pocketbase/ui/dist/assets/index.2831f276.js

383 lines
766 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.

const m_=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)}};m_();function oe(){}const ml=n=>n;function ht(n,e){for(const t in e)n[t]=e[t];return n}function Np(n){return n()}function Ba(){return Object.create(null)}function lt(n){n.forEach(Np)}function Bn(n){return typeof n=="function"}function Oe(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let El;function Jn(n,e){return El||(El=document.createElement("a")),El.href=e,n===El.href}function g_(n){return Object.keys(n).length===0}function Rp(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function cn(n,e,t){n.$$.on_destroy.push(Rp(e,t))}function $n(n,e,t,i){if(n){const s=Hp(n,e,t,i);return n[0](s)}}function Hp(n,e,t,i){return n[1]&&i?ht(t.ctx.slice(),n[1](i(e))):t.ctx}function Cn(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 Mn(n,e,t,i,s,l){if(s){const o=Hp(e,t,i,l);n.p(o,s)}}function Tn(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 si(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Wt(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 Ua(n){return n==null?"":n}function jp(n,e,t){return n.set(t),e}function tt(n){return n&&Bn(n.destroy)?n.destroy:oe}const qp=typeof window<"u";let Oo=qp?()=>window.performance.now():()=>Date.now(),ta=qp?n=>requestAnimationFrame(n):oe;const ps=new Set;function Vp(n){ps.forEach(e=>{e.c(n)||(ps.delete(e),e.f())}),ps.size!==0&&ta(Vp)}function Ao(n){let e;return ps.size===0&&ta(Vp),{promise:new Promise(t=>{ps.add(e={c:n,f:t})}),abort(){ps.delete(e)}}}function m(n,e){n.appendChild(e)}function zp(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function __(n){const e=_("style");return b_(zp(n),e),e.sheet}function b_(n,e){m(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Rn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function R(n){return document.createTextNode(n)}function T(){return R(" ")}function ot(){return R("")}function G(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Vt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Hn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Bp(n){return function(e){e.target===this&&n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ii(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]:h(n,i,e[i])}function Dt(n){return n===""?null:+n}function v_(n){return Array.from(n.childNodes)}function be(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Ce(n,e){n.value=e==null?"":e}function Wa(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function X(n,e,t){n.classList[t?"add":"remove"](e)}function Up(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const oo=new Map;let ro=0;function y_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function k_(n,e){const t={stylesheet:__(e),rules:{}};return oo.set(n,t),t}function sl(n,e,t,i,s,l,o,r=0){const a=16.666/i;let u=`{
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${y_(f)}_${r}`,d=zp(n),{stylesheet:p,rules:g}=oo.get(d)||k_(d,n);g[c]||(g[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ro+=1,c}function ll(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(", "),ro-=s,ro||w_())}function w_(){ta(()=>{ro||(oo.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),oo.clear())})}function S_(n,e,t,i){if(!e)return oe;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return oe;const{delay:l=0,duration:o=300,easing:r=ml,start:a=Oo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,g;function v(){c&&(g=sl(n,0,1,o,l,r,c)),l||(p=!0)}function b(){c&&ll(n,g),d=!1}return Ao(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),b()),!d)return!1;if(p){const S=y-a,$=0+1*r(S/o);f($,1-$)}return!0}),v(),f(0,1),b}function $_(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,Wp(n,s)}}function Wp(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 ol;function Ks(n){ol=n}function Eo(){if(!ol)throw new Error("Function called outside component initialization");return ol}function Un(n){Eo().$$.on_mount.push(n)}function C_(n){Eo().$$.after_update.push(n)}function M_(n){Eo().$$.on_destroy.push(n)}function rn(){const n=Eo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Up(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function dt(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const zs=[],ge=[],eo=[],wr=[],Yp=Promise.resolve();let Sr=!1;function Kp(){Sr||(Sr=!0,Yp.then(Zp))}function li(){return Kp(),Yp}function Tt(n){eo.push(n)}function Re(n){wr.push(n)}const Yo=new Set;let Pl=0;function Zp(){const n=ol;do{for(;Pl<zs.length;){const e=zs[Pl];Pl++,Ks(e),T_(e.$$)}for(Ks(null),zs.length=0,Pl=0;ge.length;)ge.pop()();for(let e=0;e<eo.length;e+=1){const t=eo[e];Yo.has(t)||(Yo.add(t),t())}eo.length=0}while(zs.length);for(;wr.length;)wr.pop()();Sr=!1,Yo.clear(),Ks(n)}function T_(n){if(n.fragment!==null){n.update(),lt(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let As;function na(){return As||(As=Promise.resolve(),As.then(()=>{As=null})),As}function Gi(n,e,t){n.dispatchEvent(Up(`${e?"intro":"outro"}${t}`))}const to=new Set;let ei;function Te(){ei={r:0,c:[],p:ei}}function De(){ei.r||lt(ei.c),ei=ei.p}function A(n,e){n&&n.i&&(to.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(to.has(n))return;to.add(n),ei.c.push(()=>{to.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ia={duration:0};function Jp(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&ll(n,l)}function u(){const{delay:c=0,duration:d=300,easing:p=ml,tick:g=oe,css:v}=i||ia;v&&(l=sl(n,0,1,d,c,p,v,r++)),g(0,1);const b=Oo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>Gi(n,!0,"start")),o=Ao(S=>{if(s){if(S>=y)return g(1,0),Gi(n,!0,"end"),a(),s=!1;if(S>=b){const $=p((S-b)/d);g($,1-$)}}return s})}let f=!1;return{start(){f||(f=!0,ll(n),Bn(i)?(i=i(),na().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Gp(n,e,t){let i=e(n,t),s=!0,l;const o=ei;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=ml,tick:c=oe,css:d}=i||ia;d&&(l=sl(n,1,0,u,a,f,d));const p=Oo()+a,g=p+u;Tt(()=>Gi(n,!1,"start")),Ao(v=>{if(s){if(v>=g)return c(0,1),Gi(n,!1,"end"),--o.r||lt(o.c),!1;if(v>=p){const b=f((v-p)/u);c(1-b,b)}}return s})}return Bn(i)?na().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&ll(n,l),s=!1)}}}function at(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&ll(n,a)}function f(d,p){const g=d.b-l;return p*=Math.abs(g),{a:l,b:d.b,d:g,duration:p,start:d.start,end:d.start+p,group:d.group}}function c(d){const{delay:p=0,duration:g=300,easing:v=ml,tick:b=oe,css:y}=s||ia,S={start:Oo()+p,b:d};d||(S.group=ei,ei.r+=1),o||r?r=S:(y&&(u(),a=sl(n,l,d,g,p,v,y)),d&&b(0,1),o=f(S,g),Tt(()=>Gi(n,d,"start")),Ao($=>{if(r&&$>r.start&&(o=f(r,g),r=null,Gi(n,o.b,"start"),y&&(u(),a=sl(n,l,o.b,o.duration,0,v,s.css))),o){if($>=o.end)b(l=o.b,1-l),Gi(n,o.b,"end"),r||(o.b?u():--o.group.r||lt(o.group.c)),o=null;else if($>=o.start){const C=$-o.start;l=o.a+o.d*v(C/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Bn(s)?na().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function ln(n,e){n.d(1),e.delete(n.key)}function Ft(n,e){P(n,1,1,()=>{e.delete(n.key)})}function D_(n,e){n.f(),Ft(n,e)}function ft(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,p=l.length,g=d;const v={};for(;g--;)v[n[g].key]=g;const b=[],y=new Map,S=new Map;for(g=p;g--;){const D=c(s,l,g),L=t(D);let O=o.get(L);O?i&&O.p(D,e):(O=u(L,D),O.c()),y.set(L,b[g]=O),L in v&&S.set(L,Math.abs(g-v[L]))}const $=new Set,C=new Set;function M(D){A(D,1),D.m(r,f),o.set(D.key,D),f=D.first,p--}for(;d&&p;){const D=b[p-1],L=n[d-1],O=D.key,F=L.key;D===L?(f=D.first,d--,p--):y.has(F)?!o.has(O)||$.has(O)?M(D):C.has(F)?d--:S.get(O)>S.get(F)?(C.add(O),M(D)):($.add(F),d--):(a(L,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;p;)M(b[p-1]);return b}function hn(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 oi(n){return typeof n=="object"&&n!==null?n:{}}function Ie(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function z(n){n&&n.c()}function q(n,e,t,i){const{fragment:s,on_mount:l,on_destroy:o,after_update:r}=n.$$;s&&s.m(e,t),i||Tt(()=>{const a=l.map(Np).filter(Bn);o?o.push(...a):lt(a),n.$$.on_mount=[]}),r.forEach(Tt)}function V(n,e){const t=n.$$;t.fragment!==null&&(lt(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function O_(n,e){n.$$.dirty[0]===-1&&(zs.push(n),Kp(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Ae(n,e,t,i,s,l,o,r=[-1]){const a=ol;Ks(n);const u=n.$$={fragment:null,ctx:null,props:l,update:oe,not_equal:s,bound:Ba(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Ba(),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 g=p.length?p[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&O_(n,c)),d}):[],u.update(),f=!0,lt(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=v_(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),q(n,e.target,e.anchor,e.customElement),Zp()}Ks(a)}class Ee{$destroy(){V(this,1),this.$destroy=oe}$on(e,t){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&&!g_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function tn(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 us=[];function Xp(n,e){return{subscribe:bi(n,e).subscribe}}function bi(n,e=oe){let t;const i=new Set;function s(r){if(Oe(n,r)&&(n=r,t)){const a=!us.length;for(const u of i)u[1](),us.push(u,n);if(a){for(let u=0;u<us.length;u+=2)us[u][0](us[u+1]);us.length=0}}}function l(r){s(r(n))}function o(r,a=oe){const u=[r,a];return i.add(u),i.size===1&&(t=e(s)||oe),r(n),()=>{i.delete(u),i.size===0&&(t(),t=null)}}return{set:s,update:l,subscribe:o}}function Qp(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Xp(t,o=>{let r=!1;const a=[];let u=0,f=oe;const c=()=>{if(u)return;f();const p=e(i?a[0]:a,o);l?o(p):f=Bn(p)?p:oe},d=s.map((p,g)=>Rp(p,v=>{a[g]=v,u&=~(1<<g),r&&c()},()=>{u|=1<<g}));return r=!0,c(),function(){lt(d),f()}})}function xp(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 A_(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=ht(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[7])),{c(){e&&z(e.$$.fragment),t=ot()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&4?hn(s,[oi(r[2])]):{};if(l!==(l=r[0])){if(e){Te();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(e=new l(o()),e.$on("routeEvent",r[7]),z(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&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function E_(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=ht(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[6])),{c(){e&&z(e.$$.fragment),t=ot()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&6?hn(s,[a&2&&{params:r[1]},a&4&&oi(r[2])]):{};if(l!==(l=r[0])){if(e){Te();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(e=new l(o()),e.$on("routeEvent",r[6]),z(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&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function P_(n){let e,t,i,s;const l=[E_,A_],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ot()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(Te(),P(o[f],1,1,()=>{o[f]=null}),De(),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){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function Ya(){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 Po=Xp(null,function(e){e(Ya());const t=()=>{e(Ya())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Qp(Po,n=>n.location);Qp(Po,n=>n.querystring);const Ka=bi(void 0);async function $s(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await li();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 wn(n,e){if(e=Ja(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return Za(n,e),{update(t){t=Ja(t),Za(n,t)}}}function Za(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||L_(i.currentTarget.getAttribute("href"))})}function Ja(n){return n&&typeof n=="string"?{href:n}:n||{}}function L_(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0,void 0),window.location.hash=n}function F_(n,e,t){let{routes:i={}}=e,{prefix:s=""}=e,{restoreScrollState:l=!1}=e;class o{constructor(M,D){if(!D||typeof D!="function"&&(typeof D!="object"||D._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:L,keys:O}=xp(M);this.path=M,typeof D=="object"&&D._sveltesparouter===!0?(this.component=D.component,this.conditions=D.conditions||[],this.userData=D.userData,this.props=D.props||{}):(this.component=()=>Promise.resolve(D),this.conditions=[],this.props={}),this._pattern=L,this._keys=O}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 F=M.match(s);if(F&&F[0])M=M.substr(F[0].length)||"/";else return null}}const D=this._pattern.exec(M);if(D===null)return null;if(this._keys===!1)return D;const L={};let O=0;for(;O<this._keys.length;){try{L[this._keys[O]]=decodeURIComponent(D[O+1]||"")||null}catch{L[this._keys[O]]=null}O++}return L}async checkConditions(M){for(let D=0;D<this.conditions.length;D++)if(!await this.conditions[D](M))return!1;return!0}}const r=[];i instanceof Map?i.forEach((C,M)=>{r.push(new o(M,C))}):Object.keys(i).forEach(C=>{r.push(new o(C,i[C]))});let a=null,u=null,f={};const c=rn();async function d(C,M){await li(),c(C,M)}let p=null,g=null;l&&(g=C=>{C.state&&C.state.__svelte_spa_router_scrollY?p=C.state:p=null},window.addEventListener("popstate",g),C_(()=>{p?window.scrollTo(p.__svelte_spa_router_scrollX,p.__svelte_spa_router_scrollY):window.scrollTo(0,0)}));let v=null,b=null;const y=Po.subscribe(async C=>{v=C;let M=0;for(;M<r.length;){const D=r[M].match(C.location);if(!D){M++;continue}const L={route:r[M].path,location:C.location,querystring:C.querystring,userData:r[M].userData,params:D&&typeof D=="object"&&Object.keys(D).length?D:null};if(!await r[M].checkConditions(L)){t(0,a=null),b=null,d("conditionsFailed",L);return}d("routeLoading",Object.assign({},L));const O=r[M].component;if(b!=O){O.loading?(t(0,a=O.loading),b=O,t(1,u=O.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const F=await O();if(C!=v)return;t(0,a=F&&F.default||F),b=O}D&&typeof D=="object"&&Object.keys(D).length?t(1,u=D):t(1,u=null),t(2,f=r[M].props),d("routeLoaded",Object.assign({},L,{component:a,name:a.name,params:u})).then(()=>{Ka.set(u)});return}t(0,a=null),b=null,Ka.set(void 0)});M_(()=>{y(),g&&window.removeEventListener("popstate",g)});function S(C){dt.call(this,n,C)}function $(C){dt.call(this,n,C)}return n.$$set=C=>{"routes"in C&&t(3,i=C.routes),"prefix"in C&&t(4,s=C.prefix),"restoreScrollState"in C&&t(5,l=C.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,S,$]}class I_ extends Ee{constructor(e){super(),Ae(this,e,F_,P_,Oe,{routes:3,prefix:4,restoreScrollState:5})}}const no=[];let em;function tm(n){const e=n.pattern.test(em);Ga(n,n.className,e),Ga(n,n.inactiveClassName,!e)}function Ga(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Po.subscribe(n=>{em=n.location+(n.querystring?"?"+n.querystring:""),no.map(tm)});function xn(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"?xp(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return no.push(i),tm(i),{destroy(){no.splice(no.indexOf(i),1)}}}const N_="modulepreload",R_=function(n){return"/_/"+n},Xa={},Ki=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=R_(s),s in Xa)return;Xa[s]=!0;const l=s.endsWith(".css"),o=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${o}`))return;const r=document.createElement("link");if(r.rel=l?"stylesheet":N_,l||(r.as="script",r.crossOrigin=""),r.href=s,document.head.appendChild(r),l)return new Promise((a,u)=>{r.addEventListener("load",a),r.addEventListener("error",()=>u(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>e())};var $r=function(n,e){return $r=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])},$r(n,e)};function on(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}$r(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Cr=function(){return Cr=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++)for(var s in e=arguments[t])Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s]);return n},Cr.apply(this,arguments)};function Zs(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){var f;u.done?s(u.value):(f=u.value,f instanceof t?f:new t(function(c){c(f)})).then(o,r)}a((i=i.apply(n,e||[])).next())})}function Js(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(f){if(t)throw new TypeError("Generator is already executing.");for(;o;)try{if(t=1,i&&(s=2&f[0]?i.return:f[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,f[1])).done)return s;switch(i=0,s&&(f=[2&f[0],s.value]),f[0]){case 0:case 1:s=f;break;case 4:return o.label++,{value:f[1],done:!1};case 5:o.label++,i=f[1],f=[0];continue;case 7:f=o.ops.pop(),o.trys.pop();continue;default:if(s=o.trys,!((s=s.length>0&&s[s.length-1])||f[0]!==6&&f[0]!==2)){o=0;continue}if(f[0]===3&&(!s||f[1]>s[0]&&f[1]<s[3])){o.label=f[1];break}if(f[0]===6&&o.label<s[1]){o.label=s[1],s=f;break}if(s&&o.label<s[2]){o.label=s[2],o.ops.push(f);break}s[2]&&o.ops.pop(),o.trys.pop();continue}f=e.call(n,o)}catch(c){f=[6,c],i=0}finally{t=s=0}if(5&f[0])throw f[1];return{value:f[0]?f[1]:void 0,done:!0}}([a,u])}}}var nm,Ko=function(n){function e(t){var i,s=this;return(s=n.call(this,"ClientResponseError")||this).url="",s.status=0,s.data={},s.isAbort=!1,s.originalError=null,t instanceof Error&&!(t instanceof s.constructor)&&(s.originalError=t),t!==null&&typeof t=="object"&&(s.url=typeof t.url=="string"?t.url:"",s.status=typeof t.status=="number"?t.status:0,s.data=t.data!==null&&typeof t.data=="object"?t.data:{}),typeof DOMException<"u"&&t instanceof DOMException&&(s.isAbort=!0),s.name="ClientResponseError "+s.status,s.message=((i=s.data)===null||i===void 0?void 0:i.message)||"Something went wrong while processing your request.",s}return on(e,n),e.prototype.toJSON=function(){return Cr({},this)},e}(Error);nm=typeof atob=="function"?atob:function(n){return Buffer.from(n,"base64").toString("binary")};var H_=function(){function n(){}return n.getPayload=function(e){if(e)try{var t=decodeURIComponent(nm(e.split(".")[1]).split("").map(function(i){return"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(t)||{}}catch{}return{}},n.isExpired=function(e,t){t===void 0&&(t=0);var i=n.getPayload(e);return!(Object.keys(i).length>0&&(!i.exp||i.exp-t>Date.now()/1e3))},n}(),gl=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.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||this.id==="00000000-0000-0000-0000-000000000000"},enumerable:!1,configurable:!0}),n.prototype.clone=function(){return new this.constructor(JSON.parse(JSON.stringify(this)))},n.prototype.export=function(){return Object.assign({},this)},n}(),ao=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t);for(var i=0,s=Object.entries(t);i<s.length;i++){var l=s[i],o=l[0],r=l[1];this[o]=r}this["@collectionId"]=t["@collectionId"]!==void 0?t["@collectionId"]:"",this["@collectionName"]=t["@collectionName"]!==void 0?t["@collectionName"]:"",this["@expand"]=t["@expand"]!==void 0?t["@expand"]:{}},e}(gl),uo=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.email=typeof t.email=="string"?t.email:"",this.verified=!!t.verified,this.lastResetSentAt=typeof t.lastResetSentAt=="string"?t.lastResetSentAt:"",this.lastVerificationSentAt=typeof t.lastVerificationSentAt=="string"?t.lastVerificationSentAt:"",this.profile=t.profile?new ao(t.profile):null},e}(gl),vs=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(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:"",this.lastResetSentAt=typeof t.lastResetSentAt=="string"?t.lastResetSentAt:""},e}(gl),im=function(){function n(e){e===void 0&&(e="pocketbase_auth"),this.fallback={},this.storageKey=e}return Object.defineProperty(n.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){var e,t=this._storageGet(this.storageKey)||{};return t===null||typeof t!="object"||t.model===null||typeof t.model!="object"?{}:((e=t.model)===null||e===void 0?void 0:e.verified)!==void 0?new uo(t.model):new vs(t.model)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!H_.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this._storageSet(this.storageKey,{token:e,model:t})},n.prototype.clear=function(){return this._storageRemove(this.storageKey)},n.prototype._storageGet=function(e){var t;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var i=((t=window==null?void 0:window.localStorage)===null||t===void 0?void 0:t.getItem(e))||"";try{return JSON.parse(i)}catch{return i}}return this.fallback[e]},n.prototype._storageSet=function(e,t){var i;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var s=t;typeof t!="string"&&(s=JSON.stringify(t)),(i=window==null?void 0:window.localStorage)===null||i===void 0||i.setItem(e,s)}else this.fallback[e]=t},n.prototype._storageRemove=function(e){var t;typeof window<"u"&&((t=window==null?void 0:window.localStorage)===null||t===void 0||t.removeItem(e)),delete this.fallback[e]},n}(),Lo=function(n){this.client=n},j_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(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}(Lo),sm=function(n,e,t,i){this.page=n>0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.items=i||[]},lm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype._getFullList=function(t,i,s){var l=this;i===void 0&&(i=100),s===void 0&&(s={});var o=[],r=function(a){return Zs(l,void 0,void 0,function(){return Js(this,function(u){return[2,this._getList(t,a,i,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 sm((r==null?void 0:r.page)||1,(r==null?void 0:r.perPage)||0,(r==null?void 0:r.totalItems)||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._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,l){return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:l,body:s}).then(function(){return!0})},e}(Lo),sa=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.getFullList=function(t,i){return t===void 0&&(t=100),i===void 0&&(i={}),this._getFullList(this.baseCrudPath(),t,i)},e.prototype.getList=function(t,i,s){return t===void 0&&(t=1),i===void 0&&(i=30),s===void 0&&(s={}),this._getList(this.baseCrudPath(),t,i,s)},e.prototype.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,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._delete(this.baseCrudPath(),t,i,s)},e}(lm),q_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.decode=function(t){return new vs(t)},e.prototype.baseCrudPath=function(){return"/api/admins"},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.admin)||{});return(t==null?void 0:t.token)&&(t==null?void 0:t.admin)&&this.client.AuthStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",admin:i})},e.prototype.authViaEmail=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({email:t,password:i},s),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:l,body:s,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath()+"/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(this.authResponse.bind(this))},e}(sa),V_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.decode=function(t){return new uo(t)},e.prototype.baseCrudPath=function(){return"/api/users"},e.prototype.authResponse=function(t){var i=this.decode((t==null?void 0:t.user)||{});return(t==null?void 0:t.token)&&(t==null?void 0:t.user)&&this.client.AuthStore.save(t.token,i),Object.assign({},t,{token:(t==null?void 0:t.token)||"",user:i})},e.prototype.listAuthMethods=function(t){return t===void 0&&(t={}),this.client.send(this.baseCrudPath()+"/auth-methods",{method:"GET",params:t}).then(function(i){return Object.assign({},i,{emailPassword:!!(i!=null&&i.emailPassword),authProviders:Array.isArray(i==null?void 0:i.authProviders)?i==null?void 0:i.authProviders:[]})})},e.prototype.authViaEmail=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),s=Object.assign({email:t,password:i},s),this.client.send(this.baseCrudPath()+"/auth-via-email",{method:"POST",params:l,body:s,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.authViaOAuth2=function(t,i,s,l,o,r){return o===void 0&&(o={}),r===void 0&&(r={}),o=Object.assign({provider:t,code:i,codeVerifier:s,redirectUrl:l},o),this.client.send(this.baseCrudPath()+"/auth-via-oauth2",{method:"POST",params:r,body:o,headers:{Authorization:""}}).then(this.authResponse.bind(this))},e.prototype.refresh=function(t,i){return t===void 0&&(t={}),i===void 0&&(i={}),this.client.send(this.baseCrudPath()+"/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(this.authResponse.bind(this))},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.baseCrudPath()+"/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.baseCrudPath()+"/confirm-verification",{method:"POST",params:s,body:i}).then(this.authResponse.bind(this))},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.baseCrudPath()+"/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.baseCrudPath()+"/confirm-email-change",{method:"POST",params:l,body:s}).then(this.authResponse.bind(this))},e}(sa),_n=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}(),On=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),this.name=typeof t.name=="string"?t.name:"",this.system=!!t.system,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 _n(l))}},e}(gl),z_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.decode=function(t){return new On(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e}(sa),B_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.decode=function(t){return new ao(t)},e.prototype.baseCrudPath=function(t){return"/api/collections/"+encodeURIComponent(t)+"/records"},e.prototype.getFileUrl=function(t,i,s){s===void 0&&(s={});var l=[];l.push(this.client.baseUrl.replace(/\/+$/gm,"")),l.push("api"),l.push("files"),l.push(t["@collectionId"]),l.push(t.id),l.push(i);var o=l.join("/");if(Object.keys(s).length){var r=new URLSearchParams(s);o+=(o.includes("?")?"&":"?")+r}return o},e}(function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.getFullList=function(t,i,s){return i===void 0&&(i=100),s===void 0&&(s={}),this._getFullList(this.baseCrudPath(t),i,s)},e.prototype.getList=function(t,i,s,l){return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),this._getList(this.baseCrudPath(t),i,s,l)},e.prototype.getOne=function(t,i,s){return s===void 0&&(s={}),this._getOne(this.baseCrudPath(t),i,s)},e.prototype.create=function(t,i,s){return i===void 0&&(i={}),s===void 0&&(s={}),this._create(this.baseCrudPath(t),i,s)},e.prototype.update=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),this._update(this.baseCrudPath(t),i,s,l)},e.prototype.delete=function(t,i,s,l){return s===void 0&&(s={}),l===void 0&&(l={}),this._delete(this.baseCrudPath(t),i,s,l)},e}(lm)),Mr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),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.ip=typeof t.ip=="string"?t.ip:"",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}(gl),U_=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return on(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 Mr(u))}}return new sm((l==null?void 0:l.page)||1,(l==null?void 0:l.perPage)||0,(l==null?void 0:l.totalItems)||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 Mr(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}(Lo),W_=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t}return on(e,n),e.prototype.subscribe=function(t,i){var s;return Zs(this,void 0,void 0,function(){return Js(this,function(l){switch(l.label){case 0:if(!t)throw new Error("subscription must be set.");return this.subscriptions[t]&&((s=this.eventSource)===null||s===void 0||s.removeEventListener(t,this.subscriptions[t])),this.subscriptions[t]=function(o){var r,a=o;try{r=JSON.parse(a==null?void 0:a.data)}catch{}i(r||{})},this.eventSource?[3,1]:(this.connect(),[3,3]);case 1:return this.clientId?[4,this.submitSubscriptions()]:[3,3];case 2:l.sent(),l.label=3;case 3:return[2]}})})},e.prototype.unsubscribe=function(t){var i;return Zs(this,void 0,void 0,function(){return Js(this,function(s){switch(s.label){case 0:if(t){if(!this.subscriptions[t])return[2];(i=this.eventSource)===null||i===void 0||i.removeEventListener(t,this.subscriptions[t]),delete this.subscriptions[t]}else this.removeSubscriptionListeners(),this.subscriptions={};return this.clientId?[4,this.submitSubscriptions()]:[3,2];case 1:s.sent(),s.label=2;case 2:return Object.keys(this.subscriptions).length||this.disconnect(),[2]}})})},e.prototype.submitSubscriptions=function(){return Zs(this,void 0,void 0,function(){return Js(this,function(t){return this.addSubscriptionListeners(),[2,this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:Object.keys(this.subscriptions)}}).then(function(){return!0})]})})},e.prototype.addSubscriptionListeners=function(){if(this.eventSource)for(var t in this.removeSubscriptionListeners(),this.subscriptions)this.eventSource.addEventListener(t,this.subscriptions[t])},e.prototype.removeSubscriptionListeners=function(){if(this.eventSource)for(var t in this.subscriptions)this.eventSource.removeEventListener(t,this.subscriptions[t])},e.prototype.connectHandler=function(t){var i=t;this.clientId=i==null?void 0:i.lastEventId,this.submitSubscriptions()},e.prototype.connect=function(){var t=this;this.disconnect(),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.addEventListener("PB_CONNECT",function(i){return t.connectHandler(i)})},e.prototype.disconnect=function(){var t,i,s=this;this.removeSubscriptionListeners(),(t=this.eventSource)===null||t===void 0||t.removeEventListener("PB_CONNECT",function(l){return s.connectHandler(l)}),(i=this.eventSource)===null||i===void 0||i.close(),this.eventSource=null,this.clientId=""},e}(Lo),la=function(){function n(e,t,i){e===void 0&&(e="/"),t===void 0&&(t="en-US"),this.cancelControllers={},this.baseUrl=e,this.lang=t,this.AuthStore=i||new im,this.Settings=new j_(this),this.Admins=new q_(this),this.Users=new V_(this),this.Collections=new z_(this),this.Records=new B_(this),this.Logs=new U_(this),this.Realtime=new W_(this)}return 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,c,d=this,p=Object.assign({},t);if(p.body&&p.body.constructor.name!=="FormData"&&(typeof p.body!="string"&&(p.body=JSON.stringify(p.body)),((i=p==null?void 0:p.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(p.headers=Object.assign({},p.headers,{"Content-Type":"application/json"}))),((s=p==null?void 0:p.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(p.headers=Object.assign({},p.headers,{"Accept-Language":this.lang})),((l=this.AuthStore)===null||l===void 0?void 0:l.token)&&((o=p==null?void 0:p.headers)===null||o===void 0?void 0:o.Authorization)===void 0){var g="Admin";((r=this.AuthStore.model)===null||r===void 0?void 0:r.verified)!==void 0&&(g="User"),p.headers=Object.assign({},p.headers,{Authorization:g+" "+this.AuthStore.token})}if(((a=p==null?void 0:p.params)===null||a===void 0?void 0:a.$autoCancel)!==!1){var v=((u=p==null?void 0:p.params)===null||u===void 0?void 0:u.$cancelKey)||(p.method||"GET")+e;this.cancelRequest(v);var b=new AbortController;this.cancelControllers[v]=b,p.signal=b.signal}(f=p==null?void 0:p.params)===null||f===void 0||delete f.$autoCancel,(c=p==null?void 0:p.params)===null||c===void 0||delete c.$cancelKey;var y=this.buildUrl(e);if(p.params!==void 0){var S=this.serializeQueryParams(p.params);S&&(y+=(y.includes("?")?"&":"?")+S),delete p.params}return fetch(y,Object.assign({method:"GET",mode:"cors"},p)).then(function($){return Zs(d,void 0,void 0,function(){var C;return Js(this,function(M){switch(M.label){case 0:C={},M.label=1;case 1:return M.trys.push([1,3,,4]),[4,$.json()];case 2:return C=M.sent(),[3,4];case 3:return M.sent(),[3,4];case 4:if($.status>=400)throw new Ko({url:$.url,status:$.status,data:C});return[2,C]}})})}).catch(function($){throw $ instanceof Ko?$:new Ko($)})},n.prototype.buildUrl=function(e){var t=this.baseUrl+(this.baseUrl.endsWith("/")?"":"/");return e&&(t+=e.startsWith("/")?e.substring(1):e),t},n.prototype.serializeQueryParams=function(e){var t=[];for(var i in e)if(e[i]!==null){var s=e[i],l=encodeURIComponent(i);if(Array.isArray(s))for(var o=0,r=s;o<r.length;o++){var a=r[o];t.push(l+"="+encodeURIComponent(a))}else s instanceof Date?t.push(l+"="+encodeURIComponent(s.toISOString())):typeof s!==null&&typeof s=="object"?t.push(l+"="+encodeURIComponent(JSON.stringify(s))):t.push(l+"="+encodeURIComponent(s))}return t.join("&")},n}();class ts extends Error{}class Y_ extends ts{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class K_ extends ts{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Z_ extends ts{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Bs extends ts{}class om extends ts{constructor(e){super(`Invalid unit ${e}`)}}class Fn extends ts{}class wi extends ts{constructor(){super("Zone is an abstract class")}}const je="numeric",Gn="short",Dn="long",Tr={year:je,month:je,day:je},rm={year:je,month:Gn,day:je},J_={year:je,month:Gn,day:je,weekday:Gn},am={year:je,month:Dn,day:je},um={year:je,month:Dn,day:je,weekday:Dn},fm={hour:je,minute:je},cm={hour:je,minute:je,second:je},dm={hour:je,minute:je,second:je,timeZoneName:Gn},hm={hour:je,minute:je,second:je,timeZoneName:Dn},pm={hour:je,minute:je,hourCycle:"h23"},mm={hour:je,minute:je,second:je,hourCycle:"h23"},gm={hour:je,minute:je,second:je,hourCycle:"h23",timeZoneName:Gn},_m={hour:je,minute:je,second:je,hourCycle:"h23",timeZoneName:Dn},bm={year:je,month:je,day:je,hour:je,minute:je},vm={year:je,month:je,day:je,hour:je,minute:je,second:je},ym={year:je,month:Gn,day:je,hour:je,minute:je},km={year:je,month:Gn,day:je,hour:je,minute:je,second:je},G_={year:je,month:Gn,day:je,weekday:Gn,hour:je,minute:je},wm={year:je,month:Dn,day:je,hour:je,minute:je,timeZoneName:Gn},Sm={year:je,month:Dn,day:je,hour:je,minute:je,second:je,timeZoneName:Gn},$m={year:je,month:Dn,day:je,weekday:Dn,hour:je,minute:je,timeZoneName:Dn},Cm={year:je,month:Dn,day:je,weekday:Dn,hour:je,minute:je,second:je,timeZoneName:Dn};function mt(n){return typeof n>"u"}function Xi(n){return typeof n=="number"}function Fo(n){return typeof n=="number"&&n%1===0}function X_(n){return typeof n=="string"}function Q_(n){return Object.prototype.toString.call(n)==="[object Date]"}function Mm(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function x_(n){return Array.isArray(n)?n:[n]}function Qa(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 ys(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function hi(n,e,t){return Fo(n)&&n>=e&&n<=t}function t0(n,e){return n-e*Math.floor(n/e)}function Bt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function $i(n){if(!(mt(n)||n===null||n===""))return parseInt(n,10)}function Hi(n){if(!(mt(n)||n===null||n===""))return parseFloat(n)}function oa(n){if(!(mt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function ra(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function _l(n){return n%4===0&&(n%100!==0||n%400===0)}function Gs(n){return _l(n)?366:365}function fo(n,e){const t=t0(e-1,12)+1,i=n+(e-t)/12;return t===2?_l(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function aa(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 co(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 Dr(n){return n>99?n:n>60?1900+n:2e3+n}function Tm(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 Io(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 Dm(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Fn(`Invalid unit value ${n}`);return e}function ho(n,e){const t={};for(const i in n)if(ys(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=Dm(s)}return t}function Xs(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}${Bt(t,2)}:${Bt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Bt(t,2)}${Bt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function No(n){return e0(n,["hour","minute","second","millisecond"])}const Om=/[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"],Am=["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 Em(n){switch(n){case"narrow":return[...i0];case"short":return[...Am];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 Pm=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Lm=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],s0=["M","T","W","T","F","S","S"];function Fm(n){switch(n){case"narrow":return[...s0];case"short":return[...Lm];case"long":return[...Pm];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Im=["AM","PM"],l0=["Before Christ","Anno Domini"],o0=["BC","AD"],r0=["B","A"];function Nm(n){switch(n){case"narrow":return[...r0];case"short":return[...o0];case"long":return[...l0];default:return null}}function a0(n){return Im[n.hour<12?0:1]}function u0(n,e){return Fm(e)[n.weekday-1]}function f0(n,e){return Em(e)[n.month-1]}function c0(n,e){return Nm(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 xa(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const h0={D:Tr,DD:rm,DDD:am,DDDD:um,t:fm,tt:cm,ttt:dm,tttt:hm,T:pm,TT:mm,TTT:gm,TTTT:_m,f:bm,ff:ym,fff:wm,ffff:$m,F:vm,FF:km,FFF:Sm,FFFF:Cm};class gn{static create(e,t={}){return new gn(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 h0[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 Bt(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,g)=>this.loc.extract(e,p,g),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,g)=>i?f0(e,p):l(g?{month:p}:{month:p,day:"numeric"},"month"),u=(p,g)=>i?u0(e,p):l(g?{weekday:p}:{weekday:p,month:"long",day:"numeric"},"weekday"),f=p=>{const g=gn.macroTokenToFormatOpts(p);return g?this.formatWithSystemDefault(e,g):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 xa(gn.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=gn.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 xa(l,s(r))}}class Kn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class bl{get type(){throw new wi}get name(){throw new wi}get ianaName(){return this.name}get isUniversal(){throw new wi}offsetName(e,t){throw new wi}formatOffset(e,t){throw new wi}offset(e){throw new wi}equals(e){throw new wi}get isValid(){throw new wi}}let Zo=null;class ua extends bl{static get instance(){return Zo===null&&(Zo=new ua),Zo}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Tm(e,t,i)}formatOffset(e,t){return Xs(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let io={};function p0(n){return io[n]||(io[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"})),io[n]}const m0={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function g0(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 _0(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=m0[l];l==="era"?i[r]=o:mt(r)||(i[r]=parseInt(o,10))}return i}let Ll={};class mi extends bl{static create(e){return Ll[e]||(Ll[e]=new mi(e)),Ll[e]}static resetCache(){Ll={},io={}}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=mi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return Tm(e,t,i,this.name)}formatOffset(e,t){return Xs(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const i=p0(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?_0(i,t):g0(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=aa({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let p=+t;const g=p%1e3;return p-=g>=0?g:1e3+g,(d-p)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let Jo=null;class fn extends bl{static get utcInstance(){return Jo===null&&(Jo=new fn(0)),Jo}static instance(e){return e===0?fn.utcInstance:new fn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new fn(Io(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Xs(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Xs(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return Xs(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 bl{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 Ci(n,e){if(mt(n)||n===null)return e;if(n instanceof bl)return n;if(X_(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?fn.utcInstance:fn.parseSpecifier(t)||mi.create(n)}else return Xi(n)?fn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new b0(n)}let eu=()=>Date.now(),tu="system",nu=null,iu=null,su=null,lu;class Kt{static get now(){return eu}static set now(e){eu=e}static set defaultZone(e){tu=e}static get defaultZone(){return Ci(tu,ua.instance)}static get defaultLocale(){return nu}static set defaultLocale(e){nu=e}static get defaultNumberingSystem(){return iu}static set defaultNumberingSystem(e){iu=e}static get defaultOutputCalendar(){return su}static set defaultOutputCalendar(e){su=e}static get throwOnInvalid(){return lu}static set throwOnInvalid(e){lu=e}static resetCaches(){It.resetCache(),mi.resetCache()}}let ou={};function v0(n,e={}){const t=JSON.stringify([n,e]);let i=ou[t];return i||(i=new Intl.ListFormat(n,e),ou[t]=i),i}let Or={};function Ar(n,e={}){const t=JSON.stringify([n,e]);let i=Or[t];return i||(i=new Intl.DateTimeFormat(n,e),Or[t]=i),i}let Er={};function y0(n,e={}){const t=JSON.stringify([n,e]);let i=Er[t];return i||(i=new Intl.NumberFormat(n,e),Er[t]=i),i}let Pr={};function k0(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=Pr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),Pr[s]=l),l}let Us=null;function w0(){return Us||(Us=new Intl.DateTimeFormat().resolvedOptions().locale,Us)}function S0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Ar(n).resolvedOptions()}catch{t=Ar(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function $0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function C0(n){const e=[];for(let t=1;t<=12;t++){const i=et.utc(2016,t,1);e.push(n(i))}return e}function M0(n){const e=[];for(let t=1;t<=7;t++){const i=et.utc(2016,11,13+t);e.push(n(i))}return e}function Fl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function T0(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 D0{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):ra(e,3);return Bt(t,this.padTo)}}}class O0{constructor(e,t,i){this.opts=i;let s;if(e.zone.isUniversal){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&mi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:et.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=Ar(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class A0{constructor(e,t,i){this.opts={style:"long",...i},!t&&Mm()&&(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 It{static fromOpts(e){return It.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Kt.defaultLocale,o=l||(s?"en-US":w0()),r=t||Kt.defaultNumberingSystem,a=i||Kt.defaultOutputCalendar;return new It(o,r,a,l)}static resetCache(){Us=null,Or={},Er={},Pr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return It.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=$0(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=T0(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:It.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 Fl(this,e,i,Em,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=C0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Fl(this,e,i,Fm,()=>{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]=M0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Fl(this,void 0,e,()=>Im,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[et.utc(2016,11,13,9),et.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Fl(this,e,t,Nm,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[et.utc(-40,1,1),et.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 D0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new O0(e,this.intl,t)}relFormatter(e={}){return new A0(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 Cs(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Ms(...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 Ts(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 Rm(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=$i(e[t+s]);return[i,null,t+s]}}const Hm=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,E0=`(?:${Hm.source}?(?:\\[(${Om.source})\\])?)?`,fa=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,jm=RegExp(`${fa.source}${E0}`),ca=RegExp(`(?:T${jm.source})?`),P0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,L0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,F0=/(\d{4})-?(\d{3})/,I0=Rm("weekYear","weekNumber","weekDay"),N0=Rm("year","ordinal"),R0=/(\d{4})-(\d\d)-(\d\d)/,qm=RegExp(`${fa.source} ?(?:${Hm.source}|(${Om.source}))?`),H0=RegExp(`(?: ${qm.source})?`);function ms(n,e,t){const i=n[e];return mt(i)?t:$i(i)}function j0(n,e){return[{year:ms(n,e),month:ms(n,e+1,1),day:ms(n,e+2,1)},null,e+3]}function Ds(n,e){return[{hours:ms(n,e,0),minutes:ms(n,e+1,0),seconds:ms(n,e+2,0),milliseconds:oa(n[e+3])},null,e+4]}function vl(n,e){const t=!n[e]&&!n[e+1],i=Io(n[e+1],n[e+2]),s=t?null:fn.instance(i);return[{},s,e+3]}function yl(n,e){const t=n[e]?mi.create(n[e]):null;return[{},t,e+1]}const q0=RegExp(`^T?${fa.source}$`),V0=/^-?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,g=!1)=>p!==void 0&&(g||p&&f)?-p:p;return[{years:d(Hi(t)),months:d(Hi(i)),weeks:d(Hi(s)),days:d(Hi(l)),hours:d(Hi(o)),minutes:d(Hi(r)),seconds:d(Hi(a),a==="-0"),milliseconds:d(oa(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 da(n,e,t,i,s,l,o){const r={year:e.length===2?Dr($i(e)):$i(e),month:Am.indexOf(t)+1,day:$i(i),hour:$i(s),minute:$i(l)};return o&&(r.second=$i(o)),n&&(r.weekday=n.length>3?Pm.indexOf(n)+1:Lm.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=da(e,s,i,t,l,o,r);let p;return a?p=B0[a]:u?p=0:p=Io(f,c),[d,new fn(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$/,Z0=/^(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$/,J0=/^(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 ru(n){const[,e,t,i,s,l,o,r]=n;return[da(e,s,i,t,l,o,r),fn.utcInstance]}function G0(n){const[,e,t,i,s,l,o,r]=n;return[da(e,r,t,i,s,l,o),fn.utcInstance]}const X0=Cs(P0,ca),Q0=Cs(L0,ca),x0=Cs(F0,ca),e1=Cs(jm),Vm=Ms(j0,Ds,vl,yl),t1=Ms(I0,Ds,vl,yl),n1=Ms(N0,Ds,vl,yl),i1=Ms(Ds,vl,yl);function s1(n){return Ts(n,[X0,Vm],[Q0,t1],[x0,n1],[e1,i1])}function l1(n){return Ts(Y0(n),[U0,W0])}function o1(n){return Ts(n,[K0,ru],[Z0,ru],[J0,G0])}function r1(n){return Ts(n,[V0,z0])}const a1=Ms(Ds);function u1(n){return Ts(n,[q0,a1])}const f1=Cs(R0,H0),c1=Cs(qm),d1=Ms(Ds,vl,yl);function h1(n){return Ts(n,[f1,Vm],[c1,d1])}const p1="Invalid Duration",zm={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}},m1={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},...zm},An=146097/400,fs=146097/4800,g1={years:{quarters:4,months:12,weeks:An/7,days:An,hours:An*24,minutes:An*24*60,seconds:An*24*60*60,milliseconds:An*24*60*60*1e3},quarters:{months:3,weeks:An/28,days:An/4,hours:An*24/4,minutes:An*24*60/4,seconds:An*24*60*60/4,milliseconds:An*24*60*60*1e3/4},months:{weeks:fs/7,days:fs,hours:fs*24,minutes:fs*24*60,seconds:fs*24*60*60,milliseconds:fs*24*60*60*1e3},...zm},Ui=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],_1=Ui.slice(0).reverse();function ji(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 vt(i)}function b1(n){return n<0?Math.floor(n):Math.ceil(n)}function Bm(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?b1(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function v1(n,e){_1.reduce((t,i)=>mt(e[i])?t:(t&&Bm(n,e,t,e,i),i),null)}class vt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||It.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?g1:m1,this.isLuxonDuration=!0}static fromMillis(e,t){return vt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Fn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new vt({values:ho(e,vt.normalizeUnit),loc:It.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(Xi(e))return vt.fromMillis(e);if(vt.isDuration(e))return e;if(typeof e=="object")return vt.fromObject(e);throw new Fn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=r1(e);return i?vt.fromObject(i,t):vt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=u1(e);return i?vt.fromObject(i,t):vt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Fn("need to specify a reason the Duration is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Kt.throwOnInvalid)throw new Z_(i);return new vt({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 om(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?gn.create(this.loc,i).formatDurationFromString(this,e):p1}toHuman(e={}){const t=Ui.map(i=>{const s=this.values[i];return mt(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+=ra(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=vt.fromDurationLike(e),i={};for(const s of Ui)(ys(t.values,s)||ys(this.values,s))&&(i[s]=t.get(s)+this.get(s));return ji(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=vt.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]=Dm(e(this.values[i],i));return ji(this,{values:t},!0)}get(e){return this[vt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...ho(e,vt.normalizeUnit)};return ji(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),ji(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return v1(this.matrix,e),ji(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>vt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Ui)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)Ui.indexOf(u)>Ui.indexOf(o)&&Bm(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 ji(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 ji(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 Ui)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Es="Invalid Interval";function y1(n,e){return!n||!n.isValid?Nt.invalid("missing or invalid start"):!e||!e.isValid?Nt.invalid("missing or invalid end"):e<n?Nt.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 Nt{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 Fn("need to specify a reason the Interval is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Kt.throwOnInvalid)throw new K_(i);return new Nt({invalid:i})}static fromDateTimes(e,t){const i=Fs(e),s=Fs(t),l=y1(i,s);return l==null?new Nt({start:i,end:s}):l}static after(e,t){const i=vt.fromDurationLike(t),s=Fs(e);return Nt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=vt.fromDurationLike(t),s=Fs(e);return Nt.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=et.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=et.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return Nt.fromDateTimes(l,r);if(o){const u=vt.fromISO(s,t);if(u.isValid)return Nt.after(l,u)}else if(a){const u=vt.fromISO(i,t);if(u.isValid)return Nt.before(r,u)}}return Nt.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?Nt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Fs).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(Nt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=vt.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(Nt.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:Nt.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 Nt.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(Nt.fromDateTimes(t,a.time)),t=null);return Nt.merge(s)}difference(...e){return Nt.xor([this].concat(e)).map(t=>this.intersection(t)).filter(t=>t&&!t.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Es}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Es}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Es}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Es}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Es}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):vt.invalid(this.invalidReason)}mapEndpoints(e){return Nt.fromDateTimes(e(this.s),e(this.e))}}class Il{static hasDST(e=Kt.defaultZone){const t=et.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return Ci(e,Kt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||It.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||It.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||It.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||It.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return It.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return It.create(t,null,"gregory").eras(e)}static features(){return{relative:Mm()}}}function au(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(vt.fromMillis(i).as("days"))}function k1(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=au(r,a);return(u-u%7)/7}],["days",au]],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 w1(n,e,t,i){let[s,l,o,r]=k1(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=vt.fromObject(l,i);return u.length>0?vt.fromMillis(a,i).shiftTo(...u).plus(f):f}const ha={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},uu={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]},S1=ha.hanidec.replace(/[\[|\]]/g,"").split("");function $1(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(ha.hanidec)!==-1)e+=S1.indexOf(n[t]);else for(const s in uu){const[l,o]=uu[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Wn({numberingSystem:n},e=""){return new RegExp(`${ha[n||"latn"]}${e}`)}const C1="missing Intl.DateTimeFormat.formatToParts support";function kt(n,e=t=>t){return{regex:n,deser:([t])=>e($1(t))}}const M1=String.fromCharCode(160),Um=`[ ${M1}]`,Wm=new RegExp(Um,"g");function T1(n){return n.replace(/\./g,"\\.?").replace(Wm,Um)}function fu(n){return n.replace(/\./g,"").replace(Wm," ").toLowerCase()}function Yn(n,e){return n===null?null:{regex:RegExp(n.map(T1).join("|")),deser:([t])=>n.findIndex(i=>fu(t)===fu(i))+e}}function cu(n,e){return{regex:n,deser:([,t,i])=>Io(t,i),groups:e}}function Go(n){return{regex:n,deser:([e])=>e}}function D1(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function O1(n,e){const t=Wn(e),i=Wn(e,"{2}"),s=Wn(e,"{3}"),l=Wn(e,"{4}"),o=Wn(e,"{6}"),r=Wn(e,"{1,2}"),a=Wn(e,"{1,3}"),u=Wn(e,"{1,6}"),f=Wn(e,"{1,9}"),c=Wn(e,"{2,4}"),d=Wn(e,"{4,6}"),p=b=>({regex:RegExp(D1(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return p(b);switch(b.val){case"G":return Yn(e.eras("short",!1),0);case"GG":return Yn(e.eras("long",!1),0);case"y":return kt(u);case"yy":return kt(c,Dr);case"yyyy":return kt(l);case"yyyyy":return kt(d);case"yyyyyy":return kt(o);case"M":return kt(r);case"MM":return kt(i);case"MMM":return Yn(e.months("short",!0,!1),1);case"MMMM":return Yn(e.months("long",!0,!1),1);case"L":return kt(r);case"LL":return kt(i);case"LLL":return Yn(e.months("short",!1,!1),1);case"LLLL":return Yn(e.months("long",!1,!1),1);case"d":return kt(r);case"dd":return kt(i);case"o":return kt(a);case"ooo":return kt(s);case"HH":return kt(i);case"H":return kt(r);case"hh":return kt(i);case"h":return kt(r);case"mm":return kt(i);case"m":return kt(r);case"q":return kt(r);case"qq":return kt(i);case"s":return kt(r);case"ss":return kt(i);case"S":return kt(a);case"SSS":return kt(s);case"u":return Go(f);case"uu":return Go(r);case"uuu":return kt(t);case"a":return Yn(e.meridiems(),0);case"kkkk":return kt(l);case"kk":return kt(c,Dr);case"W":return kt(r);case"WW":return kt(i);case"E":case"c":return kt(t);case"EEE":return Yn(e.weekdays("short",!1,!1),1);case"EEEE":return Yn(e.weekdays("long",!1,!1),1);case"ccc":return Yn(e.weekdays("short",!0,!1),1);case"cccc":return Yn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return cu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return cu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Go(/[a-z_+-/]{1,256}?/i);default:return p(b)}})(n)||{invalidReason:C1};return v.token=n,v}const A1={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 E1(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=A1[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function P1(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function L1(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(ys(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 F1(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 mt(n.z)||(t=mi.create(n.z)),mt(n.Z)||(t||(t=new fn(n.Z)),i=n.Z),mt(n.q)||(n.M=(n.q-1)*3+1),mt(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),mt(n.u)||(n.S=oa(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let Xo=null;function I1(){return Xo||(Xo=et.fromMillis(1555555555555)),Xo}function N1(n,e){if(n.literal)return n;const t=gn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=gn.create(e,t).formatDateTimeParts(I1()).map(o=>E1(o,e,t));return l.includes(void 0)?n:l}function R1(n,e){return Array.prototype.concat(...n.map(t=>N1(t,e)))}function Ym(n,e,t){const i=R1(gn.parseFormat(t),n),s=i.map(o=>O1(o,n)),l=s.find(o=>o.invalidReason);if(l)return{input:e,tokens:i,invalidReason:l.invalidReason};{const[o,r]=P1(s),a=RegExp(o,"i"),[u,f]=L1(e,a,r),[c,d,p]=f?F1(f):[null,null,void 0];if(ys(f,"a")&&ys(f,"H"))throw new Bs("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 H1(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=Ym(n,e,t);return[i,s,l,o]}const Km=[0,31,59,90,120,151,181,212,243,273,304,334],Zm=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new Kn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Jm(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 Gm(n,e,t){return t+(_l(n)?Zm:Km)[e-1]}function Xm(n,e){const t=_l(n)?Zm:Km,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function Lr(n){const{year:e,month:t,day:i}=n,s=Gm(e,t,i),l=Jm(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=co(r)):o>co(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...No(n)}}function du(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Jm(e,1,4),l=Gs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=Gs(r)):o>l?(r=e+1,o-=Gs(e)):r=e;const{month:a,day:u}=Xm(r,o);return{year:r,month:a,day:u,...No(n)}}function Qo(n){const{year:e,month:t,day:i}=n,s=Gm(e,t,i);return{year:e,ordinal:s,...No(n)}}function hu(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Xm(e,t);return{year:e,month:i,day:s,...No(n)}}function j1(n){const e=Fo(n.weekYear),t=hi(n.weekNumber,1,co(n.weekYear)),i=hi(n.weekday,1,7);return e?t?i?!1:Nn("weekday",n.weekday):Nn("week",n.week):Nn("weekYear",n.weekYear)}function q1(n){const e=Fo(n.year),t=hi(n.ordinal,1,Gs(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function Qm(n){const e=Fo(n.year),t=hi(n.month,1,12),i=hi(n.day,1,fo(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function xm(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=hi(e,0,23)||e===24&&t===0&&i===0&&s===0,o=hi(t,0,59),r=hi(i,0,59),a=hi(s,0,999);return l?o?r?a?!1:Nn("millisecond",s):Nn("second",i):Nn("minute",t):Nn("hour",e)}const xo="Invalid DateTime",pu=864e13;function Nl(n){return new Kn("unsupported zone",`the zone "${n.name}" is not supported`)}function er(n){return n.weekData===null&&(n.weekData=Lr(n.c)),n.weekData}function Ps(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new et({...t,...e,old:t})}function eg(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 mu(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 so(n,e,t){return eg(aa(n),e,t)}function gu(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,fo(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=vt.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=aa(l);let[a,u]=eg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Ls(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=et.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return et.invalid(new Kn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function Rl(n,e,t=!0){return n.isValid?gn.create(It.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function tr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Bt(n.c.year,t?6:4),e?(i+="-",i+=Bt(n.c.month),i+="-",i+=Bt(n.c.day)):(i+=Bt(n.c.month),i+=Bt(n.c.day)),i}function _u(n,e,t,i,s,l){let o=Bt(n.c.hour);return e?(o+=":",o+=Bt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Bt(n.c.minute),(n.c.second!==0||!t)&&(o+=Bt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Bt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Bt(Math.trunc(-n.o/60)),o+=":",o+=Bt(Math.trunc(-n.o%60))):(o+="+",o+=Bt(Math.trunc(n.o/60)),o+=":",o+=Bt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const tg={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},V1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},z1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},ng=["year","month","day","hour","minute","second","millisecond"],B1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],U1=["year","ordinal","hour","minute","second","millisecond"];function bu(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 om(n);return e}function vu(n,e){const t=Ci(e.zone,Kt.defaultZone),i=It.fromObject(e),s=Kt.now();let l,o;if(mt(n.year))l=s;else{for(const u of ng)mt(n[u])&&(n[u]=tg[u]);const r=Qm(n)||xm(n);if(r)return et.invalid(r);const a=t.offset(s);[l,o]=so(n,a,t)}return new et({ts:l,zone:t,loc:i,o})}function yu(n,e,t){const i=mt(t.round)?!0:t.round,s=(o,r)=>(o=ra(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 ku(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 et{constructor(e){const t=e.zone||Kt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Kn("invalid input"):null)||(t.isValid?null:Nl(t));this.ts=mt(e.ts)?Kt.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=mu(this.ts,r),i=Number.isNaN(s.year)?new Kn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||It.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new et({})}static local(){const[e,t]=ku(arguments),[i,s,l,o,r,a,u]=t;return vu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=ku(arguments),[i,s,l,o,r,a,u]=t;return e.zone=fn.utcInstance,vu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Q_(e)?e.valueOf():NaN;if(Number.isNaN(i))return et.invalid("invalid input");const s=Ci(t.zone,Kt.defaultZone);return s.isValid?new et({ts:i,zone:s,loc:It.fromObject(t)}):et.invalid(Nl(s))}static fromMillis(e,t={}){if(Xi(e))return e<-pu||e>pu?et.invalid("Timestamp out of range"):new et({ts:e,zone:Ci(t.zone,Kt.defaultZone),loc:It.fromObject(t)});throw new Fn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Xi(e))return new et({ts:e*1e3,zone:Ci(t.zone,Kt.defaultZone),loc:It.fromObject(t)});throw new Fn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Ci(t.zone,Kt.defaultZone);if(!i.isValid)return et.invalid(Nl(i));const s=Kt.now(),l=mt(t.specificOffset)?i.offset(s):t.specificOffset,o=ho(e,bu),r=!mt(o.ordinal),a=!mt(o.year),u=!mt(o.month)||!mt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=It.fromObject(t);if((f||r)&&c)throw new Bs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Bs("Can't mix ordinal dates with month/day");const p=c||o.weekday&&!f;let g,v,b=mu(s,l);p?(g=B1,v=V1,b=Lr(b)):r?(g=U1,v=z1,b=Qo(b)):(g=ng,v=tg);let y=!1;for(const O of g){const F=o[O];mt(F)?y?o[O]=v[O]:o[O]=b[O]:y=!0}const S=p?j1(o):r?q1(o):Qm(o),$=S||xm(o);if($)return et.invalid($);const C=p?du(o):r?hu(o):o,[M,D]=so(C,l,i),L=new et({ts:M,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==L.weekday?et.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${L.toISO()}`):L}static fromISO(e,t={}){const[i,s]=s1(e);return Ls(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=l1(e);return Ls(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=o1(e);return Ls(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(mt(e)||mt(t))throw new Fn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=It.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=H1(o,e,t);return f?et.invalid(f):Ls(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return et.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=h1(e);return Ls(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Fn("need to specify a reason the DateTime is invalid");const i=e instanceof Kn?e:new Kn(e,t);if(Kt.throwOnInvalid)throw new Y_(i);return new et({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?er(this).weekYear:NaN}get weekNumber(){return this.isValid?er(this).weekNumber:NaN}get weekday(){return this.isValid?er(this).weekday:NaN}get ordinal(){return this.isValid?Qo(this.c).ordinal:NaN}get monthShort(){return this.isValid?Il.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Il.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Il.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Il.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return _l(this.year)}get daysInMonth(){return fo(this.year,this.month)}get daysInYear(){return this.isValid?Gs(this.year):NaN}get weeksInWeekYear(){return this.isValid?co(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(fn.instance(e),t)}toLocal(){return this.setZone(Kt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Ci(e,Kt.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]=so(o,l,e)}return Ps(this,{ts:s,zone:e})}else return et.invalid(Nl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ps(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ho(e,bu),i=!mt(t.weekYear)||!mt(t.weekNumber)||!mt(t.weekday),s=!mt(t.ordinal),l=!mt(t.year),o=!mt(t.month)||!mt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Bs("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Bs("Can't mix ordinal dates with month/day");let u;i?u=du({...Lr(this.c),...t}):mt(t.ordinal)?(u={...this.toObject(),...t},mt(t.day)&&(u.day=Math.min(fo(u.year,u.month),u.day))):u=hu({...Qo(this.c),...t});const[f,c]=so(u,this.o,this.zone);return Ps(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=vt.fromDurationLike(e);return Ps(this,gu(this,t))}minus(e){if(!this.isValid)return this;const t=vt.fromDurationLike(e).negate();return Ps(this,gu(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=vt.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?gn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):xo}toLocaleString(e=Tr,t={}){return this.isValid?gn.create(this.loc.clone(t),e).formatDateTime(this):xo}toLocaleParts(e={}){return this.isValid?gn.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=tr(this,o);return r+="T",r+=_u(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?tr(this,e==="extended"):null}toISOWeekDate(){return Rl(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":"")+_u(this,o==="extended",t,e,i,l):null}toRFC2822(){return Rl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Rl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?tr(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")),Rl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():xo}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 vt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=x_(t).map(vt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=w1(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(et.now(),e,t)}until(e){return this.isValid?Nt.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||et.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),yu(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?yu(e.base||et.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(et.isDateTime))throw new Fn("min requires all arguments be DateTimes");return Qa(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(et.isDateTime))throw new Fn("max requires all arguments be DateTimes");return Qa(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=It.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return Ym(o,e,t)}static fromStringExplain(e,t,i={}){return et.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Tr}static get DATE_MED(){return rm}static get DATE_MED_WITH_WEEKDAY(){return J_}static get DATE_FULL(){return am}static get DATE_HUGE(){return um}static get TIME_SIMPLE(){return fm}static get TIME_WITH_SECONDS(){return cm}static get TIME_WITH_SHORT_OFFSET(){return dm}static get TIME_WITH_LONG_OFFSET(){return hm}static get TIME_24_SIMPLE(){return pm}static get TIME_24_WITH_SECONDS(){return mm}static get TIME_24_WITH_SHORT_OFFSET(){return gm}static get TIME_24_WITH_LONG_OFFSET(){return _m}static get DATETIME_SHORT(){return bm}static get DATETIME_SHORT_WITH_SECONDS(){return vm}static get DATETIME_MED(){return ym}static get DATETIME_MED_WITH_SECONDS(){return km}static get DATETIME_MED_WITH_WEEKDAY(){return G_}static get DATETIME_FULL(){return wm}static get DATETIME_FULL_WITH_SECONDS(){return Sm}static get DATETIME_HUGE(){return $m}static get DATETIME_HUGE_WITH_SECONDS(){return Cm}}function Fs(n){if(et.isDateTime(n))return n;if(n&&n.valueOf&&Xi(n.valueOf()))return et.fromJSDate(n);if(n&&typeof n=="object")return et.fromObject(n);throw new Fn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}class W{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static isEmpty(e){return e===""||e===null||e==="00000000-0000-0000-0000-000000000000"||e==="0001-01-01T00:00:00Z"||e==="0001-01-01"||typeof e>"u"||Array.isArray(e)&&e.length===0||W.isObject(e)&&Object.keys(e).length===0}static isInput(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return t==="input"||t==="select"||t==="textarea"||e.isContentEditable}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return W.isInput(e)||t==="button"||t==="a"||t==="details"||e.tabIndex>=0}static hasNonEmptyProps(e){for(let t in e)if(!W.isEmpty(e[t]))return!0;return!1}static isObjectArrayWithKeys(e,t){if(!Array.isArray(e)||typeof e[0]!="object")return!1;if(e.length==0)return!0;let i=W.toArray(t);for(let s of i)if(!(s in e[0]))return!1;return!0}static toArray(e,t=!1){return Array.isArray(e)?e:(t||!W.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){W.inArray(e,t)||e.push(t)}static findByKey(e,t,i){for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){let 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"){const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=W.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=t.split(s);for(const r of o){if(!W.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!W.isObject(e)&&!Array.isArray(e)){console.warn("setByPath: data not an object or array.");return}let l=e,o=t.split(s),r=o.pop();for(const a of o)(!W.isObject(l)&&!Array.isArray(l)||!W.isObject(l[a])&&!Array.isArray(l[a]))&&(l[a]={}),l=l[a];l[r]=i}static deleteByPath(e,t,i="."){let s=e||{},l=t.split(i),o=l.pop();for(const r of l)(!W.isObject(s)&&!Array.isArray(s)||!W.isObject(s[r])&&!Array.isArray(s[r]))&&(s[r]={}),s=s[r];Array.isArray(s)?s.splice(o,1):W.isObject(s)&&delete s[o],l.length>0&&(Array.isArray(s)&&!s.length||W.isObject(s)&&!Object.keys(s).length)&&(Array.isArray(e)&&e.length>0||W.isObject(e)&&Object.keys(e).length>0)&&W.deleteByPath(e,l.join(i),i)}static randomString(e){e=e||10;let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let s=0;s<e;s++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static 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(),W.isEmpty(l)||s.push(l);return s}static joinNonEmpty(e,t=", "){const i=[];for(let s of e)s=typeof s=="string"?s.trim():"",W.isEmpty(s)||i.push(s);return i.join(t)}static getDateTime(e){if(typeof e=="string"){const t="yyyy-MM-dd HH:mm:ss",i="yyyy-MM-dd HH:mm:ss.SSS",s=e.length===i.length?i:t;return et.fromFormat(e,s,{zone:"UTC"})}return et.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return W.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return W.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static openInWindow(e,t,i,s){t=t||1024,i=i||768,s=s||"popup";let l=window.innerWidth,o=window.innerHeight;t=t>l?l:t,i=i>o?o:i;let r=l/2-t/2,a=o/2-i/2;return window.open(e,s,"width="+t+",height="+i+",top="+a+",left="+r+",resizable,menubar=no")}static getQueryString(e){let t=e.indexOf("?");if(t<0)return"";let i=e.indexOf("#");return e.substring(t+1,i>t?i:e.length)}static getQueryParams(e){let t={},i=W.getQueryString(e).split("&");for(let s in i){let l=i[s].split("=");if(l.length===2){let o=decodeURIComponent(l[1]);if(o.startsWith("{")||o.startsWith("["))try{o=JSON.parse(o)}catch{}t[decodeURIComponent(l[0])]=o}}return t}static setQueryParams(e,t,i=!0){let s=W.getQueryString(e),l=i&&s?W.getQueryParams(e):{},o=Object.assign(l,t),r="";for(let a in o)W.isEmpty(o[a])||(r&&(r+="&"),r+=encodeURIComponent(a)+"=",W.isObject(o[a])?r+=encodeURIComponent(JSON.stringify(o[a])):r+=encodeURIComponent(o[a]));return r=r?"?"+r:"",W.isEmpty(s)?e+r:e.replace("?"+s,r)}static replaceClientQueryParams(e){let t=W.setQueryParams(window.location.href,e);window.location.replace(t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return/\.jpg|\.jpeg|\.png|\.svg|\.webp|\.avif$/.test(e)}static checkImageUrl(e){return new Promise((t,i)=>{const s=new Image;s.onload=function(){return t(!0)},s.onerror=function(l){return i(l)},s.src=e})}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 setDocumentTitle(e,t="PocketBase"){let i=[];W.isEmpty(e)||i.push(e.trim()),W.isEmpty(t)||i.push(t.trim()),document.title=i.join(" - ")}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(W.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const s of i)W.addValueToFormData(e,t,s);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):W.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static dummyCollectionRecord(e){var s,l,o,r,a;const t=(e==null?void 0:e.schema)||[],i={"@collectionId":e==null?void 0:e.id,"@collectionName":e==null?void 0:e.name,id:"RECORD_ID",created:"2022-01-01 01:00:00",updated:"2022-01-01 23:59:59"};for(const u of t){let f=null;u.type==="number"?f=123:u.type==="date"?f="2022-01-01 10:00:00":u.type==="bool"?f=!0:u.type==="email"?f="test@example.com":u.type==="url"?f="https://example.com":u.type==="json"?f="JSON (array/object)":u.type==="file"?(f="filename.jpg",((s=u.options)==null?void 0:s.maxSelect)>1&&(f=[f])):u.type==="select"?(f=(o=(l=u.options)==null?void 0:l.values)==null?void 0:o[0],((r=u.options)==null?void 0:r.maxSelect)>1&&(f=[f])):u.type==="relation"||u.type==="user"?(f="RELATION_RECORD_ID",((a=u.options)==null?void 0:a.maxSelect)>1&&(f=[f])):f="test",i[u.name]=f}return i}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"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=e||{},e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":case"user":return((t=e.options)==null?void 0:t.maxSelect)>1?"Array<String>":"String";default:return"String"}}}const pa=bi([]);function dn(n,e=3e3){return sg(n,"success",e)}function ig(n,e=4500){return sg(n,"error",e)}function sg(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{lg(i)},t)};pa.update(s=>(og(s,i.message),W.pushOrReplaceByKey(s,i,"message"),s))}function lg(n){pa.update(e=>(og(e,n),e))}function og(n,e){let t;typeof e=="string"?t=W.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),W.removeByKey(n,"message",t.message))}const ns=bi({});function Li(n){ns.set(n||{})}function rg(n){ns.update(e=>(W.deleteByPath(e,n),e))}const ma=bi({});function Fr(n){ma.set(n||{})}la.prototype.logout=function(n=!0){this.AuthStore.clear(),n&&$s("/login")};la.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&&ig(l)}if(W.isEmpty(s.data)||Li(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),$s("/")};class W1 extends im{save(e,t){super.save(e,t),t instanceof vs&&Fr(t)}clear(){super.clear(),Fr(null)}}const Se=new la("/","en-US",new W1("pb_admin_auth"));Se.AuthStore.model instanceof vs&&Fr(Se.AuthStore.model);function wu(n){let e,t,i;return{c(){e=_("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=T(),i=_("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function Y1(n){let e,t,i,s,l,o,r,a,u=!n[0]&&wu();const f=n[2].default,c=$n(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),u&&u.c(),l=T(),c&&c.c(),o=T(),r=_("div"),h(t,"class","flex-fill"),h(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),h(r,"class","flex-fill"),h(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),u&&u.m(s,null),m(s,l),c&&c.m(s,null),m(e,o),m(e,r),a=!0},p(d,[p]){d[0]?u&&(u.d(1),u=null):u||(u=wu(),u.c(),u.m(s,l)),c&&c.p&&(!a||p&2)&&Mn(c,f,d,d[1],a?Cn(f,d[1],p,null):Tn(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){P(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function K1(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(1,s=o.$$scope)},[l,s,i]}class ag extends Ee{constructor(e){super(),Ae(this,e,K1,Y1,Oe,{nobranding:0})}}function Su(n,e,t){const i=n.slice();return i[11]=e[t],i}const Z1=n=>({}),$u=n=>({uniqueId:n[3]});function J1(n){let e=(n[11]||po)+"",t;return{c(){t=R(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||po)+"")&&be(t,e)},d(i){i&&k(t)}}}function G1(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||po)+"",t;return{c(){t=R(e)},m(l,o){w(l,t,o)},p(l,o){var r,a;o&4&&e!==(e=(((r=l[11])==null?void 0:r.message)||((a=l[11])==null?void 0:a.code)||po)+"")&&be(t,e)},d(l){l&&k(t)}}}function Cu(n){let e,t;function i(o,r){return typeof o[11]=="object"?G1:J1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),h(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),m(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&&k(e),l.d()}}}function X1(n){let e,t,i,s,l;const o=n[7].default,r=$n(o,n,n[6],$u);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Cu(Su(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();h(e,"class",n[0]),X(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),m(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=G(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Mn(r,o,f,f[6],i?Cn(o,f[6],c,Z1):Tn(f[6]),$u),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const p=Su(f,a,d);u[d]?u[d].p(p,c):(u[d]=Cu(p),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&h(e,"class",f[0]),c&5&&X(e,"error",f[2].length)},i(f){i||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Rn(u,f),n[9](null),s=!1,l()}}}const po="Invalid value";function Q1(n,e,t){let i;cn(n,ns,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){rg(r)}Un(()=>(u.addEventListener("change",c),()=>{u.removeEventListener("change",c)}));function d(g){dt.call(this,n,g)}function p(g){ge[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,p]}class Fe extends Ee{constructor(e){super(),Ae(this,e,Q1,X1,Oe,{name:4,class:0})}}function x1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eb(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[1]),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&h(e,"for",i),d&512&&o!==(o=c[9])&&h(l,"id",o),d&2&&l.value!==c[1]&&Ce(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function tb(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Password confirm"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[2]),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&Ce(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nb(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[x1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[eb,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[tb,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("button"),f.innerHTML=`<span class="txt">Create and login</span>
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),X(f,"btn-disabled",n[3]),X(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),q(a,e,null),m(e,u),m(e,f),c=!0,d||(p=G(e,"submit",Vt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const S={};v&1540&&(S.$$scope={dirty:v,ctx:g}),a.$set(S),v&8&&X(f,"btn-disabled",g[3]),v&8&&X(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),V(s),V(o),V(a),d=!1,p()}}}function ib(n,e,t){const i=rn();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await Se.Admins.create({email:s,password:l,passwordConfirm:o}),await Se.Admins.authViaEmail(s,l),i("submit")}catch(d){Se.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 sb extends Ee{constructor(e){super(),Ae(this,e,ib,nb,Oe,{})}}function Mu(n){let e,t;return e=new ag({props:{$$slots:{default:[lb]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lb(n){let e,t;return e=new sb({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:oe,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ob(n){let e,t,i=n[0]&&Mu(n);return{c(){i&&i.c(),e=ot()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Mu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Te(),P(i,1,1,()=>{i=null}),De())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function rb(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){Se.logout(!1),t(0,i=!0);return}Se.AuthStore.isValid?$s("/collections"):Se.logout()}return[i,async()=>{t(0,i=!1),await li(),window.location.search=""}]}class ab extends Ee{constructor(e){super(),Ae(this,e,rb,ob,Oe,{})}}function Ro(n){const e=n-1;return e*e*e+1}function mo(n,{delay:e=0,duration:t=400,easing:i=ml}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=Ro,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function Xt(n,{delay:e=0,duration:t=400,easing:i=Ro}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:p=>`overflow: hidden;opacity: ${Math.min(p*20,1)*l};height: ${p*o}px;padding-top: ${p*r}px;padding-bottom: ${p*a}px;margin-top: ${p*u}px;margin-bottom: ${p*f}px;border-top-width: ${p*c}px;border-bottom-width: ${p*d}px;`}}function qn(n,{delay:e=0,duration:t=400,easing:i=Ro,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function ub(n){let e,t,i,s;return{c(){e=_("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Ce(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&Ce(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function fb(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={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=new o(r(n)),ge.push(()=>Ie(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=ot()},m(a,u){e&&q(e,a,u),w(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],Re(()=>t=!1)),o!==(o=a[4])){if(e){Te();const c=e;P(c.$$.fragment,1,0,()=>{V(c,1)}),De()}o?(e=new o(r(a)),ge.push(()=>Ie(e,"value",l)),e.$on("submit",a[10]),z(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&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&V(e,a)}}}function Tu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Du();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',h(t,"type","button"),h(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&A(r,1):(r=Du(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Te(),P(r,1,1,()=>{r=null}),De())},i(a){s||(A(r),Tt(()=>{i||(i=at(t,jn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),i||(i=at(t,jn,{duration:150,x:5},!1)),i.run(0),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Du(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=at(e,jn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,jn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function cb(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[fb,ub],p=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=p[o]=d[o](n);let v=(n[0].length||n[7].length)&&Tu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),h(s,"class","ri-search-line"),h(i,"for",n[8]),h(i,"class","m-l-10 txt-xl"),h(t,"class","searchbar"),h(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),p[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Vt(n[10])),G(e,"click",Hn(n[11]))],f=!0)},p(b,[y]){let S=o;o=g(b),o===S?p[o].p(b,y):(Te(),P(p[S],1,1,()=>{p[S]=null}),De(),r=p[o],r?r.p(b,y):(r=p[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Tu(b),v.c(),A(v,1),v.m(t,null)):v&&(Te(),P(v,1,1,()=>{v=null}),De())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),p[o].d(),v&&v.d(),f=!1,lt(c)}}}function db(n,e,t){const i=rn(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new On}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function p(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Ki(()=>import("./FilterAutocompleteInput.8c26964d.js"),[])).default),t(5,f=!1))}Un(()=>{v()});function b(M){dt.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function S(M){ge[M?"unshift":"push"](()=>{c=M,t(6,c)})}function $(){d=this.value,t(7,d),t(0,l)}const C=()=>{p(!1),g()};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,g,b,y,S,$,C]}class Ho extends Ee{constructor(e){super(),Ae(this,e,db,cb,Oe,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let Ir,qi;const Nr="app-tooltip";function Ou(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Oi(){return qi=qi||document.querySelector("."+Nr),qi||(qi=document.createElement("div"),qi.classList.add(Nr),document.body.appendChild(qi)),qi}function ug(n,e){let t=Oi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Rr();return}t.textContent=e.text,t.className=Nr+" active",e.class&&t.classList.add(e.class),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 Rr(){clearTimeout(Ir),Oi().classList.remove("active"),Oi().activeNode=void 0}function hb(n,e){Oi().activeNode=n,clearTimeout(Ir),Ir=setTimeout(()=>{Oi().classList.add("active"),ug(n,e)},isNaN(e.delay)?250:e.delay)}function Mt(n,e){let t=Ou(e);function i(){hb(n,t)}function s(){Rr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&W.isFocusable(n))&&n.addEventListener("click",s),Oi(),{update(l){var o,r;t=Ou(l),(r=(o=Oi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&ug(n,t)},destroy(){var l,o;(o=(l=Oi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Rr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function pb(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='<i class="ri-refresh-line svelte-b7gb6q"></i>',h(e,"type","button"),h(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),X(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[tt(t=Mt.call(null,e,n[0])),G(e,"click",n[2])],i=!0)},p(l,[o]){t&&Bn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&X(e,"refreshing",l[1])},i:oe,o:oe,d(l){l&&k(e),i=!1,lt(s)}}}function mb(n,e,t){const i=rn();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)},200))}return Un(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class jo extends Ee{constructor(e){super(),Ae(this,e,mb,pb,Oe,{tooltip:0})}}function gb(n){let e,t,i,s,l;const o=n[6].default,r=$n(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),h(e,"tabindex","0"),h(e,"class",t="col-sort "+n[1]),X(e,"col-sort-disabled",n[3]),X(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),X(e,"sort-desc",n[0]==="-"+n[2]),X(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[G(e,"click",n[7]),G(e,"keydown",n[8])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Mn(r,o,a,a[5],i?Cn(o,a[5],u,null):Tn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&h(e,"class",t),u&10&&X(e,"col-sort-disabled",a[3]),u&7&&X(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&X(e,"sort-desc",a[0]==="-"+a[2]),u&7&&X(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(A(r,a),i=!0)},o(a){P(r,a),i=!1},d(a){a&&k(e),r&&r.d(a),s=!1,lt(l)}}}function _b(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 xt extends Ee{constructor(e){super(),Ae(this,e,_b,gb,Oe,{class:1,name:2,sort:0,disable:3})}}function bb(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function vb(n){let e,t=W.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=R(t),s=R(" UTC"),h(e,"class","txt")},m(a,u){w(a,e,u),m(e,i),m(e,s),o||(r=tt(l=Mt.call(null,e,W.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=W.formatToUTCDate(a[0])+"")&&be(i,t),l&&Bn(l.update)&&u&1&&l.update.call(null,W.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function yb(n){let e;function t(l,o){return l[0]?vb:bb}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function kb(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class gi extends Ee{constructor(e){super(),Ae(this,e,kb,yb,Oe,{date:0})}}function Au(n,e,t){const i=n.slice();return i[21]=e[t],i}function wb(n){let e;return{c(){e=_("div"),e.innerHTML=`<i class="ri-global-line"></i>
<span class="txt">method</span>`,h(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Sb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",h(t,"class",W.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function $b(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",h(t,"class",W.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Cb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",h(t,"class",W.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Mb(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function Eu(n){let e;function t(l,o){return l[6]?Db:Tb}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function Tb(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Pu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Pu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Db(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Pu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Lu(n){let e;return{c(){e=_("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fu(n,e){var le,me,re;let t,i,s,l=((le=e[21].method)==null?void 0:le.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,p,g,v,b,y,S=(e[21].referer||"N/A")+"",$,C,M,D,L,O=e[21].status+"",F,E,j,U,Q,te,H,Y,K,Z,ee=(((me=e[21].meta)==null?void 0:me.errorMessage)||((re=e[21].meta)==null?void 0:re.errorData))&&Lu();U=new gi({props:{date:e[21].created}});function ae(){return e[16](e[21])}function ve(...de){return e[17](e[21],...de)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=R(l),a=T(),u=_("td"),f=_("span"),d=R(c),g=T(),ee&&ee.c(),v=T(),b=_("td"),y=_("span"),$=R(S),M=T(),D=_("td"),L=_("span"),F=R(O),E=T(),j=_("td"),z(U.$$.fragment),Q=T(),te=_("td"),te.innerHTML='<i class="ri-arrow-right-line"></i>',H=T(),h(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",p=e[21].url),h(u,"class","col-type-text col-field-url"),h(y,"class","txt txt-ellipsis"),h(y,"title",C=e[21].referer),X(y,"txt-hint",!e[21].referer),h(b,"class","col-type-text col-field-referer"),h(L,"class","label"),X(L,"label-danger",e[21].status>=400),h(D,"class","col-type-number col-field-status"),h(j,"class","col-type-date col-field-created"),h(te,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(de,fe){w(de,t,fe),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),ee&&ee.m(u,null),m(t,v),m(t,b),m(b,y),m(y,$),m(t,M),m(t,D),m(D,L),m(L,F),m(t,E),m(t,j),q(U,j,null),m(t,Q),m(t,te),m(t,H),Y=!0,K||(Z=[G(t,"click",ae),G(t,"keydown",ve)],K=!0)},p(de,fe){var x,ye,He;e=de,(!Y||fe&8)&&l!==(l=((x=e[21].method)==null?void 0:x.toUpperCase())+"")&&be(o,l),(!Y||fe&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&h(s,"class",r),(!Y||fe&8)&&c!==(c=e[21].url+"")&&be(d,c),(!Y||fe&8&&p!==(p=e[21].url))&&h(f,"title",p),((ye=e[21].meta)==null?void 0:ye.errorMessage)||((He=e[21].meta)==null?void 0:He.errorData)?ee||(ee=Lu(),ee.c(),ee.m(u,null)):ee&&(ee.d(1),ee=null),(!Y||fe&8)&&S!==(S=(e[21].referer||"N/A")+"")&&be($,S),(!Y||fe&8&&C!==(C=e[21].referer))&&h(y,"title",C),fe&8&&X(y,"txt-hint",!e[21].referer),(!Y||fe&8)&&O!==(O=e[21].status+"")&&be(F,O),fe&8&&X(L,"label-danger",e[21].status>=400);const ie={};fe&8&&(ie.date=e[21].created),U.$set(ie)},i(de){Y||(A(U.$$.fragment,de),Y=!0)},o(de){P(U.$$.fragment,de),Y=!1},d(de){de&&k(t),ee&&ee.d(),V(U),K=!1,lt(Z)}}}function Iu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&be(s,i),a&16&&be(o,r[4])},d(r){r&&k(e)}}}function Nu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),X(t,"btn-loading",n[6]),X(t,"btn-disabled",n[6]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&be(o,l),c&64&&X(t,"btn-loading",f[6]),c&64&&X(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function Ob(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L=[],O=new Map,F,E,j,U;function Q(x){n[11](x)}let te={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[wb]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),l=new xt({props:te}),ge.push(()=>Ie(l,"sort",Q));function H(x){n[12](x)}let Y={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Sb]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),a=new xt({props:Y}),ge.push(()=>Ie(a,"sort",H));function K(x){n[13](x)}let Z={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[$b]},$$scope:{ctx:n}};n[1]!==void 0&&(Z.sort=n[1]),c=new xt({props:Z}),ge.push(()=>Ie(c,"sort",K));function ee(x){n[14](x)}let ae={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[Cb]},$$scope:{ctx:n}};n[1]!==void 0&&(ae.sort=n[1]),g=new xt({props:ae}),ge.push(()=>Ie(g,"sort",ee));function ve(x){n[15](x)}let le={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[Mb]},$$scope:{ctx:n}};n[1]!==void 0&&(le.sort=n[1]),y=new xt({props:le}),ge.push(()=>Ie(y,"sort",ve));let me=n[3];const re=x=>x[21].id;for(let x=0;x<me.length;x+=1){let ye=Au(n,me,x),He=re(ye);O.set(He,L[x]=Fu(He,ye))}let de=null;me.length||(de=Eu(n));let fe=n[3].length&&Iu(n),ie=n[3].length&&n[7]&&Nu(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),z(l.$$.fragment),r=T(),z(a.$$.fragment),f=T(),z(c.$$.fragment),p=T(),z(g.$$.fragment),b=T(),z(y.$$.fragment),$=T(),C=_("th"),M=T(),D=_("tbody");for(let x=0;x<L.length;x+=1)L[x].c();de&&de.c(),F=T(),fe&&fe.c(),E=T(),ie&&ie.c(),j=ot(),h(C,"class","col-type-action min-width"),h(t,"class","table"),X(t,"table-loading",n[6]),h(e,"class","table-wrapper")},m(x,ye){w(x,e,ye),m(e,t),m(t,i),m(i,s),q(l,s,null),m(s,r),q(a,s,null),m(s,f),q(c,s,null),m(s,p),q(g,s,null),m(s,b),q(y,s,null),m(s,$),m(s,C),m(t,M),m(t,D);for(let He=0;He<L.length;He+=1)L[He].m(D,null);de&&de.m(D,null),w(x,F,ye),fe&&fe.m(x,ye),w(x,E,ye),ie&&ie.m(x,ye),w(x,j,ye),U=!0},p(x,[ye]){const He={};ye&16777216&&(He.$$scope={dirty:ye,ctx:x}),!o&&ye&2&&(o=!0,He.sort=x[1],Re(()=>o=!1)),l.$set(He);const Le={};ye&16777216&&(Le.$$scope={dirty:ye,ctx:x}),!u&&ye&2&&(u=!0,Le.sort=x[1],Re(()=>u=!1)),a.$set(Le);const Pe={};ye&16777216&&(Pe.$$scope={dirty:ye,ctx:x}),!d&&ye&2&&(d=!0,Pe.sort=x[1],Re(()=>d=!1)),c.$set(Pe);const ue={};ye&16777216&&(ue.$$scope={dirty:ye,ctx:x}),!v&&ye&2&&(v=!0,ue.sort=x[1],Re(()=>v=!1)),g.$set(ue);const ce={};ye&16777216&&(ce.$$scope={dirty:ye,ctx:x}),!S&&ye&2&&(S=!0,ce.sort=x[1],Re(()=>S=!1)),y.$set(ce),ye&841&&(me=x[3],Te(),L=ft(L,ye,re,1,x,me,O,D,Ft,Fu,null,Au),De(),!me.length&&de?de.p(x,ye):me.length?de&&(de.d(1),de=null):(de=Eu(x),de.c(),de.m(D,null))),ye&64&&X(t,"table-loading",x[6]),x[3].length?fe?fe.p(x,ye):(fe=Iu(x),fe.c(),fe.m(E.parentNode,E)):fe&&(fe.d(1),fe=null),x[3].length&&x[7]?ie?ie.p(x,ye):(ie=Nu(x),ie.c(),ie.m(j.parentNode,j)):ie&&(ie.d(1),ie=null)},i(x){if(!U){A(l.$$.fragment,x),A(a.$$.fragment,x),A(c.$$.fragment,x),A(g.$$.fragment,x),A(y.$$.fragment,x);for(let ye=0;ye<me.length;ye+=1)A(L[ye]);U=!0}},o(x){P(l.$$.fragment,x),P(a.$$.fragment,x),P(c.$$.fragment,x),P(g.$$.fragment,x),P(y.$$.fragment,x);for(let ye=0;ye<L.length;ye+=1)P(L[ye]);U=!1},d(x){x&&k(e),V(l),V(a),V(c),V(g),V(y);for(let ye=0;ye<L.length;ye+=1)L[ye].d();de&&de.d(),x&&k(F),fe&&fe.d(x),x&&k(E),ie&&ie.d(x),x&&k(j)}}}function Ab(n,e,t){let i;const s=rn(),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;async function p(O=1){return t(6,d=!0),Se.Logs.getRequestsList(O,40,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(F=>{O<=1&&g(),t(6,d=!1),t(3,u=u.concat(F.items)),t(5,f=F.page),t(4,c=F.totalItems),s("load",u)}).catch(F=>{F!=null&&F.isAbort||(t(6,d=!1),console.warn(F),g(),Se.errorResponseHandler(F,!1))})}function g(){t(3,u=[]),t(5,f=1),t(4,c=0)}function v(O){a=O,t(1,a)}function b(O){a=O,t(1,a)}function y(O){a=O,t(1,a)}function S(O){a=O,t(1,a)}function $(O){a=O,t(1,a)}const C=O=>s("select",O),M=(O,F)=>{F.code==="Enter"&&(F.preventDefault(),s("select",O))},D=()=>t(0,o=""),L=()=>p(f+1);return n.$$set=O=>{"filter"in O&&t(0,o=O.filter),"presets"in O&&t(10,r=O.presets),"sort"in O&&t(1,a=O.sort)},n.$$.update=()=>{n.$$.dirty&1027&&(typeof a<"u"||typeof o<"u"||typeof r<"u")&&(g(),p(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,p,u,c,f,d,i,s,l,r,v,b,y,S,$,C,M,D,L]}class Eb extends Ee{constructor(e){super(),Ae(this,e,Ab,Ob,Oe,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*!
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/const fg=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function cg(n,e,t){const i=t||(o=>Array.prototype.slice.call(o));let s=!1,l=[];return function(...o){l=i(o),s||(s=!0,fg.call(window,()=>{s=!1,n.apply(e,l)}))}}function Pb(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Lb=n=>n==="start"?"left":n==="end"?"right":"center",Ru=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function ui(){}const Fb=function(){let n=0;return function(){return n++}}();function Ct(n){return n===null||typeof n>"u"}function Lt(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 pt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const qt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Pn(n,e){return qt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const Ib=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,dg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Rt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function $t(n,e,t,i){let s,l,o;if(Lt(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(pt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function go(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 _o(n){if(Lt(n))return n.map(_o);if(pt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=_o(n[t[s]]);return e}return n}function hg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Nb(n,e,t,i){if(!hg(n))return;const s=e[n],l=t[n];pt(s)&&pt(l)?rl(s,l,i):e[n]=_o(l)}function rl(n,e,t){const i=Lt(e)?e:[e],s=i.length;if(!pt(n))return n;t=t||{};const l=t.merger||Nb;for(let o=0;o<s;++o){if(e=i[o],!pt(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 Qs(n,e){return rl(n,e,{merger:Rb})}function Rb(n,e,t){if(!hg(n))return;const i=e[n],s=t[n];pt(i)&&pt(s)?Qs(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=_o(s))}const Hb="",jb=".";function Hu(n,e){const t=n.indexOf(jb,e);return t===-1?n.length:t}function Ei(n,e){if(e===Hb)return n;let t=0,i=Hu(e,t);for(;n&&i>t;)n=n[e.slice(t,i)],t=i+1,i=Hu(e,t);return n}function ga(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Vn=n=>typeof n<"u",Pi=n=>typeof n=="function",ju=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function qb(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const jt=Math.PI,At=2*jt,Vb=At+jt,bo=Number.POSITIVE_INFINITY,zb=jt/180,Ht=jt/2,Is=jt/4,qu=jt*2/3,In=Math.log10,ti=Math.sign;function Vu(n){const e=Math.round(n);n=xs(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(In(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Bb(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 al(n){return!isNaN(parseFloat(n))&&isFinite(n)}function xs(n,e,t){return Math.abs(n-e)<t}function Ub(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function pg(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 Zn(n){return n*(jt/180)}function _a(n){return n*(180/jt)}function zu(n){if(!qt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function mg(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*jt&&(l+=At),{angle:l,distance:s}}function Hr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Wb(n,e){return(n-e+Vb)%At-jt}function kn(n){return(n%At+At)%At}function ul(n,e,t,i){const s=kn(n),l=kn(e),o=kn(t),r=kn(l-s),a=kn(o-s),u=kn(s-l),f=kn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function sn(n,e,t){return Math.max(e,Math.min(t,n))}function Yb(n){return sn(n,-32768,32767)}function fl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}const Hl=n=>n===0||n===1,Bu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*At/t)),Uu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*At/t)+1,el={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*Ht)+1,easeOutSine:n=>Math.sin(n*Ht),easeInOutSine:n=>-.5*(Math.cos(jt*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=>Hl(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=>Hl(n)?n:Bu(n,.075,.3),easeOutElastic:n=>Hl(n)?n:Uu(n,.075,.3),easeInOutElastic(n){return Hl(n)?n:n<.5?.5*Bu(n*2,.1125,.45):.5+.5*Uu(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-el.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?el.easeInBounce(n*2)*.5:el.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 kl(n){return n+.5|0}const Ti=(n,e,t)=>Math.max(Math.min(n,t),e);function Ws(n){return Ti(kl(n*2.55),0,255)}function Ai(n){return Ti(kl(n*255),0,255)}function di(n){return Ti(kl(n/2.55)/100,0,1)}function Wu(n){return Ti(kl(n*100),0,100)}const En={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},jr=[..."0123456789ABCDEF"],Kb=n=>jr[n&15],Zb=n=>jr[(n&240)>>4]+jr[n&15],jl=n=>(n&240)>>4===(n&15),Jb=n=>jl(n.r)&&jl(n.g)&&jl(n.b)&&jl(n.a);function Gb(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const Xb=(n,e)=>n<255?e(n):"";function Qb(n){var e=Jb(n)?Kb:Zb;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Xb(n.a,e):void 0}const xb=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function gg(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 ev(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 tv(n,e,t){const i=gg(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 nv(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 ba(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=nv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function va(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ai)}function ya(n,e,t){return va(gg,n,e,t)}function iv(n,e,t){return va(tv,n,e,t)}function sv(n,e,t){return va(ev,n,e,t)}function _g(n){return(n%360+360)%360}function lv(n){const e=xb.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ws(+e[5]):Ai(+e[5]));const s=_g(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=iv(s,l,o):e[1]==="hsv"?i=sv(s,l,o):i=ya(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function ov(n,e){var t=ba(n);t[0]=_g(t[0]+e),t=ya(t),n.r=t[0],n.g=t[1],n.b=t[2]}function rv(n){if(!n)return;const e=ba(n),t=e[0],i=Wu(e[1]),s=Wu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${di(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Yu={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"},Ku={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 av(){const n={},e=Object.keys(Ku),t=Object.keys(Yu);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,Yu[l]);l=parseInt(Ku[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let ql;function uv(n){ql||(ql=av(),ql.transparent=[0,0,0,0]);const e=ql[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const fv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function cv(n){const e=fv.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?Ws(o):Ti(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Ws(i):Ti(i,0,255)),s=255&(e[4]?Ws(s):Ti(s,0,255)),l=255&(e[6]?Ws(l):Ti(l,0,255)),{r:i,g:s,b:l,a:t}}}function dv(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${di(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const nr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,cs=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function hv(n,e,t){const i=cs(di(n.r)),s=cs(di(n.g)),l=cs(di(n.b));return{r:Ai(nr(i+t*(cs(di(e.r))-i))),g:Ai(nr(s+t*(cs(di(e.g))-s))),b:Ai(nr(l+t*(cs(di(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Vl(n,e,t){if(n){let i=ba(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=ya(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function bg(n,e){return n&&Object.assign(e||{},n)}function Zu(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=Ai(n[3]))):(e=bg(n,{r:0,g:0,b:0,a:1}),e.a=Ai(e.a)),e}function pv(n){return n.charAt(0)==="r"?cv(n):lv(n)}class vo{constructor(e){if(e instanceof vo)return e;const t=typeof e;let i;t==="object"?i=Zu(e):t==="string"&&(i=Gb(e)||uv(e)||pv(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=bg(this._rgb);return e&&(e.a=di(e.a)),e}set rgb(e){this._rgb=Zu(e)}rgbString(){return this._valid?dv(this._rgb):void 0}hexString(){return this._valid?Qb(this._rgb):void 0}hslString(){return this._valid?rv(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=hv(this._rgb,e._rgb,t)),this}clone(){return new vo(this.rgb)}alpha(e){return this._rgb.a=Ai(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=kl(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 Vl(this._rgb,2,e),this}darken(e){return Vl(this._rgb,2,-e),this}saturate(e){return Vl(this._rgb,1,e),this}desaturate(e){return Vl(this._rgb,1,-e),this}rotate(e){return ov(this._rgb,e),this}}function vg(n){return new vo(n)}function yg(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Ju(n){return yg(n)?n:vg(n)}function ir(n){return yg(n)?n:vg(n).saturate(.5).darken(.1).hexString()}const es=Object.create(null),qr=Object.create(null);function tl(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 sr(n,e,t){return typeof e=="string"?rl(tl(n,e),t):rl(tl(n,""),e)}class mv{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)=>ir(i.backgroundColor),this.hoverBorderColor=(t,i)=>ir(i.borderColor),this.hoverColor=(t,i)=>ir(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 sr(this,e,t)}get(e){return tl(this,e)}describe(e,t){return sr(qr,e,t)}override(e,t){return sr(es,e,t)}route(e,t,i,s){const l=tl(this,e),o=tl(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 pt(a)?Object.assign({},u,a):gt(a,u)},set(a){this[r]=a}}})}}var _t=new mv({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function gv(n){return!n||Ct(n.size)||Ct(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function yo(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 _v(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&&Lt(c)!==!0)o=yo(n,s,l,o,c);else if(Lt(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!Lt(d)&&(o=yo(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 Vi(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 Gu(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Vr(n,e,t,i){let s,l,o,r,a;const u=e.pointStyle,f=e.rotation,c=e.radius;let d=(f||0)*zb;if(u&&typeof u=="object"&&(s=u.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(d),n.drawImage(u,-u.width/2,-u.height/2,u.width,u.height),n.restore();return}if(!(isNaN(c)||c<=0)){switch(n.beginPath(),u){default:n.arc(t,i,c,0,At),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(d)*c,i-Math.cos(d)*c),d+=qu,n.lineTo(t+Math.sin(d)*c,i-Math.cos(d)*c),d+=qu,n.lineTo(t+Math.sin(d)*c,i-Math.cos(d)*c),n.closePath();break;case"rectRounded":a=c*.516,r=c-a,l=Math.cos(d+Is)*r,o=Math.sin(d+Is)*r,n.arc(t-l,i-o,a,d-jt,d-Ht),n.arc(t+o,i-l,a,d-Ht,d),n.arc(t+l,i+o,a,d,d+Ht),n.arc(t-o,i+l,a,d+Ht,d+jt),n.closePath();break;case"rect":if(!f){r=Math.SQRT1_2*c,n.rect(t-r,i-r,2*r,2*r);break}d+=Is;case"rectRot":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+o,i-l),n.lineTo(t+l,i+o),n.lineTo(t-o,i+l),n.closePath();break;case"crossRot":d+=Is;case"cross":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o),n.moveTo(t+o,i-l),n.lineTo(t-o,i+l);break;case"star":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o),n.moveTo(t+o,i-l),n.lineTo(t-o,i+l),d+=Is,l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o),n.moveTo(t+o,i-l),n.lineTo(t-o,i+l);break;case"line":l=Math.cos(d)*c,o=Math.sin(d)*c,n.moveTo(t-l,i-o),n.lineTo(t+l,i+o);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(d)*c,i+Math.sin(d)*c);break}n.fill(),e.borderWidth>0&&n.stroke()}}function cl(n,e,t){return t=t||.5,!e||n&&n.x>e.left-t&&n.x<e.right+t&&n.y>e.top-t&&n.y<e.bottom+t}function ka(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function wa(n){n.restore()}function bv(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 vv(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 ko(n,e,t,i,s,l={}){const o=Lt(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,yv(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),Ct(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),kv(n,t,i,u,l),i+=s.lineHeight;n.restore()}function yv(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Ct(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 kv(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 wo(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-Ht,jt,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,jt,Ht,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,Ht,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-Ht,!0),n.lineTo(t+o.topLeft,i)}const wv=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),Sv=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function $v(n,e){const t=(""+n).match(wv);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 Cv=n=>+n||0;function Sa(n,e){const t={},i=pt(e),s=i?Object.keys(e):e,l=pt(n)?i?o=>gt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=Cv(l(o));return t}function kg(n){return Sa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function gs(n){return Sa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function zn(n){const e=kg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Sn(n,e){n=n||{},e=e||_t.font;let t=gt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=gt(n.style,e.style);i&&!(""+i).match(Sv)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:gt(n.family,e.family),lineHeight:$v(gt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:gt(n.weight,e.weight),string:""};return s.string=gv(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&&Lt(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function Mv(n,e,t){const{min:i,max:s}=n,l=dg(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 Fi(n,e){return Object.assign(Object.create(n),e)}function $a(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 Ji=(n,e,t)=>$a(n,t,i=>n[i][e]<t),Tv=(n,e,t)=>$a(n,t,i=>n[i][e]>=t);function Dv(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 wg=["push","pop","shift","splice","unshift"];function Ov(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),wg.forEach(t=>{const i="_onData"+ga(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 Xu(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)&&(wg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Sg(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)}function Ca(n,e=[""],t=n,i,s=()=>n[0]){Vn(i)||(i=Tg("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>Ca([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 Cg(o,r,()=>Rv(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return xu(o).includes(r)},ownKeys(o){return xu(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function ks(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:$g(n,i),setContext:l=>ks(n,l,t,i),override:l=>ks(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 Cg(l,o,()=>Ev(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 $g(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:Pi(t)?t:()=>t,isIndexable:Pi(i)?i:()=>i}}const Av=(n,e)=>n?n+ga(e):e,Ma=(n,e)=>pt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function Cg(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function Ev(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return Pi(r)&&o.isScriptable(e)&&(r=Pv(e,r,n,t)),Lt(r)&&r.length&&(r=Lv(e,r,n,o.isIndexable)),Ma(e,r)&&(r=ks(r,s,l&&l[e],o)),r}function Pv(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),Ma(n,e)&&(e=Ta(s._scopes,s,n,e)),e}function Lv(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Vn(l.index)&&i(n))e=e[l.index%e.length];else if(pt(e[0])){const a=e,u=s._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ta(u,s,n,f);e.push(ks(c,l,o&&o[n],r))}}return e}function Mg(n,e,t){return Pi(n)?n(e,t):n}const Fv=(n,e)=>n===!0?e:typeof n=="string"?Ei(e,n):void 0;function Iv(n,e,t,i,s){for(const l of e){const o=Fv(t,l);if(o){n.add(o);const r=Mg(o._fallback,t,s);if(Vn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Vn(i)&&t!==i)return null}return!1}function Ta(n,e,t,i){const s=e._rootScopes,l=Mg(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=Qu(r,o,t,l||t,i);return a===null||Vn(l)&&l!==t&&(a=Qu(r,o,l,a,i),a===null)?!1:Ca(Array.from(r),[""],s,l,()=>Nv(e,t,i))}function Qu(n,e,t,i,s){for(;t;)t=Iv(n,e,t,i,s);return t}function Nv(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return Lt(s)&&pt(t)?t:s}function Rv(n,e,t,i){let s;for(const l of e)if(s=Tg(Av(l,n),t),Vn(s))return Ma(n,s)?Ta(t,i,n,s):s}function Tg(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Vn(i))return i}}function xu(n){let e=n._keys;return e||(e=n._keys=Hv(n._scopes)),e}function Hv(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 Dg(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(Ei(f,l),u)};return o}const jv=Number.EPSILON||1e-14,ws=(n,e)=>e<n.length&&!n[e].skip&&n[e],Og=n=>n==="x"?"y":"x";function qv(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Hr(l,s),a=Hr(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 Vv(n,e,t){const i=n.length;let s,l,o,r,a,u=ws(n,0);for(let f=0;f<i-1;++f)if(a=u,u=ws(n,f+1),!(!a||!u)){if(xs(e[f],0,jv)){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 zv(n,e,t="x"){const i=Og(t),s=n.length;let l,o,r,a=ws(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=ws(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 Bv(n,e="x"){const t=Og(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=ws(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=ws(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?ti(s[o-1])!==ti(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Vv(n,s,l),zv(n,l,e)}function Bl(n,e,t){return Math.max(Math.min(n,t),e)}function Uv(n,e){let t,i,s,l,o,r=cl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&cl(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Bl(s.cp1x,e.left,e.right),s.cp1y=Bl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Bl(s.cp2x,e.left,e.right),s.cp2y=Bl(s.cp2y,e.top,e.bottom)))}function Wv(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")Bv(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=qv(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&&Uv(n,t)}function Ag(){return typeof window<"u"&&typeof document<"u"}function Da(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function So(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 qo=n=>window.getComputedStyle(n,null);function Yv(n,e){return qo(n).getPropertyValue(e)}const Kv=["top","right","bottom","left"];function Qi(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=Kv[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Zv=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Jv(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Zv(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 Wi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=qo(t),l=s.boxSizing==="border-box",o=Qi(s,"padding"),r=Qi(s,"border","width"),{x:a,y:u,box:f}=Jv(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:p,height:g}=e;return l&&(p-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/p*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Gv(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Da(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=qo(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=So(r.maxWidth,l,"clientWidth"),s=So(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||bo,maxHeight:s||bo}}const lr=n=>Math.round(n*10)/10;function Xv(n,e,t,i){const s=qo(n),l=Qi(s,"margin"),o=So(s.maxWidth,n,"clientWidth")||bo,r=So(s.maxHeight,n,"clientHeight")||bo,a=Gv(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=lr(Math.min(u,o,a.maxWidth)),f=lr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=lr(u/2)),{width:u,height:f}}function ef(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 Qv=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 tf(n,e){const t=Yv(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Yi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function xv(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 ey(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Yi(n,s,t),r=Yi(s,l,t),a=Yi(l,e,t),u=Yi(o,r,t),f=Yi(r,a,t);return Yi(u,f,t)}const nf=new Map;function ty(n,e){e=e||{};const t=n+JSON.stringify(e);let i=nf.get(t);return i||(i=new Intl.NumberFormat(n,e),nf.set(t,i)),i}function wl(n,e,t){return ty(e,t).format(n)}const ny=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}}},iy=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function or(n,e,t){return n?ny(e,t):iy()}function sy(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 ly(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Eg(n){return n==="angle"?{between:ul,compare:Wb,normalize:kn}:{between:fl,compare:(e,t)=>e-t,normalize:e=>e}}function sf({start:n,end:e,count:t,loop:i,style:s}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:s}}function oy(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=Eg(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 Pg(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=Eg(i),{start:f,end:c,loop:d,style:p}=oy(n,e,t),g=[];let v=!1,b=null,y,S,$;const C=()=>a(s,$,y)&&r(s,$)!==0,M=()=>r(l,y)===0||a(l,$,y),D=()=>v||C(),L=()=>!v||M();for(let O=f,F=f;O<=c;++O)S=e[O%o],!S.skip&&(y=u(S[i]),y!==$&&(v=a(y,s,l),b===null&&D()&&(b=r(y,s)===0?O:F),b!==null&&L()&&(g.push(sf({start:b,end:O,loop:d,count:o,style:p})),b=null),F=O,$=y));return b!==null&&g.push(sf({start:b,end:c,loop:d,count:o,style:p})),g}function Lg(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=Pg(i[s],n.points,e);l.length&&t.push(...l)}return t}function ry(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 ay(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 uy(n,e){const t=n.points,i=n.options.spanGaps,s=t.length;if(!s)return[];const l=!!n._loop,{start:o,end:r}=ry(t,s,l,i);if(i===!0)return lf(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 lf(n,ay(t,o,a,u),t,e)}function lf(n,e,t,i){return!i||!i.setContext||!t?e:fy(n,e,t,i)}function fy(n,e,t,i){const s=n._chart.getContext(),l=of(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function p(g,v,b,y){const S=r?-1:1;if(g!==v){for(g+=a;t[g%a].skip;)g-=S;for(;t[v%a].skip;)v+=S;g%a!==v%a&&(u.push({start:g%a,end:v%a,loop:b,style:y}),f=y,c=v%a)}}for(const g of e){c=r?c:g.start;let v=t[c%a],b;for(d=c+1;d<=g.end;d++){const y=t[d%a];b=of(i.setContext(Fi(s,{type:"segment",p0:v,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),cy(b,f)&&p(c,d-1,g.loop,f),v=y,f=b}c<d-1&&p(c,d-1,g.loop,f)}return u}function of(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function cy(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
* Chart.js v3.8.0
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class dy{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=fg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var fi=new dy;const rf="transparent",hy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Ju(n||rf),s=i.valid&&Ju(e||rf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class py{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||hy[e.type||typeof o],this._easing=el[e.easing]||el.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 my=["x","y","borderWidth","radius","tension"],gy=["color","borderColor","backgroundColor"];_t.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 _y=Object.keys(_t.animation);_t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});_t.set("animations",{colors:{type:"color",properties:gy},numbers:{type:"number",properties:my}});_t.describe("animations",{_fallback:"animation"});_t.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 Fg{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!pt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!pt(s))return;const l={};for(const o of _y)l[o]=s[o];(Lt(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=vy(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&by(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 py(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 fi.add(this._chart,i),!0}}function by(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 vy(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 yy(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 ky(n){let e,t,i,s;return pt(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 Ig(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 uf(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],qt(u)&&(l||e===0||ti(e)===ti(u))&&(e+=u)}return e}}function wy(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 ff(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function Sy(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function $y(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 Cy(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function cf(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 df(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=Sy(l,o,i),c=e.length;let d;for(let p=0;p<c;++p){const g=e[p],{[a]:v,[u]:b}=g,y=g._stacks||(g._stacks={});d=y[u]=Cy(s,f,v),d[r]=b,d._top=cf(d,o,!0,i.type),d._bottom=cf(d,o,!1,i.type)}}function rr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function My(n,e){return Fi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function Ty(n,e,t){return Fi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Ns(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 ar=n=>n==="reset"||n==="none",hf=(n,e)=>e?n:Object.assign({},n),Dy=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Ig(t,!0),values:null};class ri{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=ff(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&Ns(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,p,g)=>c==="x"?d:c==="r"?g:p,l=t.xAxisID=gt(i.xAxisID,rr(e,"x")),o=t.yAxisID=gt(i.yAxisID,rr(e,"y")),r=t.rAxisID=gt(i.rAxisID,rr(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&&Xu(this._data,this),e._stacked&&Ns(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(pt(t))this._data=wy(t);else if(i!==t){if(i){Xu(i,this);const s=this._cachedMeta;Ns(s),s._parsed=[]}t&&Object.isExtensible(t)&&Ov(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=ff(t.vScale,t),t.stack!==i.stack&&(s=!0,Ns(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&df(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{Lt(s[e])?d=this.parseArrayData(i,s,e,t):pt(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&&df(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,g;for(d=0,p=s;d<p;++d)g=d+i,c[d]={[r]:f||l.parse(u[g],g),[a]:o.parse(t[g],g)};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(Ei(p,r),d),y:o.parse(Ei(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:Ig(s,!0),values:t._stacks[e.axis]};return uf(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=uf(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=Dy(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=$y(r);let d,p;function g(){p=s[d];const v=p[r.axis];return!qt(p[e.axis])||f>v||c<v}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(u,e,p,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!g()){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],qt(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=ky(gt(this.options.clip,yy(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=Ty(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=My(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&&Vn(i);if(r)return hf(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(_t.elements[e]),g=()=>this.getContext(i,s),v=u.resolveNamedOptions(d,p,g,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(hf(v,a))),v}_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 Fg(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||ar(e)||this.chart._animationsDisabled}updateElement(e,t,i,s){ar(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!ar(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&&Ns(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])}}ri.defaults={};ri.prototype.datasetElementType=null;ri.prototype.dataElementType=null;function Oy(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=Sg(i.sort((s,l)=>s-l))}return n._cache.$bar}function Ay(n){const e=n.iScale,t=Oy(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Vn(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 Ey(n,e,t,i){const s=t.barThickness;let l,o;return Ct(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 Py(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 Ly(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 Ng(n,e,t,i){return Lt(n)?Ly(n,e,t,i):e[t.axis]=t.parse(n,i),e}function pf(n,e,t,i){const s=n.iScale,l=n.vScale,o=s.getLabels(),r=s===l,a=[];let u,f,c,d;for(u=t,f=t+i;u<f;++u)d=e[u],c={},c[s.axis]=r||s.parse(o[u],u),a.push(Ng(d,c,l,u));return a}function ur(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function Fy(n,e,t){return n!==0?ti(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function Iy(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 Ny(n,e,t,i){let s=e.borderSkipped;const l={};if(!s){n.borderSkipped=l;return}const{start:o,end:r,reverse:a,top:u,bottom:f}=Iy(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[mf(f,o,r,a)]=!0,s=u)),l[mf(s,o,r,a)]=!0,n.borderSkipped=l}function mf(n,e,t,i){return i?(n=Ry(n,e,t),n=gf(n,t,e)):n=gf(n,e,t),n}function Ry(n,e,t){return n===e?t:n===t?e:n}function gf(n,e,t){return n==="start"?e:n==="end"?t:n}function Hy(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Oa extends ri{parsePrimitiveData(e,t,i,s){return pf(e,t,i,s)}parseArrayData(e,t,i,s){return pf(e,t,i,s)}parseObjectData(e,t,i,s){const{iScale:l,vScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=l.axis==="x"?r:a,f=o.axis==="x"?r:a,c=[];let d,p,g,v;for(d=i,p=i+s;d<p;++d)v=t[d],g={},g[l.axis]=l.parse(Ei(v,u),d),c.push(Ng(Ei(v,f),g,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=ur(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(),c=this.resolveDataElementOptions(t,s),d=this.getSharedOptions(c),p=this.includeOptions(s,d);this.updateSharedOptions(d,s,c);for(let g=t;g<t+i;g++){const v=this.getParsed(g),b=l||Ct(v[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(g),y=this._calculateBarIndexPixels(g,f),S=(v._stacks||{})[r.axis],$={horizontal:u,base:b.base,enableBorderRadius:!S||ur(v._custom)||o===S._top||o===S._bottom,x:u?b.head:y.center,y:u?y.center:b.head,height:u?y.size:Math.abs(b.size),width:u?Math.abs(b.size):y.size};p&&($.options=d||this.resolveDataElementOptions(g,e[g].active?"active":s));const C=$.options||e[g].options;Ny($,C,S,o),Hy($,C,f.ratio),this.updateElement(e[g],g,$,s)}}_getStacks(e,t){const s=this._cachedMeta.iScale,l=s.getMatchingVisibleMetas(this._type),o=s.options.stacked,r=l.length,a=[];let u,f;for(u=0;u<r;++u)if(f=l[u],!!f.controller.options.grouped){if(typeof t<"u"){const c=f.controller.getParsed(t)[f.controller._cachedMeta.vScale.axis];if(Ct(c)||isNaN(c))continue}if((o===!1||a.indexOf(f.stack)===-1||o===void 0&&f.stack===void 0)&&a.push(f.stack),f.index===e)break}return a.length||a.push(void 0),a}_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||Ay(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=ur(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,p,g;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&ti(f)!==ti(a.barEnd)&&(c=0),c+=f);const v=!Ct(s)&&!u?s:c;let b=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?p=t.getPixelForValue(c+d):p=b,g=p-b,Math.abs(g)<l){g=Fy(g,t,o)*l,f===o&&(b-=g/2);const y=t.getPixelForDecimal(0),S=t.getPixelForDecimal(1),$=Math.min(y,S),C=Math.max(y,S);b=Math.max(Math.min(b,C),$),p=b+g}if(b===t.getPixelForValue(o)){const y=ti(g)*t.getLineWidthForValue(o)/2;b+=y,g-=y}return{size:g,base:b,head:p,center:p+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=gt(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?Py(e,t,s,u):Ey(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)}}Oa.id="bar";Oa.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Oa.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Aa extends ri{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=gt(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=gt(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,a=this.resolveDataElementOptions(t,s),u=this.getSharedOptions(a),f=this.includeOptions(s,u),c=o.axis,d=r.axis;for(let p=t;p<t+i;p++){const g=e[p],v=!l&&this.getParsed(p),b={},y=b[c]=l?o.getPixelForDecimal(.5):o.getPixelForValue(v[c]),S=b[d]=l?r.getBasePixel():r.getPixelForValue(v[d]);b.skip=isNaN(y)||isNaN(S),f&&(b.options=this.resolveDataElementOptions(p,g.active?"active":s),l&&(b.options.radius=0)),this.updateElement(g,p,b,s)}this.updateSharedOptions(u,s,a)}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+=gt(i&&i._custom,l),s}}Aa.id="bubble";Aa.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Aa.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function jy(n,e,t){let i=1,s=1,l=0,o=0;if(e<At){const r=n,a=r+e,u=Math.cos(r),f=Math.sin(r),c=Math.cos(a),d=Math.sin(a),p=($,C,M)=>ul($,r,a,!0)?1:Math.max(C,C*t,M,M*t),g=($,C,M)=>ul($,r,a,!0)?-1:Math.min(C,C*t,M,M*t),v=p(0,u,c),b=p(Ht,f,d),y=g(jt,u,c),S=g(jt+Ht,f,d);i=(v-y)/2,s=(b-S)/2,l=-(v+y)/2,o=-(b+S)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Sl extends ri{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(pt(i[e])){const{key:a="value"}=this._parsing;l=u=>+Ei(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Zn(this.options.rotation-90)}_getCircumference(){return Zn(this.options.circumference)}_getRotationExtents(){let e=At,t=-At;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(Ib(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:p,offsetX:g,offsetY:v}=jy(c,f,a),b=(i.width-o)/d,y=(i.height-o)/p,S=Math.max(Math.min(b,y)/2,0),$=dg(this.options.radius,S),C=Math.max($*a,0),M=($-C)/this._getVisibleDatasetWeightTotal();this.offsetX=g*$,this.offsetY=v*$,s.total=this.calculateTotal(),this.outerRadius=$-M*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-M*u,0),this.updateElements(l,0,l.length,e)}_circumference(e,t){const i=this.options,s=this._cachedMeta,l=this._getCircumference();return t&&i.animation.animateRotate||!this.chart.getDataVisibility(e)||s._parsed[e]===null||s.data[e].hidden?0:this.calculateCircumference(s._parsed[e]*l/At)}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,g=d?0:this.outerRadius,v=this.resolveDataElementOptions(t,s),b=this.getSharedOptions(v),y=this.includeOptions(s,b);let S=this._getRotation(),$;for($=0;$<t;++$)S+=this._circumference($,l);for($=t;$<t+i;++$){const C=this._circumference($,l),M=e[$],D={x:f+this.offsetX,y:c+this.offsetY,startAngle:S,endAngle:S+C,circumference:C,outerRadius:g,innerRadius:p};y&&(D.options=b||this.resolveDataElementOptions($,M.active?"active":s)),S+=C,this.updateElement(M,$,D,s)}this.updateSharedOptions(b,s,v)}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)?At*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=wl(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(gt(this.chart.data.datasets[e].weight,1),0)}_getVisibleDatasetWeightTotal(){return this._getRingWeightOffset(this.chart.data.datasets.length)||1}}Sl.id="doughnut";Sl.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"};Sl.descriptors={_scriptable:n=>n!=="spacing",_indexable:n=>n!=="spacing"};Sl.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 Lt(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class $l extends ri{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}=qy(t,s,o);this._drawStart=r,this._drawCount=a,Vy(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,f=this.resolveDataElementOptions(t,s),c=this.getSharedOptions(f),d=this.includeOptions(s,c),p=o.axis,g=r.axis,{spanGaps:v,segment:b}=this.options,y=al(v)?v:Number.POSITIVE_INFINITY,S=this.chart._animationsDisabled||l||s==="none";let $=t>0&&this.getParsed(t-1);for(let C=t;C<t+i;++C){const M=e[C],D=this.getParsed(C),L=S?M:{},O=Ct(D[g]),F=L[p]=o.getPixelForValue(D[p],C),E=L[g]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,D,a):D[g],C);L.skip=isNaN(F)||isNaN(E)||O,L.stop=C>0&&Math.abs(D[p]-$[p])>y,b&&(L.parsed=D,L.raw=u.data[C]),d&&(L.options=c||this.resolveDataElementOptions(C,M.active?"active":s)),S||this.updateElement(M,C,L,s),$=D}this.updateSharedOptions(c,s,f)}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()}}$l.id="line";$l.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};$l.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};function qy(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=sn(Math.min(Ji(r,o.axis,u).lo,t?i:Ji(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=sn(Math.max(Ji(r,o.axis,f).hi+1,t?0:Ji(e,a,o.getPixelForValue(f)).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Vy(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}class Ea extends ri{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=wl(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return Dg.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*jt;let p=d,g;const v=360/this.countVisibleElements();for(g=0;g<t;++g)p+=this._computeAngle(g,s,v);for(g=t;g<t+i;g++){const b=e[g];let y=p,S=p+this._computeAngle(g,s,v),$=o.getDataVisibility(g)?u.getDistanceFromCenterForValue(this.getParsed(g).r):0;p=S,l&&(a.animateScale&&($=0),a.animateRotate&&(y=S=d));const C={x:f,y:c,innerRadius:0,outerRadius:$,startAngle:y,endAngle:S,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,C,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)?Zn(this.resolveDataElementOptions(e,t).angle||i):0}}Ea.id="polarArea";Ea.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};Ea.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 Rg extends Sl{}Rg.id="pie";Rg.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Pa extends ri{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 Dg.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)}}}Pa.id="radar";Pa.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};Pa.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class La extends $l{}La.id="scatter";La.defaults={showLine:!1,fill:!1};La.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function zi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class zr{constructor(e){this.options=e||{}}formats(){return zi()}parse(e,t){return zi()}format(e,t){return zi()}add(e,t,i){return zi()}diff(e,t,i){return zi()}startOf(e,t,i){return zi()}endOf(e,t){return zi()}}zr.override=function(n){Object.assign(zr.prototype,n)};var Hg={_date:zr};function zy(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?Tv:Ji;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 Cl(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}=zy(l[r],e,o,s);for(let p=c;p<=d;++p){const g=f[p];g.skip||i(g,u,p)}}}function By(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 fr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Cl(n,t,e,function(r,a,u){!s&&!cl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function Uy(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=mg(o,{x:e.x,y:e.y});ul(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Cl(n,t,e,l),s}function Wy(n,e,t,i,s,l){let o=[];const r=By(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 g=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(g))&&!p)return;const b=r(e,g);b<a?(o=[{element:f,datasetIndex:c,index:d}],a=b):b===a&&o.push({element:f,datasetIndex:c,index:d})}return Cl(n,t,e,u),o}function cr(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?Uy(n,e,t,s):Wy(n,e,t,i,s,l)}function _f(n,e,t,i,s){const l=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Cl(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 Yy={evaluateInteractionItems:Cl,modes:{index(n,e,t,i){const s=Wi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?fr(n,s,l,i,o):cr(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=Wi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?fr(n,s,l,i,o):cr(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=Wi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return fr(n,s,l,i,o)},nearest(n,e,t,i){const s=Wi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return cr(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Wi(e,n);return _f(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Wi(e,n);return _f(n,s,"y",t.intersect,i)}}};const jg=["left","top","right","bottom"];function Rs(n,e){return n.filter(t=>t.pos===e)}function bf(n,e){return n.filter(t=>jg.indexOf(t.pos)===-1&&t.box.axis===e)}function Hs(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 Ky(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 Zy(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!jg.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 Jy(n,e){const t=Zy(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 Gy(n){const e=Ky(n),t=Hs(e.filter(u=>u.box.fullSize),!0),i=Hs(Rs(e,"left"),!0),s=Hs(Rs(e,"right")),l=Hs(Rs(e,"top"),!0),o=Hs(Rs(e,"bottom")),r=bf(e,"x"),a=bf(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:Rs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function vf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function qg(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 Xy(n,e,t,i){const{pos:s,box:l}=t,o=n.maxPadding;if(!pt(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&&qg(o,l.getPadding());const r=Math.max(0,e.outerWidth-vf(o,n,"left","right")),a=Math.max(0,e.outerHeight-vf(o,n,"top","bottom")),u=r!==n.w,f=a!==n.h;return n.w=r,n.h=a,t.horizontal?{same:u,other:f}:{same:f,other:u}}function Qy(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 xy(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 Ys(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,xy(r.horizontal,e));const{same:c,other:d}=Xy(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&Ys(s,e,t,i)||f}function Ul(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;Vn(u.start)&&(o=u.start),a.fullSize?Ul(a,s.left,o,t.outerWidth-s.right-s.left,d):Ul(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;Vn(u.start)&&(l=u.start),a.fullSize?Ul(a,l,s.top,d,t.outerHeight-s.bottom-s.top):Ul(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}_t.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Wl={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=zn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=Gy(n.boxes),a=r.vertical,u=r.horizontal;$t(n.boxes,v=>{typeof v.beforeLayout=="function"&&v.beforeLayout()});const f=a.reduce((v,b)=>b.box.options&&b.box.options.display===!1?v:v+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);qg(d,zn(i));const p=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=Jy(a.concat(u),c);Ys(r.fullSize,p,c,g),Ys(a,p,c,g),Ys(u,p,c,g)&&Ys(a,p,c,g),Qy(p),yf(r.leftAndTop,p,c,g),p.x+=p.w,p.y+=p.h,yf(r.rightAndBottom,p,c,g),n.chartArea={left:p.left,top:p.top,right:p.left+p.w,bottom:p.top+p.h,height:p.h,width:p.w},$t(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(p.w,p.h,{left:0,top:0,right:0,bottom:0})})}};class Vg{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 e2 extends Vg{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const lo="$chartjs",t2={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},kf=n=>n===null||n==="";function n2(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[lo]={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=tf(n,"width");l!==void 0&&(n.width=l)}if(kf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=tf(n,"height");l!==void 0&&(n.height=l)}return n}const zg=Qv?{passive:!0}:!1;function i2(n,e,t){n.addEventListener(e,t,zg)}function s2(n,e,t){n.canvas.removeEventListener(e,t,zg)}function l2(n,e){const t=t2[n.type]||n.type,{x:i,y:s}=Wi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function $o(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function o2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||$o(r.addedNodes,i),o=o&&!$o(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function r2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||$o(r.removedNodes,i),o=o&&!$o(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const dl=new Map;let wf=0;function Bg(){const n=window.devicePixelRatio;n!==wf&&(wf=n,dl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function a2(n,e){dl.size||window.addEventListener("resize",Bg),dl.set(n,e)}function u2(n){dl.delete(n),dl.size||window.removeEventListener("resize",Bg)}function f2(n,e,t){const i=n.canvas,s=i&&Da(i);if(!s)return;const l=cg((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),a2(n,l),o}function dr(n,e,t){t&&t.disconnect(),e==="resize"&&u2(n)}function c2(n,e,t){const i=n.canvas,s=cg(l=>{n.ctx!==null&&t(l2(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return i2(i,e,s),s}class d2 extends Vg{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(n2(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[lo])return!1;const i=t[lo].initial;["height","width"].forEach(l=>{const o=i[l];Ct(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[lo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:o2,detach:r2,resize:f2}[t]||c2;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:dr,detach:dr,resize:dr}[t]||s2)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Xv(e,t,i,s)}isAttached(e){const t=Da(e);return!!(t&&t.isConnected)}}function h2(n){return!Ag()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?e2:d2}class vi{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 al(this.x)&&al(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}}vi.defaults={};vi.defaultRoutes=void 0;const Ug={values(n){return Lt(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=p2(n,t)}const o=In(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),wl(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(In(n)));return i===1||i===2||i===5?Ug.numeric.call(this,n,e,t):""}};function p2(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 Vo={formatters:Ug};_t.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:Vo.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});_t.route("scale.ticks","color","","color");_t.route("scale.grid","color","","borderColor");_t.route("scale.grid","borderColor","","borderColor");_t.route("scale.title","color","","color");_t.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});_t.describe("scales",{_fallback:"scale"});_t.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function m2(n,e){const t=n.options.ticks,i=t.maxTicksLimit||g2(n),s=t.major.enabled?b2(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return v2(e,a,s,l/i),a;const u=_2(s,e,i);if(l>0){let f,c;const d=l>1?Math.round((r-o)/(l-1)):null;for(Yl(e,a,u,Ct(d)?0:o-d,o),f=0,c=l-1;f<c;f++)Yl(e,a,u,s[f],s[f+1]);return Yl(e,a,u,r,Ct(d)?e.length:r+d),a}return Yl(e,a,u),a}function g2(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 _2(n,e,t){const i=y2(n),s=e.length/t;if(!i)return Math.max(s,1);const l=Bb(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 b2(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function v2(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 Yl(n,e,t,i,s){const l=gt(i,0),o=Math.min(gt(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 y2(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 k2=n=>n==="left"?"right":n==="right"?"left":n,Sf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function $f(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 w2(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 S2(n,e){$t(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 js(n){return n.drawTicks?n.tickLength:0}function Cf(n,e){if(!n.display)return 0;const t=Sn(n.font,e),i=zn(n.padding);return(Lt(n.text)?n.text.length:1)*t.lineHeight+i.height}function $2(n,e){return Fi(n,{scale:e,type:"scale"})}function C2(n,e,t){return Fi(n,{tick:t,index:e,type:"tick"})}function M2(n,e,t){let i=Lb(n);return(t&&e!=="right"||!t&&e==="right")&&(i=k2(i)),i}function T2(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,g;const v=o-s,b=r-l;if(n.isHorizontal()){if(p=Ru(i,l,r),pt(t)){const y=Object.keys(t)[0],S=t[y];g=f[y].getPixelForValue(S)+v-e}else t==="center"?g=(u.bottom+u.top)/2+v-e:g=Sf(n,t,e);d=r-l}else{if(pt(t)){const y=Object.keys(t)[0],S=t[y];p=f[y].getPixelForValue(S)-b+e}else t==="center"?p=(u.left+u.right)/2-b+e:p=Sf(n,t,e);g=Ru(i,o,s),c=t==="left"?-Ht:Ht}return{titleX:p,titleY:g,maxWidth:d,rotation:c}}class is extends vi{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=Pn(e,Number.POSITIVE_INFINITY),t=Pn(t,Number.NEGATIVE_INFINITY),i=Pn(i,Number.POSITIVE_INFINITY),s=Pn(s,Number.NEGATIVE_INFINITY),{min:Pn(e,i),max:Pn(t,s),minDefined:qt(e),maxDefined:qt(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:Pn(t,Pn(i,t)),max:Pn(i,Pn(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(){Rt(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=Mv(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?$f(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=m2(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(){Rt(this.options.afterUpdate,[this])}beforeSetDimensions(){Rt(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(){Rt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Rt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Rt(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=Rt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){Rt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Rt(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=sn(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-js(e.grid)-t.padding-Cf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=_a(Math.min(Math.asin(sn((f.highest.height+6)/r,-1,1)),Math.asin(sn(a/u,-1,1))-Math.asin(sn(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Rt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Rt(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=Cf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=js(l)+a):(e.height=this.maxHeight,e.width=js(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),p=i.padding*2,g=Zn(this.labelRotation),v=Math.cos(g),b=Math.sin(g);if(r){const y=i.mirror?0:b*c.width+v*d.height;e.height=Math.min(this.maxHeight,e.height+y+p)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+p)}this._calculatePadding(u,f,b,v)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,s){const{ticks:{align:l,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,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(){Rt(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++)Ct(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=$f(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,g,v,b,y,S,$;for(u=0;u<t;++u){if(d=e[u].label,p=this._resolveTickFontOptions(u),i.font=g=p.string,v=s[g]=s[g]||{data:{},gc:[]},b=p.lineHeight,y=S=0,!Ct(d)&&!Lt(d))y=yo(i,v.data,v.gc,y,d),S=b;else if(Lt(d))for(f=0,c=d.length;f<c;++f)$=d[f],!Ct($)&&!Lt($)&&(y=yo(i,v.data,v.gc,y,$),S+=b);l.push(y),o.push(S),r=Math.max(y,r),a=Math.max(S,a)}S2(s,t);const C=l.indexOf(r),M=o.indexOf(a),D=L=>({width:l[L]||0,height:o[L]||0});return{first:D(0),last:D(t-1),widest:D(C),highest:D(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 Yb(this._alignToPixels?Vi(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=C2(this.getContext(),e,i))}return this.$context||(this.$context=$2(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Zn(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=js(l),d=[],p=l.setContext(this.getContext()),g=p.drawBorder?p.borderWidth:0,v=g/2,b=function(H){return Vi(i,H,g)};let y,S,$,C,M,D,L,O,F,E,j,U;if(o==="top")y=b(this.bottom),D=this.bottom-c,O=y-v,E=b(e.top)+v,U=e.bottom;else if(o==="bottom")y=b(this.top),E=e.top,U=b(e.bottom)-v,D=y+v,O=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,L=y-v,F=b(e.left)+v,j=e.right;else if(o==="right")y=b(this.left),F=e.left,j=b(e.right)-v,M=y+v,L=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(pt(o)){const H=Object.keys(o)[0],Y=o[H];y=b(this.chart.scales[H].getPixelForValue(Y))}E=e.top,U=e.bottom,D=y+v,O=D+c}else if(t==="y"){if(o==="center")y=b((e.left+e.right)/2);else if(pt(o)){const H=Object.keys(o)[0],Y=o[H];y=b(this.chart.scales[H].getPixelForValue(Y))}M=y-v,L=M-c,F=e.left,j=e.right}const Q=gt(s.ticks.maxTicksLimit,f),te=Math.max(1,Math.ceil(f/Q));for(S=0;S<f;S+=te){const H=l.setContext(this.getContext(S)),Y=H.lineWidth,K=H.color,Z=l.borderDash||[],ee=H.borderDashOffset,ae=H.tickWidth,ve=H.tickColor,le=H.tickBorderDash||[],me=H.tickBorderDashOffset;$=w2(this,S,r),$!==void 0&&(C=Vi(i,$,Y),a?M=L=F=j=C:D=O=E=U=C,d.push({tx1:M,ty1:D,tx2:L,ty2:O,x1:F,y1:E,x2:j,y2:U,width:Y,color:K,borderDash:Z,borderDashOffset:ee,tickWidth:ae,tickColor:ve,tickBorderDash:le,tickBorderDashOffset:me}))}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=js(i.grid),p=d+f,g=c?-f:p,v=-Zn(this.labelRotation),b=[];let y,S,$,C,M,D,L,O,F,E,j,U,Q="middle";if(s==="top")D=this.bottom-g,L=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+g,L=this._getXAxisLabelAlignment();else if(s==="left"){const H=this._getYAxisLabelAlignment(d);L=H.textAlign,M=H.x}else if(s==="right"){const H=this._getYAxisLabelAlignment(d);L=H.textAlign,M=H.x}else if(t==="x"){if(s==="center")D=(e.top+e.bottom)/2+p;else if(pt(s)){const H=Object.keys(s)[0],Y=s[H];D=this.chart.scales[H].getPixelForValue(Y)+p}L=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-p;else if(pt(s)){const H=Object.keys(s)[0],Y=s[H];M=this.chart.scales[H].getPixelForValue(Y)}L=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?Q="top":a==="end"&&(Q="bottom"));const te=this._getLabelSizes();for(y=0,S=r.length;y<S;++y){$=r[y],C=$.label;const H=l.setContext(this.getContext(y));O=this.getPixelForTick(y)+l.labelOffset,F=this._resolveTickFontOptions(y),E=F.lineHeight,j=Lt(C)?C.length:1;const Y=j/2,K=H.color,Z=H.textStrokeColor,ee=H.textStrokeWidth;let ae=L;o?(M=O,L==="inner"&&(y===S-1?ae=this.options.reverse?"left":"right":y===0?ae=this.options.reverse?"right":"left":ae="center"),s==="top"?u==="near"||v!==0?U=-j*E+E/2:u==="center"?U=-te.highest.height/2-Y*E+E:U=-te.highest.height+E/2:u==="near"||v!==0?U=E/2:u==="center"?U=te.highest.height/2-Y*E:U=te.highest.height-j*E,c&&(U*=-1)):(D=O,U=(1-j)*E/2);let ve;if(H.showLabelBackdrop){const le=zn(H.backdropPadding),me=te.heights[y],re=te.widths[y];let de=D+U-le.top,fe=M-le.left;switch(Q){case"middle":de-=me/2;break;case"bottom":de-=me;break}switch(L){case"center":fe-=re/2;break;case"right":fe-=re;break}ve={left:fe,top:de,width:re+le.width,height:me+le.height,color:H.backdropColor}}b.push({rotation:v,label:C,font:F,color:K,strokeColor:Z,strokeWidth:ee,textOffset:U,textAlign:ae,textBaseline:Q,translation:[M,D],backdrop:ve})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Zn(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=Vi(e,this.left,l)-l/2,u=Vi(e,this.right,o)+o/2,f=c=r):(f=Vi(e,this.top,l)-l/2,c=Vi(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&&ka(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let c=a.textOffset;ko(i,f,0,c,u,a)}s&&wa(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=Sn(i.font),o=zn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||pt(t)?(a+=o.bottom,Lt(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=T2(this,a,t,r);ko(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:M2(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=gt(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==is.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 Kl{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;A2(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,D2(e,o,i),this.override&&_t.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 _t[s]&&(delete _t[s][i],this.override&&delete es[i])}}function D2(n,e,t){const i=rl(Object.create(null),[t?_t.get(t):{},_t.get(e),n.defaults]);_t.set(e,i),n.defaultRoutes&&O2(e,n.defaultRoutes),n.descriptors&&_t.describe(e,n.descriptors)}function O2(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(".");_t.route(l,s,a,r)})}function A2(n){return"id"in n&&"defaults"in n}class E2{constructor(){this.controllers=new Kl(ri,"datasets",!0),this.elements=new Kl(vi,"elements"),this.plugins=new Kl(Object,"plugins"),this.scales=new Kl(is,"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):$t(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=ga(e);Rt(i["before"+s],[],i),t[e](i),Rt(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 pi=new E2;class P2{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(Rt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Ct(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=gt(i.options&&i.options.plugins,{}),l=L2(i);return s===!1&&!t?[]:I2(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 L2(n){const e=[],t=Object.keys(pi.plugins.items);for(let s=0;s<t.length;s++)e.push(pi.getPlugin(t[s]));const i=n.plugins||[];for(let s=0;s<i.length;s++){const l=i[s];e.indexOf(l)===-1&&e.push(l)}return e}function F2(n,e){return!e&&n===!1?null:n===!0?{}:n}function I2(n,e,t,i){const s=[],l=n.getContext();for(let o=0;o<e.length;o++){const r=e[o],a=r.id,u=F2(t[a],i);u!==null&&s.push({plugin:r,options:N2(n.config,r,u,l)})}return s}function N2(n,e,t,i){const s=n.pluginScopeKeys(e),l=n.getOptionScopes(t,s);return n.createResolver(l,i,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Br(n,e){const t=_t.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function R2(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function H2(n,e){return n===e?"_index_":"_value_"}function j2(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Ur(n,e){return n==="x"||n==="y"?n:e.axis||j2(e.position)||n.charAt(0).toLowerCase()}function q2(n,e){const t=es[n.type]||{scales:{}},i=e.scales||{},s=Br(n.type,e),l=Object.create(null),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!pt(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=Ur(r,a),f=H2(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=Qs(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||Br(a,e),c=(es[a]||{}).scales||{};Object.keys(c).forEach(d=>{const p=R2(d,u),g=r[p+"AxisID"]||l[p]||p;o[g]=o[g]||Object.create(null),Qs(o[g],[{axis:p},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];Qs(a,[_t.scales[a.type],_t.scale])}),o}function Wg(n){const e=n.options||(n.options={});e.plugins=gt(e.plugins,{}),e.scales=q2(n,e)}function Yg(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function V2(n){return n=n||{},n.data=Yg(n.data),Wg(n),n}const Mf=new Map,Kg=new Set;function Zl(n,e){let t=Mf.get(n);return t||(t=e(),Mf.set(n,t),Kg.add(t)),t}const qs=(n,e,t)=>{const i=Ei(e,t);i!==void 0&&n.add(i)};class z2{constructor(e){this._config=V2(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=Yg(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(),Wg(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Zl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Zl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Zl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Zl(`${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=>qs(a,e,c))),f.forEach(c=>qs(a,s,c)),f.forEach(c=>qs(a,es[l]||{},c)),f.forEach(c=>qs(a,_t,c)),f.forEach(c=>qs(a,qr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),Kg.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,es[t]||{},_t.datasets[t]||{},{type:t},_t,qr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Tf(this._resolverCache,e,s);let a=o;if(U2(o,t)){l.$shared=!1,i=Pi(i)?i():i;const u=this.createResolver(e,i,r);a=ks(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Tf(this._resolverCache,e,i);return pt(t)?ks(l,t,void 0,s):l}}function Tf(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:Ca(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const B2=n=>pt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||Pi(n[t]),!1);function U2(n,e){const{isScriptable:t,isIndexable:i}=$g(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(Pi(r)||B2(r))||o&&Lt(r))return!0}return!1}var W2="3.8.0";const Y2=["top","bottom","left","right","chartArea"];function Df(n,e){return n==="top"||n==="bottom"||Y2.indexOf(n)===-1&&e==="x"}function Of(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Af(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Rt(t&&t.onComplete,[n],e)}function K2(n){const e=n.chart,t=e.options.animation;Rt(t&&t.onProgress,[n],e)}function Zg(n){return Ag()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Co={},Jg=n=>{const e=Zg(n);return Object.values(Co).filter(t=>t.canvas===e).pop()};function Z2(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 J2(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Mo{constructor(e,t){const i=this.config=new z2(t),s=Zg(e),l=Jg(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||h2(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=Fb(),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 P2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Pb(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Co[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}fi.listen(this,"complete",Af),fi.listen(this,"progress",K2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Ct(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():ef(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gu(this.canvas,this.ctx),this}stop(){return fi.stop(this),this}resize(e,t){fi.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,ef(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Rt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};$t(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=Ur(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),$t(l,o=>{const r=o.options,a=r.id,u=Ur(a,r),f=gt(r.type,o.dtype);(r.position===void 0||Df(r.position,u)!==Df(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=pi.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),$t(s,(o,r)=>{o||delete i[r]}),$t(i,o=>{Wl.configure(this,o,o.options),Wl.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(Of("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||Br(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=pi.getController(r),{datasetElementType:u,dataElementType:f}=_t.datasets[r];Object.assign(a.prototype,{dataElementType:pi.getElement(f),datasetElementType:u&&pi.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){$t(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||$t(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Of("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){$t(this.scales,e=>{Wl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!ju(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;Z2(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(!ju(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;Wl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],$t(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,Pi(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&&(fi.has(this)?this.attached&&!fi.running(this)&&fi.start(this):(this.draw(),Af({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:s}=this._resizeBeforeDraw;this._resize(i,s),this._resizeBeforeDraw=null}if(this.clear(),this.width<=0||this.height<=0||this.notifyPlugins("beforeDraw",{cancelable:!0})===!1)return;const t=this._layers;for(e=0;e<t.length&&t[e].z<=0;++e)t[e].draw(this.chartArea);for(this._drawDatasets();e<t.length;++e)t[e].draw(this.chartArea);this.notifyPlugins("afterDraw")}_getSortedDatasetMetas(e){const t=this._sortedMetasets,i=[];let s,l;for(s=0,l=t.length;s<l;++s){const o=t[s];(!e||o.visible)&&i.push(o)}return i}getSortedVisibleDatasetMetas(){return this._getSortedDatasetMetas(!0)}_drawDatasets(){if(this.notifyPlugins("beforeDatasetsDraw",{cancelable:!0})===!1)return;const e=this.getSortedVisibleDatasetMetas();for(let t=e.length-1;t>=0;--t)this._drawDataset(e[t]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(e){const t=this.ctx,i=e._clip,s=!i.disabled,l=this.chartArea,o={meta:e,index:e.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",o)!==!1&&(s&&ka(t,{left:i.left===!1?0:l.left-i.left,right:i.right===!1?this.width:l.right+i.right,top:i.top===!1?0:l.top-i.top,bottom:i.bottom===!1?this.height:l.bottom+i.bottom}),e.controller.draw(),s&&wa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return cl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Yy.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=Fi(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);Vn(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(),fi.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(),Gu(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Co[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)};$t(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(){$t(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},$t(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}});!go(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=qb(e),u=J2(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Rt(l.onHover,[e,r,this],this),a&&Rt(l.onClick,[e,r,this],this));const f=!go(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 Ef=()=>$t(Mo.instances,n=>n._plugins.invalidate()),Si=!0;Object.defineProperties(Mo,{defaults:{enumerable:Si,value:_t},instances:{enumerable:Si,value:Co},overrides:{enumerable:Si,value:es},registry:{enumerable:Si,value:pi},version:{enumerable:Si,value:W2},getChart:{enumerable:Si,value:Jg},register:{enumerable:Si,value:(...n)=>{pi.add(...n),Ef()}},unregister:{enumerable:Si,value:(...n)=>{pi.remove(...n),Ef()}}});function Gg(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+Ht,i-Ht),n.closePath(),n.clip()}function G2(n){return Sa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function X2(n,e,t,i){const s=G2(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 sn(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:sn(s.innerStart,0,o),innerEnd:sn(s.innerEnd,0,o)}}function ds(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Wr(n,e,t,i,s){const{x:l,y:o,startAngle:r,pixelMargin:a,innerRadius:u}=e,f=Math.max(e.outerRadius+i+t-a,0),c=u>0?u+i+t+a:0;let d=0;const p=s-r;if(i){const Y=u>0?u-i:0,K=f>0?f-i:0,Z=(Y+K)/2,ee=Z!==0?p*Z/(Z+i):p;d=(p-ee)/2}const g=Math.max(.001,p*f-t/jt)/f,v=(p-g)/2,b=r+v+d,y=s-v-d,{outerStart:S,outerEnd:$,innerStart:C,innerEnd:M}=X2(e,c,f,y-b),D=f-S,L=f-$,O=b+S/D,F=y-$/L,E=c+C,j=c+M,U=b+C/E,Q=y-M/j;if(n.beginPath(),n.arc(l,o,f,O,F),$>0){const Y=ds(L,F,l,o);n.arc(Y.x,Y.y,$,F,y+Ht)}const te=ds(j,y,l,o);if(n.lineTo(te.x,te.y),M>0){const Y=ds(j,Q,l,o);n.arc(Y.x,Y.y,M,y+Ht,Q+Math.PI)}if(n.arc(l,o,c,y-M/c,b+C/c,!0),C>0){const Y=ds(E,U,l,o);n.arc(Y.x,Y.y,C,U+Math.PI,b-Ht)}const H=ds(D,b,l,o);if(n.lineTo(H.x,H.y),S>0){const Y=ds(D,O,l,o);n.arc(Y.x,Y.y,S,b-Ht,O)}n.closePath()}function Q2(n,e,t,i){const{fullCircles:s,startAngle:l,circumference:o}=e;let r=e.endAngle;if(s){Wr(n,e,t,i,l+At);for(let a=0;a<s;++a)n.fill();isNaN(o)||(r=l+o%At,o%At===0&&(r+=At))}return Wr(n,e,t,i,r),n.fill(),r}function x2(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&&Gg(n,e,l+At),n.beginPath(),n.arc(i,s,u,l+At,l,!0),f=0;f<r;++f)n.stroke();for(n.beginPath(),n.arc(i,s,a,l,l+At),f=0;f<r;++f)n.stroke()}function ek(n,e,t,i,s){const{options:l}=e,{borderWidth:o,borderJoinStyle:r}=l,a=l.borderAlign==="inner";!o||(a?(n.lineWidth=o*2,n.lineJoin=r||"round"):(n.lineWidth=o,n.lineJoin=r||"bevel"),e.fullCircles&&x2(n,e,a),a&&Gg(n,e,s),Wr(n,e,t,i,s),n.stroke())}class Fa extends vi{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}=mg(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,g=gt(c,a-r)>=At||ul(l,r,a),v=fl(o,u+d,f+d);return g&&v}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;if(this.pixelMargin=t.borderAlign==="inner"?.33:0,this.fullCircles=i>At?Math.floor(i/At):0,i===0||this.innerRadius<0||this.outerRadius<0)return;e.save();let o=0;if(s){o=s/2;const a=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(a)*o,Math.sin(a)*o),this.circumference>=jt&&(o=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const r=Q2(e,this,o,l);ek(e,this,o,l,r),e.restore()}}Fa.id="arc";Fa.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0};Fa.defaultRoutes={backgroundColor:"backgroundColor"};function Xg(n,e,t=e){n.lineCap=gt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(gt(t.borderDash,e.borderDash)),n.lineDashOffset=gt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=gt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=gt(t.borderWidth,e.borderWidth),n.strokeStyle=gt(t.borderColor,e.borderColor)}function tk(n,e,t){n.lineTo(t.x,t.y)}function nk(n){return n.stepped?bv:n.tension||n.cubicInterpolationMode==="monotone"?vv:tk}function Qg(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 ik(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=Qg(s,t,i),f=nk(l);let{move:c=!0,reverse:d}=i||{},p,g,v;for(p=0;p<=u;++p)g=s[(r+(d?u-p:p))%o],!g.skip&&(c?(n.moveTo(g.x,g.y),c=!1):f(n,v,g,d,l.stepped),v=g);return a&&(g=s[(r+(d?u:0))%o],f(n,v,g,d,l.stepped)),!!a}function sk(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=Qg(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,p,g,v,b,y;const S=C=>(o+(u?r-C:C))%l,$=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(p=s[S(0)],n.moveTo(p.x,p.y)),d=0;d<=r;++d){if(p=s[S(d)],p.skip)continue;const C=p.x,M=p.y,D=C|0;D===g?(M<v?v=M:M>b&&(b=M),f=(c*f+C)/++c):($(),n.lineTo(C,M),g=D,c=0,v=b=M),y=M}$()}function Yr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?sk:ik}function lk(n){return n.stepped?xv:n.tension||n.cubicInterpolationMode==="monotone"?ey:Yi}function ok(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),Xg(n,e.options),n.stroke(s)}function rk(n,e,t,i){const{segments:s,options:l}=e,o=Yr(e);for(const r of s)Xg(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const ak=typeof Path2D=="function";function uk(n,e,t,i){ak&&!e.options.segment?ok(n,e,t,i):rk(n,e,t,i)}class Ii extends vi{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;Wv(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=uy(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=Lg(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=lk(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],p=l[c],g=l[d];if(p===g){r.push(p);continue}const v=Math.abs((s-p[t])/(g[t]-p[t])),b=a(p,g,v,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return Yr(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=Yr(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(),uk(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 Pf(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 vi{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 Pf(this,e,"x",t)}inYRange(e,t){return Pf(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||!cl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Vr(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 xg(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 Di(n,e,t,i){return n?0:sn(e,t,i)}function fk(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=kg(i);return{t:Di(s.top,l.top,0,t),r:Di(s.right,l.right,0,e),b:Di(s.bottom,l.bottom,0,t),l:Di(s.left,l.left,0,e)}}function ck(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=gs(s),o=Math.min(e,t),r=n.borderSkipped,a=i||pt(s);return{topLeft:Di(!a||r.top||r.left,l.topLeft,0,o),topRight:Di(!a||r.top||r.right,l.topRight,0,o),bottomLeft:Di(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:Di(!a||r.bottom||r.right,l.bottomRight,0,o)}}function dk(n){const e=xg(n),t=e.right-e.left,i=e.bottom-e.top,s=fk(n,t/2,i/2),l=ck(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 hr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&xg(n,i);return r&&(s||fl(e,r.left,r.right))&&(l||fl(t,r.top,r.bottom))}function hk(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function pk(n,e){n.rect(e.x,e.y,e.w,e.h)}function pr(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 Ia extends vi{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}=dk(this),r=hk(o.radius)?wo:pk;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,pr(o,t,l)),e.clip(),r(e,pr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,pr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return hr(this,e,t,i)}inXRange(e,t){return hr(this,e,null,t)}inYRange(e,t){return hr(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}}Ia.id="bar";Ia.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ia.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function mk(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=Na(a,u,s);const f=Kr(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=Lg(e,f);for(const d of c){const p=Kr(t,l[d.start],l[d.end],d.loop),g=Pg(r,s,p);for(const v of g)o.push({source:v,target:d,start:{[t]:Lf(f,p,"start",Math.max)},end:{[t]:Lf(f,p,"end",Math.min)}})}}return o}function Kr(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=kn(s),l=kn(l)),{property:n,start:s,end:l}}function gk(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=Na(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 Na(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Lf(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function e_(n,e){let t=[],i=!1;return Lt(n)?(i=!0,t=n):t=gk(n,e),t.length?new Ii({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function _k(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(!qt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function bk(n,e,t){const i=wk(n);if(pt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return qt(s)&&Math.floor(s)===s?vk(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function vk(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function yk(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:pt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function kk(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:pt(n)?i=n.value:i=e.getBaseValue(),i}function wk(n){const e=n.options,t=e.fill;let i=gt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function Sk(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=$k(e,t);r.push(e_({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++)Ck(s,o[f],r)}return new Ii({points:s,options:{}})}function $k(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 Ck(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=Mk(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function Mk(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(fl(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class t_{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:At},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 Tk(n){const{chart:e,fill:t,line:i}=n;if(qt(t))return Dk(e,t);if(t==="stack")return Sk(n);if(t==="shape")return!0;const s=Ok(n);return s instanceof t_?s:e_(s,i)}function Dk(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function Ok(n){return(n.scale||{}).getPointPositionForValue?Ek(n):Ak(n)}function Ak(n){const{scale:e={},fill:t}=n,i=yk(t,e);if(qt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function Ek(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=kk(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new t_({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 mr(n,e,t){const i=Tk(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&&(ka(n,t),Pk(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),wa(n))}function Pk(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&&(Ff(n,i,o.top),If(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),Ff(n,i,o.bottom)),If(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function Ff(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[Na(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 If(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=mk(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,Lk(n,o,p&&Kr(s,f,c)),n.beginPath();const g=!!t.pathSegment(n,a);let v;if(p){g?n.closePath():Nf(n,i,c,s);const b=!!i.pathSegment(n,u,{move:g,reverse:!0});v=g&&b,v||Nf(n,i,f,s)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function Lk(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 Nf(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var Fk={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:bk(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=_k(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&&mr(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;l&&mr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!i||i.fill===!1||t.drawTime!=="beforeDatasetDraw"||mr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const nl={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=Hr(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 Qn(n,e){return e&&(Lt(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function ci(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
`)>-1?n.split(`
`):n}function Ik(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 Rf(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,g=zn(e.padding);let v=g.height,b=0,y=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=p*C+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(C){b=Math.max(b,t.measureText(C).width+S)};return t.save(),t.font=u.string,$t(n.title,$),t.font=a.string,$t(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,$t(i,C=>{$t(C.before,$),$t(C.lines,$),$t(C.after,$)}),S=0,t.font=f.string,$t(n.footer,$),t.restore(),b+=g.width,{width:b,height:v}}function Nk(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Rk(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 Hk(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"),Rk(u,n,e,t)&&(u="center"),u}function Hf(n,e,t){const i=t.yAlign||e.yAlign||Nk(n,t);return{xAlign:t.xAlign||e.xAlign||Hk(n,e,t,i),yAlign:i}}function jk(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function qk(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function jf(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}=gs(o);let g=jk(e,r);const v=qk(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,p)+s),{x:sn(g,0,i.width-e.width),y:sn(v,0,i.height-e.height)}}function Jl(n,e,t){const i=zn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function qf(n){return Qn([],ci(n))}function Vk(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Vf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Zr extends vi{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 Fg(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Vk(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=Qn(r,ci(s)),r=Qn(r,ci(l)),r=Qn(r,ci(o)),r}getBeforeBody(e,t){return qf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return $t(e,l=>{const o={before:[],lines:[],after:[]},r=Vf(i,l);Qn(o.before,ci(r.beforeLabel.call(this,l))),Qn(o.lines,r.label.call(this,l)),Qn(o.after,ci(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return qf(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=Qn(r,ci(s)),r=Qn(r,ci(l)),r=Qn(r,ci(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(Ik(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))),$t(r,f=>{const c=Vf(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=nl[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=Rf(this,i),u=Object.assign({},r,a),f=Hf(this.chart,i,u),c=jf(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}=gs(r),{x:d,y:p}=e,{width:g,height:v}=t;let b,y,S,$,C,M;return l==="center"?(C=p+v/2,s==="left"?(b=d,y=b-o,$=C+o,M=C-o):(b=d+g,y=b+o,$=C-o,M=C+o),S=b):(s==="left"?y=d+Math.max(a,f)+o:s==="right"?y=d+g-Math.max(u,c)-o:y=this.caretX,l==="top"?($=p,C=$-o,b=y-o,S=y+o):($=p+v,C=$+o,b=y+o,S=y-o),M=$),{x1:b,x2:y,x3:S,y1:$,y2:C,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=or(i.rtl,this.x,this.width);for(e.x=Jl(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=Jl(this,"left",l),p=s.x(d),g=a<c.lineHeight?(c.lineHeight-a)/2:0,v=t.y+g;if(l.usePointStyle){const b={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},y=s.leftForLtr(p,u)+u/2,S=v+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,Vr(e,b,y,S),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Vr(e,b,y,S)}else{e.lineWidth=o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(p,u-f),y=s.leftForLtr(s.xPlus(p,1),u-f-2),S=gs(o.borderRadius);Object.values(S).some($=>$!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,wo(e,{x:b,y:v,w:u,h:a,radius:S}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),wo(e,{x:y,y:v+1,w:u-2,h:a-2,radius:S}),e.fill()):(e.fillStyle=l.multiKeyBackground,e.fillRect(b,v,u,a),e.strokeRect(b,v,u,a),e.fillStyle=o.backgroundColor,e.fillRect(y,v+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 g=or(i.rtl,this.x,this.width),v=function(O){t.fillText(O,g.x(e.x+p),e.y+d/2),e.y+=d+l},b=g.textAlign(o);let y,S,$,C,M,D,L;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Jl(this,b,i),t.fillStyle=i.bodyColor,$t(this.beforeBody,v),p=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,C=0,D=s.length;C<D;++C){for(y=s[C],S=this.labelTextColors[C],t.fillStyle=S,$t(y.before,v),$=y.lines,r&&$.length&&(this._drawColorBox(t,e,C,g,i),d=Math.max(c.lineHeight,a)),M=0,L=$.length;M<L;++M)v($[M]),d=c.lineHeight;$t(y.after,v)}p=0,d=c.lineHeight,$t(this.afterBody,v),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=or(i.rtl,this.x,this.width);for(e.x=Jl(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:g}=gs(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-g),t.quadraticCurveTo(r+u,a+f,r+u-g,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=nl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Rf(this,e),a=Object.assign({},o,this._size),u=Hf(t,e,a),f=jf(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=zn(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),sy(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),ly(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=!go(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||!go(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=nl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}Zr.positioners=nl;var zk={id:"tooltip",_element:Zr,positioners:nl,afterInit(n,e,t){t&&(n.tooltip=new Zr({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:ui,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:ui,beforeBody:ui,beforeLabel:ui,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 Ct(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:ui,afterBody:ui,beforeFooter:ui,footer:ui,afterFooter:ui}},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 Bk=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function Uk(n,e,t,i){const s=n.indexOf(e);if(s===-1)return Bk(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const Wk=(n,e)=>n===null?null:sn(Math.round(n),0,e);class Jr extends is{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(Ct(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:Uk(i,e,gt(t,e),this._addedLabels),Wk(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}}Jr.id="category";Jr.defaults={ticks:{callback:Jr.prototype.getLabelForValue}};function Yk(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,g=f-1,{min:v,max:b}=e,y=!Ct(o),S=!Ct(r),$=!Ct(u),C=(b-v)/(c+1);let M=Vu((b-v)/g/p)*p,D,L,O,F;if(M<1e-14&&!y&&!S)return[{value:v},{value:b}];F=Math.ceil(b/M)-Math.floor(v/M),F>g&&(M=Vu(F*M/g/p)*p),Ct(a)||(D=Math.pow(10,a),M=Math.ceil(M*D)/D),s==="ticks"?(L=Math.floor(v/M)*M,O=Math.ceil(b/M)*M):(L=v,O=b),y&&S&&l&&Ub((r-o)/l,M/1e3)?(F=Math.round(Math.min((r-o)/M,f)),M=(r-o)/F,L=o,O=r):$?(L=y?o:L,O=S?r:O,F=u-1,M=(O-L)/F):(F=(O-L)/M,xs(F,Math.round(F),M/1e3)?F=Math.round(F):F=Math.ceil(F));const E=Math.max(zu(M),zu(L));D=Math.pow(10,Ct(a)?E:a),L=Math.round(L*D)/D,O=Math.round(O*D)/D;let j=0;for(y&&(d&&L!==o?(t.push({value:o}),L<o&&j++,xs(Math.round((L+j*M)*D)/D,o,zf(o,C,n))&&j++):L<o&&j++);j<F;++j)t.push({value:Math.round((L+j*M)*D)/D});return S&&d&&O!==r?t.length&&xs(t[t.length-1].value,r,zf(r,C,n))?t[t.length-1].value=r:t.push({value:r}):(!S||O===r)&&t.push({value:O}),t}function zf(n,e,{horizontal:t,minRotation:i}){const s=Zn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class To extends is{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 Ct(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=ti(s),u=ti(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=Yk(s,l);return e.bounds==="ticks"&&pg(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 wl(e,this.chart.options.locale,this.options.ticks.format)}}class Ra extends To{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=qt(e)?e:0,this.max=qt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Zn(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}}Ra.id="linear";Ra.defaults={ticks:{callback:Vo.formatters.numeric}};function Bf(n){return n/Math.pow(10,Math.floor(In(n)))===1}function Kk(n,e){const t=Math.floor(In(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Pn(n.min,Math.pow(10,Math.floor(In(e.min)))),o=Math.floor(In(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:Bf(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=Pn(n.max,l);return s.push({value:u,major:Bf(l)}),s}class n_ extends is{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=To.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return qt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=qt(e)?Math.max(0,e):null,this.max=qt(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(In(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=Kk(t,this);return e.bounds==="ticks"&&pg(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":wl(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=In(e),this._valueRange=In(this.max)-In(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(In(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}n_.id="logarithmic";n_.defaults={ticks:{callback:Vo.formatters.logarithmic,major:{enabled:!0}}};function Gr(n){const e=n.ticks;if(e.display&&n.display){const t=zn(e.backdropPadding);return gt(e.font&&e.font.size,_t.font.size)+t.height}return 0}function Zk(n,e,t){return t=Lt(t)?t:[t],{w:_v(n,e.string,t),h:t.length*e.lineHeight}}function Uf(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 Jk(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?jt/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=Zk(n.ctx,c,n._pointLabels[a]);i[a]=d;const p=kn(n.getIndexAngle(a)+r),g=Math.round(_a(p)),v=Uf(g,f.x,d.w,0,180),b=Uf(g,f.y,d.h,90,270);Gk(t,e,p,v,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=Xk(n,i,s)}function Gk(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 Xk(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=Gr(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?jt/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(_a(kn(f.angle+Ht))),d=e[u],p=ew(f.y,d.h,c),g=Qk(c),v=xk(f.x,d.w,g);i.push({x:f.x,y:p,textAlign:g,left:v,top:p,right:v+d.w,bottom:p+d.h})}return i}function Qk(n){return n===0||n===180?"center":n<180?"left":"right"}function xk(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function ew(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function tw(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:g}=l;if(!Ct(g)){const v=gs(l.borderRadius),b=zn(l.backdropPadding);t.fillStyle=g;const y=f-b.left,S=c-b.top,$=d-f+b.width,C=p-c+b.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),wo(t,{x:y,y:S,w:$,h:C,radius:v}),t.fill()):t.fillRect(y,S,$,C)}ko(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function i_(n,e,t,i){const{ctx:s}=n;if(t)s.arc(n.xCenter,n.yCenter,e,0,At);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 nw(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(),i_(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function iw(n,e,t){return Fi(n,{label:t,index:e,type:"pointLabel"})}class Bo extends To{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=zn(Gr(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=qt(e)&&!isNaN(e)?e:0,this.max=qt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/Gr(this.options))}generateTickLabels(e){To.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=Rt(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?Jk(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=At/(this._pointLabels.length||1),i=this.options.startAngle||0;return kn(e*t+Zn(i))}getDistanceFromCenterForValue(e){if(Ct(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(Ct(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 iw(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-Ht+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(),i_(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&&tw(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));nw(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=zn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}ko(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Bo.id="radialLinear";Bo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Vo.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Bo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Bo.descriptors={angleLines:{_fallback:"grid"}};const Uo={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}},mn=Object.keys(Uo);function sw(n,e){return n-e}function Wf(n,e){if(Ct(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)),qt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(al(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function Yf(n,e,t,i){const s=mn.length;for(let l=mn.indexOf(n);l<s-1;++l){const o=Uo[mn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return mn[l]}return mn[s-1]}function lw(n,e,t,i,s){for(let l=mn.length-1;l>=mn.indexOf(t);l--){const o=mn[l];if(Uo[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return mn[t?mn.indexOf(t):0]}function ow(n){for(let e=mn.indexOf(n)+1,t=mn.length;e<t;++e)if(Uo[mn[e]].common)return mn[e]}function Kf(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=$a(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function rw(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 Zf(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:rw(n,i,s,t)}class Ml extends is{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 Hg._date(e.adapters.date);Qs(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:Wf(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=qt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=qt(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=Dv(s,l,o);return this._unit=t.unit||(i.autoSkip?Yf(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):lw(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:ow(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),Zf(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=sn(t,0,o),i=sn(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||Yf(l.minUnit,t,i,this._getLabelCapacity(t)),r=gt(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=al(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 g=s.ticks.source==="data"&&this.getDataTimestamps();for(d=c,p=0;d<i;d=+e.add(d,r,o),p++)Kf(f,d,g);return(d===i||s.bounds==="ticks"||p===1)&&Kf(f,d,g),Object.keys(f).sort((v,b)=>v-b).map(v=>+v)}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)),g=l.ticks.callback;return g?Rt(g,[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=Zn(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,Zf(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(Wf(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Sg(e.sort(sw))}}Ml.id="time";Ml.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};function Gl(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}=Ji(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}=Ji(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 s_ extends Ml{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=Gl(t,this.min),this._tableRange=Gl(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(Gl(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Gl(this._table,i*this._tableRange+this._minPos,!0)}}s_.id="timeseries";s_.defaults=Ml.defaults;/*!
* chartjs-adapter-luxon v1.1.0
* https://www.chartjs.org
* (c) 2021 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const aw={datetime:et.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:et.TIME_WITH_SECONDS,minute:et.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Hg._date.override({_id:"luxon",_create:function(n){return et.fromMillis(n,this.options)},formats:function(){return aw},parse:function(n,e){const t=this.options;if(n===null||typeof n>"u")return null;const i=typeof n;return i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=et.fromFormat(n,e,t):n=et.fromISO(n,t):n instanceof Date?n=et.fromJSDate(n,t):i==="object"&&!(n instanceof et)&&(n=et.fromObject(n)),n.isValid?n.valueOf():null},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e,this.options):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 Jf(n){let e,t,i;return{c(){e=_("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=at(e,qn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,qn,{duration:150},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function uw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=R(n[1]),t=T(),s=R(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&be(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&be(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function fw(n){let e;return{c(){e=R("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function cw(n){let e,t,i,s,l,o,r=n[2]&&Jf();function a(c,d){return c[2]?fw:uw}let u=a(n),f=u(n);return{c(){e=_("div"),r&&r.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),f.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Wa(i,"height","250px"),Wa(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),X(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(c,d){w(c,e,d),r&&r.m(e,null),m(e,t),m(e,i),n[8](i),w(c,s,d),w(c,l,d),f.m(l,null),o=!0},p(c,[d]){c[2]?r?d&4&&A(r,1):(r=Jf(),r.c(),A(r,1),r.m(e,t)):r&&(Te(),P(r,1,1,()=>{r=null}),De()),d&4&&X(e,"loading",c[2]),u===(u=a(c))&&f?f.p(c,d):(f.d(1),f=u(c),f&&(f.c(),f.m(l,null)))},i(c){o||(A(r),o=!0)},o(c){P(r),o=!1},d(c){c&&k(e),r&&r.d(),n[8](null),c&&k(s),c&&k(l),f.d()}}}function dw(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),Se.Logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let g of p)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),Se.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Un(()=>(Mo.register(Ii,zo,$l,Ra,Ml,Fk,zk),t(6,o=new Mo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,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){ge[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 hw extends Ee{constructor(e){super(),Ae(this,e,dw,cw,Oe,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Gf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},l_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S($,C){C=C||{};var M,D;switch(r.util.type($)){case"Object":if(D=r.util.objId($),C[D])return C[D];M={},C[D]=M;for(var L in $)$.hasOwnProperty(L)&&(M[L]=S($[L],C));return M;case"Array":return D=r.util.objId($),C[D]?C[D]:(M=[],C[D]=M,$.forEach(function(O,F){M[F]=S(O,C)}),M);default:return $}},getLanguage:function(S){for(;S;){var $=s.exec(S.className);if($)return $[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,$){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var C in $)if($[C].src==S)return $[C]}return null}},isActive:function(S,$,C){for(var M="no-"+$;S;){var D=S.classList;if(D.contains($))return!0;if(D.contains(M))return!1;S=S.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var C=r.util.clone(r.languages[S]);for(var M in $)C[M]=$[M];return C},insertBefore:function(S,$,C,M){M=M||r.languages;var D=M[S],L={};for(var O in D)if(D.hasOwnProperty(O)){if(O==$)for(var F in C)C.hasOwnProperty(F)&&(L[F]=C[F]);C.hasOwnProperty(O)||(L[O]=D[O])}var E=M[S];return M[S]=L,r.languages.DFS(r.languages,function(j,U){U===E&&j!=S&&(this[j]=L)}),L},DFS:function S($,C,M,D){D=D||{};var L=r.util.objId;for(var O in $)if($.hasOwnProperty(O)){C.call($,O,$[O],M||O);var F=$[O],E=r.util.type(F);E==="Object"&&!D[L(F)]?(D[L(F)]=!0,S(F,C,null,D)):E==="Array"&&!D[L(F)]&&(D[L(F)]=!0,S(F,C,O,D))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,C){var M={callback:C,container:S,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 D=0,L;L=M.elements[D++];)r.highlightElement(L,$===!0,M.callback)},highlightElement:function(S,$,C){var M=r.util.getLanguage(S),D=r.languages[M];r.util.setLanguage(S,M);var L=S.parentElement;L&&L.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(L,M);var O=S.textContent,F={element:S,language:M,grammar:D,code:O};function E(U){F.highlightedCode=U,r.hooks.run("before-insert",F),F.element.innerHTML=F.highlightedCode,r.hooks.run("after-highlight",F),r.hooks.run("complete",F),C&&C.call(F.element)}if(r.hooks.run("before-sanity-check",F),L=F.element.parentElement,L&&L.nodeName.toLowerCase()==="pre"&&!L.hasAttribute("tabindex")&&L.setAttribute("tabindex","0"),!F.code){r.hooks.run("complete",F),C&&C.call(F.element);return}if(r.hooks.run("before-highlight",F),!F.grammar){E(r.util.encode(F.code));return}if($&&i.Worker){var j=new Worker(r.filename);j.onmessage=function(U){E(U.data)},j.postMessage(JSON.stringify({language:F.language,code:F.code,immediateClose:!0}))}else E(r.highlight(F.code,F.grammar,F.language))},highlight:function(S,$,C){var M={code:S,grammar:$,language:C};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(S,$){var C=$.rest;if(C){for(var M in C)$[M]=C[M];delete $.rest}var D=new c;return d(D,D.head,S),f(S,D,$,D.head,0),g(D)},hooks:{all:{},add:function(S,$){var C=r.hooks.all;C[S]=C[S]||[],C[S].push($)},run:function(S,$){var C=r.hooks.all[S];if(!(!C||!C.length))for(var M=0,D;D=C[M++];)D($)}},Token:a};i.Prism=r;function a(S,$,C,M){this.type=S,this.content=$,this.alias=C,this.length=(M||"").length|0}a.stringify=function S($,C){if(typeof $=="string")return $;if(Array.isArray($)){var M="";return $.forEach(function(E){M+=S(E,C)}),M}var D={type:$.type,content:S($.content,C),tag:"span",classes:["token",$.type],attributes:{},language:C},L=$.alias;L&&(Array.isArray(L)?Array.prototype.push.apply(D.classes,L):D.classes.push(L)),r.hooks.run("wrap",D);var O="";for(var F in D.attributes)O+=" "+F+'="'+(D.attributes[F]||"").replace(/"/g,"&quot;")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+O+">"+D.content+"</"+D.tag+">"};function u(S,$,C,M){S.lastIndex=$;var D=S.exec(C);if(D&&M&&D[1]){var L=D[1].length;D.index+=L,D[0]=D[0].slice(L)}return D}function f(S,$,C,M,D,L){for(var O in C)if(!(!C.hasOwnProperty(O)||!C[O])){var F=C[O];F=Array.isArray(F)?F:[F];for(var E=0;E<F.length;++E){if(L&&L.cause==O+","+E)return;var j=F[E],U=j.inside,Q=!!j.lookbehind,te=!!j.greedy,H=j.alias;if(te&&!j.pattern.global){var Y=j.pattern.toString().match(/[imsuy]*$/)[0];j.pattern=RegExp(j.pattern.source,Y+"g")}for(var K=j.pattern||j,Z=M.next,ee=D;Z!==$.tail&&!(L&&ee>=L.reach);ee+=Z.value.length,Z=Z.next){var ae=Z.value;if($.length>S.length)return;if(!(ae instanceof a)){var ve=1,le;if(te){if(le=u(K,ee,S,Q),!le||le.index>=S.length)break;var fe=le.index,me=le.index+le[0].length,re=ee;for(re+=Z.value.length;fe>=re;)Z=Z.next,re+=Z.value.length;if(re-=Z.value.length,ee=re,Z.value instanceof a)continue;for(var de=Z;de!==$.tail&&(re<me||typeof de.value=="string");de=de.next)ve++,re+=de.value.length;ve--,ae=S.slice(ee,re),le.index-=ee}else if(le=u(K,0,ae,Q),!le)continue;var fe=le.index,ie=le[0],x=ae.slice(0,fe),ye=ae.slice(fe+ie.length),He=ee+ae.length;L&&He>L.reach&&(L.reach=He);var Le=Z.prev;x&&(Le=d($,Le,x),ee+=x.length),p($,Le,ve);var Pe=new a(O,U?r.tokenize(ie,U):ie,H,ie);if(Z=d($,Le,Pe),ye&&d($,Z,ye),ve>1){var ue={cause:O+","+E,reach:He};f(S,$,C,Z.prev,ee,ue),L&&ue.reach>L.reach&&(L.reach=ue.reach)}}}}}}function c(){var S={value:null,prev:null,next:null},$={value:null,prev:S,next:null};S.next=$,this.head=S,this.tail=$,this.length=0}function d(S,$,C){var M=$.next,D={value:C,prev:$,next:M};return $.next=D,M.prev=D,S.length++,D}function p(S,$,C){for(var M=$.next,D=0;D<C&&M!==S.tail;D++)M=M.next;$.next=M,M.prev=$,S.length-=D}function g(S){for(var $=[],C=S.head.next;C!==S.tail;)$.push(C.value),C=C.next;return $}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(S){var $=JSON.parse(S.data),C=$.language,M=$.code,D=$.immediateClose;i.postMessage(r.highlight(M,r.languages[C],C)),D&&i.close()},!1)),r;var v=r.util.currentScript();v&&(r.filename=v.src,v.hasAttribute("data-manual")&&(r.manual=!0));function b(){r.manual||r.highlightAll()}if(!r.manual){var y=document.readyState;y==="loading"||y==="interactive"&&v&&v.defer?document.addEventListener("DOMContentLoaded",b):window.requestAnimationFrame?window.requestAnimationFrame(b):window.setTimeout(b,16)}return r}(e);n.exports&&(n.exports=t),typeof Gf<"u"&&(Gf.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"},/"|'/]}},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:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,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\u2026",s=function(v,b){return"\u2716 Error "+v+" while fetching file: "+b},l="\u2716 Error: File does not exist or is empty",o={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},r="data-src-status",a="loading",u="loaded",f="failed",c="pre[data-src]:not(["+r+'="'+u+'"]):not(['+r+'="'+a+'"])';function d(v,b,y){var S=new XMLHttpRequest;S.open("GET",v,!0),S.onreadystatechange=function(){S.readyState==4&&(S.status<400&&S.responseText?b(S.responseText):S.status>=400?y(s(S.status,S.statusText)):y(l))},S.send(null)}function p(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),S=b[2],$=b[3];return S?$?[y,Number($)]:[y,void 0]:[y,y]}}t.hooks.add("before-highlightall",function(v){v.selector+=", "+c}),t.hooks.add("before-sanity-check",function(v){var b=v.element;if(b.matches(c)){v.code="",b.setAttribute(r,a);var y=b.appendChild(document.createElement("CODE"));y.textContent=i;var S=b.getAttribute("data-src"),$=v.language;if($==="none"){var C=(/\.(\w+)$/.exec(S)||[,"none"])[1];$=o[C]||C}t.util.setLanguage(y,$),t.util.setLanguage(b,$);var M=t.plugins.autoloader;M&&M.loadLanguages($),d(S,function(D){b.setAttribute(r,u);var L=p(b.getAttribute("data-range"));if(L){var O=D.split(/\r\n?|\n/g),F=L[0],E=L[1]==null?O.length:L[1];F<0&&(F+=O.length),F=Math.max(0,Math.min(F-1,O.length)),E<0&&(E+=O.length),E=Math.max(0,Math.min(E,O.length)),D=O.slice(F,E).join(`
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(F+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),S=0,$;$=y[S++];)t.highlightElement($)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(l_);const Vs=l_.exports;var pw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
`+u[c],f=d)}r[a]=u.join("")}return r.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(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var p=a[d];p==l.element?c=!0:p.nodeName==="#text"&&(c?f+=p.nodeValue:u+=p.nodeValue,r.removeChild(p),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(pw);function mw(n){let e,t;return{c(){e=_("div"),t=_("code"),h(t,"class","svelte-tv7jme"),h(e,"class","code-wrapper prism-light svelte-tv7jme")},m(i,s){w(i,e,s),m(e,t),t.innerHTML=n[0]},p(i,[s]){s&1&&(t.innerHTML=i[0])},i:oe,o:oe,d(i){i&&k(e)}}}function gw(n,e,t){let{content:i=""}=e,{language:s="javascript"}=e,l="";function o(r){return r=typeof r=="string"?r:"",r=Vs.plugins.NormalizeWhitespace.normalize(r,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Vs.highlight(r,Vs.languages[s]||Vs.languages.javascript,s)}return n.$$set=r=>{"content"in r&&t(1,i=r.content),"language"in r&&t(2,s=r.language)},n.$$.update=()=>{n.$$.dirty&2&&typeof Vs<"u"&&i&&t(0,l=o(i))},[l,i,s]}class en extends Ee{constructor(e){super(),Ae(this,e,gw,mw,Oe,{content:1,language:2})}}const _w=n=>({}),Xf=n=>({}),bw=n=>({}),Qf=n=>({});function xf(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$=n[4]&&!n[2]&&ec(n);const C=n[18].header,M=$n(C,n,n[17],Qf);let D=n[4]&&n[2]&&tc(n);const L=n[18].default,O=$n(L,n,n[17],null),F=n[18].footer,E=$n(F,n,n[17],Xf);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),$&&$.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),E&&E.c(),h(t,"class","overlay"),h(o,"class","overlay-panel-section panel-header"),h(f,"class","overlay-panel-section panel-content"),h(d,"class","overlay-panel-section panel-footer"),h(l,"class",p="overlay-panel "+n[1]+" "+n[8]),X(l,"popup",n[2]),h(e,"class","overlay-panel-container"),X(e,"padded",n[2]),X(e,"active",n[0])},m(j,U){w(j,e,U),m(e,t),m(e,s),m(e,l),m(l,o),$&&$.m(o,null),m(o,r),M&&M.m(o,null),m(o,a),D&&D.m(o,null),m(l,u),m(l,f),O&&O.m(f,null),n[20](f),m(l,c),m(l,d),E&&E.m(d,null),b=!0,y||(S=[G(t,"click",Vt(n[19])),G(f,"scroll",n[21])],y=!0)},p(j,U){n=j,n[4]&&!n[2]?$?$.p(n,U):($=ec(n),$.c(),$.m(o,r)):$&&($.d(1),$=null),M&&M.p&&(!b||U&131072)&&Mn(M,C,n,n[17],b?Cn(C,n[17],U,bw):Tn(n[17]),Qf),n[4]&&n[2]?D?D.p(n,U):(D=tc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||U&131072)&&Mn(O,L,n,n[17],b?Cn(L,n[17],U,null):Tn(n[17]),null),E&&E.p&&(!b||U&131072)&&Mn(E,F,n,n[17],b?Cn(F,n[17],U,_w):Tn(n[17]),Xf),(!b||U&258&&p!==(p="overlay-panel "+n[1]+" "+n[8]))&&h(l,"class",p),U&262&&X(l,"popup",n[2]),U&4&&X(e,"padded",n[2]),U&1&&X(e,"active",n[0])},i(j){b||(Tt(()=>{i||(i=at(t,mo,{duration:hs,opacity:0},!0)),i.run(1)}),A(M,j),A(O,j),A(E,j),Tt(()=>{v&&v.end(1),g=Jp(l,jn,n[2]?{duration:hs,y:-10}:{duration:hs,x:50}),g.start()}),b=!0)},o(j){i||(i=at(t,mo,{duration:hs,opacity:0},!1)),i.run(0),P(M,j),P(O,j),P(E,j),g&&g.invalidate(),v=Gp(l,jn,n[2]?{duration:hs,y:10}:{duration:hs,x:50}),b=!1},d(j){j&&k(e),j&&i&&i.end(),$&&$.d(),M&&M.d(j),D&&D.d(),O&&O.d(j),n[20](null),E&&E.d(j),j&&v&&v.end(),y=!1,lt(S)}}}function ec(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Vt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function tc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary btn-close m-l-auto")},m(s,l){w(s,e,l),t||(i=G(e,"click",Vt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function vw(n){let e,t,i,s,l=n[0]&&xf(n);return{c(){e=_("div"),l&&l.c(),h(e,"class","overlay-panel-wrapper")},m(o,r){w(o,e,r),l&&l.m(e,null),n[22](e),t=!0,i||(s=[G(window,"resize",n[10]),G(window,"keydown",n[9])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=xf(o),l.c(),A(l,1),l.m(e,null)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[22](null),i=!1,lt(s)}}}let Bi;function o_(){return Bi=Bi||document.querySelector(".overlays"),Bi||(Bi=document.createElement("div"),Bi.classList.add("overlays"),document.body.appendChild(Bi)),Bi}let hs=150;function nc(){return 1e3+o_().querySelectorAll(".overlay-panel-container.active").length}function yw(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=rn();let g,v,b,y,S="";function $(){typeof c=="function"&&c()===!1||t(0,o=!0)}function C(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(H){H?(b=document.activeElement,g==null||g.focus(),p("show")):(clearTimeout(y),b==null||b.focus(),p("hide")),await li(),L()}function L(){!g||(o?t(6,g.style.zIndex=nc(),g):t(6,g.style="",g))}function O(H){o&&f&&H.code=="Escape"&&!W.isInput(H.target)&&g&&g.style.zIndex==nc()&&(H.preventDefault(),C())}function F(H){o&&E(v)}function E(H,Y){Y&&t(8,S=""),H&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!H)return;if(H.scrollHeight-H.offsetHeight>0)t(8,S="scrollable");else{t(8,S="");return}H.scrollTop==0?t(8,S+=" scroll-top-reached"):H.scrollTop+H.offsetHeight==H.scrollHeight&&t(8,S+=" scroll-bottom-reached")},100)))}Un(()=>(o_().appendChild(g),()=>{var H;clearTimeout(y),(H=g==null?void 0:g.classList)==null||H.add("hidden")}));const j=()=>a?C():!0;function U(H){ge[H?"unshift":"push"](()=>{v=H,t(7,v)})}const Q=H=>E(H.target);function te(H){ge[H?"unshift":"push"](()=>{g=H,t(6,g)})}return n.$$set=H=>{"class"in H&&t(1,l=H.class),"active"in H&&t(0,o=H.active),"popup"in H&&t(2,r=H.popup),"overlayClose"in H&&t(3,a=H.overlayClose),"btnClose"in H&&t(4,u=H.btnClose),"escClose"in H&&t(12,f=H.escClose),"beforeOpen"in H&&t(13,c=H.beforeOpen),"beforeHide"in H&&t(14,d=H.beforeHide),"$$scope"in H&&t(17,s=H.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&D(o),n.$$.dirty&128&&E(v,!0),n.$$.dirty&64&&g&&L()},[o,l,r,a,u,C,g,v,S,O,F,E,f,c,d,$,M,s,i,j,U,Q,te]}class yi extends Ee{constructor(e){super(),Ae(this,e,yw,vw,Oe,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16})}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function kw(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function ww(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=R(t),h(e,"href",s=n[2].referer),h(e,"target","_blank"),h(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&be(i,t),o&4&&s!==(s=l[2].referer)&&h(e,"href",s)},d(l){l&&k(e)}}}function Sw(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function $w(n){let e,t;return e=new en({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Cw(n){var Xn;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,p,g,v=n[2].status+"",b,y,S,$,C,M,D=((Xn=n[2].method)==null?void 0:Xn.toUpperCase())+"",L,O,F,E,j,U,Q=n[2].auth+"",te,H,Y,K,Z,ee,ae=n[2].url+"",ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe=n[2].ip+"",ue,ce,ke,Be,Ke,Ue,Je=n[2].userAgent+"",xe,J,se,pe,Ve,Ge,bt,rt,ut,yt,Pt,Zt,_e,we,Ze,nt;function Et(ct,N){return ct[2].referer?ww:kw}let he=Et(n),$e=he(n);const Xe=[$w,Sw],Jt=[];function zt(ct,N){return N&4&&(bt=null),bt==null&&(bt=!W.isEmpty(ct[2].meta)),bt?0:1}return rt=zt(n,-1),ut=Jt[rt]=Xe[rt](n),Ze=new gi({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=T(),o=_("td"),a=R(r),u=T(),f=_("tr"),c=_("td"),c.textContent="Status",d=T(),p=_("td"),g=_("span"),b=R(v),y=T(),S=_("tr"),$=_("td"),$.textContent="Method",C=T(),M=_("td"),L=R(D),O=T(),F=_("tr"),E=_("td"),E.textContent="Auth",j=T(),U=_("td"),te=R(Q),H=T(),Y=_("tr"),K=_("td"),K.textContent="URL",Z=T(),ee=_("td"),ve=R(ae),le=T(),me=_("tr"),re=_("td"),re.textContent="Referer",de=T(),fe=_("td"),$e.c(),ie=T(),x=_("tr"),ye=_("td"),ye.textContent="IP",He=T(),Le=_("td"),ue=R(Pe),ce=T(),ke=_("tr"),Be=_("td"),Be.textContent="UserAgent",Ke=T(),Ue=_("td"),xe=R(Je),J=T(),se=_("tr"),pe=_("td"),pe.textContent="Meta",Ve=T(),Ge=_("td"),ut.c(),yt=T(),Pt=_("tr"),Zt=_("td"),Zt.textContent="Created",_e=T(),we=_("td"),z(Ze.$$.fragment),h(s,"class","min-width txt-hint txt-bold"),h(c,"class","min-width txt-hint txt-bold"),h(g,"class","label"),X(g,"label-danger",n[2].status>=400),h($,"class","min-width txt-hint txt-bold"),h(E,"class","min-width txt-hint txt-bold"),h(K,"class","min-width txt-hint txt-bold"),h(re,"class","min-width txt-hint txt-bold"),h(ye,"class","min-width txt-hint txt-bold"),h(Be,"class","min-width txt-hint txt-bold"),h(pe,"class","min-width txt-hint txt-bold"),h(Zt,"class","min-width txt-hint txt-bold"),h(e,"class","table-compact table-border")},m(ct,N){w(ct,e,N),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,a),m(t,u),m(t,f),m(f,c),m(f,d),m(f,p),m(p,g),m(g,b),m(t,y),m(t,S),m(S,$),m(S,C),m(S,M),m(M,L),m(t,O),m(t,F),m(F,E),m(F,j),m(F,U),m(U,te),m(t,H),m(t,Y),m(Y,K),m(Y,Z),m(Y,ee),m(ee,ve),m(t,le),m(t,me),m(me,re),m(me,de),m(me,fe),$e.m(fe,null),m(t,ie),m(t,x),m(x,ye),m(x,He),m(x,Le),m(Le,ue),m(t,ce),m(t,ke),m(ke,Be),m(ke,Ke),m(ke,Ue),m(Ue,xe),m(t,J),m(t,se),m(se,pe),m(se,Ve),m(se,Ge),Jt[rt].m(Ge,null),m(t,yt),m(t,Pt),m(Pt,Zt),m(Pt,_e),m(Pt,we),q(Ze,we,null),nt=!0},p(ct,N){var ne;(!nt||N&4)&&r!==(r=ct[2].id+"")&&be(a,r),(!nt||N&4)&&v!==(v=ct[2].status+"")&&be(b,v),N&4&&X(g,"label-danger",ct[2].status>=400),(!nt||N&4)&&D!==(D=((ne=ct[2].method)==null?void 0:ne.toUpperCase())+"")&&be(L,D),(!nt||N&4)&&Q!==(Q=ct[2].auth+"")&&be(te,Q),(!nt||N&4)&&ae!==(ae=ct[2].url+"")&&be(ve,ae),he===(he=Et(ct))&&$e?$e.p(ct,N):($e.d(1),$e=he(ct),$e&&($e.c(),$e.m(fe,null))),(!nt||N&4)&&Pe!==(Pe=ct[2].ip+"")&&be(ue,Pe),(!nt||N&4)&&Je!==(Je=ct[2].userAgent+"")&&be(xe,Je);let I=rt;rt=zt(ct,N),rt===I?Jt[rt].p(ct,N):(Te(),P(Jt[I],1,1,()=>{Jt[I]=null}),De(),ut=Jt[rt],ut?ut.p(ct,N):(ut=Jt[rt]=Xe[rt](ct),ut.c()),A(ut,1),ut.m(Ge,null));const B={};N&4&&(B.date=ct[2].created),Ze.$set(B)},i(ct){nt||(A(ut),A(Ze.$$.fragment,ct),nt=!0)},o(ct){P(ut),P(Ze.$$.fragment,ct),nt=!1},d(ct){ct&&k(e),$e.d(),Jt[rt].d(),V(Ze)}}}function Mw(n){let e;return{c(){e=_("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Tw(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[4]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Dw(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[Tw],header:[Mw],default:[Cw]},$$scope:{ctx:n}};return e=new yi({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){z(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){P(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function Ow(n,e,t){let i,s=new Mr;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){ge[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){dt.call(this,n,c)}function f(c){dt.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class Aw extends Ee{constructor(e){super(),Ae(this,e,Ow,Dw,Oe,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function Ew(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Include requests by admins"),h(e,"type","checkbox"),h(e,"id",t=n[13]),h(s,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[7]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&h(e,"id",t),f&1&&(e.checked=u[0]),f&8192&&o!==(o=u[13])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function ic(n){let e,t,i;function s(o){n[9](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new hw({props:l}),ge.push(()=>Ie(e,"filter",s)),{c(){z(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],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function sc(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 Eb({props:l}),ge.push(()=>Ie(e,"filter",s)),e.$on("select",n[11]),{c(){z(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],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Pw(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y=n[3],S,$=n[3],C,M,D;o=new jo({}),o.$on("refresh",n[6]),c=new Fe({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[Ew,({uniqueId:E})=>({13:E}),({uniqueId:E})=>E?8192:0]},$$scope:{ctx:n}}}),p=new Ho({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","ip","referer","status","auth","userAgent"]}}),p.$on("submit",n[8]);let L=ic(n),O=sc(n),F={};return M=new Aw({props:F}),n[12](M),{c(){e=_("main"),t=_("div"),i=_("header"),s=_("nav"),s.innerHTML='<div class="breadcrumb-item">Request logs</div>',l=T(),z(o.$$.fragment),r=T(),a=_("div"),u=T(),f=_("div"),z(c.$$.fragment),d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=T(),L.c(),S=T(),O.c(),C=T(),z(M.$$.fragment),h(s,"class","breadcrumbs"),h(a,"class","flex-fill"),h(f,"class","inline-flex"),h(i,"class","page-header"),h(v,"class","clearfix m-b-xs"),h(t,"class","page-header-wrapper m-b-0"),h(e,"class","page-wrapper")},m(E,j){w(E,e,j),m(e,t),m(t,i),m(i,s),m(i,l),q(o,i,null),m(i,r),m(i,a),m(i,u),m(i,f),q(c,f,null),m(t,d),q(p,t,null),m(t,g),m(t,v),m(t,b),L.m(t,null),m(e,S),O.m(e,null),w(E,C,j),q(M,E,j),D=!0},p(E,[j]){const U={};j&24577&&(U.$$scope={dirty:j,ctx:E}),c.$set(U);const Q={};j&4&&(Q.value=E[2]),p.$set(Q),j&8&&Oe(y,y=E[3])?(Te(),P(L,1,1,oe),De(),L=ic(E),L.c(),A(L,1),L.m(t,null)):L.p(E,j),j&8&&Oe($,$=E[3])?(Te(),P(O,1,1,oe),De(),O=sc(E),O.c(),A(O,1),O.m(e,null)):O.p(E,j);const te={};M.$set(te)},i(E){D||(A(o.$$.fragment,E),A(c.$$.fragment,E),A(p.$$.fragment,E),A(L),A(O),A(M.$$.fragment,E),D=!0)},o(E){P(o.$$.fragment,E),P(c.$$.fragment,E),P(p.$$.fragment,E),P(L),P(O),P(M.$$.fragment,E),D=!1},d(E){E&&k(e),V(o),V(c),V(p),L.d(E),O.d(E),E&&k(C),n[12](null),V(M,E)}}}const lc="includeAdminLogs";function Lw(n,e,t){var b;let i,s,l="",o=((b=window.localStorage)==null?void 0:b.getItem(lc))<<0,r=1;function a(){t(3,r++,r)}W.setDocumentTitle("Request logs");const u=()=>a();function f(){o=this.checked,t(0,o)}const c=y=>t(2,l=y.detail);function d(y){l=y,t(2,l)}function p(y){l=y,t(2,l)}const g=y=>s==null?void 0:s.show(y==null?void 0:y.detail);function v(y){ge[y?"unshift":"push"](()=>{s=y,t(1,s)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=o?"":'auth!="admin"'),n.$$.dirty&1&&typeof o<"u"&&window.localStorage&&window.localStorage.setItem(lc,o<<0)},[o,s,l,r,i,a,u,f,c,d,p,g,v]}class Fw extends Ee{constructor(e){super(),Ae(this,e,Lw,Pw,Oe,{})}}const Ss=bi([]),ni=bi({}),Xr=bi(!1);function Iw(n){ni.update(e=>W.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Ss.update(e=>(W.pushOrReplaceByKey(e,n,"id"),e))}function Nw(n){Ss.update(e=>(W.removeByKey(e,"id",n.id),ni.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function Rw(n=null){return Xr.set(!0),ni.set({}),Ss.set([]),Se.Collections.getFullList(200,{sort:"+created"}).then(e=>{Ss.set(e);const t=n&&W.findByKey(e,"id",n);if(t)ni.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&ni.set(i)}}).catch(e=>{Se.errorResponseHandler(e)}).finally(()=>{Xr.set(!1)})}const Ha=bi({});function _i(n,e,t){Ha.set({text:n,yesCallback:e,noCallback:t})}function r_(){Ha.set({})}function oc(n){let e,t,i,s;const l=n[13].default,o=$n(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),h(e,"class",n[1]),X(e,"active",n[0])},m(r,a){w(r,e,a),o&&o.m(e,null),s=!0},p(r,a){o&&o.p&&(!s||a&4096)&&Mn(o,l,r,r[12],s?Cn(l,r[12],a,null):Tn(r[12]),null),(!s||a&2)&&h(e,"class",r[1]),a&3&&X(e,"active",r[0])},i(r){s||(A(o,r),r&&Tt(()=>{i&&i.end(1),t=Jp(e,jn,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=Gp(e,jn,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function Hw(n){let e,t,i,s,l=n[0]&&oc(n);return{c(){e=_("div"),l&&l.c(),h(e,"class","toggler-container")},m(o,r){w(o,e,r),l&&l.m(e,null),n[14](e),t=!0,i||(s=[G(window,"click",n[3]),G(window,"keydown",n[4]),G(window,"focusin",n[5])],i=!0)},p(o,[r]){o[0]?l?(l.p(o,r),r&1&&A(l,1)):(l=oc(o),l.c(),A(l,1),l.m(e,null)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){t||(A(l),t=!0)},o(o){P(l),t=!1},d(o){o&&k(e),l&&l.d(),n[14](null),i=!1,lt(s)}}}function jw(n,e,t){let{$$slots:i={},$$scope:s}=e,{trigger:l=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{closableClass:a="closable"}=e,{class:u=""}=e,f;const c=rn();function d(){t(0,o=!1)}function p(){t(0,o=!0)}function g(){o?d():p()}function v(D){return!f||D.classList.contains(a)||(l==null?void 0:l.contains(D))&&!f.contains(D)||f.contains(D)&&D.closest&&D.closest("."+a)}function b(D){(!o||v(D.target))&&(D.preventDefault(),g())}function y(D){(D.code==="Enter"||D.code==="Space")&&(!o||v(D.target))&&(D.preventDefault(),D.stopPropagation(),g())}function S(D){o&&!(f!=null&&f.contains(D.target))&&!(l!=null&&l.contains(D.target))&&d()}function $(D){o&&r&&D.code=="Escape"&&(D.preventDefault(),d())}function C(D){return S(D)}Un(()=>(t(6,l=l||f.parentNode),l.addEventListener("click",b),l.addEventListener("keydown",y),()=>{l.removeEventListener("click",b),l.removeEventListener("keydown",y)}));function M(D){ge[D?"unshift":"push"](()=>{f=D,t(2,f)})}return n.$$set=D=>{"trigger"in D&&t(6,l=D.trigger),"active"in D&&t(0,o=D.active),"escClose"in D&&t(7,r=D.escClose),"closableClass"in D&&t(8,a=D.closableClass),"class"in D&&t(1,u=D.class),"$$scope"in D&&t(12,s=D.$$scope)},n.$$.update=()=>{var D,L;n.$$.dirty&65&&(o?((D=l==null?void 0:l.classList)==null||D.add("active"),c("show")):((L=l==null?void 0:l.classList)==null||L.remove("active"),c("hide")))},[o,u,f,S,$,C,l,r,a,d,p,g,s,i,M]}class ss extends Ee{constructor(e){super(),Ae(this,e,jw,Hw,Oe,{trigger:6,active:0,escClose:7,closableClass:8,class:1,hide:9,show:10,toggle:11})}get hide(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}get toggle(){return this.$$.ctx[11]}}const qw=n=>({active:n&1}),rc=n=>({active:n[0]});function ac(n){let e,t,i;const s=n[12].default,l=$n(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&2048)&&Mn(l,s,o,o[11],i?Cn(s,o[11],r,null):Tn(o[11]),null)},i(o){i||(A(l,o),o&&Tt(()=>{t||(t=at(e,Xt,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=at(e,Xt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function Vw(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=$n(u,n,n[11],rc);let c=n[0]&&ac(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=T(),c&&c.c(),h(t,"class","accordion-header"),X(t,"interactive",n[2]),h(e,"tabindex",s=n[2]?0:-1),h(e,"class",l="accordion "+n[1]),X(e,"active",n[0])},m(d,p){w(d,e,p),m(e,t),f&&f.m(t,null),m(e,i),c&&c.m(e,null),n[14](e),o=!0,r||(a=[G(t,"click",Vt(n[13])),G(e,"keydown",Bp(n[5]))],r=!0)},p(d,[p]){f&&f.p&&(!o||p&2049)&&Mn(f,u,d,d[11],o?Cn(u,d[11],p,qw):Tn(d[11]),rc),p&4&&X(t,"interactive",d[2]),d[0]?c?(c.p(d,p),p&1&&A(c,1)):(c=ac(d),c.c(),A(c,1),c.m(e,null)):c&&(Te(),P(c,1,1,()=>{c=null}),De()),(!o||p&4&&s!==(s=d[2]?0:-1))&&h(e,"tabindex",s),(!o||p&2&&l!==(l="accordion "+d[1]))&&h(e,"class",l),p&3&&X(e,"active",d[0])},i(d){o||(A(f,d),A(c),o=!0)},o(d){P(f,d),P(c),o=!1},d(d){d&&k(e),f&&f.d(d),c&&c.d(),n[14](null),r=!1,lt(a)}}}function zw(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=rn();let o,r,{class:a=""}=e,{active:u=!1}=e,{interactive:f=!0}=e,{single:c=!1}=e;function d(){v(),t(0,u=!0),l("expand")}function p(){t(0,u=!1),clearTimeout(r),l("collapse")}function g(){l("toggle"),u?p():d()}function v(){if(c&&o.parentElement){const $=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const C of $)C.click()}}function b($){!f||($.code==="Enter"||$.code==="Space")&&($.preventDefault(),g())}Un(()=>()=>clearTimeout(r));const y=()=>f&&g();function S($){ge[$?"unshift":"push"](()=>{o=$,t(4,o)})}return n.$$set=$=>{"class"in $&&t(1,a=$.class),"active"in $&&t(0,u=$.active),"interactive"in $&&t(2,f=$.interactive),"single"in $&&t(6,c=$.single),"$$scope"in $&&t(11,s=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1041&&u&&(clearTimeout(r),t(10,r=setTimeout(()=>{o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},250)))},[u,a,f,g,o,b,c,d,p,v,r,s,i,y,S]}class ja extends Ee{constructor(e){super(),Ae(this,e,zw,Vw,Oe,{class:1,active:0,interactive:2,single:6,expand:7,collapse:8,toggle:3,collapseSiblings:9})}get expand(){return this.$$.ctx[7]}get collapse(){return this.$$.ctx[8]}get toggle(){return this.$$.ctx[3]}get collapseSiblings(){return this.$$.ctx[9]}}const Bw=n=>({}),uc=n=>({});function fc(n,e,t){const i=n.slice();return i[46]=e[t],i}function cc(n,e,t){const i=n.slice();return i[49]=e[t],i}const Uw=n=>({}),dc=n=>({});function hc(n,e,t){const i=n.slice();return i[49]=e[t],i}function pc(n){let e,t;return{c(){e=_("div"),t=R(n[2]),h(e,"class","txt-placeholder")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&4&&be(t,i[2])},d(i){i&&k(e)}}}function Ww(n){let e,t=n[49]+"",i;return{c(){e=_("span"),i=R(t),h(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&1&&t!==(t=s[49]+"")&&be(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function Yw(n){let e,t,i;const s=[{item:n[49]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=ht(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&z(e.$$.fragment),t=ot()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&257?hn(s,[a[0]&1&&{item:r[49]},a[0]&256&&oi(r[8])]):{};if(l!==(l=r[7])){if(e){Te();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(e=new l(o()),z(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&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function mc(n){let e,t,i;function s(){return n[34](n[49])}return{c(){e=_("span"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[tt(Mt.call(null,e,"Clear")),G(e,"click",Hn(Vt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function gc(n){let e,t,i,s,l,o;const r=[Yw,Ww],a=[];function u(c,d){return c[7]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[6])&&mc(n);return{c(){e=_("div"),i.c(),s=T(),f&&f.c(),l=T(),h(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),m(e,s),f&&f.m(e,null),m(e,l),o=!0},p(c,d){let p=t;t=u(c),t===p?a[t].p(c,d):(Te(),P(a[p],1,1,()=>{a[p]=null}),De(),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=mc(c),f.c(),f.m(e,l)):f&&(f.d(1),f=null)},i(c){o||(A(i),o=!0)},o(c){P(i),o=!1},d(c){c&&k(e),a[t].d(),f&&f.d()}}}function _c(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[Jw]},$$scope:{ctx:n}};return e=new ss({props:i}),n[39](e),e.$on("show",n[23]),e.$on("hide",n[40]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&2048&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[39](null),V(e,s)}}}function bc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&vc(n);return{c(){e=_("div"),t=_("label"),i=_("div"),i.innerHTML='<i class="ri-search-line"></i>',s=T(),l=_("input"),o=T(),u&&u.c(),h(i,"class","addon p-r-0"),l.autofocus=!0,h(l,"type","text"),h(l,"placeholder",n[3]),h(t,"class","input-group"),h(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(t,s),m(t,l),Ce(l,n[14]),m(t,o),u&&u.m(t,null),l.focus(),r||(a=G(l,"input",n[36]),r=!0)},p(f,c){c[0]&8&&h(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Ce(l,f[14]),f[14].length?u?u.p(f,c):(u=vc(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function vc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-close-line"></i>',h(t,"type","button"),h(t,"class","btn btn-sm btn-circle btn-secondary clear"),h(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),m(e,t),i||(s=G(t,"click",Hn(Vt(n[20]))),i=!0)},p:oe,d(l){l&&k(e),i=!1,s()}}}function yc(n){let e,t=n[1]&&kc(n);return{c(){t&&t.c(),e=ot()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=kc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function kc(n){let e,t;return{c(){e=_("div"),t=R(n[1]),h(e,"class","txt-missing")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&2&&be(t,i[1])},d(i){i&&k(e)}}}function wc(n){let e,t=n[46].group+"",i;return{c(){e=_("div"),i=R(t),h(e,"class","dropdown-item separator")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&524288&&t!==(t=s[46].group+"")&&be(i,t)},d(s){s&&k(e)}}}function Kw(n){let e=n[49]+"",t;return{c(){t=R(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[49]+"")&&be(t,e)},i:oe,o:oe,d(i){i&&k(t)}}}function Zw(n){let e,t,i;const s=[{item:n[49]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=ht(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&z(e.$$.fragment),t=ot()},m(r,a){e&&q(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&525312?hn(s,[a[0]&524288&&{item:r[49]},a[0]&1024&&oi(r[10])]):{};if(l!==(l=r[9])){if(e){Te();const f=e;P(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(e=new l(o()),z(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&&P(e.$$.fragment,r),i=!1},d(r){r&&k(t),e&&V(e,r)}}}function Sc(n){let e,t,i,s,l,o,r;const a=[Zw,Kw],u=[];function f(p,g){return p[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...p){return n[37](n[49],...p)}function d(...p){return n[38](n[49],...p)}return{c(){e=_("div"),i.c(),s=T(),h(e,"tabindex","0"),h(e,"class","dropdown-item option closable"),X(e,"selected",n[18](n[49]))},m(p,g){w(p,e,g),u[t].m(e,null),m(e,s),l=!0,o||(r=[G(e,"click",c),G(e,"keydown",d)],o=!0)},p(p,g){n=p;let v=t;t=f(n),t===v?u[t].p(n,g):(Te(),P(u[v],1,1,()=>{u[v]=null}),De(),i=u[t],i?i.p(n,g):(i=u[t]=a[t](n),i.c()),A(i,1),i.m(e,s)),g[0]&786432&&X(e,"selected",n[18](n[49]))},i(p){l||(A(i),l=!0)},o(p){P(i),l=!1},d(p){p&&k(e),u[t].d(),o=!1,lt(r)}}}function $c(n){let e,t,i,s=n[46].group!=Qr&&wc(n),l=n[46].items,o=[];for(let a=0;a<l.length;a+=1)o[a]=Sc(cc(n,l,a));const r=a=>P(o[a],1,1,()=>{o[a]=null});return{c(){s&&s.c(),e=T();for(let a=0;a<o.length;a+=1)o[a].c();t=ot()},m(a,u){s&&s.m(a,u),w(a,e,u);for(let f=0;f<o.length;f+=1)o[f].m(a,u);w(a,t,u),i=!0},p(a,u){if(a[46].group!=Qr?s?s.p(a,u):(s=wc(a),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),u[0]&7079424){l=a[46].items;let f;for(f=0;f<l.length;f+=1){const c=cc(a,l,f);o[f]?(o[f].p(c,u),A(o[f],1)):(o[f]=Sc(c),o[f].c(),A(o[f],1),o[f].m(t.parentNode,t))}for(Te(),f=l.length;f<o.length;f+=1)r(f);De()}},i(a){if(!i){for(let u=0;u<l.length;u+=1)A(o[u]);i=!0}},o(a){o=o.filter(Boolean);for(let u=0;u<o.length;u+=1)P(o[u]);i=!1},d(a){s&&s.d(a),a&&k(e),Rn(o,a),a&&k(t)}}}function Jw(n){let e,t,i,s,l,o=n[11]&&bc(n);const r=n[33].beforeOptions,a=$n(r,n,n[42],dc);let u=n[19],f=[];for(let v=0;v<u.length;v+=1)f[v]=$c(fc(n,u,v));const c=v=>P(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=yc(n));const p=n[33].afterOptions,g=$n(p,n,n[42],uc);return{c(){o&&o.c(),e=T(),a&&a.c(),t=T(),i=_("div");for(let v=0;v<f.length;v+=1)f[v].c();d&&d.c(),s=T(),g&&g.c(),h(i,"class","options-list")},m(v,b){o&&o.m(v,b),w(v,e,b),a&&a.m(v,b),w(v,t,b),w(v,i,b);for(let y=0;y<f.length;y+=1)f[y].m(i,null);d&&d.m(i,null),w(v,s,b),g&&g.m(v,b),l=!0},p(v,b){if(v[11]?o?o.p(v,b):(o=bc(v),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&2048)&&Mn(a,r,v,v[42],l?Cn(r,v[42],b,Uw):Tn(v[42]),dc),b[0]&7079426){u=v[19];let y;for(y=0;y<u.length;y+=1){const S=fc(v,u,y);f[y]?(f[y].p(S,b),A(f[y],1)):(f[y]=$c(S),f[y].c(),A(f[y],1),f[y].m(i,null))}for(Te(),y=u.length;y<f.length;y+=1)c(y);De(),!u.length&&d?d.p(v,b):u.length?d&&(d.d(1),d=null):(d=yc(v),d.c(),d.m(i,null))}g&&g.p&&(!l||b[1]&2048)&&Mn(g,p,v,v[42],l?Cn(p,v[42],b,Bw):Tn(v[42]),uc)},i(v){if(!l){A(a,v);for(let b=0;b<u.length;b+=1)A(f[b]);A(g,v),l=!0}},o(v){P(a,v),f=f.filter(Boolean);for(let b=0;b<f.length;b+=1)P(f[b]);P(g,v),l=!1},d(v){o&&o.d(v),v&&k(e),a&&a.d(v),v&&k(t),v&&k(i),Rn(f,v),d&&d.d(),v&&k(s),g&&g.d(v)}}}function Gw(n){let e,t,i,s,l,o,r=W.toArray(n[0]),a=[];for(let d=0;d<r.length;d+=1)a[d]=gc(hc(n,r,d));const u=d=>P(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=pc(n));let c=!n[5]&&_c(n);return{c(){e=_("div"),t=_("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),s=T(),c&&c.c(),h(t,"tabindex",i=n[5]?"-1":"0"),h(t,"class","selected-container"),X(t,"disabled",n[5]),h(e,"class",l="select "+n[12]),X(e,"multiple",n[4]),X(e,"disabled",n[5])},m(d,p){w(d,e,p),m(e,t);for(let g=0;g<a.length;g+=1)a[g].m(t,null);f&&f.m(t,null),n[35](t),m(e,s),c&&c.m(e,null),n[41](e),o=!0},p(d,p){if(p[0]&8661){r=W.toArray(d[0]);let g;for(g=0;g<r.length;g+=1){const v=hc(d,r,g);a[g]?(a[g].p(v,p),A(a[g],1)):(a[g]=gc(v),a[g].c(),A(a[g],1),a[g].m(t,null))}for(Te(),g=r.length;g<a.length;g+=1)u(g);De(),!r.length&&f?f.p(d,p):r.length?f&&(f.d(1),f=null):(f=pc(d),f.c(),f.m(t,null))}(!o||p[0]&32&&i!==(i=d[5]?"-1":"0"))&&h(t,"tabindex",i),p[0]&32&&X(t,"disabled",d[5]),d[5]?c&&(Te(),P(c,1,1,()=>{c=null}),De()):c?(c.p(d,p),p[0]&32&&A(c,1)):(c=_c(d),c.c(),A(c,1),c.m(e,null)),(!o||p[0]&4096&&l!==(l="select "+d[12]))&&h(e,"class",l),p[0]&4112&&X(e,"multiple",d[4]),p[0]&4128&&X(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)P(a[p]);P(c),o=!1},d(d){d&&k(e),Rn(a,d),f&&f.d(),n[35](null),c&&c.d(),n[41](null)}}}const Qr="_base_";function Xw(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 Qw(n,e,t){let i,s,l,{$$slots:o={},$$scope:r}=e,{id:a=""}=e,{noOptionsText:u="No options found"}=e,{selectPlaceholder:f="- Select -"}=e,{searchPlaceholder:c="Search..."}=e,{items:d=[]}=e,{multiple:p=!1}=e,{disabled:g=!1}=e,{selected:v=p?[]:void 0}=e,{toggle:b=!1}=e,{labelComponent:y=void 0}=e,{labelComponentProps:S={}}=e,{optionComponent:$=void 0}=e,{optionComponentProps:C={}}=e,{searchable:M=!1}=e,{searchFunc:D=void 0}=e,{class:L=""}=e,O,F="",E,j;function U(ue){if(W.isEmpty(v))return;let ce=W.toArray(v);W.inArray(ce,ue)&&(W.removeByValue(ce,ue),t(0,v=ce)),E==null||E.dispatchEvent(new CustomEvent("change",{detail:v,bubbles:!0}))}function Q(ue){if(p){let ce=W.toArray(v);W.inArray(ce,ue)||t(0,v=[...ce,ue])}else t(0,v=ue);E==null||E.dispatchEvent(new CustomEvent("change",{detail:v,bubbles:!0}))}function te(ue){return l(ue)?U(ue):Q(ue)}function H(){t(0,v=p?[]:void 0)}function Y(){O!=null&&O.show&&(O==null||O.show())}function K(){O!=null&&O.hide&&(O==null||O.hide())}function Z(){if(W.isEmpty(v)||W.isEmpty(i))return;let ue=W.toArray(v),ce=[];for(const ke of ue){let Be=!1;for(const Ke of i)if(W.inArray(Ke.items,ke)){Be=!0;break}Be||ce.push(ke)}if(ce.length){for(const ke of ce)W.removeByValue(ue,ke);t(0,v=p?ue:ue[0])}}function ee(){t(14,F="")}function ae(ue,ce){var Ke;const ke=[],Be=D||Xw;for(const Ue of ue){let Je;typeof ce=="string"&&ce.length?Je=((Ke=Ue.items)==null?void 0:Ke.filter(xe=>Be(xe,ce)))||[]:Je=Ue.items||[],Je.length&&ke.push({group:Ue.group,items:Je})}return ke}function ve(ue,ce){ue.preventDefault(),b&&p?te(ce):Q(ce)}function le(ue,ce){(ue.code==="Enter"||ue.code==="Space")&&ve(ue,ce)}function me(){ee(),setTimeout(()=>{const ue=E==null?void 0:E.querySelector(".dropdown-item.option.selected");ue&&(ue.focus(),ue.scrollIntoView({block:"nearest"}))},0)}function re(ue){ue.stopPropagation(),!g&&(O==null||O.toggle())}Un(()=>{const ue=document.querySelectorAll(`label[for="${a}"]`);for(const ce of ue)ce.addEventListener("click",re);return()=>{for(const ce of ue)ce.removeEventListener("click",re)}});const de=ue=>U(ue);function fe(ue){ge[ue?"unshift":"push"](()=>{j=ue,t(17,j)})}function ie(){F=this.value,t(14,F)}const x=(ue,ce)=>ve(ce,ue),ye=(ue,ce)=>le(ce,ue);function He(ue){ge[ue?"unshift":"push"](()=>{O=ue,t(15,O)})}function Le(ue){dt.call(this,n,ue)}function Pe(ue){ge[ue?"unshift":"push"](()=>{E=ue,t(16,E)})}return n.$$set=ue=>{"id"in ue&&t(24,a=ue.id),"noOptionsText"in ue&&t(1,u=ue.noOptionsText),"selectPlaceholder"in ue&&t(2,f=ue.selectPlaceholder),"searchPlaceholder"in ue&&t(3,c=ue.searchPlaceholder),"items"in ue&&t(25,d=ue.items),"multiple"in ue&&t(4,p=ue.multiple),"disabled"in ue&&t(5,g=ue.disabled),"selected"in ue&&t(0,v=ue.selected),"toggle"in ue&&t(6,b=ue.toggle),"labelComponent"in ue&&t(7,y=ue.labelComponent),"labelComponentProps"in ue&&t(8,S=ue.labelComponentProps),"optionComponent"in ue&&t(9,$=ue.optionComponent),"optionComponentProps"in ue&&t(10,C=ue.optionComponentProps),"searchable"in ue&&t(11,M=ue.searchable),"searchFunc"in ue&&t(26,D=ue.searchFunc),"class"in ue&&t(12,L=ue.class),"$$scope"in ue&&t(42,r=ue.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&t(32,i=W.isObjectArrayWithKeys(d,["group"])?d:[{group:Qr,items:d}]),n.$$.dirty[0]&33554432&&d&&(Z(),ee()),n.$$.dirty[0]&16384|n.$$.dirty[1]&2&&t(19,s=ae(i,F)),n.$$.dirty[0]&1&&t(18,l=function(ue){let ce=W.toArray(v);return W.inArray(ce,ue)})},[v,u,f,c,p,g,b,y,S,$,C,M,L,U,F,O,E,j,l,s,ee,ve,le,me,a,d,D,Q,te,H,Y,K,i,o,de,fe,ie,x,ye,He,Le,Pe,r]}class a_ extends Ee{constructor(e){super(),Ae(this,e,Qw,Gw,Oe,{id:24,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:25,multiple:4,disabled:5,selected:0,toggle:6,labelComponent:7,labelComponentProps:8,optionComponent:9,optionComponentProps:10,searchable:11,searchFunc:26,class:12,deselectItem:13,selectItem:27,toggleItem:28,reset:29,showDropdown:30,hideDropdown:31},null,[-1,-1])}get deselectItem(){return this.$$.ctx[13]}get selectItem(){return this.$$.ctx[27]}get toggleItem(){return this.$$.ctx[28]}get reset(){return this.$$.ctx[29]}get showDropdown(){return this.$$.ctx[30]}get hideDropdown(){return this.$$.ctx[31]}}function Cc(n){let e,t;return{c(){e=_("i"),h(e,"class",t="icon "+n[0].icon)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t="icon "+i[0].icon)&&h(e,"class",t)},d(i){i&&k(e)}}}function xw(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&&Cc(n);return{c(){l&&l.c(),e=T(),t=_("span"),s=R(i),h(t,"class","txt")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),m(t,s)},p(o,[r]){o[0].icon?l?l.p(o,r):(l=Cc(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)+"")&&be(s,i)},i:oe,o:oe,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function eS(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Mc extends Ee{constructor(e){super(),Ae(this,e,eS,xw,Oe,{item:0})}}const tS=n=>({}),Tc=n=>({});function nS(n){let e;const t=n[8].afterOptions,i=$n(t,n,n[12],Tc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Mn(i,t,s,s[12],e?Cn(t,s[12],l,tS):Tn(s[12]),Tc)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function iS(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:[nS]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=ht(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new a_({props:o}),ge.push(()=>Ie(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){z(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&62?hn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&oi(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],Re(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function sS(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Wt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Mc}=e,{optionComponent:c=Mc}=e,{selectionKey:d="value"}=e,{keyOfSelected:p=a?[]:void 0}=e;function g(C){C=W.toArray(C,!0);let M=[],D=b();for(let L of D)W.inArray(C,L[d])&&M.push(L);C.length&&!M.length||t(0,u=a?M:M[0])}async function v(C){let M=W.toArray(C,!0).map(D=>D[d]);!r.length||t(6,p=a?M:M[0])}function b(){if(!W.isObjectArrayWithKeys(r,["group","items"]))return r;let C=[];for(const M of r)C=C.concat(M.items);return C}function y(C){u=C,t(0,u)}function S(C){dt.call(this,n,C)}function $(C){dt.call(this,n,C)}return n.$$set=C=>{e=ht(ht({},e),si(C)),t(5,s=Wt(e,i)),"items"in C&&t(1,r=C.items),"multiple"in C&&t(2,a=C.multiple),"selected"in C&&t(0,u=C.selected),"labelComponent"in C&&t(3,f=C.labelComponent),"optionComponent"in C&&t(4,c=C.optionComponent),"selectionKey"in C&&t(7,d=C.selectionKey),"keyOfSelected"in C&&t(6,p=C.keyOfSelected),"$$scope"in C&&t(12,o=C.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(p),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,p,d,l,y,S,$,o]}class ls extends Ee{constructor(e){super(),Ae(this,e,sS,iS,Oe,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function lS(n){let e,t,i;const s=[{class:"field-type-select "+n[1]},{searchable:!0},{items:n[2]},n[3]];function l(r){n[4](r)}let o={};for(let r=0;r<s.length;r+=1)o=ht(o,s[r]);return n[0]!==void 0&&(o.keyOfSelected=n[0]),e=new ls({props:o}),ge.push(()=>Ie(e,"keyOfSelected",l)),{c(){z(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&14?hn(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&oi(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],Re(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function oS(n,e,t){const i=["value","class"];let s=Wt(e,i),{value:l="text"}=e,{class:o=""}=e;const r=[{label:"Text",value:"text",icon:W.getFieldTypeIcon("text")},{label:"Number",value:"number",icon:W.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:W.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:W.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:W.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:W.getFieldTypeIcon("date")},{label:"Multiple choices",value:"select",icon:W.getFieldTypeIcon("select")},{label:"JSON",value:"json",icon:W.getFieldTypeIcon("json")},{label:"File",value:"file",icon:W.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:W.getFieldTypeIcon("relation")},{label:"User",value:"user",icon:W.getFieldTypeIcon("user")}];function a(u){l=u,t(0,l)}return n.$$set=u=>{e=ht(ht({},e),si(u)),t(3,s=Wt(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class rS extends Ee{constructor(e){super(),Ae(this,e,oS,lS,Oe,{value:0,class:1})}}function aS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Min length"),s=T(),l=_("input"),h(e,"for",i=n[5]),h(l,"type","number"),h(l,"id",o=n[5]),h(l,"step","1"),h(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].min&&Ce(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function uS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=R("Max length"),s=T(),l=_("input"),h(e,"for",i=n[5]),h(l,"type","number"),h(l,"id",o=n[5]),h(l,"step","1"),h(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Ce(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&h(e,"for",i),c&32&&o!==(o=f[5])&&h(l,"id",o),c&1&&r!==(r=f[0].min||0)&&h(l,"min",r),c&1&&Dt(l.value)!==f[0].max&&Ce(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function fS(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("Regex pattern"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",h(e,"for",i=n[5]),h(l,"type","text"),h(l,"id",o=n[5]),h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].pattern),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[4]),u=!0)},p(c,d){d&32&&i!==(i=c[5])&&h(e,"for",i),d&32&&o!==(o=c[5])&&h(l,"id",o),d&1&&l.value!==c[0].pattern&&Ce(l,c[0].pattern)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function cS(n){let e,t,i,s,l,o,r,a,u,f;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[aS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[uS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[fS,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),f=!0},p(c,[d]){const p={};d&2&&(p.name="schema."+c[1]+".options.min"),d&97&&(p.$$scope={dirty:d,ctx:c}),i.$set(p);const g={};d&2&&(g.name="schema."+c[1]+".options.max"),d&97&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.pattern"),d&97&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function dS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Dt(this.value),t(0,s)}function o(){s.max=Dt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class hS extends Ee{constructor(e){super(),Ae(this,e,dS,cS,Oe,{key:1,options:0})}}function pS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Min"),s=T(),l=_("input"),h(e,"for",i=n[4]),h(l,"type","number"),h(l,"id",o=n[4])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&h(e,"for",i),f&16&&o!==(o=u[4])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].min&&Ce(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mS(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=R("Max"),s=T(),l=_("input"),h(e,"for",i=n[4]),h(l,"type","number"),h(l,"id",o=n[4]),h(l,"min",r=n[0].min)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Ce(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&h(e,"for",i),c&16&&o!==(o=f[4])&&h(l,"id",o),c&1&&r!==(r=f[0].min)&&h(l,"min",r),c&1&&Dt(l.value)!==f[0].max&&Ce(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function gS(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[pS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[mS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function _S(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Dt(this.value),t(0,s)}function o(){s.max=Dt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class bS extends Ee{constructor(e){super(),Ae(this,e,_S,gS,Oe,{key:1,options:0})}}function vS(n,e,t){let{key:i=""}=e,{options:s={}}=e;return n.$$set=l=>{"key"in l&&t(0,i=l.key),"options"in l&&t(1,s=l.options)},[i,s]}class yS extends Ee{constructor(e){super(),Ae(this,e,vS,null,Oe,{key:0,options:1})}}function kS(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=ht(o,l[r]);return{c(){e=_("input"),ii(e,o)},m(r,a){w(r,e,a),e.value=o.value,e.autofocus&&e.focus(),i||(s=G(e,"input",n[4]),i=!0)},p(r,[a]){ii(e,o=hn(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:oe,o:oe,d(r){r&&k(e),i=!1,s()}}}function wS(n,e,t){let i;const s=["value","separator"];let l=Wt(e,s),{value:o=[]}=e,{separator:r=","}=e;const a=u=>{t(0,o=W.splitNonEmpty(u.target.value,r))};return n.$$set=u=>{e=ht(ht({},e),si(u)),t(3,l=Wt(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 os extends Ee{constructor(e){super(),Ae(this,e,wS,kS,Oe,{value:0,separator:1})}}function SS(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[2](b)}let v={id:n[4],disabled:!W.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:`List of domains that are NOT allowed.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&h(e,"for",l);const S={};y&16&&(S.id=b[4]),y&1&&(S.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function $S(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[4]+".options.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&h(e,"for",l);const S={};y&16&&(S.id=b[4]+".options.onlyDomains"),y&1&&(S.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function CS(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[SS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[$S,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function MS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class u_ extends Ee{constructor(e){super(),Ae(this,e,MS,CS,Oe,{key:1,options:0})}}function TS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new u_({props:r}),ge.push(()=>Ie(e,"key",l)),ge.push(()=>Ie(e,"options",o)),{c(){z(e.$$.fragment)},m(a,u){q(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],Re(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],Re(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){V(e,a)}}}function DS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class OS extends Ee{constructor(e){super(),Ae(this,e,DS,TS,Oe,{key:0,options:1})}}var gr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],_s={_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},hl={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(n){var e=n%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},pn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Ln=function(n){return n===!0?1:0};function Dc(n,e){var t;return function(){var i=this,s=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,s)},e)}}var _r=function(n){return n instanceof Array?n:[n]};function an(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function wt(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 Xl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function f_(n,e){if(e(n))return n;if(n.parentNode)return f_(n.parentNode,e)}function Ql(n,e){var t=wt("div","numInputWrapper"),i=wt("input","numInput "+n),s=wt("span","arrowUp"),l=wt("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 vn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var br=function(){},Do=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},AS={D:br,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*Ln(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:br,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:br,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Zi={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})"},il={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[il.w(n,e,t)]},F:function(n,e,t){return Do(il.n(n,e,t)-1,!1,e)},G:function(n,e,t){return pn(il.h(n,e,t))},H:function(n){return pn(n.getHours())},J:function(n,e){return e.ordinal!==void 0?n.getDate()+e.ordinal(n.getDate()):n.getDate()},K:function(n,e){return e.amPM[Ln(n.getHours()>11)]},M:function(n,e){return Do(n.getMonth(),!0,e)},S:function(n){return pn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return pn(n.getFullYear(),4)},d:function(n){return pn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return pn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return pn(n.getMonth()+1)},n:function(n){return n.getMonth()+1},s:function(n){return n.getSeconds()},u:function(n){return n.getTime()},w:function(n){return n.getDay()},y:function(n){return String(n.getFullYear()).substring(2)}},c_=function(n){var e=n.config,t=e===void 0?_s:e,i=n.l10n,s=i===void 0?hl: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 il[c]&&p[d-1]!=="\\"?il[c](r,f,t):c!=="\\"?c:""}).join("")}},xr=function(n){var e=n.config,t=e===void 0?_s:e,i=n.l10n,s=i===void 0?hl: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||_s).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 g=void 0,v=[],b=0,y=0,S="";b<d.length;b++){var $=d[b],C=$==="\\",M=d[b-1]==="\\"||C;if(Zi[$]&&!M){S+=Zi[$];var D=new RegExp(S).exec(l);D&&(g=!0)&&v[$!=="Y"?"push":"unshift"]({fn:AS[$],val:D[++y]})}else C||(S+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),v.forEach(function(L){var O=L.fn,F=L.val;return f=O(f,F,u)||f}),f=g?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 yn(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 ES=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},vr=function(n,e,t){return n*3600+e*60+t},PS=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},LS={DAY:864e5};function yr(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 nn=globalThis&&globalThis.__assign||function(){return nn=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},nn.apply(this,arguments)},Oc=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},FS=300;function IS(n,e){var t={config:nn(nn({},_s),Ut.defaultConfig),l10n:hl};t.parseDate=xr({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=v,t._setHoursFromDate=d,t._positionCalendar=Je,t.changeMonth=ve,t.changeYear=ie,t.clear=le,t.close=me,t.onMouseOver=Pe,t._createElement=wt,t.createDay=D,t.destroy=re,t.isEnabled=x,t.jumpToDate=S,t.updateValue=zt,t.open=ce,t.redraw=se,t.set=bt,t.setDate=ut,t.toggle=Ze;function i(){t.utils={getDaysInMonth:function(N,I){return N===void 0&&(N=t.currentMonth),I===void 0&&(I=t.currentYear),N===1&&(I%4===0&&I%100!==0||I%400===0)?29:t.l10n.daysInMonth[N]}}}function s(){t.element=t.input=n,t.isOpen=!1,Be(),Ue(),Zt(),Pt(),i(),t.isMobile||M(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),zt(!1)),r();var N=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&N&&Je(),nt("onReady")}function l(){var N;return((N=t.calendarContainer)===null||N===void 0?void 0:N.getRootNode()).activeElement||document.activeElement}function o(N){return N.bind(t)}function r(){var N=t.config;N.weekNumbers===!1&&N.showMonths===1||N.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 I=(t.days.offsetWidth+1)*N.showMonths;t.daysContainer.style.width=I+"px",t.calendarContainer.style.width=I+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(N){if(t.selectedDates.length===0){var I=t.config.minDate===void 0||yn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),B=yr(t.config);I.setHours(B.hours,B.minutes,B.seconds,I.getMilliseconds()),t.selectedDates=[I],t.latestSelectedDateObj=I}N!==void 0&&N.type!=="blur"&&ct(N);var ne=t._input.value;c(),zt(),t._input.value!==ne&&t._debouncedChange()}function u(N,I){return N%12+12*Ln(I===t.l10n.amPM[1])}function f(N){switch(N%24){case 0:case 12:return 12;default:return N%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var N=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,I=(parseInt(t.minuteElement.value,10)||0)%60,B=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(N=u(N,t.amPM.textContent));var ne=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&yn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Ne=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&yn(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 qe=vr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),it=vr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),Ye=vr(N,I,B);if(Ye>it&&Ye<qe){var st=PS(qe);N=st[0],I=st[1],B=st[2]}}else{if(Ne){var We=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;N=Math.min(N,We.getHours()),N===We.getHours()&&(I=Math.min(I,We.getMinutes())),I===We.getMinutes()&&(B=Math.min(B,We.getSeconds()))}if(ne){var Qe=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;N=Math.max(N,Qe.getHours()),N===Qe.getHours()&&I<Qe.getMinutes()&&(I=Qe.getMinutes()),I===Qe.getMinutes()&&(B=Math.max(B,Qe.getSeconds()))}}p(N,I,B)}}function d(N){var I=N||t.latestSelectedDateObj;I&&I instanceof Date&&p(I.getHours(),I.getMinutes(),I.getSeconds())}function p(N,I,B){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(N%24,I,B||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=pn(t.config.time_24hr?N:(12+N)%12+12*Ln(N%12===0)),t.minuteElement.value=pn(I),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Ln(N>=12)]),t.secondElement!==void 0&&(t.secondElement.value=pn(B)))}function g(N){var I=vn(N),B=parseInt(I.value)+(N.delta||0);(B/1e3>1||N.key==="Enter"&&!/[^\d]/.test(B.toString()))&&ie(B)}function v(N,I,B,ne){if(I instanceof Array)return I.forEach(function(Ne){return v(N,Ne,B,ne)});if(N instanceof Array)return N.forEach(function(Ne){return v(Ne,I,B,ne)});N.addEventListener(I,B,ne),t._handlers.push({remove:function(){return N.removeEventListener(I,B,ne)}})}function b(){nt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(B){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+B+"]"),function(ne){return v(ne,"click",t[B])})}),t.isMobile){we();return}var N=Dc(ue,50);if(t._debouncedChange=Dc(b,FS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(B){t.config.mode==="range"&&Pe(vn(B))}),v(t._input,"keydown",Le),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Le),!t.config.inline&&!t.config.static&&v(window,"resize",N),window.ontouchstart!==void 0?v(window.document,"touchstart",fe):v(window.document,"mousedown",fe),v(window.document,"focus",fe,{capture:!0}),t.config.clickOpens===!0&&(v(t._input,"focus",t.open),v(t._input,"click",t.open)),t.daysContainer!==void 0&&(v(t.monthNav,"click",Xn),v(t.monthNav,["keyup","increment"],g),v(t.daysContainer,"click",Ve)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var I=function(B){return vn(B).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",$),v([t.hourElement,t.minuteElement],["focus","click"],I),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(B){a(B)})}t.config.allowInput&&v(t._input,"blur",He)}function S(N,I){var B=N!==void 0?t.parseDate(N):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),ne=t.currentYear,Ne=t.currentMonth;try{B!==void 0&&(t.currentYear=B.getFullYear(),t.currentMonth=B.getMonth())}catch(qe){qe.message="Invalid date supplied: "+B,t.config.errorHandler(qe)}I&&t.currentYear!==ne&&(nt("onYearChange"),Q()),I&&(t.currentYear!==ne||t.currentMonth!==Ne)&&nt("onMonthChange"),t.redraw()}function $(N){var I=vn(N);~I.className.indexOf("arrow")&&C(N,I.classList.contains("arrowUp")?1:-1)}function C(N,I,B){var ne=N&&vn(N),Ne=B||ne&&ne.parentNode&&ne.parentNode.firstChild,qe=Et("increment");qe.delta=I,Ne&&Ne.dispatchEvent(qe)}function M(){var N=window.document.createDocumentFragment();if(t.calendarContainer=wt("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(N.appendChild(Y()),t.innerContainer=wt("div","flatpickr-innerContainer"),t.config.weekNumbers){var I=ae(),B=I.weekWrapper,ne=I.weekNumbers;t.innerContainer.appendChild(B),t.weekNumbers=ne,t.weekWrapper=B}t.rContainer=wt("div","flatpickr-rContainer"),t.rContainer.appendChild(Z()),t.daysContainer||(t.daysContainer=wt("div","flatpickr-days"),t.daysContainer.tabIndex=-1),U(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),N.appendChild(t.innerContainer)}t.config.enableTime&&N.appendChild(K()),an(t.calendarContainer,"rangeMode",t.config.mode==="range"),an(t.calendarContainer,"animate",t.config.animate===!0),an(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(N);var Ne=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&&(!Ne&&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 qe=wt("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(qe,t.element),qe.appendChild(t.element),t.altInput&&qe.appendChild(t.altInput),qe.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function D(N,I,B,ne){var Ne=x(I,!0),qe=wt("span",N,I.getDate().toString());return qe.dateObj=I,qe.$i=ne,qe.setAttribute("aria-label",t.formatDate(I,t.config.ariaDateFormat)),N.indexOf("hidden")===-1&&yn(I,t.now)===0&&(t.todayDateElem=qe,qe.classList.add("today"),qe.setAttribute("aria-current","date")),Ne?(qe.tabIndex=-1,he(I)&&(qe.classList.add("selected"),t.selectedDateElem=qe,t.config.mode==="range"&&(an(qe,"startRange",t.selectedDates[0]&&yn(I,t.selectedDates[0],!0)===0),an(qe,"endRange",t.selectedDates[1]&&yn(I,t.selectedDates[1],!0)===0),N==="nextMonthDay"&&qe.classList.add("inRange")))):qe.classList.add("flatpickr-disabled"),t.config.mode==="range"&&$e(I)&&!he(I)&&qe.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&N!=="prevMonthDay"&&ne%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(I)+"</span>"),nt("onDayCreate",qe),qe}function L(N){N.focus(),t.config.mode==="range"&&Pe(N)}function O(N){for(var I=N>0?0:t.config.showMonths-1,B=N>0?t.config.showMonths:-1,ne=I;ne!=B;ne+=N)for(var Ne=t.daysContainer.children[ne],qe=N>0?0:Ne.children.length-1,it=N>0?Ne.children.length:-1,Ye=qe;Ye!=it;Ye+=N){var st=Ne.children[Ye];if(st.className.indexOf("hidden")===-1&&x(st.dateObj))return st}}function F(N,I){for(var B=N.className.indexOf("Month")===-1?N.dateObj.getMonth():t.currentMonth,ne=I>0?t.config.showMonths:-1,Ne=I>0?1:-1,qe=B-t.currentMonth;qe!=ne;qe+=Ne)for(var it=t.daysContainer.children[qe],Ye=B-t.currentMonth===qe?N.$i+I:I<0?it.children.length-1:0,st=it.children.length,We=Ye;We>=0&&We<st&&We!=(I>0?st:-1);We+=Ne){var Qe=it.children[We];if(Qe.className.indexOf("hidden")===-1&&x(Qe.dateObj)&&Math.abs(N.$i-We)>=Math.abs(I))return L(Qe)}t.changeMonth(Ne),E(O(Ne),0)}function E(N,I){var B=l(),ne=ye(B||document.body),Ne=N!==void 0?N:ne?B:t.selectedDateElem!==void 0&&ye(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&ye(t.todayDateElem)?t.todayDateElem:O(I>0?1:-1);Ne===void 0?t._input.focus():ne?F(Ne,I):L(Ne)}function j(N,I){for(var B=(new Date(N,I,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ne=t.utils.getDaysInMonth((I-1+12)%12,N),Ne=t.utils.getDaysInMonth(I,N),qe=window.document.createDocumentFragment(),it=t.config.showMonths>1,Ye=it?"prevMonthDay hidden":"prevMonthDay",st=it?"nextMonthDay hidden":"nextMonthDay",We=ne+1-B,Qe=0;We<=ne;We++,Qe++)qe.appendChild(D("flatpickr-day "+Ye,new Date(N,I-1,We),We,Qe));for(We=1;We<=Ne;We++,Qe++)qe.appendChild(D("flatpickr-day",new Date(N,I,We),We,Qe));for(var St=Ne+1;St<=42-B&&(t.config.showMonths===1||Qe%7!==0);St++,Qe++)qe.appendChild(D("flatpickr-day "+st,new Date(N,I+1,St%Ne),St,Qe));var bn=wt("div","dayContainer");return bn.appendChild(qe),bn}function U(){if(t.daysContainer!==void 0){Xl(t.daysContainer),t.weekNumbers&&Xl(t.weekNumbers);for(var N=document.createDocumentFragment(),I=0;I<t.config.showMonths;I++){var B=new Date(t.currentYear,t.currentMonth,1);B.setMonth(t.currentMonth+I),N.appendChild(j(B.getFullYear(),B.getMonth()))}t.daysContainer.appendChild(N),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Pe()}}function Q(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var N=function(ne){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ne<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&ne>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var I=0;I<12;I++)if(!!N(I)){var B=wt("option","flatpickr-monthDropdown-month");B.value=new Date(t.currentYear,I).getMonth().toString(),B.textContent=Do(I,t.config.shorthandCurrentMonth,t.l10n),B.tabIndex=-1,t.currentMonth===I&&(B.selected=!0),t.monthsDropdownContainer.appendChild(B)}}}function te(){var N=wt("div","flatpickr-month"),I=window.document.createDocumentFragment(),B;t.config.showMonths>1||t.config.monthSelectorType==="static"?B=wt("span","cur-month"):(t.monthsDropdownContainer=wt("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(it){var Ye=vn(it),st=parseInt(Ye.value,10);t.changeMonth(st-t.currentMonth),nt("onMonthChange")}),Q(),B=t.monthsDropdownContainer);var ne=Ql("cur-year",{tabindex:"-1"}),Ne=ne.getElementsByTagName("input")[0];Ne.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Ne.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Ne.setAttribute("max",t.config.maxDate.getFullYear().toString()),Ne.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var qe=wt("div","flatpickr-current-month");return qe.appendChild(B),qe.appendChild(ne),I.appendChild(qe),N.appendChild(I),{container:N,yearElement:Ne,monthElement:B}}function H(){Xl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var N=t.config.showMonths;N--;){var I=te();t.yearElements.push(I.yearElement),t.monthElements.push(I.monthElement),t.monthNav.appendChild(I.container)}t.monthNav.appendChild(t.nextMonthNav)}function Y(){return t.monthNav=wt("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=wt("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=wt("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,H(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(N){t.__hidePrevMonthArrow!==N&&(an(t.prevMonthNav,"flatpickr-disabled",N),t.__hidePrevMonthArrow=N)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(N){t.__hideNextMonthArrow!==N&&(an(t.nextMonthNav,"flatpickr-disabled",N),t.__hideNextMonthArrow=N)}}),t.currentYearElement=t.yearElements[0],Xe(),t.monthNav}function K(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var N=yr(t.config);t.timeContainer=wt("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var I=wt("span","flatpickr-time-separator",":"),B=Ql("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=B.getElementsByTagName("input")[0];var ne=Ql("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ne.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?N.hours:f(N.hours)),t.minuteElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():N.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(B),t.timeContainer.appendChild(I),t.timeContainer.appendChild(ne),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Ne=Ql("flatpickr-second");t.secondElement=Ne.getElementsByTagName("input")[0],t.secondElement.value=pn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():N.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(wt("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Ne)}return t.config.time_24hr||(t.amPM=wt("span","flatpickr-am-pm",t.l10n.amPM[Ln((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function Z(){t.weekdayContainer?Xl(t.weekdayContainer):t.weekdayContainer=wt("div","flatpickr-weekdays");for(var N=t.config.showMonths;N--;){var I=wt("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(I)}return ee(),t.weekdayContainer}function ee(){if(!!t.weekdayContainer){var N=t.l10n.firstDayOfWeek,I=Oc(t.l10n.weekdays.shorthand);N>0&&N<I.length&&(I=Oc(I.splice(N,I.length),I.splice(0,N)));for(var B=t.config.showMonths;B--;)t.weekdayContainer.children[B].innerHTML=`
<span class='flatpickr-weekday'>
`+I.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ae(){t.calendarContainer.classList.add("hasWeeks");var N=wt("div","flatpickr-weekwrapper");N.appendChild(wt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var I=wt("div","flatpickr-weeks");return N.appendChild(I),{weekWrapper:N,weekNumbers:I}}function ve(N,I){I===void 0&&(I=!0);var B=I?N:N-t.currentMonth;B<0&&t._hidePrevMonthArrow===!0||B>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=B,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,nt("onYearChange"),Q()),U(),nt("onMonthChange"),Xe())}function le(N,I){if(N===void 0&&(N=!0),I===void 0&&(I=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,I===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var B=yr(t.config),ne=B.hours,Ne=B.minutes,qe=B.seconds;p(ne,Ne,qe)}t.redraw(),N&&nt("onChange")}function me(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),nt("onClose")}function re(){t.config!==void 0&&nt("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].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 I=t.calendarContainer.parentNode;if(I.lastChild&&I.removeChild(I.lastChild),I.parentNode){for(;I.firstChild;)I.parentNode.insertBefore(I.firstChild,I);I.parentNode.removeChild(I)}}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(B){try{delete t[B]}catch{}})}function de(N){return t.calendarContainer.contains(N)}function fe(N){if(t.isOpen&&!t.config.inline){var I=vn(N),B=de(I),ne=I===t.input||I===t.altInput||t.element.contains(I)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ne=!ne&&!B&&!de(N.relatedTarget),qe=!t.config.ignoredFocusElements.some(function(it){return it.contains(I)});Ne&&qe&&(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 ie(N){if(!(!N||t.config.minDate&&N<t.config.minDate.getFullYear()||t.config.maxDate&&N>t.config.maxDate.getFullYear())){var I=N,B=t.currentYear!==I;t.currentYear=I||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)),B&&(t.redraw(),nt("onYearChange"),Q())}}function x(N,I){var B;I===void 0&&(I=!0);var ne=t.parseDate(N,void 0,I);if(t.config.minDate&&ne&&yn(ne,t.config.minDate,I!==void 0?I:!t.minDateHasTime)<0||t.config.maxDate&&ne&&yn(ne,t.config.maxDate,I!==void 0?I:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ne===void 0)return!1;for(var Ne=!!t.config.enable,qe=(B=t.config.enable)!==null&&B!==void 0?B:t.config.disable,it=0,Ye=void 0;it<qe.length;it++){if(Ye=qe[it],typeof Ye=="function"&&Ye(ne))return Ne;if(Ye instanceof Date&&ne!==void 0&&Ye.getTime()===ne.getTime())return Ne;if(typeof Ye=="string"){var st=t.parseDate(Ye,void 0,!0);return st&&st.getTime()===ne.getTime()?Ne:!Ne}else if(typeof Ye=="object"&&ne!==void 0&&Ye.from&&Ye.to&&ne.getTime()>=Ye.from.getTime()&&ne.getTime()<=Ye.to.getTime())return Ne}return!Ne}function ye(N){return t.daysContainer!==void 0?N.className.indexOf("hidden")===-1&&N.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(N):!1}function He(N){var I=N.target===t._input,B=t._input.value.trimEnd()!==Jt();I&&B&&!(N.relatedTarget&&de(N.relatedTarget))&&t.setDate(t._input.value,!0,N.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Le(N){var I=vn(N),B=t.config.wrap?n.contains(I):I===t._input,ne=t.config.allowInput,Ne=t.isOpen&&(!ne||!B),qe=t.config.inline&&B&&!ne;if(N.keyCode===13&&B){if(ne)return t.setDate(t._input.value,!0,I===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),I.blur();t.open()}else if(de(I)||Ne||qe){var it=!!t.timeContainer&&t.timeContainer.contains(I);switch(N.keyCode){case 13:it?(N.preventDefault(),a(),pe()):Ve(N);break;case 27:N.preventDefault(),pe();break;case 8:case 46:B&&!t.config.allowInput&&(N.preventDefault(),t.clear());break;case 37:case 39:if(!it&&!B){N.preventDefault();var Ye=l();if(t.daysContainer!==void 0&&(ne===!1||Ye&&ye(Ye))){var st=N.keyCode===39?1:-1;N.ctrlKey?(N.stopPropagation(),ve(st),E(O(1),0)):E(void 0,st)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:N.preventDefault();var We=N.keyCode===40?1:-1;t.daysContainer&&I.$i!==void 0||I===t.input||I===t.altInput?N.ctrlKey?(N.stopPropagation(),ie(t.currentYear-We),E(O(1),0)):it||E(void 0,We*7):I===t.currentYearElement?ie(t.currentYear-We):t.config.enableTime&&(!it&&t.hourElement&&t.hourElement.focus(),a(N),t._debouncedChange());break;case 9:if(it){var Qe=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Yt){return Yt}),St=Qe.indexOf(I);if(St!==-1){var bn=Qe[St+(N.shiftKey?-1:1)];N.preventDefault(),(bn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(I)&&N.shiftKey&&(N.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&I===t.amPM)switch(N.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),zt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),zt();break}(B||de(I))&&nt("onKeyDown",N)}function Pe(N,I){if(I===void 0&&(I="flatpickr-day"),!(t.selectedDates.length!==1||N&&(!N.classList.contains(I)||N.classList.contains("flatpickr-disabled")))){for(var B=N?N.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ne=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Ne=Math.min(B,t.selectedDates[0].getTime()),qe=Math.max(B,t.selectedDates[0].getTime()),it=!1,Ye=0,st=0,We=Ne;We<qe;We+=LS.DAY)x(new Date(We),!0)||(it=it||We>Ne&&We<qe,We<ne&&(!Ye||We>Ye)?Ye=We:We>ne&&(!st||We<st)&&(st=We));var Qe=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+I));Qe.forEach(function(St){var bn=St.dateObj,Yt=bn.getTime(),Gt=Ye>0&&Yt<Ye||st>0&&Yt>st;if(Gt){St.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ai){St.classList.remove(ai)});return}else if(it&&!Gt)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ai){St.classList.remove(ai)}),N!==void 0&&(N.classList.add(B<=t.selectedDates[0].getTime()?"startRange":"endRange"),ne<B&&Yt===ne?St.classList.add("startRange"):ne>B&&Yt===ne&&St.classList.add("endRange"),Yt>=Ye&&(st===0||Yt<=st)&&ES(Yt,ne,B)&&St.classList.add("inRange"))})}}function ue(){t.isOpen&&!t.config.static&&!t.config.inline&&Je()}function ce(N,I){if(I===void 0&&(I=t._positionElement),t.isMobile===!0){if(N){N.preventDefault();var B=vn(N);B&&B.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),nt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ne=t.isOpen;t.isOpen=!0,ne||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),nt("onOpen"),Je(I)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(N===void 0||!t.timeContainer.contains(N.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function ke(N){return function(I){var B=t.config["_"+N+"Date"]=t.parseDate(I,t.config.dateFormat),ne=t.config["_"+(N==="min"?"max":"min")+"Date"];B!==void 0&&(t[N==="min"?"minDateHasTime":"maxDateHasTime"]=B.getHours()>0||B.getMinutes()>0||B.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Ne){return x(Ne)}),!t.selectedDates.length&&N==="min"&&d(B),zt()),t.daysContainer&&(se(),B!==void 0?t.currentYearElement[N]=B.getFullYear().toString():t.currentYearElement.removeAttribute(N),t.currentYearElement.disabled=!!ne&&B!==void 0&&ne.getFullYear()===B.getFullYear())}}function Be(){var N=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],I=nn(nn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),B={};t.config.parseDate=I.parseDate,t.config.formatDate=I.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Qe){t.config._enable=yt(Qe)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Qe){t.config._disable=yt(Qe)}});var ne=I.mode==="time";if(!I.dateFormat&&(I.enableTime||ne)){var Ne=Ut.defaultConfig.dateFormat||_s.dateFormat;B.dateFormat=I.noCalendar||ne?"H:i"+(I.enableSeconds?":S":""):Ne+" H:i"+(I.enableSeconds?":S":"")}if(I.altInput&&(I.enableTime||ne)&&!I.altFormat){var qe=Ut.defaultConfig.altFormat||_s.altFormat;B.altFormat=I.noCalendar||ne?"h:i"+(I.enableSeconds?":S K":" K"):qe+(" h:i"+(I.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:ke("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:ke("max")});var it=function(Qe){return function(St){t.config[Qe==="min"?"_minTime":"_maxTime"]=t.parseDate(St,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:it("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:it("max")}),I.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,B,I);for(var Ye=0;Ye<N.length;Ye++)t.config[N[Ye]]=t.config[N[Ye]]===!0||t.config[N[Ye]]==="true";gr.filter(function(Qe){return t.config[Qe]!==void 0}).forEach(function(Qe){t.config[Qe]=_r(t.config[Qe]||[]).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 Ye=0;Ye<t.config.plugins.length;Ye++){var st=t.config.plugins[Ye](t)||{};for(var We in st)gr.indexOf(We)>-1?t.config[We]=_r(st[We]).map(o).concat(t.config[We]):typeof I[We]>"u"&&(t.config[We]=st[We])}I.altInputClass||(t.config.altInputClass=Ke().className+" "+t.config.altInputClass),nt("onParseConfig")}function Ke(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ue(){typeof t.config.locale!="object"&&typeof Ut.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=nn(nn({},Ut.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Ut.l10ns[t.config.locale]:void 0),Zi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Zi.l="("+t.l10n.weekdays.longhand.join("|")+")",Zi.M="("+t.l10n.months.shorthand.join("|")+")",Zi.F="("+t.l10n.months.longhand.join("|")+")",Zi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var N=nn(nn({},e),JSON.parse(JSON.stringify(n.dataset||{})));N.time_24hr===void 0&&Ut.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=c_(t),t.parseDate=xr({config:t.config,l10n:t.l10n})}function Je(N){if(typeof t.config.position=="function")return void t.config.position(t,N);if(t.calendarContainer!==void 0){nt("onPreCalendarPosition");var I=N||t._positionElement,B=Array.prototype.reduce.call(t.calendarContainer.children,function(Ri,Al){return Ri+Al.offsetHeight},0),ne=t.calendarContainer.offsetWidth,Ne=t.config.position.split(" "),qe=Ne[0],it=Ne.length>1?Ne[1]:null,Ye=I.getBoundingClientRect(),st=window.innerHeight-Ye.bottom,We=qe==="above"||qe!=="below"&&st<B&&Ye.top>B,Qe=window.pageYOffset+Ye.top+(We?-B-2:I.offsetHeight+2);if(an(t.calendarContainer,"arrowTop",!We),an(t.calendarContainer,"arrowBottom",We),!t.config.inline){var St=window.pageXOffset+Ye.left,bn=!1,Yt=!1;it==="center"?(St-=(ne-Ye.width)/2,bn=!0):it==="right"&&(St-=ne-Ye.width,Yt=!0),an(t.calendarContainer,"arrowLeft",!bn&&!Yt),an(t.calendarContainer,"arrowCenter",bn),an(t.calendarContainer,"arrowRight",Yt);var Gt=window.document.body.offsetWidth-(window.pageXOffset+Ye.right),ai=St+ne>window.document.body.offsetWidth,ki=Gt+ne>window.document.body.offsetWidth;if(an(t.calendarContainer,"rightMost",ai),!t.config.static)if(t.calendarContainer.style.top=Qe+"px",!ai)t.calendarContainer.style.left=St+"px",t.calendarContainer.style.right="auto";else if(!ki)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Gt+"px";else{var Qt=xe();if(Qt===void 0)return;var rs=window.document.body.offsetWidth,Tl=Math.max(0,rs/2-ne/2),Ni=".flatpickr-calendar.centerMost:before",Dl=".flatpickr-calendar.centerMost:after",as=Qt.cssRules.length,Ol="{left:"+Ye.left+"px;right:auto;}";an(t.calendarContainer,"rightMost",!1),an(t.calendarContainer,"centerMost",!0),Qt.insertRule(Ni+","+Dl+Ol,as),t.calendarContainer.style.left=Tl+"px",t.calendarContainer.style.right="auto"}}}}function xe(){for(var N=null,I=0;I<document.styleSheets.length;I++){var B=document.styleSheets[I];if(!!B.cssRules){try{B.cssRules}catch{continue}N=B;break}}return N!=null?N:J()}function J(){var N=document.createElement("style");return document.head.appendChild(N),N.sheet}function se(){t.config.noCalendar||t.isMobile||(Q(),Xe(),U())}function pe(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function Ve(N){N.preventDefault(),N.stopPropagation();var I=function(Qe){return Qe.classList&&Qe.classList.contains("flatpickr-day")&&!Qe.classList.contains("flatpickr-disabled")&&!Qe.classList.contains("notAllowed")},B=f_(vn(N),I);if(B!==void 0){var ne=B,Ne=t.latestSelectedDateObj=new Date(ne.dateObj.getTime()),qe=(Ne.getMonth()<t.currentMonth||Ne.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ne,t.config.mode==="single")t.selectedDates=[Ne];else if(t.config.mode==="multiple"){var it=he(Ne);it?t.selectedDates.splice(parseInt(it),1):t.selectedDates.push(Ne)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Ne,t.selectedDates.push(Ne),yn(Ne,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Qe,St){return Qe.getTime()-St.getTime()}));if(c(),qe){var Ye=t.currentYear!==Ne.getFullYear();t.currentYear=Ne.getFullYear(),t.currentMonth=Ne.getMonth(),Ye&&(nt("onYearChange"),Q()),nt("onMonthChange")}if(Xe(),U(),zt(),!qe&&t.config.mode!=="range"&&t.config.showMonths===1?L(ne):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 st=t.config.mode==="single"&&!t.config.enableTime,We=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(st||We)&&pe()}b()}}var Ge={locale:[Ue,ee],showMonths:[H,r,Z],minDate:[S],maxDate:[S],positionElement:[_e],clickOpens:[function(){t.config.clickOpens===!0?(v(t._input,"focus",t.open),v(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function bt(N,I){if(N!==null&&typeof N=="object"){Object.assign(t.config,N);for(var B in N)Ge[B]!==void 0&&Ge[B].forEach(function(ne){return ne()})}else t.config[N]=I,Ge[N]!==void 0?Ge[N].forEach(function(ne){return ne()}):gr.indexOf(N)>-1&&(t.config[N]=_r(I));t.redraw(),zt(!0)}function rt(N,I){var B=[];if(N instanceof Array)B=N.map(function(ne){return t.parseDate(ne,I)});else if(N instanceof Date||typeof N=="number")B=[t.parseDate(N,I)];else if(typeof N=="string")switch(t.config.mode){case"single":case"time":B=[t.parseDate(N,I)];break;case"multiple":B=N.split(t.config.conjunction).map(function(ne){return t.parseDate(ne,I)});break;case"range":B=N.split(t.l10n.rangeSeparator).map(function(ne){return t.parseDate(ne,I)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(N)));t.selectedDates=t.config.allowInvalidPreload?B:B.filter(function(ne){return ne instanceof Date&&x(ne,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ne,Ne){return ne.getTime()-Ne.getTime()})}function ut(N,I,B){if(I===void 0&&(I=!1),B===void 0&&(B=t.config.dateFormat),N!==0&&!N||N instanceof Array&&N.length===0)return t.clear(I);rt(N,B),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,I),d(),t.selectedDates.length===0&&t.clear(!1),zt(I),I&&nt("onChange")}function yt(N){return N.slice().map(function(I){return typeof I=="string"||typeof I=="number"||I instanceof Date?t.parseDate(I,void 0,!0):I&&typeof I=="object"&&I.from&&I.to?{from:t.parseDate(I.from,void 0),to:t.parseDate(I.to,void 0)}:I}).filter(function(I){return I})}function Pt(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var N=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);N&&rt(N,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 Zt(){if(t.input=Ke(),!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=wt(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"),_e()}function _e(){t._positionElement=t.config.positionElement||t._input}function we(){var N=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=wt("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=N,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=N==="datetime-local"?"Y-m-d\\TH:i:S":N==="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{}v(t.mobileInput,"change",function(I){t.setDate(vn(I).value,!1,t.mobileFormatStr),nt("onChange"),nt("onClose")})}function Ze(N){if(t.isOpen===!0)return t.close();t.open(N)}function nt(N,I){if(t.config!==void 0){var B=t.config[N];if(B!==void 0&&B.length>0)for(var ne=0;B[ne]&&ne<B.length;ne++)B[ne](t.selectedDates,t.input.value,t,I);N==="onChange"&&(t.input.dispatchEvent(Et("change")),t.input.dispatchEvent(Et("input")))}}function Et(N){var I=document.createEvent("Event");return I.initEvent(N,!0,!0),I}function he(N){for(var I=0;I<t.selectedDates.length;I++){var B=t.selectedDates[I];if(B instanceof Date&&yn(B,N)===0)return""+I}return!1}function $e(N){return t.config.mode!=="range"||t.selectedDates.length<2?!1:yn(N,t.selectedDates[0])>=0&&yn(N,t.selectedDates[1])<=0}function Xe(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(N,I){var B=new Date(t.currentYear,t.currentMonth,1);B.setMonth(t.currentMonth+I),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[I].textContent=Do(B.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=B.getMonth().toString(),N.value=B.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 Jt(N){var I=N||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(B){return t.formatDate(B,I)}).filter(function(B,ne,Ne){return t.config.mode!=="range"||t.config.enableTime||Ne.indexOf(B)===ne}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function zt(N){N===void 0&&(N=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Jt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Jt(t.config.altFormat)),N!==!1&&nt("onValueUpdate")}function Xn(N){var I=vn(N),B=t.prevMonthNav.contains(I),ne=t.nextMonthNav.contains(I);B||ne?ve(B?-1:1):t.yearElements.indexOf(I)>=0?I.select():I.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):I.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function ct(N){N.preventDefault();var I=N.type==="keydown",B=vn(N),ne=B;t.amPM!==void 0&&B===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]);var Ne=parseFloat(ne.getAttribute("min")),qe=parseFloat(ne.getAttribute("max")),it=parseFloat(ne.getAttribute("step")),Ye=parseInt(ne.value,10),st=N.delta||(I?N.which===38?1:-1:0),We=Ye+it*st;if(typeof ne.value<"u"&&ne.value.length===2){var Qe=ne===t.hourElement,St=ne===t.minuteElement;We<Ne?(We=qe+We+Ln(!Qe)+(Ln(Qe)&&Ln(!t.amPM)),St&&C(void 0,-1,t.hourElement)):We>qe&&(We=ne===t.hourElement?We-qe-Ln(!t.amPM):Ne,St&&C(void 0,1,t.hourElement)),t.amPM&&Qe&&(it===1?We+Ye===23:Math.abs(We-Ye)>it)&&(t.amPM.textContent=t.l10n.amPM[Ln(t.amPM.textContent===t.l10n.amPM[0])]),ne.value=pn(We)}}return s(),t}function bs(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=IS(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 bs(this,n)},HTMLElement.prototype.flatpickr=function(n){return bs([this],n)});var Ut=function(n,e){return typeof n=="string"?bs(window.document.querySelectorAll(n),e):n instanceof Node?bs([n],e):bs(n,e)};Ut.defaultConfig={};Ut.l10ns={en:nn({},hl),default:nn({},hl)};Ut.localize=function(n){Ut.l10ns.default=nn(nn({},Ut.l10ns.default),n)};Ut.setDefaults=function(n){Ut.defaultConfig=nn(nn({},Ut.defaultConfig),n)};Ut.parseDate=xr({});Ut.formatDate=c_({});Ut.compareDates=yn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return bs(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=Ut);function NS(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=ht(i,t[s]);return{c(){e=_("input"),ii(e,i)},m(s,l){w(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){ii(e,i=hn(t,[l&2&&s[1]]))},d(s){s&&k(e),n[11](null)}}}function RS(n){let e;const t=n[10].default,i=$n(t,n,n[9],null),s=i||NS(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)&&Mn(i,t,l,l[9],e?Cn(t,l[9],o,null):Tn(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){P(s,l),e=!1},d(l){s&&s.d(l)}}}function HS(n){return n.charAt(2).toLowerCase()+n.substring(3)}function jS(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Wt(e,i),{$$slots:l={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a="",formattedValue:u="",element:f=null,dateFormat:c=null}=e,{options:d={}}=e,p=!1,{input:g=void 0,flatpickr:v=void 0}=e;Un(()=>{const C=f||g,M=y(d);return M.onReady.push(()=>{t(8,p=!0)}),t(3,v=Ut(C,Object.assign(M,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=rn();function y(C={}){C=Object.assign({},C);for(const M of r){const D=(L,O,F)=>{b(HS(M),[L,O,F])};M in C?(Array.isArray(C[M])||(C[M]=[C[M]]),C[M].push(D)):C[M]=[D]}return C.onChange&&!C.onChange.includes(S)&&C.onChange.push(S),C}function S(C,M,D){var O,F;const L=(F=(O=D==null?void 0:D.config)==null?void 0:O.mode)!=null?F:"single";t(2,a=L==="single"?C[0]:C),t(4,u=M)}function $(C){ge[C?"unshift":"push"](()=>{g=C,t(0,g)})}return n.$$set=C=>{e=ht(ht({},e),si(C)),t(1,s=Wt(e,i)),"value"in C&&t(2,a=C.value),"formattedValue"in C&&t(4,u=C.formattedValue),"element"in C&&t(5,f=C.element),"dateFormat"in C&&t(6,c=C.dateFormat),"options"in C&&t(7,d=C.options),"input"in C&&t(0,g=C.input),"flatpickr"in C&&t(3,v=C.flatpickr),"$$scope"in C&&t(9,o=C.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&p&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&p)for(const[C,M]of Object.entries(y(d)))v.set(C,M)},[g,s,a,v,u,f,c,d,p,o,l,$]}class qa extends Ee{constructor(e){super(),Ae(this,e,jS,RS,Oe,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function qS(n){let e,t,i,s,l,o,r;function a(f){n[2](f)}let u={id:n[4],options:W.defaultFlatpickrOptions(),value:n[0].min};return n[0].min!==void 0&&(u.formattedValue=n[0].min),l=new qa({props:u}),ge.push(()=>Ie(l,"formattedValue",a)),{c(){e=_("label"),t=R("Min date (UTC)"),s=T(),z(l.$$.fragment),h(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&h(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function VS(n){let e,t,i,s,l,o,r;function a(f){n[3](f)}let u={id:n[4],options:W.defaultFlatpickrOptions(),value:n[0].max};return n[0].max!==void 0&&(u.formattedValue=n[0].max),l=new qa({props:u}),ge.push(()=>Ie(l,"formattedValue",a)),{c(){e=_("label"),t=R("Max date (UTC)"),s=T(),z(l.$$.fragment),h(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&h(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function zS(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[qS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[VS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function BS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.min,r)&&(s.min=r,t(0,s))}function o(r){n.$$.not_equal(s.max,r)&&(s.max=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class US extends Ee{constructor(e){super(),Ae(this,e,BS,zS,Oe,{key:1,options:0})}}function WS(n){let e,t,i,s,l,o,r,a,u;function f(d){n[2](d)}let c={id:n[4],placeholder:"eg. optionA, optionB",required:!0};return n[0].values!==void 0&&(c.value=n[0].values),l=new os({props:c}),ge.push(()=>Ie(l,"value",f)),{c(){e=_("label"),t=R("Choices"),s=T(),z(l.$$.fragment),r=T(),a=_("div"),a.textContent="Use comma as separator.",h(e,"for",i=n[4]),h(a,"class","help-block")},m(d,p){w(d,e,p),m(e,t),w(d,s,p),q(l,d,p),w(d,r,p),w(d,a,p),u=!0},p(d,p){(!u||p&16&&i!==(i=d[4]))&&h(e,"for",i);const g={};p&16&&(g.id=d[4]),!o&&p&1&&(o=!0,g.value=d[0].values,Re(()=>o=!1)),l.$set(g)},i(d){u||(A(l.$$.fragment,d),u=!0)},o(d){P(l.$$.fragment,d),u=!1},d(d){d&&k(e),d&&k(s),V(l,d),d&&k(r),d&&k(a)}}}function YS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max select"),s=T(),l=_("input"),h(e,"for",i=n[4]),h(l,"type","number"),h(l,"id",o=n[4]),h(l,"step","1"),h(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&h(e,"for",i),f&16&&o!==(o=u[4])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KS(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[WS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[YS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-9"),h(l,"class","col-sm-3"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.values"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.maxSelect"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function ZS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=Dt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class JS extends Ee{constructor(e){super(),Ae(this,e,ZS,KS,Oe,{key:1,options:0})}}function GS(n,e,t){return["",{}]}class XS extends Ee{constructor(e){super(),Ae(this,e,GS,null,Oe,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function QS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max file size (bytes)"),s=T(),l=_("input"),h(e,"for",i=n[10]),h(l,"type","number"),h(l,"id",o=n[10]),h(l,"step","1"),h(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSize),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&h(e,"for",i),f&1024&&o!==(o=u[10])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].maxSize&&Ce(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function xS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max files"),s=T(),l=_("input"),h(e,"for",i=n[10]),h(l,"type","number"),h(l,"id",o=n[10]),h(l,"step","1"),h(l,"min",""),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&h(e,"for",i),f&1024&&o!==(o=u[10])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function e$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("div"),e.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',t=T(),i=_("div"),i.innerHTML='<span class="txt">Images (jpg, png, svg, gif)</span>',s=T(),l=_("div"),l.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=T(),r=_("div"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',h(e,"tabindex","0"),h(e,"class","dropdown-item closable"),h(i,"tabindex","0"),h(i,"class","dropdown-item closable"),h(l,"tabindex","0"),h(l,"class","dropdown-item closable"),h(r,"tabindex","0"),h(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=[G(e,"click",n[5]),G(i,"click",n[6]),G(l,"click",n[7]),G(r,"click",n[8])],a=!0)},p:oe,d(f){f&&k(e),f&&k(t),f&&k(i),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,lt(u)}}}function t$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S;function $(M){n[4](M)}let C={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(C.value=n[0].mimeTypes),r=new os({props:C}),ge.push(()=>Ie(r,"value",$)),v=new ss({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[e$]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),c=R(`Use comma as separator.
`),d=_("span"),p=_("span"),p.textContent="Choose presets",g=T(),z(v.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(p,"class","txt link-primary"),h(d,"class","inline-flex"),h(f,"class","help-block")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),w(M,o,D),q(r,M,D),w(M,u,D),w(M,f,D),m(f,c),m(f,d),m(d,p),m(d,g),q(v,d,null),b=!0,y||(S=tt(Mt.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&h(e,"for",l);const L={};D&1024&&(L.id=M[10]),!a&&D&1&&(a=!0,L.value=M[0].mimeTypes,Re(()=>a=!1)),r.$set(L);const O={};D&2049&&(O.$$scope={dirty:D,ctx:M}),v.$set(O)},i(M){b||(A(r.$$.fragment,M),A(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),V(r,M),M&&k(u),M&&k(f),V(v),y=!1,S()}}}function n$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[9](b)}let v={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[10]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:"List of thumb sizes for image files. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&h(e,"for",l);const S={};y&1024&&(S.id=b[10]),!a&&y&1&&(a=!0,S.value=b[0].thumbs,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function i$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[QS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[t$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[n$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(a,"class","col-sm-12"),h(c,"class","col-sm-12"),h(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),p=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const S={};v&2&&(S.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(S.$$scope={dirty:v,ctx:g}),u.$set(S);const $={};v&2&&($.name="schema."+g[1]+".options.thumbs"),v&3073&&($.$$scope={dirty:v,ctx:g}),d.$set($)},i(g){p||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(i),V(o),V(u),V(d)}}}function s$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Dt(this.value),t(0,s)}function o(){s.maxSelect=Dt(this.value),t(0,s)}function r(p){n.$$.not_equal(s.mimeTypes,p)&&(s.mimeTypes=p,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(p){n.$$.not_equal(s.thumbs,p)&&(s.thumbs=p,t(0,s))}return n.$$set=p=>{"key"in p&&t(1,i=p.key),"options"in p&&t(0,s=p.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]})},[s,i,l,o,r,a,u,f,c,d]}class l$ extends Ee{constructor(e){super(),Ae(this,e,s$,i$,Oe,{key:1,options:0})}}function o$(n){let e,t,i,s,l,o,r;function a(f){n[5](f)}let u={searchable:n[3].length>5,selectPlaceholder:n[2]?"Loading...":"Select collection",noOptionsText:"No collections found",selectionKey:"id",items:n[3]};return n[0].collectionId!==void 0&&(u.keyOfSelected=n[0].collectionId),l=new ls({props:u}),ge.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("Collection"),s=T(),z(l.$$.fragment),h(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&h(e,"for",i);const d={};c&8&&(d.searchable=f[3].length>5),c&4&&(d.selectPlaceholder=f[2]?"Loading...":"Select collection"),c&8&&(d.items=f[3]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].collectionId,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function r$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max select"),s=T(),l=_("input"),h(e,"for",i=n[9]),h(l,"type","number"),h(l,"id",o=n[9]),h(l,"step","1"),h(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function a$(n){let e,t,i,s,l,o,r;function a(f){n[7](f)}let u={id:n[9],items:n[4]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new ls({props:u}),ge.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("Delete record on relation delete"),s=T(),z(l.$$.fragment),h(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&h(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function u$(n){let e,t,i,s,l,o,r,a,u,f;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[o$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[r$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[a$,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-9"),h(l,"class","col-sm-3"),h(a,"class","col-sm-12"),h(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),f=!0},p(c,[d]){const p={};d&2&&(p.name="schema."+c[1]+".options.collectionId"),d&1549&&(p.$$scope={dirty:d,ctx:c}),i.$set(p);const g={};d&2&&(g.name="schema."+c[1]+".options.maxSelect"),d&1537&&(g.$$scope={dirty:d,ctx:c}),o.$set(g);const v={};d&2&&(v.name="schema."+c[1]+".options.cascadeDelete"),d&1537&&(v.$$scope={dirty:d,ctx:c}),u.$set(v)},i(c){f||(A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!0)},o(c){P(i.$$.fragment,c),P(o.$$.fragment,c),P(u.$$.fragment,c),f=!1},d(c){c&&k(e),V(i),V(o),V(u)}}}function f$(n,e,t){let{key:i=""}=e,{options:s={}}=e;const l=[{label:"False",value:!1},{label:"True",value:!0}];let o=!1,r=[];a();function a(){t(2,o=!0),Se.Collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{Se.errorResponseHandler(d)}).finally(()=>{t(2,o=!1)})}function u(d){n.$$.not_equal(s.collectionId,d)&&(s.collectionId=d,t(0,s))}function f(){s.maxSelect=Dt(this.value),t(0,s)}function c(d){n.$$.not_equal(s.cascadeDelete,d)&&(s.cascadeDelete=d,t(0,s))}return n.$$set=d=>{"key"in d&&t(1,i=d.key),"options"in d&&t(0,s=d.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,collectionId:null,cascadeDelete:!1})},[s,i,o,r,l,u,f,c]}class c$ extends Ee{constructor(e){super(),Ae(this,e,f$,u$,Oe,{key:1,options:0})}}function d$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Max select"),s=T(),l=_("input"),h(e,"for",i=n[5]),h(l,"type","number"),h(l,"id",o=n[5]),h(l,"step","1"),h(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&h(e,"for",i),f&32&&o!==(o=u[5])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].maxSelect&&Ce(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function h$(n){let e,t,i,s,l,o,r;function a(f){n[4](f)}let u={id:n[5],items:n[2]};return n[0].cascadeDelete!==void 0&&(u.keyOfSelected=n[0].cascadeDelete),l=new ls({props:u}),ge.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("Delete record on user delete"),s=T(),z(l.$$.fragment),h(e,"for",i=n[5])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&h(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function p$(n){let e,t,i,s,l,o,r;return i=new Fe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[d$,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[h$,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.maxSelect"),u&97&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.cascadeDelete"),u&97&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),V(i),V(o)}}}function m$(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=Dt(this.value),t(0,l)}function r(a){n.$$.not_equal(l.cascadeDelete,a)&&(l.cascadeDelete=a,t(0,l))}return n.$$set=a=>{"key"in a&&t(1,s=a.key),"options"in a&&t(0,l=a.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(l)&&t(0,l={maxSelect:1,cascadeDelete:!1})},[l,s,i,o,r]}class g$ extends Ee{constructor(e){super(),Ae(this,e,m$,p$,Oe,{key:1,options:0})}}function _$(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[37],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new rS({props:u}),ge.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Type"),s=T(),z(l.$$.fragment),h(e,"for",i=n[37])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c[1]&64&&i!==(i=f[37]))&&h(e,"for",i);const d={};c[1]&64&&(d.id=f[37]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function Ac(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or reserved name",h(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=at(e,jn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=at(e,jn,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function b$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g=!n[5]&&Ac();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=T(),g&&g.c(),l=T(),o=_("input"),h(t,"class","txt"),h(e,"for",s=n[37]),h(o,"type","text"),h(o,"id",r=n[37]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,h(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,b){w(v,e,b),m(e,t),m(e,i),g&&g.m(e,null),w(v,l,b),w(v,o,b),c=!0,n[0].id||o.focus(),d||(p=G(o,"input",n[17]),d=!0)},p(v,b){v[5]?g&&(Te(),P(g,1,1,()=>{g=null}),De()):g?b[0]&32&&A(g,1):(g=Ac(),g.c(),A(g,1),g.m(e,null)),(!c||b[1]&64&&s!==(s=v[37]))&&h(e,"for",s),(!c||b[1]&64&&r!==(r=v[37]))&&h(o,"id",r),(!c||b[0]&1&&a!==(a=v[0].id&&v[0].system))&&(o.disabled=a),(!c||b[0]&1&&u!==(u=!v[0].id))&&(o.autofocus=u),(!c||b[0]&1&&f!==(f=v[0].name)&&o.value!==f)&&(o.value=f)},i(v){c||(A(g),c=!0)},o(v){P(g),c=!1},d(v){v&&k(e),g&&g.d(),v&&k(l),v&&k(o),d=!1,p()}}}function v$(n){let e,t,i;function s(o){n[28](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new g$({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function y$(n){let e,t,i;function s(o){n[27](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new c$({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function k$(n){let e,t,i;function s(o){n[26](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new l$({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function w$(n){let e,t,i;function s(o){n[25](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new XS({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function S$(n){let e,t,i;function s(o){n[24](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new JS({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $$(n){let e,t,i;function s(o){n[23](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new US({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function C$(n){let e,t,i;function s(o){n[22](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new OS({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function M$(n){let e,t,i;function s(o){n[21](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new u_({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function T$(n){let e,t,i;function s(o){n[20](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new yS({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function D$(n){let e,t,i;function s(o){n[19](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new bS({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function O$(n){let e,t,i;function s(o){n[18](o)}let l={key:n[1]};return n[0].options!==void 0&&(l.options=n[0].options),e=new hS({props:l}),ge.push(()=>Ie(e,"options",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[0]&2&&(a.key=o[1]),!t&&r[0]&1&&(t=!0,a.options=o[0].options,Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function A$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Required"),h(e,"type","checkbox"),h(e,"id",t=n[37]),h(s,"for",o=n[37])},m(u,f){w(u,e,f),e.checked=n[0].required,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[29]),r=!0)},p(u,f){f[1]&64&&t!==(t=u[37])&&h(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&64&&o!==(o=u[37])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Ec(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[E$,({uniqueId:i})=>({37:i}),({uniqueId:i})=>[0,i?64:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&192&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function E$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Unique"),h(e,"type","checkbox"),h(e,"id",t=n[37]),h(s,"for",o=n[37])},m(u,f){w(u,e,f),e.checked=n[0].unique,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[30]),r=!0)},p(u,f){f[1]&64&&t!==(t=u[37])&&h(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&64&&o!==(o=u[37])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Pc(n){let e,t,i,s,l,o,r,a,u=n[8]&&Lc(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),l=_("button"),l.innerHTML='<span class="txt">Remove</span>',o=T(),u&&u.c(),h(t,"class","flex-fill"),h(l,"type","button"),h(l,"class","btn btn-sm btn-secondary fade"),h(s,"class","inline-flex flex-gap-base flex-nowrap"),h(e,"class","col-sm-4")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),u&&u.m(s,null),r||(a=G(l,"click",Hn(n[9])),r=!0)},p(f,c){f[8]?u?u.p(f,c):(u=Lc(f),u.c(),u.m(s,null)):u&&(u.d(1),u=null)},d(f){f&&k(e),u&&u.d(),r=!1,a()}}}function Lc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Done</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",Hn(n[3])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function P$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D;s=new Fe({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[_$,({uniqueId:U})=>({37:U}),({uniqueId:U})=>[0,U?64:0]]},$$scope:{ctx:n}}}),r=new Fe({props:{class:`
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[b$,({uniqueId:U})=>({37:U}),({uniqueId:U})=>[0,U?64:0]]},$$scope:{ctx:n}}});const L=[O$,D$,T$,M$,C$,$$,S$,w$,k$,y$,v$],O=[];function F(U,Q){return U[0].type==="text"?0:U[0].type==="number"?1:U[0].type==="bool"?2:U[0].type==="email"?3:U[0].type==="url"?4:U[0].type==="date"?5:U[0].type==="select"?6:U[0].type==="json"?7:U[0].type==="file"?8:U[0].type==="relation"?9:U[0].type==="user"?10:-1}~(f=F(n))&&(c=O[f]=L[f](n)),g=new Fe({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[A$,({uniqueId:U})=>({37:U}),({uniqueId:U})=>[0,U?64:0]]},$$scope:{ctx:n}}});let E=n[0].type!=="file"&&Ec(n),j=!n[0].toDelete&&Pc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),p=_("div"),z(g.$$.fragment),v=T(),b=_("div"),E&&E.c(),y=T(),j&&j.c(),S=T(),$=_("input"),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(u,"class","col-sm-12 hidden-empty"),h(p,"class","col-sm-4 flex"),h(b,"class","col-sm-4 flex"),h(t,"class","grid"),h($,"type","submit"),h($,"class","hidden"),h($,"tabindex","-1"),h(e,"class","field-form")},m(U,Q){w(U,e,Q),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,p),q(g,p,null),m(t,v),m(t,b),E&&E.m(b,null),m(t,y),j&&j.m(t,null),m(e,S),m(e,$),C=!0,M||(D=G(e,"submit",Vt(n[31])),M=!0)},p(U,Q){const te={};Q[0]&1&&(te.class="form-field required "+(U[0].id?"disabled":"")),Q[0]&2&&(te.name="schema."+U[1]+".type"),Q[0]&1|Q[1]&192&&(te.$$scope={dirty:Q,ctx:U}),s.$set(te);const H={};Q[0]&33&&(H.class=`
form-field
required
`+(U[5]?"":"invalid")+`
`+(U[0].id&&U[0].system?"disabled":"")+`
`),Q[0]&2&&(H.name="schema."+U[1]+".name"),Q[0]&33|Q[1]&192&&(H.$$scope={dirty:Q,ctx:U}),r.$set(H);let Y=f;f=F(U),f===Y?~f&&O[f].p(U,Q):(c&&(Te(),P(O[Y],1,1,()=>{O[Y]=null}),De()),~f?(c=O[f],c?c.p(U,Q):(c=O[f]=L[f](U),c.c()),A(c,1),c.m(u,null)):c=null);const K={};Q[0]&1|Q[1]&192&&(K.$$scope={dirty:Q,ctx:U}),g.$set(K),U[0].type!=="file"?E?(E.p(U,Q),Q[0]&1&&A(E,1)):(E=Ec(U),E.c(),A(E,1),E.m(b,null)):E&&(Te(),P(E,1,1,()=>{E=null}),De()),U[0].toDelete?j&&(j.d(1),j=null):j?j.p(U,Q):(j=Pc(U),j.c(),j.m(t,null))},i(U){C||(A(s.$$.fragment,U),A(r.$$.fragment,U),A(c),A(g.$$.fragment,U),A(E),C=!0)},o(U){P(s.$$.fragment,U),P(r.$$.fragment,U),P(c),P(g.$$.fragment,U),P(E),C=!1},d(U){U&&k(e),V(s),V(r),~f&&O[f].d(),V(g),E&&E.d(),j&&j.d(),M=!1,D()}}}function Fc(n){let e,t,i,s,l=n[0].system&&Ic(),o=!n[0].id&&Nc(n),r=n[0].required&&Rc(),a=n[0].unique&&Hc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),h(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),m(e,t),o&&o.m(e,null),m(e,i),r&&r.m(e,null),m(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Ic(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=Nc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Rc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Hc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function Ic(n){let e;return{c(){e=_("span"),e.textContent="System",h(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Nc(n){let e;return{c(){e=_("span"),e.textContent="New",h(e,"class","label"),X(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&X(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Rc(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Hc(n){let e;return{c(){e=_("span"),e.textContent="Unique",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function jc(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function qc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",Hn(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function L$(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,p,g,v,b,y=!n[0].toDelete&&Fc(n),S=n[7]&&!n[0].system&&jc(),$=n[0].toDelete&&qc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=R(r),f=T(),y&&y.c(),c=T(),d=_("div"),p=T(),S&&S.c(),g=T(),$&&$.c(),v=ot(),h(i,"class",s=Ua(W.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),h(t,"class","icon field-type"),h(o,"class","title field-name svelte-1tpxlm5"),h(o,"title",u=n[0].name),X(o,"txt-strikethrough",n[0].toDelete),h(e,"class","inline-flex"),h(d,"class","flex-fill")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w(C,f,M),y&&y.m(C,M),w(C,c,M),w(C,d,M),w(C,p,M),S&&S.m(C,M),w(C,g,M),$&&$.m(C,M),w(C,v,M),b=!0},p(C,M){(!b||M[0]&1&&s!==(s=Ua(W.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&h(i,"class",s),(!b||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&be(a,r),(!b||M[0]&1&&u!==(u=C[0].name))&&h(o,"title",u),M[0]&1&&X(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?y&&(y.d(1),y=null):y?y.p(C,M):(y=Fc(C),y.c(),y.m(c.parentNode,c)),C[7]&&!C[0].system?S?M[0]&129&&A(S,1):(S=jc(),S.c(),A(S,1),S.m(g.parentNode,g)):S&&(Te(),P(S,1,1,()=>{S=null}),De()),C[0].toDelete?$?$.p(C,M):($=qc(C),$.c(),$.m(v.parentNode,v)):$&&($.d(1),$=null)},i(C){b||(A(S),b=!0)},o(C){P(S),b=!1},d(C){C&&k(e),C&&k(f),y&&y.d(C),C&&k(c),C&&k(d),C&&k(p),S&&S.d(C),C&&k(g),$&&$.d(C),C&&k(v)}}}function F$(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete||n[0].system?"field-accordion disabled":"field-accordion",$$slots:{header:[L$],default:[P$]},$$scope:{ctx:n}};return e=new ja({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&256&&(o.interactive=s[8]),l[0]&5&&(o.class=s[2]||s[0].toDelete||s[0].system?"field-accordion disabled":"field-accordion"),l[0]&483|l[1]&128&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[32](null),V(e,s)}}}function I$(n,e,t){let i,s,l,o,r;cn(n,ns,re=>t(14,r=re));const a=rn();let{key:u="0"}=e,{field:f=new _n}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,p,g=f.type;function v(){p==null||p.expand()}function b(){p==null||p.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function S(re){return W.slugify(re)}Un(()=>{f.id||v()});const $=()=>{t(0,f.toDelete=!1,f)};function C(re){n.$$.not_equal(f.type,re)&&(f.type=re,t(0,f),t(13,g),t(4,p))}const M=re=>{t(0,f.name=S(re.target.value),f),re.target.value=f.name};function D(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function L(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function O(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function F(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function E(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function j(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function U(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function Q(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function te(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function H(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function Y(re){n.$$.not_equal(f.options,re)&&(f.options=re,t(0,f),t(13,g),t(4,p))}function K(){f.required=this.checked,t(0,f),t(13,g),t(4,p)}function Z(){f.unique=this.checked,t(0,f),t(13,g),t(4,p)}const ee=()=>{i&&b()};function ae(re){ge[re?"unshift":"push"](()=>{p=re,t(4,p)})}function ve(re){dt.call(this,n,re)}function le(re){dt.call(this,n,re)}function me(re){dt.call(this,n,re)}return n.$$set=re=>{"key"in re&&t(1,u=re.key),"field"in re&&t(0,f=re.field),"disabled"in re&&t(2,c=re.disabled),"excludeNames"in re&&t(11,d=re.excludeNames)},n.$$.update=()=>{n.$$.dirty[0]&8193&&g!=f.type&&(t(13,g=f.type),t(0,f.options={},f),t(0,f.unique=!1,f)),n.$$.dirty[0]&17&&f.toDelete&&(p&&b(),!f.name&&f.originalName&&t(0,f.name=f.originalName,f)),n.$$.dirty[0]&1&&!f.originalName&&f.name&&t(0,f.originalName=f.name,f),n.$$.dirty[0]&1&&typeof f.toDelete>"u"&&t(0,f.toDelete=!1,f),n.$$.dirty[0]&1&&f.required&&t(0,f.nullable=!1,f),n.$$.dirty[0]&1&&t(6,i=!W.isEmpty(f.name)&&f.type),n.$$.dirty[0]&80&&(i||p&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&2049&&t(5,l=!d.includes(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!W.isEmpty(W.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,p,l,i,o,s,y,S,d,v,g,r,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve,le,me]}class N$ extends Ee{constructor(e){super(),Ae(this,e,I$,F$,Oe,{key:1,field:0,disabled:2,excludeNames:11,expand:12,collapse:3},null,[-1,-1])}get expand(){return this.$$.ctx[12]}get collapse(){return this.$$.ctx[3]}}function Vc(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function zc(n,e){let t,i,s,l;function o(u){e[5](u,e[9],e[10],e[11])}function r(){return e[6](e[11])}let a={key:e[11],excludeNames:e[1].concat(e[4](e[9]))};return e[9]!==void 0&&(a.field=e[9]),i=new N$({props:a}),ge.push(()=>Ie(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),q(i,u,f),l=!0},p(u,f){e=u;const c={};f&1&&(c.key=e[11]),f&1&&(c.excludeNames=e[1].concat(e[4](e[9]))),!s&&f&1&&(s=!0,c.field=e[9],Re(()=>s=!1)),i.$set(c)},i(u){l||(A(i.$$.fragment,u),l=!0)},o(u){P(i.$$.fragment,u),l=!1},d(u){u&&k(t),V(i,u)}}}function R$(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,p,g,v=n[0].schema;const b=y=>y[11];for(let y=0;y<v.length;y+=1){let S=Vc(n,v,y),$=b(S);i.set($,t[y]=zc($,S))}return{c(){var y;e=_("div");for(let S=0;S<t.length;S+=1)t[S].c();s=T(),l=_("div"),o=T(),r=_("button"),a=_("i"),u=T(),f=_("span"),f.textContent="New field",h(e,"class","accordions"),h(l,"class","clearfix m-t-xs"),h(a,"class","ri-add-line"),h(f,"class","txt"),h(r,"type","button"),h(r,"class",c="btn btn-block "+((y=n[0].schema)!=null&&y.length?"btn-secondary":"btn-success"))},m(y,S){w(y,e,S);for(let $=0;$<t.length;$+=1)t[$].m(e,null);w(y,s,S),w(y,l,S),w(y,o,S),w(y,r,S),m(r,a),m(r,u),m(r,f),d=!0,p||(g=G(r,"click",n[3]),p=!0)},p(y,[S]){var $;S&23&&(v=y[0].schema,Te(),t=ft(t,S,b,1,y,v,i,e,Ft,zc,null,Vc),De()),(!d||S&1&&c!==(c="btn btn-block "+(($=y[0].schema)!=null&&$.length?"btn-secondary":"btn-success")))&&h(r,"class",c)},i(y){if(!d){for(let S=0;S<v.length;S+=1)A(t[S]);d=!0}},o(y){for(let S=0;S<t.length;S+=1)P(t[S]);d=!1},d(y){y&&k(e);for(let S=0;S<t.length;S+=1)t[S].d();y&&k(s),y&&k(l),y&&k(o),y&&k(r),p=!1,g()}}}function H$(n,e,t){const i=["id","created","updated"];let{collection:s={}}=e;function l(d){s.schema[d]&&(s.schema.splice(d,1),t(0,s))}function o(){const d=new _n({name:r()});s.schema.push(d),t(0,s)}function r(d="field"){let p="";for(;a(d+p);)++p;return d+p}function a(d){return!!s.schema.find(p=>p.name===d)}function u(d){let p=[];if(d.toDelete)return p;for(let g of s.schema)g===d||g.toDelete||p.push(g.name);return p}function f(d,p,g,v){g[v]=d,t(0,s)}const c=d=>l(d);return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof(s==null?void 0:s.schema)>"u"&&(t(0,s=s||{}),t(0,s.schema=[],s))},[s,i,l,o,u,f,c]}class j$ extends Ee{constructor(e){super(),Ae(this,e,H$,R$,Oe,{collection:0})}}function Bc(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[16]=e,i[17]=t,i}function Uc(n,e,t){const i=n.slice();return i[19]=e[t],i}function Wc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q,te,H=n[0].schema,Y=[];for(let K=0;K<H.length;K+=1)Y[K]=Yc(Uc(n,H,K));return{c(){e=_("div"),t=_("div"),i=_("div"),s=_("p"),s.textContent="The following record fields are available:",l=T(),o=_("div"),r=_("code"),r.textContent="id",a=T(),u=_("code"),u.textContent="created",f=T(),c=_("code"),c.textContent="updated",d=T();for(let K=0;K<Y.length;K+=1)Y[K].c();p=T(),g=_("hr"),v=T(),b=_("p"),b.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=T(),S=_("div"),S.innerHTML=`<code>@request.method</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,$=T(),C=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",L=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",F=T(),E=_("hr"),j=T(),U=_("p"),U.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(g,"class","m-t-10 m-b-5"),h(b,"class","m-b-0"),h(S,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(D,"class","m-b-0"),h(O,"class","inline-flex flex-gap-5"),h(E,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(K,Z){w(K,e,Z),m(e,t),m(t,i),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(o,d);for(let ee=0;ee<Y.length;ee+=1)Y[ee].m(o,null);m(i,p),m(i,g),m(i,v),m(i,b),m(i,y),m(i,S),m(i,$),m(i,C),m(i,M),m(i,D),m(i,L),m(i,O),m(i,F),m(i,E),m(i,j),m(i,U),te=!0},p(K,Z){if(Z&1){H=K[0].schema;let ee;for(ee=0;ee<H.length;ee+=1){const ae=Uc(K,H,ee);Y[ee]?Y[ee].p(ae,Z):(Y[ee]=Yc(ae),Y[ee].c(),Y[ee].m(o,null))}for(;ee<Y.length;ee+=1)Y[ee].d(1);Y.length=H.length}},i(K){te||(K&&Tt(()=>{Q||(Q=at(e,Xt,{duration:150},!0)),Q.run(1)}),te=!0)},o(K){K&&(Q||(Q=at(e,Xt,{duration:150},!1)),Q.run(0)),te=!1},d(K){K&&k(e),Rn(Y,K),K&&Q&&Q.end()}}}function q$(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&be(i,t)},d(s){s&&k(e)}}}function V$(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=R(t),s=R(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&be(i,t)},d(l){l&&k(e)}}}function Yc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?V$:q$}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function z$(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r<l.length;r+=1){let a=Bc(n,l,r),u=o(a);t.set(u,e[r]=Kc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ot()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),Te(),e=ft(e,a,o,1,r,l,t,i.parentNode,Ft,Kc,i,Bc),De())},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)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function B$(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function U$(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[tt(Mt.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function W$(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',h(e,"type","button"),h(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[tt(Mt.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function Y$(n){let e;return{c(){e=R("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function K$(n){let e;return{c(){e=R("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Z$(n){let e,t=n[15]+"",i,s,l=Mi(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,p,g,v,b,y;function S(){return n[10](n[14])}const $=()=>n[11](u,f),C=()=>n[11](null,f);function M(j){n[12](j,n[14])}var D=n[4];function L(j){let U={baseCollection:j[0],disabled:Mi(j[0][j[14]])};return j[0][j[14]]!==void 0&&(U.value=j[0][j[14]]),{props:U}}D&&(u=new D(L(n)),$(),ge.push(()=>Ie(u,"value",M)));function O(j,U){return U&1&&(g=null),g==null&&(g=!!Mi(j[0][j[14]])),g?K$:Y$}let F=O(n,-1),E=F(n);return{c(){e=_("label"),i=R(t),s=R(" - "),o=R(l),a=T(),u&&z(u.$$.fragment),d=T(),p=_("div"),E.c(),h(e,"for",r=n[18]),h(p,"class","help-block")},m(j,U){w(j,e,U),m(e,i),m(e,s),m(e,o),w(j,a,U),u&&q(u,j,U),w(j,d,U),w(j,p,U),E.m(p,null),v=!0,b||(y=G(e,"click",S),b=!0)},p(j,U){n=j,(!v||U&1)&&l!==(l=Mi(n[0][n[14]])?"Admins only":"Custom rule")&&be(o,l),(!v||U&262144&&r!==(r=n[18]))&&h(e,"for",r),f!==n[14]&&(C(),f=n[14],$());const Q={};if(U&1&&(Q.baseCollection=n[0]),U&1&&(Q.disabled=Mi(n[0][n[14]])),!c&&U&65&&(c=!0,Q.value=n[0][n[14]],Re(()=>c=!1)),D!==(D=n[4])){if(u){Te();const te=u;P(te.$$.fragment,1,0,()=>{V(te,1)}),De()}D?(u=new D(L(n)),$(),ge.push(()=>Ie(u,"value",M)),z(u.$$.fragment),A(u.$$.fragment,1),q(u,d.parentNode,d)):u=null}else D&&u.$set(Q);F!==(F=O(n,U))&&(E.d(1),E=F(n),E&&(E.c(),E.m(p,null)))},i(j){v||(u&&A(u.$$.fragment,j),v=!0)},o(j){u&&P(u.$$.fragment,j),v=!1},d(j){j&&k(e),j&&k(a),C(),u&&V(u,j),j&&k(d),j&&k(p),E.d(),b=!1,y()}}}function Kc(n,e){let t,i,s,l,o,r,a,u;function f(p,g){return g&1&&(l=null),l==null&&(l=!!Mi(p[0][p[14]])),l?W$:U$}let c=f(e,-1),d=c(e);return r=new Fe({props:{class:"form-field rule-field m-0 "+(Mi(e[0][e[14]])?"disabled":""),name:e[14],$$slots:{default:[Z$,({uniqueId:p})=>({18:p}),({uniqueId:p})=>p?262144:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=T(),s=_("div"),d.c(),o=T(),z(r.$$.fragment),a=T(),h(t,"class","m-t-sm m-b-sm"),h(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(p,g){w(p,t,g),w(p,i,g),w(p,s,g),d.m(s,null),m(s,o),q(r,s,null),m(s,a),u=!0},p(p,g){e=p,c===(c=f(e,g))&&d?d.p(e,g):(d.d(1),d=c(e),d&&(d.c(),d.m(s,o)));const v={};g&1&&(v.class="form-field rule-field m-0 "+(Mi(e[0][e[14]])?"disabled":"")),g&4456473&&(v.$$scope={dirty:g,ctx:e}),r.$set(v)},i(p){u||(A(r.$$.fragment,p),u=!0)},o(p){P(r.$$.fragment,p),u=!1},d(p){p&&k(t),p&&k(i),p&&k(s),d.d(),V(r)}}}function J$(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,p,g,v,b=n[2]&&Wc(n);const y=[B$,z$],S=[];function $(C,M){return C[5]?0:1}return f=$(n),c=S[f]=y[f](n),{c(){e=_("div"),t=_("div"),i=_("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
</a>.`,s=T(),l=_("span"),r=R(o),a=T(),b&&b.c(),u=T(),c.c(),d=ot(),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex"),h(e,"class","block m-b-base")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),b&&b.m(e,null),w(C,u,M),S[f].m(C,M),w(C,d,M),p=!0,g||(v=G(l,"click",n[7]),g=!0)},p(C,[M]){(!p||M&4)&&o!==(o=C[2]?"Hide available fields":"Show available fields")&&be(r,o),C[2]?b?(b.p(C,M),M&4&&A(b,1)):(b=Wc(C),b.c(),A(b,1),b.m(e,null)):b&&(Te(),P(b,1,1,()=>{b=null}),De());let D=f;f=$(C),f===D?S[f].p(C,M):(Te(),P(S[D],1,1,()=>{S[D]=null}),De(),c=S[f],c?c.p(C,M):(c=S[f]=y[f](C),c.c()),A(c,1),c.m(d.parentNode,d))},i(C){p||(A(b),A(c),p=!0)},o(C){P(b),P(c),p=!1},d(C){C&&k(e),b&&b.d(),C&&k(u),S[f].d(C),C&&k(d),g=!1,v()}}}function Mi(n){return n===null}function G$(n,e,t){let{collection:i=new On}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Ki(()=>import("./FilterAutocompleteInput.8c26964d.js"),[])).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Un(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var S;t(0,i[y]=s[y]||"",i),await li(),(S=o[y])==null||S.focus()},p=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var S;return(S=o[y])==null?void 0:S.focus()};function v(y,S){ge[y?"unshift":"push"](()=>{o[S]=y,t(3,o)})}function b(y,S){n.$$.not_equal(i[S],y)&&(i[S]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,p,g,v,b]}class X$ extends Ee{constructor(e){super(),Ae(this,e,G$,J$,Oe,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jc(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gc(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xc(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=R(`Renamed collection
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&2&&l!==(l=p[1].originalName+"")&&be(o,l),g&2&&c!==(c=p[1].name+"")&&be(d,c)},d(p){p&&k(e)}}}function Qc(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=R(`Renamed field
`),s=_("strong"),o=R(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=R(c),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex")},m(p,g){w(p,e,g),m(e,t),m(t,i),m(t,s),m(s,o),m(t,r),m(t,a),m(t,u),m(t,f),m(f,d)},p(p,g){g&16&&l!==(l=p[14].originalName+"")&&be(o,l),g&16&&c!==(c=p[14].name+"")&&be(d,c)},d(p){p&&k(e)}}}function xc(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=R("Removed field "),i=_("span"),l=R(s),o=T(),h(i,"class","txt-bold"),h(e,"class","txt-danger")},m(r,a){w(r,e,a),m(e,t),m(e,i),m(i,l),m(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&be(l,s)},d(r){r&&k(e)}}}function Q$(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[3].length&&Gc(),g=n[5]&&Xc(n),v=n[4],b=[];for(let $=0;$<v.length;$+=1)b[$]=Qc(Jc(n,v,$));let y=n[3],S=[];for(let $=0;$<y.length;$+=1)S[$]=xc(Zc(n,y,$));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=T(),p&&p.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let $=0;$<b.length;$+=1)b[$].c();d=T();for(let $=0;$<S.length;$+=1)S[$].c();h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning"),h(f,"class","changes-list svelte-1ghly2p")},m($,C){w($,e,C),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),p&&p.m(s,null),w($,r,C),w($,a,C),w($,u,C),w($,f,C),g&&g.m(f,null),m(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);m(f,d);for(let M=0;M<S.length;M+=1)S[M].m(f,null)},p($,C){if($[3].length?p||(p=Gc(),p.c(),p.m(s,null)):p&&(p.d(1),p=null),$[5]?g?g.p($,C):(g=Xc($),g.c(),g.m(f,c)):g&&(g.d(1),g=null),C&16){v=$[4];let M;for(M=0;M<v.length;M+=1){const D=Jc($,v,M);b[M]?b[M].p(D,C):(b[M]=Qc(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if(C&8){y=$[3];let M;for(M=0;M<y.length;M+=1){const D=Zc($,y,M);S[M]?S[M].p(D,C):(S[M]=xc(D),S[M].c(),S[M].m(f,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=y.length}},d($){$&&k(e),p&&p.d(),$&&k(r),$&&k(a),$&&k(u),$&&k(f),g&&g.d(),Rn(b,$),Rn(S,$)}}}function x$(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function e3(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=T(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,lt(l)}}}function t3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[e3],header:[x$],default:[Q$]},$$scope:{ctx:n}};return e=new yi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),V(e,s)}}}function n3(n,e,t){let i,s,l;const o=rn();let r,a;async function u(y){t(1,a=y),await li(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),p=()=>c();function g(y){ge[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){dt.call(this,n,y)}function b(y){dt.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,p,g,v,b]}class i3 extends Ee{constructor(e){super(),Ae(this,e,n3,t3,Oe,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function ed(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new X$({props:o}),ge.push(()=>Ie(t,"collection",l)),{c(){e=_("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){w(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],Re(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),V(t)}}}function s3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new j$({props:a}),ge.push(()=>Ie(i,"collection",r));let u=n[9]===pl&&ed(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),l=T(),u&&u.c(),h(t,"class","tab-item"),X(t,"active",n[9]===xi),h(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),q(i,t,null),m(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],Re(()=>s=!1)),i.$set(d),c[0]&512&&X(t,"active",f[9]===xi),f[9]===pl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=ed(f),u.c(),A(u,1),u.m(e,null)):u&&(Te(),P(u,1,1,()=>{u=null}),De())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),V(i),u&&u.d()}}}function td(n){let e,t,i,s,l,o,r;return o=new ss({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[l3]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),z(o.$$.fragment),h(e,"class","flex-fill"),h(s,"class","ri-more-line"),h(i,"type","button"),h(i,"class","btn btn-sm btn-circle btn-secondary flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),m(i,s),m(i,l),q(o,i,null),r=!0},p(a,u){const f={};u[1]&256&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(A(o.$$.fragment,a),r=!0)},o(a){P(o.$$.fragment,a),r=!1},d(a){a&&k(e),a&&k(t),a&&k(i),V(o)}}}function l3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function nd(n){let e;return{c(){e=_("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function o3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=n[2].system&&nd();return{c(){e=_("label"),t=R("Name"),s=T(),l=_("input"),u=T(),p&&p.c(),f=ot(),h(e,"for",i=n[38]),h(l,"type","text"),h(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],h(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,h(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(g,v){w(g,e,v),m(e,t),w(g,s,v),w(g,l,v),w(g,u,v),p&&p.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&h(e,"for",i),v[1]&128&&o!==(o=g[38])&&h(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?p||(p=nd(),p.c(),p.m(f.parentNode,f)):p&&(p.d(1),p=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),p&&p.d(g),g&&k(f),c=!1,d()}}}function id(n){let e,t,i,s,l,o;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=tt(t=Mt.call(null,e,n[12])),l=!0)},p(r,a){t&&Bn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=at(e,qn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=at(e,qn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function sd(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function r3(n){var j,U,Q,te,H,Y;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,p,g,v=!W.isEmpty((j=n[4])==null?void 0:j.schema),b,y,S,$,C=!W.isEmpty((U=n[4])==null?void 0:U.listRule)||!W.isEmpty((Q=n[4])==null?void 0:Q.viewRule)||!W.isEmpty((te=n[4])==null?void 0:te.createRule)||!W.isEmpty((H=n[4])==null?void 0:H.updateRule)||!W.isEmpty((Y=n[4])==null?void 0:Y.deleteRule),M,D,L,O=!n[2].isNew&&!n[2].system&&td(n);r=new Fe({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[o3,({uniqueId:K})=>({38:K}),({uniqueId:K})=>[0,K?128:0]]},$$scope:{ctx:n}}});let F=v&&id(n),E=C&&sd();return{c(){e=_("h4"),i=R(t),s=T(),O&&O.c(),l=T(),o=_("form"),z(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),p=_("span"),p.textContent="Fields",g=T(),F&&F.c(),b=T(),y=_("button"),S=_("span"),S.textContent="API Rules",$=T(),E&&E.c(),h(u,"type","submit"),h(u,"class","hidden"),h(u,"tabindex","-1"),h(o,"class","block"),h(p,"class","txt"),h(d,"type","button"),h(d,"class","tab-item"),X(d,"active",n[9]===xi),h(S,"class","txt"),h(y,"type","button"),h(y,"class","tab-item"),X(y,"active",n[9]===pl),h(c,"class","tabs-header stretched")},m(K,Z){w(K,e,Z),m(e,i),w(K,s,Z),O&&O.m(K,Z),w(K,l,Z),w(K,o,Z),q(r,o,null),m(o,a),m(o,u),w(K,f,Z),w(K,c,Z),m(c,d),m(d,p),m(d,g),F&&F.m(d,null),m(c,b),m(c,y),m(y,S),m(y,$),E&&E.m(y,null),M=!0,D||(L=[G(o,"submit",Vt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(K,Z){var ae,ve,le,me,re,de;(!M||Z[0]&4)&&t!==(t=K[2].isNew?"New collection":"Edit collection")&&be(i,t),!K[2].isNew&&!K[2].system?O?(O.p(K,Z),Z[0]&4&&A(O,1)):(O=td(K),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Te(),P(O,1,1,()=>{O=null}),De());const ee={};Z[0]&2048&&(ee.class="form-field required m-b-0 "+(K[11]?"disabled":"")),Z[0]&2052|Z[1]&384&&(ee.$$scope={dirty:Z,ctx:K}),r.$set(ee),Z[0]&16&&(v=!W.isEmpty((ae=K[4])==null?void 0:ae.schema)),v?F?(F.p(K,Z),Z[0]&16&&A(F,1)):(F=id(K),F.c(),A(F,1),F.m(d,null)):F&&(Te(),P(F,1,1,()=>{F=null}),De()),Z[0]&512&&X(d,"active",K[9]===xi),Z[0]&16&&(C=!W.isEmpty((ve=K[4])==null?void 0:ve.listRule)||!W.isEmpty((le=K[4])==null?void 0:le.viewRule)||!W.isEmpty((me=K[4])==null?void 0:me.createRule)||!W.isEmpty((re=K[4])==null?void 0:re.updateRule)||!W.isEmpty((de=K[4])==null?void 0:de.deleteRule)),C?E?Z[0]&16&&A(E,1):(E=sd(),E.c(),A(E,1),E.m(y,null)):E&&(Te(),P(E,1,1,()=>{E=null}),De()),Z[0]&512&&X(y,"active",K[9]===pl)},i(K){M||(A(O),A(r.$$.fragment,K),A(F),A(E),M=!0)},o(K){P(O),P(r.$$.fragment,K),P(F),P(E),M=!1},d(K){K&&k(e),K&&k(s),O&&O.d(K),K&&k(l),K&&k(o),V(r),K&&k(f),K&&k(c),F&&F.d(),E&&E.d(),D=!1,lt(L)}}}function a3(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=R(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],X(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=[G(e,"click",n[18]),G(s,"click",n[19])],u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&be(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&X(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,lt(f)}}}function u3(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[a3],header:[r3],default:[s3]},$$scope:{ctx:n}};e=new yi({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new i3({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){z(e.$$.fragment),t=T(),z(i.$$.fragment)},m(r,a){q(e,r,a),w(r,t,a),q(i,r,a),s=!0},p(r,a){const u={};a[0]&264&&(u.beforeHide=r[27]),a[0]&7828|a[1]&256&&(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){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[28](null),V(e,r),r&&k(t),n[31](null),V(i,r)}}}const xi="fields",pl="api_rules";function kr(n){return JSON.stringify(n)}function f3(n,e,t){let i,s,l,o,r,a;cn(n,ni,de=>t(34,r=de)),cn(n,ns,de=>t(4,a=de));const u=rn();let f,c,d=null,p=new On,g=!1,v=!1,b=xi,y=kr(p);function S(de){t(9,b=de)}function $(de){return M(de),t(8,v=!0),S(xi),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function M(de){Li({}),typeof de<"u"?(d=de,t(2,p=de==null?void 0:de.clone())):(d=null,t(2,p=new On)),t(2,p.schema=p.schema||[],p),t(2,p.originalName=p.name||"",p),await li(),t(17,y=kr(p))}function D(){if(p.isNew)return L();c==null||c.show(p)}function L(){if(g)return;t(7,g=!0);const de=O();let fe;p.isNew?fe=Se.Collections.create(de):fe=Se.Collections.update(p.id,de),fe.then(ie=>{t(8,v=!1),C(),dn(p.isNew?"Successfully created collection.":"Successfully updated collection."),Iw(ie),p.isNew&&jp(ni,r=ie,r),u("save",ie)}).catch(ie=>{Se.errorResponseHandler(ie)}).finally(()=>{t(7,g=!1)})}function O(){const de=p.export();de.schema=de.schema.slice(0);for(let fe=de.schema.length-1;fe>=0;fe--)de.schema[fe].toDelete&&de.schema.splice(fe,1);return de}function F(){!(d!=null&&d.id)||_i(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>Se.Collections.delete(d==null?void 0:d.id).then(()=>{C(),dn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),Nw(d)}).catch(de=>{Se.errorResponseHandler(de)}))}const E=()=>C(),j=()=>D(),U=()=>F(),Q=de=>{t(2,p.name=W.slugify(de.target.value),p),de.target.value=p.name},te=()=>{o&&D()},H=()=>S(xi),Y=()=>S(pl);function K(de){p=de,t(2,p)}function Z(de){p=de,t(2,p)}const ee=()=>l&&v?(_i("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),C()}),!1):!0;function ae(de){ge[de?"unshift":"push"](()=>{f=de,t(5,f)})}function ve(de){dt.call(this,n,de)}function le(de){dt.call(this,n,de)}function me(de){ge[de?"unshift":"push"](()=>{c=de,t(6,c)})}const re=()=>L();return n.$$.update=()=>{n.$$.dirty[0]&16&&t(12,i=typeof W.getNestedVal(a,"schema.message",null)=="string"?W.getNestedVal(a,"schema.message"):"Has errors"),n.$$.dirty[0]&4&&t(11,s=!p.isNew&&p.system),n.$$.dirty[0]&131076&&t(3,l=y!=kr(p)),n.$$.dirty[0]&12&&t(10,o=p.isNew||l)},[S,C,p,l,a,f,c,g,v,b,o,s,i,D,L,F,$,y,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve,le,me,re]}class Va extends Ee{constructor(e){super(),Ae(this,e,f3,u3,Oe,{changeTab:0,show:16,hide:1},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[16]}get hide(){return this.$$.ctx[1]}}function ld(n,e,t){const i=n.slice();return i[13]=e[t],i}function od(n){let e,t=n[1].length&&rd();return{c(){t&&t.c(),e=ot()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=rd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function rd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",h(e,"class","txt-hint m-t-10 m-b-10 txt-center")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function c3(n){let e;return{c(){e=_("i"),h(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function d3(n){let e;return{c(){e=_("i"),h(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ad(n,e){let t,i,s,l=e[13].name+"",o,r,a,u;function f(g,v){var b;return((b=g[5])==null?void 0:b.id)===g[13].id?d3:c3}let c=f(e),d=c(e);function p(){return e[10](e[13])}return{key:n,first:null,c(){var g;t=_("div"),d.c(),i=T(),s=_("span"),o=R(l),r=T(),h(s,"class","txt"),h(t,"tabindex","0"),h(t,"class","sidebar-list-item"),X(t,"active",((g=e[5])==null?void 0:g.id)===e[13].id),this.first=t},m(g,v){w(g,t,v),d.m(t,null),m(t,i),m(t,s),m(s,o),m(t,r),a||(u=G(t,"click",p),a=!0)},p(g,v){var b;e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i))),v&8&&l!==(l=e[13].name+"")&&be(o,l),v&40&&X(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id)},d(g){g&&k(t),d.d(),a=!1,u()}}}function h3(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],p=new Map,g,v,b,y,S,$,C,M,D=n[3];const L=E=>E[13].id;for(let E=0;E<D.length;E+=1){let j=ld(n,D,E),U=L(j);p.set(U,d[E]=ad(U,j))}let O=null;D.length||(O=od(n));let F={};return S=new Va({props:F}),n[12](S),{c(){e=_("aside"),t=_("header"),i=_("div"),s=_("div"),l=_("button"),l.innerHTML='<i class="ri-close-line"></i>',o=T(),r=_("input"),a=T(),u=_("hr"),f=T(),c=_("div");for(let E=0;E<d.length;E+=1)d[E].c();O&&O.c(),g=T(),v=_("footer"),b=_("button"),b.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New collection</span>`,y=T(),z(S.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),X(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),X(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(c,"class","sidebar-content"),h(b,"type","button"),h(b,"class","btn btn-block btn-outline"),h(v,"class","sidebar-footer"),h(e,"class","page-sidebar collection-sidebar")},m(E,j){w(E,e,j),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Ce(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let U=0;U<d.length;U+=1)d[U].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(E,y,j),q(S,E,j),$=!0,C||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],C=!0)},p(E,[j]){j&16&&X(l,"hidden",!E[4]),j&1&&r.value!==E[0]&&Ce(r,E[0]),j&16&&X(i,"active",E[4]),j&106&&(D=E[3],d=ft(d,j,L,1,E,D,p,c,ln,ad,null,ld),!D.length&&O?O.p(E,j):D.length?O&&(O.d(1),O=null):(O=od(E),O.c(),O.m(c,null)));const U={};S.$set(U)},i(E){$||(A(S.$$.fragment,E),$=!0)},o(E){P(S.$$.fragment,E),$=!1},d(E){E&&k(e);for(let j=0;j<d.length;j+=1)d[j].d();O&&O.d(),E&&k(y),n[12](null),V(S,E),C=!1,lt(M)}}}function p3(n,e,t){let i,s,l,o,r;cn(n,ni,b=>t(5,o=b)),cn(n,Ss,b=>t(7,r=b));let a,u="";function f(b){jp(ni,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const p=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){ge[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,p,g,v]}class m3 extends Ee{constructor(e){super(),Ae(this,e,p3,h3,Oe,{})}}function g3(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe,ue,ce,ke,Be;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=R(` - is one of:
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),p=_("code"),p.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),S=_("code"),S.textContent="!=",$=T(),C=_("span"),C.textContent="NOT equal",M=T(),D=_("li"),L=_("code"),L.textContent=">",O=T(),F=_("span"),F.textContent="Greater than",E=T(),j=_("li"),U=_("code"),U.textContent=">=",Q=T(),te=_("span"),te.textContent="Greater than or equal",H=T(),Y=_("li"),K=_("code"),K.textContent="<",Z=T(),ee=_("span"),ee.textContent="Less than or equal",ae=T(),ve=_("li"),le=_("code"),le.textContent="<=",me=T(),re=_("span"),re.textContent="Less than or equal",de=T(),fe=_("li"),ie=_("code"),ie.textContent="~",x=T(),ye=_("span"),ye.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
match)`,He=T(),Le=_("li"),Pe=_("code"),Pe.textContent="!~",ue=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,ke=T(),Be=_("p"),Be.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,h(r,"class","txt-danger"),h(p,"class","filter-op svelte-1w7s5nw"),h(v,"class","txt-hint"),h(S,"class","filter-op svelte-1w7s5nw"),h(C,"class","txt-hint"),h(L,"class","filter-op svelte-1w7s5nw"),h(F,"class","txt-hint"),h(U,"class","filter-op svelte-1w7s5nw"),h(te,"class","txt-hint"),h(K,"class","filter-op svelte-1w7s5nw"),h(ee,"class","txt-hint"),h(le,"class","filter-op svelte-1w7s5nw"),h(re,"class","txt-hint"),h(ie,"class","filter-op svelte-1w7s5nw"),h(ye,"class","txt-hint"),h(Pe,"class","filter-op svelte-1w7s5nw"),h(ce,"class","txt-hint")},m(Ke,Ue){w(Ke,e,Ue),w(Ke,t,Ue),w(Ke,i,Ue),m(i,s),m(i,l),m(i,o),m(o,r),m(o,a),m(o,u),m(o,f),m(o,c),m(c,d),m(d,p),m(d,g),m(d,v),m(c,b),m(c,y),m(y,S),m(y,$),m(y,C),m(c,M),m(c,D),m(D,L),m(D,O),m(D,F),m(c,E),m(c,j),m(j,U),m(j,Q),m(j,te),m(c,H),m(c,Y),m(Y,K),m(Y,Z),m(Y,ee),m(c,ae),m(c,ve),m(ve,le),m(ve,me),m(ve,re),m(c,de),m(c,fe),m(fe,ie),m(fe,x),m(fe,ye),m(c,He),m(c,Le),m(Le,Pe),m(Le,ue),m(Le,ce),w(Ke,ke,Ue),w(Ke,Be,Ue)},p:oe,i:oe,o:oe,d(Ke){Ke&&k(e),Ke&&k(t),Ke&&k(i),Ke&&k(ke),Ke&&k(Be)}}}class _3 extends Ee{constructor(e){super(),Ae(this,e,null,g3,Oe,{})}}function ud(n,e,t){const i=n.slice();return i[8]=e[t],i}function fd(n,e,t){const i=n.slice();return i[8]=e[t],i}function cd(n,e,t){const i=n.slice();return i[13]=e[t],i}function dd(n,e,t){const i=n.slice();return i[13]=e[t],i}function hd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pd(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&be(s,i),f&24&&X(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function md(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&X(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function gd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("div"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&36&&X(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function _d(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&X(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function b3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",S,$,C,M,D,L,O,F=[],E=new Map,j,U,Q=[],te=new Map,H,Y,K,Z,ee,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe,ue,ce,ke,Be,Ke,Ue,Je,xe,J,se,pe,Ve,Ge,bt,rt,ut,yt,Pt,Zt,_e,we,Ze,nt,Et,he,$e,Xe,Jt,zt,Xn,ct,N,I,B,ne,Ne,qe,it,Ye,st,We,Qe=[],St=new Map,bn,Yt,Gt=[],ai=new Map,ki,Qt=n[1]&&hd(),rs=n[4];const Tl=Me=>Me[13].lang;for(let Me=0;Me<rs.length;Me+=1){let ze=dd(n,rs,Me),Ot=Tl(ze);E.set(Ot,F[Me]=pd(Ot,ze))}let Ni=n[4];const Dl=Me=>Me[13].lang;for(let Me=0;Me<Ni.length;Me+=1){let ze=cd(n,Ni,Me),Ot=Dl(ze);te.set(Ot,Q[Me]=md(Ot,ze))}Je=new en({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ut=new en({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),Pt=new _3({}),Xe=new en({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let as=n[5];const Ol=Me=>Me[8].code;for(let Me=0;Me<as.length;Me+=1){let ze=fd(n,as,Me),Ot=Ol(ze);St.set(Ot,Qe[Me]=gd(Ot,ze))}let Ri=n[5];const Al=Me=>Me[8].code;for(let Me=0;Me<Ri.length;Me+=1){let ze=ud(n,Ri,Me),Ot=Al(ze);ai.set(Ot,Gt[Me]=_d(Ot,ze))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),Qt&&Qt.c(),d=T(),p=_("div"),g=_("p"),v=R("Fetch a paginated "),b=_("strong"),S=R(y),$=R(" records list."),C=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),L=_("div"),O=_("div");for(let Me=0;Me<F.length;Me+=1)F[Me].c();j=T(),U=_("div");for(let Me=0;Me<Q.length;Me+=1)Q[Me].c();H=T(),Y=_("div"),Y.textContent="Query parameters",K=T(),Z=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,ae=T(),ve=_("tbody"),le=_("tr"),le.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,me=T(),re=_("tr"),re.innerHTML=`<td>perPage</td>
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,de=T(),fe=_("tr"),ie=_("td"),ie.textContent="sort",x=T(),ye=_("td"),ye.innerHTML='<span class="label">String</span>',He=T(),Le=_("td"),Pe=R("Specify the records order attribute(s). "),ue=_("br"),ce=R(`
Add `),ke=_("code"),ke.textContent="-",Be=R(" / "),Ke=_("code"),Ke.textContent="+",Ue=R(` (default) in front of the attribute for DESC / ASC order.
Ex.:
`),z(Je.$$.fragment),xe=T(),J=_("tr"),se=_("td"),se.textContent="filter",pe=T(),Ve=_("td"),Ve.innerHTML='<span class="label">String</span>',Ge=T(),bt=_("td"),rt=R(`Filter the returned records. Ex.:
`),z(ut.$$.fragment),yt=T(),z(Pt.$$.fragment),Zt=T(),_e=_("tr"),we=_("td"),we.textContent="expand",Ze=T(),nt=_("td"),nt.innerHTML='<span class="label">String</span>',Et=T(),he=_("td"),$e=R(`Auto expand nested record relations. Ex.:
`),z(Xe.$$.fragment),Jt=R(`
Supports up to 6-levels depth nested relations expansion. `),zt=_("br"),Xn=R(`
The expanded relations will be appended to each individual record under the
`),ct=_("code"),ct.textContent="@expand",N=R(" property (eg. "),I=_("code"),I.textContent='"@expand": {"rel1": {...}, ...}',B=R(`). Only the
relations that the user has permissions to `),ne=_("strong"),ne.textContent="view",Ne=R(" will be expanded."),qe=T(),it=_("div"),it.textContent="Responses",Ye=T(),st=_("div"),We=_("div");for(let Me=0;Me<Qe.length;Me+=1)Qe[Me].c();bn=T(),Yt=_("div");for(let Me=0;Me<Gt.length;Me+=1)Gt[Me].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(p,"class","content m-b-base"),h(M,"class","section-title"),h(O,"class","tabs-header compact left"),h(U,"class","tabs-content"),h(L,"class","tabs m-b-lg"),h(Y,"class","section-title"),h(Z,"class","table-compact table-border m-b-lg"),h(it,"class","section-title"),h(We,"class","tabs-header compact left"),h(Yt,"class","tabs-content"),h(st,"class","tabs")},m(Me,ze){w(Me,e,ze),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),Qt&&Qt.m(e,null),w(Me,d,ze),w(Me,p,ze),m(p,g),m(g,v),m(g,b),m(b,S),m(g,$),w(Me,C,ze),w(Me,M,ze),w(Me,D,ze),w(Me,L,ze),m(L,O);for(let Ot=0;Ot<F.length;Ot+=1)F[Ot].m(O,null);m(L,j),m(L,U);for(let Ot=0;Ot<Q.length;Ot+=1)Q[Ot].m(U,null);w(Me,H,ze),w(Me,Y,ze),w(Me,K,ze),w(Me,Z,ze),m(Z,ee),m(Z,ae),m(Z,ve),m(ve,le),m(ve,me),m(ve,re),m(ve,de),m(ve,fe),m(fe,ie),m(fe,x),m(fe,ye),m(fe,He),m(fe,Le),m(Le,Pe),m(Le,ue),m(Le,ce),m(Le,ke),m(Le,Be),m(Le,Ke),m(Le,Ue),q(Je,Le,null),m(ve,xe),m(ve,J),m(J,se),m(J,pe),m(J,Ve),m(J,Ge),m(J,bt),m(bt,rt),q(ut,bt,null),m(bt,yt),q(Pt,bt,null),m(ve,Zt),m(ve,_e),m(_e,we),m(_e,Ze),m(_e,nt),m(_e,Et),m(_e,he),m(he,$e),q(Xe,he,null),m(he,Jt),m(he,zt),m(he,Xn),m(he,ct),m(he,N),m(he,I),m(he,B),m(he,ne),m(he,Ne),w(Me,qe,ze),w(Me,it,ze),w(Me,Ye,ze),w(Me,st,ze),m(st,We);for(let Ot=0;Ot<Qe.length;Ot+=1)Qe[Ot].m(We,null);m(st,bn),m(st,Yt);for(let Ot=0;Ot<Gt.length;Ot+=1)Gt[Ot].m(Yt,null);ki=!0},p(Me,[ze]){(!ki||ze&1)&&a!==(a=Me[0].name+"")&&be(u,a),Me[1]?Qt||(Qt=hd(),Qt.c(),Qt.m(e,null)):Qt&&(Qt.d(1),Qt=null),(!ki||ze&1)&&y!==(y=Me[0].name+"")&&be(S,y),ze&24&&(rs=Me[4],F=ft(F,ze,Tl,1,Me,rs,E,O,ln,pd,null,dd)),ze&24&&(Ni=Me[4],Te(),Q=ft(Q,ze,Dl,1,Me,Ni,te,U,Ft,md,null,cd),De()),ze&36&&(as=Me[5],Qe=ft(Qe,ze,Ol,1,Me,as,St,We,ln,gd,null,fd)),ze&36&&(Ri=Me[5],Te(),Gt=ft(Gt,ze,Al,1,Me,Ri,ai,Yt,Ft,_d,null,ud),De())},i(Me){if(!ki){for(let ze=0;ze<Ni.length;ze+=1)A(Q[ze]);A(Je.$$.fragment,Me),A(ut.$$.fragment,Me),A(Pt.$$.fragment,Me),A(Xe.$$.fragment,Me);for(let ze=0;ze<Ri.length;ze+=1)A(Gt[ze]);ki=!0}},o(Me){for(let ze=0;ze<Q.length;ze+=1)P(Q[ze]);P(Je.$$.fragment,Me),P(ut.$$.fragment,Me),P(Pt.$$.fragment,Me),P(Xe.$$.fragment,Me);for(let ze=0;ze<Gt.length;ze+=1)P(Gt[ze]);ki=!1},d(Me){Me&&k(e),Qt&&Qt.d(),Me&&k(d),Me&&k(p),Me&&k(C),Me&&k(M),Me&&k(D),Me&&k(L);for(let ze=0;ze<F.length;ze+=1)F[ze].d();for(let ze=0;ze<Q.length;ze+=1)Q[ze].d();Me&&k(H),Me&&k(Y),Me&&k(K),Me&&k(Z),V(Je),V(ut),V(Pt),V(Xe),Me&&k(qe),Me&&k(it),Me&&k(Ye),Me&&k(st);for(let ze=0;ze<Qe.length;ze+=1)Qe[ze].d();for(let ze=0;ze<Gt.length;ze+=1)Gt[ze].d()}}}function v3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.listRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(s),W.dummyCollectionRecord(s)]},null,2)}),r.push({code:400,body:`
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.getList("${s==null?void 0:s.name}", { page: 2 })
.then(function (list) {
// success...
}).catch(function (error) {
// error...
});
// alternatively you can also fetch all records at once via getFullList:
client.Records.getFullList("${s==null?void 0:s.name}", 200 /* batch size */)
.then(function (records) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class y3 extends Ee{constructor(e){super(),Ae(this,e,v3,b3,Oe,{collection:0})}}function bd(n,e,t){const i=n.slice();return i[8]=e[t],i}function vd(n,e,t){const i=n.slice();return i[8]=e[t],i}function yd(n,e,t){const i=n.slice();return i[13]=e[t],i}function kd(n,e,t){const i=n.slice();return i[13]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Sd(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&be(s,i),f&24&&X(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function $d(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&X(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function Cd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&36&&X(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Md(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&X(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function k3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,S=n[0].name+"",$,C,M,D,L,O,F,E=[],j=new Map,U,Q,te=[],H=new Map,Y,K,Z,ee,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le,Pe,ue,ce,ke,Be,Ke,Ue,Je,xe,J,se,pe,Ve,Ge,bt,rt,ut,yt=[],Pt=new Map,Zt,_e,we=[],Ze=new Map,nt,Et=n[1]&&wd(),he=n[4];const $e=I=>I[13].lang;for(let I=0;I<he.length;I+=1){let B=kd(n,he,I),ne=$e(B);j.set(ne,E[I]=Sd(ne,B))}let Xe=n[4];const Jt=I=>I[13].lang;for(let I=0;I<Xe.length;I+=1){let B=yd(n,Xe,I),ne=Jt(B);H.set(ne,te[I]=$d(ne,B))}ce=new en({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let zt=n[5];const Xn=I=>I[8].code;for(let I=0;I<zt.length;I+=1){let B=vd(n,zt,I),ne=Xn(B);Pt.set(ne,yt[I]=Cd(ne,B))}let ct=n[5];const N=I=>I[8].code;for(let I=0;I<ct.length;I+=1){let B=bd(n,ct,I),ne=N(B);Ze.set(ne,we[I]=Md(ne,B))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Et&&Et.c(),p=T(),g=_("div"),v=_("p"),b=R("Fetch a single "),y=_("strong"),$=R(S),C=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",L=T(),O=_("div"),F=_("div");for(let I=0;I<E.length;I+=1)E[I].c();U=T(),Q=_("div");for(let I=0;I<te.length;I+=1)te[I].c();Y=T(),K=_("div"),K.textContent="Path Parameters",Z=T(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,ae=T(),ve=_("div"),ve.textContent="Query parameters",le=T(),me=_("table"),re=_("thead"),re.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,de=T(),fe=_("tbody"),ie=_("tr"),x=_("td"),x.textContent="expand",ye=T(),He=_("td"),He.innerHTML='<span class="label">String</span>',Le=T(),Pe=_("td"),ue=R(`Auto expand nested record relations. Ex.:
`),z(ce.$$.fragment),ke=R(`
Supports up to 6-levels depth nested relations expansion. `),Be=_("br"),Ke=R(`
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",Je=R(" property (eg. "),xe=_("code"),xe.textContent='"@expand": {"rel1": {...}, ...}',J=R(`). Only the
relations that the user has permissions to `),se=_("strong"),se.textContent="view",pe=R(" will be expanded."),Ve=T(),Ge=_("div"),Ge.textContent="Responses",bt=T(),rt=_("div"),ut=_("div");for(let I=0;I<yt.length;I+=1)yt[I].c();Zt=T(),_e=_("div");for(let I=0;I<we.length;I+=1)we[I].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-info"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(K,"class","section-title"),h(ee,"class","table-compact table-border m-b-lg"),h(ve,"class","section-title"),h(me,"class","table-compact table-border m-b-lg"),h(Ge,"class","section-title"),h(ut,"class","tabs-header compact left"),h(_e,"class","tabs-content"),h(rt,"class","tabs")},m(I,B){w(I,e,B),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Et&&Et.m(e,null),w(I,p,B),w(I,g,B),m(g,v),m(v,b),m(v,y),m(y,$),m(v,C),w(I,M,B),w(I,D,B),w(I,L,B),w(I,O,B),m(O,F);for(let ne=0;ne<E.length;ne+=1)E[ne].m(F,null);m(O,U),m(O,Q);for(let ne=0;ne<te.length;ne+=1)te[ne].m(Q,null);w(I,Y,B),w(I,K,B),w(I,Z,B),w(I,ee,B),w(I,ae,B),w(I,ve,B),w(I,le,B),w(I,me,B),m(me,re),m(me,de),m(me,fe),m(fe,ie),m(ie,x),m(ie,ye),m(ie,He),m(ie,Le),m(ie,Pe),m(Pe,ue),q(ce,Pe,null),m(Pe,ke),m(Pe,Be),m(Pe,Ke),m(Pe,Ue),m(Pe,Je),m(Pe,xe),m(Pe,J),m(Pe,se),m(Pe,pe),w(I,Ve,B),w(I,Ge,B),w(I,bt,B),w(I,rt,B),m(rt,ut);for(let ne=0;ne<yt.length;ne+=1)yt[ne].m(ut,null);m(rt,Zt),m(rt,_e);for(let ne=0;ne<we.length;ne+=1)we[ne].m(_e,null);nt=!0},p(I,[B]){(!nt||B&1)&&a!==(a=I[0].name+"")&&be(u,a),I[1]?Et||(Et=wd(),Et.c(),Et.m(e,null)):Et&&(Et.d(1),Et=null),(!nt||B&1)&&S!==(S=I[0].name+"")&&be($,S),B&24&&(he=I[4],E=ft(E,B,$e,1,I,he,j,F,ln,Sd,null,kd)),B&24&&(Xe=I[4],Te(),te=ft(te,B,Jt,1,I,Xe,H,Q,Ft,$d,null,yd),De()),B&36&&(zt=I[5],yt=ft(yt,B,Xn,1,I,zt,Pt,ut,ln,Cd,null,vd)),B&36&&(ct=I[5],Te(),we=ft(we,B,N,1,I,ct,Ze,_e,Ft,Md,null,bd),De())},i(I){if(!nt){for(let B=0;B<Xe.length;B+=1)A(te[B]);A(ce.$$.fragment,I);for(let B=0;B<ct.length;B+=1)A(we[B]);nt=!0}},o(I){for(let B=0;B<te.length;B+=1)P(te[B]);P(ce.$$.fragment,I);for(let B=0;B<we.length;B+=1)P(we[B]);nt=!1},d(I){I&&k(e),Et&&Et.d(),I&&k(p),I&&k(g),I&&k(M),I&&k(D),I&&k(L),I&&k(O);for(let B=0;B<E.length;B+=1)E[B].d();for(let B=0;B<te.length;B+=1)te[B].d();I&&k(Y),I&&k(K),I&&k(Z),I&&k(ee),I&&k(ae),I&&k(ve),I&&k(le),I&&k(me),V(ce),I&&k(Ve),I&&k(Ge),I&&k(bt),I&&k(rt);for(let B=0;B<yt.length;B+=1)yt[B].d();for(let B=0;B<we.length;B+=1)we[B].d()}}}function w3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.viewRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.getOne("${s==null?void 0:s.name}", "RECORD_ID")
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class S3 extends Ee{constructor(e){super(),Ae(this,e,w3,k3,Oe,{collection:0})}}function Td(n,e,t){const i=n.slice();return i[8]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Od(n,e,t){const i=n.slice();return i[13]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[16]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[16]=e[t],i}function Pd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ld(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&be(s,i),f&20&&X(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Fd(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&X(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function $3(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function C3(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function M3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function T3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function D3(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
Set to `),s=_("code"),s.textContent="null",l=R(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function O3(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function A3(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function E3(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function P3(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function L3(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Id(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=W.getFieldValueType(e[13])+"",p,g,v,b;function y(L,O){return L[13].required?C3:$3}let S=y(e),$=S(e);function C(L,O){if(L[13].type==="text")return L3;if(L[13].type==="number")return P3;if(L[13].type==="json")return E3;if(L[13].type==="email")return A3;if(L[13].type==="url")return O3;if(L[13].type==="file")return D3;if(L[13].type==="relation")return T3;if(L[13].type==="user")return M3}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(L,O){w(L,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(L,O){e=L,S!==(S=y(e))&&($.d(1),$=S(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&be(a,r),O&1&&d!==(d=W.getFieldValueType(e[13])+"")&&be(p,d),M===(M=C(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(L){L&&k(t),$.d(),D&&D.d()}}}function Nd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&be(s,i),f&10&&X(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Rd(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&X(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function F3(n){var Zt;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y=n[0].name+"",S,$,C,M,D,L,O,F,E,j,U,Q=[],te=new Map,H,Y,K=[],Z=new Map,ee,ae,ve,le,me,re,de,fe=[],ie=new Map,x,ye,He,Le,Pe,ue=[],ce=new Map,ke,Be,Ke=[],Ue=new Map,Je,xe=n[5]&&Pd(),J=n[4];const se=_e=>_e[16].lang;for(let _e=0;_e<J.length;_e+=1){let we=Ed(n,J,_e),Ze=se(we);te.set(Ze,Q[_e]=Ld(Ze,we))}let pe=n[4];const Ve=_e=>_e[16].lang;for(let _e=0;_e<pe.length;_e+=1){let we=Ad(n,pe,_e),Ze=Ve(we);Z.set(Ze,K[_e]=Fd(Ze,we))}let Ge=(Zt=n[0])==null?void 0:Zt.schema;const bt=_e=>_e[13].name;for(let _e=0;_e<Ge.length;_e+=1){let we=Od(n,Ge,_e),Ze=bt(we);ie.set(Ze,fe[_e]=Id(Ze,we))}let rt=n[3];const ut=_e=>_e[8].code;for(let _e=0;_e<rt.length;_e+=1){let we=Dd(n,rt,_e),Ze=ut(we);ce.set(Ze,ue[_e]=Nd(Ze,we))}let yt=n[3];const Pt=_e=>_e[8].code;for(let _e=0;_e<yt.length;_e+=1){let we=Td(n,yt,_e),Ze=Pt(we);Ue.set(Ze,Ke[_e]=Rd(Ze,we))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records"),c=T(),xe&&xe.c(),d=T(),p=_("div"),g=_("p"),v=R("Create a new "),b=_("strong"),S=R(y),$=R(" record."),C=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,D=T(),L=_("p"),L.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),F=_("div"),F.textContent="Client SDKs example",E=T(),j=_("div"),U=_("div");for(let _e=0;_e<Q.length;_e+=1)Q[_e].c();H=T(),Y=_("div");for(let _e=0;_e<K.length;_e+=1)K[_e].c();ee=T(),ae=_("div"),ae.textContent="Body Parameters",ve=T(),le=_("table"),me=_("thead"),me.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,re=T(),de=_("tbody");for(let _e=0;_e<fe.length;_e+=1)fe[_e].c();x=T(),ye=_("div"),ye.textContent="Responses",He=T(),Le=_("div"),Pe=_("div");for(let _e=0;_e<ue.length;_e+=1)ue[_e].c();ke=T(),Be=_("div");for(let _e=0;_e<Ke.length;_e+=1)Ke[_e].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-success"),h(p,"class","content m-b-base"),h(F,"class","section-title"),h(U,"class","tabs-header compact left"),h(Y,"class","tabs-content"),h(j,"class","tabs m-b-lg"),h(ae,"class","section-title"),h(le,"class","table-compact table-border m-b-lg"),h(ye,"class","section-title"),h(Pe,"class","tabs-header compact left"),h(Be,"class","tabs-content"),h(Le,"class","tabs")},m(_e,we){w(_e,e,we),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(e,c),xe&&xe.m(e,null),w(_e,d,we),w(_e,p,we),m(p,g),m(g,v),m(g,b),m(b,S),m(g,$),m(p,C),m(p,M),m(p,D),m(p,L),w(_e,O,we),w(_e,F,we),w(_e,E,we),w(_e,j,we),m(j,U);for(let Ze=0;Ze<Q.length;Ze+=1)Q[Ze].m(U,null);m(j,H),m(j,Y);for(let Ze=0;Ze<K.length;Ze+=1)K[Ze].m(Y,null);w(_e,ee,we),w(_e,ae,we),w(_e,ve,we),w(_e,le,we),m(le,me),m(le,re),m(le,de);for(let Ze=0;Ze<fe.length;Ze+=1)fe[Ze].m(de,null);w(_e,x,we),w(_e,ye,we),w(_e,He,we),w(_e,Le,we),m(Le,Pe);for(let Ze=0;Ze<ue.length;Ze+=1)ue[Ze].m(Pe,null);m(Le,ke),m(Le,Be);for(let Ze=0;Ze<Ke.length;Ze+=1)Ke[Ze].m(Be,null);Je=!0},p(_e,[we]){var Ze;(!Je||we&1)&&a!==(a=_e[0].name+"")&&be(u,a),_e[5]?xe||(xe=Pd(),xe.c(),xe.m(e,null)):xe&&(xe.d(1),xe=null),(!Je||we&1)&&y!==(y=_e[0].name+"")&&be(S,y),we&20&&(J=_e[4],Q=ft(Q,we,se,1,_e,J,te,U,ln,Ld,null,Ed)),we&20&&(pe=_e[4],Te(),K=ft(K,we,Ve,1,_e,pe,Z,Y,Ft,Fd,null,Ad),De()),we&1&&(Ge=(Ze=_e[0])==null?void 0:Ze.schema,fe=ft(fe,we,bt,1,_e,Ge,ie,de,ln,Id,null,Od)),we&10&&(rt=_e[3],ue=ft(ue,we,ut,1,_e,rt,ce,Pe,ln,Nd,null,Dd)),we&10&&(yt=_e[3],Te(),Ke=ft(Ke,we,Pt,1,_e,yt,Ue,Be,Ft,Rd,null,Td),De())},i(_e){if(!Je){for(let we=0;we<pe.length;we+=1)A(K[we]);for(let we=0;we<yt.length;we+=1)A(Ke[we]);Je=!0}},o(_e){for(let we=0;we<K.length;we+=1)P(K[we]);for(let we=0;we<Ke.length;we+=1)P(Ke[we]);Je=!1},d(_e){_e&&k(e),xe&&xe.d(),_e&&k(d),_e&&k(p),_e&&k(O),_e&&k(F),_e&&k(E),_e&&k(j);for(let we=0;we<Q.length;we+=1)Q[we].d();for(let we=0;we<K.length;we+=1)K[we].d();_e&&k(ee),_e&&k(ae),_e&&k(ve),_e&&k(le);for(let we=0;we<fe.length;we+=1)fe[we].d();_e&&k(x),_e&&k(ye),_e&&k(He),_e&&k(Le);for(let we=0;we<ue.length;we+=1)ue[we].d();for(let we=0;we<Ke.length;we+=1)Ke[we].d()}}}function I3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.createRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
const data = { ... };
client.Records.create("${s==null?void 0:s.name}", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,o,r,a,i,u,f]}class N3 extends Ee{constructor(e){super(),Ae(this,e,I3,F3,Oe,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[8]=e[t],i}function jd(n,e,t){const i=n.slice();return i[8]=e[t],i}function qd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[16]=e[t],i}function zd(n,e,t){const i=n.slice();return i[16]=e[t],i}function Bd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ud(n,e){let t,i=e[16].lang+"",s,l,o,r;function a(){return e[6](e[16])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[16].lang+"")&&be(s,i),f&20&&X(t,"active",e[2]===e[16].lang)},d(u){u&&k(t),o=!1,r()}}}function Wd(n,e){let t,i,s,l;return i=new en({props:{content:e[16].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[16].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[16].code),i.$set(a),r&20&&X(t,"active",e[2]===e[16].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function R3(n){let e;return{c(){e=_("span"),e.textContent="Optional",h(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function H3(n){let e;return{c(){e=_("span"),e.textContent="Required",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function j3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("User "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function q3(n){var l;let e,t=((l=n[13].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=R("Relation record "),i=R(t),s=R(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[13].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&be(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function V3(n){let e,t,i,s,l;return{c(){e=R("FormData object."),t=_("br"),i=R(`
Set to `),s=_("code"),s.textContent="null",l=R(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:oe,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function z3(n){let e;return{c(){e=R("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function B3(n){let e;return{c(){e=R("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function U3(n){let e;return{c(){e=R("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function W3(n){let e;return{c(){e=R("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Y3(n){let e;return{c(){e=R("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Yd(n,e){let t,i,s,l,o,r=e[13].name+"",a,u,f,c,d=W.getFieldValueType(e[13])+"",p,g,v,b;function y(L,O){return L[13].required?H3:R3}let S=y(e),$=S(e);function C(L,O){if(L[13].type==="text")return Y3;if(L[13].type==="number")return W3;if(L[13].type==="json")return U3;if(L[13].type==="email")return B3;if(L[13].type==="url")return z3;if(L[13].type==="file")return V3;if(L[13].type==="relation")return q3;if(L[13].type==="user")return j3}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),$.c(),l=T(),o=_("span"),a=R(r),u=T(),f=_("td"),c=_("span"),p=R(d),g=T(),v=_("td"),D&&D.c(),b=T(),h(s,"class","inline-flex"),h(c,"class","label"),this.first=t},m(L,O){w(L,t,O),m(t,i),m(i,s),$.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,p),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(L,O){e=L,S!==(S=y(e))&&($.d(1),$=S(e),$&&($.c(),$.m(s,l))),O&1&&r!==(r=e[13].name+"")&&be(a,r),O&1&&d!==(d=W.getFieldValueType(e[13])+"")&&be(p,d),M===(M=C(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(L){L&&k(t),$.d(),D&&D.d()}}}function Kd(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&8&&i!==(i=e[8].code+"")&&be(s,i),f&10&&X(t,"active",e[1]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function Zd(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&8&&(a.content=e[8].body),i.$set(a),r&10&&X(t,"active",e[1]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function K3(n){var Et;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,S=n[0].name+"",$,C,M,D,L,O,F,E,j,U,Q,te=[],H=new Map,Y,K,Z=[],ee=new Map,ae,ve,le,me,re,de,fe,ie,x,ye,He,Le=[],Pe=new Map,ue,ce,ke,Be,Ke,Ue=[],Je=new Map,xe,J,se=[],pe=new Map,Ve,Ge=n[5]&&Bd(),bt=n[4];const rt=he=>he[16].lang;for(let he=0;he<bt.length;he+=1){let $e=zd(n,bt,he),Xe=rt($e);H.set(Xe,te[he]=Ud(Xe,$e))}let ut=n[4];const yt=he=>he[16].lang;for(let he=0;he<ut.length;he+=1){let $e=Vd(n,ut,he),Xe=yt($e);ee.set(Xe,Z[he]=Wd(Xe,$e))}let Pt=(Et=n[0])==null?void 0:Et.schema;const Zt=he=>he[13].name;for(let he=0;he<Pt.length;he+=1){let $e=qd(n,Pt,he),Xe=Zt($e);Pe.set(Xe,Le[he]=Yd(Xe,$e))}let _e=n[3];const we=he=>he[8].code;for(let he=0;he<_e.length;he+=1){let $e=jd(n,_e,he),Xe=we($e);Je.set(Xe,Ue[he]=Kd(Xe,$e))}let Ze=n[3];const nt=he=>he[8].code;for(let he=0;he<Ze.length;he+=1){let $e=Hd(n,Ze,he),Xe=nt($e);pe.set(Xe,se[he]=Zd(Xe,$e))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Ge&&Ge.c(),p=T(),g=_("div"),v=_("p"),b=R("Update a single "),y=_("strong"),$=R(S),C=R(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,L=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",F=T(),E=_("div"),E.textContent="Client SDKs example",j=T(),U=_("div"),Q=_("div");for(let he=0;he<te.length;he+=1)te[he].c();Y=T(),K=_("div");for(let he=0;he<Z.length;he+=1)Z[he].c();ae=T(),ve=_("div"),ve.textContent="Path parameters",le=T(),me=_("table"),me.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,re=T(),de=_("div"),de.textContent="Body Parameters",fe=T(),ie=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,ye=T(),He=_("tbody");for(let he=0;he<Le.length;he+=1)Le[he].c();ue=T(),ce=_("div"),ce.textContent="Responses",ke=T(),Be=_("div"),Ke=_("div");for(let he=0;he<Ue.length;he+=1)Ue[he].c();xe=T(),J=_("div");for(let he=0;he<se.length;he+=1)se[he].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-warning"),h(g,"class","content m-b-base"),h(E,"class","section-title"),h(Q,"class","tabs-header compact left"),h(K,"class","tabs-content"),h(U,"class","tabs m-b-lg"),h(ve,"class","section-title"),h(me,"class","table-compact table-border m-b-lg"),h(de,"class","section-title"),h(ie,"class","table-compact table-border m-b-lg"),h(ce,"class","section-title"),h(Ke,"class","tabs-header compact left"),h(J,"class","tabs-content"),h(Be,"class","tabs")},m(he,$e){w(he,e,$e),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Ge&&Ge.m(e,null),w(he,p,$e),w(he,g,$e),m(g,v),m(v,b),m(v,y),m(y,$),m(v,C),m(g,M),m(g,D),m(g,L),m(g,O),w(he,F,$e),w(he,E,$e),w(he,j,$e),w(he,U,$e),m(U,Q);for(let Xe=0;Xe<te.length;Xe+=1)te[Xe].m(Q,null);m(U,Y),m(U,K);for(let Xe=0;Xe<Z.length;Xe+=1)Z[Xe].m(K,null);w(he,ae,$e),w(he,ve,$e),w(he,le,$e),w(he,me,$e),w(he,re,$e),w(he,de,$e),w(he,fe,$e),w(he,ie,$e),m(ie,x),m(ie,ye),m(ie,He);for(let Xe=0;Xe<Le.length;Xe+=1)Le[Xe].m(He,null);w(he,ue,$e),w(he,ce,$e),w(he,ke,$e),w(he,Be,$e),m(Be,Ke);for(let Xe=0;Xe<Ue.length;Xe+=1)Ue[Xe].m(Ke,null);m(Be,xe),m(Be,J);for(let Xe=0;Xe<se.length;Xe+=1)se[Xe].m(J,null);Ve=!0},p(he,[$e]){var Xe;(!Ve||$e&1)&&a!==(a=he[0].name+"")&&be(u,a),he[5]?Ge||(Ge=Bd(),Ge.c(),Ge.m(e,null)):Ge&&(Ge.d(1),Ge=null),(!Ve||$e&1)&&S!==(S=he[0].name+"")&&be($,S),$e&20&&(bt=he[4],te=ft(te,$e,rt,1,he,bt,H,Q,ln,Ud,null,zd)),$e&20&&(ut=he[4],Te(),Z=ft(Z,$e,yt,1,he,ut,ee,K,Ft,Wd,null,Vd),De()),$e&1&&(Pt=(Xe=he[0])==null?void 0:Xe.schema,Le=ft(Le,$e,Zt,1,he,Pt,Pe,He,ln,Yd,null,qd)),$e&10&&(_e=he[3],Ue=ft(Ue,$e,we,1,he,_e,Je,Ke,ln,Kd,null,jd)),$e&10&&(Ze=he[3],Te(),se=ft(se,$e,nt,1,he,Ze,pe,J,Ft,Zd,null,Hd),De())},i(he){if(!Ve){for(let $e=0;$e<ut.length;$e+=1)A(Z[$e]);for(let $e=0;$e<Ze.length;$e+=1)A(se[$e]);Ve=!0}},o(he){for(let $e=0;$e<Z.length;$e+=1)P(Z[$e]);for(let $e=0;$e<se.length;$e+=1)P(se[$e]);Ve=!1},d(he){he&&k(e),Ge&&Ge.d(),he&&k(p),he&&k(g),he&&k(F),he&&k(E),he&&k(j),he&&k(U);for(let $e=0;$e<te.length;$e+=1)te[$e].d();for(let $e=0;$e<Z.length;$e+=1)Z[$e].d();he&&k(ae),he&&k(ve),he&&k(le),he&&k(me),he&&k(re),he&&k(de),he&&k(fe),he&&k(ie);for(let $e=0;$e<Le.length;$e+=1)Le[$e].d();he&&k(ue),he&&k(ce),he&&k(ke),he&&k(Be);for(let $e=0;$e<Ue.length;$e+=1)Ue[$e].d();for(let $e=0;$e<se.length;$e+=1)se[$e].d()}}}function Z3(n,e,t){let i,{collection:s=new On}=e,l=200,o="JavaScript",r=[],a=[];const u=c=>t(2,o=c.lang),f=c=>t(1,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{var c,d;n.$$.dirty&1&&t(5,i=(s==null?void 0:s.updateRule)===null),n.$$.dirty&1&&t(3,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(s),null,2)},{code:400,body:`
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(d=(c=s==null?void 0:s.schema)==null?void 0:c[0])==null?void 0:d.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}]),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
const data = { ... };
client.Records.update("${s==null?void 0:s.name}", "RECORD_ID", data)
.then(function (record) {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,l,o,r,a,i,u,f]}class J3 extends Ee{constructor(e){super(),Ae(this,e,Z3,K3,Oe,{collection:0})}}function Jd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[8]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[13]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[13]=e[t],i}function xd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",h(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eh(n,e){let t,i=e[13].lang+"",s,l,o,r;function a(){return e[6](e[13])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&16&&i!==(i=e[13].lang+"")&&be(s,i),f&24&&X(t,"active",e[3]===e[13].lang)},d(u){u&&k(t),o=!1,r()}}}function th(n,e){let t,i,s,l;return i=new en({props:{content:e[13].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[3]===e[13].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&16&&(a.content=e[13].code),i.$set(a),r&24&&X(t,"active",e[3]===e[13].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function nh(n,e){let t,i=e[8].code+"",s,l,o,r;function a(){return e[7](e[8])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&36&&X(t,"active",e[2]===e[8].code)},d(u){u&&k(t),o=!1,r()}}}function ih(n,e){let t,i,s,l;return i=new en({props:{content:e[8].body}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[2]===e[8].code),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&36&&X(t,"active",e[2]===e[8].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function G3(n){let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,p,g,v,b,y,S=n[0].name+"",$,C,M,D,L,O,F,E=[],j=new Map,U,Q,te=[],H=new Map,Y,K,Z,ee,ae,ve,le,me,re,de=[],fe=new Map,ie,x,ye=[],He=new Map,Le,Pe=n[1]&&xd(),ue=n[4];const ce=J=>J[13].lang;for(let J=0;J<ue.length;J+=1){let se=Qd(n,ue,J),pe=ce(se);j.set(pe,E[J]=eh(pe,se))}let ke=n[4];const Be=J=>J[13].lang;for(let J=0;J<ke.length;J+=1){let se=Xd(n,ke,J),pe=Be(se);H.set(pe,te[J]=th(pe,se))}let Ke=n[5];const Ue=J=>J[8].code;for(let J=0;J<Ke.length;J+=1){let se=Gd(n,Ke,J),pe=Ue(se);fe.set(pe,de[J]=nh(pe,se))}let Je=n[5];const xe=J=>J[8].code;for(let J=0;J<Je.length;J+=1){let se=Jd(n,Je,J),pe=xe(se);He.set(pe,ye[J]=ih(pe,se))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=R("/api/collections/"),r=_("strong"),u=R(a),f=R("/records/"),c=_("strong"),c.textContent=":id",d=T(),Pe&&Pe.c(),p=T(),g=_("div"),v=_("p"),b=R("Delete a single "),y=_("strong"),$=R(S),C=R(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",L=T(),O=_("div"),F=_("div");for(let J=0;J<E.length;J+=1)E[J].c();U=T(),Q=_("div");for(let J=0;J<te.length;J+=1)te[J].c();Y=T(),K=_("div"),K.textContent="Path parameters",Z=T(),ee=_("table"),ee.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,ae=T(),ve=_("div"),ve.textContent="Responses",le=T(),me=_("div"),re=_("div");for(let J=0;J<de.length;J+=1)de[J].c();ie=T(),x=_("div");for(let J=0;J<ye.length;J+=1)ye[J].c();h(t,"class","label label-primary"),h(s,"class","content"),h(e,"class","alert alert-danger"),h(g,"class","content m-b-base"),h(D,"class","section-title"),h(F,"class","tabs-header compact left"),h(Q,"class","tabs-content"),h(O,"class","tabs m-b-lg"),h(K,"class","section-title"),h(ee,"class","table-compact table-border m-b-lg"),h(ve,"class","section-title"),h(re,"class","tabs-header compact left"),h(x,"class","tabs-content"),h(me,"class","tabs")},m(J,se){w(J,e,se),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(e,d),Pe&&Pe.m(e,null),w(J,p,se),w(J,g,se),m(g,v),m(v,b),m(v,y),m(y,$),m(v,C),w(J,M,se),w(J,D,se),w(J,L,se),w(J,O,se),m(O,F);for(let pe=0;pe<E.length;pe+=1)E[pe].m(F,null);m(O,U),m(O,Q);for(let pe=0;pe<te.length;pe+=1)te[pe].m(Q,null);w(J,Y,se),w(J,K,se),w(J,Z,se),w(J,ee,se),w(J,ae,se),w(J,ve,se),w(J,le,se),w(J,me,se),m(me,re);for(let pe=0;pe<de.length;pe+=1)de[pe].m(re,null);m(me,ie),m(me,x);for(let pe=0;pe<ye.length;pe+=1)ye[pe].m(x,null);Le=!0},p(J,[se]){(!Le||se&1)&&a!==(a=J[0].name+"")&&be(u,a),J[1]?Pe||(Pe=xd(),Pe.c(),Pe.m(e,null)):Pe&&(Pe.d(1),Pe=null),(!Le||se&1)&&S!==(S=J[0].name+"")&&be($,S),se&24&&(ue=J[4],E=ft(E,se,ce,1,J,ue,j,F,ln,eh,null,Qd)),se&24&&(ke=J[4],Te(),te=ft(te,se,Be,1,J,ke,H,Q,Ft,th,null,Xd),De()),se&36&&(Ke=J[5],de=ft(de,se,Ue,1,J,Ke,fe,re,ln,nh,null,Gd)),se&36&&(Je=J[5],Te(),ye=ft(ye,se,xe,1,J,Je,He,x,Ft,ih,null,Jd),De())},i(J){if(!Le){for(let se=0;se<ke.length;se+=1)A(te[se]);for(let se=0;se<Je.length;se+=1)A(ye[se]);Le=!0}},o(J){for(let se=0;se<te.length;se+=1)P(te[se]);for(let se=0;se<ye.length;se+=1)P(ye[se]);Le=!1},d(J){J&&k(e),Pe&&Pe.d(),J&&k(p),J&&k(g),J&&k(M),J&&k(D),J&&k(L),J&&k(O);for(let se=0;se<E.length;se+=1)E[se].d();for(let se=0;se<te.length;se+=1)te[se].d();J&&k(Y),J&&k(K),J&&k(Z),J&&k(ee),J&&k(ae),J&&k(ve),J&&k(le),J&&k(me);for(let se=0;se<de.length;se+=1)de[se].d();for(let se=0;se<ye.length;se+=1)ye[se].d()}}}function X3(n,e,t){let i,{collection:s=new On}=e,l=204,o="JavaScript",r=[],a=[];const u=c=>t(3,o=c.lang),f=c=>t(2,l=c.code);return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(s==null?void 0:s.deleteRule)===null),n.$$.dirty&3&&s!=null&&s.id&&(r.push({code:204,body:`
null
`}),r.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`})),n.$$.dirty&1&&t(4,a=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
client.Records.delete("${s==null?void 0:s.name}", "RECORD_ID")
.then(function () {
// success...
}).catch(function (error) {
// error...
});
`}])},[s,i,l,o,a,r,u,f]}class Q3 extends Ee{constructor(e){super(),Ae(this,e,X3,G3,Oe,{collection:0})}}function sh(n,e,t){const i=n.slice();return i[4]=e[t],i}function lh(n,e,t){const i=n.slice();return i[4]=e[t],i}function oh(n,e){let t,i=e[4].lang+"",s,l,o,r;function a(){return e[3](e[4])}return{key:n,first:null,c(){t=_("button"),s=R(i),l=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[4].lang),this.first=t},m(u,f){w(u,t,f),m(t,s),m(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[4].lang+"")&&be(s,i),f&6&&X(t,"active",e[1]===e[4].lang)},d(u){u&&k(t),o=!1,r()}}}function rh(n,e){let t,i,s,l;return i=new en({props:{content:e[4].code}}),{key:n,first:null,c(){t=_("div"),z(i.$$.fragment),s=T(),h(t,"class","tab-item"),X(t,"active",e[1]===e[4].lang),this.first=t},m(o,r){w(o,t,r),q(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[4].code),i.$set(a),r&6&&X(t,"active",e[1]===e[4].lang)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),V(i)}}}function x3(n){let e,t,i,s,l,o,r,a,u=[],f=new Map,c,d,p=[],g=new Map,v,b,y,S,$,C=n[2];const M=O=>O[4].lang;for(let O=0;O<C.length;O+=1){let F=lh(n,C,O),E=M(F);f.set(E,u[O]=oh(E,F))}let D=n[2];const L=O=>O[4].lang;for(let O=0;O<D.length;O+=1){let F=sh(n,D,O),E=L(F);g.set(E,p[O]=rh(E,F))}return S=new en({props:{content:JSON.stringify({action:"create",record:W.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
<div class="content"><p>/api/realtime</p></div>`,t=T(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are send for <strong>create</strong>, <strong>update</strong>
and <strong>delete</strong> record operations (see &quot;Event data format&quot; section below).</p>
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
<p>When you subscribe to a <strong>single record</strong>, the collection&#39;s
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p>
<p>When you subscribe to an <strong>entire collection</strong>, the collection&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p></div></div>`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),r=_("div"),a=_("div");for(let O=0;O<u.length;O+=1)u[O].c();c=T(),d=_("div");for(let O=0;O<p.length;O+=1)p[O].c();v=T(),b=_("div"),b.textContent="Event data format",y=T(),z(S.$$.fragment),h(e,"class","alert"),h(i,"class","content m-b-base"),h(l,"class","section-title"),h(a,"class","tabs-header compact left"),h(d,"class","tabs-content"),h(r,"class","tabs m-b-base"),h(b,"class","section-title")},m(O,F){w(O,e,F),w(O,t,F),w(O,i,F),w(O,s,F),w(O,l,F),w(O,o,F),w(O,r,F),m(r,a);for(let E=0;E<u.length;E+=1)u[E].m(a,null);m(r,c),m(r,d);for(let E=0;E<p.length;E+=1)p[E].m(d,null);w(O,v,F),w(O,b,F),w(O,y,F),q(S,O,F),$=!0},p(O,[F]){F&6&&(C=O[2],u=ft(u,F,M,1,O,C,f,a,ln,oh,null,lh)),F&6&&(D=O[2],Te(),p=ft(p,F,L,1,O,D,g,d,Ft,rh,null,sh),De());const E={};F&1&&(E.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(O[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),S.$set(E)},i(O){if(!$){for(let F=0;F<D.length;F+=1)A(p[F]);A(S.$$.fragment,O),$=!0}},o(O){for(let F=0;F<p.length;F+=1)P(p[F]);P(S.$$.fragment,O),$=!1},d(O){O&&k(e),O&&k(t),O&&k(i),O&&k(s),O&&k(l),O&&k(o),O&&k(r);for(let F=0;F<u.length;F+=1)u[F].d();for(let F=0;F<p.length;F+=1)p[F].d();O&&k(v),O&&k(b),O&&k(y),V(S,O)}}}function e4(n,e,t){let{collection:i=new On}=e,s="JavaScript",l=[];const o=r=>t(1,s=r.lang);return n.$$set=r=>{"collection"in r&&t(0,i=r.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,l=[{lang:"JavaScript",code:`
import PocketBase from 'pocketbase';
const client = new PocketBase("${Se.baseUrl}");
// (Optionally) authenticate
client.Users.authViaEmail("test@example.com", "123456");
// Subscribe to changes in any record from the collection
client.Realtime.subscribe("${i==null?void 0:i.name}", function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.Realtime.subscribe("${i==null?void 0:i.name}/RECORD_ID", function (e) {
console.log(e.record);
});
// Unsubscribe
client.Realtime.unsubscribe() // remove all subscriptions
client.Realtime.unsubscribe("${i==null?void 0:i.name}") // remove the collection subscription
client.Realtime.unsubscribe("${i==null?void 0:i.name}/RECORD_ID") // remove the record subscription
`}])},[i,s,l,o]}class t4 extends Ee{constructor(e){super(),Ae(this,e,e4,x3,Oe,{collection:0})}}function ah(n,e,t){const i=n.slice();return i[14]=e[t],i}function uh(n,e,t){const i=n.slice();return i[14]=e[t],i}function fh(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&z(t.$$.fragment),i=T(),h(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&q(t,e,null),m(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Te();const f=t;P(f.$$.fragment,1,0,()=>{V(f,1)}),De()}l?(t=new l(o(r)),z(t.$$.fragment),A(t.$$.fragment,1),q(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&V(t)}}}function ch(n,e){let t,i,s,l=e[4]===e[14].id&&fh(e);return{key:n,first:null,c(){t=ot(),l&&l.c(),i=ot(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&A(l,1)):(l=fh(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function n4(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=ah(n,l,r),u=o(a);i.set(u,t[r]=ch(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Te(),t=ft(t,a,o,1,r,l,i,e,Ft,ch,null,ah),De())},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)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function dh(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=R(s),o=T(),h(i,"class","txt"),h(t,"tabindex","0"),h(t,"class","tab-item"),X(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),m(t,i),m(i,l),m(t,o),r||(a=[G(t,"click",u),G(t,"keydown",Bp(f))],r=!0)},p(c,d){e=c,d&48&&X(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,lt(a)}}}function i4(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let p=uh(n,f,d),g=c(p);u.set(g,a[d]=dh(g,p))}return{c(){e=_("h4"),t=_("strong"),s=R(i),l=R(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();h(r,"class","tabs-header stretched")},m(d,p){w(d,e,p),m(e,t),m(t,s),m(e,l),w(d,o,p),w(d,r,p);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,p){p&8&&i!==(i=d[3].name+"")&&be(s,i),p&114&&(f=d[5],a=ft(a,p,c,1,d,f,u,r,ln,dh,null,uh))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let p=0;p<a.length;p+=1)a[p].d()}}}function s4(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',h(e,"type","button"),h(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function l4(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[s4],header:[i4],default:[n4]},$$scope:{ctx:n}};return e=new yi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),V(e,s)}}}function o4(n,e,t){const i=[{id:"list",label:"List",component:y3},{id:"view",label:"View",component:S3},{id:"create",label:"Create",component:N3},{id:"update",label:"Update",component:J3},{id:"delete",label:"Delete",component:Q3},{id:"realtime",label:"Realtime",component:t4}];let s,l=new On,o=i[0].id;function r(y){return t(3,l=y),u(i[0].id),s==null?void 0:s.show()}function a(){return s==null?void 0:s.hide()}function u(y){t(4,o=y)}function f(y,S){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(S))}const c=()=>a(),d=y=>u(y.id),p=(y,S)=>f(S,y.id);function g(y){ge[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){dt.call(this,n,y)}function b(y){dt.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,p,g,v,b]}class r4 extends Ee{constructor(e){super(),Ae(this,e,o4,l4,Oe,{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 a4(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=ht(l,s[o]);return{c(){e=_("textarea"),ii(e,l),X(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),Ce(e,n[0]),t||(i=[G(e,"input",n[6]),G(e,"keydown",n[2])],t=!0)},p(o,[r]){ii(e,l=hn(s,[r&8&&o[3]])),r&1&&Ce(e,o[0]),X(e,"svelte-1x1pbts",!0)},i:oe,o:oe,d(o){o&&k(e),n[5](null),t=!1,lt(i)}}}function u4(n,e,t){const i=["value","maxHeight"];let s=Wt(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.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Un(()=>(u(),()=>clearTimeout(a)));function c(p){ge[p?"unshift":"push"](()=>{r=p,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=ht(ht({},e),si(p)),t(3,s=Wt(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 f4 extends Ee{constructor(e){super(),Ae(this,e,u4,a4,Oe,{value:0,maxHeight:4})}}function c4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function p(v){n[2](v)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new f4({props:g}),ge.push(()=>Ie(f,"value",p)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3])},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),q(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=W.getFieldTypeIcon(v[1].type)))&&h(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&be(r,o),(!d||b&8&&a!==(a=v[3]))&&h(e,"for",a);const y={};b&8&&(y.id=v[3]),b&2&&(y.required=v[1].required),!c&&b&1&&(c=!0,y.value=v[0],Re(()=>c=!1)),f.$set(y)},i(v){d||(A(f.$$.fragment,v),d=!0)},o(v){P(f.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(u),V(f,v)}}}function d4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[c4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function h4(n,e,t){let{field:i=new _n}=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 p4 extends Ee{constructor(e){super(),Ae(this,e,h4,d4,Oe,{field:1,value:0})}}function m4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g,v,b;return{c(){var y,S;e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("input"),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","number"),h(f,"id",c=n[3]),f.required=d=n[1].required,h(f,"min",p=(y=n[1].options)==null?void 0:y.min),h(f,"max",g=(S=n[1].options)==null?void 0:S.max),h(f,"step","any")},m(y,S){w(y,e,S),m(e,t),m(e,s),m(e,l),m(l,r),w(y,u,S),w(y,f,S),Ce(f,n[0]),v||(b=G(f,"input",n[2]),v=!0)},p(y,S){var $,C;S&2&&i!==(i=W.getFieldTypeIcon(y[1].type))&&h(t,"class",i),S&2&&o!==(o=y[1].name+"")&&be(r,o),S&8&&a!==(a=y[3])&&h(e,"for",a),S&8&&c!==(c=y[3])&&h(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&p!==(p=($=y[1].options)==null?void 0:$.min)&&h(f,"min",p),S&2&&g!==(g=(C=y[1].options)==null?void 0:C.max)&&h(f,"max",g),S&1&&Dt(f.value)!==y[0]&&Ce(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function g4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[m4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function _4(n,e,t){let{field:i=new _n}=e,{value:s=void 0}=e;function l(){s=Dt(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 b4 extends Ee{constructor(e){super(),Ae(this,e,_4,g4,Oe,{field:1,value:0})}}function v4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=T(),s=_("label"),o=R(l),h(e,"type","checkbox"),h(e,"id",t=n[3]),h(s,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,s,c),m(s,o),a||(u=G(e,"change",n[2]),a=!0)},p(f,c){c&8&&t!==(t=f[3])&&h(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&be(o,l),c&8&&r!==(r=f[3])&&h(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function y4(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function k4(n,e,t){let{field:i=new _n}=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 w4 extends Ee{constructor(e){super(),Ae(this,e,k4,y4,Oe,{field:1,value:0})}}function S4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("input"),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","email"),h(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Ce(f,n[0]),p||(g=G(f,"input",n[2]),p=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&h(t,"class",i),b&2&&o!==(o=v[1].name+"")&&be(r,o),b&8&&a!==(a=v[3])&&h(e,"for",a),b&8&&c!==(c=v[3])&&h(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Ce(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),p=!1,g()}}}function $4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[S4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function C4(n,e,t){let{field:i=new _n}=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 M4 extends Ee{constructor(e){super(),Ae(this,e,C4,$4,Oe,{field:1,value:0})}}function T4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("input"),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"type","url"),h(f,"id",c=n[3]),f.required=d=n[1].required},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Ce(f,n[0]),p||(g=G(f,"input",n[2]),p=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&h(t,"class",i),b&2&&o!==(o=v[1].name+"")&&be(r,o),b&8&&a!==(a=v[3])&&h(e,"for",a),b&8&&c!==(c=v[3])&&h(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Ce(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),p=!1,g()}}}function D4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[T4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function O4(n,e,t){let{field:i=new _n}=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 A4 extends Ee{constructor(e){super(),Ae(this,e,O4,D4,Oe,{field:1,value:0})}}function E4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p;function g(b){n[2](b)}let v={id:n[3],options:W.defaultFlatpickrOptions(),value:n[0]};return n[0]!==void 0&&(v.formattedValue=n[0]),c=new qa({props:v}),ge.push(()=>Ie(c,"formattedValue",g)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),a=R(" (UTC)"),f=T(),z(c.$$.fragment),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",u=n[3])},m(b,y){w(b,e,y),m(e,t),m(e,s),m(e,l),m(l,r),m(l,a),w(b,f,y),q(c,b,y),p=!0},p(b,y){(!p||y&2&&i!==(i=W.getFieldTypeIcon(b[1].type)))&&h(t,"class",i),(!p||y&2)&&o!==(o=b[1].name+"")&&be(r,o),(!p||y&8&&u!==(u=b[3]))&&h(e,"for",u);const S={};y&8&&(S.id=b[3]),y&1&&(S.value=b[0]),!d&&y&1&&(d=!0,S.formattedValue=b[0],Re(()=>d=!1)),c.$set(S)},i(b){p||(A(c.$$.fragment,b),p=!0)},o(b){P(c.$$.fragment,b),p=!1},d(b){b&&k(e),b&&k(f),V(c,b)}}}function P4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[E4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function L4(n,e,t){let{field:i=new _n}=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 F4 extends Ee{constructor(e){super(),Ae(this,e,L4,P4,Oe,{field:1,value:0})}}function hh(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=R("Select up to "),s=R(i),l=R(" items."),h(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&be(s,i)},d(o){o&&k(e)}}}function I4(n){var S,$,C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;function v(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(S=n[1].options)==null?void 0:S.values,searchable:(($=n[1].options)==null?void 0:$.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new a_({props:b}),ge.push(()=>Ie(f,"selected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&hh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),d=T(),y&&y.c(),p=ot(),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(M,D){w(M,e,D),m(e,t),m(e,s),m(e,l),m(l,r),w(M,u,D),q(f,M,D),w(M,d,D),y&&y.m(M,D),w(M,p,D),g=!0},p(M,D){var O,F,E;(!g||D&2&&i!==(i=W.getFieldTypeIcon(M[1].type)))&&h(t,"class",i),(!g||D&2)&&o!==(o=M[1].name+"")&&be(r,o),(!g||D&16&&a!==(a=M[4]))&&h(e,"for",a);const L={};D&16&&(L.id=M[4]),D&6&&(L.toggle=!M[1].required||M[2]),D&4&&(L.multiple=M[2]),D&2&&(L.items=(O=M[1].options)==null?void 0:O.values),D&2&&(L.searchable=((F=M[1].options)==null?void 0:F.values)>5),!c&&D&1&&(c=!0,L.selected=M[0],Re(()=>c=!1)),f.$set(L),((E=M[1].options)==null?void 0:E.maxSelect)>1?y?y.p(M,D):(y=hh(M),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i(M){g||(A(f.$$.fragment,M),g=!0)},o(M){P(f.$$.fragment,M),g=!1},d(M){M&&k(e),M&&k(u),V(f,M),M&&k(d),y&&y.d(M),M&&k(p)}}}function N4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[I4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function R4(n,e,t){let i,{field:s=new _n}=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 H4 extends Ee{constructor(e){super(),Ae(this,e,R4,N4,Oe,{field:1,value:0})}}function j4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("textarea"),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[3]),h(f,"id",c=n[3]),f.required=d=n[1].required,h(f,"class","txt-mono")},m(v,b){w(v,e,b),m(e,t),m(e,s),m(e,l),m(l,r),w(v,u,b),w(v,f,b),Ce(f,n[0]),p||(g=G(f,"input",n[2]),p=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&h(t,"class",i),b&2&&o!==(o=v[1].name+"")&&be(r,o),b&8&&a!==(a=v[3])&&h(e,"for",a),b&8&&c!==(c=v[3])&&h(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Ce(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),p=!1,g()}}}function q4(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[j4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function V4(n,e,t){let{field:i=new _n}=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)},n.$$.update=()=>{n.$$.dirty&1&&typeof s<"u"&&typeof s!="string"&&s!==null&&t(0,s=JSON.stringify(s,null,2))},[s,i,l]}class z4 extends Ee{constructor(e){super(),Ae(this,e,V4,q4,Oe,{field:1,value:0})}}function B4(n){let e,t;return{c(){e=_("i"),h(e,"class","ri-file-line"),h(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&h(e,"alt",t)},d(i){i&&k(e)}}}function U4(n){let e,t,i;return{c(){e=_("img"),Jn(e.src,t=n[2])||h(e,"src",t),h(e,"width",n[1]),h(e,"height",n[1]),h(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!Jn(e.src,t=s[2])&&h(e,"src",t),l&2&&h(e,"width",s[1]),l&2&&h(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&h(e,"alt",i)},d(s){s&&k(e)}}}function W4(n){let e;function t(l,o){return l[2]?U4:B4}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function Y4(n,e,t){let i,{file:s}=e,{size:l=50}=e;function o(){t(2,i=""),W.hasImageExtension(s==null?void 0:s.name)&&W.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 K4 extends Ee{constructor(e){super(),Ae(this,e,Y4,W4,Oe,{file:0,size:1})}}function Z4(n){let e,t;return{c(){e=_("img"),Jn(e.src,t=n[2])||h(e,"src",t),h(e,"alt","Preview")},m(i,s){w(i,e,s)},p(i,s){s&4&&!Jn(e.src,t=i[2])&&h(e,"src",t)},d(i){i&&k(e)}}}function J4(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Vt(n[0])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function G4(n){let e,t,i=n[2].substring(n[2].lastIndexOf("/")+1)+"",s,l,o,r,a,u,f;return{c(){e=_("a"),t=R("/../"),s=R(i),l=T(),o=_("div"),r=T(),a=_("button"),a.textContent="Close",h(e,"href",n[2]),h(e,"title","Download"),h(e,"class","link-hint txt-ellipsis"),h(o,"class","flex-fill"),h(a,"type","button"),h(a,"class","btn btn-secondary")},m(c,d){w(c,e,d),m(e,t),m(e,s),w(c,l,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=G(a,"click",n[0]),u=!0)},p(c,d){d&4&&i!==(i=c[2].substring(c[2].lastIndexOf("/")+1)+"")&&be(s,i),d&4&&h(e,"href",c[2])},d(c){c&&k(e),c&&k(l),c&&k(o),c&&k(r),c&&k(a),u=!1,f()}}}function X4(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[G4],header:[J4],default:[Z4]},$$scope:{ctx:n}};return e=new yi({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&132&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[4](null),V(e,s)}}}function Q4(n,e,t){let i,s="";function l(f){f!==""&&W.checkImageUrl(f).then(()=>{t(2,s=f),i==null||i.show()}).catch(()=>{console.warn("Invalid image preview url: ",f),o()})}function o(){return i==null?void 0:i.hide()}function r(f){ge[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){dt.call(this,n,f)}function u(f){dt.call(this,n,f)}return[o,i,s,l,r,a,u]}class x4 extends Ee{constructor(e){super(),Ae(this,e,Q4,X4,Oe,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function eC(n){let e;return{c(){e=_("i"),h(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function tC(n){let e,t,i,s,l;return{c(){e=_("img"),Jn(e.src,t=n[4])||h(e,"src",t),h(e,"alt",n[0]),h(e,"title",i="Preview "+n[0]),X(e,"link-fade",n[2])},m(o,r){w(o,e,r),s||(l=[G(e,"click",n[7]),G(e,"error",n[5])],s=!0)},p(o,r){r&16&&!Jn(e.src,t=o[4])&&h(e,"src",t),r&1&&h(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&h(e,"title",i),r&4&&X(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,lt(l)}}}function nC(n){let e,t,i;function s(a,u){return a[2]?tC:eC}let l=s(n),o=l(n),r={};return t=new x4({props:r}),n[8](t),{c(){o.c(),e=T(),z(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),q(t,a,u),i=!0},p(a,[u]){l===(l=s(a))&&o?o.p(a,u):(o.d(1),o=l(a),o&&(o.c(),o.m(e.parentNode,e)));const f={};t.$set(f)},i(a){i||(A(t.$$.fragment,a),i=!0)},o(a){P(t.$$.fragment,a),i=!1},d(a){o.d(a),a&&k(e),n[8](null),V(t,a)}}}function iC(n,e,t){let i,{record:s}=e,{filename:l}=e,o,r="",a="";function u(){t(4,r="")}const f=d=>{d.stopPropagation(),o==null||o.show(a)};function c(d){ge[d?"unshift":"push"](()=>{o=d,t(3,o)})}return n.$$set=d=>{"record"in d&&t(6,s=d.record),"filename"in d&&t(0,l=d.filename)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=W.hasImageExtension(l)),n.$$.dirty&69&&i&&t(1,a=Se.Records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class d_ extends Ee{constructor(e){super(),Ae(this,e,iC,nC,Oe,{record:6,filename:0})}}function ph(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function mh(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function sC(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line"></i>',h(e,"type","button"),h(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[tt(Mt.call(null,e,"Remove file")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,lt(i)}}}function lC(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',h(e,"type","button"),h(e,"class","btn btn-sm btn-danger btn-secondary")},m(l,o){w(l,e,o),t||(i=G(e,"click",s),t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,i()}}}function gh(n,e){let t,i,s,l,o,r,a=e[25]+"",u,f,c,d,p,g;s=new d_({props:{record:e[2],filename:e[25]}});function v(S,$){return $&18&&(p=null),p==null&&(p=!!S[1].includes(S[24])),p?lC:sC}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),z(s.$$.fragment),l=T(),o=_("a"),r=R("/.../"),u=R(a),d=T(),y.c(),h(i,"class","thumb"),X(i,"fade",e[1].includes(e[24])),h(o,"href",f=Se.Records.getFileUrl(e[2],e[25])),h(o,"class","filename"),h(o,"title",c="Download "+e[25]),h(o,"target","_blank"),h(o,"rel","noopener"),h(o,"download",""),X(o,"txt-strikethrough",e[1].includes(e[24])),h(t,"class","list-item"),this.first=t},m(S,$){w(S,t,$),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(o,u),m(t,d),y.m(t,null),g=!0},p(S,$){e=S;const C={};$&4&&(C.record=e[2]),$&16&&(C.filename=e[25]),s.$set(C),$&18&&X(i,"fade",e[1].includes(e[24])),(!g||$&16)&&a!==(a=e[25]+"")&&be(u,a),(!g||$&20&&f!==(f=Se.Records.getFileUrl(e[2],e[25])))&&h(o,"href",f),(!g||$&16&&c!==(c="Download "+e[25]))&&h(o,"title",c),$&18&&X(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,$))&&y?y.p(e,$):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i(S){g||(A(s.$$.fragment,S),g=!0)},o(S){P(s.$$.fragment,S),g=!1},d(S){S&&k(t),V(s),y.d()}}}function _h(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,p,g,v,b;i=new K4({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),z(i.$$.fragment),s=T(),l=_("div"),o=_("small"),o.textContent="New",r=T(),a=_("span"),f=R(u),d=T(),p=_("button"),p.innerHTML='<i class="ri-close-line"></i>',h(t,"class","thumb"),h(o,"class","label label-success m-r-5"),h(a,"class","txt"),h(l,"class","filename"),h(l,"title",c=n[22].name),h(p,"type","button"),h(p,"class","btn btn-secondary btn-sm btn-circle btn-remove"),h(e,"class","list-item")},m(S,$){w(S,e,$),m(e,t),q(i,t,null),m(e,s),m(e,l),m(l,o),m(l,r),m(l,a),m(a,f),m(e,d),m(e,p),g=!0,v||(b=[tt(Mt.call(null,p,"Remove file")),G(p,"click",y)],v=!0)},p(S,$){n=S;const C={};$&1&&(C.file=n[22]),i.$set(C),(!g||$&1)&&u!==(u=n[22].name+"")&&be(f,u),(!g||$&1&&c!==(c=n[22].name))&&h(l,"title",c)},i(S){g||(A(i.$$.fragment,S),g=!0)},o(S){P(i.$$.fragment,S),g=!1},d(S){S&&k(e),V(i),v=!1,lt(b)}}}function bh(n){let e,t,i,s,l,o;return{c(){e=_("div"),t=_("input"),i=T(),s=_("button"),s.innerHTML=`<i class="ri-upload-cloud-line"></i>
<span class="txt">Upload new file</span>`,h(t,"type","file"),h(t,"class","hidden"),t.multiple=n[5],h(s,"type","button"),h(s,"class","btn btn-secondary btn-sm btn-block"),h(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),m(e,t),n[16](t),m(e,i),m(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,lt(o)}}}function oC(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,p,g,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let L=mh(n,b,D),O=y(L);d.set(O,c[D]=gh(O,L))}let S=n[0],$=[];for(let D=0;D<S.length;D+=1)$[D]=_h(ph(n,S,D));const C=D=>P($[D],1,1,()=>{$[D]=null});let M=!n[8]&&bh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();p=T();for(let D=0;D<$.length;D+=1)$[D].c();g=T(),M&&M.c(),h(t,"class",i=W.getFieldTypeIcon(n[3].type)),h(l,"class","txt"),h(e,"for",a=n[21]),h(f,"class","files-list")},m(D,L){w(D,e,L),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,L),w(D,f,L);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,p);for(let O=0;O<$.length;O+=1)$[O].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,L){if((!v||L&8&&i!==(i=W.getFieldTypeIcon(D[3].type)))&&h(t,"class",i),(!v||L&8)&&o!==(o=D[3].name+"")&&be(r,o),(!v||L&2097152&&a!==(a=D[21]))&&h(e,"for",a),L&1558&&(b=D[4],Te(),c=ft(c,L,y,1,D,b,d,f,Ft,gh,p,mh),De()),L&2049){S=D[0];let O;for(O=0;O<S.length;O+=1){const F=ph(D,S,O);$[O]?($[O].p(F,L),A($[O],1)):($[O]=_h(F),$[O].c(),A($[O],1),$[O].m(f,g))}for(Te(),O=S.length;O<$.length;O+=1)C(O);De()}D[8]?M&&(M.d(1),M=null):M?M.p(D,L):(M=bh(D),M.c(),M.m(f,null))},i(D){if(!v){for(let L=0;L<b.length;L+=1)A(c[L]);for(let L=0;L<S.length;L+=1)A($[L]);v=!0}},o(D){for(let L=0;L<c.length;L+=1)P(c[L]);$=$.filter(Boolean);for(let L=0;L<$.length;L+=1)P($[L]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let L=0;L<c.length;L+=1)c[L].d();Rn($,D),M&&M.d(),n[19](null)}}}function rC(n){let e,t;return e=new Fe({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[oC,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function aC(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new _n}=e,c,d;function p(O){W.removeByValue(u,O),t(1,u)}function g(O){W.pushUnique(u,O),t(1,u)}function v(O){W.isEmpty(a[O])||a.splice(O,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=O=>p(O),S=O=>g(O),$=O=>v(O);function C(O){ge[O?"unshift":"push"](()=>{c=O,t(6,c)})}const M=()=>{for(let O of c.files)a.push(O);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function L(O){ge[O?"unshift":"push"](()=>{d=O,t(7,d)})}return n.$$set=O=>{"record"in O&&t(2,o=O.record),"value"in O&&t(12,r=O.value),"uploadedFiles"in O&&t(0,a=O.uploadedFiles),"deletedFileIndexes"in O&&t(1,u=O.deletedFileIndexes),"field"in O&&t(3,f=O.field)},n.$$.update=()=>{var O,F;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((O=f.options)==null?void 0:O.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((F=f.options)==null?void 0:F.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,p,g,v,r,y,S,$,C,M,D,L]}class uC extends Ee{constructor(e){super(),Ae(this,e,aC,rC,Oe,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function vh(n){let e,t;return{c(){e=_("small"),t=R(n[1]),h(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&be(t,i[1])},d(i){i&&k(e)}}}function fC(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&vh(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=R(o),a=T(),c&&c.c(),h(e,"class","ri-information-line link-hint"),h(l,"class","block txt-ellipsis"),h(s,"class","content svelte-1gjwqyd")},m(d,p){w(d,e,p),w(d,i,p),w(d,s,p),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=tt(t=Mt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[p]){t&&Bn(t.update)&&p&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),p&1&&o!==(o=d[0].id+"")&&be(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,p):(c=vh(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i:oe,o:oe,d(d){d&&k(e),d&&k(i),d&&k(s),c&&c.d(),u=!1,f()}}}function cC(n,e,t){let i;const s=["id","created","updated","@collectionId","@collectionName"];let{item:l={}}=e;function o(r){r=r||{};const a=["name","title","label","key","email","heading","content",...Object.keys(r)];for(const u of a)if(typeof r[u]=="string"&&!W.isEmpty(r[u])&&!s.includes(u))return u+": "+r[u];return""}return n.$$set=r=>{"item"in r&&t(0,l=r.item)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=o(l))},[l,i]}class dC extends Ee{constructor(e){super(),Ae(this,e,cC,fC,Oe,{item:0})}}function yh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',h(e,"type","button"),h(e,"class","btn btn-block btn-sm"),X(e,"btn-loading",n[6]),X(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",Hn(n[14])),t=!0)},p(s,l){l&64&&X(e,"btn-loading",s[6]),l&64&&X(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function hC(n){let e,t=n[7]&&yh(n);return{c(){t&&t.c(),e=ot()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=yh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function pC(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:n[4]},{optionComponent:n[4]},{multiple:n[2]},{class:"records-select block-options"},n[10]];function o(u){n[15](u)}function r(u){n[16](u)}let a={$$slots:{afterOptions:[hC]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=ht(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new ls({props:a}),ge.push(()=>Ie(e,"keyOfSelected",o)),ge.push(()=>Ie(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){z(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,[f]){const c=f&1340?hn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&16&&{labelComponent:u[4]},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&oi(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],Re(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],Re(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function mC(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Wt(e,l);const r="select_"+W.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=dC}=e,{collectionId:p}=e,g=[],v=1,b=0,y=!1,S=!1;$();async function $(){const E=W.toArray(f);if(!(!p||!E.length)){t(13,S=!0);try{const j=[];for(const U of E)j.push(`id="${U}"`);t(0,u=await Se.Records.getFullList(p,200,{sort:"-created",filter:j.join("||"),$cancelKey:r+"loadSelected"})),t(5,g=W.filterDuplicatesByKey(g.concat(u)))}catch(j){Se.errorResponseHandler(j)}t(13,S=!1)}}async function C(E=!1){if(!!p){t(6,y=!0);try{const j=E?1:v+1,U=await Se.Records.getList(p,j,200,{sort:"-created",$cancelKey:r+"loadList"});E&&t(5,g=[]),t(5,g=W.filterDuplicatesByKey(g.concat(U.items))),v=U.page,t(12,b=U.totalItems)}catch(j){Se.errorResponseHandler(j)}t(6,y=!1)}}const M=()=>C();function D(E){f=E,t(1,f)}function L(E){u=E,t(0,u)}function O(E){dt.call(this,n,E)}function F(E){dt.call(this,n,E)}return n.$$set=E=>{e=ht(ht({},e),si(E)),t(10,o=Wt(e,l)),"multiple"in E&&t(2,a=E.multiple),"selected"in E&&t(0,u=E.selected),"keyOfSelected"in E&&t(1,f=E.keyOfSelected),"selectPlaceholder"in E&&t(3,c=E.selectPlaceholder),"optionComponent"in E&&t(4,d=E.optionComponent),"collectionId"in E&&t(11,p=E.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&p&&C(!0),n.$$.dirty&8256&&t(8,i=y||S),n.$$.dirty&4128&&t(7,s=b>g.length)},[u,f,a,c,d,g,y,s,i,C,o,p,b,S,M,D,L,O,F]}class gC extends Ee{constructor(e){super(),Ae(this,e,mC,pC,Oe,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function kh(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=R("Select up to "),s=R(i),l=R(" items."),h(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&be(s,i)},d(o){o&&k(e)}}}function _C(n){var S,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;function v(C){n[3](C)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:(S=n[1].options)==null?void 0:S.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new gC({props:b}),ge.push(()=>Ie(f,"keyOfSelected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&kh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),d=T(),y&&y.c(),p=ot(),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[4])},m(C,M){w(C,e,M),m(e,t),m(e,s),m(e,l),m(l,r),w(C,u,M),q(f,C,M),w(C,d,M),y&&y.m(C,M),w(C,p,M),g=!0},p(C,M){var L,O;(!g||M&2&&i!==(i=W.getFieldTypeIcon(C[1].type)))&&h(t,"class",i),(!g||M&2)&&o!==(o=C[1].name+"")&&be(r,o),(!g||M&16&&a!==(a=C[4]))&&h(e,"for",a);const D={};M&16&&(D.id=C[4]),M&4&&(D.multiple=C[2]),M&2&&(D.collectionId=(L=C[1].options)==null?void 0:L.collectionId),!c&&M&1&&(c=!0,D.keyOfSelected=C[0],Re(()=>c=!1)),f.$set(D),((O=C[1].options)==null?void 0:O.maxSelect)>1?y?y.p(C,M):(y=kh(C),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i(C){g||(A(f.$$.fragment,C),g=!0)},o(C){P(f.$$.fragment,C),g=!1},d(C){C&&k(e),C&&k(u),V(f,C),C&&k(d),y&&y.d(C),C&&k(p)}}}function bC(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[_C,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){z(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){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function vC(n,e,t){let i,{field:s=new _n}=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&7&&i&&Array.isArray(l)&&l.length>s.options.maxSelect&&t(0,l=l.slice(s.options.maxSelect-1))},[l,s,i,o]}class yC extends Ee{constructor(e){super(),Ae(this,e,vC,bC,Oe,{field:1,value:0})}}function kC(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f=n[0].email+"",c,d,p;return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=R(o),a=T(),u=_("small"),c=R(f),h(e,"class","ri-information-line link-hint"),h(l,"class","block txt-ellipsis"),h(u,"class","block txt-hint txt-ellipsis"),h(s,"class","content")},m(g,v){w(g,e,v),w(g,i,v),w(g,s,v),m(s,l),m(l,r),m(s,a),m(s,u),m(u,c),d||(p=tt(t=Mt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(g,[v]){t&&Bn(t.update)&&v&1&&t.update.call(null,{text:JSON.stringify(g[0],null,2),position:"left",class:"code"}),v&1&&o!==(o=g[0].id+"")&&be(r,o),v&1&&f!==(f=g[0].email+"")&&be(c,f)},i:oe,o:oe,d(g){g&&k(e),g&&k(i),g&&k(s),d=!1,p()}}}function wC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class ea extends Ee{constructor(e){super(),Ae(this,e,wC,kC,Oe,{item:0})}}function wh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',h(e,"type","button"),h(e,"class","btn btn-block btn-sm"),X(e,"btn-loading",n[6]),X(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",Hn(n[13])),t=!0)},p(s,l){l&64&&X(e,"btn-loading",s[6]),l&64&&X(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function SC(n){let e,t=n[7]&&wh(n);return{c(){t&&t.c(),e=ot()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=wh(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function $C(n){let e,t,i,s;const l=[{selectPlaceholder:n[8]?"Loading...":n[3]},{items:n[5]},{searchable:n[5].length>5},{selectionKey:"id"},{labelComponent:ea},{optionComponent:n[4]},{multiple:n[2]},{class:"users-select block-options"},n[10]];function o(u){n[14](u)}function r(u){n[15](u)}let a={$$slots:{afterOptions:[SC]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=ht(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new ls({props:a}),ge.push(()=>Ie(e,"keyOfSelected",o)),ge.push(()=>Ie(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){z(e.$$.fragment)},m(u,f){q(e,u,f),s=!0},p(u,[f]){const c=f&1340?hn(l,[f&264&&{selectPlaceholder:u[8]?"Loading...":u[3]},f&32&&{items:u[5]},f&32&&{searchable:u[5].length>5},l[3],f&0&&{labelComponent:ea},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&oi(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],Re(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],Re(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){V(e,u)}}}function CC(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Wt(e,l);const r="select_"+W.randomString(5);let{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{keyOfSelected:f=a?[]:void 0}=e,{selectPlaceholder:c="- Select -"}=e,{optionComponent:d=ea}=e,p=[],g=1,v=0,b=!1,y=!1;$(!0),S();async function S(){const F=W.toArray(f);if(!!F.length){t(12,y=!0);try{const E=[];for(const j of F)E.push(`id="${j}"`);t(0,u=await Se.Users.getFullList(100,{sort:"-created",filter:E.join("||"),$cancelKey:r+"loadSelected"})),t(5,p=W.filterDuplicatesByKey(p.concat(u)))}catch(E){Se.errorResponseHandler(E)}t(12,y=!1)}}async function $(F=!1){t(6,b=!0);try{const E=F?1:g+1,j=await Se.Users.getList(E,200,{sort:"-created",$cancelKey:r+"loadList"});F&&t(5,p=[]),t(5,p=W.filterDuplicatesByKey(p.concat(j.items))),g=j.page,t(11,v=j.totalItems)}catch(E){Se.errorResponseHandler(E)}t(6,b=!1)}const C=()=>$();function M(F){f=F,t(1,f)}function D(F){u=F,t(0,u)}function L(F){dt.call(this,n,F)}function O(F){dt.call(this,n,F)}return n.$$set=F=>{e=ht(ht({},e),si(F)),t(10,o=Wt(e,l)),"multiple"in F&&t(2,a=F.multiple),"selected"in F&&t(0,u=F.selected),"keyOfSelected"in F&&t(1,f=F.keyOfSelected),"selectPlaceholder"in F&&t(3,c=F.selectPlaceholder),"optionComponent"in F&&t(4,d=F.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>p.length)},[u,f,a,c,d,p,b,s,i,$,o,v,y,C,M,D,L,O]}class MC extends Ee{constructor(e){super(),Ae(this,e,CC,$C,Oe,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function Sh(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=R("Select up to "),s=R(i),l=R(" users."),h(e,"class","help-block")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&be(s,i)},d(o){o&&k(e)}}}function TC(n){var S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,p,g;function v($){n[4]($)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new MC({props:b}),ge.push(()=>Ie(f,"keyOfSelected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&Sh(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=R(o),u=T(),z(f.$$.fragment),d=T(),y&&y.c(),p=ot(),h(t,"class",i=W.getFieldTypeIcon(n[1].type)),h(l,"class","txt"),h(e,"for",a=n[5])},m($,C){w($,e,C),m(e,t),m(e,s),m(e,l),m(l,r),w($,u,C),q(f,$,C),w($,d,C),y&&y.m($,C),w($,p,C),g=!0},p($,C){var D;(!g||C&2&&i!==(i=W.getFieldTypeIcon($[1].type)))&&h(t,"class",i),(!g||C&2)&&o!==(o=$[1].name+"")&&be(r,o),(!g||C&32&&a!==(a=$[5]))&&h(e,"for",a);const M={};C&32&&(M.id=$[5]),C&4&&(M.multiple=$[2]),C&8&&(M.disabled=$[3]),!c&&C&1&&(c=!0,M.keyOfSelected=$[0],Re(()=>c=!1)),f.$set(M),((D=$[1].options)==null?void 0:D.maxSelect)>1?y?y.p($,C):(y=Sh($),y.c(),y.m(p.parentNode,p)):y&&(y.d(1),y=null)},i($){g||(A(f.$$.fragment,$),g=!0)},o($){P(f.$$.fragment,$),g=!1},d($){$&&k(e),$&&k(u),V(f,$),$&&k(d),y&&y.d($),$&&k(p)}}}function DC(n){let e,t;return e=new Fe({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[TC,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&10&&(l.class="form-field "+(i[1].required?"required":"")+" "+(i[3]?"disabled":"")),s&2&&(l.name=i[1].name),s&111&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function OC(n,e,t){let i,s,{field:l=new _n}=e,{value:o=void 0}=e;function r(a){o=a,t(0,o),t(2,s),t(1,l)}return n.$$set=a=>{"field"in a&&t(1,l=a.field),"value"in a&&t(0,o=a.value)},n.$$.update=()=>{var a;n.$$.dirty&2&&t(2,s=((a=l.options)==null?void 0:a.maxSelect)>1),n.$$.dirty&7&&s&&Array.isArray(o)&&o.length>l.options.maxSelect&&t(0,o=o.slice(l.options.maxSelect-1)),n.$$.dirty&3&&t(3,i=!W.isEmpty(o)&&l.system)},[o,l,s,i,r]}class AC extends Ee{constructor(e){super(),Ae(this,e,OC,DC,Oe,{field:1,value:0})}}function $h(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function Ch(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[EC,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&4|s[1]&12288&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function EC(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="id",l=T(),o=_("span"),a=T(),u=_("input"),h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[43]),h(u,"type","text"),h(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,p){w(d,e,p),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),w(d,a,p),w(d,u,p)},p(d,p){p[1]&4096&&r!==(r=d[43])&&h(e,"for",r),p[1]&4096&&f!==(f=d[43])&&h(u,"id",f),p[0]&4&&c!==(c=d[2].id)&&u.value!==c&&(u.value=c)},d(d){d&&k(e),d&&k(a),d&&k(u)}}}function Mh(n){let e;return{c(){e=_("div"),e.innerHTML=`<h5>No custom fields to be set</h5>
`,h(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function PC(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new AC({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function LC(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new yC({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function FC(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new uC({props:u}),ge.push(()=>Ie(e,"value",o)),ge.push(()=>Ie(e,"uploadedFiles",r)),ge.push(()=>Ie(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],Re(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],Re(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],Re(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function IC(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new z4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function NC(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new H4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function RC(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new F4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function HC(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new A4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function jC(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new M4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function qC(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new w4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function VC(n){let e,t,i;function s(o){n[20](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new b4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function zC(n){let e,t,i;function s(o){n[19](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new p4({props:l}),ge.push(()=>Ie(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],Re(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Th(n,e){let t,i,s,l,o;const r=[zC,VC,qC,jC,HC,RC,NC,IC,FC,LC,PC],a=[];function u(f,c){return f[40].type==="text"?0:f[40].type==="number"?1:f[40].type==="bool"?2:f[40].type==="email"?3:f[40].type==="url"?4:f[40].type==="date"?5:f[40].type==="select"?6:f[40].type==="json"?7:f[40].type==="file"?8:f[40].type==="relation"?9:f[40].type==="user"?10:-1}return~(i=u(e))&&(s=a[i]=r[i](e)),{key:n,first:null,c(){t=ot(),s&&s.c(),l=ot(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,l,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(s&&(Te(),P(a[d],1,1,()=>{a[d]=null}),De()),~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){P(s),o=!1},d(f){f&&k(t),~i&&a[i].d(f),f&&k(l)}}}function BC(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&Ch(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=p=>p[40].name;for(let p=0;p<u.length;p+=1){let g=$h(n,u,p),v=f(g);s.set(v,i[p]=Th(v,g))}let c=null;return u.length||(c=Mh()),{c(){e=_("form"),a&&a.c(),t=T();for(let p=0;p<i.length;p+=1)i[p].c();c&&c.c(),h(e,"id",n[11]),h(e,"class","block")},m(p,g){w(p,e,g),a&&a.m(e,null),m(e,t);for(let v=0;v<i.length;v+=1)i[v].m(e,null);c&&c.m(e,null),l=!0,o||(r=G(e,"submit",Vt(n[12])),o=!0)},p(p,g){var v;p[2].isNew?a&&(Te(),P(a,1,1,()=>{a=null}),De()):a?(a.p(p,g),g[0]&4&&A(a,1)):(a=Ch(p),a.c(),A(a,1),a.m(e,t)),g[0]&29&&(u=((v=p[0])==null?void 0:v.schema)||[],Te(),i=ft(i,g,f,1,p,u,s,e,Ft,Th,null,$h),De(),!u.length&&c?c.p(p,g):u.length?c&&(c.d(1),c=null):(c=Mh(),c.c(),c.m(e,null)))},i(p){if(!l){A(a);for(let g=0;g<u.length;g+=1)A(i[g]);l=!0}},o(p){P(a);for(let g=0;g<i.length;g+=1)P(i[g]);l=!1},d(p){p&&k(e),a&&a.d();for(let g=0;g<i.length;g+=1)i[g].d();c&&c.d(),o=!1,r()}}}function Dh(n){let e,t,i,s,l,o,r,a;return r=new ss({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[UC]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("div"),l=_("i"),o=T(),z(r.$$.fragment),h(e,"class","flex-fill"),h(l,"class","ri-more-line"),h(s,"class","content"),h(i,"type","button"),h(i,"class","btn btn-sm btn-circle btn-secondary")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),m(i,s),m(s,l),m(s,o),q(r,s,null),a=!0},p(u,f){const c={};f[1]&8192&&(c.$$scope={dirty:f,ctx:u}),r.$set(c)},i(u){a||(A(r.$$.fragment,u),a=!0)},o(u){P(r.$$.fragment,u),a=!1},d(u){u&&k(e),u&&k(t),u&&k(i),V(r)}}}function UC(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(e,"tabindex","0"),h(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function WC(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&Dh(n);return{c(){e=_("h4"),i=R(t),s=T(),o=R(l),r=R(" record"),a=T(),c&&c.c(),u=ot()},m(d,p){w(d,e,p),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,p),c&&c.m(d,p),w(d,u,p),f=!0},p(d,p){(!f||p[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&be(i,t),(!f||p[0]&1)&&l!==(l=d[0].name+"")&&be(o,l),!d[2].isNew&&d[10]?c?(c.p(d,p),p[0]&1028&&A(c,1)):(c=Dh(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Te(),P(c,1,1,()=>{c=null}),De())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function YC(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=R(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-secondary"),e.disabled=n[7],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[11]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],X(s,"btn-loading",n[7])},m(c,d){w(c,e,d),m(e,t),w(c,i,d),w(c,s,d),m(s,l),m(l,r),u||(f=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&be(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&X(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function KC(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[YC],header:[WC],default:[BC]},$$scope:{ctx:n}};return e=new yi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),V(e,s)}}}function Oh(n){return JSON.stringify(n)}function ZC(n,e,t){let i,s,l,o;const r=rn(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new ao,p=!1,g=!1,v={},b={},y="";function S(ie){return C(ie),t(8,g=!0),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function C(ie){Li({}),c=ie||{},t(2,d=ie!=null&&ie.clone?ie.clone():new ao),t(3,v={}),t(4,b={}),await li(),t(15,y=Oh(d))}function M(){if(p||!l)return;t(7,p=!0);const ie=L();let x;d.isNew?x=Se.Records.create(u==null?void 0:u.id,ie):x=Se.Records.update(u==null?void 0:u.id,d.id,ie),x.then(async ye=>{dn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),$(),r("save",ye)}).catch(ye=>{Se.errorResponseHandler(ye)}).finally(()=>{t(7,p=!1)})}function D(){!(c!=null&&c.id)||_i("Do you really want to delete the selected record?",()=>Se.Records.delete(c["@collectionId"],c.id).then(()=>{$(),dn("Successfully deleted record."),r("delete",c)}).catch(ie=>{Se.errorResponseHandler(ie)}))}function L(){const ie=(d==null?void 0:d.export())||{},x=new FormData,ye={};for(const He of(u==null?void 0:u.schema)||[])ye[He.name]=He;for(const He in ie)!ye[He]||(typeof ie[He]>"u"&&(ie[He]=null),W.addValueToFormData(x,He,ie[He]));for(const He in v){const Le=W.toArray(v[He]);for(const Pe of Le)x.append(He,Pe)}for(const He in b){const Le=W.toArray(b[He]);for(const Pe of Le)x.append(He+"."+Pe,"")}return x}const O=()=>$(),F=()=>D();function E(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function j(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function U(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function Q(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function te(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function H(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function Y(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function K(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function Z(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function ee(ie,x){n.$$.not_equal(v[x.name],ie)&&(v[x.name]=ie,t(3,v))}function ae(ie,x){n.$$.not_equal(b[x.name],ie)&&(b[x.name]=ie,t(4,b))}function ve(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}function le(ie,x){n.$$.not_equal(d[x.name],ie)&&(d[x.name]=ie,t(2,d))}const me=()=>s&&g?(_i("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),$()}),!1):!0;function re(ie){ge[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function de(ie){dt.call(this,n,ie)}function fe(ie){dt.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{n.$$.dirty[0]&24&&t(16,i=W.hasNonEmptyProps(v)||W.hasNonEmptyProps(b)),n.$$.dirty[0]&98308&&t(5,s=i||y!=Oh(d)),n.$$.dirty[0]&36&&t(9,l=d.isNew||s),n.$$.dirty[0]&1&&t(10,o=(u==null?void 0:u.name)!=="profiles")},[u,$,d,v,b,s,f,p,g,l,o,a,M,D,S,y,i,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve,le,me,re,de,fe]}class h_ extends Ee{constructor(e){super(),Ae(this,e,ZC,KC,Oe,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function JC(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function GC(n){let e,t;return{c(){e=_("span"),t=R(n[1]),h(e,"class","label txt-base txt-mono"),h(e,"title",n[0])},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&be(t,i[1]),s&1&&h(e,"title",i[0])},d(i){i&&k(e)}}}function XC(n){let e;function t(l,o){return l[0]?GC:JC}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function QC(n,e,t){let{id:i=""}=e,s=i;return n.$$set=l=>{"id"in l&&t(0,i=l.id)},n.$$.update=()=>{n.$$.dirty&1&&typeof i=="string"&&i.length>27&&t(1,s=i.substring(0,5)+"..."+i.substring(i.length-10))},[i,s]}class Wo extends Ee{constructor(e){super(),Ae(this,e,QC,XC,Oe,{id:0})}}function Ah(n,e,t){const i=n.slice();return i[8]=e[t],i}function Eh(n,e,t){const i=n.slice();return i[3]=e[t],i}function Ph(n,e,t){const i=n.slice();return i[3]=e[t],i}function xC(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=R(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[0][n[1].name])},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&3&&t!==(t=l[0][l[1].name]+"")&&be(i,t),o&3&&s!==(s=l[0][l[1].name])&&h(e,"title",s)},i:oe,o:oe,d(l){l&&k(e)}}}function eM(n){let e,t,i=W.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Lh(Ah(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o<s.length;o+=1)s[o].c();h(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r&3){i=W.toArray(o[0][o[1].name]);let a;for(a=0;a<i.length;a+=1){const u=Ah(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Lh(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(Te(),a=i.length;a<s.length;a+=1)l(a);De()}},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)P(s[r]);t=!1},d(o){o&&k(e),Rn(s,o)}}}function tM(n){let e,t,i=W.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Fh(Eh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){e=_("div");for(let o=0;o<s.length;o+=1)s[o].c();h(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<s.length;a+=1)s[a].m(e,null);t=!0},p(o,r){if(r&3){i=W.toArray(o[0][o[1].name]);let a;for(a=0;a<i.length;a+=1){const u=Eh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Fh(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(Te(),a=i.length;a<s.length;a+=1)l(a);De()}},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)P(s[r]);t=!1},d(o){o&&k(e),Rn(s,o)}}}function nM(n){let e,t=W.toArray(n[0][n[1].name]),i=[];for(let s=0;s<t.length;s+=1)i[s]=Ih(Ph(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();h(e,"class","inline-flex")},m(s,l){w(s,e,l);for(let o=0;o<i.length;o+=1)i[o].m(e,null)},p(s,l){if(l&3){t=W.toArray(s[0][s[1].name]);let o;for(o=0;o<t.length;o+=1){const r=Ph(s,t,o);i[o]?i[o].p(r,l):(i[o]=Ih(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:oe,o:oe,d(s){s&&k(e),Rn(i,s)}}}function iM(n){let e,t=JSON.stringify(n[0][n[1].name])+"",i;return{c(){e=_("span"),i=R(t),h(e,"class","txt txt-ellipsis")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=JSON.stringify(s[0][s[1].name])+"")&&be(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function sM(n){let e,t;return e=new gi({props:{date:n[0][n[1].name]}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.date=i[0][i[1].name]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function lM(n){let e,t=n[0][n[1].name]+"",i,s,l,o;return{c(){e=_("a"),i=R(t),h(e,"class","txt-ellipsis"),h(e,"href",s=n[0][n[1].name]),h(e,"target","_blank"),h(e,"rel","noopener")},m(r,a){w(r,e,a),m(e,i),l||(o=[tt(Mt.call(null,e,"Open in new tab")),G(e,"click",Hn(n[2]))],l=!0)},p(r,a){a&3&&t!==(t=r[0][r[1].name]+"")&&be(i,t),a&3&&s!==(s=r[0][r[1].name])&&h(e,"href",s)},i:oe,o:oe,d(r){r&&k(e),l=!1,lt(o)}}}function oM(n){let e,t=n[0][n[1].name]?"True":"False",i;return{c(){e=_("span"),i=R(t),h(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[0][s[1].name]?"True":"False")&&be(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function rM(n){let e;return{c(){e=_("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Lh(n){let e,t,i,s;return t=new d_({props:{record:n[0],filename:n[8]}}),{c(){e=_("figure"),z(t.$$.fragment),i=T(),h(e,"class","thumb thumb-sm")},m(l,o){w(l,e,o),q(t,e,null),m(e,i),s=!0},p(l,o){const r={};o&1&&(r.record=l[0]),o&3&&(r.filename=l[8]),t.$set(r)},i(l){s||(A(t.$$.fragment,l),s=!0)},o(l){P(t.$$.fragment,l),s=!1},d(l){l&&k(e),V(t)}}}function Fh(n){let e,t;return e=new Wo({props:{id:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&3&&(l.id=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function Ih(n){let e,t=n[3]+"",i;return{c(){e=_("span"),i=R(t),h(e,"class","label")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[3]+"")&&be(i,t)},d(s){s&&k(e)}}}function aM(n){let e,t,i,s,l,o;const r=[rM,oM,lM,sM,iM,nM,tM,eM,xC],a=[];function u(f,c){return c&3&&(t=null),t==null&&(t=!!W.isEmpty(f[0][f[1].name])),t?0:f[1].type==="bool"?1:f[1].type==="url"?2:f[1].type==="date"?3:f[1].type==="json"?4:f[1].type==="select"?5:f[1].type==="relation"||f[1].type==="user"?6:f[1].type==="file"?7:8}return i=u(n,-1),s=a[i]=r[i](n),{c(){e=_("td"),s.c(),h(e,"class",l="col-type-"+n[1].type+" col-field-"+n[1].name)},m(f,c){w(f,e,c),a[i].m(e,null),o=!0},p(f,[c]){let d=i;i=u(f,c),i===d?a[i].p(f,c):(Te(),P(a[d],1,1,()=>{a[d]=null}),De(),s=a[i],s?s.p(f,c):(s=a[i]=r[i](f),s.c()),A(s,1),s.m(e,null)),(!o||c&2&&l!==(l="col-type-"+f[1].type+" col-field-"+f[1].name))&&h(e,"class",l)},i(f){o||(A(s),o=!0)},o(f){P(s),o=!1},d(f){f&&k(e),a[i].d()}}}function uM(n,e,t){let{record:i}=e,{field:s}=e;function l(o){dt.call(this,n,o)}return n.$$set=o=>{"record"in o&&t(0,i=o.record),"field"in o&&t(1,s=o.field)},[i,s,l]}class p_ extends Ee{constructor(e){super(),Ae(this,e,uM,aM,Oe,{record:0,field:1})}}function Nh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Rh(n,e,t){const i=n.slice();return i[38]=e[t],i}function Hh(n,e,t){const i=n.slice();return i[38]=e[t],i}function fM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function cM(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=T(),l=_("span"),r=R(o),h(t,"class",i=W.getFieldTypeIcon(n[38].type)),h(l,"class","txt"),h(e,"class","col-header-content")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(l,r)},p(a,u){u[0]&2048&&i!==(i=W.getFieldTypeIcon(a[38].type))&&h(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&be(r,o)},d(a){a&&k(e)}}}function jh(n,e){let t,i,s,l;function o(a){e[22](a)}let r={class:"col-type-"+e[38].type+" col-field-"+e[38].name,name:e[38].name,$$slots:{default:[cM]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new xt({props:r}),ge.push(()=>Ie(i,"sort",o)),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),q(i,a,u),l=!0},p(a,u){e=a;const f={};u[0]&2048&&(f.class="col-type-"+e[38].type+" col-field-"+e[38].name),u[0]&2048&&(f.name=e[38].name),u[0]&2048|u[1]&4096&&(f.$$scope={dirty:u,ctx:e}),!s&&u[0]&1&&(s=!0,f.sort=e[0],Re(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){P(i.$$.fragment,a),l=!1},d(a){a&&k(t),V(i,a)}}}function dM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function hM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function qh(n){let e;function t(l,o){return l[8]?mM:pM}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function pM(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Vh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Vh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function mM(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function zh(n,e){let t,i,s;return i=new p_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function Bh(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,S,$,C,M,D,L,O,F,E,j,U;function Q(){return e[25](e[35])}p=new Wo({props:{id:e[35].id}});let te=e[11];const H=Z=>Z[38].name;for(let Z=0;Z<te.length;Z+=1){let ee=Rh(e,te,Z),ae=H(ee);b.set(ae,v[Z]=zh(ae,ee))}$=new gi({props:{date:e[35].created}}),D=new gi({props:{date:e[35].updated}});function Y(){return e[26](e[35])}function K(...Z){return e[27](e[35],...Z)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),z(p.$$.fragment),g=T();for(let Z=0;Z<v.length;Z+=1)v[Z].c();y=T(),S=_("td"),z($.$$.fragment),C=T(),M=_("td"),z(D.$$.fragment),L=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),h(l,"type","checkbox"),h(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],h(u,"for",f="checkbox_"+e[35].id),h(s,"class","form-field"),h(i,"class","bulk-select-col min-width"),h(d,"class","col-type-text col-field-id"),h(S,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Z,ee){w(Z,t,ee),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),q(p,d,null),m(t,g);for(let ae=0;ae<v.length;ae+=1)v[ae].m(t,null);m(t,y),m(t,S),q($,S,null),m(t,C),m(t,M),q(D,M,null),m(t,L),m(t,O),m(t,F),E=!0,j||(U=[G(l,"change",Q),G(s,"click",Hn(e[19])),G(t,"click",Y),G(t,"keydown",K)],j=!0)},p(Z,ee){e=Z,(!E||ee[0]&8&&o!==(o="checkbox_"+e[35].id))&&h(l,"id",o),(!E||ee[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!E||ee[0]&8&&f!==(f="checkbox_"+e[35].id))&&h(u,"for",f);const ae={};ee[0]&8&&(ae.id=e[35].id),p.$set(ae),ee[0]&2056&&(te=e[11],Te(),v=ft(v,ee,H,1,e,te,b,t,Ft,zh,y,Rh),De());const ve={};ee[0]&8&&(ve.date=e[35].created),$.$set(ve);const le={};ee[0]&8&&(le.date=e[35].updated),D.$set(le)},i(Z){if(!E){A(p.$$.fragment,Z);for(let ee=0;ee<te.length;ee+=1)A(v[ee]);A($.$$.fragment,Z),A(D.$$.fragment,Z),E=!0}},o(Z){P(p.$$.fragment,Z);for(let ee=0;ee<v.length;ee+=1)P(v[ee]);P($.$$.fragment,Z),P(D.$$.fragment,Z),E=!1},d(Z){Z&&k(t),V(p);for(let ee=0;ee<v.length;ee+=1)v[ee].d();V($),V(D),j=!1,lt(U)}}}function Uh(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[4]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&be(s,i),a[0]&16&&be(o,r[4])},d(r){r&&k(e)}}}function Wh(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),X(t,"btn-loading",n[8]),X(t,"btn-disabled",n[8]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&be(o,l),c[0]&256&&X(t,"btn-loading",f[8]),c[0]&256&&X(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Yh(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,p,g,v,b,y,S;return{c(){e=_("div"),t=_("div"),i=R("Selected "),s=_("strong"),l=R(n[6]),o=T(),a=R(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),p=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',h(t,"class","txt"),h(f,"type","button"),h(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),X(f,"btn-disabled",n[9]),h(d,"class","flex-fill"),h(g,"type","button"),h(g,"class","btn btn-sm btn-secondary btn-danger"),X(g,"btn-loading",n[9]),X(g,"btn-disabled",n[9]),h(e,"class","bulkbar")},m($,C){w($,e,C),m(e,t),m(t,i),m(t,s),m(s,l),m(t,o),m(t,a),m(e,u),m(e,f),m(e,c),m(e,d),m(e,p),m(e,g),b=!0,y||(S=[G(f,"click",n[30]),G(g,"click",n[31])],y=!0)},p($,C){(!b||C[0]&64)&&be(l,$[6]),(!b||C[0]&64)&&r!==(r=$[6]===1?"record":"records")&&be(a,r),C[0]&512&&X(f,"btn-disabled",$[9]),C[0]&512&&X(g,"btn-loading",$[9]),C[0]&512&&X(g,"btn-disabled",$[9])},i($){b||($&&Tt(()=>{v||(v=at(e,jn,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o($){$&&(v||(v=at(e,jn,{duration:150,y:5},!1)),v.run(0)),b=!1},d($){$&&k(e),$&&v&&v.end(),y=!1,lt(S)}}}function gM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v=[],b=new Map,y,S,$,C,M,D,L,O,F,E,j=[],U=new Map,Q,te,H,Y,K,Z,ee;function ae(ce){n[21](ce)}let ve={class:"col-type-text col-field-id",name:"id",$$slots:{default:[fM]},$$scope:{ctx:n}};n[0]!==void 0&&(ve.sort=n[0]),d=new xt({props:ve}),ge.push(()=>Ie(d,"sort",ae));let le=n[11];const me=ce=>ce[38].name;for(let ce=0;ce<le.length;ce+=1){let ke=Hh(n,le,ce),Be=me(ke);b.set(Be,v[ce]=jh(Be,ke))}function re(ce){n[23](ce)}let de={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dM]},$$scope:{ctx:n}};n[0]!==void 0&&(de.sort=n[0]),S=new xt({props:de}),ge.push(()=>Ie(S,"sort",re));function fe(ce){n[24](ce)}let ie={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[hM]},$$scope:{ctx:n}};n[0]!==void 0&&(ie.sort=n[0]),M=new xt({props:ie}),ge.push(()=>Ie(M,"sort",fe));let x=n[3];const ye=ce=>ce[35].id;for(let ce=0;ce<x.length;ce+=1){let ke=Nh(n,x,ce),Be=ye(ke);U.set(Be,j[ce]=Bh(Be,ke))}let He=null;x.length||(He=qh(n));let Le=n[3].length&&Uh(n),Pe=n[3].length&&n[12]&&Wh(n),ue=n[6]&&Yh(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),l=_("th"),o=_("div"),r=_("input"),u=T(),f=_("label"),c=T(),z(d.$$.fragment),g=T();for(let ce=0;ce<v.length;ce+=1)v[ce].c();y=T(),z(S.$$.fragment),C=T(),z(M.$$.fragment),L=T(),O=_("th"),F=T(),E=_("tbody");for(let ce=0;ce<j.length;ce+=1)j[ce].c();He&&He.c(),Q=T(),Le&&Le.c(),te=T(),Pe&&Pe.c(),H=T(),ue&&ue.c(),Y=ot(),h(r,"type","checkbox"),h(r,"id","checkbox_0"),r.disabled=a=!n[3].length,r.checked=n[10],h(f,"for","checkbox_0"),h(o,"class","form-field"),h(l,"class","bulk-select-col min-width"),h(O,"class","col-type-action min-width"),h(t,"class","table"),X(t,"table-loading",n[8]),h(e,"class","table-wrapper")},m(ce,ke){w(ce,e,ke),m(e,t),m(t,i),m(i,s),m(s,l),m(l,o),m(o,r),m(o,u),m(o,f),m(s,c),q(d,s,null),m(s,g);for(let Be=0;Be<v.length;Be+=1)v[Be].m(s,null);m(s,y),q(S,s,null),m(s,C),q(M,s,null),m(s,L),m(s,O),m(t,F),m(t,E);for(let Be=0;Be<j.length;Be+=1)j[Be].m(E,null);He&&He.m(E,null),w(ce,Q,ke),Le&&Le.m(ce,ke),w(ce,te,ke),Pe&&Pe.m(ce,ke),w(ce,H,ke),ue&&ue.m(ce,ke),w(ce,Y,ke),K=!0,Z||(ee=G(r,"change",n[20]),Z=!0)},p(ce,ke){(!K||ke[0]&8&&a!==(a=!ce[3].length))&&(r.disabled=a),(!K||ke[0]&1024)&&(r.checked=ce[10]);const Be={};ke[1]&4096&&(Be.$$scope={dirty:ke,ctx:ce}),!p&&ke[0]&1&&(p=!0,Be.sort=ce[0],Re(()=>p=!1)),d.$set(Be),ke[0]&2049&&(le=ce[11],Te(),v=ft(v,ke,me,1,ce,le,b,s,Ft,jh,y,Hh),De());const Ke={};ke[1]&4096&&(Ke.$$scope={dirty:ke,ctx:ce}),!$&&ke[0]&1&&($=!0,Ke.sort=ce[0],Re(()=>$=!1)),S.$set(Ke);const Ue={};ke[1]&4096&&(Ue.$$scope={dirty:ke,ctx:ce}),!D&&ke[0]&1&&(D=!0,Ue.sort=ce[0],Re(()=>D=!1)),M.$set(Ue),ke[0]&76074&&(x=ce[3],Te(),j=ft(j,ke,ye,1,ce,x,U,E,Ft,Bh,null,Nh),De(),!x.length&&He?He.p(ce,ke):x.length?He&&(He.d(1),He=null):(He=qh(ce),He.c(),He.m(E,null))),ke[0]&256&&X(t,"table-loading",ce[8]),ce[3].length?Le?Le.p(ce,ke):(Le=Uh(ce),Le.c(),Le.m(te.parentNode,te)):Le&&(Le.d(1),Le=null),ce[3].length&&ce[12]?Pe?Pe.p(ce,ke):(Pe=Wh(ce),Pe.c(),Pe.m(H.parentNode,H)):Pe&&(Pe.d(1),Pe=null),ce[6]?ue?(ue.p(ce,ke),ke[0]&64&&A(ue,1)):(ue=Yh(ce),ue.c(),A(ue,1),ue.m(Y.parentNode,Y)):ue&&(Te(),P(ue,1,1,()=>{ue=null}),De())},i(ce){if(!K){A(d.$$.fragment,ce);for(let ke=0;ke<le.length;ke+=1)A(v[ke]);A(S.$$.fragment,ce),A(M.$$.fragment,ce);for(let ke=0;ke<x.length;ke+=1)A(j[ke]);A(ue),K=!0}},o(ce){P(d.$$.fragment,ce);for(let ke=0;ke<v.length;ke+=1)P(v[ke]);P(S.$$.fragment,ce),P(M.$$.fragment,ce);for(let ke=0;ke<j.length;ke+=1)P(j[ke]);P(ue),K=!1},d(ce){ce&&k(e),V(d);for(let ke=0;ke<v.length;ke+=1)v[ke].d();V(S),V(M);for(let ke=0;ke<j.length;ke+=1)j[ke].d();He&&He.d(),ce&&k(Q),Le&&Le.d(ce),ce&&k(te),Pe&&Pe.d(ce),ce&&k(H),ue&&ue.d(ce),ce&&k(Y),Z=!1,ee()}}}function _M(n,e,t){let i,s,l,o;const r=rn();let{collection:a}=e,{sort:u=""}=e,{filter:f=""}=e,c=[],d=1,p=0,g={},v=!0,b=!1;async function y(le=1){if(!!(a!=null&&a.id))return t(8,v=!0),le<=1&&S(),Se.Records.getList(a.id,le,50,{sort:u,filter:f}).then(me=>{t(8,v=!1),t(3,c=c.concat(me.items)),t(7,d=me.page),t(4,p=me.totalItems),r("load",c)}).catch(me=>{me!=null&&me.isAbort||(t(8,v=!1),console.warn(me),S(),Se.errorResponseHandler(me,!1))})}function S(){t(3,c=[]),t(7,d=1),t(4,p=0),t(5,g={})}function $(){o?C():M()}function C(){t(5,g={})}function M(){for(const le of c)t(5,g[le.id]=le,g);t(5,g)}function D(le){g[le.id]?delete g[le.id]:t(5,g[le.id]=le,g),t(5,g)}function L(){_i(`Do you really want to delete the selected ${l===1?"record":"records"}?`,O)}async function O(){if(b||!l)return;let le=[];for(const me of Object.keys(g))le.push(Se.Records.delete(a==null?void 0:a.id,me));return t(9,b=!0),Promise.all(le).then(()=>{dn(`Successfully deleted the selected ${l===1?"record":"records"}.`),C()}).catch(me=>{Se.errorResponseHandler(me)}).finally(()=>(t(9,b=!1),y()))}function F(le){dt.call(this,n,le)}const E=()=>$();function j(le){u=le,t(0,u)}function U(le){u=le,t(0,u)}function Q(le){u=le,t(0,u)}function te(le){u=le,t(0,u)}const H=le=>D(le),Y=le=>r("select",le),K=(le,me)=>{me.code==="Enter"&&(me.preventDefault(),r("select",le))},Z=()=>t(1,f=""),ee=()=>y(d+1),ae=()=>C(),ve=()=>L();return n.$$set=le=>{"collection"in le&&t(18,a=le.collection),"sort"in le&&t(0,u=le.sort),"filter"in le&&t(1,f=le.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&(S(),y(1)),n.$$.dirty[0]&24&&t(12,i=p>c.length),n.$$.dirty[0]&262144&&t(11,s=(a==null?void 0:a.schema)||[]),n.$$.dirty[0]&32&&t(6,l=Object.keys(g).length),n.$$.dirty[0]&72&&t(10,o=c.length&&l===c.length)},[u,f,y,c,p,g,l,d,v,b,o,s,i,r,$,C,D,L,a,F,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve]}class bM extends Ee{constructor(e){super(),Ae(this,e,_M,gM,Oe,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function vM(n){let e,t,i,s,l,o,r,a,u=n[2].name+"",f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U;e=new m3({}),g=new jo({}),g.$on("refresh",n[13]),M=new Ho({props:{value:n[0],autocompleteCollection:n[2]}}),M.$on("submit",n[16]);function Q(Y){n[18](Y)}function te(Y){n[19](Y)}let H={collection:n[2]};return n[0]!==void 0&&(H.filter=n[0]),n[1]!==void 0&&(H.sort=n[1]),L=new bM({props:H}),n[17](L),ge.push(()=>Ie(L,"filter",Q)),ge.push(()=>Ie(L,"sort",te)),L.$on("select",n[20]),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Collections",r=T(),a=_("div"),f=R(u),c=T(),d=_("button"),d.innerHTML='<i class="ri-settings-4-line"></i>',p=T(),z(g.$$.fragment),v=T(),b=_("div"),y=_("button"),y.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,S=T(),$=_("button"),$.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,C=T(),z(M.$$.fragment),D=T(),z(L.$$.fragment),h(o,"class","breadcrumb-item"),h(a,"class","breadcrumb-item"),h(l,"class","breadcrumbs"),h(d,"type","button"),h(d,"class","btn btn-secondary btn-circle"),h(y,"type","button"),h(y,"class","btn btn-outline"),h($,"type","button"),h($,"class","btn btn-expanded"),h(b,"class","btns-group"),h(s,"class","page-header"),h(i,"class","page-wrapper")},m(Y,K){q(e,Y,K),w(Y,t,K),w(Y,i,K),m(i,s),m(s,l),m(l,o),m(l,r),m(l,a),m(a,f),m(s,c),m(s,d),m(s,p),q(g,s,null),m(s,v),m(s,b),m(b,y),m(b,S),m(b,$),m(i,C),q(M,i,null),m(i,D),q(L,i,null),E=!0,j||(U=[tt(Mt.call(null,d,{text:"Edit collection",position:"right"})),G(d,"click",n[12]),G(y,"click",n[14]),G($,"click",n[15])],j=!0)},p(Y,K){(!E||K&4)&&u!==(u=Y[2].name+"")&&be(f,u);const Z={};K&1&&(Z.value=Y[0]),K&4&&(Z.autocompleteCollection=Y[2]),M.$set(Z);const ee={};K&4&&(ee.collection=Y[2]),!O&&K&1&&(O=!0,ee.filter=Y[0],Re(()=>O=!1)),!F&&K&2&&(F=!0,ee.sort=Y[1],Re(()=>F=!1)),L.$set(ee)},i(Y){E||(A(e.$$.fragment,Y),A(g.$$.fragment,Y),A(M.$$.fragment,Y),A(L.$$.fragment,Y),E=!0)},o(Y){P(e.$$.fragment,Y),P(g.$$.fragment,Y),P(M.$$.fragment,Y),P(L.$$.fragment,Y),E=!1},d(Y){V(e,Y),Y&&k(t),Y&&k(i),V(g),V(M),n[17](null),V(L),j=!1,lt(U)}}}function yM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(t,"class","icon"),h(s,"class","m-b-10"),h(o,"type","button"),h(o,"class","btn btn-expanded-lg btn-lg"),h(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:oe,i:oe,o:oe,d(u){u&&k(e),r=!1,a()}}}function kM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function wM(n){let e,t,i,s,l,o,r,a,u;const f=[kM,yM,vM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let p={};s=new Va({props:p}),n[21](s);let g={};o=new r4({props:g}),n[22](o);let v={collection:n[2]};return a=new h_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,[y]){let S=e;e=d(b),e===S?c[e].p(b,y):(Te(),P(c[S],1,1,()=>{c[S]=null}),De(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const C={};o.$set(C);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),V(s,b),b&&k(l),n[22](null),V(o,b),b&&k(r),n[23](null),V(a,b)}}}function SM(n,e,t){var te;let i,s,l,o;cn(n,ni,H=>t(2,s=H)),cn(n,Ss,H=>t(10,l=H)),cn(n,Xr,H=>t(8,o=H));const r=W.getQueryParams((te=window.location)==null?void 0:te.href);let a,u,f,c,d=r.filter||"",p=r.sort||"-created",g=r.collectionId;W.setDocumentTitle("Collections"),Rw(g);const v=()=>a==null?void 0:a.show(),b=()=>a==null?void 0:a.show(s),y=()=>c==null?void 0:c.load(),S=()=>u==null?void 0:u.show(s),$=()=>f==null?void 0:f.show(),C=H=>t(0,d=H.detail);function M(H){ge[H?"unshift":"push"](()=>{c=H,t(6,c)})}function D(H){d=H,t(0,d),t(2,s),t(9,g)}function L(H){p=H,t(1,p),t(2,s),t(9,g)}const O=H=>f==null?void 0:f.show(H==null?void 0:H.detail);function F(H){ge[H?"unshift":"push"](()=>{a=H,t(3,a)})}function E(H){ge[H?"unshift":"push"](()=>{u=H,t(4,u)})}function j(H){ge[H?"unshift":"push"](()=>{f=H,t(5,f)})}const U=()=>c==null?void 0:c.load(),Q=()=>c==null?void 0:c.load();return n.$$.update=()=>{n.$$.dirty&1024&&t(7,i=l.filter(H=>H.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&g!=s.id&&(t(9,g=s.id),t(1,p="-created"),t(0,d="")),n.$$.dirty&7&&(p||d||(s==null?void 0:s.id))&&W.replaceClientQueryParams({collectionId:s==null?void 0:s.id,filter:d,sort:p})},[d,p,s,a,u,f,c,i,o,g,l,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q]}class $M extends Ee{constructor(e){super(),Ae(this,e,SM,wM,Oe,{})}}function Kh(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[CM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function CM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","text"),h(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&h(e,"for",l),c[1]&1&&a!==(a=f[31])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Zh(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',h(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=tt(Mt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function MM(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Zh();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[31]),h(a,"type","email"),h(a,"autocomplete","off"),h(a,"id",u=n[31]),a.required=!0},m(p,g){w(p,e,g),m(e,t),m(e,i),m(e,s),w(p,o,g),d&&d.m(p,g),w(p,r,g),w(p,a,g),Ce(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(p,g){g[1]&1&&l!==(l=p[31])&&h(e,"for",l),p[1].verified?d||(d=Zh(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=p[31])&&h(a,"id",u),g[0]&4&&a.value!==p[2]&&Ce(a,p[2])},d(p){p&&k(e),p&&k(o),d&&d.d(p),p&&k(r),p&&k(a),f=!1,c()}}}function Jh(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[TM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&8|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[31]),h(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[20]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&h(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Gh(n){let e,t,i,s,l,o,r,a,u;return s=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[DM,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[OM,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&128|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&256|c[1]&3&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),Tt(()=>{a||(a=at(t,Xt,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),a||(a=at(t,Xt,{duration:150},!1)),a.run(0),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function DM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[7]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&h(e,"for",l),d[1]&1&&a!==(a=c[31])&&h(r,"id",a),d[0]&128&&r.value!==c[7]&&Ce(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function OM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[31]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[31]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[8]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&h(e,"for",l),d[1]&1&&a!==(a=c[31])&&h(r,"id",a),d[0]&256&&r.value!==c[8]&&Ce(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Xh(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[AM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&512|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function AM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Send verification email"),h(e,"type","checkbox"),h(e,"id",t=n[31]),h(s,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[9],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[23]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&h(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&1&&o!==(o=u[31])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function EM(n){let e,t,i,s,l,o,r,a,u,f=!n[1].isNew&&Kh(n);i=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[MM,({uniqueId:g})=>({31:g}),({uniqueId:g})=>[0,g?1:0]]},$$scope:{ctx:n}}});let c=!n[1].isNew&&Jh(n),d=(n[1].isNew||n[3])&&Gh(n),p=n[1].isNew&&Xh(n);return{c(){e=_("form"),f&&f.c(),t=T(),z(i.$$.fragment),s=T(),c&&c.c(),l=T(),d&&d.c(),o=T(),p&&p.c(),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m(g,v){w(g,e,v),f&&f.m(e,null),m(e,t),q(i,e,null),m(e,s),c&&c.m(e,null),m(e,l),d&&d.m(e,null),m(e,o),p&&p.m(e,null),r=!0,a||(u=G(e,"submit",Vt(n[12])),a=!0)},p(g,v){g[1].isNew?f&&(Te(),P(f,1,1,()=>{f=null}),De()):f?(f.p(g,v),v[0]&2&&A(f,1)):(f=Kh(g),f.c(),A(f,1),f.m(e,t));const b={};v[0]&6|v[1]&3&&(b.$$scope={dirty:v,ctx:g}),i.$set(b),g[1].isNew?c&&(Te(),P(c,1,1,()=>{c=null}),De()):c?(c.p(g,v),v[0]&2&&A(c,1)):(c=Jh(g),c.c(),A(c,1),c.m(e,l)),g[1].isNew||g[3]?d?(d.p(g,v),v[0]&10&&A(d,1)):(d=Gh(g),d.c(),A(d,1),d.m(e,o)):d&&(Te(),P(d,1,1,()=>{d=null}),De()),g[1].isNew?p?(p.p(g,v),v[0]&2&&A(p,1)):(p=Xh(g),p.c(),A(p,1),p.m(e,null)):p&&(Te(),P(p,1,1,()=>{p=null}),De())},i(g){r||(A(f),A(i.$$.fragment,g),A(c),A(d),A(p),r=!0)},o(g){P(f),P(i.$$.fragment,g),P(c),P(d),P(p),r=!1},d(g){g&&k(e),f&&f.d(),V(i),c&&c.d(),d&&d.d(),p&&p.d(),a=!1,u()}}}function PM(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=_("h4"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New user":"Edit user")&&be(i,t)},d(s){s&&k(e)}}}function Qh(n){let e,t,i,s,l,o,r,a,u;return o=new ss({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[LM]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),z(o.$$.fragment),r=T(),a=_("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary"),h(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),q(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[0]&2|c[1]&2&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),V(o),f&&k(r),f&&k(a)}}}function xh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-mail-check-line"></i>
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function LM(n){let e,t,i,s,l=!n[1].verified&&xh(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(t,"type","button"),h(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=xh(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function FM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&Qh(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[5],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],X(l,"btn-loading",n[5])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?p&&(Te(),P(p,1,1,()=>{p=null}),De()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=Qh(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&be(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&X(l,"btn-loading",g[5])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function IM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[FM],header:[PM],default:[EM]},$$scope:{ctx:n}};return e=new yi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),V(e,s)}}}function NM(n,e,t){let i;const s=rn(),l="user_"+W.randomString(5);let o,r=new uo,a=!1,u=!1,f="",c="",d="",p=!1,g=!0;function v(Z){return y(Z),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Z){Li({}),t(1,r=Z!=null&&Z.clone?Z.clone():new uo),S()}function S(){t(3,p=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function $(){if(a||!i)return;t(5,a=!0);const Z={email:f};(r.isNew||p)&&(Z.password=c,Z.passwordConfirm=d);let ee;r.isNew?ee=Se.Users.create(Z):ee=Se.Users.update(r.id,Z),ee.then(async ae=>{g&&M(!1),t(6,u=!1),b(),dn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",ae)}).catch(ae=>{Se.errorResponseHandler(ae)}).finally(()=>{t(5,a=!1)})}function C(){!(r!=null&&r.id)||_i("Do you really want to delete the selected user?",()=>Se.Users.delete(r.id).then(()=>{t(6,u=!1),b(),dn("Successfully deleted user."),s("delete",r)}).catch(Z=>{Se.errorResponseHandler(Z)}))}function M(Z=!0){return Se.Users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),Z&&dn(`Successfully sent verification email to ${r.email}.`)}).catch(ee=>{Se.errorResponseHandler(ee)})}const D=()=>M(),L=()=>C(),O=()=>b();function F(){f=this.value,t(2,f)}function E(){p=this.checked,t(3,p)}function j(){c=this.value,t(7,c)}function U(){d=this.value,t(8,d)}function Q(){g=this.checked,t(9,g)}const te=()=>i&&u?(_i("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function H(Z){ge[Z?"unshift":"push"](()=>{o=Z,t(4,o)})}function Y(Z){dt.call(this,n,Z)}function K(Z){dt.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||p||f!==r.email)},[b,r,f,p,o,a,u,c,d,g,i,l,$,C,M,v,D,L,O,F,E,j,U,Q,te,H,Y,K]}class RM extends Ee{constructor(e){super(),Ae(this,e,NM,IM,Oe,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function ep(n,e,t){const i=n.slice();return i[38]=e[t],i}function tp(n,e,t){const i=n.slice();return i[41]=e[t],i}function np(n,e,t){const i=n.slice();return i[41]=e[t],i}function HM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F=[],E=new Map,j,U,Q,te,H,Y,K,Z,ee,ae,ve=[],le=new Map,me,re,de,fe,ie;r=new jo({}),r.$on("refresh",n[16]),p=new Ho({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),p.$on("submit",n[18]);function x(pe){n[19](pe)}let ye={class:"col-type-text col-field-id",name:"id",$$slots:{default:[qM]},$$scope:{ctx:n}};n[4]!==void 0&&(ye.sort=n[4]),$=new xt({props:ye}),ge.push(()=>Ie($,"sort",x));function He(pe){n[20](pe)}let Le={class:"col-type-email col-field-email",name:"email",$$slots:{default:[VM]},$$scope:{ctx:n}};n[4]!==void 0&&(Le.sort=n[4]),D=new xt({props:Le}),ge.push(()=>Ie(D,"sort",He));let Pe=n[12];const ue=pe=>pe[41].name;for(let pe=0;pe<Pe.length;pe+=1){let Ve=np(n,Pe,pe),Ge=ue(Ve);E.set(Ge,F[pe]=ip(Ge,Ve))}function ce(pe){n[21](pe)}let ke={class:"col-type-date col-field-created",name:"created",$$slots:{default:[zM]},$$scope:{ctx:n}};n[4]!==void 0&&(ke.sort=n[4]),U=new xt({props:ke}),ge.push(()=>Ie(U,"sort",ce));function Be(pe){n[22](pe)}let Ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[BM]},$$scope:{ctx:n}};n[4]!==void 0&&(Ke.sort=n[4]),H=new xt({props:Ke}),ge.push(()=>Ie(H,"sort",Be));let Ue=n[1];const Je=pe=>pe[38].id;for(let pe=0;pe<Ue.length;pe+=1){let Ve=ep(n,Ue,pe),Ge=Je(Ve);le.set(Ge,ve[pe]=rp(Ge,Ve))}let xe=null;Ue.length||(xe=sp(n));let J=n[1].length&&ap(n),se=n[1].length&&n[13]&&up(n);return{c(){e=_("main"),t=_("header"),i=_("nav"),i.innerHTML='<div class="breadcrumb-item">Users</div>',s=T(),l=_("button"),l.innerHTML='<i class="ri-settings-4-line"></i>',o=T(),z(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New user</span>`,d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=_("table"),y=_("thead"),S=_("tr"),z($.$$.fragment),M=T(),z(D.$$.fragment),O=T();for(let pe=0;pe<F.length;pe+=1)F[pe].c();j=T(),z(U.$$.fragment),te=T(),z(H.$$.fragment),K=T(),Z=_("th"),ee=T(),ae=_("tbody");for(let pe=0;pe<ve.length;pe+=1)ve[pe].c();xe&&xe.c(),me=T(),J&&J.c(),re=T(),se&&se.c(),h(i,"class","breadcrumbs"),h(l,"type","button"),h(l,"class","btn btn-secondary btn-circle"),h(u,"class","flex-fill"),h(c,"type","button"),h(c,"class","btn btn-expanded"),h(t,"class","page-header"),h(Z,"class","col-type-action min-width"),h(b,"class","table"),X(b,"table-loading",n[10]),h(v,"class","table-wrapper"),h(e,"class","page-wrapper")},m(pe,Ve){w(pe,e,Ve),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),q(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),m(e,d),q(p,e,null),m(e,g),m(e,v),m(v,b),m(b,y),m(y,S),q($,S,null),m(S,M),q(D,S,null),m(S,O);for(let Ge=0;Ge<F.length;Ge+=1)F[Ge].m(S,null);m(S,j),q(U,S,null),m(S,te),q(H,S,null),m(S,K),m(S,Z),m(b,ee),m(b,ae);for(let Ge=0;Ge<ve.length;Ge+=1)ve[Ge].m(ae,null);xe&&xe.m(ae,null),m(e,me),J&&J.m(e,null),m(e,re),se&&se.m(e,null),de=!0,fe||(ie=[tt(Mt.call(null,l,{text:"Edit profile collection",position:"right"})),G(l,"click",n[15]),G(c,"click",n[17])],fe=!0)},p(pe,Ve){const Ge={};Ve[0]&8&&(Ge.value=pe[3]),p.$set(Ge);const bt={};Ve[1]&32768&&(bt.$$scope={dirty:Ve,ctx:pe}),!C&&Ve[0]&16&&(C=!0,bt.sort=pe[4],Re(()=>C=!1)),$.$set(bt);const rt={};Ve[1]&32768&&(rt.$$scope={dirty:Ve,ctx:pe}),!L&&Ve[0]&16&&(L=!0,rt.sort=pe[4],Re(()=>L=!1)),D.$set(rt),Ve[0]&4096&&(Pe=pe[12],F=ft(F,Ve,ue,1,pe,Pe,E,S,ln,ip,j,np));const ut={};Ve[1]&32768&&(ut.$$scope={dirty:Ve,ctx:pe}),!Q&&Ve[0]&16&&(Q=!0,ut.sort=pe[4],Re(()=>Q=!1)),U.$set(ut);const yt={};Ve[1]&32768&&(yt.$$scope={dirty:Ve,ctx:pe}),!Y&&Ve[0]&16&&(Y=!0,yt.sort=pe[4],Re(()=>Y=!1)),H.$set(yt),Ve[0]&5450&&(Ue=pe[1],Te(),ve=ft(ve,Ve,Je,1,pe,Ue,le,ae,Ft,rp,null,ep),De(),!Ue.length&&xe?xe.p(pe,Ve):Ue.length?xe&&(xe.d(1),xe=null):(xe=sp(pe),xe.c(),xe.m(ae,null))),Ve[0]&1024&&X(b,"table-loading",pe[10]),pe[1].length?J?J.p(pe,Ve):(J=ap(pe),J.c(),J.m(e,re)):J&&(J.d(1),J=null),pe[1].length&&pe[13]?se?se.p(pe,Ve):(se=up(pe),se.c(),se.m(e,null)):se&&(se.d(1),se=null)},i(pe){if(!de){A(r.$$.fragment,pe),A(p.$$.fragment,pe),A($.$$.fragment,pe),A(D.$$.fragment,pe),A(U.$$.fragment,pe),A(H.$$.fragment,pe);for(let Ve=0;Ve<Ue.length;Ve+=1)A(ve[Ve]);de=!0}},o(pe){P(r.$$.fragment,pe),P(p.$$.fragment,pe),P($.$$.fragment,pe),P(D.$$.fragment,pe),P(U.$$.fragment,pe),P(H.$$.fragment,pe);for(let Ve=0;Ve<ve.length;Ve+=1)P(ve[Ve]);de=!1},d(pe){pe&&k(e),V(r),V(p),V($),V(D);for(let Ve=0;Ve<F.length;Ve+=1)F[Ve].d();V(U),V(H);for(let Ve=0;Ve<ve.length;Ve+=1)ve[Ve].d();xe&&xe.d(),J&&J.d(),se&&se.d(),fe=!1,lt(ie)}}}function jM(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function qM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function VM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function ip(n,e){let t,i,s,l,o,r,a,u=e[41].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=R("profile."),f=R(u),h(s,"class",l=W.getFieldTypeIcon(e[41].type)),h(r,"class","txt"),h(i,"class","col-header-content"),h(t,"class",c="col-type-"+e[41].type+" col-field-"+e[41].name),h(t,"name",d=e[41].name),this.first=t},m(p,g){w(p,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(p,g){e=p,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[41].type))&&h(s,"class",l),g[0]&4096&&u!==(u=e[41].name+"")&&be(f,u),g[0]&4096&&c!==(c="col-type-"+e[41].type+" col-field-"+e[41].name)&&h(t,"class",c),g[0]&4096&&d!==(d=e[41].name)&&h(t,"name",d)},d(p){p&&k(t)}}}function zM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function BM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function sp(n){let e;function t(l,o){return l[10]?WM:UM}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function UM(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&lp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=lp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function WM(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function lp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[25]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function op(n,e){let t,i,s;return i=new p_({props:{field:e[41],record:e[38].profile||{}}}),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[41]),o[0]&2&&(r.record=e[38].profile||{}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function rp(n,e){let t,i,s,l,o,r,a,u=e[38].email+"",f,c,d,p,g=e[38].verified?"Verified":"Unverified",v,b,y=[],S=new Map,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K;s=new Wo({props:{id:e[38].id}});let Z=e[12];const ee=le=>le[41].name;for(let le=0;le<Z.length;le+=1){let me=tp(e,Z,le),re=ee(me);S.set(re,y[le]=op(re,me))}M=new gi({props:{date:e[38].created}}),O=new gi({props:{date:e[38].updated}});function ae(){return e[23](e[38])}function ve(){return e[24](e[38])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),z(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=R(u),d=T(),p=_("span"),v=R(g),b=T();for(let le=0;le<y.length;le+=1)y[le].c();$=T(),C=_("td"),z(M.$$.fragment),D=T(),L=_("td"),z(O.$$.fragment),F=T(),E=_("td"),j=_("button"),j.innerHTML=`<i class="ri-user-settings-line"></i>
<span class="txt">Edit user</span>`,U=T(),Q=_("button"),Q.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,te=T(),h(i,"class","col-type-text col-field-id"),h(a,"class","txt"),h(a,"title",c=e[38].email),h(p,"class","label"),X(p,"label-success",e[38].verified),X(p,"label-warning",!e[38].verified),h(r,"class","inline-flex"),h(o,"class","col-type-email col-field-email"),h(C,"class","col-type-date col-field-created"),h(L,"class","col-type-date col-field-updated"),h(j,"type","button"),h(j,"class","btn btn-sm btn-outline"),h(Q,"type","button"),h(Q,"class","btn btn-sm m-l-10"),h(E,"class","col-type-action min-width"),this.first=t},m(le,me){w(le,t,me),m(t,i),q(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,p),m(p,v),m(t,b);for(let re=0;re<y.length;re+=1)y[re].m(t,null);m(t,$),m(t,C),q(M,C,null),m(t,D),m(t,L),q(O,L,null),m(t,F),m(t,E),m(E,j),m(E,U),m(E,Q),m(t,te),H=!0,Y||(K=[G(j,"click",Hn(ae)),G(Q,"click",Hn(ve))],Y=!0)},p(le,me){e=le;const re={};me[0]&2&&(re.id=e[38].id),s.$set(re),(!H||me[0]&2)&&u!==(u=e[38].email+"")&&be(f,u),(!H||me[0]&2&&c!==(c=e[38].email))&&h(a,"title",c),(!H||me[0]&2)&&g!==(g=e[38].verified?"Verified":"Unverified")&&be(v,g),me[0]&2&&X(p,"label-success",e[38].verified),me[0]&2&&X(p,"label-warning",!e[38].verified),me[0]&4098&&(Z=e[12],Te(),y=ft(y,me,ee,1,e,Z,S,t,Ft,op,$,tp),De());const de={};me[0]&2&&(de.date=e[38].created),M.$set(de);const fe={};me[0]&2&&(fe.date=e[38].updated),O.$set(fe)},i(le){if(!H){A(s.$$.fragment,le);for(let me=0;me<Z.length;me+=1)A(y[me]);A(M.$$.fragment,le),A(O.$$.fragment,le),H=!0}},o(le){P(s.$$.fragment,le);for(let me=0;me<y.length;me+=1)P(y[me]);P(M.$$.fragment,le),P(O.$$.fragment,le),H=!1},d(le){le&&k(t),V(s);for(let me=0;me<y.length;me+=1)y[me].d();V(M),V(O),Y=!1,lt(K)}}}function ap(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),o=R(n[2]),h(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),m(e,t),m(e,s),m(e,l),m(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&be(s,i),a[0]&4&&be(o,r[2])},d(r){r&&k(e)}}}function up(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=R("Load more ("),o=R(l),r=R(")"),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-lg btn-secondary btn-expanded"),X(t,"btn-loading",n[10]),X(t,"btn-disabled",n[10]),h(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(i,s),m(i,o),m(i,r),a||(u=G(t,"click",n[26]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&be(o,l),c[0]&1024&&X(t,"btn-loading",f[10]),c[0]&1024&&X(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function YM(n){let e,t,i,s,l,o,r,a,u;const f=[jM,HM],c=[];function d(b,y){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let p={};s=new RM({props:p}),n[27](s),s.$on("save",n[28]),s.$on("delete",n[29]);let g={};o=new Va({props:g}),n[30](o),o.$on("save",n[31]);let v={collection:n[5]};return a=new h_({props:v}),n[32](a),a.$on("save",n[33]),{c(){t.c(),i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),q(s,b,y),w(b,l,y),q(o,b,y),w(b,r,y),q(a,b,y),u=!0},p(b,y){let S=e;e=d(b),e===S?c[e].p(b,y):(Te(),P(c[S],1,1,()=>{c[S]=null}),De(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const $={};s.$set($);const C={};o.$set(C);const M={};y[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[27](null),V(s,b),b&&k(l),n[30](null),V(o,b),b&&k(r),n[32](null),V(a,b)}}}function KM(n,e,t){var de;let i,s;const l=W.getQueryParams((de=window.location)==null?void 0:de.href),o=["id","userId","created","updated"];let r,a,u,f=[],c=1,d=0,p=!1,g=l.filter||"",v=l.sort||"-created",b=new On,y=!1;W.setDocumentTitle("Users"),M();async function S(fe=1){return t(10,p=!0),fe<=1&&$(),Se.Users.getList(fe,50,{sort:v||"-created",filter:g}).then(ie=>{t(10,p=!1),t(1,f=f.concat(ie.items)),t(9,c=ie.page),t(2,d=ie.totalItems)}).catch(ie=>{ie!=null&&ie.isAbort||(t(10,p=!1),console.warn(ie),$(),Se.errorResponseHandler(ie,!1))})}function $(){t(1,f=[]),t(9,c=1),t(2,d=0)}function C(fe){const ie=f.find(x=>x.id===(fe==null?void 0:fe.userId));ie&&(ie.profile=fe),t(1,f)}async function M(){t(11,y=!0);try{t(5,b=await Se.Collections.getOne("profiles"))}catch(fe){Se.errorResponseHandler(fe)}t(11,y=!1)}const D=()=>a==null?void 0:a.show(b),L=()=>S(),O=()=>r==null?void 0:r.show(),F=fe=>t(3,g=fe.detail);function E(fe){v=fe,t(4,v)}function j(fe){v=fe,t(4,v)}function U(fe){v=fe,t(4,v)}function Q(fe){v=fe,t(4,v)}const te=fe=>r==null?void 0:r.show(fe),H=fe=>u==null?void 0:u.show(fe.profile),Y=()=>t(3,g=""),K=()=>S(c+1);function Z(fe){ge[fe?"unshift":"push"](()=>{r=fe,t(6,r)})}const ee=()=>S(),ae=()=>S();function ve(fe){ge[fe?"unshift":"push"](()=>{a=fe,t(7,a)})}const le=fe=>t(5,b=fe.detail);function me(fe){ge[fe?"unshift":"push"](()=>{u=fe,t(8,u)})}const re=fe=>C(fe.detail);return n.$$.update=()=>{var fe;n.$$.dirty[0]&24&&v!==-1&&g!==-1&&(W.replaceClientQueryParams({filter:g,sort:v}),S()),n.$$.dirty[0]&6&&t(13,i=d>f.length),n.$$.dirty[0]&32&&t(12,s=(fe=b==null?void 0:b.schema)==null?void 0:fe.filter(ie=>!o.includes(ie.name)))},[S,f,d,g,v,b,r,a,u,c,p,y,s,i,C,D,L,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae,ve,le,me,re]}class ZM extends Ee{constructor(e){super(),Ae(this,e,KM,YM,Oe,{loadUsers:0},null,[-1,-1])}get loadUsers(){return this.$$.ctx[0]}}function JM(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$;return{c(){e=_("aside"),t=_("div"),i=_("div"),i.textContent="System",s=T(),l=_("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=T(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=T(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=T(),c=_("div"),c.textContent="Authentication",d=T(),p=_("a"),p.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,b=T(),y=_("a"),y.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(c,"class","sidebar-title"),h(p,"href","/settings/auth-providers"),h(p,"class","sidebar-list-item"),h(v,"href","/settings/tokens"),h(v,"class","sidebar-list-item"),h(y,"href","/settings/admins"),h(y,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(C,M){w(C,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(t,o),m(t,r),m(t,a),m(t,u),m(t,f),m(t,c),m(t,d),m(t,p),m(t,g),m(t,v),m(t,b),m(t,y),S||($=[tt(xn.call(null,l,{path:"/settings"})),tt(wn.call(null,l)),tt(xn.call(null,r,{path:"/settings/mail/?.*"})),tt(wn.call(null,r)),tt(xn.call(null,u,{path:"/settings/storage/?.*"})),tt(wn.call(null,u)),tt(xn.call(null,p,{path:"/settings/auth-providers/?.*"})),tt(wn.call(null,p)),tt(xn.call(null,v,{path:"/settings/tokens/?.*"})),tt(wn.call(null,v)),tt(xn.call(null,y,{path:"/settings/admins/?.*"})),tt(wn.call(null,y))],S=!0)},p:oe,i:oe,o:oe,d(C){C&&k(e),S=!1,lt($)}}}class Os extends Ee{constructor(e){super(),Ae(this,e,null,JM,Oe,{})}}function fp(n,e,t){const i=n.slice();return i[31]=e[t],i}function cp(n){let e,t;return e=new Fe({props:{class:"form-field disabled",name:"id",$$slots:{default:[GM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GM(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","text"),h(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&h(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&h(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function dp(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=T(),Jn(t.src,i="/_/images/avatars/avatar"+n[31]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[31]),h(e,"tabindex","0"),h(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),m(e,t),m(e,s),o||(r=[G(e,"click",a),G(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(f){f&&k(e),o=!1,lt(r)}}}function XM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),r=_("input"),h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[3]),u||(f=G(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&8&&r.value!==c[3]&&Ce(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function hp(n){let e,t;return e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[QM,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function QM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[30]),h(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function pp(n){let e,t,i,s,l,o,r,a,u;return s=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[xM,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Fe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[eT,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),z(s.$$.fragment),l=T(),o=_("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),q(s,i,null),m(t,l),m(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742080|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&1073742336|c[1]&8&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),Tt(()=>{a||(a=at(t,Xt,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),a||(a=at(t,Xt,{duration:150},!1)),a.run(0),u=!1},d(f){f&&k(e),V(s),V(r),f&&a&&a.end()}}}function xM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[8]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&256&&r.value!==c[8]&&Ce(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function eT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Password confirm",o=T(),r=_("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[30]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),m(e,t),m(e,i),m(e,s),w(c,o,d),w(c,r,d),Ce(r,n[9]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&h(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&h(r,"id",a),d[0]&512&&r.value!==c[9]&&Ce(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function tT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g=!n[1].isNew&&cp(n),v=[0,1,2,3,4,5,6,7,8,9],b=[];for(let $=0;$<10;$+=1)b[$]=dp(fp(n,v,$));a=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[XM,({uniqueId:$})=>({30:$}),({uniqueId:$})=>[$?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&hp(n),S=(n[1].isNew||n[4])&&pp(n);return{c(){e=_("form"),g&&g.c(),t=T(),i=_("div"),s=_("p"),s.textContent="Avatar",l=T(),o=_("div");for(let $=0;$<10;$+=1)b[$].c();r=T(),z(a.$$.fragment),u=T(),y&&y.c(),f=T(),S&&S.c(),h(s,"class","section-title"),h(o,"class","flex flex-gap-xs flex-wrap"),h(i,"class","content"),h(e,"id",n[11]),h(e,"class","grid"),h(e,"autocomplete","off")},m($,C){w($,e,C),g&&g.m(e,null),m(e,t),m(e,i),m(i,s),m(i,l),m(i,o);for(let M=0;M<10;M+=1)b[M].m(o,null);m(e,r),q(a,e,null),m(e,u),y&&y.m(e,null),m(e,f),S&&S.m(e,null),c=!0,d||(p=G(e,"submit",Vt(n[12])),d=!0)},p($,C){if($[1].isNew?g&&(Te(),P(g,1,1,()=>{g=null}),De()):g?(g.p($,C),C[0]&2&&A(g,1)):(g=cp($),g.c(),A(g,1),g.m(e,t)),C[0]&4){v=[0,1,2,3,4,5,6,7,8,9];let D;for(D=0;D<10;D+=1){const L=fp($,v,D);b[D]?b[D].p(L,C):(b[D]=dp(L),b[D].c(),b[D].m(o,null))}for(;D<10;D+=1)b[D].d(1)}const M={};C[0]&1073741832|C[1]&8&&(M.$$scope={dirty:C,ctx:$}),a.$set(M),$[1].isNew?y&&(Te(),P(y,1,1,()=>{y=null}),De()):y?(y.p($,C),C[0]&2&&A(y,1)):(y=hp($),y.c(),A(y,1),y.m(e,f)),$[1].isNew||$[4]?S?(S.p($,C),C[0]&18&&A(S,1)):(S=pp($),S.c(),A(S,1),S.m(e,null)):S&&(Te(),P(S,1,1,()=>{S=null}),De())},i($){c||(A(g),A(a.$$.fragment,$),A(y),A(S),c=!0)},o($){P(g),P(a.$$.fragment,$),P(y),P(S),c=!1},d($){$&&k(e),g&&g.d(),Rn(b,$),V(a),y&&y.d(),S&&S.d(),d=!1,p()}}}function nT(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=_("h4"),i=R(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&2&&t!==(t=s[1].isNew?"New admin":"Edit admin")&&be(i,t)},d(s){s&&k(e)}}}function mp(n){let e,t,i,s,l,o,r,a,u;return o=new ss({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[iT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),z(o.$$.fragment),r=T(),a=_("div"),h(s,"class","ri-more-line"),h(e,"type","button"),h(e,"class","btn btn-sm btn-circle btn-secondary"),h(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),q(o,e,null),w(f,r,c),w(f,a,c),u=!0},p(f,c){const d={};c[1]&8&&(d.$$scope={dirty:c,ctx:f}),o.$set(d)},i(f){u||(A(o.$$.fragment,f),u=!0)},o(f){P(o.$$.fragment,f),u=!1},d(f){f&&k(e),V(o),f&&k(r),f&&k(a)}}}function iT(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[15]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function sT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&mp(n);return{c(){p&&p.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=R(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-secondary"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],X(l,"btn-loading",n[6])},m(g,v){p&&p.m(g,v),w(g,e,v),w(g,t,v),m(t,i),w(g,s,v),w(g,l,v),m(l,o),m(o,a),f=!0,c||(d=G(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?p&&(Te(),P(p,1,1,()=>{p=null}),De()):p?(p.p(g,v),v[0]&2&&A(p,1)):(p=mp(g),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&be(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&X(l,"btn-loading",g[6])},i(g){f||(A(p),f=!0)},o(g){P(p),f=!1},d(g){p&&p.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function lT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[sT],header:[nT],default:[tT]},$$scope:{ctx:n}};return e=new yi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){z(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),V(e,s)}}}function oT(n,e,t){let i;const s=rn(),l="admin_"+W.randomString(5);let o,r=new vs,a=!1,u=!1,f=0,c="",d="",p="",g=!1;function v(K){return y(K),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(K){Li({}),t(1,r=K!=null&&K.clone?K.clone():new vs),S()}function S(){t(4,g=!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="")}function $(){if(a||!i)return;t(6,a=!0);const K={email:c,avatar:f};(r.isNew||g)&&(K.password=d,K.passwordConfirm=p);let Z;r.isNew?Z=Se.Admins.create(K):Z=Se.Admins.update(r.id,K),Z.then(async ee=>{var ae;t(7,u=!1),b(),dn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ee),((ae=Se.AuthStore.model)==null?void 0:ae.id)===ee.id&&Se.AuthStore.save(Se.AuthStore.token,ee)}).catch(ee=>{Se.errorResponseHandler(ee)}).finally(()=>{t(6,a=!1)})}function C(){!(r!=null&&r.id)||_i("Do you really want to delete the selected admin?",()=>Se.Admins.delete(r.id).then(()=>{t(7,u=!1),b(),dn("Successfully deleted admin."),s("delete",r)}).catch(K=>{Se.errorResponseHandler(K)}))}const M=()=>C(),D=()=>b(),L=K=>t(2,f=K),O=(K,Z)=>{(Z.code==="Enter"||Z.code==="Space")&&(Z.preventDefault(),t(2,f=K))};function F(){c=this.value,t(3,c)}function E(){g=this.checked,t(4,g)}function j(){d=this.value,t(8,d)}function U(){p=this.value,t(9,p)}const Q=()=>i&&u?(_i("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function te(K){ge[K?"unshift":"push"](()=>{o=K,t(5,o)})}function H(K){dt.call(this,n,K)}function Y(K){dt.call(this,n,K)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,p,i,l,$,C,v,M,D,L,O,F,E,j,U,Q,te,H,Y]}class rT extends Ee{constructor(e){super(),Ae(this,e,oT,lT,Oe,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function gp(n,e,t){const i=n.slice();return i[22]=e[t],i}function aT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",h(t,"class",W.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function uT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",h(t,"class",W.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function fT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function cT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",h(t,"class",W.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){w(l,e,o),m(e,t),m(e,i),m(e,s)},p:oe,d(l){l&&k(e)}}}function _p(n){let e;function t(l,o){return l[5]?hT:dT}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function dT(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&bp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=T(),o&&o.c(),l=T(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),m(e,t),m(t,i),m(t,s),o&&o.m(t,null),m(e,l)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=bp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function hT(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function bp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function vp(n){let e;return{c(){e=_("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yp(n,e){let t,i,s,l,o,r,a,u,f,c,d,p,g=e[22].email+"",v,b,y,S,$,C,M,D,L,O,F,E,j,U;u=new Wo({props:{id:e[22].id}});let Q=e[22].id===e[6].id&&vp();$=new gi({props:{date:e[22].created}}),D=new gi({props:{date:e[22].updated}});function te(){return e[14](e[22])}function H(...Y){return e[15](e[22],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),z(u.$$.fragment),f=T(),Q&&Q.c(),c=T(),d=_("td"),p=_("span"),v=R(g),y=T(),S=_("td"),z($.$$.fragment),C=T(),M=_("td"),z(D.$$.fragment),L=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',F=T(),Jn(l.src,o="/_/images/avatars/avatar"+(e[22].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(a,"class","col-type-text col-field-id"),h(p,"class","txt txt-ellipsis"),h(p,"title",b=e[22].email),h(d,"class","col-type-email col-field-email"),h(S,"class","col-type-date col-field-created"),h(M,"class","col-type-date col-field-updated"),h(O,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Y,K){w(Y,t,K),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),q(u,a,null),m(a,f),Q&&Q.m(a,null),m(t,c),m(t,d),m(d,p),m(p,v),m(t,y),m(t,S),q($,S,null),m(t,C),m(t,M),q(D,M,null),m(t,L),m(t,O),m(t,F),E=!0,j||(U=[G(t,"click",te),G(t,"keydown",H)],j=!0)},p(Y,K){e=Y,(!E||K&16&&!Jn(l.src,o="/_/images/avatars/avatar"+(e[22].avatar||0)+".svg"))&&h(l,"src",o);const Z={};K&16&&(Z.id=e[22].id),u.$set(Z),e[22].id===e[6].id?Q||(Q=vp(),Q.c(),Q.m(a,null)):Q&&(Q.d(1),Q=null),(!E||K&16)&&g!==(g=e[22].email+"")&&be(v,g),(!E||K&16&&b!==(b=e[22].email))&&h(p,"title",b);const ee={};K&16&&(ee.date=e[22].created),$.$set(ee);const ae={};K&16&&(ae.date=e[22].updated),D.$set(ae)},i(Y){E||(A(u.$$.fragment,Y),A($.$$.fragment,Y),A(D.$$.fragment,Y),E=!0)},o(Y){P(u.$$.fragment,Y),P($.$$.fragment,Y),P(D.$$.fragment,Y),E=!1},d(Y){Y&&k(t),V(u),Q&&Q.d(),V($),V(D),j=!1,lt(U)}}}function kp(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=R("Showing "),s=R(i),l=R(" of "),r=R(o),h(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),m(e,t),m(e,s),m(e,l),m(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&be(s,i),u&16&&o!==(o=a[4].length+"")&&be(r,o)},d(a){a&&k(e)}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q,te,H,Y,K,Z,ee,ae=[],ve=new Map,le,me,re,de,fe,ie;e=new Os({}),r=new jo({}),r.$on("refresh",n[7]),p=new Ho({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),p.$on("submit",n[9]);function x(J){n[10](J)}let ye={class:"col-type-text",name:"id",$$slots:{default:[aT]},$$scope:{ctx:n}};n[2]!==void 0&&(ye.sort=n[2]),M=new xt({props:ye}),ge.push(()=>Ie(M,"sort",x));function He(J){n[11](J)}let Le={class:"col-type-email col-field-email",name:"email",$$slots:{default:[uT]},$$scope:{ctx:n}};n[2]!==void 0&&(Le.sort=n[2]),O=new xt({props:Le}),ge.push(()=>Ie(O,"sort",He));function Pe(J){n[12](J)}let ue={class:"col-type-date col-field-created",name:"created",$$slots:{default:[fT]},$$scope:{ctx:n}};n[2]!==void 0&&(ue.sort=n[2]),j=new xt({props:ue}),ge.push(()=>Ie(j,"sort",Pe));function ce(J){n[13](J)}let ke={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[cT]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),te=new xt({props:ke}),ge.push(()=>Ie(te,"sort",ce));let Be=n[4];const Ke=J=>J[22].id;for(let J=0;J<Be.length;J+=1){let se=gp(n,Be,J),pe=Ke(se);ve.set(pe,ae[J]=yp(pe,se))}let Ue=null;Be.length||(Ue=_p(n));let Je=n[4].length&&kp(n),xe={};return re=new rT({props:xe}),n[17](re),re.$on("save",n[18]),re.$on("delete",n[19]),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),l.innerHTML=`<div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Admins</div>`,o=T(),z(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New admin</span>`,d=T(),z(p.$$.fragment),g=T(),v=_("div"),b=_("table"),y=_("thead"),S=_("tr"),$=_("th"),C=T(),z(M.$$.fragment),L=T(),z(O.$$.fragment),E=T(),z(j.$$.fragment),Q=T(),z(te.$$.fragment),Y=T(),K=_("th"),Z=T(),ee=_("tbody");for(let J=0;J<ae.length;J+=1)ae[J].c();Ue&&Ue.c(),le=T(),Je&&Je.c(),me=T(),z(re.$$.fragment),h(l,"class","breadcrumbs"),h(u,"class","flex-fill"),h(c,"type","button"),h(c,"class","btn btn-expanded"),h(s,"class","page-header"),h($,"class","min-width"),h(K,"class","col-type-action min-width"),h(b,"class","table"),X(b,"table-loading",n[5]),h(v,"class","table-wrapper"),h(i,"class","page-wrapper")},m(J,se){q(e,J,se),w(J,t,se),w(J,i,se),m(i,s),m(s,l),m(s,o),q(r,s,null),m(s,a),m(s,u),m(s,f),m(s,c),m(i,d),q(p,i,null),m(i,g),m(i,v),m(v,b),m(b,y),m(y,S),m(S,$),m(S,C),q(M,S,null),m(S,L),q(O,S,null),m(S,E),q(j,S,null),m(S,Q),q(te,S,null),m(S,Y),m(S,K),m(b,Z),m(b,ee);for(let pe=0;pe<ae.length;pe+=1)ae[pe].m(ee,null);Ue&&Ue.m(ee,null),m(i,le),Je&&Je.m(i,null),w(J,me,se),q(re,J,se),de=!0,fe||(ie=G(c,"click",n[8]),fe=!0)},p(J,[se]){const pe={};se&2&&(pe.value=J[1]),p.$set(pe);const Ve={};se&33554432&&(Ve.$$scope={dirty:se,ctx:J}),!D&&se&4&&(D=!0,Ve.sort=J[2],Re(()=>D=!1)),M.$set(Ve);const Ge={};se&33554432&&(Ge.$$scope={dirty:se,ctx:J}),!F&&se&4&&(F=!0,Ge.sort=J[2],Re(()=>F=!1)),O.$set(Ge);const bt={};se&33554432&&(bt.$$scope={dirty:se,ctx:J}),!U&&se&4&&(U=!0,bt.sort=J[2],Re(()=>U=!1)),j.$set(bt);const rt={};se&33554432&&(rt.$$scope={dirty:se,ctx:J}),!H&&se&4&&(H=!0,rt.sort=J[2],Re(()=>H=!1)),te.$set(rt),se&122&&(Be=J[4],Te(),ae=ft(ae,se,Ke,1,J,Be,ve,ee,Ft,yp,null,gp),De(),!Be.length&&Ue?Ue.p(J,se):Be.length?Ue&&(Ue.d(1),Ue=null):(Ue=_p(J),Ue.c(),Ue.m(ee,null))),se&32&&X(b,"table-loading",J[5]),J[4].length?Je?Je.p(J,se):(Je=kp(J),Je.c(),Je.m(i,null)):Je&&(Je.d(1),Je=null);const ut={};re.$set(ut)},i(J){if(!de){A(e.$$.fragment,J),A(r.$$.fragment,J),A(p.$$.fragment,J),A(M.$$.fragment,J),A(O.$$.fragment,J),A(j.$$.fragment,J),A(te.$$.fragment,J);for(let se=0;se<Be.length;se+=1)A(ae[se]);A(re.$$.fragment,J),de=!0}},o(J){P(e.$$.fragment,J),P(r.$$.fragment,J),P(p.$$.fragment,J),P(M.$$.fragment,J),P(O.$$.fragment,J),P(j.$$.fragment,J),P(te.$$.fragment,J);for(let se=0;se<ae.length;se+=1)P(ae[se]);P(re.$$.fragment,J),de=!1},d(J){V(e,J),J&&k(t),J&&k(i),V(r),V(p),V(M),V(O),V(j),V(te);for(let se=0;se<ae.length;se+=1)ae[se].d();Ue&&Ue.d(),Je&&Je.d(),J&&k(me),n[17](null),V(re,J),fe=!1,ie()}}}function mT(n,e,t){var F;let i;cn(n,ma,E=>t(6,i=E));const s=W.getQueryParams((F=window.location)==null?void 0:F.href);let l,o=[],r=!1,a=s.filter||"",u=s.sort||"-created";W.setDocumentTitle("Admins");function f(){return t(5,r=!0),t(4,o=[]),Se.Admins.getFullList(100,{sort:u||"-created",filter:a}).then(E=>{t(4,o=E),t(5,r=!1)}).catch(E=>{E!=null&&E.isAbort||(t(5,r=!1),console.warn(E),c(),Se.errorResponseHandler(E,!1))})}function c(){t(4,o=[])}const d=()=>f(),p=()=>l==null?void 0:l.show(),g=E=>t(1,a=E.detail);function v(E){u=E,t(2,u)}function b(E){u=E,t(2,u)}function y(E){u=E,t(2,u)}function S(E){u=E,t(2,u)}const $=E=>l==null?void 0:l.show(E),C=(E,j)=>{(j.code==="Enter"||j.code==="Space")&&(j.preventDefault(),l==null||l.show(E))},M=()=>t(1,a="");function D(E){ge[E?"unshift":"push"](()=>{l=E,t(3,l)})}const L=()=>f(),O=()=>f();return n.$$.update=()=>{n.$$.dirty&6&&u!==-1&&a!==-1&&(W.replaceClientQueryParams({filter:a,sort:u}),f())},[f,a,u,l,o,r,i,d,p,g,v,b,y,S,$,C,M,D,L,O]}class gT extends Ee{constructor(e){super(),Ae(this,e,mT,pT,Oe,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Email"),s=T(),l=_("input"),h(e,"for",i=n[7]),h(l,"type","email"),h(l,"id",o=n[7]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=G(l,"input",n[4]),r=!0)},p(u,f){f&128&&i!==(i=u[7])&&h(e,"for",i),f&128&&o!==(o=u[7])&&h(l,"id",o),f&1&&l.value!==u[0]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=R("Password"),s=T(),l=_("input"),r=T(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",h(e,"for",i=n[7]),h(l,"type","password"),h(l,"id",o=n[7]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(d,p){w(d,e,p),m(e,t),w(d,s,p),w(d,l,p),Ce(l,n[1]),w(d,r,p),w(d,a,p),m(a,u),f||(c=[G(l,"input",n[5]),tt(wn.call(null,u))],f=!0)},p(d,p){p&128&&i!==(i=d[7])&&h(e,"for",i),p&128&&o!==(o=d[7])&&h(l,"id",o),p&2&&l.value!==d[1]&&Ce(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,lt(c)}}}function vT(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new Fe({props:{class:"form-field required",name:"email",$$slots:{default:[_T,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"password",$$slots:{default:[bT,({uniqueId:d})=>({7:d}),({uniqueId:d})=>d?128:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=T(),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),a=_("button"),a.innerHTML=`<span class="txt">Login</span>
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),X(a,"btn-disabled",n[2]),X(a,"btn-loading",n[2]),h(e,"class","block")},m(d,p){w(d,e,p),m(e,t),m(e,i),q(s,e,null),m(e,l),q(o,e,null),m(e,r),m(e,a),u=!0,f||(c=G(e,"submit",Vt(n[3])),f=!0)},p(d,p){const g={};p&385&&(g.$$scope={dirty:p,ctx:d}),s.$set(g);const v={};p&386&&(v.$$scope={dirty:p,ctx:d}),o.$set(v),p&4&&X(a,"btn-disabled",d[2]),p&4&&X(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&k(e),V(s),V(o),f=!1,c()}}}function yT(n){let e,t;return e=new ag({props:{$$slots:{default:[vT]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&263&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function kT(n,e,t){var f;const i=W.getQueryParams((f=window.location)==null?void 0:f.href);let s=i.demoEmail||"",l=i.demoPassword||"",o=!1;function r(){if(!o)return t(2,o=!0),Se.Admins.authViaEmail(s,l).then(()=>{$s("/")}).catch(()=>{ig("Invalid login credentials.")}).finally(()=>{t(2,o=!1)})}function a(){s=this.value,t(0,s)}function u(){l=this.value,t(1,l)}return[s,l,o,r,a,u]}class wT extends Ee{constructor(e){super(),Ae(this,e,kT,yT,Oe,{})}}function ST(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S;return i=new Fe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[CT,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[MT,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[TT,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),p=_("button"),g=_("span"),g.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(c,"class","flex-fill"),h(g,"class","txt"),h(p,"type","submit"),h(p,"class","btn btn-expanded"),p.disabled=v=!n[3]||n[2],X(p,"btn-loading",n[2]),h(f,"class","col-lg-12 flex"),h(e,"class","grid")},m($,C){w($,e,C),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),m(f,p),m(p,g),b=!0,y||(S=G(p,"click",n[9]),y=!0)},p($,C){const M={};C&12289&&(M.$$scope={dirty:C,ctx:$}),i.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const L={};C&12289&&(L.$$scope={dirty:C,ctx:$}),a.$set(L),(!b||C&12&&v!==(v=!$[3]||$[2]))&&(p.disabled=v),C&4&&X(p,"btn-loading",$[2])},i($){b||(A(i.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),b=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(a.$$.fragment,$),b=!1},d($){$&&k(e),V(i),V(o),V(a),y=!1,S()}}}function $T(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function CT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application name"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","text"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appName),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Ce(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function MT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Application url"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","text"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.appUrl),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Ce(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Logs max days retention"),s=T(),l=_("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].logs.maxDays),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].logs.maxDays&&Ce(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function DT(n){let e,t,i,s,l,o,r,a,u,f,c,d;e=new Os({});const p=[$T,ST],g=[];function v(b,y){return b[1]?0:1}return a=v(n),u=g[a]=p[a](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Application</div></nav>`,l=T(),o=_("div"),r=_("form"),u.c(),h(s,"class","page-header"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(b,y){q(e,b,y),w(b,t,y),w(b,i,y),m(i,s),m(i,l),m(i,o),m(o,r),g[a].m(r,null),f=!0,c||(d=G(r,"submit",Vt(n[4])),c=!0)},p(b,[y]){let S=a;a=v(b),a===S?g[a].p(b,y):(Te(),P(g[S],1,1,()=>{g[S]=null}),De(),u=g[a],u?u.p(b,y):(u=g[a]=p[a](b),u.c()),A(u,1),u.m(r,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){P(e.$$.fragment,b),P(u),f=!1},d(b){V(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function OT(n,e,t){let i,s={},l=!1,o=!1,r="";W.setDocumentTitle("Application settings"),a();async function a(){t(1,l=!0);try{const v=await Se.Settings.getAll()||{};f(v)}catch(v){Se.errorResponseHandler(v)}t(1,l=!1)}async function u(){if(!(o||!i)){t(2,o=!0);try{const v=await Se.Settings.update(W.filterRedactedProps(s));f(v),dn("Successfully saved application settings.")}catch(v){Se.errorResponseHandler(v)}t(2,o=!1)}}function f(v={}){t(0,s={meta:(v==null?void 0:v.meta)||{},logs:(v==null?void 0:v.logs)||{}}),t(5,r=JSON.stringify(s))}function c(){s.meta.appName=this.value,t(0,s)}function d(){s.meta.appUrl=this.value,t(0,s)}function p(){s.logs.maxDays=Dt(this.value),t(0,s)}const g=()=>u();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=r!=JSON.stringify(s))},[s,l,o,i,u,r,c,d,p,g]}class AT extends Ee{constructor(e){super(),Ae(this,e,OT,DT,Oe,{})}}function ET(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ht(l,s[o]);return{c(){e=_("input"),ii(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Ce(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){ii(e,l=hn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Ce(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function PT(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=ht(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),h(t,"type","button"),h(t,"class","btn btn-secondary btn-circle"),h(e,"class","form-field-addon"),ii(s,a)},m(u,f){w(u,e,f),m(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[tt(Mt.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){ii(s,a=hn(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,lt(o)}}}function LT(n){let e;function t(l,o){return l[3]?PT:ET}let i=t(n),s=i(n);return{c(){s.c(),e=ot()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:oe,o:oe,d(l){s.d(l),l&&k(e)}}}function FT(n,e,t){const i=["value","mask"];let s=Wt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await li(),r==null||r.focus()}const f=()=>u();function c(p){ge[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=ht(ht({},e),si(p)),t(5,s=Wt(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class za extends Ee{constructor(e){super(),Ae(this,e,FT,LT,Oe,{value:0,mask:1})}}function IT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F,E,j,U,Q;i=new Fe({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[RT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[HT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[jT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),f=new Fe({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[qT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"meta.userConfirmEmailChangeUrl",$$slots:{default:[VT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}}),S=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[zT,({uniqueId:H})=>({22:H}),({uniqueId:H})=>H?4194304:0]},$$scope:{ctx:n}}});let te=n[0].smtp.enabled&&wp(n);return{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),z(a.$$.fragment),u=T(),z(f.$$.fragment),c=T(),z(d.$$.fragment),p=T(),g=_("hr"),v=T(),b=_("div"),b.innerHTML=`<p>By default PocketBase uses the OS <code>sendmail</code> command for sending emails.
<br/>
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
below.</strong></p>`,y=T(),z(S.$$.fragment),$=T(),te&&te.c(),C=T(),M=_("div"),D=_("div"),L=T(),O=_("button"),F=_("span"),F.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid"),h(b,"class","content m-b-sm"),h(D,"class","flex-fill"),h(F,"class","txt"),h(O,"type","submit"),h(O,"class","btn btn-expanded"),O.disabled=E=!n[3]||n[2],X(O,"btn-loading",n[2]),h(M,"class","flex")},m(H,Y){w(H,e,Y),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),q(a,e,null),m(e,u),q(f,e,null),m(e,c),q(d,e,null),w(H,p,Y),w(H,g,Y),w(H,v,Y),w(H,b,Y),w(H,y,Y),q(S,H,Y),w(H,$,Y),te&&te.m(H,Y),w(H,C,Y),w(H,M,Y),m(M,D),m(M,L),m(M,O),m(O,F),j=!0,U||(Q=G(O,"click",n[18]),U=!0)},p(H,Y){const K={};Y&12582913&&(K.$$scope={dirty:Y,ctx:H}),i.$set(K);const Z={};Y&12582913&&(Z.$$scope={dirty:Y,ctx:H}),o.$set(Z);const ee={};Y&12582913&&(ee.$$scope={dirty:Y,ctx:H}),a.$set(ee);const ae={};Y&12582913&&(ae.$$scope={dirty:Y,ctx:H}),f.$set(ae);const ve={};Y&12582913&&(ve.$$scope={dirty:Y,ctx:H}),d.$set(ve);const le={};Y&12582913&&(le.$$scope={dirty:Y,ctx:H}),S.$set(le),H[0].smtp.enabled?te?(te.p(H,Y),Y&1&&A(te,1)):(te=wp(H),te.c(),A(te,1),te.m(C.parentNode,C)):te&&(Te(),P(te,1,1,()=>{te=null}),De()),(!j||Y&12&&E!==(E=!H[3]||H[2]))&&(O.disabled=E),Y&4&&X(O,"btn-loading",H[2])},i(H){j||(A(i.$$.fragment,H),A(o.$$.fragment,H),A(a.$$.fragment,H),A(f.$$.fragment,H),A(d.$$.fragment,H),A(S.$$.fragment,H),A(te),j=!0)},o(H){P(i.$$.fragment,H),P(o.$$.fragment,H),P(a.$$.fragment,H),P(f.$$.fragment,H),P(d.$$.fragment,H),P(S.$$.fragment,H),P(te),j=!1},d(H){H&&k(e),V(i),V(o),V(a),V(f),V(d),H&&k(p),H&&k(g),H&&k(v),H&&k(b),H&&k(y),V(S,H),H&&k($),te&&te.d(H),H&&k(C),H&&k(M),U=!1,Q()}}}function NT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function RT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender name"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderName),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Ce(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function HT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Sender address"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","email"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].meta.senderAddress),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Ce(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User verification page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userVerificationUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[9]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&Ce(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function qT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User reset password page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userResetPasswordUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[10]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Ce(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function VT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=R("User confirm email change page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0,h(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Ce(l,n[0].meta.userConfirmEmailChangeUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&h(e,"for",i),d&4194304&&o!==(o=c[22])&&h(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Ce(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function zT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use SMTP mail server"),h(e,"type","checkbox"),h(e,"id",t=n[22]),e.required=!0,h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[12]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$;return i=new Fe({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[BT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[UT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[WT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:"smtp.username",$$slots:{default:[YT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),v=new Fe({props:{class:"form-field",name:"smtp.password",$$slots:{default:[KT,({uniqueId:C})=>({22:C}),({uniqueId:C})=>C?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),$=!0},p(C,M){const D={};M&12582913&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const L={};M&12582913&&(L.$$scope={dirty:M,ctx:C}),o.$set(L);const O={};M&12582913&&(O.$$scope={dirty:M,ctx:C}),u.$set(O);const F={};M&12582913&&(F.$$scope={dirty:M,ctx:C}),d.$set(F);const E={};M&12582913&&(E.$$scope={dirty:M,ctx:C}),v.$set(E)},i(C){$||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Tt(()=>{S||(S=at(e,Xt,{duration:150},!0)),S.run(1)}),$=!0)},o(C){P(i.$$.fragment,C),P(o.$$.fragment,C),P(u.$$.fragment,C),P(d.$$.fragment,C),P(v.$$.fragment,C),C&&(S||(S=at(e,Xt,{duration:150},!1)),S.run(0)),$=!1},d(C){C&&k(e),V(i),V(o),V(u),V(d),V(v),C&&S&&S.end()}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("SMTP server host"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.host),r||(a=G(l,"input",n[13]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Ce(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Port"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","number"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.port),r||(a=G(l,"input",n[14]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].smtp.port&&Ce(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function WT(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[22],items:n[4]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new ls({props:u}),ge.push(()=>Ie(l,"keyOfSelected",a)),{c(){e=_("label"),t=R("TLS Encryption"),s=T(),z(l.$$.fragment),h(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4194304&&i!==(i=f[22]))&&h(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function YT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Username"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].smtp.username),r||(a=G(l,"input",n[16]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].smtp.username&&Ce(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function KT(n){let e,t,i,s,l,o,r;function a(f){n[17](f)}let u={id:n[22]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new za({props:u}),ge.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Password"),s=T(),z(l.$$.fragment),h(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4194304&&i!==(i=f[22]))&&h(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!o&&c&1&&(o=!0,d.value=f[0].smtp.password,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function ZT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;e=new Os({});const v=[NT,IT],b=[];function y(S,$){return S[1]?0:1}return f=y(n),c=b[f]=v[f](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Mail settings</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML="<p>Configure common settings for sending emails.</p>",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content txt-xl m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[19])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function JT(n,e,t){let i;const s=[{label:"Optional (StartTLS)",value:!1},{label:"Always",value:!0}];let l={},o=!1,r=!1,a="";W.setDocumentTitle("Mail settings"),u();async function u(){t(1,o=!0);try{const F=await Se.Settings.getAll()||{};c(F)}catch(F){Se.errorResponseHandler(F)}t(1,o=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const F=await Se.Settings.update(W.filterRedactedProps(l));c(F),dn("Successfully saved mail settings.")}catch(F){Se.errorResponseHandler(F)}t(2,r=!1)}}function c(F={}){t(0,l={meta:(F==null?void 0:F.meta)||{},smtp:(F==null?void 0:F.smtp)||{}}),t(6,a=JSON.stringify(l))}function d(){l.meta.senderName=this.value,t(0,l)}function p(){l.meta.senderAddress=this.value,t(0,l)}function g(){l.meta.userVerificationUrl=this.value,t(0,l)}function v(){l.meta.userResetPasswordUrl=this.value,t(0,l)}function b(){l.meta.userConfirmEmailChangeUrl=this.value,t(0,l)}function y(){l.smtp.enabled=this.checked,t(0,l)}function S(){l.smtp.host=this.value,t(0,l)}function $(){l.smtp.port=Dt(this.value),t(0,l)}function C(F){n.$$.not_equal(l.smtp.tls,F)&&(l.smtp.tls=F,t(0,l))}function M(){l.smtp.username=this.value,t(0,l)}function D(F){n.$$.not_equal(l.smtp.password,F)&&(l.smtp.password=F,t(0,l))}const L=()=>f(),O=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,o,r,i,s,f,a,d,p,g,v,b,y,S,$,C,M,D,L,O]}class GT extends Ee{constructor(e){super(),Ae(this,e,JT,ZT,Oe,{})}}function XT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;e=new Fe({props:{class:"form-field form-field-toggle",$$slots:{default:[xT,({uniqueId:b})=>({17:b}),({uniqueId:b})=>b?131072:0]},$$scope:{ctx:n}}});let g=n[3]!=n[0].enabled&&Sp(n),v=n[0].enabled&&$p(n);return{c(){z(e.$$.fragment),t=T(),g&&g.c(),i=T(),v&&v.c(),s=T(),l=_("div"),o=_("div"),r=T(),a=_("button"),u=_("span"),u.textContent="Save changes",h(o,"class","flex-fill"),h(u,"class","txt"),h(a,"type","submit"),h(a,"class","btn btn-expanded"),a.disabled=f=!n[4]||n[2],X(a,"btn-loading",n[2]),h(l,"class","flex")},m(b,y){q(e,b,y),w(b,t,y),g&&g.m(b,y),w(b,i,y),v&&v.m(b,y),w(b,s,y),w(b,l,y),m(l,o),m(l,r),m(l,a),m(a,u),c=!0,d||(p=G(a,"click",n[13]),d=!0)},p(b,y){const S={};y&393217&&(S.$$scope={dirty:y,ctx:b}),e.$set(S),b[3]!=b[0].enabled?g?(g.p(b,y),y&9&&A(g,1)):(g=Sp(b),g.c(),A(g,1),g.m(i.parentNode,i)):g&&(Te(),P(g,1,1,()=>{g=null}),De()),b[0].enabled?v?(v.p(b,y),y&1&&A(v,1)):(v=$p(b),v.c(),A(v,1),v.m(s.parentNode,s)):v&&(Te(),P(v,1,1,()=>{v=null}),De()),(!c||y&20&&f!==(f=!b[4]||b[2]))&&(a.disabled=f),y&4&&X(a,"btn-loading",b[2])},i(b){c||(A(e.$$.fragment,b),A(g),A(v),c=!0)},o(b){P(e.$$.fragment,b),P(g),P(v),c=!1},d(b){V(e,b),b&&k(t),g&&g.d(b),b&&k(i),v&&v.d(b),b&&k(s),b&&k(l),d=!1,p()}}}function QT(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function xT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Use S3 storage"),h(e,"type","checkbox"),h(e,"id",t=n[17]),e.required=!0,h(s,"for",o=n[17])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[7]),r=!0)},p(u,f){f&131072&&t!==(t=u[17])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&131072&&o!==(o=u[17])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Sp(n){let e,t,i,s,l,o,r,a=n[3]?"S3 storage":"local file system",u,f,c,d=n[0].enabled?"S3 storage":"local file system",p,g,v,b,y,S,$,C,M,D,L,O;return{c(){e=_("div"),t=_("div"),i=_("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=T(),l=_("div"),o=R(`If you have existing uploaded files, you'll have to migrate them manually from
the
`),r=_("strong"),u=R(a),f=R(`
to the
`),c=_("strong"),p=R(d),g=R(`.
`),v=_("br"),b=R(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,S=R(`,
`),$=_("a"),$.textContent=`s5cmd
`,C=R(", etc."),M=T(),D=_("div"),h(i,"class","icon"),h(y,"href","https://github.com/rclone/rclone"),h(y,"target","_blank"),h(y,"rel","noopener"),h(y,"class","txt-bold"),h($,"href","https://github.com/peak/s5cmd"),h($,"target","_blank"),h($,"rel","noopener"),h($,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(D,"class","clearfix m-t-base")},m(F,E){w(F,e,E),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(l,r),m(r,u),m(l,f),m(l,c),m(c,p),m(l,g),m(l,v),m(l,b),m(l,y),m(l,S),m(l,$),m(l,C),m(e,M),m(e,D),O=!0},p(F,E){(!O||E&8)&&a!==(a=F[3]?"S3 storage":"local file system")&&be(u,a),(!O||E&1)&&d!==(d=F[0].enabled?"S3 storage":"local file system")&&be(p,d)},i(F){O||(F&&Tt(()=>{L||(L=at(e,Xt,{duration:150},!0)),L.run(1)}),O=!0)},o(F){F&&(L||(L=at(e,Xt,{duration:150},!1)),L.run(0)),O=!1},d(F){F&&k(e),F&&L&&L.end()}}}function $p(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$;return i=new Fe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[eD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[tD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[nD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[iD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),v=new Fe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[sD,({uniqueId:C})=>({17:C}),({uniqueId:C})=>C?131072:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),p=T(),g=_("div"),z(v.$$.fragment),b=T(),y=_("div"),h(t,"class","col-lg-12"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(c,"class","col-lg-6"),h(g,"class","col-lg-6"),h(y,"class","col-lg-12"),h(e,"class","grid")},m(C,M){w(C,e,M),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),m(e,f),m(e,c),q(d,c,null),m(e,p),m(e,g),q(v,g,null),m(e,b),m(e,y),$=!0},p(C,M){const D={};M&393217&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const L={};M&393217&&(L.$$scope={dirty:M,ctx:C}),o.$set(L);const O={};M&393217&&(O.$$scope={dirty:M,ctx:C}),u.$set(O);const F={};M&393217&&(F.$$scope={dirty:M,ctx:C}),d.$set(F);const E={};M&393217&&(E.$$scope={dirty:M,ctx:C}),v.$set(E)},i(C){$||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Tt(()=>{S||(S=at(e,Xt,{duration:150},!0)),S.run(1)}),$=!0)},o(C){P(i.$$.fragment,C),P(o.$$.fragment,C),P(u.$$.fragment,C),P(d.$$.fragment,C),P(v.$$.fragment,C),C&&(S||(S=at(e,Xt,{duration:150},!1)),S.run(0)),$=!1},d(C){C&&k(e),V(i),V(o),V(u),V(d),V(v),C&&S&&S.end()}}}function eD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Endpoint"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].endpoint),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].endpoint&&Ce(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Bucket"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].bucket),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].bucket&&Ce(l,u[0].bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Region"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].region),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].region&&Ce(l,u[0].region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function iD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Access key"),s=T(),l=_("input"),h(e,"for",i=n[17]),h(l,"type","text"),h(l,"id",o=n[17]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].accessKey),r||(a=G(l,"input",n[11]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&h(e,"for",i),f&131072&&o!==(o=u[17])&&h(l,"id",o),f&1&&l.value!==u[0].accessKey&&Ce(l,u[0].accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function sD(n){let e,t,i,s,l,o,r;function a(f){n[12](f)}let u={id:n[17],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),l=new za({props:u}),ge.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Secret"),s=T(),z(l.$$.fragment),h(e,"for",i=n[17])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&131072&&i!==(i=f[17]))&&h(e,"for",i);const d={};c&131072&&(d.id=f[17]),!o&&c&1&&(o=!0,d.value=f[0].secret,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function lD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;e=new Os({});const v=[QT,XT],b=[];function y(S,$){return S[1]?0:1}return f=y(n),c=b[f]=v[f](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Files storage</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.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>`,u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content txt-xl m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[14])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function oD(n,e,t){let i,s={},l=!1,o=!1,r="",a=!1;W.setDocumentTitle("Files storage"),u();async function u(){t(1,l=!0);try{const C=await Se.Settings.getAll()||{};c(C)}catch(C){Se.errorResponseHandler(C)}t(1,l=!1)}async function f(){if(!(o||!i)){t(2,o=!0);try{const C=await Se.Settings.update(W.filterRedactedProps({s3:s}));c(C),Li({}),dn("Successfully saved Files storage settings.")}catch(C){Se.errorResponseHandler(C)}t(2,o=!1)}}function c(C={}){t(0,s=(C==null?void 0:C.s3)||{}),t(3,a=s.enabled),t(6,r=JSON.stringify(s))}function d(){s.enabled=this.checked,t(0,s)}function p(){s.endpoint=this.value,t(0,s)}function g(){s.bucket=this.value,t(0,s)}function v(){s.region=this.value,t(0,s)}function b(){s.accessKey=this.value,t(0,s)}function y(C){n.$$.not_equal(s.secret,C)&&(s.secret=C,t(0,s))}const S=()=>f(),$=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=r!=JSON.stringify(s))},[s,l,o,a,i,f,r,d,p,g,v,b,y,S,$]}class rD extends Ee{constructor(e){super(),Ae(this,e,oD,lD,Oe,{})}}function aD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[16]),h(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Cp(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Fe({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[uD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Fe({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[fD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[cD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),z(i.$$.fragment),s=T(),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),h(t,"class","col-sm-12 m-t-sm"),h(l,"class","col-lg-6"),h(a,"class","col-lg-6"),h(e,"class","grid")},m(d,p){w(d,e,p),m(e,t),q(i,t,null),m(e,s),m(e,l),q(o,l,null),m(e,r),m(e,a),q(u,a,null),c=!0},p(d,p){const g={};p&196609&&(g.$$scope={dirty:p,ctx:d}),i.$set(g);const v={};p&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),p&196609&&(v.$$scope={dirty:p,ctx:d}),o.$set(v);const b={};p&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),p&196609&&(b.$$scope={dirty:p,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=at(e,Xt,{duration:150},!0)),f.run(1)}),c=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),d&&(f||(f=at(e,Xt,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),V(i),V(o),V(u),d&&f&&f.end()}}}function uD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Minimum password length"),s=T(),l=_("input"),h(e,"for",i=n[16]),h(l,"type","number"),h(l,"id",o=n[16]),l.required=!0,h(l,"min","5"),h(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].minPasswordLength),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&65536&&i!==(i=u[16])&&h(e,"for",i),f&65536&&o!==(o=u[16])&&h(l,"id",o),f&1&&Dt(l.value)!==u[0].minPasswordLength&&Ce(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function fD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[10](b)}let v={id:n[16],disabled:!W.isEmpty(n[0].onlyDomains)};return n[0].exceptDomains!==void 0&&(v.value=n[0].exceptDomains),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&h(e,"for",l);const S={};y&65536&&(S.id=b[16]),y&1&&(S.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function cD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new os({props:v}),ge.push(()=>Ie(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),z(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[16]+".config.onlyDomains"),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),q(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(p=tt(Mt.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&h(e,"for",l);const S={};y&65536&&(S.id=b[16]+".config.onlyDomains"),y&1&&(S.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,Re(()=>a=!1)),r.$set(S)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),V(r,b),b&&k(u),b&&k(f),d=!1,p()}}}function dD(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[aD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Cp(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=ot()},m(o,r){q(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Cp(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function hD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pD(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mp(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function mD(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].enabled?pD:hD}let u=a(n),f=u(n),c=n[2]&&Mp();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=T(),f.c(),i=T(),s=_("div"),l=T(),c&&c.c(),o=ot(),h(e,"class","inline-flex"),h(s,"class","flex-fill")},m(d,p){w(d,e,p),w(d,t,p),f.m(d,p),w(d,i,p),w(d,s,p),w(d,l,p),c&&c.m(d,p),w(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?p&4&&A(c,1):(c=Mp(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Te(),P(c,1,1,()=>{c=null}),De())},i(d){r||(A(c),r=!0)},o(d){P(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function gD(n){let e,t;const i=[n[3]];let s={$$slots:{header:[mD],default:[dD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ht(s,i[l]);return e=new ja({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&8?hn(i,[oi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),V(e,l)}}}function _D(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Wt(e,s),o;cn(n,ns,C=>t(7,o=C));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function p(){r.minPasswordLength=Dt(this.value),t(0,r)}function g(C){n.$$.not_equal(r.exceptDomains,C)&&(r.exceptDomains=C,t(0,r))}function v(C){n.$$.not_equal(r.onlyDomains,C)&&(r.onlyDomains=C,t(0,r))}function b(C){ge[C?"unshift":"push"](()=>{a=C,t(1,a)})}function y(C){dt.call(this,n,C)}function S(C){dt.call(this,n,C)}function $(C){dt.call(this,n,C)}return n.$$set=C=>{e=ht(ht({},e),si(C)),t(3,l=Wt(e,s)),"config"in C&&t(0,r=C.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,p,g,v,b,y,S,$]}class bD extends Ee{constructor(e){super(),Ae(this,e,_D,gD,Oe,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function vD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Tp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;l=new Fe({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[yD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Fe({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[kD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Fe({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[wD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&Dp(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),z(l.$$.fragment),o=T(),r=_("div"),z(a.$$.fragment),u=T(),f=_("div"),z(c.$$.fragment),d=T(),v&&v.c(),h(t,"class","col-12 spacing"),h(s,"class","col-lg-6"),h(r,"class","col-lg-6"),h(f,"class","col-lg-12"),h(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),q(l,s,null),m(e,o),m(e,r),q(a,r,null),m(e,u),m(e,f),q(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const S={};y&2&&(S.name=b[1]+".clientId"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),l.$set(S);const $={};y&2&&($.name=b[1]+".clientSecret"),y&12582913&&($.$$scope={dirty:y,ctx:b}),a.$set($);const C={};y&2&&(C.name=b[1]+".allowRegistrations"),y&12582913&&(C.$$scope={dirty:y,ctx:b}),c.$set(C),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=Dp(b),v.c(),A(v,1),v.m(e,null)):v&&(Te(),P(v,1,1,()=>{v=null}),De())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{p||(p=at(e,Xt,{duration:200},!0)),p.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(p||(p=at(e,Xt,{duration:200},!1)),p.run(0)),g=!1},d(b){b&&k(e),V(l),V(a),V(c),v&&v.d(),b&&p&&p.end()}}}function yD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Client ID"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].clientId),r||(a=G(l,"input",n[12]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].clientId&&Ce(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function kD(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[22],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new za({props:u}),ge.push(()=>Ie(l,"value",a)),{c(){e=_("label"),t=R("Client Secret"),s=T(),z(l.$$.fragment),h(e,"for",i=n[22])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&4194304&&i!==(i=f[22]))&&h(e,"for",i);const d={};c&4194304&&(d.id=f[22]),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,Re(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){P(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),V(l,f)}}}function wD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=R("Allow registration for new users"),h(e,"type","checkbox"),h(e,"id",t=n[22]),h(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].allowRegistrations,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[14]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&h(e,"id",t),f&1&&(e.checked=u[0].allowRegistrations),f&4194304&&o!==(o=u[22])&&h(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Dp(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return o=new Fe({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[SD,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),u=new Fe({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[$D,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),d=new Fe({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[CD,({uniqueId:g})=>({22:g}),({uniqueId:g})=>g?4194304:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),t.textContent="Optional endpoints (if you self host the OAUTH2 service)",i=T(),s=_("div"),l=_("div"),z(o.$$.fragment),r=T(),a=_("div"),z(u.$$.fragment),f=T(),c=_("div"),z(d.$$.fragment),h(t,"class","section-title"),h(l,"class","col-lg-4"),h(a,"class","col-lg-4"),h(c,"class","col-lg-4"),h(s,"class","grid"),h(e,"class","col-lg-12")},m(g,v){w(g,e,v),m(e,t),m(e,i),m(e,s),m(s,l),q(o,l,null),m(s,r),m(s,a),q(u,a,null),m(s,f),m(s,c),q(d,c,null),p=!0},p(g,v){const b={};v&2&&(b.name=g[1]+".authUrl"),v&12582913&&(b.$$scope={dirty:v,ctx:g}),o.$set(b);const y={};v&2&&(y.name=g[1]+".tokenUrl"),v&12582913&&(y.$$scope={dirty:v,ctx:g}),u.$set(y);const S={};v&2&&(S.name=g[1]+".userApiUrl"),v&12582913&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){p||(A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),p=!0)},o(g){P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),p=!1},d(g){g&&k(e),V(o),V(u),V(d)}}}function SD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Custom Auth URL"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","url"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].authUrl),r||(a=G(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&Ce(l,u[0].authUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function $D(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Custom Token URL"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].tokenUrl),r||(a=G(l,"input",n[16]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&Ce(l,u[0].tokenUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function CD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=R("Custom User API URL"),s=T(),l=_("input"),h(e,"for",i=n[22]),h(l,"type","text"),h(l,"id",o=n[22])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0].userApiUrl),r||(a=G(l,"input",n[17]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&h(e,"for",i),f&4194304&&o!==(o=u[22])&&h(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&Ce(l,u[0].userApiUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function MD(n){let e,t,i,s;e=new Fe({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[vD,({uniqueId:o})=>({22:o}),({uniqueId:o})=>o?4194304:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&Tp(n);return{c(){z(e.$$.fragment),t=T(),l&&l.c(),i=ot()},m(o,r){q(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&2&&(a.name=o[1]+".enabled"),r&12582913&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=Tp(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Te(),P(l,1,1,()=>{l=null}),De())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function Op(n){let e;return{c(){e=_("i"),h(e,"class",n[3])},m(t,i){w(t,e,i)},p(t,i){i&8&&h(e,"class",t[3])},d(t){t&&k(e)}}}function TD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",h(e,"class","label label-hint")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function DD(n){let e;return{c(){e=_("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ap(n){let e,t,i,s,l;return{c(){e=_("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=tt(Mt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=at(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=at(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function OD(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&Op(n);function d(b,y){return b[0].enabled?DD:TD}let p=d(n),g=p(n),v=n[6]&&Ap();return{c(){e=_("div"),c&&c.c(),t=T(),i=_("span"),s=R(n[2]),l=T(),g.c(),o=T(),r=_("div"),a=T(),v&&v.c(),u=ot(),h(i,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(b,y){w(b,e,y),c&&c.m(e,null),m(e,t),m(e,i),m(i,s),w(b,l,y),g.m(b,y),w(b,o,y),w(b,r,y),w(b,a,y),v&&v.m(b,y),w(b,u,y),f=!0},p(b,y){b[3]?c?c.p(b,y):(c=Op(b),c.c(),c.m(e,t)):c&&(c.d(1),c=null),(!f||y&4)&&be(s,b[2]),p!==(p=d(b))&&(g.d(1),g=p(b),g&&(g.c(),g.m(o.parentNode,o))),b[6]?v?y&64&&A(v,1):(v=Ap(),v.c(),A(v,1),v.m(u.parentNode,u)):v&&(Te(),P(v,1,1,()=>{v=null}),De())},i(b){f||(A(v),f=!0)},o(b){P(v),f=!1},d(b){b&&k(e),c&&c.d(),b&&k(l),g.d(b),b&&k(o),b&&k(r),b&&k(a),v&&v.d(b),b&&k(u)}}}function AD(n){let e,t;const i=[n[7]];let s={$$slots:{header:[OD],default:[MD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ht(s,i[l]);return e=new ja({props:s}),n[18](e),e.$on("expand",n[19]),e.$on("collapse",n[20]),e.$on("toggle",n[21]),{c(){z(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,[o]){const r=o&128?hn(i,[oi(l[7])]):{};o&8388703&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[18](null),V(e,l)}}}function ED(n,e,t){let i;const s=["key","title","icon","config","showSelfHostedFields","expand","collapse"];let l=Wt(e,s),o;cn(n,ns,E=>t(10,o=E));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{showSelfHostedFields:c=!1}=e,d;function p(){d==null||d.expand()}function g(){d==null||d.collapse()}function v(){f.enabled=this.checked,t(0,f)}function b(){f.clientId=this.value,t(0,f)}function y(E){n.$$.not_equal(f.clientSecret,E)&&(f.clientSecret=E,t(0,f))}function S(){f.allowRegistrations=this.checked,t(0,f)}function $(){f.authUrl=this.value,t(0,f)}function C(){f.tokenUrl=this.value,t(0,f)}function M(){f.userApiUrl=this.value,t(0,f)}function D(E){ge[E?"unshift":"push"](()=>{d=E,t(5,d)})}function L(E){dt.call(this,n,E)}function O(E){dt.call(this,n,E)}function F(E){dt.call(this,n,E)}return n.$$set=E=>{e=ht(ht({},e),si(E)),t(7,l=Wt(e,s)),"key"in E&&t(1,r=E.key),"title"in E&&t(2,a=E.title),"icon"in E&&t(3,u=E.icon),"config"in E&&t(0,f=E.config),"showSelfHostedFields"in E&&t(4,c=E.showSelfHostedFields)},n.$$.update=()=>{n.$$.dirty&1026&&t(6,i=!W.isEmpty(W.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||rg(r))},[f,r,a,u,c,d,i,l,p,g,o,v,b,y,S,$,C,M,D,L,O,F]}class xl extends Ee{constructor(e){super(),Ae(this,e,ED,AD,Oe,{key:1,title:2,icon:3,config:0,showSelfHostedFields:4,expand:8,collapse:9})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C,M,D,L,O,F;function E(ae){n[8](ae)}let j={single:!0};n[0].emailAuth!==void 0&&(j.config=n[0].emailAuth),t=new bD({props:j}),n[7](t),ge.push(()=>Ie(t,"config",E));function U(ae){n[9](ae)}let Q={single:!0,key:"googleAuth",title:"Google",icon:"ri-google-line"};n[0].googleAuth!==void 0&&(Q.config=n[0].googleAuth),l=new xl({props:Q}),ge.push(()=>Ie(l,"config",U));function te(ae){n[10](ae)}let H={single:!0,key:"facebookAuth",title:"Facebook",icon:"ri-facebook-line"};n[0].facebookAuth!==void 0&&(H.config=n[0].facebookAuth),a=new xl({props:H}),ge.push(()=>Ie(a,"config",te));function Y(ae){n[11](ae)}let K={single:!0,key:"githubAuth",title:"GitHub",icon:"ri-github-line"};n[0].githubAuth!==void 0&&(K.config=n[0].githubAuth),c=new xl({props:K}),ge.push(()=>Ie(c,"config",Y));function Z(ae){n[12](ae)}let ee={single:!0,key:"gitlabAuth",title:"GitLab",icon:"ri-gitlab-line",showSelfHostedFields:!0};return n[0].gitlabAuth!==void 0&&(ee.config=n[0].gitlabAuth),g=new xl({props:ee}),ge.push(()=>Ie(g,"config",Z)),{c(){e=_("div"),z(t.$$.fragment),s=T(),z(l.$$.fragment),r=T(),z(a.$$.fragment),f=T(),z(c.$$.fragment),p=T(),z(g.$$.fragment),b=T(),y=_("div"),S=_("div"),$=T(),C=_("button"),M=_("span"),M.textContent="Save changes",h(e,"class","accordions"),h(S,"class","flex-fill"),h(M,"class","txt"),h(C,"type","submit"),h(C,"class","btn btn-expanded"),C.disabled=D=!n[4]||n[3],X(C,"btn-loading",n[3]),h(y,"class","flex m-t-base")},m(ae,ve){w(ae,e,ve),q(t,e,null),m(e,s),q(l,e,null),m(e,r),q(a,e,null),m(e,f),q(c,e,null),m(e,p),q(g,e,null),w(ae,b,ve),w(ae,y,ve),m(y,S),m(y,$),m(y,C),m(C,M),L=!0,O||(F=G(C,"click",n[13]),O=!0)},p(ae,ve){const le={};!i&&ve&1&&(i=!0,le.config=ae[0].emailAuth,Re(()=>i=!1)),t.$set(le);const me={};!o&&ve&1&&(o=!0,me.config=ae[0].googleAuth,Re(()=>o=!1)),l.$set(me);const re={};!u&&ve&1&&(u=!0,re.config=ae[0].facebookAuth,Re(()=>u=!1)),a.$set(re);const de={};!d&&ve&1&&(d=!0,de.config=ae[0].githubAuth,Re(()=>d=!1)),c.$set(de);const fe={};!v&&ve&1&&(v=!0,fe.config=ae[0].gitlabAuth,Re(()=>v=!1)),g.$set(fe),(!L||ve&24&&D!==(D=!ae[4]||ae[3]))&&(C.disabled=D),ve&8&&X(C,"btn-loading",ae[3])},i(ae){L||(A(t.$$.fragment,ae),A(l.$$.fragment,ae),A(a.$$.fragment,ae),A(c.$$.fragment,ae),A(g.$$.fragment,ae),L=!0)},o(ae){P(t.$$.fragment,ae),P(l.$$.fragment,ae),P(a.$$.fragment,ae),P(c.$$.fragment,ae),P(g.$$.fragment,ae),L=!1},d(ae){ae&&k(e),n[7](null),V(t),V(l),V(a),V(c),V(g),ae&&k(b),ae&&k(y),O=!1,F()}}}function LD(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function FD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;e=new Os({});const v=[LD,PD],b=[];function y(S,$){return S[2]?0:1}return f=y(n),c=b[f]=v[f](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Auth providers</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("h6"),a.textContent="Manage the allowed users sign-in/sign-up methods.",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","m-b-base"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[5])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function ID(n,e,t){let i,s,l={},o=!1,r=!1,a="";W.setDocumentTitle("Auth providers"),u();async function u(){t(2,o=!0);try{const $=await Se.Settings.getAll()||{};c($)}catch($){Se.errorResponseHandler($)}t(2,o=!1)}async function f(){if(!(r||!i)){t(3,r=!0);try{const $=await Se.Settings.update(W.filterRedactedProps(l));c($),Li({}),s==null||s.collapseSiblings(),dn("Successfully updated auth providers.")}catch($){Se.errorResponseHandler($)}t(3,r=!1)}}function c($){$=$||{},t(0,l={}),t(0,l.emailAuth=Object.assign({enabled:!0},$.emailAuth),l);const C=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const M of C)t(0,l[M]=Object.assign({enabled:!1,allowRegistrations:!0},$[M]),l);t(6,a=JSON.stringify(l))}function d($){ge[$?"unshift":"push"](()=>{s=$,t(1,s)})}function p($){n.$$.not_equal(l.emailAuth,$)&&(l.emailAuth=$,t(0,l))}function g($){n.$$.not_equal(l.googleAuth,$)&&(l.googleAuth=$,t(0,l))}function v($){n.$$.not_equal(l.facebookAuth,$)&&(l.facebookAuth=$,t(0,l))}function b($){n.$$.not_equal(l.githubAuth,$)&&(l.githubAuth=$,t(0,l))}function y($){n.$$.not_equal(l.gitlabAuth,$)&&(l.gitlabAuth=$,t(0,l))}const S=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(4,i=a!=JSON.stringify(l))},[l,s,o,r,i,f,a,d,p,g,v,b,y,S]}class ND extends Ee{constructor(e){super(),Ae(this,e,ID,FD,Oe,{})}}function Ep(n,e,t){const i=n.slice();return i[12]=e[t],i[13]=e,i[14]=t,i}function RD(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,p=n[4];const g=v=>v[12].key;for(let v=0;v<p.length;v+=1){let b=Ep(n,p,v),y=g(b);t.set(y,e[v]=Pp(y,b))}return{c(){for(let v=0;v<e.length;v+=1)e[v].c();i=T(),s=_("div"),l=_("div"),o=T(),r=_("button"),a=_("span"),a.textContent="Save changes",h(l,"class","flex-fill"),h(a,"class","txt"),h(r,"type","submit"),h(r,"class","btn btn-expanded"),r.disabled=u=!n[3]||n[2],X(r,"btn-loading",n[2]),h(s,"class","flex")},m(v,b){for(let y=0;y<e.length;y+=1)e[y].m(v,b);w(v,i,b),w(v,s,b),m(s,l),m(s,o),m(s,r),m(r,a),f=!0,c||(d=G(r,"click",n[9]),c=!0)},p(v,b){b&32785&&(p=v[4],Te(),e=ft(e,b,g,1,v,p,t,i.parentNode,Ft,Pp,i,Ep),De()),(!f||b&12&&u!==(u=!v[3]||v[2]))&&(r.disabled=u),b&4&&X(r,"btn-loading",v[2])},i(v){if(!f){for(let b=0;b<p.length;b+=1)A(e[b]);f=!0}},o(v){for(let b=0;b<e.length;b+=1)P(e[b]);f=!1},d(v){for(let b=0;b<e.length;b+=1)e[b].d(v);v&&k(i),v&&k(s),c=!1,d()}}}function HD(n){let e;return{c(){e=_("div"),h(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function jD(n){let e,t=n[12].label+"",i,s,l,o,r,a,u,f,c,d,p;function g(){n[7].call(r,n[12])}function v(){return n[8](n[12])}return{c(){e=_("label"),i=R(t),s=R(" duration (in seconds)"),o=T(),r=_("input"),u=T(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",h(e,"for",l=n[15]),h(r,"type","number"),h(r,"id",a=n[15]),r.required=!0,h(c,"class","link-primary"),X(c,"txt-success",n[0][n[12].key].secret),h(f,"class","help-block")},m(b,y){w(b,e,y),m(e,i),m(e,s),w(b,o,y),w(b,r,y),Ce(r,n[0][n[12].key].duration),w(b,u,y),w(b,f,y),m(f,c),d||(p=[G(r,"input",g),G(c,"click",v)],d=!0)},p(b,y){n=b,y&32768&&l!==(l=n[15])&&h(e,"for",l),y&32768&&a!==(a=n[15])&&h(r,"id",a),y&17&&Dt(r.value)!==n[0][n[12].key].duration&&Ce(r,n[0][n[12].key].duration),y&17&&X(c,"txt-success",n[0][n[12].key].secret)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(f),d=!1,lt(p)}}}function Pp(n,e){let t,i,s;return i=new Fe({props:{class:"form-field required",name:e[12].key+".duration",$$slots:{default:[jD,({uniqueId:l})=>({15:l}),({uniqueId:l})=>l?32768:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ot(),z(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),q(i,l,o),s=!0},p(l,o){e=l;const r={};o&98305&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),V(i,l)}}}function qD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g;e=new Os({});const v=[HD,RD],b=[];function y(S,$){return S[1]?0:1}return f=y(n),c=b[f]=v[f](n),{c(){z(e.$$.fragment),t=T(),i=_("main"),s=_("header"),s.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
<div class="breadcrumb-item">Token options</div></nav>`,l=T(),o=_("div"),r=_("form"),a=_("div"),a.innerHTML="<p>Adjust common token options.</p>",u=T(),c.c(),h(s,"class","page-header"),h(a,"class","content m-b-sm txt-xl"),h(r,"class","panel"),h(r,"autocomplete","off"),h(o,"class","wrapper"),h(i,"class","page-wrapper")},m(S,$){q(e,S,$),w(S,t,$),w(S,i,$),m(i,s),m(i,l),m(i,o),m(o,r),m(r,a),m(r,u),b[f].m(r,null),d=!0,p||(g=G(r,"submit",Vt(n[5])),p=!0)},p(S,[$]){let C=f;f=y(S),f===C?b[f].p(S,$):(Te(),P(b[C],1,1,()=>{b[C]=null}),De(),c=b[f],c?c.p(S,$):(c=b[f]=v[f](S),c.c()),A(c,1),c.m(r,null))},i(S){d||(A(e.$$.fragment,S),A(c),d=!0)},o(S){P(e.$$.fragment,S),P(c),d=!1},d(S){V(e,S),S&&k(t),S&&k(i),b[f].d(),p=!1,g()}}}function VD(n,e,t){let i;const s=[{key:"userAuthToken",label:"Users auth token"},{key:"userVerificationToken",label:"Users email verification token"},{key:"userPasswordResetToken",label:"Users password reset token"},{key:"userEmailChangeToken",label:"Users email change token"},{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"}];let l={},o=!1,r=!1,a="";W.setDocumentTitle("Token options"),u();async function u(){t(1,o=!0);try{const v=await Se.Settings.getAll()||{};c(v)}catch(v){Se.errorResponseHandler(v)}t(1,o=!1)}async function f(){if(!(r||!i)){t(2,r=!0);try{const v=await Se.Settings.update(W.filterRedactedProps(l));c(v),dn("Successfully saved tokens options.")}catch(v){Se.errorResponseHandler(v)}t(2,r=!1)}}function c(v){var b;v=v||{},t(0,l={});for(const y of s)t(0,l[y.key]={duration:((b=v[y.key])==null?void 0:b.duration)||0},l);t(6,a=JSON.stringify(l))}function d(v){l[v.key].duration=Dt(this.value),t(0,l)}const p=v=>{l[v.key].secret?(delete l[v.key].secret,t(0,l)):t(0,l[v.key].secret=W.randomString(50),l)},g=()=>f();return n.$$.update=()=>{n.$$.dirty&65&&t(3,i=a!=JSON.stringify(l))},[l,o,r,i,s,f,a,d,p,g]}class zD extends Ee{constructor(e){super(),Ae(this,e,VD,qD,Oe,{})}}const un=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?$s("/"):!0}],BD={"/login":tn({component:wT,conditions:un.concat([n=>!Se.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":tn({asyncComponent:()=>Ki(()=>import("./PageAdminRequestPasswordReset.1ed2f260.js"),[]),conditions:un.concat([n=>!Se.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":tn({asyncComponent:()=>Ki(()=>import("./PageAdminConfirmPasswordReset.6fd392db.js"),[]),conditions:un.concat([n=>!Se.AuthStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":tn({component:$M,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":tn({component:Fw,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users":tn({component:ZM,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmPasswordReset.3d4f00c0.js"),[]),conditions:un.concat([()=>(Se.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmVerification.0b9a252c.js"),[]),conditions:un.concat([()=>(Se.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":tn({asyncComponent:()=>Ki(()=>import("./PageUserConfirmEmailChange.70884449.js"),[]),conditions:un.concat([()=>(Se.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":tn({component:AT,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":tn({component:gT,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":tn({component:GT,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":tn({component:rD,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":tn({component:ND,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":tn({component:zD,conditions:un.concat([n=>Se.AuthStore.isValid]),userData:{showAppSidebar:!0}}),"*":tn({component:ab,userData:{showAppSidebar:!1}})};function UD(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=Ro}=i;return{delay:f,duration:Bn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(p,g)=>{const v=g*a,b=g*u,y=p+g*e.width/t.width,S=p+g*e.height/t.height;return`transform: ${l} translate(${v}px, ${b}px) scale(${y}, ${S});`}}}function Lp(n,e,t){const i=n.slice();return i[2]=e[t],i}function WD(n){let e;return{c(){e=_("i"),h(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function YD(n){let e;return{c(){e=_("i"),h(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function KD(n){let e;return{c(){e=_("i"),h(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Fp(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,p=oe,g,v,b;function y(M,D){return M[2].type==="info"?KD:M[2].type==="success"?YD:WD}let S=y(e),$=S(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=_("div"),i=_("div"),$.c(),s=T(),l=_("div"),r=R(o),a=T(),u=_("div"),u.innerHTML='<i class="ri-close-line"></i>',f=T(),h(i,"class","icon"),h(l,"class","content"),h(u,"class","close"),h(t,"class","alert txt-break"),X(t,"alert-info",e[2].type=="info"),X(t,"alert-success",e[2].type=="success"),X(t,"alert-danger",e[2].type=="error"),X(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,D){w(M,t,D),m(t,i),$.m(i,null),m(t,s),m(t,l),m(l,r),m(t,a),m(t,u),m(t,f),g=!0,v||(b=G(u,"click",Vt(C)),v=!0)},p(M,D){e=M,S!==(S=y(e))&&($.d(1),$=S(e),$&&($.c(),$.m(i,null))),(!g||D&1)&&o!==(o=e[2].message+"")&&be(r,o),D&1&&X(t,"alert-info",e[2].type=="info"),D&1&&X(t,"alert-success",e[2].type=="success"),D&1&&X(t,"alert-danger",e[2].type=="error"),D&1&&X(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){$_(t),p(),Wp(t,d)},a(){p(),p=S_(t,d,UD,{duration:150})},i(M){g||(Tt(()=>{c||(c=at(t,mo,{duration:150},!0)),c.run(1)}),g=!0)},o(M){c||(c=at(t,mo,{duration:150},!1)),c.run(0),g=!1},d(M){M&&k(t),$.d(),M&&c&&c.end(),v=!1,b()}}}function ZD(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=Lp(n,l,r),u=o(a);i.set(u,t[r]=Fp(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();h(e,"class","toasts-wrapper")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,[a]){if(a&1){l=r[0],Te();for(let u=0;u<t.length;u+=1)t[u].r();t=ft(t,a,o,1,r,l,i,e,D_,Fp,null,Lp);for(let u=0;u<t.length;u+=1)t[u].a();De()}},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)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function JD(n,e,t){let i;return cn(n,pa,l=>t(0,i=l)),[i,l=>lg(l)]}class GD extends Ee{constructor(e){super(),Ae(this,e,JD,ZD,Oe,{})}}function XD(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=_("h4"),i=R(t),h(e,"class","block center txt-break"),h(e,"slot","header")},m(l,o){w(l,e,o),m(e,i)},p(l,o){var r;o&2&&t!==(t=((r=l[1])==null?void 0:r.text)+"")&&be(i,t)},d(l){l&&k(e)}}}function QD(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=_("span"),t.textContent="No",i=T(),s=_("button"),l=_("span"),l.textContent="Yes",h(t,"class","txt"),e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded-sm"),e.disabled=n[2],h(l,"class","txt"),h(s,"type","button"),h(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],X(s,"btn-loading",n[2])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(s,l),e.focus(),o||(r=[G(e,"click",n[3]),G(s,"click",n[4])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(s.disabled=a[2]),u&4&&X(s,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,lt(r)}}}function xD(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:[QD],header:[XD]},$$scope:{ctx:n}};return e=new yi({props:i}),n[5](e),e.$on("hide",n[6]),{c(){z(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&135&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[5](null),V(e,s)}}}function eO(n,e,t){let i;cn(n,Ha,f=>t(1,i=f));let s,l=!1;const o=()=>{i!=null&&i.noCallback&&i.noCallback(),s==null||s.hide()},r=async()=>{i!=null&&i.yesCallback&&(t(2,l=!0),await Promise.resolve(i.yesCallback()),t(2,l=!1)),s==null||s.hide()};function a(f){ge[f?"unshift":"push"](()=>{s=f,t(0,s)})}const u=async()=>{i!=null&&i.noCallback&&i.noCallback(),await li(),r_()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(s==null||s.show())},[s,i,l,o,r,a,u]}class tO extends Ee{constructor(e){super(),Ae(this,e,eO,xD,Oe,{})}}function Ip(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,g,v,b,y,S,$,C;return y=new ss({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[nO]},$$scope:{ctx:n}}}),{c(){var M;e=_("aside"),t=_("a"),t.innerHTML='<img src="/_/images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=T(),s=_("nav"),l=_("a"),l.innerHTML='<i class="ri-database-2-line"></i>',o=T(),r=_("a"),r.innerHTML='<i class="ri-group-line"></i>',a=T(),u=_("a"),u.innerHTML='<i class="ri-line-chart-line"></i>',f=T(),c=_("a"),c.innerHTML='<i class="ri-tools-line"></i>',d=T(),p=_("figure"),g=_("img"),b=T(),z(y.$$.fragment),h(t,"href","/"),h(t,"class","logo logo-sm"),h(l,"href","/collections"),h(l,"class","menu-item"),h(l,"aria-label","Collections"),h(r,"href","/users"),h(r,"class","menu-item"),h(r,"aria-label","Users"),h(u,"href","/logs"),h(u,"class","menu-item"),h(u,"aria-label","Logs"),h(c,"href","/settings"),h(c,"class","menu-item"),h(c,"aria-label","Settings"),h(s,"class","main-menu"),Jn(g.src,v="/_/images/avatars/avatar"+(((M=n[1])==null?void 0:M.avatar)||0)+".svg")||h(g,"src",v),h(g,"alt","Avatar"),h(p,"class","thumb thumb-circle link-hint closable"),h(e,"class","app-sidebar")},m(M,D){w(M,e,D),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),m(s,r),m(s,a),m(s,u),m(s,f),m(s,c),m(e,d),m(e,p),m(p,g),m(p,b),q(y,p,null),S=!0,$||(C=[tt(wn.call(null,t)),tt(wn.call(null,l)),tt(xn.call(null,l,{path:"/collections/?.*",className:"current-route"})),tt(Mt.call(null,l,{text:"Collections",position:"right"})),tt(wn.call(null,r)),tt(xn.call(null,r,{path:"/users/?.*",className:"current-route"})),tt(Mt.call(null,r,{text:"Users",position:"right"})),tt(wn.call(null,u)),tt(xn.call(null,u,{path:"/logs/?.*",className:"current-route"})),tt(Mt.call(null,u,{text:"Logs",position:"right"})),tt(wn.call(null,c)),tt(xn.call(null,c,{path:"/settings/?.*",className:"current-route"})),tt(Mt.call(null,c,{text:"Settings",position:"right"}))],$=!0)},p(M,D){var O;(!S||D&2&&!Jn(g.src,v="/_/images/avatars/avatar"+(((O=M[1])==null?void 0:O.avatar)||0)+".svg"))&&h(g,"src",v);const L={};D&64&&(L.$$scope={dirty:D,ctx:M}),y.$set(L)},i(M){S||(A(y.$$.fragment,M),S=!0)},o(M){P(y.$$.fragment,M),S=!1},d(M){M&&k(e),V(y),$=!1,lt(C)}}}function nO(n){let e,t,i,s,l,o,r;return{c(){e=_("a"),e.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Manage admins</span>`,t=T(),i=_("hr"),s=T(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"tabindex","0"),h(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[tt(wn.call(null,e)),G(l,"click",n[4])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,lt(r)}}}function iO(n){var c;let e,t,i,s,l,o,r,a,u,f=((c=n[1])==null?void 0:c.id)&&n[0]&&Ip(n);return s=new I_({props:{routes:BD}}),s.$on("routeLoading",n[2]),s.$on("conditionsFailed",n[3]),o=new GD({}),a=new tO({}),{c(){e=_("div"),f&&f.c(),t=T(),i=_("div"),z(s.$$.fragment),l=T(),z(o.$$.fragment),r=T(),z(a.$$.fragment),h(i,"class","app-body"),h(e,"class","app-layout")},m(d,p){w(d,e,p),f&&f.m(e,null),m(e,t),m(e,i),q(s,i,null),w(d,l,p),q(o,d,p),w(d,r,p),q(a,d,p),u=!0},p(d,[p]){var g;((g=d[1])==null?void 0:g.id)&&d[0]?f?(f.p(d,p),p&3&&A(f,1)):(f=Ip(d),f.c(),A(f,1),f.m(e,t)):f&&(Te(),P(f,1,1,()=>{f=null}),De())},i(d){u||(A(f),A(s.$$.fragment,d),A(o.$$.fragment,d),A(a.$$.fragment,d),u=!0)},o(d){P(f),P(s.$$.fragment,d),P(o.$$.fragment,d),P(a.$$.fragment,d),u=!1},d(d){d&&k(e),f&&f.d(),V(s),d&&k(l),V(o,d),d&&k(r),V(a,d)}}}function sO(n,e,t){let i;cn(n,ma,u=>t(1,i=u));let s,l=!1;function o(u){var f,c,d,p;((f=u==null?void 0:u.detail)==null?void 0:f.location)!==s&&(t(0,l=!!((d=(c=u==null?void 0:u.detail)==null?void 0:c.userData)!=null&&d.showAppSidebar)),s=(p=u==null?void 0:u.detail)==null?void 0:p.location,W.setDocumentTitle(""),Li({}),r_())}function r(){$s("/")}function a(){Se.logout()}return[l,i,o,r,a]}class lO extends Ee{constructor(e){super(),Ae(this,e,sO,iO,Oe,{})}}new lO({target:document.getElementById("app")});export{lt as A,dn as B,W as C,$s as D,ot as E,ag as F,cn as G,Ss as H,rn as I,On as J,Un as K,ge as L,Ee as S,P as a,T as b,z as c,V as d,_ as e,h as f,w as g,m as h,Ae as i,tt as j,Te as k,wn as l,q as m,De as n,k as o,Se as p,Fe as q,X as r,Oe as s,A as t,G as u,Vt as v,R as w,be as x,oe as y,Ce as z};