659 lines
826 KiB
JavaScript
659 lines
826 KiB
JavaScript
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function oe(){}const gl=n=>n;function at(n,e){for(const t in e)n[t]=e[t];return n}function pm(n){return n()}function Ga(){return Object.create(null)}function Ge(n){n.forEach(pm)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function W_(n){return Object.keys(n).length===0}function hm(n,...e){if(n==null)return oe;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function bt(n,e,t){n.$$.on_destroy.push(hm(e,t))}function wn(n,e,t,i){if(n){const s=mm(n,e,t,i);return n[0](s)}}function mm(n,e,t,i){return n[1]&&i?at(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(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 Sn(n,e,t,i,s,l){if(s){const o=mm(e,t,i,l);n.p(o,s)}}function Cn(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 ni(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Bt(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 Xa(n){return n==null?"":n}function dn(n,e,t){return n.set(t),e}function Ye(n){return n&&Kn(n.destroy)?n.destroy:oe}const gm=typeof window<"u";let Lo=gm?()=>window.performance.now():()=>Date.now(),ra=gm?n=>requestAnimationFrame(n):oe;const bs=new Set;function _m(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&ra(_m)}function Io(n){let e;return bs.size===0&&ra(_m),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function m(n,e){n.appendChild(e)}function bm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Y_(n){const e=_("style");return K_(bm(n),e),e.sheet}function K_(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 Qt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function F(n){return document.createTextNode(n)}function T(){return F(" ")}function Ke(){return F("")}function G(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ei(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function vm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function di(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function Pt(n){return n===""?null:+n}function J_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Te(n,e){n.value=e==null?"":e}function Qa(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ie(n,e,t){n.classList[t?"add":"remove"](e)}function ym(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEvent(n,t,i,e),s}const ao=new Map;let uo=0;function Z_(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function G_(n,e){const t={stylesheet:Y_(e),rules:{}};return ao.set(n,t),t}function ol(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_${Z_(f)}_${r}`,d=bm(n),{stylesheet:h,rules:g}=ao.get(d)||G_(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(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(", "),uo-=s,uo||X_())}function X_(){ra(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function Q_(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=gl,start:a=Lo()+l,end:u=a+o,tick:f=oe,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function v(){c&&(g=ol(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&rl(n,g),d=!1}return Io(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const C=y-a,S=0+1*r(C/o);f(S,1-S)}return!0}),v(),f(0,1),b}function x_(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,km(n,s)}}function km(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 al;function Xs(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Jn(n){Fo().$$.on_mount.push(n)}function eb(n){Fo().$$.after_update.push(n)}function tb(n){Fo().$$.on_destroy.push(n)}function on(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ym(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function st(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],pe=[],no=[],Or=[],wm=Promise.resolve();let Er=!1;function $m(){Er||(Er=!0,wm.then(Sm))}function ii(){return $m(),wm}function Tt(n){no.push(n)}function He(n){Or.push(n)}const xo=new Set;let Il=0;function Sm(){const n=al;do{for(;Il<Ys.length;){const e=Ys[Il];Il++,Xs(e),nb(e.$$)}for(Xs(null),Ys.length=0,Il=0;pe.length;)pe.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];xo.has(t)||(xo.add(t),t())}no.length=0}while(Ys.length);for(;Or.length;)Or.pop()();Er=!1,xo.clear(),Xs(n)}function nb(n){if(n.fragment!==null){n.update(),Ge(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Tt)}}let Is;function aa(){return Is||(Is=Promise.resolve(),Is.then(()=>{Is=null})),Is}function ts(n,e,t){n.dispatchEvent(ym(`${e?"intro":"outro"}${t}`))}const io=new Set;let ai;function Pe(){ai={r:0,c:[],p:ai}}function Le(){ai.r||Ge(ai.c),ai=ai.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ai.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ua={duration:0};function Cm(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=gl,tick:g=oe,css:v}=i||ua;v&&(l=ol(n,0,1,d,c,h,v,r++)),g(0,1);const b=Lo()+c,y=b+d;o&&o.abort(),s=!0,Tt(()=>ts(n,!0,"start")),o=Io(C=>{if(s){if(C>=y)return g(1,0),ts(n,!0,"end"),a(),s=!1;if(C>=b){const S=h((C-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Kn(i)?(i=i(),aa().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Mm(n,e,t){let i=e(n,t),s=!0,l;const o=ai;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=gl,tick:c=oe,css:d}=i||ua;d&&(l=ol(n,1,0,u,a,f,d));const h=Lo()+a,g=h+u;Tt(()=>ts(n,!1,"start")),Io(v=>{if(s){if(v>=g)return c(0,1),ts(n,!1,"end"),--o.r||Ge(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?aa().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function it(n,e,t,i){let s=e(n,t),l=i?0:1,o=null,r=null,a=null;function u(){a&&rl(n,a)}function f(d,h){const g=d.b-l;return h*=Math.abs(g),{a:l,b:d.b,d:g,duration:h,start:d.start,end:d.start+h,group:d.group}}function c(d){const{delay:h=0,duration:g=300,easing:v=gl,tick:b=oe,css:y}=s||ua,C={start:Lo()+h,b:d};d||(C.group=ai,ai.r+=1),o||r?r=C:(y&&(u(),a=ol(n,l,d,g,h,v,y)),d&&b(0,1),o=f(C,g),Tt(()=>ts(n,d,"start")),Io(S=>{if(r&&S>r.start&&(o=f(r,g),r=null,ts(n,o.b,"start"),y&&(u(),a=ol(n,l,o.b,o.duration,0,v,s.css))),o){if(S>=o.end)b(l=o.b,1-l),ts(n,o.b,"end"),r||(o.b?u():--o.group.r||Ge(o.group.c)),o=null;else if(S>=o.start){const $=S-o.start;l=o.a+o.d*v($/o.duration),b(l,1-l)}}return!!(o||r)}))}return{run(d){Kn(s)?aa().then(()=>{s=s(),c(d)}):c(d)},end(){u(),o=r=null}}}function Mn(n,e){n.d(1),e.delete(n.key)}function Zt(n,e){P(n,1,1,()=>{e.delete(n.key)})}function ib(n,e){n.f(),Zt(n,e)}function yt(n,e,t,i,s,l,o,r,a,u,f,c){let d=n.length,h=l.length,g=d;const v={};for(;g--;)v[n[g].key]=g;const b=[],y=new Map,C=new Map;for(g=h;g--;){const D=c(s,l,g),E=t(D);let O=o.get(E);O?i&&O.p(D,e):(O=u(E,D),O.c()),y.set(E,b[g]=O),E in v&&C.set(E,Math.abs(g-v[E]))}const S=new Set,$=new Set;function M(D){A(D,1),D.m(r,f),o.set(D.key,D),f=D.first,h--}for(;d&&h;){const D=b[h-1],E=n[d-1],O=D.key,L=E.key;D===E?(f=D.first,d--,h--):y.has(L)?!o.has(O)||S.has(O)?M(D):$.has(L)?d--:C.get(O)>C.get(L)?($.add(O),M(D)):(S.add(L),d--):(a(E,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;h;)M(b[h-1]);return b}function pn(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 si(n){return typeof n=="object"&&n!==null?n:{}}function Fe(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function V(n){n&&n.c()}function j(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(pm).filter(Kn);o?o.push(...a):Ge(a),n.$$.on_mount=[]}),r.forEach(Tt)}function q(n,e){const t=n.$$;t.fragment!==null&&(Ge(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function sb(n,e){n.$$.dirty[0]===-1&&(Ys.push(n),$m(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function Oe(n,e,t,i,s,l,o,r=[-1]){const a=al;Xs(n);const u=n.$$={fragment:null,ctx:null,props:l,update:oe,not_equal:s,bound:Ga(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:Ga(),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,...h)=>{const g=h.length?h[0]:d;return u.ctx&&s(u.ctx[c],u.ctx[c]=g)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](g),f&&sb(n,c)),d}):[],u.update(),f=!0,Ge(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=J_(e.target);u.fragment&&u.fragment.l(c),c.forEach(k)}else u.fragment&&u.fragment.c();e.intro&&A(n.$$.fragment),j(n,e.target,e.anchor,e.customElement),Sm()}Xs(a)}class Ee{$destroy(){q(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&&!W_(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function en(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 ps=[];function Tm(n,e){return{subscribe:li(n,e).subscribe}}function li(n,e=oe){let t;const i=new Set;function s(r){if(De(n,r)&&(n=r,t)){const a=!ps.length;for(const u of i)u[1](),ps.push(u,n);if(a){for(let u=0;u<ps.length;u+=2)ps[u][0](ps[u+1]);ps.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 Dm(n,e,t){const i=!Array.isArray(n),s=i?[n]:n,l=e.length<2;return Tm(t,o=>{let r=!1;const a=[];let u=0,f=oe;const c=()=>{if(u)return;f();const h=e(i?a[0]:a,o);l?o(h):f=Kn(h)?h:oe},d=s.map((h,g)=>hm(h,v=>{a[g]=v,u&=~(1<<g),r&&c()},()=>{u|=1<<g}));return r=!0,c(),function(){Ge(d),f()}})}function Om(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 lb(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=at(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[7])),{c(){e&&V(e.$$.fragment),t=Ke()},m(r,a){e&&j(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&4?pn(s,[si(r[2])]):{};if(l!==(l=r[0])){if(e){Pe();const f=e;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(e=new l(o()),e.$on("routeEvent",r[7]),V(e.$$.fragment),A(e.$$.fragment,1),j(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&&q(e,r)}}}function ob(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=at(a,s[u]);return{props:a}}return l&&(e=new l(o()),e.$on("routeEvent",n[6])),{c(){e&&V(e.$$.fragment),t=Ke()},m(r,a){e&&j(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a&6?pn(s,[a&2&&{params:r[1]},a&4&&si(r[2])]):{};if(l!==(l=r[0])){if(e){Pe();const f=e;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(e=new l(o()),e.$on("routeEvent",r[6]),V(e.$$.fragment),A(e.$$.fragment,1),j(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&&q(e,r)}}}function rb(n){let e,t,i,s;const l=[ob,lb],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ke()},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):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),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 xa(){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 No=Tm(null,function(e){e(xa());const t=()=>{e(xa())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Dm(No,n=>n.location);const Ro=Dm(No,n=>n.querystring),eu=li(void 0);async function Si(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await ii();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 mn(n,e){if(e=nu(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return tu(n,e),{update(t){t=nu(t),tu(n,t)}}}function ab(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function tu(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||ub(i.currentTarget.getAttribute("href"))})}function nu(n){return n&&typeof n=="string"?{href:n}:n||{}}function ub(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function fb(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:E,keys:O}=Om(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=E,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 L=M.match(s);if(L&&L[0])M=M.substr(L[0].length)||"/";else return null}}const D=this._pattern.exec(M);if(D===null)return null;if(this._keys===!1)return D;const E={};let O=0;for(;O<this._keys.length;){try{E[this._keys[O]]=decodeURIComponent(D[O+1]||"")||null}catch{E[this._keys[O]]=null}O++}return E}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(($,M)=>{r.push(new o(M,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=on();async function d($,M){await ii(),c($,M)}let h=null,g=null;l&&(g=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?h=$.state:h=null},window.addEventListener("popstate",g),eb(()=>{ab(h)}));let v=null,b=null;const y=No.subscribe(async $=>{v=$;let M=0;for(;M<r.length;){const D=r[M].match($.location);if(!D){M++;continue}const E={route:r[M].path,location:$.location,querystring:$.querystring,userData:r[M].userData,params:D&&typeof D=="object"&&Object.keys(D).length?D:null};if(!await r[M].checkConditions(E)){t(0,a=null),b=null,d("conditionsFailed",E);return}d("routeLoading",Object.assign({},E));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({},E,{component:a,name:a.name,params:u}))):(t(0,a=null),b=null);const L=await O();if($!=v)return;t(0,a=L&&L.default||L),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({},E,{component:a,name:a.name,params:u})).then(()=>{eu.set(u)});return}t(0,a=null),b=null,eu.set(void 0)});tb(()=>{y(),g&&window.removeEventListener("popstate",g)});function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,s=$.prefix),"restoreScrollState"in $&&t(5,l=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=l?"manual":"auto")},[a,u,f,i,s,l,C,S]}class cb extends Ee{constructor(e){super(),Oe(this,e,fb,rb,De,{routes:3,prefix:4,restoreScrollState:5})}}const so=[];let Em;function Am(n){const e=n.pattern.test(Em);iu(n,n.className,e),iu(n,n.inactiveClassName,!e)}function iu(n,e,t){(e||"").split(" ").forEach(i=>{!i||(n.node.classList.remove(i),t&&n.node.classList.add(i))})}No.subscribe(n=>{Em=n.location+(n.querystring?"?"+n.querystring:""),so.map(Am)});function jn(n,e){if(e&&(typeof e=="string"||typeof e=="object"&&e instanceof RegExp)?e={path:e}:e=e||{},!e.path&&n.hasAttribute("href")&&(e.path=n.getAttribute("href"),e.path&&e.path.length>1&&e.path.charAt(0)=="#"&&(e.path=e.path.substring(1))),e.className||(e.className="active"),!e.path||typeof e.path=="string"&&(e.path.length<1||e.path.charAt(0)!="/"&&e.path.charAt(0)!="*"))throw Error('Invalid value for "path" argument');const{pattern:t}=typeof e.path=="string"?Om(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return so.push(i),Am(i),{destroy(){so.splice(so.indexOf(i),1)}}}const db="modulepreload",pb=function(n,e){return new URL(n,e).href},su={},Ai=function(e,t,i){return!t||t.length===0?e():Promise.all(t.map(s=>{if(s=pb(s,i),s in su)return;su[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":db,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 Ar=function(n,e){return Ar=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])},Ar(n,e)};function ln(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}Ar(n,e),n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Pr=function(){return Pr=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},Pr.apply(this,arguments)};function ns(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 is(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 Pm,lu=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,Object.setPrototypeOf(s,e.prototype),t instanceof e||(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 ln(e,n),e.prototype.toJSON=function(){return Pr({},this)},e}(Error);Pm=typeof atob=="function"?atob:function(n){return Buffer.from(n,"base64").toString("binary")};var hb=function(){function n(){}return n.getPayload=function(e){if(e)try{var t=decodeURIComponent(Pm(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}(),mb=function(){function n(){this.baseToken="",this.baseModel={},this._onChangeCallbacks=[]}return Object.defineProperty(n.prototype,"token",{get:function(){return this.baseToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"model",{get:function(){return this.baseModel},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isValid",{get:function(){return!hb.isExpired(this.token)},enumerable:!1,configurable:!0}),n.prototype.save=function(e,t){this.baseToken=e,this.baseModel=t,this.triggerChange()},n.prototype.clear=function(){this.baseToken="",this.baseModel={},this.triggerChange()},n.prototype.onChange=function(e){var t=this;return this._onChangeCallbacks.push(e),function(){for(var i=t._onChangeCallbacks.length-1;i>=0;i--)if(t._onChangeCallbacks[i]==e)return delete t._onChangeCallbacks[i],void t._onChangeCallbacks.splice(i,1)}},n.prototype.triggerChange=function(){for(var e=0,t=this._onChangeCallbacks;e<t.length;e++){var i=t[e];i&&i(this.token,this.model)}},n}(),_l=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}(),fo=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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}(_l),co=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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 fo(t.profile):null},e}(_l),$s=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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}(_l),Lm=function(n){function e(t){t===void 0&&(t="pocketbase_auth");var i=n.call(this)||this;return i.fallback={},i.storageKey=t,i}return ln(e,n),Object.defineProperty(e.prototype,"token",{get:function(){return(this._storageGet(this.storageKey)||{}).token||""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"model",{get:function(){var t,i=this._storageGet(this.storageKey)||{};return i===null||typeof i!="object"||i.model===null||typeof i.model!="object"?{}:((t=i.model)===null||t===void 0?void 0:t.verified)!==void 0?new co(i.model):new $s(i.model)},enumerable:!1,configurable:!0}),e.prototype.save=function(t,i){this._storageSet(this.storageKey,{token:t,model:i}),n.prototype.save.call(this,t,i)},e.prototype.clear=function(){this._storageRemove(this.storageKey),n.prototype.clear.call(this)},e.prototype._storageGet=function(t){var i;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var s=((i=window==null?void 0:window.localStorage)===null||i===void 0?void 0:i.getItem(t))||"";try{return JSON.parse(s)}catch{return s}}return this.fallback[t]},e.prototype._storageSet=function(t,i){var s;if(typeof window<"u"&&(window==null?void 0:window.localStorage)){var l=i;typeof i!="string"&&(l=JSON.stringify(i)),(s=window==null?void 0:window.localStorage)===null||s===void 0||s.setItem(t,l)}else this.fallback[t]=i},e.prototype._storageRemove=function(t){var i;typeof window<"u"&&((i=window==null?void 0:window.localStorage)===null||i===void 0||i.removeItem(t)),delete this.fallback[t]},e}(mb),Ho=function(n){this.client=n},gb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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}(Ho),Im=function(n,e,t,i,s){this.page=n>0?n:1,this.perPage=e>=0?e:0,this.totalItems=t>=0?t:0,this.totalPages=i>=0?i:0,this.items=s||[]},Fm=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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 ns(l,void 0,void 0,function(){return is(this,function(u){return[2,this._getList(t,a,i,s).then(function(f){var c=f,d=c.items,h=c.totalItems;return o=o.concat(d),d.length&&h>o.length?r(a+1):o})]})})};return r(1)},e.prototype._getList=function(t,i,s,l){var o=this;return i===void 0&&(i=1),s===void 0&&(s=30),l===void 0&&(l={}),l=Object.assign({page:i,perPage:s},l),this.client.send(t,{method:"GET",params:l}).then(function(r){var a=[];if(r!=null&&r.items){r.items=r.items||[];for(var u=0,f=r.items;u<f.length;u++){var c=f[u];a.push(o.decode(c))}}return new Im((r==null?void 0:r.page)||1,(r==null?void 0:r.perPage)||0,(r==null?void 0:r.totalItems)||0,(r==null?void 0:r.totalPages)||0,a)})},e.prototype._getOne=function(t,i,s){var l=this;return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"GET",params:s}).then(function(o){return l.decode(o)})},e.prototype._create=function(t,i,s){var l=this;return i===void 0&&(i={}),s===void 0&&(s={}),this.client.send(t,{method:"POST",params:s,body:i}).then(function(o){return l.decode(o)})},e.prototype._update=function(t,i,s,l){var o=this;return s===void 0&&(s={}),l===void 0&&(l={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"PATCH",params:l,body:s}).then(function(r){return o.decode(r)})},e.prototype._delete=function(t,i,s){return s===void 0&&(s={}),this.client.send(t+"/"+encodeURIComponent(i),{method:"DELETE",params:s}).then(function(){return!0})},e}(Ho),fa=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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){return i===void 0&&(i={}),this._delete(this.baseCrudPath(),t,i)},e}(Fm),_b=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new $s(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}(fa),bb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new co(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}(fa),Dn=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}(),fn=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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 Dn(l))}},e}(_l),vb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new fn(t)},e.prototype.baseCrudPath=function(){return"/api/collections"},e.prototype.import=function(t,i,s){return i===void 0&&(i=!1),s===void 0&&(s={}),ns(this,void 0,void 0,function(){return is(this,function(l){return[2,this.client.send(this.baseCrudPath()+"/import",{method:"PUT",params:s,body:{collections:t,deleteMissing:i}}).then(function(){return!0})]})})},e}(fa),yb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.decode=function(t){return new fo(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 ln(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){return s===void 0&&(s={}),this._delete(this.baseCrudPath(t),i,s)},e}(Fm)),Lr=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(e,n),e.prototype.load=function(t){n.prototype.load.call(this,t),t.remoteIp=t.remoteIp||t.ip,this.url=typeof t.url=="string"?t.url:"",this.method=typeof t.method=="string"?t.method:"GET",this.status=typeof t.status=="number"?t.status:200,this.auth=typeof t.auth=="string"?t.auth:"guest",this.remoteIp=typeof t.remoteIp=="string"?t.remoteIp:"",this.userIp=typeof t.userIp=="string"?t.userIp:"",this.referer=typeof t.referer=="string"?t.referer:"",this.userAgent=typeof t.userAgent=="string"?t.userAgent:"",this.meta=typeof t.meta=="object"&&t.meta!==null?t.meta:{}},e}(_l),kb=function(n){function e(){return n!==null&&n.apply(this,arguments)||this}return ln(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 Lr(u))}}return new Im((l==null?void 0:l.page)||1,(l==null?void 0:l.perPage)||0,(l==null?void 0:l.totalItems)||0,(l==null?void 0:l.totalPages)||0,o)})},e.prototype.getRequest=function(t,i){return i===void 0&&(i={}),this.client.send("/api/logs/requests/"+encodeURIComponent(t),{method:"GET",params:i}).then(function(s){return new Lr(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}(Ho),wb=function(n){function e(){var t=n!==null&&n.apply(this,arguments)||this;return t.clientId="",t.eventSource=null,t.subscriptions={},t}return ln(e,n),e.prototype.subscribe=function(t,i){var s;return ns(this,void 0,void 0,function(){return is(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 ns(this,void 0,void 0,function(){return is(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 ns(this,void 0,void 0,function(){return is(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}(Ho),ca=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 Lm,this.admins=new _b(this),this.users=new bb(this),this.records=new yb(this),this.collections=new vb(this),this.logs=new kb(this),this.settings=new gb(this),this.realtime=new wb(this)}return Object.defineProperty(n.prototype,"AuthStore",{get:function(){return this.authStore},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Settings",{get:function(){return this.settings},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Admins",{get:function(){return this.admins},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Users",{get:function(){return this.users},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Collections",{get:function(){return this.collections},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Records",{get:function(){return this.records},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Logs",{get:function(){return this.logs},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"Realtime",{get:function(){return this.realtime},enumerable:!1,configurable:!0}),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;return ns(this,void 0,void 0,function(){var d,h,g,v,b,y,C=this;return is(this,function(S){return(d=Object.assign({method:"GET"},t)).body&&d.body.constructor.name!=="FormData"&&(typeof d.body!="string"&&(d.body=JSON.stringify(d.body)),((i=d==null?void 0:d.headers)===null||i===void 0?void 0:i["Content-Type"])===void 0&&(d.headers=Object.assign({},d.headers,{"Content-Type":"application/json"}))),((s=d==null?void 0:d.headers)===null||s===void 0?void 0:s["Accept-Language"])===void 0&&(d.headers=Object.assign({},d.headers,{"Accept-Language":this.lang})),((l=this.authStore)===null||l===void 0?void 0:l.token)&&((o=d==null?void 0:d.headers)===null||o===void 0?void 0:o.Authorization)===void 0&&(h="Admin",((r=this.authStore.model)===null||r===void 0?void 0:r.verified)!==void 0&&(h="User"),d.headers=Object.assign({},d.headers,{Authorization:h+" "+this.authStore.token})),((a=d.params)===null||a===void 0?void 0:a.$autoCancel)!==!1&&(g=((u=d.params)===null||u===void 0?void 0:u.$cancelKey)||(d.method||"GET")+e,this.cancelRequest(g),v=new AbortController,this.cancelControllers[g]=v,d.signal=v.signal),(f=d.params)===null||f===void 0||delete f.$autoCancel,(c=d.params)===null||c===void 0||delete c.$cancelKey,b=this.buildUrl(e),d.params!==void 0&&((y=this.serializeQueryParams(d.params))&&(b+=(b.includes("?")?"&":"?")+y),delete d.params),this.beforeSend&&(d=Object.assign({},this.beforeSend(b,d))),[2,fetch(b,d).then(function($){return ns(C,void 0,void 0,function(){var M;return is(this,function(D){switch(D.label){case 0:M={},D.label=1;case 1:return D.trys.push([1,3,,4]),[4,$.json()];case 2:return M=D.sent(),[3,4];case 3:return D.sent(),[3,4];case 4:if(this.afterSend&&(M=this.afterSend($,M)),$.status>=400)throw new lu({url:$.url,status:$.status,data:M});return[2,M]}})})}).catch(function($){throw new lu($)})]})})},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 as extends Error{}class $b extends as{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class Sb extends as{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class Cb extends as{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class Ks extends as{}class Nm extends as{constructor(e){super(`Invalid unit ${e}`)}}class Vn extends as{}class Di extends as{constructor(){super("Zone is an abstract class")}}const Ve="numeric",ti="short",In="long",Ir={year:Ve,month:Ve,day:Ve},Rm={year:Ve,month:ti,day:Ve},Mb={year:Ve,month:ti,day:Ve,weekday:ti},Hm={year:Ve,month:In,day:Ve},jm={year:Ve,month:In,day:Ve,weekday:In},qm={hour:Ve,minute:Ve},Vm={hour:Ve,minute:Ve,second:Ve},zm={hour:Ve,minute:Ve,second:Ve,timeZoneName:ti},Bm={hour:Ve,minute:Ve,second:Ve,timeZoneName:In},Um={hour:Ve,minute:Ve,hourCycle:"h23"},Wm={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23"},Ym={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23",timeZoneName:ti},Km={hour:Ve,minute:Ve,second:Ve,hourCycle:"h23",timeZoneName:In},Jm={year:Ve,month:Ve,day:Ve,hour:Ve,minute:Ve},Zm={year:Ve,month:Ve,day:Ve,hour:Ve,minute:Ve,second:Ve},Gm={year:Ve,month:ti,day:Ve,hour:Ve,minute:Ve},Xm={year:Ve,month:ti,day:Ve,hour:Ve,minute:Ve,second:Ve},Tb={year:Ve,month:ti,day:Ve,weekday:ti,hour:Ve,minute:Ve},Qm={year:Ve,month:In,day:Ve,hour:Ve,minute:Ve,timeZoneName:ti},xm={year:Ve,month:In,day:Ve,hour:Ve,minute:Ve,second:Ve,timeZoneName:ti},eg={year:Ve,month:In,day:Ve,weekday:In,hour:Ve,minute:Ve,timeZoneName:In},tg={year:Ve,month:In,day:Ve,weekday:In,hour:Ve,minute:Ve,second:Ve,timeZoneName:In};function gt(n){return typeof n>"u"}function ss(n){return typeof n=="number"}function jo(n){return typeof n=="number"&&n%1===0}function Db(n){return typeof n=="string"}function Ob(n){return Object.prototype.toString.call(n)==="[object Date]"}function ng(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Eb(n){return Array.isArray(n)?n:[n]}function ou(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 Ab(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ss(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function ki(n,e,t){return jo(n)&&n>=e&&n<=t}function Pb(n,e){return n-e*Math.floor(n/e)}function Kt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function Ei(n){if(!(gt(n)||n===null||n===""))return parseInt(n,10)}function Ui(n){if(!(gt(n)||n===null||n===""))return parseFloat(n)}function da(n){if(!(gt(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function pa(n,e,t=!1){const i=10**e;return(t?Math.trunc:Math.round)(n*i)/i}function bl(n){return n%4===0&&(n%100!==0||n%400===0)}function Qs(n){return bl(n)?366:365}function po(n,e){const t=Pb(e-1,12)+1,i=n+(e-t)/12;return t===2?bl(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function ha(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 ho(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 Fr(n){return n>99?n:n>60?1900+n:2e3+n}function ig(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 qo(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 sg(n){const e=Number(n);if(typeof n=="boolean"||n===""||Number.isNaN(e))throw new Vn(`Invalid unit value ${n}`);return e}function mo(n,e){const t={};for(const i in n)if(Ss(n,i)){const s=n[i];if(s==null)continue;t[e(i)]=sg(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}${Kt(t,2)}:${Kt(i,2)}`;case"narrow":return`${s}${t}${i>0?`:${i}`:""}`;case"techie":return`${s}${Kt(t,2)}${Kt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Vo(n){return Ab(n,["hour","minute","second","millisecond"])}const lg=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,Lb=["January","February","March","April","May","June","July","August","September","October","November","December"],og=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Ib=["J","F","M","A","M","J","J","A","S","O","N","D"];function rg(n){switch(n){case"narrow":return[...Ib];case"short":return[...og];case"long":return[...Lb];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 ag=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ug=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Fb=["M","T","W","T","F","S","S"];function fg(n){switch(n){case"narrow":return[...Fb];case"short":return[...ug];case"long":return[...ag];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const cg=["AM","PM"],Nb=["Before Christ","Anno Domini"],Rb=["BC","AD"],Hb=["B","A"];function dg(n){switch(n){case"narrow":return[...Hb];case"short":return[...Rb];case"long":return[...Nb];default:return null}}function jb(n){return cg[n.hour<12?0:1]}function qb(n,e){return fg(e)[n.weekday-1]}function Vb(n,e){return rg(e)[n.month-1]}function zb(n,e){return dg(e)[n.year<0?0:1]}function Bb(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 ru(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const Ub={D:Ir,DD:Rm,DDD:Hm,DDDD:jm,t:qm,tt:Vm,ttt:zm,tttt:Bm,T:Um,TT:Wm,TTT:Ym,TTTT:Km,f:Jm,ff:Gm,fff:Qm,ffff:eg,F:Zm,FF:Xm,FFF:xm,FFFF:tg};class kn{static create(e,t={}){return new kn(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 Ub[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 Kt(e,t);const i={...this.opts};return t>0&&(i.padTo=t),this.loc.numberFormatter(i).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",s=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",l=(h,g)=>this.loc.extract(e,h,g),o=h=>e.isOffsetFixed&&e.offset===0&&h.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,h.format):"",r=()=>i?jb(e):l({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(h,g)=>i?Vb(e,h):l(g?{month:h}:{month:h,day:"numeric"},"month"),u=(h,g)=>i?qb(e,h):l(g?{weekday:h}:{weekday:h,month:"long",day:"numeric"},"weekday"),f=h=>{const g=kn.macroTokenToFormatOpts(h);return g?this.formatWithSystemDefault(e,g):h},c=h=>i?zb(e,h):l({era:h},"era"),d=h=>{switch(h){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return s?l({day:"numeric"},"day"):this.num(e.day);case"dd":return s?l({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return u("short",!0);case"cccc":return u("long",!0);case"ccccc":return u("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return u("short",!1);case"EEEE":return u("long",!1);case"EEEEE":return u("narrow",!1);case"L":return s?l({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return s?l({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return a("short",!0);case"LLLL":return a("long",!0);case"LLLLL":return a("narrow",!0);case"M":return s?l({month:"numeric"},"month"):this.num(e.month);case"MM":return s?l({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return a("short",!1);case"MMMM":return a("long",!1);case"MMMMM":return a("narrow",!1);case"y":return s?l({year:"numeric"},"year"):this.num(e.year);case"yy":return s?l({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return s?l({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return s?l({year:"numeric"},"year"):this.num(e.year,6);case"G":return 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(h)}};return ru(kn.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=kn.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 ru(l,s(r))}}class Xn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class vl{get type(){throw new Di}get name(){throw new Di}get ianaName(){return this.name}get isUniversal(){throw new Di}offsetName(e,t){throw new Di}formatOffset(e,t){throw new Di}offset(e){throw new Di}equals(e){throw new Di}get isValid(){throw new Di}}let er=null;class ma extends vl{static get instance(){return er===null&&(er=new ma),er}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return ig(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 lo={};function Wb(n){return lo[n]||(lo[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"})),lo[n]}const Yb={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Kb(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 Jb(n,e){const t=n.formatToParts(e),i=[];for(let s=0;s<t.length;s++){const{type:l,value:o}=t[s],r=Yb[l];l==="era"?i[r]=o:gt(r)||(i[r]=parseInt(o,10))}return i}let Fl={};class wi extends vl{static create(e){return Fl[e]||(Fl[e]=new wi(e)),Fl[e]}static resetCache(){Fl={},lo={}}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=wi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return ig(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=Wb(this.name);let[s,l,o,r,a,u,f]=i.formatToParts?Jb(i,t):Kb(i,t);r==="BC"&&(s=-Math.abs(s)+1);const d=ha({year:s,month:l,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let h=+t;const g=h%1e3;return h-=g>=0?g:1e3+g,(d-h)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let tr=null;class gn extends vl{static get utcInstance(){return tr===null&&(tr=new gn(0)),tr}static instance(e){return e===0?gn.utcInstance:new gn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new gn(qo(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 Zb extends vl{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 Pi(n,e){if(gt(n)||n===null)return e;if(n instanceof vl)return n;if(Db(n)){const t=n.toLowerCase();return t==="local"||t==="system"?e:t==="utc"||t==="gmt"?gn.utcInstance:gn.parseSpecifier(t)||wi.create(n)}else return ss(n)?gn.instance(n):typeof n=="object"&&n.offset&&typeof n.offset=="number"?n:new Zb(n)}let au=()=>Date.now(),uu="system",fu=null,cu=null,du=null,pu;class Xt{static get now(){return au}static set now(e){au=e}static set defaultZone(e){uu=e}static get defaultZone(){return Pi(uu,ma.instance)}static get defaultLocale(){return fu}static set defaultLocale(e){fu=e}static get defaultNumberingSystem(){return cu}static set defaultNumberingSystem(e){cu=e}static get defaultOutputCalendar(){return du}static set defaultOutputCalendar(e){du=e}static get throwOnInvalid(){return pu}static set throwOnInvalid(e){pu=e}static resetCaches(){Rt.resetCache(),wi.resetCache()}}let hu={};function Gb(n,e={}){const t=JSON.stringify([n,e]);let i=hu[t];return i||(i=new Intl.ListFormat(n,e),hu[t]=i),i}let Nr={};function Rr(n,e={}){const t=JSON.stringify([n,e]);let i=Nr[t];return i||(i=new Intl.DateTimeFormat(n,e),Nr[t]=i),i}let Hr={};function Xb(n,e={}){const t=JSON.stringify([n,e]);let i=Hr[t];return i||(i=new Intl.NumberFormat(n,e),Hr[t]=i),i}let jr={};function Qb(n,e={}){const{base:t,...i}=e,s=JSON.stringify([n,i]);let l=jr[s];return l||(l=new Intl.RelativeTimeFormat(n,e),jr[s]=l),l}let Js=null;function xb(){return Js||(Js=new Intl.DateTimeFormat().resolvedOptions().locale,Js)}function e0(n){const e=n.indexOf("-u-");if(e===-1)return[n];{let t;const i=n.substring(0,e);try{t=Rr(n).resolvedOptions()}catch{t=Rr(i).resolvedOptions()}const{numberingSystem:s,calendar:l}=t;return[i,s,l]}}function t0(n,e,t){return(t||e)&&(n+="-u",t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function n0(n){const e=[];for(let t=1;t<=12;t++){const i=Qe.utc(2016,t,1);e.push(n(i))}return e}function i0(n){const e=[];for(let t=1;t<=7;t++){const i=Qe.utc(2016,11,13+t);e.push(n(i))}return e}function Nl(n,e,t,i,s){const l=n.listingMode(t);return l==="error"?null:l==="en"?i(e):s(e)}function s0(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||new Intl.DateTimeFormat(n.intl).resolvedOptions().numberingSystem==="latn"}class l0{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:s,floor:l,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=Xb(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):pa(e,3);return Kt(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&&wi.create(r).valid?(s=r,this.dt=e):(s="UTC",i.timeZoneName?this.dt=e:this.dt=e.offset===0?e:Qe.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,s=e.zone.name);const l={...this.opts};s&&(l.timeZone=s),this.dtf=Rr(t,l)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class r0{constructor(e,t,i){this.opts={style:"long",...i},!t&&ng()&&(this.rtf=Qb(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Bb(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Rt{static fromOpts(e){return Rt.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,i,s=!1){const l=e||Xt.defaultLocale,o=l||(s?"en-US":xb()),r=t||Xt.defaultNumberingSystem,a=i||Xt.defaultOutputCalendar;return new Rt(o,r,a,l)}static resetCache(){Js=null,Nr={},Hr={},jr={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:i}={}){return Rt.create(e,t,i)}constructor(e,t,i,s){const[l,o,r]=e0(e);this.locale=l,this.numberingSystem=t||o||null,this.outputCalendar=i||r||null,this.intl=t0(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=s,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=s0(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&t?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:Rt.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 Nl(this,e,i,rg,()=>{const s=t?{month:e,day:"numeric"}:{month:e},l=t?"format":"standalone";return this.monthsCache[l][e]||(this.monthsCache[l][e]=n0(o=>this.extract(o,s,"month"))),this.monthsCache[l][e]})}weekdays(e,t=!1,i=!0){return Nl(this,e,i,fg,()=>{const s=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=i0(o=>this.extract(o,s,"weekday"))),this.weekdaysCache[l][e]})}meridiems(e=!0){return Nl(this,void 0,e,()=>cg,()=>{if(!this.meridiemCache){const t={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Qe.utc(2016,11,13,9),Qe.utc(2016,11,13,19)].map(i=>this.extract(i,t,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Nl(this,e,t,dg,()=>{const i={era:e};return this.eraCache[e]||(this.eraCache[e]=[Qe.utc(-40,1,1),Qe.utc(2017,1,1)].map(s=>this.extract(s,i,"era"))),this.eraCache[e]})}extract(e,t,i){const s=this.dtFormatter(e,t),l=s.formatToParts(),o=l.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new l0(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new o0(e,this.intl,t)}relFormatter(e={}){return new r0(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Gb(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 Os(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Es(...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 As(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 pg(...n){return(e,t)=>{const i={};let s;for(s=0;s<n.length;s++)i[n[s]]=Ei(e[t+s]);return[i,null,t+s]}}const hg=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,a0=`(?:${hg.source}?(?:\\[(${lg.source})\\])?)?`,ga=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,mg=RegExp(`${ga.source}${a0}`),_a=RegExp(`(?:T${mg.source})?`),u0=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,f0=/(\d{4})-?W(\d\d)(?:-?(\d))?/,c0=/(\d{4})-?(\d{3})/,d0=pg("weekYear","weekNumber","weekDay"),p0=pg("year","ordinal"),h0=/(\d{4})-(\d\d)-(\d\d)/,gg=RegExp(`${ga.source} ?(?:${hg.source}|(${lg.source}))?`),m0=RegExp(`(?: ${gg.source})?`);function vs(n,e,t){const i=n[e];return gt(i)?t:Ei(i)}function g0(n,e){return[{year:vs(n,e),month:vs(n,e+1,1),day:vs(n,e+2,1)},null,e+3]}function Ps(n,e){return[{hours:vs(n,e,0),minutes:vs(n,e+1,0),seconds:vs(n,e+2,0),milliseconds:da(n[e+3])},null,e+4]}function yl(n,e){const t=!n[e]&&!n[e+1],i=qo(n[e+1],n[e+2]),s=t?null:gn.instance(i);return[{},s,e+3]}function kl(n,e){const t=n[e]?wi.create(n[e]):null;return[{},t,e+1]}const _0=RegExp(`^T?${ga.source}$`),b0=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function v0(n){const[e,t,i,s,l,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(h,g=!1)=>h!==void 0&&(g||h&&f)?-h:h;return[{years:d(Ui(t)),months:d(Ui(i)),weeks:d(Ui(s)),days:d(Ui(l)),hours:d(Ui(o)),minutes:d(Ui(r)),seconds:d(Ui(a),a==="-0"),milliseconds:d(da(u),c)}]}const y0={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function ba(n,e,t,i,s,l,o){const r={year:e.length===2?Fr(Ei(e)):Ei(e),month:og.indexOf(t)+1,day:Ei(i),hour:Ei(s),minute:Ei(l)};return o&&(r.second=Ei(o)),n&&(r.weekday=n.length>3?ag.indexOf(n)+1:ug.indexOf(n)+1),r}const k0=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function w0(n){const[,e,t,i,s,l,o,r,a,u,f,c]=n,d=ba(e,s,i,t,l,o,r);let h;return a?h=y0[a]:u?h=0:h=qo(f,c),[d,new gn(h)]}function $0(n){return n.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const S0=/^(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$/,C0=/^(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$/,M0=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function mu(n){const[,e,t,i,s,l,o,r]=n;return[ba(e,s,i,t,l,o,r),gn.utcInstance]}function T0(n){const[,e,t,i,s,l,o,r]=n;return[ba(e,r,t,i,s,l,o),gn.utcInstance]}const D0=Os(u0,_a),O0=Os(f0,_a),E0=Os(c0,_a),A0=Os(mg),_g=Es(g0,Ps,yl,kl),P0=Es(d0,Ps,yl,kl),L0=Es(p0,Ps,yl,kl),I0=Es(Ps,yl,kl);function F0(n){return As(n,[D0,_g],[O0,P0],[E0,L0],[A0,I0])}function N0(n){return As($0(n),[k0,w0])}function R0(n){return As(n,[S0,mu],[C0,mu],[M0,T0])}function H0(n){return As(n,[b0,v0])}const j0=Es(Ps);function q0(n){return As(n,[_0,j0])}const V0=Os(h0,m0),z0=Os(gg),B0=Es(Ps,yl,kl);function U0(n){return As(n,[V0,_g],[z0,B0])}const W0="Invalid Duration",bg={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Y0={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...bg},Fn=146097/400,hs=146097/4800,K0={years:{quarters:4,months:12,weeks:Fn/7,days:Fn,hours:Fn*24,minutes:Fn*24*60,seconds:Fn*24*60*60,milliseconds:Fn*24*60*60*1e3},quarters:{months:3,weeks:Fn/28,days:Fn/4,hours:Fn*24/4,minutes:Fn*24*60/4,seconds:Fn*24*60*60/4,milliseconds:Fn*24*60*60*1e3/4},months:{weeks:hs/7,days:hs,hours:hs*24,minutes:hs*24*60,seconds:hs*24*60*60,milliseconds:hs*24*60*60*1e3},...bg},Gi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],J0=Gi.slice(0).reverse();function Wi(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 kt(i)}function Z0(n){return n<0?Math.floor(n):Math.ceil(n)}function vg(n,e,t,i,s){const l=n[s][t],o=e[t]/l,r=Math.sign(o)===Math.sign(i[s]),a=!r&&i[s]!==0&&Math.abs(o)<=1?Z0(o):Math.trunc(o);i[s]+=a,e[t]-=a*l}function G0(n,e){J0.reduce((t,i)=>gt(e[i])?t:(t&&vg(n,e,t,e,i),i),null)}class kt{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;this.values=e.values,this.loc=e.loc||Rt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?K0:Y0,this.isLuxonDuration=!0}static fromMillis(e,t){return kt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new Vn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new kt({values:mo(e,kt.normalizeUnit),loc:Rt.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(ss(e))return kt.fromMillis(e);if(kt.isDuration(e))return e;if(typeof e=="object")return kt.fromObject(e);throw new Vn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=H0(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=q0(e);return i?kt.fromObject(i,t):kt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the Duration is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Xt.throwOnInvalid)throw new Cb(i);return new kt({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 Nm(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?kn.create(this.loc,i).formatDurationFromString(this,e):W0}toHuman(e={}){const t=Gi.map(i=>{const s=this.values[i];return gt(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+=pa(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=kt.fromDurationLike(e),i={};for(const s of Gi)(Ss(t.values,s)||Ss(this.values,s))&&(i[s]=t.get(s)+this.get(s));return Wi(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=kt.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]=sg(e(this.values[i],i));return Wi(this,{values:t},!0)}get(e){return this[kt.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...mo(e,kt.normalizeUnit)};return Wi(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),Wi(this,l)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return G0(this.matrix,e),Wi(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>kt.normalizeUnit(o));const t={},i={},s=this.toObject();let l;for(const o of Gi)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;ss(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)Gi.indexOf(u)>Gi.indexOf(o)&&vg(this.matrix,s,u,t,o)}else ss(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 Wi(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 Wi(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 Gi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const Fs="Invalid Interval";function X0(n,e){return!n||!n.isValid?qt.invalid("missing or invalid start"):!e||!e.isValid?qt.invalid("missing or invalid end"):e<n?qt.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 qt{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 Vn("need to specify a reason the Interval is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Xt.throwOnInvalid)throw new Sb(i);return new qt({invalid:i})}static fromDateTimes(e,t){const i=Hs(e),s=Hs(t),l=X0(i,s);return l==null?new qt({start:i,end:s}):l}static after(e,t){const i=kt.fromDurationLike(t),s=Hs(e);return qt.fromDateTimes(s,s.plus(i))}static before(e,t){const i=kt.fromDurationLike(t),s=Hs(e);return qt.fromDateTimes(s.minus(i),s)}static fromISO(e,t){const[i,s]=(e||"").split("/",2);if(i&&s){let l,o;try{l=Qe.fromISO(i,t),o=l.isValid}catch{o=!1}let r,a;try{r=Qe.fromISO(s,t),a=r.isValid}catch{a=!1}if(o&&a)return qt.fromDateTimes(l,r);if(o){const u=kt.fromISO(s,t);if(u.isValid)return qt.after(l,u)}else if(a){const u=kt.fromISO(i,t);if(u.isValid)return qt.before(r,u)}}return qt.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?qt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(Hs).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(qt.fromDateTimes(s,r)),s=r,l+=1}return i}splitBy(e){const t=kt.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(qt.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:qt.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 qt.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(qt.fromDateTimes(t,a.time)),t=null);return qt.merge(s)}difference(...e){return qt.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()})`:Fs}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Fs}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Fs}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Fs}toFormat(e,{separator:t=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Fs}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):kt.invalid(this.invalidReason)}mapEndpoints(e){return qt.fromDateTimes(e(this.s),e(this.e))}}class Rl{static hasDST(e=Xt.defaultZone){const t=Qe.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return wi.isValidZone(e)}static normalizeZone(e){return Pi(e,Xt.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null,outputCalendar:l="gregory"}={}){return(s||Rt.create(t,i,l)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:s=null}={}){return(s||Rt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Rt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Rt.create(t,null,"gregory").eras(e)}static features(){return{relative:ng()}}}function gu(n,e){const t=s=>s.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(kt.fromMillis(i).as("days"))}function Q0(n,e,t){const i=[["years",(r,a)=>a.year-r.year],["quarters",(r,a)=>a.quarter-r.quarter],["months",(r,a)=>a.month-r.month+(a.year-r.year)*12],["weeks",(r,a)=>{const u=gu(r,a);return(u-u%7)/7}],["days",gu]],s={};let l,o;for(const[r,a]of i)if(t.indexOf(r)>=0){l=r;let u=a(n,e);o=n.plus({[r]:u}),o>e?(n=n.plus({[r]:u-1}),u-=1):n=o,s[r]=u}return[n,s,o,l]}function x0(n,e,t,i){let[s,l,o,r]=Q0(n,e,t);const a=e-s,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=s.plus({[r]:1})),o!==s&&(l[r]=(l[r]||0)+a/(o-s)));const f=kt.fromObject(l,i);return u.length>0?kt.fromMillis(a,i).shiftTo(...u).plus(f):f}const va={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"},_u={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]},e1=va.hanidec.replace(/[\[|\]]/g,"").split("");function t1(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(va.hanidec)!==-1)e+=e1.indexOf(n[t]);else for(const s in _u){const[l,o]=_u[s];i>=l&&i<=o&&(e+=i-l)}}return parseInt(e,10)}else return e}function Zn({numberingSystem:n},e=""){return new RegExp(`${va[n||"latn"]}${e}`)}const n1="missing Intl.DateTimeFormat.formatToParts support";function $t(n,e=t=>t){return{regex:n,deser:([t])=>e(t1(t))}}const i1=String.fromCharCode(160),yg=`[ ${i1}]`,kg=new RegExp(yg,"g");function s1(n){return n.replace(/\./g,"\\.?").replace(kg,yg)}function bu(n){return n.replace(/\./g,"").replace(kg," ").toLowerCase()}function Gn(n,e){return n===null?null:{regex:RegExp(n.map(s1).join("|")),deser:([t])=>n.findIndex(i=>bu(t)===bu(i))+e}}function vu(n,e){return{regex:n,deser:([,t,i])=>qo(t,i),groups:e}}function nr(n){return{regex:n,deser:([e])=>e}}function l1(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o1(n,e){const t=Zn(e),i=Zn(e,"{2}"),s=Zn(e,"{3}"),l=Zn(e,"{4}"),o=Zn(e,"{6}"),r=Zn(e,"{1,2}"),a=Zn(e,"{1,3}"),u=Zn(e,"{1,6}"),f=Zn(e,"{1,9}"),c=Zn(e,"{2,4}"),d=Zn(e,"{4,6}"),h=b=>({regex:RegExp(l1(b.val)),deser:([y])=>y,literal:!0}),v=(b=>{if(n.literal)return h(b);switch(b.val){case"G":return Gn(e.eras("short",!1),0);case"GG":return Gn(e.eras("long",!1),0);case"y":return $t(u);case"yy":return $t(c,Fr);case"yyyy":return $t(l);case"yyyyy":return $t(d);case"yyyyyy":return $t(o);case"M":return $t(r);case"MM":return $t(i);case"MMM":return Gn(e.months("short",!0,!1),1);case"MMMM":return Gn(e.months("long",!0,!1),1);case"L":return $t(r);case"LL":return $t(i);case"LLL":return Gn(e.months("short",!1,!1),1);case"LLLL":return Gn(e.months("long",!1,!1),1);case"d":return $t(r);case"dd":return $t(i);case"o":return $t(a);case"ooo":return $t(s);case"HH":return $t(i);case"H":return $t(r);case"hh":return $t(i);case"h":return $t(r);case"mm":return $t(i);case"m":return $t(r);case"q":return $t(r);case"qq":return $t(i);case"s":return $t(r);case"ss":return $t(i);case"S":return $t(a);case"SSS":return $t(s);case"u":return nr(f);case"uu":return nr(r);case"uuu":return $t(t);case"a":return Gn(e.meridiems(),0);case"kkkk":return $t(l);case"kk":return $t(c,Fr);case"W":return $t(r);case"WW":return $t(i);case"E":case"c":return $t(t);case"EEE":return Gn(e.weekdays("short",!1,!1),1);case"EEEE":return Gn(e.weekdays("long",!1,!1),1);case"ccc":return Gn(e.weekdays("short",!0,!1),1);case"cccc":return Gn(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return vu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return vu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return nr(/[a-z_+-/]{1,256}?/i);default:return h(b)}})(n)||{invalidReason:n1};return v.token=n,v}const r1={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 a1(n,e,t){const{type:i,value:s}=n;if(i==="literal")return{literal:!0,val:s};const l=t[i];let o=r1[i];if(typeof o=="object"&&(o=o[l]),o)return{literal:!1,val:o}}function u1(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function f1(n,e,t){const i=n.match(e);if(i){const s={};let l=1;for(const o in t)if(Ss(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 c1(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 gt(n.z)||(t=wi.create(n.z)),gt(n.Z)||(t||(t=new gn(n.Z)),i=n.Z),gt(n.q)||(n.M=(n.q-1)*3+1),gt(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),gt(n.u)||(n.S=da(n.u)),[Object.keys(n).reduce((l,o)=>{const r=e(o);return r&&(l[r]=n[o]),l},{}),t,i]}let ir=null;function d1(){return ir||(ir=Qe.fromMillis(1555555555555)),ir}function p1(n,e){if(n.literal)return n;const t=kn.macroTokenToFormatOpts(n.val);if(!t)return n;const l=kn.create(e,t).formatDateTimeParts(d1()).map(o=>a1(o,e,t));return l.includes(void 0)?n:l}function h1(n,e){return Array.prototype.concat(...n.map(t=>p1(t,e)))}function wg(n,e,t){const i=h1(kn.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]=u1(s),a=RegExp(o,"i"),[u,f]=f1(e,a,r),[c,d,h]=f?c1(f):[null,null,void 0];if(Ss(f,"a")&&Ss(f,"H"))throw new Ks("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:h}}}function m1(n,e,t){const{result:i,zone:s,specificOffset:l,invalidReason:o}=wg(n,e,t);return[i,s,l,o]}const $g=[0,31,59,90,120,151,181,212,243,273,304,334],Sg=[0,31,60,91,121,152,182,213,244,274,305,335];function Bn(n,e){return new Xn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Cg(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 Mg(n,e,t){return t+(bl(n)?Sg:$g)[e-1]}function Tg(n,e){const t=bl(n)?Sg:$g,i=t.findIndex(l=>l<e),s=e-t[i];return{month:i+1,day:s}}function qr(n){const{year:e,month:t,day:i}=n,s=Mg(e,t,i),l=Cg(e,t,i);let o=Math.floor((s-l+10)/7),r;return o<1?(r=e-1,o=ho(r)):o>ho(e)?(r=e+1,o=1):r=e,{weekYear:r,weekNumber:o,weekday:l,...Vo(n)}}function yu(n){const{weekYear:e,weekNumber:t,weekday:i}=n,s=Cg(e,1,4),l=Qs(e);let o=t*7+i-s-3,r;o<1?(r=e-1,o+=Qs(r)):o>l?(r=e+1,o-=Qs(e)):r=e;const{month:a,day:u}=Tg(r,o);return{year:r,month:a,day:u,...Vo(n)}}function sr(n){const{year:e,month:t,day:i}=n,s=Mg(e,t,i);return{year:e,ordinal:s,...Vo(n)}}function ku(n){const{year:e,ordinal:t}=n,{month:i,day:s}=Tg(e,t);return{year:e,month:i,day:s,...Vo(n)}}function g1(n){const e=jo(n.weekYear),t=ki(n.weekNumber,1,ho(n.weekYear)),i=ki(n.weekday,1,7);return e?t?i?!1:Bn("weekday",n.weekday):Bn("week",n.week):Bn("weekYear",n.weekYear)}function _1(n){const e=jo(n.year),t=ki(n.ordinal,1,Qs(n.year));return e?t?!1:Bn("ordinal",n.ordinal):Bn("year",n.year)}function Dg(n){const e=jo(n.year),t=ki(n.month,1,12),i=ki(n.day,1,po(n.year,n.month));return e?t?i?!1:Bn("day",n.day):Bn("month",n.month):Bn("year",n.year)}function Og(n){const{hour:e,minute:t,second:i,millisecond:s}=n,l=ki(e,0,23)||e===24&&t===0&&i===0&&s===0,o=ki(t,0,59),r=ki(i,0,59),a=ki(s,0,999);return l?o?r?a?!1:Bn("millisecond",s):Bn("second",i):Bn("minute",t):Bn("hour",e)}const lr="Invalid DateTime",wu=864e13;function Hl(n){return new Xn("unsupported zone",`the zone "${n.name}" is not supported`)}function or(n){return n.weekData===null&&(n.weekData=qr(n.c)),n.weekData}function Ns(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new Qe({...t,...e,old:t})}function 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 $u(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 oo(n,e,t){return Eg(ha(n),e,t)}function Su(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,po(i,s))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=kt.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=ha(l);let[a,u]=Eg(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function Rs(n,e,t,i,s,l){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0){const a=e||r,u=Qe.fromObject(n,{...t,zone:a,specificOffset:l});return o?u:u.setZone(r)}else return Qe.invalid(new Xn("unparsable",`the input "${s}" can't be parsed as ${i}`))}function jl(n,e,t=!0){return n.isValid?kn.create(Rt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function rr(n,e){const t=n.c.year>9999||n.c.year<0;let i="";return t&&n.c.year>=0&&(i+="+"),i+=Kt(n.c.year,t?6:4),e?(i+="-",i+=Kt(n.c.month),i+="-",i+=Kt(n.c.day)):(i+=Kt(n.c.month),i+=Kt(n.c.day)),i}function Cu(n,e,t,i,s,l){let o=Kt(n.c.hour);return e?(o+=":",o+=Kt(n.c.minute),(n.c.second!==0||!t)&&(o+=":")):o+=Kt(n.c.minute),(n.c.second!==0||!t)&&(o+=Kt(n.c.second),(n.c.millisecond!==0||!i)&&(o+=".",o+=Kt(n.c.millisecond,3))),s&&(n.isOffsetFixed&&n.offset===0&&!l?o+="Z":n.o<0?(o+="-",o+=Kt(Math.trunc(-n.o/60)),o+=":",o+=Kt(Math.trunc(-n.o%60))):(o+="+",o+=Kt(Math.trunc(n.o/60)),o+=":",o+=Kt(Math.trunc(n.o%60)))),l&&(o+="["+n.zone.ianaName+"]"),o}const Ag={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},b1={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},v1={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Pg=["year","month","day","hour","minute","second","millisecond"],y1=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],k1=["year","ordinal","hour","minute","second","millisecond"];function Mu(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 Nm(n);return e}function Tu(n,e){const t=Pi(e.zone,Xt.defaultZone),i=Rt.fromObject(e),s=Xt.now();let l,o;if(gt(n.year))l=s;else{for(const u of Pg)gt(n[u])&&(n[u]=Ag[u]);const r=Dg(n)||Og(n);if(r)return Qe.invalid(r);const a=t.offset(s);[l,o]=oo(n,a,t)}return new Qe({ts:l,zone:t,loc:i,o})}function Du(n,e,t){const i=gt(t.round)?!0:t.round,s=(o,r)=>(o=pa(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 Ou(n){let e={},t;return n.length>0&&typeof n[n.length-1]=="object"?(e=n[n.length-1],t=Array.from(n).slice(0,n.length-1)):t=Array.from(n),[e,t]}class Qe{constructor(e){const t=e.zone||Xt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new Xn("invalid input"):null)||(t.isValid?null:Hl(t));this.ts=gt(e.ts)?Xt.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=$u(this.ts,r),i=Number.isNaN(s.year)?new Xn("invalid input"):null,s=i?null:s,l=i?null:r}this._zone=t,this.loc=e.loc||Rt.create(),this.invalid=i,this.weekData=null,this.c=s,this.o=l,this.isLuxonDateTime=!0}static now(){return new Qe({})}static local(){const[e,t]=Ou(arguments),[i,s,l,o,r,a,u]=t;return Tu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Ou(arguments),[i,s,l,o,r,a,u]=t;return e.zone=gn.utcInstance,Tu({year:i,month:s,day:l,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=Ob(e)?e.valueOf():NaN;if(Number.isNaN(i))return Qe.invalid("invalid input");const s=Pi(t.zone,Xt.defaultZone);return s.isValid?new Qe({ts:i,zone:s,loc:Rt.fromObject(t)}):Qe.invalid(Hl(s))}static fromMillis(e,t={}){if(ss(e))return e<-wu||e>wu?Qe.invalid("Timestamp out of range"):new Qe({ts:e,zone:Pi(t.zone,Xt.defaultZone),loc:Rt.fromObject(t)});throw new Vn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(ss(e))return new Qe({ts:e*1e3,zone:Pi(t.zone,Xt.defaultZone),loc:Rt.fromObject(t)});throw new Vn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Pi(t.zone,Xt.defaultZone);if(!i.isValid)return Qe.invalid(Hl(i));const s=Xt.now(),l=gt(t.specificOffset)?i.offset(s):t.specificOffset,o=mo(e,Mu),r=!gt(o.ordinal),a=!gt(o.year),u=!gt(o.month)||!gt(o.day),f=a||u,c=o.weekYear||o.weekNumber,d=Rt.fromObject(t);if((f||r)&&c)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(u&&r)throw new Ks("Can't mix ordinal dates with month/day");const h=c||o.weekday&&!f;let g,v,b=$u(s,l);h?(g=y1,v=b1,b=qr(b)):r?(g=k1,v=v1,b=sr(b)):(g=Pg,v=Ag);let y=!1;for(const O of g){const L=o[O];gt(L)?y?o[O]=v[O]:o[O]=b[O]:y=!0}const C=h?g1(o):r?_1(o):Dg(o),S=C||Og(o);if(S)return Qe.invalid(S);const $=h?yu(o):r?ku(o):o,[M,D]=oo($,l,i),E=new Qe({ts:M,zone:i,o:D,loc:d});return o.weekday&&f&&e.weekday!==E.weekday?Qe.invalid("mismatched weekday",`you can't specify both a weekday of ${o.weekday} and a date of ${E.toISO()}`):E}static fromISO(e,t={}){const[i,s]=F0(e);return Rs(i,s,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,s]=N0(e);return Rs(i,s,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,s]=R0(e);return Rs(i,s,t,"HTTP",t)}static fromFormat(e,t,i={}){if(gt(e)||gt(t))throw new Vn("fromFormat requires an input string and a format");const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0}),[r,a,u,f]=m1(o,e,t);return f?Qe.invalid(f):Rs(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return Qe.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,s]=U0(e);return Rs(i,s,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new Vn("need to specify a reason the DateTime is invalid");const i=e instanceof Xn?e:new Xn(e,t);if(Xt.throwOnInvalid)throw new $b(i);return new Qe({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?or(this).weekYear:NaN}get weekNumber(){return this.isValid?or(this).weekNumber:NaN}get weekday(){return this.isValid?or(this).weekday:NaN}get ordinal(){return this.isValid?sr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Rl.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Rl.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Rl.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Rl.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 bl(this.year)}get daysInMonth(){return po(this.year,this.month)}get daysInYear(){return this.isValid?Qs(this.year):NaN}get weeksInWeekYear(){return this.isValid?ho(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:s}=kn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:s}}toUTC(e=0,t={}){return this.setZone(gn.instance(e),t)}toLocal(){return this.setZone(Xt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Pi(e,Xt.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]=oo(o,l,e)}return Ns(this,{ts:s,zone:e})}else return Qe.invalid(Hl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const s=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ns(this,{loc:s})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=mo(e,Mu),i=!gt(t.weekYear)||!gt(t.weekNumber)||!gt(t.weekday),s=!gt(t.ordinal),l=!gt(t.year),o=!gt(t.month)||!gt(t.day),r=l||o,a=t.weekYear||t.weekNumber;if((r||s)&&a)throw new Ks("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(o&&s)throw new Ks("Can't mix ordinal dates with month/day");let u;i?u=yu({...qr(this.c),...t}):gt(t.ordinal)?(u={...this.toObject(),...t},gt(t.day)&&(u.day=Math.min(po(u.year,u.month),u.day))):u=ku({...sr(this.c),...t});const[f,c]=oo(u,this.o,this.zone);return Ns(this,{ts:f,o:c})}plus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e);return Ns(this,Su(this,t))}minus(e){if(!this.isValid)return this;const t=kt.fromDurationLike(e).negate();return Ns(this,Su(this,t))}startOf(e){if(!this.isValid)return this;const t={},i=kt.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?kn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):lr}toLocaleString(e=Ir,t={}){return this.isValid?kn.create(this.loc.clone(t),e).formatDateTime(this):lr}toLocaleParts(e={}){return this.isValid?kn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:s=!0,extendedZone:l=!1}={}){if(!this.isValid)return null;const o=e==="extended";let r=rr(this,o);return r+="T",r+=Cu(this,o,t,i,s,l),r}toISODate({format:e="extended"}={}){return this.isValid?rr(this,e==="extended"):null}toISOWeekDate(){return jl(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":"")+Cu(this,o==="extended",t,e,i,l):null}toRFC2822(){return jl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?rr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let s="HH:mm:ss.SSS";return(t||e)&&(i&&(s+=" "),t?s+="z":e&&(s+="ZZ")),jl(this,s,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():lr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",i={}){if(!this.isValid||!e.isValid)return kt.invalid("created by diffing an invalid DateTime");const s={locale:this.locale,numberingSystem:this.numberingSystem,...i},l=Eb(t).map(kt.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=x0(r,a,l,s);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(Qe.now(),e,t)}until(e){return this.isValid?qt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const i=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t)<=i&&i<=s.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Qe.fromObject({},{zone:this.zone}),i=e.padding?this<t?-e.padding:e.padding:0;let s=["years","months","days","hours","minutes","seconds"],l=e.unit;return Array.isArray(e.unit)&&(s=e.unit,l=void 0),Du(t,this.plus(i),{...e,numeric:"always",units:s,unit:l})}toRelativeCalendar(e={}){return this.isValid?Du(e.base||Qe.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(Qe.isDateTime))throw new Vn("min requires all arguments be DateTimes");return ou(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(Qe.isDateTime))throw new Vn("max requires all arguments be DateTimes");return ou(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:s=null,numberingSystem:l=null}=i,o=Rt.fromOpts({locale:s,numberingSystem:l,defaultToEN:!0});return wg(o,e,t)}static fromStringExplain(e,t,i={}){return Qe.fromFormatExplain(e,t,i)}static get DATE_SHORT(){return Ir}static get DATE_MED(){return Rm}static get DATE_MED_WITH_WEEKDAY(){return Mb}static get DATE_FULL(){return Hm}static get DATE_HUGE(){return jm}static get TIME_SIMPLE(){return qm}static get TIME_WITH_SECONDS(){return Vm}static get TIME_WITH_SHORT_OFFSET(){return zm}static get TIME_WITH_LONG_OFFSET(){return Bm}static get TIME_24_SIMPLE(){return Um}static get TIME_24_WITH_SECONDS(){return Wm}static get TIME_24_WITH_SHORT_OFFSET(){return Ym}static get TIME_24_WITH_LONG_OFFSET(){return Km}static get DATETIME_SHORT(){return Jm}static get DATETIME_SHORT_WITH_SECONDS(){return Zm}static get DATETIME_MED(){return Gm}static get DATETIME_MED_WITH_SECONDS(){return Xm}static get DATETIME_MED_WITH_WEEKDAY(){return Tb}static get DATETIME_FULL(){return Qm}static get DATETIME_FULL_WITH_SECONDS(){return xm}static get DATETIME_HUGE(){return eg}static get DATETIME_HUGE_WITH_SECONDS(){return tg}}function Hs(n){if(Qe.isDateTime(n))return n;if(n&&n.valueOf&&ss(n.valueOf()))return Qe.fromJSDate(n);if(n&&typeof n=="object")return Qe.fromObject(n);throw new Vn(`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 toArray(e,t=!1){return Array.isArray(e)?e:(t||!W.isEmpty(e))&&typeof e<"u"?[e]:[]}static inArray(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t)return!0;return!1}static removeByValue(e,t){e=Array.isArray(e)?e:[];for(let i=e.length-1;i>=0;i--)if(e[i]==t){e.splice(i,1);break}}static pushUnique(e,t){W.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let s in e)if(e[s][t]==i)return e[s];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let s in e)i[e[s][t]]=i[e[s][t]]||[],i[e[s][t]].push(e[s]);return i}static removeByKey(e,t,i){for(let s in e)if(e[s][t]==i){e.splice(s,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let s=e.length-1;s>=0;s--)if(e[s][i]==t[i]){e[s]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const s of e)i[s[t]]=s;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let s in i)typeof i[s]=="object"&&i[s]!==null?i[s]=W.filterRedactedProps(i[s],t):i[s]===t&&delete i[s];return i}static getNestedVal(e,t,i=null,s="."){let l=e||{},o=(t||"").split(s);for(const r of o){if(!W.isObject(l)&&!Array.isArray(l)||typeof l[r]>"u")return i;l=l[r]}return l}static setByPath(e,t,i,s="."){if(!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 Qe.fromFormat(e,s,{zone:"UTC"})}return Qe.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 downloadJson(e,t){const i="data:text/json;charset=utf-8,"+encodeURIComponent(JSON.stringify(e,null,2)),s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",t+".json"),s.click(),s.remove()}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return/\.jpg|\.jpeg|\.png|\.svg|\.gif|\.webp|\.avif$/.test(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 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"}}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const s=Array.isArray(e.schema)?e.schema:[],l=Array.isArray(t.schema)?t.schema:[],o=s.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(l,"id",u.id)),r=l.filter(u=>(u==null?void 0:u.id)&&!W.findByKey(s,"id",u.id)),a=l.filter(u=>{const f=W.isObject(u)&&W.findByKey(s,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}}const ya=li([]);function Lg(n,e=4e3){return ka(n,"info",e)}function cn(n,e=3e3){return ka(n,"success",e)}function go(n,e=4500){return ka(n,"error",e)}function ka(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Ig(i)},t)};ya.update(s=>(Fg(s,i.message),W.pushOrReplaceByKey(s,i,"message"),s))}function Ig(n){ya.update(e=>(Fg(e,n),e))}function Fg(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 qi=li({});function hi(n){qi.set(n||{})}function wa(n){qi.update(e=>(W.deleteByPath(e,n),e))}const $a=li({});function Vr(n){$a.set(n||{})}ca.prototype.logout=function(n=!0){this.authStore.clear(),n&&Si("/login")};ca.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&&go(l)}if(W.isEmpty(s.data)||hi(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Si("/")};class w1 extends Lm{save(e,t){super.save(e,t),t instanceof $s&&Vr(t)}clear(){super.clear(),Vr(null)}}const we=new ca("../","en-US",new w1("pb_admin_auth"));we.authStore.model instanceof $s&&Vr(we.authStore.model);function $1(n){let e,t,i,s,l,o,r,a;const u=n[3].default,f=wn(u,n,n[2],null);return{c(){e=_("div"),t=_("main"),f&&f.c(),i=T(),s=_("footer"),l=_("a"),o=_("span"),o.textContent="PocketBase v0.5.0",p(t,"class","page-content"),p(o,"class","txt"),p(l,"href","https://github.com/pocketbase/pocketbase/releases"),p(l,"class","inline-flex flex-gap-5"),p(l,"target","_blank"),p(l,"rel","noopener"),p(l,"title","Releases"),p(s,"class","page-footer"),p(e,"class",r="page-wrapper "+n[1]),ie(e,"center-content",n[0])},m(c,d){w(c,e,d),m(e,t),f&&f.m(t,null),m(e,i),m(e,s),m(s,l),m(l,o),a=!0},p(c,[d]){f&&f.p&&(!a||d&4)&&Sn(f,u,c,c[2],a?$n(u,c[2],d,null):Cn(c[2]),null),(!a||d&2&&r!==(r="page-wrapper "+c[1]))&&p(e,"class",r),d&3&&ie(e,"center-content",c[0])},i(c){a||(A(f,c),a=!0)},o(c){P(f,c),a=!1},d(c){c&&k(e),f&&f.d(c)}}}function S1(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class On extends Ee{constructor(e){super(),Oe(this,e,S1,$1,De,{center:0,class:1})}}function Eu(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"),p(e,"class","block txt-center m-b-lg"),p(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 C1(n){let e,t,i,s=!n[0]&&Eu();const l=n[1].default,o=wn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=T(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),m(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Eu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function M1(n){let e,t;return e=new On({props:{class:"full-page",center:!0,$$slots:{default:[C1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function T1(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class Ng extends Ee{constructor(e){super(),Oe(this,e,T1,M1,De,{nobranding:0})}}function Au(n,e,t){const i=n.slice();return i[11]=e[t],i}const D1=n=>({}),Pu=n=>({uniqueId:n[3]});function O1(n){let e=(n[11]||_o)+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ue(t,e)},d(i){i&&k(t)}}}function E1(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||_o)+"",i;return{c(){e=_("pre"),i=F(t)},m(o,r){w(o,e,r),m(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Lu(n){let e,t;function i(o,r){return typeof o[11]=="object"?E1:O1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),p(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 A1(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Pu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Lu(Au(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ie(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)&&Sn(r,o,f,f[6],i?$n(o,f[6],c,D1):Cn(f[6]),Pu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Au(f,a,d);u[d]?u[d].p(h,c):(u[d]=Lu(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&ie(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),Qt(u,f),n[9](null),s=!1,l()}}}const _o="Invalid value";function P1(n,e,t){let i;bt(n,qi,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(){wa(r)}Jn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){st.call(this,n,g)}function h(g){pe[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,h]}class Re extends Ee{constructor(e){super(),Oe(this,e,P1,A1,De,{name:4,class:0})}}function L1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Te(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function I1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Te(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])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&Te(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function F1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Password confirm"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[2]),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&Te(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function N1(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[L1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[I1,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[F1,({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(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("button"),f.innerHTML=`<span class="txt">Create and login</span>
|
||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ie(f,"btn-disabled",n[3]),ie(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),j(a,e,null),m(e,u),m(e,f),c=!0,d||(h=G(e,"submit",Yt(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 C={};v&1540&&(C.$$scope={dirty:v,ctx:g}),a.$set(C),v&8&&ie(f,"btn-disabled",g[3]),v&8&&ie(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),q(s),q(o),q(a),d=!1,h()}}}function R1(n,e,t){const i=on();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await we.admins.create({email:s,password:l,passwordConfirm:o}),await we.admins.authViaEmail(s,l),i("submit")}catch(d){we.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 H1 extends Ee{constructor(e){super(),Oe(this,e,R1,N1,De,{})}}function Iu(n){let e,t;return e=new Ng({props:{$$slots:{default:[j1]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function j1(n){let e,t;return e=new H1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function q1(n){let e,t,i=n[0]&&Iu(n);return{c(){i&&i.c(),e=Ke()},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=Iu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function V1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){we.logout(!1),t(0,i=!0);return}we.authStore.isValid?Si("/collections"):we.logout()}return[i,async()=>{t(0,i=!1),await ii(),window.location.search=""}]}class z1 extends Ee{constructor(e){super(),Oe(this,e,V1,q1,De,{})}}const Ft=li(""),bo=li("");function zo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=gl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Un(n,{delay:e=0,duration:t=400,easing:i=zo,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 tn(n,{delay:e=0,duration:t=400,easing:i=zo}={}){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:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Tn(n,{delay:e=0,duration:t=400,easing:i=zo,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 B1(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Te(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Te(e,l[7])},i:oe,o:oe,d(l){l&&k(e),n[13](null),i=!1,s()}}}function U1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(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],He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),j(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&&q(e,a)}}}function Fu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Nu();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(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=Nu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(A(r),a&&Tt(()=>{i||(i=it(t,Un,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=it(t,Un,{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 Nu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=it(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Un,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function W1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[U1,B1],h=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Fu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(i,s),m(t,l),h[o].m(t,null),m(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Yt(n[10])),G(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let C=o;o=g(b),o===C?h[o].p(b,y):(Pe(),P(h[C],1,1,()=>{h[C]=null}),Le(),r=h[o],r?r.p(b,y):(r=h[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=Fu(b),v.c(),A(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Ge(c)}}}function Y1(n,e,t){const i=on(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new fn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(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 Ai(()=>import("./FilterAutocompleteInput.9df887af.js"),["FilterAutocompleteInput.9df887af.js","index.afc1faa1.js"],import.meta.url)).default),t(5,f=!1))}Jn(()=>{v()});function b(M){st.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function C(M){pe[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!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,h,g,b,y,C,S,$]}class Bo extends Ee{constructor(e){super(),Oe(this,e,Y1,W1,De,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}let zr,Yi;const Br="app-tooltip";function Ru(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Br),Yi||(Yi=document.createElement("div"),Yi.classList.add(Br),document.body.appendChild(Yi)),Yi}function Rg(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){Ur();return}t.textContent=e.text,t.className=Br+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Ur(){clearTimeout(zr),Ni().classList.remove("active"),Ni().activeNode=void 0}function K1(n,e){Ni().activeNode=n,clearTimeout(zr),zr=setTimeout(()=>{Ni().classList.add("active"),Rg(n,e)},isNaN(e.delay)?200:e.delay)}function wt(n,e){let t=Ru(e);function i(){K1(n,t)}function s(){Ur()}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),Ni(),{update(l){var o,r;t=Ru(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Rg(n,t)},destroy(){var l,o;(o=(l=Ni())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Ur(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function J1(n){let e,t,i,s;return{c(){e=_("button"),e.innerHTML='<i class="ri-refresh-line svelte-b7gb6q"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-circle svelte-b7gb6q"),ie(e,"refreshing",n[1])},m(l,o){w(l,e,o),i||(s=[Ye(t=wt.call(null,e,n[0])),G(e,"click",n[2])],i=!0)},p(l,[o]){t&&Kn(t.update)&&o&1&&t.update.call(null,l[0]),o&2&&ie(e,"refreshing",l[1])},i:oe,o:oe,d(l){l&&k(e),i=!1,Ge(s)}}}function Z1(n,e,t){const i=on();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 Jn(()=>()=>clearTimeout(l)),n.$$set=r=>{"tooltip"in r&&t(0,s=r.tooltip)},[s,l,o]}class Uo extends Ee{constructor(e){super(),Oe(this,e,Z1,J1,De,{tooltip:0})}}function G1(n){let e,t,i,s,l;const o=n[6].default,r=wn(o,n,n[5],null);return{c(){e=_("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"class",t="col-sort "+n[1]),ie(e,"col-sort-disabled",n[3]),ie(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),ie(e,"sort-desc",n[0]==="-"+n[2]),ie(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)&&Sn(r,o,a,a[5],i?$n(o,a[5],u,null):Cn(a[5]),null),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),u&10&&ie(e,"col-sort-disabled",a[3]),u&7&&ie(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),u&7&&ie(e,"sort-desc",a[0]==="-"+a[2]),u&7&&ie(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,Ge(l)}}}function X1(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 sn extends Ee{constructor(e){super(),Oe(this,e,X1,G1,De,{class:1,name:2,sort:0,disable:3})}}function Q1(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function x1(n){let e,t=W.formatToUTCDate(n[0])+"",i,s,l,o,r;return{c(){e=_("span"),i=F(t),s=F(" UTC"),p(e,"class","txt")},m(a,u){w(a,e,u),m(e,i),m(e,s),o||(r=Ye(l=wt.call(null,e,W.formatToLocalDate(n[0])+" Local")),o=!0)},p(a,u){u&1&&t!==(t=W.formatToUTCDate(a[0])+"")&&ue(i,t),l&&Kn(l.update)&&u&1&&l.update.call(null,W.formatToLocalDate(a[0])+" Local")},d(a){a&&k(e),o=!1,r()}}}function ev(n){let e;function t(l,o){return l[0]?x1:Q1}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 tv(n,e,t){let{date:i=""}=e;return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i]}class $i extends Ee{constructor(e){super(),Oe(this,e,tv,ev,De,{date:0})}}function Hu(n,e,t){const i=n.slice();return i[21]=e[t],i}function nv(n){let e;return{c(){e=_("div"),e.innerHTML=`<i class="ri-global-line"></i>
|
||
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function iv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(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 sv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(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 lv(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",W.getFieldTypeIcon("number")),p(s,"class","txt"),p(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 ov(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 ju(n){let e;function t(l,o){return l[6]?av:rv}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 rv(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&qu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(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=qu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function av(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 qu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Vu(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zu(n,e){var X,ae,ve;let t,i,s,l=((X=e[21].method)==null?void 0:X.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,g,v,b,y,C=(e[21].referer||"N/A")+"",S,$,M,D,E,O=e[21].status+"",L,I,N,B,U,ee,K,se,Y,te,J=(((ae=e[21].meta)==null?void 0:ae.errorMessage)||((ve=e[21].meta)==null?void 0:ve.errorData))&&Vu();B=new $i({props:{date:e[21].created}});function _e(){return e[16](e[21])}function be(...H){return e[17](e[21],...H)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=T(),u=_("td"),f=_("span"),d=F(c),g=T(),J&&J.c(),v=T(),b=_("td"),y=_("span"),S=F(C),M=T(),D=_("td"),E=_("span"),L=F(O),I=T(),N=_("td"),V(B.$$.fragment),U=T(),ee=_("td"),ee.innerHTML='<i class="ri-arrow-right-line"></i>',K=T(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ie(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(E,"class","label"),ie(E,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(N,"class","col-type-date col-field-created"),p(ee,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(H,me){w(H,t,me),m(t,i),m(i,s),m(s,o),m(t,a),m(t,u),m(u,f),m(f,d),m(u,g),J&&J.m(u,null),m(t,v),m(t,b),m(b,y),m(y,S),m(t,M),m(t,D),m(D,E),m(E,L),m(t,I),m(t,N),j(B,N,null),m(t,U),m(t,ee),m(t,K),se=!0,Y||(te=[G(t,"click",_e),G(t,"keydown",be)],Y=!0)},p(H,me){var Q,Se,je;e=H,(!se||me&8)&&l!==(l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"")&&ue(o,l),(!se||me&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!se||me&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!se||me&8&&h!==(h=e[21].url))&&p(f,"title",h),((Se=e[21].meta)==null?void 0:Se.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?J||(J=Vu(),J.c(),J.m(u,null)):J&&(J.d(1),J=null),(!se||me&8)&&C!==(C=(e[21].referer||"N/A")+"")&&ue(S,C),(!se||me&8&&$!==($=e[21].referer))&&p(y,"title",$),me&8&&ie(y,"txt-hint",!e[21].referer),(!se||me&8)&&O!==(O=e[21].status+"")&&ue(L,O),me&8&&ie(E,"label-danger",e[21].status>=400);const x={};me&8&&(x.date=e[21].created),B.$set(x)},i(H){se||(A(B.$$.fragment,H),se=!0)},o(H){P(B.$$.fragment,H),se=!1},d(H){H&&k(t),J&&J.d(),q(B),Y=!1,Ge(te)}}}function Bu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(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+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Uu(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=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[6]),ie(t,"btn-disabled",n[6]),p(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+"")&&ue(o,l),c&64&&ie(t,"btn-loading",f[6]),c&64&&ie(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function uv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E=[],O=new Map,L,I,N,B;function U(Q){n[11](Q)}let ee={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[nv]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),l=new sn({props:ee}),pe.push(()=>Fe(l,"sort",U));function K(Q){n[12](Q)}let se={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[iv]},$$scope:{ctx:n}};n[1]!==void 0&&(se.sort=n[1]),a=new sn({props:se}),pe.push(()=>Fe(a,"sort",K));function Y(Q){n[13](Q)}let te={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[sv]},$$scope:{ctx:n}};n[1]!==void 0&&(te.sort=n[1]),c=new sn({props:te}),pe.push(()=>Fe(c,"sort",Y));function J(Q){n[14](Q)}let _e={disable:!0,class:"col-type-number col-field-status",name:"status",$$slots:{default:[lv]},$$scope:{ctx:n}};n[1]!==void 0&&(_e.sort=n[1]),g=new sn({props:_e}),pe.push(()=>Fe(g,"sort",J));function be(Q){n[15](Q)}let X={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[ov]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),y=new sn({props:X}),pe.push(()=>Fe(y,"sort",be));let ae=n[3];const ve=Q=>Q[21].id;for(let Q=0;Q<ae.length;Q+=1){let Se=Hu(n,ae,Q),je=ve(Se);O.set(je,E[Q]=zu(je,Se))}let H=null;ae.length||(H=ju(n));let me=n[3].length&&Bu(n),x=n[3].length&&n[7]&&Uu(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),V(l.$$.fragment),r=T(),V(a.$$.fragment),f=T(),V(c.$$.fragment),h=T(),V(g.$$.fragment),b=T(),V(y.$$.fragment),S=T(),$=_("th"),M=T(),D=_("tbody");for(let Q=0;Q<E.length;Q+=1)E[Q].c();H&&H.c(),L=T(),me&&me.c(),I=T(),x&&x.c(),N=Ke(),p($,"class","col-type-action min-width"),p(t,"class","table"),ie(t,"table-loading",n[6]),p(e,"class","table-wrapper")},m(Q,Se){w(Q,e,Se),m(e,t),m(t,i),m(i,s),j(l,s,null),m(s,r),j(a,s,null),m(s,f),j(c,s,null),m(s,h),j(g,s,null),m(s,b),j(y,s,null),m(s,S),m(s,$),m(t,M),m(t,D);for(let je=0;je<E.length;je+=1)E[je].m(D,null);H&&H.m(D,null),w(Q,L,Se),me&&me.m(Q,Se),w(Q,I,Se),x&&x.m(Q,Se),w(Q,N,Se),B=!0},p(Q,[Se]){const je={};Se&16777216&&(je.$$scope={dirty:Se,ctx:Q}),!o&&Se&2&&(o=!0,je.sort=Q[1],He(()=>o=!1)),l.$set(je);const Ue={};Se&16777216&&(Ue.$$scope={dirty:Se,ctx:Q}),!u&&Se&2&&(u=!0,Ue.sort=Q[1],He(()=>u=!1)),a.$set(Ue);const Z={};Se&16777216&&(Z.$$scope={dirty:Se,ctx:Q}),!d&&Se&2&&(d=!0,Z.sort=Q[1],He(()=>d=!1)),c.$set(Z);const ge={};Se&16777216&&(ge.$$scope={dirty:Se,ctx:Q}),!v&&Se&2&&(v=!0,ge.sort=Q[1],He(()=>v=!1)),g.$set(ge);const ce={};Se&16777216&&(ce.$$scope={dirty:Se,ctx:Q}),!C&&Se&2&&(C=!0,ce.sort=Q[1],He(()=>C=!1)),y.$set(ce),Se&841&&(ae=Q[3],Pe(),E=yt(E,Se,ve,1,Q,ae,O,D,Zt,zu,null,Hu),Le(),!ae.length&&H?H.p(Q,Se):ae.length?H&&(H.d(1),H=null):(H=ju(Q),H.c(),H.m(D,null))),Se&64&&ie(t,"table-loading",Q[6]),Q[3].length?me?me.p(Q,Se):(me=Bu(Q),me.c(),me.m(I.parentNode,I)):me&&(me.d(1),me=null),Q[3].length&&Q[7]?x?x.p(Q,Se):(x=Uu(Q),x.c(),x.m(N.parentNode,N)):x&&(x.d(1),x=null)},i(Q){if(!B){A(l.$$.fragment,Q),A(a.$$.fragment,Q),A(c.$$.fragment,Q),A(g.$$.fragment,Q),A(y.$$.fragment,Q);for(let Se=0;Se<ae.length;Se+=1)A(E[Se]);B=!0}},o(Q){P(l.$$.fragment,Q),P(a.$$.fragment,Q),P(c.$$.fragment,Q),P(g.$$.fragment,Q),P(y.$$.fragment,Q);for(let Se=0;Se<E.length;Se+=1)P(E[Se]);B=!1},d(Q){Q&&k(e),q(l),q(a),q(c),q(g),q(y);for(let Se=0;Se<E.length;Se+=1)E[Se].d();H&&H.d(),Q&&k(L),me&&me.d(Q),Q&&k(I),x&&x.d(Q),Q&&k(N)}}}function fv(n,e,t){let i;const s=on(),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 h(O=1){return t(6,d=!0),we.logs.getRequestsList(O,40,{sort:a,filter:[r,o].filter(Boolean).join("&&")}).then(L=>{O<=1&&g(),t(6,d=!1),t(3,u=u.concat(L.items)),t(5,f=L.page),t(4,c=L.totalItems),s("load",u)}).catch(L=>{L!=null&&L.isAbort||(t(6,d=!1),console.warn(L),g(),we.errorResponseHandler(L,!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 C(O){a=O,t(1,a)}function S(O){a=O,t(1,a)}const $=O=>s("select",O),M=(O,L)=>{L.code==="Enter"&&(L.preventDefault(),s("select",O))},D=()=>t(0,o=""),E=()=>h(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(),h(1)),n.$$.dirty&24&&t(7,i=c>u.length)},[o,a,h,u,c,f,d,i,s,l,r,v,b,y,C,S,$,M,D,E]}class cv extends Ee{constructor(e){super(),Oe(this,e,fv,uv,De,{filter:0,presets:10,sort:1,load:2})}get load(){return this.$$.ctx[2]}}/*!
|
||
* Chart.js v3.9.1
|
||
* https://www.chartjs.org
|
||
* (c) 2022 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/function _i(){}const dv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function It(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 Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Wt(n)?n:e}function _t(n,e){return typeof n>"u"?e:n}const pv=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Hg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Vt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Et(n,e,t,i){let s,l,o;if(It(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 yo(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 ko(n){if(It(n))return n.map(ko);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]]=ko(n[t[s]]);return e}return n}function jg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function hv(n,e,t,i){if(!jg(n))return;const s=e[n],l=t[n];pt(s)&&pt(l)?ul(s,l,i):e[n]=ko(l)}function ul(n,e,t){const i=It(e)?e:[e],s=i.length;if(!pt(n))return n;t=t||{};const l=t.merger||hv;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 el(n,e){return ul(n,e,{merger:mv})}function mv(n,e,t){if(!jg(n))return;const i=e[n],s=t[n];pt(i)&&pt(s)?el(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ko(s))}const Wu={"":n=>n,x:n=>n.x,y:n=>n.y};function Hi(n,e){return(Wu[e]||(Wu[e]=gv(e)))(n)}function gv(n){const e=_v(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function _v(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Sa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",ji=n=>typeof n=="function",Yu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function bv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,At=2*Ut,vv=At+Ut,wo=Number.POSITIVE_INFINITY,yv=Ut/180,zt=Ut/2,js=Ut/4,Ku=Ut*2/3,zn=Math.log10,fi=Math.sign;function Ju(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(zn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function kv(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)<t}function wv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function qg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(Ut/180)}function Ca(n){return n*(180/Ut)}function Zu(n){if(!Wt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Vg(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*Ut&&(l+=At),{angle:l,distance:s}}function Wr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function $v(n,e){return(n-e+vv)%At-Ut}function Pn(n){return(n%At+At)%At}function fl(n,e,t,i){const s=Pn(n),l=Pn(e),o=Pn(t),r=Pn(l-s),a=Pn(o-s),u=Pn(s-l),f=Pn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function un(n,e,t){return Math.max(e,Math.min(t,n))}function Sv(n){return un(n,-32768,32767)}function cl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ma(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 es=(n,e,t,i)=>Ma(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Cv=(n,e,t)=>Ma(n,t,i=>n[i][e]>=t);function Mv(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 zg=["push","pop","shift","splice","unshift"];function Tv(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),zg.forEach(t=>{const i="_onData"+Sa(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 Gu(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)&&(zg.forEach(l=>{delete n[l]}),delete n._chartjs)}function Bg(n){const e=new Set;let t,i;for(t=0,i=n.length;t<i;++t)e.add(n[t]);return e.size===i?n:Array.from(e)}const Ug=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function Wg(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,Ug.call(window,()=>{s=!1,n.apply(e,l)}))}}function Dv(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const Ov=n=>n==="start"?"left":n==="end"?"right":"center",Xu=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function Yg(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=un(Math.min(es(r,o.axis,u).lo,t?i:es(e,a,o.getPixelForValue(u)).lo),0,i-1)),d?l=un(Math.max(es(r,o.axis,f,!0).hi+1,t?0:es(e,a,o.getPixelForValue(f),!0).hi+1),s,i)-s:l=i-s}return{start:s,count:l}}function Kg(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,s={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=s,!0;const l=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),l}const ql=n=>n===0||n===1,Qu=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*At/t)),xu=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*At/t)+1,nl={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*zt)+1,easeOutSine:n=>Math.sin(n*zt),easeInOutSine:n=>-.5*(Math.cos(Ut*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=>ql(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=>ql(n)?n:Qu(n,.075,.3),easeOutElastic:n=>ql(n)?n:xu(n,.075,.3),easeInOutElastic(n){return ql(n)?n:n<.5?.5*Qu(n*2,.1125,.45):.5+.5*xu(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-nl.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?nl.easeInBounce(n*2)*.5:nl.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 wl(n){return n+.5|0}const Ii=(n,e,t)=>Math.max(Math.min(n,t),e);function Zs(n){return Ii(wl(n*2.55),0,255)}function Ri(n){return Ii(wl(n*255),0,255)}function yi(n){return Ii(wl(n/2.55)/100,0,1)}function ef(n){return Ii(wl(n*100),0,100)}const Nn={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},Yr=[..."0123456789ABCDEF"],Ev=n=>Yr[n&15],Av=n=>Yr[(n&240)>>4]+Yr[n&15],Vl=n=>(n&240)>>4===(n&15),Pv=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Lv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const Iv=(n,e)=>n<255?e(n):"";function Fv(n){var e=Pv(n)?Ev:Av;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Iv(n.a,e):void 0}const Nv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Jg(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 Rv(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 Hv(n,e,t){const i=Jg(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 jv(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 Ta(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=jv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Da(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Oa(n,e,t){return Da(Jg,n,e,t)}function qv(n,e,t){return Da(Hv,n,e,t)}function Vv(n,e,t){return Da(Rv,n,e,t)}function Zg(n){return(n%360+360)%360}function zv(n){const e=Nv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Zs(+e[5]):Ri(+e[5]));const s=Zg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=qv(s,l,o):e[1]==="hsv"?i=Vv(s,l,o):i=Oa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Bv(n,e){var t=Ta(n);t[0]=Zg(t[0]+e),t=Oa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Uv(n){if(!n)return;const e=Ta(n),t=e[0],i=ef(e[1]),s=ef(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${yi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const tf={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"},nf={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 Wv(){const n={},e=Object.keys(nf),t=Object.keys(tf);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,tf[l]);l=parseInt(nf[o],16),n[r]=[l>>16&255,l>>8&255,l&255]}return n}let zl;function Yv(n){zl||(zl=Wv(),zl.transparent=[0,0,0,0]);const e=zl[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const Kv=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function Jv(n){const e=Kv.exec(n);let t=255,i,s,l;if(!!e){if(e[7]!==i){const o=+e[7];t=e[8]?Zs(o):Ii(o*255,0,255)}return i=+e[1],s=+e[3],l=+e[5],i=255&(e[2]?Zs(i):Ii(i,0,255)),s=255&(e[4]?Zs(s):Ii(s,0,255)),l=255&(e[6]?Zs(l):Ii(l,0,255)),{r:i,g:s,b:l,a:t}}}function Zv(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${yi(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const ar=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,ms=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function Gv(n,e,t){const i=ms(yi(n.r)),s=ms(yi(n.g)),l=ms(yi(n.b));return{r:Ri(ar(i+t*(ms(yi(e.r))-i))),g:Ri(ar(s+t*(ms(yi(e.g))-s))),b:Ri(ar(l+t*(ms(yi(e.b))-l))),a:n.a+t*(e.a-n.a)}}function Bl(n,e,t){if(n){let i=Ta(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Oa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function Gg(n,e){return n&&Object.assign(e||{},n)}function sf(n){var e={r:0,g:0,b:0,a:255};return Array.isArray(n)?n.length>=3&&(e={r:n[0],g:n[1],b:n[2],a:255},n.length>3&&(e.a=Ri(n[3]))):(e=Gg(n,{r:0,g:0,b:0,a:1}),e.a=Ri(e.a)),e}function Xv(n){return n.charAt(0)==="r"?Jv(n):zv(n)}class $o{constructor(e){if(e instanceof $o)return e;const t=typeof e;let i;t==="object"?i=sf(e):t==="string"&&(i=Lv(e)||Yv(e)||Xv(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=Gg(this._rgb);return e&&(e.a=yi(e.a)),e}set rgb(e){this._rgb=sf(e)}rgbString(){return this._valid?Zv(this._rgb):void 0}hexString(){return this._valid?Fv(this._rgb):void 0}hslString(){return this._valid?Uv(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=Gv(this._rgb,e._rgb,t)),this}clone(){return new $o(this.rgb)}alpha(e){return this._rgb.a=Ri(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=wl(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 Bl(this._rgb,2,e),this}darken(e){return Bl(this._rgb,2,-e),this}saturate(e){return Bl(this._rgb,1,e),this}desaturate(e){return Bl(this._rgb,1,-e),this}rotate(e){return Bv(this._rgb,e),this}}function Xg(n){return new $o(n)}function Qg(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function lf(n){return Qg(n)?n:Xg(n)}function ur(n){return Qg(n)?n:Xg(n).saturate(.5).darken(.1).hexString()}const rs=Object.create(null),Kr=Object.create(null);function il(n,e){if(!e)return n;const t=e.split(".");for(let i=0,s=t.length;i<s;++i){const l=t[i];n=n[l]||(n[l]=Object.create(null))}return n}function fr(n,e,t){return typeof e=="string"?ul(il(n,e),t):ul(il(n,""),e)}class Qv{constructor(e){this.animation=void 0,this.backgroundColor="rgba(0,0,0,0.1)",this.borderColor="rgba(0,0,0,0.1)",this.color="#666",this.datasets={},this.devicePixelRatio=t=>t.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,i)=>ur(i.backgroundColor),this.hoverBorderColor=(t,i)=>ur(i.borderColor),this.hoverColor=(t,i)=>ur(i.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(e)}set(e,t){return fr(this,e,t)}get(e){return il(this,e)}describe(e,t){return fr(Kr,e,t)}override(e,t){return fr(rs,e,t)}route(e,t,i,s){const l=il(this,e),o=il(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):_t(a,u)},set(a){this[r]=a}}})}}var vt=new Qv({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});function xv(n){return!n||Mt(n.size)||Mt(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function So(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 ey(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&&It(c)!==!0)o=So(n,s,l,o,c);else if(It(c))for(u=0,f=c.length;u<f;u++)d=c[u],d!=null&&!It(d)&&(o=So(n,s,l,o,d));n.restore();const h=l.length/2;if(h>t.length){for(a=0;a<h;a++)delete s[l[a]];l.splice(0,h)}return o}function Ki(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 of(n,e){e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore()}function Jr(n,e,t,i){ty(n,e,t,i,null)}function ty(n,e,t,i,s){let l,o,r,a,u,f;const c=e.pointStyle,d=e.rotation,h=e.radius;let g=(d||0)*yv;if(c&&typeof c=="object"&&(l=c.toString(),l==="[object HTMLImageElement]"||l==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(c,-c.width/2,-c.height/2,c.width,c.height),n.restore();return}if(!(isNaN(h)||h<=0)){switch(n.beginPath(),c){default:s?n.ellipse(t,i,s/2,h,0,0,At):n.arc(t,i,h,0,At),n.closePath();break;case"triangle":n.moveTo(t+Math.sin(g)*h,i-Math.cos(g)*h),g+=Ku,n.lineTo(t+Math.sin(g)*h,i-Math.cos(g)*h),g+=Ku,n.lineTo(t+Math.sin(g)*h,i-Math.cos(g)*h),n.closePath();break;case"rectRounded":u=h*.516,a=h-u,o=Math.cos(g+js)*a,r=Math.sin(g+js)*a,n.arc(t-o,i-r,u,g-Ut,g-zt),n.arc(t+r,i-o,u,g-zt,g),n.arc(t+o,i+r,u,g,g+zt),n.arc(t-r,i+o,u,g+zt,g+Ut),n.closePath();break;case"rect":if(!d){a=Math.SQRT1_2*h,f=s?s/2:a,n.rect(t-f,i-a,2*f,2*a);break}g+=js;case"rectRot":o=Math.cos(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+r,i-o),n.lineTo(t+o,i+r),n.lineTo(t-r,i+o),n.closePath();break;case"crossRot":g+=js;case"cross":o=Math.cos(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"star":o=Math.cos(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o),g+=js,o=Math.cos(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r),n.moveTo(t+r,i-o),n.lineTo(t-r,i+o);break;case"line":o=s?s/2:Math.cos(g)*h,r=Math.sin(g)*h,n.moveTo(t-o,i-r),n.lineTo(t+o,i+r);break;case"dash":n.moveTo(t,i),n.lineTo(t+Math.cos(g)*h,i+Math.sin(g)*h);break}n.fill(),e.borderWidth>0&&n.stroke()}}function dl(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 Ea(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function Aa(n){n.restore()}function ny(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 iy(n,e,t,i){if(!e)return n.lineTo(t.x,t.y);n.bezierCurveTo(i?e.cp1x:e.cp2x,i?e.cp1y:e.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function Co(n,e,t,i,s,l={}){const o=It(e)?e:[e],r=l.strokeWidth>0&&l.strokeColor!=="";let a,u;for(n.save(),n.font=s.string,sy(n,l),a=0;a<o.length;++a)u=o[a],r&&(l.strokeColor&&(n.strokeStyle=l.strokeColor),Mt(l.strokeWidth)||(n.lineWidth=l.strokeWidth),n.strokeText(u,t,i,l.maxWidth)),n.fillText(u,t,i,l.maxWidth),ly(n,t,i,u,l),i+=s.lineHeight;n.restore()}function sy(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Mt(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 ly(n,e,t,i,s){if(s.strikethrough||s.underline){const l=n.measureText(i),o=e-l.actualBoundingBoxLeft,r=e+l.actualBoundingBoxRight,a=t-l.actualBoundingBoxAscent,u=t+l.actualBoundingBoxDescent,f=s.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=s.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function Mo(n,e){const{x:t,y:i,w:s,h:l,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,-zt,Ut,!0),n.lineTo(t,i+l-o.bottomLeft),n.arc(t+o.bottomLeft,i+l-o.bottomLeft,o.bottomLeft,Ut,zt,!0),n.lineTo(t+s-o.bottomRight,i+l),n.arc(t+s-o.bottomRight,i+l-o.bottomRight,o.bottomRight,zt,0,!0),n.lineTo(t+s,i+o.topRight),n.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-zt,!0),n.lineTo(t+o.topLeft,i)}const oy=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ry=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function ay(n,e){const t=(""+n).match(oy);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 uy=n=>+n||0;function Pa(n,e){const t={},i=pt(e),s=i?Object.keys(e):e,l=pt(n)?i?o=>_t(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of s)t[o]=uy(l(o));return t}function xg(n){return Pa(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ys(n){return Pa(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Yn(n){const e=xg(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function Ln(n,e){n=n||{},e=e||vt.font;let t=_t(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=_t(n.style,e.style);i&&!(""+i).match(ry)&&(console.warn('Invalid font style specified: "'+i+'"'),i="");const s={family:_t(n.family,e.family),lineHeight:ay(_t(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:_t(n.weight,e.weight),string:""};return s.string=xv(s),s}function Ul(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&&It(r)&&(r=r[t%r.length],s=!1),r!==void 0))return i&&!s&&(i.cacheable=!1),r}function fy(n,e,t){const{min:i,max:s}=n,l=Hg(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 Vi(n,e){return Object.assign(Object.create(n),e)}function La(n,e=[""],t=n,i,s=()=>n[0]){Wn(i)||(i=i_("_fallback",n));const l={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:t,_fallback:i,_getTarget:s,override:o=>La([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 t_(o,r,()=>by(r,e,n,o))},getOwnPropertyDescriptor(o,r){return Reflect.getOwnPropertyDescriptor(o._scopes[0],r)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(o,r){return af(o).includes(r)},ownKeys(o){return af(o)},set(o,r,a){const u=o._storage||(o._storage=s());return o[r]=u[r]=a,delete o._keys,!0}})}function Ms(n,e,t,i){const s={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:e_(n,i),setContext:l=>Ms(n,l,t,i),override:l=>Ms(n.override(l),e,t,i)};return new Proxy(s,{deleteProperty(l,o){return delete l[o],delete n[o],!0},get(l,o,r){return t_(l,o,()=>dy(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 e_(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:s=e.allKeys}=n;return{allKeys:s,scriptable:t,indexable:i,isScriptable:ji(t)?t:()=>t,isIndexable:ji(i)?i:()=>i}}const cy=(n,e)=>n?n+Sa(e):e,Ia=(n,e)=>pt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function t_(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];const i=t();return n[e]=i,i}function dy(n,e,t){const{_proxy:i,_context:s,_subProxy:l,_descriptors:o}=n;let r=i[e];return ji(r)&&o.isScriptable(e)&&(r=py(e,r,n,t)),It(r)&&r.length&&(r=hy(e,r,n,o.isIndexable)),Ia(e,r)&&(r=Ms(r,s,l&&l[e],o)),r}function py(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),Ia(n,e)&&(e=Fa(s._scopes,s,n,e)),e}function hy(n,e,t,i){const{_proxy:s,_context:l,_subProxy:o,_descriptors:r}=t;if(Wn(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=Fa(u,s,n,f);e.push(Ms(c,l,o&&o[n],r))}}return e}function n_(n,e,t){return ji(n)?n(e,t):n}const my=(n,e)=>n===!0?e:typeof n=="string"?Hi(e,n):void 0;function gy(n,e,t,i,s){for(const l of e){const o=my(t,l);if(o){n.add(o);const r=n_(o._fallback,t,s);if(Wn(r)&&r!==t&&r!==i)return r}else if(o===!1&&Wn(i)&&t!==i)return null}return!1}function Fa(n,e,t,i){const s=e._rootScopes,l=n_(e._fallback,t,i),o=[...n,...s],r=new Set;r.add(i);let a=rf(r,o,t,l||t,i);return a===null||Wn(l)&&l!==t&&(a=rf(r,o,l,a,i),a===null)?!1:La(Array.from(r),[""],s,l,()=>_y(e,t,i))}function rf(n,e,t,i,s){for(;t;)t=gy(n,e,t,i,s);return t}function _y(n,e,t){const i=n._getTarget();e in i||(i[e]={});const s=i[e];return It(s)&&pt(t)?t:s}function by(n,e,t,i){let s;for(const l of e)if(s=i_(cy(l,n),t),Wn(s))return Ia(n,s)?Fa(t,i,n,s):s}function i_(n,e){for(const t of e){if(!t)continue;const i=t[n];if(Wn(i))return i}}function af(n){let e=n._keys;return e||(e=n._keys=vy(n._scopes)),e}function vy(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 s_(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(Hi(f,l),u)};return o}const yy=Number.EPSILON||1e-14,Ts=(n,e)=>e<n.length&&!n[e].skip&&n[e],l_=n=>n==="x"?"y":"x";function ky(n,e,t,i){const s=n.skip?e:n,l=e,o=t.skip?e:t,r=Wr(l,s),a=Wr(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 wy(n,e,t){const i=n.length;let s,l,o,r,a,u=Ts(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Ts(n,f+1),!(!a||!u)){if(tl(e[f],0,yy)){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 $y(n,e,t="x"){const i=l_(t),s=n.length;let l,o,r,a=Ts(n,0);for(let u=0;u<s;++u){if(o=r,r=a,a=Ts(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 Sy(n,e="x"){const t=l_(e),i=n.length,s=Array(i).fill(0),l=Array(i);let o,r,a,u=Ts(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Ts(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?fi(s[o-1])!==fi(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}wy(n,s,l),$y(n,l,e)}function Wl(n,e,t){return Math.max(Math.min(n,t),e)}function Cy(n,e){let t,i,s,l,o,r=dl(n[0],e);for(t=0,i=n.length;t<i;++t)o=l,l=r,r=t<i-1&&dl(n[t+1],e),l&&(s=n[t],o&&(s.cp1x=Wl(s.cp1x,e.left,e.right),s.cp1y=Wl(s.cp1y,e.top,e.bottom)),r&&(s.cp2x=Wl(s.cp2x,e.left,e.right),s.cp2y=Wl(s.cp2y,e.top,e.bottom)))}function My(n,e,t,i,s){let l,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")Sy(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=ky(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&&Cy(n,t)}function o_(){return typeof window<"u"&&typeof document<"u"}function Na(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function To(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Wo=n=>window.getComputedStyle(n,null);function Ty(n,e){return Wo(n).getPropertyValue(e)}const Dy=["top","right","bottom","left"];function ls(n,e,t){const i={};t=t?"-"+t:"";for(let s=0;s<4;s++){const l=Dy[s];i[l]=parseFloat(n[e+"-"+l+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Oy=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Ey(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:s,offsetY:l}=i;let o=!1,r,a;if(Oy(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 Xi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,s=Wo(t),l=s.boxSizing==="border-box",o=ls(s,"padding"),r=ls(s,"border","width"),{x:a,y:u,box:f}=Ey(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:h,height:g}=e;return l&&(h-=o.width+r.width,g-=o.height+r.height),{x:Math.round((a-c)/h*t.width/i),y:Math.round((u-d)/g*t.height/i)}}function Ay(n,e,t){let i,s;if(e===void 0||t===void 0){const l=Na(n);if(!l)e=n.clientWidth,t=n.clientHeight;else{const o=l.getBoundingClientRect(),r=Wo(l),a=ls(r,"border","width"),u=ls(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=To(r.maxWidth,l,"clientWidth"),s=To(r.maxHeight,l,"clientHeight")}}return{width:e,height:t,maxWidth:i||wo,maxHeight:s||wo}}const cr=n=>Math.round(n*10)/10;function Py(n,e,t,i){const s=Wo(n),l=ls(s,"margin"),o=To(s.maxWidth,n,"clientWidth")||wo,r=To(s.maxHeight,n,"clientHeight")||wo,a=Ay(n,e,t);let{width:u,height:f}=a;if(s.boxSizing==="content-box"){const c=ls(s,"border","width"),d=ls(s,"padding");u-=d.width+c.width,f-=d.height+c.height}return u=Math.max(0,u-l.width),f=Math.max(0,i?Math.floor(u/i):f-l.height),u=cr(Math.min(u,o,a.maxWidth)),f=cr(Math.min(f,r,a.maxHeight)),u&&!f&&(f=cr(u/2)),{width:u,height:f}}function uf(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 Ly=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 ff(n,e){const t=Ty(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Qi(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Iy(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 Fy(n,e,t,i){const s={x:n.cp2x,y:n.cp2y},l={x:e.cp1x,y:e.cp1y},o=Qi(n,s,t),r=Qi(s,l,t),a=Qi(l,e,t),u=Qi(o,r,t),f=Qi(r,a,t);return Qi(u,f,t)}const cf=new Map;function Ny(n,e){e=e||{};const t=n+JSON.stringify(e);let i=cf.get(t);return i||(i=new Intl.NumberFormat(n,e),cf.set(t,i)),i}function $l(n,e,t){return Ny(e,t).format(n)}const Ry=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}}},Hy=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function dr(n,e,t){return n?Ry(e,t):Hy()}function jy(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 qy(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function r_(n){return n==="angle"?{between:fl,compare:$v,normalize:Pn}:{between:cl,compare:(e,t)=>e-t,normalize:e=>e}}function df({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 Vy(n,e,t){const{property:i,start:s,end:l}=t,{between:o,normalize:r}=r_(i),a=e.length;let{start:u,end:f,loop:c}=n,d,h;if(c){for(u+=a,f+=a,d=0,h=a;d<h&&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 a_(n,e,t){if(!t)return[n];const{property:i,start:s,end:l}=t,o=e.length,{compare:r,between:a,normalize:u}=r_(i),{start:f,end:c,loop:d,style:h}=Vy(n,e,t),g=[];let v=!1,b=null,y,C,S;const $=()=>a(s,S,y)&&r(s,S)!==0,M=()=>r(l,y)===0||a(l,S,y),D=()=>v||$(),E=()=>!v||M();for(let O=f,L=f;O<=c;++O)C=e[O%o],!C.skip&&(y=u(C[i]),y!==S&&(v=a(y,s,l),b===null&&D()&&(b=r(y,s)===0?O:L),b!==null&&E()&&(g.push(df({start:b,end:O,loop:d,count:o,style:h})),b=null),L=O,S=y));return b!==null&&g.push(df({start:b,end:c,loop:d,count:o,style:h})),g}function u_(n,e){const t=[],i=n.segments;for(let s=0;s<i.length;s++){const l=a_(i[s],n.points,e);l.length&&t.push(...l)}return t}function zy(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 By(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}=zy(t,s,l,i);if(i===!0)return pf(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 pf(n,By(t,o,a,u),t,e)}function pf(n,e,t,i){return!i||!i.setContext||!t?e:Wy(n,e,t,i)}function Wy(n,e,t,i){const s=n._chart.getContext(),l=hf(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=l,c=e[0].start,d=c;function h(g,v,b,y){const C=r?-1:1;if(g!==v){for(g+=a;t[g%a].skip;)g-=C;for(;t[v%a].skip;)v+=C;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=hf(i.setContext(Vi(s,{type:"segment",p0:v,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),Yy(b,f)&&h(c,d-1,g.loop,f),v=y,f=b}c<d-1&&h(c,d-1,g.loop,f)}return u}function hf(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function Yy(n,e){return e&&JSON.stringify(n)!==JSON.stringify(e)}/*!
|
||
* Chart.js v3.9.1
|
||
* https://www.chartjs.org
|
||
* (c) 2022 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class Ky{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=Ug.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 bi=new Ky;const mf="transparent",Jy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=lf(n||mf),s=i.valid&&lf(e||mf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Zy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||Jy[e.type||typeof o],this._easing=nl[e.easing]||nl.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=Ul([e.to,t,s,e.from]),this._from=Ul([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 Gy=["x","y","borderWidth","radius","tension"],Xy=["color","borderColor","backgroundColor"];vt.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 Qy=Object.keys(vt.animation);vt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});vt.set("animations",{colors:{type:"color",properties:Xy},numbers:{type:"number",properties:Gy}});vt.describe("animations",{_fallback:"animation"});vt.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 f_{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 Qy)l[o]=s[o];(It(s.properties)&&s.properties||[i]).forEach(o=>{(o===i||!t.has(o))&&t.set(o,l)})})}_animateOptions(e,t){const i=t.options,s=ek(e,i);if(!s)return[];const l=this._createAnimations(s,i);return i.$shared&&xy(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 Zy(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 bi.add(this._chart,i),!0}}function xy(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 ek(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 gf(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 tk(n,e,t){if(t===!1)return!1;const i=gf(n,t),s=gf(e,t);return{top:s.end,right:i.end,bottom:s.start,left:i.start}}function nk(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 c_(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 _f(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],Wt(u)&&(l||e===0||fi(e)===fi(u))&&(e+=u)}return e}}function ik(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 bf(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function sk(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function lk(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 ok(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function vf(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 yf(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=sk(l,o,i),c=e.length;let d;for(let h=0;h<c;++h){const g=e[h],{[a]:v,[u]:b}=g,y=g._stacks||(g._stacks={});d=y[u]=ok(s,f,v),d[r]=b,d._top=vf(d,o,!0,i.type),d._bottom=vf(d,o,!1,i.type)}}function pr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function rk(n,e){return Vi(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function ak(n,e,t){return Vi(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function qs(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(!!i){e=e||n._parsed;for(const s of e){const l=s._stacks;if(!l||l[i]===void 0||l[i][t]===void 0)return;delete l[i][t]}}}const hr=n=>n==="reset"||n==="none",kf=(n,e)=>e?n:Object.assign({},n),uk=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:c_(t,!0),values:null};class oi{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=bf(e.vScale,e),this.addElements()}updateIndex(e){this.index!==e&&qs(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),s=(c,d,h,g)=>c==="x"?d:c==="r"?g:h,l=t.xAxisID=_t(i.xAxisID,pr(e,"x")),o=t.yAxisID=_t(i.yAxisID,pr(e,"y")),r=t.rAxisID=_t(i.rAxisID,pr(e,"r")),a=t.indexAxis,u=t.iAxisID=s(a,l,o,r),f=t.vAxisID=s(a,o,l,r);t.xScale=this.getScaleForId(l),t.yScale=this.getScaleForId(o),t.rScale=this.getScaleForId(r),t.iScale=this.getScaleForId(u),t.vScale=this.getScaleForId(f)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(e){return this.chart.scales[e]}_getOtherScale(e){const t=this._cachedMeta;return e===t.iScale?t.vScale:t.iScale}reset(){this._update("reset")}_destroy(){const e=this._cachedMeta;this._data&&Gu(this._data,this),e._stacked&&qs(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(pt(t))this._data=ik(t);else if(i!==t){if(i){Gu(i,this);const s=this._cachedMeta;qs(s),s._parsed=[]}t&&Object.isExtensible(t)&&Tv(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=bf(t.vScale,t),t.stack!==i.stack&&(s=!0,qs(t),t.stack=i.stack),this._resyncElements(e),(s||l!==t._stacked)&&yf(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{It(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 h=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(h()&&(a=!1),u=c);i._sorted=a}o&&yf(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,h,g;for(d=0,h=s;d<h;++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,h;for(f=0,c=s;f<c;++f)d=f+i,h=t[d],u[f]={x:l.parse(Hi(h,r),d),y:o.parse(Hi(h,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:c_(s,!0),values:t._stacks[e.axis]};return _f(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=_f(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=uk(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=lk(r);let d,h;function g(){h=s[d];const v=h[r.axis];return!Wt(h[e.axis])||f>v||c<v}for(d=0;d<o&&!(!g()&&(this.updateRangeFromParsed(u,e,h,a),l));++d);if(l){for(d=o-1;d>=0;--d)if(!g()){this.updateRangeFromParsed(u,e,h,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let s,l,o;for(s=0,l=t.length;s<l;++s)o=t[s][e.axis],Wt(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=nk(_t(this.options.clip,tk(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=ak(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=rk(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&&Wn(i);if(r)return kf(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),h=Object.keys(vt.elements[e]),g=()=>this.getContext(i,s),v=u.resolveNamedOptions(d,h,g,c);return v.$shared&&(v.$shared=a,l[o]=Object.freeze(kf(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 f_(s,a&&a.animations);return a&&a._cacheable&&(l[o]=Object.freeze(u)),u}getSharedOptions(e){if(!!e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||hr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),s=this._sharedOptions,l=this.getSharedOptions(i),o=this.includeOptions(t,l)||l!==s;return this.updateSharedOptions(l,t,i),{sharedOptions:l,includeOptions:o}}updateElement(e,t,i,s){hr(s)?Object.assign(e,i):this._resolveAnimations(t,s).update(e,i)}updateSharedOptions(e,t,i){e&&!hr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,s){e.active=s;const l=this.getStyle(t,s);this._resolveAnimations(t,i,s).update(e,{options:!s&&this.getSharedOptions(l)||l})}removeHoverStyle(e,t,i){this._setStyle(e,i,"active",!1)}setHoverStyle(e,t,i){this._setStyle(e,i,"active",!0)}_removeDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!1)}_setDatasetHoverStyle(){const e=this._cachedMeta.dataset;e&&this._setStyle(e,void 0,"active",!0)}_resyncElements(e){const t=this._data,i=this._cachedMeta.data;for(const[r,a,u]of this._syncList)this[r](a,u);this._syncList=[];const s=i.length,l=t.length,o=Math.min(l,s);o&&this.parse(0,o),l>s?this._insertElements(s,l-s,e):l<s&&this._removeElements(l,s-l)}_insertElements(e,t,i=!0){const s=this._cachedMeta,l=s.data,o=e+t;let r;const a=u=>{for(u.length+=t,r=u.length-1;r>=o;r--)u[r]=u[r-t]};for(a(l),r=e;r<o;++r)l[r]=new this.dataElementType;this._parsing&&a(s._parsed),this.parse(e,t),i&&this.updateElements(l,e,t,"reset")}updateElements(e,t,i,s){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const s=i._parsed.splice(e,t);i._stacked&&qs(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])}}oi.defaults={};oi.prototype.datasetElementType=null;oi.prototype.dataElementType=null;function fk(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=Bg(i.sort((s,l)=>s-l))}return n._cache.$bar}function ck(n){const e=n.iScale,t=fk(e,n.type);let i=e._length,s,l,o,r;const a=()=>{o===32767||o===-32768||(Wn(r)&&(i=Math.min(i,Math.abs(o-r)||i)),r=o)};for(s=0,l=t.length;s<l;++s)o=e.getPixelForValue(t[s]),a();for(r=void 0,s=0,l=e.ticks.length;s<l;++s)o=e.getPixelForTick(s),a();return i}function dk(n,e,t,i){const s=t.barThickness;let l,o;return Mt(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 pk(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 hk(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 d_(n,e,t,i){return It(n)?hk(n,e,t,i):e[t.axis]=t.parse(n,i),e}function wf(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(d_(d,c,l,u));return a}function mr(n){return n&&n.barStart!==void 0&&n.barEnd!==void 0}function mk(n,e,t){return n!==0?fi(n):(e.isHorizontal()?1:-1)*(e.min>=t?1:-1)}function gk(n){let e,t,i,s,l;return n.horizontal?(e=n.base>n.x,t="left",i="right"):(e=n.base<n.y,t="bottom",i="top"),e?(s="end",l="start"):(s="start",l="end"),{start:t,end:i,reverse:e,top:s,bottom:l}}function _k(n,e,t,i){let s=e.borderSkipped;const l={};if(!s){n.borderSkipped=l;return}if(s===!0){n.borderSkipped={top:!0,right:!0,bottom:!0,left:!0};return}const{start:o,end:r,reverse:a,top:u,bottom:f}=gk(n);s==="middle"&&t&&(n.enableBorderRadius=!0,(t._top||0)===i?s=u:(t._bottom||0)===i?s=f:(l[$f(f,o,r,a)]=!0,s=u)),l[$f(s,o,r,a)]=!0,n.borderSkipped=l}function $f(n,e,t,i){return i?(n=bk(n,e,t),n=Sf(n,t,e)):n=Sf(n,e,t),n}function bk(n,e,t){return n===e?t:n===t?e:n}function Sf(n,e,t){return n==="start"?e:n==="end"?t:n}function vk(n,{inflateAmount:e},t){n.inflateAmount=e==="auto"?t===1?.33:0:e}class Ra extends oi{parsePrimitiveData(e,t,i,s){return wf(e,t,i,s)}parseArrayData(e,t,i,s){return wf(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,h,g,v;for(d=i,h=i+s;d<h;++d)v=t[d],g={},g[l.axis]=l.parse(Hi(v,u),d),c.push(d_(Hi(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=mr(o)?"["+o.start+", "+o.end+"]":""+s.getLabelForValue(l[s.axis]);return{label:""+i.getLabelForValue(l[i.axis]),value:r}}initialize(){this.enableOptionSharing=!0,super.initialize();const e=this._cachedMeta;e.stack=this.getDataset().stack}update(e){const t=this._cachedMeta;this.updateElements(t.data,0,t.data.length,e)}updateElements(e,t,i,s){const l=s==="reset",{index:o,_cachedMeta:{vScale:r}}=this,a=r.getBasePixel(),u=r.isHorizontal(),f=this._getRuler(),{sharedOptions:c,includeOptions:d}=this._getSharedOptions(t,s);for(let h=t;h<t+i;h++){const g=this.getParsed(h),v=l||Mt(g[r.axis])?{base:a,head:a}:this._calculateBarValuePixels(h),b=this._calculateBarIndexPixels(h,f),y=(g._stacks||{})[r.axis],C={horizontal:u,base:v.base,enableBorderRadius:!y||mr(g._custom)||o===y._top||o===y._bottom,x:u?v.head:b.center,y:u?b.center:v.head,height:u?b.size:Math.abs(v.size),width:u?Math.abs(v.size):b.size};d&&(C.options=c||this.resolveDataElementOptions(h,e[h].active?"active":s));const S=C.options||e[h].options;_k(C,S,y,o),vk(C,S,f.ratio),this.updateElement(e[h],h,C,s)}}_getStacks(e,t){const{iScale:i}=this._cachedMeta,s=i.getMatchingVisibleMetas(this._type).filter(a=>a.controller.options.grouped),l=i.options.stacked,o=[],r=a=>{const u=a.controller.getParsed(t),f=u&&u[a.vScale.axis];if(Mt(f)||isNaN(f))return!0};for(const a of s)if(!(t!==void 0&&r(a))&&((l===!1||o.indexOf(a.stack)===-1||l===void 0&&a.stack===void 0)&&o.push(a.stack),a.index===e))break;return o.length||o.push(void 0),o}_getStackCount(e){return this._getStacks(void 0,e).length}_getStackIndex(e,t,i){const s=this._getStacks(e,i),l=t!==void 0?s.indexOf(t):-1;return l===-1?s.length-1:l}_getRuler(){const e=this.options,t=this._cachedMeta,i=t.iScale,s=[];let l,o;for(l=0,o=t.data.length;l<o;++l)s.push(i.getPixelForValue(this.getParsed(l)[i.axis],l));const r=e.barThickness;return{min:r||ck(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=mr(a);let f=r[t.axis],c=0,d=i?this.applyStack(t,r,i):f,h,g;d!==f&&(c=d-f,d=f),u&&(f=a.barStart,d=a.barEnd-a.barStart,f!==0&&fi(f)!==fi(a.barEnd)&&(c=0),c+=f);const v=!Mt(s)&&!u?s:c;let b=t.getPixelForValue(v);if(this.chart.getDataVisibility(e)?h=t.getPixelForValue(c+d):h=b,g=h-b,Math.abs(g)<l){g=mk(g,t,o)*l,f===o&&(b-=g/2);const y=t.getPixelForDecimal(0),C=t.getPixelForDecimal(1),S=Math.min(y,C),$=Math.max(y,C);b=Math.max(Math.min(b,$),S),h=b+g}if(b===t.getPixelForValue(o)){const y=fi(g)*t.getLineWidthForValue(o)/2;b+=y,g-=y}return{size:g,base:b,head:h,center:h+g/2}}_calculateBarIndexPixels(e,t){const i=t.scale,s=this.options,l=s.skipNull,o=_t(s.maxBarThickness,1/0);let r,a;if(t.grouped){const u=l?this._getStackCount(e):t.stackCount,f=s.barThickness==="flex"?pk(e,t,s,u):dk(e,t,s,u),c=this._getStackIndex(this.index,this._cachedMeta.stack,l?e:void 0);r=f.start+f.chunk*c+f.chunk/2,a=Math.min(o,f.chunk*f.ratio)}else r=i.getPixelForValue(this.getParsed(e)[i.axis],e),a=Math.min(o,t.min*t.ratio);return{base:r-a/2,head:r+a/2,center:r,size:a}}draw(){const e=this._cachedMeta,t=e.vScale,i=e.data,s=i.length;let l=0;for(;l<s;++l)this.getParsed(l)[t.axis]!==null&&i[l].draw(this._ctx)}}Ra.id="bar";Ra.defaults={datasetElementType:!1,dataElementType:"bar",categoryPercentage:.8,barPercentage:.9,grouped:!0,animations:{numbers:{type:"number",properties:["x","y","base","width","height"]}}};Ra.overrides={scales:{_index_:{type:"category",offset:!0,grid:{offset:!0}},_value_:{type:"linear",beginAtZero:!0}}};class Ha extends oi{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=_t(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=_t(r&&r.r&&+r.r,this.resolveDataElementOptions(o+i).radius)}return l}getMaxOverflow(){const e=this._cachedMeta.data;let t=0;for(let i=e.length-1;i>=0;--i)t=Math.max(t,e[i].size(this.resolveDataElementOptions(i))/2);return t>0&&t}getLabelAndValue(e){const t=this._cachedMeta,{xScale:i,yScale:s}=t,l=this.getParsed(e),o=i.getLabelForValue(l.x),r=s.getLabelForValue(l.y),a=l._custom;return{label:t.label,value:"("+o+", "+r+(a?", "+a:"")+")"}}update(e){const t=this._cachedMeta.data;this.updateElements(t,0,t.length,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r}=this._cachedMeta,{sharedOptions:a,includeOptions:u}=this._getSharedOptions(t,s),f=o.axis,c=r.axis;for(let d=t;d<t+i;d++){const h=e[d],g=!l&&this.getParsed(d),v={},b=v[f]=l?o.getPixelForDecimal(.5):o.getPixelForValue(g[f]),y=v[c]=l?r.getBasePixel():r.getPixelForValue(g[c]);v.skip=isNaN(b)||isNaN(y),u&&(v.options=a||this.resolveDataElementOptions(d,h.active?"active":s),l&&(v.options.radius=0)),this.updateElement(h,d,v,s)}}resolveDataElementOptions(e,t){const i=this.getParsed(e);let s=super.resolveDataElementOptions(e,t);s.$shared&&(s=Object.assign({},s,{$shared:!1}));const l=s.radius;return t!=="active"&&(s.radius=0),s.radius+=_t(i&&i._custom,l),s}}Ha.id="bubble";Ha.defaults={datasetElementType:!1,dataElementType:"point",animations:{numbers:{type:"number",properties:["x","y","borderWidth","radius"]}}};Ha.overrides={scales:{x:{type:"linear"},y:{type:"linear"}},plugins:{tooltip:{callbacks:{title(){return""}}}}};function yk(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),h=(S,$,M)=>fl(S,r,a,!0)?1:Math.max($,$*t,M,M*t),g=(S,$,M)=>fl(S,r,a,!0)?-1:Math.min($,$*t,M,M*t),v=h(0,u,c),b=h(zt,f,d),y=g(Ut,u,c),C=g(Ut+zt,f,d);i=(v-y)/2,s=(b-C)/2,l=-(v+y)/2,o=-(b+C)/2}return{ratioX:i,ratioY:s,offsetX:l,offsetY:o}}class Sl extends oi{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=>+Hi(i[u],a)}let o,r;for(o=e,r=e+t;o<r;++o)s._parsed[o]=l(o)}}_getRotation(){return Qn(this.options.rotation-90)}_getCircumference(){return Qn(this.options.circumference)}_getRotationExtents(){let e=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(pv(this.options.cutout,r),1),u=this._getRingWeight(this.index),{circumference:f,rotation:c}=this._getRotationExtents(),{ratioX:d,ratioY:h,offsetX:g,offsetY:v}=yk(c,f,a),b=(i.width-o)/d,y=(i.height-o)/h,C=Math.max(Math.min(b,y)/2,0),S=Hg(this.options.radius,C),$=Math.max(S*a,0),M=(S-$)/this._getVisibleDatasetWeightTotal();this.offsetX=g*S,this.offsetY=v*S,s.total=this.calculateTotal(),this.outerRadius=S-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,h=d?0:this.innerRadius,g=d?0:this.outerRadius,{sharedOptions:v,includeOptions:b}=this._getSharedOptions(t,s);let y=this._getRotation(),C;for(C=0;C<t;++C)y+=this._circumference(C,l);for(C=t;C<t+i;++C){const S=this._circumference(C,l),$=e[C],M={x:f+this.offsetX,y:c+this.offsetY,startAngle:y,endAngle:y+S,circumference:S,outerRadius:g,innerRadius:h};b&&(M.options=v||this.resolveDataElementOptions(C,$.active?"active":s)),y+=S,this.updateElement($,C,M,s)}}calculateTotal(){const e=this._cachedMeta,t=e.data;let i=0,s;for(s=0;s<t.length;s++){const l=e._parsed[s];l!==null&&!isNaN(l)&&this.chart.getDataVisibility(s)&&!t[s].hidden&&(i+=Math.abs(l))}return i}calculateCircumference(e){const t=this._cachedMeta.total;return t>0&&!isNaN(e)?At*(Math.abs(e)/t):0}getLabelAndValue(e){const t=this._cachedMeta,i=this.chart,s=i.data.labels||[],l=$l(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(_t(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 It(e)?(e=e.slice(),e[0]+=t):e+=t,e}}}}};class Yo extends oi{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}=Yg(t,s,o);this._drawStart=r,this._drawCount=a,Kg(t)&&(r=0,a=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!l._decimated,i.points=s;const u=this.resolveDatasetElementOptions(e);this.options.showLine||(u.borderWidth=0),u.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:u},e),this.updateElements(s,r,a,e)}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,s),d=o.axis,h=r.axis,{spanGaps:g,segment:v}=this.options,b=Cs(g)?g:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||l||s==="none";let C=t>0&&this.getParsed(t-1);for(let S=t;S<t+i;++S){const $=e[S],M=this.getParsed(S),D=y?$:{},E=Mt(M[h]),O=D[d]=o.getPixelForValue(M[d],S),L=D[h]=l||E?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,M,a):M[h],S);D.skip=isNaN(O)||isNaN(L)||E,D.stop=S>0&&Math.abs(M[d]-C[d])>b,v&&(D.parsed=M,D.raw=u.data[S]),c&&(D.options=f||this.resolveDataElementOptions(S,$.active?"active":s)),y||this.updateElement($,S,D,s),C=M}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,s=e.data||[];if(!s.length)return i;const l=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,l,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Yo.id="line";Yo.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1};Yo.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class ja extends oi{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=$l(t._parsed[e].r,i.options.locale);return{label:s[e]||"",value:l}}parseObjectData(e,t,i,s){return s_.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*Ut;let h=d,g;const v=360/this.countVisibleElements();for(g=0;g<t;++g)h+=this._computeAngle(g,s,v);for(g=t;g<t+i;g++){const b=e[g];let y=h,C=h+this._computeAngle(g,s,v),S=o.getDataVisibility(g)?u.getDistanceFromCenterForValue(this.getParsed(g).r):0;h=C,l&&(a.animateScale&&(S=0),a.animateRotate&&(y=C=d));const $={x:f,y:c,innerRadius:0,outerRadius:S,startAngle:y,endAngle:C,options:this.resolveDataElementOptions(g,b.active?"active":s)};this.updateElement(b,g,$,s)}}countVisibleElements(){const e=this._cachedMeta;let t=0;return e.data.forEach((i,s)=>{!isNaN(this.getParsed(s).r)&&this.chart.getDataVisibility(s)&&t++}),t}_computeAngle(e,t,i){return this.chart.getDataVisibility(e)?Qn(this.resolveDataElementOptions(e,t).angle||i):0}}ja.id="polarArea";ja.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0};ja.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(n){const e=n.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:t}}=n.legend.options;return e.labels.map((i,s)=>{const o=n.getDatasetMeta(0).controller.getStyle(s);return{text:i,fillStyle:o.backgroundColor,strokeStyle:o.borderColor,lineWidth:o.borderWidth,pointStyle:t,hidden:!n.getDataVisibility(s),index:s}})}return[]}},onClick(n,e,t){t.chart.toggleDataVisibility(e.index),t.chart.update()}},tooltip:{callbacks:{title(){return""},label(n){return n.chart.data.labels[n.dataIndex]+": "+n.formattedValue}}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class p_ extends Sl{}p_.id="pie";p_.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class qa extends oi{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 s_.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,h={x:c,y:d,angle:f.angle,skip:isNaN(c)||isNaN(d),options:u};this.updateElement(a,r,h,s)}}}qa.id="radar";qa.defaults={datasetElementType:"line",dataElementType:"point",indexAxis:"r",showLine:!0,elements:{line:{fill:"start"}}};qa.overrides={aspectRatio:1,scales:{r:{type:"radialLinear"}}};class Ci{constructor(){this.x=void 0,this.y=void 0,this.active=!1,this.options=void 0,this.$animations=void 0}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return Cs(this.x)&&Cs(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const s={};return e.forEach(l=>{s[l]=i[l]&&i[l].active()?i[l]._to:this[l]}),s}}Ci.defaults={};Ci.defaultRoutes=void 0;const h_={values(n){return It(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=kk(n,t)}const o=zn(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),$l(n,i,a)},logarithmic(n,e,t){if(n===0)return"0";const i=n/Math.pow(10,Math.floor(zn(n)));return i===1||i===2||i===5?h_.numeric.call(this,n,e,t):""}};function kk(n,e){let t=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;return Math.abs(t)>=1&&n!==Math.floor(n)&&(t=n-Math.floor(n)),t}var Ko={formatters:h_};vt.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",grace:0,grid:{display:!0,lineWidth:1,drawBorder:!0,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,e)=>e.lineWidth,tickColor:(n,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Ko.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}});vt.route("scale.ticks","color","","color");vt.route("scale.grid","color","","borderColor");vt.route("scale.grid","borderColor","","borderColor");vt.route("scale.title","color","","color");vt.describe("scale",{_fallback:!1,_scriptable:n=>!n.startsWith("before")&&!n.startsWith("after")&&n!=="callback"&&n!=="parser",_indexable:n=>n!=="borderDash"&&n!=="tickBorderDash"});vt.describe("scales",{_fallback:"scale"});vt.describe("scale.ticks",{_scriptable:n=>n!=="backdropPadding"&&n!=="callback",_indexable:n=>n!=="backdropPadding"});function wk(n,e){const t=n.options.ticks,i=t.maxTicksLimit||$k(n),s=t.major.enabled?Ck(e):[],l=s.length,o=s[0],r=s[l-1],a=[];if(l>i)return Mk(e,a,s,l/i),a;const u=Sk(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,Mt(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,Mt(d)?e.length:r+d),a}return Yl(e,a,u),a}function $k(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 Sk(n,e,t){const i=Tk(n),s=e.length/t;if(!i)return Math.max(s,1);const l=kv(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 Ck(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function Mk(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=_t(i,0),o=Math.min(_t(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 Tk(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 Dk=n=>n==="left"?"right":n==="right"?"left":n,Cf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t;function Mf(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 Ok(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 Ek(n,e){Et(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 Vs(n){return n.drawTicks?n.tickLength:0}function Tf(n,e){if(!n.display)return 0;const t=Ln(n.font,e),i=Yn(n.padding);return(It(n.text)?n.text.length:1)*t.lineHeight+i.height}function Ak(n,e){return Vi(n,{scale:e,type:"scale"})}function Pk(n,e,t){return Vi(n,{tick:t,index:e,type:"tick"})}function Lk(n,e,t){let i=Ov(n);return(t&&e!=="right"||!t&&e==="right")&&(i=Dk(i)),i}function Ik(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,h,g;const v=o-s,b=r-l;if(n.isHorizontal()){if(h=Xu(i,l,r),pt(t)){const y=Object.keys(t)[0],C=t[y];g=f[y].getPixelForValue(C)+v-e}else t==="center"?g=(u.bottom+u.top)/2+v-e:g=Cf(n,t,e);d=r-l}else{if(pt(t)){const y=Object.keys(t)[0],C=t[y];h=f[y].getPixelForValue(C)-b+e}else t==="center"?h=(u.left+u.right)/2-b+e:h=Cf(n,t,e);g=Xu(i,o,s),c=t==="left"?-zt:zt}return{titleX:h,titleY:g,maxWidth:d,rotation:c}}class us extends Ci{constructor(e){super(),this.id=e.id,this.type=e.type,this.options=void 0,this.ctx=e.ctx,this.chart=e.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(e){this.options=e.setContext(this.getContext()),this.axis=e.axis,this._userMin=this.parse(e.min),this._userMax=this.parse(e.max),this._suggestedMin=this.parse(e.suggestedMin),this._suggestedMax=this.parse(e.suggestedMax)}parse(e,t){return e}getUserBounds(){let{_userMin:e,_userMax:t,_suggestedMin:i,_suggestedMax:s}=this;return e=Rn(e,Number.POSITIVE_INFINITY),t=Rn(t,Number.NEGATIVE_INFINITY),i=Rn(i,Number.POSITIVE_INFINITY),s=Rn(s,Number.NEGATIVE_INFINITY),{min:Rn(e,i),max:Rn(t,s),minDefined:Wt(e),maxDefined:Wt(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:Rn(t,Rn(i,t)),max:Rn(i,Rn(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(){Vt(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=fy(this,l,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?Mf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=wk(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(){Vt(this.options.afterUpdate,[this])}beforeSetDimensions(){Vt(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(){Vt(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Vt(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Vt(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=Vt(t.callback,[l.value,i,e],this)}afterTickToLabelConversion(){Vt(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Vt(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,h=un(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:h/(i-1),c+6>r&&(r=h/(i-(e.offset?.5:1)),a=this.maxHeight-Vs(e.grid)-t.padding-Tf(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Ca(Math.min(Math.asin(un((f.highest.height+6)/r,-1,1)),Math.asin(un(a/u,-1,1))-Math.asin(un(d/u,-1,1)))),o=Math.max(s,Math.min(l,o))),this.labelRotation=o}afterCalculateLabelRotation(){Vt(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Vt(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=Tf(s,t.options.font);if(r?(e.width=this.maxWidth,e.height=Vs(l)+a):(e.height=this.maxHeight,e.width=Vs(l)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),h=i.padding*2,g=Qn(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+h)}else{const y=i.mirror?0:v*c.width+b*d.height;e.width=Math.min(this.maxWidth,e.width+y+h)}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,h=0;a?u?(d=s*e.width,h=i*t.height):(d=i*e.height,h=s*t.width):l==="start"?h=t.width:l==="end"?d=e.width:l!=="inner"&&(d=e.width/2,h=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((h-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(){Vt(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++)Mt(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=Mf(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,h,g,v,b,y,C,S;for(u=0;u<t;++u){if(d=e[u].label,h=this._resolveTickFontOptions(u),i.font=g=h.string,v=s[g]=s[g]||{data:{},gc:[]},b=h.lineHeight,y=C=0,!Mt(d)&&!It(d))y=So(i,v.data,v.gc,y,d),C=b;else if(It(d))for(f=0,c=d.length;f<c;++f)S=d[f],!Mt(S)&&!It(S)&&(y=So(i,v.data,v.gc,y,S),C+=b);l.push(y),o.push(C),r=Math.max(y,r),a=Math.max(C,a)}Ek(s,t);const $=l.indexOf(r),M=o.indexOf(a),D=E=>({width:l[E]||0,height:o[E]||0});return{first:D(0),last:D(t-1),widest:D($),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 Sv(this._alignToPixels?Ki(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=Pk(this.getContext(),e,i))}return this.$context||(this.$context=Ak(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Qn(this.labelRotation),i=Math.abs(Math.cos(t)),s=Math.abs(Math.sin(t)),l=this._getLabelSizes(),o=e.autoSkipPadding||0,r=l?l.widest.width+o:0,a=l?l.highest.height+o:0;return this.isHorizontal()?a*i>r*s?r/i:a/s:a*s<r*i?a/i:r/s}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,s=this.options,{grid:l,position:o}=s,r=l.offset,a=this.isHorizontal(),f=this.ticks.length+(r?1:0),c=Vs(l),d=[],h=l.setContext(this.getContext()),g=h.drawBorder?h.borderWidth:0,v=g/2,b=function(K){return Ki(i,K,g)};let y,C,S,$,M,D,E,O,L,I,N,B;if(o==="top")y=b(this.bottom),D=this.bottom-c,O=y-v,I=b(e.top)+v,B=e.bottom;else if(o==="bottom")y=b(this.top),I=e.top,B=b(e.bottom)-v,D=y+v,O=this.top+c;else if(o==="left")y=b(this.right),M=this.right-c,E=y-v,L=b(e.left)+v,N=e.right;else if(o==="right")y=b(this.left),L=e.left,N=b(e.right)-v,M=y+v,E=this.left+c;else if(t==="x"){if(o==="center")y=b((e.top+e.bottom)/2+.5);else if(pt(o)){const K=Object.keys(o)[0],se=o[K];y=b(this.chart.scales[K].getPixelForValue(se))}I=e.top,B=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 K=Object.keys(o)[0],se=o[K];y=b(this.chart.scales[K].getPixelForValue(se))}M=y-v,E=M-c,L=e.left,N=e.right}const U=_t(s.ticks.maxTicksLimit,f),ee=Math.max(1,Math.ceil(f/U));for(C=0;C<f;C+=ee){const K=l.setContext(this.getContext(C)),se=K.lineWidth,Y=K.color,te=K.borderDash||[],J=K.borderDashOffset,_e=K.tickWidth,be=K.tickColor,X=K.tickBorderDash||[],ae=K.tickBorderDashOffset;S=Ok(this,C,r),S!==void 0&&($=Ki(i,S,se),a?M=E=L=N=$:D=O=I=B=$,d.push({tx1:M,ty1:D,tx2:E,ty2:O,x1:L,y1:I,x2:N,y2:B,width:se,color:Y,borderDash:te,borderDashOffset:J,tickWidth:_e,tickColor:be,tickBorderDash:X,tickBorderDashOffset:ae}))}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=Vs(i.grid),h=d+f,g=c?-f:h,v=-Qn(this.labelRotation),b=[];let y,C,S,$,M,D,E,O,L,I,N,B,U="middle";if(s==="top")D=this.bottom-g,E=this._getXAxisLabelAlignment();else if(s==="bottom")D=this.top+g,E=this._getXAxisLabelAlignment();else if(s==="left"){const K=this._getYAxisLabelAlignment(d);E=K.textAlign,M=K.x}else if(s==="right"){const K=this._getYAxisLabelAlignment(d);E=K.textAlign,M=K.x}else if(t==="x"){if(s==="center")D=(e.top+e.bottom)/2+h;else if(pt(s)){const K=Object.keys(s)[0],se=s[K];D=this.chart.scales[K].getPixelForValue(se)+h}E=this._getXAxisLabelAlignment()}else if(t==="y"){if(s==="center")M=(e.left+e.right)/2-h;else if(pt(s)){const K=Object.keys(s)[0],se=s[K];M=this.chart.scales[K].getPixelForValue(se)}E=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?U="top":a==="end"&&(U="bottom"));const ee=this._getLabelSizes();for(y=0,C=r.length;y<C;++y){S=r[y],$=S.label;const K=l.setContext(this.getContext(y));O=this.getPixelForTick(y)+l.labelOffset,L=this._resolveTickFontOptions(y),I=L.lineHeight,N=It($)?$.length:1;const se=N/2,Y=K.color,te=K.textStrokeColor,J=K.textStrokeWidth;let _e=E;o?(M=O,E==="inner"&&(y===C-1?_e=this.options.reverse?"left":"right":y===0?_e=this.options.reverse?"right":"left":_e="center"),s==="top"?u==="near"||v!==0?B=-N*I+I/2:u==="center"?B=-ee.highest.height/2-se*I+I:B=-ee.highest.height+I/2:u==="near"||v!==0?B=I/2:u==="center"?B=ee.highest.height/2-se*I:B=ee.highest.height-N*I,c&&(B*=-1)):(D=O,B=(1-N)*I/2);let be;if(K.showLabelBackdrop){const X=Yn(K.backdropPadding),ae=ee.heights[y],ve=ee.widths[y];let H=D+B-X.top,me=M-X.left;switch(U){case"middle":H-=ae/2;break;case"bottom":H-=ae;break}switch(E){case"center":me-=ve/2;break;case"right":me-=ve;break}be={left:me,top:H,width:ve+X.width,height:ae+X.height,color:K.backdropColor}}b.push({rotation:v,label:$,font:L,color:Y,strokeColor:te,strokeWidth:J,textOffset:B,textAlign:_e,textBaseline:U,translation:[M,D],backdrop:be})}return b}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Qn(this.labelRotation))return e==="top"?"left":"right";let s="center";return t.align==="start"?s="left":t.align==="end"?s="right":t.align==="inner"&&(s="inner"),s}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:s,padding:l}}=this.options,o=this._getLabelSizes(),r=e+l,a=o.widest.width;let u,f;return t==="left"?s?(f=this.right+l,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f+=a)):(f=this.right-r,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f=this.left)):t==="right"?s?(f=this.left+l,i==="near"?u="right":i==="center"?(u="center",f-=a/2):(u="left",f-=a)):(f=this.left+r,i==="near"?u="left":i==="center"?(u="center",f+=a/2):(u="right",f=this.right)):u="right",{textAlign:u,x:f}}_computeLabelArea(){if(this.options.ticks.mirror)return;const e=this.chart,t=this.options.position;if(t==="left"||t==="right")return{top:0,left:this.left,bottom:e.height,right:this.right};if(t==="top"||t==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:e.width}}drawBackground(){const{ctx:e,options:{backgroundColor:t},left:i,top:s,width:l,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,s,l,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const s=this.ticks.findIndex(l=>l.value===e);return s>=0?t.setContext(this.getContext(s)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let l,o;const r=(a,u,f)=>{!f.width||!f.color||(i.save(),i.lineWidth=f.width,i.strokeStyle=f.color,i.setLineDash(f.borderDash||[]),i.lineDashOffset=f.borderDashOffset,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(u.x,u.y),i.stroke(),i.restore())};if(t.display)for(l=0,o=s.length;l<o;++l){const a=s[l];t.drawOnChartArea&&r({x:a.x1,y:a.y1},{x:a.x2,y:a.y2},a),t.drawTicks&&r({x:a.tx1,y:a.ty1},{x:a.tx2,y:a.ty2},{color:a.tickColor,width:a.tickWidth,borderDash:a.tickBorderDash,borderDashOffset:a.tickBorderDashOffset})}}drawBorder(){const{chart:e,ctx:t,options:{grid:i}}=this,s=i.setContext(this.getContext()),l=i.drawBorder?s.borderWidth:0;if(!l)return;const o=i.setContext(this.getContext(0)).lineWidth,r=this._borderValue;let a,u,f,c;this.isHorizontal()?(a=Ki(e,this.left,l)-l/2,u=Ki(e,this.right,o)+o/2,f=c=r):(f=Ki(e,this.top,l)-l/2,c=Ki(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&&Ea(i,s);const l=this._labelItems||(this._labelItems=this._computeLabelItems(e));let o,r;for(o=0,r=l.length;o<r;++o){const a=l[o],u=a.font,f=a.label;a.backdrop&&(i.fillStyle=a.backdrop.color,i.fillRect(a.backdrop.left,a.backdrop.top,a.backdrop.width,a.backdrop.height));let c=a.textOffset;Co(i,f,0,c,u,a)}s&&Aa(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:s}}=this;if(!i.display)return;const l=Ln(i.font),o=Yn(i.padding),r=i.align;let a=l.lineHeight/2;t==="bottom"||t==="center"||pt(t)?(a+=o.bottom,It(i.text)&&(a+=l.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=Ik(this,a,t,r);Co(e,i.text,0,0,l,{color:i.color,maxWidth:c,rotation:d,textAlign:Lk(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=_t(e.grid&&e.grid.z,-1);return!this._isVisible()||this.draw!==us.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 Ln(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;Rk(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,Fk(e,o,i),this.override&&vt.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 vt[s]&&(delete vt[s][i],this.override&&delete rs[i])}}function Fk(n,e,t){const i=ul(Object.create(null),[t?vt.get(t):{},vt.get(e),n.defaults]);vt.set(e,i),n.defaultRoutes&&Nk(e,n.defaultRoutes),n.descriptors&&vt.describe(e,n.descriptors)}function Nk(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(".");vt.route(l,s,a,r)})}function Rk(n){return"id"in n&&"defaults"in n}class Hk{constructor(){this.controllers=new Kl(oi,"datasets",!0),this.elements=new Kl(Ci,"elements"),this.plugins=new Kl(Object,"plugins"),this.scales=new Kl(us,"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):Et(s,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const s=Sa(e);Vt(i["before"+s],[],i),t[e](i),Vt(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 ui=new Hk;class Va extends oi{update(e){const t=this._cachedMeta,{data:i=[]}=t,s=this.chart._animationsDisabled;let{start:l,count:o}=Yg(t,i,s);if(this._drawStart=l,this._drawCount=o,Kg(t)&&(l=0,o=i.length),this.options.showLine){const{dataset:r,_dataset:a}=t;r._chart=this.chart,r._datasetIndex=this.index,r._decimated=!!a._decimated,r.points=i;const u=this.resolveDatasetElementOptions(e);u.segment=this.options.segment,this.updateElement(r,void 0,{animated:!s,options:u},e)}this.updateElements(i,l,o,e)}addElements(){const{showLine:e}=this.options;!this.datasetElementType&&e&&(this.datasetElementType=ui.getElement("line")),super.addElements()}updateElements(e,t,i,s){const l=s==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,f=this.resolveDataElementOptions(t,s),c=this.getSharedOptions(f),d=this.includeOptions(s,c),h=o.axis,g=r.axis,{spanGaps:v,segment:b}=this.options,y=Cs(v)?v:Number.POSITIVE_INFINITY,C=this.chart._animationsDisabled||l||s==="none";let S=t>0&&this.getParsed(t-1);for(let $=t;$<t+i;++$){const M=e[$],D=this.getParsed($),E=C?M:{},O=Mt(D[g]),L=E[h]=o.getPixelForValue(D[h],$),I=E[g]=l||O?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,D,a):D[g],$);E.skip=isNaN(L)||isNaN(I)||O,E.stop=$>0&&Math.abs(D[h]-S[h])>y,b&&(E.parsed=D,E.raw=u.data[$]),d&&(E.options=c||this.resolveDataElementOptions($,M.active?"active":s)),C||this.updateElement(M,$,E,s),S=D}this.updateSharedOptions(c,s,f)}getMaxOverflow(){const e=this._cachedMeta,t=e.data||[];if(!this.options.showLine){let r=0;for(let a=t.length-1;a>=0;--a)r=Math.max(r,t[a].size(this.resolveDataElementOptions(a))/2);return r>0&&r}const i=e.dataset,s=i.options&&i.options.borderWidth||0;if(!t.length)return s;const l=t[0].size(this.resolveDataElementOptions(0)),o=t[t.length-1].size(this.resolveDataElementOptions(t.length-1));return Math.max(s,l,o)/2}}Va.id="scatter";Va.defaults={datasetElementType:!1,dataElementType:"point",showLine:!1,fill:!1};Va.overrides={interaction:{mode:"point"},plugins:{tooltip:{callbacks:{title(){return""},label(n){return"("+n.label+", "+n.formattedValue+")"}}}},scales:{x:{type:"linear"},y:{type:"linear"}}};function Ji(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Zr{constructor(e){this.options=e||{}}init(e){}formats(){return Ji()}parse(e,t){return Ji()}format(e,t){return Ji()}add(e,t,i){return Ji()}diff(e,t,i){return Ji()}startOf(e,t,i){return Ji()}endOf(e,t){return Ji()}}Zr.override=function(n){Object.assign(Zr.prototype,n)};var m_={_date:Zr};function jk(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?Cv:es;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}=jk(l[r],e,o,s);for(let h=c;h<=d;++h){const g=f[h];g.skip||i(g,u,h)}}}function qk(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,s){const l=e?Math.abs(i.x-s.x):0,o=t?Math.abs(i.y-s.y):0;return Math.sqrt(Math.pow(l,2)+Math.pow(o,2))}}function gr(n,e,t,i,s){const l=[];return!s&&!n.isPointInArea(e)||Cl(n,t,e,function(r,a,u){!s&&!dl(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&l.push({element:r,datasetIndex:a,index:u})},!0),l}function Vk(n,e,t,i){let s=[];function l(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=Vg(o,{x:e.x,y:e.y});fl(c,u,f)&&s.push({element:o,datasetIndex:r,index:a})}return Cl(n,t,e,l),s}function zk(n,e,t,i,s,l){let o=[];const r=qk(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const h=f.inRange(e.x,e.y,s);if(i&&!h)return;const g=f.getCenterPoint(s);if(!(!!l||n.isPointInArea(g))&&!h)return;const b=r(e,g);b<a?(o=[{element:f,datasetIndex:c,index:d}],a=b):b===a&&o.push({element:f,datasetIndex:c,index:d})}return Cl(n,t,e,u),o}function _r(n,e,t,i,s,l){return!l&&!n.isPointInArea(e)?[]:t==="r"&&!i?Vk(n,e,t,s):zk(n,e,t,i,s,l)}function Df(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 Bk={evaluateInteractionItems:Cl,modes:{index(n,e,t,i){const s=Xi(e,n),l=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?gr(n,s,l,i,o):_r(n,s,l,!1,i,o),a=[];return r.length?(n.getSortedVisibleDatasetMetas().forEach(u=>{const f=r[0].index,c=u.data[f];c&&!c.skip&&a.push({element:c,datasetIndex:u.index,index:f})}),a):[]},dataset(n,e,t,i){const s=Xi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?gr(n,s,l,i,o):_r(n,s,l,!1,i,o);if(r.length>0){const a=r[0].datasetIndex,u=n.getDatasetMeta(a).data;r=[];for(let f=0;f<u.length;++f)r.push({element:u[f],datasetIndex:a,index:f})}return r},point(n,e,t,i){const s=Xi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return gr(n,s,l,i,o)},nearest(n,e,t,i){const s=Xi(e,n),l=t.axis||"xy",o=t.includeInvisible||!1;return _r(n,s,l,t.intersect,i,o)},x(n,e,t,i){const s=Xi(e,n);return Df(n,s,"x",t.intersect,i)},y(n,e,t,i){const s=Xi(e,n);return Df(n,s,"y",t.intersect,i)}}};const g_=["left","top","right","bottom"];function zs(n,e){return n.filter(t=>t.pos===e)}function Of(n,e){return n.filter(t=>g_.indexOf(t.pos)===-1&&t.box.axis===e)}function Bs(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 Uk(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 Wk(n){const e={};for(const t of n){const{stack:i,pos:s,stackWeight:l}=t;if(!i||!g_.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 Yk(n,e){const t=Wk(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 Kk(n){const e=Uk(n),t=Bs(e.filter(u=>u.box.fullSize),!0),i=Bs(zs(e,"left"),!0),s=Bs(zs(e,"right")),l=Bs(zs(e,"top"),!0),o=Bs(zs(e,"bottom")),r=Of(e,"x"),a=Of(e,"y");return{fullSize:t,leftAndTop:i.concat(l),rightAndBottom:s.concat(a).concat(o).concat(r),chartArea:zs(e,"chartArea"),vertical:i.concat(s).concat(a),horizontal:l.concat(o).concat(r)}}function Ef(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function __(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 Jk(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&&__(o,l.getPadding());const r=Math.max(0,e.outerWidth-Ef(o,n,"left","right")),a=Math.max(0,e.outerHeight-Ef(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 Zk(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 Gk(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 Gs(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,Gk(r.horizontal,e));const{same:c,other:d}=Jk(e,t,r,i);u|=c&&s.length,f=f||d,a.fullSize||s.push(r)}return u&&Gs(s,e,t,i)||f}function Jl(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 Af(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;Wn(u.start)&&(o=u.start),a.fullSize?Jl(a,s.left,o,t.outerWidth-s.right-s.left,d):Jl(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;Wn(u.start)&&(l=u.start),a.fullSize?Jl(a,l,s.top,d,t.outerHeight-s.bottom-s.top):Jl(a,l,e.top+u.placed,d,c),u.start=l,u.placed+=c,l=a.right}}e.x=l,e.y=o}vt.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}});var Zl={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=Yn(n.options.layout.padding),l=Math.max(e-s.width,0),o=Math.max(t-s.height,0),r=Kk(n.boxes),a=r.vertical,u=r.horizontal;Et(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);__(d,Yn(i));const h=Object.assign({maxPadding:d,w:l,h:o,x:s.left,y:s.top},s),g=Yk(a.concat(u),c);Gs(r.fullSize,h,c,g),Gs(a,h,c,g),Gs(u,h,c,g)&&Gs(a,h,c,g),Zk(h),Af(r.leftAndTop,h,c,g),h.x+=h.w,h.y+=h.h,Af(r.rightAndBottom,h,c,g),n.chartArea={left:h.left,top:h.top,right:h.left+h.w,bottom:h.top+h.h,height:h.h,width:h.w},Et(r.chartArea,v=>{const b=v.box;Object.assign(b,n.chartArea),b.update(h.w,h.h,{left:0,top:0,right:0,bottom:0})})}};class b_{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 Xk extends b_{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const ro="$chartjs",Qk={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Pf=n=>n===null||n==="";function xk(n,e){const t=n.style,i=n.getAttribute("height"),s=n.getAttribute("width");if(n[ro]={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",Pf(s)){const l=ff(n,"width");l!==void 0&&(n.width=l)}if(Pf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const l=ff(n,"height");l!==void 0&&(n.height=l)}return n}const v_=Ly?{passive:!0}:!1;function e2(n,e,t){n.addEventListener(e,t,v_)}function t2(n,e,t){n.canvas.removeEventListener(e,t,v_)}function n2(n,e){const t=Qk[n.type]||n.type,{x:i,y:s}=Xi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:s!==void 0?s:null}}function Do(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function i2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.addedNodes,i),o=o&&!Do(r.removedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}function s2(n,e,t){const i=n.canvas,s=new MutationObserver(l=>{let o=!1;for(const r of l)o=o||Do(r.removedNodes,i),o=o&&!Do(r.addedNodes,i);o&&t()});return s.observe(document,{childList:!0,subtree:!0}),s}const pl=new Map;let Lf=0;function y_(){const n=window.devicePixelRatio;n!==Lf&&(Lf=n,pl.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function l2(n,e){pl.size||window.addEventListener("resize",y_),pl.set(n,e)}function o2(n){pl.delete(n),pl.size||window.removeEventListener("resize",y_)}function r2(n,e,t){const i=n.canvas,s=i&&Na(i);if(!s)return;const l=Wg((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),l2(n,l),o}function br(n,e,t){t&&t.disconnect(),e==="resize"&&o2(n)}function a2(n,e,t){const i=n.canvas,s=Wg(l=>{n.ctx!==null&&t(n2(l,n))},n,l=>{const o=l[0];return[o,o.offsetX,o.offsetY]});return e2(i,e,s),s}class u2 extends b_{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(xk(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[ro])return!1;const i=t[ro].initial;["height","width"].forEach(l=>{const o=i[l];Mt(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[ro],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const s=e.$proxies||(e.$proxies={}),o={attach:i2,detach:s2,resize:r2}[t]||a2;s[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),s=i[t];if(!s)return;({attach:br,detach:br,resize:br}[t]||t2)(e,t,s),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,s){return Py(e,t,i,s)}isAttached(e){const t=Na(e);return!!(t&&t.isConnected)}}function f2(n){return!o_()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?Xk:u2}class c2{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(Vt(r,a,o)===!1&&s.cancelable)return!1}return!0}invalidate(){Mt(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=_t(i.options&&i.options.plugins,{}),l=d2(i);return s===!1&&!t?[]:h2(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 d2(n){const e={},t=[],i=Object.keys(ui.plugins.items);for(let l=0;l<i.length;l++)t.push(ui.getPlugin(i[l]));const s=n.plugins||[];for(let l=0;l<s.length;l++){const o=s[l];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function p2(n,e){return!e&&n===!1?null:n===!0?{}:n}function h2(n,{plugins:e,localIds:t},i,s){const l=[],o=n.getContext();for(const r of e){const a=r.id,u=p2(i[a],s);u!==null&&l.push({plugin:r,options:m2(n.config,{plugin:r,local:t[a]},u,o)})}return l}function m2(n,{plugin:e,local:t},i,s){const l=n.pluginScopeKeys(e),o=n.getOptionScopes(i,l);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function Gr(n,e){const t=vt.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function g2(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function _2(n,e){return n===e?"_index_":"_value_"}function b2(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function Xr(n,e){return n==="x"||n==="y"?n:e.axis||b2(e.position)||n.charAt(0).toLowerCase()}function v2(n,e){const t=rs[n.type]||{scales:{}},i=e.scales||{},s=Gr(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=Xr(r,a),f=_2(u,s),c=t.scales||{};l[u]=l[u]||r,o[r]=el(Object.create(null),[{axis:u},a,c[u],c[f]])}),n.data.datasets.forEach(r=>{const a=r.type||n.type,u=r.indexAxis||Gr(a,e),c=(rs[a]||{}).scales||{};Object.keys(c).forEach(d=>{const h=g2(d,u),g=r[h+"AxisID"]||l[h]||h;o[g]=o[g]||Object.create(null),el(o[g],[{axis:h},i[g],c[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];el(a,[vt.scales[a.type],vt.scale])}),o}function k_(n){const e=n.options||(n.options={});e.plugins=_t(e.plugins,{}),e.scales=v2(n,e)}function w_(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function y2(n){return n=n||{},n.data=w_(n.data),k_(n),n}const If=new Map,$_=new Set;function Gl(n,e){let t=If.get(n);return t||(t=e(),If.set(n,t),$_.add(t)),t}const Us=(n,e,t)=>{const i=Hi(e,t);i!==void 0&&n.add(i)};class k2{constructor(e){this._config=y2(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=w_(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(),k_(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gl(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gl(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gl(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gl(`${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=>Us(a,e,c))),f.forEach(c=>Us(a,s,c)),f.forEach(c=>Us(a,rs[l]||{},c)),f.forEach(c=>Us(a,vt,c)),f.forEach(c=>Us(a,Kr,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),$_.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,rs[t]||{},vt.datasets[t]||{},{type:t},vt,Kr]}resolveNamedOptions(e,t,i,s=[""]){const l={$shared:!0},{resolver:o,subPrefixes:r}=Ff(this._resolverCache,e,s);let a=o;if($2(o,t)){l.$shared=!1,i=ji(i)?i():i;const u=this.createResolver(e,i,r);a=Ms(o,i,u)}for(const u of t)l[u]=a[u];return l}createResolver(e,t,i=[""],s){const{resolver:l}=Ff(this._resolverCache,e,i);return pt(t)?Ms(l,t,void 0,s):l}}function Ff(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:La(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(s,l)),l}const w2=n=>pt(n)&&Object.getOwnPropertyNames(n).reduce((e,t)=>e||ji(n[t]),!1);function $2(n,e){const{isScriptable:t,isIndexable:i}=e_(n);for(const s of e){const l=t(s),o=i(s),r=(o||l)&&n[s];if(l&&(ji(r)||w2(r))||o&&It(r))return!0}return!1}var S2="3.9.1";const C2=["top","bottom","left","right","chartArea"];function Nf(n,e){return n==="top"||n==="bottom"||C2.indexOf(n)===-1&&e==="x"}function Rf(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function Hf(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Vt(t&&t.onComplete,[n],e)}function M2(n){const e=n.chart,t=e.options.animation;Vt(t&&t.onProgress,[n],e)}function S_(n){return o_()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const Oo={},C_=n=>{const e=S_(n);return Object.values(Oo).filter(t=>t.canvas===e).pop()};function T2(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 D2(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class Eo{constructor(e,t){const i=this.config=new k2(t),s=S_(e),l=C_(s);if(l)throw new Error("Canvas is already in use. Chart with ID '"+l.id+"' must be destroyed before the canvas with ID '"+l.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||f2(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=dv(),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 c2,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=Dv(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],Oo[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}bi.listen(this,"complete",Hf),bi.listen(this,"progress",M2),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:s,_aspectRatio:l}=this;return Mt(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():uf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return of(this.canvas,this.ctx),this}stop(){return bi.stop(this),this}resize(e,t){bi.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,uf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Vt(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};Et(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=Xr(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),Et(l,o=>{const r=o.options,a=r.id,u=Xr(a,r),f=_t(r.type,o.dtype);(r.position===void 0||Nf(r.position,u)!==Nf(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=ui.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),Et(s,(o,r)=>{o||delete i[r]}),Et(i,o=>{Zl.configure(this,o,o.options),Zl.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(Rf("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||Gr(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=ui.getController(r),{datasetElementType:u,dataElementType:f}=vt.datasets[r];Object.assign(a.prototype,{dataElementType:ui.getElement(f),datasetElementType:u&&ui.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){Et(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||Et(l,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(Rf("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){Et(this.scales,e=>{Zl.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!Yu(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;T2(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(!Yu(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;Zl.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],Et(this.boxes,s=>{i&&s.position==="chartArea"||(s.configure&&s.configure(),this._layers.push(...s._layers()))},this),this._layers.forEach((s,l)=>{s._idx=l}),this.notifyPlugins("afterLayout")}_updateDatasets(e){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:e,cancelable:!0})!==!1){for(let t=0,i=this.data.datasets.length;t<i;++t)this.getDatasetMeta(t).controller.configure();for(let t=0,i=this.data.datasets.length;t<i;++t)this._updateDataset(t,ji(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),s={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",s)!==!1&&(i.controller._update(t),s.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",s))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(bi.has(this)?this.attached&&!bi.running(this)&&bi.start(this):(this.draw(),Hf({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&&Ea(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&&Aa(t),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}isPointInArea(e){return dl(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,s){const l=Bk.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=Vi(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);Wn(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(),bi.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(),of(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),this.notifyPlugins("destroy"),delete Oo[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)};Et(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(){Et(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},Et(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}});!yo(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=bv(e),u=D2(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Vt(l.onHover,[e,r,this],this),a&&Vt(l.onClick,[e,r,this],this));const f=!yo(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 jf=()=>Et(Eo.instances,n=>n._plugins.invalidate()),Oi=!0;Object.defineProperties(Eo,{defaults:{enumerable:Oi,value:vt},instances:{enumerable:Oi,value:Oo},overrides:{enumerable:Oi,value:rs},registry:{enumerable:Oi,value:ui},version:{enumerable:Oi,value:S2},getChart:{enumerable:Oi,value:C_},register:{enumerable:Oi,value:(...n)=>{ui.add(...n),jf()}},unregister:{enumerable:Oi,value:(...n)=>{ui.remove(...n),jf()}}});function M_(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+zt,i-zt),n.closePath(),n.clip()}function O2(n){return Pa(n,["outerStart","outerEnd","innerStart","innerEnd"])}function E2(n,e,t,i){const s=O2(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 un(a,0,Math.min(l,u))};return{outerStart:r(s.outerStart),outerEnd:r(s.outerEnd),innerStart:un(s.innerStart,0,o),innerEnd:un(s.innerEnd,0,o)}}function gs(n,e,t,i){return{x:t+n*Math.cos(e),y:i+n*Math.sin(e)}}function Qr(n,e,t,i,s,l){const{x:o,y:r,startAngle:a,pixelMargin:u,innerRadius:f}=e,c=Math.max(e.outerRadius+i+t-u,0),d=f>0?f+i+t+u:0;let h=0;const g=s-a;if(i){const K=f>0?f-i:0,se=c>0?c-i:0,Y=(K+se)/2,te=Y!==0?g*Y/(Y+i):g;h=(g-te)/2}const v=Math.max(.001,g*c-t/Ut)/c,b=(g-v)/2,y=a+b+h,C=s-b-h,{outerStart:S,outerEnd:$,innerStart:M,innerEnd:D}=E2(e,d,c,C-y),E=c-S,O=c-$,L=y+S/E,I=C-$/O,N=d+M,B=d+D,U=y+M/N,ee=C-D/B;if(n.beginPath(),l){if(n.arc(o,r,c,L,I),$>0){const Y=gs(O,I,o,r);n.arc(Y.x,Y.y,$,I,C+zt)}const K=gs(B,C,o,r);if(n.lineTo(K.x,K.y),D>0){const Y=gs(B,ee,o,r);n.arc(Y.x,Y.y,D,C+zt,ee+Math.PI)}if(n.arc(o,r,d,C-D/d,y+M/d,!0),M>0){const Y=gs(N,U,o,r);n.arc(Y.x,Y.y,M,U+Math.PI,y-zt)}const se=gs(E,y,o,r);if(n.lineTo(se.x,se.y),S>0){const Y=gs(E,L,o,r);n.arc(Y.x,Y.y,S,y-zt,L)}}else{n.moveTo(o,r);const K=Math.cos(L)*c+o,se=Math.sin(L)*c+r;n.lineTo(K,se);const Y=Math.cos(I)*c+o,te=Math.sin(I)*c+r;n.lineTo(Y,te)}n.closePath()}function A2(n,e,t,i,s){const{fullCircles:l,startAngle:o,circumference:r}=e;let a=e.endAngle;if(l){Qr(n,e,t,i,o+At,s);for(let u=0;u<l;++u)n.fill();isNaN(r)||(a=o+r%At,r%At===0&&(a+=At))}return Qr(n,e,t,i,a,s),n.fill(),a}function P2(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&&M_(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 L2(n,e,t,i,s,l){const{options:o}=e,{borderWidth:r,borderJoinStyle:a}=o,u=o.borderAlign==="inner";!r||(u?(n.lineWidth=r*2,n.lineJoin=a||"round"):(n.lineWidth=r,n.lineJoin=a||"bevel"),e.fullCircles&&P2(n,e,u),u&&M_(n,e,s),Qr(n,e,t,i,s,l),n.stroke())}class za extends Ci{constructor(e){super(),this.options=void 0,this.circumference=void 0,this.startAngle=void 0,this.endAngle=void 0,this.innerRadius=void 0,this.outerRadius=void 0,this.pixelMargin=0,this.fullCircles=0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.getProps(["x","y"],i),{angle:l,distance:o}=Vg(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=_t(c,a-r)>=At||fl(l,r,a),v=cl(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,o=t.circular;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 r=0;if(s){r=s/2;const u=(this.startAngle+this.endAngle)/2;e.translate(Math.cos(u)*r,Math.sin(u)*r),this.circumference>=Ut&&(r=s)}e.fillStyle=t.backgroundColor,e.strokeStyle=t.borderColor;const a=A2(e,this,r,l,o);L2(e,this,r,l,a,o),e.restore()}}za.id="arc";za.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0,circular:!0};za.defaultRoutes={backgroundColor:"backgroundColor"};function T_(n,e,t=e){n.lineCap=_t(t.borderCapStyle,e.borderCapStyle),n.setLineDash(_t(t.borderDash,e.borderDash)),n.lineDashOffset=_t(t.borderDashOffset,e.borderDashOffset),n.lineJoin=_t(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=_t(t.borderWidth,e.borderWidth),n.strokeStyle=_t(t.borderColor,e.borderColor)}function I2(n,e,t){n.lineTo(t.x,t.y)}function F2(n){return n.stepped?ny:n.tension||n.cubicInterpolationMode==="monotone"?iy:I2}function D_(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 N2(n,e,t,i){const{points:s,options:l}=e,{count:o,start:r,loop:a,ilen:u}=D_(s,t,i),f=F2(l);let{move:c=!0,reverse:d}=i||{},h,g,v;for(h=0;h<=u;++h)g=s[(r+(d?u-h:h))%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 R2(n,e,t,i){const s=e.points,{count:l,start:o,ilen:r}=D_(s,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,h,g,v,b,y;const C=$=>(o+(u?r-$:$))%l,S=()=>{v!==b&&(n.lineTo(f,b),n.lineTo(f,v),n.lineTo(f,y))};for(a&&(h=s[C(0)],n.moveTo(h.x,h.y)),d=0;d<=r;++d){if(h=s[C(d)],h.skip)continue;const $=h.x,M=h.y,D=$|0;D===g?(M<v?v=M:M>b&&(b=M),f=(c*f+$)/++c):(S(),n.lineTo($,M),g=D,c=0,v=b=M),y=M}S()}function xr(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?R2:N2}function H2(n){return n.stepped?Iy:n.tension||n.cubicInterpolationMode==="monotone"?Fy:Qi}function j2(n,e,t,i){let s=e._path;s||(s=e._path=new Path2D,e.path(s,t,i)&&s.closePath()),T_(n,e.options),n.stroke(s)}function q2(n,e,t,i){const{segments:s,options:l}=e,o=xr(e);for(const r of s)T_(n,l,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const V2=typeof Path2D=="function";function z2(n,e,t,i){V2&&!e.options.segment?j2(n,e,t,i):q2(n,e,t,i)}class zi extends Ci{constructor(e){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,e&&Object.assign(this,e)}updateControlPoints(e,t){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;My(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=u_(this,{property:t,start:s,end:s});if(!o.length)return;const r=[],a=H2(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],h=l[c],g=l[d];if(h===g){r.push(h);continue}const v=Math.abs((s-h[t])/(g[t]-h[t])),b=a(h,g,v,i.stepped);b[t]=e[t],r.push(b)}return r.length===1?r[0]:r}pathSegment(e,t,i){return xr(this)(e,this,t,i)}path(e,t,i){const s=this.segments,l=xr(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(),z2(e,this,i,s),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}zi.id="line";zi.defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};zi.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};zi.descriptors={_scriptable:!0,_indexable:n=>n!=="borderDash"&&n!=="fill"};function qf(n,e,t,i){const s=n.options,{[t]:l}=n.getProps([t],i);return Math.abs(e-l)<s.radius+s.hitRadius}class Jo extends Ci{constructor(e){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,e&&Object.assign(this,e)}inRange(e,t,i){const s=this.options,{x:l,y:o}=this.getProps(["x","y"],i);return Math.pow(e-l,2)+Math.pow(t-o,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(e,t){return qf(this,e,"x",t)}inYRange(e,t){return qf(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||!dl(this,t,this.size(i)/2)||(e.strokeStyle=i.borderColor,e.lineWidth=i.borderWidth,e.fillStyle=i.backgroundColor,Jr(e,i,this.x,this.y))}getRange(){const e=this.options||{};return e.radius+e.hitRadius}}Jo.id="point";Jo.defaults={borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0};Jo.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function O_(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 Fi(n,e,t,i){return n?0:un(e,t,i)}function B2(n,e,t){const i=n.options.borderWidth,s=n.borderSkipped,l=xg(i);return{t:Fi(s.top,l.top,0,t),r:Fi(s.right,l.right,0,e),b:Fi(s.bottom,l.bottom,0,t),l:Fi(s.left,l.left,0,e)}}function U2(n,e,t){const{enableBorderRadius:i}=n.getProps(["enableBorderRadius"]),s=n.options.borderRadius,l=ys(s),o=Math.min(e,t),r=n.borderSkipped,a=i||pt(s);return{topLeft:Fi(!a||r.top||r.left,l.topLeft,0,o),topRight:Fi(!a||r.top||r.right,l.topRight,0,o),bottomLeft:Fi(!a||r.bottom||r.left,l.bottomLeft,0,o),bottomRight:Fi(!a||r.bottom||r.right,l.bottomRight,0,o)}}function W2(n){const e=O_(n),t=e.right-e.left,i=e.bottom-e.top,s=B2(n,t/2,i/2),l=U2(n,t/2,i/2);return{outer:{x:e.left,y:e.top,w:t,h:i,radius:l},inner:{x:e.left+s.l,y:e.top+s.t,w:t-s.l-s.r,h:i-s.t-s.b,radius:{topLeft:Math.max(0,l.topLeft-Math.max(s.t,s.l)),topRight:Math.max(0,l.topRight-Math.max(s.t,s.r)),bottomLeft:Math.max(0,l.bottomLeft-Math.max(s.b,s.l)),bottomRight:Math.max(0,l.bottomRight-Math.max(s.b,s.r))}}}}function vr(n,e,t,i){const s=e===null,l=t===null,r=n&&!(s&&l)&&O_(n,i);return r&&(s||cl(e,r.left,r.right))&&(l||cl(t,r.top,r.bottom))}function Y2(n){return n.topLeft||n.topRight||n.bottomLeft||n.bottomRight}function K2(n,e){n.rect(e.x,e.y,e.w,e.h)}function yr(n,e,t={}){const i=n.x!==t.x?-e:0,s=n.y!==t.y?-e:0,l=(n.x+n.w!==t.x+t.w?e:0)-i,o=(n.y+n.h!==t.y+t.h?e:0)-s;return{x:n.x+i,y:n.y+s,w:n.w+l,h:n.h+o,radius:n.radius}}class Ba extends Ci{constructor(e){super(),this.options=void 0,this.horizontal=void 0,this.base=void 0,this.width=void 0,this.height=void 0,this.inflateAmount=void 0,e&&Object.assign(this,e)}draw(e){const{inflateAmount:t,options:{borderColor:i,backgroundColor:s}}=this,{inner:l,outer:o}=W2(this),r=Y2(o.radius)?Mo:K2;e.save(),(o.w!==l.w||o.h!==l.h)&&(e.beginPath(),r(e,yr(o,t,l)),e.clip(),r(e,yr(l,-t,o)),e.fillStyle=i,e.fill("evenodd")),e.beginPath(),r(e,yr(l,t)),e.fillStyle=s,e.fill(),e.restore()}inRange(e,t,i){return vr(this,e,t,i)}inXRange(e,t){return vr(this,e,null,t)}inYRange(e,t){return vr(this,null,e,t)}getCenterPoint(e){const{x:t,y:i,base:s,horizontal:l}=this.getProps(["x","y","base","horizontal"],e);return{x:l?(t+s)/2:t,y:l?i:(i+s)/2}}getRange(e){return e==="x"?this.width/2:this.height/2}}Ba.id="bar";Ba.defaults={borderSkipped:"start",borderWidth:0,borderRadius:0,inflateAmount:"auto",pointStyle:void 0};Ba.defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};function J2(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=Ua(a,u,s);const f=ea(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=u_(e,f);for(const d of c){const h=ea(t,l[d.start],l[d.end],d.loop),g=a_(r,s,h);for(const v of g)o.push({source:v,target:d,start:{[t]:Vf(f,h,"start",Math.max)},end:{[t]:Vf(f,h,"end",Math.min)}})}}return o}function ea(n,e,t,i){if(i)return;let s=e[n],l=t[n];return n==="angle"&&(s=Pn(s),l=Pn(l)),{property:n,start:s,end:l}}function Z2(n,e){const{x:t=null,y:i=null}=n||{},s=e.points,l=[];return e.segments.forEach(({start:o,end:r})=>{r=Ua(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 Ua(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function Vf(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 It(n)?(i=!0,t=n):t=Z2(n,e),t.length?new zi({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function zf(n){return n&&n.fill!==!1}function G2(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(!Wt(s))return s;if(o=n[s],!o)return!1;if(o.visible)return s;l.push(s),s=o.fill}return!1}function X2(n,e,t){const i=tw(n);if(pt(i))return isNaN(i.value)?!1:i;let s=parseFloat(i);return Wt(s)&&Math.floor(s)===s?Q2(i[0],e,s,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Q2(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function x2(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 ew(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 tw(n){const e=n.options,t=e.fill;let i=_t(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function nw(n){const{scale:e,index:t,line:i}=n,s=[],l=i.segments,o=i.points,r=iw(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++)sw(s,o[f],r)}return new zi({points:s,options:{}})}function iw(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 sw(n,e,t){const i=[];for(let s=0;s<t.length;s++){const l=t[s],{first:o,last:r,point:a}=lw(l,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function lw(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(cl(s,c,d)){r=s===c,a=s===d;break}}return{first:r,last:a,point:i}}class A_{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 ow(n){const{chart:e,fill:t,line:i}=n;if(Wt(t))return rw(e,t);if(t==="stack")return nw(n);if(t==="shape")return!0;const s=aw(n);return s instanceof A_?s:E_(s,i)}function rw(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function aw(n){return(n.scale||{}).getPointPositionForValue?fw(n):uw(n)}function uw(n){const{scale:e={},fill:t}=n,i=x2(t,e);if(Wt(i)){const s=e.isHorizontal();return{x:s?i:null,y:s?null:i}}return null}function fw(n){const{scale:e,fill:t}=n,i=e.options,s=e.getLabels().length,l=i.reverse?e.max:e.min,o=ew(t,e,l),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,l);return new A_({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<s;++a)r.push(e.getPointPositionForValue(a,o));return r}function kr(n,e,t){const i=ow(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&&(Ea(n,t),cw(n,{line:s,target:i,above:f,below:c,area:t,scale:l,axis:o}),Aa(n))}function cw(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&&(Bf(n,i,o.top),Uf(n,{line:t,target:i,color:s,scale:r,property:a}),n.restore(),n.save(),Bf(n,i,o.bottom)),Uf(n,{line:t,target:i,color:l,scale:r,property:a}),n.restore()}function Bf(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[Ua(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 Uf(n,e){const{line:t,target:i,property:s,color:l,scale:o}=e,r=J2(t,i,s);for(const{source:a,target:u,start:f,end:c}of r){const{style:{backgroundColor:d=l}={}}=a,h=i!==!0;n.save(),n.fillStyle=d,dw(n,o,h&&ea(s,f,c)),n.beginPath();const g=!!t.pathSegment(n,a);let v;if(h){g?n.closePath():Wf(n,i,c,s);const b=!!i.pathSegment(n,u,{move:g,reverse:!0});v=g&&b,v||Wf(n,i,f,s)}n.closePath(),n.fill(v?"evenodd":"nonzero"),n.restore()}}function dw(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 Wf(n,e,t,i){const s=e.interpolate(t,i);s&&n.lineTo(s.x,s.y)}var pw={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 zi&&(a={visible:n.isDatasetVisible(o),index:o,fill:X2(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=G2(s,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",s=n.getSortedVisibleDatasetMetas(),l=n.chartArea;for(let o=s.length-1;o>=0;--o){const r=s[o].$filler;!r||(r.line.updateControlPoints(l,r.axis),i&&r.fill&&kr(n.ctx,r,l))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let s=i.length-1;s>=0;--s){const l=i[s].$filler;zf(l)&&kr(n.ctx,l,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!zf(i)||t.drawTime!=="beforeDatasetDraw"||kr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const sl={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=Wr(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 ri(n,e){return e&&(It(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function vi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
||
`)>-1?n.split(`
|
||
`):n}function hw(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 Yf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Ln(e.bodyFont),u=Ln(e.titleFont),f=Ln(e.footerFont),c=l.length,d=s.length,h=i.length,g=Yn(e.padding);let v=g.height,b=0,y=i.reduce(($,M)=>$+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 $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let C=0;const S=function($){b=Math.max(b,t.measureText($).width+C)};return t.save(),t.font=u.string,Et(n.title,S),t.font=a.string,Et(n.beforeBody.concat(n.afterBody),S),C=e.displayColors?o+2+e.boxPadding:0,Et(i,$=>{Et($.before,S),Et($.lines,S),Et($.after,S)}),C=0,t.font=f.string,Et(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function mw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function gw(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 _w(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"),gw(u,n,e,t)&&(u="center"),u}function Kf(n,e,t){const i=t.yAlign||e.yAlign||mw(n,t);return{xAlign:t.xAlign||e.xAlign||_w(n,e,t,i),yAlign:i}}function bw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function vw(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:h}=ys(o);let g=bw(e,r);const v=vw(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,h)+s),{x:un(g,0,i.width-e.width),y:un(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Zf(n){return ri([],vi(n))}function yw(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Gf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ta extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new f_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=yw(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=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(o)),r}getBeforeBody(e,t){return Zf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Et(e,l=>{const o={before:[],lines:[],after:[]},r=Gf(i,l);ri(o.before,vi(r.beforeLabel.call(this,l))),ri(o.lines,r.label.call(this,l)),ri(o.after,vi(r.afterLabel.call(this,l))),s.push(o)}),s}getAfterBody(e,t){return Zf(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=ri(r,vi(s)),r=ri(r,vi(l)),r=ri(r,vi(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(hw(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))),Et(r,f=>{const c=Gf(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=sl[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=Yf(this,i),u=Object.assign({},r,a),f=Kf(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}=ys(r),{x:d,y:h}=e,{width:g,height:v}=t;let b,y,C,S,$,M;return l==="center"?($=h+v/2,s==="left"?(b=d,y=b-o,S=$+o,M=$-o):(b=d+g,y=b+o,S=$-o,M=$+o),C=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"?(S=h,$=S-o,b=y-o,C=y+o):(S=h+v,$=S+o,b=y+o,C=y-o),M=S),{x1:b,x2:y,x3:C,y1:S,y2:$,y3:M}}drawTitle(e,t,i){const s=this.title,l=s.length;let o,r,a;if(l){const u=dr(i.rtl,this.x,this.width);for(e.x=Xl(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=Ln(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=Ln(l.bodyFont),d=Xl(this,"left",l),h=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(h,u)+u/2,C=v+a/2;e.strokeStyle=l.multiKeyBackground,e.fillStyle=l.multiKeyBackground,Jr(e,b,y,C),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,Jr(e,b,y,C)}else{e.lineWidth=pt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const b=s.leftForLtr(h,u-f),y=s.leftForLtr(s.xPlus(h,1),u-f-2),C=ys(o.borderRadius);Object.values(C).some(S=>S!==0)?(e.beginPath(),e.fillStyle=l.multiKeyBackground,Mo(e,{x:b,y:v,w:u,h:a,radius:C}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),Mo(e,{x:y,y:v+1,w:u-2,h:a-2,radius:C}),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=Ln(i.bodyFont);let d=c.lineHeight,h=0;const g=dr(i.rtl,this.x,this.width),v=function(O){t.fillText(O,g.x(e.x+h),e.y+d/2),e.y+=d+l},b=g.textAlign(o);let y,C,S,$,M,D,E;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xl(this,b,i),t.fillStyle=i.bodyColor,Et(this.beforeBody,v),h=r&&b!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,D=s.length;$<D;++$){for(y=s[$],C=this.labelTextColors[$],t.fillStyle=C,Et(y.before,v),S=y.lines,r&&S.length&&(this._drawColorBox(t,e,$,g,i),d=Math.max(c.lineHeight,a)),M=0,E=S.length;M<E;++M)v(S[M]),d=c.lineHeight;Et(y.after,v)}h=0,d=c.lineHeight,Et(this.afterBody,v),e.y-=l}drawFooter(e,t,i){const s=this.footer,l=s.length;let o,r;if(l){const a=dr(i.rtl,this.x,this.width);for(e.x=Xl(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=Ln(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:h,bottomRight:g}=ys(s.cornerRadius);t.fillStyle=s.backgroundColor,t.strokeStyle=s.borderColor,t.lineWidth=s.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,s),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&l==="right"&&this.drawCaret(e,t,i,s),t.lineTo(r+u,a+f-g),t.quadraticCurveTo(r+u,a+f,r+u-g,a+f),o==="bottom"&&this.drawCaret(e,t,i,s),t.lineTo(r+h,a+f),t.quadraticCurveTo(r,a+f,r,a+f-h),o==="center"&&l==="left"&&this.drawCaret(e,t,i,s),t.lineTo(r,a+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=sl[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=Yf(this,e),a=Object.assign({},o,this._size),u=Kf(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=Yn(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),jy(e,t.textDirection),l.y+=o.top,this.drawTitle(l,e,t),this.drawBody(l,e,t),this.drawFooter(l,e,t),qy(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=!yo(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||!yo(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=sl[l.position].call(this,e,t);return o!==!1&&(i!==o.x||s!==o.y)}}ta.positioners=sl;var kw={id:"tooltip",_element:ta,positioners:sl,afterInit(n,e,t){t&&(n.tooltip=new ta({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:_i,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:_i,beforeBody:_i,beforeLabel:_i,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 Mt(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:_i,afterBody:_i,beforeFooter:_i,footer:_i,afterFooter:_i}},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 ww=(n,e,t,i)=>(typeof e=="string"?(t=n.push(e)-1,i.unshift({index:t,label:e})):isNaN(e)&&(t=null),t);function $w(n,e,t,i){const s=n.indexOf(e);if(s===-1)return ww(n,e,t,i);const l=n.lastIndexOf(e);return s!==l?t:s}const Sw=(n,e)=>n===null?null:un(Math.round(n),0,e);class na extends us{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(Mt(e))return null;const i=this.getLabels();return t=isFinite(t)&&i[t]===e?t:$w(i,e,_t(t,e),this._addedLabels),Sw(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}}na.id="category";na.defaults={ticks:{callback:na.prototype.getLabelForValue}};function Cw(n,e){const t=[],{bounds:s,step:l,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,h=l||1,g=f-1,{min:v,max:b}=e,y=!Mt(o),C=!Mt(r),S=!Mt(u),$=(b-v)/(c+1);let M=Ju((b-v)/g/h)*h,D,E,O,L;if(M<1e-14&&!y&&!C)return[{value:v},{value:b}];L=Math.ceil(b/M)-Math.floor(v/M),L>g&&(M=Ju(L*M/g/h)*h),Mt(a)||(D=Math.pow(10,a),M=Math.ceil(M*D)/D),s==="ticks"?(E=Math.floor(v/M)*M,O=Math.ceil(b/M)*M):(E=v,O=b),y&&C&&l&&wv((r-o)/l,M/1e3)?(L=Math.round(Math.min((r-o)/M,f)),M=(r-o)/L,E=o,O=r):S?(E=y?o:E,O=C?r:O,L=u-1,M=(O-E)/L):(L=(O-E)/M,tl(L,Math.round(L),M/1e3)?L=Math.round(L):L=Math.ceil(L));const I=Math.max(Zu(M),Zu(E));D=Math.pow(10,Mt(a)?I:a),E=Math.round(E*D)/D,O=Math.round(O*D)/D;let N=0;for(y&&(d&&E!==o?(t.push({value:o}),E<o&&N++,tl(Math.round((E+N*M)*D)/D,o,Xf(o,$,n))&&N++):E<o&&N++);N<L;++N)t.push({value:Math.round((E+N*M)*D)/D});return C&&d&&O!==r?t.length&&tl(t[t.length-1].value,r,Xf(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!C||O===r)&&t.push({value:O}),t}function Xf(n,e,{horizontal:t,minRotation:i}){const s=Qn(i),l=(t?Math.sin(s):Math.cos(s))||.001,o=.75*e*(""+n).length;return Math.min(e/l,o)}class Ao extends us{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 Mt(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=fi(s),u=fi(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=Cw(s,l);return e.bounds==="ticks"&&qg(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 $l(e,this.chart.options.locale,this.options.ticks.format)}}class Wa extends Ao{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Wt(e)?e:0,this.max=Wt(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Qn(this.options.ticks.minRotation),s=(e?Math.sin(i):Math.cos(i))||.001,l=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,l.lineHeight/s))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Wa.id="linear";Wa.defaults={ticks:{callback:Ko.formatters.numeric}};function Qf(n){return n/Math.pow(10,Math.floor(zn(n)))===1}function Mw(n,e){const t=Math.floor(zn(e.max)),i=Math.ceil(e.max/Math.pow(10,t)),s=[];let l=Rn(n.min,Math.pow(10,Math.floor(zn(e.min)))),o=Math.floor(zn(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:Qf(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=Rn(n.max,l);return s.push({value:u,major:Qf(l)}),s}class P_ extends us{constructor(e){super(e),this.start=void 0,this.end=void 0,this._startValue=void 0,this._valueRange=0}parse(e,t){const i=Ao.prototype.parse.apply(this,[e,t]);if(i===0){this._zero=!0;return}return Wt(i)&&i>0?i:null}determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=Wt(e)?Math.max(0,e):null,this.max=Wt(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(zn(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=Mw(t,this);return e.bounds==="ticks"&&qg(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":$l(e,this.chart.options.locale,this.options.ticks.format)}configure(){const e=this.min;super.configure(),this._startValue=zn(e),this._valueRange=zn(this.max)-zn(e)}getPixelForValue(e){return(e===void 0||e===0)&&(e=this.min),e===null||isNaN(e)?NaN:this.getPixelForDecimal(e===this.min?0:(zn(e)-this._startValue)/this._valueRange)}getValueForPixel(e){const t=this.getDecimalForPixel(e);return Math.pow(10,this._startValue+t*this._valueRange)}}P_.id="logarithmic";P_.defaults={ticks:{callback:Ko.formatters.logarithmic,major:{enabled:!0}}};function ia(n){const e=n.ticks;if(e.display&&n.display){const t=Yn(e.backdropPadding);return _t(e.font&&e.font.size,vt.font.size)+t.height}return 0}function Tw(n,e,t){return t=It(t)?t:[t],{w:ey(n,e.string,t),h:t.length*e.lineHeight}}function xf(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 Dw(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?Ut/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=Ln(u.font),d=Tw(n.ctx,c,n._pointLabels[a]);i[a]=d;const h=Pn(n.getIndexAngle(a)+r),g=Math.round(Ca(h)),v=xf(g,f.x,d.w,0,180),b=xf(g,f.y,d.h,90,270);Ow(t,e,h,v,b)}n.setCenterPoint(e.l-t.l,t.r-e.r,e.t-t.t,t.b-e.b),n._pointLabelItems=Ew(n,i,s)}function Ow(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 Ew(n,e,t){const i=[],s=n._pointLabels.length,l=n.options,o=ia(l)/2,r=n.drawingArea,a=l.pointLabels.centerPointLabels?Ut/s:0;for(let u=0;u<s;u++){const f=n.getPointPosition(u,r+o+t[u],a),c=Math.round(Ca(Pn(f.angle+zt))),d=e[u],h=Lw(f.y,d.h,c),g=Aw(c),v=Pw(f.x,d.w,g);i.push({x:f.x,y:h,textAlign:g,left:v,top:h,right:v+d.w,bottom:h+d.h})}return i}function Aw(n){return n===0||n===180?"center":n<180?"left":"right"}function Pw(n,e,t){return t==="right"?n-=e:t==="center"&&(n-=e/2),n}function Lw(n,e,t){return t===90||t===270?n-=e/2:(t>270||t<90)&&(n-=e),n}function Iw(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=Ln(l.font),{x:r,y:a,textAlign:u,left:f,top:c,right:d,bottom:h}=n._pointLabelItems[s],{backdropColor:g}=l;if(!Mt(g)){const v=ys(l.borderRadius),b=Yn(l.backdropPadding);t.fillStyle=g;const y=f-b.left,C=c-b.top,S=d-f+b.width,$=h-c+b.height;Object.values(v).some(M=>M!==0)?(t.beginPath(),Mo(t,{x:y,y:C,w:S,h:$,radius:v}),t.fill()):t.fillRect(y,C,S,$)}Co(t,n._pointLabels[s],r,a+o.lineHeight/2,o,{color:l.color,textAlign:u,textBaseline:"middle"})}}function L_(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 Fw(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(),L_(n,t,l,i),s.closePath(),s.stroke(),s.restore())}function Nw(n,e,t){return Vi(n,{label:t,index:e,type:"pointLabel"})}class Zo extends Ao{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=Yn(ia(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=Wt(e)&&!isNaN(e)?e:0,this.max=Wt(t)&&!isNaN(t)?t:0,this.handleTickRangeOptions()}computeTickLimit(){return Math.ceil(this.drawingArea/ia(this.options))}generateTickLabels(e){Ao.prototype.generateTickLabels.call(this,e),this._pointLabels=this.getLabels().map((t,i)=>{const s=Vt(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?Dw(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 Pn(e*t+Qn(i))}getDistanceFromCenterForValue(e){if(Mt(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(Mt(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 Nw(this.getContext(),e,i)}}getPointPosition(e,t,i=0){const s=this.getIndexAngle(e)-zt+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(),L_(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&&Iw(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));Fw(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=Ln(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=Yn(u.backdropPadding);e.fillRect(-o/2-c.left,-l-f.size/2-c.top,o+c.width,f.size+c.height)}Co(e,r.label,0,-l,f,{color:u.color})}),e.restore()}drawTitle(){}}Zo.id="radialLinear";Zo.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Ko.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback(n){return n},padding:5,centerPointLabels:!1}};Zo.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"};Zo.descriptors={angleLines:{_fallback:"grid"}};const Go={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},yn=Object.keys(Go);function Rw(n,e){return n-e}function ec(n,e){if(Mt(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)),Wt(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(s&&(o=s==="week"&&(Cs(l)||l===!0)?t.startOf(o,"isoWeek",l):t.startOf(o,s)),+o)}function tc(n,e,t,i){const s=yn.length;for(let l=yn.indexOf(n);l<s-1;++l){const o=Go[yn[l]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return yn[l]}return yn[s-1]}function Hw(n,e,t,i,s){for(let l=yn.length-1;l>=yn.indexOf(t);l--){const o=yn[l];if(Go[o].common&&n._adapter.diff(s,i,o)>=e-1)return o}return yn[t?yn.indexOf(t):0]}function jw(n){for(let e=yn.indexOf(n)+1,t=yn.length;e<t;++e)if(Go[yn[e]].common)return yn[e]}function nc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:s}=Ma(t,e),l=t[i]>=e?t[i]:t[s];n[l]=!0}}function qw(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 ic(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:qw(n,i,s,t)}class Ml extends us{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 m_._date(e.adapters.date);s.init(t),el(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:ec(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=Wt(s)&&!isNaN(s)?s:+t.startOf(Date.now(),i),l=Wt(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=Mv(s,l,o);return this._unit=t.unit||(i.autoSkip?tc(t.minUnit,this.min,this.max,this._getLabelCapacity(l)):Hw(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:jw(this._unit),this.initOffsets(s),e.reverse&&r.reverse(),ic(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=un(t,0,o),i=un(i,0,o),this._offsets={start:t,end:i,factor:1/(t+1+i)}}_generate(){const e=this._adapter,t=this.min,i=this.max,s=this.options,l=s.time,o=l.unit||tc(l.minUnit,t,i,this._getLabelCapacity(t)),r=_t(l.stepSize,1),a=o==="week"?l.isoWeekday:!1,u=Cs(a)||a===!0,f={};let c=t,d,h;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,h=0;d<i;d=+e.add(d,r,o),h++)nc(f,d,g);return(d===i||s.bounds==="ticks"||h===1)&&nc(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,h=this._adapter.format(e,s||(d?f:u)),g=l.ticks.callback;return g?Vt(g,[h,t,i],this):h}generateTickLabels(e){let t,i,s;for(t=0,i=e.length;t<i;++t)s=e[t],s.label=this._tickFormatFunction(s.value,t,e)}getDecimalForValue(e){return e===null?NaN:(e-this.min)/(this.max-this.min)}getPixelForValue(e){const t=this._offsets,i=this.getDecimalForValue(e);return this.getPixelForDecimal((t.start+i)*t.factor)}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return this.min+i*(this.max-this.min)}_getLabelSize(e){const t=this.options.ticks,i=this.ctx.measureText(e).width,s=Qn(this.isHorizontal()?t.maxRotation:t.minRotation),l=Math.cos(s),o=Math.sin(s),r=this._resolveTickFontOptions(0).size;return{w:i*l+r*o,h:i*o+r*l}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,s=i[t.unit]||i.millisecond,l=this._tickFormatFunction(e,0,ic(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(ec(this,s[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return Bg(e.sort(Rw))}}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 Ql(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}=es(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}=es(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 I_ 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=Ql(t,this.min),this._tableRange=Ql(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(Ql(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Ql(this._table,i*this._tableRange+this._minPos,!0)}}I_.id="timeseries";I_.defaults=Ml.defaults;/*!
|
||
* chartjs-adapter-luxon v1.2.0
|
||
* https://www.chartjs.org
|
||
* (c) 2022 chartjs-adapter-luxon Contributors
|
||
* Released under the MIT license
|
||
*/const Vw={datetime:Qe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Qe.TIME_WITH_SECONDS,minute:Qe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};m_._date.override({_id:"luxon",_create:function(n){return Qe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return Vw},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Qe.fromFormat(n,e,t):n=Qe.fromISO(n,t):n instanceof Date?n=Qe.fromJSDate(n,t):i==="object"&&!(n instanceof Qe)&&(n=Qe.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function sc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Tt(()=>{t||(t=it(e,Tn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=it(e,Tn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function zw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=T(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Bw(n){let e;return{c(){e=F("Loading...")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Uw(n){let e,t,i,s,l,o=n[2]&&sc();function r(f,c){return f[2]?Bw:zw}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Qa(i,"height","250px"),Qa(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ie(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),m(e,t),m(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=sc(),o.c(),A(o,1),o.m(e,t)):o&&(Pe(),P(o,1,1,()=>{o=null}),Le()),c&4&&ie(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){P(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Ww(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),we.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)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(h=>{h!=null&&h.isAbort||(c(),console.warn(h),we.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Jn(()=>(Eo.register(zi,Jo,Yo,Wa,Ml,pw,kw),t(6,o=new Eo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){pe[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[l,a,u,i,s,f,o,r,d]}class Yw extends Ee{constructor(e){super(),Oe(this,e,Ww,Uw,De,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var lc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},F_={exports:{}};(function(n){var e=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
||
* Prism: Lightweight, robust, elegant syntax highlighting
|
||
*
|
||
* @license MIT <https://opensource.org/licenses/MIT>
|
||
* @author Lea Verou <https://lea.verou.me>
|
||
* @namespace
|
||
* @public
|
||
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function C(S){return S instanceof a?new a(S.type,C(S.content),S.alias):Array.isArray(S)?S.map(C):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(C){return Object.prototype.toString.call(C).slice(8,-1)},objId:function(C){return C.__id||Object.defineProperty(C,"__id",{value:++l}),C.__id},clone:function C(S,$){$=$||{};var M,D;switch(r.util.type(S)){case"Object":if(D=r.util.objId(S),$[D])return $[D];M={},$[D]=M;for(var E in S)S.hasOwnProperty(E)&&(M[E]=C(S[E],$));return M;case"Array":return D=r.util.objId(S),$[D]?$[D]:(M=[],$[D]=M,S.forEach(function(O,L){M[L]=C(O,$)}),M);default:return S}},getLanguage:function(C){for(;C;){var S=s.exec(C.className);if(S)return S[1].toLowerCase();C=C.parentElement}return"none"},setLanguage:function(C,S){C.className=C.className.replace(RegExp(s,"gi"),""),C.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var C=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(C){var S=document.getElementsByTagName("script");for(var $ in S)if(S[$].src==C)return S[$]}return null}},isActive:function(C,S,$){for(var M="no-"+S;C;){var D=C.classList;if(D.contains(S))return!0;if(D.contains(M))return!1;C=C.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(C,S){var $=r.util.clone(r.languages[C]);for(var M in S)$[M]=S[M];return $},insertBefore:function(C,S,$,M){M=M||r.languages;var D=M[C],E={};for(var O in D)if(D.hasOwnProperty(O)){if(O==S)for(var L in $)$.hasOwnProperty(L)&&(E[L]=$[L]);$.hasOwnProperty(O)||(E[O]=D[O])}var I=M[C];return M[C]=E,r.languages.DFS(r.languages,function(N,B){B===I&&N!=C&&(this[N]=E)}),E},DFS:function C(S,$,M,D){D=D||{};var E=r.util.objId;for(var O in S)if(S.hasOwnProperty(O)){$.call(S,O,S[O],M||O);var L=S[O],I=r.util.type(L);I==="Object"&&!D[E(L)]?(D[E(L)]=!0,C(L,$,null,D)):I==="Array"&&!D[E(L)]&&(D[E(L)]=!0,C(L,$,O,D))}}},plugins:{},highlightAll:function(C,S){r.highlightAllUnder(document,C,S)},highlightAllUnder:function(C,S,$){var M={callback:$,container:C,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,E;E=M.elements[D++];)r.highlightElement(E,S===!0,M.callback)},highlightElement:function(C,S,$){var M=r.util.getLanguage(C),D=r.languages[M];r.util.setLanguage(C,M);var E=C.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var O=C.textContent,L={element:C,language:M,grammar:D,code:O};function I(B){L.highlightedCode=B,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.call(L.element)}if(r.hooks.run("before-sanity-check",L),E=L.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),$&&$.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){I(r.util.encode(L.code));return}if(S&&i.Worker){var N=new Worker(r.filename);N.onmessage=function(B){I(B.data)},N.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else I(r.highlight(L.code,L.grammar,L.language))},highlight:function(C,S,$){var M={code:C,grammar:S,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(C,S){var $=S.rest;if($){for(var M in $)S[M]=$[M];delete S.rest}var D=new c;return d(D,D.head,C),f(C,D,S,D.head,0),g(D)},hooks:{all:{},add:function(C,S){var $=r.hooks.all;$[C]=$[C]||[],$[C].push(S)},run:function(C,S){var $=r.hooks.all[C];if(!(!$||!$.length))for(var M=0,D;D=$[M++];)D(S)}},Token:a};i.Prism=r;function a(C,S,$,M){this.type=C,this.content=S,this.alias=$,this.length=(M||"").length|0}a.stringify=function C(S,$){if(typeof S=="string")return S;if(Array.isArray(S)){var M="";return S.forEach(function(I){M+=C(I,$)}),M}var D={type:S.type,content:C(S.content,$),tag:"span",classes:["token",S.type],attributes:{},language:$},E=S.alias;E&&(Array.isArray(E)?Array.prototype.push.apply(D.classes,E):D.classes.push(E)),r.hooks.run("wrap",D);var O="";for(var L in D.attributes)O+=" "+L+'="'+(D.attributes[L]||"").replace(/"/g,""")+'"';return"<"+D.tag+' class="'+D.classes.join(" ")+'"'+O+">"+D.content+"</"+D.tag+">"};function u(C,S,$,M){C.lastIndex=S;var D=C.exec($);if(D&&M&&D[1]){var E=D[1].length;D.index+=E,D[0]=D[0].slice(E)}return D}function f(C,S,$,M,D,E){for(var O in $)if(!(!$.hasOwnProperty(O)||!$[O])){var L=$[O];L=Array.isArray(L)?L:[L];for(var I=0;I<L.length;++I){if(E&&E.cause==O+","+I)return;var N=L[I],B=N.inside,U=!!N.lookbehind,ee=!!N.greedy,K=N.alias;if(ee&&!N.pattern.global){var se=N.pattern.toString().match(/[imsuy]*$/)[0];N.pattern=RegExp(N.pattern.source,se+"g")}for(var Y=N.pattern||N,te=M.next,J=D;te!==S.tail&&!(E&&J>=E.reach);J+=te.value.length,te=te.next){var _e=te.value;if(S.length>C.length)return;if(!(_e instanceof a)){var be=1,X;if(ee){if(X=u(Y,J,C,U),!X||X.index>=C.length)break;var me=X.index,ae=X.index+X[0].length,ve=J;for(ve+=te.value.length;me>=ve;)te=te.next,ve+=te.value.length;if(ve-=te.value.length,J=ve,te.value instanceof a)continue;for(var H=te;H!==S.tail&&(ve<ae||typeof H.value=="string");H=H.next)be++,ve+=H.value.length;be--,_e=C.slice(J,ve),X.index-=J}else if(X=u(Y,0,_e,U),!X)continue;var me=X.index,x=X[0],Q=_e.slice(0,me),Se=_e.slice(me+x.length),je=J+_e.length;E&&je>E.reach&&(E.reach=je);var Ue=te.prev;Q&&(Ue=d(S,Ue,Q),J+=Q.length),h(S,Ue,be);var Z=new a(O,B?r.tokenize(x,B):x,K,x);if(te=d(S,Ue,Z),Se&&d(S,te,Se),be>1){var ge={cause:O+","+I,reach:je};f(C,S,$,te.prev,J,ge),E&&ge.reach>E.reach&&(E.reach=ge.reach)}}}}}}function c(){var C={value:null,prev:null,next:null},S={value:null,prev:C,next:null};C.next=S,this.head=C,this.tail=S,this.length=0}function d(C,S,$){var M=S.next,D={value:$,prev:S,next:M};return S.next=D,M.prev=D,C.length++,D}function h(C,S,$){for(var M=S.next,D=0;D<$&&M!==C.tail;D++)M=M.next;S.next=M,M.prev=S,C.length-=D}function g(C){for(var S=[],$=C.head.next;$!==C.tail;)S.push($.value),$=$.next;return S}if(!i.document)return i.addEventListener&&(r.disableWorkerMessageHandler||i.addEventListener("message",function(C){var S=JSON.parse(C.data),$=S.language,M=S.code,D=S.immediateClose;i.postMessage(r.highlight(M,r.languages[$],$)),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 lc<"u"&&(lc.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(/&/,"&"))}),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 C=new XMLHttpRequest;C.open("GET",v,!0),C.onreadystatechange=function(){C.readyState==4&&(C.status<400&&C.responseText?b(C.responseText):C.status>=400?y(s(C.status,C.statusText)):y(l))},C.send(null)}function h(v){var b=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(v||"");if(b){var y=Number(b[1]),C=b[2],S=b[3];return C?S?[y,Number(S)]:[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 C=b.getAttribute("data-src"),S=v.language;if(S==="none"){var $=(/\.(\w+)$/.exec(C)||[,"none"])[1];S=o[$]||$}t.util.setLanguage(y,S),t.util.setLanguage(b,S);var M=t.plugins.autoloader;M&&M.loadLanguages(S),d(C,function(D){b.setAttribute(r,u);var E=h(b.getAttribute("data-range"));if(E){var O=D.split(/\r\n?|\n/g),L=E[0],I=E[1]==null?O.length:E[1];L<0&&(L+=O.length),L=Math.max(0,Math.min(L-1,O.length)),I<0&&(I+=O.length),I=Math.max(0,Math.min(I,O.length)),D=O.slice(L,I).join(`
|
||
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+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),C=0,S;S=y[C++];)t.highlightElement(S)}};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)}}()})(F_);const Ws=F_.exports;var Kw={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 h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,r.removeChild(h),--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}}}})})()})(Kw);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function Jw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),m(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-1ua9m3i")&&p(e,"class",i)},i:oe,o:oe,d(s){s&&k(e)}}}function Zw(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Ws.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ws.highlight(a,Ws.languages[l]||Ws.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Ws<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _n extends Ee{constructor(e){super(),Oe(this,e,Zw,Jw,De,{class:0,content:2,language:3})}}const Gw=n=>({}),oc=n=>({}),Xw=n=>({}),rc=n=>({});function ac(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S=n[4]&&!n[2]&&uc(n);const $=n[18].header,M=wn($,n,n[17],rc);let D=n[4]&&n[2]&&fc(n);const E=n[18].default,O=wn(E,n,n[17],null),L=n[18].footer,I=wn(L,n,n[17],oc);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),S&&S.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),O&&O.c(),c=T(),d=_("div"),I&&I.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),ie(l,"popup",n[2]),p(e,"class","overlay-panel-container"),ie(e,"padded",n[2]),ie(e,"active",n[0])},m(N,B){w(N,e,B),m(e,t),m(e,s),m(e,l),m(l,o),S&&S.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),I&&I.m(d,null),b=!0,y||(C=[G(t,"click",Yt(n[19])),G(f,"scroll",n[21])],y=!0)},p(N,B){n=N,n[4]&&!n[2]?S?S.p(n,B):(S=uc(n),S.c(),S.m(o,r)):S&&(S.d(1),S=null),M&&M.p&&(!b||B&131072)&&Sn(M,$,n,n[17],b?$n($,n[17],B,Xw):Cn(n[17]),rc),n[4]&&n[2]?D?D.p(n,B):(D=fc(n),D.c(),D.m(o,null)):D&&(D.d(1),D=null),O&&O.p&&(!b||B&131072)&&Sn(O,E,n,n[17],b?$n(E,n[17],B,null):Cn(n[17]),null),I&&I.p&&(!b||B&131072)&&Sn(I,L,n,n[17],b?$n(L,n[17],B,Gw):Cn(n[17]),oc),(!b||B&258&&h!==(h="overlay-panel "+n[1]+" "+n[8]))&&p(l,"class",h),B&262&&ie(l,"popup",n[2]),B&4&&ie(e,"padded",n[2]),B&1&&ie(e,"active",n[0])},i(N){b||(Tt(()=>{i||(i=it(t,vo,{duration:_s,opacity:0},!0)),i.run(1)}),A(M,N),A(O,N),A(I,N),Tt(()=>{v&&v.end(1),g=Cm(l,Un,n[2]?{duration:_s,y:-10}:{duration:_s,x:50}),g.start()}),b=!0)},o(N){i||(i=it(t,vo,{duration:_s,opacity:0},!1)),i.run(0),P(M,N),P(O,N),P(I,N),g&&g.invalidate(),v=Mm(l,Un,n[2]?{duration:_s,y:10}:{duration:_s,x:50}),b=!1},d(N){N&&k(e),N&&i&&i.end(),S&&S.d(),M&&M.d(N),D&&D.d(),O&&O.d(N),n[20](null),I&&I.d(N),N&&v&&v.end(),y=!1,Ge(C)}}}function uc(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function fc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line txt-lg"></i>',p(e,"type","button"),p(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",Yt(n[5])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Qw(n){let e,t,i,s,l=n[0]&&ac(n);return{c(){e=_("div"),l&&l.c(),p(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=ac(o),l.c(),A(l,1),l.m(e,null)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},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,Ge(s)}}}let Zi;function N_(){return Zi=Zi||document.querySelector(".overlays"),Zi||(Zi=document.createElement("div"),Zi.classList.add("overlays"),document.body.appendChild(Zi)),Zi}let _s=150;function cc(){return 1e3+N_().querySelectorAll(".overlay-panel-container.active").length}function xw(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 h=on();let g,v,b,y,C="";function S(){typeof c=="function"&&c()===!1||t(0,o=!0)}function $(){typeof d=="function"&&d()===!1||t(0,o=!1)}function M(){return o}async function D(K){K?(b=document.activeElement,g==null||g.focus(),h("show")):(clearTimeout(y),b==null||b.focus(),h("hide")),await ii(),E()}function E(){!g||(o?t(6,g.style.zIndex=cc(),g):t(6,g.style="",g))}function O(K){o&&f&&K.code=="Escape"&&!W.isInput(K.target)&&g&&g.style.zIndex==cc()&&(K.preventDefault(),$())}function L(K){o&&I(v)}function I(K,se){se&&t(8,C=""),K&&(y||(y=setTimeout(()=>{if(clearTimeout(y),y=null,!K)return;if(K.scrollHeight-K.offsetHeight>0)t(8,C="scrollable");else{t(8,C="");return}K.scrollTop==0?t(8,C+=" scroll-top-reached"):K.scrollTop+K.offsetHeight==K.scrollHeight&&t(8,C+=" scroll-bottom-reached")},100)))}Jn(()=>(N_().appendChild(g),()=>{var K;clearTimeout(y),(K=g==null?void 0:g.classList)==null||K.add("hidden")}));const N=()=>a?$():!0;function B(K){pe[K?"unshift":"push"](()=>{v=K,t(7,v)})}const U=K=>I(K.target);function ee(K){pe[K?"unshift":"push"](()=>{g=K,t(6,g)})}return n.$$set=K=>{"class"in K&&t(1,l=K.class),"active"in K&&t(0,o=K.active),"popup"in K&&t(2,r=K.popup),"overlayClose"in K&&t(3,a=K.overlayClose),"btnClose"in K&&t(4,u=K.btnClose),"escClose"in K&&t(12,f=K.escClose),"beforeOpen"in K&&t(13,c=K.beforeOpen),"beforeHide"in K&&t(14,d=K.beforeHide),"$$scope"in K&&t(17,s=K.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&D(o),n.$$.dirty&128&&I(v,!0),n.$$.dirty&64&&g&&E()},[o,l,r,a,u,$,g,v,C,O,L,I,f,c,d,S,M,s,i,N,B,U,ee]}class mi extends Ee{constructor(e){super(),Oe(this,e,xw,Qw,De,{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 e$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function t$(n){let e,t=n[2].referer+"",i,s;return{c(){e=_("a"),i=F(t),p(e,"href",s=n[2].referer),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(l,o){w(l,e,o),m(e,i)},p(l,o){o&4&&t!==(t=l[2].referer+"")&&ue(i,t),o&4&&s!==(s=l[2].referer)&&p(e,"href",s)},d(l){l&&k(e)}}}function n$(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function i$(n){let e,t;return e=new _n({props:{content:JSON.stringify(n[2].meta,null,2)}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function s$(n){var le;let e,t,i,s,l,o,r=n[2].id+"",a,u,f,c,d,h,g,v=n[2].status+"",b,y,C,S,$,M,D=((le=n[2].method)==null?void 0:le.toUpperCase())+"",E,O,L,I,N,B,U=n[2].auth+"",ee,K,se,Y,te,J,_e=n[2].url+"",be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z=n[2].remoteIp+"",ge,ce,$e,Ze,et,We,tt=n[2].userIp+"",Me,ze,Xe,nt,ut,ye,Ne=n[2].userAgent+"",ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je,Ce,Be,ot,rt,Ht,Ct,ft;function xt(de,ke){return de[2].referer?t$:e$}let R=xt(n),z=R(n);const ne=[i$,n$],re=[];function Ae(de,ke){return ke&4&&(Nt=null),Nt==null&&(Nt=!W.isEmpty(de[2].meta)),Nt?0:1}return Ot=Ae(n,-1),Je=re[Ot]=ne[Ot](n),Ct=new $i({props:{date:n[2].created}}),{c(){e=_("table"),t=_("tbody"),i=_("tr"),s=_("td"),s.textContent="ID",l=T(),o=_("td"),a=F(r),u=T(),f=_("tr"),c=_("td"),c.textContent="Status",d=T(),h=_("td"),g=_("span"),b=F(v),y=T(),C=_("tr"),S=_("td"),S.textContent="Method",$=T(),M=_("td"),E=F(D),O=T(),L=_("tr"),I=_("td"),I.textContent="Auth",N=T(),B=_("td"),ee=F(U),K=T(),se=_("tr"),Y=_("td"),Y.textContent="URL",te=T(),J=_("td"),be=F(_e),X=T(),ae=_("tr"),ve=_("td"),ve.textContent="Referer",H=T(),me=_("td"),z.c(),x=T(),Q=_("tr"),Se=_("td"),Se.textContent="Remote IP",je=T(),Ue=_("td"),ge=F(Z),ce=T(),$e=_("tr"),Ze=_("td"),Ze.textContent="User IP",et=T(),We=_("td"),Me=F(tt),ze=T(),Xe=_("tr"),nt=_("td"),nt.textContent="UserAgent",ut=T(),ye=_("td"),ct=F(Ne),Dt=T(),dt=_("tr"),lt=_("td"),lt.textContent="Meta",Lt=T(),mt=_("td"),Je.c(),Ce=T(),Be=_("tr"),ot=_("td"),ot.textContent="Created",rt=T(),Ht=_("td"),V(Ct.$$.fragment),p(s,"class","min-width txt-hint txt-bold"),p(c,"class","min-width txt-hint txt-bold"),p(g,"class","label"),ie(g,"label-danger",n[2].status>=400),p(S,"class","min-width txt-hint txt-bold"),p(I,"class","min-width txt-hint txt-bold"),p(Y,"class","min-width txt-hint txt-bold"),p(ve,"class","min-width txt-hint txt-bold"),p(Se,"class","min-width txt-hint txt-bold"),p(Ze,"class","min-width txt-hint txt-bold"),p(nt,"class","min-width txt-hint txt-bold"),p(lt,"class","min-width txt-hint txt-bold"),p(ot,"class","min-width txt-hint txt-bold"),p(e,"class","table-compact table-border")},m(de,ke){w(de,e,ke),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,h),m(h,g),m(g,b),m(t,y),m(t,C),m(C,S),m(C,$),m(C,M),m(M,E),m(t,O),m(t,L),m(L,I),m(L,N),m(L,B),m(B,ee),m(t,K),m(t,se),m(se,Y),m(se,te),m(se,J),m(J,be),m(t,X),m(t,ae),m(ae,ve),m(ae,H),m(ae,me),z.m(me,null),m(t,x),m(t,Q),m(Q,Se),m(Q,je),m(Q,Ue),m(Ue,ge),m(t,ce),m(t,$e),m($e,Ze),m($e,et),m($e,We),m(We,Me),m(t,ze),m(t,Xe),m(Xe,nt),m(Xe,ut),m(Xe,ye),m(ye,ct),m(t,Dt),m(t,dt),m(dt,lt),m(dt,Lt),m(dt,mt),re[Ot].m(mt,null),m(t,Ce),m(t,Be),m(Be,ot),m(Be,rt),m(Be,Ht),j(Ct,Ht,null),ft=!0},p(de,ke){var Ie;(!ft||ke&4)&&r!==(r=de[2].id+"")&&ue(a,r),(!ft||ke&4)&&v!==(v=de[2].status+"")&&ue(b,v),ke&4&&ie(g,"label-danger",de[2].status>=400),(!ft||ke&4)&&D!==(D=((Ie=de[2].method)==null?void 0:Ie.toUpperCase())+"")&&ue(E,D),(!ft||ke&4)&&U!==(U=de[2].auth+"")&&ue(ee,U),(!ft||ke&4)&&_e!==(_e=de[2].url+"")&&ue(be,_e),R===(R=xt(de))&&z?z.p(de,ke):(z.d(1),z=R(de),z&&(z.c(),z.m(me,null))),(!ft||ke&4)&&Z!==(Z=de[2].remoteIp+"")&&ue(ge,Z),(!ft||ke&4)&&tt!==(tt=de[2].userIp+"")&&ue(Me,tt),(!ft||ke&4)&&Ne!==(Ne=de[2].userAgent+"")&&ue(ct,Ne);let fe=Ot;Ot=Ae(de,ke),Ot===fe?re[Ot].p(de,ke):(Pe(),P(re[fe],1,1,()=>{re[fe]=null}),Le(),Je=re[Ot],Je?Je.p(de,ke):(Je=re[Ot]=ne[Ot](de),Je.c()),A(Je,1),Je.m(mt,null));const he={};ke&4&&(he.date=de[2].created),Ct.$set(he)},i(de){ft||(A(Je),A(Ct.$$.fragment,de),ft=!0)},o(de){P(Je),P(Ct.$$.fragment,de),ft=!1},d(de){de&&k(e),z.d(),re[Ot].d(),q(Ct)}}}function l$(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 o$(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(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 r$(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[o$],header:[l$],default:[s$]},$$scope:{ctx:n}};return e=new mi({props:i}),n[5](e),e.$on("hide",n[6]),e.$on("show",n[7]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function a$(n,e,t){let i,s=new Lr;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){pe[c?"unshift":"push"](()=>{i=c,t(1,i)})}function u(c){st.call(this,n,c)}function f(c){st.call(this,n,c)}return[o,i,s,l,r,a,u,f]}class u$ extends Ee{constructor(e){super(),Oe(this,e,a$,r$,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function f$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[14]),p(s,"for",o=n[14])},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[8]),r=!0)},p(u,f){f&16384&&t!==(t=u[14])&&p(e,"id",t),f&1&&(e.checked=u[0]),f&16384&&o!==(o=u[14])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function dc(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 Yw({props:l}),pe.push(()=>Fe(e,"filter",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function pc(n){let e,t,i;function s(o){n[11](o)}let l={presets:n[4]};return n[2]!==void 0&&(l.filter=n[2]),e=new cv({props:l}),pe.push(()=>Fe(e,"filter",s)),e.$on("select",n[12]),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function c$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C=n[3],S,$=n[3],M,D;r=new Uo({}),r.$on("refresh",n[7]),d=new Re({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[f$,({uniqueId:L})=>({14:L}),({uniqueId:L})=>L?16384:0]},$$scope:{ctx:n}}}),g=new Bo({props:{value:n[2],placeholder:"Search logs, ex. status > 200",extraAutocompleteKeys:["method","url","remoteIp","userIp","referer","status","auth","userAgent"]}}),g.$on("submit",n[9]);let E=dc(n),O=pc(n);return{c(){e=_("div"),t=_("header"),i=_("nav"),s=_("div"),l=F(n[5]),o=T(),V(r.$$.fragment),a=T(),u=_("div"),f=T(),c=_("div"),V(d.$$.fragment),h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=T(),E.c(),S=T(),O.c(),M=Ke(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(u,"class","flex-fill"),p(c,"class","inline-flex"),p(t,"class","page-header"),p(b,"class","clearfix m-b-xs"),p(e,"class","page-header-wrapper m-b-0")},m(L,I){w(L,e,I),m(e,t),m(t,i),m(i,s),m(s,l),m(t,o),j(r,t,null),m(t,a),m(t,u),m(t,f),m(t,c),j(d,c,null),m(e,h),j(g,e,null),m(e,v),m(e,b),m(e,y),E.m(e,null),w(L,S,I),O.m(L,I),w(L,M,I),D=!0},p(L,I){(!D||I&32)&&ue(l,L[5]);const N={};I&49153&&(N.$$scope={dirty:I,ctx:L}),d.$set(N);const B={};I&4&&(B.value=L[2]),g.$set(B),I&8&&De(C,C=L[3])?(Pe(),P(E,1,1,oe),Le(),E=dc(L),E.c(),A(E,1),E.m(e,null)):E.p(L,I),I&8&&De($,$=L[3])?(Pe(),P(O,1,1,oe),Le(),O=pc(L),O.c(),A(O,1),O.m(M.parentNode,M)):O.p(L,I)},i(L){D||(A(r.$$.fragment,L),A(d.$$.fragment,L),A(g.$$.fragment,L),A(E),A(O),D=!0)},o(L){P(r.$$.fragment,L),P(d.$$.fragment,L),P(g.$$.fragment,L),P(E),P(O),D=!1},d(L){L&&k(e),q(r),q(d),q(g),E.d(L),L&&k(S),L&&k(M),O.d(L)}}}function d$(n){let e,t,i,s;e=new On({props:{$$slots:{default:[c$]},$$scope:{ctx:n}}});let l={};return i=new u$({props:l}),n[13](i),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(o,r){j(e,o,r),w(o,t,r),j(i,o,r),s=!0},p(o,[r]){const a={};r&32831&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){s||(A(e.$$.fragment,o),A(i.$$.fragment,o),s=!0)},o(o){P(e.$$.fragment,o),P(i.$$.fragment,o),s=!1},d(o){q(e,o),o&&k(t),n[13](null),q(i,o)}}}const hc="includeAdminLogs";function p$(n,e,t){var y;let i,s;bt(n,Ft,C=>t(5,s=C)),dn(Ft,s="Request logs",s);let l,o="",r=((y=window.localStorage)==null?void 0:y.getItem(hc))<<0,a=1;function u(){t(3,a++,a)}const f=()=>u();function c(){r=this.checked,t(0,r)}const d=C=>t(2,o=C.detail);function h(C){o=C,t(2,o)}function g(C){o=C,t(2,o)}const v=C=>l==null?void 0:l.show(C==null?void 0:C.detail);function b(C){pe[C?"unshift":"push"](()=>{l=C,t(1,l)})}return n.$$.update=()=>{n.$$.dirty&1&&t(4,i=r?"":'auth!="admin"'),n.$$.dirty&1&&typeof r<"u"&&window.localStorage&&window.localStorage.setItem(hc,r<<0)},[r,l,o,a,i,s,u,f,c,d,h,g,v,b]}class h$ extends Ee{constructor(e){super(),Oe(this,e,p$,d$,De,{})}}const Ds=li([]),ci=li({}),sa=li(!1);function m$(n){ci.update(e=>W.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Ds.update(e=>(W.pushOrReplaceByKey(e,n,"id"),e))}function g$(n){Ds.update(e=>(W.removeByKey(e,"id",n.id),ci.update(t=>t.id===n.id?e.find(i=>i.name!="profiles")||{}:t),e))}async function _$(n=null){return sa.set(!0),ci.set({}),Ds.set([]),we.collections.getFullList(200,{sort:"+created"}).then(e=>{Ds.set(e);const t=n&&W.findByKey(e,"id",n);if(t)ci.set(t);else if(e.length){const i=e.find(s=>s.name!="profiles");i&&ci.set(i)}}).catch(e=>{we.errorResponseHandler(e)}).finally(()=>{sa.set(!1)})}const Ya=li({});function pi(n,e,t){Ya.set({text:n,yesCallback:e,noCallback:t})}function R_(){Ya.set({})}function mc(n){let e,t,i,s;const l=n[13].default,o=wn(l,n,n[12],null);return{c(){e=_("div"),o&&o.c(),p(e,"class",n[1]),ie(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)&&Sn(o,l,r,r[12],s?$n(l,r[12],a,null):Cn(r[12]),null),(!s||a&2)&&p(e,"class",r[1]),a&3&&ie(e,"active",r[0])},i(r){s||(A(o,r),r&&Tt(()=>{i&&i.end(1),t=Cm(e,Un,{duration:150,y:-5}),t.start()}),s=!0)},o(r){P(o,r),t&&t.invalidate(),r&&(i=Mm(e,Un,{duration:150,y:2})),s=!1},d(r){r&&k(e),o&&o.d(r),r&&i&&i.end()}}}function b$(n){let e,t,i,s,l=n[0]&&mc(n);return{c(){e=_("div"),l&&l.c(),p(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=mc(o),l.c(),A(l,1),l.m(e,null)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},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,Ge(s)}}}function v$(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=on();function d(){t(0,o=!1)}function h(){t(0,o=!0)}function g(){o?d():h()}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 C(D){o&&!(f!=null&&f.contains(D.target))&&!(l!=null&&l.contains(D.target))&&d()}function S(D){o&&r&&D.code=="Escape"&&(D.preventDefault(),d())}function $(D){return C(D)}Jn(()=>(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){pe[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,E;n.$$.dirty&65&&(o?((D=l==null?void 0:l.classList)==null||D.add("active"),c("show")):((E=l==null?void 0:l.classList)==null||E.remove("active"),c("hide")))},[o,u,f,C,S,$,l,r,a,d,h,g,s,i,M]}class Mi extends Ee{constructor(e){super(),Oe(this,e,v$,b$,De,{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 y$=n=>({active:n&1}),gc=n=>({active:n[0]});function _c(n){let e,t,i;const s=n[12].default,l=wn(s,n,n[11],null);return{c(){e=_("div"),l&&l.c(),p(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)&&Sn(l,s,o,o[11],i?$n(s,o[11],r,null):Cn(o[11]),null)},i(o){i||(A(l,o),o&&Tt(()=>{t||(t=it(e,tn,{duration:150},!0)),t.run(1)}),i=!0)},o(o){P(l,o),o&&(t||(t=it(e,tn,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function k$(n){let e,t,i,s,l,o,r,a;const u=n[12].header,f=wn(u,n,n[11],gc);let c=n[0]&&_c(n);return{c(){e=_("div"),t=_("header"),f&&f.c(),i=T(),c&&c.c(),p(t,"class","accordion-header"),ie(t,"interactive",n[2]),p(e,"tabindex",s=n[2]?0:-1),p(e,"class",l="accordion "+n[1]),ie(e,"active",n[0])},m(d,h){w(d,e,h),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",Yt(n[13])),G(e,"keydown",vm(n[5]))],r=!0)},p(d,[h]){f&&f.p&&(!o||h&2049)&&Sn(f,u,d,d[11],o?$n(u,d[11],h,y$):Cn(d[11]),gc),h&4&&ie(t,"interactive",d[2]),d[0]?c?(c.p(d,h),h&1&&A(c,1)):(c=_c(d),c.c(),A(c,1),c.m(e,null)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le()),(!o||h&4&&s!==(s=d[2]?0:-1))&&p(e,"tabindex",s),(!o||h&2&&l!==(l="accordion "+d[1]))&&p(e,"class",l),h&3&&ie(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,Ge(a)}}}function w$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=on();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 h(){t(0,u=!1),clearTimeout(r),l("collapse")}function g(){l("toggle"),u?h():d()}function v(){if(c&&o.parentElement){const S=o.parentElement.querySelectorAll(".accordion.active .accordion-header.interactive");for(const $ of S)$.click()}}function b(S){!f||(S.code==="Enter"||S.code==="Space")&&(S.preventDefault(),g())}Jn(()=>()=>clearTimeout(r));const y=()=>f&&g();function C(S){pe[S?"unshift":"push"](()=>{o=S,t(4,o)})}return n.$$set=S=>{"class"in S&&t(1,a=S.class),"active"in S&&t(0,u=S.active),"interactive"in S&&t(2,f=S.interactive),"single"in S&&t(6,c=S.single),"$$scope"in S&&t(11,s=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,h,v,r,s,i,y,C]}class Xo extends Ee{constructor(e){super(),Oe(this,e,w$,k$,De,{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 $$=n=>({}),bc=n=>({});function vc(n,e,t){const i=n.slice();return i[45]=e[t],i}const S$=n=>({}),yc=n=>({});function kc(n,e,t){const i=n.slice();return i[45]=e[t],i}function wc(n){let e,t;return{c(){e=_("div"),t=F(n[2]),p(e,"class","txt-placeholder")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&4&&ue(t,i[2])},d(i){i&&k(e)}}}function C$(n){let e,t=n[45]+"",i;return{c(){e=_("span"),i=F(t),p(e,"class","txt")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l[0]&1&&t!==(t=s[45]+"")&&ue(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function M$(n){let e,t,i;const s=[{item:n[45]},n[8]];var l=n[7];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=at(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&V(e.$$.fragment),t=Ke()},m(r,a){e&&j(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&257?pn(s,[a[0]&1&&{item:r[45]},a[0]&256&&si(r[8])]):{};if(l!==(l=r[7])){if(e){Pe();const f=e;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(e=new l(o()),V(e.$$.fragment),A(e.$$.fragment,1),j(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&&q(e,r)}}}function $c(n){let e,t,i;function s(){return n[33](n[45])}return{c(){e=_("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Clear")),G(e,"click",ei(Yt(s)))],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function Sc(n){let e,t,i,s,l,o;const r=[M$,C$],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])&&$c(n);return{c(){e=_("div"),i.c(),s=T(),f&&f.c(),l=T(),p(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 h=t;t=u(c),t===h?a[t].p(c,d):(Pe(),P(a[h],1,1,()=>{a[h]=null}),Le(),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=$c(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 Cc(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left",trigger:n[17],$$slots:{default:[O$]},$$scope:{ctx:n}};return e=new Mi({props:i}),n[38](e),e.$on("show",n[23]),e.$on("hide",n[39]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&131072&&(o.trigger=s[17]),l[0]&806410|l[1]&1024&&(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[38](null),q(e,s)}}}function Mc(n){let e,t,i,s,l,o,r,a,u=n[14].length&&Tc(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(),p(i,"class","addon p-r-0"),l.autofocus=!0,p(l,"type","text"),p(l,"placeholder",n[3]),p(t,"class","input-group"),p(e,"class","form-field form-field-sm options-search")},m(f,c){w(f,e,c),m(e,t),m(t,i),m(t,s),m(t,l),Te(l,n[14]),m(t,o),u&&u.m(t,null),l.focus(),r||(a=G(l,"input",n[35]),r=!0)},p(f,c){c[0]&8&&p(l,"placeholder",f[3]),c[0]&16384&&l.value!==f[14]&&Te(l,f[14]),f[14].length?u?u.p(f,c):(u=Tc(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 Tc(n){let e,t,i,s;return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-secondary clear"),p(e,"class","addon suffix p-r-5")},m(l,o){w(l,e,o),m(e,t),i||(s=G(t,"click",ei(Yt(n[20]))),i=!0)},p:oe,d(l){l&&k(e),i=!1,s()}}}function Dc(n){let e,t=n[1]&&Oc(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1]?t?t.p(i,s):(t=Oc(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Oc(n){let e,t;return{c(){e=_("div"),t=F(n[1]),p(e,"class","txt-missing")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s[0]&2&&ue(t,i[1])},d(i){i&&k(e)}}}function T$(n){let e=n[45]+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s[0]&524288&&e!==(e=i[45]+"")&&ue(t,e)},i:oe,o:oe,d(i){i&&k(t)}}}function D$(n){let e,t,i;const s=[{item:n[45]},n[10]];var l=n[9];function o(r){let a={};for(let u=0;u<s.length;u+=1)a=at(a,s[u]);return{props:a}}return l&&(e=new l(o())),{c(){e&&V(e.$$.fragment),t=Ke()},m(r,a){e&&j(e,r,a),w(r,t,a),i=!0},p(r,a){const u=a[0]&525312?pn(s,[a[0]&524288&&{item:r[45]},a[0]&1024&&si(r[10])]):{};if(l!==(l=r[9])){if(e){Pe();const f=e;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(e=new l(o()),V(e.$$.fragment),A(e.$$.fragment,1),j(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&&q(e,r)}}}function Ec(n){let e,t,i,s,l,o,r;const a=[D$,T$],u=[];function f(h,g){return h[9]?0:1}t=f(n),i=u[t]=a[t](n);function c(...h){return n[36](n[45],...h)}function d(...h){return n[37](n[45],...h)}return{c(){e=_("div"),i.c(),s=T(),p(e,"tabindex","0"),p(e,"class","dropdown-item option closable"),ie(e,"selected",n[18](n[45]))},m(h,g){w(h,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(h,g){n=h;let v=t;t=f(n),t===v?u[t].p(n,g):(Pe(),P(u[v],1,1,()=>{u[v]=null}),Le(),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&&ie(e,"selected",n[18](n[45]))},i(h){l||(A(i),l=!0)},o(h){P(i),l=!1},d(h){h&&k(e),u[t].d(),o=!1,Ge(r)}}}function O$(n){let e,t,i,s,l,o=n[11]&&Mc(n);const r=n[32].beforeOptions,a=wn(r,n,n[41],yc);let u=n[19],f=[];for(let v=0;v<u.length;v+=1)f[v]=Ec(vc(n,u,v));const c=v=>P(f[v],1,1,()=>{f[v]=null});let d=null;u.length||(d=Dc(n));const h=n[32].afterOptions,g=wn(h,n,n[41],bc);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(),p(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=Mc(v),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!l||b[1]&1024)&&Sn(a,r,v,v[41],l?$n(r,v[41],b,S$):Cn(v[41]),yc),b[0]&7079426){u=v[19];let y;for(y=0;y<u.length;y+=1){const C=vc(v,u,y);f[y]?(f[y].p(C,b),A(f[y],1)):(f[y]=Ec(C),f[y].c(),A(f[y],1),f[y].m(i,null))}for(Pe(),y=u.length;y<f.length;y+=1)c(y);Le(),!u.length&&d?d.p(v,b):u.length?d&&(d.d(1),d=null):(d=Dc(v),d.c(),d.m(i,null))}g&&g.p&&(!l||b[1]&1024)&&Sn(g,h,v,v[41],l?$n(h,v[41],b,$$):Cn(v[41]),bc)},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),Qt(f,v),d&&d.d(),v&&k(s),g&&g.d(v)}}}function E$(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]=Sc(kc(n,r,d));const u=d=>P(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=wc(n));let c=!n[5]&&Cc(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(),p(t,"tabindex",i=n[5]?"-1":"0"),p(t,"class","selected-container"),ie(t,"disabled",n[5]),p(e,"class",l="select "+n[12]),ie(e,"multiple",n[4]),ie(e,"disabled",n[5])},m(d,h){w(d,e,h),m(e,t);for(let g=0;g<a.length;g+=1)a[g].m(t,null);f&&f.m(t,null),n[34](t),m(e,s),c&&c.m(e,null),n[40](e),o=!0},p(d,h){if(h[0]&8661){r=W.toArray(d[0]);let g;for(g=0;g<r.length;g+=1){const v=kc(d,r,g);a[g]?(a[g].p(v,h),A(a[g],1)):(a[g]=Sc(v),a[g].c(),A(a[g],1),a[g].m(t,null))}for(Pe(),g=r.length;g<a.length;g+=1)u(g);Le(),!r.length&&f?f.p(d,h):r.length?f&&(f.d(1),f=null):(f=wc(d),f.c(),f.m(t,null))}(!o||h[0]&32&&i!==(i=d[5]?"-1":"0"))&&p(t,"tabindex",i),h[0]&32&&ie(t,"disabled",d[5]),d[5]?c&&(Pe(),P(c,1,1,()=>{c=null}),Le()):c?(c.p(d,h),h[0]&32&&A(c,1)):(c=Cc(d),c.c(),A(c,1),c.m(e,null)),(!o||h[0]&4096&&l!==(l="select "+d[12]))&&p(e,"class",l),h[0]&4112&&ie(e,"multiple",d[4]),h[0]&4128&&ie(e,"disabled",d[5])},i(d){if(!o){for(let h=0;h<r.length;h+=1)A(a[h]);A(c),o=!0}},o(d){a=a.filter(Boolean);for(let h=0;h<a.length;h+=1)P(a[h]);P(c),o=!1},d(d){d&&k(e),Qt(a,d),f&&f.d(),n[34](null),c&&c.d(),n[40](null)}}}function A$(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 P$(n,e,t){let i,s,{$$slots:l={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:h=!1}=e,{selected:g=d?[]:void 0}=e,{toggle:v=!1}=e,{labelComponent:b=void 0}=e,{labelComponentProps:y={}}=e,{optionComponent:C=void 0}=e,{optionComponentProps:S={}}=e,{searchable:$=!1}=e,{searchFunc:M=void 0}=e,{class:D=""}=e,E,O="",L,I;function N(Z){if(W.isEmpty(g))return;let ge=W.toArray(g);W.inArray(ge,Z)&&(W.removeByValue(ge,Z),t(0,g=ge)),L==null||L.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function B(Z){if(d){let ge=W.toArray(g);W.inArray(ge,Z)||t(0,g=[...ge,Z])}else t(0,g=Z);L==null||L.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function U(Z){return s(Z)?N(Z):B(Z)}function ee(){t(0,g=d?[]:void 0)}function K(){E!=null&&E.show&&(E==null||E.show())}function se(){E!=null&&E.hide&&(E==null||E.hide())}function Y(){if(W.isEmpty(g)||W.isEmpty(c))return;let Z=W.toArray(g),ge=[];for(const ce of Z)W.inArray(c,ce)||ge.push(ce);if(ge.length){for(const ce of ge)W.removeByValue(Z,ce);t(0,g=d?Z:Z[0])}}function te(){t(14,O="")}function J(Z,ge){Z=Z||[];const ce=M||A$;return Z.filter($e=>ce($e,ge))||[]}function _e(Z,ge){Z.preventDefault(),v&&d?U(ge):B(ge)}function be(Z,ge){(Z.code==="Enter"||Z.code==="Space")&&_e(Z,ge)}function X(){te(),setTimeout(()=>{const Z=L==null?void 0:L.querySelector(".dropdown-item.option.selected");Z&&(Z.focus(),Z.scrollIntoView({block:"nearest"}))},0)}function ae(Z){Z.stopPropagation(),!h&&(E==null||E.toggle())}Jn(()=>{const Z=document.querySelectorAll(`label[for="${r}"]`);for(const ge of Z)ge.addEventListener("click",ae);return()=>{for(const ge of Z)ge.removeEventListener("click",ae)}});const ve=Z=>N(Z);function H(Z){pe[Z?"unshift":"push"](()=>{I=Z,t(17,I)})}function me(){O=this.value,t(14,O)}const x=(Z,ge)=>_e(ge,Z),Q=(Z,ge)=>be(ge,Z);function Se(Z){pe[Z?"unshift":"push"](()=>{E=Z,t(15,E)})}function je(Z){st.call(this,n,Z)}function Ue(Z){pe[Z?"unshift":"push"](()=>{L=Z,t(16,L)})}return n.$$set=Z=>{"id"in Z&&t(24,r=Z.id),"noOptionsText"in Z&&t(1,a=Z.noOptionsText),"selectPlaceholder"in Z&&t(2,u=Z.selectPlaceholder),"searchPlaceholder"in Z&&t(3,f=Z.searchPlaceholder),"items"in Z&&t(25,c=Z.items),"multiple"in Z&&t(4,d=Z.multiple),"disabled"in Z&&t(5,h=Z.disabled),"selected"in Z&&t(0,g=Z.selected),"toggle"in Z&&t(6,v=Z.toggle),"labelComponent"in Z&&t(7,b=Z.labelComponent),"labelComponentProps"in Z&&t(8,y=Z.labelComponentProps),"optionComponent"in Z&&t(9,C=Z.optionComponent),"optionComponentProps"in Z&&t(10,S=Z.optionComponentProps),"searchable"in Z&&t(11,$=Z.searchable),"searchFunc"in Z&&t(26,M=Z.searchFunc),"class"in Z&&t(12,D=Z.class),"$$scope"in Z&&t(41,o=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&c&&(Y(),te()),n.$$.dirty[0]&33570816&&t(19,i=J(c,O)),n.$$.dirty[0]&1&&t(18,s=function(Z){let ge=W.toArray(g);return W.inArray(ge,Z)})},[g,a,u,f,d,h,v,b,y,C,S,$,D,N,O,E,L,I,s,i,te,_e,be,X,r,c,M,B,U,ee,K,se,l,ve,H,me,x,Q,Se,je,Ue,o]}class H_ extends Ee{constructor(e){super(),Oe(this,e,P$,E$,De,{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 Ac(n){let e,t;return{c(){e=_("i"),p(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)&&p(e,"class",t)},d(i){i&&k(e)}}}function L$(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&&Ac(n);return{c(){l&&l.c(),e=T(),t=_("span"),s=F(i),p(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=Ac(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)+"")&&ue(s,i)},i:oe,o:oe,d(o){l&&l.d(o),o&&k(e),o&&k(t)}}}function I$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Pc extends Ee{constructor(e){super(),Oe(this,e,I$,L$,De,{item:0})}}const F$=n=>({}),Lc=n=>({});function N$(n){let e;const t=n[8].afterOptions,i=wn(t,n,n[12],Lc);return{c(){i&&i.c()},m(s,l){i&&i.m(s,l),e=!0},p(s,l){i&&i.p&&(!e||l&4096)&&Sn(i,t,s,s[12],e?$n(t,s[12],l,F$):Cn(s[12]),Lc)},i(s){e||(A(i,s),e=!0)},o(s){P(i,s),e=!1},d(s){i&&i.d(s)}}}function R$(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:[N$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=at(o,s[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new H_({props:o}),pe.push(()=>Fe(e,"selected",l)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&62?pn(s,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&si(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function H$(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let s=Bt(e,i),{$$slots:l={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Pc}=e,{optionComponent:c=Pc}=e,{selectionKey:d="value"}=e,{keyOfSelected:h=a?[]:void 0}=e;function g(S){S=W.toArray(S,!0);let $=[];for(let M of r)W.inArray(S,M[d])&&$.push(M);S.length&&!$.length||t(0,u=a?$:$[0])}async function v(S){let $=W.toArray(S,!0).map(M=>M[d]);!r.length||t(6,h=a?$:$[0])}function b(S){u=S,t(0,u)}function y(S){st.call(this,n,S)}function C(S){st.call(this,n,S)}return n.$$set=S=>{e=at(at({},e),ni(S)),t(5,s=Bt(e,i)),"items"in S&&t(1,r=S.items),"multiple"in S&&t(2,a=S.multiple),"selected"in S&&t(0,u=S.selected),"labelComponent"in S&&t(3,f=S.labelComponent),"optionComponent"in S&&t(4,c=S.optionComponent),"selectionKey"in S&&t(7,d=S.selectionKey),"keyOfSelected"in S&&t(6,h=S.keyOfSelected),"$$scope"in S&&t(12,o=S.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&g(h),n.$$.dirty&1&&v(u)},[u,r,a,f,c,s,h,d,l,b,y,C,o]}class fs extends Ee{constructor(e){super(),Oe(this,e,H$,R$,De,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function j$(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=at(o,s[r]);return n[0]!==void 0&&(o.keyOfSelected=n[0]),e=new fs({props:o}),pe.push(()=>Fe(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&14?pn(s,[a&2&&{class:"field-type-select "+r[1]},s[1],a&4&&{items:r[2]},a&8&&si(r[3])]):{};!t&&a&1&&(t=!0,u.keyOfSelected=r[0],He(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){q(e,r)}}}function q$(n,e,t){const i=["value","class"];let s=Bt(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=at(at({},e),ni(u)),t(3,s=Bt(e,i)),"value"in u&&t(0,l=u.value),"class"in u&&t(1,o=u.class)},[l,o,r,s,a]}class V$ extends Ee{constructor(e){super(),Oe(this,e,q$,j$,De,{value:0,class:1})}}function z$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].min&&Te(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function B$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max length"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min",r=n[0].min||0)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Te(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&32&&i!==(i=f[5])&&p(e,"for",i),c&32&&o!==(o=f[5])&&p(l,"id",o),c&1&&r!==(r=f[0].min||0)&&p(l,"min",r),c&1&&Pt(l.value)!==f[0].max&&Te(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function U$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Regex pattern"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML="Valid Go regular expression, eg. <code>^\\w+$</code>.",p(e,"for",i=n[5]),p(l,"type","text"),p(l,"id",o=n[5]),p(a,"class","help-block")},m(c,d){w(c,e,d),m(e,t),w(c,s,d),w(c,l,d),Te(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])&&p(e,"for",i),d&32&&o!==(o=c[5])&&p(l,"id",o),d&1&&l.value!==c[0].pattern&&Te(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 W$(n){let e,t,i,s,l,o,r,a,u,f;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[z$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[B$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[U$,({uniqueId:c})=>({5:c}),({uniqueId:c})=>c?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.min"),d&97&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);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),q(i),q(o),q(u)}}}function Y$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Pt(this.value),t(0,s)}function o(){s.max=Pt(this.value),t(0,s)}function r(){s.pattern=this.value,t(0,s)}return n.$$set=a=>{"key"in a&&t(1,i=a.key),"options"in a&&t(0,s=a.options)},[s,i,l,o,r]}class K$ extends Ee{constructor(e){super(),Oe(this,e,Y$,W$,De,{key:1,options:0})}}function J$(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Min"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].min),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].min&&Te(l,u[0].min)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Z$(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=F("Max"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"min",r=n[0].min)},m(f,c){w(f,e,c),m(e,t),w(f,s,c),w(f,l,c),Te(l,n[0].max),a||(u=G(l,"input",n[3]),a=!0)},p(f,c){c&16&&i!==(i=f[4])&&p(e,"for",i),c&16&&o!==(o=f[4])&&p(l,"id",o),c&1&&r!==(r=f[0].min)&&p(l,"min",r),c&1&&Pt(l.value)!==f[0].max&&Te(l,f[0].max)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function G$(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[J$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[Z$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(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),q(i),q(o)}}}function X$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.min=Pt(this.value),t(0,s)}function o(){s.max=Pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class Q$ extends Ee{constructor(e){super(),Oe(this,e,X$,G$,De,{key:1,options:0})}}function x$(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 eS extends Ee{constructor(e){super(),Oe(this,e,x$,null,De,{key:0,options:1})}}function tS(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=at(o,l[r]);return{c(){e=_("input"),di(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]){di(e,o=pn(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 nS(n,e,t){let i;const s=["value","separator"];let l=Bt(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=at(at({},e),ni(u)),t(3,l=Bt(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 cs extends Ee{constructor(e){super(),Oe(this,e,nS,tS,De,{value:0,separator:1})}}function iS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;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 cs({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.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]))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},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),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function sS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;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 cs({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.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"))&&p(e,"for",l);const C={};y&16&&(C.id=b[4]+".options.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},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),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function lS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[iS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[sS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(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),q(i),q(o)}}}function oS(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 j_ extends Ee{constructor(e){super(),Oe(this,e,oS,lS,De,{key:1,options:0})}}function rS(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 j_({props:r}),pe.push(()=>Fe(e,"key",l)),pe.push(()=>Fe(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function aS(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 uS extends Ee{constructor(e){super(),Oe(this,e,aS,rS,De,{key:0,options:1})}}var wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},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},bn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},Hn=function(n){return n===!0?1:0};function Ic(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 hn(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function St(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function xl(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function q_(n,e){if(e(n))return n;if(n.parentNode)return q_(n.parentNode,e)}function eo(n,e){var t=St("div","numInputWrapper"),i=St("input","numInput "+n),s=St("span","arrowUp"),l=St("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(s),t.appendChild(l),t}function En(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Sr=function(){},Po=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},fS={D:Sr,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*Hn(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:Sr,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:Sr,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},xi={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})"},ll={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[ll.w(n,e,t)]},F:function(n,e,t){return Po(ll.n(n,e,t)-1,!1,e)},G:function(n,e,t){return bn(ll.h(n,e,t))},H:function(n){return bn(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[Hn(n.getHours()>11)]},M:function(n,e){return Po(n.getMonth(),!0,e)},S:function(n){return bn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return bn(n.getFullYear(),4)},d:function(n){return bn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return bn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return bn(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)}},V_=function(n){var e=n.config,t=e===void 0?ks: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,h){return ll[c]&&h[d-1]!=="\\"?ll[c](r,f,t):c!=="\\"?c:""}).join("")}},la=function(n){var e=n.config,t=e===void 0?ks: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||ks).dateFormat,h=String(l).trim();if(h==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(l,d);else if(/Z$/.test(h)||/GMT$/.test(h))f=new Date(l);else{for(var g=void 0,v=[],b=0,y=0,C="";b<d.length;b++){var S=d[b],$=S==="\\",M=d[b-1]==="\\"||$;if(xi[S]&&!M){C+=xi[S];var D=new RegExp(C).exec(l);D&&(g=!0)&&v[S!=="Y"?"push":"unshift"]({fn:fS[S],val:D[++y]})}else $||(C+=".")}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(E){var O=E.fn,L=E.val;return f=O(f,L,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 An(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 cS=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Cr=function(n,e,t){return n*3600+e*60+t},dS=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},pS={DAY:864e5};function Mr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var s=n.minDate.getHours(),l=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<s&&(e=s),e===s&&t<l&&(t=l),e===s&&t===l&&i<o&&(i=n.minDate.getSeconds())}if(n.maxDate!==void 0){var r=n.maxDate.getHours(),a=n.maxDate.getMinutes();e=Math.min(e,r),e===r&&(t=Math.min(a,t)),e===r&&t===a&&(i=n.maxDate.getSeconds())}return{hours:e,minutes:t,seconds:i}}typeof Object.assign!="function"&&(Object.assign=function(n){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];if(!n)throw TypeError("Cannot convert undefined or null to object");for(var i=function(r){r&&Object.keys(r).forEach(function(a){return n[a]=r[a]})},s=0,l=e;s<l.length;s++){var o=l[s];i(o)}return n});var an=globalThis&&globalThis.__assign||function(){return an=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=e[s])}return n},an.apply(this,arguments)},Fc=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},hS=300;function mS(n,e){var t={config:an(an({},ks),Jt.defaultConfig),l10n:hl};t.parseDate=la({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=v,t._setHoursFromDate=d,t._positionCalendar=tt,t.changeMonth=be,t.changeYear=x,t.clear=X,t.close=ae,t.onMouseOver=Z,t._createElement=St,t.createDay=D,t.destroy=ve,t.isEnabled=Q,t.jumpToDate=C,t.updateValue=Ct,t.open=ce,t.redraw=Xe,t.set=Ne,t.setDate=Dt,t.toggle=Ot;function i(){t.utils={getDaysInMonth:function(R,z){return R===void 0&&(R=t.currentMonth),z===void 0&&(z=t.currentYear),R===1&&(z%4===0&&z%100!==0||z%400===0)?29:t.l10n.daysInMonth[R]}}}function s(){t.element=t.input=n,t.isOpen=!1,Ze(),We(),Lt(),lt(),i(),t.isMobile||M(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Ct(!1)),r();var R=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&R&&tt(),Je("onReady")}function l(){var R;return((R=t.calendarContainer)===null||R===void 0?void 0:R.getRootNode()).activeElement||document.activeElement}function o(R){return R.bind(t)}function r(){var R=t.config;R.weekNumbers===!1&&R.showMonths===1||R.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 z=(t.days.offsetWidth+1)*R.showMonths;t.daysContainer.style.width=z+"px",t.calendarContainer.style.width=z+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(R){if(t.selectedDates.length===0){var z=t.config.minDate===void 0||An(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),ne=Mr(t.config);z.setHours(ne.hours,ne.minutes,ne.seconds,z.getMilliseconds()),t.selectedDates=[z],t.latestSelectedDateObj=z}R!==void 0&&R.type!=="blur"&&xt(R);var re=t._input.value;c(),Ct(),t._input.value!==re&&t._debouncedChange()}function u(R,z){return R%12+12*Hn(z===t.l10n.amPM[1])}function f(R){switch(R%24){case 0:case 12:return 12;default:return R%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var R=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,z=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(R=u(R,t.amPM.textContent));var re=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&An(t.latestSelectedDateObj,t.config.minDate,!0)===0,Ae=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&An(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 le=Cr(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),de=Cr(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),ke=Cr(R,z,ne);if(ke>de&&ke<le){var fe=dS(le);R=fe[0],z=fe[1],ne=fe[2]}}else{if(Ae){var he=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;R=Math.min(R,he.getHours()),R===he.getHours()&&(z=Math.min(z,he.getMinutes())),z===he.getMinutes()&&(ne=Math.min(ne,he.getSeconds()))}if(re){var Ie=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;R=Math.max(R,Ie.getHours()),R===Ie.getHours()&&z<Ie.getMinutes()&&(z=Ie.getMinutes()),z===Ie.getMinutes()&&(ne=Math.max(ne,Ie.getSeconds()))}}h(R,z,ne)}}function d(R){var z=R||t.latestSelectedDateObj;z&&z instanceof Date&&h(z.getHours(),z.getMinutes(),z.getSeconds())}function h(R,z,ne){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(R%24,z,ne||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=bn(t.config.time_24hr?R:(12+R)%12+12*Hn(R%12===0)),t.minuteElement.value=bn(z),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[Hn(R>=12)]),t.secondElement!==void 0&&(t.secondElement.value=bn(ne)))}function g(R){var z=En(R),ne=parseInt(z.value)+(R.delta||0);(ne/1e3>1||R.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&x(ne)}function v(R,z,ne,re){if(z instanceof Array)return z.forEach(function(Ae){return v(R,Ae,ne,re)});if(R instanceof Array)return R.forEach(function(Ae){return v(Ae,z,ne,re)});R.addEventListener(z,ne,re),t._handlers.push({remove:function(){return R.removeEventListener(z,ne,re)}})}function b(){Je("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(re){return v(re,"click",t[ne])})}),t.isMobile){Nt();return}var R=Ic(ge,50);if(t._debouncedChange=Ic(b,hS),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&v(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Z(En(ne))}),v(t._input,"keydown",Ue),t.calendarContainer!==void 0&&v(t.calendarContainer,"keydown",Ue),!t.config.inline&&!t.config.static&&v(window,"resize",R),window.ontouchstart!==void 0?v(window.document,"touchstart",me):v(window.document,"mousedown",me),v(window.document,"focus",me,{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",ft),v(t.monthNav,["keyup","increment"],g),v(t.daysContainer,"click",ut)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var z=function(ne){return En(ne).select()};v(t.timeContainer,["increment"],a),v(t.timeContainer,"blur",a,{capture:!0}),v(t.timeContainer,"click",S),v([t.hourElement,t.minuteElement],["focus","click"],z),t.secondElement!==void 0&&v(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&v(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&v(t._input,"blur",je)}function C(R,z){var ne=R!==void 0?t.parseDate(R):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),re=t.currentYear,Ae=t.currentMonth;try{ne!==void 0&&(t.currentYear=ne.getFullYear(),t.currentMonth=ne.getMonth())}catch(le){le.message="Invalid date supplied: "+ne,t.config.errorHandler(le)}z&&t.currentYear!==re&&(Je("onYearChange"),U()),z&&(t.currentYear!==re||t.currentMonth!==Ae)&&Je("onMonthChange"),t.redraw()}function S(R){var z=En(R);~z.className.indexOf("arrow")&&$(R,z.classList.contains("arrowUp")?1:-1)}function $(R,z,ne){var re=R&&En(R),Ae=ne||re&&re.parentNode&&re.parentNode.firstChild,le=Ce("increment");le.delta=z,Ae&&Ae.dispatchEvent(le)}function M(){var R=window.document.createDocumentFragment();if(t.calendarContainer=St("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(R.appendChild(se()),t.innerContainer=St("div","flatpickr-innerContainer"),t.config.weekNumbers){var z=_e(),ne=z.weekWrapper,re=z.weekNumbers;t.innerContainer.appendChild(ne),t.weekNumbers=re,t.weekWrapper=ne}t.rContainer=St("div","flatpickr-rContainer"),t.rContainer.appendChild(te()),t.daysContainer||(t.daysContainer=St("div","flatpickr-days"),t.daysContainer.tabIndex=-1),B(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),R.appendChild(t.innerContainer)}t.config.enableTime&&R.appendChild(Y()),hn(t.calendarContainer,"rangeMode",t.config.mode==="range"),hn(t.calendarContainer,"animate",t.config.animate===!0),hn(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(R);var Ae=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&&(!Ae&&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 le=St("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(le,t.element),le.appendChild(t.element),t.altInput&&le.appendChild(t.altInput),le.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(R,z,ne,re){var Ae=Q(z,!0),le=St("span",R,z.getDate().toString());return le.dateObj=z,le.$i=re,le.setAttribute("aria-label",t.formatDate(z,t.config.ariaDateFormat)),R.indexOf("hidden")===-1&&An(z,t.now)===0&&(t.todayDateElem=le,le.classList.add("today"),le.setAttribute("aria-current","date")),Ae?(le.tabIndex=-1,Be(z)&&(le.classList.add("selected"),t.selectedDateElem=le,t.config.mode==="range"&&(hn(le,"startRange",t.selectedDates[0]&&An(z,t.selectedDates[0],!0)===0),hn(le,"endRange",t.selectedDates[1]&&An(z,t.selectedDates[1],!0)===0),R==="nextMonthDay"&&le.classList.add("inRange")))):le.classList.add("flatpickr-disabled"),t.config.mode==="range"&&ot(z)&&!Be(z)&&le.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&R!=="prevMonthDay"&&re%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(z)+"</span>"),Je("onDayCreate",le),le}function E(R){R.focus(),t.config.mode==="range"&&Z(R)}function O(R){for(var z=R>0?0:t.config.showMonths-1,ne=R>0?t.config.showMonths:-1,re=z;re!=ne;re+=R)for(var Ae=t.daysContainer.children[re],le=R>0?0:Ae.children.length-1,de=R>0?Ae.children.length:-1,ke=le;ke!=de;ke+=R){var fe=Ae.children[ke];if(fe.className.indexOf("hidden")===-1&&Q(fe.dateObj))return fe}}function L(R,z){for(var ne=R.className.indexOf("Month")===-1?R.dateObj.getMonth():t.currentMonth,re=z>0?t.config.showMonths:-1,Ae=z>0?1:-1,le=ne-t.currentMonth;le!=re;le+=Ae)for(var de=t.daysContainer.children[le],ke=ne-t.currentMonth===le?R.$i+z:z<0?de.children.length-1:0,fe=de.children.length,he=ke;he>=0&&he<fe&&he!=(z>0?fe:-1);he+=Ae){var Ie=de.children[he];if(Ie.className.indexOf("hidden")===-1&&Q(Ie.dateObj)&&Math.abs(R.$i-he)>=Math.abs(z))return E(Ie)}t.changeMonth(Ae),I(O(Ae),0)}function I(R,z){var ne=l(),re=Se(ne||document.body),Ae=R!==void 0?R:re?ne:t.selectedDateElem!==void 0&&Se(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&Se(t.todayDateElem)?t.todayDateElem:O(z>0?1:-1);Ae===void 0?t._input.focus():re?L(Ae,z):E(Ae)}function N(R,z){for(var ne=(new Date(R,z,1).getDay()-t.l10n.firstDayOfWeek+7)%7,re=t.utils.getDaysInMonth((z-1+12)%12,R),Ae=t.utils.getDaysInMonth(z,R),le=window.document.createDocumentFragment(),de=t.config.showMonths>1,ke=de?"prevMonthDay hidden":"prevMonthDay",fe=de?"nextMonthDay hidden":"nextMonthDay",he=re+1-ne,Ie=0;he<=re;he++,Ie++)le.appendChild(D("flatpickr-day "+ke,new Date(R,z-1,he),he,Ie));for(he=1;he<=Ae;he++,Ie++)le.appendChild(D("flatpickr-day",new Date(R,z,he),he,Ie));for(var ht=Ae+1;ht<=42-ne&&(t.config.showMonths===1||Ie%7!==0);ht++,Ie++)le.appendChild(D("flatpickr-day "+fe,new Date(R,z+1,ht%Ae),ht,Ie));var rn=St("div","dayContainer");return rn.appendChild(le),rn}function B(){if(t.daysContainer!==void 0){xl(t.daysContainer),t.weekNumbers&&xl(t.weekNumbers);for(var R=document.createDocumentFragment(),z=0;z<t.config.showMonths;z++){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+z),R.appendChild(N(ne.getFullYear(),ne.getMonth()))}t.daysContainer.appendChild(R),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Z()}}function U(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var R=function(re){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&re<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&re>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var z=0;z<12;z++)if(!!R(z)){var ne=St("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,z).getMonth().toString(),ne.textContent=Po(z,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===z&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function ee(){var R=St("div","flatpickr-month"),z=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=St("span","cur-month"):(t.monthsDropdownContainer=St("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),v(t.monthsDropdownContainer,"change",function(de){var ke=En(de),fe=parseInt(ke.value,10);t.changeMonth(fe-t.currentMonth),Je("onMonthChange")}),U(),ne=t.monthsDropdownContainer);var re=eo("cur-year",{tabindex:"-1"}),Ae=re.getElementsByTagName("input")[0];Ae.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Ae.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Ae.setAttribute("max",t.config.maxDate.getFullYear().toString()),Ae.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var le=St("div","flatpickr-current-month");return le.appendChild(ne),le.appendChild(re),z.appendChild(le),R.appendChild(z),{container:R,yearElement:Ae,monthElement:ne}}function K(){xl(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var R=t.config.showMonths;R--;){var z=ee();t.yearElements.push(z.yearElement),t.monthElements.push(z.monthElement),t.monthNav.appendChild(z.container)}t.monthNav.appendChild(t.nextMonthNav)}function se(){return t.monthNav=St("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=St("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=St("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,K(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(R){t.__hidePrevMonthArrow!==R&&(hn(t.prevMonthNav,"flatpickr-disabled",R),t.__hidePrevMonthArrow=R)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(R){t.__hideNextMonthArrow!==R&&(hn(t.nextMonthNav,"flatpickr-disabled",R),t.__hideNextMonthArrow=R)}}),t.currentYearElement=t.yearElements[0],rt(),t.monthNav}function Y(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var R=Mr(t.config);t.timeContainer=St("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var z=St("span","flatpickr-time-separator",":"),ne=eo("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var re=eo("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=re.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?R.hours:f(R.hours)),t.minuteElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():R.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(ne),t.timeContainer.appendChild(z),t.timeContainer.appendChild(re),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Ae=eo("flatpickr-second");t.secondElement=Ae.getElementsByTagName("input")[0],t.secondElement.value=bn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():R.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(St("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Ae)}return t.config.time_24hr||(t.amPM=St("span","flatpickr-am-pm",t.l10n.amPM[Hn((t.latestSelectedDateObj?t.hourElement.value:t.config.defaultHour)>11)]),t.amPM.title=t.l10n.toggleTitle,t.amPM.tabIndex=-1,t.timeContainer.appendChild(t.amPM)),t.timeContainer}function te(){t.weekdayContainer?xl(t.weekdayContainer):t.weekdayContainer=St("div","flatpickr-weekdays");for(var R=t.config.showMonths;R--;){var z=St("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(z)}return J(),t.weekdayContainer}function J(){if(!!t.weekdayContainer){var R=t.l10n.firstDayOfWeek,z=Fc(t.l10n.weekdays.shorthand);R>0&&R<z.length&&(z=Fc(z.splice(R,z.length),z.splice(0,R)));for(var ne=t.config.showMonths;ne--;)t.weekdayContainer.children[ne].innerHTML=`
|
||
<span class='flatpickr-weekday'>
|
||
`+z.join("</span><span class='flatpickr-weekday'>")+`
|
||
</span>
|
||
`}}function _e(){t.calendarContainer.classList.add("hasWeeks");var R=St("div","flatpickr-weekwrapper");R.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return R.appendChild(z),{weekWrapper:R,weekNumbers:z}}function be(R,z){z===void 0&&(z=!0);var ne=z?R:R-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Je("onYearChange"),U()),B(),Je("onMonthChange"),rt())}function X(R,z){if(R===void 0&&(R=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Mr(t.config),re=ne.hours,Ae=ne.minutes,le=ne.seconds;h(re,Ae,le)}t.redraw(),R&&Je("onChange")}function ae(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Je("onClose")}function ve(){t.config!==void 0&&Je("onDestroy");for(var R=t._handlers.length;R--;)t._handlers[R].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 z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}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(ne){try{delete t[ne]}catch{}})}function H(R){return t.calendarContainer.contains(R)}function me(R){if(t.isOpen&&!t.config.inline){var z=En(R),ne=H(z),re=z===t.input||z===t.altInput||t.element.contains(z)||R.path&&R.path.indexOf&&(~R.path.indexOf(t.input)||~R.path.indexOf(t.altInput)),Ae=!re&&!ne&&!H(R.relatedTarget),le=!t.config.ignoredFocusElements.some(function(de){return de.contains(z)});Ae&&le&&(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 x(R){if(!(!R||t.config.minDate&&R<t.config.minDate.getFullYear()||t.config.maxDate&&R>t.config.maxDate.getFullYear())){var z=R,ne=t.currentYear!==z;t.currentYear=z||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)),ne&&(t.redraw(),Je("onYearChange"),U())}}function Q(R,z){var ne;z===void 0&&(z=!0);var re=t.parseDate(R,void 0,z);if(t.config.minDate&&re&&An(re,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&re&&An(re,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(re===void 0)return!1;for(var Ae=!!t.config.enable,le=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,de=0,ke=void 0;de<le.length;de++){if(ke=le[de],typeof ke=="function"&&ke(re))return Ae;if(ke instanceof Date&&re!==void 0&&ke.getTime()===re.getTime())return Ae;if(typeof ke=="string"){var fe=t.parseDate(ke,void 0,!0);return fe&&fe.getTime()===re.getTime()?Ae:!Ae}else if(typeof ke=="object"&&re!==void 0&&ke.from&&ke.to&&re.getTime()>=ke.from.getTime()&&re.getTime()<=ke.to.getTime())return Ae}return!Ae}function Se(R){return t.daysContainer!==void 0?R.className.indexOf("hidden")===-1&&R.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(R):!1}function je(R){var z=R.target===t._input,ne=t._input.value.trimEnd()!==Ht();z&&ne&&!(R.relatedTarget&&H(R.relatedTarget))&&t.setDate(t._input.value,!0,R.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ue(R){var z=En(R),ne=t.config.wrap?n.contains(z):z===t._input,re=t.config.allowInput,Ae=t.isOpen&&(!re||!ne),le=t.config.inline&&ne&&!re;if(R.keyCode===13&&ne){if(re)return t.setDate(t._input.value,!0,z===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),z.blur();t.open()}else if(H(z)||Ae||le){var de=!!t.timeContainer&&t.timeContainer.contains(z);switch(R.keyCode){case 13:de?(R.preventDefault(),a(),nt()):ut(R);break;case 27:R.preventDefault(),nt();break;case 8:case 46:ne&&!t.config.allowInput&&(R.preventDefault(),t.clear());break;case 37:case 39:if(!de&&!ne){R.preventDefault();var ke=l();if(t.daysContainer!==void 0&&(re===!1||ke&&Se(ke))){var fe=R.keyCode===39?1:-1;R.ctrlKey?(R.stopPropagation(),be(fe),I(O(1),0)):I(void 0,fe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:R.preventDefault();var he=R.keyCode===40?1:-1;t.daysContainer&&z.$i!==void 0||z===t.input||z===t.altInput?R.ctrlKey?(R.stopPropagation(),x(t.currentYear-he),I(O(1),0)):de||I(void 0,he*7):z===t.currentYearElement?x(t.currentYear-he):t.config.enableTime&&(!de&&t.hourElement&&t.hourElement.focus(),a(R),t._debouncedChange());break;case 9:if(de){var Ie=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(jt){return jt}),ht=Ie.indexOf(z);if(ht!==-1){var rn=Ie[ht+(R.shiftKey?-1:1)];R.preventDefault(),(rn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(z)&&R.shiftKey&&(R.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&z===t.amPM)switch(R.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Ct();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Ct();break}(ne||H(z))&&Je("onKeyDown",R)}function Z(R,z){if(z===void 0&&(z="flatpickr-day"),!(t.selectedDates.length!==1||R&&(!R.classList.contains(z)||R.classList.contains("flatpickr-disabled")))){for(var ne=R?R.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),re=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Ae=Math.min(ne,t.selectedDates[0].getTime()),le=Math.max(ne,t.selectedDates[0].getTime()),de=!1,ke=0,fe=0,he=Ae;he<le;he+=pS.DAY)Q(new Date(he),!0)||(de=de||he>Ae&&he<le,he<re&&(!ke||he>ke)?ke=he:he>re&&(!fe||he<fe)&&(fe=he));var Ie=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+z));Ie.forEach(function(ht){var rn=ht.dateObj,jt=rn.getTime(),Ti=ke>0&&jt<ke||fe>0&&jt>fe;if(Ti){ht.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(gi){ht.classList.remove(gi)});return}else if(de&&!Ti)return;["startRange","inRange","endRange","notAllowed"].forEach(function(gi){ht.classList.remove(gi)}),R!==void 0&&(R.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),re<ne&&jt===re?ht.classList.add("startRange"):re>ne&&jt===re&&ht.classList.add("endRange"),jt>=ke&&(fe===0||jt<=fe)&&cS(jt,re,ne)&&ht.classList.add("inRange"))})}}function ge(){t.isOpen&&!t.config.static&&!t.config.inline&&tt()}function ce(R,z){if(z===void 0&&(z=t._positionElement),t.isMobile===!0){if(R){R.preventDefault();var ne=En(R);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),Je("onOpen");return}else if(t._input.disabled||t.config.inline)return;var re=t.isOpen;t.isOpen=!0,re||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),Je("onOpen"),tt(z)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(R===void 0||!t.timeContainer.contains(R.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function $e(R){return function(z){var ne=t.config["_"+R+"Date"]=t.parseDate(z,t.config.dateFormat),re=t.config["_"+(R==="min"?"max":"min")+"Date"];ne!==void 0&&(t[R==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Ae){return Q(Ae)}),!t.selectedDates.length&&R==="min"&&d(ne),Ct()),t.daysContainer&&(Xe(),ne!==void 0?t.currentYearElement[R]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(R),t.currentYearElement.disabled=!!re&&ne!==void 0&&re.getFullYear()===ne.getFullYear())}}function Ze(){var R=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],z=an(an({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=z.parseDate,t.config.formatDate=z.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ie){t.config._enable=dt(Ie)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ie){t.config._disable=dt(Ie)}});var re=z.mode==="time";if(!z.dateFormat&&(z.enableTime||re)){var Ae=Jt.defaultConfig.dateFormat||ks.dateFormat;ne.dateFormat=z.noCalendar||re?"H:i"+(z.enableSeconds?":S":""):Ae+" H:i"+(z.enableSeconds?":S":"")}if(z.altInput&&(z.enableTime||re)&&!z.altFormat){var le=Jt.defaultConfig.altFormat||ks.altFormat;ne.altFormat=z.noCalendar||re?"h:i"+(z.enableSeconds?":S K":" K"):le+(" h:i"+(z.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:$e("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:$e("max")});var de=function(Ie){return function(ht){t.config[Ie==="min"?"_minTime":"_maxTime"]=t.parseDate(ht,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:de("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:de("max")}),z.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,z);for(var ke=0;ke<R.length;ke++)t.config[R[ke]]=t.config[R[ke]]===!0||t.config[R[ke]]==="true";wr.filter(function(Ie){return t.config[Ie]!==void 0}).forEach(function(Ie){t.config[Ie]=$r(t.config[Ie]||[]).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 ke=0;ke<t.config.plugins.length;ke++){var fe=t.config.plugins[ke](t)||{};for(var he in fe)wr.indexOf(he)>-1?t.config[he]=$r(fe[he]).map(o).concat(t.config[he]):typeof z[he]>"u"&&(t.config[he]=fe[he])}z.altInputClass||(t.config.altInputClass=et().className+" "+t.config.altInputClass),Je("onParseConfig")}function et(){return t.config.wrap?n.querySelector("[data-input]"):n}function We(){typeof t.config.locale!="object"&&typeof Jt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=an(an({},Jt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Jt.l10ns[t.config.locale]:void 0),xi.D="("+t.l10n.weekdays.shorthand.join("|")+")",xi.l="("+t.l10n.weekdays.longhand.join("|")+")",xi.M="("+t.l10n.months.shorthand.join("|")+")",xi.F="("+t.l10n.months.longhand.join("|")+")",xi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var R=an(an({},e),JSON.parse(JSON.stringify(n.dataset||{})));R.time_24hr===void 0&&Jt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=V_(t),t.parseDate=la({config:t.config,l10n:t.l10n})}function tt(R){if(typeof t.config.position=="function")return void t.config.position(t,R);if(t.calendarContainer!==void 0){Je("onPreCalendarPosition");var z=R||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(Al,Pl){return Al+Pl.offsetHeight},0),re=t.calendarContainer.offsetWidth,Ae=t.config.position.split(" "),le=Ae[0],de=Ae.length>1?Ae[1]:null,ke=z.getBoundingClientRect(),fe=window.innerHeight-ke.bottom,he=le==="above"||le!=="below"&&fe<ne&&ke.top>ne,Ie=window.pageYOffset+ke.top+(he?-ne-2:z.offsetHeight+2);if(hn(t.calendarContainer,"arrowTop",!he),hn(t.calendarContainer,"arrowBottom",he),!t.config.inline){var ht=window.pageXOffset+ke.left,rn=!1,jt=!1;de==="center"?(ht-=(re-ke.width)/2,rn=!0):de==="right"&&(ht-=re-ke.width,jt=!0),hn(t.calendarContainer,"arrowLeft",!rn&&!jt),hn(t.calendarContainer,"arrowCenter",rn),hn(t.calendarContainer,"arrowRight",jt);var Ti=window.document.body.offsetWidth-(window.pageXOffset+ke.right),gi=ht+re>window.document.body.offsetWidth,Tl=Ti+re>window.document.body.offsetWidth;if(hn(t.calendarContainer,"rightMost",gi),!t.config.static)if(t.calendarContainer.style.top=Ie+"px",!gi)t.calendarContainer.style.left=ht+"px",t.calendarContainer.style.right="auto";else if(!Tl)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Ti+"px";else{var ds=Me();if(ds===void 0)return;var Dl=window.document.body.offsetWidth,qe=Math.max(0,Dl/2-re/2),xe=".flatpickr-calendar.centerMost:before",Gt=".flatpickr-calendar.centerMost:after",Ol=ds.cssRules.length,El="{left:"+ke.left+"px;right:auto;}";hn(t.calendarContainer,"rightMost",!1),hn(t.calendarContainer,"centerMost",!0),ds.insertRule(xe+","+Gt+El,Ol),t.calendarContainer.style.left=qe+"px",t.calendarContainer.style.right="auto"}}}}function Me(){for(var R=null,z=0;z<document.styleSheets.length;z++){var ne=document.styleSheets[z];if(!!ne.cssRules){try{ne.cssRules}catch{continue}R=ne;break}}return R!=null?R:ze()}function ze(){var R=document.createElement("style");return document.head.appendChild(R),R.sheet}function Xe(){t.config.noCalendar||t.isMobile||(U(),rt(),B())}function nt(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function ut(R){R.preventDefault(),R.stopPropagation();var z=function(Ie){return Ie.classList&&Ie.classList.contains("flatpickr-day")&&!Ie.classList.contains("flatpickr-disabled")&&!Ie.classList.contains("notAllowed")},ne=q_(En(R),z);if(ne!==void 0){var re=ne,Ae=t.latestSelectedDateObj=new Date(re.dateObj.getTime()),le=(Ae.getMonth()<t.currentMonth||Ae.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=re,t.config.mode==="single")t.selectedDates=[Ae];else if(t.config.mode==="multiple"){var de=Be(Ae);de?t.selectedDates.splice(parseInt(de),1):t.selectedDates.push(Ae)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Ae,t.selectedDates.push(Ae),An(Ae,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ie,ht){return Ie.getTime()-ht.getTime()}));if(c(),le){var ke=t.currentYear!==Ae.getFullYear();t.currentYear=Ae.getFullYear(),t.currentMonth=Ae.getMonth(),ke&&(Je("onYearChange"),U()),Je("onMonthChange")}if(rt(),B(),Ct(),!le&&t.config.mode!=="range"&&t.config.showMonths===1?E(re):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 fe=t.config.mode==="single"&&!t.config.enableTime,he=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(fe||he)&&nt()}b()}}var ye={locale:[We,J],showMonths:[K,r,te],minDate:[C],maxDate:[C],positionElement:[mt],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 Ne(R,z){if(R!==null&&typeof R=="object"){Object.assign(t.config,R);for(var ne in R)ye[ne]!==void 0&&ye[ne].forEach(function(re){return re()})}else t.config[R]=z,ye[R]!==void 0?ye[R].forEach(function(re){return re()}):wr.indexOf(R)>-1&&(t.config[R]=$r(z));t.redraw(),Ct(!0)}function ct(R,z){var ne=[];if(R instanceof Array)ne=R.map(function(re){return t.parseDate(re,z)});else if(R instanceof Date||typeof R=="number")ne=[t.parseDate(R,z)];else if(typeof R=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(R,z)];break;case"multiple":ne=R.split(t.config.conjunction).map(function(re){return t.parseDate(re,z)});break;case"range":ne=R.split(t.l10n.rangeSeparator).map(function(re){return t.parseDate(re,z)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(R)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(re){return re instanceof Date&&Q(re,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(re,Ae){return re.getTime()-Ae.getTime()})}function Dt(R,z,ne){if(z===void 0&&(z=!1),ne===void 0&&(ne=t.config.dateFormat),R!==0&&!R||R instanceof Array&&R.length===0)return t.clear(z);ct(R,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),C(void 0,z),d(),t.selectedDates.length===0&&t.clear(!1),Ct(z),z&&Je("onChange")}function dt(R){return R.slice().map(function(z){return typeof z=="string"||typeof z=="number"||z instanceof Date?t.parseDate(z,void 0,!0):z&&typeof z=="object"&&z.from&&z.to?{from:t.parseDate(z.from,void 0),to:t.parseDate(z.to,void 0)}:z}).filter(function(z){return z})}function lt(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var R=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);R&&ct(R,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 Lt(){if(t.input=et(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=St(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),mt()}function mt(){t._positionElement=t.config.positionElement||t._input}function Nt(){var R=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=St("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=R,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=R==="datetime-local"?"Y-m-d\\TH:i:S":R==="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(z){t.setDate(En(z).value,!1,t.mobileFormatStr),Je("onChange"),Je("onClose")})}function Ot(R){if(t.isOpen===!0)return t.close();t.open(R)}function Je(R,z){if(t.config!==void 0){var ne=t.config[R];if(ne!==void 0&&ne.length>0)for(var re=0;ne[re]&&re<ne.length;re++)ne[re](t.selectedDates,t.input.value,t,z);R==="onChange"&&(t.input.dispatchEvent(Ce("change")),t.input.dispatchEvent(Ce("input")))}}function Ce(R){var z=document.createEvent("Event");return z.initEvent(R,!0,!0),z}function Be(R){for(var z=0;z<t.selectedDates.length;z++){var ne=t.selectedDates[z];if(ne instanceof Date&&An(ne,R)===0)return""+z}return!1}function ot(R){return t.config.mode!=="range"||t.selectedDates.length<2?!1:An(R,t.selectedDates[0])>=0&&An(R,t.selectedDates[1])<=0}function rt(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(R,z){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+z),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[z].textContent=Po(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),R.value=ne.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 Ht(R){var z=R||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,z)}).filter(function(ne,re,Ae){return t.config.mode!=="range"||t.config.enableTime||Ae.indexOf(ne)===re}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Ct(R){R===void 0&&(R=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=Ht(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=Ht(t.config.altFormat)),R!==!1&&Je("onValueUpdate")}function ft(R){var z=En(R),ne=t.prevMonthNav.contains(z),re=t.nextMonthNav.contains(z);ne||re?be(ne?-1:1):t.yearElements.indexOf(z)>=0?z.select():z.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):z.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function xt(R){R.preventDefault();var z=R.type==="keydown",ne=En(R),re=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Hn(t.amPM.textContent===t.l10n.amPM[0])]);var Ae=parseFloat(re.getAttribute("min")),le=parseFloat(re.getAttribute("max")),de=parseFloat(re.getAttribute("step")),ke=parseInt(re.value,10),fe=R.delta||(z?R.which===38?1:-1:0),he=ke+de*fe;if(typeof re.value<"u"&&re.value.length===2){var Ie=re===t.hourElement,ht=re===t.minuteElement;he<Ae?(he=le+he+Hn(!Ie)+(Hn(Ie)&&Hn(!t.amPM)),ht&&$(void 0,-1,t.hourElement)):he>le&&(he=re===t.hourElement?he-le-Hn(!t.amPM):Ae,ht&&$(void 0,1,t.hourElement)),t.amPM&&Ie&&(de===1?he+ke===23:Math.abs(he-ke)>de)&&(t.amPM.textContent=t.l10n.amPM[Hn(t.amPM.textContent===t.l10n.amPM[0])]),re.value=bn(he)}}return s(),t}function ws(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],s=0;s<t.length;s++){var l=t[s];try{if(l.getAttribute("data-fp-omit")!==null)continue;l._flatpickr!==void 0&&(l._flatpickr.destroy(),l._flatpickr=void 0),l._flatpickr=mS(l,e||{}),i.push(l._flatpickr)}catch(o){console.error(o)}}return i.length===1?i[0]:i}typeof HTMLElement<"u"&&typeof HTMLCollection<"u"&&typeof NodeList<"u"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(n){return ws(this,n)},HTMLElement.prototype.flatpickr=function(n){return ws([this],n)});var Jt=function(n,e){return typeof n=="string"?ws(window.document.querySelectorAll(n),e):n instanceof Node?ws([n],e):ws(n,e)};Jt.defaultConfig={};Jt.l10ns={en:an({},hl),default:an({},hl)};Jt.localize=function(n){Jt.l10ns.default=an(an({},Jt.l10ns.default),n)};Jt.setDefaults=function(n){Jt.defaultConfig=an(an({},Jt.defaultConfig),n)};Jt.parseDate=la({});Jt.formatDate=V_({});Jt.compareDates=An;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return ws(this,n)});Date.prototype.fp_incr=function(n){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof n=="string"?parseInt(n,10):n))};typeof window<"u"&&(window.flatpickr=Jt);function gS(n){let e,t=[n[1]],i={};for(let s=0;s<t.length;s+=1)i=at(i,t[s]);return{c(){e=_("input"),di(e,i)},m(s,l){w(s,e,l),e.autofocus&&e.focus(),n[11](e)},p(s,l){di(e,i=pn(t,[l&2&&s[1]]))},d(s){s&&k(e),n[11](null)}}}function _S(n){let e;const t=n[10].default,i=wn(t,n,n[9],null),s=i||gS(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)&&Sn(i,t,l,l[9],e?$n(t,l[9],o,null):Cn(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 bS(n){return n.charAt(2).toLowerCase()+n.substring(3)}function vS(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let s=Bt(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,h=!1,{input:g=void 0,flatpickr:v=void 0}=e;Jn(()=>{const $=f||g,M=y(d);return M.onReady.push(()=>{t(8,h=!0)}),t(3,v=Jt($,Object.assign(M,f?{wrap:!0}:{}))),()=>{v.destroy()}});const b=on();function y($={}){$=Object.assign({},$);for(const M of r){const D=(E,O,L)=>{b(bS(M),[E,O,L])};M in $?(Array.isArray($[M])||($[M]=[$[M]]),$[M].push(D)):$[M]=[D]}return $.onChange&&!$.onChange.includes(C)&&$.onChange.push(C),$}function C($,M,D){var O,L;const E=(L=(O=D==null?void 0:D.config)==null?void 0:O.mode)!=null?L:"single";t(2,a=E==="single"?$[0]:$),t(4,u=M)}function S($){pe[$?"unshift":"push"](()=>{g=$,t(0,g)})}return n.$$set=$=>{e=at(at({},e),ni($)),t(1,s=Bt(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,g=$.input),"flatpickr"in $&&t(3,v=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&v&&h&&v.setDate(a,!1,c),n.$$.dirty&392&&v&&h)for(const[$,M]of Object.entries(y(d)))v.set($,M)},[g,s,a,v,u,f,c,d,h,o,l,S]}class Ka extends Ee{constructor(e){super(),Oe(this,e,vS,_S,De,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function yS(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 Ka({props:u}),pe.push(()=>Fe(l,"formattedValue",a)),{c(){e=_("label"),t=F("Min date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].min),!o&&c&1&&(o=!0,d.formattedValue=f[0].min,He(()=>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),q(l,f)}}}function kS(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 Ka({props:u}),pe.push(()=>Fe(l,"formattedValue",a)),{c(){e=_("label"),t=F("Max date (UTC)"),s=T(),V(l.$$.fragment),p(e,"for",i=n[4])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&16&&i!==(i=f[4]))&&p(e,"for",i);const d={};c&16&&(d.id=f[4]),c&1&&(d.value=f[0].max),!o&&c&1&&(o=!0,d.formattedValue=f[0].max,He(()=>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),q(l,f)}}}function wS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[yS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[kS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(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),q(i),q(o)}}}function $S(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 SS extends Ee{constructor(e){super(),Oe(this,e,$S,wS,De,{key:1,options:0})}}function CS(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 cs({props:c}),pe.push(()=>Fe(l,"value",f)),{c(){e=_("label"),t=F("Choices"),s=T(),V(l.$$.fragment),r=T(),a=_("div"),a.textContent="Use comma as separator.",p(e,"for",i=n[4]),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),j(l,d,h),w(d,r,h),w(d,a,h),u=!0},p(d,h){(!u||h&16&&i!==(i=d[4]))&&p(e,"for",i);const g={};h&16&&(g.id=d[4]),!o&&h&1&&(o=!0,g.value=d[0].values,He(()=>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),q(l,d),d&&k(r),d&&k(a)}}}function MS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[4]),p(l,"type","number"),p(l,"id",o=n[4]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&16&&i!==(i=u[4])&&p(e,"for",i),f&16&&o!==(o=u[4])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.values",$$slots:{default:[CS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[MS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(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),q(i),q(o)}}}function DS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.values,r)&&(s.values=r,t(0,s))}function o(){s.maxSelect=Pt(this.value),t(0,s)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s={maxSelect:1,values:[]})},[s,i,l,o]}class OS extends Ee{constructor(e){super(),Oe(this,e,DS,TS,De,{key:1,options:0})}}function ES(n,e,t){return["",{}]}class AS extends Ee{constructor(e){super(),Oe(this,e,ES,null,De,{key:0,options:1})}get key(){return this.$$.ctx[0]}get options(){return this.$$.ctx[1]}}function PS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max file size (bytes)"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min","0")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSize),r||(a=G(l,"input",n[2]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSize&&Te(l,u[0].maxSize)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function LS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max files"),s=T(),l=_("input"),p(e,"for",i=n[10]),p(l,"type","number"),p(l,"id",o=n[10]),p(l,"step","1"),p(l,"min",""),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function IS(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>',p(e,"tabindex","0"),p(e,"class","dropdown-item closable"),p(i,"tabindex","0"),p(i,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable"),p(r,"tabindex","0"),p(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,Ge(u)}}}function FS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[4](O)}let E={id:n[10],placeholder:"eg. image/png, application/pdf..."};return n[0].mimeTypes!==void 0&&(E.value=n[0].mimeTypes),r=new cs({props:E}),pe.push(()=>Fe(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-nowrap",$$slots:{default:[IS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Mime types",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Choose presets",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:`Allow files ONLY with the listed mime types.
|
||
Leave empty for no restriction.`,position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].mimeTypes,He(()=>a=!1)),r.$set(I);const N={};L&2049&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function NS(n){let e;return{c(){e=_("ul"),e.innerHTML=`<li><strong>WxH</strong>
|
||
(eg. 100x50) - crop to WxH viewbox (from center)</li>
|
||
<li><strong>WxHt</strong>
|
||
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
|
||
<li><strong>WxHb</strong>
|
||
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
|
||
<li><strong>WxHf</strong>
|
||
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
|
||
<li><strong>0xH</strong>
|
||
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
|
||
<li><strong>Wx0</strong>
|
||
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function RS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M;function D(O){n[9](O)}let E={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(E.value=n[0].thumbs),r=new cs({props:E}),pe.push(()=>Fe(r,"value",D)),C=new Mi({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[NS]},$$scope:{ctx:n}}}),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),c=_("span"),c.textContent="Use comma as separator.",d=T(),h=_("button"),g=_("span"),g.textContent="Supported formats",v=T(),b=_("i"),y=T(),V(C.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(b,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,L){w(O,e,L),m(e,t),m(e,i),m(e,s),w(O,o,L),j(r,O,L),w(O,u,L),w(O,f,L),m(f,c),m(f,d),m(f,h),m(h,g),m(h,v),m(h,b),m(h,y),j(C,h,null),S=!0,$||(M=Ye(wt.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(O,L){(!S||L&1024&&l!==(l=O[10]))&&p(e,"for",l);const I={};L&1024&&(I.id=O[10]),!a&&L&1&&(a=!0,I.value=O[0].thumbs,He(()=>a=!1)),r.$set(I);const N={};L&2048&&(N.$$scope={dirty:L,ctx:O}),C.$set(N)},i(O){S||(A(r.$$.fragment,O),A(C.$$.fragment,O),S=!0)},o(O){P(r.$$.fragment,O),P(C.$$.fragment,O),S=!1},d(O){O&&k(e),O&&k(o),q(r,O),O&&k(u),O&&k(f),q(C),$=!1,M()}}}function HS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[PS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[LS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[FS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[RS,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(g,v){w(g,e,v),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),h=!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 C={};v&2&&(C.name="schema."+g[1]+".options.mimeTypes"),v&3073&&(C.$$scope={dirty:v,ctx:g}),u.$set(C);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){h||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),h=!1},d(g){g&&k(e),q(i),q(o),q(u),q(d)}}}function jS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=Pt(this.value),t(0,s)}function o(){s.maxSelect=Pt(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,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(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.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 qS extends Ee{constructor(e){super(),Oe(this,e,jS,HS,De,{key:1,options:0})}}function VS(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 fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Collection"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(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,He(()=>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),q(l,f)}}}function zS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","number"),p(l,"id",o=n[9]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function BS(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 fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on relation delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[9])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&512&&i!==(i=f[9]))&&p(e,"for",i);const d={};c&512&&(d.id=f[9]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>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),q(l,f)}}}function US(n){let e,t,i,s,l,o,r,a,u,f;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.collectionId",$$slots:{default:[VS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[zS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[BS,({uniqueId:c})=>({9:c}),({uniqueId:c})=>c?512:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-9"),p(l,"class","col-sm-3"),p(a,"class","col-sm-12"),p(e,"class","grid")},m(c,d){w(c,e,d),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),f=!0},p(c,[d]){const h={};d&2&&(h.name="schema."+c[1]+".options.collectionId"),d&1549&&(h.$$scope={dirty:d,ctx:c}),i.$set(h);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),q(i),q(o),q(u)}}}function WS(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),we.collections.getFullList(200,{sort:"-created"}).then(d=>{t(3,r=d)}).catch(d=>{we.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=Pt(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 YS extends Ee{constructor(e){super(),Oe(this,e,WS,US,De,{key:1,options:0})}}function KS(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Max select"),s=T(),l=_("input"),p(e,"for",i=n[5]),p(l,"type","number"),p(l,"id",o=n[5]),p(l,"step","1"),p(l,"min","1"),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].maxSelect),r||(a=G(l,"input",n[3]),r=!0)},p(u,f){f&32&&i!==(i=u[5])&&p(e,"for",i),f&32&&o!==(o=u[5])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].maxSelect&&Te(l,u[0].maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function JS(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 fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("Delete record on user delete"),s=T(),V(l.$$.fragment),p(e,"for",i=n[5])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&32&&i!==(i=f[5]))&&p(e,"for",i);const d={};c&32&&(d.id=f[5]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].cascadeDelete,He(()=>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),q(l,f)}}}function ZS(n){let e,t,i,s,l,o,r;return i=new Re({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[KS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[JS,({uniqueId:a})=>({5:a}),({uniqueId:a})=>a?32:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),m(e,t),j(i,t,null),m(e,s),m(e,l),j(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),q(i),q(o)}}}function GS(n,e,t){const i=[{label:"False",value:!1},{label:"True",value:!0}];let{key:s=""}=e,{options:l={}}=e;function o(){l.maxSelect=Pt(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 XS extends Ee{constructor(e){super(),Oe(this,e,GS,ZS,De,{key:1,options:0})}}function QS(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[38],disabled:n[0].id};return n[0].type!==void 0&&(u.value=n[0].type),l=new V$({props:u}),pe.push(()=>Fe(l,"value",a)),{c(){e=_("label"),t=F("Type"),s=T(),V(l.$$.fragment),p(e,"for",i=n[38])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c[1]&128&&i!==(i=f[38]))&&p(e,"for",i);const d={};c[1]&128&&(d.id=f[38]),c[0]&1&&(d.disabled=f[0].id),!o&&c[0]&1&&(o=!0,d.value=f[0].type,He(()=>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),q(l,f)}}}function Nc(n){let e,t,i;return{c(){e=_("span"),e.textContent="Duplicated or invalid name",p(e,"class","txt invalid-name-note svelte-1tpxlm5")},m(s,l){w(s,e,l),i=!0},i(s){i||(Tt(()=>{t||(t=it(e,Un,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){t||(t=it(e,Un,{duration:150,x:5},!1)),t.run(0),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function xS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[5]&&Nc();return{c(){e=_("label"),t=_("span"),t.textContent="Name",i=T(),g&&g.c(),l=T(),o=_("input"),p(t,"class","txt"),p(e,"for",s=n[38]),p(o,"type","text"),p(o,"id",r=n[38]),o.required=!0,o.disabled=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,o.value=f=n[0].name},m(v,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||(h=G(o,"input",n[17]),d=!0)},p(v,b){v[5]?g&&(Pe(),P(g,1,1,()=>{g=null}),Le()):g?b[0]&32&&A(g,1):(g=Nc(),g.c(),A(g,1),g.m(e,null)),(!c||b[1]&128&&s!==(s=v[38]))&&p(e,"for",s),(!c||b[1]&128&&r!==(r=v[38]))&&p(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,h()}}}function e3(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 XS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function t3(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 YS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function n3(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 qS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function i3(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 AS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function s3(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 OS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function l3(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 SS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function o3(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 uS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function r3(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 j_({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function a3(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 eS({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function u3(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 Q$({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function f3(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 K$({props:l}),pe.push(()=>Fe(e,"options",s)),{c(){V(e.$$.fragment)},m(o,r){j(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,He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function c3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Required"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},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]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].required),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Rc(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle m-0",name:"unique",$$slots:{default:[d3,({uniqueId:i})=>({38:i}),({uniqueId:i})=>[0,i?128:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1|s[1]&384&&(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){q(e,i)}}}function d3(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[38]),p(s,"for",o=n[38])},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]&128&&t!==(t=u[38])&&p(e,"id",t),f[0]&1&&(e.checked=u[0].unique),f[1]&128&&o!==(o=u[38])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Hc(n){let e,t,i,s,l,o,r,a,u,f;a=new Mi({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[p3]},$$scope:{ctx:n}}});let c=n[8]&&jc(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),l=_("button"),o=_("i"),r=T(),V(a.$$.fragment),u=T(),c&&c.c(),p(t,"class","flex-fill"),p(o,"class","ri-more-line"),p(l,"type","button"),p(l,"class","btn btn-circle btn-sm btn-secondary"),p(s,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","col-sm-4 txt-right")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),m(l,o),m(l,r),j(a,l,null),m(s,u),c&&c.m(s,null),f=!0},p(d,h){const g={};h[1]&256&&(g.$$scope={dirty:h,ctx:d}),a.$set(g),d[8]?c?c.p(d,h):(c=jc(d),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},i(d){f||(A(a.$$.fragment,d),f=!0)},o(d){P(a.$$.fragment,d),f=!1},d(d){d&&k(e),q(a),c&&c.d()}}}function p3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-right")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[9]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function jc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Done</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-outline btn-expanded-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[3])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function h3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D;s=new Re({props:{class:"form-field required "+(n[0].id?"disabled":""),name:"schema."+n[1]+".type",$$slots:{default:[QS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:`
|
||
form-field
|
||
required
|
||
`+(n[5]?"":"invalid")+`
|
||
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||
`,name:"schema."+n[1]+".name",$$slots:{default:[xS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const E=[f3,u3,a3,r3,o3,l3,s3,i3,n3,t3,e3],O=[];function L(B,U){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=L(n))&&(c=O[f]=E[f](n)),g=new Re({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[c3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let I=n[0].type!=="file"&&Rc(n),N=!n[0].toDelete&&Hc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(g.$$.fragment),v=T(),b=_("div"),I&&I.c(),y=T(),N&&N.c(),C=T(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(B,U){w(B,e,U),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(r,o,null),m(t,a),m(t,u),~f&&O[f].m(u,null),m(t,d),m(t,h),j(g,h,null),m(t,v),m(t,b),I&&I.m(b,null),m(t,y),N&&N.m(t,null),m(e,C),m(e,S),$=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(B,U){const ee={};U[0]&1&&(ee.class="form-field required "+(B[0].id?"disabled":"")),U[0]&2&&(ee.name="schema."+B[1]+".type"),U[0]&1|U[1]&384&&(ee.$$scope={dirty:U,ctx:B}),s.$set(ee);const K={};U[0]&33&&(K.class=`
|
||
form-field
|
||
required
|
||
`+(B[5]?"":"invalid")+`
|
||
`+(B[0].id&&B[0].system?"disabled":"")+`
|
||
`),U[0]&2&&(K.name="schema."+B[1]+".name"),U[0]&33|U[1]&384&&(K.$$scope={dirty:U,ctx:B}),r.$set(K);let se=f;f=L(B),f===se?~f&&O[f].p(B,U):(c&&(Pe(),P(O[se],1,1,()=>{O[se]=null}),Le()),~f?(c=O[f],c?c.p(B,U):(c=O[f]=E[f](B),c.c()),A(c,1),c.m(u,null)):c=null);const Y={};U[0]&1|U[1]&384&&(Y.$$scope={dirty:U,ctx:B}),g.$set(Y),B[0].type!=="file"?I?(I.p(B,U),U[0]&1&&A(I,1)):(I=Rc(B),I.c(),A(I,1),I.m(b,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),B[0].toDelete?N&&(Pe(),P(N,1,1,()=>{N=null}),Le()):N?(N.p(B,U),U[0]&1&&A(N,1)):(N=Hc(B),N.c(),A(N,1),N.m(t,null))},i(B){$||(A(s.$$.fragment,B),A(r.$$.fragment,B),A(c),A(g.$$.fragment,B),A(I),A(N),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(g.$$.fragment,B),P(I),P(N),$=!1},d(B){B&&k(e),q(s),q(r),~f&&O[f].d(),q(g),I&&I.d(),N&&N.d(),M=!1,D()}}}function qc(n){let e,t,i,s,l=n[0].system&&Vc(),o=!n[0].id&&zc(n),r=n[0].required&&Bc(),a=n[0].unique&&Uc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),p(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=Vc(),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=zc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Bc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=Uc(),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 Vc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ie(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ie(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Bc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Uc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Yc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[15])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function m3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,g,v,b,y=!n[0].toDelete&&qc(n),C=n[7]&&!n[0].system&&Wc(),S=n[0].toDelete&&Yc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=F(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),C&&C.c(),g=T(),S&&S.c(),v=Ke(),p(i,"class",s=Xa(W.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ie(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),m(e,t),m(t,i),m(e,l),m(e,o),m(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),C&&C.m($,M),w($,g,M),S&&S.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Xa(W.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ue(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=qc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?C?M[0]&129&&A(C,1):(C=Wc(),C.c(),A(C,1),C.m(g.parentNode,g)):C&&(Pe(),P(C,1,1,()=>{C=null}),Le()),$[0].toDelete?S?S.p($,M):(S=Yc($),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i($){b||(A(C),b=!0)},o($){P(C),b=!1},d($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),C&&C.d($),$&&k(g),S&&S.d($),$&&k(v)}}}function g3(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:[m3],default:[h3]},$$scope:{ctx:n}};return e=new Xo({props:i}),n[32](e),e.$on("expand",n[33]),e.$on("collapse",n[34]),e.$on("toggle",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(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]&256&&(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),q(e,s)}}}function _3(n,e,t){let i,s,l,o,r;bt(n,qi,H=>t(14,r=H));const a=on();let{key:u="0"}=e,{field:f=new Dn}=e,{disabled:c=!1}=e,{excludeNames:d=[]}=e,h,g=f.type;function v(){h==null||h.expand()}function b(){h==null||h.collapse()}function y(){f.id?t(0,f.toDelete=!0,f):(b(),a("remove"))}function C(H){if(H=(""+H).toLowerCase(),!H)return!1;for(const me of d)if(me.toLowerCase()===H)return!1;return!0}function S(H){return W.slugify(H)}Jn(()=>{f.id||v()});const $=()=>{t(0,f.toDelete=!1,f)};function M(H){n.$$.not_equal(f.type,H)&&(f.type=H,t(0,f),t(13,g),t(4,h))}const D=H=>{t(0,f.name=S(H.target.value),f),H.target.value=f.name};function E(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function O(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function L(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function I(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function N(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function B(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function U(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function ee(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function K(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function se(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function Y(H){n.$$.not_equal(f.options,H)&&(f.options=H,t(0,f),t(13,g),t(4,h))}function te(){f.required=this.checked,t(0,f),t(13,g),t(4,h)}function J(){f.unique=this.checked,t(0,f),t(13,g),t(4,h)}const _e=()=>{i&&b()};function be(H){pe[H?"unshift":"push"](()=>{h=H,t(4,h)})}function X(H){st.call(this,n,H)}function ae(H){st.call(this,n,H)}function ve(H){st.call(this,n,H)}return n.$$set=H=>{"key"in H&&t(1,u=H.key),"field"in H&&t(0,f=H.field),"disabled"in H&&t(2,c=H.disabled),"excludeNames"in H&&t(11,d=H.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&&(h&&b(),f.originalName&&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||h&&v()),n.$$.dirty[0]&69&&t(8,s=!c&&!f.system&&!f.toDelete&&i),n.$$.dirty[0]&1&&t(5,l=C(f.name)),n.$$.dirty[0]&16418&&t(7,o=!l||!W.isEmpty(W.getNestedVal(r,`schema.${u}`)))},[f,u,c,b,h,l,i,o,s,y,S,d,v,g,r,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve]}class b3 extends Ee{constructor(e){super(),Oe(this,e,_3,g3,De,{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 Kc(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function Jc(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 b3({props:a}),pe.push(()=>Fe(i,"field",o)),i.$on("remove",r),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(u,f){w(u,t,f),j(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],He(()=>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),q(i,u)}}}function v3(n){let e,t=[],i=new Map,s,l,o,r,a,u,f,c,d,h,g,v=n[0].schema;const b=y=>y[11];for(let y=0;y<v.length;y+=1){let C=Kc(n,v,y),S=b(C);i.set(S,t[y]=Jc(S,C))}return{c(){var y;e=_("div");for(let C=0;C<t.length;C+=1)t[C].c();s=T(),l=_("div"),o=T(),r=_("button"),a=_("i"),u=T(),f=_("span"),f.textContent="New field",p(e,"class","accordions"),p(l,"class","clearfix m-t-xs"),p(a,"class","ri-add-line"),p(f,"class","txt"),p(r,"type","button"),p(r,"class",c="btn btn-block "+((y=n[0].schema)!=null&&y.length?"btn-secondary":"btn-success"))},m(y,C){w(y,e,C);for(let S=0;S<t.length;S+=1)t[S].m(e,null);w(y,s,C),w(y,l,C),w(y,o,C),w(y,r,C),m(r,a),m(r,u),m(r,f),d=!0,h||(g=G(r,"click",n[3]),h=!0)},p(y,[C]){var S;C&23&&(v=y[0].schema,Pe(),t=yt(t,C,b,1,y,v,i,e,Zt,Jc,null,Kc),Le()),(!d||C&1&&c!==(c="btn btn-block "+((S=y[0].schema)!=null&&S.length?"btn-secondary":"btn-success")))&&p(r,"class",c)},i(y){if(!d){for(let C=0;C<v.length;C+=1)A(t[C]);d=!0}},o(y){for(let C=0;C<t.length;C+=1)P(t[C]);d=!1},d(y){y&&k(e);for(let C=0;C<t.length;C+=1)t[C].d();y&&k(s),y&&k(l),y&&k(o),y&&k(r),h=!1,g()}}}function y3(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 Dn({name:r()});s.schema.push(d),t(0,s)}function r(d="field"){let h="";for(;a(d+h);)++h;return d+h}function a(d){return!!s.schema.find(h=>h.name===d)}function u(d){let h=[];if(d.toDelete)return h;for(let g of s.schema)g===d||g.toDelete||h.push(g.name);return h}function f(d,h,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 k3 extends Ee{constructor(e){super(),Oe(this,e,y3,v3,De,{collection:0})}}function Zc(n,e,t){const i=n.slice();return i[13]=e[t][0],i[14]=e[t][1],i[15]=e,i[16]=t,i}function Gc(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K=n[0].schema,se=[];for(let Y=0;Y<K.length;Y+=1)se[Y]=Qc(Gc(n,K,Y));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 Y=0;Y<se.length;Y+=1)se[Y].c();h=T(),g=_("hr"),v=T(),b=_("p"),b.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",y=T(),C=_("div"),C.innerHTML=`<code>@request.method</code>
|
||
<code>@request.query.*</code>
|
||
<code>@request.data.*</code>
|
||
<code>@request.user.*</code>`,S=T(),$=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",E=T(),O=_("div"),O.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",L=T(),I=_("hr"),N=T(),B=_("p"),B.innerHTML=`Example rule:
|
||
<br/>
|
||
<code>@request.user.id!="" && created>"2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(C,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(O,"class","inline-flex flex-gap-5"),p(I,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(Y,te){w(Y,e,te),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 J=0;J<se.length;J+=1)se[J].m(o,null);m(i,h),m(i,g),m(i,v),m(i,b),m(i,y),m(i,C),m(i,S),m(i,$),m(i,M),m(i,D),m(i,E),m(i,O),m(i,L),m(i,I),m(i,N),m(i,B),ee=!0},p(Y,te){if(te&1){K=Y[0].schema;let J;for(J=0;J<K.length;J+=1){const _e=Gc(Y,K,J);se[J]?se[J].p(_e,te):(se[J]=Qc(_e),se[J].c(),se[J].m(o,null))}for(;J<se.length;J+=1)se[J].d(1);se.length=K.length}},i(Y){ee||(Y&&Tt(()=>{U||(U=it(e,tn,{duration:150},!0)),U.run(1)}),ee=!0)},o(Y){Y&&(U||(U=it(e,tn,{duration:150},!1)),U.run(0)),ee=!1},d(Y){Y&&k(e),Qt(se,Y),Y&&U&&U.end()}}}function w3(n){let e,t=n[18].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&1&&t!==(t=s[18].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function $3(n){let e,t=n[18].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),m(e,i),m(e,s)},p(l,o){o&1&&t!==(t=l[18].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function Qc(n){let e;function t(l,o){return l[18].type==="relation"||l[18].type==="user"?$3:w3}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 S3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[13];for(let r=0;r<l.length;r+=1){let a=Zc(n,l,r),u=o(a);t.set(u,e[r]=xc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Ke()},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&131163&&(l=Object.entries(r[6]),Pe(),e=yt(e,a,o,1,r,l,t,i.parentNode,Zt,xc,i,Zc),Le())},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 C3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function M3(n){let e,t,i;function s(){return n[9](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.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,Ge(i)}}}function T3(n){let e,t,i;function s(){return n[8](n[13])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(wt.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,Ge(i)}}}function D3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function O3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function E3(n){let e,t=n[14]+"",i,s,l=Li(n[0][n[13]])?"Admins only":"Custom rule",o,r,a,u,f=n[13],c,d,h,g,v;const b=()=>n[10](u,f),y=()=>n[10](null,f);function C(O){n[11](O,n[13])}var S=n[4];function $(O){let L={id:O[17],baseCollection:O[0],disabled:Li(O[0][O[13]])};return O[0][O[13]]!==void 0&&(L.value=O[0][O[13]]),{props:L}}S&&(u=new S($(n)),b(),pe.push(()=>Fe(u,"value",C)));function M(O,L){return L&1&&(g=null),g==null&&(g=!!Li(O[0][O[13]])),g?O3:D3}let D=M(n,-1),E=D(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),E.c(),p(e,"for",r=n[17]),p(h,"class","help-block")},m(O,L){w(O,e,L),m(e,i),m(e,s),m(e,o),w(O,a,L),u&&j(u,O,L),w(O,d,L),w(O,h,L),E.m(h,null),v=!0},p(O,L){n=O,(!v||L&1)&&l!==(l=Li(n[0][n[13]])?"Admins only":"Custom rule")&&ue(o,l),(!v||L&131072&&r!==(r=n[17]))&&p(e,"for",r),f!==n[13]&&(y(),f=n[13],b());const I={};if(L&131072&&(I.id=n[17]),L&1&&(I.baseCollection=n[0]),L&1&&(I.disabled=Li(n[0][n[13]])),!c&&L&65&&(c=!0,I.value=n[0][n[13]],He(()=>c=!1)),S!==(S=n[4])){if(u){Pe();const N=u;P(N.$$.fragment,1,0,()=>{q(N,1)}),Le()}S?(u=new S($(n)),b(),pe.push(()=>Fe(u,"value",C)),V(u.$$.fragment),A(u.$$.fragment,1),j(u,d.parentNode,d)):u=null}else S&&u.$set(I);D!==(D=M(n,L))&&(E.d(1),E=D(n),E&&(E.c(),E.m(h,null)))},i(O){v||(u&&A(u.$$.fragment,O),v=!0)},o(O){u&&P(u.$$.fragment,O),v=!1},d(O){O&&k(e),O&&k(a),y(),u&&q(u,O),O&&k(d),O&&k(h),E.d()}}}function xc(n,e){let t,i,s,l,o,r,a,u;function f(h,g){return g&1&&(l=null),l==null&&(l=!!Li(h[0][h[13]])),l?T3:M3}let c=f(e,-1),d=c(e);return r=new Re({props:{class:"form-field rule-field m-0 "+(Li(e[0][e[13]])?"disabled":""),name:e[13],$$slots:{default:[E3,({uniqueId:h})=>({17:h}),({uniqueId:h})=>h?131072:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=_("hr"),i=T(),s=_("div"),d.c(),o=T(),V(r.$$.fragment),a=T(),p(t,"class","m-t-sm m-b-sm"),p(s,"class","rule-block svelte-fjxz7k"),this.first=t},m(h,g){w(h,t,g),w(h,i,g),w(h,s,g),d.m(s,null),m(s,o),j(r,s,null),m(s,a),u=!0},p(h,g){e=h,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 "+(Li(e[0][e[13]])?"disabled":"")),g&2228249&&(v.$$scope={dirty:g,ctx:e}),r.$set(v)},i(h){u||(A(r.$$.fragment,h),u=!0)},o(h){P(r.$$.fragment,h),u=!1},d(h){h&&k(t),h&&k(i),h&&k(s),d.d(),q(r)}}}function A3(n){let e,t,i,s,l,o=n[2]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,v,b=n[2]&&Xc(n);const y=[C3,S3],C=[];function S($,M){return $[5]?0:1}return f=S(n),c=C[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=F(o),a=T(),b&&b.c(),u=T(),c.c(),d=Ke(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,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($,u,M),C[f].m($,M),w($,d,M),h=!0,g||(v=G(l,"click",n[7]),g=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&A(b,1)):(b=Xc($),b.c(),A(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=S($),f===D?C[f].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),c=C[f],c?c.p($,M):(c=C[f]=y[f]($),c.c()),A(c,1),c.m(d.parentNode,d))},i($){h||(A(b),A(c),h=!0)},o($){P(b),P(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),C[f].d($),$&&k(d),g=!1,v()}}}function Li(n){return n===null}function P3(n,e,t){let{collection:i=new fn}=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 Ai(()=>import("./FilterAutocompleteInput.9df887af.js"),["FilterAutocompleteInput.9df887af.js","index.afc1faa1.js"],import.meta.url)).default)}catch(b){console.warn(b),t(4,r=null)}t(5,a=!1)}Jn(()=>{f()});const c=()=>t(2,l=!l),d=async b=>{var y;t(0,i[b]=s[b]||"",i),await ii(),(y=o[b])==null||y.focus()},h=b=>{t(1,s[b]=i[b],s),t(0,i[b]=null,i)};function g(b,y){pe[b?"unshift":"push"](()=>{o[y]=b,t(3,o)})}function v(b,y){n.$$.not_equal(i[y],b)&&(i[y]=b,t(0,i))}return n.$$set=b=>{"collection"in b&&t(0,i=b.collection)},[i,s,l,o,r,a,u,c,d,h,g,v]}class L3 extends Ee{constructor(e){super(),Oe(this,e,P3,A3,De,{collection:0})}}function ed(n,e,t){const i=n.slice();return i[14]=e[t],i}function td(n,e,t){const i=n.slice();return i[14]=e[t],i}function nd(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 id(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=F(`Renamed collection
|
||
`),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,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(h,g){g&2&&l!==(l=h[1].originalName+"")&&ue(o,l),g&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function sd(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=F(`Renamed field
|
||
`),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,g){w(h,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(h,g){g&16&&l!==(l=h[14].originalName+"")&&ue(o,l),g&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function ld(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=F("Removed field "),i=_("span"),l=F(s),o=T(),p(i,"class","txt-bold"),p(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+"")&&ue(l,s)},d(r){r&&k(e)}}}function I3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&nd(),g=n[5]&&id(n),v=n[4],b=[];for(let S=0;S<v.length;S+=1)b[S]=sd(td(n,v,S));let y=n[3],C=[];for(let S=0;S<y.length;S+=1)C[S]=ld(ed(n,y,S));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(),h&&h.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let S=0;S<b.length;S+=1)b[S].c();d=T();for(let S=0;S<C.length;S+=1)C[S].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(S,$){w(S,e,$),m(e,t),m(e,i),m(e,s),m(s,l),m(s,o),h&&h.m(s,null),w(S,r,$),w(S,a,$),w(S,u,$),w(S,f,$),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<C.length;M+=1)C[M].m(f,null)},p(S,$){if(S[3].length?h||(h=nd(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),S[5]?g?g.p(S,$):(g=id(S),g.c(),g.m(f,c)):g&&(g.d(1),g=null),$&16){v=S[4];let M;for(M=0;M<v.length;M+=1){const D=td(S,v,M);b[M]?b[M].p(D,$):(b[M]=sd(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if($&8){y=S[3];let M;for(M=0;M<y.length;M+=1){const D=ed(S,y,M);C[M]?C[M].p(D,$):(C[M]=ld(D),C[M].c(),C[M].m(f,null))}for(;M<C.length;M+=1)C[M].d(1);C.length=y.length}},d(S){S&&k(e),h&&h.d(),S&&k(r),S&&k(a),S&&k(u),S&&k(f),g&&g.d(),Qt(b,S),Qt(C,S)}}}function F3(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 N3(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,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(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,Ge(l)}}}function R3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[N3],header:[F3],default:[I3]},$$scope:{ctx:n}};return e=new mi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function H3(n,e,t){let i,s,l;const o=on();let r,a;async function u(y){t(1,a=y),await ii(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function g(y){pe[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){st.call(this,n,y)}function b(y){st.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,h,g,v,b]}class j3 extends Ee{constructor(e){super(),Oe(this,e,H3,R3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function od(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 L3({props:o}),pe.push(()=>Fe(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>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),q(t)}}}function q3(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 k3({props:a}),pe.push(()=>Fe(i,"collection",r));let u=n[9]===ml&&od(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===os),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),m(e,t),j(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],He(()=>s=!1)),i.$set(d),c[0]&512&&ie(t,"active",f[9]===os),f[9]===ml?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=od(f),u.c(),A(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},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),q(i),u&&u.d()}}}function rd(n){let e,t,i,s,l,o,r;return o=new Mi({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[V3]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("i"),l=T(),V(o.$$.fragment),p(e,"class","flex-fill"),p(s,"class","ri-more-line"),p(i,"type","button"),p(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),j(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),q(o)}}}function V3(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item 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 ad(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function z3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&ad();return{c(){e=_("label"),t=F("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Ke(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(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),h&&h.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])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(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?h||(h=ad(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),h&&h.d(g),g&&k(f),c=!1,d()}}}function ud(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=wt.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Tt(()=>{i||(i=it(e,Tn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=it(e,Tn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function fd(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function B3(n){var N,B,U,ee,K,se;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,g,v=!W.isEmpty((N=n[4])==null?void 0:N.schema),b,y,C,S,$=!W.isEmpty((B=n[4])==null?void 0:B.listRule)||!W.isEmpty((U=n[4])==null?void 0:U.viewRule)||!W.isEmpty((ee=n[4])==null?void 0:ee.createRule)||!W.isEmpty((K=n[4])==null?void 0:K.updateRule)||!W.isEmpty((se=n[4])==null?void 0:se.deleteRule),M,D,E,O=!n[2].isNew&&!n[2].system&&rd(n);r=new Re({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[z3,({uniqueId:Y})=>({38:Y}),({uniqueId:Y})=>[0,Y?128:0]]},$$scope:{ctx:n}}});let L=v&&ud(n),I=$&&fd();return{c(){e=_("h4"),i=F(t),s=T(),O&&O.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",g=T(),L&&L.c(),b=T(),y=_("button"),C=_("span"),C.textContent="API Rules",S=T(),I&&I.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===os),p(C,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===ml),p(c,"class","tabs-header stretched")},m(Y,te){w(Y,e,te),m(e,i),w(Y,s,te),O&&O.m(Y,te),w(Y,l,te),w(Y,o,te),j(r,o,null),m(o,a),m(o,u),w(Y,f,te),w(Y,c,te),m(c,d),m(d,h),m(d,g),L&&L.m(d,null),m(c,b),m(c,y),m(y,C),m(y,S),I&&I.m(y,null),M=!0,D||(E=[G(o,"submit",Yt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(Y,te){var _e,be,X,ae,ve,H;(!M||te[0]&4)&&t!==(t=Y[2].isNew?"New collection":"Edit collection")&&ue(i,t),!Y[2].isNew&&!Y[2].system?O?(O.p(Y,te),te[0]&4&&A(O,1)):(O=rd(Y),O.c(),A(O,1),O.m(l.parentNode,l)):O&&(Pe(),P(O,1,1,()=>{O=null}),Le());const J={};te[0]&2048&&(J.class="form-field required m-b-0 "+(Y[11]?"disabled":"")),te[0]&2052|te[1]&384&&(J.$$scope={dirty:te,ctx:Y}),r.$set(J),te[0]&16&&(v=!W.isEmpty((_e=Y[4])==null?void 0:_e.schema)),v?L?(L.p(Y,te),te[0]&16&&A(L,1)):(L=ud(Y),L.c(),A(L,1),L.m(d,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),te[0]&512&&ie(d,"active",Y[9]===os),te[0]&16&&($=!W.isEmpty((be=Y[4])==null?void 0:be.listRule)||!W.isEmpty((X=Y[4])==null?void 0:X.viewRule)||!W.isEmpty((ae=Y[4])==null?void 0:ae.createRule)||!W.isEmpty((ve=Y[4])==null?void 0:ve.updateRule)||!W.isEmpty((H=Y[4])==null?void 0:H.deleteRule)),$?I?te[0]&16&&A(I,1):(I=fd(),I.c(),A(I,1),I.m(y,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),te[0]&512&&ie(y,"active",Y[9]===ml)},i(Y){M||(A(O),A(r.$$.fragment,Y),A(L),A(I),M=!0)},o(Y){P(O),P(r.$$.fragment,Y),P(L),P(I),M=!1},d(Y){Y&&k(e),Y&&k(s),O&&O.d(Y),Y&&k(l),Y&&k(o),q(r),Y&&k(f),Y&&k(c),L&&L.d(),I&&I.d(),D=!1,Ge(E)}}}function U3(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=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=a=!n[10]||n[7],ie(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")&&ue(r,o),d[0]&1152&&a!==(a=!c[10]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Ge(f)}}}function W3(n){let e,t,i,s,l={class:"overlay-panel-lg colored-header compact-header collection-panel",beforeHide:n[27],$$slots:{footer:[U3],header:[B3],default:[q3]},$$scope:{ctx:n}};e=new mi({props:l}),n[28](e),e.$on("hide",n[29]),e.$on("show",n[30]);let o={};return i=new j3({props:o}),n[31](i),i.$on("confirm",n[32]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(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),q(e,r),r&&k(t),n[31](null),q(i,r)}}}const os="fields",ml="api_rules";function Tr(n){return JSON.stringify(n)}function Y3(n,e,t){let i,s,l,o,r,a;bt(n,ci,H=>t(34,r=H)),bt(n,qi,H=>t(4,a=H));const u=on();let f,c,d=null,h=new fn,g=!1,v=!1,b=os,y=Tr(h);function C(H){t(9,b=H)}function S(H){return M(H),t(8,v=!0),C(os),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(H){hi({}),typeof H<"u"?(d=H,t(2,h=H==null?void 0:H.clone())):(d=null,t(2,h=new fn)),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await ii(),t(17,y=Tr(h))}function D(){if(h.isNew)return E();c==null||c.show(h)}function E(){if(g)return;t(7,g=!0);const H=O();let me;h.isNew?me=we.collections.create(H):me=we.collections.update(h.id,H),me.then(x=>{t(8,v=!1),$(),cn(h.isNew?"Successfully created collection.":"Successfully updated collection."),m$(x),h.isNew&&dn(ci,r=x,r),u("save",x)}).catch(x=>{we.errorResponseHandler(x)}).finally(()=>{t(7,g=!1)})}function O(){const H=h.export();H.schema=H.schema.slice(0);for(let me=H.schema.length-1;me>=0;me--)H.schema[me].toDelete&&H.schema.splice(me,1);return H}function L(){!(d!=null&&d.id)||pi(`Do you really want to delete collection "${d==null?void 0:d.name}" and all its records?`,()=>we.collections.delete(d==null?void 0:d.id).then(()=>{$(),cn(`Successfully deleted collection "${d==null?void 0:d.name}".`),u("delete",d),g$(d)}).catch(H=>{we.errorResponseHandler(H)}))}const I=()=>$(),N=()=>D(),B=()=>L(),U=H=>{t(2,h.name=W.slugify(H.target.value),h),H.target.value=h.name},ee=()=>{o&&D()},K=()=>C(os),se=()=>C(ml);function Y(H){h=H,t(2,h)}function te(H){h=H,t(2,h)}const J=()=>l&&v?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,v=!1),$()}),!1):!0;function _e(H){pe[H?"unshift":"push"](()=>{f=H,t(5,f)})}function be(H){st.call(this,n,H)}function X(H){st.call(this,n,H)}function ae(H){pe[H?"unshift":"push"](()=>{c=H,t(6,c)})}const ve=()=>E();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=!h.isNew&&h.system),n.$$.dirty[0]&131076&&t(3,l=y!=Tr(h)),n.$$.dirty[0]&12&&t(10,o=h.isNew||l)},[C,$,h,l,a,f,c,g,v,b,o,s,i,D,E,L,S,y,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve]}class Ja extends Ee{constructor(e){super(),Oe(this,e,Y3,W3,De,{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 cd(n,e,t){const i=n.slice();return i[13]=e[t],i}function dd(n){let e,t=n[1].length&&pd();return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[1].length?t||(t=pd(),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function pd(n){let e;return{c(){e=_("p"),e.textContent="No collections found.",p(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 K3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-2-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function J3(n){let e;return{c(){e=_("i"),p(e,"class","ri-folder-open-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hd(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?J3:K3}let c=f(e),d=c(e);function h(){return e[10](e[13])}return{key:n,first:null,c(){var g;t=_("div"),d.c(),i=T(),s=_("span"),o=F(l),r=T(),p(s,"class","txt"),p(t,"tabindex","0"),p(t,"class","sidebar-list-item"),ie(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",h),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+"")&&ue(o,l),v&40&&ie(t,"active",((b=e[5])==null?void 0:b.id)===e[13].id)},d(g){g&&k(t),d.d(),a=!1,u()}}}function Z3(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],h=new Map,g,v,b,y,C,S,$,M,D=n[3];const E=I=>I[13].id;for(let I=0;I<D.length;I+=1){let N=cd(n,D,I),B=E(N);h.set(B,d[I]=hd(B,N))}let O=null;D.length||(O=dd(n));let L={};return C=new Ja({props:L}),n[12](C),{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 I=0;I<d.length;I+=1)d[I].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(),V(C.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ie(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),ie(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(I,N){w(I,e,N),m(e,t),m(t,i),m(i,s),m(s,l),m(i,o),m(i,r),Te(r,n[0]),m(e,a),m(e,u),m(e,f),m(e,c);for(let B=0;B<d.length;B+=1)d[B].m(c,null);O&&O.m(c,null),m(e,g),m(e,v),m(v,b),w(I,y,N),j(C,I,N),S=!0,$||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],$=!0)},p(I,[N]){N&16&&ie(l,"hidden",!I[4]),N&1&&r.value!==I[0]&&Te(r,I[0]),N&16&&ie(i,"active",I[4]),N&106&&(D=I[3],d=yt(d,N,E,1,I,D,h,c,Mn,hd,null,cd),!D.length&&O?O.p(I,N):D.length?O&&(O.d(1),O=null):(O=dd(I),O.c(),O.m(c,null)));const B={};C.$set(B)},i(I){S||(A(C.$$.fragment,I),S=!0)},o(I){P(C.$$.fragment,I),S=!1},d(I){I&&k(e);for(let N=0;N<d.length;N+=1)d[N].d();O&&O.d(),I&&k(y),n[12](null),q(C,I),$=!1,Ge(M)}}}function G3(n,e,t){let i,s,l,o,r;bt(n,ci,b=>t(5,o=b)),bt(n,Ds,b=>t(7,r=b));let a,u="";function f(b){dn(ci,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){pe[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,h,g,v]}class X3 extends Ee{constructor(e){super(),Oe(this,e,G3,Z3,De,{})}}function Q3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze;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=F(` - is one of:
|
||
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),C=_("code"),C.textContent="!=",S=T(),$=_("span"),$.textContent="NOT equal",M=T(),D=_("li"),E=_("code"),E.textContent=">",O=T(),L=_("span"),L.textContent="Greater than",I=T(),N=_("li"),B=_("code"),B.textContent=">=",U=T(),ee=_("span"),ee.textContent="Greater than or equal",K=T(),se=_("li"),Y=_("code"),Y.textContent="<",te=T(),J=_("span"),J.textContent="Less than or equal",_e=T(),be=_("li"),X=_("code"),X.textContent="<=",ae=T(),ve=_("span"),ve.textContent="Less than or equal",H=T(),me=_("li"),x=_("code"),x.textContent="~",Q=T(),Se=_("span"),Se.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||
match)`,je=T(),Ue=_("li"),Z=_("code"),Z.textContent="!~",ge=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||
wildcard match)`,$e=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets
|
||
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(C,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(E,"class","filter-op svelte-1w7s5nw"),p(L,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(ee,"class","txt-hint"),p(Y,"class","filter-op svelte-1w7s5nw"),p(J,"class","txt-hint"),p(X,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(x,"class","filter-op svelte-1w7s5nw"),p(Se,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(et,We){w(et,e,We),w(et,t,We),w(et,i,We),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,h),m(d,g),m(d,v),m(c,b),m(c,y),m(y,C),m(y,S),m(y,$),m(c,M),m(c,D),m(D,E),m(D,O),m(D,L),m(c,I),m(c,N),m(N,B),m(N,U),m(N,ee),m(c,K),m(c,se),m(se,Y),m(se,te),m(se,J),m(c,_e),m(c,be),m(be,X),m(be,ae),m(be,ve),m(c,H),m(c,me),m(me,x),m(me,Q),m(me,Se),m(c,je),m(c,Ue),m(Ue,Z),m(Ue,ge),m(Ue,ce),w(et,$e,We),w(et,Ze,We)},p:oe,i:oe,o:oe,d(et){et&&k(e),et&&k(t),et&&k(i),et&&k($e),et&&k(Ze)}}}class x3 extends Ee{constructor(e){super(),Oe(this,e,null,Q3,De,{})}}function md(n,e,t){const i=n.slice();return i[5]=e[t],i}function gd(n,e,t){const i=n.slice();return i[5]=e[t],i}function _d(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=F(s),o=T(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),m(t,i),m(i,l),m(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function bd(n,e){let t,i,s,l;return i=new _n({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ie(t,"active",e[0]===e[5].language)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function eC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=gd(n,f,g),b=c(v);s.set(b,i[g]=_d(b,v))}let d=n[1];const h=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=md(n,d,g),b=h(v);a.set(b,r[g]=bd(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=T(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(g,v){w(g,e,v),m(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);m(e,l),m(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=yt(i,v,c,1,g,f,s,t,Mn,_d,null,gd)),v&3&&(d=g[1],Pe(),r=yt(r,v,h,1,g,d,a,o,Zt,bd,null,md),Le())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)P(r[v]);u=!1},d(g){g&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const vd="pb_sdk_preference";function tC(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(vd)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(vd,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Ls extends Ee{constructor(e){super(),Oe(this,e,tC,eC,De,{js:2,dart:3})}}function yd(n,e,t){const i=n.slice();return i[6]=e[t],i}function kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function wd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $d(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("div"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].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&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Sd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function nC(n){var gi,Tl,ds,Dl;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je,Ce,Be,ot,rt,Ht,Ct,ft,xt,R,z,ne,re=[],Ae=new Map,le,de,ke=[],fe=new Map,he,Ie=n[1]&&wd();E=new Ls({props:{js:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
// fetch a paginated records list
|
||
const resultList = await client.records.getList('${(gi=n[0])==null?void 0:gi.name}', 1, 50, {
|
||
filter: 'created >= "2022-01-01 00:00:00"',
|
||
});
|
||
|
||
// alternatively you can also fetch all records at once via getFullList:
|
||
const records = await client.records.getFullList('${(Tl=n[0])==null?void 0:Tl.name}', 200 /* batch size */, {
|
||
sort: '-created',
|
||
});
|
||
`,dart:`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
// fetch a paginated records list
|
||
final result = await client.records.getList(
|
||
'${(ds=n[0])==null?void 0:ds.name}',
|
||
page: 1,
|
||
perPage: 50,
|
||
filter: 'created >= "2022-01-01 00:00:00"',
|
||
);
|
||
|
||
// alternatively you can also fetch all records at once via getFullList:
|
||
final records = await client.records.getFullList('${(Dl=n[0])==null?void 0:Dl.name}', batch: 200, sort: '-created');
|
||
`}}),Z=new _n({props:{content:`
|
||
// DESC by created and ASC by id
|
||
?sort=-created,id
|
||
`}}),ze=new _n({props:{content:`
|
||
?filter=(id='abc' && created>'2022-01-01')
|
||
`}}),nt=new x3({}),mt=new _n({props:{content:`
|
||
?expand=rel1,rel2.subrel21.subrel22
|
||
`}});let ht=n[4];const rn=qe=>qe[6].code;for(let qe=0;qe<ht.length;qe+=1){let xe=kd(n,ht,qe),Gt=rn(xe);Ae.set(Gt,re[qe]=$d(Gt,xe))}let jt=n[4];const Ti=qe=>qe[6].code;for(let qe=0;qe<jt.length;qe+=1){let xe=yd(n,jt,qe),Gt=Ti(xe);fe.set(Gt,ke[qe]=Sd(Gt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=T(),Ie&&Ie.c(),d=T(),h=_("div"),g=_("p"),v=F("Fetch a paginated "),b=_("strong"),C=F(y),S=F(" records list."),$=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),V(E.$$.fragment),O=T(),L=_("div"),L.textContent="Query parameters",I=T(),N=_("table"),B=_("thead"),B.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr>`,U=T(),ee=_("tbody"),K=_("tr"),K.innerHTML=`<td>page</td>
|
||
<td><span class="label">Number</span></td>
|
||
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,se=T(),Y=_("tr"),Y.innerHTML=`<td>perPage</td>
|
||
<td><span class="label">Number</span></td>
|
||
<td>Specify the max returned records per page (default to 30).</td>`,te=T(),J=_("tr"),_e=_("td"),_e.textContent="sort",be=T(),X=_("td"),X.innerHTML='<span class="label">String</span>',ae=T(),ve=_("td"),H=F("Specify the records order attribute(s). "),me=_("br"),x=F(`
|
||
Add `),Q=_("code"),Q.textContent="-",Se=F(" / "),je=_("code"),je.textContent="+",Ue=F(` (default) in front of the attribute for DESC / ASC order.
|
||
Ex.:
|
||
`),V(Z.$$.fragment),ge=T(),ce=_("tr"),$e=_("td"),$e.textContent="filter",Ze=T(),et=_("td"),et.innerHTML='<span class="label">String</span>',We=T(),tt=_("td"),Me=F(`Filter the returned records. Ex.:
|
||
`),V(ze.$$.fragment),Xe=T(),V(nt.$$.fragment),ut=T(),ye=_("tr"),Ne=_("td"),Ne.textContent="expand",ct=T(),Dt=_("td"),Dt.innerHTML='<span class="label">String</span>',dt=T(),lt=_("td"),Lt=F(`Auto expand record relations. Ex.:
|
||
`),V(mt.$$.fragment),Nt=F(`
|
||
Supports up to 6-levels depth nested relations expansion. `),Ot=_("br"),Je=F(`
|
||
The expanded relations will be appended to each individual record under the
|
||
`),Ce=_("code"),Ce.textContent="@expand",Be=F(" property (eg. "),ot=_("code"),ot.textContent='"@expand": {"rel1": {...}, ...}',rt=F(`). Only the
|
||
relations that the user has permissions to `),Ht=_("strong"),Ht.textContent="view",Ct=F(" will be expanded."),ft=T(),xt=_("div"),xt.textContent="Responses",R=T(),z=_("div"),ne=_("div");for(let qe=0;qe<re.length;qe+=1)re[qe].c();le=T(),de=_("div");for(let qe=0;qe<ke.length;qe+=1)ke[qe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(L,"class","section-title"),p(N,"class","table-compact table-border m-b-lg"),p(xt,"class","section-title"),p(ne,"class","tabs-header compact left"),p(de,"class","tabs-content"),p(z,"class","tabs")},m(qe,xe){w(qe,e,xe),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),Ie&&Ie.m(e,null),w(qe,d,xe),w(qe,h,xe),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),w(qe,$,xe),w(qe,M,xe),w(qe,D,xe),j(E,qe,xe),w(qe,O,xe),w(qe,L,xe),w(qe,I,xe),w(qe,N,xe),m(N,B),m(N,U),m(N,ee),m(ee,K),m(ee,se),m(ee,Y),m(ee,te),m(ee,J),m(J,_e),m(J,be),m(J,X),m(J,ae),m(J,ve),m(ve,H),m(ve,me),m(ve,x),m(ve,Q),m(ve,Se),m(ve,je),m(ve,Ue),j(Z,ve,null),m(ee,ge),m(ee,ce),m(ce,$e),m(ce,Ze),m(ce,et),m(ce,We),m(ce,tt),m(tt,Me),j(ze,tt,null),m(tt,Xe),j(nt,tt,null),m(ee,ut),m(ee,ye),m(ye,Ne),m(ye,ct),m(ye,Dt),m(ye,dt),m(ye,lt),m(lt,Lt),j(mt,lt,null),m(lt,Nt),m(lt,Ot),m(lt,Je),m(lt,Ce),m(lt,Be),m(lt,ot),m(lt,rt),m(lt,Ht),m(lt,Ct),w(qe,ft,xe),w(qe,xt,xe),w(qe,R,xe),w(qe,z,xe),m(z,ne);for(let Gt=0;Gt<re.length;Gt+=1)re[Gt].m(ne,null);m(z,le),m(z,de);for(let Gt=0;Gt<ke.length;Gt+=1)ke[Gt].m(de,null);he=!0},p(qe,[xe]){var Ol,El,Al,Pl;(!he||xe&1)&&a!==(a=qe[0].name+"")&&ue(u,a),qe[1]?Ie||(Ie=wd(),Ie.c(),Ie.m(e,null)):Ie&&(Ie.d(1),Ie=null),(!he||xe&1)&&y!==(y=qe[0].name+"")&&ue(C,y);const Gt={};xe&9&&(Gt.js=`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${qe[3]}');
|
||
|
||
...
|
||
|
||
// fetch a paginated records list
|
||
const resultList = await client.records.getList('${(Ol=qe[0])==null?void 0:Ol.name}', 1, 50, {
|
||
filter: 'created >= "2022-01-01 00:00:00"',
|
||
});
|
||
|
||
// alternatively you can also fetch all records at once via getFullList:
|
||
const records = await client.records.getFullList('${(El=qe[0])==null?void 0:El.name}', 200 /* batch size */, {
|
||
sort: '-created',
|
||
});
|
||
`),xe&9&&(Gt.dart=`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${qe[3]}');
|
||
|
||
...
|
||
|
||
// fetch a paginated records list
|
||
final result = await client.records.getList(
|
||
'${(Al=qe[0])==null?void 0:Al.name}',
|
||
page: 1,
|
||
perPage: 50,
|
||
filter: 'created >= "2022-01-01 00:00:00"',
|
||
);
|
||
|
||
// alternatively you can also fetch all records at once via getFullList:
|
||
final records = await client.records.getFullList('${(Pl=qe[0])==null?void 0:Pl.name}', batch: 200, sort: '-created');
|
||
`),E.$set(Gt),xe&20&&(ht=qe[4],re=yt(re,xe,rn,1,qe,ht,Ae,ne,Mn,$d,null,kd)),xe&20&&(jt=qe[4],Pe(),ke=yt(ke,xe,Ti,1,qe,jt,fe,de,Zt,Sd,null,yd),Le())},i(qe){if(!he){A(E.$$.fragment,qe),A(Z.$$.fragment,qe),A(ze.$$.fragment,qe),A(nt.$$.fragment,qe),A(mt.$$.fragment,qe);for(let xe=0;xe<jt.length;xe+=1)A(ke[xe]);he=!0}},o(qe){P(E.$$.fragment,qe),P(Z.$$.fragment,qe),P(ze.$$.fragment,qe),P(nt.$$.fragment,qe),P(mt.$$.fragment,qe);for(let xe=0;xe<ke.length;xe+=1)P(ke[xe]);he=!1},d(qe){qe&&k(e),Ie&&Ie.d(),qe&&k(d),qe&&k(h),qe&&k($),qe&&k(M),qe&&k(D),q(E,qe),qe&&k(O),qe&&k(L),qe&&k(I),qe&&k(N),q(Z),q(ze),q(nt),q(mt),qe&&k(ft),qe&&k(xt),qe&&k(R),qe&&k(z);for(let xe=0;xe<re.length;xe+=1)re[xe].d();for(let xe=0;xe<ke.length;xe+=1)ke[xe].d()}}}function iC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[W.dummyCollectionRecord(l),W.dummyCollectionRecord(l)]},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": {}
|
||
}
|
||
`}))},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class sC extends Ee{constructor(e){super(),Oe(this,e,iC,nC,De,{collection:0})}}function Cd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Md(n,e,t){const i=n.slice();return i[6]=e[t],i}function Td(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].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&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Od(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function lC(n){var Ot,Je;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe=[],nt=new Map,ut,ye,Ne=[],ct=new Map,Dt,dt=n[1]&&Td();O=new Ls({props:{js:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
const record = await client.records.getOne('${(Ot=n[0])==null?void 0:Ot.name}', 'RECORD_ID', {
|
||
expand: 'some_relation'
|
||
});
|
||
`,dart:`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
final record = await client.records.getOne('${(Je=n[0])==null?void 0:Je.name}', 'RECORD_ID', query: {
|
||
'expand': 'some_relation',
|
||
});
|
||
`}}),x=new _n({props:{content:`
|
||
?expand=rel1,rel2.subrel21.subrel22
|
||
`}});let lt=n[4];const Lt=Ce=>Ce[6].code;for(let Ce=0;Ce<lt.length;Ce+=1){let Be=Md(n,lt,Ce),ot=Lt(Be);nt.set(ot,Xe[Ce]=Dd(ot,Be))}let mt=n[4];const Nt=Ce=>Ce[6].code;for(let Ce=0;Ce<mt.length;Ce+=1){let Be=Cd(n,mt,Ce),ot=Nt(Be);ct.set(ot,Ne[Ce]=Od(ot,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),dt&&dt.c(),h=T(),g=_("div"),v=_("p"),b=F("Fetch a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),V(O.$$.fragment),L=T(),I=_("div"),I.textContent="Path Parameters",N=T(),B=_("table"),B.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>`,U=T(),ee=_("div"),ee.textContent="Query parameters",K=T(),se=_("table"),Y=_("thead"),Y.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr>`,te=T(),J=_("tbody"),_e=_("tr"),be=_("td"),be.textContent="expand",X=T(),ae=_("td"),ae.innerHTML='<span class="label">String</span>',ve=T(),H=_("td"),me=F(`Auto expand record relations. Ex.:
|
||
`),V(x.$$.fragment),Q=F(`
|
||
Supports up to 6-levels depth nested relations expansion. `),Se=_("br"),je=F(`
|
||
The expanded relations will be appended to the record under the
|
||
`),Ue=_("code"),Ue.textContent="@expand",Z=F(" property (eg. "),ge=_("code"),ge.textContent='"@expand": {"rel1": {...}, ...}',ce=F(`). Only the
|
||
relations that the user has permissions to `),$e=_("strong"),$e.textContent="view",Ze=F(" will be expanded."),et=T(),We=_("div"),We.textContent="Responses",tt=T(),Me=_("div"),ze=_("div");for(let Ce=0;Ce<Xe.length;Ce+=1)Xe[Ce].c();ut=T(),ye=_("div");for(let Ce=0;Ce<Ne.length;Ce+=1)Ne[Ce].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(I,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(We,"class","section-title"),p(ze,"class","tabs-header compact left"),p(ye,"class","tabs-content"),p(Me,"class","tabs")},m(Ce,Be){w(Ce,e,Be),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),dt&&dt.m(e,null),w(Ce,h,Be),w(Ce,g,Be),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Ce,M,Be),w(Ce,D,Be),w(Ce,E,Be),j(O,Ce,Be),w(Ce,L,Be),w(Ce,I,Be),w(Ce,N,Be),w(Ce,B,Be),w(Ce,U,Be),w(Ce,ee,Be),w(Ce,K,Be),w(Ce,se,Be),m(se,Y),m(se,te),m(se,J),m(J,_e),m(_e,be),m(_e,X),m(_e,ae),m(_e,ve),m(_e,H),m(H,me),j(x,H,null),m(H,Q),m(H,Se),m(H,je),m(H,Ue),m(H,Z),m(H,ge),m(H,ce),m(H,$e),m(H,Ze),w(Ce,et,Be),w(Ce,We,Be),w(Ce,tt,Be),w(Ce,Me,Be),m(Me,ze);for(let ot=0;ot<Xe.length;ot+=1)Xe[ot].m(ze,null);m(Me,ut),m(Me,ye);for(let ot=0;ot<Ne.length;ot+=1)Ne[ot].m(ye,null);Dt=!0},p(Ce,[Be]){var rt,Ht;(!Dt||Be&1)&&a!==(a=Ce[0].name+"")&&ue(u,a),Ce[1]?dt||(dt=Td(),dt.c(),dt.m(e,null)):dt&&(dt.d(1),dt=null),(!Dt||Be&1)&&C!==(C=Ce[0].name+"")&&ue(S,C);const ot={};Be&9&&(ot.js=`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${Ce[3]}');
|
||
|
||
...
|
||
|
||
const record = await client.records.getOne('${(rt=Ce[0])==null?void 0:rt.name}', 'RECORD_ID', {
|
||
expand: 'some_relation'
|
||
});
|
||
`),Be&9&&(ot.dart=`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${Ce[3]}');
|
||
|
||
...
|
||
|
||
final record = await client.records.getOne('${(Ht=Ce[0])==null?void 0:Ht.name}', 'RECORD_ID', query: {
|
||
'expand': 'some_relation',
|
||
});
|
||
`),O.$set(ot),Be&20&&(lt=Ce[4],Xe=yt(Xe,Be,Lt,1,Ce,lt,nt,ze,Mn,Dd,null,Md)),Be&20&&(mt=Ce[4],Pe(),Ne=yt(Ne,Be,Nt,1,Ce,mt,ct,ye,Zt,Od,null,Cd),Le())},i(Ce){if(!Dt){A(O.$$.fragment,Ce),A(x.$$.fragment,Ce);for(let Be=0;Be<mt.length;Be+=1)A(Ne[Be]);Dt=!0}},o(Ce){P(O.$$.fragment,Ce),P(x.$$.fragment,Ce);for(let Be=0;Be<Ne.length;Be+=1)P(Ne[Be]);Dt=!1},d(Ce){Ce&&k(e),dt&&dt.d(),Ce&&k(h),Ce&&k(g),Ce&&k(M),Ce&&k(D),Ce&&k(E),q(O,Ce),Ce&&k(L),Ce&&k(I),Ce&&k(N),Ce&&k(B),Ce&&k(U),Ce&&k(ee),Ce&&k(K),Ce&&k(se),q(x),Ce&&k(et),Ce&&k(We),Ce&&k(tt),Ce&&k(Me);for(let Be=0;Be<Xe.length;Be+=1)Xe[Be].d();for(let Be=0;Be<Ne.length;Be+=1)Ne[Be].d()}}}function oC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(W.dummyCollectionRecord(l),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": {}
|
||
}
|
||
`}))},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class rC extends Ee{constructor(e){super(),Oe(this,e,oC,lC,De,{collection:0})}}function Ed(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ad(n,e,t){const i=n.slice();return i[6]=e[t],i}function Pd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ld(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function aC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function uC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},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[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function cC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},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[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function dC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
|
||
Set to `),s=_("code"),s.textContent="null",l=F(" 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 pC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function mC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function _C(n){let e;return{c(){e=F("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[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(E,O){return E[11].required?uC:aC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return _C;if(E[11].type==="number")return gC;if(E[11].type==="json")return mC;if(E[11].type==="email")return hC;if(E[11].type==="url")return pC;if(E[11].type==="file")return dC;if(E[11].type==="relation")return cC;if(E[11].type==="user")return fC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),S.d(),D&&D.d()}}}function Fd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].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&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Nd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function bC(n){var ne,re,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y=n[0].name+"",C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be=[],X=new Map,ae,ve,H,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt=[],Nt=new Map,Ot,Je,Ce=[],Be=new Map,ot,rt=n[4]&&Ld();N=new Ls({props:{js:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
const data = { ... };
|
||
|
||
const record = await client.records.create('${(ne=n[0])==null?void 0:ne.name}', data);
|
||
`,dart:`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
final body = <String, dynamic>{ ... };
|
||
|
||
final record = await client.records.create('${(re=n[0])==null?void 0:re.name}', body: body);
|
||
`}});let Ht=(Ae=n[0])==null?void 0:Ae.schema;const Ct=le=>le[11].name;for(let le=0;le<Ht.length;le+=1){let de=Pd(n,Ht,le),ke=Ct(de);X.set(ke,be[le]=Id(ke,de))}et=new _n({props:{content:`
|
||
?expand=rel1,rel2.subrel21.subrel22
|
||
`}});let ft=n[2];const xt=le=>le[6].code;for(let le=0;le<ft.length;le+=1){let de=Ad(n,ft,le),ke=xt(de);Nt.set(ke,mt[le]=Fd(ke,de))}let R=n[2];const z=le=>le[6].code;for(let le=0;le<R.length;le+=1){let de=Ed(n,R,le),ke=z(de);Be.set(ke,Ce[le]=Nd(ke,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=T(),rt&&rt.c(),d=T(),h=_("div"),g=_("p"),v=F("Create a new "),b=_("strong"),C=F(y),S=F(" record."),$=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
<code>multipart/form-data</code>.`,D=T(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",O=T(),L=_("div"),L.textContent="Client SDKs example",I=T(),V(N.$$.fragment),B=T(),U=_("div"),U.textContent="Body Parameters",ee=T(),K=_("table"),se=_("thead"),se.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="50%">Description</th></tr>`,Y=T(),te=_("tbody"),J=_("tr"),J.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||
<span>id</span></div></td>
|
||
<td><span class="label">String</span></td>
|
||
<td><strong>15 characters string</strong> to store as record ID.
|
||
<br/>
|
||
If not set, it will be auto generated.</td>`,_e=T();for(let le=0;le<be.length;le+=1)be[le].c();ae=T(),ve=_("div"),ve.textContent="Query parameters",H=T(),me=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr>`,Q=T(),Se=_("tbody"),je=_("tr"),Ue=_("td"),Ue.textContent="expand",Z=T(),ge=_("td"),ge.innerHTML='<span class="label">String</span>',ce=T(),$e=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.:
|
||
`),V(et.$$.fragment),We=F(`
|
||
Supports up to 6-levels depth nested relations expansion. `),tt=_("br"),Me=F(`
|
||
The expanded relations will be appended to the record under the
|
||
`),ze=_("code"),ze.textContent="@expand",Xe=F(" property (eg. "),nt=_("code"),nt.textContent='"@expand": {"rel1": {...}, ...}',ut=F(`). Only the
|
||
relations that the user has permissions to `),ye=_("strong"),ye.textContent="view",Ne=F(" will be expanded."),ct=T(),Dt=_("div"),Dt.textContent="Responses",dt=T(),lt=_("div"),Lt=_("div");for(let le=0;le<mt.length;le+=1)mt[le].c();Ot=T(),Je=_("div");for(let le=0;le<Ce.length;le+=1)Ce[le].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(L,"class","section-title"),p(U,"class","section-title"),p(K,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(me,"class","table-compact table-border m-b-lg"),p(Dt,"class","section-title"),p(Lt,"class","tabs-header compact left"),p(Je,"class","tabs-content"),p(lt,"class","tabs")},m(le,de){w(le,e,de),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),rt&&rt.m(e,null),w(le,d,de),w(le,h,de),m(h,g),m(g,v),m(g,b),m(b,C),m(g,S),m(h,$),m(h,M),m(h,D),m(h,E),w(le,O,de),w(le,L,de),w(le,I,de),j(N,le,de),w(le,B,de),w(le,U,de),w(le,ee,de),w(le,K,de),m(K,se),m(K,Y),m(K,te),m(te,J),m(te,_e);for(let ke=0;ke<be.length;ke+=1)be[ke].m(te,null);w(le,ae,de),w(le,ve,de),w(le,H,de),w(le,me,de),m(me,x),m(me,Q),m(me,Se),m(Se,je),m(je,Ue),m(je,Z),m(je,ge),m(je,ce),m(je,$e),m($e,Ze),j(et,$e,null),m($e,We),m($e,tt),m($e,Me),m($e,ze),m($e,Xe),m($e,nt),m($e,ut),m($e,ye),m($e,Ne),w(le,ct,de),w(le,Dt,de),w(le,dt,de),w(le,lt,de),m(lt,Lt);for(let ke=0;ke<mt.length;ke+=1)mt[ke].m(Lt,null);m(lt,Ot),m(lt,Je);for(let ke=0;ke<Ce.length;ke+=1)Ce[ke].m(Je,null);ot=!0},p(le,[de]){var fe,he,Ie;(!ot||de&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?rt||(rt=Ld(),rt.c(),rt.m(e,null)):rt&&(rt.d(1),rt=null),(!ot||de&1)&&y!==(y=le[0].name+"")&&ue(C,y);const ke={};de&9&&(ke.js=`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${le[3]}');
|
||
|
||
...
|
||
|
||
const data = { ... };
|
||
|
||
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
|
||
`),de&9&&(ke.dart=`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${le[3]}');
|
||
|
||
...
|
||
|
||
final body = <String, dynamic>{ ... };
|
||
|
||
final record = await client.records.create('${(he=le[0])==null?void 0:he.name}', body: body);
|
||
`),N.$set(ke),de&1&&(Ht=(Ie=le[0])==null?void 0:Ie.schema,be=yt(be,de,Ct,1,le,Ht,X,te,Mn,Id,null,Pd)),de&6&&(ft=le[2],mt=yt(mt,de,xt,1,le,ft,Nt,Lt,Mn,Fd,null,Ad)),de&6&&(R=le[2],Pe(),Ce=yt(Ce,de,z,1,le,R,Be,Je,Zt,Nd,null,Ed),Le())},i(le){if(!ot){A(N.$$.fragment,le),A(et.$$.fragment,le);for(let de=0;de<R.length;de+=1)A(Ce[de]);ot=!0}},o(le){P(N.$$.fragment,le),P(et.$$.fragment,le);for(let de=0;de<Ce.length;de+=1)P(Ce[de]);ot=!1},d(le){le&&k(e),rt&&rt.d(),le&&k(d),le&&k(h),le&&k(O),le&&k(L),le&&k(I),q(N,le),le&&k(B),le&&k(U),le&&k(ee),le&&k(K);for(let de=0;de<be.length;de+=1)be[de].d();le&&k(ae),le&&k(ve),le&&k(H),le&&k(me),q(et),le&&k(ct),le&&k(Dt),le&&k(dt),le&&k(lt);for(let de=0;de<mt.length;de+=1)mt[de].d();for(let de=0;de<Ce.length;de+=1)Ce[de].d()}}}function vC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||
{
|
||
"code": 400,
|
||
"message": "Failed to create record.",
|
||
"data": {
|
||
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
|
||
"code": "validation_required",
|
||
"message": "Missing required value."
|
||
}
|
||
}
|
||
}
|
||
`},{code:403,body:`
|
||
{
|
||
"code": 403,
|
||
"message": "You are not allowed to perform this request.",
|
||
"data": {}
|
||
}
|
||
`}])},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class yC extends Ee{constructor(e){super(),Oe(this,e,vC,bC,De,{collection:0})}}function Rd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[6]=e[t],i}function jd(n,e,t){const i=n.slice();return i[11]=e[t],i}function qd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function wC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function $C(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},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[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function SC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},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[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function CC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
|
||
Set to `),s=_("code"),s.textContent="null",l=F(" 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 MC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function TC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function DC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function OC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function EC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function Vd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",h,g,v,b;function y(E,O){return E[11].required?wC:kC}let C=y(e),S=C(e);function $(E,O){if(E[11].type==="text")return EC;if(E[11].type==="number")return OC;if(E[11].type==="json")return DC;if(E[11].type==="email")return TC;if(E[11].type==="url")return MC;if(E[11].type==="file")return CC;if(E[11].type==="relation")return SC;if(E[11].type==="user")return $C}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(E,O){w(E,t,O),m(t,i),m(i,s),S.m(s,null),m(s,l),m(s,o),m(o,a),m(t,u),m(t,f),m(f,c),m(c,h),m(t,g),m(t,v),D&&D.m(v,null),m(t,b)},p(E,O){e=E,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(s,l))),O&1&&r!==(r=e[11].name+"")&&ue(a,r),O&1&&d!==(d=W.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,O):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(E){E&&k(t),S.d(),D&&D.d()}}}function zd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].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&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Bd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function AC(n){var le,de,ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve=[],H=new Map,me,x,Q,Se,je,Ue,Z,ge,ce,$e,Ze,et,We,tt,Me,ze,Xe,nt,ut,ye,Ne,ct,Dt,dt,lt,Lt,mt,Nt,Ot,Je=[],Ce=new Map,Be,ot,rt=[],Ht=new Map,Ct,ft=n[4]&&qd();B=new Ls({props:{js:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
const data = { ... };
|
||
|
||
const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data);
|
||
`,dart:`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
final body = <String, dynamic>{ ... };
|
||
|
||
final record = await client.records.update('${(de=n[0])==null?void 0:de.name}', 'RECORD_ID', body: body);
|
||
`}});let xt=(ke=n[0])==null?void 0:ke.schema;const R=fe=>fe[11].name;for(let fe=0;fe<xt.length;fe+=1){let he=jd(n,xt,fe),Ie=R(he);H.set(Ie,ve[fe]=Vd(Ie,he))}Me=new _n({props:{content:`
|
||
?expand=rel1,rel2.subrel21.subrel22
|
||
`}});let z=n[2];const ne=fe=>fe[6].code;for(let fe=0;fe<z.length;fe+=1){let he=Hd(n,z,fe),Ie=ne(he);Ce.set(Ie,Je[fe]=zd(Ie,he))}let re=n[2];const Ae=fe=>fe[6].code;for(let fe=0;fe<re.length;fe+=1){let he=Rd(n,re,fe),Ie=Ae(he);Ht.set(Ie,rt[fe]=Bd(Ie,he))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),ft&&ft.c(),h=T(),g=_("div"),v=_("p"),b=F("Update a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
<code>multipart/form-data</code>.`,E=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",L=T(),I=_("div"),I.textContent="Client SDKs example",N=T(),V(B.$$.fragment),U=T(),ee=_("div"),ee.textContent="Path parameters",K=T(),se=_("table"),se.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>`,Y=T(),te=_("div"),te.textContent="Body Parameters",J=T(),_e=_("table"),be=_("thead"),be.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="50%">Description</th></tr>`,X=T(),ae=_("tbody");for(let fe=0;fe<ve.length;fe+=1)ve[fe].c();me=T(),x=_("div"),x.textContent="Query parameters",Q=T(),Se=_("table"),je=_("thead"),je.innerHTML=`<tr><th>Param</th>
|
||
<th>Type</th>
|
||
<th width="60%">Description</th></tr>`,Ue=T(),Z=_("tbody"),ge=_("tr"),ce=_("td"),ce.textContent="expand",$e=T(),Ze=_("td"),Ze.innerHTML='<span class="label">String</span>',et=T(),We=_("td"),tt=F(`Auto expand relations when returning the updated record. Ex.:
|
||
`),V(Me.$$.fragment),ze=F(`
|
||
Supports up to 6-levels depth nested relations expansion. `),Xe=_("br"),nt=F(`
|
||
The expanded relations will be appended to the record under the
|
||
`),ut=_("code"),ut.textContent="@expand",ye=F(" property (eg. "),Ne=_("code"),Ne.textContent='"@expand": {"rel1": {...}, ...}',ct=F(`). Only the
|
||
relations that the user has permissions to `),Dt=_("strong"),Dt.textContent="view",dt=F(" will be expanded."),lt=T(),Lt=_("div"),Lt.textContent="Responses",mt=T(),Nt=_("div"),Ot=_("div");for(let fe=0;fe<Je.length;fe+=1)Je[fe].c();Be=T(),ot=_("div");for(let fe=0;fe<rt.length;fe+=1)rt[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(I,"class","section-title"),p(ee,"class","section-title"),p(se,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(_e,"class","table-compact table-border m-b-lg"),p(x,"class","section-title"),p(Se,"class","table-compact table-border m-b-lg"),p(Lt,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(ot,"class","tabs-content"),p(Nt,"class","tabs")},m(fe,he){w(fe,e,he),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),ft&&ft.m(e,null),w(fe,h,he),w(fe,g,he),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),m(g,M),m(g,D),m(g,E),m(g,O),w(fe,L,he),w(fe,I,he),w(fe,N,he),j(B,fe,he),w(fe,U,he),w(fe,ee,he),w(fe,K,he),w(fe,se,he),w(fe,Y,he),w(fe,te,he),w(fe,J,he),w(fe,_e,he),m(_e,be),m(_e,X),m(_e,ae);for(let Ie=0;Ie<ve.length;Ie+=1)ve[Ie].m(ae,null);w(fe,me,he),w(fe,x,he),w(fe,Q,he),w(fe,Se,he),m(Se,je),m(Se,Ue),m(Se,Z),m(Z,ge),m(ge,ce),m(ge,$e),m(ge,Ze),m(ge,et),m(ge,We),m(We,tt),j(Me,We,null),m(We,ze),m(We,Xe),m(We,nt),m(We,ut),m(We,ye),m(We,Ne),m(We,ct),m(We,Dt),m(We,dt),w(fe,lt,he),w(fe,Lt,he),w(fe,mt,he),w(fe,Nt,he),m(Nt,Ot);for(let Ie=0;Ie<Je.length;Ie+=1)Je[Ie].m(Ot,null);m(Nt,Be),m(Nt,ot);for(let Ie=0;Ie<rt.length;Ie+=1)rt[Ie].m(ot,null);Ct=!0},p(fe,[he]){var ht,rn,jt;(!Ct||he&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?ft||(ft=qd(),ft.c(),ft.m(e,null)):ft&&(ft.d(1),ft=null),(!Ct||he&1)&&C!==(C=fe[0].name+"")&&ue(S,C);const Ie={};he&9&&(Ie.js=`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${fe[3]}');
|
||
|
||
...
|
||
|
||
const data = { ... };
|
||
|
||
const record = await client.records.update('${(ht=fe[0])==null?void 0:ht.name}', 'RECORD_ID', data);
|
||
`),he&9&&(Ie.dart=`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${fe[3]}');
|
||
|
||
...
|
||
|
||
final body = <String, dynamic>{ ... };
|
||
|
||
final record = await client.records.update('${(rn=fe[0])==null?void 0:rn.name}', 'RECORD_ID', body: body);
|
||
`),B.$set(Ie),he&1&&(xt=(jt=fe[0])==null?void 0:jt.schema,ve=yt(ve,he,R,1,fe,xt,H,ae,Mn,Vd,null,jd)),he&6&&(z=fe[2],Je=yt(Je,he,ne,1,fe,z,Ce,Ot,Mn,zd,null,Hd)),he&6&&(re=fe[2],Pe(),rt=yt(rt,he,Ae,1,fe,re,Ht,ot,Zt,Bd,null,Rd),Le())},i(fe){if(!Ct){A(B.$$.fragment,fe),A(Me.$$.fragment,fe);for(let he=0;he<re.length;he+=1)A(rt[he]);Ct=!0}},o(fe){P(B.$$.fragment,fe),P(Me.$$.fragment,fe);for(let he=0;he<rt.length;he+=1)P(rt[he]);Ct=!1},d(fe){fe&&k(e),ft&&ft.d(),fe&&k(h),fe&&k(g),fe&&k(L),fe&&k(I),fe&&k(N),q(B,fe),fe&&k(U),fe&&k(ee),fe&&k(K),fe&&k(se),fe&&k(Y),fe&&k(te),fe&&k(J),fe&&k(_e);for(let he=0;he<ve.length;he+=1)ve[he].d();fe&&k(me),fe&&k(x),fe&&k(Q),fe&&k(Se),q(Me),fe&&k(lt),fe&&k(Lt),fe&&k(mt),fe&&k(Nt);for(let he=0;he<Je.length;he+=1)Je[he].d();for(let he=0;he<rt.length;he+=1)rt[he].d()}}}function PC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||
{
|
||
"code": 400,
|
||
"message": "Failed to update record.",
|
||
"data": {
|
||
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.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": {}
|
||
}
|
||
`}])},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,o,r,s,i,a]}class LC extends Ee{constructor(e){super(),Oe(this,e,PC,AC,De,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[6]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].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&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Jd(n,e){let t,i,s,l;return i=new _n({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),m(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function IC(n){var je,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,g,v,b,y,C=n[0].name+"",S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te=[],J=new Map,_e,be,X=[],ae=new Map,ve,H=n[1]&&Yd();O=new Ls({props:{js:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
await client.records.delete('${(je=n[0])==null?void 0:je.name}', 'RECORD_ID');
|
||
`,dart:`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${n[3]}');
|
||
|
||
...
|
||
|
||
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
|
||
`}});let me=n[4];const x=Z=>Z[6].code;for(let Z=0;Z<me.length;Z+=1){let ge=Wd(n,me,Z),ce=x(ge);J.set(ce,te[Z]=Kd(ce,ge))}let Q=n[4];const Se=Z=>Z[6].code;for(let Z=0;Z<Q.length;Z+=1){let ge=Ud(n,Q,Z),ce=Se(ge);ae.set(ce,X[Z]=Jd(ce,ge))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),H&&H.c(),h=T(),g=_("div"),v=_("p"),b=F("Delete a single "),y=_("strong"),S=F(C),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",E=T(),V(O.$$.fragment),L=T(),I=_("div"),I.textContent="Path parameters",N=T(),B=_("table"),B.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>`,U=T(),ee=_("div"),ee.textContent="Responses",K=T(),se=_("div"),Y=_("div");for(let Z=0;Z<te.length;Z+=1)te[Z].c();_e=T(),be=_("div");for(let Z=0;Z<X.length;Z+=1)X[Z].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(I,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(Y,"class","tabs-header compact left"),p(be,"class","tabs-content"),p(se,"class","tabs")},m(Z,ge){w(Z,e,ge),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),H&&H.m(e,null),w(Z,h,ge),w(Z,g,ge),m(g,v),m(v,b),m(v,y),m(y,S),m(v,$),w(Z,M,ge),w(Z,D,ge),w(Z,E,ge),j(O,Z,ge),w(Z,L,ge),w(Z,I,ge),w(Z,N,ge),w(Z,B,ge),w(Z,U,ge),w(Z,ee,ge),w(Z,K,ge),w(Z,se,ge),m(se,Y);for(let ce=0;ce<te.length;ce+=1)te[ce].m(Y,null);m(se,_e),m(se,be);for(let ce=0;ce<X.length;ce+=1)X[ce].m(be,null);ve=!0},p(Z,[ge]){var $e,Ze;(!ve||ge&1)&&a!==(a=Z[0].name+"")&&ue(u,a),Z[1]?H||(H=Yd(),H.c(),H.m(e,null)):H&&(H.d(1),H=null),(!ve||ge&1)&&C!==(C=Z[0].name+"")&&ue(S,C);const ce={};ge&9&&(ce.js=`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${Z[3]}');
|
||
|
||
...
|
||
|
||
await client.records.delete('${($e=Z[0])==null?void 0:$e.name}', 'RECORD_ID');
|
||
`),ge&9&&(ce.dart=`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${Z[3]}');
|
||
|
||
...
|
||
|
||
await client.records.delete('${(Ze=Z[0])==null?void 0:Ze.name}', 'RECORD_ID');
|
||
`),O.$set(ce),ge&20&&(me=Z[4],te=yt(te,ge,x,1,Z,me,J,Y,Mn,Kd,null,Wd)),ge&20&&(Q=Z[4],Pe(),X=yt(X,ge,Se,1,Z,Q,ae,be,Zt,Jd,null,Ud),Le())},i(Z){if(!ve){A(O.$$.fragment,Z);for(let ge=0;ge<Q.length;ge+=1)A(X[ge]);ve=!0}},o(Z){P(O.$$.fragment,Z);for(let ge=0;ge<X.length;ge+=1)P(X[ge]);ve=!1},d(Z){Z&&k(e),H&&H.d(),Z&&k(h),Z&&k(g),Z&&k(M),Z&&k(D),Z&&k(E),q(O,Z),Z&&k(L),Z&&k(I),Z&&k(N),Z&&k(B),Z&&k(U),Z&&k(ee),Z&&k(K),Z&&k(se);for(let ge=0;ge<te.length;ge+=1)te[ge].d();for(let ge=0;ge<X.length;ge+=1)X[ge].d()}}}function FC(n,e,t){let i,s,{collection:l=new fn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.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": {}
|
||
}
|
||
`}))},t(3,s=W.getApiExampleUrl(we.baseUrl)),[l,i,o,s,r,a]}class NC extends Ee{constructor(e){super(),Oe(this,e,FC,IC,De,{collection:0})}}function RC(n){var h,g,v,b,y,C,S,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Ls({props:{js:`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${n[1]}');
|
||
|
||
...
|
||
|
||
// (Optionally) authenticate
|
||
client.users.authViaEmail('test@example.com', '123456');
|
||
|
||
// Subscribe to changes in any record from the collection
|
||
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
|
||
console.log(e.record);
|
||
});
|
||
|
||
// Subscribe to changes in a single record
|
||
client.realtime.subscribe('${(g=n[0])==null?void 0:g.name}/RECORD_ID', function (e) {
|
||
console.log(e.record);
|
||
});
|
||
|
||
// Unsubscribe
|
||
client.realtime.unsubscribe() // remove all subscriptions
|
||
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
|
||
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
|
||
`,dart:`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${n[1]}');
|
||
|
||
...
|
||
|
||
// (Optionally) authenticate
|
||
client.users.authViaEmail('test@example.com', '123456');
|
||
|
||
// Subscribe to changes in any record from the collection
|
||
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
|
||
print(e.record);
|
||
});
|
||
|
||
// Subscribe to changes in a single record
|
||
client.realtime.subscribe('${(C=n[0])==null?void 0:C.name}/RECORD_ID', (e) {
|
||
print(e.record);
|
||
});
|
||
|
||
// Unsubscribe
|
||
client.realtime.unsubscribe() // remove all subscriptions
|
||
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}') // remove only the collection subscription
|
||
client.realtime.unsubscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID') // remove only the record subscription
|
||
`}}),c=new _n({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 "Event data format" 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'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'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(),V(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),V(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(M,D){w(M,e,D),w(M,t,D),w(M,i,D),w(M,s,D),w(M,l,D),w(M,o,D),j(r,M,D),w(M,a,D),w(M,u,D),w(M,f,D),j(c,M,D),d=!0},p(M,[D]){var L,I,N,B,U,ee,K,se;const E={};D&3&&(E.js=`
|
||
import PocketBase from 'pocketbase';
|
||
|
||
const client = new PocketBase('${M[1]}');
|
||
|
||
...
|
||
|
||
// (Optionally) authenticate
|
||
client.users.authViaEmail('test@example.com', '123456');
|
||
|
||
// Subscribe to changes in any record from the collection
|
||
client.realtime.subscribe('${(L=M[0])==null?void 0:L.name}', function (e) {
|
||
console.log(e.record);
|
||
});
|
||
|
||
// Subscribe to changes in a single record
|
||
client.realtime.subscribe('${(I=M[0])==null?void 0:I.name}/RECORD_ID', function (e) {
|
||
console.log(e.record);
|
||
});
|
||
|
||
// Unsubscribe
|
||
client.realtime.unsubscribe() // remove all subscriptions
|
||
client.realtime.unsubscribe('${(N=M[0])==null?void 0:N.name}') // remove only the collection subscription
|
||
client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}/RECORD_ID') // remove only the record subscription
|
||
`),D&3&&(E.dart=`
|
||
import 'package:pocketbase/pocketbase.dart';
|
||
|
||
final client = PocketBase('${M[1]}');
|
||
|
||
...
|
||
|
||
// (Optionally) authenticate
|
||
client.users.authViaEmail('test@example.com', '123456');
|
||
|
||
// Subscribe to changes in any record from the collection
|
||
client.realtime.subscribe('${(U=M[0])==null?void 0:U.name}', (e) {
|
||
print(e.record);
|
||
});
|
||
|
||
// Subscribe to changes in a single record
|
||
client.realtime.subscribe('${(ee=M[0])==null?void 0:ee.name}/RECORD_ID', (e) {
|
||
print(e.record);
|
||
});
|
||
|
||
// Unsubscribe
|
||
client.realtime.unsubscribe() // remove all subscriptions
|
||
client.realtime.unsubscribe('${(K=M[0])==null?void 0:K.name}') // remove only the collection subscription
|
||
client.realtime.unsubscribe('${(se=M[0])==null?void 0:se.name}/RECORD_ID') // remove only the record subscription
|
||
`),r.$set(E);const O={};D&1&&(O.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(O)},i(M){d||(A(r.$$.fragment,M),A(c.$$.fragment,M),d=!0)},o(M){P(r.$$.fragment,M),P(c.$$.fragment,M),d=!1},d(M){M&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function HC(n,e,t){let i,{collection:s=new fn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=W.getApiExampleUrl(we.baseUrl)),[s,i]}class jC extends Ee{constructor(e){super(),Oe(this,e,HC,RC,De,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Gd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Xd(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&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(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){Pe();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),A(t.$$.fragment,1),j(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&&q(t)}}}function Qd(n,e){let t,i,s,l=e[4]===e[14].id&&Xd(e);return{key:n,first:null,c(){t=Ke(),l&&l.c(),i=Ke(),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=Xd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},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 qC(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=Zd(n,l,r),u=o(a);i.set(u,t[r]=Qd(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(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],Pe(),t=yt(t,a,o,1,r,l,i,e,Zt,Qd,null,Zd),Le())},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 xd(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=F(s),o=T(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ie(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",vm(f))],r=!0)},p(c,d){e=c,d&48&&ie(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Ge(a)}}}function VC(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 h=Gd(n,f,d),g=c(h);u.set(g,a[d]=xd(g,h))}return{c(){e=_("h4"),t=_("strong"),s=F(i),l=F(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),m(e,t),m(t,s),m(e,l),w(d,o,h),w(d,r,h);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=yt(a,h,c,1,d,f,u,r,Mn,xd,null,Gd))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function zC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(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 BC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[zC],header:[VC],default:[qC]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function UC(n,e,t){const i=[{id:"list",label:"List",component:sC},{id:"view",label:"View",component:rC},{id:"create",label:"Create",component:yC},{id:"update",label:"Update",component:LC},{id:"delete",label:"Delete",component:NC},{id:"realtime",label:"Realtime",component:jC}];let s,l=new fn,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,C){(y.code==="Enter"||y.code==="Space")&&(y.preventDefault(),u(C))}const c=()=>a(),d=y=>u(y.id),h=(y,C)=>f(C,y.id);function g(y){pe[y?"unshift":"push"](()=>{s=y,t(2,s)})}function v(y){st.call(this,n,y)}function b(y){st.call(this,n,y)}return[a,u,s,l,o,i,f,r,c,d,h,g,v,b]}class WC extends Ee{constructor(e){super(),Oe(this,e,UC,BC,De,{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 YC(n){let e,t,i,s=[n[3]],l={};for(let o=0;o<s.length;o+=1)l=at(l,s[o]);return{c(){e=_("textarea"),di(e,l),ie(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),Te(e,n[0]),t||(i=[G(e,"input",n[6]),G(e,"keydown",n[2])],t=!0)},p(o,[r]){di(e,l=pn(s,[r&8&&o[3]])),r&1&&Te(e,o[0]),ie(e,"svelte-1x1pbts",!0)},i:oe,o:oe,d(o){o&&k(e),n[5](null),t=!1,Ge(i)}}}function KC(n,e,t){const i=["value","maxHeight"];let s=Bt(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(h){if((h==null?void 0:h.code)==="Enter"&&!(h!=null&&h.shiftKey)){h.preventDefault();const g=r.closest("form");g!=null&&g.requestSubmit&&g.requestSubmit()}}Jn(()=>(u(),()=>clearTimeout(a)));function c(h){pe[h?"unshift":"push"](()=>{r=h,t(1,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=at(at({},e),ni(h)),t(3,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"maxHeight"in h&&t(4,o=h.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof l!==void 0&&u()},[l,r,f,s,o,c,d]}class JC extends Ee{constructor(e){super(),Oe(this,e,KC,YC,De,{value:0,maxHeight:4})}}function ZC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d;function h(v){n[2](v)}let g={id:n[3],required:n[1].required};return n[0]!==void 0&&(g.value=n[0]),f=new JC({props:g}),pe.push(()=>Fe(f,"value",h)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(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),j(f,v,b),d=!0},p(v,b){(!d||b&2&&i!==(i=W.getFieldTypeIcon(v[1].type)))&&p(t,"class",i),(!d||b&2)&&o!==(o=v[1].name+"")&&ue(r,o),(!d||b&8&&a!==(a=v[3]))&&p(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],He(()=>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),q(f,v)}}}function GC(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[ZC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function XC(n,e,t){let{field:i=new Dn}=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 QC extends Ee{constructor(e){super(),Oe(this,e,XC,GC,De,{field:1,value:0})}}function xC(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g,v,b;return{c(){var y,C;e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",h=(y=n[1].options)==null?void 0:y.min),p(f,"max",g=(C=n[1].options)==null?void 0:C.max),p(f,"step","any")},m(y,C){w(y,e,C),m(e,t),m(e,s),m(e,l),m(l,r),w(y,u,C),w(y,f,C),Te(f,n[0]),v||(b=G(f,"input",n[2]),v=!0)},p(y,C){var S,$;C&2&&i!==(i=W.getFieldTypeIcon(y[1].type))&&p(t,"class",i),C&2&&o!==(o=y[1].name+"")&&ue(r,o),C&8&&a!==(a=y[3])&&p(e,"for",a),C&8&&c!==(c=y[3])&&p(f,"id",c),C&2&&d!==(d=y[1].required)&&(f.required=d),C&2&&h!==(h=(S=y[1].options)==null?void 0:S.min)&&p(f,"min",h),C&2&&g!==(g=($=y[1].options)==null?void 0:$.max)&&p(f,"max",g),C&1&&Pt(f.value)!==y[0]&&Te(f,y[0])},d(y){y&&k(e),y&&k(u),y&&k(f),v=!1,b()}}}function e4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[xC,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function t4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=Pt(this.value),t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class n4 extends Ee{constructor(e){super(),Oe(this,e,t4,e4,De,{field:1,value:0})}}function i4(n){let e,t,i,s,l=n[1].name+"",o,r,a,u;return{c(){e=_("input"),i=T(),s=_("label"),o=F(l),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(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])&&p(e,"id",t),c&1&&(e.checked=f[0]),c&2&&l!==(l=f[1].name+"")&&ue(o,l),c&8&&r!==(r=f[3])&&p(s,"for",r)},d(f){f&&k(e),f&&k(i),f&&k(s),a=!1,u()}}}function s4(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[i4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function l4(n,e,t){let{field:i=new Dn}=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 o4 extends Ee{constructor(e){super(),Oe(this,e,l4,s4,De,{field:1,value:0})}}function r4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,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),Te(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&f.value!==v[0]&&Te(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function a4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[r4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function u4(n,e,t){let{field:i=new Dn}=e,{value:s=void 0}=e;function l(){s=this.value,t(0,s)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,s=o.value)},[s,i,l]}class f4 extends Ee{constructor(e){super(),Oe(this,e,u4,a4,De,{field:1,value:0})}}function c4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("input"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(v,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),Te(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Te(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function d4(n){let e,t;return e=new Re({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(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function p4(n,e,t){let{field:i=new Dn}=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 h4 extends Ee{constructor(e){super(),Oe(this,e,p4,d4,De,{field:1,value:0})}}function m4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h;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 Ka({props:v}),pe.push(()=>Fe(c,"formattedValue",g)),{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),a=F(" (UTC)"),f=T(),V(c.$$.fragment),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(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),j(c,b,y),h=!0},p(b,y){(!h||y&2&&i!==(i=W.getFieldTypeIcon(b[1].type)))&&p(t,"class",i),(!h||y&2)&&o!==(o=b[1].name+"")&&ue(r,o),(!h||y&8&&u!==(u=b[3]))&&p(e,"for",u);const C={};y&8&&(C.id=b[3]),y&1&&(C.value=b[0]),!d&&y&1&&(d=!0,C.formattedValue=b[0],He(()=>d=!1)),c.$set(C)},i(b){h||(A(c.$$.fragment,b),h=!0)},o(b){P(c.$$.fragment,b),h=!1},d(b){b&&k(e),b&&k(f),q(c,b)}}}function g4(n){let e,t;return e=new Re({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(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function _4(n,e,t){let{field:i=new Dn}=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 b4 extends Ee{constructor(e){super(),Oe(this,e,_4,g4,De,{field:1,value:0})}}function ep(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(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+"")&&ue(s,i)},d(o){o&&k(e)}}}function v4(n){var C,S,$;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(M){n[3](M)}let b={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],items:(C=n[1].options)==null?void 0:C.values,searchable:((S=n[1].options)==null?void 0:S.values)>5};n[0]!==void 0&&(b.selected=n[0]),f=new H_({props:b}),pe.push(()=>Fe(f,"selected",v));let y=(($=n[1].options)==null?void 0:$.maxSelect)>1&&ep(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(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),j(f,M,D),w(M,d,D),y&&y.m(M,D),w(M,h,D),g=!0},p(M,D){var O,L,I;(!g||D&2&&i!==(i=W.getFieldTypeIcon(M[1].type)))&&p(t,"class",i),(!g||D&2)&&o!==(o=M[1].name+"")&&ue(r,o),(!g||D&16&&a!==(a=M[4]))&&p(e,"for",a);const E={};D&16&&(E.id=M[4]),D&6&&(E.toggle=!M[1].required||M[2]),D&4&&(E.multiple=M[2]),D&2&&(E.items=(O=M[1].options)==null?void 0:O.values),D&2&&(E.searchable=((L=M[1].options)==null?void 0:L.values)>5),!c&&D&1&&(c=!0,E.selected=M[0],He(()=>c=!1)),f.$set(E),((I=M[1].options)==null?void 0:I.maxSelect)>1?y?y.p(M,D):(y=ep(M),y.c(),y.m(h.parentNode,h)):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),q(f,M),M&&k(d),y&&y.d(M),M&&k(h)}}}function y4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[v4,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function k4(n,e,t){let i,{field:s=new Dn}=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 w4 extends Ee{constructor(e){super(),Oe(this,e,k4,y4,De,{field:1,value:0})}}function $4(n){let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("textarea"),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[3]),p(f,"id",c=n[3]),f.required=d=n[1].required,p(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),Te(f,n[0]),h||(g=G(f,"input",n[2]),h=!0)},p(v,b){b&2&&i!==(i=W.getFieldTypeIcon(v[1].type))&&p(t,"class",i),b&2&&o!==(o=v[1].name+"")&&ue(r,o),b&8&&a!==(a=v[3])&&p(e,"for",a),b&8&&c!==(c=v[3])&&p(f,"id",c),b&2&&d!==(d=v[1].required)&&(f.required=d),b&1&&Te(f,v[0])},d(v){v&&k(e),v&&k(u),v&&k(f),h=!1,g()}}}function S4(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[$4,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function C4(n,e,t){let{field:i=new Dn}=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 M4 extends Ee{constructor(e){super(),Oe(this,e,C4,S4,De,{field:1,value:0})}}function T4(n){let e,t;return{c(){e=_("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,s){w(i,e,s)},p(i,s){s&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&k(e)}}}function D4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"width",n[1]),p(e,"height",n[1]),p(e,"alt",i=n[0].name)},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&2&&p(e,"width",s[1]),l&2&&p(e,"height",s[1]),l&1&&i!==(i=s[0].name)&&p(e,"alt",i)},d(s){s&&k(e)}}}function O4(n){let e;function t(l,o){return l[2]?D4:T4}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 E4(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 A4 extends Ee{constructor(e){super(),Oe(this,e,E4,O4,De,{file:0,size:1})}}function P4(n){let e,t,i;return{c(){e=_("img"),xn(e.src,t=n[2])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(s,l){w(s,e,l)},p(s,l){l&4&&!xn(e.src,t=s[2])&&p(e,"src",t),l&4&&i!==(i="Preview "+s[2])&&p(e,"alt",i)},d(s){s&&k(e)}}}function L4(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","overlay-close")},m(s,l){w(s,e,l),t||(i=G(e,"click",Yt(n[0])),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function I4(n){let e,t=n[2].substring(n[2].lastIndexOf("/")+1)+"",i,s,l,o,r,a,u;return{c(){e=_("a"),i=F(t),s=T(),l=_("div"),o=T(),r=_("button"),r.textContent="Close",p(e,"href",n[2]),p(e,"title","Download"),p(e,"class","link-hint txt-ellipsis"),p(l,"class","flex-fill"),p(r,"type","button"),p(r,"class","btn btn-secondary")},m(f,c){w(f,e,c),m(e,i),w(f,s,c),w(f,l,c),w(f,o,c),w(f,r,c),a||(u=G(r,"click",n[0]),a=!0)},p(f,c){c&4&&t!==(t=f[2].substring(f[2].lastIndexOf("/")+1)+"")&&ue(i,t),c&4&&p(e,"href",f[2])},d(f){f&&k(e),f&&k(s),f&&k(l),f&&k(o),f&&k(r),a=!1,u()}}}function F4(n){let e,t,i={class:"image-preview",btnClose:!1,popup:!0,$$slots:{footer:[I4],header:[L4],default:[P4]},$$scope:{ctx:n}};return e=new mi({props:i}),n[4](e),e.$on("show",n[5]),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function N4(n,e,t){let i,s="";function l(f){f!==""&&(t(2,s=f),i==null||i.show())}function o(){return i==null?void 0:i.hide()}function r(f){pe[f?"unshift":"push"](()=>{i=f,t(1,i)})}function a(f){st.call(this,n,f)}function u(f){st.call(this,n,f)}return[o,i,s,l,r,a,u]}class R4 extends Ee{constructor(e){super(),Oe(this,e,N4,F4,De,{show:3,hide:0})}get show(){return this.$$.ctx[3]}get hide(){return this.$$.ctx[0]}}function H4(n){let e;return{c(){e=_("i"),p(e,"class","ri-file-line")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function j4(n){let e,t,i,s,l;return{c(){e=_("img"),xn(e.src,t=n[4])||p(e,"src",t),p(e,"alt",n[0]),p(e,"title",i="Preview "+n[0]),ie(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&&!xn(e.src,t=o[4])&&p(e,"src",t),r&1&&p(e,"alt",o[0]),r&1&&i!==(i="Preview "+o[0])&&p(e,"title",i),r&4&&ie(e,"link-fade",o[2])},d(o){o&&k(e),s=!1,Ge(l)}}}function q4(n){let e,t,i;function s(a,u){return a[2]?j4:H4}let l=s(n),o=l(n),r={};return t=new R4({props:r}),n[8](t),{c(){o.c(),e=T(),V(t.$$.fragment)},m(a,u){o.m(a,u),w(a,e,u),j(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),q(t,a)}}}function V4(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){pe[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=we.records.getFileUrl(s,`${l}`)),n.$$.dirty&2&&t(4,r=a?a+"?thumb=100x100":"")},[l,a,i,o,r,u,s,f,c]}class z_ extends Ee{constructor(e){super(),Oe(this,e,V4,q4,De,{record:6,filename:0})}}function tp(n,e,t){const i=n.slice();return i[22]=e[t],i[24]=t,i}function np(n,e,t){const i=n.slice();return i[25]=e[t],i[24]=t,i}function z4(n){let e,t,i;function s(){return n[14](n[24])}return{c(){e=_("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-sm btn-circle btn-remove txt-hint")},m(l,o){w(l,e,o),t||(i=[Ye(wt.call(null,e,"Remove file")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Ge(i)}}}function B4(n){let e,t,i;function s(){return n[13](n[24])}return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(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 ip(n,e){let t,i,s,l,o,r=e[25]+"",a,u,f,c,d,h,g;s=new z_({props:{record:e[2],filename:e[25]}});function v(C,S){return S&18&&(c=null),c==null&&(c=!!C[1].includes(C[24])),c?B4:z4}let b=v(e,-1),y=b(e);return{key:n,first:null,c(){t=_("div"),i=_("figure"),V(s.$$.fragment),l=T(),o=_("a"),a=F(r),f=T(),y.c(),p(i,"class","thumb"),ie(i,"fade",e[1].includes(e[24])),p(o,"href",u=we.records.getFileUrl(e[2],e[25])),p(o,"class","filename link-hint"),p(o,"target","_blank"),p(o,"rel","noopener"),ie(o,"txt-strikethrough",e[1].includes(e[24])),p(t,"class","list-item"),this.first=t},m(C,S){w(C,t,S),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,a),m(t,f),y.m(t,null),d=!0,h||(g=Ye(wt.call(null,o,{position:"right",text:"Download"})),h=!0)},p(C,S){e=C;const $={};S&4&&($.record=e[2]),S&16&&($.filename=e[25]),s.$set($),S&18&&ie(i,"fade",e[1].includes(e[24])),(!d||S&16)&&r!==(r=e[25]+"")&&ue(a,r),(!d||S&20&&u!==(u=we.records.getFileUrl(e[2],e[25])))&&p(o,"href",u),S&18&&ie(o,"txt-strikethrough",e[1].includes(e[24])),b===(b=v(e,S))&&y?y.p(e,S):(y.d(1),y=b(e),y&&(y.c(),y.m(t,null)))},i(C){d||(A(s.$$.fragment,C),d=!0)},o(C){P(s.$$.fragment,C),d=!1},d(C){C&&k(t),q(s),y.d(),h=!1,g()}}}function sp(n){let e,t,i,s,l,o,r,a,u=n[22].name+"",f,c,d,h,g,v,b;i=new A4({props:{file:n[22]}});function y(){return n[15](n[24])}return{c(){e=_("div"),t=_("figure"),V(i.$$.fragment),s=T(),l=_("div"),o=_("small"),o.textContent="New",r=T(),a=_("span"),f=F(u),d=T(),h=_("button"),h.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(l,"class","filename"),p(l,"title",c=n[22].name),p(h,"type","button"),p(h,"class","btn btn-secondary btn-sm btn-circle btn-remove"),p(e,"class","list-item")},m(C,S){w(C,e,S),m(e,t),j(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,h),g=!0,v||(b=[Ye(wt.call(null,h,"Remove file")),G(h,"click",y)],v=!0)},p(C,S){n=C;const $={};S&1&&($.file=n[22]),i.$set($),(!g||S&1)&&u!==(u=n[22].name+"")&&ue(f,u),(!g||S&1&&c!==(c=n[22].name))&&p(l,"title",c)},i(C){g||(A(i.$$.fragment,C),g=!0)},o(C){P(i.$$.fragment,C),g=!1},d(C){C&&k(e),q(i),v=!1,Ge(b)}}}function lp(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>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(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,Ge(o)}}}function U4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,g,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let E=np(n,b,D),O=y(E);d.set(O,c[D]=ip(O,E))}let C=n[0],S=[];for(let D=0;D<C.length;D+=1)S[D]=sp(tp(n,C,D));const $=D=>P(S[D],1,1,()=>{S[D]=null});let M=!n[8]&&lp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();h=T();for(let D=0;D<S.length;D+=1)S[D].c();g=T(),M&&M.c(),p(t,"class",i=W.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(D,E){w(D,e,E),m(e,t),m(e,s),m(e,l),m(l,r),w(D,u,E),w(D,f,E);for(let O=0;O<c.length;O+=1)c[O].m(f,null);m(f,h);for(let O=0;O<S.length;O+=1)S[O].m(f,null);m(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,E){if((!v||E&8&&i!==(i=W.getFieldTypeIcon(D[3].type)))&&p(t,"class",i),(!v||E&8)&&o!==(o=D[3].name+"")&&ue(r,o),(!v||E&2097152&&a!==(a=D[21]))&&p(e,"for",a),E&1558&&(b=D[4],Pe(),c=yt(c,E,y,1,D,b,d,f,Zt,ip,h,np),Le()),E&2049){C=D[0];let O;for(O=0;O<C.length;O+=1){const L=tp(D,C,O);S[O]?(S[O].p(L,E),A(S[O],1)):(S[O]=sp(L),S[O].c(),A(S[O],1),S[O].m(f,g))}for(Pe(),O=C.length;O<S.length;O+=1)$(O);Le()}D[8]?M&&(M.d(1),M=null):M?M.p(D,E):(M=lp(D),M.c(),M.m(f,null))},i(D){if(!v){for(let E=0;E<b.length;E+=1)A(c[E]);for(let E=0;E<C.length;E+=1)A(S[E]);v=!0}},o(D){for(let E=0;E<c.length;E+=1)P(c[E]);S=S.filter(Boolean);for(let E=0;E<S.length;E+=1)P(S[E]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let E=0;E<c.length;E+=1)c[E].d();Qt(S,D),M&&M.d(),n[19](null)}}}function W4(n){let e,t;return e=new Re({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[U4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function Y4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Dn}=e,c,d;function h(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=>h(O),C=O=>g(O),S=O=>v(O);function $(O){pe[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 E(O){pe[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,L;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)&&((L=f.options)==null?void 0:L.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,g,v,r,y,C,S,$,M,D,E]}class K4 extends Ee{constructor(e){super(),Oe(this,e,Y4,W4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function op(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function J4(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f,c=n[1]!==""&&n[1]!==n[0].id&&op(n);return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),c&&c.c(),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(s,"class","content svelte-1gjwqyd")},m(d,h){w(d,e,h),w(d,i,h),w(d,s,h),m(s,l),m(l,r),m(s,a),c&&c.m(s,null),u||(f=Ye(t=wt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),u=!0)},p(d,[h]){t&&Kn(t.update)&&h&1&&t.update.call(null,{text:JSON.stringify(d[0],null,2),position:"left",class:"code"}),h&1&&o!==(o=d[0].id+"")&&ue(r,o),d[1]!==""&&d[1]!==d[0].id?c?c.p(d,h):(c=op(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 Z4(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 G4 extends Ee{constructor(e){super(),Oe(this,e,Z4,J4,De,{item:0})}}function rp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[14])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function X4(n){let e,t=n[7]&&rp(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=rp(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function Q4(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:[X4]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=at(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new fs({props:a}),pe.push(()=>Fe(e,"keyOfSelected",o)),pe.push(()=>Fe(e,"selected",r)),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(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&&si(u[10])]):{};f&4194496&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function x4(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent","collectionId"];let o=Bt(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=G4}=e,{collectionId:h}=e,g=[],v=1,b=0,y=!1,C=!1;S();async function S(){const I=W.toArray(f);if(!(!h||!I.length)){t(13,C=!0);try{const N=[];for(const B of I)N.push(`id="${B}"`);t(0,u=await we.records.getFullList(h,200,{sort:"-created",filter:N.join("||"),$cancelKey:r+"loadSelected"})),t(5,g=W.filterDuplicatesByKey(g.concat(u)))}catch(N){we.errorResponseHandler(N)}t(13,C=!1)}}async function $(I=!1){if(!!h){t(6,y=!0);try{const N=I?1:v+1,B=await we.records.getList(h,N,200,{sort:"-created",$cancelKey:r+"loadList"});I&&t(5,g=[]),t(5,g=W.filterDuplicatesByKey(g.concat(B.items))),v=B.page,t(12,b=B.totalItems)}catch(N){we.errorResponseHandler(N)}t(6,y=!1)}}const M=()=>$();function D(I){f=I,t(1,f)}function E(I){u=I,t(0,u)}function O(I){st.call(this,n,I)}function L(I){st.call(this,n,I)}return n.$$set=I=>{e=at(at({},e),ni(I)),t(10,o=Bt(e,l)),"multiple"in I&&t(2,a=I.multiple),"selected"in I&&t(0,u=I.selected),"keyOfSelected"in I&&t(1,f=I.keyOfSelected),"selectPlaceholder"in I&&t(3,c=I.selectPlaceholder),"optionComponent"in I&&t(4,d=I.optionComponent),"collectionId"in I&&t(11,h=I.collectionId)},n.$$.update=()=>{n.$$.dirty&2048&&h&&$(!0),n.$$.dirty&8256&&t(8,i=y||C),n.$$.dirty&4128&&t(7,s=b>g.length)},[u,f,a,c,d,g,y,s,i,$,o,h,b,C,M,D,E,O,L]}class eM extends Ee{constructor(e){super(),Oe(this,e,x4,Q4,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4,collectionId:11})}}function ap(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" items."),p(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+"")&&ue(s,i)},d(o){o&&k(e)}}}function tM(n){var C,S;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v($){n[3]($)}let b={toggle:!0,id:n[4],multiple:n[2],collectionId:(C=n[1].options)==null?void 0:C.collectionId};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new eM({props:b}),pe.push(()=>Fe(f,"keyOfSelected",v));let y=((S=n[1].options)==null?void 0:S.maxSelect)>1&&ap(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[4])},m($,M){w($,e,M),m(e,t),m(e,s),m(e,l),m(l,r),w($,u,M),j(f,$,M),w($,d,M),y&&y.m($,M),w($,h,M),g=!0},p($,M){var E,O;(!g||M&2&&i!==(i=W.getFieldTypeIcon($[1].type)))&&p(t,"class",i),(!g||M&2)&&o!==(o=$[1].name+"")&&ue(r,o),(!g||M&16&&a!==(a=$[4]))&&p(e,"for",a);const D={};M&16&&(D.id=$[4]),M&4&&(D.multiple=$[2]),M&2&&(D.collectionId=(E=$[1].options)==null?void 0:E.collectionId),!c&&M&1&&(c=!0,D.keyOfSelected=$[0],He(()=>c=!1)),f.$set(D),((O=$[1].options)==null?void 0:O.maxSelect)>1?y?y.p($,M):(y=ap($),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i($){g||(A(f.$$.fragment,$),g=!0)},o($){P(f.$$.fragment,$),g=!1},d($){$&&k(e),$&&k(u),q(f,$),$&&k(d),y&&y.d($),$&&k(h)}}}function nM(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[tM,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function iM(n,e,t){let i,{field:s=new Dn}=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 sM extends Ee{constructor(e){super(),Oe(this,e,iM,nM,De,{field:1,value:0})}}function lM(n){let e,t,i,s,l,o=n[0].id+"",r,a,u,f=n[0].email+"",c,d,h;return{c(){e=_("i"),i=T(),s=_("div"),l=_("div"),r=F(o),a=T(),u=_("small"),c=F(f),p(e,"class","ri-information-line link-hint"),p(l,"class","block txt-ellipsis"),p(u,"class","block txt-hint txt-ellipsis"),p(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||(h=Ye(t=wt.call(null,e,{text:JSON.stringify(n[0],null,2),position:"left",class:"code"})),d=!0)},p(g,[v]){t&&Kn(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+"")&&ue(r,o),v&1&&f!==(f=g[0].email+"")&&ue(c,f)},i:oe,o:oe,d(g){g&&k(e),g&&k(i),g&&k(s),d=!1,h()}}}function oM(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class oa extends Ee{constructor(e){super(),Oe(this,e,oM,lM,De,{item:0})}}function up(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Load more</span>',p(e,"type","button"),p(e,"class","btn btn-block btn-sm"),ie(e,"btn-loading",n[6]),ie(e,"btn-disabled",n[6])},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[13])),t=!0)},p(s,l){l&64&&ie(e,"btn-loading",s[6]),l&64&&ie(e,"btn-disabled",s[6])},d(s){s&&k(e),t=!1,i()}}}function rM(n){let e,t=n[7]&&up(n);return{c(){t&&t.c(),e=Ke()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[7]?t?t.p(i,s):(t=up(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){t&&t.d(i),i&&k(e)}}}function aM(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:oa},{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:[rM]},$$scope:{ctx:n}};for(let u=0;u<l.length;u+=1)a=at(a,l[u]);return n[1]!==void 0&&(a.keyOfSelected=n[1]),n[0]!==void 0&&(a.selected=n[0]),e=new fs({props:a}),pe.push(()=>Fe(e,"keyOfSelected",o)),pe.push(()=>Fe(e,"selected",r)),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(u,f){j(e,u,f),s=!0},p(u,[f]){const c=f&1340?pn(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:oa},f&16&&{optionComponent:u[4]},f&4&&{multiple:u[2]},l[7],f&1024&&si(u[10])]):{};f&2097344&&(c.$$scope={dirty:f,ctx:u}),!t&&f&2&&(t=!0,c.keyOfSelected=u[1],He(()=>t=!1)),!i&&f&1&&(i=!0,c.selected=u[0],He(()=>i=!1)),e.$set(c)},i(u){s||(A(e.$$.fragment,u),s=!0)},o(u){P(e.$$.fragment,u),s=!1},d(u){q(e,u)}}}function uM(n,e,t){let i,s;const l=["multiple","selected","keyOfSelected","selectPlaceholder","optionComponent"];let o=Bt(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=oa}=e,h=[],g=1,v=0,b=!1,y=!1;S(!0),C();async function C(){const L=W.toArray(f);if(!!L.length){t(12,y=!0);try{const I=[];for(const N of L)I.push(`id="${N}"`);t(0,u=await we.users.getFullList(100,{sort:"-created",filter:I.join("||"),$cancelKey:r+"loadSelected"})),t(5,h=W.filterDuplicatesByKey(h.concat(u)))}catch(I){we.errorResponseHandler(I)}t(12,y=!1)}}async function S(L=!1){t(6,b=!0);try{const I=L?1:g+1,N=await we.users.getList(I,200,{sort:"-created",$cancelKey:r+"loadList"});L&&t(5,h=[]),t(5,h=W.filterDuplicatesByKey(h.concat(N.items))),g=N.page,t(11,v=N.totalItems)}catch(I){we.errorResponseHandler(I)}t(6,b=!1)}const $=()=>S();function M(L){f=L,t(1,f)}function D(L){u=L,t(0,u)}function E(L){st.call(this,n,L)}function O(L){st.call(this,n,L)}return n.$$set=L=>{e=at(at({},e),ni(L)),t(10,o=Bt(e,l)),"multiple"in L&&t(2,a=L.multiple),"selected"in L&&t(0,u=L.selected),"keyOfSelected"in L&&t(1,f=L.keyOfSelected),"selectPlaceholder"in L&&t(3,c=L.selectPlaceholder),"optionComponent"in L&&t(4,d=L.optionComponent)},n.$$.update=()=>{n.$$.dirty&4160&&t(8,i=b||y),n.$$.dirty&2080&&t(7,s=v>h.length)},[u,f,a,c,d,h,b,s,i,S,o,v,y,$,M,D,E,O]}class fM extends Ee{constructor(e){super(),Oe(this,e,uM,aM,De,{multiple:2,selected:0,keyOfSelected:1,selectPlaceholder:3,optionComponent:4})}}function fp(n){let e,t,i=n[1].options.maxSelect+"",s,l;return{c(){e=_("div"),t=F("Select up to "),s=F(i),l=F(" users."),p(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+"")&&ue(s,i)},d(o){o&&k(e)}}}function cM(n){var C;let e,t,i,s,l,o=n[1].name+"",r,a,u,f,c,d,h,g;function v(S){n[4](S)}let b={toggle:!0,id:n[5],multiple:n[2],disabled:n[3]};n[0]!==void 0&&(b.keyOfSelected=n[0]),f=new fM({props:b}),pe.push(()=>Fe(f,"keyOfSelected",v));let y=((C=n[1].options)==null?void 0:C.maxSelect)>1&&fp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),V(f.$$.fragment),d=T(),y&&y.c(),h=Ke(),p(t,"class",i=W.getFieldTypeIcon(n[1].type)),p(l,"class","txt"),p(e,"for",a=n[5])},m(S,$){w(S,e,$),m(e,t),m(e,s),m(e,l),m(l,r),w(S,u,$),j(f,S,$),w(S,d,$),y&&y.m(S,$),w(S,h,$),g=!0},p(S,$){var D;(!g||$&2&&i!==(i=W.getFieldTypeIcon(S[1].type)))&&p(t,"class",i),(!g||$&2)&&o!==(o=S[1].name+"")&&ue(r,o),(!g||$&32&&a!==(a=S[5]))&&p(e,"for",a);const M={};$&32&&(M.id=S[5]),$&4&&(M.multiple=S[2]),$&8&&(M.disabled=S[3]),!c&&$&1&&(c=!0,M.keyOfSelected=S[0],He(()=>c=!1)),f.$set(M),((D=S[1].options)==null?void 0:D.maxSelect)>1?y?y.p(S,$):(y=fp(S),y.c(),y.m(h.parentNode,h)):y&&(y.d(1),y=null)},i(S){g||(A(f.$$.fragment,S),g=!0)},o(S){P(f.$$.fragment,S),g=!1},d(S){S&&k(e),S&&k(u),q(f,S),S&&k(d),y&&y.d(S),S&&k(h)}}}function dM(n){let e,t;return e=new Re({props:{class:"form-field "+(n[1].required?"required":"")+" "+(n[3]?"disabled":""),name:n[1].name,$$slots:{default:[cM,({uniqueId:i})=>({5:i}),({uniqueId:i})=>i?32:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function pM(n,e,t){let i,s,{field:l=new Dn}=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 hM extends Ee{constructor(e){super(),Oe(this,e,pM,dM,De,{field:1,value:0})}}function cp(n,e,t){const i=n.slice();return i[40]=e[t],i[41]=e,i[42]=t,i}function dp(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[mM,({uniqueId:i})=>({43:i}),({uniqueId:i})=>[0,i?4096:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function mM(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"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[43]),p(u,"type","text"),p(u,"id",f=n[43]),u.value=c=n[2].id,u.disabled=!0},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(e,l),m(e,o),w(d,a,h),w(d,u,h)},p(d,h){h[1]&4096&&r!==(r=d[43])&&p(e,"for",r),h[1]&4096&&f!==(f=d[43])&&p(u,"id",f),h[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 pp(n){let e;return{c(){e=_("div"),e.innerHTML=`<h5>No custom fields to be set</h5>
|
||
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function gM(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 hM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function _M(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 sM({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function bM(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 K4({props:u}),pe.push(()=>Fe(e,"value",o)),pe.push(()=>Fe(e,"uploadedFiles",r)),pe.push(()=>Fe(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(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],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function vM(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 M4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function yM(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 w4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function kM(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 b4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function wM(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 h4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function $M(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 f4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function SM(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 o4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function CM(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 n4({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function MM(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 QC({props:l}),pe.push(()=>Fe(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(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],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function hp(n,e){let t,i,s,l,o;const r=[MM,CM,SM,$M,wM,kM,yM,vM,bM,_M,gM],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=Ke(),s&&s.c(),l=Ke(),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&&(Pe(),P(a[d],1,1,()=>{a[d]=null}),Le()),~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 TM(n){var d;let e,t,i=[],s=new Map,l,o,r,a=!n[2].isNew&&dp(n),u=((d=n[0])==null?void 0:d.schema)||[];const f=h=>h[40].name;for(let h=0;h<u.length;h+=1){let g=cp(n,u,h),v=f(g);s.set(v,i[h]=hp(v,g))}let c=null;return u.length||(c=pp()),{c(){e=_("form"),a&&a.c(),t=T();for(let h=0;h<i.length;h+=1)i[h].c();c&&c.c(),p(e,"id",n[11]),p(e,"class","block")},m(h,g){w(h,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",Yt(n[12])),o=!0)},p(h,g){var v;h[2].isNew?a&&(Pe(),P(a,1,1,()=>{a=null}),Le()):a?(a.p(h,g),g[0]&4&&A(a,1)):(a=dp(h),a.c(),A(a,1),a.m(e,t)),g[0]&29&&(u=((v=h[0])==null?void 0:v.schema)||[],Pe(),i=yt(i,g,f,1,h,u,s,e,Zt,hp,null,cp),Le(),!u.length&&c?c.p(h,g):u.length?c&&(c.d(1),c=null):(c=pp(),c.c(),c.m(e,null)))},i(h){if(!l){A(a);for(let g=0;g<u.length;g+=1)A(i[g]);l=!0}},o(h){P(a);for(let g=0;g<i.length;g+=1)P(i[g]);l=!1},d(h){h&&k(e),a&&a.d();for(let g=0;g<i.length;g+=1)i[g].d();c&&c.d(),o=!1,r()}}}function mp(n){let e,t,i,s,l,o,r,a;return r=new Mi({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[DM]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=T(),i=_("button"),s=_("div"),l=_("i"),o=T(),V(r.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(s,"class","content"),p(i,"type","button"),p(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),j(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),q(r)}}}function DM(n){let e,t,i;return{c(){e=_("div"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(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 OM(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]&&mp(n);return{c(){e=_("h4"),i=F(t),s=T(),o=F(l),r=F(" record"),a=T(),c&&c.c(),u=Ke()},m(d,h){w(d,e,h),m(e,i),m(e,s),m(e,o),m(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&A(c,1)):(c=mp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},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 EM(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=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ie(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")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function AM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[EM],header:[OM],default:[TM]},$$scope:{ctx:n}};return e=new mi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function gp(n){return JSON.stringify(n)}function PM(n,e,t){let i,s,l,o;const r=on(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new fo,h=!1,g=!1,v={},b={},y="";function C(x){return $(x),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function $(x){hi({}),c=x||{},t(2,d=x!=null&&x.clone?x.clone():new fo),t(3,v={}),t(4,b={}),await ii(),t(15,y=gp(d))}function M(){if(h||!l)return;t(7,h=!0);const x=E();let Q;d.isNew?Q=we.records.create(u==null?void 0:u.id,x):Q=we.records.update(u==null?void 0:u.id,d.id,x),Q.then(async Se=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",Se)}).catch(Se=>{we.errorResponseHandler(Se)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||pi("Do you really want to delete the selected record?",()=>we.records.delete(c["@collectionId"],c.id).then(()=>{S(),cn("Successfully deleted record."),r("delete",c)}).catch(x=>{we.errorResponseHandler(x)}))}function E(){const x=(d==null?void 0:d.export())||{},Q=new FormData,Se={};for(const je of(u==null?void 0:u.schema)||[])Se[je.name]=je;for(const je in x)!Se[je]||(typeof x[je]>"u"&&(x[je]=null),W.addValueToFormData(Q,je,x[je]));for(const je in v){const Ue=W.toArray(v[je]);for(const Z of Ue)Q.append(je,Z)}for(const je in b){const Ue=W.toArray(b[je]);for(const Z of Ue)Q.append(je+"."+Z,"")}return Q}const O=()=>S(),L=()=>D();function I(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function N(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function B(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function U(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function ee(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function K(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function se(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function Y(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function te(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function J(x,Q){n.$$.not_equal(v[Q.name],x)&&(v[Q.name]=x,t(3,v))}function _e(x,Q){n.$$.not_equal(b[Q.name],x)&&(b[Q.name]=x,t(4,b))}function be(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}function X(x,Q){n.$$.not_equal(d[Q.name],x)&&(d[Q.name]=x,t(2,d))}const ae=()=>s&&g?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,g=!1),S()}),!1):!0;function ve(x){pe[x?"unshift":"push"](()=>{f=x,t(6,f)})}function H(x){st.call(this,n,x)}function me(x){st.call(this,n,x)}return n.$$set=x=>{"collection"in x&&t(0,u=x.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!=gp(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,S,d,v,b,s,f,h,g,l,o,a,M,D,C,y,i,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me]}class B_ extends Ee{constructor(e){super(),Oe(this,e,PM,AM,De,{collection:0,show:14,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[1]}}function LM(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function IM(n){let e,t;return{c(){e=_("span"),t=F(n[1]),p(e,"class","label txt-base txt-mono"),p(e,"title",n[0])},m(i,s){w(i,e,s),m(e,t)},p(i,s){s&2&&ue(t,i[1]),s&1&&p(e,"title",i[0])},d(i){i&&k(e)}}}function FM(n){let e;function t(l,o){return l[0]?IM:LM}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 NM(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 Qo extends Ee{constructor(e){super(),Oe(this,e,NM,FM,De,{id:0})}}function _p(n,e,t){const i=n.slice();return i[8]=e[t],i}function bp(n,e,t){const i=n.slice();return i[3]=e[t],i}function vp(n,e,t){const i=n.slice();return i[3]=e[t],i}function RM(n){let e,t=n[0][n[1].name]+"",i,s;return{c(){e=_("span"),i=F(t),p(e,"class","txt txt-ellipsis"),p(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]+"")&&ue(i,t),o&3&&s!==(s=l[0][l[1].name])&&p(e,"title",s)},i:oe,o:oe,d(l){l&&k(e)}}}function HM(n){let e,t,i=W.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=yp(_p(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();p(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=_p(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=yp(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(Pe(),a=i.length;a<s.length;a+=1)l(a);Le()}},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),Qt(s,o)}}}function jM(n){let e,t,i=W.toArray(n[0][n[1].name]),s=[];for(let o=0;o<i.length;o+=1)s[o]=kp(bp(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();p(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=bp(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=kp(u),s[a].c(),A(s[a],1),s[a].m(e,null))}for(Pe(),a=i.length;a<s.length;a+=1)l(a);Le()}},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),Qt(s,o)}}}function qM(n){let e,t=W.toArray(n[0][n[1].name]),i=[];for(let s=0;s<t.length;s+=1)i[s]=wp(vp(n,t,s));return{c(){e=_("div");for(let s=0;s<i.length;s+=1)i[s].c();p(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=vp(s,t,o);i[o]?i[o].p(r,l):(i[o]=wp(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),Qt(i,s)}}}function VM(n){let e,t=JSON.stringify(n[0][n[1].name])+"",i;return{c(){e=_("span"),i=F(t),p(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])+"")&&ue(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function zM(n){let e,t;return e=new $i({props:{date:n[0][n[1].name]}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function BM(n){let e,t=n[0][n[1].name]+"",i,s,l,o;return{c(){e=_("a"),i=F(t),p(e,"class","txt-ellipsis"),p(e,"href",s=n[0][n[1].name]),p(e,"target","_blank"),p(e,"rel","noopener")},m(r,a){w(r,e,a),m(e,i),l||(o=[Ye(wt.call(null,e,"Open in new tab")),G(e,"click",ei(n[2]))],l=!0)},p(r,a){a&3&&t!==(t=r[0][r[1].name]+"")&&ue(i,t),a&3&&s!==(s=r[0][r[1].name])&&p(e,"href",s)},i:oe,o:oe,d(r){r&&k(e),l=!1,Ge(o)}}}function UM(n){let e,t=n[0][n[1].name]?"True":"False",i;return{c(){e=_("span"),i=F(t),p(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")&&ue(i,t)},i:oe,o:oe,d(s){s&&k(e)}}}function WM(n){let e;return{c(){e=_("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function yp(n){let e,t,i,s;return t=new z_({props:{record:n[0],filename:n[8]}}),{c(){e=_("figure"),V(t.$$.fragment),i=T(),p(e,"class","thumb thumb-sm")},m(l,o){w(l,e,o),j(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),q(t)}}}function kp(n){let e,t;return e=new Qo({props:{id:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function wp(n){let e,t=n[3]+"",i;return{c(){e=_("span"),i=F(t),p(e,"class","label")},m(s,l){w(s,e,l),m(e,i)},p(s,l){l&3&&t!==(t=s[3]+"")&&ue(i,t)},d(s){s&&k(e)}}}function YM(n){let e,t,i,s,l,o;const r=[WM,UM,BM,zM,VM,qM,jM,HM,RM],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(),p(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):(Pe(),P(a[d],1,1,()=>{a[d]=null}),Le(),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))&&p(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 KM(n,e,t){let{record:i}=e,{field:s}=e;function l(o){st.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 U_ extends Ee{constructor(e){super(),Oe(this,e,KM,YM,De,{record:0,field:1})}}function $p(n,e,t){const i=n.slice();return i[35]=e[t],i}function Sp(n,e,t){const i=n.slice();return i[38]=e[t],i}function Cp(n,e,t){const i=n.slice();return i[38]=e[t],i}function JM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(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 ZM(n){let e,t,i,s,l,o=n[38].name+"",r;return{c(){e=_("div"),t=_("i"),s=T(),l=_("span"),r=F(o),p(t,"class",i=W.getFieldTypeIcon(n[38].type)),p(l,"class","txt"),p(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))&&p(t,"class",i),u[0]&2048&&o!==(o=a[38].name+"")&&ue(r,o)},d(a){a&&k(e)}}}function Mp(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:[ZM]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new sn({props:r}),pe.push(()=>Fe(i,"sort",o)),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(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],He(()=>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),q(i,a)}}}function GM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 XM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 Tp(n){let e;function t(l,o){return l[8]?xM:QM}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 QM(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&Dp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No records found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(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=Dp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function xM(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 Dp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Op(n,e){let t,i,s;return i=new U_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(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),q(i,l)}}}function Ep(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,E,O,L,I,N,B;function U(){return e[25](e[35])}h=new Qo({props:{id:e[35].id}});let ee=e[11];const K=te=>te[38].name;for(let te=0;te<ee.length;te+=1){let J=Sp(e,ee,te),_e=K(J);b.set(_e,v[te]=Op(_e,J))}S=new $i({props:{date:e[35].created}}),D=new $i({props:{date:e[35].updated}});function se(){return e[26](e[35])}function Y(...te){return e[27](e[35],...te)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),V(h.$$.fragment),g=T();for(let te=0;te<v.length;te+=1)v[te].c();y=T(),C=_("td"),V(S.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),E=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',L=T(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,J){w(te,t,J),m(t,i),m(i,s),m(s,l),m(s,a),m(s,u),m(t,c),m(t,d),j(h,d,null),m(t,g);for(let _e=0;_e<v.length;_e+=1)v[_e].m(t,null);m(t,y),m(t,C),j(S,C,null),m(t,$),m(t,M),j(D,M,null),m(t,E),m(t,O),m(t,L),I=!0,N||(B=[G(l,"change",U),G(s,"click",ei(e[19])),G(t,"click",se),G(t,"keydown",Y)],N=!0)},p(te,J){e=te,(!I||J[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!I||J[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!I||J[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const _e={};J[0]&8&&(_e.id=e[35].id),h.$set(_e),J[0]&2056&&(ee=e[11],Pe(),v=yt(v,J,K,1,e,ee,b,t,Zt,Op,y,Sp),Le());const be={};J[0]&8&&(be.date=e[35].created),S.$set(be);const X={};J[0]&8&&(X.date=e[35].updated),D.$set(X)},i(te){if(!I){A(h.$$.fragment,te);for(let J=0;J<ee.length;J+=1)A(v[J]);A(S.$$.fragment,te),A(D.$$.fragment,te),I=!0}},o(te){P(h.$$.fragment,te);for(let J=0;J<v.length;J+=1)P(v[J]);P(S.$$.fragment,te),P(D.$$.fragment,te),I=!1},d(te){te&&k(t),q(h);for(let J=0;J<v.length;J+=1)v[J].d();q(S),q(D),N=!1,Ge(B)}}}function Ap(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(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+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Pp(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=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[8]),ie(t,"btn-disabled",n[8]),p(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+"")&&ue(o,l),c[0]&256&&ie(t,"btn-loading",f[8]),c[0]&256&&ie(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Lp(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,g,v,b,y,C;return{c(){e=_("div"),t=_("div"),i=F("Selected "),s=_("strong"),l=F(n[6]),o=T(),a=F(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),h=T(),g=_("button"),g.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ie(f,"btn-disabled",n[9]),p(d,"class","flex-fill"),p(g,"type","button"),p(g,"class","btn btn-sm btn-secondary btn-danger"),ie(g,"btn-loading",n[9]),ie(g,"btn-disabled",n[9]),p(e,"class","bulkbar")},m(S,$){w(S,e,$),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,h),m(e,g),b=!0,y||(C=[G(f,"click",n[30]),G(g,"click",n[31])],y=!0)},p(S,$){(!b||$[0]&64)&&ue(l,S[6]),(!b||$[0]&64)&&r!==(r=S[6]===1?"record":"records")&&ue(a,r),$[0]&512&&ie(f,"btn-disabled",S[9]),$[0]&512&&ie(g,"btn-loading",S[9]),$[0]&512&&ie(g,"btn-disabled",S[9])},i(S){b||(S&&Tt(()=>{v||(v=it(e,Un,{duration:150,y:5},!0)),v.run(1)}),b=!0)},o(S){S&&(v||(v=it(e,Un,{duration:150,y:5},!1)),v.run(0)),b=!1},d(S){S&&k(e),S&&v&&v.end(),y=!1,Ge(C)}}}function eT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v=[],b=new Map,y,C,S,$,M,D,E,O,L,I,N=[],B=new Map,U,ee,K,se,Y,te,J;function _e(ce){n[21](ce)}let be={class:"col-type-text col-field-id",name:"id",$$slots:{default:[JM]},$$scope:{ctx:n}};n[0]!==void 0&&(be.sort=n[0]),d=new sn({props:be}),pe.push(()=>Fe(d,"sort",_e));let X=n[11];const ae=ce=>ce[38].name;for(let ce=0;ce<X.length;ce+=1){let $e=Cp(n,X,ce),Ze=ae($e);b.set(Ze,v[ce]=Mp(Ze,$e))}function ve(ce){n[23](ce)}let H={class:"col-type-date col-field-created",name:"created",$$slots:{default:[GM]},$$scope:{ctx:n}};n[0]!==void 0&&(H.sort=n[0]),C=new sn({props:H}),pe.push(()=>Fe(C,"sort",ve));function me(ce){n[24](ce)}let x={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[XM]},$$scope:{ctx:n}};n[0]!==void 0&&(x.sort=n[0]),M=new sn({props:x}),pe.push(()=>Fe(M,"sort",me));let Q=n[3];const Se=ce=>ce[35].id;for(let ce=0;ce<Q.length;ce+=1){let $e=$p(n,Q,ce),Ze=Se($e);B.set(Ze,N[ce]=Ep(Ze,$e))}let je=null;Q.length||(je=Tp(n));let Ue=n[3].length&&Ap(n),Z=n[3].length&&n[12]&&Pp(n),ge=n[6]&&Lp(n);return{c(){e=_("div"),t=_("table"),i=_("thead"),s=_("tr"),l=_("th"),o=_("div"),r=_("input"),u=T(),f=_("label"),c=T(),V(d.$$.fragment),g=T();for(let ce=0;ce<v.length;ce+=1)v[ce].c();y=T(),V(C.$$.fragment),$=T(),V(M.$$.fragment),E=T(),O=_("th"),L=T(),I=_("tbody");for(let ce=0;ce<N.length;ce+=1)N[ce].c();je&&je.c(),U=T(),Ue&&Ue.c(),ee=T(),Z&&Z.c(),K=T(),ge&&ge.c(),se=Ke(),p(r,"type","checkbox"),p(r,"id","checkbox_0"),r.disabled=a=!n[3].length,r.checked=n[10],p(f,"for","checkbox_0"),p(o,"class","form-field"),p(l,"class","bulk-select-col min-width"),p(O,"class","col-type-action min-width"),p(t,"class","table"),ie(t,"table-loading",n[8]),p(e,"class","table-wrapper")},m(ce,$e){w(ce,e,$e),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),j(d,s,null),m(s,g);for(let Ze=0;Ze<v.length;Ze+=1)v[Ze].m(s,null);m(s,y),j(C,s,null),m(s,$),j(M,s,null),m(s,E),m(s,O),m(t,L),m(t,I);for(let Ze=0;Ze<N.length;Ze+=1)N[Ze].m(I,null);je&&je.m(I,null),w(ce,U,$e),Ue&&Ue.m(ce,$e),w(ce,ee,$e),Z&&Z.m(ce,$e),w(ce,K,$e),ge&&ge.m(ce,$e),w(ce,se,$e),Y=!0,te||(J=G(r,"change",n[20]),te=!0)},p(ce,$e){(!Y||$e[0]&8&&a!==(a=!ce[3].length))&&(r.disabled=a),(!Y||$e[0]&1024)&&(r.checked=ce[10]);const Ze={};$e[1]&4096&&(Ze.$$scope={dirty:$e,ctx:ce}),!h&&$e[0]&1&&(h=!0,Ze.sort=ce[0],He(()=>h=!1)),d.$set(Ze),$e[0]&2049&&(X=ce[11],Pe(),v=yt(v,$e,ae,1,ce,X,b,s,Zt,Mp,y,Cp),Le());const et={};$e[1]&4096&&(et.$$scope={dirty:$e,ctx:ce}),!S&&$e[0]&1&&(S=!0,et.sort=ce[0],He(()=>S=!1)),C.$set(et);const We={};$e[1]&4096&&(We.$$scope={dirty:$e,ctx:ce}),!D&&$e[0]&1&&(D=!0,We.sort=ce[0],He(()=>D=!1)),M.$set(We),$e[0]&76074&&(Q=ce[3],Pe(),N=yt(N,$e,Se,1,ce,Q,B,I,Zt,Ep,null,$p),Le(),!Q.length&&je?je.p(ce,$e):Q.length?je&&(je.d(1),je=null):(je=Tp(ce),je.c(),je.m(I,null))),$e[0]&256&&ie(t,"table-loading",ce[8]),ce[3].length?Ue?Ue.p(ce,$e):(Ue=Ap(ce),Ue.c(),Ue.m(ee.parentNode,ee)):Ue&&(Ue.d(1),Ue=null),ce[3].length&&ce[12]?Z?Z.p(ce,$e):(Z=Pp(ce),Z.c(),Z.m(K.parentNode,K)):Z&&(Z.d(1),Z=null),ce[6]?ge?(ge.p(ce,$e),$e[0]&64&&A(ge,1)):(ge=Lp(ce),ge.c(),A(ge,1),ge.m(se.parentNode,se)):ge&&(Pe(),P(ge,1,1,()=>{ge=null}),Le())},i(ce){if(!Y){A(d.$$.fragment,ce);for(let $e=0;$e<X.length;$e+=1)A(v[$e]);A(C.$$.fragment,ce),A(M.$$.fragment,ce);for(let $e=0;$e<Q.length;$e+=1)A(N[$e]);A(ge),Y=!0}},o(ce){P(d.$$.fragment,ce);for(let $e=0;$e<v.length;$e+=1)P(v[$e]);P(C.$$.fragment,ce),P(M.$$.fragment,ce);for(let $e=0;$e<N.length;$e+=1)P(N[$e]);P(ge),Y=!1},d(ce){ce&&k(e),q(d);for(let $e=0;$e<v.length;$e+=1)v[$e].d();q(C),q(M);for(let $e=0;$e<N.length;$e+=1)N[$e].d();je&&je.d(),ce&&k(U),Ue&&Ue.d(ce),ce&&k(ee),Z&&Z.d(ce),ce&&k(K),ge&&ge.d(ce),ce&&k(se),te=!1,J()}}}function tT(n,e,t){let i,s,l,o;const r=on();let{collection:a}=e,{sort:u=""}=e,{filter:f=""}=e,c=[],d=1,h=0,g={},v=!0,b=!1;async function y(X=1){if(!!(a!=null&&a.id))return t(8,v=!0),X<=1&&C(),we.records.getList(a.id,X,50,{sort:u,filter:f}).then(ae=>{t(8,v=!1),t(3,c=c.concat(ae.items)),t(7,d=ae.page),t(4,h=ae.totalItems),r("load",c)}).catch(ae=>{ae!=null&&ae.isAbort||(t(8,v=!1),console.warn(ae),C(),we.errorResponseHandler(ae,!1))})}function C(){t(3,c=[]),t(7,d=1),t(4,h=0),t(5,g={})}function S(){o?$():M()}function $(){t(5,g={})}function M(){for(const X of c)t(5,g[X.id]=X,g);t(5,g)}function D(X){g[X.id]?delete g[X.id]:t(5,g[X.id]=X,g),t(5,g)}function E(){pi(`Do you really want to delete the selected ${l===1?"record":"records"}?`,O)}async function O(){if(b||!l)return;let X=[];for(const ae of Object.keys(g))X.push(we.records.delete(a==null?void 0:a.id,ae));return t(9,b=!0),Promise.all(X).then(()=>{cn(`Successfully deleted the selected ${l===1?"record":"records"}.`),$()}).catch(ae=>{we.errorResponseHandler(ae)}).finally(()=>(t(9,b=!1),y()))}function L(X){st.call(this,n,X)}const I=()=>S();function N(X){u=X,t(0,u)}function B(X){u=X,t(0,u)}function U(X){u=X,t(0,u)}function ee(X){u=X,t(0,u)}const K=X=>D(X),se=X=>r("select",X),Y=(X,ae)=>{ae.code==="Enter"&&(ae.preventDefault(),r("select",X))},te=()=>t(1,f=""),J=()=>y(d+1),_e=()=>$(),be=()=>E();return n.$$set=X=>{"collection"in X&&t(18,a=X.collection),"sort"in X&&t(0,u=X.sort),"filter"in X&&t(1,f=X.filter)},n.$$.update=()=>{n.$$.dirty[0]&262147&&a&&a.id&&u!==-1&&f!==-1&&(C(),y(1)),n.$$.dirty[0]&24&&t(12,i=h>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,h,g,l,d,v,b,o,s,i,r,S,$,D,E,a,L,I,N,B,U,ee,K,se,Y,te,J,_e,be]}class nT extends Ee{constructor(e){super(),Oe(this,e,tT,eT,De,{collection:18,sort:0,filter:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}function iT(n){let e,t,i,s;return e=new X3({}),i=new On({props:{$$slots:{default:[oT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o&1073741951&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function sT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[rT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741832&&(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){q(e,i)}}}function lT(n){let e,t;return e=new On({props:{center:!0,$$slots:{default:[aT]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1073741824&&(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){q(e,i)}}}function oT(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I;d=new Uo({}),d.$on("refresh",n[13]),S=new Bo({props:{value:n[0],autocompleteCollection:n[2]}}),S.$on("submit",n[16]);function N(ee){n[18](ee)}function B(ee){n[19](ee)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),M=new nT({props:U}),n[17](M),pe.push(()=>Fe(M,"filter",N)),pe.push(()=>Fe(M,"sort",B)),M.$on("select",n[20]),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Collections",s=T(),l=_("div"),r=F(o),a=T(),u=_("div"),f=_("button"),f.innerHTML='<i class="ri-settings-4-line"></i>',c=T(),V(d.$$.fragment),h=T(),g=_("div"),v=_("button"),v.innerHTML=`<i class="ri-code-s-slash-line"></i>
|
||
<span class="txt">API Preview</span>`,b=T(),y=_("button"),y.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New record</span>`,C=T(),V(S.$$.fragment),$=T(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"type","button"),p(f,"class","btn btn-secondary btn-circle"),p(u,"class","inline-flex gap-5"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(g,"class","btns-group"),p(e,"class","page-header")},m(ee,K){w(ee,e,K),m(e,t),m(t,i),m(t,s),m(t,l),m(l,r),m(e,a),m(e,u),m(u,f),m(u,c),j(d,u,null),m(e,h),m(e,g),m(g,v),m(g,b),m(g,y),w(ee,C,K),j(S,ee,K),w(ee,$,K),j(M,ee,K),O=!0,L||(I=[Ye(wt.call(null,f,{text:"Edit collection",position:"right"})),G(f,"click",n[12]),G(v,"click",n[14]),G(y,"click",n[15])],L=!0)},p(ee,K){(!O||K&4)&&o!==(o=ee[2].name+"")&&ue(r,o);const se={};K&1&&(se.value=ee[0]),K&4&&(se.autocompleteCollection=ee[2]),S.$set(se);const Y={};K&4&&(Y.collection=ee[2]),!D&&K&1&&(D=!0,Y.filter=ee[0],He(()=>D=!1)),!E&&K&2&&(E=!0,Y.sort=ee[1],He(()=>E=!1)),M.$set(Y)},i(ee){O||(A(d.$$.fragment,ee),A(S.$$.fragment,ee),A(M.$$.fragment,ee),O=!0)},o(ee){P(d.$$.fragment,ee),P(S.$$.fragment,ee),P(M.$$.fragment,ee),O=!1},d(ee){ee&&k(e),q(d),ee&&k(C),q(S,ee),ee&&k($),n[17](null),q(M,ee),L=!1,Ge(I)}}}function rT(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>`,p(t,"class","icon"),p(s,"class","m-b-10"),p(o,"type","button"),p(o,"class","btn btn-expanded-lg btn-lg"),p(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,d(u){u&&k(e),r=!1,a()}}}function aT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function uT(n){let e,t,i,s,l,o,r,a,u;const f=[lT,sT,iT],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Ja({props:h}),n[21](s);let g={};o=new WC({props:g}),n[22](o);let v={collection:n[2]};return a=new B_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,[y]){let C=e;e=d(b),e===C?c[e].p(b,y):(Pe(),P(c[C],1,1,()=>{c[C]=null}),Le(),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={};s.$set(S);const $={};o.$set($);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),q(s,b),b&&k(l),n[22](null),q(o,b),b&&k(r),n[23](null),q(a,b)}}}function fT(n,e,t){let i,s,l,o,r,a;bt(n,ci,Y=>t(2,s=Y)),bt(n,Ds,Y=>t(10,l=Y)),bt(n,Ro,Y=>t(26,o=Y)),bt(n,Ft,Y=>t(27,r=Y)),bt(n,sa,Y=>t(8,a=Y)),dn(Ft,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,h,g=u.get("filter")||"",v=u.get("sort")||"-created",b=u.get("collectionId")||"";function y(){t(9,b=s.id),t(1,v="-created"),t(0,g="")}_$(b);const C=()=>f==null?void 0:f.show(),S=()=>f==null?void 0:f.show(s),$=()=>h==null?void 0:h.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),E=Y=>t(0,g=Y.detail);function O(Y){pe[Y?"unshift":"push"](()=>{h=Y,t(6,h)})}function L(Y){g=Y,t(0,g)}function I(Y){v=Y,t(1,v)}const N=Y=>d==null?void 0:d.show(Y==null?void 0:Y.detail);function B(Y){pe[Y?"unshift":"push"](()=>{f=Y,t(3,f)})}function U(Y){pe[Y?"unshift":"push"](()=>{c=Y,t(4,c)})}function ee(Y){pe[Y?"unshift":"push"](()=>{d=Y,t(5,d)})}const K=()=>h==null?void 0:h.load(),se=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(Y=>Y.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||g||(s==null?void 0:s.id))){const Y=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();Si("/collections?"+Y)}},[g,v,s,f,c,d,h,i,a,b,l,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se]}class cT extends Ee{constructor(e){super(),Oe(this,e,fT,uT,De,{})}}function Ip(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[dT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function dT(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"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(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])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(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 Fp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye(wt.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Fp();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,g){w(h,e,g),m(e,t),m(e,i),m(e,s),w(h,o,g),d&&d.m(h,g),w(h,r,g),w(h,a,g),Te(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,g){g[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Fp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&&u!==(u=h[31])&&p(a,"id",u),g[0]&4&&a.value!==h[2]&&Te(a,h[2])},d(h){h&&k(e),h&&k(o),d&&d.d(h),h&&k(r),h&&k(a),f=!1,c()}}}function Np(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[hT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function hT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(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])&&p(e,"id",t),f[0]&8&&(e.checked=u[3]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Rp(n){let e,t,i,s,l,o,r,a,u;return s=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[mT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[gT,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(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 h={};c[0]&256|c[1]&3&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Tt(()=>{a||(a=it(t,tn,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=it(t,tn,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(s),q(r),f&&a&&a.end()}}}function mT(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"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(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),Te(r,n[7]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&128&&r.value!==c[7]&&Te(r,c[7])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function gT(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"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(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),Te(r,n[8]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[1]&1&&l!==(l=c[31])&&p(e,"for",l),d[1]&1&&a!==(a=c[31])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Te(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Hp(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[_T,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function _T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Send verification email"),p(e,"type","checkbox"),p(e,"id",t=n[31]),p(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])&&p(e,"id",t),f[0]&512&&(e.checked=u[9]),f[1]&1&&o!==(o=u[31])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function bT(n){let e,t,i,s,l,o,r,a,u,f=!n[1].isNew&&Ip(n);i=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[pT,({uniqueId:g})=>({31:g}),({uniqueId:g})=>[0,g?1:0]]},$$scope:{ctx:n}}});let c=!n[1].isNew&&Np(n),d=(n[1].isNew||n[3])&&Rp(n),h=n[1].isNew&&Hp(n);return{c(){e=_("form"),f&&f.c(),t=T(),V(i.$$.fragment),s=T(),c&&c.c(),l=T(),d&&d.c(),o=T(),h&&h.c(),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(g,v){w(g,e,v),f&&f.m(e,null),m(e,t),j(i,e,null),m(e,s),c&&c.m(e,null),m(e,l),d&&d.m(e,null),m(e,o),h&&h.m(e,null),r=!0,a||(u=G(e,"submit",Yt(n[12])),a=!0)},p(g,v){g[1].isNew?f&&(Pe(),P(f,1,1,()=>{f=null}),Le()):f?(f.p(g,v),v[0]&2&&A(f,1)):(f=Ip(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&&(Pe(),P(c,1,1,()=>{c=null}),Le()):c?(c.p(g,v),v[0]&2&&A(c,1)):(c=Np(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=Rp(g),d.c(),A(d,1),d.m(e,o)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le()),g[1].isNew?h?(h.p(g,v),v[0]&2&&A(h,1)):(h=Hp(g),h.c(),A(h,1),h.m(e,null)):h&&(Pe(),P(h,1,1,()=>{h=null}),Le())},i(g){r||(A(f),A(i.$$.fragment,g),A(c),A(d),A(h),r=!0)},o(g){P(f),P(i.$$.fragment,g),P(c),P(d),P(h),r=!1},d(g){g&&k(e),f&&f.d(),q(i),c&&c.d(),d&&d.d(),h&&h.d(),a=!1,u()}}}function vT(n){let e,t=n[1].isNew?"New user":"Edit user",i;return{c(){e=_("h4"),i=F(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")&&ue(i,t)},d(s){s&&k(e)}}}function jp(n){let e,t,i,s,l,o,r,a,u;return o=new Mi({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[yT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),V(o.$$.fragment),r=T(),a=_("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),j(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),q(o),f&&k(r),f&&k(a)}}}function qp(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>`,p(e,"type","button"),p(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 yT(n){let e,t,i,s,l=!n[1].verified&&qp(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>`,p(t,"type","button"),p(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=qp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function kT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&jp(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ie(l,"btn-loading",n[5])},m(g,v){h&&h.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?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=jp(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",g[5])},i(g){f||(A(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function wT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[kT],header:[vT],default:[bT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function $T(n,e,t){let i;const s=on(),l="user_"+W.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",h=!1,g=!0;function v(te){return y(te),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(te){hi({}),t(1,r=te!=null&&te.clone?te.clone():new co),C()}function C(){t(3,h=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const te={email:f};(r.isNew||h)&&(te.password=c,te.passwordConfirm=d);let J;r.isNew?J=we.users.create(te):J=we.users.update(r.id,te),J.then(async _e=>{g&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",_e)}).catch(_e=>{we.errorResponseHandler(_e)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected user?",()=>we.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{we.errorResponseHandler(te)}))}function M(te=!0){return we.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(J=>{we.errorResponseHandler(J)})}const D=()=>M(),E=()=>$(),O=()=>b();function L(){f=this.value,t(2,f)}function I(){h=this.checked,t(3,h)}function N(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function U(){g=this.checked,t(9,g)}const ee=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function K(te){pe[te?"unshift":"push"](()=>{o=te,t(4,o)})}function se(te){st.call(this,n,te)}function Y(te){st.call(this,n,te)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,g,i,l,S,$,M,v,D,E,O,L,I,N,B,U,ee,K,se,Y]}class ST extends Ee{constructor(e){super(),Oe(this,e,$T,wT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Vp(n,e,t){const i=n.slice();return i[40]=e[t],i}function zp(n,e,t){const i=n.slice();return i[43]=e[t],i}function Bp(n,e,t){const i=n.slice();return i[43]=e[t],i}function CT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I=[],N=new Map,B,U,ee,K,se,Y,te,J,_e,be,X=[],ae=new Map,ve,H,me,x,Q,Se;a=new Uo({}),a.$on("refresh",n[17]),g=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}}),g.$on("submit",n[19]);function je(ye){n[20](ye)}let Ue={class:"col-type-text col-field-id",name:"id",$$slots:{default:[TT]},$$scope:{ctx:n}};n[4]!==void 0&&(Ue.sort=n[4]),$=new sn({props:Ue}),pe.push(()=>Fe($,"sort",je));function Z(ye){n[21](ye)}let ge={class:"col-type-email col-field-email",name:"email",$$slots:{default:[DT]},$$scope:{ctx:n}};n[4]!==void 0&&(ge.sort=n[4]),E=new sn({props:ge}),pe.push(()=>Fe(E,"sort",Z));let ce=n[12];const $e=ye=>ye[43].name;for(let ye=0;ye<ce.length;ye+=1){let Ne=Bp(n,ce,ye),ct=$e(Ne);N.set(ct,I[ye]=Up(ct,Ne))}function Ze(ye){n[22](ye)}let et={class:"col-type-date col-field-created",name:"created",$$slots:{default:[OT]},$$scope:{ctx:n}};n[4]!==void 0&&(et.sort=n[4]),U=new sn({props:et}),pe.push(()=>Fe(U,"sort",Ze));function We(ye){n[23](ye)}let tt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[ET]},$$scope:{ctx:n}};n[4]!==void 0&&(tt.sort=n[4]),se=new sn({props:tt}),pe.push(()=>Fe(se,"sort",We));let Me=n[1];const ze=ye=>ye[40].id;for(let ye=0;ye<Me.length;ye+=1){let Ne=Vp(n,Me,ye),ct=ze(Ne);ae.set(ct,X[ye]=Jp(ct,Ne))}let Xe=null;Me.length||(Xe=Wp(n));let nt=n[1].length&&Zp(n),ut=n[1].length&&n[13]&&Gp(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),s=F(n[14]),l=T(),o=_("button"),o.innerHTML='<i class="ri-settings-4-line"></i>',r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=T(),d=_("button"),d.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New user</span>`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),V($.$$.fragment),D=T(),V(E.$$.fragment),L=T();for(let ye=0;ye<I.length;ye+=1)I[ye].c();B=T(),V(U.$$.fragment),K=T(),V(se.$$.fragment),te=T(),J=_("th"),_e=T(),be=_("tbody");for(let ye=0;ye<X.length;ye+=1)X[ye].c();Xe&&Xe.c(),ve=T(),nt&&nt.c(),H=T(),ut&&ut.c(),me=Ke(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(o,"type","button"),p(o,"class","btn btn-secondary btn-circle"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(J,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[10]),p(b,"class","table-wrapper")},m(ye,Ne){w(ye,e,Ne),m(e,t),m(t,i),m(i,s),m(e,l),m(e,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(ye,h,Ne),j(g,ye,Ne),w(ye,v,Ne),w(ye,b,Ne),m(b,y),m(y,C),m(C,S),j($,S,null),m(S,D),j(E,S,null),m(S,L);for(let ct=0;ct<I.length;ct+=1)I[ct].m(S,null);m(S,B),j(U,S,null),m(S,K),j(se,S,null),m(S,te),m(S,J),m(y,_e),m(y,be);for(let ct=0;ct<X.length;ct+=1)X[ct].m(be,null);Xe&&Xe.m(be,null),w(ye,ve,Ne),nt&&nt.m(ye,Ne),w(ye,H,Ne),ut&&ut.m(ye,Ne),w(ye,me,Ne),x=!0,Q||(Se=[Ye(wt.call(null,o,{text:"Edit profile collection",position:"right"})),G(o,"click",n[16]),G(d,"click",n[18])],Q=!0)},p(ye,Ne){(!x||Ne[0]&16384)&&ue(s,ye[14]);const ct={};Ne[0]&8&&(ct.value=ye[3]),g.$set(ct);const Dt={};Ne[1]&131072&&(Dt.$$scope={dirty:Ne,ctx:ye}),!M&&Ne[0]&16&&(M=!0,Dt.sort=ye[4],He(()=>M=!1)),$.$set(Dt);const dt={};Ne[1]&131072&&(dt.$$scope={dirty:Ne,ctx:ye}),!O&&Ne[0]&16&&(O=!0,dt.sort=ye[4],He(()=>O=!1)),E.$set(dt),Ne[0]&4096&&(ce=ye[12],I=yt(I,Ne,$e,1,ye,ce,N,S,Mn,Up,B,Bp));const lt={};Ne[1]&131072&&(lt.$$scope={dirty:Ne,ctx:ye}),!ee&&Ne[0]&16&&(ee=!0,lt.sort=ye[4],He(()=>ee=!1)),U.$set(lt);const Lt={};Ne[1]&131072&&(Lt.$$scope={dirty:Ne,ctx:ye}),!Y&&Ne[0]&16&&(Y=!0,Lt.sort=ye[4],He(()=>Y=!1)),se.$set(Lt),Ne[0]&5450&&(Me=ye[1],Pe(),X=yt(X,Ne,ze,1,ye,Me,ae,be,Zt,Jp,null,Vp),Le(),!Me.length&&Xe?Xe.p(ye,Ne):Me.length?Xe&&(Xe.d(1),Xe=null):(Xe=Wp(ye),Xe.c(),Xe.m(be,null))),Ne[0]&1024&&ie(y,"table-loading",ye[10]),ye[1].length?nt?nt.p(ye,Ne):(nt=Zp(ye),nt.c(),nt.m(H.parentNode,H)):nt&&(nt.d(1),nt=null),ye[1].length&&ye[13]?ut?ut.p(ye,Ne):(ut=Gp(ye),ut.c(),ut.m(me.parentNode,me)):ut&&(ut.d(1),ut=null)},i(ye){if(!x){A(a.$$.fragment,ye),A(g.$$.fragment,ye),A($.$$.fragment,ye),A(E.$$.fragment,ye),A(U.$$.fragment,ye),A(se.$$.fragment,ye);for(let Ne=0;Ne<Me.length;Ne+=1)A(X[Ne]);x=!0}},o(ye){P(a.$$.fragment,ye),P(g.$$.fragment,ye),P($.$$.fragment,ye),P(E.$$.fragment,ye),P(U.$$.fragment,ye),P(se.$$.fragment,ye);for(let Ne=0;Ne<X.length;Ne+=1)P(X[Ne]);x=!1},d(ye){ye&&k(e),q(a),ye&&k(h),q(g,ye),ye&&k(v),ye&&k(b),q($),q(E);for(let Ne=0;Ne<I.length;Ne+=1)I[Ne].d();q(U),q(se);for(let Ne=0;Ne<X.length;Ne+=1)X[Ne].d();Xe&&Xe.d(),ye&&k(ve),nt&&nt.d(ye),ye&&k(H),ut&&ut.d(ye),ye&&k(me),Q=!1,Ge(Se)}}}function MT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
<h1>Loading users...</h1>`,p(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 TT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(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 DT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(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 Up(n,e){let t,i,s,l,o,r,a,u=e[43].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=F("profile."),f=F(u),p(s,"class",l=W.getFieldTypeIcon(e[43].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[43].type+" col-field-"+e[43].name),p(t,"name",d=e[43].name),this.first=t},m(h,g){w(h,t,g),m(t,i),m(i,s),m(i,o),m(i,r),m(r,a),m(r,f)},p(h,g){e=h,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[43].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[43].name+"")&&ue(f,u),g[0]&4096&&c!==(c="col-type-"+e[43].type+" col-field-"+e[43].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[43].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function OT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 ET(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 Wp(n){let e;function t(l,o){return l[10]?PT:AT}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 AT(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Yp(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(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=Yp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function PT(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 Yp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[26]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function Kp(n,e){let t,i,s;return i=new U_({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[43]),o[0]&2&&(r.record=e[40].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),q(i,l)}}}function Jp(n,e){let t,i,s,l,o,r,a,u=e[40].email+"",f,c,d,h,g=e[40].verified?"Verified":"Unverified",v,b,y=[],C=new Map,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y;s=new Qo({props:{id:e[40].id}});let te=e[12];const J=X=>X[43].name;for(let X=0;X<te.length;X+=1){let ae=zp(e,te,X),ve=J(ae);C.set(ve,y[X]=Kp(ve,ae))}M=new $i({props:{date:e[40].created}}),O=new $i({props:{date:e[40].updated}});function _e(){return e[24](e[40])}function be(){return e[25](e[40])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),V(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=F(u),d=T(),h=_("span"),v=F(g),b=T();for(let X=0;X<y.length;X+=1)y[X].c();S=T(),$=_("td"),V(M.$$.fragment),D=T(),E=_("td"),V(O.$$.fragment),L=T(),I=_("td"),N=_("button"),N.innerHTML=`<i class="ri-user-settings-line"></i>
|
||
<span class="txt">Edit user</span>`,B=T(),U=_("button"),U.innerHTML=`<i class="ri-profile-line"></i>
|
||
<span class="txt">Edit profile</span>`,ee=T(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[40].email),p(h,"class","label"),ie(h,"label-success",e[40].verified),ie(h,"label-warning",!e[40].verified),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(E,"class","col-type-date col-field-updated"),p(N,"type","button"),p(N,"class","btn btn-sm btn-outline"),p(U,"type","button"),p(U,"class","btn btn-sm m-l-10"),p(I,"class","col-type-action min-width"),this.first=t},m(X,ae){w(X,t,ae),m(t,i),j(s,i,null),m(t,l),m(t,o),m(o,r),m(r,a),m(a,f),m(r,d),m(r,h),m(h,v),m(t,b);for(let ve=0;ve<y.length;ve+=1)y[ve].m(t,null);m(t,S),m(t,$),j(M,$,null),m(t,D),m(t,E),j(O,E,null),m(t,L),m(t,I),m(I,N),m(I,B),m(I,U),m(t,ee),K=!0,se||(Y=[G(N,"click",ei(_e)),G(U,"click",ei(be))],se=!0)},p(X,ae){e=X;const ve={};ae[0]&2&&(ve.id=e[40].id),s.$set(ve),(!K||ae[0]&2)&&u!==(u=e[40].email+"")&&ue(f,u),(!K||ae[0]&2&&c!==(c=e[40].email))&&p(a,"title",c),(!K||ae[0]&2)&&g!==(g=e[40].verified?"Verified":"Unverified")&&ue(v,g),ae[0]&2&&ie(h,"label-success",e[40].verified),ae[0]&2&&ie(h,"label-warning",!e[40].verified),ae[0]&4098&&(te=e[12],Pe(),y=yt(y,ae,J,1,e,te,C,t,Zt,Kp,S,zp),Le());const H={};ae[0]&2&&(H.date=e[40].created),M.$set(H);const me={};ae[0]&2&&(me.date=e[40].updated),O.$set(me)},i(X){if(!K){A(s.$$.fragment,X);for(let ae=0;ae<te.length;ae+=1)A(y[ae]);A(M.$$.fragment,X),A(O.$$.fragment,X),K=!0}},o(X){P(s.$$.fragment,X);for(let ae=0;ae<y.length;ae+=1)P(y[ae]);P(M.$$.fragment,X),P(O.$$.fragment,X),K=!1},d(X){X&&k(t),q(s);for(let ae=0;ae<y.length;ae+=1)y[ae].d();q(M),q(O),se=!1,Ge(Y)}}}function Zp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[2]),p(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+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function Gp(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=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[10]),ie(t,"btn-disabled",n[10]),p(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[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,l),c[0]&1024&&ie(t,"btn-loading",f[10]),c[0]&1024&&ie(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function LT(n){let e,t,i,s;const l=[MT,CT],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Ke()},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):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),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 IT(n){let e,t,i,s,l,o,r,a;e=new On({props:{$$slots:{default:[LT]},$$scope:{ctx:n}}});let u={};i=new ST({props:u}),n[28](i),i.$on("save",n[29]),i.$on("delete",n[30]);let f={};l=new Ja({props:f}),n[31](l),l.$on("save",n[32]);let c={collection:n[5]};return r=new B_({props:c}),n[33](r),r.$on("save",n[34]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment),o=T(),V(r.$$.fragment)},m(d,h){j(e,d,h),w(d,t,h),j(i,d,h),w(d,s,h),j(l,d,h),w(d,o,h),j(r,d,h),a=!0},p(d,h){const g={};h[0]&32766|h[1]&131072&&(g.$$scope={dirty:h,ctx:d}),e.$set(g);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(A(e.$$.fragment,d),A(i.$$.fragment,d),A(l.$$.fragment,d),A(r.$$.fragment,d),a=!0)},o(d){P(e.$$.fragment,d),P(i.$$.fragment,d),P(l.$$.fragment,d),P(r.$$.fragment,d),a=!1},d(d){q(e,d),d&&k(t),n[28](null),q(i,d),d&&k(s),n[31](null),q(l,d),d&&k(o),n[33](null),q(r,d)}}}function FT(n,e,t){let i,s,l,o;bt(n,Ro,x=>t(35,l=x)),bt(n,Ft,x=>t(14,o=x)),dn(Ft,o="Users",o);const r=new URLSearchParams(l),a=["id","userId","created","updated"];let u,f,c,d=[],h=1,g=0,v=!1,b=r.get("filter")||"",y=r.get("sort")||"-created",C=new fn,S=!1;E();async function $(x=1){return t(10,v=!0),x<=1&&M(),we.users.getList(x,50,{sort:y||"-created",filter:b}).then(Q=>{t(10,v=!1),t(1,d=d.concat(Q.items)),t(9,h=Q.page),t(2,g=Q.totalItems)}).catch(Q=>{Q!=null&&Q.isAbort||(t(10,v=!1),console.warn(Q),M(),we.errorResponseHandler(Q,!1))})}function M(){t(1,d=[]),t(9,h=1),t(2,g=0)}function D(x){const Q=d.find(Se=>Se.id===(x==null?void 0:x.userId));Q&&(Q.profile=x),t(1,d)}async function E(){t(11,S=!0);try{t(5,C=await we.collections.getOne("profiles"))}catch(x){we.errorResponseHandler(x)}t(11,S=!1)}const O=()=>f==null?void 0:f.show(C),L=()=>$(),I=()=>u==null?void 0:u.show(),N=x=>t(3,b=x.detail);function B(x){y=x,t(4,y)}function U(x){y=x,t(4,y)}function ee(x){y=x,t(4,y)}function K(x){y=x,t(4,y)}const se=x=>u==null?void 0:u.show(x),Y=x=>c==null?void 0:c.show(x.profile),te=()=>t(3,b=""),J=()=>$(h+1);function _e(x){pe[x?"unshift":"push"](()=>{u=x,t(6,u)})}const be=()=>$(),X=()=>$();function ae(x){pe[x?"unshift":"push"](()=>{f=x,t(7,f)})}const ve=x=>t(5,C=x.detail);function H(x){pe[x?"unshift":"push"](()=>{c=x,t(8,c)})}const me=x=>D(x.detail);return n.$$.update=()=>{var x;if(n.$$.dirty[0]&24&&y!==-1&&b!==-1){const Q=new URLSearchParams({filter:b,sort:y}).toString();Si("/users?"+Q),$()}n.$$.dirty[0]&6&&t(13,i=g>d.length),n.$$.dirty[0]&32&&t(12,s=(x=C==null?void 0:C.schema)==null?void 0:x.filter(Q=>!a.includes(Q.name)))},[$,d,g,b,y,C,u,f,c,h,v,S,s,i,o,D,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be,X,ae,ve,H,me]}class NT extends Ee{constructor(e){super(),Oe(this,e,FT,IT,De,{loadUsers:0},null,[-1,-1])}get loadUsers(){return this.$$.ctx[0]}}function RT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L;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.innerHTML=`<span class="txt">Sync</span>
|
||
<small class="label label-danger label-sm">Experimental</small>`,d=T(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
|
||
<span class="txt">Export collections</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
|
||
<span class="txt">Import collections</span>`,b=T(),y=_("div"),y.textContent="Authentication",C=T(),S=_("a"),S.innerHTML=`<i class="ri-lock-password-line"></i>
|
||
<span class="txt">Auth providers</span>`,$=T(),M=_("a"),M.innerHTML=`<i class="ri-key-line"></i>
|
||
<span class="txt">Token options</span>`,D=T(),E=_("a"),E.innerHTML=`<i class="ri-shield-user-line"></i>
|
||
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(S,"href","/settings/auth-providers"),p(S,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(E,"href","/settings/admins"),p(E,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(I,N){w(I,e,N),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,h),m(t,g),m(t,v),m(t,b),m(t,y),m(t,C),m(t,S),m(t,$),m(t,M),m(t,D),m(t,E),O||(L=[Ye(jn.call(null,l,{path:"/settings"})),Ye(mn.call(null,l)),Ye(jn.call(null,r,{path:"/settings/mail/?.*"})),Ye(mn.call(null,r)),Ye(jn.call(null,u,{path:"/settings/storage/?.*"})),Ye(mn.call(null,u)),Ye(jn.call(null,h,{path:"/settings/export-collections/?.*"})),Ye(mn.call(null,h)),Ye(jn.call(null,v,{path:"/settings/import-collections/?.*"})),Ye(mn.call(null,v)),Ye(jn.call(null,S,{path:"/settings/auth-providers/?.*"})),Ye(mn.call(null,S)),Ye(jn.call(null,M,{path:"/settings/tokens/?.*"})),Ye(mn.call(null,M)),Ye(jn.call(null,E,{path:"/settings/admins/?.*"})),Ye(mn.call(null,E))],O=!0)},p:oe,i:oe,o:oe,d(I){I&&k(e),O=!1,Ge(L)}}}class Bi extends Ee{constructor(e){super(),Oe(this,e,null,RT,De,{})}}function Xp(n,e,t){const i=n.slice();return i[31]=e[t],i}function Qp(n){let e,t;return e=new Re({props:{class:"form-field disabled",name:"id",$$slots:{default:[HT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function HT(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"),p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(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])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(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 xp(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(),xn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(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"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Ge(r)}}}function jT(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"),p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(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),Te(r,n[3]),u||(f=G(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Te(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function eh(n){let e,t;return e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[qT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(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){q(e,i)}}}function qT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(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])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function th(n){let e,t,i,s,l,o,r,a,u;return s=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[VT,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new Re({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[zT,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),m(e,t),m(t,i),j(s,i,null),m(t,l),m(t,o),j(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 h={};c[0]&1073742336|c[1]&8&&(h.$$scope={dirty:c,ctx:f}),r.$set(h)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Tt(()=>{a||(a=it(t,tn,{duration:150},!0)),a.run(1)}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=it(t,tn,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),q(s),q(r),f&&a&&a.end()}}}function VT(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"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(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),Te(r,n[8]),u||(f=G(r,"input",n[21]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&256&&r.value!==c[8]&&Te(r,c[8])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function zT(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"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(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),Te(r,n[9]),u||(f=G(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&Te(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function BT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g=!n[1].isNew&&Qp(n),v=[0,1,2,3,4,5,6,7,8,9],b=[];for(let S=0;S<10;S+=1)b[S]=xp(Xp(n,v,S));a=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[jT,({uniqueId:S})=>({30:S}),({uniqueId:S})=>[S?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[1].isNew&&eh(n),C=(n[1].isNew||n[4])&&th(n);return{c(){e=_("form"),g&&g.c(),t=T(),i=_("div"),s=_("p"),s.textContent="Avatar",l=T(),o=_("div");for(let S=0;S<10;S+=1)b[S].c();r=T(),V(a.$$.fragment),u=T(),y&&y.c(),f=T(),C&&C.c(),p(s,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[11]),p(e,"class","grid"),p(e,"autocomplete","off")},m(S,$){w(S,e,$),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),j(a,e,null),m(e,u),y&&y.m(e,null),m(e,f),C&&C.m(e,null),c=!0,d||(h=G(e,"submit",Yt(n[12])),d=!0)},p(S,$){if(S[1].isNew?g&&(Pe(),P(g,1,1,()=>{g=null}),Le()):g?(g.p(S,$),$[0]&2&&A(g,1)):(g=Qp(S),g.c(),A(g,1),g.m(e,t)),$[0]&4){v=[0,1,2,3,4,5,6,7,8,9];let D;for(D=0;D<10;D+=1){const E=Xp(S,v,D);b[D]?b[D].p(E,$):(b[D]=xp(E),b[D].c(),b[D].m(o,null))}for(;D<10;D+=1)b[D].d(1)}const M={};$[0]&1073741832|$[1]&8&&(M.$$scope={dirty:$,ctx:S}),a.$set(M),S[1].isNew?y&&(Pe(),P(y,1,1,()=>{y=null}),Le()):y?(y.p(S,$),$[0]&2&&A(y,1)):(y=eh(S),y.c(),A(y,1),y.m(e,f)),S[1].isNew||S[4]?C?(C.p(S,$),$[0]&18&&A(C,1)):(C=th(S),C.c(),A(C,1),C.m(e,null)):C&&(Pe(),P(C,1,1,()=>{C=null}),Le())},i(S){c||(A(g),A(a.$$.fragment,S),A(y),A(C),c=!0)},o(S){P(g),P(a.$$.fragment,S),P(y),P(C),c=!1},d(S){S&&k(e),g&&g.d(),Qt(b,S),q(a),y&&y.d(),C&&C.d(),d=!1,h()}}}function UT(n){let e,t=n[1].isNew?"New admin":"Edit admin",i;return{c(){e=_("h4"),i=F(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")&&ue(i,t)},d(s){s&&k(e)}}}function nh(n){let e,t,i,s,l,o,r,a,u;return o=new Mi({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[WT]},$$scope:{ctx:n}}}),{c(){e=_("button"),t=_("span"),i=T(),s=_("i"),l=T(),V(o.$$.fragment),r=T(),a=_("div"),p(s,"class","ri-more-line"),p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-secondary"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),m(e,t),m(e,i),m(e,s),m(e,l),j(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),q(o),f&&k(r),f&&k(a)}}}function WT(n){let e,t,i;return{c(){e=_("button"),e.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},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 YT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&nh(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ie(l,"btn-loading",n[6])},m(g,v){h&&h.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?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(g,v),v[0]&2&&A(h,1)):(h=nh(g),h.c(),A(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ie(l,"btn-loading",g[6])},i(g){f||(A(h),f=!0)},o(g){P(h),f=!1},d(g){h&&h.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function KT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[YT],header:[UT],default:[BT]},$$scope:{ctx:n}};return e=new mi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function JT(n,e,t){let i;const s=on(),l="admin_"+W.randomString(5);let o,r=new $s,a=!1,u=!1,f=0,c="",d="",h="",g=!1;function v(Y){return y(Y),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Y){hi({}),t(1,r=Y!=null&&Y.clone?Y.clone():new $s),C()}function C(){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,h="")}function S(){if(a||!i)return;t(6,a=!0);const Y={email:c,avatar:f};(r.isNew||g)&&(Y.password=d,Y.passwordConfirm=h);let te;r.isNew?te=we.admins.create(Y):te=we.admins.update(r.id,Y),te.then(async J=>{var _e;t(7,u=!1),b(),cn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",J),((_e=we.authStore.model)==null?void 0:_e.id)===J.id&&we.authStore.save(we.authStore.token,J)}).catch(J=>{we.errorResponseHandler(J)}).finally(()=>{t(6,a=!1)})}function $(){!(r!=null&&r.id)||pi("Do you really want to delete the selected admin?",()=>we.admins.delete(r.id).then(()=>{t(7,u=!1),b(),cn("Successfully deleted admin."),s("delete",r)}).catch(Y=>{we.errorResponseHandler(Y)}))}const M=()=>$(),D=()=>b(),E=Y=>t(2,f=Y),O=(Y,te)=>{(te.code==="Enter"||te.code==="Space")&&(te.preventDefault(),t(2,f=Y))};function L(){c=this.value,t(3,c)}function I(){g=this.checked,t(4,g)}function N(){d=this.value,t(8,d)}function B(){h=this.value,t(9,h)}const U=()=>i&&u?(pi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function ee(Y){pe[Y?"unshift":"push"](()=>{o=Y,t(5,o)})}function K(Y){st.call(this,n,Y)}function se(Y){st.call(this,n,Y)}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,h,i,l,S,$,v,M,D,E,O,L,I,N,B,U,ee,K,se]}class ZT extends Ee{constructor(e){super(),Oe(this,e,JT,KT,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function ih(n,e,t){const i=n.slice();return i[24]=e[t],i}function GT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(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 XT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(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 QT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 xT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(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 sh(n){let e;function t(l,o){return l[5]?tD:eD}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 eD(n){var r;let e,t,i,s,l,o=((r=n[1])==null?void 0:r.length)&&lh(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No admins found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(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=lh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function tD(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 lh(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[17]),t=!0)},p:oe,d(s){s&&k(e),t=!1,i()}}}function oh(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rh(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,g=e[24].email+"",v,b,y,C,S,$,M,D,E,O,L,I,N,B;u=new Qo({props:{id:e[24].id}});let U=e[24].id===e[7].id&&oh();S=new $i({props:{date:e[24].created}}),D=new $i({props:{date:e[24].updated}});function ee(){return e[15](e[24])}function K(...se){return e[16](e[24],...se)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),V(u.$$.fragment),f=T(),U&&U.c(),c=T(),d=_("td"),h=_("span"),v=F(g),y=T(),C=_("td"),V(S.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),E=T(),O=_("td"),O.innerHTML='<i class="ri-arrow-right-line"></i>',L=T(),xn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p(C,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(O,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(se,Y){w(se,t,Y),m(t,i),m(i,s),m(s,l),m(t,r),m(t,a),j(u,a,null),m(a,f),U&&U.m(a,null),m(t,c),m(t,d),m(d,h),m(h,v),m(t,y),m(t,C),j(S,C,null),m(t,$),m(t,M),j(D,M,null),m(t,E),m(t,O),m(t,L),I=!0,N||(B=[G(t,"click",ee),G(t,"keydown",K)],N=!0)},p(se,Y){e=se,(!I||Y&16&&!xn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const te={};Y&16&&(te.id=e[24].id),u.$set(te),e[24].id===e[7].id?U||(U=oh(),U.c(),U.m(a,null)):U&&(U.d(1),U=null),(!I||Y&16)&&g!==(g=e[24].email+"")&&ue(v,g),(!I||Y&16&&b!==(b=e[24].email))&&p(h,"title",b);const J={};Y&16&&(J.date=e[24].created),S.$set(J);const _e={};Y&16&&(_e.date=e[24].updated),D.$set(_e)},i(se){I||(A(u.$$.fragment,se),A(S.$$.fragment,se),A(D.$$.fragment,se),I=!0)},o(se){P(u.$$.fragment,se),P(S.$$.fragment,se),P(D.$$.fragment,se),I=!1},d(se){se&&k(t),q(u),U&&U.d(),q(S),q(D),N=!1,Ge(B)}}}function ah(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),r=F(o),p(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+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function nD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te,J,_e,be=[],X=new Map,ae,ve,H,me,x;a=new Uo({}),a.$on("refresh",n[8]),g=new Bo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),g.$on("submit",n[10]);function Q(Me){n[11](Me)}let Se={class:"col-type-text",name:"id",$$slots:{default:[GT]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),D=new sn({props:Se}),pe.push(()=>Fe(D,"sort",Q));function je(Me){n[12](Me)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[XT]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),L=new sn({props:Ue}),pe.push(()=>Fe(L,"sort",je));function Z(Me){n[13](Me)}let ge={class:"col-type-date col-field-created",name:"created",$$slots:{default:[QT]},$$scope:{ctx:n}};n[2]!==void 0&&(ge.sort=n[2]),B=new sn({props:ge}),pe.push(()=>Fe(B,"sort",Z));function ce(Me){n[14](Me)}let $e={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[xT]},$$scope:{ctx:n}};n[2]!==void 0&&($e.sort=n[2]),K=new sn({props:$e}),pe.push(()=>Fe(K,"sort",ce));let Ze=n[4];const et=Me=>Me[24].id;for(let Me=0;Me<Ze.length;Me+=1){let ze=ih(n,Ze,Me),Xe=et(ze);X.set(Xe,be[Me]=rh(Xe,ze))}let We=null;Ze.length||(We=sh(n));let tt=n[4].length&&ah(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[6]),r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=T(),d=_("button"),d.innerHTML=`<i class="ri-add-line"></i>
|
||
<span class="txt">New admin</span>`,h=T(),V(g.$$.fragment),v=T(),b=_("div"),y=_("table"),C=_("thead"),S=_("tr"),$=_("th"),M=T(),V(D.$$.fragment),O=T(),V(L.$$.fragment),N=T(),V(B.$$.fragment),ee=T(),V(K.$$.fragment),Y=T(),te=_("th"),J=T(),_e=_("tbody");for(let Me=0;Me<be.length;Me+=1)be[Me].c();We&&We.c(),ae=T(),tt&&tt.c(),ve=Ke(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p($,"class","min-width"),p(te,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Me,ze){w(Me,e,ze),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),m(e,r),j(a,e,null),m(e,u),m(e,f),m(e,c),m(e,d),w(Me,h,ze),j(g,Me,ze),w(Me,v,ze),w(Me,b,ze),m(b,y),m(y,C),m(C,S),m(S,$),m(S,M),j(D,S,null),m(S,O),j(L,S,null),m(S,N),j(B,S,null),m(S,ee),j(K,S,null),m(S,Y),m(S,te),m(y,J),m(y,_e);for(let Xe=0;Xe<be.length;Xe+=1)be[Xe].m(_e,null);We&&We.m(_e,null),w(Me,ae,ze),tt&&tt.m(Me,ze),w(Me,ve,ze),H=!0,me||(x=G(d,"click",n[9]),me=!0)},p(Me,ze){(!H||ze&64)&&ue(o,Me[6]);const Xe={};ze&2&&(Xe.value=Me[1]),g.$set(Xe);const nt={};ze&134217728&&(nt.$$scope={dirty:ze,ctx:Me}),!E&&ze&4&&(E=!0,nt.sort=Me[2],He(()=>E=!1)),D.$set(nt);const ut={};ze&134217728&&(ut.$$scope={dirty:ze,ctx:Me}),!I&&ze&4&&(I=!0,ut.sort=Me[2],He(()=>I=!1)),L.$set(ut);const ye={};ze&134217728&&(ye.$$scope={dirty:ze,ctx:Me}),!U&&ze&4&&(U=!0,ye.sort=Me[2],He(()=>U=!1)),B.$set(ye);const Ne={};ze&134217728&&(Ne.$$scope={dirty:ze,ctx:Me}),!se&&ze&4&&(se=!0,Ne.sort=Me[2],He(()=>se=!1)),K.$set(Ne),ze&186&&(Ze=Me[4],Pe(),be=yt(be,ze,et,1,Me,Ze,X,_e,Zt,rh,null,ih),Le(),!Ze.length&&We?We.p(Me,ze):Ze.length?We&&(We.d(1),We=null):(We=sh(Me),We.c(),We.m(_e,null))),ze&32&&ie(y,"table-loading",Me[5]),Me[4].length?tt?tt.p(Me,ze):(tt=ah(Me),tt.c(),tt.m(ve.parentNode,ve)):tt&&(tt.d(1),tt=null)},i(Me){if(!H){A(a.$$.fragment,Me),A(g.$$.fragment,Me),A(D.$$.fragment,Me),A(L.$$.fragment,Me),A(B.$$.fragment,Me),A(K.$$.fragment,Me);for(let ze=0;ze<Ze.length;ze+=1)A(be[ze]);H=!0}},o(Me){P(a.$$.fragment,Me),P(g.$$.fragment,Me),P(D.$$.fragment,Me),P(L.$$.fragment,Me),P(B.$$.fragment,Me),P(K.$$.fragment,Me);for(let ze=0;ze<be.length;ze+=1)P(be[ze]);H=!1},d(Me){Me&&k(e),q(a),Me&&k(h),q(g,Me),Me&&k(v),Me&&k(b),q(D),q(L),q(B),q(K);for(let ze=0;ze<be.length;ze+=1)be[ze].d();We&&We.d(),Me&&k(ae),tt&&tt.d(Me),Me&&k(ve),me=!1,x()}}}function iD(n){let e,t,i,s,l,o;e=new Bi({}),i=new On({props:{$$slots:{default:[nD]},$$scope:{ctx:n}}});let r={};return l=new ZT({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[18](null),q(l,a)}}}function sD(n,e,t){let i,s,l;bt(n,Ro,N=>t(21,i=N)),bt(n,Ft,N=>t(6,s=N)),bt(n,$a,N=>t(7,l=N)),dn(Ft,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),we.admins.getFullList(100,{sort:c||"-created",filter:f}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),h(),we.errorResponseHandler(N,!1))})}function h(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=N=>t(1,f=N.detail);function y(N){c=N,t(2,c)}function C(N){c=N,t(2,c)}function S(N){c=N,t(2,c)}function $(N){c=N,t(2,c)}const M=N=>r==null?void 0:r.show(N),D=(N,B)=>{(B.code==="Enter"||B.code==="Space")&&(B.preventDefault(),r==null||r.show(N))},E=()=>t(1,f="");function O(N){pe[N?"unshift":"push"](()=>{r=N,t(3,r)})}const L=()=>d(),I=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const N=new URLSearchParams({filter:f,sort:c}).toString();Si("/settings/admins?"+N),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,C,S,$,M,D,E,O,L,I]}class lD extends Ee{constructor(e){super(),Oe(this,e,sD,iD,De,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function oD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=T(),l=_("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0]),l.focus(),r||(a=G(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&Te(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function rD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=_("label"),t=F("Password"),s=T(),l=_("input"),r=T(),a=_("div"),u=_("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Te(l,n[1]),w(d,r,h),w(d,a,h),m(a,u),f||(c=[G(l,"input",n[5]),Ye(mn.call(null,u))],f=!0)},p(d,h){h&256&&i!==(i=d[8])&&p(e,"for",i),h&256&&o!==(o=d[8])&&p(l,"id",o),h&2&&l.value!==d[1]&&Te(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,Ge(c)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new Re({props:{class:"form-field required",name:"email",$$slots:{default:[oD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"password",$$slots:{default:[rD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=_("form"),t=_("div"),t.innerHTML="<h4>Admin sign in</h4>",i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),a=_("button"),a.innerHTML=`<span class="txt">Login</span>
|
||
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ie(a,"btn-disabled",n[2]),ie(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),m(e,t),m(e,i),j(s,e,null),m(e,l),j(o,e,null),m(e,r),m(e,a),u=!0,f||(c=G(e,"submit",Yt(n[3])),f=!0)},p(d,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:d}),s.$set(g);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),h&4&&ie(a,"btn-disabled",d[2]),h&4&&ie(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),q(s),q(o),f=!1,c()}}}function uD(n){let e,t;return e=new Ng({props:{$$slots:{default:[aD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function fD(n,e,t){let i;bt(n,Ro,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),we.admins.authViaEmail(l,o).then(()=>{Si("/")}).catch(()=>{go("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class cD extends Ee{constructor(e){super(),Oe(this,e,fD,uD,De,{})}}function dD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S;i=new Re({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[hD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[mD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[gD,({uniqueId:M})=>({17:M}),({uniqueId:M})=>M?131072:0]},$$scope:{ctx:n}}});let $=n[3]&&uh(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),$&&$.c(),h=T(),g=_("button"),v=_("span"),v.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(v,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=b=!n[3]||n[2],ie(g,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(M,D){w(M,e,D),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),j(a,e,null),m(e,u),m(e,f),m(f,c),m(f,d),$&&$.m(f,null),m(f,h),m(f,g),m(g,v),y=!0,C||(S=G(g,"click",n[12]),C=!0)},p(M,D){const E={};D&393217&&(E.$$scope={dirty:D,ctx:M}),i.$set(E);const O={};D&393217&&(O.$$scope={dirty:D,ctx:M}),o.$set(O);const L={};D&393217&&(L.$$scope={dirty:D,ctx:M}),a.$set(L),M[3]?$?$.p(M,D):($=uh(M),$.c(),$.m(f,h)):$&&($.d(1),$=null),(!y||D&12&&b!==(b=!M[3]||M[2]))&&(g.disabled=b),D&4&&ie(g,"btn-loading",M[2])},i(M){y||(A(i.$$.fragment,M),A(o.$$.fragment,M),A(a.$$.fragment,M),y=!0)},o(M){P(i.$$.fragment,M),P(o.$$.fragment,M),P(a.$$.fragment,M),y=!1},d(M){M&&k(e),q(i),q(o),q(a),$&&$.d(),C=!1,S()}}}function pD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function hD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Application name"),s=T(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","text"),p(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),Te(l,n[0].meta.appName),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Te(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Application url"),s=T(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","text"),p(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),Te(l,n[0].meta.appUrl),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Te(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function gD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Logs max days retention"),s=T(),l=_("input"),p(e,"for",i=n[17]),p(l,"type","number"),p(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),Te(l,n[0].logs.maxDays),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&131072&&i!==(i=u[17])&&p(e,"for",i),f&131072&&o!==(o=u[17])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].logs.maxDays&&Te(l,u[0].logs.maxDays)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function uh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),m(e,t),i||(s=G(e,"click",n[11]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function _D(n){let e,t,i,s,l,o,r,a,u;const f=[pD,dD],c=[];function d(h,g){return h[1]?0:1}return l=d(n),o=c[l]=f[l](n),{c(){e=_("header"),e.innerHTML=`<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div>
|
||
<div class="breadcrumb-item">Application</div></nav>`,t=T(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),m(i,s),c[l].m(s,null),r=!0,a||(u=G(s,"submit",Yt(n[4])),a=!0)},p(h,g){let v=l;l=d(h),l===v?c[l].p(h,g):(Pe(),P(c[v],1,1,()=>{c[v]=null}),Le(),o=c[l],o?o.p(h,g):(o=c[l]=f[l](h),o.c()),A(o,1),o.m(s,null))},i(h){r||(A(o),r=!0)},o(h){P(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function bD(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[_D]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&262159&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function vD(n,e,t){let i,s,l;bt(n,bo,$=>t(13,s=$)),bt(n,Ft,$=>t(14,l=$)),dn(Ft,l="Application settings",l);let o={},r={},a=!1,u=!1,f="";c();async function c(){t(1,a=!0);try{const $=await we.settings.getAll()||{};h($)}catch($){we.errorResponseHandler($)}t(1,a=!1)}async function d(){if(!(u||!i)){t(2,u=!0);try{const $=await we.settings.update(W.filterRedactedProps(r));h($),cn("Successfully saved application settings.")}catch($){we.errorResponseHandler($)}t(2,u=!1)}}function h($={}){var M;dn(bo,s=(M=$==null?void 0:$.meta)==null?void 0:M.appName,s),t(0,r={meta:($==null?void 0:$.meta)||{},logs:($==null?void 0:$.logs)||{}}),t(6,o=JSON.parse(JSON.stringify(r)))}function g(){t(0,r=JSON.parse(JSON.stringify(o||{})))}function v(){r.meta.appName=this.value,t(0,r)}function b(){r.meta.appUrl=this.value,t(0,r)}function y(){r.logs.maxDays=Pt(this.value),t(0,r)}const C=()=>g(),S=()=>d();return n.$$.update=()=>{n.$$.dirty&64&&t(7,f=JSON.stringify(o)),n.$$.dirty&129&&t(3,i=f!=JSON.stringify(r))},[r,a,u,i,d,g,o,f,v,b,y,C,S]}class yD extends Ee{constructor(e){super(),Oe(this,e,vD,bD,De,{})}}function kD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=at(l,s[o]);return{c(){e=_("input"),di(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Te(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){di(e,l=pn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Te(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function wD(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=at(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),di(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=[Ye(wt.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){di(s,a=pn(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,Ge(o)}}}function $D(n){let e;function t(l,o){return l[3]?wD:kD}let i=t(n),s=i(n);return{c(){s.c(),e=Ke()},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 SD(n,e,t){const i=["value","mask"];let s=Bt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ii(),r==null||r.focus()}const f=()=>u();function c(h){pe[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=at(at({},e),ni(h)),t(5,s=Bt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.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(),Oe(this,e,SD,$D,De,{value:0,mask:1})}}function CD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v;return{c(){e=_("label"),t=F("Subject"),s=T(),l=_("input"),r=T(),a=_("div"),u=F(`Available placeholder parameters:
|
||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||
`,c=F(`,
|
||
`),d=_("span"),d.textContent=`{APP_URL}
|
||
`,h=F("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(b,y){w(b,e,y),m(e,t),w(b,s,y),w(b,l,y),Te(l,n[0].subject),w(b,r,y),w(b,a,y),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),g||(v=[G(l,"input",n[13]),G(f,"click",n[14]),G(d,"click",n[15])],g=!0)},p(b,y){y[1]&1&&i!==(i=b[31])&&p(e,"for",i),y[1]&1&&o!==(o=b[31])&&p(l,"id",o),y[0]&1&&l.value!==b[0].subject&&Te(l,b[0].subject)},d(b){b&&k(e),b&&k(s),b&&k(l),b&&k(r),b&&k(a),g=!1,Ge(v)}}}function MD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y;return{c(){e=_("label"),t=F("Action URL"),s=T(),l=_("input"),r=T(),a=_("div"),u=F(`Available placeholder parameters:
|
||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||
`,c=F(`,
|
||
`),d=_("span"),d.textContent=`{APP_URL}
|
||
`,h=F(`,
|
||
`),g=_("span"),g.textContent="{TOKEN}",v=F("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(C,S){w(C,e,S),m(e,t),w(C,s,S),w(C,l,S),Te(l,n[0].actionUrl),w(C,r,S),w(C,a,S),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),b||(y=[G(l,"input",n[16]),G(f,"click",n[17]),G(d,"click",n[18]),G(g,"click",n[19])],b=!0)},p(C,S){S[1]&1&&i!==(i=C[31])&&p(e,"for",i),S[1]&1&&o!==(o=C[31])&&p(l,"id",o),S[0]&1&&l.value!==C[0].actionUrl&&Te(l,C[0].actionUrl)},d(C){C&&k(e),C&&k(s),C&&k(l),C&&k(r),C&&k(a),b=!1,Ge(y)}}}function TD(n){let e,t,i,s;return{c(){e=_("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","12"),e.required=!0},m(l,o){w(l,e,o),Te(e,n[0].body),i||(s=G(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&Te(e,l[0].body)},i:oe,o:oe,d(l){l&&k(e),i=!1,s()}}}function DD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=new o(r(n)),pe.push(()=>Fe(e,"value",l))),{c(){e&&V(e.$$.fragment),i=Ke()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),pe.push(()=>Fe(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),j(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&&q(e,a)}}}function OD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$;const M=[DD,TD],D=[];function E(O,L){return O[4]&&!O[5]?0:1}return l=E(n),o=D[l]=M[l](n),{c(){e=_("label"),t=F("Body (HTML)"),s=T(),o.c(),r=T(),a=_("div"),u=F(`Available placeholder parameters:
|
||
`),f=_("span"),f.textContent=`{APP_NAME}
|
||
`,c=F(`,
|
||
`),d=_("span"),d.textContent=`{APP_URL}
|
||
`,h=F(`,
|
||
`),g=_("span"),g.textContent=`{TOKEN}
|
||
`,v=F(`,
|
||
`),b=_("span"),b.textContent=`{ACTION_URL}
|
||
`,y=F("."),p(e,"for",i=n[31]),p(f,"class","label label-sm link-primary txt-mono"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"class","label label-sm link-primary txt-mono"),p(b,"class","label label-sm link-primary txt-mono"),p(b,"title","Required parameter"),p(a,"class","help-block")},m(O,L){w(O,e,L),m(e,t),w(O,s,L),D[l].m(O,L),w(O,r,L),w(O,a,L),m(a,u),m(a,f),m(a,c),m(a,d),m(a,h),m(a,g),m(a,v),m(a,b),m(a,y),C=!0,S||($=[G(f,"click",n[22]),G(d,"click",n[23]),G(g,"click",n[24]),G(b,"click",n[25])],S=!0)},p(O,L){(!C||L[1]&1&&i!==(i=O[31]))&&p(e,"for",i);let I=l;l=E(O),l===I?D[l].p(O,L):(Pe(),P(D[I],1,1,()=>{D[I]=null}),Le(),o=D[l],o?o.p(O,L):(o=D[l]=M[l](O),o.c()),A(o,1),o.m(r.parentNode,r))},i(O){C||(A(o),C=!0)},o(O){P(o),C=!1},d(O){O&&k(e),O&&k(s),D[l].d(O),O&&k(r),O&&k(a),S=!1,Ge($)}}}function ED(n){let e,t,i,s,l,o;return e=new Re({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[CD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new Re({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[MD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new Re({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[OD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){q(e,r),r&&k(t),q(i,r),r&&k(s),q(l,r)}}}function fh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function AD(n){let e,t,i,s,l,o,r,a,u,f,c=n[6]&&fh();return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),l=F(n[2]),o=T(),r=_("div"),a=T(),c&&c.c(),u=Ke(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(d,h){w(d,e,h),m(e,t),m(e,i),m(e,s),m(s,l),w(d,o,h),w(d,r,h),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&ue(l,d[2]),d[6]?c?h[0]&64&&A(c,1):(c=fh(),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(A(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(o),d&&k(r),d&&k(a),c&&c.d(d),d&&k(u)}}}function PD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[AD],default:[ED]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new Xo({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?pn(i,[si(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),q(e,l)}}}function LD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;bt(n,qi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function v(){f==null||f.collapseSiblings()}async function b(){c||d||(t(5,d=!0),t(4,c=(await Ai(()=>import("./CodeEditor.f0bf9689.js"),["CodeEditor.f0bf9689.js","index.afc1faa1.js"],import.meta.url)).default),t(5,d=!1))}b();function y(J){W.copyToClipboard(J),Lg(`Copied ${J} to clipboard`,2e3)}function C(){u.subject=this.value,t(0,u)}const S=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function M(){u.actionUrl=this.value,t(0,u)}const D=()=>y("{APP_NAME}"),E=()=>y("{APP_URL}"),O=()=>y("{TOKEN}");function L(J){n.$$.not_equal(u.body,J)&&(u.body=J,t(0,u))}function I(){u.body=this.value,t(0,u)}const N=()=>y("{APP_NAME}"),B=()=>y("{APP_URL}"),U=()=>y("{TOKEN}"),ee=()=>y("{ACTION_URL}");function K(J){pe[J?"unshift":"push"](()=>{f=J,t(3,f)})}function se(J){st.call(this,n,J)}function Y(J){st.call(this,n,J)}function te(J){st.call(this,n,J)}return n.$$set=J=>{e=at(at({},e),ni(J)),t(8,l=Bt(e,s)),"key"in J&&t(1,r=J.key),"title"in J&&t(2,a=J.title),"config"in J&&t(0,u=J.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!W.isEmpty(W.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||wa(r))},[u,r,a,f,c,d,i,y,l,h,g,v,o,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se,Y,te]}class Dr extends Ee{constructor(e){super(),Oe(this,e,LD,PD,De,{key:1,title:2,config:0,expand:9,collapse:10,collapseSiblings:11},null,[-1,-1])}get expand(){return this.$$.ctx[9]}get collapse(){return this.$$.ctx[10]}get collapseSiblings(){return this.$$.ctx[11]}}function ID(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I,N,B,U,ee,K,se;i=new Re({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[ND,({uniqueId:H})=>({26:H}),({uniqueId:H})=>H?67108864:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[RD,({uniqueId:H})=>({26:H}),({uniqueId:H})=>H?67108864:0]},$$scope:{ctx:n}}});function Y(H){n[12](H)}let te={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};n[0].meta.verificationTemplate!==void 0&&(te.config=n[0].meta.verificationTemplate),u=new Dr({props:te}),pe.push(()=>Fe(u,"config",Y));function J(H){n[13](H)}let _e={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};n[0].meta.resetPasswordTemplate!==void 0&&(_e.config=n[0].meta.resetPasswordTemplate),d=new Dr({props:_e}),pe.push(()=>Fe(d,"config",J));function be(H){n[14](H)}let X={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};n[0].meta.confirmEmailChangeTemplate!==void 0&&(X.config=n[0].meta.confirmEmailChangeTemplate),v=new Dr({props:X}),pe.push(()=>Fe(v,"config",be)),$=new Re({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[HD,({uniqueId:H})=>({26:H}),({uniqueId:H})=>H?67108864:0]},$$scope:{ctx:n}}});let ae=n[0].smtp.enabled&&ch(n),ve=n[3]&&dh(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),c=T(),V(d.$$.fragment),g=T(),V(v.$$.fragment),y=T(),C=_("hr"),S=T(),V($.$$.fragment),M=T(),ae&&ae.c(),D=T(),E=_("div"),O=_("div"),L=T(),ve&&ve.c(),I=T(),N=_("button"),B=_("span"),B.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(O,"class","flex-fill"),p(B,"class","txt"),p(N,"type","submit"),p(N,"class","btn btn-expanded"),N.disabled=U=!n[3]||n[2],ie(N,"btn-loading",n[2]),p(E,"class","flex")},m(H,me){w(H,e,me),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),w(H,r,me),w(H,a,me),j(u,a,null),m(a,c),j(d,a,null),m(a,g),j(v,a,null),w(H,y,me),w(H,C,me),w(H,S,me),j($,H,me),w(H,M,me),ae&&ae.m(H,me),w(H,D,me),w(H,E,me),m(E,O),m(E,L),ve&&ve.m(E,null),m(E,I),m(E,N),m(N,B),ee=!0,K||(se=G(N,"click",n[22]),K=!0)},p(H,me){const x={};me&201326593&&(x.$$scope={dirty:me,ctx:H}),i.$set(x);const Q={};me&201326593&&(Q.$$scope={dirty:me,ctx:H}),o.$set(Q);const Se={};!f&&me&1&&(f=!0,Se.config=H[0].meta.verificationTemplate,He(()=>f=!1)),u.$set(Se);const je={};!h&&me&1&&(h=!0,je.config=H[0].meta.resetPasswordTemplate,He(()=>h=!1)),d.$set(je);const Ue={};!b&&me&1&&(b=!0,Ue.config=H[0].meta.confirmEmailChangeTemplate,He(()=>b=!1)),v.$set(Ue);const Z={};me&201326593&&(Z.$$scope={dirty:me,ctx:H}),$.$set(Z),H[0].smtp.enabled?ae?(ae.p(H,me),me&1&&A(ae,1)):(ae=ch(H),ae.c(),A(ae,1),ae.m(D.parentNode,D)):ae&&(Pe(),P(ae,1,1,()=>{ae=null}),Le()),H[3]?ve?ve.p(H,me):(ve=dh(H),ve.c(),ve.m(E,I)):ve&&(ve.d(1),ve=null),(!ee||me&12&&U!==(U=!H[3]||H[2]))&&(N.disabled=U),me&4&&ie(N,"btn-loading",H[2])},i(H){ee||(A(i.$$.fragment,H),A(o.$$.fragment,H),A(u.$$.fragment,H),A(d.$$.fragment,H),A(v.$$.fragment,H),A($.$$.fragment,H),A(ae),ee=!0)},o(H){P(i.$$.fragment,H),P(o.$$.fragment,H),P(u.$$.fragment,H),P(d.$$.fragment,H),P(v.$$.fragment,H),P($.$$.fragment,H),P(ae),ee=!1},d(H){H&&k(e),q(i),q(o),H&&k(r),H&&k(a),q(u),q(d),q(v),H&&k(y),H&&k(C),H&&k(S),q($,H),H&&k(M),ae&&ae.d(H),H&&k(D),H&&k(E),ve&&ve.d(),K=!1,se()}}}function FD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function ND(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Sender name"),s=T(),l=_("input"),p(e,"for",i=n[26]),p(l,"type","text"),p(l,"id",o=n[26]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].meta.senderName),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Te(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function RD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Sender address"),s=T(),l=_("input"),p(e,"for",i=n[26]),p(l,"type","email"),p(l,"id",o=n[26]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].meta.senderAddress),r||(a=G(l,"input",n[11]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Te(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function HD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=T(),s=_("label"),l=_("span"),l.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=T(),r=_("i"),p(e,"type","checkbox"),p(e,"id",t=n[26]),e.required=!0,p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[26])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[G(e,"change",n[15]),Ye(wt.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d&67108864&&t!==(t=c[26])&&p(e,"id",t),d&1&&(e.checked=c[0].smtp.enabled),d&67108864&&a!==(a=c[26])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Ge(f)}}}function ch(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S;return i=new Re({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[jD,({uniqueId:$})=>({26:$}),({uniqueId:$})=>$?67108864:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[qD,({uniqueId:$})=>({26:$}),({uniqueId:$})=>$?67108864:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[VD,({uniqueId:$})=>({26:$}),({uniqueId:$})=>$?67108864:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:"smtp.username",$$slots:{default:[zD,({uniqueId:$})=>({26:$}),({uniqueId:$})=>$?67108864:0]},$$scope:{ctx:n}}}),v=new Re({props:{class:"form-field",name:"smtp.password",$$slots:{default:[BD,({uniqueId:$})=>({26:$}),({uniqueId:$})=>$?67108864:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),g=_("div"),V(v.$$.fragment),b=T(),y=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m($,M){w($,e,M),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),m(e,h),m(e,g),j(v,g,null),m(e,b),m(e,y),S=!0},p($,M){const D={};M&201326593&&(D.$$scope={dirty:M,ctx:$}),i.$set(D);const E={};M&201326593&&(E.$$scope={dirty:M,ctx:$}),o.$set(E);const O={};M&201326593&&(O.$$scope={dirty:M,ctx:$}),u.$set(O);const L={};M&201326593&&(L.$$scope={dirty:M,ctx:$}),d.$set(L);const I={};M&201326593&&(I.$$scope={dirty:M,ctx:$}),v.$set(I)},i($){S||(A(i.$$.fragment,$),A(o.$$.fragment,$),A(u.$$.fragment,$),A(d.$$.fragment,$),A(v.$$.fragment,$),$&&Tt(()=>{C||(C=it(e,tn,{duration:150},!0)),C.run(1)}),S=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(u.$$.fragment,$),P(d.$$.fragment,$),P(v.$$.fragment,$),$&&(C||(C=it(e,tn,{duration:150},!1)),C.run(0)),S=!1},d($){$&&k(e),q(i),q(o),q(u),q(d),q(v),$&&C&&C.end()}}}function jD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("SMTP server host"),s=T(),l=_("input"),p(e,"for",i=n[26]),p(l,"type","text"),p(l,"id",o=n[26]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].smtp.host),r||(a=G(l,"input",n[16]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Te(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function qD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Port"),s=T(),l=_("input"),p(e,"for",i=n[26]),p(l,"type","number"),p(l,"id",o=n[26]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].smtp.port),r||(a=G(l,"input",n[17]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].smtp.port&&Te(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function VD(n){let e,t,i,s,l,o,r;function a(f){n[18](f)}let u={id:n[26],items:n[5]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new fs({props:u}),pe.push(()=>Fe(l,"keyOfSelected",a)),{c(){e=_("label"),t=F("TLS Encryption"),s=T(),V(l.$$.fragment),p(e,"for",i=n[26])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&67108864&&i!==(i=f[26]))&&p(e,"for",i);const d={};c&67108864&&(d.id=f[26]),!o&&c&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,He(()=>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),q(l,f)}}}function zD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Username"),s=T(),l=_("input"),p(e,"for",i=n[26]),p(l,"type","text"),p(l,"id",o=n[26])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].smtp.username),r||(a=G(l,"input",n[19]),r=!0)},p(u,f){f&67108864&&i!==(i=u[26])&&p(e,"for",i),f&67108864&&o!==(o=u[26])&&p(l,"id",o),f&1&&l.value!==u[0].smtp.username&&Te(l,u[0].smtp.username)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function BD(n){let e,t,i,s,l,o,r;function a(f){n[20](f)}let u={id:n[26]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),l=new Za({props:u}),pe.push(()=>Fe(l,"value",a)),{c(){e=_("label"),t=F("Password"),s=T(),V(l.$$.fragment),p(e,"for",i=n[26])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&67108864&&i!==(i=f[26]))&&p(e,"for",i);const d={};c&67108864&&(d.id=f[26]),!o&&c&1&&(o=!0,d.value=f[0].smtp.password,He(()=>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),q(l,f)}}}function dh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),m(e,t),i||(s=G(e,"click",n[21]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function UD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[FD,ID],C=[];function S($,M){return $[1]?0:1}return d=S(n),h=C[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[4]),r=T(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=T(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w($,r,M),w($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=G(u,"submit",Yt(n[23])),v=!0)},p($,M){(!g||M&16)&&ue(o,$[4]);let D=d;d=S($),d===D?C[d].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){P(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function WD(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[UD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&134217759&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function YD(n,e,t){let i,s,l;bt(n,Ft,U=>t(4,l=U));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}];dn(Ft,l="Mail settings",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const U=await we.settings.getAll()||{};h(U)}catch(U){we.errorResponseHandler(U)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const U=await we.settings.update(W.filterRedactedProps(a));h(U),hi({}),cn("Successfully saved mail settings.")}catch(U){we.errorResponseHandler(U)}t(2,f=!1)}}function h(U={}){t(0,a={meta:(U==null?void 0:U.meta)||{},smtp:(U==null?void 0:U.smtp)||{}}),t(8,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.senderName=this.value,t(0,a)}function b(){a.meta.senderAddress=this.value,t(0,a)}function y(U){n.$$.not_equal(a.meta.verificationTemplate,U)&&(a.meta.verificationTemplate=U,t(0,a))}function C(U){n.$$.not_equal(a.meta.resetPasswordTemplate,U)&&(a.meta.resetPasswordTemplate=U,t(0,a))}function S(U){n.$$.not_equal(a.meta.confirmEmailChangeTemplate,U)&&(a.meta.confirmEmailChangeTemplate=U,t(0,a))}function $(){a.smtp.enabled=this.checked,t(0,a)}function M(){a.smtp.host=this.value,t(0,a)}function D(){a.smtp.port=Pt(this.value),t(0,a)}function E(U){n.$$.not_equal(a.smtp.tls,U)&&(a.smtp.tls=U,t(0,a))}function O(){a.smtp.username=this.value,t(0,a)}function L(U){n.$$.not_equal(a.smtp.password,U)&&(a.smtp.password=U,t(0,a))}const I=()=>g(),N=()=>d(),B=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,g,r,i,v,b,y,C,S,$,M,D,E,O,L,I,N,B]}class KD extends Ee{constructor(e){super(),Oe(this,e,YD,WD,De,{})}}function JD(n){var C;let e,t,i,s,l,o,r,a,u,f,c,d,h,g;e=new Re({props:{class:"form-field form-field-toggle",$$slots:{default:[GD,({uniqueId:S})=>({21:S}),({uniqueId:S})=>S?2097152:0]},$$scope:{ctx:n}}});let v=((C=n[0].s3)==null?void 0:C.enabled)!=n[1].s3.enabled&&ph(n),b=n[1].s3.enabled&&hh(n),y=n[4]&&mh(n);return{c(){V(e.$$.fragment),t=T(),v&&v.c(),i=T(),b&&b.c(),s=T(),l=_("div"),o=_("div"),r=T(),y&&y.c(),a=T(),u=_("button"),f=_("span"),f.textContent="Save changes",p(o,"class","flex-fill"),p(f,"class","txt"),p(u,"type","submit"),p(u,"class","btn btn-expanded"),u.disabled=c=!n[4]||n[3],ie(u,"btn-loading",n[3]),p(l,"class","flex")},m(S,$){j(e,S,$),w(S,t,$),v&&v.m(S,$),w(S,i,$),b&&b.m(S,$),w(S,s,$),w(S,l,$),m(l,o),m(l,r),y&&y.m(l,null),m(l,a),m(l,u),m(u,f),d=!0,h||(g=G(u,"click",n[17]),h=!0)},p(S,$){var D;const M={};$&6291458&&(M.$$scope={dirty:$,ctx:S}),e.$set(M),((D=S[0].s3)==null?void 0:D.enabled)!=S[1].s3.enabled?v?(v.p(S,$),$&3&&A(v,1)):(v=ph(S),v.c(),A(v,1),v.m(i.parentNode,i)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le()),S[1].s3.enabled?b?(b.p(S,$),$&2&&A(b,1)):(b=hh(S),b.c(),A(b,1),b.m(s.parentNode,s)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le()),S[4]?y?y.p(S,$):(y=mh(S),y.c(),y.m(l,a)):y&&(y.d(1),y=null),(!d||$&24&&c!==(c=!S[4]||S[3]))&&(u.disabled=c),$&8&&ie(u,"btn-loading",S[3])},i(S){d||(A(e.$$.fragment,S),A(v),A(b),d=!0)},o(S){P(e.$$.fragment,S),P(v),P(b),d=!1},d(S){q(e,S),S&&k(t),v&&v.d(S),S&&k(i),b&&b.d(S),S&&k(s),S&&k(l),y&&y.d(),h=!1,g()}}}function ZD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function GD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Use S3 storage"),p(e,"type","checkbox"),p(e,"id",t=n[21]),e.required=!0,p(s,"for",o=n[21])},m(u,f){w(u,e,f),e.checked=n[1].s3.enabled,w(u,i,f),w(u,s,f),m(s,l),r||(a=G(e,"change",n[9]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&p(e,"id",t),f&2&&(e.checked=u[1].s3.enabled),f&2097152&&o!==(o=u[21])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function ph(n){var L;let e,t,i,s,l,o,r,a=(L=n[0].s3)!=null&&L.enabled?"S3 storage":"local file system",u,f,c,d=n[1].s3.enabled?"S3 storage":"local file system",h,g,v,b,y,C,S,$,M,D,E,O;return{c(){e=_("div"),t=_("div"),i=_("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',s=T(),l=_("div"),o=F(`If you have existing uploaded files, you'll have to migrate them manually from
|
||
the
|
||
`),r=_("strong"),u=F(a),f=F(`
|
||
to the
|
||
`),c=_("strong"),h=F(d),g=F(`.
|
||
`),v=_("br"),b=F(`
|
||
There are numerous command line tools that can help you, such as:
|
||
`),y=_("a"),y.textContent=`rclone
|
||
`,C=F(`,
|
||
`),S=_("a"),S.textContent=`s5cmd
|
||
`,$=F(", etc."),M=T(),D=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(S,"href","https://github.com/peak/s5cmd"),p(S,"target","_blank"),p(S,"rel","noopener"),p(S,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(I,N){w(I,e,N),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,h),m(l,g),m(l,v),m(l,b),m(l,y),m(l,C),m(l,S),m(l,$),m(e,M),m(e,D),O=!0},p(I,N){var B;(!O||N&1)&&a!==(a=(B=I[0].s3)!=null&&B.enabled?"S3 storage":"local file system")&&ue(u,a),(!O||N&2)&&d!==(d=I[1].s3.enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){O||(I&&Tt(()=>{E||(E=it(e,tn,{duration:150},!0)),E.run(1)}),O=!0)},o(I){I&&(E||(E=it(e,tn,{duration:150},!1)),E.run(0)),O=!1},d(I){I&&k(e),I&&E&&E.end()}}}function hh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D;return i=new Re({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[XD,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[QD,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field required",name:"s3.region",$$slots:{default:[xD,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[eO,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),v=new Re({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[tO,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),C=new Re({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[nO,({uniqueId:E})=>({21:E}),({uniqueId:E})=>E?2097152:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),g=_("div"),V(v.$$.fragment),b=T(),y=_("div"),V(C.$$.fragment),S=T(),$=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(E,O){w(E,e,O),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),m(e,f),m(e,c),j(d,c,null),m(e,h),m(e,g),j(v,g,null),m(e,b),m(e,y),j(C,y,null),m(e,S),m(e,$),D=!0},p(E,O){const L={};O&6291458&&(L.$$scope={dirty:O,ctx:E}),i.$set(L);const I={};O&6291458&&(I.$$scope={dirty:O,ctx:E}),o.$set(I);const N={};O&6291458&&(N.$$scope={dirty:O,ctx:E}),u.$set(N);const B={};O&6291458&&(B.$$scope={dirty:O,ctx:E}),d.$set(B);const U={};O&6291458&&(U.$$scope={dirty:O,ctx:E}),v.$set(U);const ee={};O&6291458&&(ee.$$scope={dirty:O,ctx:E}),C.$set(ee)},i(E){D||(A(i.$$.fragment,E),A(o.$$.fragment,E),A(u.$$.fragment,E),A(d.$$.fragment,E),A(v.$$.fragment,E),A(C.$$.fragment,E),E&&Tt(()=>{M||(M=it(e,tn,{duration:150},!0)),M.run(1)}),D=!0)},o(E){P(i.$$.fragment,E),P(o.$$.fragment,E),P(u.$$.fragment,E),P(d.$$.fragment,E),P(v.$$.fragment,E),P(C.$$.fragment,E),E&&(M||(M=it(e,tn,{duration:150},!1)),M.run(0)),D=!1},d(E){E&&k(e),q(i),q(o),q(u),q(d),q(v),q(C),E&&M&&M.end()}}}function XD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Endpoint"),s=T(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[1].s3.endpoint),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&Te(l,u[1].s3.endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function QD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Bucket"),s=T(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[1].s3.bucket),r||(a=G(l,"input",n[11]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.bucket&&Te(l,u[1].s3.bucket)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function xD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Region"),s=T(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[1].s3.region),r||(a=G(l,"input",n[12]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.region&&Te(l,u[1].s3.region)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function eO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Access key"),s=T(),l=_("input"),p(e,"for",i=n[21]),p(l,"type","text"),p(l,"id",o=n[21]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[1].s3.accessKey),r||(a=G(l,"input",n[13]),r=!0)},p(u,f){f&2097152&&i!==(i=u[21])&&p(e,"for",i),f&2097152&&o!==(o=u[21])&&p(l,"id",o),f&2&&l.value!==u[1].s3.accessKey&&Te(l,u[1].s3.accessKey)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function tO(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[21],required:!0};return n[1].s3.secret!==void 0&&(u.value=n[1].s3.secret),l=new Za({props:u}),pe.push(()=>Fe(l,"value",a)),{c(){e=_("label"),t=F("Secret"),s=T(),V(l.$$.fragment),p(e,"for",i=n[21])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&p(e,"for",i);const d={};c&2097152&&(d.id=f[21]),!o&&c&2&&(o=!0,d.value=f[1].s3.secret,He(()=>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),q(l,f)}}}function nO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("input"),i=T(),s=_("label"),l=_("span"),l.textContent="Force path-style addressing",o=T(),r=_("i"),p(e,"type","checkbox"),p(e,"id",t=n[21]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[21])},m(c,d){w(c,e,d),e.checked=n[1].s3.forcePathStyle,w(c,i,d),w(c,s,d),m(s,l),m(s,o),m(s,r),u||(f=[G(e,"change",n[15]),Ye(wt.call(null,r,{text:'Forces the request to use path-style addressing, eg. "https://s3.amazonaws.com/BUCKET/KEY" instead of the default "https://BUCKET.s3.amazonaws.com/KEY".',position:"top"}))],u=!0)},p(c,d){d&2097152&&t!==(t=c[21])&&p(e,"id",t),d&2&&(e.checked=c[1].s3.forcePathStyle),d&2097152&&a!==(a=c[21])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Ge(f)}}}function mh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=G(e,"click",n[16]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function iO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[ZD,JD],C=[];function S($,M){return $[2]?0:1}return d=S(n),h=C[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[5]),r=T(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
|
||
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=T(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w($,r,M),w($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=G(u,"submit",Yt(n[18])),v=!0)},p($,M){(!g||M&32)&&ue(o,$[5]);let D=d;d=S($),d===D?C[d].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){P(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function sO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[iO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&4194367&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function lO(n,e,t){let i,s,l;bt(n,Ft,O=>t(5,l=O)),dn(Ft,l="Files storage",l);let o={},r={},a=!1,u=!1;f();async function f(){t(2,a=!0);try{const O=await we.settings.getAll()||{};d(O)}catch(O){we.errorResponseHandler(O)}t(2,a=!1)}async function c(){if(!(u||!s)){t(3,u=!0);try{const O=await we.settings.update(W.filterRedactedProps(r));d(O),hi({}),cn("Successfully saved files storage settings.")}catch(O){we.errorResponseHandler(O)}t(3,u=!1)}}function d(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(){r.s3.enabled=this.checked,t(1,r)}function v(){r.s3.endpoint=this.value,t(1,r)}function b(){r.s3.bucket=this.value,t(1,r)}function y(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function S(O){n.$$.not_equal(r.s3.secret,O)&&(r.s3.secret=O,t(1,r))}function $(){r.s3.forcePathStyle=this.checked,t(1,r)}const M=()=>h(),D=()=>c(),E=()=>c();return n.$$.update=()=>{n.$$.dirty&1&&t(8,i=JSON.stringify(o)),n.$$.dirty&258&&t(4,s=i!=JSON.stringify(r))},[o,r,a,u,s,l,c,h,i,g,v,b,y,C,S,$,M,D,E]}class oO extends Ee{constructor(e){super(),Oe(this,e,lO,sO,De,{})}}function rO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(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])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(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,f,c;return i=new Re({props:{class:"form-field required",name:"emailAuth.minPasswordLength",$$slots:{default:[aO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Re({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailAuth.exceptDomains",$$slots:{default:[uO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailAuth.onlyDomains",$$slots:{default:[fO,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),m(e,t),j(i,t,null),m(e,s),m(e,l),j(o,l,null),m(e,r),m(e,a),j(u,a,null),c=!0},p(d,h){const g={};h&196609&&(g.$$scope={dirty:h,ctx:d}),i.$set(g);const v={};h&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Tt(()=>{f||(f=it(e,tn,{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=it(e,tn,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),q(i),q(o),q(u),d&&f&&f.end()}}}function aO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Minimum password length"),s=T(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",o=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].minPasswordLength),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&65536&&i!==(i=u[16])&&p(e,"for",i),f&65536&&o!==(o=u[16])&&p(l,"id",o),f&1&&Pt(l.value)!==u[0].minPasswordLength&&Te(l,u[0].minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function uO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;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 cs({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Except domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.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]))&&p(e,"for",l);const C={};y&65536&&(C.id=b[16]),y&1&&(C.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,C.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(C)},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),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function fO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;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 cs({props:v}),pe.push(()=>Fe(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(wt.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"))&&p(e,"for",l);const C={};y&65536&&(C.id=b[16]+".config.onlyDomains"),y&1&&(C.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,C.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(C)},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),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function cO(n){let e,t,i,s;e=new Re({props:{class:"form-field form-field-toggle m-b-0",name:"emailAuth.enabled",$$slots:{default:[rO,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&gh(n);return{c(){V(e.$$.fragment),t=T(),l&&l.c(),i=Ke()},m(o,r){j(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=gh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){q(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function dO(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pO(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function _h(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function hO(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?pO:dO}let u=a(n),f=u(n),c=n[2]&&_h();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=Ke(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&A(c,1):(c=_h(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},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 mO(n){let e,t;const i=[n[3]];let s={$$slots:{header:[hO],default:[cO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new Xo({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,[o]){const r=o&8?pn(i,[si(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),q(e,l)}}}function gO(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;bt(n,qi,$=>t(7,o=$));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 h(){r.minPasswordLength=Pt(this.value),t(0,r)}function g($){n.$$.not_equal(r.exceptDomains,$)&&(r.exceptDomains=$,t(0,r))}function v($){n.$$.not_equal(r.onlyDomains,$)&&(r.onlyDomains=$,t(0,r))}function b($){pe[$?"unshift":"push"](()=>{a=$,t(1,a)})}function y($){st.call(this,n,$)}function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$set=$=>{e=at(at({},e),ni($)),t(3,l=Bt(e,s)),"config"in $&&t(0,r=$.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailAuth))},[r,a,i,l,u,f,c,o,d,h,g,v,b,y,C,S]}class _O extends Ee{constructor(e){super(),Oe(this,e,gO,mO,De,{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 bO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},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[12]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function bh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;l=new Re({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[vO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),a=new Re({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[yO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}}),c=new Re({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[kO,({uniqueId:b})=>({23:b}),({uniqueId:b})=>b?8388608:0]},$$scope:{ctx:n}}});let v=n[4]&&vh(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),V(l.$$.fragment),o=T(),r=_("div"),V(a.$$.fragment),u=T(),f=_("div"),V(c.$$.fragment),d=T(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),m(e,t),m(e,i),m(e,s),j(l,s,null),m(e,o),m(e,r),j(a,r,null),m(e,u),m(e,f),j(c,f,null),m(e,d),v&&v.m(e,null),g=!0},p(b,y){const C={};y&2&&(C.name=b[1]+".clientId"),y&25165825&&(C.$$scope={dirty:y,ctx:b}),l.$set(C);const S={};y&2&&(S.name=b[1]+".clientSecret"),y&25165825&&(S.$$scope={dirty:y,ctx:b}),a.$set(S);const $={};y&2&&($.name=b[1]+".allowRegistrations"),y&25165825&&($.$$scope={dirty:y,ctx:b}),c.$set($),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=vh(b),v.c(),A(v,1),v.m(e,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Tt(()=>{h||(h=it(e,tn,{duration:200},!0)),h.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(h||(h=it(e,tn,{duration:200},!1)),h.run(0)),g=!1},d(b){b&&k(e),q(l),q(a),q(c),v&&v.d(),b&&h&&h.end()}}}function vO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Client ID"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].clientId),r||(a=G(l,"input",n[13]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].clientId&&Te(l,u[0].clientId)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function yO(n){let e,t,i,s,l,o,r;function a(f){n[14](f)}let u={id:n[23],required:!0};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new Za({props:u}),pe.push(()=>Fe(l,"value",a)),{c(){e=_("label"),t=F("Client Secret"),s=T(),V(l.$$.fragment),p(e,"for",i=n[23])},m(f,c){w(f,e,c),m(e,t),w(f,s,c),j(l,f,c),r=!0},p(f,c){(!r||c&8388608&&i!==(i=f[23]))&&p(e,"for",i);const d={};c&8388608&&(d.id=f[23]),!o&&c&1&&(o=!0,d.value=f[0].clientSecret,He(()=>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),q(l,f)}}}function kO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Allow registration for new users"),p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"for",o=n[23])},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[15]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].allowRegistrations),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function vh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return o=new Re({props:{class:"form-field",name:n[1]+".authUrl",$$slots:{default:[wO,({uniqueId:g})=>({23:g}),({uniqueId:g})=>g?8388608:0]},$$scope:{ctx:n}}}),u=new Re({props:{class:"form-field",name:n[1]+".tokenUrl",$$slots:{default:[$O,({uniqueId:g})=>({23:g}),({uniqueId:g})=>g?8388608:0]},$$scope:{ctx:n}}}),d=new Re({props:{class:"form-field",name:n[1]+".userApiUrl",$$slots:{default:[SO,({uniqueId:g})=>({23:g}),({uniqueId:g})=>g?8388608: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"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","section-title"),p(l,"class","col-lg-4"),p(a,"class","col-lg-4"),p(c,"class","col-lg-4"),p(s,"class","grid"),p(e,"class","col-lg-12")},m(g,v){w(g,e,v),m(e,t),m(e,i),m(e,s),m(s,l),j(o,l,null),m(s,r),m(s,a),j(u,a,null),m(s,f),m(s,c),j(d,c,null),h=!0},p(g,v){const b={};v&2&&(b.name=g[1]+".authUrl"),v&25165825&&(b.$$scope={dirty:v,ctx:g}),o.$set(b);const y={};v&2&&(y.name=g[1]+".tokenUrl"),v&25165825&&(y.$$scope={dirty:v,ctx:g}),u.$set(y);const C={};v&2&&(C.name=g[1]+".userApiUrl"),v&25165825&&(C.$$scope={dirty:v,ctx:g}),d.$set(C)},i(g){h||(A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),h=!0)},o(g){P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),h=!1},d(g){g&&k(e),q(o),q(u),q(d)}}}function wO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Custom Auth URL"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","url"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].authUrl),r||(a=G(l,"input",n[16]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&Te(l,u[0].authUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function $O(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Custom Token URL"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].tokenUrl),r||(a=G(l,"input",n[17]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].tokenUrl&&Te(l,u[0].tokenUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function SO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Custom User API URL"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23])},m(u,f){w(u,e,f),m(e,t),w(u,s,f),w(u,l,f),Te(l,n[0].userApiUrl),r||(a=G(l,"input",n[18]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].userApiUrl&&Te(l,u[0].userApiUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function CO(n){let e,t,i,s;e=new Re({props:{class:"form-field form-field-toggle m-b-0",name:n[1]+".enabled",$$slots:{default:[bO,({uniqueId:o})=>({23:o}),({uniqueId:o})=>o?8388608:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&bh(n);return{c(){V(e.$$.fragment),t=T(),l&&l.c(),i=Ke()},m(o,r){j(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&25165825&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=bh(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){q(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function yh(n){let e;return{c(){e=_("i"),p(e,"class",n[3])},m(t,i){w(t,e,i)},p(t,i){i&8&&p(e,"class",t[3])},d(t){t&&k(e)}}}function MO(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label label-hint")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function TO(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kh(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(wt.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Tt(()=>{t||(t=it(e,Tn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=it(e,Tn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function DO(n){let e,t,i,s,l,o,r,a,u,f,c=n[3]&&yh(n);function d(b,y){return b[0].enabled?TO:MO}let h=d(n),g=h(n),v=n[6]&&kh();return{c(){e=_("div"),c&&c.c(),t=T(),i=_("span"),s=F(n[2]),l=T(),g.c(),o=T(),r=_("div"),a=T(),v&&v.c(),u=Ke(),p(i,"class","txt"),p(e,"class","inline-flex"),p(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=yh(b),c.c(),c.m(e,t)):c&&(c.d(1),c=null),(!f||y&4)&&ue(s,b[2]),h!==(h=d(b))&&(g.d(1),g=h(b),g&&(g.c(),g.m(o.parentNode,o))),b[6]?v?y&64&&A(v,1):(v=kh(),v.c(),A(v,1),v.m(u.parentNode,u)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},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 OO(n){let e,t;const i=[n[7]];let s={$$slots:{header:[DO],default:[CO]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=at(s,i[l]);return e=new Xo({props:s}),n[19](e),e.$on("expand",n[20]),e.$on("collapse",n[21]),e.$on("toggle",n[22]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,[o]){const r=o&128?pn(i,[si(l[7])]):{};o&16777311&&(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[19](null),q(e,l)}}}function EO(n,e,t){let i;const s=["key","title","icon","config","showSelfHostedFields","expand","collapse","collapseSiblings"];let l=Bt(e,s),o;bt(n,qi,N=>t(11,o=N));let{key:r}=e,{title:a}=e,{icon:u=""}=e,{config:f={}}=e,{showSelfHostedFields:c=!1}=e,d;function h(){d==null||d.expand()}function g(){d==null||d.collapse()}function v(){d==null||d.collapseSiblings()}function b(){f.enabled=this.checked,t(0,f)}function y(){f.clientId=this.value,t(0,f)}function C(N){n.$$.not_equal(f.clientSecret,N)&&(f.clientSecret=N,t(0,f))}function S(){f.allowRegistrations=this.checked,t(0,f)}function $(){f.authUrl=this.value,t(0,f)}function M(){f.tokenUrl=this.value,t(0,f)}function D(){f.userApiUrl=this.value,t(0,f)}function E(N){pe[N?"unshift":"push"](()=>{d=N,t(5,d)})}function O(N){st.call(this,n,N)}function L(N){st.call(this,n,N)}function I(N){st.call(this,n,N)}return n.$$set=N=>{e=at(at({},e),ni(N)),t(7,l=Bt(e,s)),"key"in N&&t(1,r=N.key),"title"in N&&t(2,a=N.title),"icon"in N&&t(3,u=N.icon),"config"in N&&t(0,f=N.config),"showSelfHostedFields"in N&&t(4,c=N.showSelfHostedFields)},n.$$.update=()=>{n.$$.dirty&2050&&t(6,i=!W.isEmpty(W.getNestedVal(o,r))),n.$$.dirty&3&&(f.enabled||wa(r))},[f,r,a,u,c,d,i,l,h,g,v,o,b,y,C,S,$,M,D,E,O,L,I]}class to extends Ee{constructor(e){super(),Oe(this,e,EO,OO,De,{key:1,title:2,icon:3,config:0,showSelfHostedFields:4,expand:8,collapse:9,collapseSiblings:10})}get expand(){return this.$$.ctx[8]}get collapse(){return this.$$.ctx[9]}get collapseSiblings(){return this.$$.ctx[10]}}function AO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E,O,L,I;function N(X){n[11](X)}let B={single:!0};n[0].emailAuth!==void 0&&(B.config=n[0].emailAuth),t=new _O({props:B}),n[10](t),pe.push(()=>Fe(t,"config",N));function U(X){n[12](X)}let ee={single:!0,key:"googleAuth",title:"Google",icon:"ri-google-line"};n[0].googleAuth!==void 0&&(ee.config=n[0].googleAuth),l=new to({props:ee}),pe.push(()=>Fe(l,"config",U));function K(X){n[13](X)}let se={single:!0,key:"facebookAuth",title:"Facebook",icon:"ri-facebook-line"};n[0].facebookAuth!==void 0&&(se.config=n[0].facebookAuth),a=new to({props:se}),pe.push(()=>Fe(a,"config",K));function Y(X){n[14](X)}let te={single:!0,key:"githubAuth",title:"GitHub",icon:"ri-github-line"};n[0].githubAuth!==void 0&&(te.config=n[0].githubAuth),c=new to({props:te}),pe.push(()=>Fe(c,"config",Y));function J(X){n[15](X)}let _e={single:!0,key:"gitlabAuth",title:"GitLab",icon:"ri-gitlab-line",showSelfHostedFields:!0};n[0].gitlabAuth!==void 0&&(_e.config=n[0].gitlabAuth),g=new to({props:_e}),pe.push(()=>Fe(g,"config",J));let be=n[4]&&wh(n);return{c(){e=_("div"),V(t.$$.fragment),s=T(),V(l.$$.fragment),r=T(),V(a.$$.fragment),f=T(),V(c.$$.fragment),h=T(),V(g.$$.fragment),b=T(),y=_("div"),C=_("div"),S=T(),be&&be.c(),$=T(),M=_("button"),D=_("span"),D.textContent="Save changes",p(e,"class","accordions"),p(C,"class","flex-fill"),p(D,"class","txt"),p(M,"type","submit"),p(M,"class","btn btn-expanded"),M.disabled=E=!n[4]||n[3],ie(M,"btn-loading",n[3]),p(y,"class","flex m-t-base")},m(X,ae){w(X,e,ae),j(t,e,null),m(e,s),j(l,e,null),m(e,r),j(a,e,null),m(e,f),j(c,e,null),m(e,h),j(g,e,null),w(X,b,ae),w(X,y,ae),m(y,C),m(y,S),be&&be.m(y,null),m(y,$),m(y,M),m(M,D),O=!0,L||(I=G(M,"click",n[17]),L=!0)},p(X,ae){const ve={};!i&&ae&1&&(i=!0,ve.config=X[0].emailAuth,He(()=>i=!1)),t.$set(ve);const H={};!o&&ae&1&&(o=!0,H.config=X[0].googleAuth,He(()=>o=!1)),l.$set(H);const me={};!u&&ae&1&&(u=!0,me.config=X[0].facebookAuth,He(()=>u=!1)),a.$set(me);const x={};!d&&ae&1&&(d=!0,x.config=X[0].githubAuth,He(()=>d=!1)),c.$set(x);const Q={};!v&&ae&1&&(v=!0,Q.config=X[0].gitlabAuth,He(()=>v=!1)),g.$set(Q),X[4]?be?be.p(X,ae):(be=wh(X),be.c(),be.m(y,$)):be&&(be.d(1),be=null),(!O||ae&24&&E!==(E=!X[4]||X[3]))&&(M.disabled=E),ae&8&&ie(M,"btn-loading",X[3])},i(X){O||(A(t.$$.fragment,X),A(l.$$.fragment,X),A(a.$$.fragment,X),A(c.$$.fragment,X),A(g.$$.fragment,X),O=!0)},o(X){P(t.$$.fragment,X),P(l.$$.fragment,X),P(a.$$.fragment,X),P(c.$$.fragment,X),P(g.$$.fragment,X),O=!1},d(X){X&&k(e),n[10](null),q(t),q(l),q(a),q(c),q(g),X&&k(b),X&&k(y),be&&be.d(),L=!1,I()}}}function PO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function wh(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),m(e,t),i||(s=G(e,"click",n[16]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function LO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[PO,AO],C=[];function S($,M){return $[2]?0:1}return d=S(n),h=C[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[5]),r=T(),a=_("div"),u=_("form"),f=_("h6"),f.textContent="Manage the allowed users sign-in/sign-up methods.",c=T(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w($,r,M),w($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=G(u,"submit",Yt(n[6])),v=!0)},p($,M){(!g||M&32)&&ue(o,$[5]);let D=d;d=S($),d===D?C[d].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){P(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function IO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[LO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048639&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function FO(n,e,t){let i,s,l;bt(n,Ft,E=>t(5,l=E)),dn(Ft,l="Auth providers",l);let o,r={},a={},u=!1,f=!1;c();async function c(){t(2,u=!0);try{const E=await we.settings.getAll()||{};h(E)}catch(E){we.errorResponseHandler(E)}t(2,u=!1)}async function d(){if(!(f||!s)){t(3,f=!0);try{const E=await we.settings.update(W.filterRedactedProps(a));h(E),hi({}),o==null||o.collapseSiblings(),cn("Successfully updated auth providers.")}catch(E){we.errorResponseHandler(E)}t(3,f=!1)}}function h(E){E=E||{},t(0,a={emailAuth:Object.assign({enabled:!0},E.emailAuth)});const O=["googleAuth","facebookAuth","githubAuth","gitlabAuth"];for(const L of O)t(0,a[L]=Object.assign({enabled:!1,allowRegistrations:!0},E[L]),a);t(8,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(E){pe[E?"unshift":"push"](()=>{o=E,t(1,o)})}function b(E){n.$$.not_equal(a.emailAuth,E)&&(a.emailAuth=E,t(0,a))}function y(E){n.$$.not_equal(a.googleAuth,E)&&(a.googleAuth=E,t(0,a))}function C(E){n.$$.not_equal(a.facebookAuth,E)&&(a.facebookAuth=E,t(0,a))}function S(E){n.$$.not_equal(a.githubAuth,E)&&(a.githubAuth=E,t(0,a))}function $(E){n.$$.not_equal(a.gitlabAuth,E)&&(a.gitlabAuth=E,t(0,a))}const M=()=>g(),D=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(4,s=i!=JSON.stringify(a))},[a,o,u,f,s,l,d,g,r,i,v,b,y,C,S,$,M,D]}class NO extends Ee{constructor(e){super(),Oe(this,e,FO,IO,De,{})}}function $h(n,e,t){const i=n.slice();return i[16]=e[t],i[17]=e,i[18]=t,i}function RO(n){let e=[],t=new Map,i,s,l,o,r,a,u,f,c,d,h,g=n[5];const v=y=>y[16].key;for(let y=0;y<g.length;y+=1){let C=$h(n,g,y),S=v(C);t.set(S,e[y]=Sh(S,C))}let b=n[3]&&Ch(n);return{c(){for(let y=0;y<e.length;y+=1)e[y].c();i=T(),s=_("div"),l=_("div"),o=T(),b&&b.c(),r=T(),a=_("button"),u=_("span"),u.textContent="Save changes",p(l,"class","flex-fill"),p(u,"class","txt"),p(a,"type","submit"),p(a,"class","btn btn-expanded"),a.disabled=f=!n[3]||n[2],ie(a,"btn-loading",n[2]),p(s,"class","flex")},m(y,C){for(let S=0;S<e.length;S+=1)e[S].m(y,C);w(y,i,C),w(y,s,C),m(s,l),m(s,o),b&&b.m(s,null),m(s,r),m(s,a),m(a,u),c=!0,d||(h=G(a,"click",n[13]),d=!0)},p(y,C){C&524321&&(g=y[5],Pe(),e=yt(e,C,v,1,y,g,t,i.parentNode,Zt,Sh,i,$h),Le()),y[3]?b?b.p(y,C):(b=Ch(y),b.c(),b.m(s,r)):b&&(b.d(1),b=null),(!c||C&12&&f!==(f=!y[3]||y[2]))&&(a.disabled=f),C&4&&ie(a,"btn-loading",y[2])},i(y){if(!c){for(let C=0;C<g.length;C+=1)A(e[C]);c=!0}},o(y){for(let C=0;C<e.length;C+=1)P(e[C]);c=!1},d(y){for(let C=0;C<e.length;C+=1)e[C].d(y);y&&k(i),y&&k(s),b&&b.d(),d=!1,h()}}}function HO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function jO(n){let e,t=n[16].label+"",i,s,l,o,r,a,u,f,c,d,h;function g(){n[10].call(r,n[16])}function v(){return n[11](n[16])}return{c(){e=_("label"),i=F(t),s=F(" duration (in seconds)"),o=T(),r=_("input"),u=T(),f=_("div"),c=_("span"),c.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[19]),p(r,"type","number"),p(r,"id",a=n[19]),r.required=!0,p(c,"class","link-primary"),ie(c,"txt-success",n[0][n[16].key].secret),p(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),Te(r,n[0][n[16].key].duration),w(b,u,y),w(b,f,y),m(f,c),d||(h=[G(r,"input",g),G(c,"click",v)],d=!0)},p(b,y){n=b,y&524288&&l!==(l=n[19])&&p(e,"for",l),y&524288&&a!==(a=n[19])&&p(r,"id",a),y&33&&Pt(r.value)!==n[0][n[16].key].duration&&Te(r,n[0][n[16].key].duration),y&33&&ie(c,"txt-success",n[0][n[16].key].secret)},d(b){b&&k(e),b&&k(o),b&&k(r),b&&k(u),b&&k(f),d=!1,Ge(h)}}}function Sh(n,e){let t,i,s;return i=new Re({props:{class:"form-field required",name:e[16].key+".duration",$$slots:{default:[jO,({uniqueId:l})=>({19:l}),({uniqueId:l})=>l?524288:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=Ke(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o&1572865&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Ch(n){let e,t,i,s;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary btn-hint"),e.disabled=n[2]},m(l,o){w(l,e,o),m(e,t),i||(s=G(e,"click",n[12]),i=!0)},p(l,o){o&4&&(e.disabled=l[2])},d(l){l&&k(e),i=!1,s()}}}function qO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b;const y=[HO,RO],C=[];function S($,M){return $[1]?0:1}return d=S(n),h=C[d]=y[d](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[4]),r=T(),a=_("div"),u=_("form"),f=_("div"),f.innerHTML="<p>Adjust common token options.</p>",c=T(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content m-b-sm txt-xl"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){w($,e,M),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w($,r,M),w($,a,M),m(a,u),m(u,f),m(u,c),C[d].m(u,null),g=!0,v||(b=G(u,"submit",Yt(n[6])),v=!0)},p($,M){(!g||M&16)&&ue(o,$[4]);let D=d;d=S($),d===D?C[d].p($,M):(Pe(),P(C[D],1,1,()=>{C[D]=null}),Le(),h=C[d],h?h.p($,M):(h=C[d]=y[d]($),h.c()),A(h,1),h.m(u,null))},i($){g||(A(h),g=!0)},o($){P(h),g=!1},d($){$&&k(e),$&&k(r),$&&k(a),C[d].d(),v=!1,b()}}}function VO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[qO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048607&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function zO(n,e,t){let i,s,l;bt(n,Ft,S=>t(4,l=S));const o=[{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"}];dn(Ft,l="Token options",l);let r={},a={},u=!1,f=!1;c();async function c(){t(1,u=!0);try{const S=await we.settings.getAll()||{};h(S)}catch(S){we.errorResponseHandler(S)}t(1,u=!1)}async function d(){if(!(f||!s)){t(2,f=!0);try{const S=await we.settings.update(W.filterRedactedProps(a));h(S),cn("Successfully saved tokens options.")}catch(S){we.errorResponseHandler(S)}t(2,f=!1)}}function h(S){var $;S=S||{},t(0,a={});for(const M of o)t(0,a[M.key]={duration:(($=S[M.key])==null?void 0:$.duration)||0},a);t(8,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(S){a[S.key].duration=Pt(this.value),t(0,a)}const b=S=>{a[S.key].secret?(delete a[S.key].secret,t(0,a)):t(0,a[S.key].secret=W.randomString(50),a)},y=()=>g(),C=()=>d();return n.$$.update=()=>{n.$$.dirty&256&&t(9,i=JSON.stringify(r)),n.$$.dirty&513&&t(3,s=i!=JSON.stringify(a))},[a,u,f,s,l,o,d,g,r,i,v,b,y,C]}class BO extends Ee{constructor(e){super(),Oe(this,e,zO,VO,De,{})}}function UO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g;return o=new _n({props:{content:n[2]}}),{c(){e=_("div"),e.innerHTML=`<p>Below you'll find your current collections configuration that you could import in
|
||
another PocketBase environment.</p>`,t=T(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=T(),V(o.$$.fragment),r=T(),a=_("div"),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
|
||
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){w(v,e,b),w(v,t,b),w(v,i,b),m(i,s),m(i,l),j(o,i,null),n[8](i),w(v,r,b),w(v,a,b),m(a,u),m(a,f),m(a,c),d=!0,h||(g=[G(s,"click",n[7]),G(i,"keydown",n[9]),G(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){P(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),q(o),n[8](null),v&&k(r),v&&k(a),h=!1,Ge(g)}}}function WO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function YO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[WO,UO],g=[];function v(b,y){return b[1]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[3]),r=T(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let C=f;f=v(b),f===C?g[f].p(b,y):(Pe(),P(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function KO(n){let e,t,i,s;return e=new Bi({}),i=new On({props:{$$slots:{default:[YO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function JO(n,e,t){let i,s;bt(n,Ft,b=>t(3,s=b)),dn(Ft,s="Export collections",s);const l="export_"+W.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await we.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){we.errorResponseHandler(b)}t(1,a=!1)}function f(){W.downloadJson(r,"pb_schema")}function c(){W.copyToClipboard(i),Lg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){pe[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),C=document.createRange();C.selectNodeContents(o),y.removeAllRanges(),y.addRange(C)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,v]}class ZO extends Ee{constructor(e){super(),Oe(this,e,JO,KO,De,{})}}function Mh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Th(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Dh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Oh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Eh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ah(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Ph(n,e,t){const i=n.slice();return i[30]=e[t],i}function GO(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Lh(),a=n[0].name!==n[1].name&&Ih(n);return{c(){e=_("div"),r&&r.c(),t=T(),a&&a.c(),i=T(),s=_("strong"),o=F(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),m(e,t),a&&a.m(e,null),m(e,i),m(e,s),m(s,o)},p(u,f){u[9]?r||(r=Lh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Ih(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function XO(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=T(),i=_("strong"),l=F(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function QO(n){var o;let e,t,i,s=((o=n[1])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Added",t=T(),i=_("strong"),l=F(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),m(i,l)},p(r,a){var u;a[0]&2&&s!==(s=((u=r[1])==null?void 0:u.name)+"")&&ue(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function Lh(n){let e;return{c(){e=_("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Ih(n){let e,t=n[0].name+"",i,s,l;return{c(){e=_("strong"),i=F(t),s=T(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function Fh(n){var b,y;let e,t,i,s=n[30]+"",l,o,r,a,u=n[12]((b=n[0])==null?void 0:b[n[30]])+"",f,c,d,h,g=n[12]((y=n[1])==null?void 0:y[n[30]])+"",v;return{c(){var C,S,$,M,D,E;e=_("tr"),t=_("td"),i=_("span"),l=F(s),o=T(),r=_("td"),a=_("pre"),f=F(u),c=T(),d=_("td"),h=_("pre"),v=F(g),p(t,"class","min-width svelte-lmkr38"),p(a,"class","txt"),p(r,"class","svelte-lmkr38"),ie(r,"changed-old-col",!n[10]&&vn((C=n[0])==null?void 0:C[n[30]],(S=n[1])==null?void 0:S[n[30]])),ie(r,"changed-none-col",n[10]),p(h,"class","txt"),p(d,"class","svelte-lmkr38"),ie(d,"changed-new-col",!n[5]&&vn(($=n[0])==null?void 0:$[n[30]],(M=n[1])==null?void 0:M[n[30]])),ie(d,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),ie(e,"txt-primary",vn((D=n[0])==null?void 0:D[n[30]],(E=n[1])==null?void 0:E[n[30]]))},m(C,S){w(C,e,S),m(e,t),m(t,i),m(i,l),m(e,o),m(e,r),m(r,a),m(a,f),m(e,c),m(e,d),m(d,h),m(h,v)},p(C,S){var $,M,D,E,O,L,I,N;S[0]&1&&u!==(u=C[12](($=C[0])==null?void 0:$[C[30]])+"")&&ue(f,u),S[0]&3075&&ie(r,"changed-old-col",!C[10]&&vn((M=C[0])==null?void 0:M[C[30]],(D=C[1])==null?void 0:D[C[30]])),S[0]&1024&&ie(r,"changed-none-col",C[10]),S[0]&2&&g!==(g=C[12]((E=C[1])==null?void 0:E[C[30]])+"")&&ue(v,g),S[0]&2083&&ie(d,"changed-new-col",!C[5]&&vn((O=C[0])==null?void 0:O[C[30]],(L=C[1])==null?void 0:L[C[30]])),S[0]&32&&ie(d,"changed-none-col",C[5]),S[0]&2051&&ie(e,"txt-primary",vn((I=C[0])==null?void 0:I[C[30]],(N=C[1])==null?void 0:N[C[30]]))},d(C){C&&k(e)}}}function Nh(n){let e,t=n[6],i=[];for(let s=0;s<t.length;s+=1)i[s]=Hh(Eh(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Ke()},m(s,l){for(let o=0;o<i.length;o+=1)i[o].m(s,l);w(s,e,l)},p(s,l){if(l[0]&4160){t=s[6];let o;for(o=0;o<t.length;o+=1){const r=Eh(s,t,o);i[o]?i[o].p(r,l):(i[o]=Hh(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){Qt(i,s),s&&k(e)}}}function Rh(n){let e,t,i=n[17]+"",s,l,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=_("tr"),t=_("td"),s=F(i),l=T(),o=_("td"),r=_("pre"),u=F(a),f=T(),c=_("td"),d=T(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-lmkr38"),p(c,"class","changed-none-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(h,g){w(h,e,g),m(e,t),m(t,s),m(e,l),m(e,o),m(o,r),m(r,u),m(e,f),m(e,c),m(e,d)},p(h,g){g[0]&64&&i!==(i=h[17]+"")&&ue(s,i),g[0]&64&&a!==(a=h[12](h[18])+"")&&ue(u,a)},d(h){h&&k(e)}}}function Hh(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c,d,h=n[14].name+"",g,v,b,y,C=Object.entries(n[14]),S=[];for(let $=0;$<C.length;$+=1)S[$]=Rh(Ah(n,C,$));return{c(){e=_("tr"),t=_("th"),i=_("span"),s=F("field: "),o=F(l),r=T(),a=_("span"),u=F("Deleted - "),f=_("small"),c=F("All stored data related to "),d=_("strong"),g=F(h),v=F(" will be deleted!"),b=T();for(let $=0;$<S.length;$+=1)S[$].c();y=Ke(),p(i,"class","txt"),p(a,"class","label label-danger m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m($,M){w($,e,M),m(e,t),m(t,i),m(i,s),m(i,o),m(t,r),m(t,a),m(a,u),m(a,f),m(f,c),m(f,d),m(d,g),m(f,v),w($,b,M);for(let D=0;D<S.length;D+=1)S[D].m($,M);w($,y,M)},p($,M){if(M[0]&64&&l!==(l=$[14].name+"")&&ue(o,l),M[0]&64&&h!==(h=$[14].name+"")&&ue(g,h),M[0]&4160){C=Object.entries($[14]);let D;for(D=0;D<C.length;D+=1){const E=Ah($,C,D);S[D]?S[D].p(E,M):(S[D]=Rh(E),S[D].c(),S[D].m(y.parentNode,y))}for(;D<S.length;D+=1)S[D].d(1);S.length=C.length}},d($){$&&k(e),$&&k(b),Qt(S,$),$&&k(y)}}}function jh(n){let e;return{c(){e=_("span"),e.textContent="Changed",p(e,"class","label label-warning m-l-5 svelte-lmkr38")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qh(n){var v;let e,t,i=n[17]+"",s,l,o,r,a=n[12]((v=qn(n[3],n[14].id))==null?void 0:v[n[17]])+"",u,f,c,d,h=n[12](n[23])+"",g;return{c(){var b,y,C;e=_("tr"),t=_("td"),s=F(i),l=T(),o=_("td"),r=_("pre"),u=F(a),f=T(),c=_("td"),d=_("pre"),g=F(h),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","svelte-lmkr38"),ie(o,"changed-old-col",vn((b=qn(n[3],n[14].id))==null?void 0:b[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-lmkr38"),ie(c,"changed-new-col",vn((y=qn(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-lmkr38"),ie(e,"txt-primary",vn((C=qn(n[3],n[14].id))==null?void 0:C[n[17]],n[23]))},m(b,y){w(b,e,y),m(e,t),m(t,s),m(e,l),m(e,o),m(o,r),m(r,u),m(e,f),m(e,c),m(c,d),m(d,g)},p(b,y){var C,S,$,M;y[0]&128&&i!==(i=b[17]+"")&&ue(s,i),y[0]&136&&a!==(a=b[12]((C=qn(b[3],b[14].id))==null?void 0:C[b[17]])+"")&&ue(u,a),y[0]&136&&ie(o,"changed-old-col",vn((S=qn(b[3],b[14].id))==null?void 0:S[b[17]],b[23])),y[0]&128&&h!==(h=b[12](b[23])+"")&&ue(g,h),y[0]&136&&ie(c,"changed-new-col",vn(($=qn(b[3],b[14].id))==null?void 0:$[b[17]],b[23])),y[0]&136&&ie(e,"txt-primary",vn((M=qn(b[3],b[14].id))==null?void 0:M[b[17]],b[23]))},d(b){b&&k(e)}}}function Vh(n){let e,t,i,s,l=n[14].name+"",o,r,a=vn(qn(n[3],n[14].id),qn(n[4],n[14].id)),u,f,c=a&&jh(),d=Object.entries(n[14]),h=[];for(let g=0;g<d.length;g+=1)h[g]=qh(Oh(n,d,g));return{c(){e=_("tr"),t=_("th"),i=_("span"),s=F("field: "),o=F(l),r=T(),c&&c.c(),u=T();for(let g=0;g<h.length;g+=1)h[g].c();f=Ke(),p(i,"class","txt"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(g,v){w(g,e,v),m(e,t),m(t,i),m(i,s),m(i,o),m(t,r),c&&c.m(t,null),w(g,u,v);for(let b=0;b<h.length;b+=1)h[b].m(g,v);w(g,f,v)},p(g,v){if(v[0]&128&&l!==(l=g[14].name+"")&&ue(o,l),v[0]&152&&(a=vn(qn(g[3],g[14].id),qn(g[4],g[14].id))),a?c||(c=jh(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),v[0]&4232){d=Object.entries(g[14]);let b;for(b=0;b<d.length;b+=1){const y=Oh(g,d,b);h[b]?h[b].p(y,v):(h[b]=qh(y),h[b].c(),h[b].m(f.parentNode,f))}for(;b<h.length;b+=1)h[b].d(1);h.length=d.length}},d(g){g&&k(e),c&&c.d(),g&&k(u),Qt(h,g),g&&k(f)}}}function zh(n){let e,t,i=n[17]+"",s,l,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=_("tr"),t=_("td"),s=F(i),l=T(),o=_("td"),r=T(),a=_("td"),u=_("pre"),c=F(f),d=T(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(o,"class","changed-none-col svelte-lmkr38"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(h,g){w(h,e,g),m(e,t),m(t,s),m(e,l),m(e,o),m(e,r),m(e,a),m(a,u),m(u,c),m(e,d)},p(h,g){g[0]&256&&i!==(i=h[17]+"")&&ue(s,i),g[0]&256&&f!==(f=h[12](h[18])+"")&&ue(c,f)},d(h){h&&k(e)}}}function Bh(n){let e,t,i,s,l=n[14].name+"",o,r,a,u,f,c=Object.entries(n[14]),d=[];for(let h=0;h<c.length;h+=1)d[h]=zh(Th(n,c,h));return{c(){e=_("tr"),t=_("th"),i=_("span"),s=F("field: "),o=F(l),r=T(),a=_("span"),a.textContent="Added",u=T();for(let h=0;h<d.length;h+=1)d[h].c();f=Ke(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(h,g){w(h,e,g),m(e,t),m(t,i),m(i,s),m(i,o),m(t,r),m(t,a),w(h,u,g);for(let v=0;v<d.length;v+=1)d[v].m(h,g);w(h,f,g)},p(h,g){if(g[0]&256&&l!==(l=h[14].name+"")&&ue(o,l),g[0]&4352){c=Object.entries(h[14]);let v;for(v=0;v<c.length;v+=1){const b=Th(h,c,v);d[v]?d[v].p(b,g):(d[v]=zh(b),d[v].c(),d[v].m(f.parentNode,f))}for(;v<d.length;v+=1)d[v].d(1);d.length=c.length}},d(h){h&&k(e),h&&k(u),Qt(d,h),h&&k(f)}}}function xO(n){let e,t,i,s,l,o,r,a,u;function f($,M){var D,E;return(D=$[0])!=null&&D.id?(E=$[1])!=null&&E.id?GO:XO:QO}let c=f(n),d=c(n),h=n[11],g=[];for(let $=0;$<h.length;$+=1)g[$]=Fh(Ph(n,h,$));let v=(n[2]||n[5])&&Nh(n),b=n[7],y=[];for(let $=0;$<b.length;$+=1)y[$]=Vh(Dh(n,b,$));let C=n[8],S=[];for(let $=0;$<C.length;$+=1)S[$]=Bh(Mh(n,C,$));return{c(){e=_("div"),d.c(),t=T(),i=_("table"),s=_("thead"),s.innerHTML=`<tr class="svelte-lmkr38"><th class="svelte-lmkr38">Props</th>
|
||
<th width="10%" class="svelte-lmkr38">Old</th>
|
||
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=T(),o=_("tbody");for(let $=0;$<g.length;$+=1)g[$].c();r=T(),v&&v.c(),a=T();for(let $=0;$<y.length;$+=1)y[$].c();u=T();for(let $=0;$<S.length;$+=1)S[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){w($,e,M),d.m(e,null),w($,t,M),w($,i,M),m(i,s),m(i,l),m(i,o);for(let D=0;D<g.length;D+=1)g[D].m(o,null);m(o,r),v&&v.m(o,null),m(o,a);for(let D=0;D<y.length;D+=1)y[D].m(o,null);m(o,u);for(let D=0;D<S.length;D+=1)S[D].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){h=$[11];let D;for(D=0;D<h.length;D+=1){const E=Ph($,h,D);g[D]?g[D].p(E,M):(g[D]=Fh(E),g[D].c(),g[D].m(o,r))}for(;D<g.length;D+=1)g[D].d(1);g.length=h.length}if($[2]||$[5]?v?v.p($,M):(v=Nh($),v.c(),v.m(o,a)):v&&(v.d(1),v=null),M[0]&4248){b=$[7];let D;for(D=0;D<b.length;D+=1){const E=Dh($,b,D);y[D]?y[D].p(E,M):(y[D]=Vh(E),y[D].c(),y[D].m(o,u))}for(;D<y.length;D+=1)y[D].d(1);y.length=b.length}if(M[0]&4352){C=$[8];let D;for(D=0;D<C.length;D+=1){const E=Mh($,C,D);S[D]?S[D].p(E,M):(S[D]=Bh(E),S[D].c(),S[D].m(o,null))}for(;D<S.length;D+=1)S[D].d(1);S.length=C.length}},i:oe,o:oe,d($){$&&k(e),d.d(),$&&k(t),$&&k(i),Qt(g,$),v&&v.d(),Qt(y,$),Qt(S,$)}}}function qn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function vn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function eE(n,e,t){let i,s,l,{collectionA:o=new fn}=e,{collectionB:r=new fn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const g=Object.keys(new fn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(C=>y.id==C.id))))}function b(y){return typeof y>"u"?"":W.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(C=>y.id==C.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(C=>C.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(C=>C.id==y.id))),n.$$.dirty[0]&7&&t(9,l=W.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,g,b]}class tE extends Ee{constructor(e){super(),Oe(this,e,eE,xO,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Uh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Wh(n){let e,t;return e=new tE({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function nE(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Wh(Uh(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Uh(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Wh(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(Pe(),a=i.length;a<s.length;a+=1)l(a);Le()}},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){Qt(s,o),o&&k(e)}}}function iE(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:oe,d(t){t&&k(e)}}}function sE(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=F("Close"),i=T(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-expanded"),s.disabled=n[4],ie(s,"btn-loading",n[4])},m(a,u){w(a,e,u),m(e,t),w(a,i,u),w(a,s,u),m(s,l),o||(r=[G(e,"click",n[0]),G(s,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(s.disabled=a[4]),u&16&&ie(s,"btn-loading",a[4])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Ge(r)}}}function lE(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[sE],header:[iE],default:[nE]},$$scope:{ctx:n}};return e=new mi({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&1048604&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function oE(n,e,t){const i=on();let s,l=[],o=[],r=[],a=!1,u=!1;function f($,M,D=!1){t(7,l=$),t(8,o=M),t(3,a=D),s==null||s.show()}function c(){return s==null?void 0:s.hide()}function d(){t(2,r=[]);for(const $ of l){const M=W.findByKey(o,"id",$.id)||null;(a&&!(M!=null&&M.id)||(M==null?void 0:M.id)&&W.hasCollectionChanges($,M,a))&&r.push({old:$,new:M})}for(const $ of o){const M=W.findByKey(l,"id",$.id)||null;M!=null&&M.id||r.push({old:M,new:$})}}function h(){const $=[];if(a)for(const M of l){const D=W.findByKey(o,"id",M.id);if(!D)$.push(M.name+".*");else{const E=Array.isArray(M.schema)?M.schema:[];for(const O of E)W.findByKey(D.schema,"id",O.id)||$.push(`${M.name}.${O.name} (${O.id})`)}}$.length?pi(`Do you really want to delete the following collection fields and their related records data:
|
||
- ${$.join(`
|
||
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await we.collections.import(o,a),cn("Successfully imported collections configuration."),i("submit")}catch($){we.errorResponseHandler($)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y($){pe[$?"unshift":"push"](()=>{s=$,t(1,s)})}function C($){st.call(this,n,$)}function S($){st.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,C,S]}class rE extends Ee{constructor(e){super(),Oe(this,e,oE,lE,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Yh(n,e,t){const i=n.slice();return i[32]=e[t],i}function Kh(n,e,t){const i=n.slice();return i[35]=e[t],i}function Jh(n,e,t){const i=n.slice();return i[32]=e[t],i}function aE(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$,M,D,E;a=new Re({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[fE,({uniqueId:U})=>({40:U}),({uniqueId:U})=>[0,U?512:0]]},$$scope:{ctx:n}}});let O=!1,L=n[6]&&n[1].length&&!n[7]&&Gh(),I=n[6]&&n[1].length&&n[7]&&Xh(n),N=n[13].length&&am(n),B=!!n[0]&&um(n);return{c(){e=_("input"),t=T(),i=_("div"),s=_("p"),l=F(`Paste below the collections configuration you want to import or
|
||
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=T(),V(a.$$.fragment),u=T(),f=T(),L&&L.c(),c=T(),I&&I.c(),d=T(),N&&N.c(),h=T(),g=_("div"),B&&B.c(),v=T(),b=_("div"),y=T(),C=_("button"),S=_("span"),S.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ie(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(S,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=$=!n[14],p(g,"class","flex m-t-base")},m(U,ee){w(U,e,ee),n[19](e),w(U,t,ee),w(U,i,ee),m(i,s),m(s,l),m(s,o),w(U,r,ee),j(a,U,ee),w(U,u,ee),w(U,f,ee),L&&L.m(U,ee),w(U,c,ee),I&&I.m(U,ee),w(U,d,ee),N&&N.m(U,ee),w(U,h,ee),w(U,g,ee),B&&B.m(g,null),m(g,v),m(g,b),m(g,y),m(g,C),m(C,S),M=!0,D||(E=[G(e,"change",n[20]),G(o,"click",n[21]),G(C,"click",n[26])],D=!0)},p(U,ee){ee[0]&4096&&ie(o,"btn-loading",U[12]);const K={};ee[0]&64&&(K.class="form-field "+(U[6]?"":"field-error")),ee[0]&65|ee[1]&1536&&(K.$$scope={dirty:ee,ctx:U}),a.$set(K),U[6]&&U[1].length&&!U[7]?L||(L=Gh(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),U[6]&&U[1].length&&U[7]?I?I.p(U,ee):(I=Xh(U),I.c(),I.m(d.parentNode,d)):I&&(I.d(1),I=null),U[13].length?N?N.p(U,ee):(N=am(U),N.c(),N.m(h.parentNode,h)):N&&(N.d(1),N=null),U[0]?B?B.p(U,ee):(B=um(U),B.c(),B.m(g,v)):B&&(B.d(1),B=null),(!M||ee[0]&16384&&$!==($=!U[14]))&&(C.disabled=$)},i(U){M||(A(a.$$.fragment,U),A(O),M=!0)},o(U){P(a.$$.fragment,U),P(O),M=!1},d(U){U&&k(e),n[19](null),U&&k(t),U&&k(i),U&&k(r),q(a,U),U&&k(u),U&&k(f),L&&L.d(U),U&&k(c),I&&I.d(U),U&&k(d),N&&N.d(U),U&&k(h),U&&k(g),B&&B.d(),D=!1,Ge(E)}}}function uE(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:oe,i:oe,o:oe,d(t){t&&k(e)}}}function Zh(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function fE(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Zh();return{c(){e=_("label"),t=F("Collections"),s=T(),l=_("textarea"),r=T(),c&&c.c(),a=Ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),m(e,t),w(d,s,h),w(d,l,h),Te(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=G(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Te(l,d[0]),!!d[0]&&!d[6]?c||(c=Zh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function Gh(n){let e;return{c(){e=_("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
|
||
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xh(n){let e,t,i,s,l,o=n[9].length&&Qh(n),r=n[4].length&&tm(n),a=n[8].length&&lm(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=T(),i=_("div"),o&&o.c(),s=T(),r&&r.c(),l=T(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),m(i,s),r&&r.m(i,null),m(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Qh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=tm(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=lm(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Qh(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Jh(n,s,o),a=l(r);t.set(a,e[o]=em(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=yt(e,r,l,1,o,s,t,i.parentNode,Mn,em,i,Jh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function xh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function em(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&xh(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=T(),l=_("strong"),r=F(o),a=T(),f&&f.c(),u=T(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=xh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function tm(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=Kh(n,s,o),a=l(r);t.set(a,e[o]=sm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=yt(e,r,l,1,o,s,t,i.parentNode,Mn,sm,i,Kh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function nm(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=F(t),s=T(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),m(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function im(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function sm(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&nm(e),h=e[35].new.id&&im(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=T(),l=_("div"),d&&d.c(),o=T(),r=_("strong"),u=F(a),f=T(),h&&h.c(),c=T(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(g,v){w(g,t,v),m(t,i),m(t,s),m(t,l),d&&d.m(l,null),m(l,o),m(l,r),m(r,u),m(l,f),h&&h.m(l,null),m(t,c)},p(g,v){e=g,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=nm(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=im(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&k(t),d&&d.d(),h&&h.d()}}}function lm(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Yh(n,s,o),a=l(r);t.set(a,e[o]=rm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=yt(e,r,l,1,o,s,t,i.parentNode,Mn,rm,i,Yh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function om(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),m(e,t),m(e,s),m(e,l)},p(o,r){r[0]&256&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function rm(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&om(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Added",s=T(),l=_("strong"),r=F(o),a=T(),f&&f.c(),u=T(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),m(t,i),m(t,s),m(t,l),m(l,r),m(t,a),f&&f.m(t,null),m(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=om(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function am(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),s=_("div"),s.innerHTML=`<string>Some of the imported collections shares the same name and/or fields but are
|
||
imported with different IDs. You can replace them in the import if you want
|
||
to.</string>`,l=T(),o=_("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){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[24]),r=!0)},p:oe,d(u){u&&k(e),r=!1,a()}}}function um(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},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 cE(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[uE,aE],g=[];function v(b,y){return b[5]?0:1}return f=v(n),c=g[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[15]),r=T(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),m(e,t),m(t,i),m(t,s),m(t,l),m(l,o),w(b,r,y),w(b,a,y),m(a,u),g[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let C=f;f=v(b),f===C?g[f].p(b,y):(Pe(),P(g[C],1,1,()=>{g[C]=null}),Le(),c=g[f],c?c.p(b,y):(c=g[f]=h[f](b),c.c()),A(c,1),c.m(u,null))},i(b){d||(A(c),d=!0)},o(b){P(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),g[f].d()}}}function dE(n){let e,t,i,s,l,o;e=new Bi({}),i=new On({props:{$$slots:{default:[cE]},$$scope:{ctx:n}}});let r={};return l=new rE({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[27](null),q(l,a)}}}function pE(n,e,t){let i,s,l,o,r,a,u;bt(n,Ft,J=>t(15,u=J)),dn(Ft,u="Import collections",u);let f,c,d="",h=!1,g=[],v=[],b=!0,y=[],C=!1;S();async function S(){t(5,C=!0);try{t(2,v=await we.collections.getFullList(200));for(let J of v)delete J.created,delete J.updated}catch(J){we.errorResponseHandler(J)}t(5,C=!1)}function $(){if(t(4,y=[]),!!i)for(let J of g){const _e=W.findByKey(v,"id",J.id);!(_e!=null&&_e.id)||!W.hasCollectionChanges(_e,J,b)||y.push({new:J,old:_e})}}function M(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=W.filterDuplicatesByKey(g)):t(1,g=[]);for(let J of g)delete J.created,delete J.updated,J.schema=W.filterDuplicatesByKey(J.schema)}function D(){var J,_e;for(let be of g){const X=W.findByKey(v,"name",be.name)||W.findByKey(v,"id",be.id);if(!X)continue;const ae=be.id,ve=X.id;be.id=ve;const H=Array.isArray(X.schema)?X.schema:[],me=Array.isArray(be.schema)?be.schema:[];for(const x of me){const Q=W.findByKey(H,"name",x.name);Q&&Q.id&&(x.id=Q.id)}for(let x of g)if(!!Array.isArray(x.schema))for(let Q of x.schema)((J=Q.options)==null?void 0:J.collectionId)&&((_e=Q.options)==null?void 0:_e.collectionId)===ae&&(Q.options.collectionId=ve)}t(0,d=JSON.stringify(g,null,4))}function E(J){t(12,h=!0);const _e=new FileReader;_e.onload=async be=>{t(12,h=!1),t(10,f.value="",f),t(0,d=be.target.result),await ii(),g.length||(go("Invalid collections configuration."),O())},_e.onerror=be=>{console.warn(be),go("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},_e.readAsText(J)}function O(){t(0,d=""),t(10,f.value="",f),hi({})}function L(J){pe[J?"unshift":"push"](()=>{f=J,t(10,f)})}const I=()=>{f.files.length&&E(f.files[0])},N=()=>{f.click()};function B(){d=this.value,t(0,d)}function U(){b=this.checked,t(3,b)}const ee=()=>D(),K=()=>O(),se=()=>c==null?void 0:c.show(v,g,b);function Y(J){pe[J?"unshift":"push"](()=>{c=J,t(11,c)})}const te=()=>O();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(J=>i&&b&&!W.findByKey(g,"id",J.id))),n.$$.dirty[0]&70&&t(8,l=g.filter(J=>i&&!W.findByKey(v,"id",J.id))),n.$$.dirty[0]&10&&(typeof g<"u"||typeof b<"u")&&$(),n.$$.dirty[0]&785&&t(7,o=!!d&&(s.length||l.length||y.length)),n.$$.dirty[0]&224&&t(14,r=!C&&i&&o),n.$$.dirty[0]&6&&t(13,a=g.filter(J=>{let _e=W.findByKey(v,"name",J.name)||W.findByKey(v,"id",J.id);if(!_e)return!1;if(_e.id!=J.id)return!0;const be=Array.isArray(_e.schema)?_e.schema:[],X=Array.isArray(J.schema)?J.schema:[];for(const ae of X){if(W.findByKey(be,"id",ae.id))continue;const H=W.findByKey(be,"name",ae.name);if(H&&ae.id!=H.id)return!0}return!1}))},[d,g,v,b,y,C,i,o,l,s,f,c,h,a,r,u,D,E,O,L,I,N,B,U,ee,K,se,Y,te]}class hE extends Ee{constructor(e){super(),Oe(this,e,pE,dE,De,{},null,[-1,-1])}}const nn=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?Si("/"):!0}],mE={"/login":en({component:cD,conditions:nn.concat([n=>!we.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":en({asyncComponent:()=>Ai(()=>import("./PageAdminRequestPasswordReset.ee61a059.js"),[],import.meta.url),conditions:nn.concat([n=>!we.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":en({asyncComponent:()=>Ai(()=>import("./PageAdminConfirmPasswordReset.cafba9d3.js"),[],import.meta.url),conditions:nn.concat([n=>!we.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":en({component:cT,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":en({component:h$,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users":en({component:NT,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":en({asyncComponent:()=>Ai(()=>import("./PageUserConfirmPasswordReset.bea4e34d.js"),[],import.meta.url),conditions:nn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":en({asyncComponent:()=>Ai(()=>import("./PageUserConfirmVerification.31e1b34e.js"),[],import.meta.url),conditions:nn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":en({asyncComponent:()=>Ai(()=>import("./PageUserConfirmEmailChange.a1d6c3eb.js"),[],import.meta.url),conditions:nn.concat([()=>(we.logout(!1),!0)]),userData:{showAppSidebar:!1}}),"/settings":en({component:yD,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":en({component:lD,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":en({component:KD,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":en({component:oO,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":en({component:NO,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":en({component:BO,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":en({component:ZO,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":en({component:hE,conditions:nn.concat([n=>we.authStore.isValid]),userData:{showAppSidebar:!0}}),"*":en({component:z1,userData:{showAppSidebar:!1}})};function gE(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=h=>Math.sqrt(h)*120,easing:d=zo}=i;return{delay:f,duration:Kn(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(h,g)=>{const v=g*a,b=g*u,y=h+g*e.width/t.width,C=h+g*e.height/t.height;return`transform: ${l} translate(${v}px, ${b}px) scale(${y}, ${C});`}}}function fm(n,e,t){const i=n.slice();return i[2]=e[t],i}function _E(n){let e;return{c(){e=_("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function bE(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function vE(n){let e;return{c(){e=_("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function yE(n){let e;return{c(){e=_("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function cm(n,e){let t,i,s,l,o=e[2].message+"",r,a,u,f,c,d,h=oe,g,v,b;function y(M,D){return M[2].type==="info"?yE:M[2].type==="success"?vE:M[2].type==="warning"?bE:_E}let C=y(e),S=C(e);function $(){return e[1](e[2])}return{key:n,first:null,c(){t=_("div"),i=_("div"),S.c(),s=T(),l=_("div"),r=F(o),a=T(),u=_("div"),u.innerHTML='<i class="ri-close-line"></i>',f=T(),p(i,"class","icon"),p(l,"class","content"),p(u,"class","close"),p(t,"class","alert txt-break"),ie(t,"alert-info",e[2].type=="info"),ie(t,"alert-success",e[2].type=="success"),ie(t,"alert-danger",e[2].type=="error"),ie(t,"alert-warning",e[2].type=="warning"),this.first=t},m(M,D){w(M,t,D),m(t,i),S.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",Yt($)),v=!0)},p(M,D){e=M,C!==(C=y(e))&&(S.d(1),S=C(e),S&&(S.c(),S.m(i,null))),(!g||D&1)&&o!==(o=e[2].message+"")&&ue(r,o),D&1&&ie(t,"alert-info",e[2].type=="info"),D&1&&ie(t,"alert-success",e[2].type=="success"),D&1&&ie(t,"alert-danger",e[2].type=="error"),D&1&&ie(t,"alert-warning",e[2].type=="warning")},r(){d=t.getBoundingClientRect()},f(){x_(t),h(),km(t,d)},a(){h(),h=Q_(t,d,gE,{duration:150})},i(M){g||(Tt(()=>{c||(c=it(t,vo,{duration:150},!0)),c.run(1)}),g=!0)},o(M){c||(c=it(t,vo,{duration:150},!1)),c.run(0),g=!1},d(M){M&&k(t),S.d(),M&&c&&c.end(),v=!1,b()}}}function kE(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=fm(n,l,r),u=o(a);i.set(u,t[r]=cm(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(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],Pe();for(let u=0;u<t.length;u+=1)t[u].r();t=yt(t,a,o,1,r,l,i,e,ib,cm,null,fm);for(let u=0;u<t.length;u+=1)t[u].a();Le()}},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 wE(n,e,t){let i;return bt(n,ya,l=>t(0,i=l)),[i,l=>Ig(l)]}class $E extends Ee{constructor(e){super(),Oe(this,e,wE,kE,De,{})}}function SE(n){var s;let e,t=((s=n[1])==null?void 0:s.text)+"",i;return{c(){e=_("h4"),i=F(t),p(e,"class","block center txt-break"),p(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)+"")&&ue(i,t)},d(l){l&&k(e)}}}function CE(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",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded-sm"),e.disabled=n[2],p(l,"class","txt"),p(s,"type","button"),p(s,"class","btn btn-danger btn-expanded"),s.disabled=n[2],ie(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&&ie(s,"btn-loading",a[2])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,Ge(r)}}}function ME(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:[CE],header:[SE]},$$scope:{ctx:n}};return e=new mi({props:i}),n[5](e),e.$on("hide",n[6]),{c(){V(e.$$.fragment)},m(s,l){j(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),q(e,s)}}}function TE(n,e,t){let i;bt(n,Ya,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){pe[f?"unshift":"push"](()=>{s=f,t(0,s)})}const u=async()=>{i!=null&&i.noCallback&&i.noCallback(),await ii(),R_()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(s==null||s.show())},[s,i,l,o,r,a,u]}class DE extends Ee{constructor(e){super(),Oe(this,e,TE,ME,De,{})}}function dm(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,v,b,y,C,S,$;return y=new Mi({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[OE]},$$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(),h=_("figure"),g=_("img"),b=T(),V(y.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(l,"href","/collections"),p(l,"class","menu-item"),p(l,"aria-label","Collections"),p(r,"href","/users"),p(r,"class","menu-item"),p(r,"aria-label","Users"),p(u,"href","/logs"),p(u,"class","menu-item"),p(u,"aria-label","Logs"),p(c,"href","/settings"),p(c,"class","menu-item"),p(c,"aria-label","Settings"),p(s,"class","main-menu"),xn(g.src,v="./images/avatars/avatar"+(((M=n[0])==null?void 0:M.avatar)||0)+".svg")||p(g,"src",v),p(g,"alt","Avatar"),p(h,"class","thumb thumb-circle link-hint closable"),p(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,h),m(h,g),m(h,b),j(y,h,null),C=!0,S||($=[Ye(mn.call(null,t)),Ye(mn.call(null,l)),Ye(jn.call(null,l,{path:"/collections/?.*",className:"current-route"})),Ye(wt.call(null,l,{text:"Collections",position:"right"})),Ye(mn.call(null,r)),Ye(jn.call(null,r,{path:"/users/?.*",className:"current-route"})),Ye(wt.call(null,r,{text:"Users",position:"right"})),Ye(mn.call(null,u)),Ye(jn.call(null,u,{path:"/logs/?.*",className:"current-route"})),Ye(wt.call(null,u,{text:"Logs",position:"right"})),Ye(mn.call(null,c)),Ye(jn.call(null,c,{path:"/settings/?.*",className:"current-route"})),Ye(wt.call(null,c,{text:"Settings",position:"right"}))],S=!0)},p(M,D){var O;(!C||D&1&&!xn(g.src,v="./images/avatars/avatar"+(((O=M[0])==null?void 0:O.avatar)||0)+".svg"))&&p(g,"src",v);const E={};D&512&&(E.$$scope={dirty:D,ctx:M}),y.$set(E)},i(M){C||(A(y.$$.fragment,M),C=!0)},o(M){P(y.$$.fragment,M),C=!1},d(M){M&&k(e),q(y),S=!1,Ge($)}}}function OE(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>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),p(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=[Ye(mn.call(null,e)),G(l,"click",n[6])],o=!0)},p:oe,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Ge(r)}}}function EE(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=W.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&dm(n);return o=new cb({props:{routes:mE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new $E({}),f=new DE({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),m(i,s),m(i,l),j(o,l,null),m(l,r),j(a,l,null),w(g,u,v),j(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=W.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=dm(g),d.c(),A(d,1),d.m(i,s)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){P(d),P(o.$$.fragment,g),P(a.$$.fragment,g),P(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),q(o),q(a),g&&k(u),q(f,g)}}}function AE(n,e,t){let i,s,l;bt(n,bo,d=>t(2,i=d)),bt(n,$a,d=>t(0,s=d)),bt(n,Ft,d=>t(3,l=d));let o,r=!1;function a(d){var h,g,v,b;((h=d==null?void 0:d.detail)==null?void 0:h.location)!==o&&(t(1,r=!!((v=(g=d==null?void 0:d.detail)==null?void 0:g.userData)!=null&&v.showAppSidebar)),o=(b=d==null?void 0:d.detail)==null?void 0:b.location,dn(Ft,l="",l),hi({}),R_())}function u(){Si("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const h=await we.settings.getAll({$cancelKey:"loadAppName"});dn(bo,i=((d=h==null?void 0:h.meta)==null?void 0:d.appName)||"",i)}catch(h){console.warn("Failed to load app name.",h)}}function c(){we.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class PE extends Ee{constructor(e){super(),Oe(this,e,AE,EE,De,{})}}new PE({target:document.getElementById("app")});export{Ge as A,cn as B,W as C,Si as D,Ke as E,Ng as F,bt as G,Ds as H,on as I,fn as J,Jn as K,pe as L,Qa as M,Ee as S,P as a,T as b,V as c,q as d,_ as e,p as f,w as g,m as h,Oe as i,Ye as j,Pe as k,mn as l,j as m,Le as n,k as o,we as p,Re as q,ie as r,De as s,A as t,G as u,Yt as v,F as w,ue as x,oe as y,Te as z};
|