mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-11-10 05:47:57 +01:00
153 lines
976 KiB
JavaScript
153 lines
976 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./FilterAutocompleteInput-CZ6wrvfj.js","./index-BVTzzYHA.js","./CodeEditor-BZmYqzs5.js","./ListApiDocs-NcawIdXj.js","./SdkTabs-qJt846QG.js","./SdkTabs-CSWLpEgj.css","./FieldsQueryParam-8MYHSagY.js","./ListApiDocs-ByASLUZu.css","./ViewApiDocs-Bqi1Bubc.js","./CreateApiDocs-Dp5mBTnM.js","./UpdateApiDocs-U5vj4iTc.js","./DeleteApiDocs-Sd9qCx1L.js","./RealtimeApiDocs-BGJAnbV8.js","./AuthWithPasswordDocs-DTzh-tiS.js","./AuthWithOAuth2Docs-BgQXm4pV.js","./AuthRefreshDocs-eA35WVdY.js","./RequestVerificationDocs-D8lPTjIQ.js","./ConfirmVerificationDocs-B-t2hzDm.js","./RequestPasswordResetDocs-BdwsLKcm.js","./ConfirmPasswordResetDocs-CFydU8W2.js","./RequestEmailChangeDocs-SF9ggaSn.js","./ConfirmEmailChangeDocs-Nc8EAF7u.js","./AuthMethodsDocs-Bc1UuK8n.js","./ListExternalAuthsDocs-Bk44wTxj.js","./UnlinkExternalAuthDocs-DFP5clLH.js"])))=>i.map(i=>d[i]);
|
||
var b0=Object.defineProperty;var k0=(n,e,t)=>e in n?b0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ge=(n,e,t)=>k0(n,typeof e!="symbol"?e+"":e,t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const vs=n=>n;function Ae(n,e){for(const t in e)n[t]=e[t];return n}function y0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Ig(n){return n()}function nu(){return Object.create(null)}function we(n){n.forEach(Ig)}function Mt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let As;function en(n,e){return n===e?!0:(As||(As=document.createElement("a")),As.href=e,n===As.href)}function v0(n){return Object.keys(n).length===0}function ma(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ag(n){let e;return ma(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ma(e,t))}function St(n,e,t,i){if(n){const l=Lg(n,e,t,i);return n[0](l)}}function Lg(n,e,t,i){return n[1]&&i?Ae(t.ctx.slice(),n[1](i(e))):t.ctx}function $t(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r<o;r+=1)s[r]=e.dirty[r]|l[r];return s}return e.dirty|l}return e.dirty}function Tt(n,e,t,i,l,s){if(l){const o=Lg(e,t,i,s);n.p(o,l)}}function Ct(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 Yt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Xe(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 Un(n){return n??""}function xt(n,e,t){return n.set(t),e}function $e(n){return n&&Mt(n.destroy)?n.destroy:Q}function iu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Ng=typeof window<"u";let Po=Ng?()=>window.performance.now():()=>Date.now(),ha=Ng?n=>requestAnimationFrame(n):Q;const yl=new Set;function Pg(n){yl.forEach(e=>{e.c(n)||(yl.delete(e),e.f())}),yl.size!==0&&ha(Pg)}function Fo(n){let e;return yl.size===0&&ha(Pg),{promise:new Promise(t=>{yl.add(e={c:n,f:t})}),abort(){yl.delete(e)}}}function k(n,e){n.appendChild(e)}function Fg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function w0(n){const e=b("style");return e.textContent="/* empty */",S0(Fg(n),e),e.sheet}function S0(n,e){return k(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function ot(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function Z(n){return document.createTextNode(n)}function M(){return Z(" ")}function ye(){return Z("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Ue(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Tn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const $0=["width","height"];function ni(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&&$0.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function T0(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function it(n){return n===""?null:+n}function C0(n){return Array.from(n.childNodes)}function se(n,e){e=""+e,n.data!==e&&(n.data=e)}function oe(n,e){n.value=e??""}function O0(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function x(n,e,t){n.classList.toggle(e,!!t)}function Rg(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}function It(n,e){return new n(e)}const go=new Map;let bo=0;function M0(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function D0(n,e){const t={stylesheet:w0(e),rules:{}};return go.set(n,t),t}function rs(n,e,t,i,l,s,o,r=0){const a=16.666/i;let u=`{
|
||
`;for(let g=0;g<=1;g+=a){const y=e+(t-e)*s(g);u+=g*100+`%{${o(y,1-y)}}
|
||
`}const f=u+`100% {${o(t,1-t)}}
|
||
}`,c=`__svelte_${M0(f)}_${r}`,d=Fg(n),{stylesheet:m,rules:h}=go.get(d)||D0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,bo+=1,c}function as(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),bo-=l,bo||E0())}function E0(){ha(()=>{bo||(go.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),go.clear())})}function I0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=vs,start:a=Po()+s,end:u=a+o,tick:f=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=rs(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&as(n,h),d=!1}return Fo(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),g()),!d)return!1;if(m){const S=y-a,T=0+1*r(S/o);f(T,1-T)}return!0}),_(),f(0,1),g}function A0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,qg(n,l)}}function qg(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let us;function pi(n){us=n}function ws(){if(!us)throw new Error("Function called outside component initialization");return us}function Kt(n){ws().$$.on_mount.push(n)}function L0(n){ws().$$.after_update.push(n)}function Ss(n){ws().$$.on_destroy.push(n)}function lt(){const n=ws();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Rg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ce(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bl=[],te=[];let vl=[];const Hr=[],jg=Promise.resolve();let zr=!1;function Hg(){zr||(zr=!0,jg.then(_a))}function Qt(){return Hg(),jg}function Ke(n){vl.push(n)}function ke(n){Hr.push(n)}const nr=new Set;let dl=0;function _a(){if(dl!==0)return;const n=us;do{try{for(;dl<bl.length;){const e=bl[dl];dl++,pi(e),N0(e.$$)}}catch(e){throw bl.length=0,dl=0,e}for(pi(null),bl.length=0,dl=0;te.length;)te.pop()();for(let e=0;e<vl.length;e+=1){const t=vl[e];nr.has(t)||(nr.add(t),t())}vl.length=0}while(bl.length);for(;Hr.length;)Hr.pop()();zr=!1,nr.clear(),pi(n)}function N0(n){if(n.fragment!==null){n.update(),we(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ke)}}function P0(n){const e=[],t=[];vl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vl=e}let Hl;function ga(){return Hl||(Hl=Promise.resolve(),Hl.then(()=>{Hl=null})),Hl}function Zi(n,e,t){n.dispatchEvent(Rg(`${e?"intro":"outro"}${t}`))}const io=new Set;let xn;function ie(){xn={r:0,c:[],p:xn}}function le(){xn.r||we(xn.c),xn=xn.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function A(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),xn.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function zg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&as(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=vs,tick:_=Q,css:g}=l||ba;g&&(o=rs(n,0,1,m,d,h,g,a++)),_(0,1);const y=Po()+d,S=y+m;r&&r.abort(),s=!0,Ke(()=>Zi(n,!0,"start")),r=Fo(T=>{if(s){if(T>=S)return _(1,0),Zi(n,!0,"end"),u(),s=!1;if(T>=y){const $=h((T-y)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,as(n),Mt(l)?(l=l(i),ga().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function ka(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=xn;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=vs,tick:m=Q,css:h}=l||ba;h&&(o=rs(n,1,0,c,f,d,h));const _=Po()+f,g=_+c;Ke(()=>Zi(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Fo(y=>{if(s){if(y>=g)return m(0,1),Zi(n,!1,"end"),--r.r||we(r.c),!1;if(y>=_){const S=d((y-_)/c);m(1-S,S)}}return s})}return Mt(l)?ga().then(()=>{l=l(i),u()}):u(),{end(f){f&&"inert"in n&&(n.inert=a),f&&l.tick&&l.tick(1,0),s&&(o&&as(n,o),s=!1)}}}function Fe(n,e,t,i){let s=e(n,t,{direction:"both"}),o=i?0:1,r=null,a=null,u=null,f;function c(){u&&as(n,u)}function d(h,_){const g=h.b-o;return _*=Math.abs(g),{a:o,b:h.b,d:g,duration:_,start:h.start,end:h.start+_,group:h.group}}function m(h){const{delay:_=0,duration:g=300,easing:y=vs,tick:S=Q,css:T}=s||ba,$={start:Po()+_,b:h};h||($.group=xn,xn.r+=1),"inert"in n&&(h?f!==void 0&&(n.inert=f):(f=n.inert,n.inert=!0)),r||a?a=$:(T&&(c(),u=rs(n,o,h,g,_,y,T)),h&&S(0,1),r=d($,g),Ke(()=>Zi(n,h,"start")),Fo(C=>{if(a&&C>a.start&&(r=d(a,g),a=null,Zi(n,r.b,"start"),T&&(c(),u=rs(n,o,r.b,r.duration,0,y,s.css))),r){if(C>=r.end)S(o=r.b,1-o),Zi(n,r.b,"end"),a||(r.b?c():--r.group.r||we(r.group.c)),r=null;else if(C>=r.start){const O=C-r.start;o=r.a+r.d*y(O/r.duration),S(o,1-o)}}return!!(r||a)}))}return{run(h){Mt(s)?ga().then(()=>{s=s({direction:h?"in":"out"}),m(h)}):m(h)},end(){c(),r=a=null}}}function lu(n,e){const t=e.token={};function i(l,s,o,r){if(e.token!==t)return;e.resolved=r;let a=e.ctx;o!==void 0&&(a=a.slice(),a[o]=r);const u=l&&(e.current=l)(a);let f=!1;e.block&&(e.blocks?e.blocks.forEach((c,d)=>{d!==s&&c&&(ie(),A(c,1,1,()=>{e.blocks[d]===c&&(e.blocks[d]=null)}),le())}):e.block.d(1),u.c(),E(u,1),u.m(e.mount(),e.anchor),f=!0),e.block=u,e.blocks&&(e.blocks[s]=u),f&&_a()}if(y0(n)){const l=ws();if(n.then(s=>{pi(l),i(e.then,1,e.value,s),pi(null)},s=>{if(pi(l),i(e.catch,2,e.error,s),pi(null),!e.hasCatch)throw s}),e.current!==e.pending)return i(e.pending,0),!0}else{if(e.current!==e.then)return i(e.then,1,e.value,n),!0;e.resolved=n}}function F0(n,e,t){const i=e.slice(),{resolved:l}=n;n.current===n.then&&(i[n.value]=l),n.current===n.catch&&(i[n.error]=l),n.block.p(i,t)}function fe(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function Li(n,e){n.d(1),e.delete(n.key)}function At(n,e){A(n,1,1,()=>{e.delete(n.key)})}function R0(n,e){n.f(),At(n,e)}function at(n,e,t,i,l,s,o,r,a,u,f,c){let d=n.length,m=s.length,h=d;const _={};for(;h--;)_[n[h].key]=h;const g=[],y=new Map,S=new Map,T=[];for(h=m;h--;){const D=c(l,s,h),I=t(D);let L=o.get(I);L?T.push(()=>L.p(D,e)):(L=u(I,D),L.c()),y.set(I,g[h]=L),I in _&&S.set(I,Math.abs(h-_[I]))}const $=new Set,C=new Set;function O(D){E(D,1),D.m(r,f),o.set(D.key,D),f=D.first,m--}for(;d&&m;){const D=g[m-1],I=n[d-1],L=D.key,R=I.key;D===I?(f=D.first,d--,m--):y.has(R)?!o.has(L)||$.has(L)?O(D):C.has(R)?d--:S.get(L)>S.get(R)?(C.add(L),O(D)):($.add(R),d--):(a(I,o),d--)}for(;d--;){const D=n[d];y.has(D.key)||a(D,o)}for(;m;)O(g[m-1]);return we(T),g}function dt(n,e){const t={},i={},l={$$scope:1};let s=n.length;for(;s--;){const o=n[s],r=e[s];if(r){for(const a in o)a in r||(i[a]=1);for(const a in r)l[a]||(t[a]=r[a],l[a]=1);n[s]=r}else for(const a in o)l[a]=1}for(const o in i)o in t||(t[o]=void 0);return t}function Dt(n){return typeof n=="object"&&n!==null?n:{}}function be(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 H(n,e,t){const{fragment:i,after_update:l}=n.$$;i&&i.m(e,t),Ke(()=>{const s=n.$$.on_mount.map(Ig).filter(Mt);n.$$.on_destroy?n.$$.on_destroy.push(...s):we(s),n.$$.on_mount=[]}),l.forEach(Ke)}function z(n,e){const t=n.$$;t.fragment!==null&&(P0(t.after_update),we(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function q0(n,e){n.$$.dirty[0]===-1&&(bl.push(n),Hg(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<<e%31}function _e(n,e,t,i,l,s,o=null,r=[-1]){const a=us;pi(n);const u=n.$$={fragment:null,ctx:[],props:s,update:Q,not_equal:l,bound:nu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(e.context||(a?a.$$.context:[])),callbacks:nu(),dirty:r,skip_bound:!1,root:e.target||a.$$.root};o&&o(u.root);let f=!1;if(u.ctx=t?t(n,e.props||{},(c,d,...m)=>{const h=m.length?m[0]:d;return u.ctx&&l(u.ctx[c],u.ctx[c]=h)&&(!u.skip_bound&&u.bound[c]&&u.bound[c](h),f&&q0(n,c)),d}):[],u.update(),f=!0,we(u.before_update),u.fragment=i?i(u.ctx):!1,e.target){if(e.hydrate){const c=C0(e.target);u.fragment&&u.fragment.l(c),c.forEach(v)}else u.fragment&&u.fragment.c();e.intro&&E(n.$$.fragment),H(n,e.target,e.anchor),_a()}pi(a)}class ge{constructor(){Ge(this,"$$");Ge(this,"$$set")}$destroy(){z(this,1),this.$destroy=Q}$on(e,t){if(!Mt(t))return Q;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const l=i.indexOf(t);l!==-1&&i.splice(l,1)}}$set(e){this.$$set&&!v0(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const j0="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(j0);const pl=[];function Vg(n,e){return{subscribe:Cn(n,e).subscribe}}function Cn(n,e=Q){let t;const i=new Set;function l(r){if(me(n,r)&&(n=r,t)){const a=!pl.length;for(const u of i)u[1](),pl.push(u,n);if(a){for(let u=0;u<pl.length;u+=2)pl[u][0](pl[u+1]);pl.length=0}}}function s(r){l(r(n))}function o(r,a=Q){const u=[r,a];return i.add(u),i.size===1&&(t=e(l,s)||Q),r(n),()=>{i.delete(u),i.size===0&&t&&(t(),t=null)}}return{set:l,update:s,subscribe:o}}function Bg(n,e,t){const i=!Array.isArray(n),l=i?[n]:n;if(!l.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const s=e.length<2;return Vg(t,(o,r)=>{let a=!1;const u=[];let f=0,c=Q;const d=()=>{if(f)return;c();const h=e(i?u[0]:u,o,r);s?o(h):c=Mt(h)?h:Q},m=l.map((h,_)=>ma(h,g=>{u[_]=g,f&=~(1<<_),a&&d()},()=>{f|=1<<_}));return a=!0,d(),function(){we(m),c(),a=!1}})}function Ug(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,l,s,o=[],r="",a=n.split("/");for(a[0]||a.shift();l=a.shift();)t=l[0],t==="*"?(o.push("wild"),r+="/(.*)"):t===":"?(i=l.indexOf("?",1),s=l.indexOf(".",1),o.push(l.substring(1,~i?i:~s?s:l.length)),r+=~i&&!~s?"(?:/([^/]+?))?":"/([^/]+?)",~s&&(r+=(~i?"?":"")+"\\"+l.substring(s))):r+="/"+l;return{keys:o,pattern:new RegExp("^"+r+"/?$","i")}}function H0(n){let e,t,i;const l=[n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=Ae(u,l[f]);return a!==void 0&&a&4&&(u=Ae(u,dt(l,[Dt(r[2])]))),{props:u}}return s&&(e=It(s,o(n)),e.$on("routeEvent",n[7])),{c(){e&&V(e.$$.fragment),t=ye()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){if(a&1&&s!==(s=r[0])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),le()}s?(e=It(s,o(r,a)),e.$on("routeEvent",r[7]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const u=a&4?dt(l,[Dt(r[2])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function z0(n){let e,t,i;const l=[{params:n[1]},n[2]];var s=n[0];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=Ae(u,l[f]);return a!==void 0&&a&6&&(u=Ae(u,dt(l,[a&2&&{params:r[1]},a&4&&Dt(r[2])]))),{props:u}}return s&&(e=It(s,o(n)),e.$on("routeEvent",n[6])),{c(){e&&V(e.$$.fragment),t=ye()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){if(a&1&&s!==(s=r[0])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),le()}s?(e=It(s,o(r,a)),e.$on("routeEvent",r[6]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const u=a&6?dt(l,[a&2&&{params:r[1]},a&4&&Dt(r[2])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function V0(n){let e,t,i,l;const s=[z0,H0],o=[];function r(a,u){return a[1]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function su(){const n=window.location.href.indexOf("#/");let e=n>-1?window.location.href.substr(n+1):"/";const t=e.indexOf("?");let i="";return t>-1&&(i=e.substr(t+1),e=e.substr(0,t)),{location:e,querystring:i}}const Ro=Vg(null,function(e){e(su());const t=()=>{e(su())};return window.addEventListener("hashchange",t,!1),function(){window.removeEventListener("hashchange",t,!1)}});Bg(Ro,n=>n.location);const qo=Bg(Ro,n=>n.querystring),ou=Cn(void 0);async function nl(n){if(!n||n.length<1||n.charAt(0)!="/"&&n.indexOf("#/")!==0)throw Error("Invalid parameter location");await Qt();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 ln(n,e){if(e=au(e),!n||!n.tagName||n.tagName.toLowerCase()!="a")throw Error('Action "link" can only be used with <a> tags');return ru(n,e),{update(t){t=au(t),ru(n,t)}}}function B0(n){n?window.scrollTo(n.__svelte_spa_router_scrollX,n.__svelte_spa_router_scrollY):window.scrollTo(0,0)}function ru(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||U0(i.currentTarget.getAttribute("href"))})}function au(n){return n&&typeof n=="string"?{href:n}:n||{}}function U0(n){history.replaceState({...history.state,__svelte_spa_router_scrollX:window.scrollX,__svelte_spa_router_scrollY:window.scrollY},void 0),window.location.hash=n}function W0(n,e,t){let{routes:i={}}=e,{prefix:l=""}=e,{restoreScrollState:s=!1}=e;class o{constructor(C,O){if(!O||typeof O!="function"&&(typeof O!="object"||O._sveltesparouter!==!0))throw Error("Invalid component object");if(!C||typeof C=="string"&&(C.length<1||C.charAt(0)!="/"&&C.charAt(0)!="*")||typeof C=="object"&&!(C instanceof RegExp))throw Error('Invalid value for "path" argument - strings must start with / or *');const{pattern:D,keys:I}=Ug(C);this.path=C,typeof O=="object"&&O._sveltesparouter===!0?(this.component=O.component,this.conditions=O.conditions||[],this.userData=O.userData,this.props=O.props||{}):(this.component=()=>Promise.resolve(O),this.conditions=[],this.props={}),this._pattern=D,this._keys=I}match(C){if(l){if(typeof l=="string")if(C.startsWith(l))C=C.substr(l.length)||"/";else return null;else if(l instanceof RegExp){const L=C.match(l);if(L&&L[0])C=C.substr(L[0].length)||"/";else return null}}const O=this._pattern.exec(C);if(O===null)return null;if(this._keys===!1)return O;const D={};let I=0;for(;I<this._keys.length;){try{D[this._keys[I]]=decodeURIComponent(O[I+1]||"")||null}catch{D[this._keys[I]]=null}I++}return D}async checkConditions(C){for(let O=0;O<this.conditions.length;O++)if(!await this.conditions[O](C))return!1;return!0}}const r=[];i instanceof Map?i.forEach(($,C)=>{r.push(new o(C,$))}):Object.keys(i).forEach($=>{r.push(new o($,i[$]))});let a=null,u=null,f={};const c=lt();async function d($,C){await Qt(),c($,C)}let m=null,h=null;s&&(h=$=>{$.state&&($.state.__svelte_spa_router_scrollY||$.state.__svelte_spa_router_scrollX)?m=$.state:m=null},window.addEventListener("popstate",h),L0(()=>{B0(m)}));let _=null,g=null;const y=Ro.subscribe(async $=>{_=$;let C=0;for(;C<r.length;){const O=r[C].match($.location);if(!O){C++;continue}const D={route:r[C].path,location:$.location,querystring:$.querystring,userData:r[C].userData,params:O&&typeof O=="object"&&Object.keys(O).length?O:null};if(!await r[C].checkConditions(D)){t(0,a=null),g=null,d("conditionsFailed",D);return}d("routeLoading",Object.assign({},D));const I=r[C].component;if(g!=I){I.loading?(t(0,a=I.loading),g=I,t(1,u=I.loadingParams),t(2,f={}),d("routeLoaded",Object.assign({},D,{component:a,name:a.name,params:u}))):(t(0,a=null),g=null);const L=await I();if($!=_)return;t(0,a=L&&L.default||L),g=I}O&&typeof O=="object"&&Object.keys(O).length?t(1,u=O):t(1,u=null),t(2,f=r[C].props),d("routeLoaded",Object.assign({},D,{component:a,name:a.name,params:u})).then(()=>{ou.set(u)});return}t(0,a=null),g=null,ou.set(void 0)});Ss(()=>{y(),h&&window.removeEventListener("popstate",h)});function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$set=$=>{"routes"in $&&t(3,i=$.routes),"prefix"in $&&t(4,l=$.prefix),"restoreScrollState"in $&&t(5,s=$.restoreScrollState)},n.$$.update=()=>{n.$$.dirty&32&&(history.scrollRestoration=s?"manual":"auto")},[a,u,f,i,l,s,S,T]}class Y0 extends ge{constructor(e){super(),_e(this,e,W0,V0,me,{routes:3,prefix:4,restoreScrollState:5})}}const lo=[];let Wg;function Yg(n){const e=n.pattern.test(Wg);uu(n,n.className,e),uu(n,n.inactiveClassName,!e)}function uu(n,e,t){(e||"").split(" ").forEach(i=>{i&&(n.node.classList.remove(i),t&&n.node.classList.add(i))})}Ro.subscribe(n=>{Wg=n.location+(n.querystring?"?"+n.querystring:""),lo.map(Yg)});function Ln(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"?Ug(e.path):{pattern:e.path},i={node:n,className:e.className,inactiveClassName:e.inactiveClassName,pattern:t};return lo.push(i),Yg(i),{destroy(){lo.splice(lo.indexOf(i),1)}}}const K0="modulepreload",J0=function(n,e){return new URL(n,e).href},fu={},tt=function(e,t,i){let l=Promise.resolve();if(t&&t.length>0){const o=document.getElementsByTagName("link"),r=document.querySelector("meta[property=csp-nonce]"),a=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));l=Promise.allSettled(t.map(u=>{if(u=J0(u,i),u in fu)return;fu[u]=!0;const f=u.endsWith(".css"),c=f?'[rel="stylesheet"]':"";if(!!i)for(let h=o.length-1;h>=0;h--){const _=o[h];if(_.href===u&&(!f||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${u}"]${c}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":K0,f||(m.as="script"),m.crossOrigin="",m.href=u,a&&m.setAttribute("nonce",a),document.head.appendChild(m),f)return new Promise((h,_)=>{m.addEventListener("load",h),m.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${u}`)))})}))}function s(o){const r=new Event("vite:preloadError",{cancelable:!0});if(r.payload=o,window.dispatchEvent(r),!r.defaultPrevented)throw o}return l.then(o=>{for(const r of o||[])r.status==="rejected"&&s(r.reason);return e().catch(s)})};function Nt(n){if(!n)throw Error("Parameter args is required");if(!n.component==!n.asyncComponent)throw Error("One and only one of component and asyncComponent is required");if(n.component&&(n.asyncComponent=()=>Promise.resolve(n.component)),typeof n.asyncComponent!="function")throw Error("Parameter asyncComponent must be a function");if(n.conditions){Array.isArray(n.conditions)||(n.conditions=[n.conditions]);for(let t=0;t<n.conditions.length;t++)if(!n.conditions[t]||typeof n.conditions[t]!="function")throw Error("Invalid parameter conditions["+t+"]")}return n.loadingComponent&&(n.asyncComponent.loading=n.loadingComponent,n.asyncComponent.loadingParams=n.loadingParams||void 0),{component:n.asyncComponent,userData:n.userData,conditions:n.conditions&&n.conditions.length?n.conditions:void 0,props:n.props&&Object.keys(n.props).length?n.props:{},_sveltesparouter:!0}}class gn extends Error{constructor(e){var t,i,l,s;super("ClientResponseError"),this.url="",this.status=0,this.response={},this.isAbort=!1,this.originalError=null,Object.setPrototypeOf(this,gn.prototype),e!==null&&typeof e=="object"&&(this.url=typeof e.url=="string"?e.url:"",this.status=typeof e.status=="number"?e.status:0,this.isAbort=!!e.isAbort,this.originalError=e.originalError,e.response!==null&&typeof e.response=="object"?this.response=e.response:e.data!==null&&typeof e.data=="object"?this.response=e.data:this.response={}),this.originalError||e instanceof gn||(this.originalError=e),typeof DOMException<"u"&&e instanceof DOMException&&(this.isAbort=!0),this.name="ClientResponseError "+this.status,this.message=(t=this.response)==null?void 0:t.message,this.message||(this.isAbort?this.message="The request was autocancelled. You can find more info in https://github.com/pocketbase/js-sdk#auto-cancellation.":(s=(l=(i=this.originalError)==null?void 0:i.cause)==null?void 0:l.message)!=null&&s.includes("ECONNREFUSED ::1")?this.message="Failed to connect to the PocketBase server. Try changing the SDK URL from localhost to 127.0.0.1 (https://github.com/pocketbase/js-sdk/issues/21).":this.message="Something went wrong while processing your request.")}get data(){return this.response}toJSON(){return{...this}}}const Ls=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function Z0(n,e){const t={};if(typeof n!="string")return t;const i=Object.assign({},{}).decode||G0;let l=0;for(;l<n.length;){const s=n.indexOf("=",l);if(s===-1)break;let o=n.indexOf(";",l);if(o===-1)o=n.length;else if(o<s){l=n.lastIndexOf(";",s-1)+1;continue}const r=n.slice(l,s).trim();if(t[r]===void 0){let a=n.slice(s+1,o).trim();a.charCodeAt(0)===34&&(a=a.slice(1,-1));try{t[r]=i(a)}catch{t[r]=a}}l=o+1}return t}function cu(n,e,t){const i=Object.assign({},t||{}),l=i.encode||X0;if(!Ls.test(n))throw new TypeError("argument name is invalid");const s=l(e);if(s&&!Ls.test(s))throw new TypeError("argument val is invalid");let o=n+"="+s;if(i.maxAge!=null){const r=i.maxAge-0;if(isNaN(r)||!isFinite(r))throw new TypeError("option maxAge is invalid");o+="; Max-Age="+Math.floor(r)}if(i.domain){if(!Ls.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain="+i.domain}if(i.path){if(!Ls.test(i.path))throw new TypeError("option path is invalid");o+="; Path="+i.path}if(i.expires){if(!function(a){return Object.prototype.toString.call(a)==="[object Date]"||a instanceof Date}(i.expires)||isNaN(i.expires.valueOf()))throw new TypeError("option expires is invalid");o+="; Expires="+i.expires.toUTCString()}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.priority)switch(typeof i.priority=="string"?i.priority.toLowerCase():i.priority){case"low":o+="; Priority=Low";break;case"medium":o+="; Priority=Medium";break;case"high":o+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}if(i.sameSite)switch(typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return o}function G0(n){return n.indexOf("%")!==-1?decodeURIComponent(n):n}function X0(n){return encodeURIComponent(n)}const Q0=typeof navigator<"u"&&navigator.product==="ReactNative"||typeof global<"u"&&global.HermesInternal;let Kg;function wl(n){if(n)try{const e=decodeURIComponent(Kg(n.split(".")[1]).split("").map(function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(e)||{}}catch{}return{}}function ya(n,e=0){let t=wl(n);return!(Object.keys(t).length>0&&(!t.exp||t.exp-e>Date.now()/1e3))}Kg=typeof atob!="function"||Q0?n=>{let e=String(n).replace(/=+$/,"");if(e.length%4==1)throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var t,i,l=0,s=0,o="";i=e.charAt(s++);~i&&(t=l%4?64*t+i:i,l++%4)?o+=String.fromCharCode(255&t>>(-2*l&6)):0)i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}:atob;const du="pb_auth";class x0{constructor(){this.baseToken="",this.baseModel=null,this._onChangeCallbacks=[]}get token(){return this.baseToken}get model(){return this.baseModel}get isValid(){return!ya(this.token)}get isAdmin(){return wl(this.token).type==="admin"}get isAuthRecord(){return wl(this.token).type==="authRecord"}save(e,t){this.baseToken=e||"",this.baseModel=t||null,this.triggerChange()}clear(){this.baseToken="",this.baseModel=null,this.triggerChange()}loadFromCookie(e,t=du){const i=Z0(e||"")[t]||"";let l={};try{l=JSON.parse(i),(typeof l===null||typeof l!="object"||Array.isArray(l))&&(l={})}catch{}this.save(l.token||"",l.model||null)}exportToCookie(e,t=du){var a,u;const i={secure:!0,sameSite:!0,httpOnly:!0,path:"/"},l=wl(this.token);i.expires=l!=null&&l.exp?new Date(1e3*l.exp):new Date("1970-01-01"),e=Object.assign({},i,e);const s={token:this.token,model:this.model?JSON.parse(JSON.stringify(this.model)):null};let o=cu(t,JSON.stringify(s),e);const r=typeof Blob<"u"?new Blob([o]).size:o.length;if(s.model&&r>4096){s.model={id:(a=s==null?void 0:s.model)==null?void 0:a.id,email:(u=s==null?void 0:s.model)==null?void 0:u.email};const f=["collectionId","username","verified"];for(const c in this.model)f.includes(c)&&(s.model[c]=this.model[c]);o=cu(t,JSON.stringify(s),e)}return o}onChange(e,t=!1){return this._onChangeCallbacks.push(e),t&&e(this.token,this.model),()=>{for(let i=this._onChangeCallbacks.length-1;i>=0;i--)if(this._onChangeCallbacks[i]==e)return delete this._onChangeCallbacks[i],void this._onChangeCallbacks.splice(i,1)}}triggerChange(){for(const e of this._onChangeCallbacks)e&&e(this.token,this.model)}}class Jg extends x0{constructor(e="pocketbase_auth"){super(),this.storageFallback={},this.storageKey=e,this._bindStorageEvent()}get token(){return(this._storageGet(this.storageKey)||{}).token||""}get model(){return(this._storageGet(this.storageKey)||{}).model||null}save(e,t){this._storageSet(this.storageKey,{token:e,model:t}),super.save(e,t)}clear(){this._storageRemove(this.storageKey),super.clear()}_storageGet(e){if(typeof window<"u"&&(window!=null&&window.localStorage)){const t=window.localStorage.getItem(e)||"";try{return JSON.parse(t)}catch{return t}}return this.storageFallback[e]}_storageSet(e,t){if(typeof window<"u"&&(window!=null&&window.localStorage)){let i=t;typeof t!="string"&&(i=JSON.stringify(t)),window.localStorage.setItem(e,i)}else this.storageFallback[e]=t}_storageRemove(e){var t;typeof window<"u"&&(window!=null&&window.localStorage)&&((t=window.localStorage)==null||t.removeItem(e)),delete this.storageFallback[e]}_bindStorageEvent(){typeof window<"u"&&(window!=null&&window.localStorage)&&window.addEventListener&&window.addEventListener("storage",e=>{if(e.key!=this.storageKey)return;const t=this._storageGet(this.storageKey)||{};super.save(t.token||"",t.model||null)})}}class il{constructor(e){this.client=e}}class ek extends il{async getAll(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/settings",e)}async update(e,t){return t=Object.assign({method:"PATCH",body:e},t),this.client.send("/api/settings",t)}async testS3(e="storage",t){return t=Object.assign({method:"POST",body:{filesystem:e}},t),this.client.send("/api/settings/test/s3",t).then(()=>!0)}async testEmail(e,t,i){return i=Object.assign({method:"POST",body:{email:e,template:t}},i),this.client.send("/api/settings/test/email",i).then(()=>!0)}async generateAppleClientSecret(e,t,i,l,s,o){return o=Object.assign({method:"POST",body:{clientId:e,teamId:t,keyId:i,privateKey:l,duration:s}},o),this.client.send("/api/settings/apple/generate-client-secret",o)}}class va extends il{decode(e){return e}async getFullList(e,t){if(typeof e=="number")return this._getFullList(e,t);let i=500;return(t=Object.assign({},e,t)).batch&&(i=t.batch,delete t.batch),this._getFullList(i,t)}async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send(this.baseCrudPath,i).then(l=>{var s;return l.items=((s=l.items)==null?void 0:s.map(o=>this.decode(o)))||[],l})}async getFirstListItem(e,t){return(t=Object.assign({requestKey:"one_by_filter_"+this.baseCrudPath+"_"+e},t)).query=Object.assign({filter:e,skipTotal:1},t.query),this.getList(1,1,t).then(i=>{var l;if(!((l=i==null?void 0:i.items)!=null&&l.length))throw new gn({status:404,response:{code:404,message:"The requested resource wasn't found.",data:{}}});return i.items[0]})}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl(this.baseCrudPath+"/"),status:404,response:{code:404,message:"Missing required record id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(i=>this.decode(i))}async create(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send(this.baseCrudPath,t).then(i=>this.decode(i))}async update(e,t,i){return i=Object.assign({method:"PATCH",body:t},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),i).then(l=>this.decode(l))}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e),t).then(()=>!0)}_getFullList(e=500,t){(t=t||{}).query=Object.assign({skipTotal:1},t.query);let i=[],l=async s=>this.getList(s,e||500,t).then(o=>{const r=o.items;return i=i.concat(r),r.length==o.perPage?l(s+1):i});return l(1)}}function wn(n,e,t,i){const l=i!==void 0;return l||t!==void 0?l?(console.warn(n),e.body=Object.assign({},e.body,t),e.query=Object.assign({},e.query,i),e):Object.assign(e,t):e}function ir(n){var e;(e=n._resetAutoRefresh)==null||e.call(n)}class tk extends va{get baseCrudPath(){return"/api/admins"}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o;return((s=this.client.authStore.model)==null?void 0:s.id)===l.id&&((o=this.client.authStore.model)==null?void 0:o.collectionId)===void 0&&this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s;return i&&((l=this.client.authStore.model)==null?void 0:l.id)===e&&((s=this.client.authStore.model)==null?void 0:s.collectionId)===void 0&&this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.admin)||{});return e!=null&&e.token&&(e!=null&&e.admin)&&this.client.authStore.save(e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",admin:t})}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};s=wn("This form of authWithPassword(email, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(email, pass, options?).",s,i,l);const o=s.autoRefreshThreshold;delete s.autoRefreshThreshold,s.autoRefresh||ir(this.client);let r=await this.client.send(this.baseCrudPath+"/auth-with-password",s);return r=this.authResponse(r),o&&function(u,f,c,d){ir(u);const m=u.beforeSend,h=u.authStore.model,_=u.authStore.onChange((g,y)=>{(!g||(y==null?void 0:y.id)!=(h==null?void 0:h.id)||(y!=null&&y.collectionId||h!=null&&h.collectionId)&&(y==null?void 0:y.collectionId)!=(h==null?void 0:h.collectionId))&&ir(u)});u._resetAutoRefresh=function(){_(),u.beforeSend=m,delete u._resetAutoRefresh},u.beforeSend=async(g,y)=>{var C;const S=u.authStore.token;if((C=y.query)!=null&&C.autoRefresh)return m?m(g,y):{url:g,sendOptions:y};let T=u.authStore.isValid;if(T&&ya(u.authStore.token,f))try{await c()}catch{T=!1}T||await d();const $=y.headers||{};for(let O in $)if(O.toLowerCase()=="authorization"&&S==$[O]&&u.authStore.token){$[O]=u.authStore.token;break}return y.headers=$,m?m(g,y):{url:g,sendOptions:y}}}(this.client,o,()=>this.authRefresh({autoRefresh:!0}),()=>this.authWithPassword(e,t,Object.assign({autoRefresh:!0},s))),r}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCrudPath+"/auth-refresh",i).then(this.authResponse.bind(this))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCrudPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(resetToken, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(resetToken, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCrudPath+"/confirm-password-reset",o).then(()=>!0)}}const nk=["requestKey","$cancelKey","$autoCancel","fetch","headers","body","query","params","cache","credentials","headers","integrity","keepalive","method","mode","redirect","referrer","referrerPolicy","signal","window"];function Zg(n){if(n){n.query=n.query||{};for(let e in n)nk.includes(e)||(n.query[e]=n[e],delete n[e])}}class Gg extends il{constructor(){super(...arguments),this.clientId="",this.eventSource=null,this.subscriptions={},this.lastSentSubscriptions=[],this.maxConnectTimeout=15e3,this.reconnectAttempts=0,this.maxReconnectAttempts=1/0,this.predefinedReconnectIntervals=[200,300,500,1e3,1200,1500,2e3],this.pendingConnects=[]}get isConnected(){return!!this.eventSource&&!!this.clientId&&!this.pendingConnects.length}async subscribe(e,t,i){var o;if(!e)throw new Error("topic must be set.");let l=e;if(i){Zg(i=Object.assign({},i));const r="options="+encodeURIComponent(JSON.stringify({query:i.query,headers:i.headers}));l+=(l.includes("?")?"&":"?")+r}const s=function(r){const a=r;let u;try{u=JSON.parse(a==null?void 0:a.data)}catch{}t(u||{})};return this.subscriptions[l]||(this.subscriptions[l]=[]),this.subscriptions[l].push(s),this.isConnected?this.subscriptions[l].length===1?await this.submitSubscriptions():(o=this.eventSource)==null||o.addEventListener(l,s):await this.connect(),async()=>this.unsubscribeByTopicAndListener(e,s)}async unsubscribe(e){var i;let t=!1;if(e){const l=this.getSubscriptionsByTopic(e);for(let s in l)if(this.hasSubscriptionListeners(s)){for(let o of this.subscriptions[s])(i=this.eventSource)==null||i.removeEventListener(s,o);delete this.subscriptions[s],t||(t=!0)}}else this.subscriptions={};this.hasSubscriptionListeners()?t&&await this.submitSubscriptions():this.disconnect()}async unsubscribeByPrefix(e){var i;let t=!1;for(let l in this.subscriptions)if((l+"?").startsWith(e)){t=!0;for(let s of this.subscriptions[l])(i=this.eventSource)==null||i.removeEventListener(l,s);delete this.subscriptions[l]}t&&(this.hasSubscriptionListeners()?await this.submitSubscriptions():this.disconnect())}async unsubscribeByTopicAndListener(e,t){var s;let i=!1;const l=this.getSubscriptionsByTopic(e);for(let o in l){if(!Array.isArray(this.subscriptions[o])||!this.subscriptions[o].length)continue;let r=!1;for(let a=this.subscriptions[o].length-1;a>=0;a--)this.subscriptions[o][a]===t&&(r=!0,delete this.subscriptions[o][a],this.subscriptions[o].splice(a,1),(s=this.eventSource)==null||s.removeEventListener(o,t));r&&(this.subscriptions[o].length||delete this.subscriptions[o],i||this.hasSubscriptionListeners(o)||(i=!0))}this.hasSubscriptionListeners()?i&&await this.submitSubscriptions():this.disconnect()}hasSubscriptionListeners(e){var t,i;if(this.subscriptions=this.subscriptions||{},e)return!!((t=this.subscriptions[e])!=null&&t.length);for(let l in this.subscriptions)if((i=this.subscriptions[l])!=null&&i.length)return!0;return!1}async submitSubscriptions(){if(this.clientId)return this.addAllSubscriptionListeners(),this.lastSentSubscriptions=this.getNonEmptySubscriptionKeys(),this.client.send("/api/realtime",{method:"POST",body:{clientId:this.clientId,subscriptions:this.lastSentSubscriptions},requestKey:this.getSubscriptionsCancelKey()}).catch(e=>{if(!(e!=null&&e.isAbort))throw e})}getSubscriptionsCancelKey(){return"realtime_"+this.clientId}getSubscriptionsByTopic(e){const t={};e=e.includes("?")?e:e+"?";for(let i in this.subscriptions)(i+"?").startsWith(e)&&(t[i]=this.subscriptions[i]);return t}getNonEmptySubscriptionKeys(){const e=[];for(let t in this.subscriptions)this.subscriptions[t].length&&e.push(t);return e}addAllSubscriptionListeners(){if(this.eventSource){this.removeAllSubscriptionListeners();for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.addEventListener(e,t)}}removeAllSubscriptionListeners(){if(this.eventSource)for(let e in this.subscriptions)for(let t of this.subscriptions[e])this.eventSource.removeEventListener(e,t)}async connect(){if(!(this.reconnectAttempts>0))return new Promise((e,t)=>{this.pendingConnects.push({resolve:e,reject:t}),this.pendingConnects.length>1||this.initConnect()})}initConnect(){this.disconnect(!0),clearTimeout(this.connectTimeoutId),this.connectTimeoutId=setTimeout(()=>{this.connectErrorHandler(new Error("EventSource connect took too long."))},this.maxConnectTimeout),this.eventSource=new EventSource(this.client.buildUrl("/api/realtime")),this.eventSource.onerror=e=>{this.connectErrorHandler(new Error("Failed to establish realtime connection."))},this.eventSource.addEventListener("PB_CONNECT",e=>{const t=e;this.clientId=t==null?void 0:t.lastEventId,this.submitSubscriptions().then(async()=>{let i=3;for(;this.hasUnsentSubscriptions()&&i>0;)i--,await this.submitSubscriptions()}).then(()=>{for(let l of this.pendingConnects)l.resolve();this.pendingConnects=[],this.reconnectAttempts=0,clearTimeout(this.reconnectTimeoutId),clearTimeout(this.connectTimeoutId);const i=this.getSubscriptionsByTopic("PB_CONNECT");for(let l in i)for(let s of i[l])s(e)}).catch(i=>{this.clientId="",this.connectErrorHandler(i)})})}hasUnsentSubscriptions(){const e=this.getNonEmptySubscriptionKeys();if(e.length!=this.lastSentSubscriptions.length)return!0;for(const t of e)if(!this.lastSentSubscriptions.includes(t))return!0;return!1}connectErrorHandler(e){if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),!this.clientId&&!this.reconnectAttempts||this.reconnectAttempts>this.maxReconnectAttempts){for(let i of this.pendingConnects)i.reject(new gn(e));return this.pendingConnects=[],void this.disconnect()}this.disconnect(!0);const t=this.predefinedReconnectIntervals[this.reconnectAttempts]||this.predefinedReconnectIntervals[this.predefinedReconnectIntervals.length-1];this.reconnectAttempts++,this.reconnectTimeoutId=setTimeout(()=>{this.initConnect()},t)}disconnect(e=!1){var t;if(clearTimeout(this.connectTimeoutId),clearTimeout(this.reconnectTimeoutId),this.removeAllSubscriptionListeners(),this.client.cancelRequest(this.getSubscriptionsCancelKey()),(t=this.eventSource)==null||t.close(),this.eventSource=null,this.clientId="",!e){this.reconnectAttempts=0;for(let i of this.pendingConnects)i.resolve();this.pendingConnects=[]}}}class ik extends va{constructor(e,t){super(e),this.collectionIdOrName=t}get baseCrudPath(){return this.baseCollectionPath+"/records"}get baseCollectionPath(){return"/api/collections/"+encodeURIComponent(this.collectionIdOrName)}async subscribe(e,t,i){if(!e)throw new Error("Missing topic.");if(!t)throw new Error("Missing subscription callback.");return this.client.realtime.subscribe(this.collectionIdOrName+"/"+e,t,i)}async unsubscribe(e){return e?this.client.realtime.unsubscribe(this.collectionIdOrName+"/"+e):this.client.realtime.unsubscribeByPrefix(this.collectionIdOrName)}async getFullList(e,t){if(typeof e=="number")return super.getFullList(e,t);const i=Object.assign({},e,t);return super.getFullList(i)}async getList(e=1,t=30,i){return super.getList(e,t,i)}async getFirstListItem(e,t){return super.getFirstListItem(e,t)}async getOne(e,t){return super.getOne(e,t)}async create(e,t){return super.create(e,t)}async update(e,t,i){return super.update(e,t,i).then(l=>{var s,o,r;return((s=this.client.authStore.model)==null?void 0:s.id)!==(l==null?void 0:l.id)||((o=this.client.authStore.model)==null?void 0:o.collectionId)!==this.collectionIdOrName&&((r=this.client.authStore.model)==null?void 0:r.collectionName)!==this.collectionIdOrName||this.client.authStore.save(this.client.authStore.token,l),l})}async delete(e,t){return super.delete(e,t).then(i=>{var l,s,o;return!i||((l=this.client.authStore.model)==null?void 0:l.id)!==e||((s=this.client.authStore.model)==null?void 0:s.collectionId)!==this.collectionIdOrName&&((o=this.client.authStore.model)==null?void 0:o.collectionName)!==this.collectionIdOrName||this.client.authStore.clear(),i})}authResponse(e){const t=this.decode((e==null?void 0:e.record)||{});return this.client.authStore.save(e==null?void 0:e.token,t),Object.assign({},e,{token:(e==null?void 0:e.token)||"",record:t})}async listAuthMethods(e){return e=Object.assign({method:"GET"},e),this.client.send(this.baseCollectionPath+"/auth-methods",e).then(t=>Object.assign({},t,{usernamePassword:!!(t!=null&&t.usernamePassword),emailPassword:!!(t!=null&&t.emailPassword),authProviders:Array.isArray(t==null?void 0:t.authProviders)?t==null?void 0:t.authProviders:[]}))}async authWithPassword(e,t,i,l){let s={method:"POST",body:{identity:e,password:t}};return s=wn("This form of authWithPassword(usernameOrEmail, pass, body?, query?) is deprecated. Consider replacing it with authWithPassword(usernameOrEmail, pass, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/auth-with-password",s).then(o=>this.authResponse(o))}async authWithOAuth2Code(e,t,i,l,s,o,r){let a={method:"POST",body:{provider:e,code:t,codeVerifier:i,redirectUrl:l,createData:s}};return a=wn("This form of authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, body?, query?) is deprecated. Consider replacing it with authWithOAuth2Code(provider, code, codeVerifier, redirectUrl, createData?, options?).",a,o,r),this.client.send(this.baseCollectionPath+"/auth-with-oauth2",a).then(u=>this.authResponse(u))}authWithOAuth2(...e){if(e.length>1||typeof(e==null?void 0:e[0])=="string")return console.warn("PocketBase: This form of authWithOAuth2() is deprecated and may get removed in the future. Please replace with authWithOAuth2Code() OR use the authWithOAuth2() realtime form as shown in https://pocketbase.io/docs/authentication/#oauth2-integration."),this.authWithOAuth2Code((e==null?void 0:e[0])||"",(e==null?void 0:e[1])||"",(e==null?void 0:e[2])||"",(e==null?void 0:e[3])||"",(e==null?void 0:e[4])||{},(e==null?void 0:e[5])||{},(e==null?void 0:e[6])||{});const t=(e==null?void 0:e[0])||{};let i=null;t.urlCallback||(i=pu(void 0));const l=new Gg(this.client);function s(){i==null||i.close(),l.unsubscribe()}const o={},r=t.requestKey;return r&&(o.requestKey=r),this.listAuthMethods(o).then(a=>{var d;const u=a.authProviders.find(m=>m.name===t.provider);if(!u)throw new gn(new Error(`Missing or invalid provider "${t.provider}".`));const f=this.client.buildUrl("/api/oauth2-redirect"),c=r?(d=this.client.cancelControllers)==null?void 0:d[r]:void 0;return c&&(c.signal.onabort=()=>{s()}),new Promise(async(m,h)=>{var _;try{await l.subscribe("@oauth2",async T=>{var C;const $=l.clientId;try{if(!T.state||$!==T.state)throw new Error("State parameters don't match.");if(T.error||!T.code)throw new Error("OAuth2 redirect error or missing code: "+T.error);const O=Object.assign({},t);delete O.provider,delete O.scopes,delete O.createData,delete O.urlCallback,(C=c==null?void 0:c.signal)!=null&&C.onabort&&(c.signal.onabort=null);const D=await this.authWithOAuth2Code(u.name,T.code,u.codeVerifier,f,t.createData,O);m(D)}catch(O){h(new gn(O))}s()});const g={state:l.clientId};(_=t.scopes)!=null&&_.length&&(g.scope=t.scopes.join(" "));const y=this._replaceQueryParams(u.authUrl+f,g);await(t.urlCallback||function(T){i?i.location.href=T:i=pu(T)})(y)}catch(g){s(),h(new gn(g))}})}).catch(a=>{throw s(),a})}async authRefresh(e,t){let i={method:"POST"};return i=wn("This form of authRefresh(body?, query?) is deprecated. Consider replacing it with authRefresh(options?).",i,e,t),this.client.send(this.baseCollectionPath+"/auth-refresh",i).then(l=>this.authResponse(l))}async requestPasswordReset(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestPasswordReset(email, body?, query?) is deprecated. Consider replacing it with requestPasswordReset(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-password-reset",l).then(()=>!0)}async confirmPasswordReset(e,t,i,l,s){let o={method:"POST",body:{token:e,password:t,passwordConfirm:i}};return o=wn("This form of confirmPasswordReset(token, password, passwordConfirm, body?, query?) is deprecated. Consider replacing it with confirmPasswordReset(token, password, passwordConfirm, options?).",o,l,s),this.client.send(this.baseCollectionPath+"/confirm-password-reset",o).then(()=>!0)}async requestVerification(e,t,i){let l={method:"POST",body:{email:e}};return l=wn("This form of requestVerification(email, body?, query?) is deprecated. Consider replacing it with requestVerification(email, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-verification",l).then(()=>!0)}async confirmVerification(e,t,i){let l={method:"POST",body:{token:e}};return l=wn("This form of confirmVerification(token, body?, query?) is deprecated. Consider replacing it with confirmVerification(token, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/confirm-verification",l).then(()=>{const s=wl(e),o=this.client.authStore.model;return o&&!o.verified&&o.id===s.id&&o.collectionId===s.collectionId&&(o.verified=!0,this.client.authStore.save(this.client.authStore.token,o)),!0})}async requestEmailChange(e,t,i){let l={method:"POST",body:{newEmail:e}};return l=wn("This form of requestEmailChange(newEmail, body?, query?) is deprecated. Consider replacing it with requestEmailChange(newEmail, options?).",l,t,i),this.client.send(this.baseCollectionPath+"/request-email-change",l).then(()=>!0)}async confirmEmailChange(e,t,i,l){let s={method:"POST",body:{token:e,password:t}};return s=wn("This form of confirmEmailChange(token, password, body?, query?) is deprecated. Consider replacing it with confirmEmailChange(token, password, options?).",s,i,l),this.client.send(this.baseCollectionPath+"/confirm-email-change",s).then(()=>{const o=wl(e),r=this.client.authStore.model;return r&&r.id===o.id&&r.collectionId===o.collectionId&&this.client.authStore.clear(),!0})}async listExternalAuths(e,t){return t=Object.assign({method:"GET"},t),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths",t)}async unlinkExternalAuth(e,t,i){return i=Object.assign({method:"DELETE"},i),this.client.send(this.baseCrudPath+"/"+encodeURIComponent(e)+"/external-auths/"+encodeURIComponent(t),i).then(()=>!0)}_replaceQueryParams(e,t={}){let i=e,l="";e.indexOf("?")>=0&&(i=e.substring(0,e.indexOf("?")),l=e.substring(e.indexOf("?")+1));const s={},o=l.split("&");for(const r of o){if(r=="")continue;const a=r.split("=");s[decodeURIComponent(a[0].replace(/\+/g," "))]=decodeURIComponent((a[1]||"").replace(/\+/g," "))}for(let r in t)t.hasOwnProperty(r)&&(t[r]==null?delete s[r]:s[r]=t[r]);l="";for(let r in s)s.hasOwnProperty(r)&&(l!=""&&(l+="&"),l+=encodeURIComponent(r.replace(/%20/g,"+"))+"="+encodeURIComponent(s[r].replace(/%20/g,"+")));return l!=""?i+"?"+l:i}}function pu(n){if(typeof window>"u"||!(window!=null&&window.open))throw new gn(new Error("Not in a browser context - please pass a custom urlCallback function."));let e=1024,t=768,i=window.innerWidth,l=window.innerHeight;e=e>i?i:e,t=t>l?l:t;let s=i/2-e/2,o=l/2-t/2;return window.open(n,"popup_window","width="+e+",height="+t+",top="+o+",left="+s+",resizable,menubar=no")}class lk extends va{get baseCrudPath(){return"/api/collections"}async import(e,t=!1,i){return i=Object.assign({method:"PUT",body:{collections:e,deleteMissing:t}},i),this.client.send(this.baseCrudPath+"/import",i).then(()=>!0)}}class sk extends il{async getList(e=1,t=30,i){return(i=Object.assign({method:"GET"},i)).query=Object.assign({page:e,perPage:t},i.query),this.client.send("/api/logs",i)}async getOne(e,t){if(!e)throw new gn({url:this.client.buildUrl("/api/logs/"),status:404,response:{code:404,message:"Missing required log id.",data:{}}});return t=Object.assign({method:"GET"},t),this.client.send("/api/logs/"+encodeURIComponent(e),t)}async getStats(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/logs/stats",e)}}class ok extends il{async check(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/health",e)}}class rk extends il{getUrl(e,t,i={}){if(!t||!(e!=null&&e.id)||!(e!=null&&e.collectionId)&&!(e!=null&&e.collectionName))return"";const l=[];l.push("api"),l.push("files"),l.push(encodeURIComponent(e.collectionId||e.collectionName)),l.push(encodeURIComponent(e.id)),l.push(encodeURIComponent(t));let s=this.client.buildUrl(l.join("/"));if(Object.keys(i).length){i.download===!1&&delete i.download;const o=new URLSearchParams(i);s+=(s.includes("?")?"&":"?")+o}return s}async getToken(e){return e=Object.assign({method:"POST"},e),this.client.send("/api/files/token",e).then(t=>(t==null?void 0:t.token)||"")}}class ak extends il{async getFullList(e){return e=Object.assign({method:"GET"},e),this.client.send("/api/backups",e)}async create(e,t){return t=Object.assign({method:"POST",body:{name:e}},t),this.client.send("/api/backups",t).then(()=>!0)}async upload(e,t){return t=Object.assign({method:"POST",body:e},t),this.client.send("/api/backups/upload",t).then(()=>!0)}async delete(e,t){return t=Object.assign({method:"DELETE"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}`,t).then(()=>!0)}async restore(e,t){return t=Object.assign({method:"POST"},t),this.client.send(`/api/backups/${encodeURIComponent(e)}/restore`,t).then(()=>!0)}getDownloadUrl(e,t){return this.client.buildUrl(`/api/backups/${encodeURIComponent(t)}?token=${encodeURIComponent(e)}`)}}class jo{constructor(e="/",t,i="en-US"){this.cancelControllers={},this.recordServices={},this.enableAutoCancellation=!0,this.baseUrl=e,this.lang=i,this.authStore=t||new Jg,this.admins=new tk(this),this.collections=new lk(this),this.files=new rk(this),this.logs=new sk(this),this.settings=new ek(this),this.realtime=new Gg(this),this.health=new ok(this),this.backups=new ak(this)}collection(e){return this.recordServices[e]||(this.recordServices[e]=new ik(this,e)),this.recordServices[e]}autoCancellation(e){return this.enableAutoCancellation=!!e,this}cancelRequest(e){return this.cancelControllers[e]&&(this.cancelControllers[e].abort(),delete this.cancelControllers[e]),this}cancelAllRequests(){for(let e in this.cancelControllers)this.cancelControllers[e].abort();return this.cancelControllers={},this}filter(e,t){if(!t)return e;for(let i in t){let l=t[i];switch(typeof l){case"boolean":case"number":l=""+l;break;case"string":l="'"+l.replace(/'/g,"\\'")+"'";break;default:l=l===null?"null":l instanceof Date?"'"+l.toISOString().replace("T"," ")+"'":"'"+JSON.stringify(l).replace(/'/g,"\\'")+"'"}e=e.replaceAll("{:"+i+"}",l)}return e}getFileUrl(e,t,i={}){return this.files.getUrl(e,t,i)}buildUrl(e){var i;let t=this.baseUrl;return typeof window>"u"||!window.location||t.startsWith("https://")||t.startsWith("http://")||(t=(i=window.location.origin)!=null&&i.endsWith("/")?window.location.origin.substring(0,window.location.origin.length-1):window.location.origin||"",this.baseUrl.startsWith("/")||(t+=window.location.pathname||"/",t+=t.endsWith("/")?"":"/"),t+=this.baseUrl),e&&(t+=t.endsWith("/")?"":"/",t+=e.startsWith("/")?e.substring(1):e),t}async send(e,t){t=this.initSendOptions(e,t);let i=this.buildUrl(e);if(this.beforeSend){const l=Object.assign({},await this.beforeSend(i,t));l.url!==void 0||l.options!==void 0?(i=l.url||i,t=l.options||t):Object.keys(l).length&&(t=l,console!=null&&console.warn&&console.warn("Deprecated format of beforeSend return: please use `return { url, options }`, instead of `return options`."))}if(t.query!==void 0){const l=this.serializeQueryParams(t.query);l&&(i+=(i.includes("?")?"&":"?")+l),delete t.query}return this.getHeader(t.headers,"Content-Type")=="application/json"&&t.body&&typeof t.body!="string"&&(t.body=JSON.stringify(t.body)),(t.fetch||fetch)(i,t).then(async l=>{let s={};try{s=await l.json()}catch{}if(this.afterSend&&(s=await this.afterSend(l,s)),l.status>=400)throw new gn({url:l.url,status:l.status,data:s});return s}).catch(l=>{throw new gn(l)})}initSendOptions(e,t){if((t=Object.assign({method:"GET"},t)).body=this.convertToFormDataIfNeeded(t.body),Zg(t),t.query=Object.assign({},t.params,t.query),t.requestKey===void 0&&(t.$autoCancel===!1||t.query.$autoCancel===!1?t.requestKey=null:(t.$cancelKey||t.query.$cancelKey)&&(t.requestKey=t.$cancelKey||t.query.$cancelKey)),delete t.$autoCancel,delete t.query.$autoCancel,delete t.$cancelKey,delete t.query.$cancelKey,this.getHeader(t.headers,"Content-Type")!==null||this.isFormData(t.body)||(t.headers=Object.assign({},t.headers,{"Content-Type":"application/json"})),this.getHeader(t.headers,"Accept-Language")===null&&(t.headers=Object.assign({},t.headers,{"Accept-Language":this.lang})),this.authStore.token&&this.getHeader(t.headers,"Authorization")===null&&(t.headers=Object.assign({},t.headers,{Authorization:this.authStore.token})),this.enableAutoCancellation&&t.requestKey!==null){const i=t.requestKey||(t.method||"GET")+e;delete t.requestKey,this.cancelRequest(i);const l=new AbortController;this.cancelControllers[i]=l,t.signal=l.signal}return t}convertToFormDataIfNeeded(e){if(typeof FormData>"u"||e===void 0||typeof e!="object"||e===null||this.isFormData(e)||!this.hasBlobField(e))return e;const t=new FormData;for(const i in e){const l=e[i];if(typeof l!="object"||this.hasBlobField({data:l})){const s=Array.isArray(l)?l:[l];for(let o of s)t.append(i,o)}else{let s={};s[i]=l,t.append("@jsonPayload",JSON.stringify(s))}}return t}hasBlobField(e){for(const t in e){const i=Array.isArray(e[t])?e[t]:[e[t]];for(const l of i)if(typeof Blob<"u"&&l instanceof Blob||typeof File<"u"&&l instanceof File)return!0}return!1}getHeader(e,t){e=e||{},t=t.toLowerCase();for(let i in e)if(i.toLowerCase()==t)return e[i];return null}isFormData(e){return e&&(e.constructor.name==="FormData"||typeof FormData<"u"&&e instanceof FormData)}serializeQueryParams(e){const t=[];for(const i in e){if(e[i]===null)continue;const l=e[i],s=encodeURIComponent(i);if(Array.isArray(l))for(const o of l)t.push(s+"="+encodeURIComponent(o));else l instanceof Date?t.push(s+"="+encodeURIComponent(l.toISOString())):typeof l!==null&&typeof l=="object"?t.push(s+"="+encodeURIComponent(JSON.stringify(l))):t.push(s+"="+encodeURIComponent(l))}return t.join("&")}}class ll extends Error{}class uk extends ll{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class fk extends ll{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class ck extends ll{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class kl extends ll{}class Xg extends ll{constructor(e){super(`Invalid unit ${e}`)}}class tn extends ll{}class yi extends ll{constructor(){super("Zone is an abstract class")}}const De="numeric",Wn="short",$n="long",ko={year:De,month:De,day:De},Qg={year:De,month:Wn,day:De},dk={year:De,month:Wn,day:De,weekday:Wn},xg={year:De,month:$n,day:De},e1={year:De,month:$n,day:De,weekday:$n},t1={hour:De,minute:De},n1={hour:De,minute:De,second:De},i1={hour:De,minute:De,second:De,timeZoneName:Wn},l1={hour:De,minute:De,second:De,timeZoneName:$n},s1={hour:De,minute:De,hourCycle:"h23"},o1={hour:De,minute:De,second:De,hourCycle:"h23"},r1={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:Wn},a1={hour:De,minute:De,second:De,hourCycle:"h23",timeZoneName:$n},u1={year:De,month:De,day:De,hour:De,minute:De},f1={year:De,month:De,day:De,hour:De,minute:De,second:De},c1={year:De,month:Wn,day:De,hour:De,minute:De},d1={year:De,month:Wn,day:De,hour:De,minute:De,second:De},pk={year:De,month:Wn,day:De,weekday:Wn,hour:De,minute:De},p1={year:De,month:$n,day:De,hour:De,minute:De,timeZoneName:Wn},m1={year:De,month:$n,day:De,hour:De,minute:De,second:De,timeZoneName:Wn},h1={year:De,month:$n,day:De,weekday:$n,hour:De,minute:De,timeZoneName:$n},_1={year:De,month:$n,day:De,weekday:$n,hour:De,minute:De,second:De,timeZoneName:$n};class $s{get type(){throw new yi}get name(){throw new yi}get ianaName(){return this.name}get isUniversal(){throw new yi}offsetName(e,t){throw new yi}formatOffset(e,t){throw new yi}offset(e){throw new yi}equals(e){throw new yi}get isValid(){throw new yi}}let lr=null;class Ho extends $s{static get instance(){return lr===null&&(lr=new Ho),lr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return O1(e,t,i)}formatOffset(e,t){return xl(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}const Vr=new Map;function mk(n){let e=Vr.get(n);return e===void 0&&(e=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"}),Vr.set(n,e)),e}const hk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function _k(n,e){const t=n.format(e).replace(/\u200E/g,""),i=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(t),[,l,s,o,r,a,u,f]=i;return[o,l,s,r,a,u,f]}function gk(n,e){const t=n.formatToParts(e),i=[];for(let l=0;l<t.length;l++){const{type:s,value:o}=t[l],r=hk[s];s==="era"?i[r]=o:Be(r)||(i[r]=parseInt(o,10))}return i}const sr=new Map;class mi extends $s{static create(e){let t=sr.get(e);return t===void 0&&sr.set(e,t=new mi(e)),t}static resetCache(){sr.clear(),Vr.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch{return!1}}constructor(e){super(),this.zoneName=e,this.valid=mi.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:i}){return O1(e,t,i,this.name)}formatOffset(e,t){return xl(this.offset(e),t)}offset(e){if(!this.valid)return NaN;const t=new Date(e);if(isNaN(t))return NaN;const i=mk(this.name);let[l,s,o,r,a,u,f]=i.formatToParts?gk(i,t):_k(i,t);r==="BC"&&(l=-Math.abs(l)+1);const d=Vo({year:l,month:s,day:o,hour:a===24?0:a,minute:u,second:f,millisecond:0});let m=+t;const h=m%1e3;return m-=h>=0?h:1e3+h,(d-m)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let mu={};function bk(n,e={}){const t=JSON.stringify([n,e]);let i=mu[t];return i||(i=new Intl.ListFormat(n,e),mu[t]=i),i}const Br=new Map;function Ur(n,e={}){const t=JSON.stringify([n,e]);let i=Br.get(t);return i===void 0&&(i=new Intl.DateTimeFormat(n,e),Br.set(t,i)),i}const Wr=new Map;function kk(n,e={}){const t=JSON.stringify([n,e]);let i=Wr.get(t);return i===void 0&&(i=new Intl.NumberFormat(n,e),Wr.set(t,i)),i}const Yr=new Map;function yk(n,e={}){const{base:t,...i}=e,l=JSON.stringify([n,i]);let s=Yr.get(l);return s===void 0&&(s=new Intl.RelativeTimeFormat(n,e),Yr.set(l,s)),s}let Kl=null;function vk(){return Kl||(Kl=new Intl.DateTimeFormat().resolvedOptions().locale,Kl)}const Kr=new Map;function g1(n){let e=Kr.get(n);return e===void 0&&(e=new Intl.DateTimeFormat(n).resolvedOptions(),Kr.set(n,e)),e}const Jr=new Map;function wk(n){let e=Jr.get(n);if(!e){const t=new Intl.Locale(n);e="getWeekInfo"in t?t.getWeekInfo():t.weekInfo,"minimalDays"in e||(e={...b1,...e}),Jr.set(n,e)}return e}function Sk(n){const e=n.indexOf("-x-");e!==-1&&(n=n.substring(0,e));const t=n.indexOf("-u-");if(t===-1)return[n];{let i,l;try{i=Ur(n).resolvedOptions(),l=n}catch{const a=n.substring(0,t);i=Ur(a).resolvedOptions(),l=a}const{numberingSystem:s,calendar:o}=i;return[l,s,o]}}function $k(n,e,t){return(t||e)&&(n.includes("-u-")||(n+="-u"),t&&(n+=`-ca-${t}`),e&&(n+=`-nu-${e}`)),n}function Tk(n){const e=[];for(let t=1;t<=12;t++){const i=je.utc(2009,t,1);e.push(n(i))}return e}function Ck(n){const e=[];for(let t=1;t<=7;t++){const i=je.utc(2016,11,13+t);e.push(n(i))}return e}function Ns(n,e,t,i){const l=n.listingMode();return l==="error"?null:l==="en"?t(e):i(e)}function Ok(n){return n.numberingSystem&&n.numberingSystem!=="latn"?!1:n.numberingSystem==="latn"||!n.locale||n.locale.startsWith("en")||g1(n.locale).numberingSystem==="latn"}class Mk{constructor(e,t,i){this.padTo=i.padTo||0,this.floor=i.floor||!1;const{padTo:l,floor:s,...o}=i;if(!t||Object.keys(o).length>0){const r={useGrouping:!1,...i};i.padTo>0&&(r.minimumIntegerDigits=i.padTo),this.inf=kk(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):Ca(e,3);return Vt(t,this.padTo)}}}class Dk{constructor(e,t,i){this.opts=i,this.originalZone=void 0;let l;if(this.opts.timeZone)this.dt=e;else if(e.zone.type==="fixed"){const o=-1*(e.offset/60),r=o>=0?`Etc/GMT+${o}`:`Etc/GMT${o}`;e.offset!==0&&mi.create(r).valid?(l=r,this.dt=e):(l="UTC",this.dt=e.offset===0?e:e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type==="system"?this.dt=e:e.zone.type==="iana"?(this.dt=e,l=e.zone.name):(l="UTC",this.dt=e.setZone("UTC").plus({minutes:e.offset}),this.originalZone=e.zone);const s={...this.opts};s.timeZone=s.timeZone||l,this.dtf=Ur(t,s)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(t=>{if(t.type==="timeZoneName"){const i=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...t,value:i}}else return t}):e}resolvedOptions(){return this.dtf.resolvedOptions()}}class Ek{constructor(e,t,i){this.opts={style:"long",...i},!t&&T1()&&(this.rtf=yk(e,i))}format(e,t){return this.rtf?this.rtf.format(e,t):Qk(t,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}const b1={firstDay:1,minimalDays:4,weekend:[6,7]};class pt{static fromOpts(e){return pt.create(e.locale,e.numberingSystem,e.outputCalendar,e.weekSettings,e.defaultToEN)}static create(e,t,i,l,s=!1){const o=e||jt.defaultLocale,r=o||(s?"en-US":vk()),a=t||jt.defaultNumberingSystem,u=i||jt.defaultOutputCalendar,f=Gr(l)||jt.defaultWeekSettings;return new pt(r,a,u,f,o)}static resetCache(){Kl=null,Br.clear(),Wr.clear(),Yr.clear(),Kr.clear(),Jr.clear()}static fromObject({locale:e,numberingSystem:t,outputCalendar:i,weekSettings:l}={}){return pt.create(e,t,i,l)}constructor(e,t,i,l,s){const[o,r,a]=Sk(e);this.locale=o,this.numberingSystem=t||r||null,this.outputCalendar=i||a||null,this.weekSettings=l,this.intl=$k(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=Ok(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:pt.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,Gr(e.weekSettings)||this.weekSettings,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ns(this,e,E1,()=>{const i=this.intl==="ja"||this.intl.startsWith("ja-");t&=!i;const l=t?{month:e,day:"numeric"}:{month:e},s=t?"format":"standalone";if(!this.monthsCache[s][e]){const o=i?r=>this.dtFormatter(r,l).format():r=>this.extract(r,l,"month");this.monthsCache[s][e]=Tk(o)}return this.monthsCache[s][e]})}weekdays(e,t=!1){return Ns(this,e,L1,()=>{const i=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},l=t?"format":"standalone";return this.weekdaysCache[l][e]||(this.weekdaysCache[l][e]=Ck(s=>this.extract(s,i,"weekday"))),this.weekdaysCache[l][e]})}meridiems(){return Ns(this,void 0,()=>N1,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[je.utc(2016,11,13,9),je.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e){return Ns(this,e,P1,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[je.utc(-40,1,1),je.utc(2017,1,1)].map(i=>this.extract(i,t,"era"))),this.eraCache[e]})}extract(e,t,i){const l=this.dtFormatter(e,t),s=l.formatToParts(),o=s.find(r=>r.type.toLowerCase()===i);return o?o.value:null}numberFormatter(e={}){return new Mk(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Dk(e,this.intl,t)}relFormatter(e={}){return new Ek(this.intl,this.isEnglish(),e)}listFormatter(e={}){return bk(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||g1(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:C1()?wk(this.locale):b1}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let or=null;class cn extends $s{static get utcInstance(){return or===null&&(or=new cn(0)),or}static instance(e){return e===0?cn.utcInstance:new cn(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new cn(Bo(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${xl(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${xl(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return xl(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 Ik extends $s{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 Si(n,e){if(Be(n)||n===null)return e;if(n instanceof $s)return n;if(Rk(n)){const t=n.toLowerCase();return t==="default"?e:t==="local"||t==="system"?Ho.instance:t==="utc"||t==="gmt"?cn.utcInstance:cn.parseSpecifier(t)||mi.create(n)}else return Mi(n)?cn.instance(n):typeof n=="object"&&"offset"in n&&typeof n.offset=="function"?n:new Ik(n)}const wa={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},hu={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]},Ak=wa.hanidec.replace(/[\[|\]]/g,"").split("");function Lk(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(wa.hanidec)!==-1)e+=Ak.indexOf(n[t]);else for(const l in hu){const[s,o]=hu[l];i>=s&&i<=o&&(e+=i-s)}}return parseInt(e,10)}else return e}const Zr=new Map;function Nk(){Zr.clear()}function jn({numberingSystem:n},e=""){const t=n||"latn";let i=Zr.get(t);i===void 0&&(i=new Map,Zr.set(t,i));let l=i.get(e);return l===void 0&&(l=new RegExp(`${wa[t]}${e}`),i.set(e,l)),l}let _u=()=>Date.now(),gu="system",bu=null,ku=null,yu=null,vu=60,wu,Su=null;class jt{static get now(){return _u}static set now(e){_u=e}static set defaultZone(e){gu=e}static get defaultZone(){return Si(gu,Ho.instance)}static get defaultLocale(){return bu}static set defaultLocale(e){bu=e}static get defaultNumberingSystem(){return ku}static set defaultNumberingSystem(e){ku=e}static get defaultOutputCalendar(){return yu}static set defaultOutputCalendar(e){yu=e}static get defaultWeekSettings(){return Su}static set defaultWeekSettings(e){Su=Gr(e)}static get twoDigitCutoffYear(){return vu}static set twoDigitCutoffYear(e){vu=e%100}static get throwOnInvalid(){return wu}static set throwOnInvalid(e){wu=e}static resetCaches(){pt.resetCache(),mi.resetCache(),je.resetCache(),Nk()}}class zn{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const k1=[0,31,59,90,120,151,181,212,243,273,304,334],y1=[0,31,60,91,121,152,182,213,244,274,305,335];function Nn(n,e){return new zn("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${n}, which is invalid`)}function Sa(n,e,t){const i=new Date(Date.UTC(n,e-1,t));n<100&&n>=0&&i.setUTCFullYear(i.getUTCFullYear()-1900);const l=i.getUTCDay();return l===0?7:l}function v1(n,e,t){return t+(Ts(n)?y1:k1)[e-1]}function w1(n,e){const t=Ts(n)?y1:k1,i=t.findIndex(s=>s<e),l=e-t[i];return{month:i+1,day:l}}function $a(n,e){return(n-e+7)%7+1}function yo(n,e=4,t=1){const{year:i,month:l,day:s}=n,o=v1(i,l,s),r=$a(Sa(i,l,s),t);let a=Math.floor((o-r+14-e)/7),u;return a<1?(u=i-1,a=fs(u,e,t)):a>fs(i,e,t)?(u=i+1,a=1):u=i,{weekYear:u,weekNumber:a,weekday:r,...Uo(n)}}function $u(n,e=4,t=1){const{weekYear:i,weekNumber:l,weekday:s}=n,o=$a(Sa(i,1,e),t),r=Sl(i);let a=l*7+s-o-7+e,u;a<1?(u=i-1,a+=Sl(u)):a>r?(u=i+1,a-=Sl(i)):u=i;const{month:f,day:c}=w1(u,a);return{year:u,month:f,day:c,...Uo(n)}}function rr(n){const{year:e,month:t,day:i}=n,l=v1(e,t,i);return{year:e,ordinal:l,...Uo(n)}}function Tu(n){const{year:e,ordinal:t}=n,{month:i,day:l}=w1(e,t);return{year:e,month:i,day:l,...Uo(n)}}function Cu(n,e){if(!Be(n.localWeekday)||!Be(n.localWeekNumber)||!Be(n.localWeekYear)){if(!Be(n.weekday)||!Be(n.weekNumber)||!Be(n.weekYear))throw new kl("Cannot mix locale-based week fields with ISO-based week fields");return Be(n.localWeekday)||(n.weekday=n.localWeekday),Be(n.localWeekNumber)||(n.weekNumber=n.localWeekNumber),Be(n.localWeekYear)||(n.weekYear=n.localWeekYear),delete n.localWeekday,delete n.localWeekNumber,delete n.localWeekYear,{minDaysInFirstWeek:e.getMinDaysInFirstWeek(),startOfWeek:e.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function Pk(n,e=4,t=1){const i=zo(n.weekYear),l=Pn(n.weekNumber,1,fs(n.weekYear,e,t)),s=Pn(n.weekday,1,7);return i?l?s?!1:Nn("weekday",n.weekday):Nn("week",n.weekNumber):Nn("weekYear",n.weekYear)}function Fk(n){const e=zo(n.year),t=Pn(n.ordinal,1,Sl(n.year));return e?t?!1:Nn("ordinal",n.ordinal):Nn("year",n.year)}function S1(n){const e=zo(n.year),t=Pn(n.month,1,12),i=Pn(n.day,1,vo(n.year,n.month));return e?t?i?!1:Nn("day",n.day):Nn("month",n.month):Nn("year",n.year)}function $1(n){const{hour:e,minute:t,second:i,millisecond:l}=n,s=Pn(e,0,23)||e===24&&t===0&&i===0&&l===0,o=Pn(t,0,59),r=Pn(i,0,59),a=Pn(l,0,999);return s?o?r?a?!1:Nn("millisecond",l):Nn("second",i):Nn("minute",t):Nn("hour",e)}function Be(n){return typeof n>"u"}function Mi(n){return typeof n=="number"}function zo(n){return typeof n=="number"&&n%1===0}function Rk(n){return typeof n=="string"}function qk(n){return Object.prototype.toString.call(n)==="[object Date]"}function T1(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function C1(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function jk(n){return Array.isArray(n)?n:[n]}function Ou(n,e,t){if(n.length!==0)return n.reduce((i,l)=>{const s=[e(l),l];return i&&t(i[0],s[0])===i[0]?i:s},null)[1]}function Hk(n,e){return e.reduce((t,i)=>(t[i]=n[i],t),{})}function Ml(n,e){return Object.prototype.hasOwnProperty.call(n,e)}function Gr(n){if(n==null)return null;if(typeof n!="object")throw new tn("Week settings must be an object");if(!Pn(n.firstDay,1,7)||!Pn(n.minimalDays,1,7)||!Array.isArray(n.weekend)||n.weekend.some(e=>!Pn(e,1,7)))throw new tn("Invalid week settings");return{firstDay:n.firstDay,minimalDays:n.minimalDays,weekend:Array.from(n.weekend)}}function Pn(n,e,t){return zo(n)&&n>=e&&n<=t}function zk(n,e){return n-e*Math.floor(n/e)}function Vt(n,e=2){const t=n<0;let i;return t?i="-"+(""+-n).padStart(e,"0"):i=(""+n).padStart(e,"0"),i}function vi(n){if(!(Be(n)||n===null||n===""))return parseInt(n,10)}function Fi(n){if(!(Be(n)||n===null||n===""))return parseFloat(n)}function Ta(n){if(!(Be(n)||n===null||n==="")){const e=parseFloat("0."+n)*1e3;return Math.floor(e)}}function Ca(n,e,t="round"){const i=10**e;switch(t){case"expand":return n>0?Math.ceil(n*i)/i:Math.floor(n*i)/i;case"trunc":return Math.trunc(n*i)/i;case"round":return Math.round(n*i)/i;case"floor":return Math.floor(n*i)/i;case"ceil":return Math.ceil(n*i)/i;default:throw new RangeError(`Value rounding ${t} is out of range`)}}function Ts(n){return n%4===0&&(n%100!==0||n%400===0)}function Sl(n){return Ts(n)?366:365}function vo(n,e){const t=zk(e-1,12)+1,i=n+(e-t)/12;return t===2?Ts(i)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][t-1]}function Vo(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(n.year,n.month-1,n.day)),+e}function Mu(n,e,t){return-$a(Sa(n,1,e),t)+e-1}function fs(n,e=4,t=1){const i=Mu(n,e,t),l=Mu(n+1,e,t);return(Sl(n)-i+l)/7}function Xr(n){return n>99?n:n>jt.twoDigitCutoffYear?1900+n:2e3+n}function O1(n,e,t,i=null){const l=new Date(n),s={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};i&&(s.timeZone=i);const o={timeZoneName:e,...s},r=new Intl.DateTimeFormat(t,o).formatToParts(l).find(a=>a.type.toLowerCase()==="timezonename");return r?r.value:null}function Bo(n,e){let t=parseInt(n,10);Number.isNaN(t)&&(t=0);const i=parseInt(e,10)||0,l=t<0||Object.is(t,-0)?-i:i;return t*60+l}function M1(n){const e=Number(n);if(typeof n=="boolean"||n===""||!Number.isFinite(e))throw new tn(`Invalid unit value ${n}`);return e}function wo(n,e){const t={};for(const i in n)if(Ml(n,i)){const l=n[i];if(l==null)continue;t[e(i)]=M1(l)}return t}function xl(n,e){const t=Math.trunc(Math.abs(n/60)),i=Math.trunc(Math.abs(n%60)),l=n>=0?"+":"-";switch(e){case"short":return`${l}${Vt(t,2)}:${Vt(i,2)}`;case"narrow":return`${l}${t}${i>0?`:${i}`:""}`;case"techie":return`${l}${Vt(t,2)}${Vt(i,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function Uo(n){return Hk(n,["hour","minute","second","millisecond"])}const Vk=["January","February","March","April","May","June","July","August","September","October","November","December"],D1=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Bk=["J","F","M","A","M","J","J","A","S","O","N","D"];function E1(n){switch(n){case"narrow":return[...Bk];case"short":return[...D1];case"long":return[...Vk];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 I1=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],A1=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Uk=["M","T","W","T","F","S","S"];function L1(n){switch(n){case"narrow":return[...Uk];case"short":return[...A1];case"long":return[...I1];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const N1=["AM","PM"],Wk=["Before Christ","Anno Domini"],Yk=["BC","AD"],Kk=["B","A"];function P1(n){switch(n){case"narrow":return[...Kk];case"short":return[...Yk];case"long":return[...Wk];default:return null}}function Jk(n){return N1[n.hour<12?0:1]}function Zk(n,e){return L1(e)[n.weekday-1]}function Gk(n,e){return E1(e)[n.month-1]}function Xk(n,e){return P1(e)[n.year<0?0:1]}function Qk(n,e,t="always",i=!1){const l={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."]},s=["hours","minutes","seconds"].indexOf(n)===-1;if(t==="auto"&&s){const c=n==="days";switch(e){case 1:return c?"tomorrow":`next ${l[n][0]}`;case-1:return c?"yesterday":`last ${l[n][0]}`;case 0:return c?"today":`this ${l[n][0]}`}}const o=Object.is(e,-0)||e<0,r=Math.abs(e),a=r===1,u=l[n],f=i?a?u[1]:u[2]||u[1]:a?l[n][0]:n;return o?`${r} ${f} ago`:`in ${r} ${f}`}function Du(n,e){let t="";for(const i of n)i.literal?t+=i.val:t+=e(i.val);return t}const xk={D:ko,DD:Qg,DDD:xg,DDDD:e1,t:t1,tt:n1,ttt:i1,tttt:l1,T:s1,TT:o1,TTT:r1,TTTT:a1,f:u1,ff:c1,fff:p1,ffff:h1,F:f1,FF:d1,FFF:m1,FFFF:_1};class sn{static create(e,t={}){return new sn(e,t)}static parseFormat(e){let t=null,i="",l=!1;const s=[];for(let o=0;o<e.length;o++){const r=e.charAt(o);r==="'"?((i.length>0||l)&&s.push({literal:l||/^\s+$/.test(i),val:i===""?"'":i}),t=null,i="",l=!l):l||r===t?i+=r:(i.length>0&&s.push({literal:/^\s+$/.test(i),val:i}),i=r,t=r)}return i.length>0&&s.push({literal:l||/^\s+$/.test(i),val:i}),s}static macroTokenToFormatOpts(e){return xk[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()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,i=void 0){if(this.opts.forceSimple)return Vt(e,t);const l={...this.opts};return t>0&&(l.padTo=t),i&&(l.signDisplay=i),this.loc.numberFormatter(l).format(e)}formatDateTimeFromString(e,t){const i=this.loc.listingMode()==="en",l=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",s=(m,h)=>this.loc.extract(e,m,h),o=m=>e.isOffsetFixed&&e.offset===0&&m.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,m.format):"",r=()=>i?Jk(e):s({hour:"numeric",hourCycle:"h12"},"dayperiod"),a=(m,h)=>i?Gk(e,m):s(h?{month:m}:{month:m,day:"numeric"},"month"),u=(m,h)=>i?Zk(e,m):s(h?{weekday:m}:{weekday:m,month:"long",day:"numeric"},"weekday"),f=m=>{const h=sn.macroTokenToFormatOpts(m);return h?this.formatWithSystemDefault(e,h):m},c=m=>i?Xk(e,m):s({era:m},"era"),d=m=>{switch(m){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return o({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return o({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return o({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return r();case"d":return l?s({day:"numeric"},"day"):this.num(e.day);case"dd":return l?s({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 l?s({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return l?s({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 l?s({month:"numeric"},"month"):this.num(e.month);case"MM":return l?s({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 l?s({year:"numeric"},"year"):this.num(e.year);case"yy":return l?s({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return l?s({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return l?s({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"n":return this.num(e.localWeekNumber);case"nn":return this.num(e.localWeekNumber,2);case"ii":return this.num(e.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(e.localWeekYear,4);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return f(m)}};return Du(sn.parseFormat(t),d)}formatDurationFromString(e,t){const i=this.opts.signMode==="negativeLargestOnly"?-1:1,l=f=>{switch(f[0]){case"S":return"milliseconds";case"s":return"seconds";case"m":return"minutes";case"h":return"hours";case"d":return"days";case"w":return"weeks";case"M":return"months";case"y":return"years";default:return null}},s=(f,c)=>d=>{const m=l(d);if(m){const h=c.isNegativeDuration&&m!==c.largestUnit?i:1;let _;return this.opts.signMode==="negativeLargestOnly"&&m!==c.largestUnit?_="never":this.opts.signMode==="all"?_="always":_="auto",this.num(f.get(m)*h,d.length,_)}else return d},o=sn.parseFormat(t),r=o.reduce((f,{literal:c,val:d})=>c?f:f.concat(d),[]),a=e.shiftTo(...r.map(l).filter(f=>f)),u={isNegativeDuration:a<0,largestUnit:Object.keys(a.values)[0]};return Du(o,s(a,u))}}const F1=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Ll(...n){const e=n.reduce((t,i)=>t+i.source,"");return RegExp(`^${e}$`)}function Nl(...n){return e=>n.reduce(([t,i,l],s)=>{const[o,r,a]=s(e,l);return[{...t,...o},r||i,a]},[{},null,1]).slice(0,2)}function Pl(n,...e){if(n==null)return[null,null];for(const[t,i]of e){const l=t.exec(n);if(l)return i(l)}return[null,null]}function R1(...n){return(e,t)=>{const i={};let l;for(l=0;l<n.length;l++)i[n[l]]=vi(e[t+l]);return[i,null,t+l]}}const q1=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,ey=`(?:${q1.source}?(?:\\[(${F1.source})\\])?)?`,Oa=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,j1=RegExp(`${Oa.source}${ey}`),Ma=RegExp(`(?:[Tt]${j1.source})?`),ty=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,ny=/(\d{4})-?W(\d\d)(?:-?(\d))?/,iy=/(\d{4})-?(\d{3})/,ly=R1("weekYear","weekNumber","weekDay"),sy=R1("year","ordinal"),oy=/(\d{4})-(\d\d)-(\d\d)/,H1=RegExp(`${Oa.source} ?(?:${q1.source}|(${F1.source}))?`),ry=RegExp(`(?: ${H1.source})?`);function $l(n,e,t){const i=n[e];return Be(i)?t:vi(i)}function ay(n,e){return[{year:$l(n,e),month:$l(n,e+1,1),day:$l(n,e+2,1)},null,e+3]}function Fl(n,e){return[{hours:$l(n,e,0),minutes:$l(n,e+1,0),seconds:$l(n,e+2,0),milliseconds:Ta(n[e+3])},null,e+4]}function Cs(n,e){const t=!n[e]&&!n[e+1],i=Bo(n[e+1],n[e+2]),l=t?null:cn.instance(i);return[{},l,e+3]}function Os(n,e){const t=n[e]?mi.create(n[e]):null;return[{},t,e+1]}const uy=RegExp(`^T?${Oa.source}$`),fy=/^-?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 cy(n){const[e,t,i,l,s,o,r,a,u]=n,f=e[0]==="-",c=a&&a[0]==="-",d=(m,h=!1)=>m!==void 0&&(h||m&&f)?-m:m;return[{years:d(Fi(t)),months:d(Fi(i)),weeks:d(Fi(l)),days:d(Fi(s)),hours:d(Fi(o)),minutes:d(Fi(r)),seconds:d(Fi(a),a==="-0"),milliseconds:d(Ta(u),c)}]}const dy={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Da(n,e,t,i,l,s,o){const r={year:e.length===2?Xr(vi(e)):vi(e),month:D1.indexOf(t)+1,day:vi(i),hour:vi(l),minute:vi(s)};return o&&(r.second=vi(o)),n&&(r.weekday=n.length>3?I1.indexOf(n)+1:A1.indexOf(n)+1),r}const py=/^(?:(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 my(n){const[,e,t,i,l,s,o,r,a,u,f,c]=n,d=Da(e,l,i,t,s,o,r);let m;return a?m=dy[a]:u?m=0:m=Bo(f,c),[d,new cn(m)]}function hy(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const _y=/^(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$/,gy=/^(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$/,by=/^(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 Eu(n){const[,e,t,i,l,s,o,r]=n;return[Da(e,l,i,t,s,o,r),cn.utcInstance]}function ky(n){const[,e,t,i,l,s,o,r]=n;return[Da(e,r,t,i,l,s,o),cn.utcInstance]}const yy=Ll(ty,Ma),vy=Ll(ny,Ma),wy=Ll(iy,Ma),Sy=Ll(j1),z1=Nl(ay,Fl,Cs,Os),$y=Nl(ly,Fl,Cs,Os),Ty=Nl(sy,Fl,Cs,Os),Cy=Nl(Fl,Cs,Os);function Oy(n){return Pl(n,[yy,z1],[vy,$y],[wy,Ty],[Sy,Cy])}function My(n){return Pl(hy(n),[py,my])}function Dy(n){return Pl(n,[_y,Eu],[gy,Eu],[by,ky])}function Ey(n){return Pl(n,[fy,cy])}const Iy=Nl(Fl);function Ay(n){return Pl(n,[uy,Iy])}const Ly=Ll(oy,ry),Ny=Ll(H1),Py=Nl(Fl,Cs,Os);function Fy(n){return Pl(n,[Ly,z1],[Ny,Py])}const Iu="Invalid Duration",V1={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}},Ry={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},...V1},Dn=146097/400,ml=146097/4800,qy={years:{quarters:4,months:12,weeks:Dn/7,days:Dn,hours:Dn*24,minutes:Dn*24*60,seconds:Dn*24*60*60,milliseconds:Dn*24*60*60*1e3},quarters:{months:3,weeks:Dn/28,days:Dn/4,hours:Dn*24/4,minutes:Dn*24*60/4,seconds:Dn*24*60*60/4,milliseconds:Dn*24*60*60*1e3/4},months:{weeks:ml/7,days:ml,hours:ml*24,minutes:ml*24*60,seconds:ml*24*60*60,milliseconds:ml*24*60*60*1e3},...V1},Yi=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],jy=Yi.slice(0).reverse();function ri(n,e,t=!1){const i={values:t?e.values:{...n.values,...e.values||{}},loc:n.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||n.conversionAccuracy,matrix:e.matrix||n.matrix};return new st(i)}function B1(n,e){let t=e.milliseconds??0;for(const i of jy.slice(1))e[i]&&(t+=e[i]*n[i].milliseconds);return t}function Au(n,e){const t=B1(n,e)<0?-1:1;Yi.reduceRight((i,l)=>{if(Be(e[l]))return i;if(i){const s=e[i]*t,o=n[l][i],r=Math.floor(s/o);e[l]+=r*t,e[i]-=r*o*t}return l},null),Yi.reduce((i,l)=>{if(Be(e[l]))return i;if(i){const s=e[i]%1;e[i]-=s,e[l]+=s*n[i][l]}return l},null)}function Lu(n){const e={};for(const[t,i]of Object.entries(n))i!==0&&(e[t]=i);return e}class st{constructor(e){const t=e.conversionAccuracy==="longterm"||!1;let i=t?qy:Ry;e.matrix&&(i=e.matrix),this.values=e.values,this.loc=e.loc||pt.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=i,this.isLuxonDuration=!0}static fromMillis(e,t){return st.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(e==null||typeof e!="object")throw new tn(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new st({values:wo(e,st.normalizeUnit),loc:pt.fromObject(t),conversionAccuracy:t.conversionAccuracy,matrix:t.matrix})}static fromDurationLike(e){if(Mi(e))return st.fromMillis(e);if(st.isDuration(e))return e;if(typeof e=="object")return st.fromObject(e);throw new tn(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[i]=Ey(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[i]=Ay(e);return i?st.fromObject(i,t):st.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the Duration is invalid");const i=e instanceof zn?e:new zn(e,t);if(jt.throwOnInvalid)throw new ck(i);return new st({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 Xg(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?sn.create(this.loc,i).formatDurationFromString(this,e):Iu}toHuman(e={}){if(!this.isValid)return Iu;const t=e.showZeros!==!1,i=Yi.map(l=>{const s=this.values[l];return Be(s)||s===0&&!t?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:l.slice(0,-1)}).format(s)}).filter(l=>l);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(i)}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+=Ca(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e,includeOffset:!1},je.fromMillis(t,{zone:"UTC"}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?B1(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e),i={};for(const l of Yi)(Ml(t.values,l)||Ml(this.values,l))&&(i[l]=t.get(l)+this.get(l));return ri(this,{values:i},!0)}minus(e){if(!this.isValid)return this;const t=st.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]=M1(e(this.values[i],i));return ri(this,{values:t},!0)}get(e){return this[st.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const t={...this.values,...wo(e,st.normalizeUnit)};return ri(this,{values:t})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:i,matrix:l}={}){const o={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:l,conversionAccuracy:i};return ri(this,o)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Au(this.matrix,e),ri(this,{values:e},!0)}rescale(){if(!this.isValid)return this;const e=Lu(this.normalize().shiftToAll().toObject());return ri(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(o=>st.normalizeUnit(o));const t={},i={},l=this.toObject();let s;for(const o of Yi)if(e.indexOf(o)>=0){s=o;let r=0;for(const u in i)r+=this.matrix[u][o]*i[u],i[u]=0;Mi(l[o])&&(r+=l[o]);const a=Math.trunc(r);t[o]=a,i[o]=(r*1e3-a*1e3)/1e3}else Mi(l[o])&&(i[o]=l[o]);for(const o in i)i[o]!==0&&(t[s]+=o===s?i[o]:i[o]/this.matrix[s][o]);return Au(this.matrix,t),ri(this,{values:t},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return ri(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;const e=Lu(this.values);return ri(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(i,l){return i===void 0||i===0?l===void 0||l===0:i===l}for(const i of Yi)if(!t(this.values[i],e.values[i]))return!1;return!0}}const hl="Invalid Interval";function Hy(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 tn("need to specify a reason the Interval is invalid");const i=e instanceof zn?e:new zn(e,t);if(jt.throwOnInvalid)throw new fk(i);return new qt({invalid:i})}static fromDateTimes(e,t){const i=zl(e),l=zl(t),s=Hy(i,l);return s??new qt({start:i,end:l})}static after(e,t){const i=st.fromDurationLike(t),l=zl(e);return qt.fromDateTimes(l,l.plus(i))}static before(e,t){const i=st.fromDurationLike(t),l=zl(e);return qt.fromDateTimes(l.minus(i),l)}static fromISO(e,t){const[i,l]=(e||"").split("/",2);if(i&&l){let s,o;try{s=je.fromISO(i,t),o=s.isValid}catch{o=!1}let r,a;try{r=je.fromISO(l,t),a=r.isValid}catch{a=!1}if(o&&a)return qt.fromDateTimes(s,r);if(o){const u=st.fromISO(l,t);if(u.isValid)return qt.after(s,u)}else if(a){const u=st.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 lastDateTime(){return this.isValid&&this.e?this.e.minus(1):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",t){if(!this.isValid)return NaN;const i=this.start.startOf(e,t);let l;return t!=null&&t.useLocaleWeeks?l=this.end.reconfigure({locale:i.locale}):l=this.end,l=l.startOf(e,t),Math.floor(l.diff(i,e).get(e))+(l.valueOf()!==this.end.valueOf())}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(zl).filter(o=>this.contains(o)).sort((o,r)=>o.toMillis()-r.toMillis()),i=[];let{s:l}=this,s=0;for(;l<this.e;){const o=t[s]||this.e,r=+o>+this.e?this.e:o;i.push(qt.fromDateTimes(l,r)),l=r,s+=1}return i}splitBy(e){const t=st.fromDurationLike(e);if(!this.isValid||!t.isValid||t.as("milliseconds")===0)return[];let{s:i}=this,l=1,s;const o=[];for(;i<this.e;){const r=this.start.plus(t.mapUnits(a=>a*l));s=+r>+this.e?this.e:r,o.push(qt.fromDateTimes(i,s)),i=s,l+=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((l,s)=>l.s-s.s).reduce(([l,s],o)=>s?s.overlaps(o)||s.abutsStart(o)?[l,s.union(o)]:[l.concat([s]),o]:[l,o],[[],null]);return i&&t.push(i),t}static xor(e){let t=null,i=0;const l=[],s=e.map(a=>[{time:a.s,type:"s"},{time:a.e,type:"e"}]),o=Array.prototype.concat(...s),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&&l.push(qt.fromDateTimes(t,a.time)),t=null);return qt.merge(l)}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()} – ${this.e.toISO()})`:hl}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=ko,t={}){return this.isValid?sn.create(this.s.loc.clone(t),e).formatInterval(this):hl}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:hl}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:hl}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:hl}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:hl}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):st.invalid(this.invalidReason)}mapEndpoints(e){return qt.fromDateTimes(e(this.s),e(this.e))}}class Ps{static hasDST(e=jt.defaultZone){const t=je.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return mi.isValidZone(e)}static normalizeZone(e){return Si(e,jt.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||pt.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||pt.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||pt.create(e)).getWeekendDays().slice()}static months(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||pt.create(t,i,s)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null,outputCalendar:s="gregory"}={}){return(l||pt.create(t,i,s)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||pt.create(t,i,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:i=null,locObj:l=null}={}){return(l||pt.create(t,i,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return pt.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return pt.create(t,null,"gregory").eras(e)}static features(){return{relative:T1(),localeWeek:C1()}}}function Nu(n,e){const t=l=>l.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),i=t(e)-t(n);return Math.floor(st.fromMillis(i).as("days"))}function zy(n,e,t){const i=[["years",(a,u)=>u.year-a.year],["quarters",(a,u)=>u.quarter-a.quarter+(u.year-a.year)*4],["months",(a,u)=>u.month-a.month+(u.year-a.year)*12],["weeks",(a,u)=>{const f=Nu(a,u);return(f-f%7)/7}],["days",Nu]],l={},s=n;let o,r;for(const[a,u]of i)t.indexOf(a)>=0&&(o=a,l[a]=u(n,e),r=s.plus(l),r>e?(l[a]--,n=s.plus(l),n>e&&(r=n,l[a]--,n=s.plus(l))):n=r);return[n,l,r,o]}function Vy(n,e,t,i){let[l,s,o,r]=zy(n,e,t);const a=e-l,u=t.filter(c=>["hours","minutes","seconds","milliseconds"].indexOf(c)>=0);u.length===0&&(o<e&&(o=l.plus({[r]:1})),o!==l&&(s[r]=(s[r]||0)+a/(o-l)));const f=st.fromObject(s,i);return u.length>0?st.fromMillis(a,i).shiftTo(...u).plus(f):f}const By="missing Intl.DateTimeFormat.formatToParts support";function ft(n,e=t=>t){return{regex:n,deser:([t])=>e(Lk(t))}}const Uy=" ",U1=`[ ${Uy}]`,W1=new RegExp(U1,"g");function Wy(n){return n.replace(/\./g,"\\.?").replace(W1,U1)}function Pu(n){return n.replace(/\./g,"").replace(W1," ").toLowerCase()}function Hn(n,e){return n===null?null:{regex:RegExp(n.map(Wy).join("|")),deser:([t])=>n.findIndex(i=>Pu(t)===Pu(i))+e}}function Fu(n,e){return{regex:n,deser:([,t,i])=>Bo(t,i),groups:e}}function Fs(n){return{regex:n,deser:([e])=>e}}function Yy(n){return n.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Ky(n,e){const t=jn(e),i=jn(e,"{2}"),l=jn(e,"{3}"),s=jn(e,"{4}"),o=jn(e,"{6}"),r=jn(e,"{1,2}"),a=jn(e,"{1,3}"),u=jn(e,"{1,6}"),f=jn(e,"{1,9}"),c=jn(e,"{2,4}"),d=jn(e,"{4,6}"),m=g=>({regex:RegExp(Yy(g.val)),deser:([y])=>y,literal:!0}),_=(g=>{if(n.literal)return m(g);switch(g.val){case"G":return Hn(e.eras("short"),0);case"GG":return Hn(e.eras("long"),0);case"y":return ft(u);case"yy":return ft(c,Xr);case"yyyy":return ft(s);case"yyyyy":return ft(d);case"yyyyyy":return ft(o);case"M":return ft(r);case"MM":return ft(i);case"MMM":return Hn(e.months("short",!0),1);case"MMMM":return Hn(e.months("long",!0),1);case"L":return ft(r);case"LL":return ft(i);case"LLL":return Hn(e.months("short",!1),1);case"LLLL":return Hn(e.months("long",!1),1);case"d":return ft(r);case"dd":return ft(i);case"o":return ft(a);case"ooo":return ft(l);case"HH":return ft(i);case"H":return ft(r);case"hh":return ft(i);case"h":return ft(r);case"mm":return ft(i);case"m":return ft(r);case"q":return ft(r);case"qq":return ft(i);case"s":return ft(r);case"ss":return ft(i);case"S":return ft(a);case"SSS":return ft(l);case"u":return Fs(f);case"uu":return Fs(r);case"uuu":return ft(t);case"a":return Hn(e.meridiems(),0);case"kkkk":return ft(s);case"kk":return ft(c,Xr);case"W":return ft(r);case"WW":return ft(i);case"E":case"c":return ft(t);case"EEE":return Hn(e.weekdays("short",!1),1);case"EEEE":return Hn(e.weekdays("long",!1),1);case"ccc":return Hn(e.weekdays("short",!0),1);case"cccc":return Hn(e.weekdays("long",!0),1);case"Z":case"ZZ":return Fu(new RegExp(`([+-]${r.source})(?::(${i.source}))?`),2);case"ZZZ":return Fu(new RegExp(`([+-]${r.source})(${i.source})?`),2);case"z":return Fs(/[a-z_+-/]{1,256}?/i);case" ":return Fs(/[^\S\n\r]/);default:return m(g)}})(n)||{invalidReason:By};return _.token=n,_}const Jy={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",hour12:{numeric:"h","2-digit":"hh"},hour24:{numeric:"H","2-digit":"HH"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Zy(n,e,t){const{type:i,value:l}=n;if(i==="literal"){const a=/^\s+$/.test(l);return{literal:!a,val:a?" ":l}}const s=e[i];let o=i;i==="hour"&&(e.hour12!=null?o=e.hour12?"hour12":"hour24":e.hourCycle!=null?e.hourCycle==="h11"||e.hourCycle==="h12"?o="hour12":o="hour24":o=t.hour12?"hour12":"hour24");let r=Jy[o];if(typeof r=="object"&&(r=r[s]),r)return{literal:!1,val:r}}function Gy(n){return[`^${n.map(t=>t.regex).reduce((t,i)=>`${t}(${i.source})`,"")}$`,n]}function Xy(n,e,t){const i=n.match(e);if(i){const l={};let s=1;for(const o in t)if(Ml(t,o)){const r=t[o],a=r.groups?r.groups+1:1;!r.literal&&r.token&&(l[r.token.val[0]]=r.deser(i.slice(s,s+a))),s+=a}return[i,l]}else return[i,{}]}function Qy(n){const e=s=>{switch(s){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 Be(n.z)||(t=mi.create(n.z)),Be(n.Z)||(t||(t=new cn(n.Z)),i=n.Z),Be(n.q)||(n.M=(n.q-1)*3+1),Be(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),Be(n.u)||(n.S=Ta(n.u)),[Object.keys(n).reduce((s,o)=>{const r=e(o);return r&&(s[r]=n[o]),s},{}),t,i]}let ar=null;function xy(){return ar||(ar=je.fromMillis(1555555555555)),ar}function ev(n,e){if(n.literal)return n;const t=sn.macroTokenToFormatOpts(n.val),i=Z1(t,e);return i==null||i.includes(void 0)?n:i}function Y1(n,e){return Array.prototype.concat(...n.map(t=>ev(t,e)))}class K1{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=Y1(sn.parseFormat(t),e),this.units=this.tokens.map(i=>Ky(i,e)),this.disqualifyingUnit=this.units.find(i=>i.invalidReason),!this.disqualifyingUnit){const[i,l]=Gy(this.units);this.regex=RegExp(i,"i"),this.handlers=l}}explainFromTokens(e){if(this.isValid){const[t,i]=Xy(e,this.regex,this.handlers),[l,s,o]=i?Qy(i):[null,null,void 0];if(Ml(i,"a")&&Ml(i,"H"))throw new kl("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:i,result:l,zone:s,specificOffset:o}}else return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function J1(n,e,t){return new K1(n,t).explainFromTokens(e)}function tv(n,e,t){const{result:i,zone:l,specificOffset:s,invalidReason:o}=J1(n,e,t);return[i,l,s,o]}function Z1(n,e){if(!n)return null;const i=sn.create(e,n).dtFormatter(xy()),l=i.formatToParts(),s=i.resolvedOptions();return l.map(o=>Zy(o,n,s))}const ur="Invalid DateTime",Ru=864e13;function Jl(n){return new zn("unsupported zone",`the zone "${n.name}" is not supported`)}function fr(n){return n.weekData===null&&(n.weekData=yo(n.c)),n.weekData}function cr(n){return n.localWeekData===null&&(n.localWeekData=yo(n.c,n.loc.getMinDaysInFirstWeek(),n.loc.getStartOfWeek())),n.localWeekData}function Ri(n,e){const t={ts:n.ts,zone:n.zone,c:n.c,o:n.o,loc:n.loc,invalid:n.invalid};return new je({...t,...e,old:t})}function G1(n,e,t){let i=n-e*60*1e3;const l=t.offset(i);if(e===l)return[i,e];i-=(l-e)*60*1e3;const s=t.offset(i);return l===s?[i,l]:[n-Math.min(l,s)*60*1e3,Math.max(l,s)]}function Rs(n,e){n+=e*60*1e3;const t=new Date(n);return{year:t.getUTCFullYear(),month:t.getUTCMonth()+1,day:t.getUTCDate(),hour:t.getUTCHours(),minute:t.getUTCMinutes(),second:t.getUTCSeconds(),millisecond:t.getUTCMilliseconds()}}function so(n,e,t){return G1(Vo(n),e,t)}function qu(n,e){const t=n.o,i=n.c.year+Math.trunc(e.years),l=n.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,s={...n.c,year:i,month:l,day:Math.min(n.c.day,vo(i,l))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},o=st.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=Vo(s);let[a,u]=G1(r,t,n.zone);return o!==0&&(a+=o,u=n.zone.offset(a)),{ts:a,o:u}}function _l(n,e,t,i,l,s){const{setZone:o,zone:r}=t;if(n&&Object.keys(n).length!==0||e){const a=e||r,u=je.fromObject(n,{...t,zone:a,specificOffset:s});return o?u:u.setZone(r)}else return je.invalid(new zn("unparsable",`the input "${l}" can't be parsed as ${i}`))}function qs(n,e,t=!0){return n.isValid?sn.create(pt.create("en-US"),{allowZ:t,forceSimple:!0}).formatDateTimeFromString(n,e):null}function dr(n,e,t){const i=n.c.year>9999||n.c.year<0;let l="";if(i&&n.c.year>=0&&(l+="+"),l+=Vt(n.c.year,i?6:4),t==="year")return l;if(e){if(l+="-",l+=Vt(n.c.month),t==="month")return l;l+="-"}else if(l+=Vt(n.c.month),t==="month")return l;return l+=Vt(n.c.day),l}function ju(n,e,t,i,l,s,o){let r=!t||n.c.millisecond!==0||n.c.second!==0,a="";switch(o){case"day":case"month":case"year":break;default:if(a+=Vt(n.c.hour),o==="hour")break;if(e){if(a+=":",a+=Vt(n.c.minute),o==="minute")break;r&&(a+=":",a+=Vt(n.c.second))}else{if(a+=Vt(n.c.minute),o==="minute")break;r&&(a+=Vt(n.c.second))}if(o==="second")break;r&&(!i||n.c.millisecond!==0)&&(a+=".",a+=Vt(n.c.millisecond,3))}return l&&(n.isOffsetFixed&&n.offset===0&&!s?a+="Z":n.o<0?(a+="-",a+=Vt(Math.trunc(-n.o/60)),a+=":",a+=Vt(Math.trunc(-n.o%60))):(a+="+",a+=Vt(Math.trunc(n.o/60)),a+=":",a+=Vt(Math.trunc(n.o%60)))),s&&(a+="["+n.zone.ianaName+"]"),a}const X1={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},nv={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},iv={ordinal:1,hour:0,minute:0,second:0,millisecond:0},oo=["year","month","day","hour","minute","second","millisecond"],lv=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],sv=["year","ordinal","hour","minute","second","millisecond"];function ro(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 Xg(n);return e}function Hu(n){switch(n.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return ro(n)}}function ov(n){if(Zl===void 0&&(Zl=jt.now()),n.type!=="iana")return n.offset(Zl);const e=n.name;let t=Qr.get(e);return t===void 0&&(t=n.offset(Zl),Qr.set(e,t)),t}function zu(n,e){const t=Si(e.zone,jt.defaultZone);if(!t.isValid)return je.invalid(Jl(t));const i=pt.fromObject(e);let l,s;if(Be(n.year))l=jt.now();else{for(const a of oo)Be(n[a])&&(n[a]=X1[a]);const o=S1(n)||$1(n);if(o)return je.invalid(o);const r=ov(t);[l,s]=so(n,r,t)}return new je({ts:l,zone:t,loc:i,o:s})}function Vu(n,e,t){const i=Be(t.round)?!0:t.round,l=Be(t.rounding)?"trunc":t.rounding,s=(r,a)=>(r=Ca(r,i||t.calendary?0:2,t.calendary?"round":l),e.loc.clone(t).relFormatter(t).format(r,a)),o=r=>t.calendary?e.hasSame(n,r)?0:e.startOf(r).diff(n.startOf(r),r).get(r):e.diff(n,r).get(r);if(t.unit)return s(o(t.unit),t.unit);for(const r of t.units){const a=o(r);if(Math.abs(a)>=1)return s(a,r)}return s(n>e?-0:0,t.units[t.units.length-1])}function Bu(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]}let Zl;const Qr=new Map;class je{constructor(e){const t=e.zone||jt.defaultZone;let i=e.invalid||(Number.isNaN(e.ts)?new zn("invalid input"):null)||(t.isValid?null:Jl(t));this.ts=Be(e.ts)?jt.now():e.ts;let l=null,s=null;if(!i)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[l,s]=[e.old.c,e.old.o];else{const r=Mi(e.o)&&!e.old?e.o:t.offset(this.ts);l=Rs(this.ts,r),i=Number.isNaN(l.year)?new zn("invalid input"):null,l=i?null:l,s=i?null:r}this._zone=t,this.loc=e.loc||pt.create(),this.invalid=i,this.weekData=null,this.localWeekData=null,this.c=l,this.o=s,this.isLuxonDateTime=!0}static now(){return new je({})}static local(){const[e,t]=Bu(arguments),[i,l,s,o,r,a,u]=t;return zu({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static utc(){const[e,t]=Bu(arguments),[i,l,s,o,r,a,u]=t;return e.zone=cn.utcInstance,zu({year:i,month:l,day:s,hour:o,minute:r,second:a,millisecond:u},e)}static fromJSDate(e,t={}){const i=qk(e)?e.valueOf():NaN;if(Number.isNaN(i))return je.invalid("invalid input");const l=Si(t.zone,jt.defaultZone);return l.isValid?new je({ts:i,zone:l,loc:pt.fromObject(t)}):je.invalid(Jl(l))}static fromMillis(e,t={}){if(Mi(e))return e<-Ru||e>Ru?je.invalid("Timestamp out of range"):new je({ts:e,zone:Si(t.zone,jt.defaultZone),loc:pt.fromObject(t)});throw new tn(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(Mi(e))return new je({ts:e*1e3,zone:Si(t.zone,jt.defaultZone),loc:pt.fromObject(t)});throw new tn("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const i=Si(t.zone,jt.defaultZone);if(!i.isValid)return je.invalid(Jl(i));const l=pt.fromObject(t),s=wo(e,Hu),{minDaysInFirstWeek:o,startOfWeek:r}=Cu(s,l),a=jt.now(),u=Be(t.specificOffset)?i.offset(a):t.specificOffset,f=!Be(s.ordinal),c=!Be(s.year),d=!Be(s.month)||!Be(s.day),m=c||d,h=s.weekYear||s.weekNumber;if((m||f)&&h)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(d&&f)throw new kl("Can't mix ordinal dates with month/day");const _=h||s.weekday&&!m;let g,y,S=Rs(a,u);_?(g=lv,y=nv,S=yo(S,o,r)):f?(g=sv,y=iv,S=rr(S)):(g=oo,y=X1);let T=!1;for(const R of g){const F=s[R];Be(F)?T?s[R]=y[R]:s[R]=S[R]:T=!0}const $=_?Pk(s,o,r):f?Fk(s):S1(s),C=$||$1(s);if(C)return je.invalid(C);const O=_?$u(s,o,r):f?Tu(s):s,[D,I]=so(O,u,i),L=new je({ts:D,zone:i,o:I,loc:l});return s.weekday&&m&&e.weekday!==L.weekday?je.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${L.toISO()}`):L.isValid?L:je.invalid(L.invalid)}static fromISO(e,t={}){const[i,l]=Oy(e);return _l(i,l,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[i,l]=My(e);return _l(i,l,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[i,l]=Dy(e);return _l(i,l,t,"HTTP",t)}static fromFormat(e,t,i={}){if(Be(e)||Be(t))throw new tn("fromFormat requires an input string and a format");const{locale:l=null,numberingSystem:s=null}=i,o=pt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0}),[r,a,u,f]=tv(o,e,t);return f?je.invalid(f):_l(r,a,i,`format ${t}`,e,u)}static fromString(e,t,i={}){return je.fromFormat(e,t,i)}static fromSQL(e,t={}){const[i,l]=Fy(e);return _l(i,l,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new tn("need to specify a reason the DateTime is invalid");const i=e instanceof zn?e:new zn(e,t);if(jt.throwOnInvalid)throw new uk(i);return new je({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){const i=Z1(e,pt.fromObject(t));return i?i.map(l=>l?l.val:null).join(""):null}static expandFormat(e,t={}){return Y1(sn.parseFormat(e),pt.fromObject(t)).map(l=>l.val).join("")}static resetCache(){Zl=void 0,Qr.clear()}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?fr(this).weekYear:NaN}get weekNumber(){return this.isValid?fr(this).weekNumber:NaN}get weekday(){return this.isValid?fr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?cr(this).weekday:NaN}get localWeekNumber(){return this.isValid?cr(this).weekNumber:NaN}get localWeekYear(){return this.isValid?cr(this).weekYear:NaN}get ordinal(){return this.isValid?rr(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ps.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ps.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ps.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ps.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}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];const e=864e5,t=6e4,i=Vo(this.c),l=this.zone.offset(i-e),s=this.zone.offset(i+e),o=this.zone.offset(i-l*t),r=this.zone.offset(i-s*t);if(o===r)return[this];const a=i-o*t,u=i-r*t,f=Rs(a,o),c=Rs(u,r);return f.hour===c.hour&&f.minute===c.minute&&f.second===c.second&&f.millisecond===c.millisecond?[Ri(this,{ts:a}),Ri(this,{ts:u})]:[this]}get isInLeapYear(){return Ts(this.year)}get daysInMonth(){return vo(this.year,this.month)}get daysInYear(){return this.isValid?Sl(this.year):NaN}get weeksInWeekYear(){return this.isValid?fs(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?fs(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:i,calendar:l}=sn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:i,outputCalendar:l}}toUTC(e=0,t={}){return this.setZone(cn.instance(e),t)}toLocal(){return this.setZone(jt.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:i=!1}={}){if(e=Si(e,jt.defaultZone),e.equals(this.zone))return this;if(e.isValid){let l=this.ts;if(t||i){const s=e.offset(this.ts),o=this.toObject();[l]=so(o,s,e)}return Ri(this,{ts:l,zone:e})}else return je.invalid(Jl(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:i}={}){const l=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:i});return Ri(this,{loc:l})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=wo(e,Hu),{minDaysInFirstWeek:i,startOfWeek:l}=Cu(t,this.loc),s=!Be(t.weekYear)||!Be(t.weekNumber)||!Be(t.weekday),o=!Be(t.ordinal),r=!Be(t.year),a=!Be(t.month)||!Be(t.day),u=r||a,f=t.weekYear||t.weekNumber;if((u||o)&&f)throw new kl("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&o)throw new kl("Can't mix ordinal dates with month/day");let c;s?c=$u({...yo(this.c,i,l),...t},i,l):Be(t.ordinal)?(c={...this.toObject(),...t},Be(t.day)&&(c.day=Math.min(vo(c.year,c.month),c.day))):c=Tu({...rr(this.c),...t});const[d,m]=so(c,this.o,this.zone);return Ri(this,{ts:d,o:m})}plus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e);return Ri(this,qu(this,t))}minus(e){if(!this.isValid)return this;const t=st.fromDurationLike(e).negate();return Ri(this,qu(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;const i={},l=st.normalizeUnit(e);switch(l){case"years":i.month=1;case"quarters":case"months":i.day=1;case"weeks":case"days":i.hour=0;case"hours":i.minute=0;case"minutes":i.second=0;case"seconds":i.millisecond=0;break}if(l==="weeks")if(t){const s=this.loc.getStartOfWeek(),{weekday:o}=this;o<s&&(i.weekNumber=this.weekNumber-1),i.weekday=s}else i.weekday=1;if(l==="quarters"){const s=Math.ceil(this.month/3);i.month=(s-1)*3+1}return this.set(i)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?sn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ur}toLocaleString(e=ko,t={}){return this.isValid?sn.create(this.loc.clone(t),e).formatDateTime(this):ur}toLocaleParts(e={}){return this.isValid?sn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:i=!1,includeOffset:l=!0,extendedZone:s=!1,precision:o="milliseconds"}={}){if(!this.isValid)return null;o=ro(o);const r=e==="extended";let a=dr(this,r,o);return oo.indexOf(o)>=3&&(a+="T"),a+=ju(this,r,t,i,l,s,o),a}toISODate({format:e="extended",precision:t="day"}={}){return this.isValid?dr(this,e==="extended",ro(t)):null}toISOWeekDate(){return qs(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:i=!0,includePrefix:l=!1,extendedZone:s=!1,format:o="extended",precision:r="milliseconds"}={}){return this.isValid?(r=ro(r),(l&&oo.indexOf(r)>=3?"T":"")+ju(this,o==="extended",t,e,i,s,r)):null}toRFC2822(){return qs(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return qs(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?dr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:i=!0}={}){let l="HH:mm:ss.SSS";return(t||e)&&(i&&(l+=" "),t?l+="z":e&&(l+="ZZ")),qs(this,l,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ur}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}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 st.invalid("created by diffing an invalid DateTime");const l={locale:this.locale,numberingSystem:this.numberingSystem,...i},s=jk(t).map(st.normalizeUnit),o=e.valueOf()>this.valueOf(),r=o?this:e,a=o?e:this,u=Vy(r,a,s,l);return o?u.negate():u}diffNow(e="milliseconds",t={}){return this.diff(je.now(),e,t)}until(e){return this.isValid?qt.fromDateTimes(this,e):this}hasSame(e,t,i){if(!this.isValid)return!1;const l=e.valueOf(),s=this.setZone(e.zone,{keepLocalTime:!0});return s.startOf(t,i)<=l&&l<=s.endOf(t,i)}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||je.fromObject({},{zone:this.zone}),i=e.padding?this<t?-e.padding:e.padding:0;let l=["years","months","days","hours","minutes","seconds"],s=e.unit;return Array.isArray(e.unit)&&(l=e.unit,s=void 0),Vu(t,this.plus(i),{...e,numeric:"always",units:l,unit:s})}toRelativeCalendar(e={}){return this.isValid?Vu(e.base||je.fromObject({},{zone:this.zone}),this,{...e,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...e){if(!e.every(je.isDateTime))throw new tn("min requires all arguments be DateTimes");return Ou(e,t=>t.valueOf(),Math.min)}static max(...e){if(!e.every(je.isDateTime))throw new tn("max requires all arguments be DateTimes");return Ou(e,t=>t.valueOf(),Math.max)}static fromFormatExplain(e,t,i={}){const{locale:l=null,numberingSystem:s=null}=i,o=pt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});return J1(o,e,t)}static fromStringExplain(e,t,i={}){return je.fromFormatExplain(e,t,i)}static buildFormatParser(e,t={}){const{locale:i=null,numberingSystem:l=null}=t,s=pt.fromOpts({locale:i,numberingSystem:l,defaultToEN:!0});return new K1(s,e)}static fromFormatParser(e,t,i={}){if(Be(e)||Be(t))throw new tn("fromFormatParser requires an input string and a format parser");const{locale:l=null,numberingSystem:s=null}=i,o=pt.fromOpts({locale:l,numberingSystem:s,defaultToEN:!0});if(!o.equals(t.locale))throw new tn(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${t.locale}`);const{result:r,zone:a,specificOffset:u,invalidReason:f}=t.explainFromTokens(e);return f?je.invalid(f):_l(r,a,i,`format ${t.format}`,e,u)}static get DATE_SHORT(){return ko}static get DATE_MED(){return Qg}static get DATE_MED_WITH_WEEKDAY(){return dk}static get DATE_FULL(){return xg}static get DATE_HUGE(){return e1}static get TIME_SIMPLE(){return t1}static get TIME_WITH_SECONDS(){return n1}static get TIME_WITH_SHORT_OFFSET(){return i1}static get TIME_WITH_LONG_OFFSET(){return l1}static get TIME_24_SIMPLE(){return s1}static get TIME_24_WITH_SECONDS(){return o1}static get TIME_24_WITH_SHORT_OFFSET(){return r1}static get TIME_24_WITH_LONG_OFFSET(){return a1}static get DATETIME_SHORT(){return u1}static get DATETIME_SHORT_WITH_SECONDS(){return f1}static get DATETIME_MED(){return c1}static get DATETIME_MED_WITH_SECONDS(){return d1}static get DATETIME_MED_WITH_WEEKDAY(){return pk}static get DATETIME_FULL(){return p1}static get DATETIME_FULL_WITH_SECONDS(){return m1}static get DATETIME_HUGE(){return h1}static get DATETIME_HUGE_WITH_SECONDS(){return _1}}function zl(n){if(je.isDateTime(n))return n;if(n&&n.valueOf&&Mi(n.valueOf()))return je.fromJSDate(n);if(n&&typeof n=="object")return je.fromObject(n);throw new tn(`Unknown datetime argument: ${n}, of type ${typeof n}`)}const rv=[".jpg",".jpeg",".png",".svg",".gif",".jfif",".webp",".avif"],av=[".mp4",".avi",".mov",".3gp",".wmv"],uv=[".aa",".aac",".m4v",".mp3",".ogg",".oga",".mogg",".amr"],fv=[".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".odp",".odt",".ods",".txt"],Q1=[{level:-4,label:"DEBUG",class:""},{level:0,label:"INFO",class:"label-success"},{level:4,label:"WARN",class:"label-warning"},{level:8,label:"ERROR",class:"label-danger"}];class j{static isObject(e){return e!==null&&typeof e=="object"&&e.constructor===Object}static clone(e){return typeof structuredClone<"u"?structuredClone(e):JSON.parse(JSON.stringify(e))}static zeroValue(e){switch(typeof e){case"string":return"";case"number":return 0;case"boolean":return!1;case"object":return e===null?null:Array.isArray(e)?[]:{};case"undefined":return;default:return null}}static isEmpty(e){return e===""||e===null||typeof e>"u"||Array.isArray(e)&&e.length===0||j.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==null?void 0:e.isContentEditable)}static isFocusable(e){let t=e&&e.tagName?e.tagName.toLowerCase():"";return j.isInput(e)||t==="button"||t==="a"||t==="details"||(e==null?void 0:e.tabIndex)>=0}static hasNonEmptyProps(e){for(let t in e)if(!j.isEmpty(e[t]))return!0;return!1}static toArray(e,t=!1){return Array.isArray(e)?e.slice():(t||!j.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){j.inArray(e,t)||e.push(t)}static findByKey(e,t,i){e=Array.isArray(e)?e:[];for(let l in e)if(e[l][t]==i)return e[l];return null}static groupByKey(e,t){e=Array.isArray(e)?e:[];const i={};for(let l in e)i[e[l][t]]=i[e[l][t]]||[],i[e[l][t]].push(e[l]);return i}static removeByKey(e,t,i){for(let l in e)if(e[l][t]==i){e.splice(l,1);break}}static pushOrReplaceByKey(e,t,i="id"){for(let l=e.length-1;l>=0;l--)if(e[l][i]==t[i]){e[l]=t;return}e.push(t)}static filterDuplicatesByKey(e,t="id"){e=Array.isArray(e)?e:[];const i={};for(const l of e)i[l[t]]=l;return Object.values(i)}static filterRedactedProps(e,t="******"){const i=JSON.parse(JSON.stringify(e||{}));for(let l in i)typeof i[l]=="object"&&i[l]!==null?i[l]=j.filterRedactedProps(i[l],t):i[l]===t&&delete i[l];return i}static getNestedVal(e,t,i=null,l="."){let s=e||{},o=(t||"").split(l);for(const r of o){if(!j.isObject(s)&&!Array.isArray(s)||typeof s[r]>"u")return i;s=s[r]}return s}static setByPath(e,t,i,l="."){if(e===null||typeof e!="object"){console.warn("setByPath: data not an object or array.");return}let s=e,o=t.split(l),r=o.pop();for(const a of o)(!j.isObject(s)&&!Array.isArray(s)||!j.isObject(s[a])&&!Array.isArray(s[a]))&&(s[a]={}),s=s[a];s[r]=i}static deleteByPath(e,t,i="."){let l=e||{},s=(t||"").split(i),o=s.pop();for(const r of s)(!j.isObject(l)&&!Array.isArray(l)||!j.isObject(l[r])&&!Array.isArray(l[r]))&&(l[r]={}),l=l[r];Array.isArray(l)?l.splice(o,1):j.isObject(l)&&delete l[o],s.length>0&&(Array.isArray(l)&&!l.length||j.isObject(l)&&!Object.keys(l).length)&&(Array.isArray(e)&&e.length>0||j.isObject(e)&&Object.keys(e).length>0)&&j.deleteByPath(e,s.join(i),i)}static randomString(e=10){let t="",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let l=0;l<e;l++)t+=i.charAt(Math.floor(Math.random()*i.length));return t}static randomSecret(e=15){if(typeof crypto>"u")return j.randomString(e);const t=new Uint8Array(e);crypto.getRandomValues(t);const i="-_0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";let l="";for(let s=0;s<e;s++)l+=i.charAt(t[s]%i.length);return l}static sentenize(e,t=!0){if(typeof e!="string")return"";if(e=e.trim().split("_").join(" "),e==="")return e;if(e=e[0].toUpperCase()+e.substring(1),t){let i=e[e.length-1];i!=="."&&i!=="?"&&i!=="!"&&(e+=".")}return e}static trimQuotedValue(e){return typeof e=="string"&&(e[0]=='"'||e[0]=="'"||e[0]=="`")&&e[0]==e[e.length-1]?e.slice(1,-1):e}static plainText(e){return e?(new DOMParser().parseFromString(e,"text/html").body.innerText||"").trim():""}static truncate(e,t=150,i=!0){return e=""+e,e.length<=t?e:e.substring(0,t)+(i?"...":"")}static truncateObject(e){const t={};for(let i in e){let l=e[i];typeof l=="string"&&(l=j.truncate(l,150,!0)),t[i]=l}return t}static slugify(e,t="_",i=[".","=","-"]){if(e==="")return"";const l={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 s in l)e=e.replace(l[s],s);return e.replace(new RegExp("["+i.join("")+"]","g")," ").replace(/[^\w\ ]/gi,"").replace(/\s+/g,t)}static escapeRegExp(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}static splitNonEmpty(e,t=","){const i=[],l=(e||"").replaceAll("\\"+t,"{_PB_ESCAPED_}").split(t).map(s=>s.replaceAll("{_PB_ESCAPED_}",t));for(let s of l)s=s.trim(),j.isEmpty(s)||i.push(s);return i}static joinNonEmpty(e,t=", "){e=e||[];const i=[],l=t.length>1?t.trim():t;for(let s of e)s=typeof s=="string"?s.trim():"",j.isEmpty(s)||i.push(s.replaceAll(l,"\\"+l));return i.join(t)}static getInitials(e){if(e=(e||"").split("@")[0].trim(),e.length<=2)return e.toUpperCase();const t=e.split(/[\.\_\-\ ]/);return t.length>=2?(t[0][0]+t[1][0]).toUpperCase():e[0].toUpperCase()}static formattedFileSize(e){const t=e?Math.floor(Math.log(e)/Math.log(1024)):0;return(e/Math.pow(1024,t)).toFixed(2)*1+" "+["B","KB","MB","GB","TB"][t]}static getDateTime(e){if(typeof e=="string"){const t={19:"yyyy-MM-dd HH:mm:ss",23:"yyyy-MM-dd HH:mm:ss.SSS",20:"yyyy-MM-dd HH:mm:ss'Z'",24:"yyyy-MM-dd HH:mm:ss.SSS'Z'"},i=t[e.length]||t[19];return je.fromFormat(e,i,{zone:"UTC"})}return je.fromJSDate(e)}static formatToUTCDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toUTC().toFormat(t)}static formatToLocalDate(e,t="yyyy-MM-dd HH:mm:ss"){return j.getDateTime(e).toLocal().toFormat(t)}static async copyToClipboard(e){var t;if(e=""+e,!(!e.length||!((t=window==null?void 0:window.navigator)!=null&&t.clipboard)))return window.navigator.clipboard.writeText(e).catch(i=>{console.warn("Failed to copy.",i)})}static download(e,t){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("download",t),i.setAttribute("target","_blank"),i.click(),i.remove()}static downloadJson(e,t){t=t.endsWith(".json")?t:t+".json";const i=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),l=window.URL.createObjectURL(i);j.download(l,t)}static getJWTPayload(e){const t=(e||"").split(".")[1]||"";if(t==="")return{};try{const i=decodeURIComponent(atob(t));return JSON.parse(i)||{}}catch(i){console.warn("Failed to parse JWT payload data.",i)}return{}}static hasImageExtension(e){return e=e||"",!!rv.find(t=>e.toLowerCase().endsWith(t))}static hasVideoExtension(e){return e=e||"",!!av.find(t=>e.toLowerCase().endsWith(t))}static hasAudioExtension(e){return e=e||"",!!uv.find(t=>e.toLowerCase().endsWith(t))}static hasDocumentExtension(e){return e=e||"",!!fv.find(t=>e.toLowerCase().endsWith(t))}static getFileType(e){return j.hasImageExtension(e)?"image":j.hasDocumentExtension(e)?"document":j.hasVideoExtension(e)?"video":j.hasAudioExtension(e)?"audio":"file"}static generateThumb(e,t=100,i=100){return new Promise(l=>{let s=new FileReader;s.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),l(a.toDataURL(e.type))},r.src=o.target.result},s.readAsDataURL(e)})}static addValueToFormData(e,t,i){if(!(typeof i>"u"))if(j.isEmpty(i))e.append(t,"");else if(Array.isArray(i))for(const l of i)j.addValueToFormData(e,t,l);else i instanceof File?e.append(t,i):i instanceof Date?e.append(t,i.toISOString()):j.isObject(i)?e.append(t,JSON.stringify(i)):e.append(t,""+i)}static dummyCollectionRecord(e){var a,u,f,c,d,m,h;const t=(e==null?void 0:e.schema)||[],i=(e==null?void 0:e.type)==="auth",l=(e==null?void 0:e.type)==="view",s={id:"RECORD_ID",collectionId:e==null?void 0:e.id,collectionName:e==null?void 0:e.name};i&&(s.username="username123",s.verified=!1,s.emailVisibility=!0,s.email="test@example.com"),(!l||j.extractColumnsFromQuery((a=e==null?void 0:e.options)==null?void 0:a.query).includes("created"))&&(s.created="2022-01-01 01:00:00.123Z"),(!l||j.extractColumnsFromQuery((u=e==null?void 0:e.options)==null?void 0:u.query).includes("updated"))&&(s.updated="2022-01-01 23:59:59.456Z");for(const _ of t){let g=null;_.type==="number"?g=123:_.type==="date"?g="2022-01-01 10:00:00.123Z":_.type==="bool"?g=!0:_.type==="email"?g="test@example.com":_.type==="url"?g="https://example.com":_.type==="json"?g="JSON":_.type==="file"?(g="filename.jpg",((f=_.options)==null?void 0:f.maxSelect)!==1&&(g=[g])):_.type==="select"?(g=(d=(c=_.options)==null?void 0:c.values)==null?void 0:d[0],((m=_.options)==null?void 0:m.maxSelect)!==1&&(g=[g])):_.type==="relation"?(g="RELATION_RECORD_ID",((h=_.options)==null?void 0:h.maxSelect)!==1&&(g=[g])):g="test",s[_.name]=g}return s}static dummyCollectionSchemaData(e){var l,s,o,r;const t=(e==null?void 0:e.schema)||[],i={};for(const a of t){let u=null;if(a.type==="number")u=123;else if(a.type==="date")u="2022-01-01 10:00:00.123Z";else if(a.type==="bool")u=!0;else if(a.type==="email")u="test@example.com";else if(a.type==="url")u="https://example.com";else if(a.type==="json")u="JSON";else{if(a.type==="file")continue;a.type==="select"?(u=(s=(l=a.options)==null?void 0:l.values)==null?void 0:s[0],((o=a.options)==null?void 0:o.maxSelect)!==1&&(u=[u])):a.type==="relation"?(u="RELATION_RECORD_ID",((r=a.options)==null?void 0:r.maxSelect)!==1&&(u=[u])):u="test"}i[a.name]=u}return i}static getCollectionTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"auth":return"ri-group-line";case"view":return"ri-table-line";default:return"ri-folder-2-line"}}static getFieldTypeIcon(e){switch(e==null?void 0:e.toLowerCase()){case"primary":return"ri-key-line";case"text":return"ri-text";case"number":return"ri-hashtag";case"date":return"ri-calendar-line";case"bool":return"ri-toggle-line";case"email":return"ri-mail-line";case"url":return"ri-link";case"editor":return"ri-edit-2-line";case"select":return"ri-list-check";case"json":return"ri-braces-line";case"file":return"ri-image-line";case"relation":return"ri-mind-map";case"user":return"ri-user-line";default:return"ri-star-s-line"}}static getFieldValueType(e){var t;switch(e==null?void 0:e.type){case"bool":return"Boolean";case"number":return"Number";case"file":return"File";case"select":case"relation":return((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)===1?"String":"Array<String>";default:return"String"}}static zeroDefaultStr(e){var t;return(e==null?void 0:e.type)==="number"?"0":(e==null?void 0:e.type)==="bool"?"false":(e==null?void 0:e.type)==="json"?'null, "", [], {}':["select","relation","file"].includes(e==null?void 0:e.type)&&((t=e==null?void 0:e.options)==null?void 0:t.maxSelect)!=1?"[]":'""'}static getApiExampleUrl(e){return(window.location.href.substring(0,window.location.href.indexOf("/_"))||e||"/").replace("//localhost","//127.0.0.1")}static hasCollectionChanges(e,t,i=!1){if(e=e||{},t=t||{},e.id!=t.id)return!0;for(let u in e)if(u!=="schema"&&JSON.stringify(e[u])!==JSON.stringify(t[u]))return!0;const l=Array.isArray(e.schema)?e.schema:[],s=Array.isArray(t.schema)?t.schema:[],o=l.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(s,"id",u.id)),r=s.filter(u=>(u==null?void 0:u.id)&&!j.findByKey(l,"id",u.id)),a=s.filter(u=>{const f=j.isObject(u)&&j.findByKey(l,"id",u.id);if(!f)return!1;for(let c in f)if(JSON.stringify(u[c])!=JSON.stringify(f[c]))return!0;return!1});return!!(r.length||a.length||i&&o.length)}static sortCollections(e=[]){const t=[],i=[],l=[];for(const o of e)o.type==="auth"?t.push(o):o.type==="base"?i.push(o):l.push(o);function s(o,r){return o.name>r.name?1:o.name<r.name?-1:0}return[].concat(t.sort(s),i.sort(s),l.sort(s))}static yieldToMain(){return new Promise(e=>{setTimeout(e,0)})}static defaultFlatpickrOptions(){return{dateFormat:"Y-m-d H:i:S",disableMobile:!0,allowInput:!0,enableTime:!0,time_24hr:!0,locale:{firstDayOfWeek:1}}}static defaultEditorOptions(){const e=["DIV","P","A","EM","B","STRONG","H1","H2","H3","H4","H5","H6","TABLE","TR","TD","TH","TBODY","THEAD","TFOOT","BR","HR","Q","SUP","SUB","DEL","IMG","OL","UL","LI","CODE"];function t(l){let s=l.parentNode;for(;l.firstChild;)s.insertBefore(l.firstChild,l);s.removeChild(l)}function i(l){if(l){for(const s of l.children)i(s);e.includes(l.tagName)?(l.removeAttribute("style"),l.removeAttribute("class")):t(l)}}return{branding:!1,promotion:!1,menubar:!1,min_height:270,height:270,max_height:700,autoresize_bottom_margin:30,convert_unsafe_embeds:!0,skin:"pocketbase",content_style:"body { font-size: 14px }",plugins:["autoresize","autolink","lists","link","image","searchreplace","fullscreen","media","table","code","codesample","directionality"],codesample_global_prismjs:!0,codesample_languages:[{text:"HTML/XML",value:"markup"},{text:"CSS",value:"css"},{text:"SQL",value:"sql"},{text:"JavaScript",value:"javascript"},{text:"Go",value:"go"},{text:"Dart",value:"dart"},{text:"Zig",value:"zig"},{text:"Rust",value:"rust"},{text:"Lua",value:"lua"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"},{text:"Markdown",value:"markdown"},{text:"Swift",value:"swift"},{text:"Kotlin",value:"kotlin"},{text:"Elixir",value:"elixir"},{text:"Scala",value:"scala"},{text:"Julia",value:"julia"},{text:"Haskell",value:"haskell"}],toolbar:"styles | alignleft aligncenter alignright | bold italic forecolor backcolor | bullist numlist | link image_picker table codesample direction | code fullscreen",paste_postprocess:(l,s)=>{i(s.node)},file_picker_types:"image",file_picker_callback:(l,s,o)=>{const r=document.createElement("input");r.setAttribute("type","file"),r.setAttribute("accept","image/*"),r.addEventListener("change",a=>{const u=a.target.files[0],f=new FileReader;f.addEventListener("load",()=>{if(!tinymce)return;const c="blobid"+new Date().getTime(),d=tinymce.activeEditor.editorUpload.blobCache,m=f.result.split(",")[1],h=d.create(c,u,m);d.add(h),l(h.blobUri(),{title:u.name})}),f.readAsDataURL(u)}),r.click()},setup:l=>{l.on("keydown",o=>{(o.ctrlKey||o.metaKey)&&o.code=="KeyS"&&l.formElement&&(o.preventDefault(),o.stopPropagation(),l.formElement.dispatchEvent(new KeyboardEvent("keydown",o)))});const s="tinymce_last_direction";l.on("init",()=>{var r;const o=(r=window==null?void 0:window.localStorage)==null?void 0:r.getItem(s);!l.isDirty()&&l.getContent()==""&&o=="rtl"&&l.execCommand("mceDirectionRTL")}),l.ui.registry.addMenuButton("direction",{icon:"visualchars",fetch:o=>{o([{type:"menuitem",text:"LTR content",icon:"ltr",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"ltr"),l.execCommand("mceDirectionLTR")}},{type:"menuitem",text:"RTL content",icon:"rtl",onAction:()=>{var a;(a=window==null?void 0:window.localStorage)==null||a.setItem(s,"rtl"),l.execCommand("mceDirectionRTL")}}])}}),l.ui.registry.addMenuButton("image_picker",{icon:"image",fetch:o=>{o([{type:"menuitem",text:"From collection",icon:"gallery",onAction:()=>{l.dispatch("collections_file_picker",{})}},{type:"menuitem",text:"Inline",icon:"browse",onAction:()=>{l.execCommand("mceImage")}}])}})}}}static displayValue(e,t,i="N/A"){e=e||{},t=t||[];let l=[];for(const o of t){let r=e[o];typeof r>"u"||(r=j.stringifyValue(r,i),l.push(r))}if(l.length>0)return l.join(", ");const s=["title","name","slug","email","username","nickname","label","heading","message","key","identifier","id"];for(const o of s){let r=j.stringifyValue(e[o],"");if(r)return r}return i}static stringifyValue(e,t="N/A",i=150){if(j.isEmpty(e))return t;if(typeof e=="number")return""+e;if(typeof e=="boolean")return e?"True":"False";if(typeof e=="string")return e=e.indexOf("<")>=0?j.plainText(e):e,j.truncate(e,i)||t;if(Array.isArray(e)&&typeof e[0]!="object")return j.truncate(e.join(","),i);if(typeof e=="object")try{return j.truncate(JSON.stringify(e),i)||t}catch{return t}return e}static extractColumnsFromQuery(e){var o;const t="__GROUP__";e=(e||"").replace(/\([\s\S]+?\)/gm,t).replace(/[\t\r\n]|(?:\s\s)+/g," ");const i=e.match(/select\s+([\s\S]+)\s+from/),l=((o=i==null?void 0:i[1])==null?void 0:o.split(","))||[],s=[];for(let r of l){const a=r.trim().split(" ").pop();a!=""&&a!=t&&s.push(a.replace(/[\'\"\`\[\]\s]/g,""))}return s}static getAllCollectionIdentifiers(e,t=""){if(!e)return[];let i=[t+"id"];if(e.type==="view")for(let s of j.extractColumnsFromQuery(e.options.query))j.pushUnique(i,t+s);else e.type==="auth"?(i.push(t+"username"),i.push(t+"email"),i.push(t+"emailVisibility"),i.push(t+"verified"),i.push(t+"created"),i.push(t+"updated")):(i.push(t+"created"),i.push(t+"updated"));const l=e.schema||[];for(const s of l)j.pushUnique(i,t+s.name);return i}static getCollectionAutocompleteKeys(e,t,i="",l=0){var r,a,u;let s=e.find(f=>f.name==t||f.id==t);if(!s||l>=4)return[];s.schema=s.schema||[];let o=j.getAllCollectionIdentifiers(s,i);for(const f of s.schema){const c=i+f.name;if(f.type=="relation"&&((r=f.options)!=null&&r.collectionId)){const d=j.getCollectionAutocompleteKeys(e,f.options.collectionId,c+".",l+1);d.length&&(o=o.concat(d))}((a=f.options)==null?void 0:a.maxSelect)!=1&&["select","file","relation"].includes(f.type)&&(o.push(c+":each"),o.push(c+":length"))}for(const f of e){f.schema=f.schema||[];for(const c of f.schema)if(c.type=="relation"&&((u=c.options)==null?void 0:u.collectionId)==s.id){const d=i+f.name+"_via_"+c.name,m=j.getCollectionAutocompleteKeys(e,f.id,d+".",l+2);m.length&&(o=o.concat(m))}}return o}static getCollectionJoinAutocompleteKeys(e){const t=[];for(const i of e){const l="@collection."+i.name+".",s=j.getCollectionAutocompleteKeys(e,i.name,l);for(const o of s)t.push(o)}return t}static getRequestAutocompleteKeys(e,t){const i=[];i.push("@request.context"),i.push("@request.method"),i.push("@request.query."),i.push("@request.data."),i.push("@request.headers."),i.push("@request.auth.id"),i.push("@request.auth.collectionId"),i.push("@request.auth.collectionName"),i.push("@request.auth.verified"),i.push("@request.auth.username"),i.push("@request.auth.email"),i.push("@request.auth.emailVisibility"),i.push("@request.auth.created"),i.push("@request.auth.updated");const l=e.filter(s=>s.type==="auth");for(const s of l){const o=j.getCollectionAutocompleteKeys(e,s.id,"@request.auth.");for(const r of o)j.pushUnique(i,r)}if(t){const s=["created","updated"],o=j.getCollectionAutocompleteKeys(e,t,"@request.data.");for(const r of o){i.push(r);const a=r.split(".");a.length===3&&a[2].indexOf(":")===-1&&!s.includes(a[2])&&i.push(r+":isset")}}return i}static parseIndex(e){var a,u,f,c,d;const t={unique:!1,optional:!1,schemaName:"",indexName:"",tableName:"",columns:[],where:""},l=/create\s+(unique\s+)?\s*index\s*(if\s+not\s+exists\s+)?(\S*)\s+on\s+(\S*)\s*\(([\s\S]*)\)(?:\s*where\s+([\s\S]*))?/gmi.exec((e||"").trim());if((l==null?void 0:l.length)!=7)return t;const s=/^[\"\'\`\[\{}]|[\"\'\`\]\}]$/gm;t.unique=((a=l[1])==null?void 0:a.trim().toLowerCase())==="unique",t.optional=!j.isEmpty((u=l[2])==null?void 0:u.trim());const o=(l[3]||"").split(".");o.length==2?(t.schemaName=o[0].replace(s,""),t.indexName=o[1].replace(s,"")):(t.schemaName="",t.indexName=o[0].replace(s,"")),t.tableName=(l[4]||"").replace(s,"");const r=(l[5]||"").replace(/,(?=[^\(]*\))/gmi,"{PB_TEMP}").split(",");for(let m of r){m=m.trim().replaceAll("{PB_TEMP}",",");const _=/^([\s\S]+?)(?:\s+collate\s+([\w]+))?(?:\s+(asc|desc))?$/gmi.exec(m);if((_==null?void 0:_.length)!=4)continue;const g=(c=(f=_[1])==null?void 0:f.trim())==null?void 0:c.replace(s,"");g&&t.columns.push({name:g,collate:_[2]||"",sort:((d=_[3])==null?void 0:d.toUpperCase())||""})}return t.where=l[6]||"",t}static buildIndex(e){let t="CREATE ";e.unique&&(t+="UNIQUE "),t+="INDEX ",e.optional&&(t+="IF NOT EXISTS "),e.schemaName&&(t+=`\`${e.schemaName}\`.`),t+=`\`${e.indexName||"idx_"+j.randomString(7)}\` `,t+=`ON \`${e.tableName}\` (`;const i=e.columns.filter(l=>!!(l!=null&&l.name));return i.length>1&&(t+=`
|
||
`),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`,
|
||
`),i.length>1&&(t+=`
|
||
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Wo=Cn([]);function So(n,e=4e3){return Yo(n,"info",e)}function Pt(n,e=3e3){return Yo(n,"success",e)}function ii(n,e=4500){return Yo(n,"error",e)}function cv(n,e=4500){return Yo(n,"warning",e)}function Yo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{x1(i)},t)};Wo.update(l=>(Ia(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function x1(n){Wo.update(e=>(Ia(e,n),e))}function Ea(){Wo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const hi=Cn({});function Zt(n){hi.set(n||{})}function li(n){hi.update(e=>(j.deleteByPath(e,n),e))}const Aa=Cn({});function xr(n){Aa.set(n||{})}const Rn=Cn([]),Yn=Cn({}),$o=Cn(!1),eb=Cn({});let es;typeof BroadcastChannel<"u"&&(es=new BroadcastChannel("collections"),es.onmessage=()=>{var n;nb((n=Ag(Yn))==null?void 0:n.id)});function tb(){es==null||es.postMessage("reload")}function dv(n){Rn.update(e=>{const t=j.findByKey(e,"id",n);return t?Yn.set(t):e.length&&Yn.set(e[0]),e})}function pv(n){Yn.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),Rn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),La(),tb(),j.sortCollections(e)))}function mv(n){Rn.update(e=>(j.removeByKey(e,"id",n.id),Yn.update(t=>t.id===n.id?e[0]:t),La(),tb(),e))}async function nb(n=null){$o.set(!0);try{let e=await re.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),Rn.set(e);const t=n&&j.findByKey(e,"id",n);t?Yn.set(t):e.length&&Yn.set(e[0]),La()}catch(e){re.error(e)}$o.set(!1)}function La(){eb.update(n=>(Rn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const pr="pb_admin_file_token";jo.prototype.logout=function(n=!0){this.authStore.clear(),n&&nl("/login")};jo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&ii(s),j.isEmpty(l.data)||Zt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),nl("/")};jo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Ag(eb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ya(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class hv extends Jg{save(e,t){super.save(e,t),t&&!t.collectionId&&xr(t)}clear(){super.clear(),xr(null)}}const re=new jo("../",new hv("pb_admin_auth"));re.authStore.model&&!re.authStore.model.collectionId&&xr(re.authStore.model);const _v=n=>({}),Uu=n=>({});function gv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;const h=n[3].default,_=St(h,n,n[2],null),g=n[3].footer,y=St(g,n,n[2],Uu);return{c(){e=b("div"),t=b("main"),_&&_.c(),i=M(),l=b("footer"),y&&y.c(),s=M(),o=b("a"),o.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',r=M(),a=b("span"),a.textContent="|",u=M(),f=b("a"),c=b("span"),c.textContent="PocketBase v0.22.42",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener noreferrer"),p(a,"class","delimiter"),p(c,"class","txt"),p(f,"href","https://github.com/pocketbase/pocketbase/releases"),p(f,"target","_blank"),p(f,"rel","noopener noreferrer"),p(f,"title","Releases"),p(l,"class","page-footer"),p(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(S,T){w(S,e,T),k(e,t),_&&_.m(t,null),k(e,i),k(e,l),y&&y.m(l,null),k(l,s),k(l,o),k(l,r),k(l,a),k(l,u),k(l,f),k(f,c),m=!0},p(S,[T]){_&&_.p&&(!m||T&4)&&Tt(_,h,S,S[2],m?$t(h,S[2],T,null):Ct(S[2]),null),y&&y.p&&(!m||T&4)&&Tt(y,g,S,S[2],m?$t(g,S[2],T,_v):Ct(S[2]),Uu),(!m||T&2&&d!==(d="page-wrapper "+S[1]))&&p(e,"class",d),(!m||T&3)&&x(e,"center-content",S[0])},i(S){m||(E(_,S),E(y,S),m=!0)},o(S){A(_,S),A(y,S),m=!1},d(S){S&&v(e),_&&_.d(S),y&&y.d(S)}}}function bv(n,e,t){let{$$slots:i={},$$scope:l}=e,{center:s=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,s=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,l=r.$$scope)},[s,o,l,i]}class bn extends ge{constructor(e){super(),_e(this,e,bv,gv,me,{center:0,class:1})}}function Wu(n){let e,t,i;return{c(){e=b("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=M(),i=b("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function kv(n){let e,t,i,l=!n[0]&&Wu();const s=n[1].default,o=St(s,n,n[2],null);return{c(){e=b("div"),l&&l.c(),t=M(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),l&&l.m(e,null),k(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?l&&(l.d(1),l=null):l||(l=Wu(),l.c(),l.m(e,t)),o&&o.p&&(!i||a&4)&&Tt(o,s,r,r[2],i?$t(s,r[2],a,null):Ct(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){A(o,r),i=!1},d(r){r&&v(e),l&&l.d(),o&&o.d(r)}}}function yv(n){let e,t;return e=new bn({props:{class:"full-page",center:!0,$$slots:{default:[kv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&5&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function vv(n,e,t){let{$$slots:i={},$$scope:l}=e,{nobranding:s=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,s=o.nobranding),"$$scope"in o&&t(2,l=o.$$scope)},[s,i,l]}class ib extends ge{constructor(e){super(),_e(this,e,vv,yv,me,{nobranding:0})}}function Ko(n){const e=n-1;return e*e*e+1}function cs(n,{delay:e=0,duration:t=400,easing:i=vs}={}){const l=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*l}`}}function Fn(n,{delay:e=0,duration:t=400,easing:i=Ko,x:l=0,y:s=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=iu(l),[m,h]=iu(s);return{delay:e,duration:t,easing:i,css:(_,g)=>`
|
||
transform: ${u} translate(${(1-_)*c}${d}, ${(1-_)*m}${h});
|
||
opacity: ${a-f*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Ko,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),h=parseFloat(s[`margin${f[1]}`]),_=parseFloat(s[`border${f[0]}Width`]),g=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*m}px;margin-${u[1]}: ${y*h}px;border-${u[0]}-width: ${y*_}px;border-${u[1]}-width: ${y*g}px;`}}function Wt(n,{delay:e=0,duration:t=400,easing:i=Ko,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>`
|
||
transform: ${a} scale(${1-u*d});
|
||
opacity: ${r-f*d}
|
||
`}}let ea,qi;const ta="app-tooltip";function Yu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Di(){return qi=qi||document.querySelector("."+ta),qi||(qi=document.createElement("div"),qi.classList.add(ta),document.body.appendChild(qi)),qi}function lb(n,e){let t=Di();if(!t.classList.contains("active")||!(e!=null&&e.text)){na();return}t.textContent=e.text,t.className=ta+" 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,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),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 na(){clearTimeout(ea),Di().classList.remove("active"),Di().activeNode=void 0}function wv(n,e){Di().activeNode=n,clearTimeout(ea),ea=setTimeout(()=>{Di().classList.add("active"),lb(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Yu(e);function i(){wv(n,t)}function l(){na()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Di(),{update(s){var o,r;t=Yu(s),(r=(o=Di())==null?void 0:o.activeNode)!=null&&r.contains(n)&&lb(n,t)},destroy(){var s,o;(o=(s=Di())==null?void 0:s.activeNode)!=null&&o.contains(n)&&na(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Ku(n,e,t){const i=n.slice();return i[12]=e[t],i}const Sv=n=>({}),Ju=n=>({uniqueId:n[4]});function $v(n){let e,t,i=fe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Zu(Ku(n,i,o));const s=o=>A(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ye()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&8){i=fe(o[3]);let a;for(a=0;a<i.length;a+=1){const u=Ku(o,i,a);l[a]?(l[a].p(u,r),E(l[a],1)):(l[a]=Zu(u),l[a].c(),E(l[a],1),l[a].m(e.parentNode,e))}for(ie(),a=i.length;a<l.length;a+=1)s(a);le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)A(l[r]);t=!1},d(o){o&&v(e),ot(l,o)}}}function Tv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon inline-error-icon")},m(a,u){w(a,e,u),k(e,t),s=!0,o||(r=$e(i=Pe.call(null,t,{position:"left",text:n[3].map(To).join(`
|
||
`)})),o=!0)},p(a,u){i&&Mt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(To).join(`
|
||
`)})},i(a){s||(a&&Ke(()=>{s&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Fe(t,Wt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Zu(n){let e,t,i=To(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=Z(i),s=M(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),k(e,t),k(t,l),k(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=To(a[12])+"")&&se(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Fe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Fe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function Cv(n){let e,t,i,l,s,o,r;const a=n[9].default,u=St(a,n,n[8],Ju),f=[Tv,$v],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,h){w(m,e,h),u&&u.m(e,null),k(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[h]){u&&u.p&&(!s||h&256)&&Tt(u,a,m,m[8],s?$t(a,m[8],h,Sv):Ct(m[8]),Ju);let _=i;i=d(m),i===_?c[i].p(m,h):(ie(),A(c[_],1,1,()=>{c[_]=null}),le(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),E(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&x(e,"error",m[3].length)},i(m){s||(E(u,m),E(l),s=!0)},o(m){A(u,m),A(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Gu="Invalid value";function To(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Gu:n||Gu}function Ov(n,e,t){let i;We(n,hi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){li(r)}Kt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(_){Ce.call(this,n,_)}function h(_){te[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,u=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,h]}class ce extends ge{constructor(e){super(),_e(this,e,Ov,Cv,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Mv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&oe(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Dv(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Z("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[1]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&2&&s.value!==c[1]&&oe(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Ev(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&oe(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Iv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return l=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[Mv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[Dv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[Ev,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Create your first admin account in order to continue</h4>",i=M(),V(l.$$.fragment),s=M(),V(o.$$.fragment),r=M(),V(a.$$.fragment),u=M(),f=b("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"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(h,_){w(h,e,_),k(e,t),k(e,i),H(l,e,null),k(e,s),H(o,e,null),k(e,r),H(a,e,null),k(e,u),k(e,f),c=!0,d||(m=K(e,"submit",Ue(n[4])),d=!0)},p(h,[_]){const g={};_&1537&&(g.$$scope={dirty:_,ctx:h}),l.$set(g);const y={};_&1538&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_&1540&&(S.$$scope={dirty:_,ctx:h}),a.$set(S),(!c||_&8)&&x(f,"btn-disabled",h[3]),(!c||_&8)&&x(f,"btn-loading",h[3])},i(h){c||(E(l.$$.fragment,h),E(o.$$.fragment,h),E(a.$$.fragment,h),c=!0)},o(h){A(l.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!1},d(h){h&&v(e),z(l),z(o),z(a),d=!1,m()}}}function Av(n,e,t){const i=lt();let l="",s="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await re.admins.create({email:l,password:s,passwordConfirm:o}),await re.admins.authWithPassword(l,s),i("submit")}catch(d){re.error(d)}t(3,r=!1)}}function u(){l=this.value,t(0,l)}function f(){s=this.value,t(1,s)}function c(){o=this.value,t(2,o)}return[l,s,o,r,a,u,f,c]}class Lv extends ge{constructor(e){super(),_e(this,e,Av,Iv,me,{})}}function Xu(n){let e,t;return e=new ib({props:{$$slots:{default:[Nv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&9&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Nv(n){let e,t;return e=new Lv({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p:Q,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Pv(n){let e,t,i=n[0]&&Xu(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,[s]){l[0]?i?(i.p(l,s),s&1&&E(i,1)):(i=Xu(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ie(),A(i,1,1,()=>{i=null}),le())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function Fv(n,e,t){let i=!1;l();function l(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){re.logout(!1),t(0,i=!0);return}re.authStore.isValid?nl("/collections"):re.logout()}return[i,async()=>{t(0,i=!1),await Qt(),window.location.search=""}]}class Rv extends ge{constructor(e){super(),_e(this,e,Fv,Pv,me,{})}}const Lt=Cn(""),Co=Cn(""),Qi=Cn(!1);function qv(n){let e,t,i,l;return{c(){e=b("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(s,o){w(s,e,o),n[13](e),oe(e,n[7]),i||(l=K(e,"input",n[14]),i=!0)},p(s,o){o&3&&t!==(t=s[0]||s[1])&&p(e,"placeholder",t),o&128&&e.value!==s[7]&&oe(e,s[7])},i:Q,o:Q,d(s){s&&v(e),n[13](null),i=!1,l()}}}function jv(n){let e,t,i,l;function s(a){n[12](a)}var o=n[4];function r(a,u){let f={id:a[8],singleLine:!0,disableRequestKeys:!0,disableCollectionJoinKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(f.value=a[7]),{props:f}}return o&&(e=It(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&16&&o!==(o=a[4])){if(e){ie();const f=e;A(f.$$.fragment,1,0,()=>{z(f,1)}),le()}o?(e=It(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),e.$set(f)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function Qu(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded-sm btn-sm btn-warning")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function xu(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[15]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Fn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Hv(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[jv,qv],m=[];function h(y,S){return y[4]&&!y[5]?0:1}s=h(n),o=m[s]=d[s](n);let _=(n[0].length||n[7].length)&&n[7]!=n[0]&&Qu(),g=(n[0].length||n[7].length)&&xu(n);return{c(){e=b("form"),t=b("label"),i=b("i"),l=M(),o.c(),r=M(),_&&_.c(),a=M(),g&&g.c(),p(i,"class","ri-search-line"),p(t,"for",n[8]),p(t,"class","m-l-10 txt-xl"),p(e,"class","searchbar")},m(y,S){w(y,e,S),k(e,t),k(t,i),k(e,l),m[s].m(e,null),k(e,r),_&&_.m(e,null),k(e,a),g&&g.m(e,null),u=!0,f||(c=[K(e,"click",Tn(n[11])),K(e,"submit",Ue(n[10]))],f=!0)},p(y,[S]){let T=s;s=h(y),s===T?m[s].p(y,S):(ie(),A(m[T],1,1,()=>{m[T]=null}),le(),o=m[s],o?o.p(y,S):(o=m[s]=d[s](y),o.c()),E(o,1),o.m(e,r)),(y[0].length||y[7].length)&&y[7]!=y[0]?_?S&129&&E(_,1):(_=Qu(),_.c(),E(_,1),_.m(e,a)):_&&(ie(),A(_,1,1,()=>{_=null}),le()),y[0].length||y[7].length?g?(g.p(y,S),S&129&&E(g,1)):(g=xu(y),g.c(),E(g,1),g.m(e,null)):g&&(ie(),A(g,1,1,()=>{g=null}),le())},i(y){u||(E(o),E(_),E(g),u=!0)},o(y){A(o),A(_),A(g),u=!1},d(y){y&&v(e),m[s].d(),_&&_.d(),g&&g.d(),f=!1,we(c)}}}function zv(n,e,t){const i=lt(),l="search_"+j.randomString(7);let{value:s=""}=e,{placeholder:o='Search term or filter like created > "2022-01-01"...'}=e,{autocompleteCollection:r=j.initCollection()}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(C=!0){t(7,d=""),C&&(c==null||c.focus()),i("clear")}function h(){t(0,s=d),i("submit",s)}async function _(){u||f||(t(5,f=!0),t(4,u=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CZ6wrvfj.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),t(5,f=!1))}Kt(()=>{_()});function g(C){Ce.call(this,n,C)}function y(C){d=C,t(7,d),t(0,s)}function S(C){te[C?"unshift":"push"](()=>{c=C,t(6,c)})}function T(){d=this.value,t(7,d),t(0,s)}const $=()=>{m(!1),h()};return n.$$set=C=>{"value"in C&&t(0,s=C.value),"placeholder"in C&&t(1,o=C.placeholder),"autocompleteCollection"in C&&t(2,r=C.autocompleteCollection),"extraAutocompleteKeys"in C&&t(3,a=C.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof s=="string"&&t(7,d=s)},[s,o,r,a,u,f,c,d,l,m,h,g,y,S,T,$]}class Ms extends ge{constructor(e){super(),_e(this,e,zv,Hv,me,{value:0,placeholder:1,autocompleteCollection:2,extraAutocompleteKeys:3})}}function Vv(n){let e,t,i,l,s,o;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-refresh-line svelte-1bvelc2"),p(e,"type","button"),p(e,"aria-label","Refresh"),p(e,"class",i="btn btn-transparent btn-circle "+n[1]+" svelte-1bvelc2"),x(e,"refreshing",n[2])},m(r,a){w(r,e,a),k(e,t),s||(o=[$e(l=Pe.call(null,e,n[0])),K(e,"click",n[3])],s=!0)},p(r,[a]){a&2&&i!==(i="btn btn-transparent btn-circle "+r[1]+" svelte-1bvelc2")&&p(e,"class",i),l&&Mt(l.update)&&a&1&&l.update.call(null,r[0]),a&6&&x(e,"refreshing",r[2])},i:Q,o:Q,d(r){r&&v(e),s=!1,we(o)}}}function Bv(n,e,t){const i=lt();let{tooltip:l={text:"Refresh",position:"right"}}=e,{class:s=""}=e,o=null;function r(){i("refresh");const a=l;t(0,l=null),clearTimeout(o),t(2,o=setTimeout(()=>{t(2,o=null),t(0,l=a)},150))}return Kt(()=>()=>clearTimeout(o)),n.$$set=a=>{"tooltip"in a&&t(0,l=a.tooltip),"class"in a&&t(1,s=a.class)},[l,s,o,r]}class Jo extends ge{constructor(e){super(),_e(this,e,Bv,Vv,me,{tooltip:0,class:1})}}function Uv(n){let e,t,i,l,s;const o=n[6].default,r=St(o,n,n[5],null);return{c(){e=b("th"),r&&r.c(),p(e,"tabindex","0"),p(e,"title",n[2]),p(e,"class",t="col-sort "+n[1]),x(e,"col-sort-disabled",n[3]),x(e,"sort-active",n[0]==="-"+n[2]||n[0]==="+"+n[2]),x(e,"sort-desc",n[0]==="-"+n[2]),x(e,"sort-asc",n[0]==="+"+n[2])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"click",n[7]),K(e,"keydown",n[8])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&32)&&Tt(r,o,a,a[5],i?$t(o,a[5],u,null):Ct(a[5]),null),(!i||u&4)&&p(e,"title",a[2]),(!i||u&2&&t!==(t="col-sort "+a[1]))&&p(e,"class",t),(!i||u&10)&&x(e,"col-sort-disabled",a[3]),(!i||u&7)&&x(e,"sort-active",a[0]==="-"+a[2]||a[0]==="+"+a[2]),(!i||u&7)&&x(e,"sort-desc",a[0]==="-"+a[2]),(!i||u&7)&&x(e,"sort-asc",a[0]==="+"+a[2])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,we(s)}}}function Wv(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=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,s=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,l=d.$$scope)},[r,s,o,a,u,l,i,f,c]}class Sn extends ge{constructor(e){super(),_e(this,e,Wv,Uv,me,{class:1,name:2,sort:0,disable:3})}}const Yv=n=>({}),ef=n=>({}),Kv=n=>({}),tf=n=>({});function Jv(n){let e,t,i,l,s,o,r,a;const u=n[11].before,f=St(u,n,n[10],tf),c=n[11].default,d=St(c,n,n[10],null),m=n[11].after,h=St(m,n,n[10],ef);return{c(){e=b("div"),f&&f.c(),t=M(),i=b("div"),d&&d.c(),s=M(),h&&h.c(),p(i,"class",l="scroller "+n[0]+" "+n[3]+" svelte-3a0gfs"),p(e,"class","scroller-wrapper svelte-3a0gfs")},m(_,g){w(_,e,g),f&&f.m(e,null),k(e,t),k(e,i),d&&d.m(i,null),n[12](i),k(e,s),h&&h.m(e,null),o=!0,r||(a=[K(window,"resize",n[1]),K(i,"scroll",n[1])],r=!0)},p(_,[g]){f&&f.p&&(!o||g&1024)&&Tt(f,u,_,_[10],o?$t(u,_[10],g,Kv):Ct(_[10]),tf),d&&d.p&&(!o||g&1024)&&Tt(d,c,_,_[10],o?$t(c,_[10],g,null):Ct(_[10]),null),(!o||g&9&&l!==(l="scroller "+_[0]+" "+_[3]+" svelte-3a0gfs"))&&p(i,"class",l),h&&h.p&&(!o||g&1024)&&Tt(h,m,_,_[10],o?$t(m,_[10],g,Yv):Ct(_[10]),ef)},i(_){o||(E(f,_),E(d,_),E(h,_),o=!0)},o(_){A(f,_),A(d,_),A(h,_),o=!1},d(_){_&&v(e),f&&f.d(_),d&&d.d(_),n[12](null),h&&h.d(_),r=!1,we(a)}}}function Zv(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{class:o=""}=e,{vThreshold:r=0}=e,{hThreshold:a=0}=e,{dispatchOnNoScroll:u=!0}=e,f=null,c="",d=null,m,h,_,g,y;function S(){f&&t(2,f.scrollTop=0,f)}function T(){f&&t(2,f.scrollLeft=0,f)}function $(){f&&(t(3,c=""),_=f.clientWidth+2,g=f.clientHeight+2,m=f.scrollWidth-_,h=f.scrollHeight-g,h>0?(t(3,c+=" v-scroll"),r>=g&&t(4,r=0),f.scrollTop-r<=0&&(t(3,c+=" v-scroll-start"),s("vScrollStart")),f.scrollTop+r>=h&&(t(3,c+=" v-scroll-end"),s("vScrollEnd"))):u&&s("vScrollEnd"),m>0?(t(3,c+=" h-scroll"),a>=_&&t(5,a=0),f.scrollLeft-a<=0&&(t(3,c+=" h-scroll-start"),s("hScrollStart")),f.scrollLeft+a>=m&&(t(3,c+=" h-scroll-end"),s("hScrollEnd"))):u&&s("hScrollEnd"))}function C(){d||(d=setTimeout(()=>{$(),d=null},150))}Kt(()=>(C(),y=new MutationObserver(C),y.observe(f,{attributeFilter:["width","height"],childList:!0,subtree:!0}),()=>{y==null||y.disconnect(),clearTimeout(d)}));function O(D){te[D?"unshift":"push"](()=>{f=D,t(2,f)})}return n.$$set=D=>{"class"in D&&t(0,o=D.class),"vThreshold"in D&&t(4,r=D.vThreshold),"hThreshold"in D&&t(5,a=D.hThreshold),"dispatchOnNoScroll"in D&&t(6,u=D.dispatchOnNoScroll),"$$scope"in D&&t(10,l=D.$$scope)},[o,C,f,c,r,a,u,S,T,$,l,i,O]}class Zo extends ge{constructor(e){super(),_e(this,e,Zv,Jv,me,{class:0,vThreshold:4,hThreshold:5,dispatchOnNoScroll:6,resetVerticalScroll:7,resetHorizontalScroll:8,refresh:9,throttleRefresh:1})}get resetVerticalScroll(){return this.$$.ctx[7]}get resetHorizontalScroll(){return this.$$.ctx[8]}get refresh(){return this.$$.ctx[9]}get throttleRefresh(){return this.$$.ctx[1]}}function Gv(n){let e,t,i=(n[1]||"UNKN")+"",l,s,o,r,a;return{c(){e=b("div"),t=b("span"),l=Z(i),s=Z(" ("),o=Z(n[0]),r=Z(")"),p(t,"class","txt"),p(e,"class",a="label log-level-label level-"+n[0]+" svelte-ha6hme")},m(u,f){w(u,e,f),k(e,t),k(t,l),k(t,s),k(t,o),k(t,r)},p(u,[f]){f&2&&i!==(i=(u[1]||"UNKN")+"")&&se(l,i),f&1&&se(o,u[0]),f&1&&a!==(a="label log-level-label level-"+u[0]+" svelte-ha6hme")&&p(e,"class",a)},i:Q,o:Q,d(u){u&&v(e)}}}function Xv(n,e,t){let i,{level:l}=e;return n.$$set=s=>{"level"in s&&t(0,l=s.level)},n.$$.update=()=>{var s;n.$$.dirty&1&&t(1,i=(s=Q1.find(o=>o.level==l))==null?void 0:s.label)},[l,i]}class sb extends ge{constructor(e){super(),_e(this,e,Xv,Gv,me,{level:0})}}function Qv(n){let e,t=n[0].replace("Z"," UTC")+"",i,l,s;return{c(){e=b("span"),i=Z(t),p(e,"class","txt-nowrap")},m(o,r){w(o,e,r),k(e,i),l||(s=$e(Pe.call(null,e,n[1])),l=!0)},p(o,[r]){r&1&&t!==(t=o[0].replace("Z"," UTC")+"")&&se(i,t)},i:Q,o:Q,d(o){o&&v(e),l=!1,s()}}}function xv(n,e,t){let{date:i}=e;const l={get text(){return j.formatToLocalDate(i,"yyyy-MM-dd HH:mm:ss.SSS")+" Local"}};return n.$$set=s=>{"date"in s&&t(0,i=s.date)},[i,l]}class ob extends ge{constructor(e){super(),_e(this,e,xv,Qv,me,{date:0})}}function nf(n,e,t){var o;const i=n.slice();i[31]=e[t];const l=((o=i[31].data)==null?void 0:o.type)=="request";i[32]=l;const s=c2(i[31]);return i[33]=s,i}function lf(n,e,t){const i=n.slice();return i[36]=e[t],i}function e2(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[8],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[18]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&256&&(t.checked=a[8])},d(a){a&&v(e),o=!1,r()}}}function t2(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function n2(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-bookmark-line"></i> <span class="txt">level</span>',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function i2(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-file-list-2-line"></i> <span class="txt">message</span>',p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function l2(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("date")} svelte-91v05h"></i> <span class="txt">created</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function sf(n){let e;function t(s,o){return s[7]?o2:s2}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function s2(n){var r;let e,t,i,l,s,o=((r=n[0])==null?void 0:r.length)&&of(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No logs found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=of(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function o2(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td> '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function of(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function rf(n){let e,t=fe(n[33]),i=[];for(let l=0;l<t.length;l+=1)i[l]=af(lf(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","flex flex-wrap flex-gap-10 m-t-10")},m(l,s){w(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s[0]&8){t=fe(l[33]);let o;for(o=0;o<t.length;o+=1){const r=lf(l,t,o);i[o]?i[o].p(r,s):(i[o]=af(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&v(e),ot(i,l)}}}function r2(n){let e=n[36].key+"",t,i,l=j.stringifyValue(n[31].data[n[36].key],"-",80)+"",s;return{c(){t=Z(e),i=Z(": "),s=Z(l)},m(o,r){w(o,t,r),w(o,i,r),w(o,s,r)},p(o,r){r[0]&8&&e!==(e=o[36].key+"")&&se(t,e),r[0]&8&&l!==(l=j.stringifyValue(o[31].data[o[36].key],"-",80)+"")&&se(s,l)},d(o){o&&(v(t),v(i),v(s))}}}function a2(n){let e=n[36].key+"",t,i,l=n[31].data[n[36].key]+"",s,o;return{c(){t=Z(e),i=Z(": "),s=Z(l),o=Z("ms")},m(r,a){w(r,t,a),w(r,i,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&8&&e!==(e=r[36].key+"")&&se(t,e),a[0]&8&&l!==(l=r[31].data[r[36].key]+"")&&se(s,l)},d(r){r&&(v(t),v(i),v(s),v(o))}}}function af(n){let e,t,i;function l(r,a){return r[32]&&r[36].key=="execTime"?a2:r2}let s=l(n),o=s(n);return{c(){e=b("span"),o.c(),t=M(),p(e,"class",i="label label-sm "+(n[36].label||"")+" svelte-91v05h")},m(r,a){w(r,e,a),o.m(e,null),k(e,t)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,t))),a[0]&8&&i!==(i="label label-sm "+(r[36].label||"")+" svelte-91v05h")&&p(e,"class",i)},d(r){r&&v(e),o.d()}}}function uf(n,e){let t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S=e[31].message+"",T,$,C,O,D,I,L,R,F,N,P;function q(){return e[22](e[31])}m=new sb({props:{level:e[31].level}});let U=e[33].length&&rf(e);D=new ob({props:{date:e[31].created}});function Y(){return e[23](e[31])}function J(...B){return e[24](e[31],...B)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("div"),s=b("input"),a=M(),u=b("label"),c=M(),d=b("td"),V(m.$$.fragment),h=M(),_=b("td"),g=b("div"),y=b("span"),T=Z(S),$=M(),U&&U.c(),C=M(),O=b("td"),V(D.$$.fragment),I=M(),L=b("td"),L.innerHTML='<i class="ri-arrow-right-line"></i>',R=M(),p(s,"type","checkbox"),p(s,"id",o="checkbox_"+e[31].id),s.checked=r=e[4][e[31].id],p(u,"for",f="checkbox_"+e[31].id),p(l,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-level min-width svelte-91v05h"),p(y,"class","txt-ellipsis"),p(g,"class","flex flex-gap-10"),p(_,"class","col-type-text col-field-message svelte-91v05h"),p(O,"class","col-type-date col-field-created"),p(L,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(B,W){w(B,t,W),k(t,i),k(i,l),k(l,s),k(l,a),k(l,u),k(t,c),k(t,d),H(m,d,null),k(t,h),k(t,_),k(_,g),k(g,y),k(y,T),k(_,$),U&&U.m(_,null),k(t,C),k(t,O),H(D,O,null),k(t,I),k(t,L),k(t,R),F=!0,N||(P=[K(s,"change",q),K(l,"click",Tn(e[17])),K(t,"click",Y),K(t,"keydown",J)],N=!0)},p(B,W){e=B,(!F||W[0]&8&&o!==(o="checkbox_"+e[31].id))&&p(s,"id",o),(!F||W[0]&24&&r!==(r=e[4][e[31].id]))&&(s.checked=r),(!F||W[0]&8&&f!==(f="checkbox_"+e[31].id))&&p(u,"for",f);const pe={};W[0]&8&&(pe.level=e[31].level),m.$set(pe),(!F||W[0]&8)&&S!==(S=e[31].message+"")&&se(T,S),e[33].length?U?U.p(e,W):(U=rf(e),U.c(),U.m(_,null)):U&&(U.d(1),U=null);const ee={};W[0]&8&&(ee.date=e[31].created),D.$set(ee)},i(B){F||(E(m.$$.fragment,B),E(D.$$.fragment,B),F=!0)},o(B){A(m.$$.fragment,B),A(D.$$.fragment,B),F=!1},d(B){B&&v(t),z(m),U&&U.d(),z(D),N=!1,we(P)}}}function u2(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S=[],T=new Map,$;function C(J,B){return J[7]?t2:e2}let O=C(n),D=O(n);function I(J){n[19](J)}let L={disable:!0,class:"col-field-level min-width",name:"level",$$slots:{default:[n2]},$$scope:{ctx:n}};n[1]!==void 0&&(L.sort=n[1]),o=new Sn({props:L}),te.push(()=>be(o,"sort",I));function R(J){n[20](J)}let F={disable:!0,class:"col-type-text col-field-message",name:"data",$$slots:{default:[i2]},$$scope:{ctx:n}};n[1]!==void 0&&(F.sort=n[1]),u=new Sn({props:F}),te.push(()=>be(u,"sort",R));function N(J){n[21](J)}let P={disable:!0,class:"col-type-date col-field-created",name:"created",$$slots:{default:[l2]},$$scope:{ctx:n}};n[1]!==void 0&&(P.sort=n[1]),d=new Sn({props:P}),te.push(()=>be(d,"sort",N));let q=fe(n[3]);const U=J=>J[31].id;for(let J=0;J<q.length;J+=1){let B=nf(n,q,J),W=U(B);T.set(W,S[J]=uf(W,B))}let Y=null;return q.length||(Y=sf(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),l=b("th"),D.c(),s=M(),V(o.$$.fragment),a=M(),V(u.$$.fragment),c=M(),V(d.$$.fragment),h=M(),_=b("th"),g=M(),y=b("tbody");for(let J=0;J<S.length;J+=1)S[J].c();Y&&Y.c(),p(l,"class","bulk-select-col min-width"),p(_,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[7])},m(J,B){w(J,e,B),k(e,t),k(t,i),k(i,l),D.m(l,null),k(i,s),H(o,i,null),k(i,a),H(u,i,null),k(i,c),H(d,i,null),k(i,h),k(i,_),k(e,g),k(e,y);for(let W=0;W<S.length;W+=1)S[W]&&S[W].m(y,null);Y&&Y.m(y,null),$=!0},p(J,B){O===(O=C(J))&&D?D.p(J,B):(D.d(1),D=O(J),D&&(D.c(),D.m(l,null)));const W={};B[1]&256&&(W.$$scope={dirty:B,ctx:J}),!r&&B[0]&2&&(r=!0,W.sort=J[1],ke(()=>r=!1)),o.$set(W);const pe={};B[1]&256&&(pe.$$scope={dirty:B,ctx:J}),!f&&B[0]&2&&(f=!0,pe.sort=J[1],ke(()=>f=!1)),u.$set(pe);const ee={};B[1]&256&&(ee.$$scope={dirty:B,ctx:J}),!m&&B[0]&2&&(m=!0,ee.sort=J[1],ke(()=>m=!1)),d.$set(ee),B[0]&9369&&(q=fe(J[3]),ie(),S=at(S,B,U,1,J,q,T,y,At,uf,null,nf),le(),!q.length&&Y?Y.p(J,B):q.length?Y&&(Y.d(1),Y=null):(Y=sf(J),Y.c(),Y.m(y,null))),(!$||B[0]&128)&&x(e,"table-loading",J[7])},i(J){if(!$){E(o.$$.fragment,J),E(u.$$.fragment,J),E(d.$$.fragment,J);for(let B=0;B<q.length;B+=1)E(S[B]);$=!0}},o(J){A(o.$$.fragment,J),A(u.$$.fragment,J),A(d.$$.fragment,J);for(let B=0;B<S.length;B+=1)A(S[B]);$=!1},d(J){J&&v(e),D.d(),z(o),z(u),z(d);for(let B=0;B<S.length;B+=1)S[B].d();Y&&Y.d()}}}function ff(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<span class="txt">Load more</span>',p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),x(t,"btn-loading",n[7]),x(t,"btn-disabled",n[7]),p(e,"class","block txt-center m-t-sm")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",n[26]),i=!0)},p(s,o){o[0]&128&&x(t,"btn-loading",s[7]),o[0]&128&&x(t,"btn-disabled",s[7])},d(s){s&&v(e),i=!1,l()}}}function cf(n){let e,t,i,l,s,o,r=n[5]===1?"log":"logs",a,u,f,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=Z("Selected "),l=b("strong"),s=Z(n[5]),o=M(),a=Z(r),u=M(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='<span class="txt">Download as JSON</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm"),p(e,"class","bulkbar svelte-91v05h")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,u),k(e,f),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[K(f,"click",n[27]),K(h,"click",n[14])],y=!0)},p(T,$){(!g||$[0]&32)&&se(s,T[5]),(!g||$[0]&32)&&r!==(r=T[5]===1?"log":"logs")&&se(a,r)},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,we(S)}}}function f2(n){let e,t,i,l,s;e=new Zo({props:{class:"table-wrapper",$$slots:{default:[u2]},$$scope:{ctx:n}}});let o=n[3].length&&n[9]&&ff(n),r=n[5]&&cf(n);return{c(){V(e.$$.fragment),t=M(),o&&o.c(),i=M(),r&&r.c(),l=ye()},m(a,u){H(e,a,u),w(a,t,u),o&&o.m(a,u),w(a,i,u),r&&r.m(a,u),w(a,l,u),s=!0},p(a,u){const f={};u[0]&411|u[1]&256&&(f.$$scope={dirty:u,ctx:a}),e.$set(f),a[3].length&&a[9]?o?o.p(a,u):(o=ff(a),o.c(),o.m(i.parentNode,i)):o&&(o.d(1),o=null),a[5]?r?(r.p(a,u),u[0]&32&&E(r,1)):(r=cf(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){s||(E(e.$$.fragment,a),E(r),s=!0)},o(a){A(e.$$.fragment,a),A(r),s=!1},d(a){a&&(v(t),v(i),v(l)),z(e,a),o&&o.d(a),r&&r.d(a)}}}const df=50,mr=/[-:\. ]/gi;function c2(n){let e=[];if(!n.data)return e;if(n.data.type=="request"){const t=["status","execTime","auth","userIp"];for(let i of t)typeof n.data[i]<"u"&&e.push({key:i});n.data.referer&&!n.data.referer.includes(window.location.host)&&e.push({key:"referer"})}else{const t=Object.keys(n.data);for(const i of t)i!="error"&&i!="details"&&e.length<6&&e.push({key:i})}return n.data.error&&e.push({key:"error",label:"label-danger"}),n.data.details&&e.push({key:"details",label:"label-warning"}),e}function d2(n,e,t){let i,l,s;const o=lt();let{filter:r=""}=e,{presets:a=""}=e,{sort:u="-rowid"}=e,f=[],c=1,d=0,m=!1,h=0,_={};async function g(B=1,W=!0){t(7,m=!0);const pe=[a,j.normalizeLogsFilter(r)].filter(Boolean).join("&&");return re.logs.getList(B,df,{sort:u,skipTotal:1,filter:pe}).then(async ee=>{var Oe;B<=1&&y();const ue=j.toArray(ee.items);if(t(7,m=!1),t(6,c=ee.page),t(16,d=((Oe=ee.items)==null?void 0:Oe.length)||0),o("load",f.concat(ue)),W){const He=++h;for(;ue.length&&h==He;){const Je=ue.splice(0,10);for(let xe of Je)j.pushOrReplaceByKey(f,xe);t(3,f),await j.yieldToMain()}}else{for(let He of ue)j.pushOrReplaceByKey(f,He);t(3,f)}}).catch(ee=>{ee!=null&&ee.isAbort||(t(7,m=!1),console.warn(ee),y(),re.error(ee,!pe||(ee==null?void 0:ee.status)!=400))})}function y(){t(3,f=[]),t(4,_={}),t(6,c=1),t(16,d=0)}function S(){s?T():$()}function T(){t(4,_={})}function $(){for(const B of f)t(4,_[B.id]=B,_);t(4,_)}function C(B){_[B.id]?delete _[B.id]:t(4,_[B.id]=B,_),t(4,_)}function O(){const B=Object.values(_).sort((ee,ue)=>ee.created<ue.created?1:ee.created>ue.created?-1:0);if(!B.length)return;if(B.length==1)return j.downloadJson(B[0],"log_"+B[0].created.replaceAll(mr,"")+".json");const W=B[0].created.replaceAll(mr,""),pe=B[B.length-1].created.replaceAll(mr,"");return j.downloadJson(B,`${B.length}_logs_${pe}_to_${W}.json`)}function D(B){Ce.call(this,n,B)}const I=()=>S();function L(B){u=B,t(1,u)}function R(B){u=B,t(1,u)}function F(B){u=B,t(1,u)}const N=B=>C(B),P=B=>o("select",B),q=(B,W)=>{W.code==="Enter"&&(W.preventDefault(),o("select",B))},U=()=>t(0,r=""),Y=()=>g(c+1),J=()=>T();return n.$$set=B=>{"filter"in B&&t(0,r=B.filter),"presets"in B&&t(15,a=B.presets),"sort"in B&&t(1,u=B.sort)},n.$$.update=()=>{n.$$.dirty[0]&32771&&(typeof u<"u"||typeof r<"u"||typeof a<"u")&&(y(),g(1)),n.$$.dirty[0]&65536&&t(9,i=d>=df),n.$$.dirty[0]&16&&t(5,l=Object.keys(_).length),n.$$.dirty[0]&40&&t(8,s=f.length&&l===f.length)},[r,u,g,f,_,l,c,m,s,i,o,S,T,C,O,a,d,D,I,L,R,F,N,P,q,U,Y,J]}class p2 extends ge{constructor(e){super(),_e(this,e,d2,f2,me,{filter:0,presets:15,sort:1,load:2},null,[-1,-1])}get load(){return this.$$.ctx[2]}}/*!
|
||
* @kurkle/color v0.3.4
|
||
* https://github.com/kurkle/color#readme
|
||
* (c) 2024 Jukka Kurkela
|
||
* Released under the MIT License
|
||
*/function Ds(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Gl(n){return $i(Ds(n*2.55),0,255)}function Ei(n){return $i(Ds(n*255),0,255)}function ci(n){return $i(Ds(n/2.55)/100,0,1)}function pf(n){return $i(Ds(n*100),0,100)}const En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ia=[..."0123456789ABCDEF"],m2=n=>ia[n&15],h2=n=>ia[(n&240)>>4]+ia[n&15],js=n=>(n&240)>>4===(n&15),_2=n=>js(n.r)&&js(n.g)&&js(n.b)&&js(n.a);function g2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const b2=(n,e)=>n<255?e(n):"";function k2(n){var e=_2(n)?m2:h2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+b2(n.a,e):void 0}const y2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function rb(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function v2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function w2(n,e,t){const i=rb(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function S2(n,e,t,i,l){return n===l?(e-t)/i+(e<t?6:0):e===l?(t-n)/i+2:(n-e)/i+4}function Na(n){const t=n.r/255,i=n.g/255,l=n.b/255,s=Math.max(t,i,l),o=Math.min(t,i,l),r=(s+o)/2;let a,u,f;return s!==o&&(f=s-o,u=r>.5?f/(2-s-o):f/(s+o),a=S2(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Pa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ei)}function Fa(n,e,t){return Pa(rb,n,e,t)}function $2(n,e,t){return Pa(w2,n,e,t)}function T2(n,e,t){return Pa(v2,n,e,t)}function ab(n){return(n%360+360)%360}function C2(n){const e=y2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Gl(+e[5]):Ei(+e[5]));const l=ab(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=$2(l,s,o):e[1]==="hsv"?i=T2(l,s,o):i=Fa(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function O2(n,e){var t=Na(n);t[0]=ab(t[0]+e),t=Fa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function M2(n){if(!n)return;const e=Na(n),t=e[0],i=pf(e[1]),l=pf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${ci(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const mf={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"},hf={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 D2(){const n={},e=Object.keys(hf),t=Object.keys(mf);let i,l,s,o,r;for(i=0;i<e.length;i++){for(o=r=e[i],l=0;l<t.length;l++)s=t[l],r=r.replace(s,mf[s]);s=parseInt(hf[o],16),n[r]=[s>>16&255,s>>8&255,s&255]}return n}let Hs;function E2(n){Hs||(Hs=D2(),Hs.transparent=[0,0,0,0]);const e=Hs[n.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:e.length===4?e[3]:255}}const I2=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function A2(n){const e=I2.exec(n);let t=255,i,l,s;if(e){if(e[7]!==i){const o=+e[7];t=e[8]?Gl(o):$i(o*255,0,255)}return i=+e[1],l=+e[3],s=+e[5],i=255&(e[2]?Gl(i):$i(i,0,255)),l=255&(e[4]?Gl(l):$i(l,0,255)),s=255&(e[6]?Gl(s):$i(s,0,255)),{r:i,g:l,b:s,a:t}}}function L2(n){return n&&(n.a<255?`rgba(${n.r}, ${n.g}, ${n.b}, ${ci(n.a)})`:`rgb(${n.r}, ${n.g}, ${n.b})`)}const hr=n=>n<=.0031308?n*12.92:Math.pow(n,1/2.4)*1.055-.055,gl=n=>n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4);function N2(n,e,t){const i=gl(ci(n.r)),l=gl(ci(n.g)),s=gl(ci(n.b));return{r:Ei(hr(i+t*(gl(ci(e.r))-i))),g:Ei(hr(l+t*(gl(ci(e.g))-l))),b:Ei(hr(s+t*(gl(ci(e.b))-s))),a:n.a+t*(e.a-n.a)}}function zs(n,e,t){if(n){let i=Na(n);i[e]=Math.max(0,Math.min(i[e]+i[e]*t,e===0?360:1)),i=Fa(i),n.r=i[0],n.g=i[1],n.b=i[2]}}function ub(n,e){return n&&Object.assign(e||{},n)}function _f(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=Ei(n[3]))):(e=ub(n,{r:0,g:0,b:0,a:1}),e.a=Ei(e.a)),e}function P2(n){return n.charAt(0)==="r"?A2(n):C2(n)}class ds{constructor(e){if(e instanceof ds)return e;const t=typeof e;let i;t==="object"?i=_f(e):t==="string"&&(i=g2(e)||E2(e)||P2(e)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var e=ub(this._rgb);return e&&(e.a=ci(e.a)),e}set rgb(e){this._rgb=_f(e)}rgbString(){return this._valid?L2(this._rgb):void 0}hexString(){return this._valid?k2(this._rgb):void 0}hslString(){return this._valid?M2(this._rgb):void 0}mix(e,t){if(e){const i=this.rgb,l=e.rgb;let s;const o=t===s?.5:t,r=2*o-1,a=i.a-l.a,u=((r*a===-1?r:(r+a)/(1+r*a))+1)/2;s=1-u,i.r=255&u*i.r+s*l.r+.5,i.g=255&u*i.g+s*l.g+.5,i.b=255&u*i.b+s*l.b+.5,i.a=o*i.a+(1-o)*l.a,this.rgb=i}return this}interpolate(e,t){return e&&(this._rgb=N2(this._rgb,e._rgb,t)),this}clone(){return new ds(this.rgb)}alpha(e){return this._rgb.a=Ei(e),this}clearer(e){const t=this._rgb;return t.a*=1-e,this}greyscale(){const e=this._rgb,t=Ds(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 zs(this._rgb,2,e),this}darken(e){return zs(this._rgb,2,-e),this}saturate(e){return zs(this._rgb,1,e),this}desaturate(e){return zs(this._rgb,1,-e),this}rotate(e){return O2(this._rgb,e),this}}/*!
|
||
* Chart.js v4.5.1
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/function ai(){}const F2=(()=>{let n=0;return()=>n++})();function Et(n){return n==null}function Xt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function rn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Zn(n,e){return rn(n)?n:e}function wt(n,e){return typeof n>"u"?e:n}const R2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Ht(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ht(n,e,t,i){let l,s,o;if(Xt(n))for(s=n.length,l=0;l<s;l++)e.call(t,n[l],l);else if(nt(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function Oo(n,e){let t,i,l,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(l=n[t],s=e[t],l.datasetIndex!==s.datasetIndex||l.index!==s.index)return!1;return!0}function Mo(n){if(Xt(n))return n.map(Mo);if(nt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=Mo(n[t[l]]);return e}return n}function fb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function q2(n,e,t,i){if(!fb(n))return;const l=e[n],s=t[n];nt(l)&&nt(s)?ps(l,s,i):e[n]=Mo(s)}function ps(n,e,t){const i=Xt(e)?e:[e],l=i.length;if(!nt(n))return n;t=t||{};const s=t.merger||q2;let o;for(let r=0;r<l;++r){if(o=i[r],!nt(o))continue;const a=Object.keys(o);for(let u=0,f=a.length;u<f;++u)s(a[u],n,o,t)}return n}function ts(n,e){return ps(n,e,{merger:j2})}function j2(n,e,t){if(!fb(n))return;const i=e[n],l=t[n];nt(i)&&nt(l)?ts(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Mo(l))}const gf={"":n=>n,x:n=>n.x,y:n=>n.y};function H2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function z2(n){const e=H2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Do(n,e){return(gf[e]||(gf[e]=z2(e)))(n)}function Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Eo=n=>typeof n<"u",Ii=n=>typeof n=="function",bf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function V2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const on=Math.PI,ti=2*on,B2=ti+on,Io=Number.POSITIVE_INFINITY,U2=on/180,Vn=on/2,ji=on/4,kf=on*2/3,cb=Math.log10,Dl=Math.sign;function ns(n,e,t){return Math.abs(n-e)<t}function yf(n){const e=Math.round(n);n=ns(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(cb(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function W2(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((l,s)=>l-s).pop(),e}function Y2(n){return typeof n=="symbol"||typeof n=="object"&&n!==null&&!(Symbol.toPrimitive in n||"toString"in n||"valueOf"in n)}function ms(n){return!Y2(n)&&!isNaN(parseFloat(n))&&isFinite(n)}function K2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function J2(n,e,t){let i,l,s;for(i=0,l=n.length;i<l;i++)s=n[i][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Ki(n){return n*(on/180)}function Z2(n){return n*(180/on)}function vf(n){if(!rn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function G2(n,e){const t=e.x-n.x,i=e.y-n.y,l=Math.sqrt(t*t+i*i);let s=Math.atan2(i,t);return s<-.5*on&&(s+=ti),{angle:s,distance:l}}function la(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function X2(n,e){return(n-e+B2)%ti-on}function Qn(n){return(n%ti+ti)%ti}function db(n,e,t,i){const l=Qn(n),s=Qn(e),o=Qn(t),r=Qn(s-l),a=Qn(o-l),u=Qn(l-s),f=Qn(l-o);return l===s||l===o||i&&s===o||r>a&&u<f}function Bn(n,e,t){return Math.max(e,Math.min(t,n))}function Q2(n){return Bn(n,-32768,32767)}function pb(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function qa(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Ji=(n,e,t,i)=>qa(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),x2=(n,e,t)=>qa(n,t,i=>n[i][e]>=t);function ew(n,e,t){let i=0,l=n.length;for(;i<l&&n[i]<e;)i++;for(;l>i&&n[l-1]>t;)l--;return i>0||l<n.length?n.slice(i,l):n}const mb=["push","pop","shift","splice","unshift"];function tw(n,e){if(n._chartjs){n._chartjs.listeners.push(e);return}Object.defineProperty(n,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[e]}}),mb.forEach(t=>{const i="_onData"+Ra(t),l=n[t];Object.defineProperty(n,t,{configurable:!0,enumerable:!1,value(...s){const o=l.apply(this,s);return n._chartjs.listeners.forEach(r=>{typeof r[i]=="function"&&r[i](...s)}),o}})})}function wf(n,e){const t=n._chartjs;if(!t)return;const i=t.listeners,l=i.indexOf(e);l!==-1&&i.splice(l,1),!(i.length>0)&&(mb.forEach(s=>{delete n[s]}),delete n._chartjs)}function nw(n){const e=new Set(n);return e.size===n.length?n:Array.from(e)}const hb=function(){return typeof window>"u"?function(n){return n()}:window.requestAnimationFrame}();function _b(n,e){let t=[],i=!1;return function(...l){t=l,i||(i=!0,hb.call(window,()=>{i=!1,n.apply(e,t)}))}}function iw(n,e){let t;return function(...i){return e?(clearTimeout(t),t=setTimeout(n,e,i)):n.apply(this,i),e}}const lw=n=>n==="start"?"left":n==="end"?"right":"center",Sf=(n,e,t)=>n==="start"?e:n==="end"?t:(e+t)/2;function sw(n,e,t){const i=e.length;let l=0,s=i;if(n._sorted){const{iScale:o,vScale:r,_parsed:a}=n,u=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null,f=o.axis,{min:c,max:d,minDefined:m,maxDefined:h}=o.getUserBounds();if(m){if(l=Math.min(Ji(a,f,c).lo,t?i:Ji(e,f,o.getPixelForValue(c)).lo),u){const _=a.slice(0,l+1).reverse().findIndex(g=>!Et(g[r.axis]));l-=Math.max(0,_)}l=Bn(l,0,i-1)}if(h){let _=Math.max(Ji(a,o.axis,d,!0).hi+1,t?0:Ji(e,f,o.getPixelForValue(d),!0).hi+1);if(u){const g=a.slice(_-1).findIndex(y=>!Et(y[r.axis]));_+=Math.max(0,g)}s=Bn(_,l,i)-l}else s=i-l}return{start:l,count:s}}function ow(n){const{xScale:e,yScale:t,_scaleRanges:i}=n,l={xmin:e.min,xmax:e.max,ymin:t.min,ymax:t.max};if(!i)return n._scaleRanges=l,!0;const s=i.xmin!==e.min||i.xmax!==e.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,l),s}const Vs=n=>n===0||n===1,$f=(n,e,t)=>-(Math.pow(2,10*(n-=1))*Math.sin((n-e)*ti/t)),Tf=(n,e,t)=>Math.pow(2,-10*n)*Math.sin((n-e)*ti/t)+1,is={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*Vn)+1,easeOutSine:n=>Math.sin(n*Vn),easeInOutSine:n=>-.5*(Math.cos(on*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=>Vs(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=>Vs(n)?n:$f(n,.075,.3),easeOutElastic:n=>Vs(n)?n:Tf(n,.075,.3),easeInOutElastic(n){return Vs(n)?n:n<.5?.5*$f(n*2,.1125,.45):.5+.5*Tf(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-is.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?is.easeInBounce(n*2)*.5:is.easeOutBounce(n*2-1)*.5+.5};function ja(n){if(n&&typeof n=="object"){const e=n.toString();return e==="[object CanvasPattern]"||e==="[object CanvasGradient]"}return!1}function Cf(n){return ja(n)?n:new ds(n)}function _r(n){return ja(n)?n:new ds(n).saturate(.5).darken(.1).hexString()}const rw=["x","y","borderWidth","radius","tension"],aw=["color","borderColor","backgroundColor"];function uw(n){n.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),n.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:e=>e!=="onProgress"&&e!=="onComplete"&&e!=="fn"}),n.set("animations",{colors:{type:"color",properties:aw},numbers:{type:"number",properties:rw}}),n.describe("animations",{_fallback:"animation"}),n.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:e=>e|0}}}})}function fw(n){n.set("layout",{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}const Of=new Map;function cw(n,e){e=e||{};const t=n+JSON.stringify(e);let i=Of.get(t);return i||(i=new Intl.NumberFormat(n,e),Of.set(t,i)),i}function gb(n,e,t){return cw(e,t).format(n)}const dw={values(n){return Xt(n)?n:""+n},numeric(n,e,t){if(n===0)return"0";const i=this.chart.options.locale;let l,s=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)&&(l="scientific"),s=pw(n,t)}const o=cb(Math.abs(s)),r=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),a={notation:l,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(a,this.options.ticks.format),gb(n,i,a)}};function pw(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 bb={formatters:dw};function mw(n){n.set("scale",{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:"ticks",clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(e,t)=>t.lineWidth,tickColor:(e,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width: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:bb.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),n.route("scale.ticks","color","","color"),n.route("scale.grid","color","","borderColor"),n.route("scale.border","color","","borderColor"),n.route("scale.title","color","","color"),n.describe("scale",{_fallback:!1,_scriptable:e=>!e.startsWith("before")&&!e.startsWith("after")&&e!=="callback"&&e!=="parser",_indexable:e=>e!=="borderDash"&&e!=="tickBorderDash"&&e!=="dash"}),n.describe("scales",{_fallback:"scale"}),n.describe("scale.ticks",{_scriptable:e=>e!=="backdropPadding"&&e!=="callback",_indexable:e=>e!=="backdropPadding"})}const xi=Object.create(null),sa=Object.create(null);function ls(n,e){if(!e)return n;const t=e.split(".");for(let i=0,l=t.length;i<l;++i){const s=t[i];n=n[s]||(n[s]=Object.create(null))}return n}function gr(n,e,t){return typeof e=="string"?ps(ls(n,e),t):ps(ls(n,""),e)}class hw{constructor(e,t){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=i=>i.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=(i,l)=>_r(l.backgroundColor),this.hoverBorderColor=(i,l)=>_r(l.borderColor),this.hoverColor=(i,l)=>_r(l.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),this.apply(t)}set(e,t){return gr(this,e,t)}get(e){return ls(this,e)}describe(e,t){return gr(sa,e,t)}override(e,t){return gr(xi,e,t)}route(e,t,i,l){const s=ls(this,e),o=ls(this,i),r="_"+t;Object.defineProperties(s,{[r]:{value:s[t],writable:!0},[t]:{enumerable:!0,get(){const a=this[r],u=o[l];return nt(a)?Object.assign({},u,a):wt(a,u)},set(a){this[r]=a}}})}apply(e){e.forEach(t=>t(this))}}var Ut=new hw({_scriptable:n=>!n.startsWith("on"),_indexable:n=>n!=="events",hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}},[uw,fw,mw]);function _w(n){return!n||Et(n.size)||Et(n.family)?null:(n.style?n.style+" ":"")+(n.weight?n.weight+" ":"")+n.size+"px "+n.family}function Mf(n,e,t,i,l){let s=e[l];return s||(s=e[l]=n.measureText(l).width,t.push(l)),s>i&&(i=s),i}function Hi(n,e,t){const i=n.currentDevicePixelRatio,l=t!==0?Math.max(t/2,.5):0;return Math.round((e-l)*i)/i+l}function Df(n,e){!e&&!n||(e=e||n.getContext("2d"),e.save(),e.resetTransform(),e.clearRect(0,0,n.width,n.height),e.restore())}function oa(n,e,t,i){gw(n,e,t,i)}function gw(n,e,t,i,l){let s,o,r,a,u,f,c,d;const m=e.pointStyle,h=e.rotation,_=e.radius;let g=(h||0)*U2;if(m&&typeof m=="object"&&(s=m.toString(),s==="[object HTMLImageElement]"||s==="[object HTMLCanvasElement]")){n.save(),n.translate(t,i),n.rotate(g),n.drawImage(m,-m.width/2,-m.height/2,m.width,m.height),n.restore();return}if(!(isNaN(_)||_<=0)){switch(n.beginPath(),m){default:n.arc(t,i,_,0,ti),n.closePath();break;case"triangle":f=_,n.moveTo(t+Math.sin(g)*f,i-Math.cos(g)*_),g+=kf,n.lineTo(t+Math.sin(g)*f,i-Math.cos(g)*_),g+=kf,n.lineTo(t+Math.sin(g)*f,i-Math.cos(g)*_),n.closePath();break;case"rectRounded":u=_*.516,a=_-u,o=Math.cos(g+ji)*a,c=Math.cos(g+ji)*a,r=Math.sin(g+ji)*a,d=Math.sin(g+ji)*a,n.arc(t-c,i-r,u,g-on,g-Vn),n.arc(t+d,i-o,u,g-Vn,g),n.arc(t+c,i+r,u,g,g+Vn),n.arc(t-d,i+o,u,g+Vn,g+on),n.closePath();break;case"rect":if(!h){a=Math.SQRT1_2*_,f=a,n.rect(t-f,i-a,2*f,2*a);break}g+=ji;case"rectRot":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+d,i-o),n.lineTo(t+c,i+r),n.lineTo(t-d,i+o),n.closePath();break;case"crossRot":g+=ji;case"cross":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"star":c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o),g+=ji,c=Math.cos(g)*_,o=Math.cos(g)*_,r=Math.sin(g)*_,d=Math.sin(g)*_,n.moveTo(t-c,i-r),n.lineTo(t+c,i+r),n.moveTo(t+d,i-o),n.lineTo(t-d,i+o);break;case"line":o=Math.cos(g)*_,r=Math.sin(g)*_,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)*_,i+Math.sin(g)*_);break;case!1:n.closePath();break}n.fill(),e.borderWidth>0&&n.stroke()}}function hs(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 Ha(n,e){n.save(),n.beginPath(),n.rect(e.left,e.top,e.right-e.left,e.bottom-e.top),n.clip()}function za(n){n.restore()}function bw(n,e,t,i,l){if(!e)return n.lineTo(t.x,t.y);if(l==="middle"){const s=(e.x+t.x)/2;n.lineTo(s,e.y),n.lineTo(s,t.y)}else l==="after"!=!!i?n.lineTo(e.x,t.y):n.lineTo(t.x,e.y);n.lineTo(t.x,t.y)}function kw(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 yw(n,e){e.translation&&n.translate(e.translation[0],e.translation[1]),Et(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 vw(n,e,t,i,l){if(l.strikethrough||l.underline){const s=n.measureText(i),o=e-s.actualBoundingBoxLeft,r=e+s.actualBoundingBoxRight,a=t-s.actualBoundingBoxAscent,u=t+s.actualBoundingBoxDescent,f=l.strikethrough?(a+u)/2:u;n.strokeStyle=n.fillStyle,n.beginPath(),n.lineWidth=l.decorationWidth||2,n.moveTo(o,f),n.lineTo(r,f),n.stroke()}}function ww(n,e){const t=n.fillStyle;n.fillStyle=e.color,n.fillRect(e.left,e.top,e.width,e.height),n.fillStyle=t}function Ef(n,e,t,i,l,s={}){const o=Xt(e)?e:[e],r=s.strokeWidth>0&&s.strokeColor!=="";let a,u;for(n.save(),n.font=l.string,yw(n,s),a=0;a<o.length;++a)u=o[a],s.backdrop&&ww(n,s.backdrop),r&&(s.strokeColor&&(n.strokeStyle=s.strokeColor),Et(s.strokeWidth)||(n.lineWidth=s.strokeWidth),n.strokeText(u,t,i,s.maxWidth)),n.fillText(u,t,i,s.maxWidth),vw(n,t,i,u,s),i+=Number(l.lineHeight);n.restore()}function If(n,e){const{x:t,y:i,w:l,h:s,radius:o}=e;n.arc(t+o.topLeft,i+o.topLeft,o.topLeft,1.5*on,on,!0),n.lineTo(t,i+s-o.bottomLeft),n.arc(t+o.bottomLeft,i+s-o.bottomLeft,o.bottomLeft,on,Vn,!0),n.lineTo(t+l-o.bottomRight,i+s),n.arc(t+l-o.bottomRight,i+s-o.bottomRight,o.bottomRight,Vn,0,!0),n.lineTo(t+l,i+o.topRight),n.arc(t+l-o.topRight,i+o.topRight,o.topRight,0,-Vn,!0),n.lineTo(t+o.topLeft,i)}const Sw=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/,$w=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function Tw(n,e){const t=(""+n).match(Sw);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 Cw=n=>+n||0;function kb(n,e){const t={},i=nt(e),l=i?Object.keys(e):e,s=nt(n)?i?o=>wt(n[o],n[e[o]]):o=>n[o]:()=>n;for(const o of l)t[o]=Cw(s(o));return t}function Ow(n){return kb(n,{top:"y",right:"x",bottom:"y",left:"x"})}function ao(n){return kb(n,["topLeft","topRight","bottomLeft","bottomRight"])}function Ai(n){const e=Ow(n);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function ei(n,e){n=n||{},e=e||Ut.font;let t=wt(n.size,e.size);typeof t=="string"&&(t=parseInt(t,10));let i=wt(n.style,e.style);i&&!(""+i).match($w)&&(console.warn('Invalid font style specified: "'+i+'"'),i=void 0);const l={family:wt(n.family,e.family),lineHeight:Tw(wt(n.lineHeight,e.lineHeight),t),size:t,style:i,weight:wt(n.weight,e.weight),string:""};return l.string=_w(l),l}function Bs(n,e,t,i){let l,s,o;for(l=0,s=n.length;l<s;++l)if(o=n[l],o!==void 0&&o!==void 0)return o}function Mw(n,e,t){const{min:i,max:l}=n,s=R2(e,(l-i)/2),o=(r,a)=>t&&r===0?0:r+a;return{min:o(i,-Math.abs(s)),max:o(l,s)}}function sl(n,e){return Object.assign(Object.create(n),e)}function Va(n,e=[""],t,i,l=()=>n[0]){const s=t||n;typeof i>"u"&&(i=Sb("_fallback",n));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:n,_rootScopes:s,_fallback:i,_getTarget:l,override:r=>Va([r,...n],e,s,i)};return new Proxy(o,{deleteProperty(r,a){return delete r[a],delete r._keys,delete n[0][a],!0},get(r,a){return vb(r,a,()=>Fw(a,e,n,r))},getOwnPropertyDescriptor(r,a){return Reflect.getOwnPropertyDescriptor(r._scopes[0],a)},getPrototypeOf(){return Reflect.getPrototypeOf(n[0])},has(r,a){return Lf(r).includes(a)},ownKeys(r){return Lf(r)},set(r,a,u){const f=r._storage||(r._storage=l());return r[a]=f[a]=u,delete r._keys,!0}})}function El(n,e,t,i){const l={_cacheable:!1,_proxy:n,_context:e,_subProxy:t,_stack:new Set,_descriptors:yb(n,i),setContext:s=>El(n,s,t,i),override:s=>El(n.override(s),e,t,i)};return new Proxy(l,{deleteProperty(s,o){return delete s[o],delete n[o],!0},get(s,o,r){return vb(s,o,()=>Ew(s,o,r))},getOwnPropertyDescriptor(s,o){return s._descriptors.allKeys?Reflect.has(n,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(n,o)},getPrototypeOf(){return Reflect.getPrototypeOf(n)},has(s,o){return Reflect.has(n,o)},ownKeys(){return Reflect.ownKeys(n)},set(s,o,r){return n[o]=r,delete s[o],!0}})}function yb(n,e={scriptable:!0,indexable:!0}){const{_scriptable:t=e.scriptable,_indexable:i=e.indexable,_allKeys:l=e.allKeys}=n;return{allKeys:l,scriptable:t,indexable:i,isScriptable:Ii(t)?t:()=>t,isIndexable:Ii(i)?i:()=>i}}const Dw=(n,e)=>n?n+Ra(e):e,Ba=(n,e)=>nt(e)&&n!=="adapters"&&(Object.getPrototypeOf(e)===null||e.constructor===Object);function vb(n,e,t){if(Object.prototype.hasOwnProperty.call(n,e)||e==="constructor")return n[e];const i=t();return n[e]=i,i}function Ew(n,e,t){const{_proxy:i,_context:l,_subProxy:s,_descriptors:o}=n;let r=i[e];return Ii(r)&&o.isScriptable(e)&&(r=Iw(e,r,n,t)),Xt(r)&&r.length&&(r=Aw(e,r,n,o.isIndexable)),Ba(e,r)&&(r=El(r,l,s&&s[e],o)),r}function Iw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_stack:r}=t;if(r.has(n))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+n);r.add(n);let a=e(s,o||i);return r.delete(n),Ba(n,a)&&(a=Ua(l._scopes,l,n,a)),a}function Aw(n,e,t,i){const{_proxy:l,_context:s,_subProxy:o,_descriptors:r}=t;if(typeof s.index<"u"&&i(n))return e[s.index%e.length];if(nt(e[0])){const a=e,u=l._scopes.filter(f=>f!==a);e=[];for(const f of a){const c=Ua(u,l,n,f);e.push(El(c,s,o&&o[n],r))}}return e}function wb(n,e,t){return Ii(n)?n(e,t):n}const Lw=(n,e)=>n===!0?e:typeof n=="string"?Do(e,n):void 0;function Nw(n,e,t,i,l){for(const s of e){const o=Lw(t,s);if(o){n.add(o);const r=wb(o._fallback,t,l);if(typeof r<"u"&&r!==t&&r!==i)return r}else if(o===!1&&typeof i<"u"&&t!==i)return null}return!1}function Ua(n,e,t,i){const l=e._rootScopes,s=wb(e._fallback,t,i),o=[...n,...l],r=new Set;r.add(i);let a=Af(r,o,t,s||t,i);return a===null||typeof s<"u"&&s!==t&&(a=Af(r,o,s,a,i),a===null)?!1:Va(Array.from(r),[""],l,s,()=>Pw(e,t,i))}function Af(n,e,t,i,l){for(;t;)t=Nw(n,e,t,i,l);return t}function Pw(n,e,t){const i=n._getTarget();e in i||(i[e]={});const l=i[e];return Xt(l)&&nt(t)?t:l||{}}function Fw(n,e,t,i){let l;for(const s of e)if(l=Sb(Dw(s,n),t),typeof l<"u")return Ba(n,l)?Ua(t,i,n,l):l}function Sb(n,e){for(const t of e){if(!t)continue;const i=t[n];if(typeof i<"u")return i}}function Lf(n){let e=n._keys;return e||(e=n._keys=Rw(n._scopes)),e}function Rw(n){const e=new Set;for(const t of n)for(const i of Object.keys(t).filter(l=>!l.startsWith("_")))e.add(i);return Array.from(e)}const qw=Number.EPSILON||1e-14,Il=(n,e)=>e<n.length&&!n[e].skip&&n[e],$b=n=>n==="x"?"y":"x";function jw(n,e,t,i){const l=n.skip?e:n,s=e,o=t.skip?e:t,r=la(s,l),a=la(o,s);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:s.x-c*(o.x-l.x),y:s.y-c*(o.y-l.y)},next:{x:s.x+d*(o.x-l.x),y:s.y+d*(o.y-l.y)}}}function Hw(n,e,t){const i=n.length;let l,s,o,r,a,u=Il(n,0);for(let f=0;f<i-1;++f)if(a=u,u=Il(n,f+1),!(!a||!u)){if(ns(e[f],0,qw)){t[f]=t[f+1]=0;continue}l=t[f]/e[f],s=t[f+1]/e[f],r=Math.pow(l,2)+Math.pow(s,2),!(r<=9)&&(o=3/Math.sqrt(r),t[f]=l*o*e[f],t[f+1]=s*o*e[f])}}function zw(n,e,t="x"){const i=$b(t),l=n.length;let s,o,r,a=Il(n,0);for(let u=0;u<l;++u){if(o=r,r=a,a=Il(n,u+1),!r)continue;const f=r[t],c=r[i];o&&(s=(f-o[t])/3,r[`cp1${t}`]=f-s,r[`cp1${i}`]=c-s*e[u]),a&&(s=(a[t]-f)/3,r[`cp2${t}`]=f+s,r[`cp2${i}`]=c+s*e[u])}}function Vw(n,e="x"){const t=$b(e),i=n.length,l=Array(i).fill(0),s=Array(i);let o,r,a,u=Il(n,0);for(o=0;o<i;++o)if(r=a,a=u,u=Il(n,o+1),!!a){if(u){const f=u[e]-a[e];l[o]=f!==0?(u[t]-a[t])/f:0}s[o]=r?u?Dl(l[o-1])!==Dl(l[o])?0:(l[o-1]+l[o])/2:l[o-1]:l[o]}Hw(n,l,s),zw(n,s,e)}function Us(n,e,t){return Math.max(Math.min(n,t),e)}function Bw(n,e){let t,i,l,s,o,r=hs(n[0],e);for(t=0,i=n.length;t<i;++t)o=s,s=r,r=t<i-1&&hs(n[t+1],e),s&&(l=n[t],o&&(l.cp1x=Us(l.cp1x,e.left,e.right),l.cp1y=Us(l.cp1y,e.top,e.bottom)),r&&(l.cp2x=Us(l.cp2x,e.left,e.right),l.cp2y=Us(l.cp2y,e.top,e.bottom)))}function Uw(n,e,t,i,l){let s,o,r,a;if(e.spanGaps&&(n=n.filter(u=>!u.skip)),e.cubicInterpolationMode==="monotone")Vw(n,l);else{let u=i?n[n.length-1]:n[0];for(s=0,o=n.length;s<o;++s)r=n[s],a=jw(u,r,n[Math.min(s+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&&Bw(n,t)}function Wa(){return typeof window<"u"&&typeof document<"u"}function Ya(n){let e=n.parentNode;return e&&e.toString()==="[object ShadowRoot]"&&(e=e.host),e}function Ao(n,e,t){let i;return typeof n=="string"?(i=parseInt(n,10),n.indexOf("%")!==-1&&(i=i/100*e.parentNode[t])):i=n,i}const Go=n=>n.ownerDocument.defaultView.getComputedStyle(n,null);function Ww(n,e){return Go(n).getPropertyValue(e)}const Yw=["top","right","bottom","left"];function Gi(n,e,t){const i={};t=t?"-"+t:"";for(let l=0;l<4;l++){const s=Yw[l];i[s]=parseFloat(n[e+"-"+s+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}const Kw=(n,e,t)=>(n>0||e>0)&&(!t||!t.shadowRoot);function Jw(n,e){const t=n.touches,i=t&&t.length?t[0]:n,{offsetX:l,offsetY:s}=i;let o=!1,r,a;if(Kw(l,s,n.target))r=l,a=s;else{const u=e.getBoundingClientRect();r=i.clientX-u.left,a=i.clientY-u.top,o=!0}return{x:r,y:a,box:o}}function Bi(n,e){if("native"in n)return n;const{canvas:t,currentDevicePixelRatio:i}=e,l=Go(t),s=l.boxSizing==="border-box",o=Gi(l,"padding"),r=Gi(l,"border","width"),{x:a,y:u,box:f}=Jw(n,t),c=o.left+(f&&r.left),d=o.top+(f&&r.top);let{width:m,height:h}=e;return s&&(m-=o.width+r.width,h-=o.height+r.height),{x:Math.round((a-c)/m*t.width/i),y:Math.round((u-d)/h*t.height/i)}}function Zw(n,e,t){let i,l;if(e===void 0||t===void 0){const s=n&&Ya(n);if(!s)e=n.clientWidth,t=n.clientHeight;else{const o=s.getBoundingClientRect(),r=Go(s),a=Gi(r,"border","width"),u=Gi(r,"padding");e=o.width-u.width-a.width,t=o.height-u.height-a.height,i=Ao(r.maxWidth,s,"clientWidth"),l=Ao(r.maxHeight,s,"clientHeight")}}return{width:e,height:t,maxWidth:i||Io,maxHeight:l||Io}}const Ti=n=>Math.round(n*10)/10;function Gw(n,e,t,i){const l=Go(n),s=Gi(l,"margin"),o=Ao(l.maxWidth,n,"clientWidth")||Io,r=Ao(l.maxHeight,n,"clientHeight")||Io,a=Zw(n,e,t);let{width:u,height:f}=a;if(l.boxSizing==="content-box"){const d=Gi(l,"border","width"),m=Gi(l,"padding");u-=m.width+d.width,f-=m.height+d.height}return u=Math.max(0,u-s.width),f=Math.max(0,i?u/i:f-s.height),u=Ti(Math.min(u,o,a.maxWidth)),f=Ti(Math.min(f,r,a.maxHeight)),u&&!f&&(f=Ti(u/2)),(e!==void 0||t!==void 0)&&i&&a.height&&f>a.height&&(f=a.height,u=Ti(Math.floor(f*i))),{width:u,height:f}}function Nf(n,e,t){const i=e||1,l=Ti(n.height*i),s=Ti(n.width*i);n.height=Ti(n.height),n.width=Ti(n.width);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!==l||o.width!==s?(n.currentDevicePixelRatio=i,o.height=l,o.width=s,n.ctx.setTransform(i,0,0,i,0,0),!0):!1}const Xw=function(){let n=!1;try{const e={get passive(){return n=!0,!1}};Wa()&&(window.addEventListener("test",null,e),window.removeEventListener("test",null,e))}catch{}return n}();function Pf(n,e){const t=Ww(n,e),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ui(n,e,t,i){return{x:n.x+t*(e.x-n.x),y:n.y+t*(e.y-n.y)}}function Qw(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 xw(n,e,t,i){const l={x:n.cp2x,y:n.cp2y},s={x:e.cp1x,y:e.cp1y},o=Ui(n,l,t),r=Ui(l,s,t),a=Ui(s,e,t),u=Ui(o,r,t),f=Ui(r,a,t);return Ui(u,f,t)}const e3=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}}},t3=function(){return{x(n){return n},setWidth(n){},textAlign(n){return n},xPlus(n,e){return n+e},leftForLtr(n,e){return n}}};function br(n,e,t){return n?e3(e,t):t3()}function n3(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 i3(n,e){e!==void 0&&(delete n.prevTextDirection,n.canvas.style.setProperty("direction",e[0],e[1]))}function Tb(n){return n==="angle"?{between:db,compare:X2,normalize:Qn}:{between:pb,compare:(e,t)=>e-t,normalize:e=>e}}function Ff({start:n,end:e,count:t,loop:i,style:l}){return{start:n%t,end:e%t,loop:i&&(e-n+1)%t===0,style:l}}function l3(n,e,t){const{property:i,start:l,end:s}=t,{between:o,normalize:r}=Tb(i),a=e.length;let{start:u,end:f,loop:c}=n,d,m;if(c){for(u+=a,f+=a,d=0,m=a;d<m&&o(r(e[u%a][i]),l,s);++d)u--,f--;u%=a,f%=a}return f<u&&(f+=a),{start:u,end:f,loop:c,style:n.style}}function Cb(n,e,t){if(!t)return[n];const{property:i,start:l,end:s}=t,o=e.length,{compare:r,between:a,normalize:u}=Tb(i),{start:f,end:c,loop:d,style:m}=l3(n,e,t),h=[];let _=!1,g=null,y,S,T;const $=()=>a(l,T,y)&&r(l,T)!==0,C=()=>r(s,y)===0||a(s,T,y),O=()=>_||$(),D=()=>!_||C();for(let I=f,L=f;I<=c;++I)S=e[I%o],!S.skip&&(y=u(S[i]),y!==T&&(_=a(y,l,s),g===null&&O()&&(g=r(y,l)===0?I:L),g!==null&&D()&&(h.push(Ff({start:g,end:I,loop:d,count:o,style:m})),g=null),L=I,T=y));return g!==null&&h.push(Ff({start:g,end:c,loop:d,count:o,style:m})),h}function Ob(n,e){const t=[],i=n.segments;for(let l=0;l<i.length;l++){const s=Cb(i[l],n.points,e);s.length&&t.push(...s)}return t}function s3(n,e,t,i){let l=0,s=e-1;if(t&&!i)for(;l<e&&!n[l].skip;)l++;for(;l<e&&n[l].skip;)l++;for(l%=e,t&&(s+=l);s>l&&n[s%e].skip;)s--;return s%=e,{start:l,end:s}}function o3(n,e,t,i){const l=n.length,s=[];let o=e,r=n[e],a;for(a=e+1;a<=t;++a){const u=n[a%l];u.skip||u.stop?r.skip||(i=!1,s.push({start:e%l,end:(a-1)%l,loop:i}),e=o=u.stop?a:null):(o=a,r.skip&&(e=a)),r=u}return o!==null&&s.push({start:e%l,end:o%l,loop:i}),s}function r3(n,e){const t=n.points,i=n.options.spanGaps,l=t.length;if(!l)return[];const s=!!n._loop,{start:o,end:r}=s3(t,l,s,i);if(i===!0)return Rf(n,[{start:o,end:r,loop:s}],t,e);const a=r<o?r+l:r,u=!!n._fullLoop&&o===0&&r===l-1;return Rf(n,o3(t,o,a,u),t,e)}function Rf(n,e,t,i){return!i||!i.setContext||!t?e:a3(n,e,t,i)}function a3(n,e,t,i){const l=n._chart.getContext(),s=qf(n.options),{_datasetIndex:o,options:{spanGaps:r}}=n,a=t.length,u=[];let f=s,c=e[0].start,d=c;function m(h,_,g,y){const S=r?-1:1;if(h!==_){for(h+=a;t[h%a].skip;)h-=S;for(;t[_%a].skip;)_+=S;h%a!==_%a&&(u.push({start:h%a,end:_%a,loop:g,style:y}),f=y,c=_%a)}}for(const h of e){c=r?c:h.start;let _=t[c%a],g;for(d=c+1;d<=h.end;d++){const y=t[d%a];g=qf(i.setContext(sl(l,{type:"segment",p0:_,p1:y,p0DataIndex:(d-1)%a,p1DataIndex:d%a,datasetIndex:o}))),u3(g,f)&&m(c,d-1,h.loop,f),_=y,f=g}c<d-1&&m(c,d-1,h.loop,f)}return u}function qf(n){return{backgroundColor:n.backgroundColor,borderCapStyle:n.borderCapStyle,borderDash:n.borderDash,borderDashOffset:n.borderDashOffset,borderJoinStyle:n.borderJoinStyle,borderWidth:n.borderWidth,borderColor:n.borderColor}}function u3(n,e){if(!e)return!1;const t=[],i=function(l,s){return ja(s)?(t.includes(s)||t.push(s),t.indexOf(s)):s};return JSON.stringify(n,i)!==JSON.stringify(e,i)}function Ws(n,e,t){return n.options.clip?n[t]:e[t]}function f3(n,e){const{xScale:t,yScale:i}=n;return t&&i?{left:Ws(t,e,"left"),right:Ws(t,e,"right"),top:Ws(i,e,"top"),bottom:Ws(i,e,"bottom")}:e}function Mb(n,e){const t=e._clip;if(t.disabled)return!1;const i=f3(e,n.chartArea);return{left:t.left===!1?0:i.left-(t.left===!0?0:t.left),right:t.right===!1?n.width:i.right+(t.right===!0?0:t.right),top:t.top===!1?0:i.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?n.height:i.bottom+(t.bottom===!0?0:t.bottom)}}/*!
|
||
* Chart.js v4.5.1
|
||
* https://www.chartjs.org
|
||
* (c) 2025 Chart.js Contributors
|
||
* Released under the MIT License
|
||
*/class c3{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,l){const s=t.listeners[l],o=t.duration;s.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=hb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.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,l)=>Math.max(i,l._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 l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ui=new c3;const jf="transparent",d3={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Cf(n||jf),l=i.valid&&Cf(e||jf);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class p3{constructor(e,t,i,l){const s=t[i];l=Bs([e.to,l,s,e.from]);const o=Bs([e.from,s,l]);this._active=!0,this._fn=e.fn||d3[e.type||typeof o],this._easing=is[e.easing]||is.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=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Bs([e.to,t,l,e.from]),this._from=Bs([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t<i),!this._active){this._target[l]=r,this._notify(!0);return}if(t<0){this._target[l]=s;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,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 l=0;l<i.length;l++)i[l][t]()}}class Db{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!nt(e))return;const t=Object.keys(Ut.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!nt(s))return;const o={};for(const r of t)o[r]=s[r];(Xt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=h3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&m3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=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"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[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}s[u]=c=new p3(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size===0){Object.assign(e,t);return}const i=this._createAnimations(e,t);if(i.length)return ui.add(this._chart,i),!0}}function m3(n,e){const t=[],i=Object.keys(e);for(let l=0;l<i.length;l++){const s=n[i[l]];s&&s.active()&&t.push(s.wait())}return Promise.all(t)}function h3(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 Hf(n,e){const t=n&&n.options||{},i=t.reverse,l=t.min===void 0?e:0,s=t.max===void 0?e:0;return{start:i?s:l,end:i?l:s}}function _3(n,e,t){if(t===!1)return!1;const i=Hf(n,t),l=Hf(e,t);return{top:l.end,right:i.end,bottom:l.start,left:i.start}}function g3(n){let e,t,i,l;return nt(n)?(e=n.top,t=n.right,i=n.bottom,l=n.left):e=t=i=l=n,{top:e,right:t,bottom:i,left:l,disabled:n===!1}}function Eb(n,e){const t=[],i=n._getSortedDatasetMetas(e);let l,s;for(l=0,s=i.length;l<s;++l)t.push(i[l].index);return t}function zf(n,e,t,i={}){const l=n.keys,s=i.mode==="single";let o,r,a,u;if(e===null)return;let f=!1;for(o=0,r=l.length;o<r;++o){if(a=+l[o],a===t){if(f=!0,i.all)continue;break}u=n.values[a],rn(u)&&(s||e===0||Dl(e)===Dl(u))&&(e+=u)}return!f&&!i.all?0:e}function b3(n,e){const{iScale:t,vScale:i}=e,l=t.axis==="x"?"x":"y",s=i.axis==="x"?"x":"y",o=Object.keys(n),r=new Array(o.length);let a,u,f;for(a=0,u=o.length;a<u;++a)f=o[a],r[a]={[l]:f,[s]:n[f]};return r}function kr(n,e){const t=n&&n.options.stacked;return t||t===void 0&&e.stack!==void 0}function k3(n,e,t){return`${n.id}.${e.id}.${t.stack||t.type}`}function y3(n){const{min:e,max:t,minDefined:i,maxDefined:l}=n.getUserBounds();return{min:i?e:Number.NEGATIVE_INFINITY,max:l?t:Number.POSITIVE_INFINITY}}function v3(n,e,t){const i=n[e]||(n[e]={});return i[t]||(i[t]={})}function Vf(n,e,t,i){for(const l of e.getMatchingVisibleMetas(i).reverse()){const s=n[l.index];if(t&&s>0||!t&&s<0)return l.index}return null}function Bf(n,e){const{chart:t,_cachedMeta:i}=n,l=t._stacks||(t._stacks={}),{iScale:s,vScale:o,index:r}=i,a=s.axis,u=o.axis,f=k3(s,o,i),c=e.length;let d;for(let m=0;m<c;++m){const h=e[m],{[a]:_,[u]:g}=h,y=h._stacks||(h._stacks={});d=y[u]=v3(l,f,_),d[r]=g,d._top=Vf(d,o,!0,i.type),d._bottom=Vf(d,o,!1,i.type);const S=d._visualValues||(d._visualValues={});S[r]=g}}function yr(n,e){const t=n.scales;return Object.keys(t).filter(i=>t[i].axis===e).shift()}function w3(n,e){return sl(n,{active:!1,dataset:void 0,datasetIndex:e,index:e,mode:"default",type:"dataset"})}function S3(n,e,t){return sl(n,{active:!1,dataIndex:e,parsed:void 0,raw:void 0,element:t,index:e,mode:"default",type:"data"})}function Vl(n,e){const t=n.controller.index,i=n.vScale&&n.vScale.axis;if(i){e=e||n._parsed;for(const l of e){const s=l._stacks;if(!s||s[i]===void 0||s[i][t]===void 0)return;delete s[i][t],s[i]._visualValues!==void 0&&s[i]._visualValues[t]!==void 0&&delete s[i]._visualValues[t]}}}const vr=n=>n==="reset"||n==="none",Uf=(n,e)=>e?n:Object.assign({},n),$3=(n,e,t)=>n&&!e.hidden&&e._stacked&&{keys:Eb(t,!0),values:null};class ss{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.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const e=this._cachedMeta;this.configure(),this.linkScales(),e._stacked=kr(e.vScale,e),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(e){this.index!==e&&Vl(this._cachedMeta),this.index=e}linkScales(){const e=this.chart,t=this._cachedMeta,i=this.getDataset(),l=(c,d,m,h)=>c==="x"?d:c==="r"?h:m,s=t.xAxisID=wt(i.xAxisID,yr(e,"x")),o=t.yAxisID=wt(i.yAxisID,yr(e,"y")),r=t.rAxisID=wt(i.rAxisID,yr(e,"r")),a=t.indexAxis,u=t.iAxisID=l(a,s,o,r),f=t.vAxisID=l(a,o,s,r);t.xScale=this.getScaleForId(s),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&&wf(this._data,this),e._stacked&&Vl(e)}_dataCheck(){const e=this.getDataset(),t=e.data||(e.data=[]),i=this._data;if(nt(t)){const l=this._cachedMeta;this._data=b3(t,l)}else if(i!==t){if(i){wf(i,this);const l=this._cachedMeta;Vl(l),l._parsed=[]}t&&Object.isExtensible(t)&&tw(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 l=!1;this._dataCheck();const s=t._stacked;t._stacked=kr(t.vScale,t),t.stack!==i.stack&&(l=!0,Vl(t),t.stack=i.stack),this._resyncElements(e),(l||s!==t._stacked)&&(Bf(this,t._parsed),t._stacked=kr(t.vScale,t))}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:l}=this,{iScale:s,_stacked:o}=i,r=s.axis;let a=e===0&&t===l.length?!0:i._sorted,u=e>0&&i._parsed[e-1],f,c,d;if(this._parsing===!1)i._parsed=l,i._sorted=!0,d=l;else{Xt(l[e])?d=this.parseArrayData(i,l,e,t):nt(l[e])?d=this.parseObjectData(i,l,e,t):d=this.parsePrimitiveData(i,l,e,t);const m=()=>c[r]===null||u&&c[r]<u[r];for(f=0;f<t;++f)i._parsed[f+e]=c=d[f],a&&(m()&&(a=!1),u=c);i._sorted=a}o&&Bf(this,d)}parsePrimitiveData(e,t,i,l){const{iScale:s,vScale:o}=e,r=s.axis,a=o.axis,u=s.getLabels(),f=s===o,c=new Array(l);let d,m,h;for(d=0,m=l;d<m;++d)h=d+i,c[d]={[r]:f||s.parse(u[h],h),[a]:o.parse(t[h],h)};return c}parseArrayData(e,t,i,l){const{xScale:s,yScale:o}=e,r=new Array(l);let a,u,f,c;for(a=0,u=l;a<u;++a)f=a+i,c=t[f],r[a]={x:s.parse(c[0],f),y:o.parse(c[1],f)};return r}parseObjectData(e,t,i,l){const{xScale:s,yScale:o}=e,{xAxisKey:r="x",yAxisKey:a="y"}=this._parsing,u=new Array(l);let f,c,d,m;for(f=0,c=l;f<c;++f)d=f+i,m=t[d],u[f]={x:s.parse(Do(m,r),d),y:o.parse(Do(m,a),d)};return u}getParsed(e){return this._cachedMeta._parsed[e]}getDataElement(e){return this._cachedMeta.data[e]}applyStack(e,t,i){const l=this.chart,s=this._cachedMeta,o=t[e.axis],r={keys:Eb(l,!0),values:t._stacks[e.axis]._visualValues};return zf(r,o,s.index,{mode:i})}updateRangeFromParsed(e,t,i,l){const s=i[t.axis];let o=s===null?NaN:s;const r=l&&i._stacks[t.axis];l&&r&&(l.values=r,o=zf(l,s,this._cachedMeta.index)),e.min=Math.min(e.min,o),e.max=Math.max(e.max,o)}getMinMax(e,t){const i=this._cachedMeta,l=i._parsed,s=i._sorted&&e===i.iScale,o=l.length,r=this._getOtherScale(e),a=$3(t,i,this.chart),u={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:f,max:c}=y3(r);let d,m;function h(){m=l[d];const _=m[r.axis];return!rn(m[e.axis])||f>_||c<_}for(d=0;d<o&&!(!h()&&(this.updateRangeFromParsed(u,e,m,a),s));++d);if(s){for(d=o-1;d>=0;--d)if(!h()){this.updateRangeFromParsed(u,e,m,a);break}}return u}getAllParsedValues(e){const t=this._cachedMeta._parsed,i=[];let l,s,o;for(l=0,s=t.length;l<s;++l)o=t[l][e.axis],rn(o)&&i.push(o);return i}getMaxOverflow(){return!1}getLabelAndValue(e){const t=this._cachedMeta,i=t.iScale,l=t.vScale,s=this.getParsed(e);return{label:i?""+i.getLabelForValue(s[i.axis]):"",value:l?""+l.getLabelForValue(s[l.axis]):""}}_update(e){const t=this._cachedMeta;this.update(e||"default"),t._clip=g3(wt(this.options.clip,_3(t.xScale,t.yScale,this.getMaxOverflow())))}update(e){}draw(){const e=this._ctx,t=this.chart,i=this._cachedMeta,l=i.data||[],s=t.chartArea,o=[],r=this._drawStart||0,a=this._drawCount||l.length-r,u=this.options.drawActiveElementsOnTop;let f;for(i.dataset&&i.dataset.draw(e,s,r,a),f=r;f<r+a;++f){const c=l[f];c.hidden||(c.active&&u?o.push(c):c.draw(e,s))}for(f=0;f<o.length;++f)o[f].draw(e,s)}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 l=this.getDataset();let s;if(e>=0&&e<this._cachedMeta.data.length){const o=this._cachedMeta.data[e];s=o.$context||(o.$context=S3(this.getContext(),e,o)),s.parsed=this.getParsed(e),s.raw=l.data[e],s.index=s.dataIndex=e}else s=this.$context||(this.$context=w3(this.chart.getContext(),this.index)),s.dataset=l,s.index=s.datasetIndex=this.index;return s.active=!!t,s.mode=i,s}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 l=t==="active",s=this._cachedDataOpts,o=e+"-"+t,r=s[o],a=this.enableOptionSharing&&Eo(i);if(r)return Uf(r,a);const u=this.chart.config,f=u.datasetElementScopeKeys(this._type,e),c=l?[`${e}Hover`,"hover",e,""]:[e,""],d=u.getOptionScopes(this.getDataset(),f),m=Object.keys(Ut.elements[e]),h=()=>this.getContext(i,l,t),_=u.resolveNamedOptions(d,m,h,c);return _.$shared&&(_.$shared=a,s[o]=Object.freeze(Uf(_,a))),_}_resolveAnimations(e,t,i){const l=this.chart,s=this._cachedDataOpts,o=`animation-${t}`,r=s[o];if(r)return r;let a;if(l.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 Db(l,a&&a.animations);return a&&a._cacheable&&(s[o]=Object.freeze(u)),u}getSharedOptions(e){if(e.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},e))}includeOptions(e,t){return!t||vr(e)||this.chart._animationsDisabled}_getSharedOptions(e,t){const i=this.resolveDataElementOptions(e,t),l=this._sharedOptions,s=this.getSharedOptions(i),o=this.includeOptions(t,s)||s!==l;return this.updateSharedOptions(s,t,i),{sharedOptions:s,includeOptions:o}}updateElement(e,t,i,l){vr(l)?Object.assign(e,i):this._resolveAnimations(t,l).update(e,i)}updateSharedOptions(e,t,i){e&&!vr(t)&&this._resolveAnimations(void 0,t).update(e,i)}_setStyle(e,t,i,l){e.active=l;const s=this.getStyle(t,l);this._resolveAnimations(t,i,l).update(e,{options:!l&&this.getSharedOptions(s)||s})}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 l=i.length,s=t.length,o=Math.min(s,l);o&&this.parse(0,o),s>l?this._insertElements(l,s-l,e):s<l&&this._removeElements(s,l-s)}_insertElements(e,t,i=!0){const l=this._cachedMeta,s=l.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(s),r=e;r<o;++r)s[r]=new this.dataElementType;this._parsing&&a(l._parsed),this.parse(e,t),i&&this.updateElements(s,e,t,"reset")}updateElements(e,t,i,l){}_removeElements(e,t){const i=this._cachedMeta;if(this._parsing){const l=i._parsed.splice(e,t);i._stacked&&Vl(i,l)}i.data.splice(e,t)}_sync(e){if(this._parsing)this._syncList.push(e);else{const[t,i,l]=e;this[t](i,l)}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])}}Ge(ss,"defaults",{}),Ge(ss,"datasetElementType",null),Ge(ss,"dataElementType",null);class uo extends ss{initialize(){this.enableOptionSharing=!0,this.supportsDecimation=!0,super.initialize()}update(e){const t=this._cachedMeta,{dataset:i,data:l=[],_dataset:s}=t,o=this.chart._animationsDisabled;let{start:r,count:a}=sw(t,l,o);this._drawStart=r,this._drawCount=a,ow(t)&&(r=0,a=l.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!s._decimated,i.points=l;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(l,r,a,e)}updateElements(e,t,i,l){const s=l==="reset",{iScale:o,vScale:r,_stacked:a,_dataset:u}=this._cachedMeta,{sharedOptions:f,includeOptions:c}=this._getSharedOptions(t,l),d=o.axis,m=r.axis,{spanGaps:h,segment:_}=this.options,g=ms(h)?h:Number.POSITIVE_INFINITY,y=this.chart._animationsDisabled||s||l==="none",S=t+i,T=e.length;let $=t>0&&this.getParsed(t-1);for(let C=0;C<T;++C){const O=e[C],D=y?O:{};if(C<t||C>=S){D.skip=!0;continue}const I=this.getParsed(C),L=Et(I[m]),R=D[d]=o.getPixelForValue(I[d],C),F=D[m]=s||L?r.getBasePixel():r.getPixelForValue(a?this.applyStack(r,I,a):I[m],C);D.skip=isNaN(R)||isNaN(F)||L,D.stop=C>0&&Math.abs(I[d]-$[d])>g,_&&(D.parsed=I,D.raw=u.data[C]),c&&(D.options=f||this.resolveDataElementOptions(C,O.active?"active":l)),y||this.updateElement(O,C,D,l),$=I}}getMaxOverflow(){const e=this._cachedMeta,t=e.dataset,i=t.options&&t.options.borderWidth||0,l=e.data||[];if(!l.length)return i;const s=l[0].size(this.resolveDataElementOptions(0)),o=l[l.length-1].size(this.resolveDataElementOptions(l.length-1));return Math.max(i,s,o)/2}draw(){const e=this._cachedMeta;e.dataset.updateControlPoints(this.chart.chartArea,e.iScale.axis),super.draw()}}Ge(uo,"id","line"),Ge(uo,"defaults",{datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1}),Ge(uo,"overrides",{scales:{_index_:{type:"category"},_value_:{type:"linear"}}});function zi(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class Ka{constructor(e){Ge(this,"options");this.options=e||{}}static override(e){Object.assign(Ka.prototype,e)}init(){}formats(){return zi()}parse(){return zi()}format(){return zi()}add(){return zi()}diff(){return zi()}startOf(){return zi()}endOf(){return zi()}}var Ib={_date:Ka};function T3(n,e,t,i){const{controller:l,data:s,_sorted:o}=n,r=l._cachedMeta.iScale,a=n.dataset&&n.dataset.options?n.dataset.options.spanGaps:null;if(r&&e===r.axis&&e!=="r"&&o&&s.length){const u=r._reversePixels?x2:Ji;if(i){if(l._sharedOptions){const f=s[0],c=typeof f.getRange=="function"&&f.getRange(e);if(c){const d=u(s,e,t-c),m=u(s,e,t+c);return{lo:d.lo,hi:m.hi}}}}else{const f=u(s,e,t);if(a){const{vScale:c}=l._cachedMeta,{_parsed:d}=n,m=d.slice(0,f.lo+1).reverse().findIndex(_=>!Et(_[c.axis]));f.lo-=Math.max(0,m);const h=d.slice(f.hi).findIndex(_=>!Et(_[c.axis]));f.hi+=Math.max(0,h)}return f}}return{lo:0,hi:s.length-1}}function Xo(n,e,t,i,l){const s=n.getSortedVisibleDatasetMetas(),o=t[e];for(let r=0,a=s.length;r<a;++r){const{index:u,data:f}=s[r],{lo:c,hi:d}=T3(s[r],e,o,l);for(let m=c;m<=d;++m){const h=f[m];h.skip||i(h,u,m)}}}function C3(n){const e=n.indexOf("x")!==-1,t=n.indexOf("y")!==-1;return function(i,l){const s=e?Math.abs(i.x-l.x):0,o=t?Math.abs(i.y-l.y):0;return Math.sqrt(Math.pow(s,2)+Math.pow(o,2))}}function wr(n,e,t,i,l){const s=[];return!l&&!n.isPointInArea(e)||Xo(n,t,e,function(r,a,u){!l&&!hs(r,n.chartArea,0)||r.inRange(e.x,e.y,i)&&s.push({element:r,datasetIndex:a,index:u})},!0),s}function O3(n,e,t,i){let l=[];function s(o,r,a){const{startAngle:u,endAngle:f}=o.getProps(["startAngle","endAngle"],i),{angle:c}=G2(o,{x:e.x,y:e.y});db(c,u,f)&&l.push({element:o,datasetIndex:r,index:a})}return Xo(n,t,e,s),l}function M3(n,e,t,i,l,s){let o=[];const r=C3(t);let a=Number.POSITIVE_INFINITY;function u(f,c,d){const m=f.inRange(e.x,e.y,l);if(i&&!m)return;const h=f.getCenterPoint(l);if(!(!!s||n.isPointInArea(h))&&!m)return;const g=r(e,h);g<a?(o=[{element:f,datasetIndex:c,index:d}],a=g):g===a&&o.push({element:f,datasetIndex:c,index:d})}return Xo(n,t,e,u),o}function Sr(n,e,t,i,l,s){return!s&&!n.isPointInArea(e)?[]:t==="r"&&!i?O3(n,e,t,l):M3(n,e,t,i,l,s)}function Wf(n,e,t,i,l){const s=[],o=t==="x"?"inXRange":"inYRange";let r=!1;return Xo(n,t,e,(a,u,f)=>{a[o]&&a[o](e[t],l)&&(s.push({element:a,datasetIndex:u,index:f}),r=r||a.inRange(e.x,e.y,l))}),i&&!r?[]:s}var D3={modes:{index(n,e,t,i){const l=Bi(e,n),s=t.axis||"x",o=t.includeInvisible||!1,r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!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 l=Bi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;let r=t.intersect?wr(n,l,s,i,o):Sr(n,l,s,!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 l=Bi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return wr(n,l,s,i,o)},nearest(n,e,t,i){const l=Bi(e,n),s=t.axis||"xy",o=t.includeInvisible||!1;return Sr(n,l,s,t.intersect,i,o)},x(n,e,t,i){const l=Bi(e,n);return Wf(n,l,"x",t.intersect,i)},y(n,e,t,i){const l=Bi(e,n);return Wf(n,l,"y",t.intersect,i)}}};const Ab=["left","top","right","bottom"];function Bl(n,e){return n.filter(t=>t.pos===e)}function Yf(n,e){return n.filter(t=>Ab.indexOf(t.pos)===-1&&t.box.axis===e)}function Ul(n,e){return n.sort((t,i)=>{const l=e?i:t,s=e?t:i;return l.weight===s.weight?l.index-s.index:l.weight-s.weight})}function E3(n){const e=[];let t,i,l,s,o,r;for(t=0,i=(n||[]).length;t<i;++t)l=n[t],{position:s,options:{stack:o,stackWeight:r=1}}=l,e.push({index:t,box:l,pos:s,horizontal:l.isHorizontal(),weight:l.weight,stack:o&&s+o,stackWeight:r});return e}function I3(n){const e={};for(const t of n){const{stack:i,pos:l,stackWeight:s}=t;if(!i||!Ab.includes(l))continue;const o=e[i]||(e[i]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=s}return e}function A3(n,e){const t=I3(n),{vBoxMaxWidth:i,hBoxMaxHeight:l}=e;let s,o,r;for(s=0,o=n.length;s<o;++s){r=n[s];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=l):(r.width=i,r.height=f?f*l:a&&e.availableHeight)}return t}function L3(n){const e=E3(n),t=Ul(e.filter(u=>u.box.fullSize),!0),i=Ul(Bl(e,"left"),!0),l=Ul(Bl(e,"right")),s=Ul(Bl(e,"top"),!0),o=Ul(Bl(e,"bottom")),r=Yf(e,"x"),a=Yf(e,"y");return{fullSize:t,leftAndTop:i.concat(s),rightAndBottom:l.concat(a).concat(o).concat(r),chartArea:Bl(e,"chartArea"),vertical:i.concat(l).concat(a),horizontal:s.concat(o).concat(r)}}function Kf(n,e,t,i){return Math.max(n[t],e[t])+Math.max(n[i],e[i])}function Lb(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 N3(n,e,t,i){const{pos:l,box:s}=t,o=n.maxPadding;if(!nt(l)){t.size&&(n[l]-=t.size);const c=i[t.stack]||{size:0,count:1};c.size=Math.max(c.size,t.horizontal?s.height:s.width),t.size=c.size/c.count,n[l]+=t.size}s.getPadding&&Lb(o,s.getPadding());const r=Math.max(0,e.outerWidth-Kf(o,n,"left","right")),a=Math.max(0,e.outerHeight-Kf(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 P3(n){const e=n.maxPadding;function t(i){const l=Math.max(e[i]-n[i],0);return n[i]+=l,l}n.y+=t("top"),n.x+=t("left"),t("right"),t("bottom")}function F3(n,e){const t=e.maxPadding;function i(l){const s={left:0,top:0,right:0,bottom:0};return l.forEach(o=>{s[o]=Math.max(e[o],t[o])}),s}return i(n?["left","right"]:["top","bottom"])}function Xl(n,e,t,i){const l=[];let s,o,r,a,u,f;for(s=0,o=n.length,u=0;s<o;++s){r=n[s],a=r.box,a.update(r.width||e.w,r.height||e.h,F3(r.horizontal,e));const{same:c,other:d}=N3(e,t,r,i);u|=c&&l.length,f=f||d,a.fullSize||l.push(r)}return u&&Xl(l,e,t,i)||f}function Ys(n,e,t,i,l){n.top=t,n.left=e,n.right=e+i,n.bottom=t+l,n.width=i,n.height=l}function Jf(n,e,t,i){const l=t.padding;let{x:s,y:o}=e;for(const r of n){const a=r.box,u=i[r.stack]||{placed:0,weight:1},f=r.stackWeight/u.weight||1;if(r.horizontal){const c=e.w*f,d=u.size||a.height;Eo(u.start)&&(o=u.start),a.fullSize?Ys(a,l.left,o,t.outerWidth-l.right-l.left,d):Ys(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;Eo(u.start)&&(s=u.start),a.fullSize?Ys(a,s,l.top,d,t.outerHeight-l.bottom-l.top):Ys(a,s,e.top+u.placed,d,c),u.start=s,u.placed+=c,s=a.right}}e.x=s,e.y=o}var Ks={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 l=Ai(n.options.layout.padding),s=Math.max(e-l.width,0),o=Math.max(t-l.height,0),r=L3(n.boxes),a=r.vertical,u=r.horizontal;ht(n.boxes,_=>{typeof _.beforeLayout=="function"&&_.beforeLayout()});const f=a.reduce((_,g)=>g.box.options&&g.box.options.display===!1?_:_+1,0)||1,c=Object.freeze({outerWidth:e,outerHeight:t,padding:l,availableWidth:s,availableHeight:o,vBoxMaxWidth:s/2/f,hBoxMaxHeight:o/2}),d=Object.assign({},l);Lb(d,Ai(i));const m=Object.assign({maxPadding:d,w:s,h:o,x:l.left,y:l.top},l),h=A3(a.concat(u),c);Xl(r.fullSize,m,c,h),Xl(a,m,c,h),Xl(u,m,c,h)&&Xl(a,m,c,h),P3(m),Jf(r.leftAndTop,m,c,h),m.x+=m.w,m.y+=m.h,Jf(r.rightAndBottom,m,c,h),n.chartArea={left:m.left,top:m.top,right:m.left+m.w,bottom:m.top+m.h,height:m.h,width:m.w},ht(r.chartArea,_=>{const g=_.box;Object.assign(g,n.chartArea),g.update(m.w,m.h,{left:0,top:0,right:0,bottom:0})})}};class Nb{acquireContext(e,t){}releaseContext(e){return!1}addEventListener(e,t,i){}removeEventListener(e,t,i){}getDevicePixelRatio(){return 1}getMaximumSize(e,t,i,l){return t=Math.max(0,t||e.width),i=i||e.height,{width:t,height:Math.max(0,l?Math.floor(t/l):i)}}isAttached(e){return!0}updateConfig(e){}}class R3 extends Nb{acquireContext(e){return e&&e.getContext&&e.getContext("2d")||null}updateConfig(e){e.options.animation=!1}}const fo="$chartjs",q3={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},Zf=n=>n===null||n==="";function j3(n,e){const t=n.style,i=n.getAttribute("height"),l=n.getAttribute("width");if(n[fo]={initial:{height:i,width:l,style:{display:t.display,height:t.height,width:t.width}}},t.display=t.display||"block",t.boxSizing=t.boxSizing||"border-box",Zf(l)){const s=Pf(n,"width");s!==void 0&&(n.width=s)}if(Zf(i))if(n.style.height==="")n.height=n.width/(e||2);else{const s=Pf(n,"height");s!==void 0&&(n.height=s)}return n}const Pb=Xw?{passive:!0}:!1;function H3(n,e,t){n&&n.addEventListener(e,t,Pb)}function z3(n,e,t){n&&n.canvas&&n.canvas.removeEventListener(e,t,Pb)}function V3(n,e){const t=q3[n.type]||n.type,{x:i,y:l}=Bi(n,e);return{type:t,chart:e,native:n,x:i!==void 0?i:null,y:l!==void 0?l:null}}function Lo(n,e){for(const t of n)if(t===e||t.contains(e))return!0}function B3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Lo(r.addedNodes,i),o=o&&!Lo(r.removedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}function U3(n,e,t){const i=n.canvas,l=new MutationObserver(s=>{let o=!1;for(const r of s)o=o||Lo(r.removedNodes,i),o=o&&!Lo(r.addedNodes,i);o&&t()});return l.observe(document,{childList:!0,subtree:!0}),l}const _s=new Map;let Gf=0;function Fb(){const n=window.devicePixelRatio;n!==Gf&&(Gf=n,_s.forEach((e,t)=>{t.currentDevicePixelRatio!==n&&e()}))}function W3(n,e){_s.size||window.addEventListener("resize",Fb),_s.set(n,e)}function Y3(n){_s.delete(n),_s.size||window.removeEventListener("resize",Fb)}function K3(n,e,t){const i=n.canvas,l=i&&Ya(i);if(!l)return;const s=_b((r,a)=>{const u=l.clientWidth;t(r,a),u<l.clientWidth&&t()},window),o=new ResizeObserver(r=>{const a=r[0],u=a.contentRect.width,f=a.contentRect.height;u===0&&f===0||s(u,f)});return o.observe(l),W3(n,s),o}function $r(n,e,t){t&&t.disconnect(),e==="resize"&&Y3(n)}function J3(n,e,t){const i=n.canvas,l=_b(s=>{n.ctx!==null&&t(V3(s,n))},n);return H3(i,e,l),l}class Z3 extends Nb{acquireContext(e,t){const i=e&&e.getContext&&e.getContext("2d");return i&&i.canvas===e?(j3(e,t),i):null}releaseContext(e){const t=e.canvas;if(!t[fo])return!1;const i=t[fo].initial;["height","width"].forEach(s=>{const o=i[s];Et(o)?t.removeAttribute(s):t.setAttribute(s,o)});const l=i.style||{};return Object.keys(l).forEach(s=>{t.style[s]=l[s]}),t.width=t.width,delete t[fo],!0}addEventListener(e,t,i){this.removeEventListener(e,t);const l=e.$proxies||(e.$proxies={}),o={attach:B3,detach:U3,resize:K3}[t]||J3;l[t]=o(e,t,i)}removeEventListener(e,t){const i=e.$proxies||(e.$proxies={}),l=i[t];if(!l)return;({attach:$r,detach:$r,resize:$r}[t]||z3)(e,t,l),i[t]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(e,t,i,l){return Gw(e,t,i,l)}isAttached(e){const t=e&&Ya(e);return!!(t&&t.isConnected)}}function G3(n){return!Wa()||typeof OffscreenCanvas<"u"&&n instanceof OffscreenCanvas?R3:Z3}class el{constructor(){Ge(this,"x");Ge(this,"y");Ge(this,"active",!1);Ge(this,"options");Ge(this,"$animations")}tooltipPosition(e){const{x:t,y:i}=this.getProps(["x","y"],e);return{x:t,y:i}}hasValue(){return ms(this.x)&&ms(this.y)}getProps(e,t){const i=this.$animations;if(!t||!i)return this;const l={};return e.forEach(s=>{l[s]=i[s]&&i[s].active()?i[s]._to:this[s]}),l}}Ge(el,"defaults",{}),Ge(el,"defaultRoutes");function X3(n,e){const t=n.options.ticks,i=Q3(n),l=Math.min(t.maxTicksLimit||i,i),s=t.major.enabled?e4(e):[],o=s.length,r=s[0],a=s[o-1],u=[];if(o>l)return t4(e,u,s,o/l),u;const f=x3(s,e,l);if(o>0){let c,d;const m=o>1?Math.round((a-r)/(o-1)):null;for(Js(e,u,f,Et(m)?0:r-m,r),c=0,d=o-1;c<d;c++)Js(e,u,f,s[c],s[c+1]);return Js(e,u,f,a,Et(m)?e.length:a+m),u}return Js(e,u,f),u}function Q3(n){const e=n.options.offset,t=n._tickSize(),i=n._length/t+(e?0:1),l=n._maxLength/t;return Math.floor(Math.min(i,l))}function x3(n,e,t){const i=n4(n),l=e.length/t;if(!i)return Math.max(l,1);const s=W2(i);for(let o=0,r=s.length-1;o<r;o++){const a=s[o];if(a>l)return a}return Math.max(l,1)}function e4(n){const e=[];let t,i;for(t=0,i=n.length;t<i;t++)n[t].major&&e.push(t);return e}function t4(n,e,t,i){let l=0,s=t[0],o;for(i=Math.ceil(i),o=0;o<n.length;o++)o===s&&(e.push(n[o]),l++,s=t[l*i])}function Js(n,e,t,i,l){const s=wt(i,0),o=Math.min(wt(l,n.length),n.length);let r=0,a,u,f;for(t=Math.ceil(t),l&&(a=l-i,t=a/Math.floor(a/t)),f=s;f<0;)r++,f=Math.round(s+r*t);for(u=Math.max(s,0);u<o;u++)u===f&&(e.push(n[u]),r++,f=Math.round(s+r*t))}function n4(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 i4=n=>n==="left"?"right":n==="right"?"left":n,Xf=(n,e,t)=>e==="top"||e==="left"?n[e]+t:n[e]-t,Qf=(n,e)=>Math.min(e||n,n);function xf(n,e){const t=[],i=n.length/e,l=n.length;let s=0;for(;s<l;s+=i)t.push(n[Math.floor(s)]);return t}function l4(n,e,t){const i=n.ticks.length,l=Math.min(e,i-1),s=n._startPixel,o=n._endPixel,r=1e-6;let a=n.getPixelForTick(l),u;if(!(t&&(i===1?u=Math.max(a-s,o-a):e===0?u=(n.getPixelForTick(1)-a)/2:u=(a-n.getPixelForTick(l-1))/2,a+=l<e?u:-u,a<s-r||a>o+r)))return a}function s4(n,e){ht(n,t=>{const i=t.gc,l=i.length/2;let s;if(l>e){for(s=0;s<l;++s)delete t.data[i[s]];i.splice(0,l)}})}function Wl(n){return n.drawTicks?n.tickLength:0}function ec(n,e){if(!n.display)return 0;const t=ei(n.font,e),i=Ai(n.padding);return(Xt(n.text)?n.text.length:1)*t.lineHeight+i.height}function o4(n,e){return sl(n,{scale:e,type:"scale"})}function r4(n,e,t){return sl(n,{tick:t,index:e,type:"tick"})}function a4(n,e,t){let i=lw(n);return(t&&e!=="right"||!t&&e==="right")&&(i=i4(i)),i}function u4(n,e,t,i){const{top:l,left:s,bottom:o,right:r,chart:a}=n,{chartArea:u,scales:f}=a;let c=0,d,m,h;const _=o-l,g=r-s;if(n.isHorizontal()){if(m=Sf(i,s,r),nt(t)){const y=Object.keys(t)[0],S=t[y];h=f[y].getPixelForValue(S)+_-e}else t==="center"?h=(u.bottom+u.top)/2+_-e:h=Xf(n,t,e);d=r-s}else{if(nt(t)){const y=Object.keys(t)[0],S=t[y];m=f[y].getPixelForValue(S)-g+e}else t==="center"?m=(u.left+u.right)/2-g+e:m=Xf(n,t,e);h=Sf(i,o,l),c=t==="left"?-Vn:Vn}return{titleX:m,titleY:h,maxWidth:d,rotation:c}}class Es extends el{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:l}=this;return e=Zn(e,Number.POSITIVE_INFINITY),t=Zn(t,Number.NEGATIVE_INFINITY),i=Zn(i,Number.POSITIVE_INFINITY),l=Zn(l,Number.NEGATIVE_INFINITY),{min:Zn(e,i),max:Zn(t,l),minDefined:rn(e),maxDefined:rn(t)}}getMinMax(e){let{min:t,max:i,minDefined:l,maxDefined:s}=this.getUserBounds(),o;if(l&&s)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),l||(t=Math.min(t,o.min)),s||(i=Math.max(i,o.max));return t=s&&t>i?i:t,i=l&&t>i?t:i,{min:Zn(t,Zn(i,t)),max:Zn(i,Zn(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||[]}getLabelItems(e=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(e))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){Ht(this.options.beforeUpdate,[this])}update(e,t,i){const{beginAtZero:l,grace:s,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=Mw(this,s,l),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const a=r<this.ticks.length;this._convertTicksToLabels(a?xf(this.ticks,r):this.ticks),this.configure(),this.beforeCalculateLabelRotation(),this.calculateLabelRotation(),this.afterCalculateLabelRotation(),o.display&&(o.autoSkip||o.source==="auto")&&(this.ticks=X3(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(){Ht(this.options.afterUpdate,[this])}beforeSetDimensions(){Ht(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(){Ht(this.options.afterSetDimensions,[this])}_callHooks(e){this.chart.notifyPlugins(e,this.getContext()),Ht(this.options[e],[this])}beforeDataLimits(){this._callHooks("beforeDataLimits")}determineDataLimits(){}afterDataLimits(){this._callHooks("afterDataLimits")}beforeBuildTicks(){this._callHooks("beforeBuildTicks")}buildTicks(){return[]}afterBuildTicks(){this._callHooks("afterBuildTicks")}beforeTickToLabelConversion(){Ht(this.options.beforeTickToLabelConversion,[this])}generateTickLabels(e){const t=this.options.ticks;let i,l,s;for(i=0,l=e.length;i<l;i++)s=e[i],s.label=Ht(t.callback,[s.value,i,e],this)}afterTickToLabelConversion(){Ht(this.options.afterTickToLabelConversion,[this])}beforeCalculateLabelRotation(){Ht(this.options.beforeCalculateLabelRotation,[this])}calculateLabelRotation(){const e=this.options,t=e.ticks,i=Qf(this.ticks.length,e.ticks.maxTicksLimit),l=t.minRotation||0,s=t.maxRotation;let o=l,r,a,u;if(!this._isVisible()||!t.display||l>=s||i<=1||!this.isHorizontal()){this.labelRotation=l;return}const f=this._getLabelSizes(),c=f.widest.width,d=f.highest.height,m=Bn(this.chart.width-c,0,this.maxWidth);r=e.offset?this.maxWidth/i:m/(i-1),c+6>r&&(r=m/(i-(e.offset?.5:1)),a=this.maxHeight-Wl(e.grid)-t.padding-ec(e.title,this.chart.options.font),u=Math.sqrt(c*c+d*d),o=Z2(Math.min(Math.asin(Bn((f.highest.height+6)/r,-1,1)),Math.asin(Bn(a/u,-1,1))-Math.asin(Bn(d/u,-1,1)))),o=Math.max(l,Math.min(s,o))),this.labelRotation=o}afterCalculateLabelRotation(){Ht(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){Ht(this.options.beforeFit,[this])}fit(){const e={width:0,height:0},{chart:t,options:{ticks:i,title:l,grid:s}}=this,o=this._isVisible(),r=this.isHorizontal();if(o){const a=ec(l,t.options.font);if(r?(e.width=this.maxWidth,e.height=Wl(s)+a):(e.height=this.maxHeight,e.width=Wl(s)+a),i.display&&this.ticks.length){const{first:u,last:f,widest:c,highest:d}=this._getLabelSizes(),m=i.padding*2,h=Ki(this.labelRotation),_=Math.cos(h),g=Math.sin(h);if(r){const y=i.mirror?0:g*c.width+_*d.height;e.height=Math.min(this.maxHeight,e.height+y+m)}else{const y=i.mirror?0:_*c.width+g*d.height;e.width=Math.min(this.maxWidth,e.width+y+m)}this._calculatePadding(u,f,g,_)}}this._handleMargins(),r?(this.width=this._length=t.width-this._margins.left-this._margins.right,this.height=e.height):(this.width=e.width,this.height=this._length=t.height-this._margins.top-this._margins.bottom)}_calculatePadding(e,t,i,l){const{ticks:{align:s,padding:o},position:r}=this.options,a=this.labelRotation!==0,u=r!=="top"&&this.axis==="x";if(this.isHorizontal()){const f=this.getPixelForTick(0)-this.left,c=this.right-this.getPixelForTick(this.ticks.length-1);let d=0,m=0;a?u?(d=l*e.width,m=i*t.height):(d=i*e.height,m=l*t.width):s==="start"?m=t.width:s==="end"?d=e.width:s!=="inner"&&(d=e.width/2,m=t.width/2),this.paddingLeft=Math.max((d-f+o)*this.width/(this.width-f),0),this.paddingRight=Math.max((m-c+o)*this.width/(this.width-c),0)}else{let f=t.height/2,c=e.height/2;s==="start"?(f=0,c=e.height):s==="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(){Ht(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++)Et(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=xf(i,t)),this._labelSizes=e=this._computeLabelSizes(i,i.length,this.options.ticks.maxTicksLimit)}return e}_computeLabelSizes(e,t,i){const{ctx:l,_longestTextCache:s}=this,o=[],r=[],a=Math.floor(t/Qf(t,i));let u=0,f=0,c,d,m,h,_,g,y,S,T,$,C;for(c=0;c<t;c+=a){if(h=e[c].label,_=this._resolveTickFontOptions(c),l.font=g=_.string,y=s[g]=s[g]||{data:{},gc:[]},S=_.lineHeight,T=$=0,!Et(h)&&!Xt(h))T=Mf(l,y.data,y.gc,T,h),$=S;else if(Xt(h))for(d=0,m=h.length;d<m;++d)C=h[d],!Et(C)&&!Xt(C)&&(T=Mf(l,y.data,y.gc,T,C),$+=S);o.push(T),r.push($),u=Math.max(T,u),f=Math.max($,f)}s4(s,t);const O=o.indexOf(u),D=r.indexOf(f),I=L=>({width:o[L]||0,height:r[L]||0});return{first:I(0),last:I(t-1),widest:I(O),highest:I(D),widths:o,heights:r}}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 Q2(this._alignToPixels?Hi(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=r4(this.getContext(),e,i))}return this.$context||(this.$context=o4(this.chart.getContext(),this))}_tickSize(){const e=this.options.ticks,t=Ki(this.labelRotation),i=Math.abs(Math.cos(t)),l=Math.abs(Math.sin(t)),s=this._getLabelSizes(),o=e.autoSkipPadding||0,r=s?s.widest.width+o:0,a=s?s.highest.height+o:0;return this.isHorizontal()?a*i>r*l?r/i:a/l:a*l<r*i?a/i:r/l}_isVisible(){const e=this.options.display;return e!=="auto"?!!e:this.getMatchingVisibleMetas().length>0}_computeGridLineItems(e){const t=this.axis,i=this.chart,l=this.options,{grid:s,position:o,border:r}=l,a=s.offset,u=this.isHorizontal(),c=this.ticks.length+(a?1:0),d=Wl(s),m=[],h=r.setContext(this.getContext()),_=h.display?h.width:0,g=_/2,y=function(Y){return Hi(i,Y,_)};let S,T,$,C,O,D,I,L,R,F,N,P;if(o==="top")S=y(this.bottom),D=this.bottom-d,L=S-g,F=y(e.top)+g,P=e.bottom;else if(o==="bottom")S=y(this.top),F=e.top,P=y(e.bottom)-g,D=S+g,L=this.top+d;else if(o==="left")S=y(this.right),O=this.right-d,I=S-g,R=y(e.left)+g,N=e.right;else if(o==="right")S=y(this.left),R=e.left,N=y(e.right)-g,O=S+g,I=this.left+d;else if(t==="x"){if(o==="center")S=y((e.top+e.bottom)/2+.5);else if(nt(o)){const Y=Object.keys(o)[0],J=o[Y];S=y(this.chart.scales[Y].getPixelForValue(J))}F=e.top,P=e.bottom,D=S+g,L=D+d}else if(t==="y"){if(o==="center")S=y((e.left+e.right)/2);else if(nt(o)){const Y=Object.keys(o)[0],J=o[Y];S=y(this.chart.scales[Y].getPixelForValue(J))}O=S-g,I=O-d,R=e.left,N=e.right}const q=wt(l.ticks.maxTicksLimit,c),U=Math.max(1,Math.ceil(c/q));for(T=0;T<c;T+=U){const Y=this.getContext(T),J=s.setContext(Y),B=r.setContext(Y),W=J.lineWidth,pe=J.color,ee=B.dash||[],ue=B.dashOffset,Oe=J.tickWidth,He=J.tickColor,Je=J.tickBorderDash||[],xe=J.tickBorderDashOffset;$=l4(this,T,a),$!==void 0&&(C=Hi(i,$,W),u?O=I=R=N=C:D=L=F=P=C,m.push({tx1:O,ty1:D,tx2:I,ty2:L,x1:R,y1:F,x2:N,y2:P,width:W,color:pe,borderDash:ee,borderDashOffset:ue,tickWidth:Oe,tickColor:He,tickBorderDash:Je,tickBorderDashOffset:xe}))}return this._ticksLength=c,this._borderValue=S,m}_computeLabelItems(e){const t=this.axis,i=this.options,{position:l,ticks:s}=i,o=this.isHorizontal(),r=this.ticks,{align:a,crossAlign:u,padding:f,mirror:c}=s,d=Wl(i.grid),m=d+f,h=c?-f:m,_=-Ki(this.labelRotation),g=[];let y,S,T,$,C,O,D,I,L,R,F,N,P="middle";if(l==="top")O=this.bottom-h,D=this._getXAxisLabelAlignment();else if(l==="bottom")O=this.top+h,D=this._getXAxisLabelAlignment();else if(l==="left"){const U=this._getYAxisLabelAlignment(d);D=U.textAlign,C=U.x}else if(l==="right"){const U=this._getYAxisLabelAlignment(d);D=U.textAlign,C=U.x}else if(t==="x"){if(l==="center")O=(e.top+e.bottom)/2+m;else if(nt(l)){const U=Object.keys(l)[0],Y=l[U];O=this.chart.scales[U].getPixelForValue(Y)+m}D=this._getXAxisLabelAlignment()}else if(t==="y"){if(l==="center")C=(e.left+e.right)/2-m;else if(nt(l)){const U=Object.keys(l)[0],Y=l[U];C=this.chart.scales[U].getPixelForValue(Y)}D=this._getYAxisLabelAlignment(d).textAlign}t==="y"&&(a==="start"?P="top":a==="end"&&(P="bottom"));const q=this._getLabelSizes();for(y=0,S=r.length;y<S;++y){T=r[y],$=T.label;const U=s.setContext(this.getContext(y));I=this.getPixelForTick(y)+s.labelOffset,L=this._resolveTickFontOptions(y),R=L.lineHeight,F=Xt($)?$.length:1;const Y=F/2,J=U.color,B=U.textStrokeColor,W=U.textStrokeWidth;let pe=D;o?(C=I,D==="inner"&&(y===S-1?pe=this.options.reverse?"left":"right":y===0?pe=this.options.reverse?"right":"left":pe="center"),l==="top"?u==="near"||_!==0?N=-F*R+R/2:u==="center"?N=-q.highest.height/2-Y*R+R:N=-q.highest.height+R/2:u==="near"||_!==0?N=R/2:u==="center"?N=q.highest.height/2-Y*R:N=q.highest.height-F*R,c&&(N*=-1),_!==0&&!U.showLabelBackdrop&&(C+=R/2*Math.sin(_))):(O=I,N=(1-F)*R/2);let ee;if(U.showLabelBackdrop){const ue=Ai(U.backdropPadding),Oe=q.heights[y],He=q.widths[y];let Je=N-ue.top,xe=0-ue.left;switch(P){case"middle":Je-=Oe/2;break;case"bottom":Je-=Oe;break}switch(D){case"center":xe-=He/2;break;case"right":xe-=He;break;case"inner":y===S-1?xe-=He:y>0&&(xe-=He/2);break}ee={left:xe,top:Je,width:He+ue.width,height:Oe+ue.height,color:U.backdropColor}}g.push({label:$,font:L,textOffset:N,options:{rotation:_,color:J,strokeColor:B,strokeWidth:W,textAlign:pe,textBaseline:P,translation:[C,O],backdrop:ee}})}return g}_getXAxisLabelAlignment(){const{position:e,ticks:t}=this.options;if(-Ki(this.labelRotation))return e==="top"?"left":"right";let l="center";return t.align==="start"?l="left":t.align==="end"?l="right":t.align==="inner"&&(l="inner"),l}_getYAxisLabelAlignment(e){const{position:t,ticks:{crossAlign:i,mirror:l,padding:s}}=this.options,o=this._getLabelSizes(),r=e+s,a=o.widest.width;let u,f;return t==="left"?l?(f=this.right+s,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"?l?(f=this.left+s,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:l,width:s,height:o}=this;t&&(e.save(),e.fillStyle=t,e.fillRect(i,l,s,o),e.restore())}getLineWidthForValue(e){const t=this.options.grid;if(!this._isVisible()||!t.display)return 0;const l=this.ticks.findIndex(s=>s.value===e);return l>=0?t.setContext(this.getContext(l)).lineWidth:0}drawGrid(e){const t=this.options.grid,i=this.ctx,l=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(e));let s,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(s=0,o=l.length;s<o;++s){const a=l[s];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:{border:i,grid:l}}=this,s=i.setContext(this.getContext()),o=i.display?s.width:0;if(!o)return;const r=l.setContext(this.getContext(0)).lineWidth,a=this._borderValue;let u,f,c,d;this.isHorizontal()?(u=Hi(e,this.left,o)-o/2,f=Hi(e,this.right,r)+r/2,c=d=a):(c=Hi(e,this.top,o)-o/2,d=Hi(e,this.bottom,r)+r/2,u=f=a),t.save(),t.lineWidth=s.width,t.strokeStyle=s.color,t.beginPath(),t.moveTo(u,c),t.lineTo(f,d),t.stroke(),t.restore()}drawLabels(e){if(!this.options.ticks.display)return;const i=this.ctx,l=this._computeLabelArea();l&&Ha(i,l);const s=this.getLabelItems(e);for(const o of s){const r=o.options,a=o.font,u=o.label,f=o.textOffset;Ef(i,u,0,f,a,r)}l&&za(i)}drawTitle(){const{ctx:e,options:{position:t,title:i,reverse:l}}=this;if(!i.display)return;const s=ei(i.font),o=Ai(i.padding),r=i.align;let a=s.lineHeight/2;t==="bottom"||t==="center"||nt(t)?(a+=o.bottom,Xt(i.text)&&(a+=s.lineHeight*(i.text.length-1))):a+=o.top;const{titleX:u,titleY:f,maxWidth:c,rotation:d}=u4(this,a,t,r);Ef(e,i.text,0,0,s,{color:i.color,maxWidth:c,rotation:d,textAlign:a4(r,t,l),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=wt(e.grid&&e.grid.z,-1),l=wt(e.border&&e.border.z,0);return!this._isVisible()||this.draw!==Es.prototype.draw?[{z:t,draw:s=>{this.draw(s)}}]:[{z:i,draw:s=>{this.drawBackground(),this.drawGrid(s),this.drawTitle()}},{z:l,draw:()=>{this.drawBorder()}},{z:t,draw:s=>{this.drawLabels(s)}}]}getMatchingVisibleMetas(e){const t=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",l=[];let s,o;for(s=0,o=t.length;s<o;++s){const r=t[s];r[i]===this.id&&(!e||r.type===e)&&l.push(r)}return l}_resolveTickFontOptions(e){const t=this.options.ticks.setContext(this.getContext(e));return ei(t.font)}_maxDigits(){const e=this._resolveTickFontOptions(0).lineHeight;return(this.isHorizontal()?this.width:this.height)/e}}class Zs{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;d4(t)&&(i=this.register(t));const l=this.items,s=e.id,o=this.scope+"."+s;if(!s)throw new Error("class does not have id: "+e);return s in l||(l[s]=e,f4(e,o,i),this.override&&Ut.override(e.id,e.overrides)),o}get(e){return this.items[e]}unregister(e){const t=this.items,i=e.id,l=this.scope;i in t&&delete t[i],l&&i in Ut[l]&&(delete Ut[l][i],this.override&&delete xi[i])}}function f4(n,e,t){const i=ps(Object.create(null),[t?Ut.get(t):{},Ut.get(e),n.defaults]);Ut.set(e,i),n.defaultRoutes&&c4(e,n.defaultRoutes),n.descriptors&&Ut.describe(e,n.descriptors)}function c4(n,e){Object.keys(e).forEach(t=>{const i=t.split("."),l=i.pop(),s=[n].concat(i).join("."),o=e[t].split("."),r=o.pop(),a=o.join(".");Ut.route(s,l,a,r)})}function d4(n){return"id"in n&&"defaults"in n}class p4{constructor(){this.controllers=new Zs(ss,"datasets",!0),this.elements=new Zs(el,"elements"),this.plugins=new Zs(Object,"plugins"),this.scales=new Zs(Es,"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(l=>{const s=i||this._getRegistryForType(l);i||s.isForType(l)||s===this.plugins&&l.id?this._exec(e,s,l):ht(l,o=>{const r=i||this._getRegistryForType(o);this._exec(e,r,o)})})}_exec(e,t,i){const l=Ra(e);Ht(i["before"+l],[],i),t[e](i),Ht(i["after"+l],[],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 l=t.get(e);if(l===void 0)throw new Error('"'+e+'" is not a registered '+i+".");return l}}var Xn=new p4;class m4{constructor(){this._init=void 0}notify(e,t,i,l){if(t==="beforeInit"&&(this._init=this._createDescriptors(e,!0),this._notify(this._init,e,"install")),this._init===void 0)return;const s=l?this._descriptors(e).filter(l):this._descriptors(e),o=this._notify(s,e,t,i);return t==="afterDestroy"&&(this._notify(s,e,"stop"),this._notify(this._init,e,"uninstall"),this._init=void 0),o}_notify(e,t,i,l){l=l||{};for(const s of e){const o=s.plugin,r=o[i],a=[t,l,s.options];if(Ht(r,a,o)===!1&&l.cancelable)return!1}return!0}invalidate(){Et(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,l=wt(i.options&&i.options.plugins,{}),s=h4(i);return l===!1&&!t?[]:g4(e,s,l,t)}_notifyStateChanges(e){const t=this._oldCache||[],i=this._cache,l=(s,o)=>s.filter(r=>!o.some(a=>r.plugin.id===a.plugin.id));this._notify(l(t,i),e,"stop"),this._notify(l(i,t),e,"start")}}function h4(n){const e={},t=[],i=Object.keys(Xn.plugins.items);for(let s=0;s<i.length;s++)t.push(Xn.getPlugin(i[s]));const l=n.plugins||[];for(let s=0;s<l.length;s++){const o=l[s];t.indexOf(o)===-1&&(t.push(o),e[o.id]=!0)}return{plugins:t,localIds:e}}function _4(n,e){return!e&&n===!1?null:n===!0?{}:n}function g4(n,{plugins:e,localIds:t},i,l){const s=[],o=n.getContext();for(const r of e){const a=r.id,u=_4(i[a],l);u!==null&&s.push({plugin:r,options:b4(n.config,{plugin:r,local:t[a]},u,o)})}return s}function b4(n,{plugin:e,local:t},i,l){const s=n.pluginScopeKeys(e),o=n.getOptionScopes(i,s);return t&&e.defaults&&o.push(e.defaults),n.createResolver(o,l,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function ra(n,e){const t=Ut.datasets[n]||{};return((e.datasets||{})[n]||{}).indexAxis||e.indexAxis||t.indexAxis||"x"}function k4(n,e){let t=n;return n==="_index_"?t=e:n==="_value_"&&(t=e==="x"?"y":"x"),t}function y4(n,e){return n===e?"_index_":"_value_"}function tc(n){if(n==="x"||n==="y"||n==="r")return n}function v4(n){if(n==="top"||n==="bottom")return"x";if(n==="left"||n==="right")return"y"}function aa(n,...e){if(tc(n))return n;for(const t of e){const i=t.axis||v4(t.position)||n.length>1&&tc(n[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${n}' axis. Please provide 'axis' or 'position' option.`)}function nc(n,e,t){if(t[e+"AxisID"]===n)return{axis:e}}function w4(n,e){if(e.data&&e.data.datasets){const t=e.data.datasets.filter(i=>i.xAxisID===n||i.yAxisID===n);if(t.length)return nc(n,"x",t[0])||nc(n,"y",t[0])}return{}}function S4(n,e){const t=xi[n.type]||{scales:{}},i=e.scales||{},l=ra(n.type,e),s=Object.create(null);return Object.keys(i).forEach(o=>{const r=i[o];if(!nt(r))return console.error(`Invalid scale configuration for scale: ${o}`);if(r._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${o}`);const a=aa(o,r,w4(o,n),Ut.scales[r.type]),u=y4(a,l),f=t.scales||{};s[o]=ts(Object.create(null),[{axis:a},r,f[a],f[u]])}),n.data.datasets.forEach(o=>{const r=o.type||n.type,a=o.indexAxis||ra(r,e),f=(xi[r]||{}).scales||{};Object.keys(f).forEach(c=>{const d=k4(c,a),m=o[d+"AxisID"]||d;s[m]=s[m]||Object.create(null),ts(s[m],[{axis:d},i[m],f[c]])})}),Object.keys(s).forEach(o=>{const r=s[o];ts(r,[Ut.scales[r.type],Ut.scale])}),s}function Rb(n){const e=n.options||(n.options={});e.plugins=wt(e.plugins,{}),e.scales=S4(n,e)}function qb(n){return n=n||{},n.datasets=n.datasets||[],n.labels=n.labels||[],n}function $4(n){return n=n||{},n.data=qb(n.data),Rb(n),n}const ic=new Map,jb=new Set;function Gs(n,e){let t=ic.get(n);return t||(t=e(),ic.set(n,t),jb.add(t)),t}const Yl=(n,e,t)=>{const i=Do(e,t);i!==void 0&&n.add(i)};class T4{constructor(e){this._config=$4(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=qb(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(),Rb(e)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(e){return Gs(e,()=>[[`datasets.${e}`,""]])}datasetAnimationScopeKeys(e,t){return Gs(`${e}.transition.${t}`,()=>[[`datasets.${e}.transitions.${t}`,`transitions.${t}`],[`datasets.${e}`,""]])}datasetElementScopeKeys(e,t){return Gs(`${e}-${t}`,()=>[[`datasets.${e}.elements.${t}`,`datasets.${e}`,`elements.${t}`,""]])}pluginScopeKeys(e){const t=e.id,i=this.type;return Gs(`${i}-plugin-${t}`,()=>[[`plugins.${t}`,...e.additionalOptionScopes||[]]])}_cachedScopes(e,t){const i=this._scopeCache;let l=i.get(e);return(!l||t)&&(l=new Map,i.set(e,l)),l}getOptionScopes(e,t,i){const{options:l,type:s}=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=>Yl(a,e,c))),f.forEach(c=>Yl(a,l,c)),f.forEach(c=>Yl(a,xi[s]||{},c)),f.forEach(c=>Yl(a,Ut,c)),f.forEach(c=>Yl(a,sa,c))});const u=Array.from(a);return u.length===0&&u.push(Object.create(null)),jb.has(t)&&o.set(t,u),u}chartOptionScopes(){const{options:e,type:t}=this;return[e,xi[t]||{},Ut.datasets[t]||{},{type:t},Ut,sa]}resolveNamedOptions(e,t,i,l=[""]){const s={$shared:!0},{resolver:o,subPrefixes:r}=lc(this._resolverCache,e,l);let a=o;if(O4(o,t)){s.$shared=!1,i=Ii(i)?i():i;const u=this.createResolver(e,i,r);a=El(o,i,u)}for(const u of t)s[u]=a[u];return s}createResolver(e,t,i=[""],l){const{resolver:s}=lc(this._resolverCache,e,i);return nt(t)?El(s,t,void 0,l):s}}function lc(n,e,t){let i=n.get(e);i||(i=new Map,n.set(e,i));const l=t.join();let s=i.get(l);return s||(s={resolver:Va(e,t),subPrefixes:t.filter(r=>!r.toLowerCase().includes("hover"))},i.set(l,s)),s}const C4=n=>nt(n)&&Object.getOwnPropertyNames(n).some(e=>Ii(n[e]));function O4(n,e){const{isScriptable:t,isIndexable:i}=yb(n);for(const l of e){const s=t(l),o=i(l),r=(o||s)&&n[l];if(s&&(Ii(r)||C4(r))||o&&Xt(r))return!0}return!1}var M4="4.5.1";const D4=["top","bottom","left","right","chartArea"];function sc(n,e){return n==="top"||n==="bottom"||D4.indexOf(n)===-1&&e==="x"}function oc(n,e){return function(t,i){return t[n]===i[n]?t[e]-i[e]:t[n]-i[n]}}function rc(n){const e=n.chart,t=e.options.animation;e.notifyPlugins("afterRender"),Ht(t&&t.onComplete,[n],e)}function E4(n){const e=n.chart,t=e.options.animation;Ht(t&&t.onProgress,[n],e)}function Hb(n){return Wa()&&typeof n=="string"?n=document.getElementById(n):n&&n.length&&(n=n[0]),n&&n.canvas&&(n=n.canvas),n}const co={},ac=n=>{const e=Hb(n);return Object.values(co).filter(t=>t.canvas===e).pop()};function I4(n,e,t){const i=Object.keys(n);for(const l of i){const s=+l;if(s>=e){const o=n[l];delete n[l],(t>0||s>e)&&(n[s+t]=o)}}}function A4(n,e,t,i){return!t||n.type==="mouseout"?null:i?e:n}class di{static register(...e){Xn.add(...e),uc()}static unregister(...e){Xn.remove(...e),uc()}constructor(e,t){const i=this.config=new T4(t),l=Hb(e),s=ac(l);if(s)throw new Error("Canvas is already in use. Chart with ID '"+s.id+"' must be destroyed before the canvas with ID '"+s.canvas.id+"' can be reused.");const o=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||G3(l)),this.platform.updateConfig(i);const r=this.platform.acquireContext(l,o.aspectRatio),a=r&&r.canvas,u=a&&a.height,f=a&&a.width;if(this.id=F2(),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 m4,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=iw(c=>this.update(c),o.resizeDelay||0),this._dataChanges=[],co[this.id]=this,!r||!a){console.error("Failed to create chart: can't acquire context from the given item");return}ui.listen(this,"complete",rc),ui.listen(this,"progress",E4),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:e,maintainAspectRatio:t},width:i,height:l,_aspectRatio:s}=this;return Et(e)?t&&s?s:l?i/l: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}get registry(){return Xn}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Nf(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Df(this.canvas,this.ctx),this}stop(){return ui.stop(this),this}resize(e,t){ui.running(this)?this._resizeBeforeDraw={width:e,height:t}:this._resize(e,t)}_resize(e,t){const i=this.options,l=this.canvas,s=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(l,e,t,s),r=i.devicePixelRatio||this.platform.getDevicePixelRatio(),a=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,Nf(this,r,!0)&&(this.notifyPlugins("resize",{size:o}),Ht(i.onResize,[this,o],this),this.attached&&this._doResize(a)&&this.render())}ensureScalesHaveIDs(){const t=this.options.scales||{};ht(t,(i,l)=>{i.id=l})}buildOrUpdateScales(){const e=this.options,t=e.scales,i=this.scales,l=Object.keys(i).reduce((o,r)=>(o[r]=!1,o),{});let s=[];t&&(s=s.concat(Object.keys(t).map(o=>{const r=t[o],a=aa(o,r),u=a==="r",f=a==="x";return{options:r,dposition:u?"chartArea":f?"bottom":"left",dtype:u?"radialLinear":f?"category":"linear"}}))),ht(s,o=>{const r=o.options,a=r.id,u=aa(a,r),f=wt(r.type,o.dtype);(r.position===void 0||sc(r.position,u)!==sc(o.dposition))&&(r.position=o.dposition),l[a]=!0;let c=null;if(a in i&&i[a].type===f)c=i[a];else{const d=Xn.getScale(f);c=new d({id:a,type:f,ctx:this.ctx,chart:this}),i[c.id]=c}c.init(r,e)}),ht(l,(o,r)=>{o||delete i[r]}),ht(i,o=>{Ks.configure(this,o,o.options),Ks.addBox(this,o)})}_updateMetasets(){const e=this._metasets,t=this.data.datasets.length,i=e.length;if(e.sort((l,s)=>l.index-s.index),i>t){for(let l=t;l<i;++l)this._destroyDatasetMeta(l);e.splice(t,i-t)}this._sortedMetasets=e.slice(0).sort(oc("order","index"))}_removeUnreferencedMetasets(){const{_metasets:e,data:{datasets:t}}=this;e.length>t.length&&delete this._stacks,e.forEach((i,l)=>{t.filter(s=>s===i._dataset).length===0&&this._destroyDatasetMeta(l)})}buildOrUpdateControllers(){const e=[],t=this.data.datasets;let i,l;for(this._removeUnreferencedMetasets(),i=0,l=t.length;i<l;i++){const s=t[i];let o=this.getDatasetMeta(i);const r=s.type||this.config.type;if(o.type&&o.type!==r&&(this._destroyDatasetMeta(i),o=this.getDatasetMeta(i)),o.type=r,o.indexAxis=s.indexAxis||ra(r,this.options),o.order=s.order||0,o.index=i,o.label=""+s.label,o.visible=this.isDatasetVisible(i),o.controller)o.controller.updateIndex(i),o.controller.linkScales();else{const a=Xn.getController(r),{datasetElementType:u,dataElementType:f}=Ut.datasets[r];Object.assign(a,{dataElementType:Xn.getElement(f),datasetElementType:u&&Xn.getElement(u)}),o.controller=new a(this,i),e.push(o.controller)}}return this._updateMetasets(),e}_resetElements(){ht(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()),l=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:e,cancelable:!0})===!1)return;const s=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=!l&&s.indexOf(c)===-1;c.buildOrUpdateElements(d),o=Math.max(+c.getMaxOverflow(),o)}o=this._minPadding=i.layout.autoPadding?o:0,this._updateLayout(o),l||ht(s,u=>{u.reset()}),this._updateDatasets(e),this.notifyPlugins("afterUpdate",{mode:e}),this._layers.sort(oc("z","_idx"));const{_active:r,_lastEvent:a}=this;a?this._eventHandler(a,!0):r.length&&this._updateHoverStyles(r,r,!0),this.render()}_updateScales(){ht(this.scales,e=>{Ks.removeBox(this,e)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const e=this.options,t=new Set(Object.keys(this._listeners)),i=new Set(e.events);(!bf(t,i)||!!this._responsiveListeners!==e.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:e}=this,t=this._getUniformDataChanges()||[];for(const{method:i,start:l,count:s}of t){const o=i==="_removeElements"?-s:s;I4(e,l,o)}}_getUniformDataChanges(){const e=this._dataChanges;if(!e||!e.length)return;this._dataChanges=[];const t=this.data.datasets.length,i=s=>new Set(e.filter(o=>o[0]===s).map((o,r)=>r+","+o.splice(1).join(","))),l=i(0);for(let s=1;s<t;s++)if(!bf(l,i(s)))return;return Array.from(l).map(s=>s.split(",")).map(s=>({method:s[1],start:+s[2],count:+s[3]}))}_updateLayout(e){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;Ks.update(this,this.width,this.height,e);const t=this.chartArea,i=t.width<=0||t.height<=0;this._layers=[],ht(this.boxes,l=>{i&&l.position==="chartArea"||(l.configure&&l.configure(),this._layers.push(...l._layers()))},this),this._layers.forEach((l,s)=>{l._idx=s}),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,Ii(e)?e({datasetIndex:t}):e);this.notifyPlugins("afterDatasetsUpdate",{mode:e})}}_updateDataset(e,t){const i=this.getDatasetMeta(e),l={meta:i,index:e,mode:t,cancelable:!0};this.notifyPlugins("beforeDatasetUpdate",l)!==!1&&(i.controller._update(t),l.cancelable=!1,this.notifyPlugins("afterDatasetUpdate",l))}render(){this.notifyPlugins("beforeRender",{cancelable:!0})!==!1&&(ui.has(this)?this.attached&&!ui.running(this)&&ui.start(this):(this.draw(),rc({chart:this})))}draw(){let e;if(this._resizeBeforeDraw){const{width:i,height:l}=this._resizeBeforeDraw;this._resizeBeforeDraw=null,this._resize(i,l)}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 l,s;for(l=0,s=t.length;l<s;++l){const o=t[l];(!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={meta:e,index:e.index,cancelable:!0},l=Mb(this,e);this.notifyPlugins("beforeDatasetDraw",i)!==!1&&(l&&Ha(t,l),e.controller.draw(),l&&za(t),i.cancelable=!1,this.notifyPlugins("afterDatasetDraw",i))}isPointInArea(e){return hs(e,this.chartArea,this._minPadding)}getElementsAtEventForMode(e,t,i,l){const s=D3.modes[t];return typeof s=="function"?s(this,e,i,l):[]}getDatasetMeta(e){const t=this.data.datasets[e],i=this._metasets;let l=i.filter(s=>s&&s._dataset===t).pop();return l||(l={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(l)),l}getContext(){return this.$context||(this.$context=sl(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 l=i?"show":"hide",s=this.getDatasetMeta(e),o=s.controller._resolveAnimations(void 0,l);Eo(t)?(s.data[t].hidden=!i,this.update()):(this.setDatasetVisibility(e,i),o.update(s,{visible:i}),this.update(r=>r.datasetIndex===e?l: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(),ui.remove(this),e=0,t=this.data.datasets.length;e<t;++e)this._destroyDatasetMeta(e)}destroy(){this.notifyPlugins("beforeDestroy");const{canvas:e,ctx:t}=this;this._stop(),this.config.clearCache(),e&&(this.unbindEvents(),Df(e,t),this.platform.releaseContext(t),this.canvas=null,this.ctx=null),delete co[this.id],this.notifyPlugins("afterDestroy")}toBase64Image(...e){return this.canvas.toDataURL(...e)}bindEvents(){this.bindUserEvents(),this.options.responsive?this.bindResponsiveEvents():this.attached=!0}bindUserEvents(){const e=this._listeners,t=this.platform,i=(s,o)=>{t.addEventListener(this,s,o),e[s]=o},l=(s,o,r)=>{s.offsetX=o,s.offsetY=r,this._eventHandler(s)};ht(this.options.events,s=>i(s,l))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const e=this._responsiveListeners,t=this.platform,i=(a,u)=>{t.addEventListener(this,a,u),e[a]=u},l=(a,u)=>{e[a]&&(t.removeEventListener(this,a,u),delete e[a])},s=(a,u)=>{this.canvas&&this.resize(a,u)};let o;const r=()=>{l("attach",r),this.attached=!0,this.resize(),i("resize",s),i("detach",o)};o=()=>{this.attached=!1,l("resize",s),this._stop(),this._resize(0,0),i("attach",r)},t.isAttached(this.canvas)?r():o()}unbindEvents(){ht(this._listeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._listeners={},ht(this._responsiveListeners,(e,t)=>{this.platform.removeEventListener(this,t,e)}),this._responsiveListeners=void 0}updateHoverStyle(e,t,i){const l=i?"set":"remove";let s,o,r,a;for(t==="dataset"&&(s=this.getDatasetMeta(e[0].datasetIndex),s.controller["_"+l+"DatasetHoverStyle"]()),r=0,a=e.length;r<a;++r){o=e[r];const u=o&&this.getDatasetMeta(o.datasetIndex).controller;u&&u[l+"HoverStyle"](o.element,o.datasetIndex,o.index)}}getActiveElements(){return this._active||[]}setActiveElements(e){const t=this._active||[],i=e.map(({datasetIndex:s,index:o})=>{const r=this.getDatasetMeta(s);if(!r)throw new Error("No dataset found at index "+s);return{datasetIndex:s,element:r.data[o],index:o}});!Oo(i,t)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,t))}notifyPlugins(e,t,i){return this._plugins.notify(this,e,t,i)}isPluginEnabled(e){return this._plugins._cache.filter(t=>t.plugin.id===e).length===1}_updateHoverStyles(e,t,i){const l=this.options.hover,s=(a,u)=>a.filter(f=>!u.some(c=>f.datasetIndex===c.datasetIndex&&f.index===c.index)),o=s(t,e),r=i?e:s(e,t);o.length&&this.updateHoverStyle(o,l.mode,!1),r.length&&l.mode&&this.updateHoverStyle(r,l.mode,!0)}_eventHandler(e,t){const i={event:e,replay:t,cancelable:!0,inChartArea:this.isPointInArea(e)},l=o=>(o.options.events||this.options.events).includes(e.native.type);if(this.notifyPlugins("beforeEvent",i,l)===!1)return;const s=this._handleEvent(e,t,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,l),(s||i.changed)&&this.render(),this}_handleEvent(e,t,i){const{_active:l=[],options:s}=this,o=t,r=this._getActiveElements(e,l,i,o),a=V2(e),u=A4(e,this._lastEvent,i,a);i&&(this._lastEvent=null,Ht(s.onHover,[e,r,this],this),a&&Ht(s.onClick,[e,r,this],this));const f=!Oo(r,l);return(f||t)&&(this._active=r,this._updateHoverStyles(r,l,t)),this._lastEvent=u,f}_getActiveElements(e,t,i,l){if(e.type==="mouseout")return[];if(!i)return t;const s=this.options.hover;return this.getElementsAtEventForMode(e,s.mode,s,l)}}Ge(di,"defaults",Ut),Ge(di,"instances",co),Ge(di,"overrides",xi),Ge(di,"registry",Xn),Ge(di,"version",M4),Ge(di,"getChart",ac);function uc(){return ht(di.instances,n=>n._plugins.invalidate())}function zb(n,e,t=e){n.lineCap=wt(t.borderCapStyle,e.borderCapStyle),n.setLineDash(wt(t.borderDash,e.borderDash)),n.lineDashOffset=wt(t.borderDashOffset,e.borderDashOffset),n.lineJoin=wt(t.borderJoinStyle,e.borderJoinStyle),n.lineWidth=wt(t.borderWidth,e.borderWidth),n.strokeStyle=wt(t.borderColor,e.borderColor)}function L4(n,e,t){n.lineTo(t.x,t.y)}function N4(n){return n.stepped?bw:n.tension||n.cubicInterpolationMode==="monotone"?kw:L4}function Vb(n,e,t={}){const i=n.length,{start:l=0,end:s=i-1}=t,{start:o,end:r}=e,a=Math.max(l,o),u=Math.min(s,r),f=l<o&&s<o||l>r&&s>r;return{count:i,start:a,loop:e.loop,ilen:u<a&&!f?i+u-a:u-a}}function P4(n,e,t,i){const{points:l,options:s}=e,{count:o,start:r,loop:a,ilen:u}=Vb(l,t,i),f=N4(s);let{move:c=!0,reverse:d}=i||{},m,h,_;for(m=0;m<=u;++m)h=l[(r+(d?u-m:m))%o],!h.skip&&(c?(n.moveTo(h.x,h.y),c=!1):f(n,_,h,d,s.stepped),_=h);return a&&(h=l[(r+(d?u:0))%o],f(n,_,h,d,s.stepped)),!!a}function F4(n,e,t,i){const l=e.points,{count:s,start:o,ilen:r}=Vb(l,t,i),{move:a=!0,reverse:u}=i||{};let f=0,c=0,d,m,h,_,g,y;const S=$=>(o+(u?r-$:$))%s,T=()=>{_!==g&&(n.lineTo(f,g),n.lineTo(f,_),n.lineTo(f,y))};for(a&&(m=l[S(0)],n.moveTo(m.x,m.y)),d=0;d<=r;++d){if(m=l[S(d)],m.skip)continue;const $=m.x,C=m.y,O=$|0;O===h?(C<_?_=C:C>g&&(g=C),f=(c*f+$)/++c):(T(),n.lineTo($,C),h=O,c=0,_=g=C),y=C}T()}function ua(n){const e=n.options,t=e.borderDash&&e.borderDash.length;return!n._decimated&&!n._loop&&!e.tension&&e.cubicInterpolationMode!=="monotone"&&!e.stepped&&!t?F4:P4}function R4(n){return n.stepped?Qw:n.tension||n.cubicInterpolationMode==="monotone"?xw:Ui}function q4(n,e,t,i){let l=e._path;l||(l=e._path=new Path2D,e.path(l,t,i)&&l.closePath()),zb(n,e.options),n.stroke(l)}function j4(n,e,t,i){const{segments:l,options:s}=e,o=ua(e);for(const r of l)zb(n,s,r.style),n.beginPath(),o(n,e,r,{start:t,end:t+i-1})&&n.closePath(),n.stroke()}const H4=typeof Path2D=="function";function z4(n,e,t,i){H4&&!e.options.segment?q4(n,e,t,i):j4(n,e,t,i)}class Ci extends el{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 l=i.spanGaps?this._loop:this._fullLoop;Uw(this._points,i,e,l,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=r3(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,l=e[t],s=this.points,o=Ob(this,{property:t,start:l,end:l});if(!o.length)return;const r=[],a=R4(i);let u,f;for(u=0,f=o.length;u<f;++u){const{start:c,end:d}=o[u],m=s[c],h=s[d];if(m===h){r.push(m);continue}const _=Math.abs((l-m[t])/(h[t]-m[t])),g=a(m,h,_,i.stepped);g[t]=e[t],r.push(g)}return r.length===1?r[0]:r}pathSegment(e,t,i){return ua(this)(e,this,t,i)}path(e,t,i){const l=this.segments,s=ua(this);let o=this._loop;t=t||0,i=i||this.points.length-t;for(const r of l)o&=s(e,this,r,{start:t,end:t+i-1});return!!o}draw(e,t,i,l){const s=this.options||{};(this.points||[]).length&&s.borderWidth&&(e.save(),z4(e,this,i,l),e.restore()),this.animated&&(this._pointsUpdated=!1,this._path=void 0)}}Ge(Ci,"id","line"),Ge(Ci,"defaults",{borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0}),Ge(Ci,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"}),Ge(Ci,"descriptors",{_scriptable:!0,_indexable:e=>e!=="borderDash"&&e!=="fill"});function fc(n,e,t,i){const l=n.options,{[t]:s}=n.getProps([t],i);return Math.abs(e-s)<l.radius+l.hitRadius}class po extends el{constructor(t){super();Ge(this,"parsed");Ge(this,"skip");Ge(this,"stop");this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,i,l){const s=this.options,{x:o,y:r}=this.getProps(["x","y"],l);return Math.pow(t-o,2)+Math.pow(i-r,2)<Math.pow(s.hitRadius+s.radius,2)}inXRange(t,i){return fc(this,t,"x",i)}inYRange(t,i){return fc(this,t,"y",i)}getCenterPoint(t){const{x:i,y:l}=this.getProps(["x","y"],t);return{x:i,y:l}}size(t){t=t||this.options||{};let i=t.radius||0;i=Math.max(i,i&&t.hoverRadius||0);const l=i&&t.borderWidth||0;return(i+l)*2}draw(t,i){const l=this.options;this.skip||l.radius<.1||!hs(this,i,this.size(l)/2)||(t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.fillStyle=l.backgroundColor,oa(t,l,this.x,this.y))}getRange(){const t=this.options||{};return t.radius+t.hitRadius}}Ge(po,"id","point"),Ge(po,"defaults",{borderWidth:1,hitRadius:1,hoverBorderWidth:1,hoverRadius:4,pointStyle:"circle",radius:3,rotation:0}),Ge(po,"defaultRoutes",{backgroundColor:"backgroundColor",borderColor:"borderColor"});function V4(n,e,t){const i=n.segments,l=n.points,s=e.points,o=[];for(const r of i){let{start:a,end:u}=r;u=Qo(a,u,l);const f=fa(t,l[a],l[u],r.loop);if(!e.segments){o.push({source:r,target:f,start:l[a],end:l[u]});continue}const c=Ob(e,f);for(const d of c){const m=fa(t,s[d.start],s[d.end],d.loop),h=Cb(r,l,m);for(const _ of h)o.push({source:_,target:d,start:{[t]:cc(f,m,"start",Math.max)},end:{[t]:cc(f,m,"end",Math.min)}})}}return o}function fa(n,e,t,i){if(i)return;let l=e[n],s=t[n];return n==="angle"&&(l=Qn(l),s=Qn(s)),{property:n,start:l,end:s}}function B4(n,e){const{x:t=null,y:i=null}=n||{},l=e.points,s=[];return e.segments.forEach(({start:o,end:r})=>{r=Qo(o,r,l);const a=l[o],u=l[r];i!==null?(s.push({x:a.x,y:i}),s.push({x:u.x,y:i})):t!==null&&(s.push({x:t,y:a.y}),s.push({x:t,y:u.y}))}),s}function Qo(n,e,t){for(;e>n;e--){const i=t[e];if(!isNaN(i.x)&&!isNaN(i.y))break}return e}function cc(n,e,t,i){return n&&e?i(n[t],e[t]):n?n[t]:e?e[t]:0}function Bb(n,e){let t=[],i=!1;return Xt(n)?(i=!0,t=n):t=B4(n,e),t.length?new Ci({points:t,options:{tension:0},_loop:i,_fullLoop:i}):null}function dc(n){return n&&n.fill!==!1}function U4(n,e,t){let l=n[e].fill;const s=[e];let o;if(!t)return l;for(;l!==!1&&s.indexOf(l)===-1;){if(!rn(l))return l;if(o=n[l],!o)return!1;if(o.visible)return l;s.push(l),l=o.fill}return!1}function W4(n,e,t){const i=Z4(n);if(nt(i))return isNaN(i.value)?!1:i;let l=parseFloat(i);return rn(l)&&Math.floor(l)===l?Y4(i[0],e,l,t):["origin","start","end","stack","shape"].indexOf(i)>=0&&i}function Y4(n,e,t,i){return(n==="-"||n==="+")&&(t=e+t),t===e||t<0||t>=i?!1:t}function K4(n,e){let t=null;return n==="start"?t=e.bottom:n==="end"?t=e.top:nt(n)?t=e.getPixelForValue(n.value):e.getBasePixel&&(t=e.getBasePixel()),t}function J4(n,e,t){let i;return n==="start"?i=t:n==="end"?i=e.options.reverse?e.min:e.max:nt(n)?i=n.value:i=e.getBaseValue(),i}function Z4(n){const e=n.options,t=e.fill;let i=wt(t&&t.target,t);return i===void 0&&(i=!!e.backgroundColor),i===!1||i===null?!1:i===!0?"origin":i}function G4(n){const{scale:e,index:t,line:i}=n,l=[],s=i.segments,o=i.points,r=X4(e,t);r.push(Bb({x:null,y:e.bottom},i));for(let a=0;a<s.length;a++){const u=s[a];for(let f=u.start;f<=u.end;f++)Q4(l,o[f],r)}return new Ci({points:l,options:{}})}function X4(n,e){const t=[],i=n.getMatchingVisibleMetas("line");for(let l=0;l<i.length;l++){const s=i[l];if(s.index===e)break;s.hidden||t.unshift(s.dataset)}return t}function Q4(n,e,t){const i=[];for(let l=0;l<t.length;l++){const s=t[l],{first:o,last:r,point:a}=x4(s,e,"x");if(!(!a||o&&r)){if(o)i.unshift(a);else if(n.push(a),!r)break}}n.push(...i)}function x4(n,e,t){const i=n.interpolate(e,t);if(!i)return{};const l=i[t],s=n.segments,o=n.points;let r=!1,a=!1;for(let u=0;u<s.length;u++){const f=s[u],c=o[f.start][t],d=o[f.end][t];if(pb(l,c,d)){r=l===c,a=l===d;break}}return{first:r,last:a,point:i}}class Ub{constructor(e){this.x=e.x,this.y=e.y,this.radius=e.radius}pathSegment(e,t,i){const{x:l,y:s,radius:o}=this;return t=t||{start:0,end:ti},e.arc(l,s,o,t.end,t.start,!0),!i.bounds}interpolate(e){const{x:t,y:i,radius:l}=this,s=e.angle;return{x:t+Math.cos(s)*l,y:i+Math.sin(s)*l,angle:s}}}function eS(n){const{chart:e,fill:t,line:i}=n;if(rn(t))return tS(e,t);if(t==="stack")return G4(n);if(t==="shape")return!0;const l=nS(n);return l instanceof Ub?l:Bb(l,i)}function tS(n,e){const t=n.getDatasetMeta(e);return t&&n.isDatasetVisible(e)?t.dataset:null}function nS(n){return(n.scale||{}).getPointPositionForValue?lS(n):iS(n)}function iS(n){const{scale:e={},fill:t}=n,i=K4(t,e);if(rn(i)){const l=e.isHorizontal();return{x:l?i:null,y:l?null:i}}return null}function lS(n){const{scale:e,fill:t}=n,i=e.options,l=e.getLabels().length,s=i.reverse?e.max:e.min,o=J4(t,e,s),r=[];if(i.grid.circular){const a=e.getPointPositionForValue(0,s);return new Ub({x:a.x,y:a.y,radius:e.getDistanceFromCenterForValue(o)})}for(let a=0;a<l;++a)r.push(e.getPointPositionForValue(a,o));return r}function Tr(n,e,t){const i=eS(e),{chart:l,index:s,line:o,scale:r,axis:a}=e,u=o.options,f=u.fill,c=u.backgroundColor,{above:d=c,below:m=c}=f||{},h=l.getDatasetMeta(s),_=Mb(l,h);i&&o.points.length&&(Ha(n,t),sS(n,{line:o,target:i,above:d,below:m,area:t,scale:r,axis:a,clip:_}),za(n))}function sS(n,e){const{line:t,target:i,above:l,below:s,area:o,scale:r,clip:a}=e,u=t._loop?"angle":e.axis;n.save();let f=s;s!==l&&(u==="x"?(pc(n,i,o.top),Cr(n,{line:t,target:i,color:l,scale:r,property:u,clip:a}),n.restore(),n.save(),pc(n,i,o.bottom)):u==="y"&&(mc(n,i,o.left),Cr(n,{line:t,target:i,color:s,scale:r,property:u,clip:a}),n.restore(),n.save(),mc(n,i,o.right),f=l)),Cr(n,{line:t,target:i,color:f,scale:r,property:u,clip:a}),n.restore()}function pc(n,e,t){const{segments:i,points:l}=e;let s=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=l[a],c=l[Qo(a,u,l)];s?(n.moveTo(f.x,f.y),s=!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 mc(n,e,t){const{segments:i,points:l}=e;let s=!0,o=!1;n.beginPath();for(const r of i){const{start:a,end:u}=r,f=l[a],c=l[Qo(a,u,l)];s?(n.moveTo(f.x,f.y),s=!1):(n.lineTo(t,f.y),n.lineTo(f.x,f.y)),o=!!e.pathSegment(n,r,{move:o}),o?n.closePath():n.lineTo(t,c.y)}n.lineTo(t,e.first().y),n.closePath(),n.clip()}function Cr(n,e){const{line:t,target:i,property:l,color:s,scale:o,clip:r}=e,a=V4(t,i,l);for(const{source:u,target:f,start:c,end:d}of a){const{style:{backgroundColor:m=s}={}}=u,h=i!==!0;n.save(),n.fillStyle=m,oS(n,o,r,h&&fa(l,c,d)),n.beginPath();const _=!!t.pathSegment(n,u);let g;if(h){_?n.closePath():hc(n,i,d,l);const y=!!i.pathSegment(n,f,{move:_,reverse:!0});g=_&&y,g||hc(n,i,c,l)}n.closePath(),n.fill(g?"evenodd":"nonzero"),n.restore()}}function oS(n,e,t,i){const l=e.chart.chartArea,{property:s,start:o,end:r}=i||{};if(s==="x"||s==="y"){let a,u,f,c;s==="x"?(a=o,u=l.top,f=r,c=l.bottom):(a=l.left,u=o,f=l.right,c=r),n.beginPath(),t&&(a=Math.max(a,t.left),f=Math.min(f,t.right),u=Math.max(u,t.top),c=Math.min(c,t.bottom)),n.rect(a,u,f-a,c-u),n.clip()}}function hc(n,e,t,i){const l=e.interpolate(t,i);l&&n.lineTo(l.x,l.y)}var rS={id:"filler",afterDatasetsUpdate(n,e,t){const i=(n.data.datasets||[]).length,l=[];let s,o,r,a;for(o=0;o<i;++o)s=n.getDatasetMeta(o),r=s.dataset,a=null,r&&r.options&&r instanceof Ci&&(a={visible:n.isDatasetVisible(o),index:o,fill:W4(r,o,i),chart:n,axis:s.controller.options.indexAxis,scale:s.vScale,line:r}),s.$filler=a,l.push(a);for(o=0;o<i;++o)a=l[o],!(!a||a.fill===!1)&&(a.fill=U4(l,o,t.propagate))},beforeDraw(n,e,t){const i=t.drawTime==="beforeDraw",l=n.getSortedVisibleDatasetMetas(),s=n.chartArea;for(let o=l.length-1;o>=0;--o){const r=l[o].$filler;r&&(r.line.updateControlPoints(s,r.axis),i&&r.fill&&Tr(n.ctx,r,s))}},beforeDatasetsDraw(n,e,t){if(t.drawTime!=="beforeDatasetsDraw")return;const i=n.getSortedVisibleDatasetMetas();for(let l=i.length-1;l>=0;--l){const s=i[l].$filler;dc(s)&&Tr(n.ctx,s,n.chartArea)}},beforeDatasetDraw(n,e,t){const i=e.meta.$filler;!dc(i)||t.drawTime!=="beforeDatasetDraw"||Tr(n.ctx,i,n.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Ql={average(n){if(!n.length)return!1;let e,t,i=new Set,l=0,s=0;for(e=0,t=n.length;e<t;++e){const r=n[e].element;if(r&&r.hasValue()){const a=r.tooltipPosition();i.add(a.x),l+=a.y,++s}}return s===0||i.size===0?!1:{x:[...i].reduce((r,a)=>r+a)/i.size,y:l/s}},nearest(n,e){if(!n.length)return!1;let t=e.x,i=e.y,l=Number.POSITIVE_INFINITY,s,o,r;for(s=0,o=n.length;s<o;++s){const a=n[s].element;if(a&&a.hasValue()){const u=a.getCenterPoint(),f=la(e,u);f<l&&(l=f,r=a)}}if(r){const a=r.tooltipPosition();t=a.x,i=a.y}return{x:t,y:i}}};function Gn(n,e){return e&&(Xt(e)?Array.prototype.push.apply(n,e):n.push(e)),n}function fi(n){return(typeof n=="string"||n instanceof String)&&n.indexOf(`
|
||
`)>-1?n.split(`
|
||
`):n}function aS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function _c(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ei(e.bodyFont),u=ei(e.titleFont),f=ei(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ai(e.padding);let _=h.height,g=0,y=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=u.string,ht(n.title,T),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,ht(i,$=>{ht($.before,T),ht($.lines,T),ht($.after,T)}),S=0,t.font=f.string,ht(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function uS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function fS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function cS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),fS(u,n,e,t)&&(u="center"),u}function gc(n,e,t){const i=t.yAlign||e.yAlign||uS(n,t);return{xAlign:t.xAlign||e.xAlign||cS(n,e,t,i),yAlign:i}}function dS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function pS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function bc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=ao(o);let h=dS(e,r);const _=pS(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Bn(h,0,i.width-e.width),y:Bn(_,0,i.height-e.height)}}function Xs(n,e,t){const i=Ai(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function kc(n){return Gn([],fi(n))}function mS(n,e,t){return sl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function yc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Wb={beforeTitle:ai,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:ai,beforeBody:ai,beforeLabel:ai,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 Et(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:ai,afterBody:ai,beforeFooter:ai,footer:ai,afterFooter:ai};function pn(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?Wb[e].call(t,i):l}class ca extends el{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,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()),l=i.enabled&&t.options.animation&&i.animations,s=new Db(this.chart,l);return l._cacheable&&(this._cachedAnimations=Object.freeze(s)),s}getContext(){return this.$context||(this.$context=mS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,l=pn(i,"beforeTitle",this,e),s=pn(i,"title",this,e),o=pn(i,"afterTitle",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}getBeforeBody(e,t){return kc(pn(t.callbacks,"beforeBody",this,e))}getBody(e,t){const{callbacks:i}=t,l=[];return ht(e,s=>{const o={before:[],lines:[],after:[]},r=yc(i,s);Gn(o.before,fi(pn(r,"beforeLabel",this,s))),Gn(o.lines,pn(r,"label",this,s)),Gn(o.after,fi(pn(r,"afterLabel",this,s))),l.push(o)}),l}getAfterBody(e,t){return kc(pn(t.callbacks,"afterBody",this,e))}getFooter(e,t){const{callbacks:i}=t,l=pn(i,"beforeFooter",this,e),s=pn(i,"footer",this,e),o=pn(i,"afterFooter",this,e);let r=[];return r=Gn(r,fi(l)),r=Gn(r,fi(s)),r=Gn(r,fi(o)),r}_createItems(e){const t=this._active,i=this.chart.data,l=[],s=[],o=[];let r=[],a,u;for(a=0,u=t.length;a<u;++a)r.push(aS(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))),ht(r,f=>{const c=yc(e.callbacks,f);l.push(pn(c,"labelColor",this,f)),s.push(pn(c,"labelPointStyle",this,f)),o.push(pn(c,"labelTextColor",this,f))}),this.labelColors=l,this.labelPointStyles=s,this.labelTextColors=o,this.dataPoints=r,r}update(e,t){const i=this.options.setContext(this.getContext()),l=this._active;let s,o=[];if(!l.length)this.opacity!==0&&(s={opacity:0});else{const r=Ql[i.position].call(this,l,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const a=this._size=_c(this,i),u=Object.assign({},r,a),f=gc(this.chart,i,u),c=bc(i,u,f,this.chart);this.xAlign=f.xAlign,this.yAlign=f.yAlign,s={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,s&&this._resolveAnimations().update(this,s),e&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:t})}drawCaret(e,t,i,l){const s=this.getCaretPosition(e,i,l);t.lineTo(s.x1,s.y1),t.lineTo(s.x2,s.y2),t.lineTo(s.x3,s.y3)}getCaretPosition(e,t,i){const{xAlign:l,yAlign:s}=this,{caretSize:o,cornerRadius:r}=i,{topLeft:a,topRight:u,bottomLeft:f,bottomRight:c}=ao(r),{x:d,y:m}=e,{width:h,height:_}=t;let g,y,S,T,$,C;return s==="center"?($=m+_/2,l==="left"?(g=d,y=g-o,T=$+o,C=$-o):(g=d+h,y=g+o,T=$-o,C=$+o),S=g):(l==="left"?y=d+Math.max(a,f)+o:l==="right"?y=d+h-Math.max(u,c)-o:y=this.caretX,s==="top"?(T=m,$=T-o,g=y-o,S=y+o):(T=m+_,$=T+o,g=y+o,S=y-o),C=T),{x1:g,x2:y,x3:S,y1:T,y2:$,y3:C}}drawTitle(e,t,i){const l=this.title,s=l.length;let o,r,a;if(s){const u=br(i.rtl,this.x,this.width);for(e.x=Xs(this,i.titleAlign,i),t.textAlign=u.textAlign(i.titleAlign),t.textBaseline="middle",o=ei(i.titleFont),r=i.titleSpacing,t.fillStyle=i.titleColor,t.font=o.string,a=0;a<s;++a)t.fillText(l[a],u.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+r,a+1===s&&(e.y+=i.titleMarginBottom-r)}}_drawColorBox(e,t,i,l,s){const o=this.labelColors[i],r=this.labelPointStyles[i],{boxHeight:a,boxWidth:u}=s,f=ei(s.bodyFont),c=Xs(this,"left",s),d=l.x(c),m=a<f.lineHeight?(f.lineHeight-a)/2:0,h=t.y+m;if(s.usePointStyle){const _={radius:Math.min(u,a)/2,pointStyle:r.pointStyle,rotation:r.rotation,borderWidth:1},g=l.leftForLtr(d,u)+u/2,y=h+a/2;e.strokeStyle=s.multiKeyBackground,e.fillStyle=s.multiKeyBackground,oa(e,_,g,y),e.strokeStyle=o.borderColor,e.fillStyle=o.backgroundColor,oa(e,_,g,y)}else{e.lineWidth=nt(o.borderWidth)?Math.max(...Object.values(o.borderWidth)):o.borderWidth||1,e.strokeStyle=o.borderColor,e.setLineDash(o.borderDash||[]),e.lineDashOffset=o.borderDashOffset||0;const _=l.leftForLtr(d,u),g=l.leftForLtr(l.xPlus(d,1),u-2),y=ao(o.borderRadius);Object.values(y).some(S=>S!==0)?(e.beginPath(),e.fillStyle=s.multiKeyBackground,If(e,{x:_,y:h,w:u,h:a,radius:y}),e.fill(),e.stroke(),e.fillStyle=o.backgroundColor,e.beginPath(),If(e,{x:g,y:h+1,w:u-2,h:a-2,radius:y}),e.fill()):(e.fillStyle=s.multiKeyBackground,e.fillRect(_,h,u,a),e.strokeRect(_,h,u,a),e.fillStyle=o.backgroundColor,e.fillRect(g,h+1,u-2,a-2))}e.fillStyle=this.labelTextColors[i]}drawBody(e,t,i){const{body:l}=this,{bodySpacing:s,bodyAlign:o,displayColors:r,boxHeight:a,boxWidth:u,boxPadding:f}=i,c=ei(i.bodyFont);let d=c.lineHeight,m=0;const h=br(i.rtl,this.x,this.width),_=function(I){t.fillText(I,h.x(e.x+m),e.y+d/2),e.y+=d+s},g=h.textAlign(o);let y,S,T,$,C,O,D;for(t.textAlign=o,t.textBaseline="middle",t.font=c.string,e.x=Xs(this,g,i),t.fillStyle=i.bodyColor,ht(this.beforeBody,_),m=r&&g!=="right"?o==="center"?u/2+f:u+2+f:0,$=0,O=l.length;$<O;++$){for(y=l[$],S=this.labelTextColors[$],t.fillStyle=S,ht(y.before,_),T=y.lines,r&&T.length&&(this._drawColorBox(t,e,$,h,i),d=Math.max(c.lineHeight,a)),C=0,D=T.length;C<D;++C)_(T[C]),d=c.lineHeight;ht(y.after,_)}m=0,d=c.lineHeight,ht(this.afterBody,_),e.y-=s}drawFooter(e,t,i){const l=this.footer,s=l.length;let o,r;if(s){const a=br(i.rtl,this.x,this.width);for(e.x=Xs(this,i.footerAlign,i),e.y+=i.footerMarginTop,t.textAlign=a.textAlign(i.footerAlign),t.textBaseline="middle",o=ei(i.footerFont),t.fillStyle=i.footerColor,t.font=o.string,r=0;r<s;++r)t.fillText(l[r],a.x(e.x),e.y+o.lineHeight/2),e.y+=o.lineHeight+i.footerSpacing}}drawBackground(e,t,i,l){const{xAlign:s,yAlign:o}=this,{x:r,y:a}=e,{width:u,height:f}=i,{topLeft:c,topRight:d,bottomLeft:m,bottomRight:h}=ao(l.cornerRadius);t.fillStyle=l.backgroundColor,t.strokeStyle=l.borderColor,t.lineWidth=l.borderWidth,t.beginPath(),t.moveTo(r+c,a),o==="top"&&this.drawCaret(e,t,i,l),t.lineTo(r+u-d,a),t.quadraticCurveTo(r+u,a,r+u,a+d),o==="center"&&s==="right"&&this.drawCaret(e,t,i,l),t.lineTo(r+u,a+f-h),t.quadraticCurveTo(r+u,a+f,r+u-h,a+f),o==="bottom"&&this.drawCaret(e,t,i,l),t.lineTo(r+m,a+f),t.quadraticCurveTo(r,a+f,r,a+f-m),o==="center"&&s==="left"&&this.drawCaret(e,t,i,l),t.lineTo(r,a+c),t.quadraticCurveTo(r,a,r+c,a),t.closePath(),t.fill(),l.borderWidth>0&&t.stroke()}_updateAnimationTarget(e){const t=this.chart,i=this.$animations,l=i&&i.x,s=i&&i.y;if(l||s){const o=Ql[e.position].call(this,this._active,this._eventPosition);if(!o)return;const r=this._size=_c(this,e),a=Object.assign({},o,this._size),u=gc(t,e,a),f=bc(e,a,u,t);(l._to!==f.x||s._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 l={width:this.width,height:this.height},s={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ai(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(s,e,l,t),n3(e,t.textDirection),s.y+=o.top,this.drawTitle(s,e,t),this.drawBody(s,e,t),this.drawFooter(s,e,t),i3(e,t.textDirection),e.restore())}getActiveElements(){return this._active||[]}setActiveElements(e,t){const i=this._active,l=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}}),s=!Oo(i,l),o=this._positionChanged(l,t);(s||o)&&(this._active=l,this._eventPosition=t,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(e,t,i=!0){if(t&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const l=this.options,s=this._active||[],o=this._getActiveElements(e,s,t,i),r=this._positionChanged(o,e),a=t||!Oo(o,s)||r;return a&&(this._active=o,(l.enabled||l.external)&&(this._eventPosition={x:e.x,y:e.y},this.update(!0,t))),a}_getActiveElements(e,t,i,l){const s=this.options;if(e.type==="mouseout")return[];if(!l)return t.filter(r=>this.chart.data.datasets[r.datasetIndex]&&this.chart.getDatasetMeta(r.datasetIndex).controller.getParsed(r.index)!==void 0);const o=this.chart.getElementsAtEventForMode(e,s.mode,s,i);return s.reverse&&o.reverse(),o}_positionChanged(e,t){const{caretX:i,caretY:l,options:s}=this,o=Ql[s.position].call(this,e,t);return o!==!1&&(i!==o.x||l!==o.y)}}Ge(ca,"positioners",Ql);var hS={id:"tooltip",_element:ca,positioners:Ql,afterInit(n,e,t){t&&(n.tooltip=new ca({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,cancelable:!0})===!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:Wb},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"]};function _S(n,e){const t=[],{bounds:l,step:s,min:o,max:r,precision:a,count:u,maxTicks:f,maxDigits:c,includeBounds:d}=n,m=s||1,h=f-1,{min:_,max:g}=e,y=!Et(o),S=!Et(r),T=!Et(u),$=(g-_)/(c+1);let C=yf((g-_)/h/m)*m,O,D,I,L;if(C<1e-14&&!y&&!S)return[{value:_},{value:g}];L=Math.ceil(g/C)-Math.floor(_/C),L>h&&(C=yf(L*C/h/m)*m),Et(a)||(O=Math.pow(10,a),C=Math.ceil(C*O)/O),l==="ticks"?(D=Math.floor(_/C)*C,I=Math.ceil(g/C)*C):(D=_,I=g),y&&S&&s&&K2((r-o)/s,C/1e3)?(L=Math.round(Math.min((r-o)/C,f)),C=(r-o)/L,D=o,I=r):T?(D=y?o:D,I=S?r:I,L=u-1,C=(I-D)/L):(L=(I-D)/C,ns(L,Math.round(L),C/1e3)?L=Math.round(L):L=Math.ceil(L));const R=Math.max(vf(C),vf(D));O=Math.pow(10,Et(a)?R:a),D=Math.round(D*O)/O,I=Math.round(I*O)/O;let F=0;for(y&&(d&&D!==o?(t.push({value:o}),D<o&&F++,ns(Math.round((D+F*C)*O)/O,o,vc(o,$,n))&&F++):D<o&&F++);F<L;++F){const N=Math.round((D+F*C)*O)/O;if(S&&N>r)break;t.push({value:N})}return S&&d&&I!==r?t.length&&ns(t[t.length-1].value,r,vc(r,$,n))?t[t.length-1].value=r:t.push({value:r}):(!S||I===r)&&t.push({value:I}),t}function vc(n,e,{horizontal:t,minRotation:i}){const l=Ki(i),s=(t?Math.sin(l):Math.cos(l))||.001,o=.75*e*(""+n).length;return Math.min(e/s,o)}class gS extends Es{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 Et(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:l,max:s}=this;const o=a=>l=t?l:a,r=a=>s=i?s:a;if(e){const a=Dl(l),u=Dl(s);a<0&&u<0?r(0):a>0&&u>0&&o(0)}if(l===s){let a=s===0?1:Math.abs(s*.05);r(s+a),e||o(l-a)}this.min=l,this.max=s}getTickLimit(){const e=this.options.ticks;let{maxTicksLimit:t,stepSize:i}=e,l;return i?(l=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,l>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${l} ticks. Limiting to 1000.`),l=1e3)):(l=this.computeTickLimit(),t=t||11),t&&(l=Math.min(t,l)),l}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const e=this.options,t=e.ticks;let i=this.getTickLimit();i=Math.max(2,i);const l={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},s=this._range||this,o=_S(l,s);return e.bounds==="ticks"&&J2(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 l=(i-t)/Math.max(e.length-1,1)/2;t-=l,i+=l}this._startValue=t,this._endValue=i,this._valueRange=i-t}getLabelForValue(e){return gb(e,this.chart.options.locale,this.options.ticks.format)}}class da extends gS{determineDataLimits(){const{min:e,max:t}=this.getMinMax(!0);this.min=rn(e)?e:0,this.max=rn(t)?t:1,this.handleTickRangeOptions()}computeTickLimit(){const e=this.isHorizontal(),t=e?this.width:this.height,i=Ki(this.options.ticks.minRotation),l=(e?Math.sin(i):Math.cos(i))||.001,s=this._resolveTickFontOptions(0);return Math.ceil(t/Math.min(40,s.lineHeight/l))}getPixelForValue(e){return e===null?NaN:this.getPixelForDecimal((e-this._startValue)/this._valueRange)}getValueForPixel(e){return this._startValue+this.getDecimalForPixel(e)*this._valueRange}}Ge(da,"id","linear"),Ge(da,"defaults",{ticks:{callback:bb.formatters.numeric}});const xo={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},_n=Object.keys(xo);function wc(n,e){return n-e}function Sc(n,e){if(Et(e))return null;const t=n._adapter,{parser:i,round:l,isoWeekday:s}=n._parseOpts;let o=e;return typeof i=="function"&&(o=i(o)),rn(o)||(o=typeof i=="string"?t.parse(o,i):t.parse(o)),o===null?null:(l&&(o=l==="week"&&(ms(s)||s===!0)?t.startOf(o,"isoWeek",s):t.startOf(o,l)),+o)}function $c(n,e,t,i){const l=_n.length;for(let s=_n.indexOf(n);s<l-1;++s){const o=xo[_n[s]],r=o.steps?o.steps:Number.MAX_SAFE_INTEGER;if(o.common&&Math.ceil((t-e)/(r*o.size))<=i)return _n[s]}return _n[l-1]}function bS(n,e,t,i,l){for(let s=_n.length-1;s>=_n.indexOf(t);s--){const o=_n[s];if(xo[o].common&&n._adapter.diff(l,i,o)>=e-1)return o}return _n[t?_n.indexOf(t):0]}function kS(n){for(let e=_n.indexOf(n)+1,t=_n.length;e<t;++e)if(xo[_n[e]].common)return _n[e]}function Tc(n,e,t){if(!t)n[e]=!0;else if(t.length){const{lo:i,hi:l}=qa(t,e),s=t[i]>=e?t[i]:t[l];n[s]=!0}}function yS(n,e,t,i){const l=n._adapter,s=+l.startOf(e[0].value,i),o=e[e.length-1].value;let r,a;for(r=s;r<=o;r=+l.add(r,1,i))a=t[r],a>=0&&(e[a].major=!0);return e}function Cc(n,e,t){const i=[],l={},s=e.length;let o,r;for(o=0;o<s;++o)r=e[o],l[r]=o,i.push({value:r,major:!1});return s===0||!t?i:yS(n,i,l,t)}class gs extends Es{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={}),l=this._adapter=new Ib._date(e.adapters.date);l.init(t),ts(i.displayFormats,l.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:Sc(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:l,max:s,minDefined:o,maxDefined:r}=this.getUserBounds();function a(u){!o&&!isNaN(u.min)&&(l=Math.min(l,u.min)),!r&&!isNaN(u.max)&&(s=Math.max(s,u.max))}(!o||!r)&&(a(this._getLabelBounds()),(e.bounds!=="ticks"||e.ticks.source!=="labels")&&a(this.getMinMax(!1))),l=rn(l)&&!isNaN(l)?l:+t.startOf(Date.now(),i),s=rn(s)&&!isNaN(s)?s:+t.endOf(Date.now(),i)+1,this.min=Math.min(l,s-1),this.max=Math.max(l+1,s)}_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,l=i.source==="labels"?this.getLabelTimestamps():this._generate();e.bounds==="ticks"&&l.length&&(this.min=this._userMin||l[0],this.max=this._userMax||l[l.length-1]);const s=this.min,o=this.max,r=ew(l,s,o);return this._unit=t.unit||(i.autoSkip?$c(t.minUnit,this.min,this.max,this._getLabelCapacity(s)):bS(this,r.length,t.minUnit,this.min,this.max)),this._majorUnit=!i.major.enabled||this._unit==="year"?void 0:kS(this._unit),this.initOffsets(l),e.reverse&&r.reverse(),Cc(this,r,this._majorUnit)}afterAutoSkip(){this.options.offsetAfterAutoskip&&this.initOffsets(this.ticks.map(e=>+e.value))}initOffsets(e=[]){let t=0,i=0,l,s;this.options.offset&&e.length&&(l=this.getDecimalForValue(e[0]),e.length===1?t=1-l:t=(this.getDecimalForValue(e[1])-l)/2,s=this.getDecimalForValue(e[e.length-1]),e.length===1?i=s:i=(s-this.getDecimalForValue(e[e.length-2]))/2);const o=e.length<3?.5:.25;t=Bn(t,0,o),i=Bn(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,l=this.options,s=l.time,o=s.unit||$c(s.minUnit,t,i,this._getLabelCapacity(t)),r=wt(l.ticks.stepSize,1),a=o==="week"?s.isoWeekday:!1,u=ms(a)||a===!0,f={};let c=t,d,m;if(u&&(c=+e.startOf(c,"isoWeek",a)),c=+e.startOf(c,u?"day":o),e.diff(i,t,o)>1e5*r)throw new Error(t+" and "+i+" are too far apart with stepSize of "+r+" "+o);const h=l.ticks.source==="data"&&this.getDataTimestamps();for(d=c,m=0;d<i;d=+e.add(d,r,o),m++)Tc(f,d,h);return(d===i||l.bounds==="ticks"||m===1)&&Tc(f,d,h),Object.keys(f).sort(wc).map(_=>+_)}getLabelForValue(e){const t=this._adapter,i=this.options.time;return i.tooltipFormat?t.format(e,i.tooltipFormat):t.format(e,i.displayFormats.datetime)}format(e,t){const l=this.options.time.displayFormats,s=this._unit,o=t||l[s];return this._adapter.format(e,o)}_tickFormatFunction(e,t,i,l){const s=this.options,o=s.ticks.callback;if(o)return Ht(o,[e,t,i],this);const r=s.time.displayFormats,a=this._unit,u=this._majorUnit,f=a&&r[a],c=u&&r[u],d=i[t],m=u&&c&&d&&d.major;return this._adapter.format(e,l||(m?c:f))}generateTickLabels(e){let t,i,l;for(t=0,i=e.length;t<i;++t)l=e[t],l.label=this._tickFormatFunction(l.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,l=Ki(this.isHorizontal()?t.maxRotation:t.minRotation),s=Math.cos(l),o=Math.sin(l),r=this._resolveTickFontOptions(0).size;return{w:i*s+r*o,h:i*o+r*s}}_getLabelCapacity(e){const t=this.options.time,i=t.displayFormats,l=i[t.unit]||i.millisecond,s=this._tickFormatFunction(e,0,Cc(this,[e],this._majorUnit),l),o=this._getLabelSize(s),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 l=this.getMatchingVisibleMetas();if(this._normalized&&l.length)return this._cache.data=l[0].controller.getAllParsedValues(this);for(t=0,i=l.length;t<i;++t)e=e.concat(l[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 l=this.getLabels();for(t=0,i=l.length;t<i;++t)e.push(Sc(this,l[t]));return this._cache.labels=this._normalized?e:this.normalize(e)}normalize(e){return nw(e.sort(wc))}}Ge(gs,"id","time"),Ge(gs,"defaults",{bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",callback:!1,major:{enabled:!1}}});function Qs(n,e,t){let i=0,l=n.length-1,s,o,r,a;t?(e>=n[i].pos&&e<=n[l].pos&&({lo:i,hi:l}=Ji(n,"pos",e)),{pos:s,time:r}=n[i],{pos:o,time:a}=n[l]):(e>=n[i].time&&e<=n[l].time&&({lo:i,hi:l}=Ji(n,"time",e)),{time:s,pos:r}=n[i],{time:o,pos:a}=n[l]);const u=o-s;return u?r+(a-r)*(e-s)/u:r}class Oc extends gs{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=Qs(t,this.min),this._tableRange=Qs(t,this.max)-this._minPos,super.initOffsets(e)}buildLookupTable(e){const{min:t,max:i}=this,l=[],s=[];let o,r,a,u,f;for(o=0,r=e.length;o<r;++o)u=e[o],u>=t&&u<=i&&l.push(u);if(l.length<2)return[{time:t,pos:0},{time:i,pos:1}];for(o=0,r=l.length;o<r;++o)f=l[o+1],a=l[o-1],u=l[o],Math.round((f+a)/2)!==u&&s.push({time:u,pos:o/(r-1)});return s}_generate(){const e=this.min,t=this.max;let i=super.getDataTimestamps();return(!i.includes(e)||!i.length)&&i.splice(0,0,e),(!i.includes(t)||i.length===1)&&i.push(t),i.sort((l,s)=>l-s)}_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(Qs(this._table,e)-this._minPos)/this._tableRange}getValueForPixel(e){const t=this._offsets,i=this.getDecimalForPixel(e)/t.factor-t.end;return Qs(this._table,i*this._tableRange+this._minPos,!0)}}Ge(Oc,"id","timeseries"),Ge(Oc,"defaults",gs.defaults);/*!
|
||
* chartjs-adapter-luxon v1.3.1
|
||
* https://www.chartjs.org
|
||
* (c) 2023 chartjs-adapter-luxon Contributors
|
||
* Released under the MIT license
|
||
*/const vS={datetime:je.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:je.TIME_WITH_SECONDS,minute:je.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Ib._date.override({_id:"luxon",_create:function(n){return je.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return vS},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=je.fromFormat(n,e,t):n=je.fromISO(n,t):n instanceof Date?n=je.fromJSDate(n,t):i==="object"&&!(n instanceof je)&&(n=je.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 Mc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,Wt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function wS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c=n[2]&&Mc();return{c(){e=b("div"),t=b("div"),i=Z("Found "),l=Z(n[1]),s=M(),r=Z(o),a=M(),c&&c.c(),u=M(),f=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,l),k(t,s),k(t,r),k(e,a),c&&c.m(e,null),k(e,u),k(e,f),n[8](f)},p(d,[m]){m&2&&se(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&se(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&E(c,1):(c=Mc(),c.c(),E(c,1),c.m(e,u)):c&&(ie(),A(c,1,1,()=>{c=null}),le()),m&4&&x(e,"loading",d[2])},i(d){E(c)},o(d){A(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function SS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,u=!1;async function f(){t(2,u=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return re.logs.getStats({filter:m}).then(h=>{c(),h=j.toArray(h);for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),re.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(7,r=[]),t(1,a=0)}Kt(()=>(di.register(Ci,po,uo,da,gs,rS,hS),t(6,o=new di(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,u,i,l,f,o,r,d]}class $S extends ge{constructor(e){super(),_e(this,e,SS,wS,me,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function TS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-s3jkbp"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-s3jkbp")},m(l,s){w(l,e,s),k(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-s3jkbp")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function CS(n,e,t){let{content:i=""}=e,{language:l="javascript"}=e,{class:s=""}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Prism.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.highlight(a,Prism.languages[l]||Prism.languages.javascript,l)}return n.$$set=a=>{"content"in a&&t(2,i=a.content),"language"in a&&t(3,l=a.language),"class"in a&&t(0,s=a.class)},n.$$.update=()=>{n.$$.dirty&4&&typeof Prism<"u"&&i&&t(1,o=r(i))},[s,o,i,l]}class Yb extends ge{constructor(e){super(),_e(this,e,CS,TS,me,{content:2,language:3,class:0})}}const OS=n=>({}),Dc=n=>({}),MS=n=>({}),Ec=n=>({});function Ic(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T=n[4]&&!n[2]&&Ac(n);const $=n[19].header,C=St($,n,n[18],Ec);let O=n[4]&&n[2]&&Lc(n);const D=n[19].default,I=St(D,n,n[18],null),L=n[19].footer,R=St(L,n,n[18],Dc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),O&&O.c(),u=M(),f=b("div"),I&&I.c(),c=M(),d=b("div"),R&&R.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(s,"class",m="overlay-panel "+n[1]+" "+n[8]),x(s,"popup",n[2]),p(e,"class","overlay-panel-container"),x(e,"padded",n[2]),x(e,"active",n[0])},m(F,N){w(F,e,N),k(e,t),k(e,l),k(e,s),k(s,o),T&&T.m(o,null),k(o,r),C&&C.m(o,null),k(o,a),O&&O.m(o,null),k(s,u),k(s,f),I&&I.m(f,null),n[21](f),k(s,c),k(s,d),R&&R.m(d,null),g=!0,y||(S=[K(t,"click",Ue(n[20])),K(f,"scroll",n[22])],y=!0)},p(F,N){n=F,n[4]&&!n[2]?T?(T.p(n,N),N[0]&20&&E(T,1)):(T=Ac(n),T.c(),E(T,1),T.m(o,r)):T&&(ie(),A(T,1,1,()=>{T=null}),le()),C&&C.p&&(!g||N[0]&262144)&&Tt(C,$,n,n[18],g?$t($,n[18],N,MS):Ct(n[18]),Ec),n[4]&&n[2]?O?O.p(n,N):(O=Lc(n),O.c(),O.m(o,null)):O&&(O.d(1),O=null),I&&I.p&&(!g||N[0]&262144)&&Tt(I,D,n,n[18],g?$t(D,n[18],N,null):Ct(n[18]),null),R&&R.p&&(!g||N[0]&262144)&&Tt(R,L,n,n[18],g?$t(L,n[18],N,OS):Ct(n[18]),Dc),(!g||N[0]&258&&m!==(m="overlay-panel "+n[1]+" "+n[8]))&&p(s,"class",m),(!g||N[0]&262)&&x(s,"popup",n[2]),(!g||N[0]&4)&&x(e,"padded",n[2]),(!g||N[0]&1)&&x(e,"active",n[0])},i(F){g||(F&&Ke(()=>{g&&(i||(i=Fe(t,cs,{duration:wi,opacity:0},!0)),i.run(1))}),E(T),E(C,F),E(I,F),E(R,F),F&&Ke(()=>{g&&(_&&_.end(1),h=zg(s,Fn,n[2]?{duration:wi,y:-10}:{duration:wi,x:50}),h.start())}),g=!0)},o(F){F&&(i||(i=Fe(t,cs,{duration:wi,opacity:0},!1)),i.run(0)),A(T),A(C,F),A(I,F),A(R,F),h&&h.invalidate(),F&&(_=ka(s,Fn,n[2]?{duration:wi,y:10}:{duration:wi,x:50})),g=!1},d(F){F&&v(e),F&&i&&i.end(),T&&T.d(),C&&C.d(F),O&&O.d(),I&&I.d(F),n[21](null),R&&R.d(F),F&&_&&_.end(),y=!1,we(S)}}}function Ac(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","overlay-close")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",Ue(n[5])),l=!0)},p(o,r){n=o},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,cs,{duration:wi},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,cs,{duration:wi},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function Lc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line txt-lg" aria-hidden="true"></i>',p(e,"type","button"),p(e,"aria-label","Close"),p(e,"class","btn btn-sm btn-circle btn-transparent btn-close m-l-auto")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ue(n[5])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function DS(n){let e,t,i,l,s=n[0]&&Ic(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","overlay-panel-wrapper"),p(e,"tabindex","-1")},m(o,r){w(o,e,r),s&&s.m(e,null),n[23](e),t=!0,i||(l=[K(window,"resize",n[10]),K(window,"keydown",n[9])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Ic(o),s.c(),E(s,1),s.m(e,null)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[23](null),i=!1,we(l)}}}let Vi,Or=[];function Kb(){return Vi=Vi||document.querySelector(".overlays"),Vi||(Vi=document.createElement("div"),Vi.classList.add("overlays"),document.body.appendChild(Vi)),Vi}let wi=150;function Nc(){return 1e3+Kb().querySelectorAll(".overlay-panel-container.active").length}function ES(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,{active:o=!1}=e,{popup:r=!1}=e,{overlayClose:a=!0}=e,{btnClose:u=!0}=e,{escClose:f=!0}=e,{beforeOpen:c=void 0}=e,{beforeHide:d=void 0}=e;const m=lt(),h="op_"+j.randomString(10);let _,g,y,S,T="",$=o;function C(){typeof c=="function"&&c()===!1||t(0,o=!0)}function O(){typeof d=="function"&&d()===!1||t(0,o=!1)}function D(){return o}async function I(W){t(17,$=W),W?(y=document.activeElement,m("show"),_==null||_.focus()):(clearTimeout(S),m("hide"),y==null||y.focus()),await Qt(),L()}function L(){_&&(o?t(6,_.style.zIndex=Nc(),_):t(6,_.style="",_))}function R(){j.pushUnique(Or,h),document.body.classList.add("overlay-active")}function F(){j.removeByValue(Or,h),Or.length||document.body.classList.remove("overlay-active")}function N(W){o&&f&&W.code=="Escape"&&!j.isInput(W.target)&&_&&_.style.zIndex==Nc()&&(W.preventDefault(),O())}function P(W){o&&q(g)}function q(W,pe){pe&&t(8,T=""),!(!W||S)&&(S=setTimeout(()=>{if(clearTimeout(S),S=null,!W)return;if(W.scrollHeight-W.offsetHeight>0)t(8,T="scrollable");else{t(8,T="");return}W.scrollTop==0?t(8,T+=" scroll-top-reached"):W.scrollTop+W.offsetHeight==W.scrollHeight&&t(8,T+=" scroll-bottom-reached")},100))}Kt(()=>(Kb().appendChild(_),()=>{var W;clearTimeout(S),F(),(W=_==null?void 0:_.classList)==null||W.add("hidden"),setTimeout(()=>{_==null||_.remove()},0)}));const U=()=>a?O():!0;function Y(W){te[W?"unshift":"push"](()=>{g=W,t(7,g)})}const J=W=>q(W.target);function B(W){te[W?"unshift":"push"](()=>{_=W,t(6,_)})}return n.$$set=W=>{"class"in W&&t(1,s=W.class),"active"in W&&t(0,o=W.active),"popup"in W&&t(2,r=W.popup),"overlayClose"in W&&t(3,a=W.overlayClose),"btnClose"in W&&t(4,u=W.btnClose),"escClose"in W&&t(12,f=W.escClose),"beforeOpen"in W&&t(13,c=W.beforeOpen),"beforeHide"in W&&t(14,d=W.beforeHide),"$$scope"in W&&t(18,l=W.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&131073&&$!=o&&I(o),n.$$.dirty[0]&128&&q(g,!0),n.$$.dirty[0]&64&&_&&L(),n.$$.dirty[0]&1&&(o?R():F())},[o,s,r,a,u,O,_,g,T,N,P,q,f,c,d,C,D,$,l,i,U,Y,J,B]}class Gt extends ge{constructor(e){super(),_e(this,e,ES,DS,me,{class:1,active:0,popup:2,overlayClose:3,btnClose:4,escClose:12,beforeOpen:13,beforeHide:14,show:15,hide:5,isActive:16},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[5]}get isActive(){return this.$$.ctx[16]}}function IS(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"tabindex","-1"),p(e,"role","button"),p(e,"class",t=n[3]?n[2]:n[1]),p(e,"aria-label","Copy to clipboard")},m(o,r){w(o,e,r),l||(s=[$e(i=Pe.call(null,e,n[3]?void 0:n[0])),K(e,"click",Tn(n[4]))],l=!0)},p(o,[r]){r&14&&t!==(t=o[3]?o[2]:o[1])&&p(e,"class",t),i&&Mt(i.update)&&r&9&&i.update.call(null,o[3]?void 0:o[0])},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function AS(n,e,t){let{value:i=""}=e,{tooltip:l="Copy"}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:o="ri-check-line txt-sm txt-success"}=e,{successDuration:r=500}=e,a;function u(){i&&(j.copyToClipboard(i),clearTimeout(a),t(3,a=setTimeout(()=>{clearTimeout(a),t(3,a=null)},r)))}return Kt(()=>()=>{a&&clearTimeout(a)}),n.$$set=f=>{"value"in f&&t(5,i=f.value),"tooltip"in f&&t(0,l=f.tooltip),"idleClasses"in f&&t(1,s=f.idleClasses),"successClasses"in f&&t(2,o=f.successClasses),"successDuration"in f&&t(6,r=f.successDuration)},[l,s,o,a,u,i,r]}class ol extends ge{constructor(e){super(),_e(this,e,AS,IS,me,{value:5,tooltip:0,idleClasses:1,successClasses:2,successDuration:6})}}function Pc(n,e,t){const i=n.slice();i[16]=e[t];const l=i[1].data[i[16]];i[17]=l;const s=i[17]!==null&&typeof i[17]=="object";return i[18]=s,i}function LS(n){let e,t,i,l,s,o,r,a,u,f,c=n[1].id+"",d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;a=new ol({props:{value:n[1].id}}),S=new sb({props:{level:n[1].level}}),I=new ob({props:{date:n[1].created}});let N=!n[4]&&Fc(n),P=fe(n[5](n[1].data)),q=[];for(let Y=0;Y<P.length;Y+=1)q[Y]=Rc(Pc(n,P,Y));const U=Y=>A(q[Y],1,1,()=>{q[Y]=null});return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),V(a.$$.fragment),u=M(),f=b("div"),d=Z(c),m=M(),h=b("tr"),_=b("td"),_.textContent="level",g=M(),y=b("td"),V(S.$$.fragment),T=M(),$=b("tr"),C=b("td"),C.textContent="created",O=M(),D=b("td"),V(I.$$.fragment),L=M(),N&&N.c(),R=M();for(let Y=0;Y<q.length;Y+=1)q[Y].c();p(l,"class","min-width txt-hint txt-bold"),p(f,"class","txt"),p(r,"class","label"),p(_,"class","min-width txt-hint txt-bold"),p(C,"class","min-width txt-hint txt-bold"),p(e,"class","table-border")},m(Y,J){w(Y,e,J),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(o,r),H(a,r,null),k(r,u),k(r,f),k(f,d),k(t,m),k(t,h),k(h,_),k(h,g),k(h,y),H(S,y,null),k(t,T),k(t,$),k($,C),k($,O),k($,D),H(I,D,null),k(t,L),N&&N.m(t,null),k(t,R);for(let B=0;B<q.length;B+=1)q[B]&&q[B].m(t,null);F=!0},p(Y,J){const B={};J&2&&(B.value=Y[1].id),a.$set(B),(!F||J&2)&&c!==(c=Y[1].id+"")&&se(d,c);const W={};J&2&&(W.level=Y[1].level),S.$set(W);const pe={};if(J&2&&(pe.date=Y[1].created),I.$set(pe),Y[4]?N&&(N.d(1),N=null):N?N.p(Y,J):(N=Fc(Y),N.c(),N.m(t,R)),J&50){P=fe(Y[5](Y[1].data));let ee;for(ee=0;ee<P.length;ee+=1){const ue=Pc(Y,P,ee);q[ee]?(q[ee].p(ue,J),E(q[ee],1)):(q[ee]=Rc(ue),q[ee].c(),E(q[ee],1),q[ee].m(t,null))}for(ie(),ee=P.length;ee<q.length;ee+=1)U(ee);le()}},i(Y){if(!F){E(a.$$.fragment,Y),E(S.$$.fragment,Y),E(I.$$.fragment,Y);for(let J=0;J<P.length;J+=1)E(q[J]);F=!0}},o(Y){A(a.$$.fragment,Y),A(S.$$.fragment,Y),A(I.$$.fragment,Y),q=q.filter(Boolean);for(let J=0;J<q.length;J+=1)A(q[J]);F=!1},d(Y){Y&&v(e),z(a),z(S),z(I),N&&N.d(),ot(q,Y)}}}function NS(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Fc(n){let e,t,i,l;function s(a,u){return a[1].message?FS:PS}let o=s(n),r=o(n);return{c(){e=b("tr"),t=b("td"),t.textContent="message",i=M(),l=b("td"),r.c(),p(t,"class","min-width txt-hint txt-bold")},m(a,u){w(a,e,u),k(e,t),k(e,i),k(e,l),r.m(l,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r.d(1),r=o(a),r&&(r.c(),r.m(l,null)))},d(a){a&&v(e),r.d()}}}function PS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function FS(n){let e,t=n[1].message+"",i;return{c(){e=b("span"),i=Z(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[1].message+"")&&se(i,t)},d(l){l&&v(e)}}}function RS(n){let e,t=n[17]+"",i,l=n[4]&&n[16]=="execTime"?"ms":"",s;return{c(){e=b("span"),i=Z(t),s=Z(l),p(e,"class","txt")},m(o,r){w(o,e,r),k(e,i),k(e,s)},p(o,r){r&2&&t!==(t=o[17]+"")&&se(i,t),r&18&&l!==(l=o[4]&&o[16]=="execTime"?"ms":"")&&se(s,l)},i:Q,o:Q,d(o){o&&v(e)}}}function qS(n){let e,t;return e=new Yb({props:{content:n[17],language:"html"}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=i[17]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function jS(n){let e,t=n[17]+"",i;return{c(){e=b("span"),i=Z(t),p(e,"class","label label-danger log-error-label svelte-144j2mz")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&2&&t!==(t=l[17]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function HS(n){let e,t;return e=new Yb({props:{content:JSON.stringify(n[17],null,2)}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.content=JSON.stringify(i[17],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function zS(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Rc(n){let e,t,i,l=n[16]+"",s,o,r,a,u,f,c,d;const m=[zS,HS,jS,qS,RS],h=[];function _(g,y){return y&2&&(a=null),a==null&&(a=!!j.isEmpty(g[17])),a?0:g[18]?1:g[16]=="error"?2:g[16]=="details"?3:4}return u=_(n,-1),f=h[u]=m[u](n),{c(){e=b("tr"),t=b("td"),i=Z("data."),s=Z(l),o=M(),r=b("td"),f.c(),c=M(),p(t,"class","min-width txt-hint txt-bold"),x(t,"v-align-top",n[18])},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,s),k(e,o),k(e,r),h[u].m(r,null),k(e,c),d=!0},p(g,y){(!d||y&2)&&l!==(l=g[16]+"")&&se(s,l),(!d||y&34)&&x(t,"v-align-top",g[18]);let S=u;u=_(g,y),u===S?h[u].p(g,y):(ie(),A(h[S],1,1,()=>{h[S]=null}),le(),f=h[u],f?f.p(g,y):(f=h[u]=m[u](g),f.c()),E(f,1),f.m(r,null))},i(g){d||(E(f),d=!0)},o(g){A(f),d=!1},d(g){g&&v(e),h[u].d()}}}function VS(n){let e,t,i,l;const s=[NS,LS],o=[];function r(a,u){var f;return a[3]?0:(f=a[1])!=null&&f.id?1:-1}return~(e=r(n))&&(t=o[e]=s[e](n)),{c(){t&&t.c(),i=ye()},m(a,u){~e&&o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?~e&&o[e].p(a,u):(t&&(ie(),A(o[f],1,1,()=>{o[f]=null}),le()),~e?(t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i)):t=null)},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),~e&&o[e].d(a)}}}function BS(n){let e;return{c(){e=b("h4"),e.textContent="Request log"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function US(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',t=M(),i=b("button"),l=b("i"),s=M(),o=b("span"),o.textContent="Download as JSON",p(e,"type","button"),p(e,"class","btn btn-transparent"),p(l,"class","ri-download-line"),p(o,"class","txt"),p(i,"type","button"),p(i,"class","btn btn-primary"),i.disabled=n[3]},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),k(i,l),k(i,s),k(i,o),r||(a=[K(e,"click",n[9]),K(i,"click",n[10])],r=!0)},p(u,f){f&8&&(i.disabled=u[3])},d(u){u&&(v(e),v(t),v(i)),r=!1,we(a)}}}function WS(n){let e,t,i={class:"overlay-panel-lg log-panel",$$slots:{footer:[US],header:[BS],default:[VS]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&2097178&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}const qc="log_view";function YS(n,e,t){let i;const l=lt();let s,o={},r=!1;function a(T){return f(T).then($=>{t(1,o=$),h()}),s==null?void 0:s.show()}function u(){return re.cancelRequest(qc),s==null?void 0:s.hide()}async function f(T){if(T&&typeof T!="string")return t(3,r=!1),T;t(3,r=!0);let $={};try{$=await re.logs.getOne(T,{requestKey:qc})}catch(C){C.isAbort||(u(),console.warn("resolveModel:",C),ii(`Unable to load log with id "${T}"`))}return t(3,r=!1),$}const c=["execTime","type","auth","status","method","url","referer","remoteIp","userIp","userAgent","error","details"];function d(T){if(!T)return[];let $=[];for(let O of c)typeof T[O]<"u"&&$.push(O);const C=Object.keys(T);for(let O of C)$.includes(O)||$.push(O);return $}function m(){j.downloadJson(o,"log_"+o.created.replaceAll(/[-:\. ]/gi,"")+".json")}function h(){l("show",o)}function _(){l("hide",o),t(1,o={})}const g=()=>u(),y=()=>m();function S(T){te[T?"unshift":"push"](()=>{s=T,t(2,s)})}return n.$$.update=()=>{var T;n.$$.dirty&2&&t(4,i=((T=o.data)==null?void 0:T.type)=="request")},[u,o,s,r,i,d,m,_,a,g,y,S]}class KS extends ge{constructor(e){super(),_e(this,e,YS,WS,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function JS(n,e,t){const i=n.slice();return i[1]=e[t],i}function ZS(n){let e;return{c(){e=b("code"),e.textContent=`${n[1].level}:${n[1].label}`,p(e,"class","txt-xs")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function GS(n){let e,t,i,l=fe(Q1),s=[];for(let o=0;o<l.length;o+=1)s[o]=ZS(JS(n,l,o));return{c(){e=b("div"),t=Z(`Default log levels:
|
||
`),i=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(i,"class","inline-flex flex-gap-5"),p(e,"class",n[0])},m(o,r){w(o,e,r),k(e,t),k(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(i,null)},p(o,[r]){r&1&&p(e,"class",o[0])},i:Q,o:Q,d(o){o&&v(e),ot(s,o)}}}function XS(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class Jb extends ge{constructor(e){super(),_e(this,e,XS,GS,me,{class:0})}}function QS(n){let e,t,i,l,s,o,r,a,u;return t=new ce({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[e$,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[t$,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[n$,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=M(),V(l.$$.fragment),s=M(),V(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(f,c){w(f,e,c),H(t,e,null),k(e,i),H(l,e,null),k(e,s),H(o,e,null),r=!0,a||(u=K(e,"submit",Ue(n[7])),a=!0)},p(f,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:f}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:f}),o.$set(h)},i(f){r||(E(t.$$.fragment,f),E(l.$$.fragment,f),E(o.$$.fragment,f),r=!0)},o(f){A(t.$$.fragment,f),A(l.$$.fragment,f),A(o.$$.fragment,f),r=!1},d(f){f&&v(e),z(t),z(l),z(o),a=!1,u()}}}function xS(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function e$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Z("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to <code>0</code> to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&it(s.value)!==c[1].logs.maxDays&&oe(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function t$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Jb({}),{c(){e=b("label"),t=Z("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=M(),V(f.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(h,_){w(h,e,_),k(e,t),w(h,l,_),w(h,s,_),oe(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),k(r,a),k(r,u),H(f,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&it(s.value)!==h[1].logs.minLevel&&oe(s,h[1].logs.minLevel)},i(h){c||(E(f.$$.fragment,h),c=!0)},o(h){A(f.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),z(f),d=!1,m()}}}function n$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIp,w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIp),f&4194304&&o!==(o=u[22])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function i$(n){let e,t,i,l;const s=[xS,QS],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function l$(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function s$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),k(e,t),w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&8&&(e.disabled=u[3]),f&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function o$(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[14],$$slots:{footer:[s$],header:[l$],default:[i$]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[15](e),e.$on("hide",n[16]),e.$on("show",n[17]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeHide=l[14]),s&8388666&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),z(e,l)}}}function r$(n,e,t){let i,l;const s=lt(),o="logs_settings_"+j.randomString(3);let r,a=!1,u=!1,f={},c={};function d(){return h(),_(),r==null?void 0:r.show()}function m(){return r==null?void 0:r.hide()}function h(){Zt(),t(9,f={}),t(1,c=JSON.parse(JSON.stringify(f||{})))}async function _(){t(4,u=!0);try{const L=await re.settings.getAll()||{};y(L)}catch(L){re.error(L)}t(4,u=!1)}async function g(){if(l){t(3,a=!0);try{const L=await re.settings.update(j.filterRedactedProps(c));y(L),t(3,a=!1),m(),Pt("Successfully saved logs settings."),s("save",L)}catch(L){t(3,a=!1),re.error(L)}}}function y(L={}){t(1,c={logs:(L==null?void 0:L.logs)||{}}),t(9,f=JSON.parse(JSON.stringify(c)))}function S(){c.logs.maxDays=it(this.value),t(1,c)}function T(){c.logs.minLevel=it(this.value),t(1,c)}function $(){c.logs.logIp=this.checked,t(1,c)}const C=()=>!a;function O(L){te[L?"unshift":"push"](()=>{r=L,t(2,r)})}function D(L){Ce.call(this,n,L)}function I(L){Ce.call(this,n,L)}return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(f)),n.$$.dirty&1026&&t(5,l=i!=JSON.stringify(c))},[m,c,r,a,u,l,o,g,d,f,i,S,T,$,C,O,D,I]}class a$ extends ge{constructor(e){super(),_e(this,e,r$,o$,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function u$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Include requests by admins"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&4&&(e.checked=u[2]),f&4194304&&o!==(o=u[22])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function jc(n){let e,t;return e=new $S({props:{filter:n[1],presets:n[5]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.filter=i[1]),l&32&&(s.presets=i[5]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Hc(n){let e,t,i;function l(o){n[13](o)}let s={presets:n[5]};return n[1]!==void 0&&(s.filter=n[1]),e=new p2({props:s}),te.push(()=>be(e,"filter",l)),e.$on("select",n[14]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&32&&(a.presets=o[5]),!t&&r&2&&(t=!0,a.filter=o[1],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function f$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$=n[4],C,O=n[4],D,I,L,R;u=new Jo({}),u.$on("refresh",n[10]),h=new ce({props:{class:"form-field form-field-toggle m-0",$$slots:{default:[u$,({uniqueId:P})=>({22:P}),({uniqueId:P})=>P?4194304:0]},$$scope:{ctx:n}}}),g=new Ms({props:{value:n[1],placeholder:"Search term or filter like `level > 0 && data.auth = 'guest'`",extraAutocompleteKeys:["level","message","data."]}}),g.$on("submit",n[12]),S=new Jb({props:{class:"block txt-sm txt-hint m-t-xs m-b-base"}});let F=jc(n),N=Hc(n);return{c(){e=b("div"),t=b("header"),i=b("nav"),l=b("div"),s=Z(n[6]),o=M(),r=b("button"),r.innerHTML='<i class="ri-settings-4-line"></i>',a=M(),V(u.$$.fragment),f=M(),c=b("div"),d=M(),m=b("div"),V(h.$$.fragment),_=M(),V(g.$$.fragment),y=M(),V(S.$$.fragment),T=M(),F.c(),C=M(),N.c(),D=ye(),p(l,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"aria-label","Logs settings"),p(r,"class","btn btn-transparent btn-circle"),p(c,"class","flex-fill"),p(m,"class","inline-flex"),p(t,"class","page-header"),p(e,"class","page-header-wrapper m-b-0")},m(P,q){w(P,e,q),k(e,t),k(t,i),k(i,l),k(l,s),k(t,o),k(t,r),k(t,a),H(u,t,null),k(t,f),k(t,c),k(t,d),k(t,m),H(h,m,null),k(e,_),H(g,e,null),k(e,y),H(S,e,null),k(e,T),F.m(e,null),w(P,C,q),N.m(P,q),w(P,D,q),I=!0,L||(R=[$e(Pe.call(null,r,{text:"Logs settings",position:"right"})),K(r,"click",n[9])],L=!0)},p(P,q){(!I||q&64)&&se(s,P[6]);const U={};q&12582916&&(U.$$scope={dirty:q,ctx:P}),h.$set(U);const Y={};q&2&&(Y.value=P[1]),g.$set(Y),q&16&&me($,$=P[4])?(ie(),A(F,1,1,Q),le(),F=jc(P),F.c(),E(F,1),F.m(e,null)):F.p(P,q),q&16&&me(O,O=P[4])?(ie(),A(N,1,1,Q),le(),N=Hc(P),N.c(),E(N,1),N.m(D.parentNode,D)):N.p(P,q)},i(P){I||(E(u.$$.fragment,P),E(h.$$.fragment,P),E(g.$$.fragment,P),E(S.$$.fragment,P),E(F),E(N),I=!0)},o(P){A(u.$$.fragment,P),A(h.$$.fragment,P),A(g.$$.fragment,P),A(S.$$.fragment,P),A(F),A(N),I=!1},d(P){P&&(v(e),v(C),v(D)),z(u),z(h),z(g),z(S),F.d(P),N.d(P),L=!1,we(R)}}}function c$(n){let e,t,i,l,s,o;e=new bn({props:{$$slots:{default:[f$]},$$scope:{ctx:n}}});let r={};i=new KS({props:r}),n[15](i),i.$on("show",n[16]),i.$on("hide",n[17]);let a={};return s=new a$({props:a}),n[18](s),s.$on("save",n[7]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(u,f){H(e,u,f),w(u,t,f),H(i,u,f),w(u,l,f),H(s,u,f),o=!0},p(u,[f]){const c={};f&8388735&&(c.$$scope={dirty:f,ctx:u}),e.$set(c);const d={};i.$set(d);const m={};s.$set(m)},i(u){o||(E(e.$$.fragment,u),E(i.$$.fragment,u),E(s.$$.fragment,u),o=!0)},o(u){A(e.$$.fragment,u),A(i.$$.fragment,u),A(s.$$.fragment,u),o=!1},d(u){u&&(v(t),v(l)),z(e,u),n[15](null),z(i,u),n[18](null),z(s,u)}}}const xs="logId",zc="adminRequests",Vc="adminLogRequests";function d$(n,e,t){var L;let i,l,s;We(n,qo,R=>t(19,l=R)),We(n,Lt,R=>t(6,s=R)),xt(Lt,s="Logs",s);const o=new URLSearchParams(l);let r,a,u=1,f=o.get("filter")||"",c=(o.get(zc)||((L=window.localStorage)==null?void 0:L.getItem(Vc)))<<0,d=c;function m(){t(4,u++,u)}function h(R={}){let F={};F.filter=f||null,F[zc]=c<<0||null,j.replaceHashQueryParams(Object.assign(F,R))}const _=()=>a==null?void 0:a.show(),g=()=>m();function y(){c=this.checked,t(2,c)}const S=R=>t(1,f=R.detail);function T(R){f=R,t(1,f)}const $=R=>r==null?void 0:r.show(R==null?void 0:R.detail);function C(R){te[R?"unshift":"push"](()=>{r=R,t(0,r)})}const O=R=>{var N;let F={};F[xs]=((N=R.detail)==null?void 0:N.id)||null,j.replaceHashQueryParams(F)},D=()=>{let R={};R[xs]=null,j.replaceHashQueryParams(R)};function I(R){te[R?"unshift":"push"](()=>{a=R,t(3,a)})}return n.$$.update=()=>{var R;n.$$.dirty&1&&o.get(xs)&&r&&r.show(o.get(xs)),n.$$.dirty&4&&t(5,i=c?"":'data.auth!="admin"'),n.$$.dirty&260&&d!=c&&(t(8,d=c),(R=window.localStorage)==null||R.setItem(Vc,c<<0),h()),n.$$.dirty&2&&typeof f<"u"&&h()},[r,f,c,a,u,i,s,m,d,_,g,y,S,T,$,C,O,D,I]}class p$ extends ge{constructor(e){super(),_e(this,e,d$,c$,me,{})}}function m$(n){let e,t,i;return{c(){e=b("span"),p(e,"class","dragline svelte-y9un12"),x(e,"dragging",n[1])},m(l,s){w(l,e,s),n[4](e),t||(i=[K(e,"mousedown",n[5]),K(e,"touchstart",n[2])],t=!0)},p(l,[s]){s&2&&x(e,"dragging",l[1])},i:Q,o:Q,d(l){l&&v(e),n[4](null),t=!1,we(i)}}}function h$(n,e,t){const i=lt();let{tolerance:l=0}=e,s,o=0,r=0,a=0,u=0,f=!1;function c(g){g.stopPropagation(),o=g.clientX,r=g.clientY,a=g.clientX-s.offsetLeft,u=g.clientY-s.offsetTop,document.addEventListener("touchmove",m),document.addEventListener("mousemove",m),document.addEventListener("touchend",d),document.addEventListener("mouseup",d)}function d(g){f&&(g.preventDefault(),t(1,f=!1),s.classList.remove("no-pointer-events"),i("dragstop",{event:g,elem:s})),document.removeEventListener("touchmove",m),document.removeEventListener("mousemove",m),document.removeEventListener("touchend",d),document.removeEventListener("mouseup",d)}function m(g){let y=g.clientX-o,S=g.clientY-r,T=g.clientX-a,$=g.clientY-u;!f&&Math.abs(T-s.offsetLeft)<l&&Math.abs($-s.offsetTop)<l||(g.preventDefault(),f||(t(1,f=!0),s.classList.add("no-pointer-events"),i("dragstart",{event:g,elem:s})),i("dragging",{event:g,elem:s,diffX:y,diffY:S}))}function h(g){te[g?"unshift":"push"](()=>{s=g,t(0,s)})}const _=g=>{g.button==0&&c(g)};return n.$$set=g=>{"tolerance"in g&&t(3,l=g.tolerance)},[s,f,c,l,h,_]}class _$ extends ge{constructor(e){super(),_e(this,e,h$,m$,me,{tolerance:3})}}function g$(n){let e,t,i,l,s;const o=n[5].default,r=St(o,n,n[4],null);return l=new _$({}),l.$on("dragstart",n[7]),l.$on("dragging",n[8]),l.$on("dragstop",n[9]),{c(){e=b("aside"),r&&r.c(),i=M(),V(l.$$.fragment),p(e,"class",t="page-sidebar "+n[0])},m(a,u){w(a,e,u),r&&r.m(e,null),n[6](e),w(a,i,u),H(l,a,u),s=!0},p(a,[u]){r&&r.p&&(!s||u&16)&&Tt(r,o,a,a[4],s?$t(o,a[4],u,null):Ct(a[4]),null),(!s||u&1&&t!==(t="page-sidebar "+a[0]))&&p(e,"class",t)},i(a){s||(E(r,a),E(l.$$.fragment,a),s=!0)},o(a){A(r,a),A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(i)),r&&r.d(a),n[6](null),z(l,a)}}}const Bc="@adminSidebarWidth";function b$(n,e,t){let{$$slots:i={},$$scope:l}=e,{class:s=""}=e,o,r,a=localStorage.getItem(Bc)||null;function u(m){te[m?"unshift":"push"](()=>{o=m,t(1,o),t(2,a)})}const f=()=>{t(3,r=o.offsetWidth)},c=m=>{t(2,a=r+m.detail.diffX+"px")},d=()=>{j.triggerResize()};return n.$$set=m=>{"class"in m&&t(0,s=m.class),"$$scope"in m&&t(4,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&6&&a&&o&&(t(1,o.style.width=a,o),localStorage.setItem(Bc,a))},[s,o,a,r,l,i,u,f,c,d]}class Zb extends ge{constructor(e){super(),_e(this,e,b$,g$,me,{class:0})}}const Ja=Cn({});function fn(n,e,t){Ja.set({text:n,yesCallback:e,noCallback:t})}function Gb(){Ja.set({})}function Uc(n){let e,t,i;const l=n[18].default,s=St(l,n,n[17],null);return{c(){e=b("div"),s&&s.c(),p(e,"class",n[1]),x(e,"active",n[0])},m(o,r){w(o,e,r),s&&s.m(e,null),n[19](e),i=!0},p(o,r){s&&s.p&&(!i||r[0]&131072)&&Tt(s,l,o,o[17],i?$t(l,o[17],r,null):Ct(o[17]),null),(!i||r[0]&2)&&p(e,"class",o[1]),(!i||r[0]&3)&&x(e,"active",o[0])},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,Fn,{duration:150,y:3},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,Fn,{duration:150,y:3},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),n[19](null),o&&t&&t.end()}}}function k$(n){let e,t,i,l,s=n[0]&&Uc(n);return{c(){e=b("div"),s&&s.c(),p(e,"class","toggler-container"),p(e,"tabindex","-1"),p(e,"role","menu")},m(o,r){w(o,e,r),s&&s.m(e,null),n[20](e),t=!0,i||(l=[K(window,"click",n[7]),K(window,"mousedown",n[6]),K(window,"keydown",n[5]),K(window,"focusin",n[4])],i=!0)},p(o,r){o[0]?s?(s.p(o,r),r[0]&1&&E(s,1)):(s=Uc(o),s.c(),E(s,1),s.m(e,null)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){t||(E(s),t=!0)},o(o){A(s),t=!1},d(o){o&&v(e),s&&s.d(),n[20](null),i=!1,we(l)}}}function y$(n,e,t){let{$$slots:i={},$$scope:l}=e,{trigger:s=void 0}=e,{active:o=!1}=e,{escClose:r=!0}=e,{autoScroll:a=!0}=e,{closableClass:u="closable"}=e,{class:f=""}=e,c,d,m,h,_,g=!1;const y=lt();function S(W=0){o&&(clearTimeout(_),_=setTimeout(T,W))}function T(){o&&(t(0,o=!1),g=!1,clearTimeout(h),clearTimeout(_))}function $(){clearTimeout(_),clearTimeout(h),!o&&(t(0,o=!0),m!=null&&m.contains(c)||c==null||c.focus(),h=setTimeout(()=>{a&&(d!=null&&d.scrollIntoViewIfNeeded?d==null||d.scrollIntoViewIfNeeded():d!=null&&d.scrollIntoView&&(d==null||d.scrollIntoView({behavior:"smooth",block:"nearest"})))},180))}function C(){o?T():$()}function O(W){return!c||W.classList.contains(u)||c.contains(W)&&W.closest&&W.closest("."+u)}function D(W){I(),c==null||c.addEventListener("click",L),c==null||c.addEventListener("keydown",R),t(16,m=W||(c==null?void 0:c.parentNode)),m==null||m.addEventListener("click",F),m==null||m.addEventListener("keydown",N)}function I(){clearTimeout(h),clearTimeout(_),c==null||c.removeEventListener("click",L),c==null||c.removeEventListener("keydown",R),m==null||m.removeEventListener("click",F),m==null||m.removeEventListener("keydown",N)}function L(W){W.stopPropagation(),O(W.target)&&T()}function R(W){(W.code==="Enter"||W.code==="Space")&&(W.stopPropagation(),O(W.target)&&S(150))}function F(W){W.preventDefault(),W.stopPropagation(),C()}function N(W){(W.code==="Enter"||W.code==="Space")&&(W.preventDefault(),W.stopPropagation(),C())}function P(W){o&&!(m!=null&&m.contains(W.target))&&!(c!=null&&c.contains(W.target))&&C()}function q(W){o&&r&&W.code==="Escape"&&(W.preventDefault(),T())}function U(W){o&&(g=!(c!=null&&c.contains(W.target)))}function Y(W){var pe;o&&g&&!(c!=null&&c.contains(W.target))&&!(m!=null&&m.contains(W.target))&&!((pe=W.target)!=null&&pe.closest(".flatpickr-calendar"))&&T()}Kt(()=>(D(),()=>I()));function J(W){te[W?"unshift":"push"](()=>{d=W,t(3,d)})}function B(W){te[W?"unshift":"push"](()=>{c=W,t(2,c)})}return n.$$set=W=>{"trigger"in W&&t(8,s=W.trigger),"active"in W&&t(0,o=W.active),"escClose"in W&&t(9,r=W.escClose),"autoScroll"in W&&t(10,a=W.autoScroll),"closableClass"in W&&t(11,u=W.closableClass),"class"in W&&t(1,f=W.class),"$$scope"in W&&t(17,l=W.$$scope)},n.$$.update=()=>{var W,pe;n.$$.dirty[0]&260&&c&&D(s),n.$$.dirty[0]&65537&&(o?((W=m==null?void 0:m.classList)==null||W.add("active"),m==null||m.setAttribute("aria-expanded",!0),y("show")):((pe=m==null?void 0:m.classList)==null||pe.remove("active"),m==null||m.setAttribute("aria-expanded",!1),y("hide")))},[o,f,c,d,P,q,U,Y,s,r,a,u,S,T,$,C,m,l,i,J,B]}class On extends ge{constructor(e){super(),_e(this,e,y$,k$,me,{trigger:8,active:0,escClose:9,autoScroll:10,closableClass:11,class:1,hideWithDelay:12,hide:13,show:14,toggle:15},null,[-1,-1])}get hideWithDelay(){return this.$$.ctx[12]}get hide(){return this.$$.ctx[13]}get show(){return this.$$.ctx[14]}get toggle(){return this.$$.ctx[15]}}function Wc(n,e,t){const i=n.slice();return i[27]=e[t],i}function v$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=M(),s=b("label"),o=Z("Unique"),p(e,"type","checkbox"),p(e,"id",t=n[30]),e.checked=i=n[3].unique,p(s,"for",r=n[30])},m(f,c){w(f,e,c),w(f,l,c),w(f,s,c),k(s,o),a||(u=K(e,"change",n[19]),a=!0)},p(f,c){c[0]&1073741824&&t!==(t=f[30])&&p(e,"id",t),c[0]&8&&i!==(i=f[3].unique)&&(e.checked=i),c[0]&1073741824&&r!==(r=f[30])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function w$(n){let e,t,i,l;function s(a){n[20](a)}var o=n[7];function r(a,u){var c;let f={id:a[30],placeholder:`eg. CREATE INDEX idx_test on ${(c=a[0])==null?void 0:c.name} (created)`,language:"sql-create-index",minHeight:"85"};return a[2]!==void 0&&(f.value=a[2]),{props:f}}return o&&(e=It(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),l=!0},p(a,u){var f;if(u[0]&128&&o!==(o=a[7])){if(e){ie();const c=e;A(c.$$.fragment,1,0,()=>{z(c,1)}),le()}o?(e=It(o,r(a)),te.push(()=>be(e,"value",s)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const c={};u[0]&1073741824&&(c.id=a[30]),u[0]&1&&(c.placeholder=`eg. CREATE INDEX idx_test on ${(f=a[0])==null?void 0:f.name} (created)`),!t&&u[0]&4&&(t=!0,c.value=a[2],ke(()=>t=!1)),e.$set(c)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function S$(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function $$(n){let e,t,i,l;const s=[S$,w$],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function Yc(n){let e,t,i,l=fe(n[10]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Kc(Wc(n,l,o));return{c(){e=b("div"),t=b("span"),t.textContent="Presets",i=M();for(let o=0;o<s.length;o+=1)s[o].c();p(t,"class","txt txt-hint"),p(e,"class","inline-flex gap-10")},m(o,r){w(o,e,r),k(e,t),k(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(e,null)},p(o,r){if(r[0]&9728){l=fe(o[10]);let a;for(a=0;a<l.length;a+=1){const u=Wc(o,l,a);s[a]?s[a].p(u,r):(s[a]=Kc(u),s[a].c(),s[a].m(e,null))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&v(e),ot(s,o)}}}function Kc(n){let e,t=n[27]+"",i,l,s,o;function r(){return n[21](n[27])}return{c(){e=b("button"),i=Z(t),l=M(),p(e,"type","button"),p(e,"class","label link-primary"),x(e,"label-info",n[9].includes(n[27]))},m(a,u){w(a,e,u),k(e,i),k(e,l),s||(o=K(e,"click",r),s=!0)},p(a,u){n=a,u[0]&1024&&t!==(t=n[27]+"")&&se(i,t),u[0]&1536&&x(e,"label-info",n[9].includes(n[27]))},d(a){a&&v(e),s=!1,o()}}}function T$(n){let e,t,i,l,s,o;e=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[v$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required m-b-sm",name:`indexes.${n[6]||""}`,$$slots:{default:[$$,({uniqueId:a})=>({30:a}),({uniqueId:a})=>[a?1073741824:0]]},$$scope:{ctx:n}}});let r=n[10].length>0&&Yc(n);return{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),r&&r.c(),s=ye()},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,l,u),r&&r.m(a,u),w(a,s,u),o=!0},p(a,u){const f={};u[0]&1073741837|u[1]&1&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&64&&(c.name=`indexes.${a[6]||""}`),u[0]&1073742213|u[1]&1&&(c.$$scope={dirty:u,ctx:a}),i.$set(c),a[10].length>0?r?r.p(a,u):(r=Yc(a),r.c(),r.m(s.parentNode,s)):r&&(r.d(1),r=null)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l),v(s)),z(e,a),z(i,a),r&&r.d(a)}}}function C$(n){let e,t=n[5]?"Update":"Create",i,l;return{c(){e=b("h4"),i=Z(t),l=Z(" index")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o[0]&32&&t!==(t=s[5]?"Update":"Create")&&se(i,t)},d(s){s&&v(e)}}}function Jc(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-delete-bin-7-line"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-hint btn-transparent m-r-auto")},m(l,s){w(l,e,s),t||(i=[$e(Pe.call(null,e,{text:"Delete",position:"top"})),K(e,"click",n[16])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function O$(n){let e,t,i,l,s,o,r=n[5]!=""&&Jc(n);return{c(){r&&r.c(),e=M(),t=b("button"),t.innerHTML='<span class="txt">Cancel</span>',i=M(),l=b("button"),l.innerHTML='<span class="txt">Set index</span>',p(t,"type","button"),p(t,"class","btn btn-transparent"),p(l,"type","button"),p(l,"class","btn"),x(l,"btn-disabled",n[9].length<=0)},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),s||(o=[K(t,"click",n[17]),K(l,"click",n[18])],s=!0)},p(a,u){a[5]!=""?r?r.p(a,u):(r=Jc(a),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null),u[0]&512&&x(l,"btn-disabled",a[9].length<=0)},d(a){a&&(v(e),v(t),v(i),v(l)),r&&r.d(a),s=!1,we(o)}}}function M$(n){let e,t;const i=[{popup:!0},n[14]];let l={$$slots:{footer:[O$],header:[C$],default:[T$]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=Ae(l,i[s]);return e=new Gt({props:l}),n[22](e),e.$on("hide",n[23]),e.$on("show",n[24]),{c(){V(e.$$.fragment)},m(s,o){H(e,s,o),t=!0},p(s,o){const r=o[0]&16384?dt(i,[i[0],Dt(s[14])]):{};o[0]&2029|o[1]&1&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){A(e.$$.fragment,s),t=!1},d(s){n[22](null),z(e,s)}}}function D$(n,e,t){let i,l,s;const o=["collection","show","hide"];let r=Xe(e,o);const a=lt();let{collection:u}=e,f,c="",d="",m="",h,_=!1;function g(U,Y){return t(6,m=j.isEmpty(Y)?"":Y),t(5,c=U||S()),t(2,d=c),f==null?void 0:f.show()}function y(){return f==null?void 0:f.hide()}function S(){const U=j.parseIndex("");return U.tableName=(u==null?void 0:u.name)||"",j.buildIndex(U)}function T(){a("remove",c),y()}function $(){s.length&&(a("submit",{old:c,new:d}),y())}function C(U){const Y=j.clone(l),J=Y.columns.find(B=>B.name==U);J?j.removeByValue(Y.columns,J):j.pushUnique(Y.columns,{name:U}),t(2,d=j.buildIndex(Y))}Kt(async()=>{t(8,_=!0);try{t(7,h=(await tt(async()=>{const{default:U}=await import("./CodeEditor-BZmYqzs5.js");return{default:U}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(U){console.warn(U)}t(8,_=!1)});const O=()=>T(),D=()=>y(),I=()=>$(),L=U=>{t(3,l.unique=U.target.checked,l),t(3,l.tableName=l.tableName||(u==null?void 0:u.name),l),t(2,d=j.buildIndex(l))};function R(U){d=U,t(2,d)}const F=U=>C(U);function N(U){te[U?"unshift":"push"](()=>{f=U,t(4,f)})}function P(U){Ce.call(this,n,U)}function q(U){Ce.call(this,n,U)}return n.$$set=U=>{e=Ae(Ae({},e),Yt(U)),t(14,r=Xe(e,o)),"collection"in U&&t(0,u=U.collection)},n.$$.update=()=>{var U,Y,J;n.$$.dirty[0]&1&&t(10,i=(((Y=(U=u==null?void 0:u.schema)==null?void 0:U.filter(B=>!B.toDelete))==null?void 0:Y.map(B=>B.name))||[]).concat(["created","updated"])),n.$$.dirty[0]&4&&t(3,l=j.parseIndex(d)),n.$$.dirty[0]&8&&t(9,s=((J=l.columns)==null?void 0:J.map(B=>B.name))||[])},[u,y,d,l,f,c,m,h,_,s,i,T,$,C,r,g,O,D,I,L,R,F,N,P,q]}class E$ extends ge{constructor(e){super(),_e(this,e,D$,M$,me,{collection:0,show:15,hide:1},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[1]}}function Zc(n,e,t){const i=n.slice();i[10]=e[t],i[13]=t;const l=j.parseIndex(i[10]);return i[11]=l,i}function Gc(n){let e;return{c(){e=b("strong"),e.textContent="Unique:"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Xc(n){var d;let e,t,i,l=((d=n[11].columns)==null?void 0:d.map(Qc).join(", "))+"",s,o,r,a,u,f=n[11].unique&&Gc();function c(){return n[4](n[10],n[13])}return{c(){var m,h;e=b("button"),f&&f.c(),t=M(),i=b("span"),s=Z(l),p(i,"class","txt"),p(e,"type","button"),p(e,"class",o="label link-primary "+((h=(m=n[2].indexes)==null?void 0:m[n[13]])!=null&&h.message?"label-danger":"")+" svelte-167lbwu")},m(m,h){var _,g;w(m,e,h),f&&f.m(e,null),k(e,t),k(e,i),k(i,s),a||(u=[$e(r=Pe.call(null,e,((g=(_=n[2].indexes)==null?void 0:_[n[13]])==null?void 0:g.message)||"")),K(e,"click",c)],a=!0)},p(m,h){var _,g,y,S,T;n=m,n[11].unique?f||(f=Gc(),f.c(),f.m(e,t)):f&&(f.d(1),f=null),h&1&&l!==(l=((_=n[11].columns)==null?void 0:_.map(Qc).join(", "))+"")&&se(s,l),h&4&&o!==(o="label link-primary "+((y=(g=n[2].indexes)==null?void 0:g[n[13]])!=null&&y.message?"label-danger":"")+" svelte-167lbwu")&&p(e,"class",o),r&&Mt(r.update)&&h&4&&r.update.call(null,((T=(S=n[2].indexes)==null?void 0:S[n[13]])==null?void 0:T.message)||"")},d(m){m&&v(e),f&&f.d(),a=!1,we(u)}}}function I$(n){var $,C,O;let e,t,i=(((C=($=n[0])==null?void 0:$.indexes)==null?void 0:C.length)||0)+"",l,s,o,r,a,u,f,c,d,m,h,_,g=fe(((O=n[0])==null?void 0:O.indexes)||[]),y=[];for(let D=0;D<g.length;D+=1)y[D]=Xc(Zc(n,g,D));function S(D){n[7](D)}let T={};return n[0]!==void 0&&(T.collection=n[0]),c=new E$({props:T}),n[6](c),te.push(()=>be(c,"collection",S)),c.$on("remove",n[8]),c.$on("submit",n[9]),{c(){e=b("div"),t=Z("Unique constraints and indexes ("),l=Z(i),s=Z(")"),o=M(),r=b("div");for(let D=0;D<y.length;D+=1)y[D].c();a=M(),u=b("button"),u.innerHTML='<span class="txt">+</span> <span class="txt">New index</span>',f=M(),V(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(D,I){w(D,e,I),k(e,t),k(e,l),k(e,s),w(D,o,I),w(D,r,I);for(let L=0;L<y.length;L+=1)y[L]&&y[L].m(r,null);k(r,a),k(r,u),w(D,f,I),H(c,D,I),m=!0,h||(_=K(u,"click",n[5]),h=!0)},p(D,[I]){var R,F,N;if((!m||I&1)&&i!==(i=(((F=(R=D[0])==null?void 0:R.indexes)==null?void 0:F.length)||0)+"")&&se(l,i),I&7){g=fe(((N=D[0])==null?void 0:N.indexes)||[]);let P;for(P=0;P<g.length;P+=1){const q=Zc(D,g,P);y[P]?y[P].p(q,I):(y[P]=Xc(q),y[P].c(),y[P].m(r,a))}for(;P<y.length;P+=1)y[P].d(1);y.length=g.length}const L={};!d&&I&1&&(d=!0,L.collection=D[0],ke(()=>d=!1)),c.$set(L)},i(D){m||(E(c.$$.fragment,D),m=!0)},o(D){A(c.$$.fragment,D),m=!1},d(D){D&&(v(e),v(o),v(r),v(f)),ot(y,D),n[6](null),z(c,D),h=!1,_()}}}const Qc=n=>n.name;function A$(n,e,t){let i;We(n,hi,m=>t(2,i=m));let{collection:l}=e,s;function o(m,h){for(let _=0;_<l.indexes.length;_++)if(l.indexes[_]==m){t(0,l.indexes[_]=h,l),li("indexes."+_);return}l.indexes.push(h),t(0,l)}const r=(m,h)=>s==null?void 0:s.show(m,h),a=()=>s==null?void 0:s.show();function u(m){te[m?"unshift":"push"](()=>{s=m,t(1,s)})}function f(m){l=m,t(0,l)}const c=m=>{for(let h=0;h<l.indexes.length;h++)if(l.indexes[h]==m.detail){l.indexes.splice(h,1),li("indexes."+h);break}t(0,l)},d=m=>{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},[l,s,i,o,r,a,u,f,c,d]}class L$ extends ge{constructor(e){super(),_e(this,e,A$,I$,me,{collection:0})}}function xc(n,e,t){const i=n.slice();return i[5]=e[t],i}function ed(n){let e,t,i,l,s,o,r;function a(){return n[3](n[5])}return{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent=`${n[5].label}`,s=M(),p(t,"class","icon "+n[5].icon+" svelte-1gz9b6p"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item svelte-1gz9b6p")},m(u,f){w(u,e,f),k(e,t),k(e,i),k(e,l),k(e,s),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u},d(u){u&&v(e),o=!1,r()}}}function N$(n){let e,t=fe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=ed(xc(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&6){t=fe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=xc(l,t,o);i[o]?i[o].p(r,s):(i[o]=ed(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(l){l&&v(e),ot(i,l)}}}function P$(n){let e,t,i,l,s,o,r,a;return o=new On({props:{class:"dropdown field-types-dropdown",$$slots:{default:[N$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("i"),i=M(),l=b("div"),l.textContent="New field",s=M(),V(o.$$.fragment),p(t,"class","ri-add-line"),p(t,"aria-hidden","true"),p(l,"class","txt"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(u,f){w(u,e,f),k(e,t),k(e,i),k(e,l),k(e,s),H(o,e,null),a=!0},p(u,[f]){const c={};f&256&&(c.$$scope={dirty:f,ctx:u}),o.$set(c),(!a||f&1&&r!==(r="field-types-btn "+u[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(u){a||(E(o.$$.fragment,u),a=!0)},o(u){A(o.$$.fragment,u),a=!1},d(u){u&&v(e),z(o)}}}function F$(n,e,t){let{class:i=""}=e;const l=lt(),s=[{label:"Plain text",value:"text",icon:j.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:j.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:j.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:j.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:j.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:j.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:j.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:j.getFieldTypeIcon("select")},{label:"File",value:"file",icon:j.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:j.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:j.getFieldTypeIcon("json")}];function o(a){l("select",a)}const r=a=>o(a.value);return n.$$set=a=>{"class"in a&&t(0,i=a.class)},[i,s,o,r]}class R$ extends ge{constructor(e){super(),_e(this,e,F$,P$,me,{class:0})}}const q$=n=>({interactive:n&64,hasErrors:n&32}),td=n=>({interactive:n[6],hasErrors:n[5]}),j$=n=>({interactive:n&64,hasErrors:n&32}),nd=n=>({interactive:n[6],hasErrors:n[5]}),H$=n=>({interactive:n&64,hasErrors:n&32}),id=n=>({interactive:n[6],hasErrors:n[5]});function ld(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="drag-handle"></span>',p(e,"class","drag-handle-wrapper"),p(e,"draggable",!0),p(e,"aria-label","Sort")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sd(n){let e,t,i;return{c(){e=b("div"),t=b("span"),i=Z(n[4]),p(t,"class","label label-success"),p(e,"class","field-labels")},m(l,s){w(l,e,s),k(e,t),k(t,i)},p(l,s){s&16&&se(i,l[4])},d(l){l&&v(e)}}}function z$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=n[0].required&&sd(n);return{c(){m&&m.c(),e=M(),t=b("div"),i=b("i"),s=M(),o=b("input"),p(i,"class",l=j.getFieldTypeIcon(n[0].type)),p(t,"class","form-field-addon prefix no-pointer-events field-type-icon"),x(t,"txt-disabled",!n[6]),p(o,"type","text"),o.required=!0,o.disabled=r=!n[6],o.readOnly=a=n[0].id&&n[0].system,p(o,"spellcheck","false"),o.autofocus=u=!n[0].id,p(o,"placeholder","Field name"),o.value=f=n[0].name},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,s,_),w(h,o,_),n[15](o),n[0].id||o.focus(),c||(d=K(o,"input",n[16]),c=!0)},p(h,_){h[0].required?m?m.p(h,_):(m=sd(h),m.c(),m.m(e.parentNode,e)):m&&(m.d(1),m=null),_&1&&l!==(l=j.getFieldTypeIcon(h[0].type))&&p(i,"class",l),_&64&&x(t,"txt-disabled",!h[6]),_&64&&r!==(r=!h[6])&&(o.disabled=r),_&1&&a!==(a=h[0].id&&h[0].system)&&(o.readOnly=a),_&1&&u!==(u=!h[0].id)&&(o.autofocus=u),_&1&&f!==(f=h[0].name)&&o.value!==f&&(o.value=f)},d(h){h&&(v(e),v(t),v(s),v(o)),m&&m.d(h),n[15](null),c=!1,d()}}}function V$(n){let e;return{c(){e=b("span"),p(e,"class","separator")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function B$(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("i"),p(t,"class","ri-settings-3-line"),p(e,"type","button"),p(e,"aria-label","Toggle field options"),p(e,"class",i="btn btn-sm btn-circle options-trigger "+(n[3]?"btn-secondary":"btn-transparent")),p(e,"aria-expanded",n[3]),x(e,"btn-hint",!n[3]&&!n[5]),x(e,"btn-danger",n[5])},m(o,r){w(o,e,r),k(e,t),l||(s=K(e,"click",n[12]),l=!0)},p(o,r){r&8&&i!==(i="btn btn-sm btn-circle options-trigger "+(o[3]?"btn-secondary":"btn-transparent"))&&p(e,"class",i),r&8&&p(e,"aria-expanded",o[3]),r&40&&x(e,"btn-hint",!o[3]&&!o[5]),r&40&&x(e,"btn-danger",o[5])},d(o){o&&v(e),l=!1,s()}}}function U$(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-restart-line"></i>',p(e,"type","button"),p(e,"class","btn btn-sm btn-circle btn-warning btn-transparent options-trigger"),p(e,"aria-label","Restore")},m(l,s){w(l,e,s),t||(i=[$e(Pe.call(null,e,"Restore")),K(e,"click",n[9])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function od(n){let e,t,i,l,s,o,r,a,u,f,c;const d=n[14].options,m=St(d,n,n[19],nd);s=new ce({props:{class:"form-field form-field-toggle",name:"requried",$$slots:{default:[W$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-toggle",name:"presentable",$$slots:{default:[Y$,({uniqueId:y})=>({25:y}),({uniqueId:y})=>y?33554432:0]},$$scope:{ctx:n}}});const h=n[14].optionsFooter,_=St(h,n,n[19],td);let g=!n[0].toDelete&&rd(n);return{c(){e=b("div"),t=b("div"),m&&m.c(),i=M(),l=b("div"),V(s.$$.fragment),o=M(),V(r.$$.fragment),a=M(),_&&_.c(),u=M(),g&&g.c(),p(t,"class","hidden-empty m-b-sm"),p(l,"class","schema-field-options-footer"),p(e,"class","schema-field-options")},m(y,S){w(y,e,S),k(e,t),m&&m.m(t,null),k(e,i),k(e,l),H(s,l,null),k(l,o),H(r,l,null),k(l,a),_&&_.m(l,null),k(l,u),g&&g.m(l,null),c=!0},p(y,S){m&&m.p&&(!c||S&524384)&&Tt(m,d,y,y[19],c?$t(d,y[19],S,j$):Ct(y[19]),nd);const T={};S&34078737&&(T.$$scope={dirty:S,ctx:y}),s.$set(T);const $={};S&34078721&&($.$$scope={dirty:S,ctx:y}),r.$set($),_&&_.p&&(!c||S&524384)&&Tt(_,h,y,y[19],c?$t(h,y[19],S,q$):Ct(y[19]),td),y[0].toDelete?g&&(ie(),A(g,1,1,()=>{g=null}),le()):g?(g.p(y,S),S&1&&E(g,1)):(g=rd(y),g.c(),E(g,1),g.m(l,null))},i(y){c||(E(m,y),E(s.$$.fragment,y),E(r.$$.fragment,y),E(_,y),E(g),y&&Ke(()=>{c&&(f||(f=Fe(e,et,{duration:150},!0)),f.run(1))}),c=!0)},o(y){A(m,y),A(s.$$.fragment,y),A(r.$$.fragment,y),A(_,y),A(g),y&&(f||(f=Fe(e,et,{duration:150},!1)),f.run(0)),c=!1},d(y){y&&v(e),m&&m.d(y),z(s),z(r),_&&_.d(y),g&&g.d(),y&&f&&f.end()}}}function W$(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),o=Z(n[4]),r=M(),a=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(a,"class","ri-information-line link-hint"),p(l,"for",f=n[25])},m(m,h){w(m,e,h),e.checked=n[0].required,w(m,i,h),w(m,l,h),k(l,s),k(s,o),k(l,r),k(l,a),c||(d=[K(e,"change",n[17]),$e(u=Pe.call(null,a,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(n[0])}.`}))],c=!0)},p(m,h){h&33554432&&t!==(t=m[25])&&p(e,"id",t),h&1&&(e.checked=m[0].required),h&16&&se(o,m[4]),u&&Mt(u.update)&&h&1&&u.update.call(null,{text:`Requires the field value NOT to be ${j.zeroDefaultStr(m[0])}.`}),h&33554432&&f!==(f=m[25])&&p(l,"for",f)},d(m){m&&(v(e),v(i),v(l)),c=!1,we(d)}}}function Y$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Presentable",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[25]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[25])},m(c,d){w(c,e,d),e.checked=n[0].presentable,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[18]),$e(Pe.call(null,r,{text:"Whether the field should be preferred in the Admin UI relation listings (default to auto)."}))],u=!0)},p(c,d){d&33554432&&t!==(t=c[25])&&p(e,"id",t),d&1&&(e.checked=c[0].presentable),d&33554432&&a!==(a=c[25])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function rd(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-sm dropdown-upside dropdown-right dropdown-nowrap no-min-width",$$slots:{default:[K$]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),l=b("i"),s=M(),V(o.$$.fragment),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More"),p(i,"class","btn btn-circle btn-sm btn-transparent"),p(t,"class","inline-flex flex-gap-sm flex-nowrap"),p(e,"class","m-l-auto txt-right")},m(a,u){w(a,e,u),k(e,t),k(t,i),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,u){const f={};u&524288&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(o)}}}function K$(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Duplicate</span>',t=M(),i=b("button"),i.innerHTML='<span class="txt">Remove</span>',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",Ue(n[10])),K(i,"click",Ue(n[8]))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function J$(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&ld();l=new ce({props:{class:"form-field required m-0 "+(n[6]?"":"disabled"),name:"schema."+n[1]+".name",inlineError:!0,$$slots:{default:[z$]},$$scope:{ctx:n}}});const c=n[14].default,d=St(c,n,n[19],id),m=d||V$();function h(S,T){if(S[0].toDelete)return U$;if(S[6])return B$}let _=h(n),g=_&&_(n),y=n[6]&&n[3]&&od(n);return{c(){e=b("div"),t=b("div"),f&&f.c(),i=M(),V(l.$$.fragment),s=M(),m&&m.c(),o=M(),g&&g.c(),r=M(),y&&y.c(),p(t,"class","schema-field-header"),p(e,"class","schema-field"),x(e,"required",n[0].required),x(e,"expanded",n[6]&&n[3]),x(e,"deleted",n[0].toDelete)},m(S,T){w(S,e,T),k(e,t),f&&f.m(t,null),k(t,i),H(l,t,null),k(t,s),m&&m.m(t,null),k(t,o),g&&g.m(t,null),k(e,r),y&&y.m(e,null),u=!0},p(S,[T]){S[6]?f||(f=ld(),f.c(),f.m(t,i)):f&&(f.d(1),f=null);const $={};T&64&&($.class="form-field required m-0 "+(S[6]?"":"disabled")),T&2&&($.name="schema."+S[1]+".name"),T&524373&&($.$$scope={dirty:T,ctx:S}),l.$set($),d&&d.p&&(!u||T&524384)&&Tt(d,c,S,S[19],u?$t(c,S[19],T,H$):Ct(S[19]),id),_===(_=h(S))&&g?g.p(S,T):(g&&g.d(1),g=_&&_(S),g&&(g.c(),g.m(t,null))),S[6]&&S[3]?y?(y.p(S,T),T&72&&E(y,1)):(y=od(S),y.c(),E(y,1),y.m(e,null)):y&&(ie(),A(y,1,1,()=>{y=null}),le()),(!u||T&1)&&x(e,"required",S[0].required),(!u||T&72)&&x(e,"expanded",S[6]&&S[3]),(!u||T&1)&&x(e,"deleted",S[0].toDelete)},i(S){u||(E(l.$$.fragment,S),E(m,S),E(y),S&&Ke(()=>{u&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(S){A(l.$$.fragment,S),A(m,S),A(y),S&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),u=!1},d(S){S&&v(e),f&&f.d(),z(l),m&&m.d(S),g&&g.d(),y&&y.d(),S&&a&&a.end()}}}let Mr=[];function Z$(n,e,t){let i,l,s,o;We(n,hi,N=>t(13,o=N));let{$$slots:r={},$$scope:a}=e;const u="f_"+j.randomString(8),f=lt(),c={bool:"Nonfalsey",number:"Nonzero"};let{key:d=""}=e,{field:m=j.initSchemaField()}=e,h,_=!1;function g(){m.id?t(0,m.toDelete=!0,m):(C(),f("remove"))}function y(){t(0,m.toDelete=!1,m),Zt({})}function S(){m.toDelete||(C(),f("duplicate"))}function T(N){return j.slugify(N)}function $(){t(3,_=!0),D()}function C(){t(3,_=!1)}function O(){_?C():$()}function D(){for(let N of Mr)N.id!=u&&N.collapse()}Kt(()=>(Mr.push({id:u,collapse:C}),m.onMountSelect&&(t(0,m.onMountSelect=!1,m),h==null||h.select()),()=>{j.removeByKey(Mr,"id",u)}));function I(N){te[N?"unshift":"push"](()=>{h=N,t(2,h)})}const L=N=>{const P=m.name;t(0,m.name=T(N.target.value),m),N.target.value=m.name,f("rename",{oldName:P,newName:m.name})};function R(){m.required=this.checked,t(0,m)}function F(){m.presentable=this.checked,t(0,m)}return n.$$set=N=>{"key"in N&&t(1,d=N.key),"field"in N&&t(0,m=N.field),"$$scope"in N&&t(19,a=N.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&m.toDelete&&m.originalName&&m.name!==m.originalName&&t(0,m.name=m.originalName,m),n.$$.dirty&1&&!m.originalName&&m.name&&t(0,m.originalName=m.name,m),n.$$.dirty&1&&typeof m.toDelete>"u"&&t(0,m.toDelete=!1,m),n.$$.dirty&1&&m.required&&t(0,m.nullable=!1,m),n.$$.dirty&1&&t(6,i=!m.toDelete&&!(m.id&&m.system)),n.$$.dirty&8194&&t(5,l=!j.isEmpty(j.getNestedVal(o,`schema.${d}`))),n.$$.dirty&1&&t(4,s=c[m==null?void 0:m.type]||"Nonempty")},[m,d,h,_,s,l,i,f,g,y,S,T,O,o,r,I,L,R,F,a]}class si extends ge{constructor(e){super(),_e(this,e,Z$,J$,me,{key:1,field:0})}}function G$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Min length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min","0")},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.min),r||(a=K(s,"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(s,"id",o),f&1&&it(s.value)!==u[0].options.min&&oe(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function X$(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Z("Max length"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"step","1"),p(s,"min",r=n[0].options.min||0)},m(f,c){w(f,e,c),k(e,t),w(f,l,c),w(f,s,c),oe(s,n[0].options.max),a||(u=K(s,"input",n[4]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].options.min||0)&&p(s,"min",r),c&1&&it(s.value)!==f[0].options.max&&oe(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function Q$(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Regex pattern"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","text"),p(s,"id",o=n[10]),p(s,"placeholder","Valid Go regular expression, eg. ^\\w+$")},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.pattern),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&&s.value!==u[0].options.pattern&&oe(s,u[0].options.pattern)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function x$(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[G$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[X$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.pattern",$$slots:{default:[Q$,({uniqueId:c})=>({10:c}),({uniqueId:c})=>c?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),r=M(),a=b("div"),V(u.$$.fragment),p(t,"class","col-sm-3"),p(s,"class","col-sm-3"),p(a,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(c,d){w(c,e,d),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(u,a,null),f=!0},p(c,d){const m={};d&2&&(m.name="schema."+c[1]+".options.min"),d&3073&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&2&&(h.name="schema."+c[1]+".options.max"),d&3073&&(h.$$scope={dirty:d,ctx:c}),o.$set(h);const _={};d&2&&(_.name="schema."+c[1]+".options.pattern"),d&3073&&(_.$$scope={dirty:d,ctx:c}),u.$set(_)},i(c){f||(E(i.$$.fragment,c),E(o.$$.fragment,c),E(u.$$.fragment,c),f=!0)},o(c){A(i.$$.fragment,c),A(o.$$.fragment,c),A(u.$$.fragment,c),f=!1},d(c){c&&v(e),z(i),z(o),z(u)}}}function eT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{options:[x$]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function tT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.min=it(this.value),t(0,s)}function a(){s.options.max=it(this.value),t(0,s)}function u(){s.options.pattern=this.value,t(0,s)}function f(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ae(Ae({},e),Yt(h)),t(2,l=Xe(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,u,f,c,d,m]}class nT extends ge{constructor(e){super(),_e(this,e,tT,eT,me,{field:0,key:1})}}function iT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Min"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10])},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.min),r||(a=K(s,"input",n[4]),r=!0)},p(u,f){f&1024&&i!==(i=u[10])&&p(e,"for",i),f&1024&&o!==(o=u[10])&&p(s,"id",o),f&1&&it(s.value)!==u[0].options.min&&oe(s,u[0].options.min)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function lT(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Z("Max"),l=M(),s=b("input"),p(e,"for",i=n[10]),p(s,"type","number"),p(s,"id",o=n[10]),p(s,"min",r=n[0].options.min)},m(f,c){w(f,e,c),k(e,t),w(f,l,c),w(f,s,c),oe(s,n[0].options.max),a||(u=K(s,"input",n[5]),a=!0)},p(f,c){c&1024&&i!==(i=f[10])&&p(e,"for",i),c&1024&&o!==(o=f[10])&&p(s,"id",o),c&1&&r!==(r=f[0].options.min)&&p(s,"min",r),c&1&&it(s.value)!==f[0].options.max&&oe(s,f[0].options.max)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function sT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[iT,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[lT,({uniqueId:a})=>({10:a}),({uniqueId:a})=>a?1024:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&3073&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&3073&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function oT(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="No decimals",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[10]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[10])},m(c,d){w(c,e,d),e.checked=n[0].options.noDecimal,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[3]),$e(Pe.call(null,r,{text:"Existing decimal numbers will not be affected."}))],u=!0)},p(c,d){d&1024&&t!==(t=c[10])&&p(e,"id",t),d&1&&(e.checked=c[0].options.noDecimal),d&1024&&a!==(a=c[10])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function rT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.noDecimal",$$slots:{default:[oT,({uniqueId:i})=>({10:i}),({uniqueId:i})=>i?1024:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.noDecimal"),l&3073&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function aT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[6](r)}let o={$$slots:{optionsFooter:[rT],options:[sT]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&2051&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function uT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(){s.options.noDecimal=this.checked,t(0,s)}function a(){s.options.min=it(this.value),t(0,s)}function u(){s.options.max=it(this.value),t(0,s)}function f(h){s=h,t(0,s)}function c(h){Ce.call(this,n,h)}function d(h){Ce.call(this,n,h)}function m(h){Ce.call(this,n,h)}return n.$$set=h=>{e=Ae(Ae({},e),Yt(h)),t(2,l=Xe(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},[s,o,l,r,a,u,f,c,d,m]}class fT extends ge{constructor(e){super(),_e(this,e,uT,aT,me,{field:0,key:1})}}function cT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function dT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ae(Ae({},e),Yt(c)),t(2,l=Xe(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class pT extends ge{constructor(e){super(),_e(this,e,dT,cT,me,{field:0,key:1})}}function mT(n){let e,t,i,l,s=[{type:t=n[5].type||"text"},{value:n[4]},{disabled:n[3]},{readOnly:n[2]},n[5]],o={};for(let r=0;r<s.length;r+=1)o=Ae(o,s[r]);return{c(){e=b("input"),ni(e,o)},m(r,a){w(r,e,a),"value"in o&&(e.value=o.value),e.autofocus&&e.focus(),i||(l=K(e,"input",n[6]),i=!0)},p(r,[a]){ni(e,o=dt(s,[a&32&&t!==(t=r[5].type||"text")&&{type:t},a&16&&e.value!==r[4]&&{value:r[4]},a&8&&{disabled:r[3]},a&4&&{readOnly:r[2]},a&32&&r[5]])),"value"in o&&(e.value=o.value)},i:Q,o:Q,d(r){r&&v(e),i=!1,l()}}}function hT(n,e,t){let i;const l=["value","separator","readonly","disabled"];let s=Xe(e,l),{value:o=[]}=e,{separator:r=","}=e,{readonly:a=null}=e,{disabled:u=null}=e;const f=c=>{t(0,o=j.splitNonEmpty(c.target.value,r))};return n.$$set=c=>{e=Ae(Ae({},e),Yt(c)),t(5,s=Xe(e,l)),"value"in c&&t(0,o=c.value),"separator"in c&&t(1,r=c.separator),"readonly"in c&&t(2,a=c.readonly),"disabled"in c&&t(3,u=c.disabled)},n.$$.update=()=>{n.$$.dirty&3&&t(4,i=j.joinNonEmpty(o,r+" "))},[o,r,a,u,i,s,f]}class Rl extends ge{constructor(e){super(),_e(this,e,hT,mT,me,{value:0,separator:1,readonly:2,disabled:3})}}function _T(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[3](g)}let _={id:n[9],disabled:!j.isEmpty(n[0].options.onlyDomains)};return n[0].options.exceptDomains!==void 0&&(_.value=n[0].options.exceptDomains),r=new Rl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]),p(f,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(Pe.call(null,l,{text:`List of domains that are NOT allowed.
|
||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function gT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Rl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(f,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(Pe.call(null,l,{text:`List of domains that are ONLY allowed.
|
||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const S={};y&512&&(S.id=g[9]+".options.onlyDomains"),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function bT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[_T,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[gT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&1537&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&1537&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function kT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[bT]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function yT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function u(m){s=m,t(0,s)}function f(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ae(Ae({},e),Yt(m)),t(2,l=Xe(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,u,f,c,d]}class Xb extends ge{constructor(e){super(),_e(this,e,yT,kT,me,{field:0,key:1})}}function vT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new Xb({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function wT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Ce.call(this,n,c)}function u(c){Ce.call(this,n,c)}function f(c){Ce.call(this,n,c)}return n.$$set=c=>{e=Ae(Ae({},e),Yt(c)),t(2,l=Xe(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,u,f]}class ST extends ge{constructor(e){super(),_e(this,e,wT,vT,me,{field:0,key:1})}}function $T(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[3]),$e(Pe.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&512&&a!==(a=c[9])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function TT(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.convertUrls",$$slots:{default:[$T,({uniqueId:i})=>({9:i}),({uniqueId:i})=>i?512:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.convertUrls"),l&1537&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function CT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[4](r)}let o={$$slots:{optionsFooter:[TT]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[5]),e.$on("remove",n[6]),e.$on("duplicate",n[7]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?dt(l,[a&2&&{key:r[1]},a&4&&Dt(r[2])]):{};a&1027&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function OT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(){t(0,s.options={convertUrls:!1},s)}function a(){s.options.convertUrls=this.checked,t(0,s)}function u(m){s=m,t(0,s)}function f(m){Ce.call(this,n,m)}function c(m){Ce.call(this,n,m)}function d(m){Ce.call(this,n,m)}return n.$$set=m=>{e=Ae(Ae({},e),Yt(m)),t(2,l=Xe(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&r()},[s,o,l,a,u,f,c,d]}class MT extends ge{constructor(e){super(),_e(this,e,OT,CT,me,{field:0,key:1})}}var Dr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Tl={_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},bs={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},mn=function(n,e){return e===void 0&&(e=2),("000"+n).slice(e*-1)},In=function(n){return n===!0?1:0};function ad(n,e){var t;return function(){var i=this,l=arguments;clearTimeout(t),t=setTimeout(function(){return n.apply(i,l)},e)}}var Er=function(n){return n instanceof Array?n:[n]};function un(n,e,t){if(t===!0)return n.classList.add(e);n.classList.remove(e)}function ct(n,e,t){var i=window.document.createElement(n);return e=e||"",t=t||"",i.className=e,t!==void 0&&(i.textContent=t),i}function eo(n){for(;n.firstChild;)n.removeChild(n.firstChild)}function Qb(n,e){if(e(n))return n;if(n.parentNode)return Qb(n.parentNode,e)}function to(n,e){var t=ct("div","numInputWrapper"),i=ct("input","numInput "+n),l=ct("span","arrowUp"),s=ct("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?i.type="number":(i.type="text",i.pattern="\\d*"),e!==void 0)for(var o in e)i.setAttribute(o,e[o]);return t.appendChild(i),t.appendChild(l),t.appendChild(s),t}function yn(n){try{if(typeof n.composedPath=="function"){var e=n.composedPath();return e[0]}return n.target}catch{return n.target}}var Ir=function(){},No=function(n,e,t){return t.months[e?"shorthand":"longhand"][n]},DT={D:Ir,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*In(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),l=new Date(n.getFullYear(),0,2+(i-1)*7,0,0,0,0);return l.setDate(l.getDate()-l.getDay()+t.firstDayOfWeek),l},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:Ir,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:Ir,y:function(n,e){n.setFullYear(2e3+parseFloat(e))}},Wi={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},os={Z:function(n){return n.toISOString()},D:function(n,e,t){return e.weekdays.shorthand[os.w(n,e,t)]},F:function(n,e,t){return No(os.n(n,e,t)-1,!1,e)},G:function(n,e,t){return mn(os.h(n,e,t))},H:function(n){return mn(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[In(n.getHours()>11)]},M:function(n,e){return No(n.getMonth(),!0,e)},S:function(n){return mn(n.getSeconds())},U:function(n){return n.getTime()/1e3},W:function(n,e,t){return t.getWeek(n)},Y:function(n){return mn(n.getFullYear(),4)},d:function(n){return mn(n.getDate())},h:function(n){return n.getHours()%12?n.getHours()%12:12},i:function(n){return mn(n.getMinutes())},j:function(n){return n.getDate()},l:function(n,e){return e.weekdays.longhand[n.getDay()]},m:function(n){return mn(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)}},xb=function(n){var e=n.config,t=e===void 0?Tl:e,i=n.l10n,l=i===void 0?bs:i,s=n.isMobile,o=s===void 0?!1:s;return function(r,a,u){var f=u||l;return t.formatDate!==void 0&&!o?t.formatDate(r,a,f):a.split("").map(function(c,d,m){return os[c]&&m[d-1]!=="\\"?os[c](r,f,t):c!=="\\"?c:""}).join("")}},pa=function(n){var e=n.config,t=e===void 0?Tl:e,i=n.l10n,l=i===void 0?bs:i;return function(s,o,r,a){if(!(s!==0&&!s)){var u=a||l,f,c=s;if(s instanceof Date)f=new Date(s.getTime());else if(typeof s!="string"&&s.toFixed!==void 0)f=new Date(s);else if(typeof s=="string"){var d=o||(t||Tl).dateFormat,m=String(s).trim();if(m==="today")f=new Date,r=!0;else if(t&&t.parseDate)f=t.parseDate(s,d);else if(/Z$/.test(m)||/GMT$/.test(m))f=new Date(s);else{for(var h=void 0,_=[],g=0,y=0,S="";g<d.length;g++){var T=d[g],$=T==="\\",C=d[g-1]==="\\"||$;if(Wi[T]&&!C){S+=Wi[T];var O=new RegExp(S).exec(s);O&&(h=!0)&&_[T!=="Y"?"push":"unshift"]({fn:DT[T],val:O[++y]})}else $||(S+=".")}f=!t||!t.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),_.forEach(function(D){var I=D.fn,L=D.val;return f=I(f,L,u)||f}),f=h?f:void 0}}if(!(f instanceof Date&&!isNaN(f.getTime()))){t.errorHandler(new Error("Invalid date provided: "+c));return}return r===!0&&f.setHours(0,0,0,0),f}}};function vn(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 ET=function(n,e,t){return n>Math.min(e,t)&&n<Math.max(e,t)},Ar=function(n,e,t){return n*3600+e*60+t},IT=function(n){var e=Math.floor(n/3600),t=(n-e*3600)/60;return[e,t,n-e*3600-t*60]},AT={DAY:864e5};function Lr(n){var e=n.defaultHour,t=n.defaultMinute,i=n.defaultSeconds;if(n.minDate!==void 0){var l=n.minDate.getHours(),s=n.minDate.getMinutes(),o=n.minDate.getSeconds();e<l&&(e=l),e===l&&t<s&&(t=s),e===l&&t===s&&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]})},l=0,s=e;l<s.length;l++){var o=s[l];i(o)}return n});var nn=function(){return nn=Object.assign||function(n){for(var e,t=1,i=arguments.length;t<i;t++){e=arguments[t];for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&(n[l]=e[l])}return n},nn.apply(this,arguments)},ud=function(){for(var n=0,e=0,t=arguments.length;e<t;e++)n+=arguments[e].length;for(var i=Array(n),l=0,e=0;e<t;e++)for(var s=arguments[e],o=0,r=s.length;o<r;o++,l++)i[l]=s[o];return i},LT=300;function NT(n,e){var t={config:nn(nn({},Tl),Bt.defaultConfig),l10n:bs};t.parseDate=pa({config:t.config,l10n:t.l10n}),t._handlers=[],t.pluginElements=[],t.loadedPlugins=[],t._bind=_,t._setHoursFromDate=d,t._positionCalendar=zt,t.changeMonth=ee,t.changeYear=bt,t.clear=ue,t.close=Oe,t.onMouseOver=Le,t._createElement=ct,t.createDay=O,t.destroy=He,t.isEnabled=kt,t.jumpToDate=S,t.updateValue=Jt,t.open=_t,t.redraw=qn,t.set=Ie,t.setDate=Pi,t.toggle=fl;function i(){t.utils={getDaysInMonth:function(G,X){return G===void 0&&(G=t.currentMonth),X===void 0&&(X=t.currentYear),G===1&&(X%4===0&&X%100!==0||X%400===0)?29:t.l10n.daysInMonth[G]}}}function l(){t.element=t.input=n,t.isOpen=!1,ve(),Ye(),ql(),al(),i(),t.isMobile||C(),y(),(t.selectedDates.length||t.config.noCalendar)&&(t.config.enableTime&&d(t.config.noCalendar?t.latestSelectedDateObj:void 0),Jt(!1)),r();var G=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!t.isMobile&&G&&zt(),gt("onReady")}function s(){var G;return((G=t.calendarContainer)===null||G===void 0?void 0:G.getRootNode()).activeElement||document.activeElement}function o(G){return G.bind(t)}function r(){var G=t.config;G.weekNumbers===!1&&G.showMonths===1||G.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 X=(t.days.offsetWidth+1)*G.showMonths;t.daysContainer.style.width=X+"px",t.calendarContainer.style.width=X+(t.weekWrapper!==void 0?t.weekWrapper.offsetWidth:0)+"px",t.calendarContainer.style.removeProperty("visibility"),t.calendarContainer.style.removeProperty("display")}})}function a(G){if(t.selectedDates.length===0){var X=t.config.minDate===void 0||vn(new Date,t.config.minDate)>=0?new Date:new Date(t.config.minDate.getTime()),ne=Lr(t.config);X.setHours(ne.hours,ne.minutes,ne.seconds,X.getMilliseconds()),t.selectedDates=[X],t.latestSelectedDateObj=X}G!==void 0&&G.type!=="blur"&&oi(G);var ae=t._input.value;c(),Jt(),t._input.value!==ae&&t._debouncedChange()}function u(G,X){return G%12+12*In(X===t.l10n.amPM[1])}function f(G){switch(G%24){case 0:case 12:return 12;default:return G%12}}function c(){if(!(t.hourElement===void 0||t.minuteElement===void 0)){var G=(parseInt(t.hourElement.value.slice(-2),10)||0)%24,X=(parseInt(t.minuteElement.value,10)||0)%60,ne=t.secondElement!==void 0?(parseInt(t.secondElement.value,10)||0)%60:0;t.amPM!==void 0&&(G=u(G,t.amPM.textContent));var ae=t.config.minTime!==void 0||t.config.minDate&&t.minDateHasTime&&t.latestSelectedDateObj&&vn(t.latestSelectedDateObj,t.config.minDate,!0)===0,Te=t.config.maxTime!==void 0||t.config.maxDate&&t.maxDateHasTime&&t.latestSelectedDateObj&&vn(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 Ne=Ar(t.config.minTime.getHours(),t.config.minTime.getMinutes(),t.config.minTime.getSeconds()),Ze=Ar(t.config.maxTime.getHours(),t.config.maxTime.getMinutes(),t.config.maxTime.getSeconds()),qe=Ar(G,X,ne);if(qe>Ze&&qe<Ne){var Qe=IT(Ne);G=Qe[0],X=Qe[1],ne=Qe[2]}}else{if(Te){var Re=t.config.maxTime!==void 0?t.config.maxTime:t.config.maxDate;G=Math.min(G,Re.getHours()),G===Re.getHours()&&(X=Math.min(X,Re.getMinutes())),X===Re.getMinutes()&&(ne=Math.min(ne,Re.getSeconds()))}if(ae){var Ve=t.config.minTime!==void 0?t.config.minTime:t.config.minDate;G=Math.max(G,Ve.getHours()),G===Ve.getHours()&&X<Ve.getMinutes()&&(X=Ve.getMinutes()),X===Ve.getMinutes()&&(ne=Math.max(ne,Ve.getSeconds()))}}m(G,X,ne)}}function d(G){var X=G||t.latestSelectedDateObj;X&&X instanceof Date&&m(X.getHours(),X.getMinutes(),X.getSeconds())}function m(G,X,ne){t.latestSelectedDateObj!==void 0&&t.latestSelectedDateObj.setHours(G%24,X,ne||0,0),!(!t.hourElement||!t.minuteElement||t.isMobile)&&(t.hourElement.value=mn(t.config.time_24hr?G:(12+G)%12+12*In(G%12===0)),t.minuteElement.value=mn(X),t.amPM!==void 0&&(t.amPM.textContent=t.l10n.amPM[In(G>=12)]),t.secondElement!==void 0&&(t.secondElement.value=mn(ne)))}function h(G){var X=yn(G),ne=parseInt(X.value)+(G.delta||0);(ne/1e3>1||G.key==="Enter"&&!/[^\d]/.test(ne.toString()))&&bt(ne)}function _(G,X,ne,ae){if(X instanceof Array)return X.forEach(function(Te){return _(G,Te,ne,ae)});if(G instanceof Array)return G.forEach(function(Te){return _(Te,X,ne,ae)});G.addEventListener(X,ne,ae),t._handlers.push({remove:function(){return G.removeEventListener(X,ne,ae)}})}function g(){gt("onChange")}function y(){if(t.config.wrap&&["open","close","toggle","clear"].forEach(function(ne){Array.prototype.forEach.call(t.element.querySelectorAll("[data-"+ne+"]"),function(ae){return _(ae,"click",t[ne])})}),t.isMobile){ul();return}var G=ad(ze,50);if(t._debouncedChange=ad(g,LT),t.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&_(t.daysContainer,"mouseover",function(ne){t.config.mode==="range"&&Le(yn(ne))}),_(t._input,"keydown",Ee),t.calendarContainer!==void 0&&_(t.calendarContainer,"keydown",Ee),!t.config.inline&&!t.config.static&&_(window,"resize",G),window.ontouchstart!==void 0?_(window.document,"touchstart",xe):_(window.document,"mousedown",xe),_(window.document,"focus",xe,{capture:!0}),t.config.clickOpens===!0&&(_(t._input,"focus",t.open),_(t._input,"click",t.open)),t.daysContainer!==void 0&&(_(t.monthNav,"click",ut),_(t.monthNav,["keyup","increment"],h),_(t.daysContainer,"click",rl)),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0){var X=function(ne){return yn(ne).select()};_(t.timeContainer,["increment"],a),_(t.timeContainer,"blur",a,{capture:!0}),_(t.timeContainer,"click",T),_([t.hourElement,t.minuteElement],["focus","click"],X),t.secondElement!==void 0&&_(t.secondElement,"focus",function(){return t.secondElement&&t.secondElement.select()}),t.amPM!==void 0&&_(t.amPM,"click",function(ne){a(ne)})}t.config.allowInput&&_(t._input,"blur",Ot)}function S(G,X){var ne=G!==void 0?t.parseDate(G):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),ae=t.currentYear,Te=t.currentMonth;try{ne!==void 0&&(t.currentYear=ne.getFullYear(),t.currentMonth=ne.getMonth())}catch(Ne){Ne.message="Invalid date supplied: "+ne,t.config.errorHandler(Ne)}X&&t.currentYear!==ae&&(gt("onYearChange"),P()),X&&(t.currentYear!==ae||t.currentMonth!==Te)&>("onMonthChange"),t.redraw()}function T(G){var X=yn(G);~X.className.indexOf("arrow")&&$(G,X.classList.contains("arrowUp")?1:-1)}function $(G,X,ne){var ae=G&&yn(G),Te=ne||ae&&ae.parentNode&&ae.parentNode.firstChild,Ne=rt("increment");Ne.delta=X,Te&&Te.dispatchEvent(Ne)}function C(){var G=window.document.createDocumentFragment();if(t.calendarContainer=ct("div","flatpickr-calendar"),t.calendarContainer.tabIndex=-1,!t.config.noCalendar){if(G.appendChild(Y()),t.innerContainer=ct("div","flatpickr-innerContainer"),t.config.weekNumbers){var X=pe(),ne=X.weekWrapper,ae=X.weekNumbers;t.innerContainer.appendChild(ne),t.weekNumbers=ae,t.weekWrapper=ne}t.rContainer=ct("div","flatpickr-rContainer"),t.rContainer.appendChild(B()),t.daysContainer||(t.daysContainer=ct("div","flatpickr-days"),t.daysContainer.tabIndex=-1),N(),t.rContainer.appendChild(t.daysContainer),t.innerContainer.appendChild(t.rContainer),G.appendChild(t.innerContainer)}t.config.enableTime&&G.appendChild(J()),un(t.calendarContainer,"rangeMode",t.config.mode==="range"),un(t.calendarContainer,"animate",t.config.animate===!0),un(t.calendarContainer,"multiMonth",t.config.showMonths>1),t.calendarContainer.appendChild(G);var Te=t.config.appendTo!==void 0&&t.config.appendTo.nodeType!==void 0;if((t.config.inline||t.config.static)&&(t.calendarContainer.classList.add(t.config.inline?"inline":"static"),t.config.inline&&(!Te&&t.element.parentNode?t.element.parentNode.insertBefore(t.calendarContainer,t._input.nextSibling):t.config.appendTo!==void 0&&t.config.appendTo.appendChild(t.calendarContainer)),t.config.static)){var Ne=ct("div","flatpickr-wrapper");t.element.parentNode&&t.element.parentNode.insertBefore(Ne,t.element),Ne.appendChild(t.element),t.altInput&&Ne.appendChild(t.altInput),Ne.appendChild(t.calendarContainer)}!t.config.static&&!t.config.inline&&(t.config.appendTo!==void 0?t.config.appendTo:window.document.body).appendChild(t.calendarContainer)}function O(G,X,ne,ae){var Te=kt(X,!0),Ne=ct("span",G,X.getDate().toString());return Ne.dateObj=X,Ne.$i=ae,Ne.setAttribute("aria-label",t.formatDate(X,t.config.ariaDateFormat)),G.indexOf("hidden")===-1&&vn(X,t.now)===0&&(t.todayDateElem=Ne,Ne.classList.add("today"),Ne.setAttribute("aria-current","date")),Te?(Ne.tabIndex=-1,Mn(X)&&(Ne.classList.add("selected"),t.selectedDateElem=Ne,t.config.mode==="range"&&(un(Ne,"startRange",t.selectedDates[0]&&vn(X,t.selectedDates[0],!0)===0),un(Ne,"endRange",t.selectedDates[1]&&vn(X,t.selectedDates[1],!0)===0),G==="nextMonthDay"&&Ne.classList.add("inRange")))):Ne.classList.add("flatpickr-disabled"),t.config.mode==="range"&&he(X)&&!Mn(X)&&Ne.classList.add("inRange"),t.weekNumbers&&t.config.showMonths===1&&G!=="prevMonthDay"&&ae%7===6&&t.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+t.config.getWeek(X)+"</span>"),gt("onDayCreate",Ne),Ne}function D(G){G.focus(),t.config.mode==="range"&&Le(G)}function I(G){for(var X=G>0?0:t.config.showMonths-1,ne=G>0?t.config.showMonths:-1,ae=X;ae!=ne;ae+=G)for(var Te=t.daysContainer.children[ae],Ne=G>0?0:Te.children.length-1,Ze=G>0?Te.children.length:-1,qe=Ne;qe!=Ze;qe+=G){var Qe=Te.children[qe];if(Qe.className.indexOf("hidden")===-1&&kt(Qe.dateObj))return Qe}}function L(G,X){for(var ne=G.className.indexOf("Month")===-1?G.dateObj.getMonth():t.currentMonth,ae=X>0?t.config.showMonths:-1,Te=X>0?1:-1,Ne=ne-t.currentMonth;Ne!=ae;Ne+=Te)for(var Ze=t.daysContainer.children[Ne],qe=ne-t.currentMonth===Ne?G.$i+X:X<0?Ze.children.length-1:0,Qe=Ze.children.length,Re=qe;Re>=0&&Re<Qe&&Re!=(X>0?Qe:-1);Re+=Te){var Ve=Ze.children[Re];if(Ve.className.indexOf("hidden")===-1&&kt(Ve.dateObj)&&Math.abs(G.$i-Re)>=Math.abs(X))return D(Ve)}t.changeMonth(Te),R(I(Te),0)}function R(G,X){var ne=s(),ae=yt(ne||document.body),Te=G!==void 0?G:ae?ne:t.selectedDateElem!==void 0&&yt(t.selectedDateElem)?t.selectedDateElem:t.todayDateElem!==void 0&&yt(t.todayDateElem)?t.todayDateElem:I(X>0?1:-1);Te===void 0?t._input.focus():ae?L(Te,X):D(Te)}function F(G,X){for(var ne=(new Date(G,X,1).getDay()-t.l10n.firstDayOfWeek+7)%7,ae=t.utils.getDaysInMonth((X-1+12)%12,G),Te=t.utils.getDaysInMonth(X,G),Ne=window.document.createDocumentFragment(),Ze=t.config.showMonths>1,qe=Ze?"prevMonthDay hidden":"prevMonthDay",Qe=Ze?"nextMonthDay hidden":"nextMonthDay",Re=ae+1-ne,Ve=0;Re<=ae;Re++,Ve++)Ne.appendChild(O("flatpickr-day "+qe,new Date(G,X-1,Re),Re,Ve));for(Re=1;Re<=Te;Re++,Ve++)Ne.appendChild(O("flatpickr-day",new Date(G,X,Re),Re,Ve));for(var vt=Te+1;vt<=42-ne&&(t.config.showMonths===1||Ve%7!==0);vt++,Ve++)Ne.appendChild(O("flatpickr-day "+Qe,new Date(G,X+1,vt%Te),vt,Ve));var Jn=ct("div","dayContainer");return Jn.appendChild(Ne),Jn}function N(){if(t.daysContainer!==void 0){eo(t.daysContainer),t.weekNumbers&&eo(t.weekNumbers);for(var G=document.createDocumentFragment(),X=0;X<t.config.showMonths;X++){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),G.appendChild(F(ne.getFullYear(),ne.getMonth()))}t.daysContainer.appendChild(G),t.days=t.daysContainer.firstChild,t.config.mode==="range"&&t.selectedDates.length===1&&Le()}}function P(){if(!(t.config.showMonths>1||t.config.monthSelectorType!=="dropdown")){var G=function(ae){return t.config.minDate!==void 0&&t.currentYear===t.config.minDate.getFullYear()&&ae<t.config.minDate.getMonth()?!1:!(t.config.maxDate!==void 0&&t.currentYear===t.config.maxDate.getFullYear()&&ae>t.config.maxDate.getMonth())};t.monthsDropdownContainer.tabIndex=-1,t.monthsDropdownContainer.innerHTML="";for(var X=0;X<12;X++)if(G(X)){var ne=ct("option","flatpickr-monthDropdown-month");ne.value=new Date(t.currentYear,X).getMonth().toString(),ne.textContent=No(X,t.config.shorthandCurrentMonth,t.l10n),ne.tabIndex=-1,t.currentMonth===X&&(ne.selected=!0),t.monthsDropdownContainer.appendChild(ne)}}}function q(){var G=ct("div","flatpickr-month"),X=window.document.createDocumentFragment(),ne;t.config.showMonths>1||t.config.monthSelectorType==="static"?ne=ct("span","cur-month"):(t.monthsDropdownContainer=ct("select","flatpickr-monthDropdown-months"),t.monthsDropdownContainer.setAttribute("aria-label",t.l10n.monthAriaLabel),_(t.monthsDropdownContainer,"change",function(Ze){var qe=yn(Ze),Qe=parseInt(qe.value,10);t.changeMonth(Qe-t.currentMonth),gt("onMonthChange")}),P(),ne=t.monthsDropdownContainer);var ae=to("cur-year",{tabindex:"-1"}),Te=ae.getElementsByTagName("input")[0];Te.setAttribute("aria-label",t.l10n.yearAriaLabel),t.config.minDate&&Te.setAttribute("min",t.config.minDate.getFullYear().toString()),t.config.maxDate&&(Te.setAttribute("max",t.config.maxDate.getFullYear().toString()),Te.disabled=!!t.config.minDate&&t.config.minDate.getFullYear()===t.config.maxDate.getFullYear());var Ne=ct("div","flatpickr-current-month");return Ne.appendChild(ne),Ne.appendChild(ae),X.appendChild(Ne),G.appendChild(X),{container:G,yearElement:Te,monthElement:ne}}function U(){eo(t.monthNav),t.monthNav.appendChild(t.prevMonthNav),t.config.showMonths&&(t.yearElements=[],t.monthElements=[]);for(var G=t.config.showMonths;G--;){var X=q();t.yearElements.push(X.yearElement),t.monthElements.push(X.monthElement),t.monthNav.appendChild(X.container)}t.monthNav.appendChild(t.nextMonthNav)}function Y(){return t.monthNav=ct("div","flatpickr-months"),t.yearElements=[],t.monthElements=[],t.prevMonthNav=ct("span","flatpickr-prev-month"),t.prevMonthNav.innerHTML=t.config.prevArrow,t.nextMonthNav=ct("span","flatpickr-next-month"),t.nextMonthNav.innerHTML=t.config.nextArrow,U(),Object.defineProperty(t,"_hidePrevMonthArrow",{get:function(){return t.__hidePrevMonthArrow},set:function(G){t.__hidePrevMonthArrow!==G&&(un(t.prevMonthNav,"flatpickr-disabled",G),t.__hidePrevMonthArrow=G)}}),Object.defineProperty(t,"_hideNextMonthArrow",{get:function(){return t.__hideNextMonthArrow},set:function(G){t.__hideNextMonthArrow!==G&&(un(t.nextMonthNav,"flatpickr-disabled",G),t.__hideNextMonthArrow=G)}}),t.currentYearElement=t.yearElements[0],Me(),t.monthNav}function J(){t.calendarContainer.classList.add("hasTime"),t.config.noCalendar&&t.calendarContainer.classList.add("noCalendar");var G=Lr(t.config);t.timeContainer=ct("div","flatpickr-time"),t.timeContainer.tabIndex=-1;var X=ct("span","flatpickr-time-separator",":"),ne=to("flatpickr-hour",{"aria-label":t.l10n.hourAriaLabel});t.hourElement=ne.getElementsByTagName("input")[0];var ae=to("flatpickr-minute",{"aria-label":t.l10n.minuteAriaLabel});if(t.minuteElement=ae.getElementsByTagName("input")[0],t.hourElement.tabIndex=t.minuteElement.tabIndex=-1,t.hourElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getHours():t.config.time_24hr?G.hours:f(G.hours)),t.minuteElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getMinutes():G.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(X),t.timeContainer.appendChild(ae),t.config.time_24hr&&t.timeContainer.classList.add("time24hr"),t.config.enableSeconds){t.timeContainer.classList.add("hasSeconds");var Te=to("flatpickr-second");t.secondElement=Te.getElementsByTagName("input")[0],t.secondElement.value=mn(t.latestSelectedDateObj?t.latestSelectedDateObj.getSeconds():G.seconds),t.secondElement.setAttribute("step",t.minuteElement.getAttribute("step")),t.secondElement.setAttribute("min","0"),t.secondElement.setAttribute("max","59"),t.secondElement.setAttribute("maxlength","2"),t.timeContainer.appendChild(ct("span","flatpickr-time-separator",":")),t.timeContainer.appendChild(Te)}return t.config.time_24hr||(t.amPM=ct("span","flatpickr-am-pm",t.l10n.amPM[In((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 B(){t.weekdayContainer?eo(t.weekdayContainer):t.weekdayContainer=ct("div","flatpickr-weekdays");for(var G=t.config.showMonths;G--;){var X=ct("div","flatpickr-weekdaycontainer");t.weekdayContainer.appendChild(X)}return W(),t.weekdayContainer}function W(){if(t.weekdayContainer){var G=t.l10n.firstDayOfWeek,X=ud(t.l10n.weekdays.shorthand);G>0&&G<X.length&&(X=ud(X.splice(G,X.length),X.splice(0,G)));for(var ne=t.config.showMonths;ne--;)t.weekdayContainer.children[ne].innerHTML=`
|
||
<span class='flatpickr-weekday'>
|
||
`+X.join("</span><span class='flatpickr-weekday'>")+`
|
||
</span>
|
||
`}}function pe(){t.calendarContainer.classList.add("hasWeeks");var G=ct("div","flatpickr-weekwrapper");G.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return G.appendChild(X),{weekWrapper:G,weekNumbers:X}}function ee(G,X){X===void 0&&(X=!0);var ne=X?G:G-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,gt("onYearChange"),P()),N(),gt("onMonthChange"),Me())}function ue(G,X){if(G===void 0&&(G=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Lr(t.config),ae=ne.hours,Te=ne.minutes,Ne=ne.seconds;m(ae,Te,Ne)}t.redraw(),G&>("onChange")}function Oe(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),gt("onClose")}function He(){t.config!==void 0&>("onDestroy");for(var G=t._handlers.length;G--;)t._handlers[G].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 X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}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 Je(G){return t.calendarContainer.contains(G)}function xe(G){if(t.isOpen&&!t.config.inline){var X=yn(G),ne=Je(X),ae=X===t.input||X===t.altInput||t.element.contains(X)||G.path&&G.path.indexOf&&(~G.path.indexOf(t.input)||~G.path.indexOf(t.altInput)),Te=!ae&&!ne&&!Je(G.relatedTarget),Ne=!t.config.ignoredFocusElements.some(function(Ze){return Ze.contains(X)});Te&&Ne&&(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 bt(G){if(!(!G||t.config.minDate&&G<t.config.minDate.getFullYear()||t.config.maxDate&&G>t.config.maxDate.getFullYear())){var X=G,ne=t.currentYear!==X;t.currentYear=X||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(),gt("onYearChange"),P())}}function kt(G,X){var ne;X===void 0&&(X=!0);var ae=t.parseDate(G,void 0,X);if(t.config.minDate&&ae&&vn(ae,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&ae&&vn(ae,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(ae===void 0)return!1;for(var Te=!!t.config.enable,Ne=(ne=t.config.enable)!==null&&ne!==void 0?ne:t.config.disable,Ze=0,qe=void 0;Ze<Ne.length;Ze++){if(qe=Ne[Ze],typeof qe=="function"&&qe(ae))return Te;if(qe instanceof Date&&ae!==void 0&&qe.getTime()===ae.getTime())return Te;if(typeof qe=="string"){var Qe=t.parseDate(qe,void 0,!0);return Qe&&Qe.getTime()===ae.getTime()?Te:!Te}else if(typeof qe=="object"&&ae!==void 0&&qe.from&&qe.to&&ae.getTime()>=qe.from.getTime()&&ae.getTime()<=qe.to.getTime())return Te}return!Te}function yt(G){return t.daysContainer!==void 0?G.className.indexOf("hidden")===-1&&G.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(G):!1}function Ot(G){var X=G.target===t._input,ne=t._input.value.trimEnd()!==mt();X&&ne&&!(G.relatedTarget&&Je(G.relatedTarget))&&t.setDate(t._input.value,!0,G.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function Ee(G){var X=yn(G),ne=t.config.wrap?n.contains(X):X===t._input,ae=t.config.allowInput,Te=t.isOpen&&(!ae||!ne),Ne=t.config.inline&&ne&&!ae;if(G.keyCode===13&&ne){if(ae)return t.setDate(t._input.value,!0,X===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),X.blur();t.open()}else if(Je(X)||Te||Ne){var Ze=!!t.timeContainer&&t.timeContainer.contains(X);switch(G.keyCode){case 13:Ze?(G.preventDefault(),a(),Ni()):rl(G);break;case 27:G.preventDefault(),Ni();break;case 8:case 46:ne&&!t.config.allowInput&&(G.preventDefault(),t.clear());break;case 37:case 39:if(!Ze&&!ne){G.preventDefault();var qe=s();if(t.daysContainer!==void 0&&(ae===!1||qe&&yt(qe))){var Qe=G.keyCode===39?1:-1;G.ctrlKey?(G.stopPropagation(),ee(Qe),R(I(1),0)):R(void 0,Qe)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:G.preventDefault();var Re=G.keyCode===40?1:-1;t.daysContainer&&X.$i!==void 0||X===t.input||X===t.altInput?G.ctrlKey?(G.stopPropagation(),bt(t.currentYear-Re),R(I(1),0)):Ze||R(void 0,Re*7):X===t.currentYearElement?bt(t.currentYear-Re):t.config.enableTime&&(!Ze&&t.hourElement&&t.hourElement.focus(),a(G),t._debouncedChange());break;case 9:if(Ze){var Ve=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(kn){return kn}),vt=Ve.indexOf(X);if(vt!==-1){var Jn=Ve[vt+(G.shiftKey?-1:1)];G.preventDefault(),(Jn||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(X)&&G.shiftKey&&(G.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&X===t.amPM)switch(G.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],c(),Jt();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],c(),Jt();break}(ne||Je(X))&>("onKeyDown",G)}function Le(G,X){if(X===void 0&&(X="flatpickr-day"),!(t.selectedDates.length!==1||G&&(!G.classList.contains(X)||G.classList.contains("flatpickr-disabled")))){for(var ne=G?G.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),ae=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),Te=Math.min(ne,t.selectedDates[0].getTime()),Ne=Math.max(ne,t.selectedDates[0].getTime()),Ze=!1,qe=0,Qe=0,Re=Te;Re<Ne;Re+=AT.DAY)kt(new Date(Re),!0)||(Ze=Ze||Re>Te&&Re<Ne,Re<ae&&(!qe||Re>qe)?qe=Re:Re>ae&&(!Qe||Re<Qe)&&(Qe=Re));var Ve=Array.from(t.rContainer.querySelectorAll("*:nth-child(-n+"+t.config.showMonths+") > ."+X));Ve.forEach(function(vt){var Jn=vt.dateObj,kn=Jn.getTime(),jl=qe>0&&kn<qe||Qe>0&&kn>Qe;if(jl){vt.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(cl){vt.classList.remove(cl)});return}else if(Ze&&!jl)return;["startRange","inRange","endRange","notAllowed"].forEach(function(cl){vt.classList.remove(cl)}),G!==void 0&&(G.classList.add(ne<=t.selectedDates[0].getTime()?"startRange":"endRange"),ae<ne&&kn===ae?vt.classList.add("startRange"):ae>ne&&kn===ae&&vt.classList.add("endRange"),kn>=qe&&(Qe===0||kn<=Qe)&&ET(kn,ae,ne)&&vt.classList.add("inRange"))})}}function ze(){t.isOpen&&!t.config.static&&!t.config.inline&&zt()}function _t(G,X){if(X===void 0&&(X=t._positionElement),t.isMobile===!0){if(G){G.preventDefault();var ne=yn(G);ne&&ne.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),gt("onOpen");return}else if(t._input.disabled||t.config.inline)return;var ae=t.isOpen;t.isOpen=!0,ae||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),gt("onOpen"),zt(X)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(G===void 0||!t.timeContainer.contains(G.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function de(G){return function(X){var ne=t.config["_"+G+"Date"]=t.parseDate(X,t.config.dateFormat),ae=t.config["_"+(G==="min"?"max":"min")+"Date"];ne!==void 0&&(t[G==="min"?"minDateHasTime":"maxDateHasTime"]=ne.getHours()>0||ne.getMinutes()>0||ne.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(Te){return kt(Te)}),!t.selectedDates.length&&G==="min"&&d(ne),Jt()),t.daysContainer&&(qn(),ne!==void 0?t.currentYearElement[G]=ne.getFullYear().toString():t.currentYearElement.removeAttribute(G),t.currentYearElement.disabled=!!ae&&ne!==void 0&&ae.getFullYear()===ne.getFullYear())}}function ve(){var G=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],X=nn(nn({},JSON.parse(JSON.stringify(n.dataset||{}))),e),ne={};t.config.parseDate=X.parseDate,t.config.formatDate=X.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(Ve){t.config._enable=Kn(Ve)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(Ve){t.config._disable=Kn(Ve)}});var ae=X.mode==="time";if(!X.dateFormat&&(X.enableTime||ae)){var Te=Bt.defaultConfig.dateFormat||Tl.dateFormat;ne.dateFormat=X.noCalendar||ae?"H:i"+(X.enableSeconds?":S":""):Te+" H:i"+(X.enableSeconds?":S":"")}if(X.altInput&&(X.enableTime||ae)&&!X.altFormat){var Ne=Bt.defaultConfig.altFormat||Tl.altFormat;ne.altFormat=X.noCalendar||ae?"h:i"+(X.enableSeconds?":S K":" K"):Ne+(" h:i"+(X.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:de("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:de("max")});var Ze=function(Ve){return function(vt){t.config[Ve==="min"?"_minTime":"_maxTime"]=t.parseDate(vt,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:Ze("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:Ze("max")}),X.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,ne,X);for(var qe=0;qe<G.length;qe++)t.config[G[qe]]=t.config[G[qe]]===!0||t.config[G[qe]]==="true";Dr.filter(function(Ve){return t.config[Ve]!==void 0}).forEach(function(Ve){t.config[Ve]=Er(t.config[Ve]||[]).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 qe=0;qe<t.config.plugins.length;qe++){var Qe=t.config.plugins[qe](t)||{};for(var Re in Qe)Dr.indexOf(Re)>-1?t.config[Re]=Er(Qe[Re]).map(o).concat(t.config[Re]):typeof X[Re]>"u"&&(t.config[Re]=Qe[Re])}X.altInputClass||(t.config.altInputClass=Se().className+" "+t.config.altInputClass),gt("onParseConfig")}function Se(){return t.config.wrap?n.querySelector("[data-input]"):n}function Ye(){typeof t.config.locale!="object"&&typeof Bt.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=nn(nn({},Bt.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?Bt.l10ns[t.config.locale]:void 0),Wi.D="("+t.l10n.weekdays.shorthand.join("|")+")",Wi.l="("+t.l10n.weekdays.longhand.join("|")+")",Wi.M="("+t.l10n.months.shorthand.join("|")+")",Wi.F="("+t.l10n.months.longhand.join("|")+")",Wi.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var G=nn(nn({},e),JSON.parse(JSON.stringify(n.dataset||{})));G.time_24hr===void 0&&Bt.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=xb(t),t.parseDate=pa({config:t.config,l10n:t.l10n})}function zt(G){if(typeof t.config.position=="function")return void t.config.position(t,G);if(t.calendarContainer!==void 0){gt("onPreCalendarPosition");var X=G||t._positionElement,ne=Array.prototype.reduce.call(t.calendarContainer.children,function(_0,g0){return _0+g0.offsetHeight},0),ae=t.calendarContainer.offsetWidth,Te=t.config.position.split(" "),Ne=Te[0],Ze=Te.length>1?Te[1]:null,qe=X.getBoundingClientRect(),Qe=window.innerHeight-qe.bottom,Re=Ne==="above"||Ne!=="below"&&Qe<ne&&qe.top>ne,Ve=window.pageYOffset+qe.top+(Re?-ne-2:X.offsetHeight+2);if(un(t.calendarContainer,"arrowTop",!Re),un(t.calendarContainer,"arrowBottom",Re),!t.config.inline){var vt=window.pageXOffset+qe.left,Jn=!1,kn=!1;Ze==="center"?(vt-=(ae-qe.width)/2,Jn=!0):Ze==="right"&&(vt-=ae-qe.width,kn=!0),un(t.calendarContainer,"arrowLeft",!Jn&&!kn),un(t.calendarContainer,"arrowCenter",Jn),un(t.calendarContainer,"arrowRight",kn);var jl=window.document.body.offsetWidth-(window.pageXOffset+qe.right),cl=vt+ae>window.document.body.offsetWidth,u0=jl+ae>window.document.body.offsetWidth;if(un(t.calendarContainer,"rightMost",cl),!t.config.static)if(t.calendarContainer.style.top=Ve+"px",!cl)t.calendarContainer.style.left=vt+"px",t.calendarContainer.style.right="auto";else if(!u0)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=jl+"px";else{var tr=dn();if(tr===void 0)return;var f0=window.document.body.offsetWidth,c0=Math.max(0,f0/2-ae/2),d0=".flatpickr-calendar.centerMost:before",p0=".flatpickr-calendar.centerMost:after",m0=tr.cssRules.length,h0="{left:"+qe.left+"px;right:auto;}";un(t.calendarContainer,"rightMost",!1),un(t.calendarContainer,"centerMost",!0),tr.insertRule(d0+","+p0+h0,m0),t.calendarContainer.style.left=c0+"px",t.calendarContainer.style.right="auto"}}}}function dn(){for(var G=null,X=0;X<document.styleSheets.length;X++){var ne=document.styleSheets[X];if(ne.cssRules){try{ne.cssRules}catch{continue}G=ne;break}}return G??an()}function an(){var G=document.createElement("style");return document.head.appendChild(G),G.sheet}function qn(){t.config.noCalendar||t.isMobile||(P(),Me(),N())}function Ni(){t._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(t.close,0):t.close()}function rl(G){G.preventDefault(),G.stopPropagation();var X=function(Ve){return Ve.classList&&Ve.classList.contains("flatpickr-day")&&!Ve.classList.contains("flatpickr-disabled")&&!Ve.classList.contains("notAllowed")},ne=Qb(yn(G),X);if(ne!==void 0){var ae=ne,Te=t.latestSelectedDateObj=new Date(ae.dateObj.getTime()),Ne=(Te.getMonth()<t.currentMonth||Te.getMonth()>t.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=ae,t.config.mode==="single")t.selectedDates=[Te];else if(t.config.mode==="multiple"){var Ze=Mn(Te);Ze?t.selectedDates.splice(parseInt(Ze),1):t.selectedDates.push(Te)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=Te,t.selectedDates.push(Te),vn(Te,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(Ve,vt){return Ve.getTime()-vt.getTime()}));if(c(),Ne){var qe=t.currentYear!==Te.getFullYear();t.currentYear=Te.getFullYear(),t.currentMonth=Te.getMonth(),qe&&(gt("onYearChange"),P()),gt("onMonthChange")}if(Me(),N(),Jt(),!Ne&&t.config.mode!=="range"&&t.config.showMonths===1?D(ae):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 Qe=t.config.mode==="single"&&!t.config.enableTime,Re=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(Qe||Re)&&Ni()}g()}}var bi={locale:[Ye,W],showMonths:[U,r,B],minDate:[S],maxDate:[S],positionElement:[ki],clickOpens:[function(){t.config.clickOpens===!0?(_(t._input,"focus",t.open),_(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function Ie(G,X){if(G!==null&&typeof G=="object"){Object.assign(t.config,G);for(var ne in G)bi[ne]!==void 0&&bi[ne].forEach(function(ae){return ae()})}else t.config[G]=X,bi[G]!==void 0?bi[G].forEach(function(ae){return ae()}):Dr.indexOf(G)>-1&&(t.config[G]=Er(X));t.redraw(),Jt(!0)}function Ft(G,X){var ne=[];if(G instanceof Array)ne=G.map(function(ae){return t.parseDate(ae,X)});else if(G instanceof Date||typeof G=="number")ne=[t.parseDate(G,X)];else if(typeof G=="string")switch(t.config.mode){case"single":case"time":ne=[t.parseDate(G,X)];break;case"multiple":ne=G.split(t.config.conjunction).map(function(ae){return t.parseDate(ae,X)});break;case"range":ne=G.split(t.l10n.rangeSeparator).map(function(ae){return t.parseDate(ae,X)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(G)));t.selectedDates=t.config.allowInvalidPreload?ne:ne.filter(function(ae){return ae instanceof Date&&kt(ae,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(ae,Te){return ae.getTime()-Te.getTime()})}function Pi(G,X,ne){if(X===void 0&&(X=!1),ne===void 0&&(ne=t.config.dateFormat),G!==0&&!G||G instanceof Array&&G.length===0)return t.clear(X);Ft(G,ne),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),S(void 0,X),d(),t.selectedDates.length===0&&t.clear(!1),Jt(X),X&>("onChange")}function Kn(G){return G.slice().map(function(X){return typeof X=="string"||typeof X=="number"||X instanceof Date?t.parseDate(X,void 0,!0):X&&typeof X=="object"&&X.from&&X.to?{from:t.parseDate(X.from,void 0),to:t.parseDate(X.to,void 0)}:X}).filter(function(X){return X})}function al(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var G=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);G&&Ft(G,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 ql(){if(t.input=Se(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ct(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),ki()}function ki(){t._positionElement=t.config.positionElement||t._input}function ul(){var G=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ct("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=G,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=G==="datetime-local"?"Y-m-d\\TH:i:S":G==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}_(t.mobileInput,"change",function(X){t.setDate(yn(X).value,!1,t.mobileFormatStr),gt("onChange"),gt("onClose")})}function fl(G){if(t.isOpen===!0)return t.close();t.open(G)}function gt(G,X){if(t.config!==void 0){var ne=t.config[G];if(ne!==void 0&&ne.length>0)for(var ae=0;ne[ae]&&ae<ne.length;ae++)ne[ae](t.selectedDates,t.input.value,t,X);G==="onChange"&&(t.input.dispatchEvent(rt("change")),t.input.dispatchEvent(rt("input")))}}function rt(G){var X=document.createEvent("Event");return X.initEvent(G,!0,!0),X}function Mn(G){for(var X=0;X<t.selectedDates.length;X++){var ne=t.selectedDates[X];if(ne instanceof Date&&vn(ne,G)===0)return""+X}return!1}function he(G){return t.config.mode!=="range"||t.selectedDates.length<2?!1:vn(G,t.selectedDates[0])>=0&&vn(G,t.selectedDates[1])<=0}function Me(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(G,X){var ne=new Date(t.currentYear,t.currentMonth,1);ne.setMonth(t.currentMonth+X),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[X].textContent=No(ne.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=ne.getMonth().toString(),G.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 mt(G){var X=G||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(ne){return t.formatDate(ne,X)}).filter(function(ne,ae,Te){return t.config.mode!=="range"||t.config.enableTime||Te.indexOf(ne)===ae}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function Jt(G){G===void 0&&(G=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=mt(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=mt(t.config.altFormat)),G!==!1&>("onValueUpdate")}function ut(G){var X=yn(G),ne=t.prevMonthNav.contains(X),ae=t.nextMonthNav.contains(X);ne||ae?ee(ne?-1:1):t.yearElements.indexOf(X)>=0?X.select():X.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):X.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function oi(G){G.preventDefault();var X=G.type==="keydown",ne=yn(G),ae=ne;t.amPM!==void 0&&ne===t.amPM&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]);var Te=parseFloat(ae.getAttribute("min")),Ne=parseFloat(ae.getAttribute("max")),Ze=parseFloat(ae.getAttribute("step")),qe=parseInt(ae.value,10),Qe=G.delta||(X?G.which===38?1:-1:0),Re=qe+Ze*Qe;if(typeof ae.value<"u"&&ae.value.length===2){var Ve=ae===t.hourElement,vt=ae===t.minuteElement;Re<Te?(Re=Ne+Re+In(!Ve)+(In(Ve)&&In(!t.amPM)),vt&&$(void 0,-1,t.hourElement)):Re>Ne&&(Re=ae===t.hourElement?Re-Ne-In(!t.amPM):Te,vt&&$(void 0,1,t.hourElement)),t.amPM&&Ve&&(Ze===1?Re+qe===23:Math.abs(Re-qe)>Ze)&&(t.amPM.textContent=t.l10n.amPM[In(t.amPM.textContent===t.l10n.amPM[0])]),ae.value=mn(Re)}}return l(),t}function Cl(n,e){for(var t=Array.prototype.slice.call(n).filter(function(o){return o instanceof HTMLElement}),i=[],l=0;l<t.length;l++){var s=t[l];try{if(s.getAttribute("data-fp-omit")!==null)continue;s._flatpickr!==void 0&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=NT(s,e||{}),i.push(s._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 Cl(this,n)},HTMLElement.prototype.flatpickr=function(n){return Cl([this],n)});var Bt=function(n,e){return typeof n=="string"?Cl(window.document.querySelectorAll(n),e):n instanceof Node?Cl([n],e):Cl(n,e)};Bt.defaultConfig={};Bt.l10ns={en:nn({},bs),default:nn({},bs)};Bt.localize=function(n){Bt.l10ns.default=nn(nn({},Bt.l10ns.default),n)};Bt.setDefaults=function(n){Bt.defaultConfig=nn(nn({},Bt.defaultConfig),n)};Bt.parseDate=pa({});Bt.formatDate=xb({});Bt.compareDates=vn;typeof jQuery<"u"&&typeof jQuery.fn<"u"&&(jQuery.fn.flatpickr=function(n){return Cl(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=Bt);function PT(n){let e,t=[n[1]],i={};for(let l=0;l<t.length;l+=1)i=Ae(i,t[l]);return{c(){e=b("input"),ni(e,i)},m(l,s){w(l,e,s),e.autofocus&&e.focus(),n[11](e)},p(l,s){ni(e,i=dt(t,[s&2&&l[1]]))},d(l){l&&v(e),n[11](null)}}}function FT(n){let e;const t=n[10].default,i=St(t,n,n[9],null),l=i||PT(n);return{c(){l&&l.c()},m(s,o){l&&l.m(s,o),e=!0},p(s,[o]){i?i.p&&(!e||o&512)&&Tt(i,t,s,s[9],e?$t(t,s[9],o,null):Ct(s[9]),null):l&&l.p&&(!e||o&3)&&l.p(s,e?o:-1)},i(s){e||(E(l,s),e=!0)},o(s){A(l,s),e=!1},d(s){l&&l.d(s)}}}function RT(n){return n.charAt(2).toLowerCase()+n.substring(3)}function fd(n,e){var i;return(((i=n==null?void 0:n.config)==null?void 0:i.mode)??"single")==="single"?e[0]:e}function cd(n,e){return!!(n==e||n instanceof Date&&e instanceof Date&&n.valueOf()===e.valueOf()||Array.isArray(n)&&Array.isArray(e)&&n.length===e.length&&n.every((t,i)=>t===e[i]))}function qT(n,e,t){const i=["value","formattedValue","element","dateFormat","options","input","flatpickr"];let l=Xe(e,i),{$$slots:s={},$$scope:o}=e;const r=new Set(["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"]);let{value:a=void 0,formattedValue:u="",element:f=void 0,dateFormat:c=void 0}=e,{options:d={}}=e,m=!1,{input:h=void 0,flatpickr:_=void 0}=e;Kt(()=>{const $=f??h,C=y(d);return C.onReady.push((O,D,I)=>{a===void 0&&S(O,D,I),Qt().then(()=>{t(8,m=!0)})}),t(3,_=Bt($,Object.assign(C,f?{wrap:!0}:{}))),()=>{_.destroy()}});const g=lt();function y($={}){$=Object.assign({},$);for(const C of r){const O=(D,I,L)=>{g(RT(C),[D,I,L])};C in $?(Array.isArray($[C])||($[C]=[$[C]]),$[C].push(O)):$[C]=[O]}return $.onChange&&!$.onChange.includes(S)&&$.onChange.push(S),$}function S($,C,O){const D=fd(O,$);!cd(a,D)&&(a||D)&&t(2,a=D),t(4,u=C)}function T($){te[$?"unshift":"push"](()=>{h=$,t(0,h)})}return n.$$set=$=>{e=Ae(Ae({},e),Yt($)),t(1,l=Xe(e,i)),"value"in $&&t(2,a=$.value),"formattedValue"in $&&t(4,u=$.formattedValue),"element"in $&&t(5,f=$.element),"dateFormat"in $&&t(6,c=$.dateFormat),"options"in $&&t(7,d=$.options),"input"in $&&t(0,h=$.input),"flatpickr"in $&&t(3,_=$.flatpickr),"$$scope"in $&&t(9,o=$.$$scope)},n.$$.update=()=>{if(n.$$.dirty&332&&_&&m&&(cd(a,fd(_,_.selectedDates))||_.setDate(a,!0,c)),n.$$.dirty&392&&_&&m)for(const[$,C]of Object.entries(y(d)))_.set($,C)},[h,l,a,_,u,f,c,d,m,o,s,T]}class Za extends ge{constructor(e){super(),_e(this,e,qT,FT,me,{value:2,formattedValue:4,element:5,dateFormat:6,options:7,input:0,flatpickr:3})}}function jT(n){let e,t,i,l,s,o,r,a;function u(d){n[6](d)}function f(d){n[7](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(c.value=n[2]),n[0].options.min!==void 0&&(c.formattedValue=n[0].options.min),s=new Za({props:c}),te.push(()=>be(s,"value",u)),te.push(()=>be(s,"formattedValue",f)),s.$on("close",n[8]),{c(){e=b("label"),t=Z("Min date (UTC)"),l=M(),V(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),H(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&4&&(o=!0,h.value=d[2],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.min,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),z(s,d)}}}function HT(n){let e,t,i,l,s,o,r,a;function u(d){n[9](d)}function f(d){n[10](d)}let c={id:n[16],options:j.defaultFlatpickrOptions()};return n[3]!==void 0&&(c.value=n[3]),n[0].options.max!==void 0&&(c.formattedValue=n[0].options.max),s=new Za({props:c}),te.push(()=>be(s,"value",u)),te.push(()=>be(s,"formattedValue",f)),s.$on("close",n[11]),{c(){e=b("label"),t=Z("Max date (UTC)"),l=M(),V(s.$$.fragment),p(e,"for",i=n[16])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),H(s,d,m),a=!0},p(d,m){(!a||m&65536&&i!==(i=d[16]))&&p(e,"for",i);const h={};m&65536&&(h.id=d[16]),!o&&m&8&&(o=!0,h.value=d[3],ke(()=>o=!1)),!r&&m&1&&(r=!0,h.formattedValue=d[0].options.max,ke(()=>r=!1)),s.$set(h)},i(d){a||(E(s.$$.fragment,d),a=!0)},o(d){A(s.$$.fragment,d),a=!1},d(d){d&&(v(e),v(l)),z(s,d)}}}function zT(n){let e,t,i,l,s,o,r;return i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.min",$$slots:{default:[jT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.max",$$slots:{default:[HT,({uniqueId:a})=>({16:a}),({uniqueId:a})=>a?65536:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.min"),u&196613&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.max"),u&196617&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){A(i.$$.fragment,a),A(o.$$.fragment,a),r=!1},d(a){a&&v(e),z(i),z(o)}}}function VT(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[12](r)}let o={$$slots:{options:[zT]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[13]),e.$on("remove",n[14]),e.$on("duplicate",n[15]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&131087&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function BT(n,e,t){var $,C;const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e,r=($=s==null?void 0:s.options)==null?void 0:$.min,a=(C=s==null?void 0:s.options)==null?void 0:C.max;function u(O,D){O.detail&&O.detail.length==3&&t(0,s.options[D]=O.detail[1],s)}function f(O){r=O,t(2,r),t(0,s)}function c(O){n.$$.not_equal(s.options.min,O)&&(s.options.min=O,t(0,s))}const d=O=>u(O,"min");function m(O){a=O,t(3,a),t(0,s)}function h(O){n.$$.not_equal(s.options.max,O)&&(s.options.max=O,t(0,s))}const _=O=>u(O,"max");function g(O){s=O,t(0,s)}function y(O){Ce.call(this,n,O)}function S(O){Ce.call(this,n,O)}function T(O){Ce.call(this,n,O)}return n.$$set=O=>{e=Ae(Ae({},e),Yt(O)),t(5,l=Xe(e,i)),"field"in O&&t(0,s=O.field),"key"in O&&t(1,o=O.key)},n.$$.update=()=>{var O,D,I,L;n.$$.dirty&5&&r!=((O=s==null?void 0:s.options)==null?void 0:O.min)&&t(2,r=(D=s==null?void 0:s.options)==null?void 0:D.min),n.$$.dirty&9&&a!=((I=s==null?void 0:s.options)==null?void 0:I.max)&&t(3,a=(L=s==null?void 0:s.options)==null?void 0:L.max)},[s,o,r,a,u,l,f,c,d,m,h,_,g,y,S,T]}class UT extends ge{constructor(e){super(),_e(this,e,BT,VT,me,{field:0,key:1})}}const WT=n=>({}),dd=n=>({});function pd(n,e,t){const i=n.slice();return i[48]=e[t],i}const YT=n=>({}),md=n=>({});function hd(n,e,t){const i=n.slice();return i[48]=e[t],i[52]=t,i}function _d(n){let e,t,i;return{c(){e=b("div"),t=Z(n[2]),i=M(),p(e,"class","block txt-placeholder"),x(e,"link-hint",!n[5]&&!n[6])},m(l,s){w(l,e,s),k(e,t),k(e,i)},p(l,s){s[0]&4&&se(t,l[2]),s[0]&96&&x(e,"link-hint",!l[5]&&!l[6])},d(l){l&&v(e)}}}function KT(n){let e,t=n[48]+"",i;return{c(){e=b("span"),i=Z(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&1&&t!==(t=l[48]+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function JT(n){let e,t,i;const l=[{item:n[48]},n[11]];var s=n[10];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=Ae(u,l[f]);return a!==void 0&&a[0]&2049&&(u=Ae(u,dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]))),{props:u}}return s&&(e=It(s,o(n))),{c(){e&&V(e.$$.fragment),t=ye()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){if(a[0]&1024&&s!==(s=r[10])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),le()}s?(e=It(s,o(r,a)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&2049?dt(l,[a[0]&1&&{item:r[48]},a[0]&2048&&Dt(r[11])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function gd(n){let e,t,i;function l(){return n[36](n[48])}return{c(){e=b("span"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"class","clear")},m(s,o){w(s,e,o),t||(i=[$e(Pe.call(null,e,"Clear")),K(e,"click",Tn(Ue(l)))],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function bd(n){let e,t,i,l,s,o;const r=[JT,KT],a=[];function u(c,d){return c[10]?0:1}t=u(n),i=a[t]=r[t](n);let f=(n[4]||n[8])&&gd(n);return{c(){e=b("div"),i.c(),l=M(),f&&f.c(),s=M(),p(e,"class","option")},m(c,d){w(c,e,d),a[t].m(e,null),k(e,l),f&&f.m(e,null),k(e,s),o=!0},p(c,d){let m=t;t=u(c),t===m?a[t].p(c,d):(ie(),A(a[m],1,1,()=>{a[m]=null}),le(),i=a[t],i?i.p(c,d):(i=a[t]=r[t](c),i.c()),E(i,1),i.m(e,l)),c[4]||c[8]?f?f.p(c,d):(f=gd(c),f.c(),f.m(e,s)):f&&(f.d(1),f=null)},i(c){o||(E(i),o=!0)},o(c){A(i),o=!1},d(c){c&&v(e),a[t].d(),f&&f.d()}}}function kd(n){let e,t,i={class:"dropdown dropdown-block options-dropdown dropdown-left "+(n[7]?"dropdown-upside":""),trigger:n[20],$$slots:{default:[XT]},$$scope:{ctx:n}};return e=new On({props:i}),n[41](e),e.$on("show",n[26]),e.$on("hide",n[42]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&128&&(o.class="dropdown dropdown-block options-dropdown dropdown-left "+(l[7]?"dropdown-upside":"")),s[0]&1048576&&(o.trigger=l[20]),s[0]&6451722|s[1]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[41](null),z(e,l)}}}function yd(n){let e,t,i,l,s,o,r,a,u=n[17].length&&vd(n);return{c(){e=b("div"),t=b("label"),i=b("div"),i.innerHTML='<i class="ri-search-line"></i>',l=M(),s=b("input"),o=M(),u&&u.c(),p(i,"class","addon p-r-0"),s.autofocus=!0,p(s,"type","text"),p(s,"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),k(e,t),k(t,i),k(t,l),k(t,s),oe(s,n[17]),k(t,o),u&&u.m(t,null),s.focus(),r||(a=K(s,"input",n[38]),r=!0)},p(f,c){c[0]&8&&p(s,"placeholder",f[3]),c[0]&131072&&s.value!==f[17]&&oe(s,f[17]),f[17].length?u?u.p(f,c):(u=vd(f),u.c(),u.m(t,null)):u&&(u.d(1),u=null)},d(f){f&&v(e),u&&u.d(),r=!1,a()}}}function vd(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent clear"),p(e,"class","addon suffix p-r-5")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",Tn(Ue(n[23]))),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function wd(n){let e,t=n[1]&&Sd(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[1]?t?t.p(i,l):(t=Sd(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function Sd(n){let e,t;return{c(){e=b("div"),t=Z(n[1]),p(e,"class","txt-missing")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&2&&se(t,i[1])},d(i){i&&v(e)}}}function ZT(n){let e=n[48]+"",t;return{c(){t=Z(e)},m(i,l){w(i,t,l)},p(i,l){l[0]&4194304&&e!==(e=i[48]+"")&&se(t,e)},i:Q,o:Q,d(i){i&&v(t)}}}function GT(n){let e,t,i;const l=[{item:n[48]},n[13]];var s=n[12];function o(r,a){let u={};for(let f=0;f<l.length;f+=1)u=Ae(u,l[f]);return a!==void 0&&a[0]&4202496&&(u=Ae(u,dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]))),{props:u}}return s&&(e=It(s,o(n))),{c(){e&&V(e.$$.fragment),t=ye()},m(r,a){e&&H(e,r,a),w(r,t,a),i=!0},p(r,a){if(a[0]&4096&&s!==(s=r[12])){if(e){ie();const u=e;A(u.$$.fragment,1,0,()=>{z(u,1)}),le()}s?(e=It(s,o(r,a)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(s){const u=a[0]&4202496?dt(l,[a[0]&4194304&&{item:r[48]},a[0]&8192&&Dt(r[13])]):{};e.$set(u)}},i(r){i||(e&&E(e.$$.fragment,r),i=!0)},o(r){e&&A(e.$$.fragment,r),i=!1},d(r){r&&v(t),e&&z(e,r)}}}function $d(n){let e,t,i,l,s,o,r;const a=[GT,ZT],u=[];function f(m,h){return m[12]?0:1}t=f(n),i=u[t]=a[t](n);function c(...m){return n[39](n[48],...m)}function d(...m){return n[40](n[48],...m)}return{c(){e=b("div"),i.c(),l=M(),p(e,"tabindex","0"),p(e,"class","dropdown-item option"),p(e,"role","menuitem"),x(e,"closable",n[9]),x(e,"selected",n[21](n[48]))},m(m,h){w(m,e,h),u[t].m(e,null),k(e,l),s=!0,o||(r=[K(e,"click",c),K(e,"keydown",d)],o=!0)},p(m,h){n=m;let _=t;t=f(n),t===_?u[t].p(n,h):(ie(),A(u[_],1,1,()=>{u[_]=null}),le(),i=u[t],i?i.p(n,h):(i=u[t]=a[t](n),i.c()),E(i,1),i.m(e,l)),(!s||h[0]&512)&&x(e,"closable",n[9]),(!s||h[0]&6291456)&&x(e,"selected",n[21](n[48]))},i(m){s||(E(i),s=!0)},o(m){A(i),s=!1},d(m){m&&v(e),u[t].d(),o=!1,we(r)}}}function XT(n){let e,t,i,l,s,o=n[14]&&yd(n);const r=n[35].beforeOptions,a=St(r,n,n[44],md);let u=fe(n[22]),f=[];for(let _=0;_<u.length;_+=1)f[_]=$d(pd(n,u,_));const c=_=>A(f[_],1,1,()=>{f[_]=null});let d=null;u.length||(d=wd(n));const m=n[35].afterOptions,h=St(m,n,n[44],dd);return{c(){o&&o.c(),e=M(),a&&a.c(),t=M(),i=b("div");for(let _=0;_<f.length;_+=1)f[_].c();d&&d.c(),l=M(),h&&h.c(),p(i,"class","options-list")},m(_,g){o&&o.m(_,g),w(_,e,g),a&&a.m(_,g),w(_,t,g),w(_,i,g);for(let y=0;y<f.length;y+=1)f[y]&&f[y].m(i,null);d&&d.m(i,null),w(_,l,g),h&&h.m(_,g),s=!0},p(_,g){if(_[14]?o?o.p(_,g):(o=yd(_),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),a&&a.p&&(!s||g[1]&8192)&&Tt(a,r,_,_[44],s?$t(r,_[44],g,YT):Ct(_[44]),md),g[0]&56635906){u=fe(_[22]);let y;for(y=0;y<u.length;y+=1){const S=pd(_,u,y);f[y]?(f[y].p(S,g),E(f[y],1)):(f[y]=$d(S),f[y].c(),E(f[y],1),f[y].m(i,null))}for(ie(),y=u.length;y<f.length;y+=1)c(y);le(),!u.length&&d?d.p(_,g):u.length?d&&(d.d(1),d=null):(d=wd(_),d.c(),d.m(i,null))}h&&h.p&&(!s||g[1]&8192)&&Tt(h,m,_,_[44],s?$t(m,_[44],g,WT):Ct(_[44]),dd)},i(_){if(!s){E(a,_);for(let g=0;g<u.length;g+=1)E(f[g]);E(h,_),s=!0}},o(_){A(a,_),f=f.filter(Boolean);for(let g=0;g<f.length;g+=1)A(f[g]);A(h,_),s=!1},d(_){_&&(v(e),v(t),v(i),v(l)),o&&o.d(_),a&&a.d(_),ot(f,_),d&&d.d(),h&&h.d(_)}}}function QT(n){let e,t,i,l,s,o,r=fe(j.toArray(n[0])),a=[];for(let d=0;d<r.length;d+=1)a[d]=bd(hd(n,r,d));const u=d=>A(a[d],1,1,()=>{a[d]=null});let f=null;r.length||(f=_d(n));let c=!n[5]&&!n[6]&&kd(n);return{c(){e=b("div"),t=b("div");for(let d=0;d<a.length;d+=1)a[d].c();f&&f.c(),l=M(),c&&c.c(),p(t,"tabindex",i=n[5]||n[6]?"-1":"0"),p(t,"class","selected-container"),p(t,"role","button"),x(t,"disabled",n[5]),x(t,"readonly",n[6]),p(e,"class",s="select "+n[15]),x(e,"upside",n[7]),x(e,"multiple",n[4]),x(e,"disabled",n[5]),x(e,"readonly",n[6])},m(d,m){w(d,e,m),k(e,t);for(let h=0;h<a.length;h+=1)a[h]&&a[h].m(t,null);f&&f.m(t,null),n[37](t),k(e,l),c&&c.m(e,null),n[43](e),o=!0},p(d,m){if(m[0]&68981){r=fe(j.toArray(d[0]));let h;for(h=0;h<r.length;h+=1){const _=hd(d,r,h);a[h]?(a[h].p(_,m),E(a[h],1)):(a[h]=bd(_),a[h].c(),E(a[h],1),a[h].m(t,null))}for(ie(),h=r.length;h<a.length;h+=1)u(h);le(),!r.length&&f?f.p(d,m):r.length?f&&(f.d(1),f=null):(f=_d(d),f.c(),f.m(t,null))}(!o||m[0]&96&&i!==(i=d[5]||d[6]?"-1":"0"))&&p(t,"tabindex",i),(!o||m[0]&32)&&x(t,"disabled",d[5]),(!o||m[0]&64)&&x(t,"readonly",d[6]),!d[5]&&!d[6]?c?(c.p(d,m),m[0]&96&&E(c,1)):(c=kd(d),c.c(),E(c,1),c.m(e,null)):c&&(ie(),A(c,1,1,()=>{c=null}),le()),(!o||m[0]&32768&&s!==(s="select "+d[15]))&&p(e,"class",s),(!o||m[0]&32896)&&x(e,"upside",d[7]),(!o||m[0]&32784)&&x(e,"multiple",d[4]),(!o||m[0]&32800)&&x(e,"disabled",d[5]),(!o||m[0]&32832)&&x(e,"readonly",d[6])},i(d){if(!o){for(let m=0;m<r.length;m+=1)E(a[m]);E(c),o=!0}},o(d){a=a.filter(Boolean);for(let m=0;m<a.length;m+=1)A(a[m]);A(c),o=!1},d(d){d&&v(e),ot(a,d),f&&f.d(),n[37](null),c&&c.d(),n[43](null)}}}function xT(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 eC(n,e,t){let i,l,{$$slots:s={},$$scope:o}=e,{id:r=""}=e,{noOptionsText:a="No options found"}=e,{selectPlaceholder:u="- Select -"}=e,{searchPlaceholder:f="Search..."}=e,{items:c=[]}=e,{multiple:d=!1}=e,{disabled:m=!1}=e,{readonly:h=!1}=e,{upside:_=!1}=e,{selected:g=d?[]:void 0}=e,{toggle:y=d}=e,{closable:S=!0}=e,{labelComponent:T=void 0}=e,{labelComponentProps:$={}}=e,{optionComponent:C=void 0}=e,{optionComponentProps:O={}}=e,{searchable:D=!1}=e,{searchFunc:I=void 0}=e,{class:L=""}=e,R,F="",N,P;function q(de){if(j.isEmpty(g))return;let ve=j.toArray(g);j.inArray(ve,de)&&(j.removeByValue(ve,de),t(0,g=ve)),N==null||N.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function U(de){if(d){let ve=j.toArray(g);j.inArray(ve,de)||t(0,g=[...ve,de])}else t(0,g=de);N==null||N.dispatchEvent(new CustomEvent("change",{detail:g,bubbles:!0}))}function Y(de){return l(de)?q(de):U(de)}function J(){t(0,g=d?[]:void 0)}function B(){R!=null&&R.show&&(R==null||R.show())}function W(){R!=null&&R.hide&&(R==null||R.hide())}function pe(){if(j.isEmpty(g)||j.isEmpty(c))return;let de=j.toArray(g),ve=[];for(const Se of de)j.inArray(c,Se)||ve.push(Se);if(ve.length){for(const Se of ve)j.removeByValue(de,Se);t(0,g=d?de:de[0])}}function ee(){t(17,F="")}function ue(de,ve){de=de||[];const Se=I||xT;return de.filter(Ye=>Se(Ye,ve))||[]}function Oe(de,ve){de.preventDefault(),y&&d?Y(ve):U(ve)}function He(de,ve){(de.code==="Enter"||de.code==="Space")&&(Oe(de,ve),S&&W())}function Je(){ee(),setTimeout(()=>{const de=N==null?void 0:N.querySelector(".dropdown-item.option.selected");de&&(de.focus(),de.scrollIntoView({block:"nearest"}))},0)}function xe(de){de.stopPropagation(),!h&&!m&&(R==null||R.toggle())}Kt(()=>{const de=document.querySelectorAll(`label[for="${r}"]`);for(const ve of de)ve.addEventListener("click",xe);return()=>{for(const ve of de)ve.removeEventListener("click",xe)}});const bt=de=>q(de);function kt(de){te[de?"unshift":"push"](()=>{P=de,t(20,P)})}function yt(){F=this.value,t(17,F)}const Ot=(de,ve)=>Oe(ve,de),Ee=(de,ve)=>He(ve,de);function Le(de){te[de?"unshift":"push"](()=>{R=de,t(18,R)})}function ze(de){Ce.call(this,n,de)}function _t(de){te[de?"unshift":"push"](()=>{N=de,t(19,N)})}return n.$$set=de=>{"id"in de&&t(27,r=de.id),"noOptionsText"in de&&t(1,a=de.noOptionsText),"selectPlaceholder"in de&&t(2,u=de.selectPlaceholder),"searchPlaceholder"in de&&t(3,f=de.searchPlaceholder),"items"in de&&t(28,c=de.items),"multiple"in de&&t(4,d=de.multiple),"disabled"in de&&t(5,m=de.disabled),"readonly"in de&&t(6,h=de.readonly),"upside"in de&&t(7,_=de.upside),"selected"in de&&t(0,g=de.selected),"toggle"in de&&t(8,y=de.toggle),"closable"in de&&t(9,S=de.closable),"labelComponent"in de&&t(10,T=de.labelComponent),"labelComponentProps"in de&&t(11,$=de.labelComponentProps),"optionComponent"in de&&t(12,C=de.optionComponent),"optionComponentProps"in de&&t(13,O=de.optionComponentProps),"searchable"in de&&t(14,D=de.searchable),"searchFunc"in de&&t(29,I=de.searchFunc),"class"in de&&t(15,L=de.class),"$$scope"in de&&t(44,o=de.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&268435456&&c&&(pe(),ee()),n.$$.dirty[0]&268566528&&t(22,i=ue(c,F)),n.$$.dirty[0]&1&&t(21,l=function(de){const ve=j.toArray(g);return j.inArray(ve,de)})},[g,a,u,f,d,m,h,_,y,S,T,$,C,O,D,L,q,F,R,N,P,l,i,ee,Oe,He,Je,r,c,I,U,Y,J,B,W,s,bt,kt,yt,Ot,Ee,Le,ze,_t,o]}class e0 extends ge{constructor(e){super(),_e(this,e,eC,QT,me,{id:27,noOptionsText:1,selectPlaceholder:2,searchPlaceholder:3,items:28,multiple:4,disabled:5,readonly:6,upside:7,selected:0,toggle:8,closable:9,labelComponent:10,labelComponentProps:11,optionComponent:12,optionComponentProps:13,searchable:14,searchFunc:29,class:15,deselectItem:16,selectItem:30,toggleItem:31,reset:32,showDropdown:33,hideDropdown:34},null,[-1,-1])}get deselectItem(){return this.$$.ctx[16]}get selectItem(){return this.$$.ctx[30]}get toggleItem(){return this.$$.ctx[31]}get reset(){return this.$$.ctx[32]}get showDropdown(){return this.$$.ctx[33]}get hideDropdown(){return this.$$.ctx[34]}}function Td(n){let e,t;return{c(){e=b("i"),p(e,"class",t="icon "+n[0].icon)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t="icon "+i[0].icon)&&p(e,"class",t)},d(i){i&&v(e)}}}function tC(n){let e,t,i=(n[0].label||n[0].name||n[0].title||n[0].id||n[0].value)+"",l,s=n[0].icon&&Td(n);return{c(){s&&s.c(),e=M(),t=b("span"),l=Z(i),p(t,"class","txt")},m(o,r){s&&s.m(o,r),w(o,e,r),w(o,t,r),k(t,l)},p(o,[r]){o[0].icon?s?s.p(o,r):(s=Td(o),s.c(),s.m(e.parentNode,e)):s&&(s.d(1),s=null),r&1&&i!==(i=(o[0].label||o[0].name||o[0].title||o[0].id||o[0].value)+"")&&se(l,i)},i:Q,o:Q,d(o){o&&(v(e),v(t)),s&&s.d(o)}}}function nC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Cd extends ge{constructor(e){super(),_e(this,e,nC,tC,me,{item:0})}}const iC=n=>({}),Od=n=>({});function lC(n){let e;const t=n[8].afterOptions,i=St(t,n,n[12],Od);return{c(){i&&i.c()},m(l,s){i&&i.m(l,s),e=!0},p(l,s){i&&i.p&&(!e||s&4096)&&Tt(i,t,l,l[12],e?$t(t,l[12],s,iC):Ct(l[12]),Od)},i(l){e||(E(i,l),e=!0)},o(l){A(i,l),e=!1},d(l){i&&i.d(l)}}}function sC(n){let e,t,i;const l=[{items:n[1]},{multiple:n[2]},{labelComponent:n[3]},{optionComponent:n[4]},n[5]];function s(r){n[9](r)}let o={$$slots:{afterOptions:[lC]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.selected=n[0]),e=new e0({props:o}),te.push(()=>be(e,"selected",s)),e.$on("show",n[10]),e.$on("hide",n[11]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&62?dt(l,[a&2&&{items:r[1]},a&4&&{multiple:r[2]},a&8&&{labelComponent:r[3]},a&16&&{optionComponent:r[4]},a&32&&Dt(r[5])]):{};a&4096&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.selected=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function oC(n,e,t){const i=["items","multiple","selected","labelComponent","optionComponent","selectionKey","keyOfSelected"];let l=Xe(e,i),{$$slots:s={},$$scope:o}=e,{items:r=[]}=e,{multiple:a=!1}=e,{selected:u=a?[]:void 0}=e,{labelComponent:f=Cd}=e,{optionComponent:c=Cd}=e,{selectionKey:d="value"}=e,{keyOfSelected:m=a?[]:void 0}=e;function h(T){T=j.toArray(T,!0);let $=[];for(let C of T){const O=j.findByKey(r,d,C);O&&$.push(O)}T.length&&!$.length||t(0,u=a?$:$[0])}async function _(T){let $=j.toArray(T,!0).map(C=>C[d]);r.length&&t(6,m=a?$:$[0])}function g(T){u=T,t(0,u)}function y(T){Ce.call(this,n,T)}function S(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ae(Ae({},e),Yt(T)),t(5,l=Xe(e,i)),"items"in T&&t(1,r=T.items),"multiple"in T&&t(2,a=T.multiple),"selected"in T&&t(0,u=T.selected),"labelComponent"in T&&t(3,f=T.labelComponent),"optionComponent"in T&&t(4,c=T.optionComponent),"selectionKey"in T&&t(7,d=T.selectionKey),"keyOfSelected"in T&&t(6,m=T.keyOfSelected),"$$scope"in T&&t(12,o=T.$$scope)},n.$$.update=()=>{n.$$.dirty&66&&r&&h(m),n.$$.dirty&1&&_(u)},[u,r,a,f,c,l,m,d,s,g,y,S,o]}class _i extends ge{constructor(e){super(),_e(this,e,oC,sC,me,{items:1,multiple:2,selected:0,labelComponent:3,optionComponent:4,selectionKey:7,keyOfSelected:6})}}function rC(n){let e,t,i,l,s,o;function r(u){n[7](u)}let a={id:n[14],placeholder:"Choices: eg. optionA, optionB",required:!0,readonly:!n[15]};return n[0].options.values!==void 0&&(a.value=n[0].options.values),t=new Rl({props:a}),te.push(()=>be(t,"value",r)),{c(){e=b("div"),V(t.$$.fragment)},m(u,f){w(u,e,f),H(t,e,null),l=!0,s||(o=$e(Pe.call(null,e,{text:"Choices (comma separated)",position:"top-left",delay:700})),s=!0)},p(u,f){const c={};f&16384&&(c.id=u[14]),f&32768&&(c.readonly=!u[15]),!i&&f&1&&(i=!0,c.value=u[0].options.values,ke(()=>i=!1)),t.$set(c)},i(u){l||(E(t.$$.fragment,u),l=!0)},o(u){A(t.$$.fragment,u),l=!1},d(u){u&&v(e),z(t),s=!1,o()}}}function aC(n){let e,t,i;function l(o){n[8](o)}let s={id:n[14],items:n[3],readonly:!n[15]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16384&&(a.id=o[14]),r&32768&&(a.readonly=!o[15]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function uC(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field required "+(n[15]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.values",$$slots:{default:[rC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[15]?"":"readonly"),inlineError:!0,$$slots:{default:[aC,({uniqueId:c})=>({14:c}),({uniqueId:c})=>c?16384:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),V(i.$$.fragment),l=M(),s=b("div"),o=M(),V(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&32768&&(m.class="form-field required "+(c[15]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.values"),d&114689&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&32768&&(h.class="form-field form-field-single-multiple-select "+(c[15]?"":"readonly")),d&114692&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(E(i.$$.fragment,c),E(r.$$.fragment,c),f=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),z(i,c),z(r,c)}}}function Md(n){let e,t;return e=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[fC,({uniqueId:i})=>({14:i}),({uniqueId:i})=>i?16384:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.maxSelect"),l&81921&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function fC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Max select"),l=M(),s=b("input"),p(e,"for",i=n[14]),p(s,"id",o=n[14]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.maxSelect),r||(a=K(s,"input",n[6]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(s,"id",o),f&1&&it(s.value)!==u[0].options.maxSelect&&oe(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function cC(n){let e,t,i=!n[2]&&Md(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[2]?i&&(ie(),A(i,1,1,()=>{i=null}),le()):i?(i.p(l,s),s&4&&E(i,1)):(i=Md(l),i.c(),E(i,1),i.m(e.parentNode,e))},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function dC(n){let e,t,i;const l=[{key:n[1]},n[4]];function s(r){n[9](r)}let o={$$slots:{options:[cC],default:[uC,({interactive:r})=>({15:r}),({interactive:r})=>r?32768:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[10]),e.$on("remove",n[11]),e.$on("duplicate",n[12]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&18?dt(l,[a&2&&{key:r[1]},a&16&&Dt(r[4])]):{};a&98311&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function pC(n,e,t){var S;const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=((S=s.options)==null?void 0:S.maxSelect)<=1,u=a;function f(){t(0,s.options={maxSelect:1,values:[]},s),t(2,a=!0),t(5,u=a)}function c(){s.options.maxSelect=it(this.value),t(0,s),t(5,u),t(2,a)}function d(T){n.$$.not_equal(s.options.values,T)&&(s.options.values=T,t(0,s),t(5,u),t(2,a))}function m(T){a=T,t(2,a)}function h(T){s=T,t(0,s),t(5,u),t(2,a)}function _(T){Ce.call(this,n,T)}function g(T){Ce.call(this,n,T)}function y(T){Ce.call(this,n,T)}return n.$$set=T=>{e=Ae(Ae({},e),Yt(T)),t(4,l=Xe(e,i)),"field"in T&&t(0,s=T.field),"key"in T&&t(1,o=T.key)},n.$$.update=()=>{var T,$;n.$$.dirty&37&&u!=a&&(t(5,u=a),a?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=(($=(T=s.options)==null?void 0:T.values)==null?void 0:$.length)||2,s)),n.$$.dirty&1&&j.isEmpty(s.options)&&f()},[s,o,a,r,l,u,c,d,m,h,_,g,y]}class mC extends ge{constructor(e){super(),_e(this,e,pC,dC,me,{field:0,key:1})}}function hC(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Z("Max size "),i=b("small"),i.textContent="(bytes)",s=M(),o=b("input"),p(e,"for",l=n[11]),p(o,"type","number"),p(o,"id",r=n[11]),p(o,"step","1"),p(o,"min","0")},m(f,c){w(f,e,c),k(e,t),k(e,i),w(f,s,c),w(f,o,c),oe(o,n[0].options.maxSize),a||(u=K(o,"input",n[4]),a=!0)},p(f,c){c&2048&&l!==(l=f[11])&&p(e,"for",l),c&2048&&r!==(r=f[11])&&p(o,"id",r),c&1&&it(o.value)!==f[0].options.maxSize&&oe(o,f[0].options.maxSize)},d(f){f&&(v(e),v(s),v(o)),a=!1,u()}}}function _C(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function gC(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line txt-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Dd(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D='"{"a":1,"b":2}"',I,L,R,F,N,P,q,U,Y,J,B,W,pe;return{c(){e=b("div"),t=b("div"),i=b("div"),l=Z("In order to support seamlessly both "),s=b("code"),s.textContent="application/json",o=Z(` and
|
||
`),r=b("code"),r.textContent="multipart/form-data",a=Z(`
|
||
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=Z(` field
|
||
is a
|
||
`),c=b("strong"),c.textContent="plain string",d=Z(`:
|
||
`),m=b("ul"),h=b("li"),h.innerHTML=""true" is converted to the json <code>true</code>",_=M(),g=b("li"),g.innerHTML=""false" is converted to the json <code>false</code>",y=M(),S=b("li"),S.innerHTML=""null" is converted to the json <code>null</code>",T=M(),$=b("li"),$.innerHTML=""[1,2,3]" is converted to the json <code>[1,2,3]</code>",C=M(),O=b("li"),I=Z(D),L=Z(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',F=M(),N=b("li"),N.textContent="numeric strings are converted to json number",P=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",U=M(),Y=b("li"),Y.textContent="any other string (empty string too) is double quoted",J=Z(`
|
||
Alternatively, if you want to avoid the string value normalizations, you can wrap your
|
||
data inside an object, eg.`),B=b("code"),B.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,ue){w(ee,e,ue),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(i,r),k(i,a),k(i,u),k(i,f),k(i,c),k(i,d),k(i,m),k(m,h),k(m,_),k(m,g),k(m,y),k(m,S),k(m,T),k(m,$),k(m,C),k(m,O),k(O,I),k(O,L),k(O,R),k(m,F),k(m,N),k(m,P),k(m,q),k(m,U),k(m,Y),k(i,J),k(i,B),pe=!0},i(ee){pe||(ee&&Ke(()=>{pe&&(W||(W=Fe(e,et,{duration:150},!0)),W.run(1))}),pe=!0)},o(ee){ee&&(W||(W=Fe(e,et,{duration:150},!1)),W.run(0)),pe=!1},d(ee){ee&&v(e),ee&&W&&W.end()}}}function bC(n){let e,t,i,l,s,o,r,a,u,f,c;e=new ce({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[hC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,y){return g[2]?gC:_C}let m=d(n),h=m(n),_=n[2]&&Dd();return{c(){V(e.$$.fragment),t=M(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=M(),h.c(),r=M(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,y){H(e,g,y),w(g,t,y),w(g,i,y),k(i,l),k(i,s),h.m(i,null),w(g,r,y),_&&_.m(g,y),w(g,a,y),u=!0,f||(c=K(i,"click",n[5]),f=!0)},p(g,y){const S={};y&2&&(S.name="schema."+g[1]+".options.maxSize"),y&6145&&(S.$$scope={dirty:y,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!u||y&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?y&4&&E(_,1):(_=Dd(),_.c(),E(_,1),_.m(a.parentNode,a)):_&&(ie(),A(_,1,1,()=>{_=null}),le())},i(g){u||(E(e.$$.fragment,g),E(_),u=!0)},o(g){A(e.$$.fragment,g),A(_),u=!1},d(g){g&&(v(t),v(i),v(r),v(a)),z(e,g),h.d(),_&&_.d(g),f=!1,c()}}}function kC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[bC]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&10?dt(l,[a&2&&{key:r[1]},a&8&&Dt(r[3])]):{};a&4103&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function yC(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function u(){s.options.maxSize=it(this.value),t(0,s)}const f=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Ce.call(this,n,_)}function m(_){Ce.call(this,n,_)}function h(_){Ce.call(this,n,_)}return n.$$set=_=>{e=Ae(Ae({},e),Yt(_)),t(3,l=Xe(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,u,f,c,d,m,h]}class vC extends ge{constructor(e){super(),_e(this,e,yC,kC,me,{field:0,key:1})}}function wC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=Z(t),l=M(),s=b("small"),r=Z(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){w(a,e,u),k(e,i),w(a,l,u),w(a,s,u),k(s,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function SC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Ed extends ge{constructor(e){super(),_e(this,e,SC,wC,me,{item:0})}}const $C=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:"",mimeType:"application/x-ole-storage"},{ext:".msi",mimeType:"application/x-ms-installer"},{ext:".aaf",mimeType:"application/octet-stream"},{ext:".msg",mimeType:"application/vnd.ms-outlook"},{ext:".xls",mimeType:"application/vnd.ms-excel"},{ext:".pub",mimeType:"application/vnd.ms-publisher"},{ext:".ppt",mimeType:"application/vnd.ms-powerpoint"},{ext:".doc",mimeType:"application/msword"},{ext:".ps",mimeType:"application/postscript"},{ext:".psd",mimeType:"image/vnd.adobe.photoshop"},{ext:".p7s",mimeType:"application/pkcs7-signature"},{ext:".ogg",mimeType:"application/ogg"},{ext:".oga",mimeType:"audio/ogg"},{ext:".ogv",mimeType:"video/ogg"},{ext:".png",mimeType:"image/png"},{ext:".png",mimeType:"image/vnd.mozilla.apng"},{ext:".jpg",mimeType:"image/jpeg"},{ext:".jxl",mimeType:"image/jxl"},{ext:".jp2",mimeType:"image/jp2"},{ext:".jpf",mimeType:"image/jpx"},{ext:".jpm",mimeType:"image/jpm"},{ext:".jxs",mimeType:"image/jxs"},{ext:".gif",mimeType:"image/gif"},{ext:".webp",mimeType:"image/webp"},{ext:".exe",mimeType:"application/vnd.microsoft.portable-executable"},{ext:"",mimeType:"application/x-elf"},{ext:"",mimeType:"application/x-object"},{ext:"",mimeType:"application/x-executable"},{ext:".so",mimeType:"application/x-sharedlib"},{ext:"",mimeType:"application/x-coredump"},{ext:".a",mimeType:"application/x-archive"},{ext:".deb",mimeType:"application/vnd.debian.binary-package"},{ext:".tar",mimeType:"application/x-tar"},{ext:".xar",mimeType:"application/x-xar"},{ext:".bz2",mimeType:"application/x-bzip2"},{ext:".fits",mimeType:"application/fits"},{ext:".tiff",mimeType:"image/tiff"},{ext:".bmp",mimeType:"image/bmp"},{ext:".ico",mimeType:"image/x-icon"},{ext:".mp3",mimeType:"audio/mpeg"},{ext:".flac",mimeType:"audio/flac"},{ext:".midi",mimeType:"audio/midi"},{ext:".ape",mimeType:"audio/ape"},{ext:".mpc",mimeType:"audio/musepack"},{ext:".amr",mimeType:"audio/amr"},{ext:".wav",mimeType:"audio/wav"},{ext:".aiff",mimeType:"audio/aiff"},{ext:".au",mimeType:"audio/basic"},{ext:".mpeg",mimeType:"video/mpeg"},{ext:".mov",mimeType:"video/quicktime"},{ext:".mqv",mimeType:"video/quicktime"},{ext:".mp4",mimeType:"video/mp4"},{ext:".webm",mimeType:"video/webm"},{ext:".3gp",mimeType:"video/3gpp"},{ext:".3g2",mimeType:"video/3gpp2"},{ext:".avi",mimeType:"video/x-msvideo"},{ext:".flv",mimeType:"video/x-flv"},{ext:".mkv",mimeType:"video/x-matroska"},{ext:".asf",mimeType:"video/x-ms-asf"},{ext:".aac",mimeType:"audio/aac"},{ext:".voc",mimeType:"audio/x-unknown"},{ext:".mp4",mimeType:"audio/mp4"},{ext:".m4a",mimeType:"audio/x-m4a"},{ext:".m3u",mimeType:"application/vnd.apple.mpegurl"},{ext:".m4v",mimeType:"video/x-m4v"},{ext:".rmvb",mimeType:"application/vnd.rn-realmedia-vbr"},{ext:".gz",mimeType:"application/gzip"},{ext:".class",mimeType:"application/x-java-applet"},{ext:".swf",mimeType:"application/x-shockwave-flash"},{ext:".crx",mimeType:"application/x-chrome-extension"},{ext:".ttf",mimeType:"font/ttf"},{ext:".woff",mimeType:"font/woff"},{ext:".woff2",mimeType:"font/woff2"},{ext:".otf",mimeType:"font/otf"},{ext:".ttc",mimeType:"font/collection"},{ext:".eot",mimeType:"application/vnd.ms-fontobject"},{ext:".wasm",mimeType:"application/wasm"},{ext:".shx",mimeType:"application/vnd.shx"},{ext:".shp",mimeType:"application/vnd.shp"},{ext:".dbf",mimeType:"application/x-dbf"},{ext:".dcm",mimeType:"application/dicom"},{ext:".rar",mimeType:"application/x-rar-compressed"},{ext:".djvu",mimeType:"image/vnd.djvu"},{ext:".mobi",mimeType:"application/x-mobipocket-ebook"},{ext:".lit",mimeType:"application/x-ms-reader"},{ext:".bpg",mimeType:"image/bpg"},{ext:".sqlite",mimeType:"application/vnd.sqlite3"},{ext:".dwg",mimeType:"image/vnd.dwg"},{ext:".nes",mimeType:"application/vnd.nintendo.snes.rom"},{ext:".lnk",mimeType:"application/x-ms-shortcut"},{ext:".macho",mimeType:"application/x-mach-binary"},{ext:".qcp",mimeType:"audio/qcelp"},{ext:".icns",mimeType:"image/x-icns"},{ext:".heic",mimeType:"image/heic"},{ext:".heic",mimeType:"image/heic-sequence"},{ext:".heif",mimeType:"image/heif"},{ext:".heif",mimeType:"image/heif-sequence"},{ext:".hdr",mimeType:"image/vnd.radiance"},{ext:".mrc",mimeType:"application/marc"},{ext:".mdb",mimeType:"application/x-msaccess"},{ext:".accdb",mimeType:"application/x-msaccess"},{ext:".zst",mimeType:"application/zstd"},{ext:".cab",mimeType:"application/vnd.ms-cab-compressed"},{ext:".rpm",mimeType:"application/x-rpm"},{ext:".xz",mimeType:"application/x-xz"},{ext:".lz",mimeType:"application/lzip"},{ext:".torrent",mimeType:"application/x-bittorrent"},{ext:".cpio",mimeType:"application/x-cpio"},{ext:"",mimeType:"application/tzif"},{ext:".xcf",mimeType:"image/x-xcf"},{ext:".pat",mimeType:"image/x-gimp-pat"},{ext:".gbr",mimeType:"image/x-gimp-gbr"},{ext:".glb",mimeType:"model/gltf-binary"},{ext:".avif",mimeType:"image/avif"},{ext:".cab",mimeType:"application/x-installshield"},{ext:".jxr",mimeType:"image/jxr"},{ext:".txt",mimeType:"text/plain"},{ext:".html",mimeType:"text/html"},{ext:".svg",mimeType:"image/svg+xml"},{ext:".xml",mimeType:"text/xml"},{ext:".rss",mimeType:"application/rss+xml"},{ext:".atom",mimeType:"applicatiotom+xml"},{ext:".x3d",mimeType:"model/x3d+xml"},{ext:".kml",mimeType:"application/vnd.google-earth.kml+xml"},{ext:".xlf",mimeType:"application/x-xliff+xml"},{ext:".dae",mimeType:"model/vnd.collada+xml"},{ext:".gml",mimeType:"application/gml+xml"},{ext:".gpx",mimeType:"application/gpx+xml"},{ext:".tcx",mimeType:"application/vnd.garmin.tcx+xml"},{ext:".amf",mimeType:"application/x-amf"},{ext:".3mf",mimeType:"application/vnd.ms-package.3dmanufacturing-3dmodel+xml"},{ext:".xfdf",mimeType:"application/vnd.adobe.xfdf"},{ext:".owl",mimeType:"application/owl+xml"},{ext:".php",mimeType:"text/x-php"},{ext:".js",mimeType:"application/javascript"},{ext:".lua",mimeType:"text/x-lua"},{ext:".pl",mimeType:"text/x-perl"},{ext:".py",mimeType:"text/x-python"},{ext:".json",mimeType:"application/json"},{ext:".geojson",mimeType:"application/geo+json"},{ext:".har",mimeType:"application/json"},{ext:".ndjson",mimeType:"application/x-ndjson"},{ext:".rtf",mimeType:"text/rtf"},{ext:".srt",mimeType:"application/x-subrip"},{ext:".tcl",mimeType:"text/x-tcl"},{ext:".csv",mimeType:"text/csv"},{ext:".tsv",mimeType:"text/tab-separated-values"},{ext:".vcf",mimeType:"text/vcard"},{ext:".ics",mimeType:"text/calendar"},{ext:".warc",mimeType:"application/warc"},{ext:".vtt",mimeType:"text/vtt"},{ext:"",mimeType:"application/octet-stream"}];function TC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[23],items:n[4],readonly:!n[24]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&8388608&&(a.id=o[23]),r&16777216&&(a.readonly=!o[24]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function CC(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[24]?"":"readonly"),inlineError:!0,$$slots:{default:[TC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),V(i.$$.fragment),l=M(),s=b("div"),p(e,"class","separator"),p(s,"class","separator")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,l,a),w(r,s,a),o=!0},p(r,a){const u={};a&16777216&&(u.class="form-field form-field-single-multiple-select "+(r[24]?"":"readonly")),a&58720260&&(u.$$scope={dirty:a,ctx:r}),i.$set(u)},i(r){o||(E(i.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l),v(s)),z(i,r)}}}function OC(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<span class="txt">Images (jpg, png, svg, gif, webp)</span>',t=M(),i=b("button"),i.innerHTML='<span class="txt">Documents (pdf, doc/docx, xls/xlsx)</span>',l=M(),s=b("button"),s.innerHTML='<span class="txt">Videos (mp4, avi, mov, 3gp)</span>',o=M(),r=b("button"),r.innerHTML='<span class="txt">Archives (zip, 7zip, rar)</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem"),p(r,"type","button"),p(r,"class","dropdown-item closable"),p(r,"role","menuitem")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[9]),K(i,"click",n[10]),K(s,"click",n[11]),K(r,"click",n[12])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function MC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T;function $(O){n[8](O)}let C={id:n[23],multiple:!0,searchable:!0,closable:!1,selectionKey:"mimeType",selectPlaceholder:"No restriction",items:n[3],labelComponent:Ed,optionComponent:Ed};return n[0].options.mimeTypes!==void 0&&(C.keyOfSelected=n[0].options.mimeTypes),r=new _i({props:C}),te.push(()=>be(r,"keyOfSelected",$)),g=new On({props:{class:"dropdown dropdown-sm dropdown-nowrap dropdown-left",$$slots:{default:[OC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Allowed mime types",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),c=b("div"),d=b("span"),d.textContent="Choose presets",m=M(),h=b("i"),_=M(),V(g.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(d,"class","txt link-primary"),p(h,"class","ri-arrow-drop-down-fill"),p(h,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(O,D){w(O,e,D),k(e,t),k(e,i),k(e,l),w(O,o,D),H(r,O,D),w(O,u,D),w(O,f,D),k(f,c),k(c,d),k(c,m),k(c,h),k(c,_),H(g,c,null),y=!0,S||(T=$e(Pe.call(null,l,{text:`Allow files ONLY with the listed mime types.
|
||
Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,D){(!y||D&8388608&&s!==(s=O[23]))&&p(e,"for",s);const I={};D&8388608&&(I.id=O[23]),D&8&&(I.items=O[3]),!a&&D&1&&(a=!0,I.keyOfSelected=O[0].options.mimeTypes,ke(()=>a=!1)),r.$set(I);const L={};D&33554433&&(L.$$scope={dirty:D,ctx:O}),g.$set(L)},i(O){y||(E(r.$$.fragment,O),E(g.$$.fragment,O),y=!0)},o(O){A(r.$$.fragment,O),A(g.$$.fragment,O),y=!1},d(O){O&&(v(e),v(o),v(u),v(f)),z(r,O),z(g),S=!1,T()}}}function DC(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function EC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C;function O(I){n[13](I)}let D={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Rl({props:D}),te.push(()=>be(r,"value",O)),S=new On({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[DC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=M(),g=b("i"),y=M(),V(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(I,L){w(I,e,L),k(e,t),k(e,i),k(e,l),w(I,o,L),H(r,I,L),w(I,u,L),w(I,f,L),k(f,c),k(f,d),k(f,m),k(m,h),k(m,_),k(m,g),k(m,y),H(S,m,null),T=!0,$||(C=$e(Pe.call(null,l,{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(I,L){(!T||L&8388608&&s!==(s=I[23]))&&p(e,"for",s);const R={};L&8388608&&(R.id=I[23]),!a&&L&1&&(a=!0,R.value=I[0].options.thumbs,ke(()=>a=!1)),r.$set(R);const F={};L&33554432&&(F.$$scope={dirty:L,ctx:I}),S.$set(F)},i(I){T||(E(r.$$.fragment,I),E(S.$$.fragment,I),T=!0)},o(I){A(r.$$.fragment,I),A(S.$$.fragment,I),T=!1},d(I){I&&(v(e),v(o),v(u),v(f)),z(r,I),z(S),$=!1,C()}}}function IC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Z("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[14]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&1&&it(s.value)!==c[0].options.maxSize&&oe(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Id(n){let e,t,i;return t=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[AC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function AC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Max select"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.maxSelect),r||(a=K(s,"input",n[15]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&1&&it(s.value)!==u[0].options.maxSelect&&oe(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function LC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[MC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[EC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[IC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Id(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),a=M(),u=b("div"),V(f.$$.fragment),d=M(),h&&h.c(),p(t,"class","col-sm-12"),p(s,"class",r=n[2]?"col-sm-8":"col-sm-6"),p(u,"class",c=n[2]?"col-sm-4":"col-sm-3"),p(e,"class","grid grid-sm")},m(_,g){w(_,e,g),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,a),k(e,u),H(f,u,null),k(e,d),h&&h.m(e,null),m=!0},p(_,g){const y={};g&2&&(y.name="schema."+_[1]+".options.mimeTypes"),g&41943049&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.name="schema."+_[1]+".options.thumbs"),g&41943041&&(S.$$scope={dirty:g,ctx:_}),o.$set(S),(!m||g&4&&r!==(r=_[2]?"col-sm-8":"col-sm-6"))&&p(s,"class",r);const T={};g&2&&(T.name="schema."+_[1]+".options.maxSize"),g&41943041&&(T.$$scope={dirty:g,ctx:_}),f.$set(T),(!m||g&4&&c!==(c=_[2]?"col-sm-4":"col-sm-3"))&&p(u,"class",c),_[2]?h&&(ie(),A(h,1,1,()=>{h=null}),le()):h?(h.p(_,g),g&4&&E(h,1)):(h=Id(_),h.c(),E(h,1),h.m(e,null))},i(_){m||(E(i.$$.fragment,_),E(o.$$.fragment,_),E(f.$$.fragment,_),E(h),m=!0)},o(_){A(i.$$.fragment,_),A(o.$$.fragment,_),A(f.$$.fragment,_),A(h),m=!1},d(_){_&&v(e),z(i),z(o),z(f),h&&h.d()}}}function NC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Protected",r=M(),a=b("a"),a.textContent="(Learn more)",p(e,"type","checkbox"),p(e,"id",t=n[23]),p(s,"class","txt"),p(l,"for",o=n[23]),p(a,"href","https://pocketbase.io/docs/files-handling/#protected-files"),p(a,"class","toggle-info txt-sm txt-hint m-l-5"),p(a,"target","_blank"),p(a,"rel","noopener")},m(c,d){w(c,e,d),e.checked=n[0].options.protected,w(c,i,d),w(c,l,d),k(l,s),w(c,r,d),w(c,a,d),u||(f=K(e,"change",n[7]),u=!0)},p(c,d){d&8388608&&t!==(t=c[23])&&p(e,"id",t),d&1&&(e.checked=c[0].options.protected),d&8388608&&o!==(o=c[23])&&p(l,"for",o)},d(c){c&&(v(e),v(i),v(l),v(r),v(a)),u=!1,f()}}}function PC(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"schema."+n[1]+".options.protected",$$slots:{default:[NC,({uniqueId:i})=>({23:i}),({uniqueId:i})=>i?8388608:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&2&&(s.name="schema."+i[1]+".options.protected"),l&41943041&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function FC(n){let e,t,i;const l=[{key:n[1]},n[5]];function s(r){n[17](r)}let o={$$slots:{optionsFooter:[PC],options:[LC],default:[CC,({interactive:r})=>({24:r}),({interactive:r})=>r?16777216:0]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&34?dt(l,[a&2&&{key:r[1]},a&32&&Dt(r[5])]):{};a&50331663&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(E(e.$$.fragment,r),i=!0)},o(r){A(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function RC(n,e,t){var F;const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;const r=[{label:"Single",value:!0},{label:"Multiple",value:!1}];let a=$C.slice(),u=((F=s.options)==null?void 0:F.maxSelect)<=1,f=u;function c(){t(0,s.options={maxSelect:1,maxSize:5242880,thumbs:[],mimeTypes:[]},s),t(2,u=!0),t(6,f=u)}function d(){if(j.isEmpty(s.options.mimeTypes))return;const N=[];for(const P of s.options.mimeTypes)a.find(q=>q.mimeType===P)||N.push({mimeType:P});N.length&&t(3,a=a.concat(N))}function m(){s.options.protected=this.checked,t(0,s),t(6,f),t(2,u)}function h(N){n.$$.not_equal(s.options.mimeTypes,N)&&(s.options.mimeTypes=N,t(0,s),t(6,f),t(2,u))}const _=()=>{t(0,s.options.mimeTypes=["image/jpeg","image/png","image/svg+xml","image/gif","image/webp"],s)},g=()=>{t(0,s.options.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},y=()=>{t(0,s.options.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},S=()=>{t(0,s.options.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function T(N){n.$$.not_equal(s.options.thumbs,N)&&(s.options.thumbs=N,t(0,s),t(6,f),t(2,u))}function $(){s.options.maxSize=it(this.value),t(0,s),t(6,f),t(2,u)}function C(){s.options.maxSelect=it(this.value),t(0,s),t(6,f),t(2,u)}function O(N){u=N,t(2,u)}function D(N){s=N,t(0,s),t(6,f),t(2,u)}function I(N){Ce.call(this,n,N)}function L(N){Ce.call(this,n,N)}function R(N){Ce.call(this,n,N)}return n.$$set=N=>{e=Ae(Ae({},e),Yt(N)),t(5,l=Xe(e,i)),"field"in N&&t(0,s=N.field),"key"in N&&t(1,o=N.key)},n.$$.update=()=>{var N,P;n.$$.dirty&69&&f!=u&&(t(6,f=u),u?t(0,s.options.maxSelect=1,s):t(0,s.options.maxSelect=((P=(N=s.options)==null?void 0:N.values)==null?void 0:P.length)||99,s)),n.$$.dirty&1&&(j.isEmpty(s.options)?c():d())},[s,o,u,a,r,l,f,m,h,_,g,y,S,T,$,C,O,D,I,L,R]}class qC extends ge{constructor(e){super(),_e(this,e,RC,FC,me,{field:0,key:1})}}function jC(n){let e,t,i,l,s;return{c(){e=b("hr"),t=M(),i=b("button"),i.innerHTML='<i class="ri-add-line"></i> <span class="txt">New collection</span>',p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[14]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function HC(n){let e,t,i;function l(o){n[15](o)}let s={id:n[24],searchable:n[5].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[5],readonly:!n[25]||n[0].id,$$slots:{afterOptions:[jC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(s.keyOfSelected=n[0].options.collectionId),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&32&&(a.searchable=o[5].length>5),r&32&&(a.items=o[5]),r&33554433&&(a.readonly=!o[25]||o[0].id),r&67108872&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function zC(n){let e,t,i;function l(o){n[16](o)}let s={id:n[24],items:n[6],readonly:!n[25]};return n[2]!==void 0&&(s.keyOfSelected=n[2]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&16777216&&(a.id=o[24]),r&33554432&&(a.readonly=!o[25]),!t&&r&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function VC(n){let e,t,i,l,s,o,r,a,u,f;return i=new ce({props:{class:"form-field required "+(n[25]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[HC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field form-field-single-multiple-select "+(n[25]?"":"readonly"),inlineError:!0,$$slots:{default:[zC,({uniqueId:c})=>({24:c}),({uniqueId:c})=>c?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),V(i.$$.fragment),l=M(),s=b("div"),o=M(),V(r.$$.fragment),a=M(),u=b("div"),p(e,"class","separator"),p(s,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),H(i,c,d),w(c,l,d),w(c,s,d),w(c,o,d),H(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d&33554432&&(m.class="form-field required "+(c[25]?"":"readonly")),d&2&&(m.name="schema."+c[1]+".options.collectionId"),d&117440553&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const h={};d&33554432&&(h.class="form-field form-field-single-multiple-select "+(c[25]?"":"readonly")),d&117440516&&(h.$$scope={dirty:d,ctx:c}),r.$set(h)},i(c){f||(E(i.$$.fragment,c),E(r.$$.fragment,c),f=!0)},o(c){A(i.$$.fragment,c),A(r.$$.fragment,c),f=!1},d(c){c&&(v(e),v(t),v(l),v(s),v(o),v(a),v(u)),z(i,c),z(r,c)}}}function Ad(n){let e,t,i,l,s,o;return t=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[BC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[UC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),i=M(),l=b("div"),V(s.$$.fragment),p(e,"class","col-sm-6"),p(l,"class","col-sm-6")},m(r,a){w(r,e,a),H(t,e,null),w(r,i,a),w(r,l,a),H(s,l,null),o=!0},p(r,a){const u={};a&2&&(u.name="schema."+r[1]+".options.minSelect"),a&83886081&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a&2&&(f.name="schema."+r[1]+".options.maxSelect"),a&83886081&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(E(t.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(t.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(i),v(l)),z(t),z(s)}}}function BC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Min select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"min","1"),p(s,"placeholder","No min limit")},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.minSelect),r||(a=K(s,"input",n[11]),r=!0)},p(u,f){f&16777216&&i!==(i=u[24])&&p(e,"for",i),f&16777216&&o!==(o=u[24])&&p(s,"id",o),f&1&&it(s.value)!==u[0].options.minSelect&&oe(s,u[0].options.minSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function UC(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Z("Max select"),l=M(),s=b("input"),p(e,"for",i=n[24]),p(s,"type","number"),p(s,"id",o=n[24]),p(s,"step","1"),p(s,"placeholder","No max limit"),p(s,"min",r=n[0].options.minSelect||2)},m(f,c){w(f,e,c),k(e,t),w(f,l,c),w(f,s,c),oe(s,n[0].options.maxSelect),a||(u=K(s,"input",n[12]),a=!0)},p(f,c){c&16777216&&i!==(i=f[24])&&p(e,"for",i),c&16777216&&o!==(o=f[24])&&p(s,"id",o),c&1&&r!==(r=f[0].options.minSelect||2)&&p(s,"min",r),c&1&&it(s.value)!==f[0].options.maxSelect&&oe(s,f[0].options.maxSelect)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function WC(n){let e,t,i,l,s,o,r,a,u,f,c,d;function m(_){n[13](_)}let h={id:n[24],items:n[7]};return n[0].options.cascadeDelete!==void 0&&(h.keyOfSelected=n[0].options.cascadeDelete),a=new _i({props:h}),te.push(()=>be(a,"keyOfSelected",m)),{c(){e=b("label"),t=b("span"),t.textContent="Cascade delete",i=M(),l=b("i"),r=M(),V(a.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",o=n[24])},m(_,g){var y,S;w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,r,g),H(a,_,g),f=!0,c||(d=$e(s=Pe.call(null,l,{text:[`Whether on ${((y=n[4])==null?void 0:y.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,n[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((S=n[4])==null?void 0:S.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
|
||
|
||
`),position:"top"})),c=!0)},p(_,g){var S,T;s&&Mt(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=_[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
|
||
|
||
`),position:"top"}),(!f||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const y={};g&16777216&&(y.id=_[24]),!u&&g&1&&(u=!0,y.keyOfSelected=_[0].options.cascadeDelete,ke(()=>u=!1)),a.$set(y)},i(_){f||(E(a.$$.fragment,_),f=!0)},o(_){A(a.$$.fragment,_),f=!1},d(_){_&&(v(e),v(r)),z(a,_),c=!1,d()}}}function YC(n){let e,t,i,l,s,o=!n[2]&&Ad(n);return l=new ce({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[WC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),V(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),k(e,t),k(e,i),H(l,i,null),s=!0},p(r,a){r[2]?o&&(ie(),A(o,1,1,()=>{o=null}),le()):o?(o.p(r,a),a&4&&E(o,1)):(o=Ad(r),o.c(),E(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(u.$$scope={dirty:a,ctx:r}),l.$set(u)},i(r){s||(E(o),E(l.$$.fragment,r),s=!0)},o(r){A(o),A(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),z(l)}}}function KC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[YC],default:[VC,({interactive:f})=>({25:f}),({interactive:f})=>f?33554432:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=Ae(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new si({props:a}),te.push(()=>be(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let u={};return l=new Ga({props:u}),n[21](l),l.$on("save",n[22]),{c(){V(e.$$.fragment),i=M(),V(l.$$.fragment)},m(f,c){H(e,f,c),w(f,i,c),H(l,f,c),s=!0},p(f,[c]){const d=c&258?dt(o,[c&2&&{key:f[1]},c&256&&Dt(f[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ke(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(f){s||(E(e.$$.fragment,f),E(l.$$.fragment,f),s=!0)},o(f){A(e.$$.fragment,f),A(l.$$.fragment,f),s=!1},d(f){f&&v(i),z(e,f),n[21](null),z(l,f)}}}function JC(n,e,t){var N;let i,l;const s=["field","key"];let o=Xe(e,s),r;We(n,Rn,P=>t(10,r=P));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((N=a.options)==null?void 0:N.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function y(){a.options.maxSelect=it(this.value),t(0,a),t(9,h),t(2,m)}function S(P){n.$$.not_equal(a.options.cascadeDelete,P)&&(a.options.cascadeDelete=P,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(P){n.$$.not_equal(a.options.collectionId,P)&&(a.options.collectionId=P,t(0,a),t(9,h),t(2,m))}function C(P){m=P,t(2,m)}function O(P){a=P,t(0,a),t(9,h),t(2,m)}function D(P){Ce.call(this,n,P)}function I(P){Ce.call(this,n,P)}function L(P){Ce.call(this,n,P)}function R(P){te[P?"unshift":"push"](()=>{d=P,t(3,d)})}const F=P=>{var q,U;(U=(q=P==null?void 0:P.detail)==null?void 0:q.collection)!=null&&U.id&&P.detail.collection.type!="view"&&t(0,a.options.collectionId=P.detail.collection.id,a)};return n.$$set=P=>{e=Ae(Ae({},e),Yt(P)),t(8,o=Xe(e,s)),"field"in P&&t(0,a=P.field),"key"in P&&t(1,u=P.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(P=>P.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(P=>P.id==a.options.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,g,y,S,T,$,C,O,D,I,L,R,F]}class ZC extends ge{constructor(e){super(),_e(this,e,JC,KC,me,{field:0,key:1})}}const GC=n=>({dragging:n&4,dragover:n&8}),Ld=n=>({dragging:n[2],dragover:n[3]});function XC(n){let e,t,i,l,s;const o=n[10].default,r=St(o,n,n[9],Ld);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Ue(n[11])),K(e,"dragleave",Ue(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&Tt(r,o,a,a[9],i?$t(o,a[9],u,GC):Ct(a[9]),Ld),(!i||u&2&&t!==(t=!a[1]))&&p(e,"draggable",t),(!i||u&4)&&x(e,"dragging",a[2]),(!i||u&8)&&x(e,"dragover",a[3])},i(a){i||(E(r,a),i=!0)},o(a){A(r,a),i=!1},d(a){a&&v(e),r&&r.d(a),l=!1,we(s)}}}function QC(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let{index:o}=e,{list:r=[]}=e,{group:a="default"}=e,{disabled:u=!1}=e,{dragHandleClass:f=""}=e,c=!1,d=!1;function m($,C){if(!(!$||u)){if(f&&!$.target.classList.contains(f)){t(3,d=!1),t(2,c=!1),$.preventDefault();return}t(2,c=!0),$.dataTransfer.effectAllowed="move",$.dataTransfer.dropEffect="move",$.dataTransfer.setData("text/plain",JSON.stringify({index:C,group:a})),s("drag",$)}}function h($,C){if(t(3,d=!1),t(2,c=!1),!$||u)return;$.dataTransfer.dropEffect="move";let O={};try{O=JSON.parse($.dataTransfer.getData("text/plain"))}catch{}if(O.group!=a)return;const D=O.index<<0;D<C?(r.splice(C+1,0,r[D]),r.splice(D,1)):(r.splice(C,0,r[D]),r.splice(D+1,1)),t(6,r),s("sort",{oldIndex:D,newIndex:C,list:r})}const _=()=>{t(3,d=!0)},g=()=>{t(3,d=!1)},y=()=>{t(3,d=!1),t(2,c=!1)},S=$=>m($,o),T=$=>h($,o);return n.$$set=$=>{"index"in $&&t(0,o=$.index),"list"in $&&t(6,r=$.list),"group"in $&&t(7,a=$.group),"disabled"in $&&t(1,u=$.disabled),"dragHandleClass"in $&&t(8,f=$.dragHandleClass),"$$scope"in $&&t(9,l=$.$$scope)},[o,u,c,d,m,h,r,a,f,l,i,_,g,y,S,T]}class Is extends ge{constructor(e){super(),_e(this,e,QC,XC,me,{index:0,list:6,group:7,disabled:1,dragHandleClass:8})}}function Nd(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function Pd(n){let e,t,i,l,s,o,r,a;return{c(){e=Z(`,
|
||
`),t=b("code"),t.textContent="username",i=Z(` ,
|
||
`),l=b("code"),l.textContent="email",s=Z(` ,
|
||
`),o=b("code"),o.textContent="emailVisibility",r=Z(` ,
|
||
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,l,f),w(u,s,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function xC(n){let e,t,i,l;function s(f){n[7](f,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function u(f,c){let d={key:f[5](f[19])};return f[19]!==void 0&&(d.field=f[19]),{props:d}}return a&&(e=It(a,u(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&V(e.$$.fragment),i=M()},m(f,c){e&&H(e,f,c),w(f,i,c),l=!0},p(f,c){if(n=f,c&1&&a!==(a=n[1][n[19].type])){if(e){ie();const d=e;A(d.$$.fragment,1,0,()=>{z(d,1)}),le()}a?(e=It(a,u(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ke(()=>t=!1)),e.$set(d)}},i(f){l||(e&&E(e.$$.fragment,f),l=!0)},o(f){e&&A(e.$$.fragment,f),l=!1},d(f){f&&v(i),e&&z(e,f)}}}function Fd(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[xC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Is({props:r}),te.push(()=>be(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[21]),u&1&&(f.disabled=e[19].toDelete||e[19].id&&e[19].system),u&4194305&&(f.$$scope={dirty:u,ctx:e}),!l&&u&1&&(l=!0,f.list=e[0].schema,ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function e5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=[],h=new Map,_,g,y,S,T,$,C,O,D=n[0].type==="auth"&&Pd(),I=fe(n[0].schema);const L=N=>N[19];for(let N=0;N<I.length;N+=1){let P=Nd(n,I,N),q=L(P);h.set(q,m[N]=Fd(q,P))}g=new R$({props:{class:"btn btn-block btn-outline"}}),g.$on("select",n[14]);function R(N){n[15](N)}let F={};return n[0]!==void 0&&(F.collection=n[0]),$=new L$({props:F}),te.push(()=>be($,"collection",R)),{c(){e=b("div"),t=b("p"),i=Z(`System fields:
|
||
`),l=b("code"),l.textContent="id",s=Z(` ,
|
||
`),o=b("code"),o.textContent="created",r=Z(` ,
|
||
`),a=b("code"),a.textContent="updated",u=M(),D&&D.c(),f=Z(`
|
||
.`),c=M(),d=b("div");for(let N=0;N<m.length;N+=1)m[N].c();_=M(),V(g.$$.fragment),y=M(),S=b("hr"),T=M(),V($.$$.fragment),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","schema-fields")},m(N,P){w(N,e,P),k(e,t),k(t,i),k(t,l),k(t,s),k(t,o),k(t,r),k(t,a),k(t,u),D&&D.m(t,null),k(t,f),w(N,c,P),w(N,d,P);for(let q=0;q<m.length;q+=1)m[q]&&m[q].m(d,null);w(N,_,P),H(g,N,P),w(N,y,P),w(N,S,P),w(N,T,P),H($,N,P),O=!0},p(N,[P]){N[0].type==="auth"?D||(D=Pd(),D.c(),D.m(t,f)):D&&(D.d(1),D=null),P&111&&(I=fe(N[0].schema),ie(),m=at(m,P,L,1,N,I,h,d,At,Fd,null,Nd),le());const q={};!C&&P&1&&(C=!0,q.collection=N[0],ke(()=>C=!1)),$.$set(q)},i(N){if(!O){for(let P=0;P<I.length;P+=1)E(m[P]);E(g.$$.fragment,N),E($.$$.fragment,N),O=!0}},o(N){for(let P=0;P<m.length;P+=1)A(m[P]);A(g.$$.fragment,N),A($.$$.fragment,N),O=!1},d(N){N&&(v(e),v(c),v(d),v(_),v(y),v(S),v(T)),D&&D.d();for(let P=0;P<m.length;P+=1)m[P].d();z(g,N),z($,N)}}}function t5(n,e,t){let i,{collection:l}=e;const s={text:nT,number:fT,bool:pT,email:Xb,url:ST,editor:MT,date:UT,select:mC,json:vC,file:qC,relation:ZC};function o(O){l.schema[O]&&(l.schema.splice(O,1),t(0,l))}function r(O){const D=l.schema[O];if(!D)return;D.onMountSelect=!1;const I=structuredClone(D);I.id="",I.name=u(I.name+"_copy"),I.onMountSelect=!0,l.schema.splice(O+1,0,I),t(0,l)}function a(O="text"){const D=j.initSchemaField({name:u(),type:O});D.onMountSelect=!0,l.schema.push(D),t(0,l)}function u(O="field"){var F;let D=O,I=2,L=((F=O.match(/\d+$/))==null?void 0:F[0])||"",R=L?O.substring(0,O.length-L.length):O;for(;f(D);)D=R+((L<<0)+I),I++;return D}function f(O){var D;return!!((D=l==null?void 0:l.schema)!=null&&D.find(I=>I.name===O))}function c(O){return i.findIndex(D=>D===O)}function d(O,D){var I,L;!((I=l==null?void 0:l.schema)!=null&&I.length)||O===D||!D||(L=l==null?void 0:l.schema)!=null&&L.find(R=>R.name==O&&!R.toDelete)||t(0,l.indexes=l.indexes.map(R=>j.replaceIndexColumn(R,O,D)),l)}function m(O,D,I,L){I[L]=O,t(0,l)}const h=O=>o(O),_=O=>r(O),g=O=>d(O.detail.oldName,O.detail.newName);function y(O){n.$$.not_equal(l.schema,O)&&(l.schema=O,t(0,l))}const S=O=>{if(!O.detail)return;const D=O.detail.target;D.style.opacity=0,setTimeout(()=>{var I;(I=D==null?void 0:D.style)==null||I.removeProperty("opacity")},0),O.detail.dataTransfer.setDragImage(D,0,0)},T=()=>{Zt({})},$=O=>a(O.detail);function C(O){l=O,t(0,l)}return n.$$set=O=>{"collection"in O&&t(0,l=O.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(O=>!O.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,y,S,T,$,C]}class n5 extends ge{constructor(e){super(),_e(this,e,t5,e5,me,{collection:0})}}const i5=n=>({isAdminOnly:n&512}),Rd=n=>({isAdminOnly:n[9]}),l5=n=>({isAdminOnly:n&512}),qd=n=>({isAdminOnly:n[9]}),s5=n=>({isAdminOnly:n&512}),jd=n=>({isAdminOnly:n[9]});function o5(n){let e,t;return e=new ce({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[a5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function r5(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Hd(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-lock-line"></i> <span class="txt">Set Admins only</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function zd(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<small class="txt svelte-1akuazq">Unlock and set custom rule</small> <div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function a5(n){let e,t,i,l,s,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,h,_,g,y,S;const T=n[12].beforeLabel,$=St(T,n,n[15],jd),C=n[12].afterLabel,O=St(C,n,n[15],qd);let D=!n[9]&&Hd(n);function I(q){n[14](q)}var L=n[7];function R(q,U){let Y={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(Y.value=q[0]),{props:Y}}L&&(m=It(L,R(n)),n[13](m),te.push(()=>be(m,"value",I)));let F=n[9]&&zd(n);const N=n[12].default,P=St(N,n,n[15],Rd);return{c(){e=b("div"),t=b("label"),$&&$.c(),i=M(),l=b("span"),s=Z(n[2]),o=M(),a=Z(r),u=M(),O&&O.c(),f=M(),D&&D.c(),d=M(),m&&V(m.$$.fragment),_=M(),F&&F.c(),g=M(),y=b("div"),P&&P.c(),p(l,"class","txt"),x(l,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,U){w(q,e,U),k(e,t),$&&$.m(t,null),k(t,i),k(t,l),k(l,s),k(l,o),k(l,a),k(t,u),O&&O.m(t,null),k(t,f),D&&D.m(t,null),k(e,d),m&&H(m,e,null),k(e,_),F&&F.m(e,null),w(q,g,U),w(q,y,U),P&&P.m(y,null),S=!0},p(q,U){if($&&$.p&&(!S||U&33280)&&Tt($,T,q,q[15],S?$t(T,q[15],U,s5):Ct(q[15]),jd),(!S||U&4)&&se(s,q[2]),(!S||U&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||U&512)&&x(l,"txt-hint",q[9]),O&&O.p&&(!S||U&33280)&&Tt(O,C,q,q[15],S?$t(C,q[15],U,l5):Ct(q[15]),qd),q[9]?D&&(D.d(1),D=null):D?D.p(q,U):(D=Hd(q),D.c(),D.m(t,null)),(!S||U&262144&&c!==(c=q[18]))&&p(t,"for",c),U&128&&L!==(L=q[7])){if(m){ie();const Y=m;A(Y.$$.fragment,1,0,()=>{z(Y,1)}),le()}L?(m=It(L,R(q)),q[13](m),te.push(()=>be(m,"value",I)),V(m.$$.fragment),E(m.$$.fragment,1),H(m,e,_)):m=null}else if(L){const Y={};U&262144&&(Y.id=q[18]),U&2&&(Y.baseCollection=q[1]),U&512&&(Y.disabled=q[9]),U&544&&(Y.placeholder=q[9]?"":q[5]),!h&&U&1&&(h=!0,Y.value=q[0],ke(()=>h=!1)),m.$set(Y)}q[9]?F?(F.p(q,U),U&512&&E(F,1)):(F=zd(q),F.c(),E(F,1),F.m(e,null)):F&&(ie(),A(F,1,1,()=>{F=null}),le()),P&&P.p&&(!S||U&33280)&&Tt(P,N,q,q[15],S?$t(N,q[15],U,i5):Ct(q[15]),Rd)},i(q){S||(E($,q),E(O,q),m&&E(m.$$.fragment,q),E(F),E(P,q),S=!0)},o(q){A($,q),A(O,q),m&&A(m.$$.fragment,q),A(F),A(P,q),S=!1},d(q){q&&(v(e),v(g),v(y)),$&&$.d(q),O&&O.d(q),D&&D.d(),n[13](null),m&&z(m),F&&F.d(),P&&P.d(q)}}}function u5(n){let e,t,i,l;const s=[r5,o5],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}let Vd;function f5(n,e,t){let i,{$$slots:l={},$$scope:s}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,h=Vd,_=!1;g();async function g(){h||_||(t(8,_=!0),t(7,h=(await tt(async()=>{const{default:C}=await import("./FilterAutocompleteInput-CZ6wrvfj.js");return{default:C}},__vite__mapDeps([0,1]),import.meta.url)).default),Vd=h,t(8,_=!1))}async function y(){t(0,r=m||""),await Qt(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function T(C){te[C?"unshift":"push"](()=>{d=C,t(6,d)})}function $(C){r=C,t(0,r)}return n.$$set=C=>{"collection"in C&&t(1,o=C.collection),"rule"in C&&t(0,r=C.rule),"label"in C&&t(2,a=C.label),"formKey"in C&&t(3,u=C.formKey),"required"in C&&t(4,f=C.required),"placeholder"in C&&t(5,c=C.placeholder),"$$scope"in C&&t(15,s=C.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,h,_,i,y,S,l,T,$,s]}class Ol extends ge{constructor(e){super(),_e(this,e,f5,u5,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Bd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ud(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L=fe(n[2]),R=[];for(let F=0;F<L.length;F+=1)R[F]=Wd(Bd(n,L,F));return{c(){e=b("div"),t=b("div"),i=b("div"),l=b("p"),l.textContent="The following record fields are available:",s=M(),o=b("div");for(let F=0;F<R.length;F+=1)R[F].c();r=M(),a=b("hr"),u=M(),f=b("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=M(),d=b("div"),d.innerHTML="<code>@request.headers.*</code> <code>@request.query.*</code> <code>@request.data.*</code> <code>@request.auth.*</code>",m=M(),h=b("hr"),_=M(),g=b("p"),g.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",y=M(),S=b("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=M(),$=b("hr"),C=M(),O=b("p"),O.innerHTML=`Example rule:
|
||
<br/> <code>@request.auth.id != "" && created > "2022-01-01 00:00:00"</code>`,p(l,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,N){w(F,e,N),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o);for(let P=0;P<R.length;P+=1)R[P]&&R[P].m(o,null);k(i,r),k(i,a),k(i,u),k(i,f),k(i,c),k(i,d),k(i,m),k(i,h),k(i,_),k(i,g),k(i,y),k(i,S),k(i,T),k(i,$),k(i,C),k(i,O),I=!0},p(F,N){if(N&4){L=fe(F[2]);let P;for(P=0;P<L.length;P+=1){const q=Bd(F,L,P);R[P]?R[P].p(q,N):(R[P]=Wd(q),R[P].c(),R[P].m(o,null))}for(;P<R.length;P+=1)R[P].d(1);R.length=L.length}},i(F){I||(F&&Ke(()=>{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(F){F&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(F){F&&v(e),ot(R,F),F&&D&&D.end()}}}function Wd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=Z(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&se(i,t)},d(l){l&&v(e)}}}function Yd(n){let e,t,i,l,s,o,r,a,u;function f(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[c5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ol({props:c}),te.push(()=>be(e,"rule",f));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Ol({props:m}),te.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Ol({props:_}),te.push(()=>be(r,"rule",h)),{c(){V(e.$$.fragment),i=M(),V(l.$$.fragment),o=M(),V(r.$$.fragment)},m(g,y){H(e,g,y),w(g,i,y),H(l,g,y),w(g,o,y),H(r,g,y),u=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};y&1&&(T.collection=g[0]),!s&&y&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};y&1&&($.collection=g[0]),!a&&y&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){u||(E(e.$$.fragment,g),E(l.$$.fragment,g),E(r.$$.fragment,g),u=!0)},o(g){A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),u=!1},d(g){g&&(v(i),v(o)),z(e,g),z(l,g),z(r,g)}}}function Kd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=$e(Pe.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(l){l&&v(e),t=!1,i()}}}function c5(n){let e,t=!n[10]&&Kd();return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Kd(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Jd(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[d5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Ol({props:s}),te.push(()=>be(e,"rule",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function d5(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
|
||
changing the password without requiring to enter the old one, directly updating the verified
|
||
state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function p5(n){var N,P;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,g,y,S,T,$,C=n[1]&&Ud(n);function O(q){n[4](q)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),f=new Ol({props:D}),te.push(()=>be(f,"rule",O));function I(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Ol({props:L}),te.push(()=>be(m,"rule",I));let R=((N=n[0])==null?void 0:N.type)!=="view"&&Yd(n),F=((P=n[0])==null?void 0:P.type)==="auth"&&Jd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
|
||
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
|
||
</a>.`,l=M(),s=b("button"),r=Z(o),a=M(),C&&C.c(),u=M(),V(f.$$.fragment),d=M(),V(m.$$.fragment),_=M(),R&&R.c(),g=M(),F&&F.c(),y=ye(),p(s,"type","button"),p(s,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,U){w(q,e,U),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),C&&C.m(e,null),w(q,u,U),H(f,q,U),w(q,d,U),H(m,q,U),w(q,_,U),R&&R.m(q,U),w(q,g,U),F&&F.m(q,U),w(q,y,U),S=!0,T||($=K(s,"click",n[3]),T=!0)},p(q,[U]){var B,W;(!S||U&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,U),U&2&&E(C,1)):(C=Ud(q),C.c(),E(C,1),C.m(e,null)):C&&(ie(),A(C,1,1,()=>{C=null}),le());const Y={};U&1&&(Y.collection=q[0]),!c&&U&1&&(c=!0,Y.rule=q[0].listRule,ke(()=>c=!1)),f.$set(Y);const J={};U&1&&(J.collection=q[0]),!h&&U&1&&(h=!0,J.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(J),((B=q[0])==null?void 0:B.type)!=="view"?R?(R.p(q,U),U&1&&E(R,1)):(R=Yd(q),R.c(),E(R,1),R.m(g.parentNode,g)):R&&(ie(),A(R,1,1,()=>{R=null}),le()),((W=q[0])==null?void 0:W.type)==="auth"?F?(F.p(q,U),U&1&&E(F,1)):(F=Jd(q),F.c(),E(F,1),F.m(y.parentNode,y)):F&&(ie(),A(F,1,1,()=>{F=null}),le())},i(q){S||(E(C),E(f.$$.fragment,q),E(m.$$.fragment,q),E(R),E(F),S=!0)},o(q){A(C),A(f.$$.fragment,q),A(m.$$.fragment,q),A(R),A(F),S=!1},d(q){q&&(v(e),v(u),v(d),v(_),v(g),v(y)),C&&C.d(),z(f,q),z(m,q),R&&R.d(q),F&&F.d(q),T=!1,$()}}}function m5(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function u(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function f(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,u,f,c,d]}class h5 extends ge{constructor(e){super(),_e(this,e,m5,p5,me,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[9]=e[t],i}function _5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=It(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){ie();const f=e;A(f.$$.fragment,1,0,()=>{z(f,1)}),le()}o?(e=It(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("change",a[6]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),e.$set(f)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function g5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Gd(n){let e,t,i=fe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Xd(Zd(n,i,s));return{c(){e=b("div"),t=b("div");for(let s=0;s<l.length;s+=1)l[s].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(s,o){w(s,e,o),k(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(t,null)},p(s,o){if(o&8){i=fe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Zd(s,i,r);l[r]?l[r].p(a,o):(l[r]=Xd(a),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&v(e),ot(l,s)}}}function Xd(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=Z(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&se(i,t)},d(l){l&&v(e)}}}function b5(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[g5,_5],m=[];function h(g,y){return g[2]?0:1}s=h(n),o=m[s]=d[s](n);let _=n[3].length&&Gd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=M(),o.c(),r=M(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported.</li> <li>The query must have a unique <code>id</code> column.
|
||
<br/>
|
||
If your query doesn't have a suitable one, you can use the universal
|
||
<code>(ROW_NUMBER() OVER()) as id</code>.</li> <li>Expressions must be aliased with a valid formatted field name (eg.
|
||
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=M(),_&&_.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),m[s].m(g,y),w(g,r,y),w(g,a,y),w(g,u,y),_&&_.m(g,y),w(g,f,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,y):(ie(),A(m[S],1,1,()=>{m[S]=null}),le(),o=m[s],o?o.p(g,y):(o=m[s]=d[s](g),o.c()),E(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,y):(_=Gd(g),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(g){c||(E(o),c=!0)},o(g){A(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(g),_&&_.d(g)}}}function k5(n){let e,t;return e=new ce({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[b5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function y5(n,e,t){let i;We(n,hi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const y=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+y))}}Kt(async()=>{t(2,o=!0);try{t(1,s=(await tt(async()=>{const{default:c}=await import("./CodeEditor-BZmYqzs5.js");return{default:c}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const f=()=>{r.length&&li("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class v5 extends ge{constructor(e){super(),_e(this,e,y5,k5,me,{collection:0})}}const w5=n=>({active:n&1}),Qd=n=>({active:n[0]});function xd(n){let e,t,i;const l=n[15].default,s=St(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Tt(s,l,o,o[14],i?$t(l,o[14],r,null):Ct(o[14]),null)},i(o){i||(E(s,o),o&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){A(s,o),o&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function S5(n){let e,t,i,l,s,o,r;const a=n[15].header,u=St(a,n,n[14],Qd);let f=n[0]&&xd(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=M(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),k(e,t),u&&u.m(t,null),k(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Ue(n[17])),K(t,"drop",Ue(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Ue(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&Tt(u,a,c,c[14],s?$t(a,c[14],d,w5):Ct(c[14]),Qd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&E(f,1)):(f=xd(c),f.c(),E(f,1),f.m(e,null)):f&&(ie(),A(f,1,1,()=>{f=null}),le()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(E(u,c),E(f),s=!0)},o(c){A(u,c),A(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,we(r)}}}function $5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=lt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!f}function _(){S(),t(0,f=!0),s("expand")}function g(){t(0,f=!1),clearTimeout(r),s("collapse")}function y(){s("toggle"),f?g():_()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of R)F.click()}}Kt(()=>()=>clearTimeout(r));function T(R){Ce.call(this,n,R)}const $=()=>c&&y(),C=R=>{u&&(t(7,m=!1),S(),s("drop",R))},O=R=>u&&s("dragstart",R),D=R=>{u&&(t(7,m=!0),s("dragenter",R))},I=R=>{u&&(t(7,m=!1),s("dragleave",R))};function L(R){te[R?"unshift":"push"](()=>{o=R,t(6,o)})}return n.$$set=R=>{"class"in R&&t(1,a=R.class),"draggable"in R&&t(2,u=R.draggable),"active"in R&&t(0,f=R.active),"interactive"in R&&t(3,c=R.interactive),"single"in R&&t(9,d=R.single),"$$scope"in R&&t(14,l=R.$$scope)},n.$$.update=()=>{n.$$.dirty&8257&&f&&(clearTimeout(r),t(13,r=setTimeout(()=>{o!=null&&o.scrollIntoViewIfNeeded?o.scrollIntoViewIfNeeded():o!=null&&o.scrollIntoView&&o.scrollIntoView({behavior:"smooth",block:"nearest"})},200)))},[f,a,u,c,y,S,o,m,s,d,h,_,g,r,l,i,T,$,C,O,D,I,L]}class mo extends ge{constructor(e){super(),_e(this,e,$5,S5,me,{class:1,draggable:2,active:0,interactive:3,single:9,isExpanded:10,expand:11,collapse:12,toggle:4,collapseSiblings:5})}get isExpanded(){return this.$$.ctx[10]}get expand(){return this.$$.ctx[11]}get collapse(){return this.$$.ctx[12]}get toggle(){return this.$$.ctx[4]}get collapseSiblings(){return this.$$.ctx[5]}}function T5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].options.allowUsernameAuth,w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[5]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowUsernameAuth),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function C5(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowUsernameAuth",$$slots:{default:[T5,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&24577&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function O5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function M5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function ep(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function D5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowUsernameAuth?M5:O5}let a=r(n),u=a(n),f=n[3]&&ep();return{c(){e=b("div"),e.innerHTML='<i class="ri-user-star-line"></i> <span class="txt">Username/Password</span>',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[3]?f?d&8&&E(f,1):(f=ep(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ie(),A(f,1,1,()=>{f=null}),le())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function E5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[6]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function tp(n){let e,t,i,l,s,o,r,a;return i=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[I5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(j.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[A5,({uniqueId:u})=>({13:u}),({uniqueId:u})=>u?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(j.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&24577&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(j.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&24577&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(E(i.$$.fragment,u),E(o.$$.fragment,u),u&&Ke(()=>{a&&(r||(r=Fe(e,et,{duration:150},!0)),r.run(1))}),a=!0)},o(u){A(i.$$.fragment,u),A(o.$$.fragment,u),u&&(r||(r=Fe(e,et,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&v(e),z(i),z(o),u&&r&&r.end()}}}function I5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[7](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new Rl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Except domains",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(f,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(Pe.call(null,l,{text:`Email domains that are NOT allowed to sign up.
|
||
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function A5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Rl({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(f,"class","help-block")},m(g,y){w(g,e,y),k(e,t),k(e,i),k(e,l),w(g,o,y),H(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up.
|
||
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};y&8192&&(S.id=g[13]),y&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(E(r.$$.fragment,g),c=!0)},o(g){A(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function L5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[E5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&tp(n);return{c(){V(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&E(s,1)):(s=tp(o),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),z(e,o),s&&s.d(o)}}}function N5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function P5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function np(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function F5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?P5:N5}let a=r(n),u=a(n),f=n[2]&&np();return{c(){e=b("div"),e.innerHTML='<i class="ri-mail-star-line"></i> <span class="txt">Email/Password</span>',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[2]?f?d&4&&E(f,1):(f=np(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ie(),A(f,1,1,()=>{f=null}),le())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function R5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function ip(n){let e,t,i;return{c(){e=b("div"),e.innerHTML='<div class="flex p-t-base"><a href="#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Fe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Fe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function q5(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[R5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&ip();return{c(){V(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&E(s,1):(s=ip(),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){l||(E(e.$$.fragment,o),E(s),l=!0)},o(o){A(e.$$.fragment,o),A(s),l=!1},d(o){o&&(v(t),v(i)),z(e,o),s&&s.d(o)}}}function j5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function H5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function lp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function z5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowOAuth2Auth?H5:j5}let a=r(n),u=a(n),f=n[1]&&lp();return{c(){e=b("div"),e.innerHTML='<i class="ri-shield-star-line"></i> <span class="txt">OAuth2</span>',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,l,d),u.m(c,d),w(c,s,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(s.parentNode,s))),c[1]?f?d&2&&E(f,1):(f=lp(),f.c(),E(f,1),f.m(o.parentNode,o)):f&&(ie(),A(f,1,1,()=>{f=null}),le())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function V5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Minimum password length"),l=M(),s=b("input"),p(e,"for",i=n[13]),p(s,"type","number"),p(s,"id",o=n[13]),s.required=!0,p(s,"min","6"),p(s,"max","72")},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].options.minPasswordLength),r||(a=K(s,"input",n[10]),r=!0)},p(u,f){f&8192&&i!==(i=u[13])&&p(e,"for",i),f&8192&&o!==(o=u[13])&&p(s,"id",o),f&1&&it(s.value)!==u[0].options.minPasswordLength&&oe(s,u[0].options.minPasswordLength)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function B5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Always require email",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[11]),$e(Pe.call(null,r,{text:`The constraint is applied only for new records.
|
||
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function U5(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[12]),$e(Pe.call(null,r,{text:["If enabled, it returns 403 for new unverified user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(`
|
||
`),position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function W5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T;return l=new mo({props:{single:!0,$$slots:{header:[D5],default:[C5]},$$scope:{ctx:n}}}),o=new mo({props:{single:!0,$$slots:{header:[F5],default:[L5]},$$scope:{ctx:n}}}),a=new mo({props:{single:!0,$$slots:{header:[z5],default:[q5]},$$scope:{ctx:n}}}),h=new ce({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[V5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[B5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[U5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),V(l.$$.fragment),s=M(),V(o.$$.fragment),r=M(),V(a.$$.fragment),u=M(),f=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),V(h.$$.fragment),_=M(),V(g.$$.fragment),y=M(),V(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),H(l,i,null),k(i,s),H(o,i,null),k(i,r),H(a,i,null),w($,u,C),w($,f,C),w($,c,C),w($,d,C),w($,m,C),H(h,$,C),w($,_,C),H(g,$,C),w($,y,C),H(S,$,C),T=!0},p($,[C]){const O={};C&16393&&(O.$$scope={dirty:C,ctx:$}),l.$set(O);const D={};C&16389&&(D.$$scope={dirty:C,ctx:$}),o.$set(D);const I={};C&16387&&(I.$$scope={dirty:C,ctx:$}),a.$set(I);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const R={};C&24577&&(R.$$scope={dirty:C,ctx:$}),g.$set(R);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),S.$set(F)},i($){T||(E(l.$$.fragment,$),E(o.$$.fragment,$),E(a.$$.fragment,$),E(h.$$.fragment,$),E(g.$$.fragment,$),E(S.$$.fragment,$),T=!0)},o($){A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(u),v(f),v(c),v(d),v(m),v(_),v(y)),z(l),z(o),z(a),z(h,$),z(g,$),z(S,$)}}}function Y5(n,e,t){let i,l,s,o;We(n,hi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=it(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,y,S,T;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,u,f,c,d,m,h,_]}class K5 extends ge{constructor(e){super(),_e(this,e,Y5,W5,me,{collection:0})}}function sp(n,e,t){const i=n.slice();return i[18]=e[t],i}function op(n,e,t){const i=n.slice();return i[18]=e[t],i}function rp(n,e,t){const i=n.slice();return i[18]=e[t],i}function ap(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function up(n){let e,t,i,l,s=n[3]&&fp(n),o=!n[4]&&cp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),s&&s.m(i,null),k(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=fp(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=cp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function fp(n){var m,h;let e,t,i,l,s=((m=n[1])==null?void 0:m.name)+"",o,r,a,u,f,c=((h=n[2])==null?void 0:h.name)+"",d;return{c(){e=b("li"),t=b("div"),i=Z(`Renamed collection
|
||
`),l=b("strong"),o=Z(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Z(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){w(_,e,g),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,u),k(t,f),k(f,d)},p(_,g){var y,S;g&2&&s!==(s=((y=_[1])==null?void 0:y.name)+"")&&se(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&se(d,c)},d(_){_&&v(e)}}}function cp(n){let e,t,i,l=fe(n[6]),s=[];for(let f=0;f<l.length;f+=1)s[f]=dp(rp(n,l,f));let o=fe(n[8]),r=[];for(let f=0;f<o.length;f+=1)r[f]=pp(op(n,o,f));let a=fe(n[7]),u=[];for(let f=0;f<a.length;f+=1)u[f]=mp(sp(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=M();for(let f=0;f<r.length;f+=1)r[f].c();t=M();for(let f=0;f<u.length;f+=1)u[f].c();i=ye()},m(f,c){for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(f,c);w(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);w(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);w(f,i,c)},p(f,c){if(c&64){l=fe(f[6]);let d;for(d=0;d<l.length;d+=1){const m=rp(f,l,d);s[d]?s[d].p(m,c):(s[d]=dp(m),s[d].c(),s[d].m(e.parentNode,e))}for(;d<s.length;d+=1)s[d].d(1);s.length=l.length}if(c&256){o=fe(f[8]);let d;for(d=0;d<o.length;d+=1){const m=op(f,o,d);r[d]?r[d].p(m,c):(r[d]=pp(m),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&128){a=fe(f[7]);let d;for(d=0;d<a.length;d+=1){const m=sp(f,a,d);u[d]?u[d].p(m,c):(u[d]=mp(m),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){f&&(v(e),v(t),v(i)),ot(s,f),ot(r,f),ot(u,f)}}}function dp(n){let e,t,i,l=n[18].name+"",s,o,r;return{c(){e=b("li"),t=Z(`Multiple to single value conversion of field
|
||
`),i=b("strong"),s=Z(l),o=M(),r=b("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){w(a,e,u),k(e,t),k(e,i),k(i,s),k(e,o),k(e,r)},p(a,u){u&64&&l!==(l=a[18].name+"")&&se(s,l)},d(a){a&&v(e)}}}function pp(n){let e,t,i,l,s=n[18].originalName+"",o,r,a,u,f,c=n[18].name+"",d;return{c(){e=b("li"),t=b("div"),i=Z(`Renamed field
|
||
`),l=b("strong"),o=Z(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Z(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,h){w(m,e,h),k(e,t),k(t,i),k(t,l),k(l,o),k(t,r),k(t,a),k(t,u),k(t,f),k(f,d)},p(m,h){h&256&&s!==(s=m[18].originalName+"")&&se(o,s),h&256&&c!==(c=m[18].name+"")&&se(d,c)},d(m){m&&v(e)}}}function mp(n){let e,t,i,l=n[18].name+"",s,o;return{c(){e=b("li"),t=Z("Removed field "),i=b("span"),s=Z(l),o=M(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(i,s),k(e,o)},p(r,a){a&128&&l!==(l=r[18].name+"")&&se(s,l)},d(r){r&&v(e)}}}function J5(n){let e,t,i,l,s,o,r,a,u=n[7].length&&ap(),f=n[9]&&up(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
|
||
you'll have to update it manually!`,o=M(),u&&u.c(),r=M(),f&&f.c(),a=ye(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),u&&u.m(l,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=ap(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=up(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(r),v(a)),u&&u.d(),f&&f.d(c)}}}function Z5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function G5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=M(),i=b("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function X5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[G5],header:[Z5],default:[J5]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[14](null),z(e,l)}}}function Q5(n,e,t){let i,l,s,o,r,a;const u=lt();let f,c,d;async function m(C,O){t(1,c=C),t(2,d=O),await Qt(),i||s.length||o.length||r.length?f==null||f.show():_()}function h(){f==null||f.hide()}function _(){h(),u("confirm")}const g=()=>h(),y=()=>_();function S(C){te[C?"unshift":"push"](()=>{f=C,t(5,f)})}function T(C){Ce.call(this,n,C)}function $(C){Ce.call(this,n,C)}return n.$$.update=()=>{var C,O,D;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(I=>I.id&&!I.toDelete&&I.originalName!=I.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(I=>I.id&&I.toDelete))||[]),n.$$.dirty&6&&t(6,r=((D=d==null?void 0:d.schema)==null?void 0:D.filter(I=>{var R,F,N;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(P=>P.id==I.id);return L?((F=L.options)==null?void 0:F.maxSelect)!=1&&((N=I.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,f,r,o,s,a,_,m,g,y,S,T,$]}class x5 extends ge{constructor(e){super(),_e(this,e,Q5,X5,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function hp(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function e6(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new n5({props:s}),te.push(()=>be(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function t6(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new v5({props:s}),te.push(()=>be(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function _p(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new h5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),z(t)}}}function gp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new K5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===Al)},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u),(!l||a[0]&8)&&x(e,"active",r[3]===Al)},i(r){l||(E(t.$$.fragment,r),l=!0)},o(r){A(t.$$.fragment,r),l=!1},d(r){r&&v(e),z(t)}}}function n6(n){let e,t,i,l,s,o,r;const a=[t6,e6],u=[];function f(m,h){return m[14]?0:1}i=f(n),l=u[i]=a[i](n);let c=n[3]===ks&&_p(n),d=n[15]&&gp(n);return{c(){e=b("div"),t=b("div"),l.c(),s=M(),c&&c.c(),o=M(),d&&d.c(),p(t,"class","tab-item"),x(t,"active",n[3]===Oi),p(e,"class","tabs-content svelte-12y0yzb")},m(m,h){w(m,e,h),k(e,t),u[i].m(t,null),k(e,s),c&&c.m(e,null),k(e,o),d&&d.m(e,null),r=!0},p(m,h){let _=i;i=f(m),i===_?u[i].p(m,h):(ie(),A(u[_],1,1,()=>{u[_]=null}),le(),l=u[i],l?l.p(m,h):(l=u[i]=a[i](m),l.c()),E(l,1),l.m(t,null)),(!r||h[0]&8)&&x(t,"active",m[3]===Oi),m[3]===ks?c?(c.p(m,h),h[0]&8&&E(c,1)):(c=_p(m),c.c(),E(c,1),c.m(e,o)):c&&(ie(),A(c,1,1,()=>{c=null}),le()),m[15]?d?(d.p(m,h),h[0]&32768&&E(d,1)):(d=gp(m),d.c(),E(d,1),d.m(e,null)):d&&(ie(),A(d,1,1,()=>{d=null}),le())},i(m){r||(E(l),E(c),E(d),r=!0)},o(m){A(l),A(c),A(d),r=!1},d(m){m&&v(e),u[i].d(),c&&c.d(),d&&d.d()}}}function bp(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right m-t-5",$$slots:{default:[i6]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),V(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More collection options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,u){const f={};u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),z(o)}}}function i6(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<i class="ri-file-copy-line" aria-hidden="true"></i> <span class="txt">Duplicate</span>',t=M(),i=b("button"),i.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',p(e,"type","button"),p(e,"class","dropdown-item"),p(e,"role","menuitem"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger"),p(i,"role","menuitem")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[27]),K(i,"click",Tn(Ue(n[28])))],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function kp(n){let e,t,i,l;return i=new On({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[l6]},$$scope:{ctx:n}}}),{c(){e=b("i"),t=M(),V(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill"),p(e,"aria-hidden","true")},m(s,o){w(s,e,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&68|o[1]&8388608&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&(v(e),v(t)),z(i,s)}}}function yp(n){let e,t,i,l,s,o=n[51]+"",r,a,u,f,c;function d(){return n[30](n[50])}return{c(){e=b("button"),t=b("i"),l=M(),s=b("span"),r=Z(o),a=Z(" collection"),u=M(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb"),p(t,"aria-hidden","true"),p(s,"class","txt"),p(e,"type","button"),p(e,"role","menuitem"),p(e,"class","dropdown-item closable"),x(e,"selected",n[50]==n[2].type)},m(m,h){w(m,e,h),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),k(e,u),f||(c=K(e,"click",d),f=!0)},p(m,h){n=m,h[0]&64&&i!==(i=Un(j.getCollectionTypeIcon(n[50]))+" svelte-12y0yzb")&&p(t,"class",i),h[0]&64&&o!==(o=n[51]+"")&&se(r,o),h[0]&68&&x(e,"selected",n[50]==n[2].type)},d(m){m&&v(e),f=!1,c()}}}function l6(n){let e,t=fe(Object.entries(n[6])),i=[];for(let l=0;l<t.length;l+=1)i[l]=yp(hp(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s[0]&524356){t=fe(Object.entries(l[6]));let o;for(o=0;o<t.length;o+=1){const r=hp(l,t,o);i[o]?i[o].p(r,s):(i[o]=yp(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(l){l&&v(e),ot(i,l)}}}function vp(n){let e;return{c(){e=b("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function s6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y=(n[6][n[2].type]||"N/A")+"",S,T,$,C,O,D,I,L,R,F,N=!n[2].id&&kp(n),P=n[2].system&&vp();return{c(){e=b("label"),t=Z("Name"),l=M(),s=b("input"),f=M(),c=b("div"),d=b("div"),m=b("span"),h=M(),_=b("span"),g=Z("Type: "),S=Z(y),T=M(),N&&N.c(),D=M(),P&&P.c(),I=ye(),p(e,"for",i=n[49]),p(s,"type","text"),p(s,"id",o=n[49]),s.required=!0,s.disabled=n[13],p(s,"spellcheck","false"),s.autofocus=r=!n[2].id,p(s,"placeholder",a=n[15]?'eg. "users"':'eg. "posts"'),s.value=u=n[2].name,p(m,"aria-hidden","true"),p(_,"class","txt"),p(d,"tabindex",$=n[2].id?-1:0),p(d,"role",C=n[2].id?"":"button"),p(d,"aria-label","View types"),p(d,"class",O="btn btn-sm p-r-10 p-l-10 "+(n[2].id?"btn-transparent":"btn-outline")),x(d,"btn-disabled",!!n[2].id),p(c,"class","form-field-addon")},m(q,U){w(q,e,U),k(e,t),w(q,l,U),w(q,s,U),w(q,f,U),w(q,c,U),k(c,d),k(d,m),k(d,h),k(d,_),k(_,g),k(_,S),k(d,T),N&&N.m(d,null),w(q,D,U),P&&P.m(q,U),w(q,I,U),L=!0,n[2].id||s.focus(),R||(F=K(s,"input",n[29]),R=!0)},p(q,U){(!L||U[1]&262144&&i!==(i=q[49]))&&p(e,"for",i),(!L||U[1]&262144&&o!==(o=q[49]))&&p(s,"id",o),(!L||U[0]&8192)&&(s.disabled=q[13]),(!L||U[0]&4&&r!==(r=!q[2].id))&&(s.autofocus=r),(!L||U[0]&32768&&a!==(a=q[15]?'eg. "users"':'eg. "posts"'))&&p(s,"placeholder",a),(!L||U[0]&4&&u!==(u=q[2].name)&&s.value!==u)&&(s.value=u),(!L||U[0]&68)&&y!==(y=(q[6][q[2].type]||"N/A")+"")&&se(S,y),q[2].id?N&&(ie(),A(N,1,1,()=>{N=null}),le()):N?(N.p(q,U),U[0]&4&&E(N,1)):(N=kp(q),N.c(),E(N,1),N.m(d,null)),(!L||U[0]&4&&$!==($=q[2].id?-1:0))&&p(d,"tabindex",$),(!L||U[0]&4&&C!==(C=q[2].id?"":"button"))&&p(d,"role",C),(!L||U[0]&4&&O!==(O="btn btn-sm p-r-10 p-l-10 "+(q[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",O),(!L||U[0]&4)&&x(d,"btn-disabled",!!q[2].id),q[2].system?P||(P=vp(),P.c(),P.m(I.parentNode,I)):P&&(P.d(1),P=null)},i(q){L||(E(N),L=!0)},o(q){A(N),L=!1},d(q){q&&(v(e),v(l),v(s),v(f),v(c),v(D),v(I)),N&&N.d(),P&&P.d(q),R=!1,F()}}}function wp(n){let e,t,i,l,s,o;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),l=!0,s||(o=$e(t=Pe.call(null,e,n[11])),s=!0)},p(r,a){t&&Mt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){l||(r&&Ke(()=>{l&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!0)),i.run(1))}),l=!0)},o(r){r&&(i||(i=Fe(e,Wt,{duration:150,start:.7},!1)),i.run(0)),l=!1},d(r){r&&v(e),r&&i&&i.end(),s=!1,o()}}}function Sp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function $p(n){var a,u,f;let e,t,i,l=!j.isEmpty((a=n[5])==null?void 0:a.options)&&!((f=(u=n[5])==null?void 0:u.options)!=null&&f.manageRule),s,o,r=l&&Tp();return{c(){e=b("button"),t=b("span"),t.textContent="Options",i=M(),r&&r.c(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","tab-item"),x(e,"active",n[3]===Al)},m(c,d){w(c,e,d),k(e,t),k(e,i),r&&r.m(e,null),s||(o=K(e,"click",n[34]),s=!0)},p(c,d){var m,h,_;d[0]&32&&(l=!j.isEmpty((m=c[5])==null?void 0:m.options)&&!((_=(h=c[5])==null?void 0:h.options)!=null&&_.manageRule)),l?r?d[0]&32&&E(r,1):(r=Tp(),r.c(),E(r,1),r.m(e,null)):r&&(ie(),A(r,1,1,()=>{r=null}),le()),d[0]&8&&x(e,"active",c[3]===Al)},d(c){c&&v(e),r&&r.d(),s=!1,o()}}}function Tp(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Pe.call(null,e,"Has errors")),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function o6(n){var U,Y,J,B,W,pe,ee;let e,t=n[2].id?"Edit collection":"New collection",i,l,s,o,r,a,u,f,c,d,m,h=n[14]?"Query":"Fields",_,g,y=!j.isEmpty(n[11]),S,T,$,C,O=!j.isEmpty((U=n[5])==null?void 0:U.listRule)||!j.isEmpty((Y=n[5])==null?void 0:Y.viewRule)||!j.isEmpty((J=n[5])==null?void 0:J.createRule)||!j.isEmpty((B=n[5])==null?void 0:B.updateRule)||!j.isEmpty((W=n[5])==null?void 0:W.deleteRule)||!j.isEmpty((ee=(pe=n[5])==null?void 0:pe.options)==null?void 0:ee.manageRule),D,I,L,R,F=!!n[2].id&&!n[2].system&&bp(n);r=new ce({props:{class:"form-field collection-field-name required m-b-0 "+(n[13]?"disabled":""),name:"name",$$slots:{default:[s6,({uniqueId:ue})=>({49:ue}),({uniqueId:ue})=>[0,ue?262144:0]]},$$scope:{ctx:n}}});let N=y&&wp(n),P=O&&Sp(),q=n[15]&&$p(n);return{c(){e=b("h4"),i=Z(t),l=M(),F&&F.c(),s=M(),o=b("form"),V(r.$$.fragment),a=M(),u=b("input"),f=M(),c=b("div"),d=b("button"),m=b("span"),_=Z(h),g=M(),N&&N.c(),S=M(),T=b("button"),$=b("span"),$.textContent="API Rules",C=M(),P&&P.c(),D=M(),q&&q.c(),p(e,"class","upsert-panel-title svelte-12y0yzb"),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),x(d,"active",n[3]===Oi),p($,"class","txt"),p(T,"type","button"),p(T,"class","tab-item"),x(T,"active",n[3]===ks),p(c,"class","tabs-header stretched")},m(ue,Oe){w(ue,e,Oe),k(e,i),w(ue,l,Oe),F&&F.m(ue,Oe),w(ue,s,Oe),w(ue,o,Oe),H(r,o,null),k(o,a),k(o,u),w(ue,f,Oe),w(ue,c,Oe),k(c,d),k(d,m),k(m,_),k(d,g),N&&N.m(d,null),k(c,S),k(c,T),k(T,$),k(T,C),P&&P.m(T,null),k(c,D),q&&q.m(c,null),I=!0,L||(R=[K(o,"submit",Ue(n[31])),K(d,"click",n[32]),K(T,"click",n[33])],L=!0)},p(ue,Oe){var Je,xe,bt,kt,yt,Ot,Ee;(!I||Oe[0]&4)&&t!==(t=ue[2].id?"Edit collection":"New collection")&&se(i,t),ue[2].id&&!ue[2].system?F?(F.p(ue,Oe),Oe[0]&4&&E(F,1)):(F=bp(ue),F.c(),E(F,1),F.m(s.parentNode,s)):F&&(ie(),A(F,1,1,()=>{F=null}),le());const He={};Oe[0]&8192&&(He.class="form-field collection-field-name required m-b-0 "+(ue[13]?"disabled":"")),Oe[0]&41028|Oe[1]&8650752&&(He.$$scope={dirty:Oe,ctx:ue}),r.$set(He),(!I||Oe[0]&16384)&&h!==(h=ue[14]?"Query":"Fields")&&se(_,h),Oe[0]&2048&&(y=!j.isEmpty(ue[11])),y?N?(N.p(ue,Oe),Oe[0]&2048&&E(N,1)):(N=wp(ue),N.c(),E(N,1),N.m(d,null)):N&&(ie(),A(N,1,1,()=>{N=null}),le()),(!I||Oe[0]&8)&&x(d,"active",ue[3]===Oi),Oe[0]&32&&(O=!j.isEmpty((Je=ue[5])==null?void 0:Je.listRule)||!j.isEmpty((xe=ue[5])==null?void 0:xe.viewRule)||!j.isEmpty((bt=ue[5])==null?void 0:bt.createRule)||!j.isEmpty((kt=ue[5])==null?void 0:kt.updateRule)||!j.isEmpty((yt=ue[5])==null?void 0:yt.deleteRule)||!j.isEmpty((Ee=(Ot=ue[5])==null?void 0:Ot.options)==null?void 0:Ee.manageRule)),O?P?Oe[0]&32&&E(P,1):(P=Sp(),P.c(),E(P,1),P.m(T,null)):P&&(ie(),A(P,1,1,()=>{P=null}),le()),(!I||Oe[0]&8)&&x(T,"active",ue[3]===ks),ue[15]?q?q.p(ue,Oe):(q=$p(ue),q.c(),q.m(c,null)):q&&(q.d(1),q=null)},i(ue){I||(E(F),E(r.$$.fragment,ue),E(N),E(P),I=!0)},o(ue){A(F),A(r.$$.fragment,ue),A(N),A(P),I=!1},d(ue){ue&&(v(e),v(l),v(s),v(o),v(f),v(c)),F&&F.d(ue),z(r),N&&N.d(),P&&P.d(),q&&q.d(),L=!1,we(R)}}}function r6(n){let e,t,i,l,s,o=n[2].id?"Save changes":"Create",r,a,u,f;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),r=Z(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[9],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=a=!n[12]||n[9],x(l,"btn-loading",n[9])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(s,r),u||(f=[K(e,"click",n[25]),K(l,"click",n[26])],u=!0)},p(c,d){d[0]&512&&(e.disabled=c[9]),d[0]&4&&o!==(o=c[2].id?"Save changes":"Create")&&se(r,o),d[0]&4608&&a!==(a=!c[12]||c[9])&&(l.disabled=a),d[0]&512&&x(l,"btn-loading",c[9])},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function a6(n){let e,t,i,l,s={class:"overlay-panel-lg colored-header collection-panel",escClose:!1,overlayClose:!n[9],beforeHide:n[39],$$slots:{footer:[r6],header:[o6],default:[n6]},$$scope:{ctx:n}};e=new Gt({props:s}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let o={};return i=new x5({props:o}),n[43](i),i.$on("confirm",n[44]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),l=!0},p(r,a){const u={};a[0]&512&&(u.overlayClose=!r[9]),a[0]&1040&&(u.beforeHide=r[39]),a[0]&64108|a[1]&8388608&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};i.$set(f)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[40](null),z(e,r),n[43](null),z(i,r)}}}const Oi="schema",ks="api_rules",Al="options",u6="base",Cp="auth",Op="view";function Nr(n){return JSON.stringify(n)}function f6(n,e,t){let i,l,s,o,r,a;We(n,hi,ve=>t(5,a=ve));const u={};u[u6]="Base",u[Op]="View",u[Cp]="Auth";const f=lt();let c,d,m=null,h=j.initCollection(),_=!1,g=!1,y=Oi,S=Nr(h),T="";function $(ve){t(3,y=ve)}function C(ve){return I(ve),t(10,g=!0),$(Oi),c==null?void 0:c.show()}function O(){return c==null?void 0:c.hide()}function D(){t(10,g=!1),O()}async function I(ve){Zt({}),typeof ve<"u"?(t(23,m=ve),t(2,h=structuredClone(ve))):(t(23,m=null),t(2,h=j.initCollection())),t(2,h.schema=h.schema||[],h),t(2,h.originalName=h.name||"",h),await Qt(),t(24,S=Nr(h))}function L(){h.id?d==null||d.show(m,h):R()}function R(){if(_)return;t(9,_=!0);const ve=F();let Se;h.id?Se=re.collections.update(h.id,ve):Se=re.collections.create(ve),Se.then(Ye=>{Ea(),pv(Ye),t(10,g=!1),O(),Pt(h.id?"Successfully updated collection.":"Successfully created collection."),f("save",{isNew:!h.id,collection:Ye})}).catch(Ye=>{re.error(Ye)}).finally(()=>{t(9,_=!1)})}function F(){const ve=Object.assign({},h);ve.schema=ve.schema.slice(0);for(let Se=ve.schema.length-1;Se>=0;Se--)ve.schema[Se].toDelete&&ve.schema.splice(Se,1);return ve}function N(){m!=null&&m.id&&fn(`Do you really want to delete collection "${m.name}" and all its records?`,()=>re.collections.delete(m.id).then(()=>{O(),Pt(`Successfully deleted collection "${m.name}".`),f("delete",m),mv(m)}).catch(ve=>{re.error(ve)}))}function P(ve){t(2,h.type=ve,h),li("schema")}function q(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{U()}):U()}async function U(){const ve=m?structuredClone(m):null;if(ve){if(ve.id="",ve.created="",ve.updated="",ve.name+="_duplicate",!j.isEmpty(ve.schema))for(const Se of ve.schema)Se.id="";if(!j.isEmpty(ve.indexes))for(let Se=0;Se<ve.indexes.length;Se++){const Ye=j.parseIndex(ve.indexes[Se]);Ye.indexName="idx_"+j.randomString(7),Ye.tableName=ve.name,ve.indexes[Se]=j.buildIndex(Ye)}}C(ve),await Qt(),t(24,S="")}const Y=()=>O(),J=()=>L(),B=()=>q(),W=()=>N(),pe=ve=>{t(2,h.name=j.slugify(ve.target.value),h),ve.target.value=h.name},ee=ve=>P(ve),ue=()=>{r&&L()},Oe=()=>$(Oi),He=()=>$(ks),Je=()=>$(Al);function xe(ve){h=ve,t(2,h),t(23,m)}function bt(ve){h=ve,t(2,h),t(23,m)}function kt(ve){h=ve,t(2,h),t(23,m)}function yt(ve){h=ve,t(2,h),t(23,m)}const Ot=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,g=!1),O()}),!1):!0;function Ee(ve){te[ve?"unshift":"push"](()=>{c=ve,t(7,c)})}function Le(ve){Ce.call(this,n,ve)}function ze(ve){Ce.call(this,n,ve)}function _t(ve){te[ve?"unshift":"push"](()=>{d=ve,t(8,d)})}const de=()=>R();return n.$$.update=()=>{var ve,Se;n.$$.dirty[0]&4&&h.type==="view"&&(t(2,h.createRule=null,h),t(2,h.updateRule=null,h),t(2,h.deleteRule=null,h),t(2,h.indexes=[],h)),n.$$.dirty[0]&8388612&&h.name&&(m==null?void 0:m.name)!=h.name&&h.indexes.length>0&&t(2,h.indexes=(ve=h.indexes)==null?void 0:ve.map(Ye=>j.replaceIndexTableName(Ye,h.name)),h),n.$$.dirty[0]&4&&t(15,i=h.type===Cp),n.$$.dirty[0]&4&&t(14,l=h.type===Op),n.$$.dirty[0]&32&&(a.schema||(Se=a.options)!=null&&Se.query?t(11,T=j.getNestedVal(a,"schema.message")||"Has errors"):t(11,T="")),n.$$.dirty[0]&4&&t(13,s=!!h.id&&h.system),n.$$.dirty[0]&16777220&&t(4,o=S!=Nr(h)),n.$$.dirty[0]&20&&t(12,r=!h.id||o),n.$$.dirty[0]&12&&y===Al&&h.type!=="auth"&&$(Oi)},[$,O,h,y,o,a,u,c,d,_,g,T,r,s,l,i,L,R,N,P,q,C,D,m,S,Y,J,B,W,pe,ee,ue,Oe,He,Je,xe,bt,kt,yt,Ot,Ee,Le,ze,_t,de]}class Ga extends ge{constructor(e){super(),_e(this,e,f6,a6,me,{changeTab:0,show:21,hide:1,forceHide:22},null,[-1,-1])}get changeTab(){return this.$$.ctx[0]}get show(){return this.$$.ctx[21]}get hide(){return this.$$.ctx[1]}get forceHide(){return this.$$.ctx[22]}}function c6(n){let e;return{c(){e=b("i"),p(e,"class","ri-pushpin-line m-l-auto svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function d6(n){let e;return{c(){e=b("i"),p(e,"class","ri-unpin-line svelte-1u3ag8h")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function p6(n){let e,t,i,l,s,o=n[0].name+"",r,a,u,f,c,d,m,h;function _(S,T){return S[1]?d6:c6}let g=_(n),y=g(n);return{c(){var S;e=b("a"),t=b("i"),l=M(),s=b("span"),r=Z(o),a=M(),u=b("span"),y.c(),p(t,"class",i=Un(j.getCollectionTypeIcon(n[0].type))+" svelte-1u3ag8h"),p(t,"aria-hidden","true"),p(s,"class","txt m-r-auto"),p(u,"class","btn btn-xs btn-circle btn-hint btn-transparent pin-collection svelte-1u3ag8h"),p(u,"aria-label","Pin collection"),p(u,"aria-hidden","true"),p(e,"href",c="/collections?collectionId="+n[0].id),p(e,"class","sidebar-list-item svelte-1u3ag8h"),p(e,"title",d=n[0].name),x(e,"active",((S=n[2])==null?void 0:S.id)===n[0].id)},m(S,T){w(S,e,T),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,u),y.m(u,null),m||(h=[$e(f=Pe.call(null,u,{position:"right",text:(n[1]?"Unpin":"Pin")+" collection"})),K(u,"click",Tn(Ue(n[5]))),$e(ln.call(null,e))],m=!0)},p(S,[T]){var $;T&1&&i!==(i=Un(j.getCollectionTypeIcon(S[0].type))+" svelte-1u3ag8h")&&p(t,"class",i),T&1&&o!==(o=S[0].name+"")&&se(r,o),g!==(g=_(S))&&(y.d(1),y=g(S),y&&(y.c(),y.m(u,null))),f&&Mt(f.update)&&T&2&&f.update.call(null,{position:"right",text:(S[1]?"Unpin":"Pin")+" collection"}),T&1&&c!==(c="/collections?collectionId="+S[0].id)&&p(e,"href",c),T&1&&d!==(d=S[0].name)&&p(e,"title",d),T&5&&x(e,"active",(($=S[2])==null?void 0:$.id)===S[0].id)},i:Q,o:Q,d(S){S&&v(e),y.d(),m=!1,we(h)}}}function m6(n,e,t){let i,l;We(n,Yn,u=>t(2,l=u));let{collection:s}=e,{pinnedIds:o}=e;function r(u){o.includes(u.id)?j.removeByValue(o,u.id):o.push(u.id),t(4,o)}const a=()=>r(s);return n.$$set=u=>{"collection"in u&&t(0,s=u.collection),"pinnedIds"in u&&t(4,o=u.pinnedIds)},n.$$.update=()=>{n.$$.dirty&17&&t(1,i=o.includes(s.id))},[s,i,l,r,o,a]}class t0 extends ge{constructor(e){super(),_e(this,e,m6,p6,me,{collection:0,pinnedIds:4})}}function Mp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Dp(n,e,t){const i=n.slice();return i[22]=e[t],i}function Ep(n){let e,t,i=[],l=new Map,s,o,r=fe(n[6]);const a=u=>u[22].id;for(let u=0;u<r.length;u+=1){let f=Dp(n,r,u),c=a(f);l.set(c,i[u]=Ip(c,f))}return{c(){e=b("div"),e.textContent="Pinned",t=M();for(let u=0;u<i.length;u+=1)i[u].c();s=ye(),p(e,"class","sidebar-title")},m(u,f){w(u,e,f),w(u,t,f);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);w(u,s,f),o=!0},p(u,f){f&66&&(r=fe(u[6]),ie(),i=at(i,f,a,1,u,r,l,s.parentNode,At,Ip,s,Dp),le())},i(u){if(!o){for(let f=0;f<r.length;f+=1)E(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)A(i[f]);o=!1},d(u){u&&(v(e),v(t),v(s));for(let f=0;f<i.length;f+=1)i[f].d(u)}}}function Ip(n,e){let t,i,l,s;function o(a){e[14](a)}let r={collection:e[22]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new t0({props:r}),te.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u&64&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function Ap(n){let e,t=[],i=new Map,l,s,o=n[6].length&&Lp(),r=fe(n[5]);const a=u=>u[22].id;for(let u=0;u<r.length;u+=1){let f=Mp(n,r,u),c=a(f);i.set(c,t[u]=Np(c,f))}return{c(){o&&o.c(),e=M();for(let u=0;u<t.length;u+=1)t[u].c();l=ye()},m(u,f){o&&o.m(u,f),w(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(u,f);w(u,l,f),s=!0},p(u,f){u[6].length?o||(o=Lp(),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),f&34&&(r=fe(u[5]),ie(),t=at(t,f,a,1,u,r,i,l.parentNode,At,Np,l,Mp),le())},i(u){if(!s){for(let f=0;f<r.length;f+=1)E(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)A(t[f]);s=!1},d(u){u&&(v(e),v(l)),o&&o.d(u);for(let f=0;f<t.length;f+=1)t[f].d(u)}}}function Lp(n){let e;return{c(){e=b("div"),e.textContent="Others",p(e,"class","sidebar-title")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Np(n,e){let t,i,l,s;function o(a){e[15](a)}let r={collection:e[22]};return e[1]!==void 0&&(r.pinnedIds=e[1]),i=new t0({props:r}),te.push(()=>be(i,"pinnedIds",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u&32&&(f.collection=e[22]),!l&&u&2&&(l=!0,f.pinnedIds=e[1],ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function Pp(n){let e;return{c(){e=b("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&&v(e)}}}function Fp(n){let e,t,i,l;return{c(){e=b("footer"),t=b("button"),t.innerHTML='<i class="ri-add-line"></i> <span class="txt">New collection</span>',p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(s,o){w(s,e,o),k(e,t),i||(l=K(t,"click",n[16]),i=!0)},p:Q,d(s){s&&v(e),i=!1,l()}}}function h6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S=n[6].length&&Ep(n),T=n[5].length&&Ap(n),$=n[3].length&&!n[2].length&&Pp(),C=!n[9]&&Fp(n);return{c(){e=b("header"),t=b("div"),i=b("div"),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=M(),o=b("input"),r=M(),a=b("hr"),u=M(),f=b("div"),S&&S.c(),c=M(),T&&T.c(),d=M(),$&&$.c(),m=M(),C&&C.c(),h=ye(),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[7]),p(i,"class","form-field-addon"),p(o,"type","text"),p(o,"placeholder","Search collections..."),p(o,"name","collections-search"),p(t,"class","form-field search"),x(t,"active",n[7]),p(e,"class","sidebar-header"),p(a,"class","m-t-5 m-b-xs"),p(f,"class","sidebar-content"),x(f,"fade",n[8]),x(f,"sidebar-content-compact",n[2].length>20)},m(O,D){w(O,e,D),k(e,t),k(t,i),k(i,l),k(t,s),k(t,o),oe(o,n[0]),w(O,r,D),w(O,a,D),w(O,u,D),w(O,f,D),S&&S.m(f,null),k(f,c),T&&T.m(f,null),k(f,d),$&&$.m(f,null),w(O,m,D),C&&C.m(O,D),w(O,h,D),_=!0,g||(y=[K(l,"click",n[12]),K(o,"input",n[13])],g=!0)},p(O,D){(!_||D&128)&&x(l,"hidden",!O[7]),D&1&&o.value!==O[0]&&oe(o,O[0]),(!_||D&128)&&x(t,"active",O[7]),O[6].length?S?(S.p(O,D),D&64&&E(S,1)):(S=Ep(O),S.c(),E(S,1),S.m(f,c)):S&&(ie(),A(S,1,1,()=>{S=null}),le()),O[5].length?T?(T.p(O,D),D&32&&E(T,1)):(T=Ap(O),T.c(),E(T,1),T.m(f,d)):T&&(ie(),A(T,1,1,()=>{T=null}),le()),O[3].length&&!O[2].length?$||($=Pp(),$.c(),$.m(f,null)):$&&($.d(1),$=null),(!_||D&256)&&x(f,"fade",O[8]),(!_||D&4)&&x(f,"sidebar-content-compact",O[2].length>20),O[9]?C&&(C.d(1),C=null):C?C.p(O,D):(C=Fp(O),C.c(),C.m(h.parentNode,h))},i(O){_||(E(S),E(T),_=!0)},o(O){A(S),A(T),_=!1},d(O){O&&(v(e),v(r),v(a),v(u),v(f),v(m),v(h)),S&&S.d(),T&&T.d(),$&&$.d(),C&&C.d(O),g=!1,we(y)}}}function _6(n){let e,t,i,l;e=new Zb({props:{class:"collection-sidebar",$$slots:{default:[h6]},$$scope:{ctx:n}}});let s={};return i=new Ga({props:s}),n[17](i),i.$on("save",n[18]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),l=!0},p(o,[r]){const a={};r&134218751&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),z(e,o),n[17](null),z(i,o)}}}const Rp="@pinnedCollections";function g6(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function b6(n,e,t){let i,l,s,o,r,a,u,f,c;We(n,Rn,L=>t(11,a=L)),We(n,Yn,L=>t(19,u=L)),We(n,$o,L=>t(8,f=L)),We(n,Qi,L=>t(9,c=L));let d,m="",h=[];g();function _(L){xt(Yn,u=L,u)}function g(){t(1,h=[]);try{const L=localStorage.getItem(Rp);L&&t(1,h=JSON.parse(L)||[])}catch{}}function y(){t(1,h=h.filter(L=>!!a.find(R=>R.id==L)))}const S=()=>t(0,m="");function T(){m=this.value,t(0,m)}function $(L){h=L,t(1,h)}function C(L){h=L,t(1,h)}const O=()=>d==null?void 0:d.show();function D(L){te[L?"unshift":"push"](()=>{d=L,t(4,d)})}const I=L=>{var R;(R=L.detail)!=null&&R.isNew&&L.detail.collection&&_(L.detail.collection)};return n.$$.update=()=>{n.$$.dirty&2048&&a&&(y(),g6()),n.$$.dirty&1&&t(3,i=m.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(7,l=m!==""),n.$$.dirty&2&&h&&localStorage.setItem(Rp,JSON.stringify(h)),n.$$.dirty&2057&&t(2,s=a.filter(L=>L.id==m||L.name.replace(/\s+/g,"").toLowerCase().includes(i))),n.$$.dirty&6&&t(6,o=s.filter(L=>h.includes(L.id))),n.$$.dirty&6&&t(5,r=s.filter(L=>!h.includes(L.id)))},[m,h,s,i,d,r,o,l,f,c,_,a,S,T,$,C,O,D,I]}class k6 extends ge{constructor(e){super(),_e(this,e,b6,_6,me,{})}}function qp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function jp(n){n[18]=n[19].default}function Hp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function zp(n){let e;return{c(){e=b("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Vp(n,e){let t,i=e[21]===Object.keys(e[6]).length,l,s,o=e[15].label+"",r,a,u,f,c=i&&zp();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),l=M(),s=b("button"),r=Z(o),a=M(),p(s,"type","button"),p(s,"class","sidebar-item"),x(s,"active",e[5]===e[14]),this.first=t},m(m,h){w(m,t,h),c&&c.m(m,h),w(m,l,h),w(m,s,h),k(s,r),k(s,a),u||(f=K(s,"click",d),u=!0)},p(m,h){e=m,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=zp(),c.c(),c.m(l.parentNode,l)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&se(r,o),h&40&&x(s,"active",e[5]===e[14])},d(m){m&&(v(t),v(l),v(s)),c&&c.d(m),u=!1,f()}}}function Bp(n){let e,t,i,l={ctx:n,current:null,token:null,hasCatch:!1,pending:w6,then:v6,catch:y6,value:19,blocks:[,,,]};return lu(t=n[15].component,l),{c(){e=ye(),l.block.c()},m(s,o){w(s,e,o),l.block.m(s,l.anchor=o),l.mount=()=>e.parentNode,l.anchor=e,i=!0},p(s,o){n=s,l.ctx=n,o&8&&t!==(t=n[15].component)&&lu(t,l)||F0(l,n,o)},i(s){i||(E(l.block),i=!0)},o(s){for(let o=0;o<3;o+=1){const r=l.blocks[o];A(r)}i=!1},d(s){s&&v(e),l.block.d(s),l.token=null,l=null}}}function y6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function v6(n){jp(n);let e,t,i;return e=new n[18]({props:{collection:n[2]}}),{c(){V(e.$$.fragment),t=M()},m(l,s){H(e,l,s),w(l,t,s),i=!0},p(l,s){jp(l);const o={};s&4&&(o.collection=l[2]),e.$set(o)},i(l){i||(E(e.$$.fragment,l),i=!0)},o(l){A(e.$$.fragment,l),i=!1},d(l){l&&v(t),z(e,l)}}}function w6(n){return{c:Q,m:Q,p:Q,i:Q,o:Q,d:Q}}function Up(n,e){let t,i,l,s=e[5]===e[14]&&Bp(e);return{key:n,first:null,c(){t=ye(),s&&s.c(),i=ye(),this.first=t},m(o,r){w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){e=o,e[5]===e[14]?s?(s.p(e,r),r&40&&E(s,1)):(s=Bp(e),s.c(),E(s,1),s.m(i.parentNode,i)):s&&(ie(),A(s,1,1,()=>{s=null}),le())},i(o){l||(E(s),l=!0)},o(o){A(s),l=!1},d(o){o&&(v(t),v(i)),s&&s.d(o)}}}function S6(n){let e,t,i,l=[],s=new Map,o,r,a=[],u=new Map,f,c=fe(Object.entries(n[3]));const d=_=>_[14];for(let _=0;_<c.length;_+=1){let g=Hp(n,c,_),y=d(g);s.set(y,l[_]=Vp(y,g))}let m=fe(Object.entries(n[3]));const h=_=>_[14];for(let _=0;_<m.length;_+=1){let g=qp(n,m,_),y=h(g);u.set(y,a[_]=Up(y,g))}return{c(){var _;e=b("div"),t=b("aside"),i=b("nav");for(let g=0;g<l.length;g+=1)l[g].c();o=M(),r=b("div");for(let g=0;g<a.length;g+=1)a[g].c();p(i,"class","sidebar-content"),p(t,"class","docs-sidebar"),x(t,"compact",((_=n[2])==null?void 0:_.type)==="auth"),p(r,"class","docs-content"),p(e,"class","docs-content-wrapper")},m(_,g){w(_,e,g),k(e,t),k(t,i);for(let y=0;y<l.length;y+=1)l[y]&&l[y].m(i,null);k(e,o),k(e,r);for(let y=0;y<a.length;y+=1)a[y]&&a[y].m(r,null);f=!0},p(_,g){var y;g&106&&(c=fe(Object.entries(_[3])),l=at(l,g,d,1,_,c,s,i,Li,Vp,null,Hp)),(!f||g&4)&&x(t,"compact",((y=_[2])==null?void 0:y.type)==="auth"),g&44&&(m=fe(Object.entries(_[3])),ie(),a=at(a,g,h,1,_,m,u,r,At,Up,null,qp),le())},i(_){if(!f){for(let g=0;g<m.length;g+=1)E(a[g]);f=!0}},o(_){for(let g=0;g<a.length;g+=1)A(a[g]);f=!1},d(_){_&&v(e);for(let g=0;g<l.length;g+=1)l[g].d();for(let g=0;g<a.length;g+=1)a[g].d()}}}function $6(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[8]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function T6(n){let e,t,i={class:"docs-panel",$$slots:{footer:[$6],default:[S6]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&4194348&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),z(e,l)}}}function C6(n,e,t){const i={list:{label:"List/Search",component:tt(()=>import("./ListApiDocs-NcawIdXj.js"),__vite__mapDeps([3,4,5,6,7]),import.meta.url)},view:{label:"View",component:tt(()=>import("./ViewApiDocs-Bqi1Bubc.js"),__vite__mapDeps([8,4,5,6]),import.meta.url)},create:{label:"Create",component:tt(()=>import("./CreateApiDocs-Dp5mBTnM.js"),__vite__mapDeps([9,4,5,6]),import.meta.url)},update:{label:"Update",component:tt(()=>import("./UpdateApiDocs-U5vj4iTc.js"),__vite__mapDeps([10,4,5,6]),import.meta.url)},delete:{label:"Delete",component:tt(()=>import("./DeleteApiDocs-Sd9qCx1L.js"),__vite__mapDeps([11,4,5]),import.meta.url)},realtime:{label:"Realtime",component:tt(()=>import("./RealtimeApiDocs-BGJAnbV8.js"),__vite__mapDeps([12,4,5]),import.meta.url)}},l={"auth-with-password":{label:"Auth with password",component:tt(()=>import("./AuthWithPasswordDocs-DTzh-tiS.js"),__vite__mapDeps([13,4,5,6]),import.meta.url)},"auth-with-oauth2":{label:"Auth with OAuth2",component:tt(()=>import("./AuthWithOAuth2Docs-BgQXm4pV.js"),__vite__mapDeps([14,4,5,6]),import.meta.url)},refresh:{label:"Auth refresh",component:tt(()=>import("./AuthRefreshDocs-eA35WVdY.js"),__vite__mapDeps([15,4,5,6]),import.meta.url)},"request-verification":{label:"Request verification",component:tt(()=>import("./RequestVerificationDocs-D8lPTjIQ.js"),__vite__mapDeps([16,4,5]),import.meta.url)},"confirm-verification":{label:"Confirm verification",component:tt(()=>import("./ConfirmVerificationDocs-B-t2hzDm.js"),__vite__mapDeps([17,4,5]),import.meta.url)},"request-password-reset":{label:"Request password reset",component:tt(()=>import("./RequestPasswordResetDocs-BdwsLKcm.js"),__vite__mapDeps([18,4,5]),import.meta.url)},"confirm-password-reset":{label:"Confirm password reset",component:tt(()=>import("./ConfirmPasswordResetDocs-CFydU8W2.js"),__vite__mapDeps([19,4,5]),import.meta.url)},"request-email-change":{label:"Request email change",component:tt(()=>import("./RequestEmailChangeDocs-SF9ggaSn.js"),__vite__mapDeps([20,4,5]),import.meta.url)},"confirm-email-change":{label:"Confirm email change",component:tt(()=>import("./ConfirmEmailChangeDocs-Nc8EAF7u.js"),__vite__mapDeps([21,4,5]),import.meta.url)},"list-auth-methods":{label:"List auth methods",component:tt(()=>import("./AuthMethodsDocs-Bc1UuK8n.js"),__vite__mapDeps([22,4,5,6]),import.meta.url)},"list-linked-accounts":{label:"List OAuth2 accounts",component:tt(()=>import("./ListExternalAuthsDocs-Bk44wTxj.js"),__vite__mapDeps([23,4,5,6]),import.meta.url)},"unlink-account":{label:"Unlink OAuth2 account",component:tt(()=>import("./UnlinkExternalAuthDocs-DFP5clLH.js"),__vite__mapDeps([24,4,5]),import.meta.url)}};let s,o={},r,a=[];a.length&&(r=Object.keys(a)[0]);function u(y){return t(2,o=y),c(Object.keys(a)[0]),s==null?void 0:s.show()}function f(){return s==null?void 0:s.hide()}function c(y){t(5,r=y)}const d=()=>f(),m=y=>c(y);function h(y){te[y?"unshift":"push"](()=>{s=y,t(4,s)})}function _(y){Ce.call(this,n,y)}function g(y){Ce.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&12&&(o.type==="auth"?(t(3,a=Object.assign({},i,l)),!o.options.allowUsernameAuth&&!o.options.allowEmailAuth&&delete a["auth-with-password"],o.options.allowOAuth2Auth||delete a["auth-with-oauth2"]):o.type==="view"?(t(3,a=Object.assign({},i)),delete a.create,delete a.update,delete a.delete,delete a.realtime):t(3,a=Object.assign({},i)))},[f,c,o,a,s,r,i,u,d,m,h,_,g]}class O6 extends ge{constructor(e){super(),_e(this,e,C6,T6,me,{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 M6(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-calendar-event-line txt-disabled")},m(s,o){w(s,e,o),i||(l=$e(t=Pe.call(null,e,{text:n[0].join(`
|
||
`),position:"left"})),i=!0)},p(s,[o]){t&&Mt(t.update)&&o&1&&t.update.call(null,{text:s[0].join(`
|
||
`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const Wp="yyyy-MM-dd HH:mm:ss.SSS";function D6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,Wp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,Wp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class n0 extends ge{constructor(e){super(),_e(this,e,D6,M6,me,{model:1})}}function E6(n){let e,t,i,l,s,o,r,a,u,f;return s=new ol({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Z(n[1]),l=M(),V(s.$$.fragment),o=M(),r=b("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),k(e,t),k(t,i),n[6](t),k(e,l),H(s,e,null),k(e,o),k(e,r),a=!0,u||(f=[$e(Pe.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(E(s.$$.fragment,c),a=!0)},o(c){A(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),z(s),u=!1,we(f)}}}function I6(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[E6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new On({props:d}),te.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),V(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(m,h){w(m,e,h),k(e,t),k(e,i),H(l,e,null),a=!0,u||(f=$e(r=Pe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Mt(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(E(l.$$.fragment,m),a=!0)},o(m){A(l.$$.fragment,m),a=!1},d(m){m&&v(e),z(l),u=!1,f()}}}function A6(n,e,t){const i=lt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class i0 extends ge{constructor(e){super(),_e(this,e,A6,I6,me,{class:0,length:5})}}function L6(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(m,h){w(m,e,h),k(e,t),k(e,i),k(e,l),w(m,o,h),w(m,r,h),oe(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),h&8192&&f!==(f=m[13])&&p(r,"id",f),h&1&&r.value!==m[0].username&&oe(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function N6(n){let e,t,i,l,s,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,y,S,T;return{c(){var $;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),u=b("span"),f=Z("Public: "),d=Z(c),h=M(),_=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=y=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),k(e,t),k(e,i),k(e,l),w($,o,C),w($,r,C),k(r,a),k(a,u),k(u,f),k(u,d),w($,h,C),w($,_,C),oe(_,n[0].email),n[2]&&_.focus(),S||(T=[$e(Pe.call(null,a,{text:"Make email public or private",position:"top-right"})),K(a,"click",Ue(n[6])),K(_,"input",n[7])],S=!0)},p($,C){var O;C&8192&&s!==(s=$[13])&&p(e,"for",s),C&1&&c!==(c=$[0].emailVisibility?"On":"Off")&&se(d,c),C&1&&m!==(m="btn btn-sm btn-transparent "+($[0].emailVisibility?"btn-success":"btn-hint"))&&p(a,"class",m),C&4&&(_.autofocus=$[2]),C&8192&&g!==(g=$[13])&&p(_,"id",g),C&2&&y!==(y=(O=$[1].options)==null?void 0:O.requireEmail)&&(_.required=y),C&1&&_.value!==$[0].email&&oe(_,$[0].email)},d($){$&&(v(e),v(o),v(r),v(h),v(_)),S=!1,we(T)}}}function Yp(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[P6,({uniqueId:i})=>({13:i}),({uniqueId:i})=>i?8192:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&24584&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function P6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[3],w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&8&&(e.checked=u[3]),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Kp(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[F6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[R6,({uniqueId:f})=>({13:f}),({uniqueId:f})=>f?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("div"),V(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),x(t,"p-t-xs",n[3]),p(e,"class","block")},m(f,c){w(f,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),u=!0},p(f,c){const d={};c&24579&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&24577&&(m.$$scope={dirty:c,ctx:f}),r.$set(m),(!u||c&8)&&x(t,"p-t-xs",f[3])},i(f){u||(E(l.$$.fragment,f),E(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){A(l.$$.fragment,f),A(r.$$.fragment,f),f&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),z(l),z(r),f&&a&&a.end()}}}function F6(n){var _,g;let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new i0({props:{length:Math.max(15,((g=(_=n[1])==null?void 0:_.options)==null?void 0:g.minPasswordLength)||0)}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0,p(f,"class","form-field-addon")},m(y,S){w(y,e,S),k(e,t),k(e,i),k(e,l),w(y,o,S),w(y,r,S),oe(r,n[0].password),w(y,u,S),w(y,f,S),H(c,f,null),d=!0,m||(h=K(r,"input",n[9]),m=!0)},p(y,S){var $,C;(!d||S&8192&&s!==(s=y[13]))&&p(e,"for",s),(!d||S&8192&&a!==(a=y[13]))&&p(r,"id",a),S&1&&r.value!==y[0].password&&oe(r,y[0].password);const T={};S&2&&(T.length=Math.max(15,((C=($=y[1])==null?void 0:$.options)==null?void 0:C.minPasswordLength)||0)),c.$set(T)},i(y){d||(E(c.$$.fragment,y),d=!0)},o(y){A(c.$$.fragment,y),d=!1},d(y){y&&(v(e),v(o),v(r),v(u),v(f)),z(c),m=!1,h()}}}function R6(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[13]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[13]),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[0].passwordConfirm),u||(f=K(r,"input",n[10]),u=!0)},p(c,d){d&8192&&s!==(s=c[13])&&p(e,"for",s),d&8192&&a!==(a=c[13])&&p(r,"id",a),d&1&&r.value!==c[0].passwordConfirm&&oe(r,c[0].passwordConfirm)},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function q6(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Verified"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(u,f){w(u,e,f),e.checked=n[0].verified,w(u,i,f),w(u,l,f),k(l,s),r||(a=[K(e,"change",n[11]),K(e,"change",Ue(n[12]))],r=!0)},p(u,f){f&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].verified),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function j6(n){var g;let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new ce({props:{class:"form-field "+(n[2]?"":"required"),name:"username",$$slots:{default:[L6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+((g=n[1].options)!=null&&g.requireEmail?"required":""),name:"email",$$slots:{default:[N6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}});let h=!n[2]&&Yp(n),_=(n[2]||n[3])&&Kp(n);return d=new ce({props:{class:"form-field form-field-toggle",name:"verified",$$slots:{default:[q6,({uniqueId:y})=>({13:y}),({uniqueId:y})=>y?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),r=M(),a=b("div"),h&&h.c(),u=M(),_&&_.c(),f=M(),c=b("div"),V(d.$$.fragment),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(a,"class","col-lg-12"),p(c,"class","col-lg-12"),p(e,"class","grid m-b-base")},m(y,S){w(y,e,S),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),h&&h.m(a,null),k(a,u),_&&_.m(a,null),k(e,f),k(e,c),H(d,c,null),m=!0},p(y,[S]){var O;const T={};S&4&&(T.class="form-field "+(y[2]?"":"required")),S&24581&&(T.$$scope={dirty:S,ctx:y}),i.$set(T);const $={};S&2&&($.class="form-field "+((O=y[1].options)!=null&&O.requireEmail?"required":"")),S&24583&&($.$$scope={dirty:S,ctx:y}),o.$set($),y[2]?h&&(ie(),A(h,1,1,()=>{h=null}),le()):h?(h.p(y,S),S&4&&E(h,1)):(h=Yp(y),h.c(),E(h,1),h.m(a,u)),y[2]||y[3]?_?(_.p(y,S),S&12&&E(_,1)):(_=Kp(y),_.c(),E(_,1),_.m(a,null)):_&&(ie(),A(_,1,1,()=>{_=null}),le());const C={};S&24581&&(C.$$scope={dirty:S,ctx:y}),d.$set(C)},i(y){m||(E(i.$$.fragment,y),E(o.$$.fragment,y),E(h),E(_),E(d.$$.fragment,y),m=!0)},o(y){A(i.$$.fragment,y),A(o.$$.fragment,y),A(h),A(_),A(d.$$.fragment,y),m=!1},d(y){y&&v(e),z(i),z(o),h&&h.d(),_&&_.d(),z(d)}}}function H6(n,e,t){let{record:i}=e,{collection:l}=e,{isNew:s=!(i!=null&&i.id)}=e,o=i.username||null,r=!1;function a(){i.username=this.value,t(0,i),t(3,r)}const u=()=>t(0,i.emailVisibility=!i.emailVisibility,i);function f(){i.email=this.value,t(0,i),t(3,r)}function c(){r=this.checked,t(3,r)}function d(){i.password=this.value,t(0,i),t(3,r)}function m(){i.passwordConfirm=this.value,t(0,i),t(3,r)}function h(){i.verified=this.checked,t(0,i),t(3,r)}const _=g=>{s||fn("Do you really want to manually change the verified account state?",()=>{},()=>{t(0,i.verified=!g.target.checked,i)})};return n.$$set=g=>{"record"in g&&t(0,i=g.record),"collection"in g&&t(1,l=g.collection),"isNew"in g&&t(2,s=g.isNew)},n.$$.update=()=>{n.$$.dirty&1&&!i.username&&i.username!==null&&t(0,i.username=null,i),n.$$.dirty&8&&(r||(t(0,i.password=null,i),t(0,i.passwordConfirm=null,i),li("password"),li("passwordConfirm")))},[i,l,s,r,o,a,u,f,c,d,m,h,_]}class z6 extends ge{constructor(e){super(),_e(this,e,H6,j6,me,{record:0,collection:1,isNew:2})}}function V6(n){let e,t,i,l=[n[3]],s={};for(let o=0;o<l.length;o+=1)s=Ae(s,l[o]);return{c(){e=b("textarea"),ni(e,s),x(e,"svelte-1x1pbts",!0)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[5](e),oe(e,n[0]),t||(i=[K(e,"input",n[6]),K(e,"keydown",n[2])],t=!0)},p(o,[r]){ni(e,s=dt(l,[r&8&&o[3]])),r&1&&oe(e,o[0]),x(e,"svelte-1x1pbts",!0)},i:Q,o:Q,d(o){o&&v(e),n[5](null),t=!1,we(i)}}}function B6(n,e,t){const i=["value","maxHeight"];let l=Xe(e,i),{value:s=""}=e,{maxHeight:o=200}=e,r,a;function u(){clearTimeout(a),a=setTimeout(()=>{r&&(t(1,r.style.height="",r),t(1,r.style.height=Math.min(r.scrollHeight,o)+"px",r))},0)}function f(m){if((m==null?void 0:m.code)==="Enter"&&!(m!=null&&m.shiftKey)&&!(m!=null&&m.isComposing)){m.preventDefault();const h=r.closest("form");h!=null&&h.requestSubmit&&h.requestSubmit()}}Kt(()=>(u(),()=>clearTimeout(a)));function c(m){te[m?"unshift":"push"](()=>{r=m,t(1,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ae(Ae({},e),Yt(m)),t(3,l=Xe(e,i)),"value"in m&&t(0,s=m.value),"maxHeight"in m&&t(4,o=m.maxHeight)},n.$$.update=()=>{n.$$.dirty&1&&typeof s!==void 0&&u()},[s,r,f,l,o,c,d]}class U6 extends ge{constructor(e){super(),_e(this,e,B6,V6,me,{value:0,maxHeight:4})}}function W6(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d;function m(_){n[2](_)}let h={id:n[3],required:n[1].required};return n[0]!==void 0&&(h.value=n[0]),f=new U6({props:h}),te.push(()=>be(f,"value",m)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),V(f.$$.fragment),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3])},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,u,g),H(f,_,g),d=!0},p(_,g){(!d||g&2&&i!==(i=j.getFieldTypeIcon(_[1].type)))&&p(t,"class",i),(!d||g&2)&&o!==(o=_[1].name+"")&&se(r,o),(!d||g&8&&a!==(a=_[3]))&&p(e,"for",a);const y={};g&8&&(y.id=_[3]),g&2&&(y.required=_[1].required),!c&&g&1&&(c=!0,y.value=_[0],ke(()=>c=!1)),f.$set(y)},i(_){d||(E(f.$$.fragment,_),d=!0)},o(_){A(f.$$.fragment,_),d=!1},d(_){_&&(v(e),v(u)),z(f,_)}}}function Y6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[W6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function K6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(o){l=o,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class J6 extends ge{constructor(e){super(),_e(this,e,K6,Y6,me,{field:1,value:0})}}function Z6(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,h,_,g;return{c(){var y,S;e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(f,"type","number"),p(f,"id",c=n[3]),f.required=d=n[1].required,p(f,"min",m=(y=n[1].options)==null?void 0:y.min),p(f,"max",h=(S=n[1].options)==null?void 0:S.max),p(f,"step","any")},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,u,S),w(y,f,S),oe(f,n[0]),_||(g=K(f,"input",n[2]),_=!0)},p(y,S){var T,$;S&2&&i!==(i=j.getFieldTypeIcon(y[1].type))&&p(t,"class",i),S&2&&o!==(o=y[1].name+"")&&se(r,o),S&8&&a!==(a=y[3])&&p(e,"for",a),S&8&&c!==(c=y[3])&&p(f,"id",c),S&2&&d!==(d=y[1].required)&&(f.required=d),S&2&&m!==(m=(T=y[1].options)==null?void 0:T.min)&&p(f,"min",m),S&2&&h!==(h=($=y[1].options)==null?void 0:$.max)&&p(f,"max",h),S&1&&it(f.value)!==y[0]&&oe(f,y[0])},d(y){y&&(v(e),v(u),v(f)),_=!1,g()}}}function G6(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[Z6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function X6(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=it(this.value),t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class Q6 extends ge{constructor(e){super(),_e(this,e,X6,G6,me,{field:1,value:0})}}function x6(n){let e,t,i,l,s=n[1].name+"",o,r,a,u;return{c(){e=b("input"),i=M(),l=b("label"),o=Z(s),p(e,"type","checkbox"),p(e,"id",t=n[3]),p(l,"for",r=n[3])},m(f,c){w(f,e,c),e.checked=n[0],w(f,i,c),w(f,l,c),k(l,o),a||(u=K(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&&s!==(s=f[1].name+"")&&se(o,s),c&8&&r!==(r=f[3])&&p(l,"for",r)},d(f){f&&(v(e),v(i),v(l)),a=!1,u()}}}function eO(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[x6,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field form-field-toggle "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function tO(n,e,t){let{field:i}=e,{value:l=!1}=e;function s(){l=this.checked,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class nO extends ge{constructor(e){super(),_e(this,e,tO,eO,me,{field:1,value:0})}}function iO(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(f,"type","email"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,u,g),w(_,f,g),oe(f,n[0]),m||(h=K(f,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&se(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(f,"id",c),g&2&&d!==(d=_[1].required)&&(f.required=d),g&1&&f.value!==_[0]&&oe(f,_[0])},d(_){_&&(v(e),v(u),v(f)),m=!1,h()}}}function lO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[iO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function sO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class oO extends ge{constructor(e){super(),_e(this,e,sO,lO,me,{field:1,value:0})}}function rO(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,h;return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),f=b("input"),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[3]),p(f,"type","url"),p(f,"id",c=n[3]),f.required=d=n[1].required},m(_,g){w(_,e,g),k(e,t),k(e,l),k(e,s),k(s,r),w(_,u,g),w(_,f,g),oe(f,n[0]),m||(h=K(f,"input",n[2]),m=!0)},p(_,g){g&2&&i!==(i=j.getFieldTypeIcon(_[1].type))&&p(t,"class",i),g&2&&o!==(o=_[1].name+"")&&se(r,o),g&8&&a!==(a=_[3])&&p(e,"for",a),g&8&&c!==(c=_[3])&&p(f,"id",c),g&2&&d!==(d=_[1].required)&&(f.required=d),g&1&&f.value!==_[0]&&oe(f,_[0])},d(_){_&&(v(e),v(u),v(f)),m=!1,h()}}}function aO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[rO,({uniqueId:i})=>({3:i}),({uniqueId:i})=>i?8:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&27&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function uO(n,e,t){let{field:i}=e,{value:l=void 0}=e;function s(){l=this.value,t(0,l)}return n.$$set=o=>{"field"in o&&t(1,i=o.field),"value"in o&&t(0,l=o.value)},[l,i,s]}class fO extends ge{constructor(e){super(),_e(this,e,uO,aO,me,{field:1,value:0})}}function Jp(n){let e,t,i,l;return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-close-line"></i>',p(t,"type","button"),p(t,"class","link-hint clear-btn svelte-11df51y"),p(e,"class","form-field-addon")},m(s,o){w(s,e,o),k(e,t),i||(l=[$e(Pe.call(null,t,"Clear")),K(t,"click",n[5])],i=!0)},p:Q,d(s){s&&v(e),i=!1,we(l)}}}function cO(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,h,_,g=n[0]&&!n[1].required&&Jp(n);function y($){n[6]($)}function S($){n[7]($)}let T={id:n[8],options:j.defaultFlatpickrOptions()};return n[2]!==void 0&&(T.value=n[2]),n[0]!==void 0&&(T.formattedValue=n[0]),d=new Za({props:T}),te.push(()=>be(d,"value",y)),te.push(()=>be(d,"formattedValue",S)),d.$on("close",n[3]),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),a=Z(" (UTC)"),f=M(),g&&g.c(),c=M(),V(d.$$.fragment),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-11df51y"),p(s,"class","txt"),p(e,"for",u=n[8])},m($,C){w($,e,C),k(e,t),k(e,l),k(e,s),k(s,r),k(s,a),w($,f,C),g&&g.m($,C),w($,c,C),H(d,$,C),_=!0},p($,C){(!_||C&2&&i!==(i=Un(j.getFieldTypeIcon($[1].type))+" svelte-11df51y"))&&p(t,"class",i),(!_||C&2)&&o!==(o=$[1].name+"")&&se(r,o),(!_||C&256&&u!==(u=$[8]))&&p(e,"for",u),$[0]&&!$[1].required?g?g.p($,C):(g=Jp($),g.c(),g.m(c.parentNode,c)):g&&(g.d(1),g=null);const O={};C&256&&(O.id=$[8]),!m&&C&4&&(m=!0,O.value=$[2],ke(()=>m=!1)),!h&&C&1&&(h=!0,O.formattedValue=$[0],ke(()=>h=!1)),d.$set(O)},i($){_||(E(d.$$.fragment,$),_=!0)},o($){A(d.$$.fragment,$),_=!1},d($){$&&(v(e),v(f),v(c)),g&&g.d($),z(d,$)}}}function dO(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[cO,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&775&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function pO(n,e,t){let{field:i}=e,{value:l=void 0}=e,s=l;function o(c){c.detail&&c.detail.length==3&&t(0,l=c.detail[1])}function r(){t(0,l="")}const a=()=>r();function u(c){s=c,t(2,s),t(0,l)}function f(c){l=c,t(0,l)}return n.$$set=c=>{"field"in c&&t(1,i=c.field),"value"in c&&t(0,l=c.value)},n.$$.update=()=>{n.$$.dirty&1&&l&&l.length>19&&t(0,l=l.substring(0,19)),n.$$.dirty&5&&s!=l&&t(2,s=l)},[l,i,s,o,r,a,u,f]}class mO extends ge{constructor(e){super(),_e(this,e,pO,dO,me,{field:1,value:0})}}function Zp(n){let e,t,i=n[1].options.maxSelect+"",l,s;return{c(){e=b("div"),t=Z("Select up to "),l=Z(i),s=Z(" items."),p(e,"class","help-block")},m(o,r){w(o,e,r),k(e,t),k(e,l),k(e,s)},p(o,r){r&2&&i!==(i=o[1].options.maxSelect+"")&&se(l,i)},d(o){o&&v(e)}}}function hO(n){var S,T,$,C,O,D;let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,h;function _(I){n[3](I)}let g={id:n[4],toggle:!n[1].required||n[2],multiple:n[2],closable:!n[2]||((S=n[0])==null?void 0:S.length)>=((T=n[1].options)==null?void 0:T.maxSelect),items:($=n[1].options)==null?void 0:$.values,searchable:((O=(C=n[1].options)==null?void 0:C.values)==null?void 0:O.length)>5};n[0]!==void 0&&(g.selected=n[0]),f=new e0({props:g}),te.push(()=>be(f,"selected",_));let y=((D=n[1].options)==null?void 0:D.maxSelect)>1&&Zp(n);return{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),V(f.$$.fragment),d=M(),y&&y.c(),m=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[4])},m(I,L){w(I,e,L),k(e,t),k(e,l),k(e,s),k(s,r),w(I,u,L),H(f,I,L),w(I,d,L),y&&y.m(I,L),w(I,m,L),h=!0},p(I,L){var F,N,P,q,U,Y;(!h||L&2&&i!==(i=j.getFieldTypeIcon(I[1].type)))&&p(t,"class",i),(!h||L&2)&&o!==(o=I[1].name+"")&&se(r,o),(!h||L&16&&a!==(a=I[4]))&&p(e,"for",a);const R={};L&16&&(R.id=I[4]),L&6&&(R.toggle=!I[1].required||I[2]),L&4&&(R.multiple=I[2]),L&7&&(R.closable=!I[2]||((F=I[0])==null?void 0:F.length)>=((N=I[1].options)==null?void 0:N.maxSelect)),L&2&&(R.items=(P=I[1].options)==null?void 0:P.values),L&2&&(R.searchable=((U=(q=I[1].options)==null?void 0:q.values)==null?void 0:U.length)>5),!c&&L&1&&(c=!0,R.selected=I[0],ke(()=>c=!1)),f.$set(R),((Y=I[1].options)==null?void 0:Y.maxSelect)>1?y?y.p(I,L):(y=Zp(I),y.c(),y.m(m.parentNode,m)):y&&(y.d(1),y=null)},i(I){h||(E(f.$$.fragment,I),h=!0)},o(I){A(f.$$.fragment,I),h=!1},d(I){I&&(v(e),v(u),v(d),v(m)),z(f,I),y&&y.d(I)}}}function _O(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[hO,({uniqueId:i})=>({4:i}),({uniqueId:i})=>i?16:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&55&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function gO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e;function o(r){s=r,t(0,s),t(2,i),t(1,l)}return n.$$set=r=>{"field"in r&&t(1,l=r.field),"value"in r&&t(0,s=r.value)},n.$$.update=()=>{var r;n.$$.dirty&2&&t(2,i=((r=l.options)==null?void 0:r.maxSelect)>1),n.$$.dirty&5&&typeof s>"u"&&t(0,s=i?[]:""),n.$$.dirty&7&&i&&Array.isArray(s)&&s.length>l.options.maxSelect&&t(0,s=s.slice(s.length-l.options.maxSelect))},[s,l,i,o]}class bO extends ge{constructor(e){super(),_e(this,e,gO,_O,me,{field:1,value:0})}}function kO(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function yO(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function vO(n){let e;return{c(){e=b("input"),p(e,"type","text"),p(e,"class","txt-mono"),e.value="Loading...",e.disabled=!0},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function wO(n){let e,t,i;var l=n[3];function s(o,r){return{props:{id:o[6],maxHeight:"500",language:"json",value:o[2]}}}return l&&(e=It(l,s(n)),e.$on("change",n[5])),{c(){e&&V(e.$$.fragment),t=ye()},m(o,r){e&&H(e,o,r),w(o,t,r),i=!0},p(o,r){if(r&8&&l!==(l=o[3])){if(e){ie();const a=e;A(a.$$.fragment,1,0,()=>{z(a,1)}),le()}l?(e=It(l,s(o)),e.$on("change",o[5]),V(e.$$.fragment),E(e.$$.fragment,1),H(e,t.parentNode,t)):e=null}else if(l){const a={};r&64&&(a.id=o[6]),r&4&&(a.value=o[2]),e.$set(a)}},i(o){i||(e&&E(e.$$.fragment,o),i=!0)},o(o){e&&A(e.$$.fragment,o),i=!1},d(o){o&&v(t),e&&z(e,o)}}}function SO(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m,h,_,g,y,S;function T(L,R){return L[4]?yO:kO}let $=T(n),C=$(n);const O=[wO,vO],D=[];function I(L,R){return L[3]?0:1}return m=I(n),h=D[m]=O[m](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),a=M(),u=b("span"),C.c(),d=M(),h.c(),_=ye(),p(t,"class",i=Un(j.getFieldTypeIcon(n[1].type))+" svelte-p6ecb8"),p(s,"class","txt"),p(u,"class","json-state svelte-p6ecb8"),p(e,"for",c=n[6])},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),k(e,u),C.m(u,null),w(L,d,R),D[m].m(L,R),w(L,_,R),g=!0,y||(S=$e(f=Pe.call(null,u,{position:"left",text:n[4]?"Valid JSON":"Invalid JSON"})),y=!0)},p(L,R){(!g||R&2&&i!==(i=Un(j.getFieldTypeIcon(L[1].type))+" svelte-p6ecb8"))&&p(t,"class",i),(!g||R&2)&&o!==(o=L[1].name+"")&&se(r,o),$!==($=T(L))&&(C.d(1),C=$(L),C&&(C.c(),C.m(u,null))),f&&Mt(f.update)&&R&16&&f.update.call(null,{position:"left",text:L[4]?"Valid JSON":"Invalid JSON"}),(!g||R&64&&c!==(c=L[6]))&&p(e,"for",c);let F=m;m=I(L),m===F?D[m].p(L,R):(ie(),A(D[F],1,1,()=>{D[F]=null}),le(),h=D[m],h?h.p(L,R):(h=D[m]=O[m](L),h.c()),E(h,1),h.m(_.parentNode,_))},i(L){g||(E(h),g=!0)},o(L){A(h),g=!1},d(L){L&&(v(e),v(d),v(_)),C.d(),D[m].d(L),y=!1,S()}}}function $O(n){let e,t;return e=new ce({props:{class:"form-field "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[SO,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&2&&(s.class="form-field "+(i[1].required?"required":"")),l&2&&(s.name=i[1].name),l&223&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Gp(n){return typeof n=="string"&&l0(n)?n:JSON.stringify(typeof n>"u"?null:n,null,2)}function l0(n){try{return JSON.parse(n===""?null:n),!0}catch{}return!1}function TO(n,e,t){let i,{field:l}=e,{value:s=void 0}=e,o,r=Gp(s);Kt(async()=>{try{t(3,o=(await tt(async()=>{const{default:u}=await import("./CodeEditor-BZmYqzs5.js");return{default:u}},__vite__mapDeps([2,1]),import.meta.url)).default)}catch(u){console.warn(u)}});const a=u=>{t(2,r=u.detail),t(0,s=r.trim())};return n.$$set=u=>{"field"in u&&t(1,l=u.field),"value"in u&&t(0,s=u.value)},n.$$.update=()=>{n.$$.dirty&5&&s!==(r==null?void 0:r.trim())&&(t(2,r=Gp(s)),t(0,s=r)),n.$$.dirty&4&&t(4,i=l0(r))},[s,l,r,o,i,a]}class CO extends ge{constructor(e){super(),_e(this,e,TO,$O,me,{field:1,value:0})}}function OO(n){let e,t;return{c(){e=b("i"),p(e,"class","ri-file-line"),p(e,"alt",t=n[0].name)},m(i,l){w(i,e,l)},p(i,l){l&1&&t!==(t=i[0].name)&&p(e,"alt",t)},d(i){i&&v(e)}}}function MO(n){let e,t,i;return{c(){e=b("img"),p(e,"draggable",!1),en(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(l,s){w(l,e,s)},p(l,s){s&4&&!en(e.src,t=l[2])&&p(e,"src",t),s&2&&p(e,"width",l[1]),s&2&&p(e,"height",l[1]),s&1&&i!==(i=l[0].name)&&p(e,"alt",i)},d(l){l&&v(e)}}}function DO(n){let e;function t(s,o){return s[2]?MO:OO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function EO(n,e,t){let i,{file:l}=e,{size:s=50}=e;function o(){j.hasImageExtension(l==null?void 0:l.name)?j.generateThumb(l,s,s).then(r=>{t(2,i=r)}).catch(r=>{t(2,i=""),console.warn("Unable to generate thumb: ",r)}):t(2,i="")}return n.$$set=r=>{"file"in r&&t(0,l=r.file),"size"in r&&t(1,s=r.size)},n.$$.update=()=>{n.$$.dirty&1&&typeof l<"u"&&o()},t(2,i=""),[l,s,i]}class IO extends ge{constructor(e){super(),_e(this,e,EO,DO,me,{file:0,size:1})}}function Xp(n){let e;function t(s,o){return s[4]==="image"?LO:AO}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function AO(n){let e,t;return{c(){e=b("object"),t=Z("Cannot preview the file."),p(e,"title",n[2]),p(e,"data",n[1])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&4&&p(e,"title",i[2]),l&2&&p(e,"data",i[1])},d(i){i&&v(e)}}}function LO(n){let e,t,i;return{c(){e=b("img"),en(e.src,t=n[1])||p(e,"src",t),p(e,"alt",i="Preview "+n[2])},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t=l[1])&&p(e,"src",t),s&4&&i!==(i="Preview "+l[2])&&p(e,"alt",i)},d(l){l&&v(e)}}}function NO(n){var l;let e=(l=n[3])==null?void 0:l.isActive(),t,i=e&&Xp(n);return{c(){i&&i.c(),t=ye()},m(s,o){i&&i.m(s,o),w(s,t,o)},p(s,o){var r;o&8&&(e=(r=s[3])==null?void 0:r.isActive()),e?i?i.p(s,o):(i=Xp(s),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(s){s&&v(t),i&&i.d(s)}}}function PO(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","overlay-close")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ue(n[0])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function FO(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Z(n[2]),i=M(),l=b("i"),s=M(),o=b("div"),r=M(),a=b("button"),a.textContent="Close",p(l,"class","ri-external-link-line"),p(e,"type","button"),p(e,"title",n[2]),p(e,"class","link-hint txt-ellipsis inline-flex"),p(o,"class","flex-fill"),p(a,"type","button"),p(a,"class","btn btn-transparent")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,s,d),w(c,o,d),w(c,r,d),w(c,a,d),u||(f=[K(e,"auxclick",n[5]),K(e,"click",n[5]),K(a,"click",n[0])],u=!0)},p(c,d){d&4&&se(t,c[2]),d&4&&p(e,"title",c[2])},d(c){c&&(v(e),v(s),v(o),v(r),v(a)),u=!1,we(f)}}}function RO(n){let e,t,i={class:"preview preview-"+n[4],btnClose:!1,popup:!0,$$slots:{footer:[FO],header:[PO],default:[NO]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[8](e),e.$on("show",n[9]),e.$on("hide",n[10]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.class="preview preview-"+l[4]),s&8222&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),z(e,l)}}}function qO(n,e,t){let i,l,s,o,r="",a;async function u(g){a=g,a&&(t(1,r=await c()),o==null||o.show())}function f(){return o==null?void 0:o.hide()}async function c(){return typeof a=="function"?await a():await a}async function d(){try{t(1,r=await c()),window.open(r,"_blank","noreferrer,noopener")}catch(g){console.warn("Open in new tab file token failure:",g)}}function m(g){te[g?"unshift":"push"](()=>{o=g,t(3,o)})}function h(g){Ce.call(this,n,g)}function _(g){Ce.call(this,n,g)}return n.$$.update=()=>{n.$$.dirty&2&&t(7,i=r.indexOf("?")),n.$$.dirty&130&&t(2,l=r.substring(r.lastIndexOf("/")+1,i>0?i:void 0)),n.$$.dirty&4&&t(4,s=j.getFileType(l))},[f,r,l,o,s,d,u,i,m,h,_]}class jO extends ge{constructor(e){super(),_e(this,e,qO,RO,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function HO(n){let e,t,i,l,s;function o(u,f){return u[5]==="image"?UO:u[5]==="video"||u[5]==="audio"?BO:VO}let r=o(n),a=r(n);return{c(){e=b("button"),a.c(),p(e,"type","button"),p(e,"draggable",!1),p(e,"class",t="handle thumb "+(n[2]?`thumb-${n[2]}`:"")),p(e,"title",i=(n[8]?"Preview":"Download")+" "+n[1])},m(u,f){w(u,e,f),a.m(e,null),l||(s=K(e,"click",Tn(n[10])),l=!0)},p(u,f){r===(r=o(u))&&a?a.p(u,f):(a.d(1),a=r(u),a&&(a.c(),a.m(e,null))),f&4&&t!==(t="handle thumb "+(u[2]?`thumb-${u[2]}`:""))&&p(e,"class",t),f&258&&i!==(i=(u[8]?"Preview":"Download")+" "+u[1])&&p(e,"title",i)},d(u){u&&v(e),a.d(),l=!1,s()}}}function zO(n){let e,t;return{c(){e=b("div"),p(e,"class",t="thumb "+(n[2]?`thumb-${n[2]}`:""))},m(i,l){w(i,e,l)},p(i,l){l&4&&t!==(t="thumb "+(i[2]?`thumb-${i[2]}`:""))&&p(e,"class",t)},d(i){i&&v(e)}}}function VO(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function BO(n){let e;return{c(){e=b("i"),p(e,"class","ri-video-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function UO(n){let e,t,i,l,s;return{c(){e=b("img"),p(e,"draggable",!1),p(e,"loading","lazy"),en(e.src,t=n[7])||p(e,"src",t),p(e,"alt",n[1]),p(e,"title",i="Preview "+n[1])},m(o,r){w(o,e,r),l||(s=K(e,"error",n[9]),l=!0)},p(o,r){r&128&&!en(e.src,t=o[7])&&p(e,"src",t),r&2&&p(e,"alt",o[1]),r&2&&i!==(i="Preview "+o[1])&&p(e,"title",i)},d(o){o&&v(e),l=!1,s()}}}function Qp(n){let e,t,i={};return e=new jO({props:i}),n[11](e),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}function WO(n){let e,t,i;function l(a,u){return a[4]?zO:HO}let s=l(n),o=s(n),r=n[8]&&Qp(n);return{c(){o.c(),e=M(),r&&r.c(),t=ye()},m(a,u){o.m(a,u),w(a,e,u),r&&r.m(a,u),w(a,t,u),i=!0},p(a,[u]){s===(s=l(a))&&o?o.p(a,u):(o.d(1),o=s(a),o&&(o.c(),o.m(e.parentNode,e))),a[8]?r?(r.p(a,u),u&256&&E(r,1)):(r=Qp(a),r.c(),E(r,1),r.m(t.parentNode,t)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){i||(E(r),i=!0)},o(a){A(r),i=!1},d(a){a&&(v(e),v(t)),o.d(a),r&&r.d(a)}}}function YO(n,e,t){let i,l,{record:s=null}=e,{filename:o=""}=e,{size:r=""}=e,a,u="",f="",c=!0;d();async function d(){t(4,c=!0);try{t(3,f=await re.getAdminFileToken(s.collectionId))}catch(g){console.warn("File token failure:",g)}t(4,c=!1)}function m(){t(7,u="")}const h=async()=>{if(l)try{a==null||a.show(async()=>(t(3,f=await re.getAdminFileToken(s.collectionId)),re.files.getUrl(s,o,{token:f})))}catch(g){console.warn("Preview file token failure:",g)}};function _(g){te[g?"unshift":"push"](()=>{a=g,t(6,a)})}return n.$$set=g=>{"record"in g&&t(0,s=g.record),"filename"in g&&t(1,o=g.filename),"size"in g&&t(2,r=g.size)},n.$$.update=()=>{n.$$.dirty&2&&t(5,i=j.getFileType(o)),n.$$.dirty&34&&t(8,l=["image","audio","video"].includes(i)||o.endsWith(".pdf")),n.$$.dirty&27&&t(7,u=c?"":re.files.getUrl(s,o,{thumb:"100x100",token:f}))},[s,o,r,f,c,i,a,u,l,m,h,_]}class Xa extends ge{constructor(e){super(),_e(this,e,YO,WO,me,{record:0,filename:1,size:2})}}function xp(n,e,t){const i=n.slice();return i[31]=e[t],i[33]=t,i}function em(n,e,t){const i=n.slice();i[36]=e[t],i[33]=t;const l=i[2].includes(i[36]);return i[37]=l,i}function KO(n){let e,t,i;function l(){return n[19](n[36])}return{c(){e=b("button"),e.innerHTML='<i class="ri-close-line"></i>',p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove")},m(s,o){w(s,e,o),t||(i=[$e(Pe.call(null,e,"Remove file")),K(e,"click",l)],t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,we(i)}}}function JO(n){let e,t,i;function l(){return n[18](n[36])}return{c(){e=b("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-transparent")},m(s,o){w(s,e,o),t||(i=K(e,"click",l),t=!0)},p(s,o){n=s},d(s){s&&v(e),t=!1,i()}}}function ZO(n){let e,t,i,l,s,o,r=n[36]+"",a,u,f,c,d,m,h;i=new Xa({props:{record:n[3],filename:n[36]}});function _(){return n[16](n[36])}function g(){return n[17](n[36])}function y($,C){return $[37]?JO:KO}let S=y(n),T=S(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),o=b("button"),a=Z(r),f=M(),c=b("div"),T.c(),x(t,"fade",n[37]),p(o,"type","button"),p(o,"draggable",!1),p(o,"class",u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")),p(o,"title","Download"),p(s,"class","content"),p(c,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[34]),x(e,"dragover",n[35])},m($,C){w($,e,C),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),k(o,a),k(e,f),k(e,c),T.m(c,null),d=!0,m||(h=[K(o,"auxclick",_),K(o,"click",g)],m=!0)},p($,C){n=$;const O={};C[0]&8&&(O.record=n[3]),C[0]&32&&(O.filename=n[36]),i.$set(O),(!d||C[0]&36)&&x(t,"fade",n[37]),(!d||C[0]&32)&&r!==(r=n[36]+"")&&se(a,r),(!d||C[0]&36&&u!==(u="txt-ellipsis "+(n[37]?"txt-strikethrough link-hint":"link-primary")))&&p(o,"class",u),S===(S=y(n))&&T?T.p(n,C):(T.d(1),T=S(n),T&&(T.c(),T.m(c,null))),(!d||C[1]&8)&&x(e,"dragging",n[34]),(!d||C[1]&16)&&x(e,"dragover",n[35])},i($){d||(E(i.$$.fragment,$),d=!0)},o($){A(i.$$.fragment,$),d=!1},d($){$&&v(e),z(i),T.d(),m=!1,we(h)}}}function tm(n,e){let t,i,l,s;function o(a){e[20](a)}let r={group:e[4].name+"_uploaded",index:e[33],disabled:!e[6],$$slots:{default:[ZO,({dragging:a,dragover:u})=>({34:a,35:u}),({dragging:a,dragover:u})=>[0,(a?8:0)|(u?16:0)]]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.list=e[0]),i=new Is({props:r}),te.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_uploaded"),u[0]&32&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&44|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.list=e[0],ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function GO(n){let e,t,i,l,s,o,r,a,u=n[31].name+"",f,c,d,m,h,_,g;i=new IO({props:{file:n[31]}});function y(){return n[21](n[33])}return{c(){e=b("div"),t=b("figure"),V(i.$$.fragment),l=M(),s=b("div"),o=b("small"),o.textContent="New",r=M(),a=b("span"),f=Z(u),d=M(),m=b("button"),m.innerHTML='<i class="ri-close-line"></i>',p(t,"class","thumb"),p(o,"class","label label-success m-r-5"),p(a,"class","txt"),p(s,"class","filename m-r-auto"),p(s,"title",c=n[31].name),p(m,"type","button"),p(m,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(e,"class","list-item"),x(e,"dragging",n[34]),x(e,"dragover",n[35])},m(S,T){w(S,e,T),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),k(s,r),k(s,a),k(a,f),k(e,d),k(e,m),h=!0,_||(g=[$e(Pe.call(null,m,"Remove file")),K(m,"click",y)],_=!0)},p(S,T){n=S;const $={};T[0]&2&&($.file=n[31]),i.$set($),(!h||T[0]&2)&&u!==(u=n[31].name+"")&&se(f,u),(!h||T[0]&2&&c!==(c=n[31].name))&&p(s,"title",c),(!h||T[1]&8)&&x(e,"dragging",n[34]),(!h||T[1]&16)&&x(e,"dragover",n[35])},i(S){h||(E(i.$$.fragment,S),h=!0)},o(S){A(i.$$.fragment,S),h=!1},d(S){S&&v(e),z(i),_=!1,we(g)}}}function nm(n,e){let t,i,l,s;function o(a){e[22](a)}let r={group:e[4].name+"_new",index:e[33],disabled:!e[6],$$slots:{default:[GO,({dragging:a,dragover:u})=>({34:a,35:u}),({dragging:a,dragover:u})=>[0,(a?8:0)|(u?16:0)]]},$$scope:{ctx:e}};return e[1]!==void 0&&(r.list=e[1]),i=new Is({props:r}),te.push(()=>be(i,"list",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&16&&(f.group=e[4].name+"_new"),u[0]&2&&(f.index=e[33]),u[0]&64&&(f.disabled=!e[6]),u[0]&2|u[1]&280&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&2&&(l=!0,f.list=e[1],ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function XO(n){let e,t,i,l,s,o=n[4].name+"",r,a,u,f,c=[],d=new Map,m,h=[],_=new Map,g,y,S,T,$,C,O,D,I,L,R,F,N=fe(n[5]);const P=Y=>Y[36]+Y[3].id;for(let Y=0;Y<N.length;Y+=1){let J=em(n,N,Y),B=P(J);d.set(B,c[Y]=tm(B,J))}let q=fe(n[1]);const U=Y=>Y[31].name+Y[33];for(let Y=0;Y<q.length;Y+=1){let J=xp(n,q,Y),B=U(J);_.set(B,h[Y]=nm(B,J))}return{c(){var Y,J;e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),f=b("div");for(let B=0;B<c.length;B+=1)c[B].c();m=M();for(let B=0;B<h.length;B+=1)h[B].c();g=M(),y=b("div"),S=b("input"),$=M(),C=b("button"),O=b("i"),D=M(),I=b("span"),I.textContent="Upload new file",p(t,"class",i=j.getFieldTypeIcon(n[4].type)),p(s,"class","txt"),p(e,"for",a=n[30]),p(S,"type","file"),p(S,"class","hidden"),p(S,"accept",T=((J=(Y=n[4].options)==null?void 0:Y.mimeTypes)==null?void 0:J.join(","))||null),S.multiple=n[6],p(O,"class","ri-upload-cloud-line"),p(I,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-transparent btn-sm btn-block"),C.disabled=n[10],p(y,"class","list-item list-item-btn"),p(f,"class","list")},m(Y,J){w(Y,e,J),k(e,t),k(e,l),k(e,s),k(s,r),w(Y,u,J),w(Y,f,J);for(let B=0;B<c.length;B+=1)c[B]&&c[B].m(f,null);k(f,m);for(let B=0;B<h.length;B+=1)h[B]&&h[B].m(f,null);k(f,g),k(f,y),k(y,S),n[23](S),k(y,$),k(y,C),k(C,O),k(C,D),k(C,I),n[26](f),L=!0,R||(F=[K(S,"change",n[24]),K(C,"click",n[25])],R=!0)},p(Y,J){var B,W;(!L||J[0]&16&&i!==(i=j.getFieldTypeIcon(Y[4].type)))&&p(t,"class",i),(!L||J[0]&16)&&o!==(o=Y[4].name+"")&&se(r,o),(!L||J[0]&1073741824&&a!==(a=Y[30]))&&p(e,"for",a),J[0]&39037|J[1]&24&&(N=fe(Y[5]),ie(),c=at(c,J,P,1,Y,N,d,f,At,tm,m,em),le()),J[0]&8274|J[1]&24&&(q=fe(Y[1]),ie(),h=at(h,J,U,1,Y,q,_,f,At,nm,g,xp),le()),(!L||J[0]&16&&T!==(T=((W=(B=Y[4].options)==null?void 0:B.mimeTypes)==null?void 0:W.join(","))||null))&&p(S,"accept",T),(!L||J[0]&64)&&(S.multiple=Y[6]),(!L||J[0]&1024)&&(C.disabled=Y[10])},i(Y){if(!L){for(let J=0;J<N.length;J+=1)E(c[J]);for(let J=0;J<q.length;J+=1)E(h[J]);L=!0}},o(Y){for(let J=0;J<c.length;J+=1)A(c[J]);for(let J=0;J<h.length;J+=1)A(h[J]);L=!1},d(Y){Y&&(v(e),v(u),v(f));for(let J=0;J<c.length;J+=1)c[J].d();for(let J=0;J<h.length;J+=1)h[J].d();n[23](null),n[26](null),R=!1,we(F)}}}function QO(n){let e,t,i,l,s;return t=new ce({props:{class:`
|
||
form-field form-field-list form-field-file
|
||
`+(n[4].required?"required":"")+`
|
||
`+(n[9]?"dragover":"")+`
|
||
`,name:n[4].name,$$slots:{default:[XO,({uniqueId:o})=>({30:o}),({uniqueId:o})=>[o?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(t,e,null),i=!0,l||(s=[K(e,"dragover",Ue(n[27])),K(e,"dragleave",n[28]),K(e,"drop",n[14])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
|
||
form-field form-field-list form-field-file
|
||
`+(o[4].required?"required":"")+`
|
||
`+(o[9]?"dragover":"")+`
|
||
`),r[0]&16&&(a.name=o[4].name),r[0]&1073743359|r[1]&256&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(E(t.$$.fragment,o),i=!0)},o(o){A(t.$$.fragment,o),i=!1},d(o){o&&v(e),z(t),l=!1,we(s)}}}function xO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1;function h(J){j.removeByValue(f,J),t(2,f)}function _(J){j.pushUnique(f,J),t(2,f)}function g(J){j.isEmpty(u[J])||u.splice(J,1),t(1,u)}function y(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function S(J){var W,pe;J.preventDefault(),t(9,m=!1);const B=((W=J.dataTransfer)==null?void 0:W.files)||[];if(!(s||!B.length)){for(const ee of B){const ue=l.length+u.length-f.length;if(((pe=r.options)==null?void 0:pe.maxSelect)<=ue)break;u.push(ee)}t(1,u)}}async function T(J){try{let B=await re.getAdminFileToken(o.collectionId),W=re.files.getUrl(o,J,{token:B});window.open(W,"_blank","noreferrer,noopener")}catch(B){console.warn("Download file token failure:",B)}}const $=J=>T(J),C=J=>T(J),O=J=>h(J),D=J=>_(J);function I(J){a=J,t(0,a),t(6,i),t(4,r)}const L=J=>g(J);function R(J){u=J,t(1,u)}function F(J){te[J?"unshift":"push"](()=>{c=J,t(7,c)})}const N=()=>{for(let J of c.files)u.push(J);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function q(J){te[J?"unshift":"push"](()=>{d=J,t(8,d)})}const U=()=>{t(9,m=!0)},Y=()=>{t(9,m=!1)};return n.$$set=J=>{"record"in J&&t(3,o=J.record),"field"in J&&t(4,r=J.field),"value"in J&&t(0,a=J.value),"uploadedFiles"in J&&t(1,u=J.uploadedFiles),"deletedFileNames"in J&&t(2,f=J.deletedFileNames)},n.$$.update=()=>{var J,B;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((J=r.options)==null?void 0:J.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(10,s=(l.length||u.length)&&((B=r.options)==null?void 0:B.maxSelect)<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&y()},[a,u,f,o,r,l,i,c,d,m,s,h,_,g,S,T,$,C,O,D,I,L,R,F,N,P,q,U,Y]}class eM extends ge{constructor(e){super(),_e(this,e,xO,QO,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function im(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function tM(n,e){e=im(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=im(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function lm(n,e,t){const i=n.slice();i[6]=e[t];const l=j.toArray(i[0][i[6]]).slice(0,5);return i[7]=l,i}function sm(n,e,t){const i=n.slice();return i[10]=e[t],i}function om(n){let e,t;return e=new Xa({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[10]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function rm(n){let e=!j.isEmpty(n[10]),t,i,l=e&&om(n);return{c(){l&&l.c(),t=ye()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&3&&(e=!j.isEmpty(s[10])),e?l?(l.p(s,o),o&3&&E(l,1)):(l=om(s),l.c(),E(l,1),l.m(t.parentNode,t)):l&&(ie(),A(l,1,1,()=>{l=null}),le())},i(s){i||(E(l),i=!0)},o(s){A(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function am(n){let e,t,i=fe(n[7]),l=[];for(let o=0;o<i.length;o+=1)l[o]=rm(sm(n,i,o));const s=o=>A(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ye()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&3){i=fe(o[7]);let a;for(a=0;a<i.length;a+=1){const u=sm(o,i,a);l[a]?(l[a].p(u,r),E(l[a],1)):(l[a]=rm(u),l[a].c(),E(l[a],1),l[a].m(e.parentNode,e))}for(ie(),a=i.length;a<l.length;a+=1)s(a);le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)A(l[r]);t=!1},d(o){o&&v(e),ot(l,o)}}}function nM(n){let e,t,i,l,s,o,r=j.truncate(j.displayValue(n[0],n[2]),70)+"",a,u,f,c,d=fe(n[1]),m=[];for(let _=0;_<d.length;_+=1)m[_]=am(lm(n,d,_));const h=_=>A(m[_],1,1,()=>{m[_]=null});return{c(){e=b("div"),t=b("i"),l=M();for(let _=0;_<m.length;_+=1)m[_].c();s=M(),o=b("span"),a=Z(r),p(t,"class","link-hint txt-sm ri-information-line"),p(o,"class","txt txt-ellipsis"),p(e,"class","record-info svelte-q8liga")},m(_,g){w(_,e,g),k(e,t),k(e,l);for(let y=0;y<m.length;y+=1)m[y]&&m[y].m(e,null);k(e,s),k(e,o),k(o,a),u=!0,f||(c=$e(i=Pe.call(null,t,{text:j.truncate(JSON.stringify(j.truncateObject(n[0]),null,2),800,!0),class:"code",position:"left"})),f=!0)},p(_,[g]){if(i&&Mt(i.update)&&g&1&&i.update.call(null,{text:j.truncate(JSON.stringify(j.truncateObject(_[0]),null,2),800,!0),class:"code",position:"left"}),g&3){d=fe(_[1]);let y;for(y=0;y<d.length;y+=1){const S=lm(_,d,y);m[y]?(m[y].p(S,g),E(m[y],1)):(m[y]=am(S),m[y].c(),E(m[y],1),m[y].m(e,s))}for(ie(),y=d.length;y<m.length;y+=1)h(y);le()}(!u||g&5)&&r!==(r=j.truncate(j.displayValue(_[0],_[2]),70)+"")&&se(a,r)},i(_){if(!u){for(let g=0;g<d.length;g+=1)E(m[g]);u=!0}},o(_){m=m.filter(Boolean);for(let g=0;g<m.length;g+=1)A(m[g]);u=!1},d(_){_&&v(e),ot(m,_),f=!1,c()}}}function iM(n,e,t){let i,l;We(n,Rn,u=>t(4,l=u));let{record:s}=e,o=[],r=[];function a(){const u=(i==null?void 0:i.schema)||[];if(t(1,o=u.filter(f=>f.presentable&&f.type=="file").map(f=>f.name)),t(2,r=u.filter(f=>f.presentable&&f.type!="file").map(f=>f.name)),!o.length&&!r.length){const f=u.find(c=>{var d,m,h;return c.type=="file"&&((d=c.options)==null?void 0:d.maxSelect)==1&&((h=(m=c.options)==null?void 0:m.mimeTypes)==null?void 0:h.find(_=>_.startsWith("image/")))});f&&o.push(f.name)}}return n.$$set=u=>{"record"in u&&t(0,s=u.record)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=l==null?void 0:l.find(u=>u.id==(s==null?void 0:s.collectionId))),n.$$.dirty&8&&i&&a()},[s,o,r,i,l]}class er extends ge{constructor(e){super(),_e(this,e,iM,nM,me,{record:0})}}function um(n,e,t){const i=n.slice();return i[49]=e[t],i[51]=t,i}function fm(n,e,t){const i=n.slice();i[49]=e[t];const l=i[9](i[49]);return i[6]=l,i}function cm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<div class="txt">New record</div>',p(e,"type","button"),p(e,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[31]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function dm(n){let e,t=!n[13]&&pm(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[13]?t&&(t.d(1),t=null):t?t.p(i,l):(t=pm(i),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function pm(n){var s;let e,t,i,l=((s=n[2])==null?void 0:s.length)&&mm(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","list-item")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[2])!=null&&a.length?l?l.p(o,r):(l=mm(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function mm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[35]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function lM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-blank-circle-line txt-disabled")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function sM(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function hm(n){let e,t,i,l;function s(){return n[32](n[49])}return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-pencil-line"></i>',p(t,"type","button"),p(t,"class","btn btn-sm btn-circle btn-transparent btn-hint m-l-auto"),p(e,"class","actions nonintrusive")},m(o,r){w(o,e,r),k(e,t),i||(l=[$e(Pe.call(null,t,"Edit")),K(t,"keydown",Tn(n[27])),K(t,"click",Tn(s))],i=!0)},p(o,r){n=o},d(o){o&&v(e),i=!1,we(l)}}}function _m(n,e){let t,i,l,s,o,r,a,u;function f(g,y){return g[6]?sM:lM}let c=f(e),d=c(e);s=new er({props:{record:e[49]}});let m=!e[11]&&hm(e);function h(){return e[33](e[49])}function _(...g){return e[34](e[49],...g)}return{key:n,first:null,c(){t=b("div"),d.c(),i=M(),l=b("div"),V(s.$$.fragment),o=M(),m&&m.c(),p(l,"class","content"),p(t,"tabindex","0"),p(t,"class","list-item handle"),x(t,"selected",e[6]),x(t,"disabled",!e[6]&&e[4]>1&&!e[10]),this.first=t},m(g,y){w(g,t,y),d.m(t,null),k(t,i),k(t,l),H(s,l,null),k(t,o),m&&m.m(t,null),r=!0,a||(u=[K(t,"click",h),K(t,"keydown",_)],a=!0)},p(g,y){e=g,c!==(c=f(e))&&(d.d(1),d=c(e),d&&(d.c(),d.m(t,i)));const S={};y[0]&256&&(S.record=e[49]),s.$set(S),e[11]?m&&(m.d(1),m=null):m?m.p(e,y):(m=hm(e),m.c(),m.m(t,null)),(!r||y[0]&768)&&x(t,"selected",e[6]),(!r||y[0]&1808)&&x(t,"disabled",!e[6]&&e[4]>1&&!e[10])},i(g){r||(E(s.$$.fragment,g),r=!0)},o(g){A(s.$$.fragment,g),r=!1},d(g){g&&v(t),d.d(),z(s),m&&m.d(),a=!1,we(u)}}}function gm(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="block txt-center"><span class="loader loader-sm active"></span></div>',p(e,"class","list-item")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function bm(n){let e,t=n[6].length+"",i,l,s,o;return{c(){e=Z("("),i=Z(t),l=Z(" of MAX "),s=Z(n[4]),o=Z(")")},m(r,a){w(r,e,a),w(r,i,a),w(r,l,a),w(r,s,a),w(r,o,a)},p(r,a){a[0]&64&&t!==(t=r[6].length+"")&&se(i,t),a[0]&16&&se(s,r[4])},d(r){r&&(v(e),v(i),v(l),v(s),v(o))}}}function oM(n){let e;return{c(){e=b("p"),e.textContent="No selected records.",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function rM(n){let e,t,i=fe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=km(um(n,i,o));const s=o=>A(l[o],1,1,()=>{l[o]=null});return{c(){e=b("div");for(let o=0;o<l.length;o+=1)l[o].c();p(e,"class","selected-list svelte-1u8jhky")},m(o,r){w(o,e,r);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null);t=!0},p(o,r){if(r[0]&65600|r[1]&6291456){i=fe(o[6]);let a;for(a=0;a<i.length;a+=1){const u=um(o,i,a);l[a]?(l[a].p(u,r),E(l[a],1)):(l[a]=km(u),l[a].c(),E(l[a],1),l[a].m(e,null))}for(ie(),a=i.length;a<l.length;a+=1)s(a);le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)A(l[r]);t=!1},d(o){o&&v(e),ot(l,o)}}}function aM(n){let e,t,i,l,s,o,r,a;t=new er({props:{record:n[49]}});function u(){return n[37](n[49])}return{c(){e=b("span"),V(t.$$.fragment),i=M(),l=b("button"),l.innerHTML='<i class="ri-close-line"></i>',s=M(),p(l,"type","button"),p(l,"title","Remove"),p(l,"class","btn btn-circle btn-transparent btn-hint btn-xs"),p(e,"class","label"),x(e,"label-danger",n[52]),x(e,"label-warning",n[53])},m(f,c){w(f,e,c),H(t,e,null),k(e,i),k(e,l),w(f,s,c),o=!0,r||(a=K(l,"click",u),r=!0)},p(f,c){n=f;const d={};c[0]&64&&(d.record=n[49]),t.$set(d),(!o||c[1]&2097152)&&x(e,"label-danger",n[52]),(!o||c[1]&4194304)&&x(e,"label-warning",n[53])},i(f){o||(E(t.$$.fragment,f),o=!0)},o(f){A(t.$$.fragment,f),o=!1},d(f){f&&(v(e),v(s)),z(t),r=!1,a()}}}function km(n){let e,t,i;function l(o){n[38](o)}let s={index:n[51],$$slots:{default:[aM,({dragging:o,dragover:r})=>({52:o,53:r}),({dragging:o,dragover:r})=>[0,(o?2097152:0)|(r?4194304:0)]]},$$scope:{ctx:n}};return n[6]!==void 0&&(s.list=n[6]),e=new Is({props:s}),te.push(()=>be(e,"list",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&64|r[1]&39845888&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&64&&(t=!0,a.list=o[6],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function uM(n){let e,t,i,l,s,o=[],r=new Map,a,u,f,c,d,m,h,_,g,y,S,T;t=new Ms({props:{value:n[2],autocompleteCollection:n[5]}}),t.$on("submit",n[30]);let $=!n[11]&&cm(n),C=fe(n[8]);const O=P=>P[49].id;for(let P=0;P<C.length;P+=1){let q=fm(n,C,P),U=O(q);r.set(U,o[P]=_m(U,q))}let D=null;C.length||(D=dm(n));let I=n[13]&&gm(),L=n[4]>1&&bm(n);const R=[rM,oM],F=[];function N(P,q){return P[6].length?0:1}return h=N(n),_=F[h]=R[h](n),{c(){e=b("div"),V(t.$$.fragment),i=M(),$&&$.c(),l=M(),s=b("div");for(let P=0;P<o.length;P+=1)o[P].c();D&&D.c(),a=M(),I&&I.c(),f=M(),c=b("h5"),d=Z(`Selected
|
||
`),L&&L.c(),m=M(),_.c(),g=ye(),p(e,"class","flex m-b-base flex-gap-10"),p(s,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(P,q){w(P,e,q),H(t,e,null),k(e,i),$&&$.m(e,null),w(P,l,q),w(P,s,q);for(let U=0;U<o.length;U+=1)o[U]&&o[U].m(s,null);D&&D.m(s,null),k(s,a),I&&I.m(s,null),w(P,f,q),w(P,c,q),k(c,d),L&&L.m(c,null),w(P,m,q),F[h].m(P,q),w(P,g,q),y=!0,S||(T=$e(u=tM.call(null,s,n[36])),S=!0)},p(P,q){const U={};q[0]&4&&(U.value=P[2]),q[0]&32&&(U.autocompleteCollection=P[5]),t.$set(U),P[11]?$&&($.d(1),$=null):$?$.p(P,q):($=cm(P),$.c(),$.m(e,null)),q[0]&143252&&(C=fe(P[8]),ie(),o=at(o,q,O,1,P,C,r,s,At,_m,a,fm),le(),!C.length&&D?D.p(P,q):C.length?D&&(D.d(1),D=null):(D=dm(P),D.c(),D.m(s,a))),P[13]?I||(I=gm(),I.c(),I.m(s,null)):I&&(I.d(1),I=null),u&&Mt(u.update)&&q[0]&4104&&u.update.call(null,P[36]),P[4]>1?L?L.p(P,q):(L=bm(P),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let Y=h;h=N(P),h===Y?F[h].p(P,q):(ie(),A(F[Y],1,1,()=>{F[Y]=null}),le(),_=F[h],_?_.p(P,q):(_=F[h]=R[h](P),_.c()),E(_,1),_.m(g.parentNode,g))},i(P){if(!y){E(t.$$.fragment,P);for(let q=0;q<C.length;q+=1)E(o[q]);E(_),y=!0}},o(P){A(t.$$.fragment,P);for(let q=0;q<o.length;q+=1)A(o[q]);A(_),y=!1},d(P){P&&(v(e),v(l),v(s),v(f),v(c),v(m),v(g)),z(t),$&&$.d();for(let q=0;q<o.length;q+=1)o[q].d();D&&D.d(),I&&I.d(),L&&L.d(),F[h].d(P),S=!1,T()}}}function fM(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=Z("Select "),i=b("strong"),s=Z(l),o=Z(" records")},m(a,u){w(a,e,u),k(e,t),k(e,i),k(i,s),k(e,o)},p(a,u){var f;u[0]&32&&l!==(l=(((f=a[5])==null?void 0:f.name)||"")+"")&&se(s,l)},d(a){a&&v(e)}}}function cM(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=M(),i=b("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function dM(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[cM],header:[fM],default:[uM]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Ae(o,s[a]);e=new Gt({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new xa({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),l=!0},p(a,u){const f=u[0]&524288?dt(s,[s[0],s[1],Dt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){l||(E(e.$$.fragment,a),E(i.$$.fragment,a),l=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),l=!1},d(a){a&&v(t),n[39](null),z(e,a),n[42](null),z(i,a)}}}const no=50;function pM(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=Xe(e,c),m;We(n,Rn,Se=>t(26,m=Se));const h=lt(),_="picker_"+j.randomString(5);let{value:g}=e,{field:y}=e,S,T,$="",C=[],O=[],D=1,I=0,L=!1,R=!1;function F(){return t(2,$=""),t(8,C=[]),t(6,O=[]),P(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function P(){const Se=j.toArray(g);if(!l||!Se.length)return;t(24,R=!0);let Ye=[];const zt=Se.slice(),dn=[];for(;zt.length>0;){const an=[];for(const qn of zt.splice(0,no))an.push(`id="${qn}"`);dn.push(re.collection(l).getFullList({batch:no,filter:an.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(an=>{Ye=Ye.concat(...an)}),t(6,O=[]);for(const an of Se){const qn=j.findByKey(Ye,"id",an);qn&&O.push(qn)}$.trim()||t(8,C=j.filterDuplicatesByKey(O.concat(C))),t(24,R=!1)}catch(an){an.isAbort||(re.error(an),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&($.trim()?t(8,C=[]):t(8,C=j.toArray(O).slice()));try{const Ye=Se?1:D+1,zt=j.getAllCollectionIdentifiers(s),dn=await re.collection(l).getList(Ye,no,{filter:j.normalizeSearchFilter($,zt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(dn.items))),D=dn.page,t(23,I=dn.items.length),t(3,L=!1)}catch(Ye){Ye.isAbort||(re.error(Ye),t(3,L=!1))}}}function U(Se){i==1?t(6,O=[Se]):u&&(j.pushOrReplaceByKey(O,Se),t(6,O))}function Y(Se){j.removeByKey(O,"id",Se.id),t(6,O)}function J(Se){f(Se)?Y(Se):U(Se)}function B(){var Se;i!=1?t(20,g=O.map(Ye=>Ye.id)):t(20,g=((Se=O==null?void 0:O[0])==null?void 0:Se.id)||""),h("save",O),N()}function W(Se){Ce.call(this,n,Se)}const pe=()=>N(),ee=()=>B(),ue=Se=>t(2,$=Se.detail),Oe=()=>T==null?void 0:T.show(),He=Se=>T==null?void 0:T.show(Se.id),Je=Se=>J(Se),xe=(Se,Ye)=>{(Ye.code==="Enter"||Ye.code==="Space")&&(Ye.preventDefault(),Ye.stopPropagation(),J(Se))},bt=()=>t(2,$=""),kt=()=>{a&&!L&&q()},yt=Se=>Y(Se);function Ot(Se){O=Se,t(6,O)}function Ee(Se){te[Se?"unshift":"push"](()=>{S=Se,t(1,S)})}function Le(Se){Ce.call(this,n,Se)}function ze(Se){Ce.call(this,n,Se)}function _t(Se){te[Se?"unshift":"push"](()=>{T=Se,t(7,T)})}const de=Se=>{j.removeByKey(C,"id",Se.detail.record.id),C.unshift(Se.detail.record),t(8,C),U(Se.detail.record)},ve=Se=>{j.removeByKey(C,"id",Se.detail.id),t(8,C),Y(Se.detail)};return n.$$set=Se=>{e=Ae(Ae({},e),Yt(Se)),t(19,d=Xe(e,c)),"value"in Se&&t(20,g=Se.value),"field"in Se&&t(21,y=Se.field)},n.$$.update=()=>{var Se,Ye;n.$$.dirty[0]&2097152&&t(4,i=((Se=y==null?void 0:y.options)==null?void 0:Se.maxSelect)||null),n.$$.dirty[0]&2097152&&t(25,l=(Ye=y==null?void 0:y.options)==null?void 0:Ye.collectionId),n.$$.dirty[0]&100663296&&t(5,s=m.find(zt=>zt.id==l)||null),n.$$.dirty[0]&6&&typeof $<"u"&&S!=null&&S.isActive()&&q(!0),n.$$.dirty[0]&32&&t(11,o=(s==null?void 0:s.type)==="view"),n.$$.dirty[0]&16777224&&t(13,r=L||R),n.$$.dirty[0]&8388608&&t(12,a=I==no),n.$$.dirty[0]&80&&t(10,u=i===null||i>O.length),n.$$.dirty[0]&64&&t(9,f=function(zt){return j.findByKey(O,"id",zt.id)})},[N,S,$,L,i,s,O,T,C,f,u,o,a,r,q,U,Y,J,B,d,g,y,F,I,R,l,m,W,pe,ee,ue,Oe,He,Je,xe,bt,kt,yt,Ot,Ee,Le,ze,_t,de,ve]}class mM extends ge{constructor(e){super(),_e(this,e,pM,dM,me,{value:20,field:21,show:22,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[22]}get hide(){return this.$$.ctx[0]}}function ym(n,e,t){const i=n.slice();return i[21]=e[t],i[23]=t,i}function vm(n,e,t){const i=n.slice();return i[26]=e[t],i}function wm(n){let e,t,i,l;return{c(){e=b("i"),p(e,"class","ri-error-warning-line link-hint m-l-auto flex-order-10")},m(s,o){w(s,e,o),i||(l=$e(t=Pe.call(null,e,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+n[6].join(", ")})),i=!0)},p(s,o){t&&Mt(t.update)&&o&64&&t.update.call(null,{position:"left",text:"The following relation ids were removed from the list because they are missing or invalid: "+s[6].join(", ")})},d(s){s&&v(e),i=!1,l()}}}function Sm(n){let e,t=n[5]&&$m(n);return{c(){t&&t.c(),e=ye()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[5]?t?t.p(i,l):(t=$m(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},d(i){i&&v(e),t&&t.d(i)}}}function $m(n){let e,t=fe(j.toArray(n[0]).slice(0,10)),i=[];for(let l=0;l<t.length;l+=1)i[l]=Tm(vm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&1){t=fe(j.toArray(l[0]).slice(0,10));let o;for(o=0;o<t.length;o+=1){const r=vm(l,t,o);i[o]?i[o].p(r,s):(i[o]=Tm(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&v(e),ot(i,l)}}}function Tm(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="skeleton-loader"></div> ',p(e,"class","list-item")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function hM(n){let e,t,i,l,s,o,r,a,u,f;i=new er({props:{record:n[21]}});function c(){return n[11](n[21])}return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),o=b("button"),o.innerHTML='<i class="ri-close-line"></i>',r=M(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(s,"class","actions"),p(e,"class","list-item"),x(e,"dragging",n[24]),x(e,"dragover",n[25])},m(d,m){w(d,e,m),k(e,t),H(i,t,null),k(e,l),k(e,s),k(s,o),w(d,r,m),a=!0,u||(f=[$e(Pe.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(d,m){n=d;const h={};m&16&&(h.record=n[21]),i.$set(h),(!a||m&16777216)&&x(e,"dragging",n[24]),(!a||m&33554432)&&x(e,"dragover",n[25])},i(d){a||(E(i.$$.fragment,d),a=!0)},o(d){A(i.$$.fragment,d),a=!1},d(d){d&&(v(e),v(r)),z(i),u=!1,we(f)}}}function Cm(n,e){let t,i,l,s;function o(a){e[12](a)}let r={group:e[2].name+"_relation",index:e[23],disabled:!e[7],$$slots:{default:[hM,({dragging:a,dragover:u})=>({24:a,25:u}),({dragging:a,dragover:u})=>(a?16777216:0)|(u?33554432:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Is({props:r}),te.push(()=>be(i,"list",o)),i.$on("sort",e[13]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[23]),u&128&&(f.disabled=!e[7]),u&587202576&&(f.$$scope={dirty:u,ctx:e}),!l&&u&16&&(l=!0,f.list=e[4],ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function _M(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m=[],h=new Map,_,g,y,S,T,$,C=n[6].length&&wm(n),O=fe(n[4]);const D=L=>L[21].id;for(let L=0;L<O.length;L+=1){let R=ym(n,O,L),F=D(R);h.set(F,m[L]=Cm(F,R))}let I=null;return O.length||(I=Sm(n)),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),a=M(),C&&C.c(),f=M(),c=b("div"),d=b("div");for(let L=0;L<m.length;L+=1)m[L].c();I&&I.c(),_=M(),g=b("div"),y=b("button"),y.innerHTML='<i class="ri-magic-line"></i> <span class="txt">Open picker</span>',p(t,"class",i=Un(j.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(s,"class","txt"),p(e,"for",u=n[20]),p(d,"class","relations-list svelte-1ynw0pc"),p(y,"type","button"),p(y,"class","btn btn-transparent btn-sm btn-block"),p(g,"class","list-item list-item-btn"),p(c,"class","list")},m(L,R){w(L,e,R),k(e,t),k(e,l),k(e,s),k(s,r),k(e,a),C&&C.m(e,null),w(L,f,R),w(L,c,R),k(c,d);for(let F=0;F<m.length;F+=1)m[F]&&m[F].m(d,null);I&&I.m(d,null),k(c,_),k(c,g),k(g,y),S=!0,T||($=K(y,"click",n[14]),T=!0)},p(L,R){(!S||R&4&&i!==(i=Un(j.getFieldTypeIcon(L[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!S||R&4)&&o!==(o=L[2].name+"")&&se(r,o),L[6].length?C?C.p(L,R):(C=wm(L),C.c(),C.m(e,null)):C&&(C.d(1),C=null),(!S||R&1048576&&u!==(u=L[20]))&&p(e,"for",u),R&50332597&&(O=fe(L[4]),ie(),m=at(m,R,D,1,L,O,h,d,At,Cm,null,ym),le(),!O.length&&I?I.p(L,R):O.length?I&&(I.d(1),I=null):(I=Sm(L),I.c(),I.m(d,null)))},i(L){if(!S){for(let R=0;R<O.length;R+=1)E(m[R]);S=!0}},o(L){for(let R=0;R<m.length;R+=1)A(m[R]);S=!1},d(L){L&&(v(e),v(f),v(c)),C&&C.d();for(let R=0;R<m.length;R+=1)m[R].d();I&&I.d(),T=!1,$()}}}function gM(n){let e,t,i,l,s={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[_M,({uniqueId:r})=>({20:r}),({uniqueId:r})=>r?1048576:0]},$$scope:{ctx:n}};e=new ce({props:s}),n[15](e);let o={value:n[0],field:n[2]};return i=new mM({props:o}),n[16](i),i.$on("save",n[17]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),l=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&537919735&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){l||(E(e.$$.fragment,r),E(i.$$.fragment,r),l=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),l=!1},d(r){r&&v(t),n[15](null),z(e,r),n[16](null),z(i,r)}}}const Om=100;function bM(n,e,t){let i,{field:l}=e,{value:s}=e,{picker:o}=e,r,a=[],u=!1,f,c=[];function d(){if(u)return!1;const D=j.toArray(s);return t(4,a=a.filter(I=>D.includes(I.id))),D.length!=a.length}async function m(){var R,F;const D=j.toArray(s);if(t(4,a=[]),t(6,c=[]),!((R=l==null?void 0:l.options)!=null&&R.collectionId)||!D.length){t(5,u=!1);return}t(5,u=!0);const I=D.slice(),L=[];for(;I.length>0;){const N=[];for(const P of I.splice(0,Om))N.push(`id="${P}"`);L.push(re.collection((F=l==null?void 0:l.options)==null?void 0:F.collectionId).getFullList(Om,{filter:N.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{let N=[];await Promise.all(L).then(P=>{N=N.concat(...P)});for(const P of D){const q=j.findByKey(N,"id",P);q?a.push(q):c.push(P)}t(4,a),_()}catch(N){re.error(N)}t(5,u=!1)}function h(D){j.removeByKey(a,"id",D.id),t(4,a),_()}function _(){var D;i?t(0,s=a.map(I=>I.id)):t(0,s=((D=a[0])==null?void 0:D.id)||"")}Ss(()=>{clearTimeout(f)});const g=D=>h(D);function y(D){a=D,t(4,a)}const S=()=>{_()},T=()=>o==null?void 0:o.show();function $(D){te[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){te[D?"unshift":"push"](()=>{o=D,t(1,o)})}const O=D=>{var I;t(4,a=D.detail||[]),t(0,s=i?a.map(L=>L.id):((I=a[0])==null?void 0:I.id)||"")};return n.$$set=D=>{"field"in D&&t(2,l=D.field),"value"in D&&t(0,s=D.value),"picker"in D&&t(1,o=D.picker)},n.$$.update=()=>{var D;n.$$.dirty&4&&t(7,i=((D=l.options)==null?void 0:D.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&1041&&d()&&(t(5,u=!0),clearTimeout(f),t(10,f=setTimeout(m,0)))},[s,o,l,r,a,u,c,i,h,_,f,g,y,S,T,$,C,O]}class kM extends ge{constructor(e){super(),_e(this,e,bM,gM,me,{field:2,value:0,picker:1})}}function yM(n){let e;return{c(){e=b("textarea"),p(e,"id",n[0]),O0(e,"visibility","hidden")},m(t,i){w(t,e,i),n[15](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[15](null)}}}function vM(n){let e;return{c(){e=b("div"),p(e,"id",n[0])},m(t,i){w(t,e,i),n[14](e)},p(t,i){i&1&&p(e,"id",t[0])},d(t){t&&v(e),n[14](null)}}}function wM(n){let e;function t(s,o){return s[1]?vM:yM}let i=t(n),l=i(n);return{c(){e=b("div"),l.c(),p(e,"class",n[2])},m(s,o){w(s,e,o),l.m(e,null),n[16](e)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null))),o&4&&p(e,"class",s[2])},i:Q,o:Q,d(s){s&&v(e),l.d(),n[16](null)}}}function SM(){let n={listeners:[],scriptLoaded:!1,injected:!1};function e(i,l,s){n.injected=!0;const o=i.createElement("script");o.referrerPolicy="origin",o.type="application/javascript",o.src=l,o.onload=()=>{s()},i.head&&i.head.appendChild(o)}function t(i,l,s){n.scriptLoaded?s():(n.listeners.push(s),n.injected||e(i,l,()=>{n.listeners.forEach(o=>o()),n.scriptLoaded=!0}))}return{load:t}}let $M=SM();function Pr(){return window&&window.tinymce?window.tinymce:null}function TM(n,e,t){let{id:i="tinymce_svelte"+j.randomString(7)}=e,{inline:l=void 0}=e,{disabled:s=!1}=e,{scriptSrc:o="./libs/tinymce/tinymce.min.js"}=e,{conf:r={}}=e,{modelEvents:a="change input undo redo"}=e,{value:u=""}=e,{text:f=""}=e,{cssClass:c="tinymce-wrapper"}=e;const d=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],m=(I,L)=>{d.forEach(R=>{I.on(R,F=>{L(R.toLowerCase(),{eventName:R,event:F,editor:I})})})};let h,_,g,y=u,S=s;const T=lt();function $(){const I={...r,target:_,inline:l!==void 0?l:r.inline!==void 0?r.inline:!1,readonly:s,setup:L=>{t(11,g=L),L.on("init",()=>{L.setContent(u),L.on(a,()=>{t(12,y=L.getContent()),y!==u&&(t(5,u=y),t(6,f=L.getContent({format:"text"})))})}),m(L,T),typeof r.setup=="function"&&r.setup(L)}};t(4,_.style.visibility="",_),Pr().init(I)}Kt(()=>(Pr()!==null?$():$M.load(h.ownerDocument,o,()=>{h&&$()}),()=>{var I,L;try{g&&((I=g.dom)==null||I.unbind(document),(L=Pr())==null||L.remove(g))}catch{}}));function C(I){te[I?"unshift":"push"](()=>{_=I,t(4,_)})}function O(I){te[I?"unshift":"push"](()=>{_=I,t(4,_)})}function D(I){te[I?"unshift":"push"](()=>{h=I,t(3,h)})}return n.$$set=I=>{"id"in I&&t(0,i=I.id),"inline"in I&&t(1,l=I.inline),"disabled"in I&&t(7,s=I.disabled),"scriptSrc"in I&&t(8,o=I.scriptSrc),"conf"in I&&t(9,r=I.conf),"modelEvents"in I&&t(10,a=I.modelEvents),"value"in I&&t(5,u=I.value),"text"in I&&t(6,f=I.text),"cssClass"in I&&t(2,c=I.cssClass)},n.$$.update=()=>{var I;if(n.$$.dirty&14496)try{g&&y!==u&&(g.setContent(u),t(6,f=g.getContent({format:"text"}))),g&&s!==S&&(t(13,S=s),typeof((I=g.mode)==null?void 0:I.set)=="function"?g.mode.set(s?"readonly":"design"):g.setMode(s?"readonly":"design"))}catch(L){console.warn("TinyMCE reactive error:",L)}},[i,l,c,h,_,u,f,s,o,r,a,g,y,S,C,O,D]}class Qa extends ge{constructor(e){super(),_e(this,e,TM,wM,me,{id:0,inline:1,disabled:7,scriptSrc:8,conf:9,modelEvents:10,value:5,text:6,cssClass:2})}}function Mm(n,e,t){const i=n.slice();i[44]=e[t];const l=i[19](i[44]);return i[45]=l,i}function Dm(n,e,t){const i=n.slice();return i[48]=e[t],i}function Em(n,e,t){const i=n.slice();return i[51]=e[t],i}function CM(n){let e,t,i=[],l=new Map,s,o,r,a,u,f,c,d,m,h,_,g=fe(n[7]);const y=S=>S[51].id;for(let S=0;S<g.length;S+=1){let T=Em(n,g,S),$=y(T);l.set($,i[S]=Im($,T))}return a=new Ms({props:{value:n[4],placeholder:"Record search term or filter...",autocompleteCollection:n[8]}}),a.$on("submit",n[30]),d=new Zo({props:{class:"files-list",vThreshold:100,$$slots:{default:[AM]},$$scope:{ctx:n}}}),d.$on("vScrollEnd",n[32]),{c(){e=b("div"),t=b("aside");for(let S=0;S<i.length;S+=1)i[S].c();s=M(),o=b("div"),r=b("div"),V(a.$$.fragment),u=M(),f=b("button"),f.innerHTML='<div class="txt">New record</div>',c=M(),V(d.$$.fragment),p(t,"class","file-picker-sidebar"),p(f,"type","button"),p(f,"class","btn btn-pill btn-transparent btn-hint p-l-xs p-r-xs"),p(r,"class","flex m-b-base flex-gap-10"),p(o,"class","file-picker-content"),p(e,"class","file-picker")},m(S,T){w(S,e,T),k(e,t);for(let $=0;$<i.length;$+=1)i[$]&&i[$].m(t,null);k(e,s),k(e,o),k(o,r),H(a,r,null),k(r,u),k(r,f),k(o,c),H(d,o,null),m=!0,h||(_=K(f,"click",n[31]),h=!0)},p(S,T){T[0]&384&&(g=fe(S[7]),i=at(i,T,y,1,S,g,l,t,Li,Im,null,Em));const $={};T[0]&16&&($.value=S[4]),T[0]&256&&($.autocompleteCollection=S[8]),a.$set($);const C={};T[0]&98416|T[1]&8388608&&(C.$$scope={dirty:T,ctx:S}),d.$set(C)},i(S){m||(E(a.$$.fragment,S),E(d.$$.fragment,S),m=!0)},o(S){A(a.$$.fragment,S),A(d.$$.fragment,S),m=!1},d(S){S&&v(e);for(let T=0;T<i.length;T+=1)i[T].d();z(a),z(d),h=!1,_()}}}function OM(n){let e;return{c(){e=b("h6"),e.innerHTML="You currently don't have any collection with <code>file</code> field.",p(e,"class","txt-center txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Im(n,e){let t,i=e[51].name+"",l,s,o,r;function a(){return e[29](e[51])}return{key:n,first:null,c(){var u;t=b("button"),l=Z(i),s=M(),p(t,"type","button"),p(t,"class","sidebar-item"),x(t,"active",((u=e[8])==null?void 0:u.id)==e[51].id),this.first=t},m(u,f){w(u,t,f),k(t,l),k(t,s),o||(r=K(t,"click",Ue(a)),o=!0)},p(u,f){var c;e=u,f[0]&128&&i!==(i=e[51].name+"")&&se(l,i),f[0]&384&&x(t,"active",((c=e[8])==null?void 0:c.id)==e[51].id)},d(u){u&&v(t),o=!1,r()}}}function MM(n){var s;let e,t,i,l=((s=n[4])==null?void 0:s.length)&&Am(n);return{c(){e=b("div"),t=b("span"),t.textContent="No records with images found.",i=M(),l&&l.c(),p(t,"class","txt txt-hint"),p(e,"class","inline-flex")},m(o,r){w(o,e,r),k(e,t),k(e,i),l&&l.m(e,null)},p(o,r){var a;(a=o[4])!=null&&a.length?l?l.p(o,r):(l=Am(o),l.c(),l.m(e,null)):l&&(l.d(1),l=null)},d(o){o&&v(e),l&&l.d()}}}function DM(n){let e=[],t=new Map,i,l=fe(n[5]);const s=o=>o[44].id;for(let o=0;o<l.length;o+=1){let r=Mm(n,l,o),a=s(r);t.set(a,e[o]=Nm(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&1638432&&(l=fe(o[5]),e=at(e,r,s,1,o,l,t,i.parentNode,Li,Nm,i,Mm))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function Am(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear filter</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",Ue(n[17])),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function EM(n){let e;return{c(){e=b("i"),p(e,"class","ri-file-3-line")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function IM(n){let e,t,i;return{c(){e=b("img"),p(e,"loading","lazy"),en(e.src,t=re.files.getUrl(n[44],n[48],{thumb:"100x100"}))||p(e,"src",t),p(e,"alt",i=n[48])},m(l,s){w(l,e,s)},p(l,s){s[0]&32&&!en(e.src,t=re.files.getUrl(l[44],l[48],{thumb:"100x100"}))&&p(e,"src",t),s[0]&32&&i!==(i=l[48])&&p(e,"alt",i)},d(l){l&&v(e)}}}function Lm(n){let e,t,i,l,s,o;function r(f,c){return c[0]&32&&(t=null),t==null&&(t=!!j.hasImageExtension(f[48])),t?IM:EM}let a=r(n,[-1,-1]),u=a(n);return{c(){e=b("button"),u.c(),i=M(),p(e,"type","button"),p(e,"class","thumb handle"),x(e,"thumb-warning",n[16](n[44],n[48]))},m(f,c){w(f,e,c),u.m(e,null),k(e,i),s||(o=[$e(l=Pe.call(null,e,n[48]+`
|
||
(record: `+n[44].id+")")),K(e,"click",Ue(function(){Mt(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&Mt(l.update)&&c[0]&32&&l.update.call(null,n[48]+`
|
||
(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,we(o)}}}function Nm(n,e){let t,i,l=fe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Lm(Dm(e,l,o));return{key:n,first:null,c(){t=ye();for(let o=0;o<s.length;o+=1)s[o].c();i=ye(),this.first=t},m(o,r){w(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=fe(e[45]);let a;for(a=0;a<l.length;a+=1){const u=Dm(e,l,a);s[a]?s[a].p(u,r):(s[a]=Lm(u),s[a].c(),s[a].m(i.parentNode,i))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&(v(t),v(i)),ot(s,o)}}}function Pm(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function AM(n){let e,t;function i(r,a){if(r[15])return DM;if(!r[6])return MM}let l=i(n),s=l&&l(n),o=n[6]&&Pm();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ye()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Pm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function LM(n){let e,t,i,l;const s=[OM,CM],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function NM(n){let e,t;return{c(){e=b("h4"),t=Z(n[0])},m(i,l){w(i,e,l),k(e,t)},p(i,l){l[0]&1&&se(t,i[0])},d(i){i&&v(e)}}}function Fm(n){let e,t;return e=new ce({props:{class:"form-field file-picker-size-select",$$slots:{default:[PM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function PM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function FM(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&Fm(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=Z(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(_,g){w(_,e,g),k(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),k(o,r),k(r,a),f=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(_,g){var y;(!f||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((y=_[9])==null?void 0:y.name)),l?m?(m.p(_,g),g[0]&512&&E(m,1)):(m=Fm(_),m.c(),E(m,1),m.m(s.parentNode,s)):m&&(ie(),A(m,1,1,()=>{m=null}),le()),(!f||g[0]&2)&&se(a,_[1]),(!f||g[0]&8192&&u!==(u=!_[13]))&&(o.disabled=u)},i(_){f||(E(m),f=!0)},o(_){A(m),f=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,we(d)}}}function RM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[FM],header:[NM],default:[LM]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Ae(o,s[a]);e=new Gt({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new xa({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?dt(s,[s[0],s[1],Dt(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&256&&(c.collection=a[8]),i.$set(c)},i(a){l||(E(e.$$.fragment,a),E(i.$$.fragment,a),l=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),l=!1},d(a){a&&v(t),n[33](null),z(e,a),n[36](null),z(i,a)}}}const Rm=50;function qM(n,e,t){let i,l,s,o;const r=["title","submitText","fileTypes","show","hide"];let a=Xe(e,r),u;We(n,Rn,Le=>t(27,u=Le));const f=lt(),c="file_picker_"+j.randomString(5);let{title:d="Select a file"}=e,{submitText:m="Insert"}=e,{fileTypes:h=["image","document","video","audio","file"]}=e,_,g,y="",S=[],T=1,$=0,C=!1,O=[],D=[],I=[],L={},R={},F="";function N(){return Y(!0),_==null?void 0:_.show()}function P(){return _==null?void 0:_.hide()}function q(){t(5,S=[]),t(9,R={}),t(12,F="")}function U(){t(4,y="")}async function Y(Le=!1){if(L!=null&&L.id){t(6,C=!0),Le&&q();try{const ze=Le?1:T+1,_t=j.getAllCollectionIdentifiers(L);let de=j.normalizeSearchFilter(y,_t)||"";de&&(de+=" && "),de+="("+D.map(Se=>`${Se.name}:length>0`).join("||")+")";const ve=await re.collection(L.id).getList(ze,Rm,{filter:de,sort:"-created",fields:"*:excerpt(100)",skipTotal:1,requestKey:c+"loadImagePicker"});t(5,S=j.filterDuplicatesByKey(S.concat(ve.items))),T=ve.page,t(26,$=ve.items.length),t(6,C=!1)}catch(ze){ze.isAbort||(re.error(ze),t(6,C=!1))}}}function J(){var ze,_t;let Le=["100x100"];if((ze=R==null?void 0:R.record)!=null&&ze.id){for(const de of D)if(j.toArray(R.record[de.name]).includes(R.name)){Le=Le.concat(j.toArray((_t=de.options)==null?void 0:_t.thumbs));break}}t(11,I=[{label:"Original size",value:""}]);for(const de of Le)I.push({label:`${de} thumb`,value:de});F&&!Le.includes(F)&&t(12,F="")}function B(Le){let ze=[];for(const _t of D){const de=j.toArray(Le[_t.name]);for(const ve of de)h.includes(j.getFileType(ve))&&ze.push(ve)}return ze}function W(Le,ze){t(9,R={record:Le,name:ze})}function pe(){o&&(f("submit",Object.assign({size:F},R)),P())}function ee(Le){F=Le,t(12,F)}const ue=Le=>{t(8,L=Le)},Oe=Le=>t(4,y=Le.detail),He=()=>g==null?void 0:g.show(),Je=()=>{s&&Y()};function xe(Le){te[Le?"unshift":"push"](()=>{_=Le,t(3,_)})}function bt(Le){Ce.call(this,n,Le)}function kt(Le){Ce.call(this,n,Le)}function yt(Le){te[Le?"unshift":"push"](()=>{g=Le,t(10,g)})}const Ot=Le=>{j.removeByKey(S,"id",Le.detail.record.id),S.unshift(Le.detail.record),t(5,S);const ze=B(Le.detail.record);ze.length>0&&W(Le.detail.record,ze[0])},Ee=Le=>{var ze;((ze=R==null?void 0:R.record)==null?void 0:ze.id)==Le.detail.id&&t(9,R={}),j.removeByKey(S,"id",Le.detail.id),t(5,S)};return n.$$set=Le=>{e=Ae(Ae({},e),Yt(Le)),t(22,a=Xe(e,r)),"title"in Le&&t(0,d=Le.title),"submitText"in Le&&t(1,m=Le.submitText),"fileTypes"in Le&&t(24,h=Le.fileTypes)},n.$$.update=()=>{var Le;n.$$.dirty[0]&134217728&&t(7,O=u.filter(ze=>ze.type!=="view"&&!!j.toArray(ze.schema).find(_t=>{var de,ve,Se,Ye,zt;return _t.type==="file"&&!((de=_t.options)!=null&&de.protected)&&(!((Se=(ve=_t.options)==null?void 0:ve.mimeTypes)!=null&&Se.length)||!!((zt=(Ye=_t.options)==null?void 0:Ye.mimeTypes)!=null&&zt.find(dn=>dn.startsWith("image/"))))}))),n.$$.dirty[0]&384&&!(L!=null&&L.id)&&O.length>0&&t(8,L=O[0]),n.$$.dirty[0]&256&&(D=(Le=L==null?void 0:L.schema)==null?void 0:Le.filter(ze=>{var _t;return ze.type==="file"&&!((_t=ze.options)!=null&&_t.protected)})),n.$$.dirty[0]&256&&L!=null&&L.id&&(U(),J()),n.$$.dirty[0]&512&&R!=null&&R.name&&J(),n.$$.dirty[0]&280&&typeof y<"u"&&L!=null&&L.id&&_!=null&&_.isActive()&&Y(!0),n.$$.dirty[0]&512&&t(16,i=(ze,_t)=>{var de;return(R==null?void 0:R.name)==_t&&((de=R==null?void 0:R.record)==null?void 0:de.id)==ze.id}),n.$$.dirty[0]&32&&t(15,l=S.find(ze=>B(ze).length>0)),n.$$.dirty[0]&67108928&&t(14,s=!C&&$==Rm),n.$$.dirty[0]&576&&t(13,o=!C&&!!(R!=null&&R.name))},[d,m,P,_,y,S,C,O,L,R,g,I,F,o,s,l,i,U,Y,B,W,pe,a,c,h,N,$,u,ee,ue,Oe,He,Je,xe,bt,kt,yt,Ot,Ee]}class jM extends ge{constructor(e){super(),_e(this,e,qM,RM,me,{title:0,submitText:1,fileTypes:24,show:25,hide:2},null,[-1,-1])}get show(){return this.$$.ctx[25]}get hide(){return this.$$.ctx[2]}}function HM(n){let e;return{c(){e=b("div"),p(e,"class","tinymce-wrapper")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function zM(n){let e,t,i;function l(o){n[6](o)}let s={id:n[11],conf:n[5]};return n[0]!==void 0&&(s.value=n[0]),e=new Qa({props:s}),te.push(()=>be(e,"value",l)),e.$on("init",n[7]),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r&2048&&(a.id=o[11]),r&32&&(a.conf=o[5]),!t&&r&1&&(t=!0,a.value=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function VM(n){let e,t,i,l,s,o=n[1].name+"",r,a,u,f,c,d,m;const h=[zM,HM],_=[];function g(y,S){return y[4]?0:1}return f=g(n),c=_[f]=h[f](n),{c(){e=b("label"),t=b("i"),l=M(),s=b("span"),r=Z(o),u=M(),c.c(),d=ye(),p(t,"class",i=j.getFieldTypeIcon(n[1].type)),p(s,"class","txt"),p(e,"for",a=n[11])},m(y,S){w(y,e,S),k(e,t),k(e,l),k(e,s),k(s,r),w(y,u,S),_[f].m(y,S),w(y,d,S),m=!0},p(y,S){(!m||S&2&&i!==(i=j.getFieldTypeIcon(y[1].type)))&&p(t,"class",i),(!m||S&2)&&o!==(o=y[1].name+"")&&se(r,o),(!m||S&2048&&a!==(a=y[11]))&&p(e,"for",a);let T=f;f=g(y),f===T?_[f].p(y,S):(ie(),A(_[T],1,1,()=>{_[T]=null}),le(),c=_[f],c?c.p(y,S):(c=_[f]=h[f](y),c.c()),E(c,1),c.m(d.parentNode,d))},i(y){m||(E(c),m=!0)},o(y){A(c),m=!1},d(y){y&&(v(e),v(u),v(d)),_[f].d(y)}}}function BM(n){let e,t,i,l;e=new ce({props:{class:"form-field form-field-editor "+(n[1].required?"required":""),name:n[1].name,$$slots:{default:[VM,({uniqueId:o})=>({11:o}),({uniqueId:o})=>o?2048:0]},$$scope:{ctx:n}}});let s={title:"Select an image",fileTypes:["image"]};return i=new jM({props:s}),n[8](i),i.$on("submit",n[9]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(o,r){H(e,o,r),w(o,t,r),H(i,o,r),l=!0},p(o,[r]){const a={};r&2&&(a.class="form-field form-field-editor "+(o[1].required?"required":"")),r&2&&(a.name=o[1].name),r&6207&&(a.$$scope={dirty:r,ctx:o}),e.$set(a);const u={};i.$set(u)},i(o){l||(E(e.$$.fragment,o),E(i.$$.fragment,o),l=!0)},o(o){A(e.$$.fragment,o),A(i.$$.fragment,o),l=!1},d(o){o&&v(t),z(e,o),n[8](null),z(i,o)}}}function UM(n,e,t){let i,{field:l}=e,{value:s=""}=e,o,r,a=!1,u=null;Kt(async()=>(typeof s>"u"&&t(0,s=""),u=setTimeout(()=>{t(4,a=!0)},100),()=>{clearTimeout(u)}));function f(h){s=h,t(0,s)}const c=h=>{t(3,r=h.detail.editor),r.on("collections_file_picker",()=>{o==null||o.show()})};function d(h){te[h?"unshift":"push"](()=>{o=h,t(2,o)})}const m=h=>{r==null||r.execCommand("InsertImage",!1,re.files.getUrl(h.detail.record,h.detail.name,{thumb:h.detail.size}))};return n.$$set=h=>{"field"in h&&t(1,l=h.field),"value"in h&&t(0,s=h.value)},n.$$.update=()=>{var h;n.$$.dirty&2&&t(5,i=Object.assign(j.defaultEditorOptions(),{convert_urls:(h=l.options)==null?void 0:h.convertUrls,relative_urls:!1})),n.$$.dirty&1&&typeof s>"u"&&t(0,s="")},[s,l,o,r,a,i,f,c,d,m]}class WM extends ge{constructor(e){super(),_e(this,e,UM,BM,me,{field:1,value:0})}}function YM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].authUrl),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].authUrl&&oe(s,u[0].authUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function KM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].tokenUrl),r||(a=K(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].tokenUrl&&oe(s,u[0].tokenUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function JM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[3]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].userApiUrl),r||(a=K(s,"input",n[7]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&8&&(s.required=u[3]),f&1&&s.value!==u[0].userApiUrl&&oe(s,u[0].userApiUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function ZM(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".authUrl",$$slots:{default:[YM,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[KM,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field "+(n[3]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[JM,({uniqueId:f})=>({8:f}),({uniqueId:f})=>f?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=Z(n[2]),i=M(),V(l.$$.fragment),s=M(),V(o.$$.fragment),r=M(),V(a.$$.fragment),p(e,"class","section-title")},m(f,c){w(f,e,c),k(e,t),w(f,i,c),H(l,f,c),w(f,s,c),H(o,f,c),w(f,r,c),H(a,f,c),u=!0},p(f,[c]){(!u||c&4)&&se(t,f[2]);const d={};c&8&&(d.class="form-field "+(f[3]?"required":"")),c&2&&(d.name=f[1]+".authUrl"),c&777&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c&8&&(m.class="form-field "+(f[3]?"required":"")),c&2&&(m.name=f[1]+".tokenUrl"),c&777&&(m.$$scope={dirty:c,ctx:f}),o.$set(m);const h={};c&8&&(h.class="form-field "+(f[3]?"required":"")),c&2&&(h.name=f[1]+".userApiUrl"),c&777&&(h.$$scope={dirty:c,ctx:f}),a.$set(h)},i(f){u||(E(l.$$.fragment,f),E(o.$$.fragment,f),E(a.$$.fragment,f),u=!0)},o(f){A(l.$$.fragment,f),A(o.$$.fragment,f),A(a.$$.fragment,f),u=!1},d(f){f&&(v(e),v(i),v(s),v(r)),z(l,f),z(o,f),z(a,f)}}}function GM(n,e,t){let i,{key:l=""}=e,{config:s={}}=e,{required:o=!1}=e,{title:r="Provider endpoints"}=e;function a(){s.authUrl=this.value,t(0,s)}function u(){s.tokenUrl=this.value,t(0,s)}function f(){s.userApiUrl=this.value,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config),"required"in c&&t(4,o=c.required),"title"in c&&t(2,r=c.title)},n.$$.update=()=>{n.$$.dirty&17&&t(3,i=o&&(s==null?void 0:s.enabled))},[s,l,r,i,o,a,u,f]}class Fr extends ge{constructor(e){super(),_e(this,e,GM,ZM,me,{key:1,config:0,required:4,title:2})}}function XM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Display name"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","text"),p(s,"id",o=n[8]),s.required=n[2]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].displayName),r||(a=K(s,"input",n[3]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&4&&(s.required=u[2]),f&1&&s.value!==u[0].displayName&&oe(s,u[0].displayName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function QM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Auth URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].authUrl),r||(a=K(s,"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(s,"id",o),f&4&&(s.required=u[2]),f&1&&s.value!==u[0].authUrl&&oe(s,u[0].authUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function xM(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Token URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].tokenUrl),r||(a=K(s,"input",n[5]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&4&&(s.required=u[2]),f&1&&s.value!==u[0].tokenUrl&&oe(s,u[0].tokenUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function e8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("User API URL"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","url"),p(s,"id",o=n[8]),s.required=n[2]},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].userApiUrl),r||(a=K(s,"input",n[6]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(s,"id",o),f&4&&(s.required=u[2]),f&1&&s.value!==u[0].userApiUrl&&oe(s,u[0].userApiUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function t8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Support PKCE",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].pkce,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[7]),$e(Pe.call(null,r,{text:"Usually it should be safe to be always enabled as most providers will just ignore the extra query parameters if they don't support PKCE.",position:"right"}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].pkce),d&256&&a!==(a=c[8])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function n8(n){let e,t,i,l,s,o,r,a,u,f,c,d;return e=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".displayName",$$slots:{default:[XM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".authUrl",$$slots:{default:[QM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[xM,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field "+(n[2]?"required":""),name:n[1]+".userApiUrl",$$slots:{default:[e8,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),c=new ce({props:{class:"form-field",name:n[1]+".pkce",$$slots:{default:[t8,({uniqueId:m})=>({8:m}),({uniqueId:m})=>m?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),i=b("div"),i.textContent="Endpoints",l=M(),V(s.$$.fragment),o=M(),V(r.$$.fragment),a=M(),V(u.$$.fragment),f=M(),V(c.$$.fragment),p(i,"class","section-title")},m(m,h){H(e,m,h),w(m,t,h),w(m,i,h),w(m,l,h),H(s,m,h),w(m,o,h),H(r,m,h),w(m,a,h),H(u,m,h),w(m,f,h),H(c,m,h),d=!0},p(m,[h]){const _={};h&4&&(_.class="form-field "+(m[2]?"required":"")),h&2&&(_.name=m[1]+".displayName"),h&773&&(_.$$scope={dirty:h,ctx:m}),e.$set(_);const g={};h&4&&(g.class="form-field "+(m[2]?"required":"")),h&2&&(g.name=m[1]+".authUrl"),h&773&&(g.$$scope={dirty:h,ctx:m}),s.$set(g);const y={};h&4&&(y.class="form-field "+(m[2]?"required":"")),h&2&&(y.name=m[1]+".tokenUrl"),h&773&&(y.$$scope={dirty:h,ctx:m}),r.$set(y);const S={};h&4&&(S.class="form-field "+(m[2]?"required":"")),h&2&&(S.name=m[1]+".userApiUrl"),h&773&&(S.$$scope={dirty:h,ctx:m}),u.$set(S);const T={};h&2&&(T.name=m[1]+".pkce"),h&769&&(T.$$scope={dirty:h,ctx:m}),c.$set(T)},i(m){d||(E(e.$$.fragment,m),E(s.$$.fragment,m),E(r.$$.fragment,m),E(u.$$.fragment,m),E(c.$$.fragment,m),d=!0)},o(m){A(e.$$.fragment,m),A(s.$$.fragment,m),A(r.$$.fragment,m),A(u.$$.fragment,m),A(c.$$.fragment,m),d=!1},d(m){m&&(v(t),v(i),v(l),v(o),v(a),v(f)),z(e,m),z(s,m),z(r,m),z(u,m),z(c,m)}}}function i8(n,e,t){let i,{key:l=""}=e,{config:s={}}=e;j.isEmpty(s.pkce)&&(s.pkce=!0),s.displayName||(s.displayName="OIDC");function o(){s.displayName=this.value,t(0,s)}function r(){s.authUrl=this.value,t(0,s)}function a(){s.tokenUrl=this.value,t(0,s)}function u(){s.userApiUrl=this.value,t(0,s)}function f(){s.pkce=this.checked,t(0,s)}return n.$$set=c=>{"key"in c&&t(1,l=c.key),"config"in c&&t(0,s=c.config)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=!!s.enabled)},[s,l,i,o,r,a,u,f]}class Rr extends ge{constructor(e){super(),_e(this,e,i8,n8,me,{key:1,config:0})}}function l8(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Z("Auth URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/authorize",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[0].authUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[2]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].authUrl&&oe(s,d[0].authUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function s8(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Z("Token URL"),l=M(),s=b("input"),a=M(),u=b("div"),u.textContent="Eg. https://login.microsoftonline.com/YOUR_DIRECTORY_TENANT_ID/oauth2/v2.0/token",p(e,"for",i=n[4]),p(s,"type","url"),p(s,"id",o=n[4]),s.required=r=n[0].enabled,p(u,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[0].tokenUrl),w(d,a,m),w(d,u,m),f||(c=K(s,"input",n[3]),f=!0)},p(d,m){m&16&&i!==(i=d[4])&&p(e,"for",i),m&16&&o!==(o=d[4])&&p(s,"id",o),m&1&&r!==(r=d[0].enabled)&&(s.required=r),m&1&&s.value!==d[0].tokenUrl&&oe(s,d[0].tokenUrl)},d(d){d&&(v(e),v(l),v(s),v(a),v(u)),f=!1,c()}}}function o8(n){let e,t,i,l,s,o;return i=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".authUrl",$$slots:{default:[l8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field "+(n[0].enabled?"required":""),name:n[1]+".tokenUrl",$$slots:{default:[s8,({uniqueId:r})=>({4:r}),({uniqueId:r})=>r?16:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.textContent="Azure AD endpoints",t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment),p(e,"class","section-title")},m(r,a){w(r,e,a),w(r,t,a),H(i,r,a),w(r,l,a),H(s,r,a),o=!0},p(r,[a]){const u={};a&1&&(u.class="form-field "+(r[0].enabled?"required":"")),a&2&&(u.name=r[1]+".authUrl"),a&49&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);const f={};a&1&&(f.class="form-field "+(r[0].enabled?"required":"")),a&2&&(f.name=r[1]+".tokenUrl"),a&49&&(f.$$scope={dirty:a,ctx:r}),s.$set(f)},i(r){o||(E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(e),v(t),v(l)),z(i,r),z(s,r)}}}function r8(n,e,t){let{key:i=""}=e,{config:l={}}=e;function s(){l.authUrl=this.value,t(0,l)}function o(){l.tokenUrl=this.value,t(0,l)}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"config"in r&&t(0,l=r.config)},[l,i,s,o]}class a8 extends ge{constructor(e){super(),_e(this,e,r8,o8,me,{key:1,config:0})}}function u8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[2]),r||(a=K(s,"input",n[12]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&4&&s.value!==u[2]&&oe(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function f8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Team ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[3]),r||(a=K(s,"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(s,"id",o),f&8&&s.value!==u[3]&&oe(s,u[3])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function c8(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Key ID"),l=M(),s=b("input"),p(e,"for",i=n[23]),p(s,"type","text"),p(s,"id",o=n[23]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[4]),r||(a=K(s,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(s,"id",o),f&16&&s.value!==u[4]&&oe(s,u[4])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function d8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="Duration (in seconds)",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(r,"type","text"),p(r,"id",a=n[23]),p(r,"max",ho),r.required=!0},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[6]),u||(f=[$e(Pe.call(null,l,{text:`Max ${ho} seconds (~${ho/(60*60*24*30)<<0} months).`,position:"top"})),K(r,"input",n[15])],u=!0)},p(c,d){d&8388608&&s!==(s=c[23])&&p(e,"for",s),d&8388608&&a!==(a=c[23])&&p(r,"id",a),d&64&&r.value!==c[6]&&oe(r,c[6])},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function p8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Z("Private key"),l=M(),s=b("textarea"),r=M(),a=b("div"),a.textContent="The key is not stored on the server and it is used only for generating the signed JWT.",p(e,"for",i=n[23]),p(s,"id",o=n[23]),s.required=!0,p(s,"rows","8"),p(s,"placeholder",`-----BEGIN PRIVATE KEY-----
|
||
...
|
||
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[5]),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(s,"id",o),d&32&&oe(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function m8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S;return l=new ce({props:{class:"form-field required",name:"clientId",$$slots:{default:[u8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"teamId",$$slots:{default:[f8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field required",name:"keyId",$$slots:{default:[c8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field required",name:"duration",$$slots:{default:[d8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:"privateKey",$$slots:{default:[p8,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("div"),V(r.$$.fragment),a=M(),u=b("div"),V(f.$$.fragment),c=M(),d=b("div"),V(m.$$.fragment),h=M(),V(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(T,$){w(T,e,$),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),k(t,a),k(t,u),H(f,u,null),k(t,c),k(t,d),H(m,d,null),k(t,h),H(_,t,null),g=!0,y||(S=K(e,"submit",Ue(n[17])),y=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const O={};$&25165832&&(O.$$scope={dirty:$,ctx:T}),r.$set(O);const D={};$&25165840&&(D.$$scope={dirty:$,ctx:T}),f.$set(D);const I={};$&25165888&&(I.$$scope={dirty:$,ctx:T}),m.$set(I);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(E(l.$$.fragment,T),E(r.$$.fragment,T),E(f.$$.fragment,T),E(m.$$.fragment,T),E(_.$$.fragment,T),g=!0)},o(T){A(l.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(l),z(r),z(f),z(m),z(_),y=!1,S()}}}function h8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function _8(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Z("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function g8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[_8],header:[h8],default:[m8]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[19](null),z(e,l)}}}const ho=15777e3;function b8(n,e,t){let i;const l=lt(),s="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,u=R.keyId||""),t(5,f=R.privateKey||""),t(6,c=R.duration||ho),Zt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const R=await re.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),Pt("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){re.error(R)}t(7,d=!1)}function g(){r=this.value,t(2,r)}function y(){a=this.value,t(3,a)}function S(){u=this.value,t(4,u)}function T(){c=this.value,t(6,c)}function $(){f=this.value,t(5,f)}const C=()=>_(),O=()=>!d;function D(R){te[R?"unshift":"push"](()=>{o=R,t(1,o)})}function I(R){Ce.call(this,n,R)}function L(R){Ce.call(this,n,R)}return t(8,i=!0),[h,o,r,a,u,f,c,d,i,s,_,m,g,y,S,T,$,C,O,D,I,L]}class k8 extends ge{constructor(e){super(),_e(this,e,b8,g8,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function y8(n){let e,t,i,l,s,o,r,a,u,f,c={};return r=new k8({props:c}),n[4](r),r.$on("submit",n[5]),{c(){e=b("button"),t=b("i"),i=M(),l=b("span"),l.textContent="Generate secret",o=M(),V(r.$$.fragment),p(t,"class","ri-key-line"),p(l,"class","txt"),p(e,"type","button"),p(e,"class",s="btn btn-sm btn-secondary btn-provider-"+n[1])},m(d,m){w(d,e,m),k(e,t),k(e,i),k(e,l),w(d,o,m),H(r,d,m),a=!0,u||(f=K(e,"click",n[3]),u=!0)},p(d,[m]){(!a||m&2&&s!==(s="btn btn-sm btn-secondary btn-provider-"+d[1]))&&p(e,"class",s);const h={};r.$set(h)},i(d){a||(E(r.$$.fragment,d),a=!0)},o(d){A(r.$$.fragment,d),a=!1},d(d){d&&(v(e),v(o)),n[4](null),z(r,d),u=!1,f()}}}function v8(n,e,t){let{key:i=""}=e,{config:l={}}=e,s;const o=()=>s==null?void 0:s.show({clientId:l.clientId});function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{var f;t(0,l.clientSecret=((f=u.detail)==null?void 0:f.secret)||"",l)};return n.$$set=u=>{"key"in u&&t(1,i=u.key),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class w8 extends ge{constructor(e){super(),_e(this,e,v8,y8,me,{key:1,config:0})}}const _o=[{key:"appleAuth",title:"Apple",logo:"apple.svg",optionsComponent:w8},{key:"googleAuth",title:"Google",logo:"google.svg"},{key:"microsoftAuth",title:"Microsoft",logo:"microsoft.svg",optionsComponent:a8},{key:"yandexAuth",title:"Yandex",logo:"yandex.svg"},{key:"facebookAuth",title:"Facebook",logo:"facebook.svg"},{key:"instagramAuth",title:"Instagram",logo:"instagram.svg"},{key:"githubAuth",title:"GitHub",logo:"github.svg"},{key:"gitlabAuth",title:"GitLab",logo:"gitlab.svg",optionsComponent:Fr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"bitbucketAuth",title:"Bitbucket",logo:"bitbucket.svg"},{key:"giteeAuth",title:"Gitee",logo:"gitee.svg"},{key:"giteaAuth",title:"Gitea",logo:"gitea.svg",optionsComponent:Fr,optionsComponentProps:{title:"Self-hosted endpoints (optional)"}},{key:"discordAuth",title:"Discord",logo:"discord.svg"},{key:"twitterAuth",title:"Twitter",logo:"twitter.svg"},{key:"kakaoAuth",title:"Kakao",logo:"kakao.svg"},{key:"vkAuth",title:"VK",logo:"vk.svg"},{key:"spotifyAuth",title:"Spotify",logo:"spotify.svg"},{key:"twitchAuth",title:"Twitch",logo:"twitch.svg"},{key:"patreonAuth",title:"Patreon (v2)",logo:"patreon.svg"},{key:"stravaAuth",title:"Strava",logo:"strava.svg"},{key:"livechatAuth",title:"LiveChat",logo:"livechat.svg"},{key:"mailcowAuth",title:"mailcow",logo:"mailcow.svg",optionsComponent:Fr,optionsComponentProps:{required:!0}},{key:"planningcenterAuth",title:"Planning Center",logo:"planningcenter.svg"},{key:"oidcAuth",title:"OpenID Connect",logo:"oidc.svg",optionsComponent:Rr},{key:"oidc2Auth",title:"(2) OpenID Connect",logo:"oidc.svg",optionsComponent:Rr},{key:"oidc3Auth",title:"(3) OpenID Connect",logo:"oidc.svg",optionsComponent:Rr}];function qm(n,e,t){const i=n.slice();return i[9]=e[t],i}function S8(n){let e;return{c(){e=b("h6"),e.textContent="No linked OAuth2 providers.",p(e,"class","txt-hint txt-center m-t-sm m-b-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $8(n){let e,t=fe(n[1]),i=[];for(let l=0;l<t.length;l+=1)i[l]=jm(qm(n,t,l));return{c(){e=b("div");for(let l=0;l<i.length;l+=1)i[l].c();p(e,"class","list")},m(l,s){w(l,e,s);for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(e,null)},p(l,s){if(s&58){t=fe(l[1]);let o;for(o=0;o<t.length;o+=1){const r=qm(l,t,o);i[o]?i[o].p(r,s):(i[o]=jm(r),i[o].c(),i[o].m(e,null))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(l){l&&v(e),ot(i,l)}}}function T8(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function jm(n){let e,t,i,l,s,o,r=n[4](n[9].provider)+"",a,u,f,c,d=n[9].providerId+"",m,h,_,g,y,S;function T(){return n[6](n[9])}return{c(){var $;e=b("div"),t=b("figure"),i=b("img"),s=M(),o=b("span"),a=Z(r),u=M(),f=b("div"),c=Z("ID: "),m=Z(d),h=M(),_=b("button"),_.innerHTML='<i class="ri-close-line"></i>',g=M(),en(i.src,l="./images/oauth2/"+(($=n[3](n[9].provider))==null?void 0:$.logo))||p(i,"src",l),p(i,"alt","Provider logo"),p(t,"class","provider-logo"),p(o,"class","txt"),p(f,"class","txt-hint"),p(_,"type","button"),p(_,"class","btn btn-transparent link-hint btn-circle btn-sm m-l-auto"),p(e,"class","list-item")},m($,C){w($,e,C),k(e,t),k(t,i),k(e,s),k(e,o),k(o,a),k(e,u),k(e,f),k(f,c),k(f,m),k(e,h),k(e,_),k(e,g),y||(S=K(_,"click",T),y=!0)},p($,C){var O;n=$,C&2&&!en(i.src,l="./images/oauth2/"+((O=n[3](n[9].provider))==null?void 0:O.logo))&&p(i,"src",l),C&2&&r!==(r=n[4](n[9].provider)+"")&&se(a,r),C&2&&d!==(d=n[9].providerId+"")&&se(m,d)},d($){$&&v(e),y=!1,S()}}}function C8(n){let e;function t(s,o){var r;return s[2]?T8:(r=s[0])!=null&&r.id&&s[1].length?$8:S8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function O8(n,e,t){const i=lt();let{record:l}=e,s=[],o=!1;function r(d){return _o.find(m=>m.key==d+"Auth")||{}}function a(d){var m;return((m=r(d))==null?void 0:m.title)||j.sentenize(d,!1)}async function u(){if(!(l!=null&&l.id)){t(1,s=[]),t(2,o=!1);return}t(2,o=!0);try{t(1,s=await re.collection(l.collectionId).listExternalAuths(l.id))}catch(d){re.error(d)}t(2,o=!1)}function f(d){!(l!=null&&l.id)||!d||fn(`Do you really want to unlink the ${a(d)} provider?`,()=>re.collection(l.collectionId).unlinkExternalAuth(l.id,d).then(()=>{Pt(`Successfully unlinked the ${a(d)} provider.`),i("unlink",d),u()}).catch(m=>{re.error(m)}))}u();const c=d=>f(d.provider);return n.$$set=d=>{"record"in d&&t(0,l=d.record)},[l,s,o,r,a,f,c]}class M8 extends ge{constructor(e){super(),_e(this,e,O8,C8,me,{record:0})}}function Hm(n,e,t){const i=n.slice();return i[71]=e[t],i[72]=e,i[73]=t,i}function zm(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-information-line"></i>',l=M(),s=b("div"),o=Z(`The record has previous unsaved changes.
|
||
`),r=b("button"),r.textContent="Restore draft",a=M(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(t,a),k(t,u),k(e,f),k(e,c),m=!0,h||(_=[K(r,"click",n[39]),$e(Pe.call(null,u,"Discard draft")),K(u,"click",Ue(n[40]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=ka(e,et,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,we(_)}}}function Vm(n){let e,t,i;return t=new n0({props:{model:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function D8(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y=!n[6]&&Vm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),y&&y.c(),u=M(),f=b("input"),p(t,"class",Un(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[74]),p(f,"type","text"),p(f,"id",c=n[74]),p(f,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=m=!n[6]},m(S,T){w(S,e,T),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),w(S,a,T),y&&y.m(S,T),w(S,u,T),w(S,f,T),oe(f,n[3].id),h=!0,_||(g=K(f,"input",n[41]),_=!0)},p(S,T){(!h||T[2]&4096&&r!==(r=S[74]))&&p(e,"for",r),S[6]?y&&(ie(),A(y,1,1,()=>{y=null}),le()):y?(y.p(S,T),T[0]&64&&E(y,1)):(y=Vm(S),y.c(),E(y,1),y.m(u.parentNode,u)),(!h||T[2]&4096&&c!==(c=S[74]))&&p(f,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(f.readOnly=m),T[0]&8&&f.value!==S[3].id&&oe(f,S[3].id)},i(S){h||(E(y),h=!0)},o(S){A(y),h=!1},d(S){S&&(v(e),v(a),v(u),v(f)),y&&y.d(S),_=!1,g()}}}function Bm(n){var u,f;let e,t,i,l,s;function o(c){n[42](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new z6({props:r}),te.push(()=>be(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Um();return{c(){V(e.$$.fragment),i=M(),a&&a.c(),l=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var h,_;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=Um(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(E(e.$$.fragment,c),s=!0)},o(c){A(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),z(e,c),a&&a.d(c)}}}function Um(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function E8(n){let e,t,i;function l(o){n[55](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new kM({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function I8(n){let e,t,i,l,s;function o(f){n[52](f,n[71])}function r(f){n[53](f,n[71])}function a(f){n[54](f,n[71])}let u={field:n[71],record:n[3]};return n[3][n[71].name]!==void 0&&(u.value=n[3][n[71].name]),n[4][n[71].name]!==void 0&&(u.uploadedFiles=n[4][n[71].name]),n[5][n[71].name]!==void 0&&(u.deletedFileNames=n[5][n[71].name]),e=new eM({props:u}),te.push(()=>be(e,"value",o)),te.push(()=>be(e,"uploadedFiles",r)),te.push(()=>be(e,"deletedFileNames",a)),{c(){V(e.$$.fragment)},m(f,c){H(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[71]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[71].name],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[71].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[71].name],ke(()=>l=!1)),e.$set(d)},i(f){s||(E(e.$$.fragment,f),s=!0)},o(f){A(e.$$.fragment,f),s=!1},d(f){z(e,f)}}}function A8(n){let e,t,i;function l(o){n[51](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new CO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function L8(n){let e,t,i;function l(o){n[50](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new bO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function N8(n){let e,t,i;function l(o){n[49](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new mO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function P8(n){let e,t,i;function l(o){n[48](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new WM({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function F8(n){let e,t,i;function l(o){n[47](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new fO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function R8(n){let e,t,i;function l(o){n[46](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new oO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function q8(n){let e,t,i;function l(o){n[45](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new nO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function j8(n){let e,t,i;function l(o){n[44](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new Q6({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function H8(n){let e,t,i;function l(o){n[43](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new J6({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function Wm(n,e){let t,i,l,s,o;const r=[H8,j8,q8,R8,F8,P8,N8,L8,A8,I8,E8],a=[];function u(f,c){return f[71].type==="text"?0:f[71].type==="number"?1:f[71].type==="bool"?2:f[71].type==="email"?3:f[71].type==="url"?4:f[71].type==="editor"?5:f[71].type==="date"?6:f[71].type==="select"?7:f[71].type==="json"?8:f[71].type==="file"?9:f[71].type==="relation"?10:-1}return~(i=u(e))&&(l=a[i]=r[i](e)),{key:n,first:null,c(){t=ye(),l&&l.c(),s=ye(),this.first=t},m(f,c){w(f,t,c),~i&&a[i].m(f,c),w(f,s,c),o=!0},p(f,c){e=f;let d=i;i=u(e),i===d?~i&&a[i].p(e,c):(l&&(ie(),A(a[d],1,1,()=>{a[d]=null}),le()),~i?(l=a[i],l?l.p(e,c):(l=a[i]=r[i](e),l.c()),E(l,1),l.m(s.parentNode,s)):l=null)},i(f){o||(E(l),o=!0)},o(f){A(l),o=!1},d(f){f&&(v(t),v(s)),~i&&a[i].d(f)}}}function Ym(n){let e,t,i;return t=new M8({props:{record:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[13]===ys)},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.record=l[3]),t.$set(o),(!i||s[0]&8192)&&x(e,"active",l[13]===ys)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function z8(n){var S;let e,t,i,l,s,o,r=[],a=new Map,u,f,c,d,m=!n[8]&&n[10]&&!n[7]&&zm(n);l=new ce({props:{class:"form-field "+(n[6]?"":"readonly"),name:"id",$$slots:{default:[D8,({uniqueId:T})=>({74:T}),({uniqueId:T})=>[0,0,T?4096:0]]},$$scope:{ctx:n}}});let h=n[14]&&Bm(n),_=fe(((S=n[0])==null?void 0:S.schema)||[]);const g=T=>T[71].name;for(let T=0;T<_.length;T+=1){let $=Hm(n,_,T),C=g($);a.set(C,r[T]=Wm(C,$))}let y=n[14]&&!n[6]&&Ym(n);return{c(){e=b("div"),t=b("form"),m&&m.c(),i=M(),V(l.$$.fragment),s=M(),h&&h.c(),o=M();for(let T=0;T<r.length;T+=1)r[T].c();u=M(),y&&y.c(),p(t,"id",n[17]),p(t,"class","tab-item"),x(t,"no-pointer-events",n[7]),x(t,"active",n[13]===Xi),p(e,"class","tabs-content no-animations")},m(T,$){w(T,e,$),k(e,t),m&&m.m(t,null),k(t,i),H(l,t,null),k(t,s),h&&h.m(t,null),k(t,o);for(let C=0;C<r.length;C+=1)r[C]&&r[C].m(t,null);k(e,u),y&&y.m(e,null),f=!0,c||(d=[K(t,"submit",Ue(n[21])),K(t,"keydown",n[26])],c=!0)},p(T,$){var O;!T[8]&&T[10]&&!T[7]?m?(m.p(T,$),$[0]&1408&&E(m,1)):(m=zm(T),m.c(),E(m,1),m.m(t,i)):m&&(ie(),A(m,1,1,()=>{m=null}),le());const C={};$[0]&64&&(C.class="form-field "+(T[6]?"":"readonly")),$[0]&200|$[2]&12288&&(C.$$scope={dirty:$,ctx:T}),l.$set(C),T[14]?h?(h.p(T,$),$[0]&16384&&E(h,1)):(h=Bm(T),h.c(),E(h,1),h.m(t,o)):h&&(ie(),A(h,1,1,()=>{h=null}),le()),$[0]&57&&(_=fe(((O=T[0])==null?void 0:O.schema)||[]),ie(),r=at(r,$,g,1,T,_,a,t,At,Wm,null,Hm),le()),(!f||$[0]&128)&&x(t,"no-pointer-events",T[7]),(!f||$[0]&8192)&&x(t,"active",T[13]===Xi),T[14]&&!T[6]?y?(y.p(T,$),$[0]&16448&&E(y,1)):(y=Ym(T),y.c(),E(y,1),y.m(e,null)):y&&(ie(),A(y,1,1,()=>{y=null}),le())},i(T){if(!f){E(m),E(l.$$.fragment,T),E(h);for(let $=0;$<_.length;$+=1)E(r[$]);E(y),f=!0}},o(T){A(m),A(l.$$.fragment,T),A(h);for(let $=0;$<r.length;$+=1)A(r[$]);A(y),f=!1},d(T){T&&v(e),m&&m.d(),z(l),h&&h.d();for(let $=0;$<r.length;$+=1)r[$].d();y&&y.d(),c=!1,we(d)}}}function V8(n){var m;let e,t=n[6]?"New":"Edit",i,l,s,o=((m=n[0])==null?void 0:m.name)+"",r,a,u,f,c,d=!n[6]&&Km(n);return{c(){e=b("h4"),i=Z(t),l=M(),s=b("strong"),r=Z(o),a=Z(" record"),u=M(),d&&d.c(),f=ye(),p(e,"class","panel-title svelte-qc5ngu")},m(h,_){w(h,e,_),k(e,i),k(e,l),k(e,s),k(s,r),k(e,a),w(h,u,_),d&&d.m(h,_),w(h,f,_),c=!0},p(h,_){var g;(!c||_[0]&64)&&t!==(t=h[6]?"New":"Edit")&&se(i,t),(!c||_[0]&1)&&o!==(o=((g=h[0])==null?void 0:g.name)+"")&&se(r,o),h[6]?d&&(ie(),A(d,1,1,()=>{d=null}),le()):d?(d.p(h,_),_[0]&64&&E(d,1)):(d=Km(h),d.c(),E(d,1),d.m(f.parentNode,f))},i(h){c||(E(d),c=!0)},o(h){A(d),c=!1},d(h){h&&(v(e),v(u),v(f)),d&&d.d(h)}}}function B8(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("h4"),i.textContent="Loading...",p(e,"class","loader loader-sm"),p(i,"class","panel-title txt-hint svelte-qc5ngu")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,i:Q,o:Q,d(l){l&&(v(e),v(t),v(i))}}}function Km(n){let e,t,i,l,s,o,r;return o=new On({props:{class:"dropdown dropdown-right dropdown-nowrap",$$slots:{default:[U8]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=M(),i=b("div"),l=b("i"),s=M(),V(o.$$.fragment),p(e,"class","flex-fill"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(i,"tabindex","0"),p(i,"role","button"),p(i,"aria-label","More record options"),p(i,"class","btn btn-sm btn-circle btn-transparent flex-gap-0")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),k(i,l),k(i,s),H(o,i,null),r=!0},p(a,u){const f={};u[0]&16388|u[2]&8192&&(f.$$scope={dirty:u,ctx:a}),o.$set(f)},i(a){r||(E(o.$$.fragment,a),r=!0)},o(a){A(o.$$.fragment,a),r=!1},d(a){a&&(v(e),v(t),v(i)),z(o)}}}function Jm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-check-line"></i> <span class="txt">Send verification email</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[33]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Zm(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-lock-line"></i> <span class="txt">Send password reset email</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[34]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function U8(n){let e,t,i,l,s,o,r,a=n[14]&&!n[2].verified&&n[2].email&&Jm(n),u=n[14]&&n[2].email&&Zm(n);return{c(){a&&a.c(),e=M(),u&&u.c(),t=M(),i=b("button"),i.innerHTML='<i class="ri-file-copy-line"></i> <span class="txt">Duplicate</span>',l=M(),s=b("button"),s.innerHTML='<i class="ri-delete-bin-7-line"></i> <span class="txt">Delete</span>',p(i,"type","button"),p(i,"class","dropdown-item closable"),p(i,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item txt-danger closable"),p(s,"role","menuitem")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,l,c),w(f,s,c),o||(r=[K(i,"click",n[35]),K(s,"click",Tn(Ue(n[36])))],o=!0)},p(f,c){f[14]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Jm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[14]&&f[2].email?u?u.p(f,c):(u=Zm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){f&&(v(e),v(t),v(i),v(l),v(s)),a&&a.d(f),u&&u.d(f),o=!1,we(r)}}}function Gm(n){let e,t,i,l,s,o;return{c(){e=b("div"),t=b("button"),t.textContent="Account",i=M(),l=b("button"),l.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),x(t,"active",n[13]===Xi),p(l,"type","button"),p(l,"class","tab-item"),x(l,"active",n[13]===ys),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),s||(o=[K(t,"click",n[37]),K(l,"click",n[38])],s=!0)},p(r,a){a[0]&8192&&x(t,"active",r[13]===Xi),a[0]&8192&&x(l,"active",r[13]===ys)},d(r){r&&v(e),s=!1,we(o)}}}function W8(n){let e,t,i,l,s;const o=[B8,V8],r=[];function a(f,c){return f[7]?0:1}e=a(n),t=r[e]=o[e](n);let u=n[14]&&!n[6]&&Gm(n);return{c(){t.c(),i=M(),u&&u.c(),l=ye()},m(f,c){r[e].m(f,c),w(f,i,c),u&&u.m(f,c),w(f,l,c),s=!0},p(f,c){let d=e;e=a(f),e===d?r[e].p(f,c):(ie(),A(r[d],1,1,()=>{r[d]=null}),le(),t=r[e],t?t.p(f,c):(t=r[e]=o[e](f),t.c()),E(t,1),t.m(i.parentNode,i)),f[14]&&!f[6]?u?u.p(f,c):(u=Gm(f),u.c(),u.m(l.parentNode,l)):u&&(u.d(1),u=null)},i(f){s||(E(t),s=!0)},o(f){A(t),s=!1},d(f){f&&(v(i),v(l)),r[e].d(f),u&&u.d(f)}}}function Y8(n){let e,t,i,l,s,o,r=n[6]?"Create":"Save changes",a,u,f,c;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Z(r),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=i=n[11]||n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[17]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[15]||n[11],x(s,"btn-loading",n[11]||n[7])},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),k(s,o),k(o,a),f||(c=K(e,"click",n[32]),f=!0)},p(d,m){m[0]&2176&&i!==(i=d[11]||d[7])&&(e.disabled=i),m[0]&64&&r!==(r=d[6]?"Create":"Save changes")&&se(a,r),m[0]&34816&&u!==(u=!d[15]||d[11])&&(s.disabled=u),m[0]&2176&&x(s,"btn-loading",d[11]||d[7])},d(d){d&&(v(e),v(l),v(s)),f=!1,c()}}}function K8(n){let e,t,i={class:`
|
||
record-panel
|
||
`+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+`
|
||
`+(n[14]&&!n[6]?"colored-header":"")+`
|
||
`,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[56],$$slots:{footer:[Y8],header:[W8],default:[z8]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[57](e),e.$on("hide",n[58]),e.$on("show",n[59]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=`
|
||
record-panel
|
||
`+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+`
|
||
`+(l[14]&&!l[6]?"colored-header":"")+`
|
||
`),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[56]),s[0]&60925|s[2]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[57](null),z(e,l)}}}const Xi="form",ys="providers";function J8(n,e,t){let i,l,s,o,r;const a=lt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},m={},h=null,_=!1,g=!1,y={},S={},T=JSON.stringify(d),$=T,C=Xi,O=!0,D=!0,I=f;function L(he){return q(he),t(12,g=!0),t(13,C=Xi),c==null?void 0:c.show()}function R(){return c==null?void 0:c.hide()}function F(){t(12,g=!1),R()}function N(){t(30,I=f),c!=null&&c.isActive()&&(B(JSON.stringify(m)),F())}async function P(he){if(he&&typeof he=="string"){try{return await re.collection(f.id).getOne(he)}catch(Me){Me.isAbort||(F(),console.warn("resolveModel:",Me),ii(`Unable to load record with id "${he}"`))}return null}return he}async function q(he){t(7,D=!0),Zt({}),t(4,y={}),t(5,S={}),t(2,d=typeof he=="string"?{id:he,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:he||{}),t(3,m=structuredClone(d)),t(2,d=await P(he)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,h=J()),!h||pe(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,D=!1)}async function U(he){var mt,Jt;Zt({}),t(2,d=he||{}),t(4,y={}),t(5,S={});const Me=((Jt=(mt=f==null?void 0:f.schema)==null?void 0:mt.filter(ut=>ut.type!="file"))==null?void 0:Jt.map(ut=>ut.name))||[];for(let ut in he)Me.includes(ut)||t(3,m[ut]=he[ut],m);await Qt(),t(28,T=JSON.stringify(m)),ee()}function Y(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function J(he){try{const Me=window.localStorage.getItem(Y());if(Me)return JSON.parse(Me)}catch{}return he}function B(he){try{window.localStorage.setItem(Y(),he)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(Y())}}function W(){h&&(t(3,m=h),t(10,h=null))}function pe(he,Me){var G;const mt=structuredClone(he||{}),Jt=structuredClone(Me||{}),ut=(G=f==null?void 0:f.schema)==null?void 0:G.filter(X=>X.type==="file");for(let X of ut)delete mt[X.name],delete Jt[X.name];const oi=["expand","password","passwordConfirm"];for(let X of oi)delete mt[X],delete Jt[X];return JSON.stringify(mt)==JSON.stringify(Jt)}function ee(){t(10,h=null),window.localStorage.removeItem(Y())}async function ue(he=!0){if(!(_||!r||!(f!=null&&f.id))){t(11,_=!0);try{const Me=He();let mt;O?mt=await re.collection(f.id).create(Me):mt=await re.collection(f.id).update(m.id,Me),Pt(O?"Successfully created record.":"Successfully updated record."),ee(),he?F():U(mt),a("save",{isNew:O,record:mt})}catch(Me){re.error(Me)}t(11,_=!1)}}function Oe(){d!=null&&d.id&&fn("Do you really want to delete the selected record?",()=>re.collection(d.collectionId).delete(d.id).then(()=>{R(),Pt("Successfully deleted record."),a("delete",d)}).catch(he=>{re.error(he)}))}function He(){const he=structuredClone(m||{}),Me=new FormData,mt={id:he.id},Jt={};for(const ut of(f==null?void 0:f.schema)||[])mt[ut.name]=!0,ut.type=="json"&&(Jt[ut.name]=!0);i&&(mt.username=!0,mt.email=!0,mt.emailVisibility=!0,mt.password=!0,mt.passwordConfirm=!0,mt.verified=!0);for(const ut in he)if(mt[ut]){if(typeof he[ut]>"u"&&(he[ut]=null),Jt[ut]&&he[ut]!=="")try{JSON.parse(he[ut])}catch(oi){const G={};throw G[ut]={code:"invalid_json",message:oi.toString()},new gn({status:400,response:{data:G}})}j.addValueToFormData(Me,ut,he[ut])}for(const ut in y){const oi=j.toArray(y[ut]);for(const G of oi)Me.append(ut,G)}for(const ut in S){const oi=j.toArray(S[ut]);for(const G of oi)Me.append(ut+"."+G,"")}return Me}function Je(){!(f!=null&&f.id)||!(d!=null&&d.email)||fn(`Do you really want to sent verification email to ${d.email}?`,()=>re.collection(f.id).requestVerification(d.email).then(()=>{Pt(`Successfully sent verification email to ${d.email}.`)}).catch(he=>{re.error(he)}))}function xe(){!(f!=null&&f.id)||!(d!=null&&d.email)||fn(`Do you really want to sent password reset email to ${d.email}?`,()=>re.collection(f.id).requestPasswordReset(d.email).then(()=>{Pt(`Successfully sent password reset email to ${d.email}.`)}).catch(he=>{re.error(he)}))}function bt(){o?fn("You have unsaved changes. Do you really want to discard them?",()=>{kt()}):kt()}async function kt(){let he=d?structuredClone(d):null;if(he){he.id="",he.created="",he.updated="";const Me=(f==null?void 0:f.schema)||[];for(const mt of Me)mt.type==="file"&&delete he[mt.name]}ee(),L(he),await Qt(),t(28,T="")}function yt(he){(he.ctrlKey||he.metaKey)&&he.code=="KeyS"&&(he.preventDefault(),he.stopPropagation(),ue(!1))}const Ot=()=>R(),Ee=()=>Je(),Le=()=>xe(),ze=()=>bt(),_t=()=>Oe(),de=()=>t(13,C=Xi),ve=()=>t(13,C=ys),Se=()=>W(),Ye=()=>ee();function zt(){m.id=this.value,t(3,m)}function dn(he){m=he,t(3,m)}function an(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function qn(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Ni(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function rl(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function bi(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Ie(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Ft(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Pi(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function Kn(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function al(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}function ql(he,Me){n.$$.not_equal(y[Me.name],he)&&(y[Me.name]=he,t(4,y))}function ki(he,Me){n.$$.not_equal(S[Me.name],he)&&(S[Me.name]=he,t(5,S))}function ul(he,Me){n.$$.not_equal(m[Me.name],he)&&(m[Me.name]=he,t(3,m))}const fl=()=>o&&g?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{F()}),!1):(Zt({}),ee(),!0);function gt(he){te[he?"unshift":"push"](()=>{c=he,t(9,c)})}function rt(he){Ce.call(this,n,he)}function Mn(he){Ce.call(this,n,he)}return n.$$set=he=>{"collection"in he&&t(0,f=he.collection)},n.$$.update=()=>{var he;n.$$.dirty[0]&1&&t(14,i=(f==null?void 0:f.type)==="auth"),n.$$.dirty[0]&1&&t(16,l=!!((he=f==null?void 0:f.schema)!=null&&he.find(Me=>Me.type==="editor"))),n.$$.dirty[0]&48&&t(31,s=j.hasNonEmptyProps(y)||j.hasNonEmptyProps(S)),n.$$.dirty[0]&8&&t(29,$=JSON.stringify(m)),n.$$.dirty[0]&805306368|n.$$.dirty[1]&1&&t(8,o=s||T!=$),n.$$.dirty[0]&4&&t(6,O=!d||!d.id),n.$$.dirty[0]&448&&t(15,r=!D&&(O||o)),n.$$.dirty[0]&536871040&&(D||B($)),n.$$.dirty[0]&1073741825&&f&&(I==null?void 0:I.id)!=(f==null?void 0:f.id)&&N()},[f,R,d,m,y,S,O,D,o,c,h,_,g,C,i,r,l,u,F,W,ee,ue,Oe,Je,xe,bt,yt,L,T,$,I,s,Ot,Ee,Le,ze,_t,de,ve,Se,Ye,zt,dn,an,qn,Ni,rl,bi,Ie,Ft,Pi,Kn,al,ql,ki,ul,fl,gt,rt,Mn]}class xa extends ge{constructor(e){super(),_e(this,e,J8,K8,me,{collection:0,show:27,hide:1},null,[-1,-1,-1])}get show(){return this.$$.ctx[27]}get hide(){return this.$$.ctx[1]}}function Z8(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function G8(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("div"),t=b("div"),i=Z(n[2]),l=M(),s=b("div"),o=Z(n[1]),r=Z(" UTC"),p(t,"class","date"),p(s,"class","time svelte-5pjd03"),p(e,"class","datetime svelte-5pjd03")},m(f,c){w(f,e,c),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(s,r),a||(u=$e(Pe.call(null,e,n[3])),a=!0)},p(f,c){c&4&&se(i,f[2]),c&2&&se(o,f[1])},d(f){f&&v(e),a=!1,u()}}}function X8(n){let e;function t(s,o){return s[0]?G8:Z8}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function Q8(n,e,t){let i,l,{date:s=""}=e;const o={get text(){return j.formatToLocalDate(s)+" Local"}};return n.$$set=r=>{"date"in r&&t(0,s=r.date)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=s?s.substring(0,10):null),n.$$.dirty&1&&t(1,l=s?s.substring(10,19):null)},[s,l,i,o]}class tl extends ge{constructor(e){super(),_e(this,e,Q8,X8,me,{date:0})}}function Xm(n,e,t){const i=n.slice();return i[18]=e[t],i[8]=t,i}function Qm(n,e,t){const i=n.slice();return i[13]=e[t],i}function xm(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function eh(n,e,t){const i=n.slice();return i[6]=e[t],i[8]=t,i}function x8(n){const e=n.slice(),t=j.toArray(e[3]);e[16]=t;const i=e[2]?10:500;return e[17]=i,e}function eD(n){var s,o;const e=n.slice(),t=j.toArray(e[3]);e[9]=t;const i=j.toArray((o=(s=e[0])==null?void 0:s.expand)==null?void 0:o[e[1].name]);e[10]=i;const l=e[2]?20:500;return e[11]=l,e}function tD(n){const e=n.slice(),t=j.trimQuotedValue(JSON.stringify(e[3]))||'""';return e[5]=t,e}function nD(n){let e,t;return{c(){e=b("div"),t=Z(n[3]),p(e,"class","block txt-break fallback-block svelte-jdf51v")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function iD(n){let e,t=j.truncate(n[3])+"",i,l;return{c(){e=b("span"),i=Z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=j.truncate(n[3]))},m(s,o){w(s,e,o),k(e,i)},p(s,o){o&8&&t!==(t=j.truncate(s[3])+"")&&se(i,t),o&8&&l!==(l=j.truncate(s[3]))&&p(e,"title",l)},i:Q,o:Q,d(s){s&&v(e)}}}function lD(n){let e,t=[],i=new Map,l,s,o=fe(n[16].slice(0,n[17]));const r=u=>u[8]+u[18];for(let u=0;u<o.length;u+=1){let f=Xm(n,o,u),c=r(f);i.set(c,t[u]=th(c,f))}let a=n[16].length>n[17]&&nh();return{c(){var u;e=b("div");for(let f=0;f<t.length;f+=1)t[f].c();l=M(),a&&a.c(),p(e,"class","inline-flex"),x(e,"multiple",((u=n[1].options)==null?void 0:u.maxSelect)!=1)},m(u,f){w(u,e,f);for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(e,null);k(e,l),a&&a.m(e,null),s=!0},p(u,f){var c;f&13&&(o=fe(u[16].slice(0,u[17])),ie(),t=at(t,f,r,1,u,o,i,e,At,th,l,Xm),le()),u[16].length>u[17]?a||(a=nh(),a.c(),a.m(e,null)):a&&(a.d(1),a=null),(!s||f&2)&&x(e,"multiple",((c=u[1].options)==null?void 0:c.maxSelect)!=1)},i(u){if(!s){for(let f=0;f<o.length;f+=1)E(t[f]);s=!0}},o(u){for(let f=0;f<t.length;f+=1)A(t[f]);s=!1},d(u){u&&v(e);for(let f=0;f<t.length;f+=1)t[f].d();a&&a.d()}}}function sD(n){let e,t,i,l,s;const o=[hD,mD],r=[];function a(f,c){return f[10].length?0:1}t=a(n),i=r[t]=o[t](n);let u=n[9].length>n[11]&&sh();return{c(){e=b("div"),i.c(),l=M(),u&&u.c(),p(e,"class","inline-flex")},m(f,c){w(f,e,c),r[t].m(e,null),k(e,l),u&&u.m(e,null),s=!0},p(f,c){let d=t;t=a(f),t===d?r[t].p(f,c):(ie(),A(r[d],1,1,()=>{r[d]=null}),le(),i=r[t],i?i.p(f,c):(i=r[t]=o[t](f),i.c()),E(i,1),i.m(e,l)),f[9].length>f[11]?u||(u=sh(),u.c(),u.m(e,null)):u&&(u.d(1),u=null)},i(f){s||(E(i),s=!0)},o(f){A(i),s=!1},d(f){f&&v(e),r[t].d(),u&&u.d()}}}function oD(n){let e,t=[],i=new Map,l=fe(j.toArray(n[3]));const s=o=>o[8]+o[6];for(let o=0;o<l.length;o+=1){let r=eh(n,l,o),a=s(r);i.set(a,t[o]=oh(a,r))}return{c(){e=b("div");for(let o=0;o<t.length;o+=1)t[o].c();p(e,"class","inline-flex")},m(o,r){w(o,e,r);for(let a=0;a<t.length;a+=1)t[a]&&t[a].m(e,null)},p(o,r){r&8&&(l=fe(j.toArray(o[3])),t=at(t,r,s,1,o,l,i,e,Li,oh,null,eh))},i:Q,o:Q,d(o){o&&v(e);for(let r=0;r<t.length;r+=1)t[r].d()}}}function rD(n){let e,t;return e=new tl({props:{date:n[3]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.date=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function aD(n){let e,t,i,l;const s=[gD,_D],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function uD(n){let e,t=j.truncate(n[3])+"",i,l,s;return{c(){e=b("a"),i=Z(t),p(e,"class","txt-ellipsis"),p(e,"href",n[3]),p(e,"target","_blank"),p(e,"rel","noopener noreferrer")},m(o,r){w(o,e,r),k(e,i),l||(s=[$e(Pe.call(null,e,"Open in new tab")),K(e,"click",Tn(n[4]))],l=!0)},p(o,r){r&8&&t!==(t=j.truncate(o[3])+"")&&se(i,t),r&8&&p(e,"href",o[3])},i:Q,o:Q,d(o){o&&v(e),l=!1,we(s)}}}function fD(n){let e,t;return{c(){e=b("span"),t=Z(n[3]),p(e,"class","txt")},m(i,l){w(i,e,l),k(e,t)},p(i,l){l&8&&se(t,i[3])},i:Q,o:Q,d(i){i&&v(e)}}}function cD(n){let e,t=n[3]?"True":"False",i;return{c(){e=b("span"),i=Z(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=l[3]?"True":"False")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function dD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function pD(n){let e,t,i,l;const s=[kD,bD],o=[];function r(a,u){return a[2]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(ie(),A(o[f],1,1,()=>{o[f]=null}),le(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){l||(E(t),l=!0)},o(a){A(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function th(n,e){let t,i,l;return i=new Xa({props:{record:e[0],filename:e[18],size:"sm"}}),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),H(i,s,o),l=!0},p(s,o){e=s;const r={};o&1&&(r.record=e[0]),o&12&&(r.filename=e[18]),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(i,s)}}}function nh(n){let e;return{c(){e=Z("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function mD(n){let e,t=fe(n[9].slice(0,n[11])),i=[];for(let l=0;l<t.length;l+=1)i[l]=ih(Qm(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&12){t=fe(l[9].slice(0,l[11]));let o;for(o=0;o<t.length;o+=1){const r=Qm(l,t,o);i[o]?i[o].p(r,s):(i[o]=ih(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:Q,o:Q,d(l){l&&v(e),ot(i,l)}}}function hD(n){let e=[],t=new Map,i,l,s=fe(n[10].slice(0,n[11]));const o=r=>r[8]+r[6];for(let r=0;r<s.length;r+=1){let a=xm(n,s,r),u=o(a);t.set(u,e[r]=lh(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=ye()},m(r,a){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(r,a);w(r,i,a),l=!0},p(r,a){a&7&&(s=fe(r[10].slice(0,r[11])),ie(),e=at(e,a,o,1,r,s,t,i.parentNode,At,lh,i,xm),le())},i(r){if(!l){for(let a=0;a<s.length;a+=1)E(e[a]);l=!0}},o(r){for(let a=0;a<e.length;a+=1)A(e[a]);l=!1},d(r){r&&v(i);for(let a=0;a<e.length;a+=1)e[a].d(r)}}}function ih(n){let e,t=n[13]+"",i;return{c(){e=b("span"),i=Z(t),p(e,"class","label")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&12&&t!==(t=l[13]+"")&&se(i,t)},d(l){l&&v(e)}}}function lh(n,e){let t,i,l,s;return i=new er({props:{record:e[6]}}),{key:n,first:null,c(){t=b("span"),V(i.$$.fragment),l=M(),p(t,"class","label"),this.first=t},m(o,r){w(o,t,r),H(i,t,null),k(t,l),s=!0},p(o,r){e=o;const a={};r&7&&(a.record=e[6]),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),z(i)}}}function sh(n){let e;return{c(){e=Z("...")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function oh(n,e){let t,i=e[6]+"",l;return{key:n,first:null,c(){t=b("span"),l=Z(i),p(t,"class","label"),this.first=t},m(s,o){w(s,t,o),k(t,l)},p(s,o){e=s,o&8&&i!==(i=e[6]+"")&&se(l,i)},d(s){s&&v(t)}}}function _D(n){let e,t;return e=new Qa({props:{cssClass:"tinymce-preview",conf:{branding:!1,promotion:!1,menubar:!1,statusbar:!1,min_height:30,height:59,max_height:500,autoresize_bottom_margin:5,resize:!1,content_style:"body { font-size: 14px }",toolbar:"",plugins:["autoresize"],skin:"pocketbase"},value:n[3],disabled:!0}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function gD(n){let e,t=j.truncate(j.plainText(n[3]),195)+"",i;return{c(){e=b("span"),i=Z(t),p(e,"class","txt")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(j.plainText(l[3]),195)+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function bD(n){let e,t=j.truncate(n[5],500,!0)+"",i,l,s,o,r=n[5].length>500&&rh(n);return{c(){e=b("span"),i=Z(t),l=M(),r&&r.c(),s=ye(),p(e,"class","txt")},m(a,u){w(a,e,u),k(e,i),w(a,l,u),r&&r.m(a,u),w(a,s,u),o=!0},p(a,u){(!o||u&8)&&t!==(t=j.truncate(a[5],500,!0)+"")&&se(i,t),a[5].length>500?r?(r.p(a,u),u&8&&E(r,1)):(r=rh(a),r.c(),E(r,1),r.m(s.parentNode,s)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){o||(E(r),o=!0)},o(a){A(r),o=!1},d(a){a&&(v(e),v(l),v(s)),r&&r.d(a)}}}function kD(n){let e,t=j.truncate(n[5])+"",i;return{c(){e=b("span"),i=Z(t),p(e,"class","txt txt-ellipsis")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s&8&&t!==(t=j.truncate(l[5])+"")&&se(i,t)},i:Q,o:Q,d(l){l&&v(e)}}}function rh(n){let e,t;return e=new ol({props:{value:JSON.stringify(n[3],null,2)}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&8&&(s.value=JSON.stringify(i[3],null,2)),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function yD(n){let e,t,i,l,s;const o=[pD,dD,cD,fD,uD,aD,rD,oD,sD,lD,iD,nD],r=[];function a(f,c){return c&8&&(e=null),f[1].type==="json"?0:(e==null&&(e=!!j.isEmpty(f[3])),e?1:f[1].type==="bool"?2:f[1].type==="number"?3:f[1].type==="url"?4:f[1].type==="editor"?5:f[1].type==="date"?6:f[1].type==="select"?7:f[1].type==="relation"?8:f[1].type==="file"?9:f[2]?10:11)}function u(f,c){return c===0?tD(f):c===8?eD(f):c===9?x8(f):f}return t=a(n,-1),i=r[t]=o[t](u(n,t)),{c(){i.c(),l=ye()},m(f,c){r[t].m(f,c),w(f,l,c),s=!0},p(f,[c]){let d=t;t=a(f,c),t===d?r[t].p(u(f,t),c):(ie(),A(r[d],1,1,()=>{r[d]=null}),le(),i=r[t],i?i.p(u(f,t),c):(i=r[t]=o[t](u(f,t)),i.c()),E(i,1),i.m(l.parentNode,l))},i(f){s||(E(i),s=!0)},o(f){A(i),s=!1},d(f){f&&v(l),r[t].d(f)}}}function vD(n,e,t){let i,{record:l}=e,{field:s}=e,{short:o=!1}=e;function r(a){Ce.call(this,n,a)}return n.$$set=a=>{"record"in a&&t(0,l=a.record),"field"in a&&t(1,s=a.field),"short"in a&&t(2,o=a.short)},n.$$.update=()=>{n.$$.dirty&3&&t(3,i=l==null?void 0:l[s.name])},[l,s,o,i,r]}class s0 extends ge{constructor(e){super(),_e(this,e,vD,yD,me,{record:0,field:1,short:2})}}function ah(n,e,t){const i=n.slice();return i[13]=e[t],i}function uh(n){let e,t,i=n[13].name+"",l,s,o,r,a;return r=new s0({props:{field:n[13],record:n[3]}}),{c(){e=b("tr"),t=b("td"),l=Z(i),s=M(),o=b("td"),V(r.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(o,"class","col-field svelte-1nt58f7")},m(u,f){w(u,e,f),k(e,t),k(t,l),k(e,s),k(e,o),H(r,o,null),a=!0},p(u,f){(!a||f&1)&&i!==(i=u[13].name+"")&&se(l,i);const c={};f&1&&(c.field=u[13]),f&8&&(c.record=u[3]),r.$set(c)},i(u){a||(E(r.$$.fragment,u),a=!0)},o(u){A(r.$$.fragment,u),a=!1},d(u){u&&v(e),z(r)}}}function fh(n){let e,t,i,l,s,o;return s=new tl({props:{date:n[3].created}}),{c(){e=b("tr"),t=b("td"),t.textContent="created",i=M(),l=b("td"),V(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),H(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].created),s.$set(u)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),z(s)}}}function ch(n){let e,t,i,l,s,o;return s=new tl({props:{date:n[3].updated}}),{c(){e=b("tr"),t=b("td"),t.textContent="updated",i=M(),l=b("td"),V(s.$$.fragment),p(t,"class","min-width txt-hint txt-bold"),p(l,"class","col-field svelte-1nt58f7")},m(r,a){w(r,e,a),k(e,t),k(e,i),k(e,l),H(s,l,null),o=!0},p(r,a){const u={};a&8&&(u.date=r[3].updated),s.$set(u)},i(r){o||(E(s.$$.fragment,r),o=!0)},o(r){A(s.$$.fragment,r),o=!1},d(r){r&&v(e),z(s)}}}function wD(n){var O;let e,t,i,l,s,o,r,a,u,f,c=(n[3].id||"...")+"",d,m,h,_,g;a=new ol({props:{value:n[3].id}});let y=fe((O=n[0])==null?void 0:O.schema),S=[];for(let D=0;D<y.length;D+=1)S[D]=uh(ah(n,y,D));const T=D=>A(S[D],1,1,()=>{S[D]=null});let $=n[3].created&&fh(n),C=n[3].updated&&ch(n);return{c(){e=b("table"),t=b("tbody"),i=b("tr"),l=b("td"),l.textContent="id",s=M(),o=b("td"),r=b("div"),V(a.$$.fragment),u=M(),f=b("span"),d=Z(c),m=M();for(let D=0;D<S.length;D+=1)S[D].c();h=M(),$&&$.c(),_=M(),C&&C.c(),p(l,"class","min-width txt-hint txt-bold"),p(f,"class","txt"),p(r,"class","label"),p(o,"class","col-field svelte-1nt58f7"),p(e,"class","table-border preview-table"),x(e,"table-loading",n[4])},m(D,I){w(D,e,I),k(e,t),k(t,i),k(i,l),k(i,s),k(i,o),k(o,r),H(a,r,null),k(r,u),k(r,f),k(f,d),k(t,m);for(let L=0;L<S.length;L+=1)S[L]&&S[L].m(t,null);k(t,h),$&&$.m(t,null),k(t,_),C&&C.m(t,null),g=!0},p(D,I){var R;const L={};if(I&8&&(L.value=D[3].id),a.$set(L),(!g||I&8)&&c!==(c=(D[3].id||"...")+"")&&se(d,c),I&9){y=fe((R=D[0])==null?void 0:R.schema);let F;for(F=0;F<y.length;F+=1){const N=ah(D,y,F);S[F]?(S[F].p(N,I),E(S[F],1)):(S[F]=uh(N),S[F].c(),E(S[F],1),S[F].m(t,h))}for(ie(),F=y.length;F<S.length;F+=1)T(F);le()}D[3].created?$?($.p(D,I),I&8&&E($,1)):($=fh(D),$.c(),E($,1),$.m(t,_)):$&&(ie(),A($,1,1,()=>{$=null}),le()),D[3].updated?C?(C.p(D,I),I&8&&E(C,1)):(C=ch(D),C.c(),E(C,1),C.m(t,null)):C&&(ie(),A(C,1,1,()=>{C=null}),le()),(!g||I&16)&&x(e,"table-loading",D[4])},i(D){if(!g){E(a.$$.fragment,D);for(let I=0;I<y.length;I+=1)E(S[I]);E($),E(C),g=!0}},o(D){A(a.$$.fragment,D),S=S.filter(Boolean);for(let I=0;I<S.length;I+=1)A(S[I]);A($),A(C),g=!1},d(D){D&&v(e),z(a),ot(S,D),$&&$.d(),C&&C.d()}}}function SD(n){var o;let e,t,i=((o=n[0])==null?void 0:o.name)+"",l,s;return{c(){e=b("h4"),t=b("strong"),l=Z(i),s=Z(" record preview")},m(r,a){w(r,e,a),k(e,t),k(t,l),k(e,s)},p(r,a){var u;a&1&&i!==(i=((u=r[0])==null?void 0:u.name)+"")&&se(l,i)},d(r){r&&v(e)}}}function $D(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-transparent")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[7]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function TD(n){let e,t,i={class:"record-preview-panel "+(n[5]?"overlay-panel-xl":"overlay-panel-lg"),$$slots:{footer:[$D],header:[SD],default:[wD]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[8](e),e.$on("hide",n[9]),e.$on("show",n[10]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&32&&(o.class="record-preview-panel "+(l[5]?"overlay-panel-xl":"overlay-panel-lg")),s&65561&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[8](null),z(e,l)}}}function CD(n,e,t){let i,{collection:l}=e,s,o={},r=!1;function a(g){return f(g),s==null?void 0:s.show()}function u(){return t(4,r=!1),s==null?void 0:s.hide()}async function f(g){t(3,o={}),t(4,r=!0),t(3,o=await c(g)||{}),t(4,r=!1)}async function c(g){if(g&&typeof g=="string"){try{return await re.collection(l.id).getOne(g)}catch(y){y.isAbort||(u(),console.warn("resolveModel:",y),ii(`Unable to load record with id "${g}"`))}return null}return g}const d=()=>u();function m(g){te[g?"unshift":"push"](()=>{s=g,t(2,s)})}function h(g){Ce.call(this,n,g)}function _(g){Ce.call(this,n,g)}return n.$$set=g=>{"collection"in g&&t(0,l=g.collection)},n.$$.update=()=>{var g;n.$$.dirty&1&&t(5,i=!!((g=l==null?void 0:l.schema)!=null&&g.find(y=>y.type==="editor")))},[l,u,s,o,r,i,a,d,m,h,_]}class OD extends ge{constructor(e){super(),_e(this,e,CD,TD,me,{collection:0,show:6,hide:1})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[1]}}function dh(n,e,t){const i=n.slice();return i[63]=e[t],i}function ph(n,e,t){const i=n.slice();return i[66]=e[t],i}function mh(n,e,t){const i=n.slice();return i[66]=e[t],i}function hh(n,e,t){const i=n.slice();return i[59]=e[t],i}function _h(n){let e;function t(s,o){return s[13]?DD:MD}let i=t(n),l=i(n);return{c(){e=b("th"),l.c(),p(e,"class","bulk-select-col min-width")},m(s,o){w(s,e,o),l.m(e,null)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e,null)))},d(s){s&&v(e),l.d()}}}function MD(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("input"),l=M(),s=b("label"),p(t,"type","checkbox"),p(t,"id","checkbox_0"),t.disabled=i=!n[3].length,t.checked=n[17],p(s,"for","checkbox_0"),p(e,"class","form-field")},m(a,u){w(a,e,u),k(e,t),k(e,l),k(e,s),o||(r=K(t,"change",n[32]),o=!0)},p(a,u){u[0]&8&&i!==(i=!a[3].length)&&(t.disabled=i),u[0]&131072&&(t.checked=a[17])},d(a){a&&v(e),o=!1,r()}}}function DD(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function gh(n){let e,t,i;function l(o){n[33](o)}let s={class:"col-type-text col-field-id",name:"id",$$slots:{default:[ED]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function ED(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("primary")}"></i> <span class="txt">id</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function bh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s,o=e&&kh(n),r=i&&yh(n);return{c(){o&&o.c(),t=M(),r&&r.c(),l=ye()},m(a,u){o&&o.m(a,u),w(a,t,u),r&&r.m(a,u),w(a,l,u),s=!0},p(a,u){u[0]&32&&(e=!a[5].includes("@username")),e?o?(o.p(a,u),u[0]&32&&E(o,1)):(o=kh(a),o.c(),E(o,1),o.m(t.parentNode,t)):o&&(ie(),A(o,1,1,()=>{o=null}),le()),u[0]&32&&(i=!a[5].includes("@email")),i?r?(r.p(a,u),u[0]&32&&E(r,1)):(r=yh(a),r.c(),E(r,1),r.m(l.parentNode,l)):r&&(ie(),A(r,1,1,()=>{r=null}),le())},i(a){s||(E(o),E(r),s=!0)},o(a){A(o),A(r),s=!1},d(a){a&&(v(t),v(l)),o&&o.d(a),r&&r.d(a)}}}function kh(n){let e,t,i;function l(o){n[34](o)}let s={class:"col-type-text col-field-id",name:"username",$$slots:{default:[ID]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function ID(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("user")}"></i> <span class="txt">username</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yh(n){let e,t,i;function l(o){n[35](o)}let s={class:"col-type-email col-field-email",name:"email",$$slots:{default:[AD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function AD(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("email")}"></i> <span class="txt">email</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LD(n){let e,t,i,l,s,o=n[66].name+"",r;return{c(){e=b("div"),t=b("i"),l=M(),s=b("span"),r=Z(o),p(t,"class",i=j.getFieldTypeIcon(n[66].type)),p(s,"class","txt"),p(e,"class","col-header-content")},m(a,u){w(a,e,u),k(e,t),k(e,l),k(e,s),k(s,r)},p(a,u){u[0]&524288&&i!==(i=j.getFieldTypeIcon(a[66].type))&&p(t,"class",i),u[0]&524288&&o!==(o=a[66].name+"")&&se(r,o)},d(a){a&&v(e)}}}function vh(n,e){let t,i,l,s;function o(a){e[36](a)}let r={class:"col-type-"+e[66].type+" col-field-"+e[66].name,name:e[66].name,$$slots:{default:[LD]},$$scope:{ctx:e}};return e[0]!==void 0&&(r.sort=e[0]),i=new Sn({props:r}),te.push(()=>be(i,"sort",o)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(i,a,u),s=!0},p(a,u){e=a;const f={};u[0]&524288&&(f.class="col-type-"+e[66].type+" col-field-"+e[66].name),u[0]&524288&&(f.name=e[66].name),u[0]&524288|u[2]&512&&(f.$$scope={dirty:u,ctx:e}),!l&&u[0]&1&&(l=!0,f.sort=e[0],ke(()=>l=!1)),i.$set(f)},i(a){s||(E(i.$$.fragment,a),s=!0)},o(a){A(i.$$.fragment,a),s=!1},d(a){a&&v(t),z(i,a)}}}function wh(n){let e,t,i;function l(o){n[37](o)}let s={class:"col-type-date col-field-created",name:"created",$$slots:{default:[ND]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function ND(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("date")}"></i> <span class="txt">created</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Sh(n){let e,t,i;function l(o){n[38](o)}let s={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[PD]},$$scope:{ctx:n}};return n[0]!==void 0&&(s.sort=n[0]),e=new Sn({props:s}),te.push(()=>be(e,"sort",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[2]&512&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.sort=o[0],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function PD(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("date")}"></i> <span class="txt">updated</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function $h(n){let e;return{c(){e=b("button"),e.innerHTML='<i class="ri-more-line"></i>',p(e,"type","button"),p(e,"aria-label","Toggle columns"),p(e,"class","btn btn-sm btn-transparent p-0")},m(t,i){w(t,e,i),n[39](e)},p:Q,d(t){t&&v(e),n[39](null)}}}function Th(n){let e;function t(s,o){return s[13]?RD:FD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function FD(n){let e,t,i,l;function s(a,u){var f;if((f=a[1])!=null&&f.length)return jD;if(!a[10])return qD}let o=s(n),r=o&&o(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No records found.",l=M(),r&&r.c(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),k(e,t),k(t,i),k(t,l),r&&r.m(t,null)},p(a,u){o===(o=s(a))&&r?r.p(a,u):(r&&r.d(1),r=o&&o(a),r&&(r.c(),r.m(t,null)))},d(a){a&&v(e),r&&r.d()}}}function RD(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>'},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function qD(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-add-line"></i> <span class="txt">New record</span>',p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[44]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function jD(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[43]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Ch(n){let e,t,i,l,s,o,r,a,u,f;function c(){return n[40](n[63])}return{c(){e=b("td"),t=b("div"),i=b("input"),o=M(),r=b("label"),p(i,"type","checkbox"),p(i,"id",l="checkbox_"+n[63].id),i.checked=s=n[4][n[63].id],p(r,"for",a="checkbox_"+n[63].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),k(e,t),k(t,i),k(t,o),k(t,r),u||(f=[K(i,"change",c),K(t,"click",Tn(n[30]))],u=!0)},p(d,m){n=d,m[0]&8&&l!==(l="checkbox_"+n[63].id)&&p(i,"id",l),m[0]&24&&s!==(s=n[4][n[63].id])&&(i.checked=s),m[0]&8&&a!==(a="checkbox_"+n[63].id)&&p(r,"for",a)},d(d){d&&v(e),u=!1,we(f)}}}function Oh(n){let e,t,i,l,s,o,r=n[63].id+"",a,u,f;l=new ol({props:{value:n[63].id}});let c=n[9]&&Mh(n);return{c(){e=b("td"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("div"),a=Z(r),u=M(),c&&c.c(),p(o,"class","txt txt-ellipsis"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),k(e,t),k(t,i),H(l,i,null),k(i,s),k(i,o),k(o,a),k(t,u),c&&c.m(t,null),f=!0},p(d,m){const h={};m[0]&8&&(h.value=d[63].id),l.$set(h),(!f||m[0]&8)&&r!==(r=d[63].id+"")&&se(a,r),d[9]?c?c.p(d,m):(c=Mh(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(E(l.$$.fragment,d),f=!0)},o(d){A(l.$$.fragment,d),f=!1},d(d){d&&v(e),z(l),c&&c.d()}}}function Mh(n){let e;function t(s,o){return s[63].verified?zD:HD}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i!==(i=t(s))&&(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function HD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(l,s){w(l,e,s),t||(i=$e(Pe.call(null,e,"Unverified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function zD(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(l,s){w(l,e,s),t||(i=$e(Pe.call(null,e,"Verified")),t=!0)},d(l){l&&v(e),t=!1,i()}}}function Dh(n){let e=!n[5].includes("@username"),t,i=!n[5].includes("@email"),l,s=e&&Eh(n),o=i&&Ih(n);return{c(){s&&s.c(),t=M(),o&&o.c(),l=ye()},m(r,a){s&&s.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,l,a)},p(r,a){a[0]&32&&(e=!r[5].includes("@username")),e?s?s.p(r,a):(s=Eh(r),s.c(),s.m(t.parentNode,t)):s&&(s.d(1),s=null),a[0]&32&&(i=!r[5].includes("@email")),i?o?o.p(r,a):(o=Ih(r),o.c(),o.m(l.parentNode,l)):o&&(o.d(1),o=null)},d(r){r&&(v(t),v(l)),s&&s.d(r),o&&o.d(r)}}}function Eh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].username)),t?BD:VD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function VD(n){let e,t=n[63].username+"",i,l;return{c(){e=b("span"),i=Z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].username)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].username+"")&&se(i,t),o[0]&8&&l!==(l=s[63].username)&&p(e,"title",l)},d(s){s&&v(e)}}}function BD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ih(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!j.isEmpty(o[63].email)),t?WD:UD}let l=i(n,[-1,-1,-1]),s=l(n);return{c(){e=b("td"),s.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(o,e,r),s.m(e,null)},p(o,r){l===(l=i(o,r))&&s?s.p(o,r):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},d(o){o&&v(e),s.d()}}}function UD(n){let e,t=n[63].email+"",i,l;return{c(){e=b("span"),i=Z(t),p(e,"class","txt txt-ellipsis"),p(e,"title",l=n[63].email)},m(s,o){w(s,e,o),k(e,i)},p(s,o){o[0]&8&&t!==(t=s[63].email+"")&&se(i,t),o[0]&8&&l!==(l=s[63].email)&&p(e,"title",l)},d(s){s&&v(e)}}}function WD(n){let e;return{c(){e=b("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Ah(n,e){let t,i,l,s;return i=new s0({props:{short:!0,record:e[63],field:e[66]}}),{key:n,first:null,c(){t=b("td"),V(i.$$.fragment),p(t,"class",l="col-type-"+e[66].type+" col-field-"+e[66].name),this.first=t},m(o,r){w(o,t,r),H(i,t,null),s=!0},p(o,r){e=o;const a={};r[0]&8&&(a.record=e[63]),r[0]&524288&&(a.field=e[66]),i.$set(a),(!s||r[0]&524288&&l!==(l="col-type-"+e[66].type+" col-field-"+e[66].name))&&p(t,"class",l)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),z(i)}}}function Lh(n){let e,t,i;return t=new tl({props:{date:n[63].created}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-created")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].created),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function Nh(n){let e,t,i;return t=new tl({props:{date:n[63].updated}}),{c(){e=b("td"),V(t.$$.fragment),p(e,"class","col-type-date col-field-updated")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.date=l[63].updated),t.$set(o)},i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function Ph(n,e){let t,i,l=!e[5].includes("@id"),s,o,r=[],a=new Map,u,f=e[8]&&!e[5].includes("@created"),c,d=e[7]&&!e[5].includes("@updated"),m,h,_,g,y,S=!e[10]&&Ch(e),T=l&&Oh(e),$=e[9]&&Dh(e),C=fe(e[19]);const O=F=>F[66].name;for(let F=0;F<C.length;F+=1){let N=ph(e,C,F),P=O(N);a.set(P,r[F]=Ah(P,N))}let D=f&&Lh(e),I=d&&Nh(e);function L(){return e[41](e[63])}function R(...F){return e[42](e[63],...F)}return{key:n,first:null,c(){t=b("tr"),S&&S.c(),i=M(),T&&T.c(),s=M(),$&&$.c(),o=M();for(let F=0;F<r.length;F+=1)r[F].c();u=M(),D&&D.c(),c=M(),I&&I.c(),m=M(),h=b("td"),h.innerHTML='<i class="ri-arrow-right-line"></i>',p(h,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(F,N){w(F,t,N),S&&S.m(t,null),k(t,i),T&&T.m(t,null),k(t,s),$&&$.m(t,null),k(t,o);for(let P=0;P<r.length;P+=1)r[P]&&r[P].m(t,null);k(t,u),D&&D.m(t,null),k(t,c),I&&I.m(t,null),k(t,m),k(t,h),_=!0,g||(y=[K(t,"click",L),K(t,"keydown",R)],g=!0)},p(F,N){e=F,e[10]?S&&(S.d(1),S=null):S?S.p(e,N):(S=Ch(e),S.c(),S.m(t,i)),N[0]&32&&(l=!e[5].includes("@id")),l?T?(T.p(e,N),N[0]&32&&E(T,1)):(T=Oh(e),T.c(),E(T,1),T.m(t,s)):T&&(ie(),A(T,1,1,()=>{T=null}),le()),e[9]?$?$.p(e,N):($=Dh(e),$.c(),$.m(t,o)):$&&($.d(1),$=null),N[0]&524296&&(C=fe(e[19]),ie(),r=at(r,N,O,1,e,C,a,t,At,Ah,u,ph),le()),N[0]&288&&(f=e[8]&&!e[5].includes("@created")),f?D?(D.p(e,N),N[0]&288&&E(D,1)):(D=Lh(e),D.c(),E(D,1),D.m(t,c)):D&&(ie(),A(D,1,1,()=>{D=null}),le()),N[0]&160&&(d=e[7]&&!e[5].includes("@updated")),d?I?(I.p(e,N),N[0]&160&&E(I,1)):(I=Nh(e),I.c(),E(I,1),I.m(t,m)):I&&(ie(),A(I,1,1,()=>{I=null}),le())},i(F){if(!_){E(T);for(let N=0;N<C.length;N+=1)E(r[N]);E(D),E(I),_=!0}},o(F){A(T);for(let N=0;N<r.length;N+=1)A(r[N]);A(D),A(I),_=!1},d(F){F&&v(t),S&&S.d(),T&&T.d(),$&&$.d();for(let N=0;N<r.length;N+=1)r[N].d();D&&D.d(),I&&I.d(),g=!1,we(y)}}}function Fh(n){let e,t,i,l,s,o;return{c(){e=b("tr"),t=b("td"),i=b("button"),l=b("span"),l.textContent="Load more",p(l,"class","txt"),p(i,"class","btn btn-expanded-lg btn-secondary btn-horizontal-sticky"),i.disabled=n[13],x(i,"btn-loading",n[13]),p(t,"colspan","99"),p(t,"class","txt-center")},m(r,a){w(r,e,a),k(e,t),k(t,i),k(i,l),s||(o=K(i,"click",Ue(n[45])),s=!0)},p(r,a){a[0]&8192&&(i.disabled=r[13]),a[0]&8192&&x(i,"btn-loading",r[13])},d(r){r&&v(e),s=!1,o()}}}function YD(n){let e,t,i,l,s=!n[5].includes("@id"),o,r,a=[],u=new Map,f,c=n[8]&&!n[5].includes("@created"),d,m=n[7]&&!n[5].includes("@updated"),h,_,g,y,S=[],T=new Map,$,C,O=!n[10]&&_h(n),D=s&&gh(n),I=n[9]&&bh(n),L=fe(n[19]);const R=B=>B[66].name;for(let B=0;B<L.length;B+=1){let W=mh(n,L,B),pe=R(W);u.set(pe,a[B]=vh(pe,W))}let F=c&&wh(n),N=m&&Sh(n),P=n[16].length&&$h(n),q=fe(n[3]);const U=B=>B[10]?B[63]:B[63].id;for(let B=0;B<q.length;B+=1){let W=dh(n,q,B),pe=U(W);T.set(pe,S[B]=Ph(pe,W))}let Y=null;q.length||(Y=Th(n));let J=n[3].length&&n[18]&&Fh(n);return{c(){e=b("table"),t=b("thead"),i=b("tr"),O&&O.c(),l=M(),D&&D.c(),o=M(),I&&I.c(),r=M();for(let B=0;B<a.length;B+=1)a[B].c();f=M(),F&&F.c(),d=M(),N&&N.c(),h=M(),_=b("th"),P&&P.c(),g=M(),y=b("tbody");for(let B=0;B<S.length;B+=1)S[B].c();Y&&Y.c(),$=M(),J&&J.c(),p(_,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[13])},m(B,W){w(B,e,W),k(e,t),k(t,i),O&&O.m(i,null),k(i,l),D&&D.m(i,null),k(i,o),I&&I.m(i,null),k(i,r);for(let pe=0;pe<a.length;pe+=1)a[pe]&&a[pe].m(i,null);k(i,f),F&&F.m(i,null),k(i,d),N&&N.m(i,null),k(i,h),k(i,_),P&&P.m(_,null),k(e,g),k(e,y);for(let pe=0;pe<S.length;pe+=1)S[pe]&&S[pe].m(y,null);Y&&Y.m(y,null),k(y,$),J&&J.m(y,null),C=!0},p(B,W){B[10]?O&&(O.d(1),O=null):O?O.p(B,W):(O=_h(B),O.c(),O.m(i,l)),W[0]&32&&(s=!B[5].includes("@id")),s?D?(D.p(B,W),W[0]&32&&E(D,1)):(D=gh(B),D.c(),E(D,1),D.m(i,o)):D&&(ie(),A(D,1,1,()=>{D=null}),le()),B[9]?I?(I.p(B,W),W[0]&512&&E(I,1)):(I=bh(B),I.c(),E(I,1),I.m(i,r)):I&&(ie(),A(I,1,1,()=>{I=null}),le()),W[0]&524289&&(L=fe(B[19]),ie(),a=at(a,W,R,1,B,L,u,i,At,vh,f,mh),le()),W[0]&288&&(c=B[8]&&!B[5].includes("@created")),c?F?(F.p(B,W),W[0]&288&&E(F,1)):(F=wh(B),F.c(),E(F,1),F.m(i,d)):F&&(ie(),A(F,1,1,()=>{F=null}),le()),W[0]&160&&(m=B[7]&&!B[5].includes("@updated")),m?N?(N.p(B,W),W[0]&160&&E(N,1)):(N=Sh(B),N.c(),E(N,1),N.m(i,h)):N&&(ie(),A(N,1,1,()=>{N=null}),le()),B[16].length?P?P.p(B,W):(P=$h(B),P.c(),P.m(_,null)):P&&(P.d(1),P=null),W[0]&9971642&&(q=fe(B[3]),ie(),S=at(S,W,U,1,B,q,T,y,At,Ph,$,dh),le(),!q.length&&Y?Y.p(B,W):q.length?Y&&(Y.d(1),Y=null):(Y=Th(B),Y.c(),Y.m(y,$))),B[3].length&&B[18]?J?J.p(B,W):(J=Fh(B),J.c(),J.m(y,null)):J&&(J.d(1),J=null),(!C||W[0]&8192)&&x(e,"table-loading",B[13])},i(B){if(!C){E(D),E(I);for(let W=0;W<L.length;W+=1)E(a[W]);E(F),E(N);for(let W=0;W<q.length;W+=1)E(S[W]);C=!0}},o(B){A(D),A(I);for(let W=0;W<a.length;W+=1)A(a[W]);A(F),A(N);for(let W=0;W<S.length;W+=1)A(S[W]);C=!1},d(B){B&&v(e),O&&O.d(),D&&D.d(),I&&I.d();for(let W=0;W<a.length;W+=1)a[W].d();F&&F.d(),N&&N.d(),P&&P.d();for(let W=0;W<S.length;W+=1)S[W].d();Y&&Y.d(),J&&J.d()}}}function Rh(n){let e,t;return e=new On({props:{class:"dropdown dropdown-right dropdown-nowrap columns-dropdown",trigger:n[15],$$slots:{default:[JD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&32768&&(s.trigger=i[15]),l[0]&65568|l[2]&512&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function KD(n){let e,t,i,l,s,o=n[59].name+"",r,a,u,f,c;function d(...m){return n[31](n[59],...m)}return{c(){e=b("input"),l=M(),s=b("label"),r=Z(o),u=M(),p(e,"type","checkbox"),p(e,"id",t=n[62]),e.checked=i=!n[5].includes(n[59].id),p(s,"for",a=n[62])},m(m,h){w(m,e,h),w(m,l,h),w(m,s,h),k(s,r),w(m,u,h),f||(c=K(e,"change",d),f=!0)},p(m,h){n=m,h[2]&1&&t!==(t=n[62])&&p(e,"id",t),h[0]&65568&&i!==(i=!n[5].includes(n[59].id))&&(e.checked=i),h[0]&65536&&o!==(o=n[59].name+"")&&se(r,o),h[2]&1&&a!==(a=n[62])&&p(s,"for",a)},d(m){m&&(v(e),v(l),v(s),v(u)),f=!1,c()}}}function qh(n,e){let t,i,l;return i=new ce({props:{class:"form-field form-field-sm form-field-toggle m-0 p-5",$$slots:{default:[KD,({uniqueId:s})=>({62:s}),({uniqueId:s})=>[0,0,s?1:0]]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(s,o){w(s,t,o),H(i,s,o),l=!0},p(s,o){e=s;const r={};o[0]&65568|o[2]&513&&(r.$$scope={dirty:o,ctx:e}),i.$set(r)},i(s){l||(E(i.$$.fragment,s),l=!0)},o(s){A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(i,s)}}}function JD(n){let e,t,i=[],l=new Map,s,o,r=fe(n[16]);const a=u=>u[59].id+u[59].name;for(let u=0;u<r.length;u+=1){let f=hh(n,r,u),c=a(f);l.set(c,i[u]=qh(c,f))}return{c(){e=b("div"),e.textContent="Toggle columns",t=M();for(let u=0;u<i.length;u+=1)i[u].c();s=ye(),p(e,"class","txt-hint txt-sm p-5 m-b-5")},m(u,f){w(u,e,f),w(u,t,f);for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(u,f);w(u,s,f),o=!0},p(u,f){f[0]&65568|f[2]&1&&(r=fe(u[16]),ie(),i=at(i,f,a,1,u,r,l,s.parentNode,At,qh,s,hh),le())},i(u){if(!o){for(let f=0;f<r.length;f+=1)E(i[f]);o=!0}},o(u){for(let f=0;f<i.length;f+=1)A(i[f]);o=!1},d(u){u&&(v(e),v(t),v(s));for(let f=0;f<i.length;f+=1)i[f].d(u)}}}function ZD(n){let e,t,i=n[15]&&Rh(n);return{c(){i&&i.c(),e=ye()},m(l,s){i&&i.m(l,s),w(l,e,s),t=!0},p(l,s){l[15]?i?(i.p(l,s),s[0]&32768&&E(i,1)):(i=Rh(l),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(ie(),A(i,1,1,()=>{i=null}),le())},i(l){t||(E(i),t=!0)},o(l){A(i),t=!1},d(l){l&&v(e),i&&i.d(l)}}}function jh(n){let e,t,i,l,s,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,h,_,g,y,S;return{c(){e=b("div"),t=b("div"),i=Z("Selected "),l=b("strong"),s=Z(n[6]),o=M(),a=Z(r),u=M(),f=b("button"),f.innerHTML='<span class="txt">Reset</span>',c=M(),d=b("div"),m=M(),h=b("button"),h.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-transparent btn-outline p-l-5 p-r-5"),x(f,"btn-disabled",n[14]),p(d,"class","flex-fill"),p(h,"type","button"),p(h,"class","btn btn-sm btn-transparent btn-danger"),x(h,"btn-loading",n[14]),x(h,"btn-disabled",n[14]),p(e,"class","bulkbar")},m(T,$){w(T,e,$),k(e,t),k(t,i),k(t,l),k(l,s),k(t,o),k(t,a),k(e,u),k(e,f),k(e,c),k(e,d),k(e,m),k(e,h),g=!0,y||(S=[K(f,"click",n[47]),K(h,"click",n[48])],y=!0)},p(T,$){(!g||$[0]&64)&&se(s,T[6]),(!g||$[0]&64)&&r!==(r=T[6]===1?"record":"records")&&se(a,r),(!g||$[0]&16384)&&x(f,"btn-disabled",T[14]),(!g||$[0]&16384)&&x(h,"btn-loading",T[14]),(!g||$[0]&16384)&&x(h,"btn-disabled",T[14])},i(T){g||(T&&Ke(()=>{g&&(_||(_=Fe(e,Fn,{duration:150,y:5},!0)),_.run(1))}),g=!0)},o(T){T&&(_||(_=Fe(e,Fn,{duration:150,y:5},!1)),_.run(0)),g=!1},d(T){T&&v(e),T&&_&&_.end(),y=!1,we(S)}}}function GD(n){let e,t,i,l,s={class:"table-wrapper",$$slots:{before:[ZD],default:[YD]},$$scope:{ctx:n}};e=new Zo({props:s}),n[46](e);let o=n[6]&&jh(n);return{c(){V(e.$$.fragment),t=M(),o&&o.c(),i=ye()},m(r,a){H(e,r,a),w(r,t,a),o&&o.m(r,a),w(r,i,a),l=!0},p(r,a){const u={};a[0]&1030075|a[2]&512&&(u.$$scope={dirty:a,ctx:r}),e.$set(u),r[6]?o?(o.p(r,a),a[0]&64&&E(o,1)):(o=jh(r),o.c(),E(o,1),o.m(i.parentNode,i)):o&&(ie(),A(o,1,1,()=>{o=null}),le())},i(r){l||(E(e.$$.fragment,r),E(o),l=!0)},o(r){A(e.$$.fragment,r),A(o),l=!1},d(r){r&&(v(t),v(i)),n[46](null),z(e,r),o&&o.d(r)}}}const XD=/^([\+\-])?(\w+)$/,Hh=40;function QD(n,e,t){let i,l,s,o,r,a,u,f,c,d,m,h;We(n,Rn,Ie=>t(53,h=Ie));const _=lt();let{collection:g}=e,{sort:y=""}=e,{filter:S=""}=e,T,$=[],C=1,O=0,D={},I=!0,L=!1,R=0,F,N=[],P=[],q="";function U(){g!=null&&g.id&&(N.length?localStorage.setItem(q,JSON.stringify(N)):localStorage.removeItem(q))}function Y(){if(t(5,N=[]),!!(g!=null&&g.id))try{const Ie=localStorage.getItem(q);Ie&&t(5,N=JSON.parse(Ie)||[])}catch{}}function J(Ie){return!!$.find(Ft=>Ft.id)}async function B(){const Ie=C;for(let Ft=1;Ft<=Ie;Ft++)(Ft===1||u)&&await W(Ft,!1)}async function W(Ie=1,Ft=!0){var ul,fl,gt;if(!(g!=null&&g.id))return;t(13,I=!0);let Pi=y;const Kn=Pi.match(XD),al=Kn?r.find(rt=>rt.name===Kn[2]):null;if(Kn&&al){const rt=((gt=(fl=(ul=h==null?void 0:h.find(he=>{var Me;return he.id==((Me=al.options)==null?void 0:Me.collectionId)}))==null?void 0:ul.schema)==null?void 0:fl.filter(he=>he.presentable))==null?void 0:gt.map(he=>he.name))||[],Mn=[];for(const he of rt)Mn.push((Kn[1]||"")+Kn[2]+"."+he);Mn.length>0&&(Pi=Mn.join(","))}const ql=j.getAllCollectionIdentifiers(g),ki=o.map(rt=>rt.name+":excerpt(200)").concat(r.map(rt=>"expand."+rt.name+".*:excerpt(200)"));return ki.length&&ki.unshift("*"),re.collection(g.id).getList(Ie,Hh,{sort:Pi,skipTotal:1,filter:j.normalizeSearchFilter(S,ql),expand:r.map(rt=>rt.name).join(","),fields:ki.join(","),requestKey:"records_list"}).then(async rt=>{var Mn;if(Ie<=1&&pe(),t(13,I=!1),t(12,C=rt.page),t(28,O=rt.items.length),_("load",$.concat(rt.items)),o.length)for(let he of rt.items)he._partial=!0;if(Ft){const he=++R;for(;(Mn=rt.items)!=null&&Mn.length&&R==he;){const Me=rt.items.splice(0,20);for(let mt of Me)j.pushOrReplaceByKey($,mt);t(3,$),await j.yieldToMain()}}else{for(let he of rt.items)j.pushOrReplaceByKey($,he);t(3,$)}}).catch(rt=>{rt!=null&&rt.isAbort||(t(13,I=!1),console.warn(rt),pe(),re.error(rt,!S||(rt==null?void 0:rt.status)!=400))})}function pe(){T==null||T.resetVerticalScroll(),t(3,$=[]),t(12,C=1),t(28,O=0),t(4,D={})}function ee(){c?ue():Oe()}function ue(){t(4,D={})}function Oe(){for(const Ie of $)t(4,D[Ie.id]=Ie,D);t(4,D)}function He(Ie){D[Ie.id]?delete D[Ie.id]:t(4,D[Ie.id]=Ie,D),t(4,D)}function Je(){fn(`Do you really want to delete the selected ${f===1?"record":"records"}?`,xe)}async function xe(){if(L||!f||!(g!=null&&g.id))return;let Ie=[];for(const Ft of Object.keys(D))Ie.push(re.collection(g.id).delete(Ft));return t(14,L=!0),Promise.all(Ie).then(()=>{Pt(`Successfully deleted the selected ${f===1?"record":"records"}.`),_("delete",D),ue()}).catch(Ft=>{re.error(Ft)}).finally(()=>(t(14,L=!1),B()))}function bt(Ie){Ce.call(this,n,Ie)}const kt=(Ie,Ft)=>{Ft.target.checked?j.removeByValue(N,Ie.id):j.pushUnique(N,Ie.id),t(5,N)},yt=()=>ee();function Ot(Ie){y=Ie,t(0,y)}function Ee(Ie){y=Ie,t(0,y)}function Le(Ie){y=Ie,t(0,y)}function ze(Ie){y=Ie,t(0,y)}function _t(Ie){y=Ie,t(0,y)}function de(Ie){y=Ie,t(0,y)}function ve(Ie){te[Ie?"unshift":"push"](()=>{F=Ie,t(15,F)})}const Se=Ie=>He(Ie),Ye=Ie=>_("select",Ie),zt=(Ie,Ft)=>{Ft.code==="Enter"&&(Ft.preventDefault(),_("select",Ie))},dn=()=>t(1,S=""),an=()=>_("new"),qn=()=>W(C+1);function Ni(Ie){te[Ie?"unshift":"push"](()=>{T=Ie,t(11,T)})}const rl=()=>ue(),bi=()=>Je();return n.$$set=Ie=>{"collection"in Ie&&t(25,g=Ie.collection),"sort"in Ie&&t(0,y=Ie.sort),"filter"in Ie&&t(1,S=Ie.filter)},n.$$.update=()=>{n.$$.dirty[0]&33554432&&g!=null&&g.id&&(q=g.id+"@hiddenColumns",Y(),pe()),n.$$.dirty[0]&33554432&&t(10,i=(g==null?void 0:g.type)==="view"),n.$$.dirty[0]&33554432&&t(9,l=(g==null?void 0:g.type)==="auth"),n.$$.dirty[0]&33554432&&t(29,s=(g==null?void 0:g.schema)||[]),n.$$.dirty[0]&536870912&&(o=s.filter(Ie=>Ie.type==="editor")),n.$$.dirty[0]&536870912&&(r=s.filter(Ie=>Ie.type==="relation")),n.$$.dirty[0]&536870944&&t(19,a=s.filter(Ie=>!N.includes(Ie.id))),n.$$.dirty[0]&33554435&&g!=null&&g.id&&y!==-1&&S!==-1&&W(1),n.$$.dirty[0]&268435456&&t(18,u=O>=Hh),n.$$.dirty[0]&16&&t(6,f=Object.keys(D).length),n.$$.dirty[0]&72&&t(17,c=$.length&&f===$.length),n.$$.dirty[0]&32&&N!==-1&&U(),n.$$.dirty[0]&1032&&t(8,d=!i||$.length>0&&typeof $[0].created<"u"),n.$$.dirty[0]&1032&&t(7,m=!i||$.length>0&&typeof $[0].updated<"u"),n.$$.dirty[0]&536871808&&t(16,P=[].concat(l?[{id:"@username",name:"username"},{id:"@email",name:"email"}]:[],s.map(Ie=>({id:Ie.id,name:Ie.name})),d?{id:"@created",name:"created"}:[],m?{id:"@updated",name:"updated"}:[]))},[y,S,W,$,D,N,f,m,d,l,i,T,C,I,L,F,P,c,u,a,_,ee,ue,He,Je,g,J,B,O,s,bt,kt,yt,Ot,Ee,Le,ze,_t,de,ve,Se,Ye,zt,dn,an,qn,Ni,rl,bi]}class xD extends ge{constructor(e){super(),_e(this,e,QD,GD,me,{collection:25,sort:0,filter:1,hasRecord:26,reloadLoadedPages:27,load:2},null,[-1,-1,-1])}get hasRecord(){return this.$$.ctx[26]}get reloadLoadedPages(){return this.$$.ctx[27]}get load(){return this.$$.ctx[2]}}function eE(n){let e,t,i,l,s=(n[2]?"...":n[0])+"",o,r;return{c(){e=b("div"),t=b("span"),t.textContent="Total found:",i=M(),l=b("span"),o=Z(s),p(t,"class","txt"),p(l,"class","txt"),p(e,"class",r="inline-flex flex-gap-5 records-counter "+n[1])},m(a,u){w(a,e,u),k(e,t),k(e,i),k(e,l),k(l,o)},p(a,[u]){u&5&&s!==(s=(a[2]?"...":a[0])+"")&&se(o,s),u&2&&r!==(r="inline-flex flex-gap-5 records-counter "+a[1])&&p(e,"class",r)},i:Q,o:Q,d(a){a&&v(e)}}}function tE(n,e,t){const i=lt();let{collection:l}=e,{filter:s=""}=e,{totalCount:o=0}=e,{class:r=void 0}=e,a=!1;async function u(){if(l!=null&&l.id){t(2,a=!0),t(0,o=0);try{const f=j.getAllCollectionIdentifiers(l),c=await re.collection(l.id).getList(1,1,{filter:j.normalizeSearchFilter(s,f),fields:"id",requestKey:"records_count"});t(0,o=c.totalItems),i("count",o),t(2,a=!1)}catch(f){f!=null&&f.isAbort||(t(2,a=!1),console.warn(f))}}}return n.$$set=f=>{"collection"in f&&t(3,l=f.collection),"filter"in f&&t(4,s=f.filter),"totalCount"in f&&t(0,o=f.totalCount),"class"in f&&t(1,r=f.class)},n.$$.update=()=>{n.$$.dirty&24&&l!=null&&l.id&&s!==-1&&u()},[o,r,a,l,s,u]}class nE extends ge{constructor(e){super(),_e(this,e,tE,eE,me,{collection:3,filter:4,totalCount:0,class:1,reload:5})}get reload(){return this.$$.ctx[5]}}function iE(n){let e,t,i,l;return e=new k6({}),i=new bn({props:{class:"flex-content",$$slots:{footer:[rE],default:[oE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&6135|o[1]&8192&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function lE(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[fE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&4112|l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function sE(n){let e,t;return e=new bn({props:{center:!0,$$slots:{default:[cE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[1]&8192&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function zh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-settings-4-line"></i>',p(e,"type","button"),p(e,"aria-label","Edit collection"),p(e,"class","btn btn-transparent btn-circle")},m(l,s){w(l,e,s),t||(i=[$e(Pe.call(null,e,{text:"Edit collection",position:"right"})),K(e,"click",n[20])],t=!0)},p:Q,d(l){l&&v(e),t=!1,we(i)}}}function Vh(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-add-line"></i> <span class="txt">New record</span>',p(e,"type","button"),p(e,"class","btn btn-expanded")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[23]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function oE(n){let e,t,i,l,s,o=n[2].name+"",r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F=!n[12]&&zh(n);c=new Jo({}),c.$on("refresh",n[21]);let N=n[2].type!=="view"&&Vh(n);y=new Ms({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[24]);function P(Y){n[26](Y)}function q(Y){n[27](Y)}let U={collection:n[2]};return n[0]!==void 0&&(U.filter=n[0]),n[1]!==void 0&&(U.sort=n[1]),C=new xD({props:U}),n[25](C),te.push(()=>be(C,"filter",P)),te.push(()=>be(C,"sort",q)),C.$on("select",n[28]),C.$on("delete",n[29]),C.$on("new",n[30]),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Collections",l=M(),s=b("div"),r=Z(o),a=M(),u=b("div"),F&&F.c(),f=M(),V(c.$$.fragment),d=M(),m=b("div"),h=b("button"),h.innerHTML='<i class="ri-code-s-slash-line"></i> <span class="txt">API Preview</span>',_=M(),N&&N.c(),g=M(),V(y.$$.fragment),S=M(),T=b("div"),$=M(),V(C.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(h,"type","button"),p(h,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p(T,"class","clearfix m-b-sm")},m(Y,J){w(Y,e,J),k(e,t),k(t,i),k(t,l),k(t,s),k(s,r),k(e,a),k(e,u),F&&F.m(u,null),k(u,f),H(c,u,null),k(e,d),k(e,m),k(m,h),k(m,_),N&&N.m(m,null),w(Y,g,J),H(y,Y,J),w(Y,S,J),w(Y,T,J),w(Y,$,J),H(C,Y,J),I=!0,L||(R=K(h,"click",n[22]),L=!0)},p(Y,J){(!I||J[0]&4)&&o!==(o=Y[2].name+"")&&se(r,o),Y[12]?F&&(F.d(1),F=null):F?F.p(Y,J):(F=zh(Y),F.c(),F.m(u,f)),Y[2].type!=="view"?N?N.p(Y,J):(N=Vh(Y),N.c(),N.m(m,null)):N&&(N.d(1),N=null);const B={};J[0]&1&&(B.value=Y[0]),J[0]&4&&(B.autocompleteCollection=Y[2]),y.$set(B);const W={};J[0]&4&&(W.collection=Y[2]),!O&&J[0]&1&&(O=!0,W.filter=Y[0],ke(()=>O=!1)),!D&&J[0]&2&&(D=!0,W.sort=Y[1],ke(()=>D=!1)),C.$set(W)},i(Y){I||(E(c.$$.fragment,Y),E(y.$$.fragment,Y),E(C.$$.fragment,Y),I=!0)},o(Y){A(c.$$.fragment,Y),A(y.$$.fragment,Y),A(C.$$.fragment,Y),I=!1},d(Y){Y&&(v(e),v(g),v(S),v(T),v($)),F&&F.d(),z(c),N&&N.d(),z(y,Y),n[25](null),z(C,Y),L=!1,R()}}}function rE(n){let e,t,i;function l(o){n[19](o)}let s={class:"m-r-auto txt-sm txt-hint",collection:n[2],filter:n[0]};return n[10]!==void 0&&(s.totalCount=n[10]),e=new nE({props:s}),n[18](e),te.push(()=>be(e,"totalCount",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};r[0]&4&&(a.collection=o[2]),r[0]&1&&(a.filter=o[0]),!t&&r[0]&1024&&(t=!0,a.totalCount=o[10],ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){n[18](null),z(e,o)}}}function aE(n){let e,t,i,l,s;return{c(){e=b("h1"),e.textContent="Create your first collection to add records!",t=M(),i=b("button"),i.innerHTML='<i class="ri-add-line"></i> <span class="txt">Create new collection</span>',p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),l||(s=K(i,"click",n[17]),l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,s()}}}function uE(n){let e;return{c(){e=b("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function fE(n){let e,t,i;function l(r,a){return r[12]?uE:aE}let s=l(n),o=s(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=M(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(r,e,a),k(e,t),k(e,i),o.m(e,null)},p(r,a){s===(s=l(r))&&o?o.p(r,a):(o.d(1),o=s(r),o&&(o.c(),o.m(e,null)))},d(r){r&&v(e),o.d()}}}function cE(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function dE(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[sE,lE,iE],m=[];function h(T,$){return T[3]&&!T[11].length?0:T[11].length?2:1}e=h(n),t=m[e]=d[e](n);let _={};l=new Ga({props:_}),n[31](l);let g={};o=new O6({props:g}),n[32](o);let y={collection:n[2]};a=new xa({props:y}),n[33](a),a.$on("hide",n[34]),a.$on("save",n[35]),a.$on("delete",n[36]);let S={collection:n[2]};return f=new OD({props:S}),n[37](f),f.$on("hide",n[38]),{c(){t.c(),i=M(),V(l.$$.fragment),s=M(),V(o.$$.fragment),r=M(),V(a.$$.fragment),u=M(),V(f.$$.fragment)},m(T,$){m[e].m(T,$),w(T,i,$),H(l,T,$),w(T,s,$),H(o,T,$),w(T,r,$),H(a,T,$),w(T,u,$),H(f,T,$),c=!0},p(T,$){let C=e;e=h(T),e===C?m[e].p(T,$):(ie(),A(m[C],1,1,()=>{m[C]=null}),le(),t=m[e],t?t.p(T,$):(t=m[e]=d[e](T),t.c()),E(t,1),t.m(i.parentNode,i));const O={};l.$set(O);const D={};o.$set(D);const I={};$[0]&4&&(I.collection=T[2]),a.$set(I);const L={};$[0]&4&&(L.collection=T[2]),f.$set(L)},i(T){c||(E(t),E(l.$$.fragment,T),E(o.$$.fragment,T),E(a.$$.fragment,T),E(f.$$.fragment,T),c=!0)},o(T){A(t),A(l.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),c=!1},d(T){T&&(v(i),v(s),v(r),v(u)),m[e].d(T),n[31](null),z(l,T),n[32](null),z(o,T),n[33](null),z(a,T),n[37](null),z(f,T)}}}function pE(n,e,t){let i,l,s,o,r,a,u;We(n,Yn,Ee=>t(2,l=Ee)),We(n,Lt,Ee=>t(39,s=Ee)),We(n,$o,Ee=>t(3,o=Ee)),We(n,qo,Ee=>t(16,r=Ee)),We(n,Rn,Ee=>t(11,a=Ee)),We(n,Qi,Ee=>t(12,u=Ee));const f=new URLSearchParams(r);let c,d,m,h,_,g,y=f.get("filter")||"",S=f.get("sort")||"-created",T=f.get("collectionId")||(l==null?void 0:l.id),$=0;nb(T);async function C(Ee){await Qt(),(l==null?void 0:l.type)==="view"?h.show(Ee):m==null||m.show(Ee)}function O(){t(14,T=l==null?void 0:l.id),t(0,y=""),t(1,S="-created"),I({recordId:null}),D(),c==null||c.forceHide(),d==null||d.hide()}async function D(){if(!S)return;const Ee=j.getAllCollectionIdentifiers(l),Le=S.split(",").map(ze=>ze.startsWith("+")||ze.startsWith("-")?ze.substring(1):ze);Le.filter(ze=>Ee.includes(ze)).length!=Le.length&&(Ee.includes("created")?t(1,S="-created"):t(1,S=""))}function I(Ee={}){const Le=Object.assign({collectionId:(l==null?void 0:l.id)||"",filter:y,sort:S},Ee);j.replaceHashQueryParams(Le)}const L=()=>c==null?void 0:c.show();function R(Ee){te[Ee?"unshift":"push"](()=>{g=Ee,t(9,g)})}function F(Ee){$=Ee,t(10,$)}const N=()=>c==null?void 0:c.show(l),P=()=>{_==null||_.load(),g==null||g.reload()},q=()=>d==null?void 0:d.show(l),U=()=>m==null?void 0:m.show(),Y=Ee=>t(0,y=Ee.detail);function J(Ee){te[Ee?"unshift":"push"](()=>{_=Ee,t(8,_)})}function B(Ee){y=Ee,t(0,y)}function W(Ee){S=Ee,t(1,S)}const pe=Ee=>{I({recordId:Ee.detail.id});let Le=Ee.detail._partial?Ee.detail.id:Ee.detail;l.type==="view"?h==null||h.show(Le):m==null||m.show(Le)},ee=()=>{g==null||g.reload()},ue=()=>m==null?void 0:m.show();function Oe(Ee){te[Ee?"unshift":"push"](()=>{c=Ee,t(4,c)})}function He(Ee){te[Ee?"unshift":"push"](()=>{d=Ee,t(5,d)})}function Je(Ee){te[Ee?"unshift":"push"](()=>{m=Ee,t(6,m)})}const xe=()=>{I({recordId:null})},bt=Ee=>{y?g==null||g.reload():Ee.detail.isNew&&t(10,$++,$),_==null||_.reloadLoadedPages()},kt=Ee=>{(!y||_!=null&&_.hasRecord(Ee.detail.id))&&t(10,$--,$),_==null||_.reloadLoadedPages()};function yt(Ee){te[Ee?"unshift":"push"](()=>{h=Ee,t(7,h)})}const Ot=()=>{I({recordId:null})};return n.$$.update=()=>{n.$$.dirty[0]&65536&&t(15,i=new URLSearchParams(r)),n.$$.dirty[0]&49160&&!o&&i.get("collectionId")&&i.get("collectionId")!=T&&dv(i.get("collectionId")),n.$$.dirty[0]&16388&&l!=null&&l.id&&T!=l.id&&O(),n.$$.dirty[0]&4&&l!=null&&l.id&&D(),n.$$.dirty[0]&8&&!o&&f.get("recordId")&&C(f.get("recordId")),n.$$.dirty[0]&15&&!o&&(S||y||l!=null&&l.id)&&I(),n.$$.dirty[0]&4&&xt(Lt,s=(l==null?void 0:l.name)||"Collections",s)},[y,S,l,o,c,d,m,h,_,g,$,a,u,I,T,i,r,L,R,F,N,P,q,U,Y,J,B,W,pe,ee,ue,Oe,He,Je,xe,bt,kt,yt,Ot]}class mE extends ge{constructor(e){super(),_e(this,e,pE,dE,me,{},null,[-1,-1])}}function Bh(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),e.innerHTML='<span class="txt">Sync</span>',t=M(),i=b("a"),i.innerHTML='<i class="ri-uninstall-line" aria-hidden="true"></i> <span class="txt">Export collections</span>',l=M(),s=b("a"),s.innerHTML='<i class="ri-install-line" aria-hidden="true"></i> <span class="txt">Import collections</span>',p(e,"class","sidebar-title"),p(i,"href","/settings/export-collections"),p(i,"class","sidebar-list-item"),p(s,"href","/settings/import-collections"),p(s,"class","sidebar-list-item")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),o||(r=[$e(Ln.call(null,i,{path:"/settings/export-collections/?.*"})),$e(ln.call(null,i)),$e(Ln.call(null,s,{path:"/settings/import-collections/?.*"})),$e(ln.call(null,s))],o=!0)},d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,we(r)}}}function hE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O=!n[0]&&Bh();return{c(){e=b("div"),t=b("div"),t.textContent="System",i=M(),l=b("a"),l.innerHTML='<i class="ri-home-gear-line" aria-hidden="true"></i> <span class="txt">Application</span>',s=M(),o=b("a"),o.innerHTML='<i class="ri-send-plane-2-line" aria-hidden="true"></i> <span class="txt">Mail settings</span>',r=M(),a=b("a"),a.innerHTML='<i class="ri-archive-drawer-line" aria-hidden="true"></i> <span class="txt">Files storage</span>',u=M(),f=b("a"),f.innerHTML='<i class="ri-archive-line" aria-hidden="true"></i> <span class="txt">Backups</span>',c=M(),O&&O.c(),d=M(),m=b("div"),m.textContent="Authentication",h=M(),_=b("a"),_.innerHTML='<i class="ri-lock-password-line" aria-hidden="true"></i> <span class="txt">Auth providers</span>',g=M(),y=b("a"),y.innerHTML='<i class="ri-key-line" aria-hidden="true"></i> <span class="txt">Token options</span>',S=M(),T=b("a"),T.innerHTML='<i class="ri-shield-user-line" aria-hidden="true"></i> <span class="txt">Admins</span>',p(t,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(o,"href","/settings/mail"),p(o,"class","sidebar-list-item"),p(a,"href","/settings/storage"),p(a,"class","sidebar-list-item"),p(f,"href","/settings/backups"),p(f,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(_,"href","/settings/auth-providers"),p(_,"class","sidebar-list-item"),p(y,"href","/settings/tokens"),p(y,"class","sidebar-list-item"),p(T,"href","/settings/admins"),p(T,"class","sidebar-list-item"),p(e,"class","sidebar-content")},m(D,I){w(D,e,I),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),k(e,r),k(e,a),k(e,u),k(e,f),k(e,c),O&&O.m(e,null),k(e,d),k(e,m),k(e,h),k(e,_),k(e,g),k(e,y),k(e,S),k(e,T),$||(C=[$e(Ln.call(null,l,{path:"/settings"})),$e(ln.call(null,l)),$e(Ln.call(null,o,{path:"/settings/mail/?.*"})),$e(ln.call(null,o)),$e(Ln.call(null,a,{path:"/settings/storage/?.*"})),$e(ln.call(null,a)),$e(Ln.call(null,f,{path:"/settings/backups/?.*"})),$e(ln.call(null,f)),$e(Ln.call(null,_,{path:"/settings/auth-providers/?.*"})),$e(ln.call(null,_)),$e(Ln.call(null,y,{path:"/settings/tokens/?.*"})),$e(ln.call(null,y)),$e(Ln.call(null,T,{path:"/settings/admins/?.*"})),$e(ln.call(null,T))],$=!0)},p(D,I){D[0]?O&&(O.d(1),O=null):O||(O=Bh(),O.c(),O.m(e,d))},d(D){D&&v(e),O&&O.d(),$=!1,we(C)}}}function _E(n){let e,t;return e=new Zb({props:{class:"settings-sidebar",$$slots:{default:[hE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&3&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function gE(n,e,t){let i;return We(n,Qi,l=>t(0,i=l)),[i]}class gi extends ge{constructor(e){super(),_e(this,e,gE,_E,me,{})}}function Uh(n,e,t){const i=n.slice();return i[31]=e[t],i}function Wh(n){let e,t;return e=new ce({props:{class:"form-field readonly",name:"id",$$slots:{default:[bE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741826|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function bE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return a=new n0({props:{model:n[1]}}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",o=M(),r=b("div"),V(a.$$.fragment),u=M(),f=b("input"),p(t,"class",j.getFieldTypeIcon("primary")),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"class","form-field-addon"),p(f,"type","text"),p(f,"id",c=n[30]),f.value=d=n[1].id,f.readOnly=!0},m(h,_){w(h,e,_),k(e,t),k(e,i),k(e,l),w(h,o,_),w(h,r,_),H(a,r,null),w(h,u,_),w(h,f,_),m=!0},p(h,_){(!m||_[0]&1073741824&&s!==(s=h[30]))&&p(e,"for",s);const g={};_[0]&2&&(g.model=h[1]),a.$set(g),(!m||_[0]&1073741824&&c!==(c=h[30]))&&p(f,"id",c),(!m||_[0]&2&&d!==(d=h[1].id)&&f.value!==d)&&(f.value=d)},i(h){m||(E(a.$$.fragment,h),m=!0)},o(h){A(a.$$.fragment,h),m=!1},d(h){h&&(v(e),v(o),v(r),v(u),v(f)),z(a)}}}function Yh(n){let e,t,i,l,s,o,r;function a(){return n[18](n[31])}return{c(){e=b("button"),t=b("img"),l=M(),en(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))},m(u,f){w(u,e,f),k(e,t),k(e,l),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&s!==(s="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-primary":"thumb-sm"))&&p(e,"class",s)},d(u){u&&v(e),o=!1,r()}}}function kE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=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),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[3]),u||(f=K(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&oe(r,c[3])},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function Kh(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[yE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&1073741840|l[1]&8&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function yE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(l,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,l,f),k(l,s),r||(a=K(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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function Jh(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[vE,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[wE,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("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),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(E(l.$$.fragment,f),E(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Fe(t,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){A(l.$$.fragment,f),A(r.$$.fragment,f),f&&(a||(a=Fe(t,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),z(l),z(r),f&&a&&a.end()}}}function vE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;return c=new i0({}),{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password",o=M(),r=b("input"),u=M(),f=b("div"),V(c.$$.fragment),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0,p(f,"class","form-field-addon")},m(_,g){w(_,e,g),k(e,t),k(e,i),k(e,l),w(_,o,g),w(_,r,g),oe(r,n[9]),w(_,u,g),w(_,f,g),H(c,f,null),d=!0,m||(h=K(r,"input",n[21]),m=!0)},p(_,g){(!d||g[0]&1073741824&&s!==(s=_[30]))&&p(e,"for",s),(!d||g[0]&1073741824&&a!==(a=_[30]))&&p(r,"id",a),g[0]&512&&r.value!==_[9]&&oe(r,_[9])},i(_){d||(E(c.$$.fragment,_),d=!0)},o(_){A(c.$$.fragment,_),d=!1},d(_){_&&(v(e),v(o),v(r),v(u),v(f)),z(c),m=!1,h()}}}function wE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Password confirm",o=M(),r=b("input"),p(t,"class","ri-lock-line"),p(l,"class","txt"),p(e,"for",s=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),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[10]),u||(f=K(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&s!==(s=c[30])&&p(e,"for",s),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&1024&&r.value!==c[10]&&oe(r,c[10])},d(c){c&&(v(e),v(o),v(r)),u=!1,f()}}}function SE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h=!n[5]&&Wh(n),_=fe([0,1,2,3,4,5,6,7,8,9]),g=[];for(let T=0;T<10;T+=1)g[T]=Yh(Uh(n,_,T));a=new ce({props:{class:"form-field required",name:"email",$$slots:{default:[kE,({uniqueId:T})=>({30:T}),({uniqueId:T})=>[T?1073741824:0]]},$$scope:{ctx:n}}});let y=!n[5]&&Kh(n),S=(n[5]||n[4])&&Jh(n);return{c(){e=b("form"),h&&h.c(),t=M(),i=b("div"),l=b("p"),l.textContent="Avatar",s=M(),o=b("div");for(let T=0;T<10;T+=1)g[T].c();r=M(),V(a.$$.fragment),u=M(),y&&y.c(),f=M(),S&&S.c(),p(l,"class","section-title"),p(o,"class","flex flex-gap-xs flex-wrap"),p(i,"class","content"),p(e,"id",n[12]),p(e,"class","grid"),p(e,"autocomplete","off")},m(T,$){w(T,e,$),h&&h.m(e,null),k(e,t),k(e,i),k(i,l),k(i,s),k(i,o);for(let C=0;C<10;C+=1)g[C]&&g[C].m(o,null);k(e,r),H(a,e,null),k(e,u),y&&y.m(e,null),k(e,f),S&&S.m(e,null),c=!0,d||(m=K(e,"submit",Ue(n[13])),d=!0)},p(T,$){if(T[5]?h&&(ie(),A(h,1,1,()=>{h=null}),le()):h?(h.p(T,$),$[0]&32&&E(h,1)):(h=Wh(T),h.c(),E(h,1),h.m(e,t)),$[0]&4){_=fe([0,1,2,3,4,5,6,7,8,9]);let O;for(O=0;O<10;O+=1){const D=Uh(T,_,O);g[O]?g[O].p(D,$):(g[O]=Yh(D),g[O].c(),g[O].m(o,null))}for(;O<10;O+=1)g[O].d(1)}const C={};$[0]&1073741832|$[1]&8&&(C.$$scope={dirty:$,ctx:T}),a.$set(C),T[5]?y&&(ie(),A(y,1,1,()=>{y=null}),le()):y?(y.p(T,$),$[0]&32&&E(y,1)):(y=Kh(T),y.c(),E(y,1),y.m(e,f)),T[5]||T[4]?S?(S.p(T,$),$[0]&48&&E(S,1)):(S=Jh(T),S.c(),E(S,1),S.m(e,null)):S&&(ie(),A(S,1,1,()=>{S=null}),le())},i(T){c||(E(h),E(a.$$.fragment,T),E(y),E(S),c=!0)},o(T){A(h),A(a.$$.fragment,T),A(y),A(S),c=!1},d(T){T&&v(e),h&&h.d(),ot(g,T),z(a),y&&y.d(),S&&S.d(),d=!1,m()}}}function $E(n){let e,t=n[5]?"New admin":"Edit admin",i;return{c(){e=b("h4"),i=Z(t)},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&32&&t!==(t=l[5]?"New admin":"Edit admin")&&se(i,t)},d(l){l&&v(e)}}}function Zh(n){let e,t,i,l,s,o,r,a,u;return o=new On({props:{class:"dropdown dropdown-upside dropdown-left dropdown-nowrap",$$slots:{default:[TE]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("span"),i=M(),l=b("i"),s=M(),V(o.$$.fragment),r=M(),a=b("div"),p(t,"aria-hidden","true"),p(l,"class","ri-more-line"),p(l,"aria-hidden","true"),p(e,"tabindex","0"),p(e,"role","button"),p(e,"aria-label","More admin options"),p(e,"class","btn btn-sm btn-circle btn-transparent"),p(a,"class","flex-fill")},m(f,c){w(f,e,c),k(e,t),k(e,i),k(e,l),k(e,s),H(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||(E(o.$$.fragment,f),u=!0)},o(f){A(o.$$.fragment,f),u=!1},d(f){f&&(v(e),v(r),v(a)),z(o)}}}function TE(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-delete-bin-7-line" aria-hidden="true"></i> <span class="txt">Delete</span>',p(e,"type","button"),p(e,"class","dropdown-item txt-danger"),p(e,"role","menuitem")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[16]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function CE(n){let e,t,i,l,s,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,m=!n[5]&&Zh(n);return{c(){m&&m.c(),e=M(),t=b("button"),i=b("span"),i.textContent="Cancel",l=M(),s=b("button"),o=b("span"),a=Z(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(s,"type","submit"),p(s,"form",n[12]),p(s,"class","btn btn-expanded"),s.disabled=u=!n[11]||n[7],x(s,"btn-loading",n[7])},m(h,_){m&&m.m(h,_),w(h,e,_),w(h,t,_),k(t,i),w(h,l,_),w(h,s,_),k(s,o),k(o,a),f=!0,c||(d=K(t,"click",n[17]),c=!0)},p(h,_){h[5]?m&&(ie(),A(m,1,1,()=>{m=null}),le()):m?(m.p(h,_),_[0]&32&&E(m,1)):(m=Zh(h),m.c(),E(m,1),m.m(e.parentNode,e)),(!f||_[0]&128)&&(t.disabled=h[7]),(!f||_[0]&32)&&r!==(r=h[5]?"Create":"Save changes")&&se(a,r),(!f||_[0]&2176&&u!==(u=!h[11]||h[7]))&&(s.disabled=u),(!f||_[0]&128)&&x(s,"btn-loading",h[7])},i(h){f||(E(m),f=!0)},o(h){A(m),f=!1},d(h){h&&(v(e),v(t),v(l),v(s)),m&&m.d(h),c=!1,d()}}}function OE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[CE],header:[$E],default:[SE]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&2304&&(o.beforeHide=l[23]),s[0]&3774|s[1]&8&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[24](null),z(e,l)}}}function ME(n,e,t){let i,l;const s=lt(),o="admin_"+j.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",m="",h="",_=!1;function g(J){return S(J),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(J){t(1,a=structuredClone(J||{})),T()}function T(){t(4,_=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,h=""),Zt({})}function $(){if(u||!l)return;t(7,u=!0);const J={email:d,avatar:c};(i||_)&&(J.password=m,J.passwordConfirm=h);let B;i?B=re.admins.create(J):B=re.admins.update(a.id,J),B.then(async W=>{var pe;t(8,f=!1),y(),Pt(i?"Successfully created admin.":"Successfully updated admin."),((pe=re.authStore.model)==null?void 0:pe.id)===W.id&&re.authStore.save(re.authStore.token,W),s("save",W)}).catch(W=>{re.error(W)}).finally(()=>{t(7,u=!1)})}function C(){a!=null&&a.id&&fn("Do you really want to delete the selected admin?",()=>re.admins.delete(a.id).then(()=>{t(8,f=!1),y(),Pt("Successfully deleted admin."),s("delete",a)}).catch(J=>{re.error(J)}))}const O=()=>C(),D=()=>y(),I=J=>t(2,c=J);function L(){d=this.value,t(3,d)}function R(){_=this.checked,t(4,_)}function F(){m=this.value,t(9,m)}function N(){h=this.value,t(10,h)}const P=()=>l&&f?(fn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(J){te[J?"unshift":"push"](()=>{r=J,t(6,r)})}function U(J){Ce.call(this,n,J)}function Y(J){Ce.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,l=i&&d!=""||_||d!==a.email||c!==a.avatar)},[y,a,c,d,_,i,r,u,f,m,h,l,o,$,C,g,O,D,I,L,R,F,N,P,q,U,Y]}class DE extends ge{constructor(e){super(),_e(this,e,ME,OE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Gh(n,e,t){const i=n.slice();return i[24]=e[t],i}function EE(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("primary")}"></i> <span class="txt">id</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function IE(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("email")}"></i> <span class="txt">email</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function AE(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("date")}"></i> <span class="txt">created</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function LE(n){let e;return{c(){e=b("div"),e.innerHTML=`<i class="${j.getFieldTypeIcon("date")}"></i> <span class="txt">updated</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Xh(n){let e;function t(s,o){return s[5]?PE:NE}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function NE(n){var r;let e,t,i,l,s,o=((r=n[1])==null?void 0:r.length)&&Qh(n);return{c(){e=b("tr"),t=b("td"),i=b("h6"),i.textContent="No admins found.",l=M(),o&&o.c(),s=M(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),k(e,t),k(t,i),k(t,l),o&&o.m(t,null),k(e,s)},p(a,u){var f;(f=a[1])!=null&&f.length?o?o.p(a,u):(o=Qh(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&v(e),o&&o.d()}}}function PE(n){let e;return{c(){e=b("tr"),e.innerHTML='<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td> '},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Qh(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[17]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function xh(n){let e;return{c(){e=b("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function e_(n,e){let t,i,l,s,o,r,a,u,f,c,d,m=e[24].id+"",h,_,g,y,S,T=e[24].email+"",$,C,O,D,I,L,R,F,N,P,q,U,Y,J;f=new ol({props:{value:e[24].id}});let B=e[24].id===e[7].id&&xh();I=new tl({props:{date:e[24].created}}),F=new tl({props:{date:e[24].updated}});function W(){return e[15](e[24])}function pe(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=b("tr"),i=b("td"),l=b("figure"),s=b("img"),r=M(),a=b("td"),u=b("div"),V(f.$$.fragment),c=M(),d=b("span"),h=Z(m),_=M(),B&&B.c(),g=M(),y=b("td"),S=b("span"),$=Z(T),O=M(),D=b("td"),V(I.$$.fragment),L=M(),R=b("td"),V(F.$$.fragment),N=M(),P=b("td"),P.innerHTML='<i class="ri-arrow-right-line"></i>',q=M(),en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(s,"src",o),p(s,"alt","Admin avatar"),p(l,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",C=e[24].email),p(y,"class","col-type-email col-field-email"),p(D,"class","col-type-date col-field-created"),p(R,"class","col-type-date col-field-updated"),p(P,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ee,ue){w(ee,t,ue),k(t,i),k(i,l),k(l,s),k(t,r),k(t,a),k(a,u),H(f,u,null),k(u,c),k(u,d),k(d,h),k(a,_),B&&B.m(a,null),k(t,g),k(t,y),k(y,S),k(S,$),k(t,O),k(t,D),H(I,D,null),k(t,L),k(t,R),H(F,R,null),k(t,N),k(t,P),k(t,q),U=!0,Y||(J=[K(t,"click",W),K(t,"keydown",pe)],Y=!0)},p(ee,ue){e=ee,(!U||ue&16&&!en(s.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(s,"src",o);const Oe={};ue&16&&(Oe.value=e[24].id),f.$set(Oe),(!U||ue&16)&&m!==(m=e[24].id+"")&&se(h,m),e[24].id===e[7].id?B||(B=xh(),B.c(),B.m(a,null)):B&&(B.d(1),B=null),(!U||ue&16)&&T!==(T=e[24].email+"")&&se($,T),(!U||ue&16&&C!==(C=e[24].email))&&p(S,"title",C);const He={};ue&16&&(He.date=e[24].created),I.$set(He);const Je={};ue&16&&(Je.date=e[24].updated),F.$set(Je)},i(ee){U||(E(f.$$.fragment,ee),E(I.$$.fragment,ee),E(F.$$.fragment,ee),U=!0)},o(ee){A(f.$$.fragment,ee),A(I.$$.fragment,ee),A(F.$$.fragment,ee),U=!1},d(ee){ee&&v(t),z(f),B&&B.d(),z(I),z(F),Y=!1,we(J)}}}function FE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C=[],O=new Map,D;function I(W){n[11](W)}let L={class:"col-type-text",name:"id",$$slots:{default:[EE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Sn({props:L}),te.push(()=>be(o,"sort",I));function R(W){n[12](W)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[IE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new Sn({props:F}),te.push(()=>be(u,"sort",R));function N(W){n[13](W)}let P={class:"col-type-date col-field-created",name:"created",$$slots:{default:[AE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),d=new Sn({props:P}),te.push(()=>be(d,"sort",N));function q(W){n[14](W)}let U={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[LE]},$$scope:{ctx:n}};n[2]!==void 0&&(U.sort=n[2]),_=new Sn({props:U}),te.push(()=>be(_,"sort",q));let Y=fe(n[4]);const J=W=>W[24].id;for(let W=0;W<Y.length;W+=1){let pe=Gh(n,Y,W),ee=J(pe);O.set(ee,C[W]=e_(ee,pe))}let B=null;return Y.length||(B=Xh(n)),{c(){e=b("table"),t=b("thead"),i=b("tr"),l=b("th"),s=M(),V(o.$$.fragment),a=M(),V(u.$$.fragment),c=M(),V(d.$$.fragment),h=M(),V(_.$$.fragment),y=M(),S=b("th"),T=M(),$=b("tbody");for(let W=0;W<C.length;W+=1)C[W].c();B&&B.c(),p(l,"class","min-width"),p(S,"class","col-type-action min-width"),p(e,"class","table"),x(e,"table-loading",n[5])},m(W,pe){w(W,e,pe),k(e,t),k(t,i),k(i,l),k(i,s),H(o,i,null),k(i,a),H(u,i,null),k(i,c),H(d,i,null),k(i,h),H(_,i,null),k(i,y),k(i,S),k(e,T),k(e,$);for(let ee=0;ee<C.length;ee+=1)C[ee]&&C[ee].m($,null);B&&B.m($,null),D=!0},p(W,pe){const ee={};pe&134217728&&(ee.$$scope={dirty:pe,ctx:W}),!r&&pe&4&&(r=!0,ee.sort=W[2],ke(()=>r=!1)),o.$set(ee);const ue={};pe&134217728&&(ue.$$scope={dirty:pe,ctx:W}),!f&&pe&4&&(f=!0,ue.sort=W[2],ke(()=>f=!1)),u.$set(ue);const Oe={};pe&134217728&&(Oe.$$scope={dirty:pe,ctx:W}),!m&&pe&4&&(m=!0,Oe.sort=W[2],ke(()=>m=!1)),d.$set(Oe);const He={};pe&134217728&&(He.$$scope={dirty:pe,ctx:W}),!g&&pe&4&&(g=!0,He.sort=W[2],ke(()=>g=!1)),_.$set(He),pe&186&&(Y=fe(W[4]),ie(),C=at(C,pe,J,1,W,Y,O,$,At,e_,null,Gh),le(),!Y.length&&B?B.p(W,pe):Y.length?B&&(B.d(1),B=null):(B=Xh(W),B.c(),B.m($,null))),(!D||pe&32)&&x(e,"table-loading",W[5])},i(W){if(!D){E(o.$$.fragment,W),E(u.$$.fragment,W),E(d.$$.fragment,W),E(_.$$.fragment,W);for(let pe=0;pe<Y.length;pe+=1)E(C[pe]);D=!0}},o(W){A(o.$$.fragment,W),A(u.$$.fragment,W),A(d.$$.fragment,W),A(_.$$.fragment,W);for(let pe=0;pe<C.length;pe+=1)A(C[pe]);D=!1},d(W){W&&v(e),z(o),z(u),z(d),z(_);for(let pe=0;pe<C.length;pe+=1)C[pe].d();B&&B.d()}}}function RE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O;return a=new Jo({}),a.$on("refresh",n[8]),_=new Ms({props:{value:n[1],placeholder:"Search term or filter like email='test@example.com'",extraAutocompleteKeys:["email"]}}),_.$on("submit",n[10]),T=new Zo({props:{class:"table-wrapper",$$slots:{default:[FE]},$$scope:{ctx:n}}}),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[6]),r=M(),V(a.$$.fragment),u=M(),f=b("div"),c=M(),d=b("div"),m=b("button"),m.innerHTML='<i class="ri-add-line"></i> <span class="txt">New admin</span>',h=M(),V(_.$$.fragment),g=M(),y=b("div"),S=M(),V(T.$$.fragment),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(d,"class","btns-group"),p(e,"class","page-header"),p(y,"class","clearfix m-b-base")},m(D,I){w(D,e,I),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(e,r),H(a,e,null),k(e,u),k(e,f),k(e,c),k(e,d),k(d,m),w(D,h,I),H(_,D,I),w(D,g,I),w(D,y,I),w(D,S,I),H(T,D,I),$=!0,C||(O=K(m,"click",n[9]),C=!0)},p(D,I){(!$||I&64)&&se(o,D[6]);const L={};I&2&&(L.value=D[1]),_.$set(L);const R={};I&134217918&&(R.$$scope={dirty:I,ctx:D}),T.$set(R)},i(D){$||(E(a.$$.fragment,D),E(_.$$.fragment,D),E(T.$$.fragment,D),$=!0)},o(D){A(a.$$.fragment,D),A(_.$$.fragment,D),A(T.$$.fragment,D),$=!1},d(D){D&&(v(e),v(h),v(g),v(y),v(S)),z(a),z(_,D),z(T,D),C=!1,O()}}}function qE(n){let e,t,i=n[4].length+"",l;return{c(){e=b("div"),t=Z("Total found: "),l=Z(i),p(e,"class","m-r-auto txt-sm txt-hint")},m(s,o){w(s,e,o),k(e,t),k(e,l)},p(s,o){o&16&&i!==(i=s[4].length+"")&&se(l,i)},d(s){s&&v(e)}}}function jE(n){let e,t,i,l,s,o;e=new gi({}),i=new bn({props:{$$slots:{footer:[qE],default:[RE]},$$scope:{ctx:n}}});let r={};return s=new DE({props:r}),n[18](s),s.$on("save",n[19]),s.$on("delete",n[20]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,l,u),H(s,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[18](null),z(s,a)}}}function HE(n,e,t){let i,l,s;We(n,qo,F=>t(21,i=F)),We(n,Lt,F=>t(6,l=F)),We(n,Aa,F=>t(7,s=F)),xt(Lt,l="Admins",l);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const F=j.normalizeSearchFilter(f,["id","email","created","updated"]);return re.admins.getFullList(100,{sort:c||"-created",filter:F}).then(N=>{t(4,a=N),t(5,u=!1)}).catch(N=>{N!=null&&N.isAbort||(t(5,u=!1),console.warn(N),m(),re.error(N,!F||(N==null?void 0:N.status)!=400))})}function m(){t(4,a=[])}const h=()=>d(),_=()=>r==null?void 0:r.show(),g=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const C=F=>r==null?void 0:r.show(F),O=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},D=()=>t(1,f="");function I(F){te[F?"unshift":"push"](()=>{r=F,t(3,r)})}const L=()=>d(),R=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();nl("/settings/admins?"+F),d()}},[d,f,c,r,a,u,l,s,h,_,g,y,S,T,$,C,O,D,I,L,R]}class zE extends ge{constructor(e){super(),_e(this,e,HE,jE,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function VE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Email"),l=M(),s=b("input"),p(e,"for",i=n[8]),p(s,"type","email"),p(s,"id",o=n[8]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&oe(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function BE(n){let e,t,i,l,s,o,r,a,u,f,c;return{c(){e=b("label"),t=Z("Password"),l=M(),s=b("input"),r=M(),a=b("div"),u=b("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(s,"type","password"),p(s,"id",o=n[8]),s.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[1]),w(d,r,m),w(d,a,m),k(a,u),f||(c=[K(s,"input",n[5]),$e(ln.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(s,"id",o),m&2&&s.value!==d[1]&&oe(s,d[1])},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),f=!1,we(c)}}}function UE(n){let e,t,i,l,s,o,r,a,u,f,c;return l=new ce({props:{class:"form-field required",name:"identity",$$slots:{default:[VE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"password",$$slots:{default:[BE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),t.innerHTML="<h4>Admin sign in</h4>",i=M(),V(l.$$.fragment),s=M(),V(o.$$.fragment),r=M(),a=b("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"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),k(e,t),k(e,i),H(l,e,null),k(e,s),H(o,e,null),k(e,r),k(e,a),u=!0,f||(c=K(e,"submit",Ue(n[3])),f=!0)},p(d,m){const h={};m&769&&(h.$$scope={dirty:m,ctx:d}),l.$set(h);const _={};m&770&&(_.$$scope={dirty:m,ctx:d}),o.$set(_),(!u||m&4)&&x(a,"btn-disabled",d[2]),(!u||m&4)&&x(a,"btn-loading",d[2])},i(d){u||(E(l.$$.fragment,d),E(o.$$.fragment,d),u=!0)},o(d){A(l.$$.fragment,d),A(o.$$.fragment,d),u=!1},d(d){d&&v(e),z(l),z(o),f=!1,c()}}}function WE(n){let e,t;return e=new ib({props:{$$slots:{default:[UE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&519&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function YE(n,e,t){let i;We(n,qo,c=>t(6,i=c));const l=new URLSearchParams(i);let s=l.get("demoEmail")||"",o=l.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),re.admins.authWithPassword(s,o).then(()=>{Ea(),nl("/")}).catch(()=>{ii("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){s=this.value,t(0,s)}function f(){o=this.value,t(1,o)}return[s,o,r,a,u,f]}class KE extends ge{constructor(e){super(),_e(this,e,YE,WE,me,{})}}function JE(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T;i=new ce({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[GE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[XE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}}),a=new ce({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[QE,({uniqueId:C})=>({18:C}),({uniqueId:C})=>C?262144:0]},$$scope:{ctx:n}}});let $=n[3]&&t_(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),r=M(),V(a.$$.fragment),u=M(),f=b("div"),c=b("div"),d=M(),$&&$.c(),m=M(),h=b("button"),_=b("span"),_.textContent="Save changes",p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(c,"class","flex-fill"),p(_,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=g=!n[3]||n[2],x(h,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,O){w(C,e,O),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),H(a,e,null),k(e,u),k(e,f),k(f,c),k(f,d),$&&$.m(f,null),k(f,m),k(f,h),k(h,_),y=!0,S||(T=K(h,"click",n[12]),S=!0)},p(C,O){const D={};O&786433&&(D.$$scope={dirty:O,ctx:C}),i.$set(D);const I={};O&786433&&(I.$$scope={dirty:O,ctx:C}),o.$set(I);const L={};O&786433&&(L.$$scope={dirty:O,ctx:C}),a.$set(L),C[3]?$?$.p(C,O):($=t_(C),$.c(),$.m(f,m)):$&&($.d(1),$=null),(!y||O&12&&g!==(g=!C[3]||C[2]))&&(h.disabled=g),(!y||O&4)&&x(h,"btn-loading",C[2])},i(C){y||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),y=!0)},o(C){A(i.$$.fragment,C),A(o.$$.fragment,C),A(a.$$.fragment,C),y=!1},d(C){C&&v(e),z(i),z(o),z(a),$&&$.d(),S=!1,T()}}}function ZE(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function GE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Application name"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].meta.appName),r||(a=K(s,"input",n[8]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appName&&oe(s,u[0].meta.appName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function XE(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Application URL"),l=M(),s=b("input"),p(e,"for",i=n[18]),p(s,"type","text"),p(s,"id",o=n[18]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].meta.appUrl),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&262144&&i!==(i=u[18])&&p(e,"for",i),f&262144&&o!==(o=u[18])&&p(s,"id",o),f&1&&s.value!==u[0].meta.appUrl&&oe(s,u[0].meta.appUrl)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function QE(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Hide collection create and edit controls",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[18]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[18])},m(c,d){w(c,e,d),e.checked=n[0].meta.hideControls,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[10]),$e(Pe.call(null,r,{text:"This could prevent making accidental schema changes when in production environment.",position:"right"}))],u=!0)},p(c,d){d&262144&&t!==(t=c[18])&&p(e,"id",t),d&1&&(e.checked=c[0].meta.hideControls),d&262144&&a!==(a=c[18])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function t_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[11]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function xE(n){let e,t,i,l,s,o,r,a,u;const f=[ZE,JE],c=[];function d(m,h){return m[1]?0:1}return s=d(n),o=c[s]=f[s](n),{c(){e=b("header"),e.innerHTML='<nav class="breadcrumbs"><div class="breadcrumb-item">Settings</div> <div class="breadcrumb-item">Application</div></nav>',t=M(),i=b("div"),l=b("form"),o.c(),p(e,"class","page-header"),p(l,"class","panel"),p(l,"autocomplete","off"),p(i,"class","wrapper")},m(m,h){w(m,e,h),w(m,t,h),w(m,i,h),k(i,l),c[s].m(l,null),r=!0,a||(u=K(l,"submit",Ue(n[4])),a=!0)},p(m,h){let _=s;s=d(m),s===_?c[s].p(m,h):(ie(),A(c[_],1,1,()=>{c[_]=null}),le(),o=c[s],o?o.p(m,h):(o=c[s]=f[s](m),o.c()),E(o,1),o.m(l,null))},i(m){r||(E(o),r=!0)},o(m){A(o),r=!1},d(m){m&&(v(e),v(t),v(i)),c[s].d(),a=!1,u()}}}function eI(n){let e,t,i,l;return e=new gi({}),i=new bn({props:{$$slots:{default:[xE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&524303&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function tI(n,e,t){let i,l,s,o;We(n,Qi,C=>t(13,l=C)),We(n,Co,C=>t(14,s=C)),We(n,Lt,C=>t(15,o=C)),xt(Lt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await re.settings.getAll()||{};h(C)}catch(C){re.error(C)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const C=await re.settings.update(j.filterRedactedProps(a));h(C),Pt("Successfully saved application settings.")}catch(C){re.error(C)}t(2,f=!1)}}function h(C={}){var O,D;xt(Co,s=(O=C==null?void 0:C.meta)==null?void 0:O.appName,s),xt(Qi,l=!!((D=C==null?void 0:C.meta)!=null&&D.hideControls),l),t(0,a={meta:(C==null?void 0:C.meta)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),$=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,_,r,c,g,y,S,T,$]}class nI extends ge{constructor(e){super(),_e(this,e,tI,eI,me,{})}}function iI(n){let e,t,i,l=[{type:"password"},{autocomplete:"new-password"},n[5]],s={};for(let o=0;o<l.length;o+=1)s=Ae(s,l[o]);return{c(){e=b("input"),ni(e,s)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),oe(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){ni(e,s=dt(l,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&oe(e,o[0])},d(o){o&&v(e),n[7](null),t=!1,i()}}}function lI(n){let e,t,i,l,s,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Ae(a,r[u]);return{c(){e=b("div"),t=b("button"),t.innerHTML='<i class="ri-key-line"></i>',i=M(),l=b("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ni(l,a)},m(u,f){w(u,e,f),k(e,t),w(u,i,f),w(u,l,f),l.autofocus&&l.focus(),s||(o=[$e(Pe.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],s=!0)},p(u,f){ni(l,a=dt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&(v(e),v(i),v(l)),s=!1,we(o)}}}function sI(n){let e;function t(s,o){return s[3]?lI:iI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,[o]){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},i:Q,o:Q,d(s){s&&v(e),l.d(s)}}}function oI(n,e,t){const i=["value","mask"];let l=Xe(e,i),{value:s=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,s=""),t(3,a=!1),await Qt(),r==null||r.focus()}const f=()=>u();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){s=this.value,t(0,s)}return n.$$set=m=>{e=Ae(Ae({},e),Yt(m)),t(5,l=Xe(e,i)),"value"in m&&t(0,s=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=s===o)},[s,o,r,a,u,l,f,c,d]}class eu extends ge{constructor(e){super(),_e(this,e,oI,sI,me,{value:0,mask:1})}}function rI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;return{c(){e=b("label"),t=Z("Subject"),l=M(),s=b("input"),r=M(),a=b("div"),u=Z(`Available placeholder parameters:
|
||
`),f=b("button"),f.textContent="{APP_NAME} ",c=Z(`,
|
||
`),d=b("button"),d.textContent="{APP_URL} ",m=Z("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),k(e,t),w(g,l,y),w(g,s,y),oe(s,n[0].subject),w(g,r,y),w(g,a,y),k(a,u),k(a,f),k(a,c),k(a,d),k(a,m),h||(_=[K(s,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],h=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(s,"id",o),y[0]&1&&s.value!==g[0].subject&&oe(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,we(_)}}}function aI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y;return{c(){e=b("label"),t=Z("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),u=Z(`Available placeholder parameters:
|
||
`),f=b("button"),f.textContent="{APP_NAME} ",c=Z(`,
|
||
`),d=b("button"),d.textContent="{APP_URL} ",m=Z(`,
|
||
`),h=b("button"),h.textContent="{TOKEN} ",_=Z("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),k(e,t),w(S,l,T),w(S,s,T),oe(s,n[0].actionUrl),w(S,r,T),w(S,a,T),k(a,u),k(a,f),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),g||(y=[K(s,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[0]&1&&s.value!==S[0].actionUrl&&oe(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),g=!1,we(y)}}}function uI(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),oe(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&oe(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function fI(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=It(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),l=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){ie();const f=e;A(f.$$.fragment,1,0,()=>{z(f,1)}),le()}o?(e=It(o,r(a)),te.push(()=>be(e,"value",s)),V(e.$$.fragment),E(e.$$.fragment,1),H(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),e.$set(f)}},i(a){l||(e&&E(e.$$.fragment,a),l=!0)},o(a){e&&A(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&z(e,a)}}}function cI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$;const C=[fI,uI],O=[];function D(I,L){return I[4]&&!I[5]?0:1}return s=D(n),o=O[s]=C[s](n),{c(){e=b("label"),t=Z("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),u=Z(`Available placeholder parameters:
|
||
`),f=b("button"),f.textContent="{APP_NAME} ",c=Z(`,
|
||
`),d=b("button"),d.textContent="{APP_URL} ",m=Z(`,
|
||
`),h=b("button"),h.textContent="{TOKEN} ",_=Z(`,
|
||
`),g=b("button"),g.textContent="{ACTION_URL} ",y=Z("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(I,L){w(I,e,L),k(e,t),w(I,l,L),O[s].m(I,L),w(I,r,L),w(I,a,L),k(a,u),k(a,f),k(a,c),k(a,d),k(a,m),k(a,h),k(a,_),k(a,g),k(a,y),S=!0,T||($=[K(f,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(g,"click",n[25])],T=!0)},p(I,L){(!S||L[1]&1&&i!==(i=I[31]))&&p(e,"for",i);let R=s;s=D(I),s===R?O[s].p(I,L):(ie(),A(O[R],1,1,()=>{O[R]=null}),le(),o=O[s],o?o.p(I,L):(o=O[s]=C[s](I),o.c()),E(o,1),o.m(r.parentNode,r))},i(I){S||(E(o),S=!0)},o(I){A(o),S=!1},d(I){I&&(v(e),v(l),v(r),v(a)),O[s].d(I),T=!1,we($)}}}function dI(n){let e,t,i,l,s,o;return e=new ce({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[rI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new ce({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[aI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new ce({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[cI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,l,a),H(s,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}),s.$set(c)},i(r){o||(E(e.$$.fragment,r),E(i.$$.fragment,r),E(s.$$.fragment,r),o=!0)},o(r){A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),z(e,r),z(i,r),z(s,r)}}}function n_(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=$e(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Fe(e,Wt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function pI(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&n_();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=Z(n[2]),o=M(),r=b("div"),a=M(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),k(l,s),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(s,c[2]),c[6]?f?d[0]&64&&E(f,1):(f=n_(),f.c(),E(f,1),f.m(u.parentNode,u)):f&&(ie(),A(f,1,1,()=>{f=null}),le())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function mI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[pI],default:[dI]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=Ae(l,i[s]);return e=new mo({props:l}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(s,o){H(e,s,o),t=!0},p(s,o){const r=o[0]&256?dt(i,[Dt(s[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){A(e.$$.fragment,s),t=!1},d(s){n[26](null),z(e,s)}}}let i_;function hI(n,e,t){let i;const l=["key","title","config","expand","collapse","collapseSiblings"];let s=Xe(e,l),o;We(n,hi,W=>t(12,o=W));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=i_,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await tt(async()=>{const{default:W}=await import("./CodeEditor-BZmYqzs5.js");return{default:W}},__vite__mapDeps([2,1]),import.meta.url)).default),i_=c,t(5,d=!1))}function y(W){j.copyToClipboard(W),So(`Copied ${W} to clipboard`,2e3)}g();function S(){u.subject=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function C(){u.actionUrl=this.value,t(0,u)}const O=()=>y("{APP_NAME}"),D=()=>y("{APP_URL}"),I=()=>y("{TOKEN}");function L(W){n.$$.not_equal(u.body,W)&&(u.body=W,t(0,u))}function R(){u.body=this.value,t(0,u)}const F=()=>y("{APP_NAME}"),N=()=>y("{APP_URL}"),P=()=>y("{TOKEN}"),q=()=>y("{ACTION_URL}");function U(W){te[W?"unshift":"push"](()=>{f=W,t(3,f)})}function Y(W){Ce.call(this,n,W)}function J(W){Ce.call(this,n,W)}function B(W){Ce.call(this,n,W)}return n.$$set=W=>{e=Ae(Ae({},e),Yt(W)),t(8,s=Xe(e,l)),"key"in W&&t(1,r=W.key),"title"in W&&t(2,a=W.title),"config"in W&&t(0,u=W.config)},n.$$.update=()=>{n.$$.dirty[0]&4098&&t(6,i=!j.isEmpty(j.getNestedVal(o,r))),n.$$.dirty[0]&3&&(u.enabled||li(r))},[u,r,a,f,c,d,i,y,s,m,h,_,o,S,T,$,C,O,D,I,L,R,F,N,P,q,U,Y,J,B]}class tu extends ge{constructor(e){super(),_e(this,e,hI,mI,me,{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 l_(n,e,t){const i=n.slice();return i[21]=e[t],i}function s_(n,e){let t,i,l,s,o,r=e[21].label+"",a,u,f,c,d,m;return c=T0(e[11][0]),{key:n,first:null,c(){t=b("div"),i=b("input"),s=M(),o=b("label"),a=Z(r),f=M(),p(i,"type","radio"),p(i,"name","template"),p(i,"id",l=e[20]+e[21].value),i.__value=e[21].value,oe(i,i.__value),p(o,"for",u=e[20]+e[21].value),p(t,"class","form-field-block"),c.p(i),this.first=t},m(h,_){w(h,t,_),k(t,i),i.checked=i.__value===e[2],k(t,s),k(t,o),k(o,a),k(t,f),d||(m=K(i,"change",e[10]),d=!0)},p(h,_){e=h,_&1048576&&l!==(l=e[20]+e[21].value)&&p(i,"id",l),_&4&&(i.checked=i.__value===e[2]),_&1048576&&u!==(u=e[20]+e[21].value)&&p(o,"for",u)},d(h){h&&v(t),c.r(),d=!1,m()}}}function _I(n){let e=[],t=new Map,i,l=fe(n[7]);const s=o=>o[21].value;for(let o=0;o<l.length;o+=1){let r=l_(n,l,o),a=s(r);t.set(a,e[o]=s_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r&1048708&&(l=fe(o[7]),e=at(e,r,s,1,o,l,t,i.parentNode,Li,s_,i,l_))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function gI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("To email address"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","email"),p(s,"id",o=n[20]),s.autofocus=!0,s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[1]),s.focus(),r||(a=K(s,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&2&&s.value!==u[1]&&oe(s,u[1])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function bI(n){let e,t,i,l,s,o,r;return t=new ce({props:{class:"form-field required",name:"template",$$slots:{default:[_I,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),l=new ce({props:{class:"form-field required m-0",name:"email",$$slots:{default:[gI,({uniqueId:a})=>({20:a}),({uniqueId:a})=>a?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=M(),V(l.$$.fragment),p(e,"id",n[6]),p(e,"autocomplete","off")},m(a,u){w(a,e,u),H(t,e,null),k(e,i),H(l,e,null),s=!0,o||(r=K(e,"submit",Ue(n[13])),o=!0)},p(a,u){const f={};u&17825796&&(f.$$scope={dirty:u,ctx:a}),t.$set(f);const c={};u&17825794&&(c.$$scope={dirty:u,ctx:a}),l.$set(c)},i(a){s||(E(t.$$.fragment,a),E(l.$$.fragment,a),s=!0)},o(a){A(t.$$.fragment,a),A(l.$$.fragment,a),s=!1},d(a){a&&v(e),z(t),z(l),o=!1,r()}}}function kI(n){let e;return{c(){e=b("h4"),e.textContent="Send test email",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Z("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Send",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","ri-mail-send-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[5]||n[4],x(l,"btn-loading",n[4])},m(c,d){w(c,e,d),k(e,t),w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&16&&(e.disabled=c[4]),d&48&&a!==(a=!c[5]||c[4])&&(l.disabled=a),d&16&&x(l,"btn-loading",c[4])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function vI(n){let e,t,i={class:"overlay-panel-sm email-test-popup",overlayClose:!n[4],escClose:!n[4],beforeHide:n[14],popup:!0,$$slots:{footer:[yI],header:[kI],default:[bI]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[15](e),e.$on("show",n[16]),e.$on("hide",n[17]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[14]),s&16777270&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[15](null),z(e,l)}}}const qr="last_email_test",o_="email_test_request";function wI(n,e,t){let i;const l=lt(),s="email_test_"+j.randomString(5),o=[{label:'"Verification" template',value:"verification"},{label:'"Password reset" template',value:"password-reset"},{label:'"Confirm email change" template',value:"email-change"}];let r,a=localStorage.getItem(qr),u=o[0].value,f=!1,c=null;function d(D="",I=""){t(1,a=D||localStorage.getItem(qr)),t(2,u=I||o[0].value),Zt({}),r==null||r.show()}function m(){return clearTimeout(c),r==null?void 0:r.hide()}async function h(){if(!(!i||f)){t(4,f=!0),localStorage==null||localStorage.setItem(qr,a),clearTimeout(c),c=setTimeout(()=>{re.cancelRequest(o_),ii("Test email send timeout.")},3e4);try{await re.settings.testEmail(a,u,{$cancelKey:o_}),Pt("Successfully sent test email."),l("submit"),t(4,f=!1),await Qt(),m()}catch(D){t(4,f=!1),re.error(D)}clearTimeout(c)}}const _=[[]];function g(){u=this.__value,t(2,u)}function y(){a=this.value,t(1,a)}const S=()=>h(),T=()=>!f;function $(D){te[D?"unshift":"push"](()=>{r=D,t(3,r)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=!!a&&!!u)},[m,a,u,r,f,i,s,o,h,d,g,_,y,S,T,$,C,O]}class SI extends ge{constructor(e){super(),_e(this,e,wI,vI,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function $I(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$;i=new ce({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[CI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[OI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let C=!n[0].meta.verificationTemplate.hidden&&r_(n),O=!n[0].meta.resetPasswordTemplate.hidden&&a_(n),D=!n[0].meta.confirmEmailChangeTemplate.hidden&&u_(n);h=new ce({props:{class:"form-field form-field-toggle m-b-sm",$$slots:{default:[MI,({uniqueId:N})=>({34:N}),({uniqueId:N})=>[0,N?8:0]]},$$scope:{ctx:n}}});let I=n[0].smtp.enabled&&f_(n);function L(N,P){return N[5]?jI:qI}let R=L(n),F=R(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),r=M(),a=b("div"),C&&C.c(),u=M(),O&&O.c(),f=M(),D&&D.c(),c=M(),d=b("hr"),m=M(),V(h.$$.fragment),_=M(),I&&I.c(),g=M(),y=b("div"),S=b("div"),T=M(),F.c(),p(t,"class","col-lg-6"),p(s,"class","col-lg-6"),p(e,"class","grid m-b-base"),p(a,"class","accordions"),p(S,"class","flex-fill"),p(y,"class","flex")},m(N,P){w(N,e,P),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),w(N,r,P),w(N,a,P),C&&C.m(a,null),k(a,u),O&&O.m(a,null),k(a,f),D&&D.m(a,null),w(N,c,P),w(N,d,P),w(N,m,P),H(h,N,P),w(N,_,P),I&&I.m(N,P),w(N,g,P),w(N,y,P),k(y,S),k(y,T),F.m(y,null),$=!0},p(N,P){const q={};P[0]&1|P[1]&24&&(q.$$scope={dirty:P,ctx:N}),i.$set(q);const U={};P[0]&1|P[1]&24&&(U.$$scope={dirty:P,ctx:N}),o.$set(U),N[0].meta.verificationTemplate.hidden?C&&(ie(),A(C,1,1,()=>{C=null}),le()):C?(C.p(N,P),P[0]&1&&E(C,1)):(C=r_(N),C.c(),E(C,1),C.m(a,u)),N[0].meta.resetPasswordTemplate.hidden?O&&(ie(),A(O,1,1,()=>{O=null}),le()):O?(O.p(N,P),P[0]&1&&E(O,1)):(O=a_(N),O.c(),E(O,1),O.m(a,f)),N[0].meta.confirmEmailChangeTemplate.hidden?D&&(ie(),A(D,1,1,()=>{D=null}),le()):D?(D.p(N,P),P[0]&1&&E(D,1)):(D=u_(N),D.c(),E(D,1),D.m(a,null));const Y={};P[0]&1|P[1]&24&&(Y.$$scope={dirty:P,ctx:N}),h.$set(Y),N[0].smtp.enabled?I?(I.p(N,P),P[0]&1&&E(I,1)):(I=f_(N),I.c(),E(I,1),I.m(g.parentNode,g)):I&&(ie(),A(I,1,1,()=>{I=null}),le()),R===(R=L(N))&&F?F.p(N,P):(F.d(1),F=R(N),F&&(F.c(),F.m(y,null)))},i(N){$||(E(i.$$.fragment,N),E(o.$$.fragment,N),E(C),E(O),E(D),E(h.$$.fragment,N),E(I),$=!0)},o(N){A(i.$$.fragment,N),A(o.$$.fragment,N),A(C),A(O),A(D),A(h.$$.fragment,N),A(I),$=!1},d(N){N&&(v(e),v(r),v(a),v(c),v(d),v(m),v(_),v(g),v(y)),z(i),z(o),C&&C.d(),O&&O.d(),D&&D.d(),z(h,N),I&&I.d(N),F.d()}}}function TI(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function CI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Sender name"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].meta.senderName),r||(a=K(s,"input",n[13]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderName&&oe(s,u[0].meta.senderName)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function OI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Sender address"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","email"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].meta.senderAddress),r||(a=K(s,"input",n[14]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].meta.senderAddress&&oe(s,u[0].meta.senderAddress)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function r_(n){let e,t,i;function l(o){n[15](o)}let s={single:!0,key:"meta.verificationTemplate",title:'Default "Verification" email template'};return n[0].meta.verificationTemplate!==void 0&&(s.config=n[0].meta.verificationTemplate),e=new tu({props:s}),te.push(()=>be(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.verificationTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function a_(n){let e,t,i;function l(o){n[16](o)}let s={single:!0,key:"meta.resetPasswordTemplate",title:'Default "Password reset" email template'};return n[0].meta.resetPasswordTemplate!==void 0&&(s.config=n[0].meta.resetPasswordTemplate),e=new tu({props:s}),te.push(()=>be(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.resetPasswordTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function u_(n){let e,t,i;function l(o){n[17](o)}let s={single:!0,key:"meta.confirmEmailChangeTemplate",title:'Default "Confirm email change" email template'};return n[0].meta.confirmEmailChangeTemplate!==void 0&&(s.config=n[0].meta.confirmEmailChangeTemplate),e=new tu({props:s}),te.push(()=>be(e,"config",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&1&&(t=!0,a.config=o[0].meta.confirmEmailChangeTemplate,ke(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){A(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function MI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.innerHTML="Use SMTP mail server <strong>(recommended)</strong>",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[34]),e.required=!0,p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[34])},m(c,d){w(c,e,d),e.checked=n[0].smtp.enabled,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[18]),$e(Pe.call(null,r,{text:'By default PocketBase uses the unix "sendmail" command for sending emails. For better emails deliverability it is recommended to use a SMTP mail server.',position:"top"}))],u=!0)},p(c,d){d[1]&8&&t!==(t=c[34])&&p(e,"id",t),d[0]&1&&(e.checked=c[0].smtp.enabled),d[1]&8&&a!==(a=c[34])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function f_(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$;l=new ce({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[DI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[EI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),f=new ce({props:{class:"form-field",name:"smtp.username",$$slots:{default:[II,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}}),m=new ce({props:{class:"form-field",name:"smtp.password",$$slots:{default:[AI,({uniqueId:L})=>({34:L}),({uniqueId:L})=>[0,L?8:0]]},$$scope:{ctx:n}}});function C(L,R){return L[4]?NI:LI}let O=C(n),D=O(n),I=n[4]&&c_(n);return{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("div"),V(r.$$.fragment),a=M(),u=b("div"),V(f.$$.fragment),c=M(),d=b("div"),V(m.$$.fragment),h=M(),_=b("button"),D.c(),g=M(),I&&I.c(),p(i,"class","col-lg-4"),p(o,"class","col-lg-2"),p(u,"class","col-lg-3"),p(d,"class","col-lg-3"),p(t,"class","grid"),p(_,"type","button"),p(_,"class","btn btn-sm btn-secondary m-t-sm m-b-sm")},m(L,R){w(L,e,R),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),k(t,a),k(t,u),H(f,u,null),k(t,c),k(t,d),H(m,d,null),k(e,h),k(e,_),D.m(_,null),k(e,g),I&&I.m(e,null),S=!0,T||($=K(_,"click",Ue(n[23])),T=!0)},p(L,R){const F={};R[0]&1|R[1]&24&&(F.$$scope={dirty:R,ctx:L}),l.$set(F);const N={};R[0]&1|R[1]&24&&(N.$$scope={dirty:R,ctx:L}),r.$set(N);const P={};R[0]&1|R[1]&24&&(P.$$scope={dirty:R,ctx:L}),f.$set(P);const q={};R[0]&1|R[1]&24&&(q.$$scope={dirty:R,ctx:L}),m.$set(q),O!==(O=C(L))&&(D.d(1),D=O(L),D&&(D.c(),D.m(_,null))),L[4]?I?(I.p(L,R),R[0]&16&&E(I,1)):(I=c_(L),I.c(),E(I,1),I.m(e,null)):I&&(ie(),A(I,1,1,()=>{I=null}),le())},i(L){S||(E(l.$$.fragment,L),E(r.$$.fragment,L),E(f.$$.fragment,L),E(m.$$.fragment,L),E(I),L&&Ke(()=>{S&&(y||(y=Fe(e,et,{duration:150},!0)),y.run(1))}),S=!0)},o(L){A(l.$$.fragment,L),A(r.$$.fragment,L),A(f.$$.fragment,L),A(m.$$.fragment,L),A(I),L&&(y||(y=Fe(e,et,{duration:150},!1)),y.run(0)),S=!1},d(L){L&&v(e),z(l),z(r),z(f),z(m),D.d(),I&&I.d(),L&&y&&y.end(),T=!1,$()}}}function DI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("SMTP server host"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].smtp.host),r||(a=K(s,"input",n[19]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.host&&oe(s,u[0].smtp.host)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function EI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Port"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","number"),p(s,"id",o=n[34]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].smtp.port),r||(a=K(s,"input",n[20]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&it(s.value)!==u[0].smtp.port&&oe(s,u[0].smtp.port)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function II(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Username"),l=M(),s=b("input"),p(e,"for",i=n[34]),p(s,"type","text"),p(s,"id",o=n[34])},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].smtp.username),r||(a=K(s,"input",n[21]),r=!0)},p(u,f){f[1]&8&&i!==(i=u[34])&&p(e,"for",i),f[1]&8&&o!==(o=u[34])&&p(s,"id",o),f[0]&1&&s.value!==u[0].smtp.username&&oe(s,u[0].smtp.username)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function AI(n){let e,t,i,l,s,o,r;function a(f){n[22](f)}let u={id:n[34]};return n[0].smtp.password!==void 0&&(u.value=n[0].smtp.password),s=new eu({props:u}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=Z("Password"),l=M(),V(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),k(e,t),w(f,l,c),H(s,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.value=f[0].smtp.password,ke(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){A(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),z(s,f)}}}function LI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Show more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-down-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function NI(n){let e,t,i;return{c(){e=b("span"),e.textContent="Hide more options",t=M(),i=b("i"),p(e,"class","txt"),p(i,"class","ri-arrow-up-s-line")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function c_(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return i=new ce({props:{class:"form-field",name:"smtp.tls",$$slots:{default:[PI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field",name:"smtp.authMethod",$$slots:{default:[FI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field",name:"smtp.localName",$$slots:{default:[RI,({uniqueId:h})=>({34:h}),({uniqueId:h})=>[0,h?8:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),r=M(),a=b("div"),V(u.$$.fragment),f=M(),c=b("div"),p(t,"class","col-lg-3"),p(s,"class","col-lg-3"),p(a,"class","col-lg-6"),p(c,"class","col-lg-12"),p(e,"class","grid")},m(h,_){w(h,e,_),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(u,a,null),k(e,f),k(e,c),m=!0},p(h,_){const g={};_[0]&1|_[1]&24&&(g.$$scope={dirty:_,ctx:h}),i.$set(g);const y={};_[0]&1|_[1]&24&&(y.$$scope={dirty:_,ctx:h}),o.$set(y);const S={};_[0]&1|_[1]&24&&(S.$$scope={dirty:_,ctx:h}),u.$set(S)},i(h){m||(E(i.$$.fragment,h),E(o.$$.fragment,h),E(u.$$.fragment,h),h&&Ke(()=>{m&&(d||(d=Fe(e,et,{duration:150},!0)),d.run(1))}),m=!0)},o(h){A(i.$$.fragment,h),A(o.$$.fragment,h),A(u.$$.fragment,h),h&&(d||(d=Fe(e,et,{duration:150},!1)),d.run(0)),m=!1},d(h){h&&v(e),z(i),z(o),z(u),h&&d&&d.end()}}}function PI(n){let e,t,i,l,s,o,r;function a(f){n[24](f)}let u={id:n[34],items:n[7]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),s=new _i({props:u}),te.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=Z("TLS encryption"),l=M(),V(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),k(e,t),w(f,l,c),H(s,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.tls,ke(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){A(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),z(s,f)}}}function FI(n){let e,t,i,l,s,o,r;function a(f){n[25](f)}let u={id:n[34],items:n[8]};return n[0].smtp.authMethod!==void 0&&(u.keyOfSelected=n[0].smtp.authMethod),s=new _i({props:u}),te.push(()=>be(s,"keyOfSelected",a)),{c(){e=b("label"),t=Z("AUTH method"),l=M(),V(s.$$.fragment),p(e,"for",i=n[34])},m(f,c){w(f,e,c),k(e,t),w(f,l,c),H(s,f,c),r=!0},p(f,c){(!r||c[1]&8&&i!==(i=f[34]))&&p(e,"for",i);const d={};c[1]&8&&(d.id=f[34]),!o&&c[0]&1&&(o=!0,d.keyOfSelected=f[0].smtp.authMethod,ke(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){A(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),z(s,f)}}}function RI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=b("span"),t.textContent="EHLO/HELO domain",i=M(),l=b("i"),o=M(),r=b("input"),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[34]),p(r,"type","text"),p(r,"id",a=n[34]),p(r,"placeholder","Default to localhost")},m(c,d){w(c,e,d),k(e,t),k(e,i),k(e,l),w(c,o,d),w(c,r,d),oe(r,n[0].smtp.localName),u||(f=[$e(Pe.call(null,l,{text:"Some SMTP servers, such as the Gmail SMTP-relay, requires a proper domain name in the inital EHLO/HELO exchange and will reject attempts to use localhost.",position:"top"})),K(r,"input",n[26])],u=!0)},p(c,d){d[1]&8&&s!==(s=c[34])&&p(e,"for",s),d[1]&8&&a!==(a=c[34])&&p(r,"id",a),d[0]&1&&r.value!==c[0].smtp.localName&&oe(r,c[0].smtp.localName)},d(c){c&&(v(e),v(o),v(r)),u=!1,we(f)}}}function qI(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<i class="ri-mail-check-line"></i> <span class="txt">Send test email</span>',p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function jI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[3],x(l,"btn-loading",n[3])},m(u,f){w(u,e,f),k(e,t),w(u,i,f),w(u,l,f),k(l,s),r||(a=[K(e,"click",n[27]),K(l,"click",n[28])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&40&&o!==(o=!u[5]||u[3])&&(l.disabled=o),f[0]&8&&x(l,"btn-loading",u[3])},d(u){u&&(v(e),v(i),v(l)),r=!1,we(a)}}}function HI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const y=[TI,$I],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[6]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,u),k(u,f),k(u,c),S[d].m(u,null),h=!0,_||(g=K(u,"submit",Ue(n[30])),_=!0)},p($,C){(!h||C[0]&64)&&se(o,$[6]);let O=d;d=T($),d===O?S[d].p($,C):(ie(),A(S[O],1,1,()=>{S[O]=null}),le(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(u,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function zI(n){let e,t,i,l,s,o;e=new gi({}),i=new bn({props:{$$slots:{default:[HI]},$$scope:{ctx:n}}});let r={};return s=new SI({props:r}),n[31](s),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,l,u),H(s,a,u),o=!0},p(a,u){const f={};u[0]&127|u[1]&16&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[31](null),z(s,a)}}}function VI(n,e,t){let i,l,s;We(n,Lt,ee=>t(6,s=ee));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];xt(Lt,s="Mail settings",s);let a,u={},f={},c=!1,d=!1,m=!1;h();async function h(){t(2,c=!0);try{const ee=await re.settings.getAll()||{};g(ee)}catch(ee){re.error(ee)}t(2,c=!1)}async function _(){if(!(d||!l)){t(3,d=!0);try{const ee=await re.settings.update(j.filterRedactedProps(f));g(ee),Zt({}),Pt("Successfully saved mail settings.")}catch(ee){re.error(ee)}t(3,d=!1)}}function g(ee={}){t(0,f={meta:(ee==null?void 0:ee.meta)||{},smtp:(ee==null?void 0:ee.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(11,u=JSON.parse(JSON.stringify(f)))}function y(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function S(){f.meta.senderName=this.value,t(0,f)}function T(){f.meta.senderAddress=this.value,t(0,f)}function $(ee){n.$$.not_equal(f.meta.verificationTemplate,ee)&&(f.meta.verificationTemplate=ee,t(0,f))}function C(ee){n.$$.not_equal(f.meta.resetPasswordTemplate,ee)&&(f.meta.resetPasswordTemplate=ee,t(0,f))}function O(ee){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ee)&&(f.meta.confirmEmailChangeTemplate=ee,t(0,f))}function D(){f.smtp.enabled=this.checked,t(0,f)}function I(){f.smtp.host=this.value,t(0,f)}function L(){f.smtp.port=it(this.value),t(0,f)}function R(){f.smtp.username=this.value,t(0,f)}function F(ee){n.$$.not_equal(f.smtp.password,ee)&&(f.smtp.password=ee,t(0,f))}const N=()=>{t(4,m=!m)};function P(ee){n.$$.not_equal(f.smtp.tls,ee)&&(f.smtp.tls=ee,t(0,f))}function q(ee){n.$$.not_equal(f.smtp.authMethod,ee)&&(f.smtp.authMethod=ee,t(0,f))}function U(){f.smtp.localName=this.value,t(0,f)}const Y=()=>y(),J=()=>_(),B=()=>a==null?void 0:a.show(),W=()=>_();function pe(ee){te[ee?"unshift":"push"](()=>{a=ee,t(1,a)})}return n.$$.update=()=>{n.$$.dirty[0]&2048&&t(12,i=JSON.stringify(u)),n.$$.dirty[0]&4097&&t(5,l=i!=JSON.stringify(f))},[f,a,c,d,m,l,s,o,r,_,y,u,i,S,T,$,C,O,D,I,L,R,F,N,P,q,U,Y,J,B,W,pe]}class BI extends ge{constructor(e){super(),_e(this,e,VI,zI,me,{},null,[-1,-1])}}const UI=n=>({isTesting:n&4,testError:n&2,enabled:n&1}),d_=n=>({isTesting:n[2],testError:n[1],enabled:n[0].enabled});function WI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z(n[4]),p(e,"type","checkbox"),p(e,"id",t=n[20]),e.required=!0,p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[8]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&16&&se(s,u[4]),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function p_(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O;return i=new ce({props:{class:"form-field required",name:n[3]+".endpoint",$$slots:{default:[YI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),o=new ce({props:{class:"form-field required",name:n[3]+".bucket",$$slots:{default:[KI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field required",name:n[3]+".region",$$slots:{default:[JI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),d=new ce({props:{class:"form-field required",name:n[3]+".accessKey",$$slots:{default:[ZI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),_=new ce({props:{class:"form-field required",name:n[3]+".secret",$$slots:{default:[GI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),S=new ce({props:{class:"form-field",name:n[3]+".forcePathStyle",$$slots:{default:[XI,({uniqueId:D})=>({20:D}),({uniqueId:D})=>D?1048576:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),r=M(),a=b("div"),V(u.$$.fragment),f=M(),c=b("div"),V(d.$$.fragment),m=M(),h=b("div"),V(_.$$.fragment),g=M(),y=b("div"),V(S.$$.fragment),T=M(),$=b("div"),p(t,"class","col-lg-6"),p(s,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(h,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(D,I){w(D,e,I),k(e,t),H(i,t,null),k(e,l),k(e,s),H(o,s,null),k(e,r),k(e,a),H(u,a,null),k(e,f),k(e,c),H(d,c,null),k(e,m),k(e,h),H(_,h,null),k(e,g),k(e,y),H(S,y,null),k(e,T),k(e,$),O=!0},p(D,I){const L={};I&8&&(L.name=D[3]+".endpoint"),I&1081345&&(L.$$scope={dirty:I,ctx:D}),i.$set(L);const R={};I&8&&(R.name=D[3]+".bucket"),I&1081345&&(R.$$scope={dirty:I,ctx:D}),o.$set(R);const F={};I&8&&(F.name=D[3]+".region"),I&1081345&&(F.$$scope={dirty:I,ctx:D}),u.$set(F);const N={};I&8&&(N.name=D[3]+".accessKey"),I&1081345&&(N.$$scope={dirty:I,ctx:D}),d.$set(N);const P={};I&8&&(P.name=D[3]+".secret"),I&1081345&&(P.$$scope={dirty:I,ctx:D}),_.$set(P);const q={};I&8&&(q.name=D[3]+".forcePathStyle"),I&1081345&&(q.$$scope={dirty:I,ctx:D}),S.$set(q)},i(D){O||(E(i.$$.fragment,D),E(o.$$.fragment,D),E(u.$$.fragment,D),E(d.$$.fragment,D),E(_.$$.fragment,D),E(S.$$.fragment,D),D&&Ke(()=>{O&&(C||(C=Fe(e,et,{duration:150},!0)),C.run(1))}),O=!0)},o(D){A(i.$$.fragment,D),A(o.$$.fragment,D),A(u.$$.fragment,D),A(d.$$.fragment,D),A(_.$$.fragment,D),A(S.$$.fragment,D),D&&(C||(C=Fe(e,et,{duration:150},!1)),C.run(0)),O=!1},d(D){D&&v(e),z(i),z(o),z(u),z(d),z(_),z(S),D&&C&&C.end()}}}function YI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Endpoint"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].endpoint),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].endpoint&&oe(s,u[0].endpoint)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function KI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Bucket"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].bucket),r||(a=K(s,"input",n[10]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].bucket&&oe(s,u[0].bucket)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function JI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Region"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].region),r||(a=K(s,"input",n[11]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].region&&oe(s,u[0].region)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function ZI(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Access key"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[0].accessKey),r||(a=K(s,"input",n[12]),r=!0)},p(u,f){f&1048576&&i!==(i=u[20])&&p(e,"for",i),f&1048576&&o!==(o=u[20])&&p(s,"id",o),f&1&&s.value!==u[0].accessKey&&oe(s,u[0].accessKey)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function GI(n){let e,t,i,l,s,o,r;function a(f){n[13](f)}let u={id:n[20],required:!0};return n[0].secret!==void 0&&(u.value=n[0].secret),s=new eu({props:u}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=Z("Secret"),l=M(),V(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),k(e,t),w(f,l,c),H(s,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),!o&&c&1&&(o=!0,d.value=f[0].secret,ke(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){A(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),z(s,f)}}}function XI(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Force path-style addressing",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[20])},m(c,d){w(c,e,d),e.checked=n[0].forcePathStyle,w(c,i,d),w(c,l,d),k(l,s),k(l,o),k(l,r),u||(f=[K(e,"change",n[14]),$e(Pe.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&1048576&&t!==(t=c[20])&&p(e,"id",t),d&1&&(e.checked=c[0].forcePathStyle),d&1048576&&a!==(a=c[20])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function QI(n){let e,t,i,l,s;e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[WI,({uniqueId:u})=>({20:u}),({uniqueId:u})=>u?1048576:0]},$$scope:{ctx:n}}});const o=n[7].default,r=St(o,n,n[15],d_);let a=n[0].enabled&&p_(n);return{c(){V(e.$$.fragment),t=M(),r&&r.c(),i=M(),a&&a.c(),l=ye()},m(u,f){H(e,u,f),w(u,t,f),r&&r.m(u,f),w(u,i,f),a&&a.m(u,f),w(u,l,f),s=!0},p(u,[f]){const c={};f&1081361&&(c.$$scope={dirty:f,ctx:u}),e.$set(c),r&&r.p&&(!s||f&32775)&&Tt(r,o,u,u[15],s?$t(o,u[15],f,UI):Ct(u[15]),d_),u[0].enabled?a?(a.p(u,f),f&1&&E(a,1)):(a=p_(u),a.c(),E(a,1),a.m(l.parentNode,l)):a&&(ie(),A(a,1,1,()=>{a=null}),le())},i(u){s||(E(e.$$.fragment,u),E(r,u),E(a),s=!0)},o(u){A(e.$$.fragment,u),A(r,u),A(a),s=!1},d(u){u&&(v(t),v(i),v(l)),z(e,u),r&&r.d(u),a&&a.d(u)}}}const jr="s3_test_request";function xI(n,e,t){let{$$slots:i={},$$scope:l}=e,{originalConfig:s={}}=e,{config:o={}}=e,{configKey:r="s3"}=e,{toggleLabel:a="Enable S3"}=e,{testFilesystem:u="storage"}=e,{testError:f=null}=e,{isTesting:c=!1}=e,d=null,m=null;function h(D){t(2,c=!0),clearTimeout(m),m=setTimeout(()=>{_()},D)}async function _(){if(t(1,f=null),!o.enabled)return t(2,c=!1),f;re.cancelRequest(jr),clearTimeout(d),d=setTimeout(()=>{re.cancelRequest(jr),t(1,f=new Error("S3 test connection timeout.")),t(2,c=!1)},3e4),t(2,c=!0);let D;try{await re.settings.testS3(u,{$cancelKey:jr})}catch(I){D=I}return D!=null&&D.isAbort||(t(1,f=D),t(2,c=!1),clearTimeout(d)),f}Kt(()=>()=>{clearTimeout(d),clearTimeout(m)});function g(){o.enabled=this.checked,t(0,o)}function y(){o.endpoint=this.value,t(0,o)}function S(){o.bucket=this.value,t(0,o)}function T(){o.region=this.value,t(0,o)}function $(){o.accessKey=this.value,t(0,o)}function C(D){n.$$.not_equal(o.secret,D)&&(o.secret=D,t(0,o))}function O(){o.forcePathStyle=this.checked,t(0,o)}return n.$$set=D=>{"originalConfig"in D&&t(5,s=D.originalConfig),"config"in D&&t(0,o=D.config),"configKey"in D&&t(3,r=D.configKey),"toggleLabel"in D&&t(4,a=D.toggleLabel),"testFilesystem"in D&&t(6,u=D.testFilesystem),"testError"in D&&t(1,f=D.testError),"isTesting"in D&&t(2,c=D.isTesting),"$$scope"in D&&t(15,l=D.$$scope)},n.$$.update=()=>{n.$$.dirty&32&&s!=null&&s.enabled&&h(100),n.$$.dirty&9&&(o.enabled||li(r))},[o,f,c,r,a,s,u,i,g,y,S,T,$,C,O,l]}class o0 extends ge{constructor(e){super(),_e(this,e,xI,QI,me,{originalConfig:5,config:0,configKey:3,toggleLabel:4,testFilesystem:6,testError:1,isTesting:2})}}function eA(n){var D;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;function y(I){n[11](I)}function S(I){n[12](I)}function T(I){n[13](I)}let $={toggleLabel:"Use S3 storage",originalConfig:n[0].s3,$$slots:{default:[nA]},$$scope:{ctx:n}};n[1].s3!==void 0&&($.config=n[1].s3),n[4]!==void 0&&($.isTesting=n[4]),n[5]!==void 0&&($.testError=n[5]),e=new o0({props:$}),te.push(()=>be(e,"config",y)),te.push(()=>be(e,"isTesting",S)),te.push(()=>be(e,"testError",T));let C=((D=n[1].s3)==null?void 0:D.enabled)&&!n[6]&&!n[3]&&h_(n),O=n[6]&&__(n);return{c(){V(e.$$.fragment),s=M(),o=b("div"),r=b("div"),a=M(),C&&C.c(),u=M(),O&&O.c(),f=M(),c=b("button"),d=b("span"),d.textContent="Save changes",p(r,"class","flex-fill"),p(d,"class","txt"),p(c,"type","submit"),p(c,"class","btn btn-expanded"),c.disabled=m=!n[6]||n[3],x(c,"btn-loading",n[3]),p(o,"class","flex")},m(I,L){H(e,I,L),w(I,s,L),w(I,o,L),k(o,r),k(o,a),C&&C.m(o,null),k(o,u),O&&O.m(o,null),k(o,f),k(o,c),k(c,d),h=!0,_||(g=K(c,"click",n[15]),_=!0)},p(I,L){var F;const R={};L&1&&(R.originalConfig=I[0].s3),L&524291&&(R.$$scope={dirty:L,ctx:I}),!t&&L&2&&(t=!0,R.config=I[1].s3,ke(()=>t=!1)),!i&&L&16&&(i=!0,R.isTesting=I[4],ke(()=>i=!1)),!l&&L&32&&(l=!0,R.testError=I[5],ke(()=>l=!1)),e.$set(R),(F=I[1].s3)!=null&&F.enabled&&!I[6]&&!I[3]?C?C.p(I,L):(C=h_(I),C.c(),C.m(o,u)):C&&(C.d(1),C=null),I[6]?O?O.p(I,L):(O=__(I),O.c(),O.m(o,f)):O&&(O.d(1),O=null),(!h||L&72&&m!==(m=!I[6]||I[3]))&&(c.disabled=m),(!h||L&8)&&x(c,"btn-loading",I[3])},i(I){h||(E(e.$$.fragment,I),h=!0)},o(I){A(e.$$.fragment,I),h=!1},d(I){I&&(v(s),v(o)),z(e,I),C&&C.d(),O&&O.d(),_=!1,g()}}}function tA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function m_(n){var L;let e,t,i,l,s,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",m,h,_,g,y,S,T,$,C,O,D,I;return{c(){e=b("div"),t=b("div"),i=b("div"),i.innerHTML='<i class="ri-error-warning-line"></i>',l=M(),s=b("div"),o=Z(`If you have existing uploaded files, you'll have to migrate them manually
|
||
from the
|
||
`),r=b("strong"),u=Z(a),f=Z(`
|
||
to the
|
||
`),c=b("strong"),m=Z(d),h=Z(`.
|
||
`),_=b("br"),g=Z(`
|
||
There are numerous command line tools that can help you, such as:
|
||
`),y=b("a"),y.textContent=`rclone
|
||
`,S=Z(`,
|
||
`),T=b("a"),T.textContent=`s5cmd
|
||
`,$=Z(", etc."),C=M(),O=b("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(O,"class","clearfix m-t-base")},m(R,F){w(R,e,F),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),k(s,r),k(r,u),k(s,f),k(s,c),k(c,m),k(s,h),k(s,_),k(s,g),k(s,y),k(s,S),k(s,T),k(s,$),k(e,C),k(e,O),I=!0},p(R,F){var N;(!I||F&1)&&a!==(a=(N=R[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&se(u,a),(!I||F&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(R){I||(R&&Ke(()=>{I&&(D||(D=Fe(e,et,{duration:150},!0)),D.run(1))}),I=!0)},o(R){R&&(D||(D=Fe(e,et,{duration:150},!1)),D.run(0)),I=!1},d(R){R&&v(e),R&&D&&D.end()}}}function nA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&m_(n);return{c(){t&&t.c(),e=ye()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&E(t,1)):(t=m_(l),t.c(),E(t,1),t.m(e.parentNode,e)):t&&(ie(),A(t,1,1,()=>{t=null}),le())},d(l){l&&v(e),t&&t.d(l)}}}function h_(n){let e;function t(s,o){return s[4]?sA:s[5]?lA:iA}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function iA(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function lA(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=$e(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Mt(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function sA(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function __(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function oA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const y=[tA,eA],S=[];function T($,C){return $[2]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[7]),r=M(),a=b("div"),u=b("form"),f=b("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 an S3 compatible storage.</p>",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,u),k(u,f),k(u,c),S[d].m(u,null),h=!0,_||(g=K(u,"submit",Ue(n[16])),_=!0)},p($,C){(!h||C&128)&&se(o,$[7]);let O=d;d=T($),d===O?S[d].p($,C):(ie(),A(S[O],1,1,()=>{S[O]=null}),le(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(u,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function rA(n){let e,t,i,l;return e=new gi({}),i=new bn({props:{$$slots:{default:[oA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}const aA="s3_test_request";function uA(n,e,t){let i,l,s;We(n,Lt,O=>t(7,s=O)),xt(Lt,s="Files storage",s);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const O=await re.settings.getAll()||{};h(O)}catch(O){re.error(O)}t(2,a=!1)}async function m(){if(!(u||!l)){t(3,u=!0);try{re.cancelRequest(aA);const O=await re.settings.update(j.filterRedactedProps(r));Zt({}),await h(O),Ea(),c?cv("Successfully saved but failed to establish S3 connection."):Pt("Successfully saved files storage settings.")}catch(O){re.error(O)}t(3,u=!1)}}async function h(O={}){t(1,r={s3:(O==null?void 0:O.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function y(O){f=O,t(4,f)}function S(O){c=O,t(5,c)}const T=()=>_(),$=()=>m(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,l=i!=JSON.stringify(r))},[o,r,a,u,f,c,l,s,m,_,i,g,y,S,T,$,C]}class fA extends ge{constructor(e){super(),_e(this,e,uA,rA,me,{})}}function cA(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(l,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function dA(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("label"),t=Z("Client ID"),l=M(),s=b("input"),p(e,"for",i=n[20]),p(s,"type","text"),p(s,"id",o=n[20]),s.required=r=n[1].enabled},m(f,c){w(f,e,c),k(e,t),w(f,l,c),w(f,s,c),oe(s,n[1].clientId),a||(u=K(s,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(s,"id",o),c&2&&r!==(r=f[1].enabled)&&(s.required=r),c&2&&s.value!==f[1].clientId&&oe(s,f[1].clientId)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function pA(n){let e,t,i,l,s,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),s=new eu({props:u}),te.push(()=>be(s,"value",a)),{c(){e=b("label"),t=Z("Client secret"),l=M(),V(s.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),k(e,t),w(f,l,c),H(s,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,ke(()=>o=!1)),s.$set(d)},i(f){r||(E(s.$$.fragment,f),r=!0)},o(f){A(s.$$.fragment,f),r=!1},d(f){f&&(v(e),v(l)),z(s,f)}}}function g_(n){let e,t,i,l;const s=[{key:n[3].key},n[3].optionsComponentProps||{}];function o(u){n[14](u)}var r=n[3].optionsComponent;function a(u,f){let c={};for(let d=0;d<s.length;d+=1)c=Ae(c,s[d]);return f!==void 0&&f&8&&(c=Ae(c,dt(s,[{key:u[3].key},Dt(u[3].optionsComponentProps||{})]))),u[1]!==void 0&&(c.config=u[1]),{props:c}}return r&&(t=It(r,a(n)),te.push(()=>be(t,"config",o))),{c(){e=b("div"),t&&V(t.$$.fragment),p(e,"class","col-lg-12")},m(u,f){w(u,e,f),t&&H(t,e,null),l=!0},p(u,f){if(f&8&&r!==(r=u[3].optionsComponent)){if(t){ie();const c=t;A(c.$$.fragment,1,0,()=>{z(c,1)}),le()}r?(t=It(r,a(u,f)),te.push(()=>be(t,"config",o)),V(t.$$.fragment),E(t.$$.fragment,1),H(t,e,null)):t=null}else if(r){const c=f&8?dt(s,[{key:u[3].key},Dt(u[3].optionsComponentProps||{})]):{};!i&&f&2&&(i=!0,c.config=u[1],ke(()=>i=!1)),t.$set(c)}},i(u){l||(t&&E(t.$$.fragment,u),l=!0)},o(u){t&&A(t.$$.fragment,u),l=!1},d(u){u&&v(e),t&&z(t)}}}function mA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new ce({props:{class:"form-field form-field-toggle m-b-0",name:n[3].key+".enabled",$$slots:{default:[cA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientId",$$slots:{default:[dA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}}),u=new ce({props:{class:"form-field "+(n[1].enabled?"required":""),name:n[3].key+".clientSecret",$$slots:{default:[pA,({uniqueId:_})=>({20:_}),({uniqueId:_})=>_?1048576:0]},$$scope:{ctx:n}}});let h=n[3].optionsComponent&&g_(n);return{c(){e=b("form"),t=b("div"),V(i.$$.fragment),l=M(),s=b("button"),s.innerHTML='<span class="txt">Clear all fields</span>',o=M(),V(r.$$.fragment),a=M(),V(u.$$.fragment),f=M(),h&&h.c(),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent btn-hint m-l-auto"),p(t,"class","flex m-b-base"),p(e,"id",n[6]),p(e,"autocomplete","off")},m(_,g){w(_,e,g),k(e,t),H(i,t,null),k(t,l),k(t,s),k(e,o),H(r,e,null),k(e,a),H(u,e,null),k(e,f),h&&h.m(e,null),c=!0,d||(m=[K(s,"click",n[8]),K(e,"submit",Ue(n[15]))],d=!0)},p(_,g){const y={};g&8&&(y.name=_[3].key+".enabled"),g&3145730&&(y.$$scope={dirty:g,ctx:_}),i.$set(y);const S={};g&2&&(S.class="form-field "+(_[1].enabled?"required":"")),g&8&&(S.name=_[3].key+".clientId"),g&3145730&&(S.$$scope={dirty:g,ctx:_}),r.$set(S);const T={};g&2&&(T.class="form-field "+(_[1].enabled?"required":"")),g&8&&(T.name=_[3].key+".clientSecret"),g&3145730&&(T.$$scope={dirty:g,ctx:_}),u.$set(T),_[3].optionsComponent?h?(h.p(_,g),g&8&&E(h,1)):(h=g_(_),h.c(),E(h,1),h.m(e,null)):h&&(ie(),A(h,1,1,()=>{h=null}),le())},i(_){c||(E(i.$$.fragment,_),E(r.$$.fragment,_),E(u.$$.fragment,_),E(h),c=!0)},o(_){A(i.$$.fragment,_),A(r.$$.fragment,_),A(u.$$.fragment,_),A(h),c=!1},d(_){_&&v(e),z(i),z(r),z(u),h&&h.d(),d=!1,we(m)}}}function hA(n){let e,t=(n[3].title||n[3].key)+"",i,l;return{c(){e=b("h4"),i=Z(t),l=Z(" provider"),p(e,"class","center txt-break")},m(s,o){w(s,e,o),k(e,i),k(e,l)},p(s,o){o&8&&t!==(t=(s[3].title||s[3].key)+"")&&se(i,t)},d(s){s&&v(e)}}}function _A(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Z("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Save changes",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),k(e,t),w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function gA(n){let e,t,i={overlayClose:!n[4],escClose:!n[4],$$slots:{footer:[_A],header:[hA],default:[mA]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[16](e),e.$on("show",n[17]),e.$on("hide",n[18]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&2097210&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[16](null),z(e,l)}}}function bA(n,e,t){let i;const l=lt(),s="provider_popup_"+j.randomString(5);let o,r={},a={},u=!1,f="";function c(D,I){Zt({}),t(3,r=Object.assign({},D)),t(1,a=Object.assign({enabled:!0},I)),t(10,f=JSON.stringify(a)),o==null||o.show()}function d(){return o==null?void 0:o.hide()}async function m(){t(4,u=!0);try{const D={};D[r.key]=j.filterRedactedProps(a);const I=await re.settings.update(D);Zt({}),Pt("Successfully updated provider settings."),l("submit",I),d()}catch(D){re.error(D)}t(4,u=!1)}function h(){var D;for(let I in a)t(1,a[I]=j.zeroValue(a[I]),a);(D=r.key)!=null&&D.startsWith("oidc")?t(1,a.pkce=!1,a):t(1,a.pkce=null,a)}function _(){a.enabled=this.checked,t(1,a)}function g(){a.clientId=this.value,t(1,a)}function y(D){n.$$.not_equal(a.clientSecret,D)&&(a.clientSecret=D,t(1,a))}function S(D){a=D,t(1,a)}const T=()=>m();function $(D){te[D?"unshift":"push"](()=>{o=D,t(2,o)})}function C(D){Ce.call(this,n,D)}function O(D){Ce.call(this,n,D)}return n.$$.update=()=>{n.$$.dirty&1026&&t(5,i=JSON.stringify(a)!=f)},[d,a,o,r,u,i,s,m,h,c,f,_,g,y,S,T,$,C,O]}class kA extends ge{constructor(e){super(),_e(this,e,bA,gA,me,{show:9,hide:0})}get show(){return this.$$.ctx[9]}get hide(){return this.$$.ctx[0]}}function b_(n){let e,t,i;return{c(){e=b("img"),en(e.src,t="./images/oauth2/"+n[1].logo)||p(e,"src",t),p(e,"alt",i=n[1].title+" logo")},m(l,s){w(l,e,s)},p(l,s){s&2&&!en(e.src,t="./images/oauth2/"+l[1].logo)&&p(e,"src",t),s&2&&i!==(i=l[1].title+" logo")&&p(e,"alt",i)},d(l){l&&v(e)}}}function k_(n){let e;return{c(){e=b("div"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function yA(n){let e,t,i,l,s=n[1].title+"",o,r,a,u,f=n[1].key.slice(0,-4)+"",c,d,m,h,_,g,y,S,T,$,C=n[1].logo&&b_(n),O=n[0].enabled&&k_(),D={};return y=new kA({props:D}),n[4](y),y.$on("submit",n[5]),{c(){e=b("div"),t=b("figure"),C&&C.c(),i=M(),l=b("div"),o=Z(s),r=M(),a=b("em"),u=Z("("),c=Z(f),d=Z(")"),m=M(),O&&O.c(),h=M(),_=b("button"),_.innerHTML='<i class="ri-settings-4-line"></i>',g=M(),V(y.$$.fragment),p(t,"class","provider-logo"),p(l,"class","title"),p(a,"class","txt-hint txt-sm m-r-auto"),p(_,"type","button"),p(_,"class","btn btn-circle btn-hint btn-transparent"),p(_,"aria-label","Provider settings"),p(e,"class","provider-card")},m(I,L){w(I,e,L),k(e,t),C&&C.m(t,null),k(e,i),k(e,l),k(l,o),k(e,r),k(e,a),k(a,u),k(a,c),k(a,d),k(e,m),O&&O.m(e,null),k(e,h),k(e,_),w(I,g,L),H(y,I,L),S=!0,T||($=K(_,"click",n[3]),T=!0)},p(I,[L]){I[1].logo?C?C.p(I,L):(C=b_(I),C.c(),C.m(t,null)):C&&(C.d(1),C=null),(!S||L&2)&&s!==(s=I[1].title+"")&&se(o,s),(!S||L&2)&&f!==(f=I[1].key.slice(0,-4)+"")&&se(c,f),I[0].enabled?O||(O=k_(),O.c(),O.m(e,h)):O&&(O.d(1),O=null);const R={};y.$set(R)},i(I){S||(E(y.$$.fragment,I),S=!0)},o(I){A(y.$$.fragment,I),S=!1},d(I){I&&(v(e),v(g)),C&&C.d(),O&&O.d(),n[4](null),z(y,I),T=!1,$()}}}function vA(n,e,t){let{provider:i={}}=e,{config:l={}}=e,s;const o=()=>{s==null||s.show(i,Object.assign({},l,{enabled:l.clientId?l.enabled:!0,pkce:l.clientId?l.pkce:null}))};function r(u){te[u?"unshift":"push"](()=>{s=u,t(2,s)})}const a=u=>{u.detail[i.key]&&t(0,l=u.detail[i.key])};return n.$$set=u=>{"provider"in u&&t(1,i=u.provider),"config"in u&&t(0,l=u.config)},[l,i,s,o,r,a]}class r0 extends ge{constructor(e){super(),_e(this,e,vA,yA,me,{provider:1,config:0})}}function y_(n,e,t){const i=n.slice();return i[9]=e[t],i[10]=e,i[11]=t,i}function v_(n,e,t){const i=n.slice();return i[9]=e[t],i[12]=e,i[13]=t,i}function wA(n){let e,t=[],i=new Map,l,s,o,r=[],a=new Map,u,f=fe(n[3]);const c=_=>_[9].key;for(let _=0;_<f.length;_+=1){let g=v_(n,f,_),y=c(g);i.set(y,t[_]=w_(y,g))}let d=n[3].length>0&&n[2].length>0&&S_(),m=fe(n[2]);const h=_=>_[9].key;for(let _=0;_<m.length;_+=1){let g=y_(n,m,_),y=h(g);a.set(y,r[_]=$_(y,g))}return{c(){e=b("div");for(let _=0;_<t.length;_+=1)t[_].c();l=M(),d&&d.c(),s=M(),o=b("div");for(let _=0;_<r.length;_+=1)r[_].c();p(e,"class","grid grid-sm"),p(o,"class","grid grid-sm")},m(_,g){w(_,e,g);for(let y=0;y<t.length;y+=1)t[y]&&t[y].m(e,null);w(_,l,g),d&&d.m(_,g),w(_,s,g),w(_,o,g);for(let y=0;y<r.length;y+=1)r[y]&&r[y].m(o,null);u=!0},p(_,g){g&9&&(f=fe(_[3]),ie(),t=at(t,g,c,1,_,f,i,e,At,w_,null,v_),le()),_[3].length>0&&_[2].length>0?d||(d=S_(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&5&&(m=fe(_[2]),ie(),r=at(r,g,h,1,_,m,a,o,At,$_,null,y_),le())},i(_){if(!u){for(let g=0;g<f.length;g+=1)E(t[g]);for(let g=0;g<m.length;g+=1)E(r[g]);u=!0}},o(_){for(let g=0;g<t.length;g+=1)A(t[g]);for(let g=0;g<r.length;g+=1)A(r[g]);u=!1},d(_){_&&(v(e),v(l),v(s),v(o));for(let g=0;g<t.length;g+=1)t[g].d();d&&d.d(_);for(let g=0;g<r.length;g+=1)r[g].d()}}}function SA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function w_(n,e){let t,i,l,s,o;function r(u){e[5](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new r0({props:a}),te.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),k(t,s),o=!0},p(u,f){e=u;const c={};f&8&&(c.provider=e[9]),!l&&f&9&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),z(i)}}}function S_(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function $_(n,e){let t,i,l,s,o;function r(u){e[6](u,e[9])}let a={provider:e[9]};return e[0][e[9].key]!==void 0&&(a.config=e[0][e[9].key]),i=new r0({props:a}),te.push(()=>be(i,"config",r)),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),s=M(),p(t,"class","col-lg-6"),this.first=t},m(u,f){w(u,t,f),H(i,t,null),k(t,s),o=!0},p(u,f){e=u;const c={};f&4&&(c.provider=e[9]),!l&&f&5&&(l=!0,c.config=e[0][e[9].key],ke(()=>l=!1)),i.$set(c)},i(u){o||(E(i.$$.fragment,u),o=!0)},o(u){A(i.$$.fragment,u),o=!1},d(u){u&&v(t),z(i)}}}function $A(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h;const _=[SA,wA],g=[];function y(S,T){return S[1]?0:1}return d=y(n),m=g[d]=_[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[4]),r=M(),a=b("div"),u=b("div"),f=b("h6"),f.textContent="Manage the allowed users OAuth2 sign-in/sign-up methods.",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","m-b-base"),p(u,"class","panel"),p(a,"class","wrapper")},m(S,T){w(S,e,T),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(S,r,T),w(S,a,T),k(a,u),k(u,f),k(u,c),g[d].m(u,null),h=!0},p(S,T){(!h||T&16)&&se(o,S[4]);let $=d;d=y(S),d===$?g[d].p(S,T):(ie(),A(g[$],1,1,()=>{g[$]=null}),le(),m=g[d],m?m.p(S,T):(m=g[d]=_[d](S),m.c()),E(m,1),m.m(u,null))},i(S){h||(E(m),h=!0)},o(S){A(m),h=!1},d(S){S&&(v(e),v(r),v(a)),g[d].d()}}}function TA(n){let e,t,i,l;return e=new gi({}),i=new bn({props:{$$slots:{default:[$A]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&16415&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function CA(n,e,t){let i,l,s;We(n,Lt,d=>t(4,s=d)),xt(Lt,s="Auth providers",s);let o=!1,r={};a();async function a(){t(1,o=!0);try{const d=await re.settings.getAll()||{};u(d)}catch(d){re.error(d)}t(1,o=!1)}function u(d){d=d||{},t(0,r={});for(const m of _o)t(0,r[m.key]=Object.assign({enabled:!1},d[m.key]),r)}function f(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}function c(d,m){n.$$.not_equal(r[m.key],d)&&(r[m.key]=d,t(0,r))}return n.$$.update=()=>{n.$$.dirty&1&&t(3,i=_o.filter(d=>{var m;return(m=r[d.key])==null?void 0:m.enabled})),n.$$.dirty&1&&t(2,l=_o.filter(d=>{var m;return!((m=r[d.key])!=null&&m.enabled)}))},[r,o,l,i,s,f,c]}class OA extends ge{constructor(e){super(),_e(this,e,CA,TA,me,{})}}function MA(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=Z(n[3]),i=Z(" duration (in seconds)"),s=M(),o=b("input"),a=M(),u=b("div"),f=b("span"),f.textContent="Invalidate all previously issued tokens",p(e,"for",l=n[6]),p(o,"type","number"),p(o,"id",r=n[6]),o.required=!0,p(f,"class","link-primary"),x(f,"txt-success",!!n[1]),p(u,"class","help-block")},m(m,h){w(m,e,h),k(e,t),k(e,i),w(m,s,h),w(m,o,h),oe(o,n[0]),w(m,a,h),w(m,u,h),k(u,f),c||(d=[K(o,"input",n[4]),K(f,"click",n[5])],c=!0)},p(m,h){h&8&&se(t,m[3]),h&64&&l!==(l=m[6])&&p(e,"for",l),h&64&&r!==(r=m[6])&&p(o,"id",r),h&1&&it(o.value)!==m[0]&&oe(o,m[0]),h&2&&x(f,"txt-success",!!m[1])},d(m){m&&(v(e),v(s),v(o),v(a),v(u)),c=!1,we(d)}}}function DA(n){let e,t;return e=new ce({props:{class:"form-field required",name:n[2]+".duration",$$slots:{default:[MA,({uniqueId:i})=>({6:i}),({uniqueId:i})=>i?64:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,[l]){const s={};l&4&&(s.name=i[2]+".duration"),l&203&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function EA(n,e,t){let{key:i}=e,{label:l}=e,{duration:s}=e,{secret:o}=e;function r(){s=it(this.value),t(0,s)}const a=()=>{o?t(1,o=void 0):t(1,o=j.randomSecret(50))};return n.$$set=u=>{"key"in u&&t(2,i=u.key),"label"in u&&t(3,l=u.label),"duration"in u&&t(0,s=u.duration),"secret"in u&&t(1,o=u.secret)},[s,o,i,l,r,a]}class a0 extends ge{constructor(e){super(),_e(this,e,EA,DA,me,{key:2,label:3,duration:0,secret:1})}}function T_(n,e,t){const i=n.slice();return i[19]=e[t],i[20]=e,i[21]=t,i}function C_(n,e,t){const i=n.slice();return i[19]=e[t],i[22]=e,i[23]=t,i}function IA(n){let e,t,i=[],l=new Map,s,o,r,a,u,f=[],c=new Map,d,m,h,_,g,y,S,T,$,C,O,D=fe(n[5]);const I=N=>N[19].key;for(let N=0;N<D.length;N+=1){let P=C_(n,D,N),q=I(P);l.set(q,i[N]=O_(q,P))}let L=fe(n[6]);const R=N=>N[19].key;for(let N=0;N<L.length;N+=1){let P=T_(n,L,N),q=R(P);c.set(q,f[N]=M_(q,P))}let F=n[3]&&D_(n);return{c(){e=b("h3"),e.textContent="Record tokens",t=M();for(let N=0;N<i.length;N+=1)i[N].c();s=M(),o=b("hr"),r=M(),a=b("h3"),a.textContent="Admin tokens",u=M();for(let N=0;N<f.length;N+=1)f[N].c();d=M(),m=b("div"),h=b("div"),_=M(),F&&F.c(),g=M(),y=b("button"),S=b("span"),S.textContent="Save changes",p(e,"class","section-title"),p(a,"class","section-title"),p(h,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[3]||n[2],x(y,"btn-loading",n[2]),p(m,"class","flex")},m(N,P){w(N,e,P),w(N,t,P);for(let q=0;q<i.length;q+=1)i[q]&&i[q].m(N,P);w(N,s,P),w(N,o,P),w(N,r,P),w(N,a,P),w(N,u,P);for(let q=0;q<f.length;q+=1)f[q]&&f[q].m(N,P);w(N,d,P),w(N,m,P),k(m,h),k(m,_),F&&F.m(m,null),k(m,g),k(m,y),k(y,S),$=!0,C||(O=K(y,"click",n[16]),C=!0)},p(N,P){P&33&&(D=fe(N[5]),ie(),i=at(i,P,I,1,N,D,l,s.parentNode,At,O_,s,C_),le()),P&65&&(L=fe(N[6]),ie(),f=at(f,P,R,1,N,L,c,d.parentNode,At,M_,d,T_),le()),N[3]?F?F.p(N,P):(F=D_(N),F.c(),F.m(m,g)):F&&(F.d(1),F=null),(!$||P&12&&T!==(T=!N[3]||N[2]))&&(y.disabled=T),(!$||P&4)&&x(y,"btn-loading",N[2])},i(N){if(!$){for(let P=0;P<D.length;P+=1)E(i[P]);for(let P=0;P<L.length;P+=1)E(f[P]);$=!0}},o(N){for(let P=0;P<i.length;P+=1)A(i[P]);for(let P=0;P<f.length;P+=1)A(f[P]);$=!1},d(N){N&&(v(e),v(t),v(s),v(o),v(r),v(a),v(u),v(d),v(m));for(let P=0;P<i.length;P+=1)i[P].d(N);for(let P=0;P<f.length;P+=1)f[P].d(N);F&&F.d(),C=!1,O()}}}function AA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function O_(n,e){let t,i,l,s,o;function r(f){e[11](f,e[19])}function a(f){e[12](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new a0({props:u}),te.push(()=>be(i,"duration",r)),te.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&33&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&33&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),z(i,f)}}}function M_(n,e){let t,i,l,s,o;function r(f){e[13](f,e[19])}function a(f){e[14](f,e[19])}let u={key:e[19].key,label:e[19].label};return e[0][e[19].key].duration!==void 0&&(u.duration=e[0][e[19].key].duration),e[0][e[19].key].secret!==void 0&&(u.secret=e[0][e[19].key].secret),i=new a0({props:u}),te.push(()=>be(i,"duration",r)),te.push(()=>be(i,"secret",a)),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(f,c){w(f,t,c),H(i,f,c),o=!0},p(f,c){e=f;const d={};!l&&c&65&&(l=!0,d.duration=e[0][e[19].key].duration,ke(()=>l=!1)),!s&&c&65&&(s=!0,d.secret=e[0][e[19].key].secret,ke(()=>s=!1)),i.$set(d)},i(f){o||(E(i.$$.fragment,f),o=!0)},o(f){A(i.$$.fragment,f),o=!1},d(f){f&&v(t),z(i,f)}}}function D_(n){let e,t,i,l;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[2]},m(s,o){w(s,e,o),k(e,t),i||(l=K(e,"click",n[15]),i=!0)},p(s,o){o&4&&(e.disabled=s[2])},d(s){s&&v(e),i=!1,l()}}}function LA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const y=[AA,IA],S=[];function T($,C){return $[1]?0:1}return d=T(n),m=S[d]=y[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[4]),r=M(),a=b("div"),u=b("form"),f=b("div"),f.innerHTML="<p>Adjust common token options.</p>",c=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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($,C){w($,e,C),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w($,r,C),w($,a,C),k(a,u),k(u,f),k(u,c),S[d].m(u,null),h=!0,_||(g=K(u,"submit",Ue(n[7])),_=!0)},p($,C){(!h||C&16)&&se(o,$[4]);let O=d;d=T($),d===O?S[d].p($,C):(ie(),A(S[O],1,1,()=>{S[O]=null}),le(),m=S[d],m?m.p($,C):(m=S[d]=y[d]($),m.c()),E(m,1),m.m(u,null))},i($){h||(E(m),h=!0)},o($){A(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function NA(n){let e,t,i,l;return e=new gi({}),i=new bn({props:{$$slots:{default:[LA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&16777247&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function PA(n,e,t){let i,l,s;We(n,Lt,O=>t(4,s=O));const o=[{key:"recordAuthToken",label:"Auth record authentication token"},{key:"recordVerificationToken",label:"Auth record email verification token"},{key:"recordPasswordResetToken",label:"Auth record password reset token"},{key:"recordEmailChangeToken",label:"Auth record email change token"},{key:"recordFileToken",label:"Records protected file access token"}],r=[{key:"adminAuthToken",label:"Admins auth token"},{key:"adminPasswordResetToken",label:"Admins password reset token"},{key:"adminFileToken",label:"Admins protected file access token"}];xt(Lt,s="Token options",s);let a={},u={},f=!1,c=!1;d();async function d(){t(1,f=!0);try{const O=await re.settings.getAll()||{};h(O)}catch(O){re.error(O)}t(1,f=!1)}async function m(){if(!(c||!l)){t(2,c=!0);try{const O=await re.settings.update(j.filterRedactedProps(u));h(O),Pt("Successfully saved tokens options.")}catch(O){re.error(O)}t(2,c=!1)}}function h(O){var I;O=O||{},t(0,u={});const D=o.concat(r);for(const L of D)t(0,u[L.key]={duration:((I=O[L.key])==null?void 0:I.duration)||0},u);t(9,a=JSON.parse(JSON.stringify(u)))}function _(){t(0,u=JSON.parse(JSON.stringify(a||{})))}function g(O,D){n.$$.not_equal(u[D.key].duration,O)&&(u[D.key].duration=O,t(0,u))}function y(O,D){n.$$.not_equal(u[D.key].secret,O)&&(u[D.key].secret=O,t(0,u))}function S(O,D){n.$$.not_equal(u[D.key].duration,O)&&(u[D.key].duration=O,t(0,u))}function T(O,D){n.$$.not_equal(u[D.key].secret,O)&&(u[D.key].secret=O,t(0,u))}const $=()=>_(),C=()=>m();return n.$$.update=()=>{n.$$.dirty&512&&t(10,i=JSON.stringify(a)),n.$$.dirty&1025&&t(3,l=i!=JSON.stringify(u))},[u,f,c,l,s,o,r,m,_,a,i,g,y,S,T,$,C]}class FA extends ge{constructor(e){super(),_e(this,e,PA,NA,me,{})}}function E_(n,e,t){const i=n.slice();return i[22]=e[t],i}function RA(n){let e,t,i,l,s,o,r,a=[],u=new Map,f,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F,N;o=new ce({props:{class:"form-field",$$slots:{default:[jA,({uniqueId:U})=>({12:U}),({uniqueId:U})=>U?4096:0]},$$scope:{ctx:n}}});let P=fe(n[0]);const q=U=>U[22].id;for(let U=0;U<P.length;U+=1){let Y=E_(n,P,U),J=q(Y);u.set(J,a[U]=I_(J,Y))}return{c(){e=b("div"),e.innerHTML=`<p>Below you'll find your current collections configuration that you could import in
|
||
another PocketBase environment.</p>`,t=M(),i=b("div"),l=b("div"),s=b("div"),V(o.$$.fragment),r=M();for(let U=0;U<a.length;U+=1)a[U].c();f=M(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",_=M(),g=b("pre"),y=M(),S=b("div"),T=b("div"),$=M(),C=b("button"),O=b("i"),D=M(),I=b("span"),I.textContent="Download as JSON",p(e,"class","content txt-xl m-b-base"),p(s,"class","list-item list-item-section"),p(l,"class","export-list"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","btn btn-sm btn-transparent fade copy-schema"),d.disabled=h=!n[2],p(g,"class","code-wrapper"),p(c,"tabindex","0"),p(c,"class","export-preview"),p(i,"class","export-panel"),p(T,"class","flex-fill"),p(O,"class","ri-download-line"),p(I,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded"),C.disabled=L=!n[2],p(S,"class","flex m-t-base")},m(U,Y){w(U,e,Y),w(U,t,Y),w(U,i,Y),k(i,l),k(l,s),H(o,s,null),k(l,r);for(let J=0;J<a.length;J+=1)a[J]&&a[J].m(l,null);k(i,f),k(i,c),k(c,d),k(d,m),k(c,_),k(c,g),g.innerHTML=n[6],n[16](c),w(U,y,Y),w(U,S,Y),k(S,T),k(S,$),k(S,C),k(C,O),k(C,D),k(C,I),R=!0,F||(N=[K(d,"click",n[15]),K(c,"keydown",n[17]),K(C,"click",n[18])],F=!0)},p(U,Y){const J={};Y&33558561&&(J.$$scope={dirty:Y,ctx:U}),o.$set(J),Y&6147&&(P=fe(U[0]),ie(),a=at(a,Y,q,1,U,P,u,l,At,I_,null,E_),le()),(!R||Y&4&&h!==(h=!U[2]))&&(d.disabled=h),(!R||Y&64)&&(g.innerHTML=U[6]),(!R||Y&4&&L!==(L=!U[2]))&&(C.disabled=L)},i(U){if(!R){E(o.$$.fragment,U);for(let Y=0;Y<P.length;Y+=1)E(a[Y]);R=!0}},o(U){A(o.$$.fragment,U);for(let Y=0;Y<a.length;Y+=1)A(a[Y]);R=!1},d(U){U&&(v(e),v(t),v(i),v(y),v(S)),z(o);for(let Y=0;Y<a.length;Y+=1)a[Y].d();n[16](null),F=!1,we(N)}}}function qA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function jA(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=M(),s=b("label"),o=Z("Select all"),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.disabled=i=!n[0].length,e.checked=n[5],p(s,"for",r=n[12])},m(f,c){w(f,e,c),w(f,l,c),w(f,s,c),k(s,o),a||(u=K(e,"change",n[13]),a=!0)},p(f,c){c&4096&&t!==(t=f[12])&&p(e,"id",t),c&1&&i!==(i=!f[0].length)&&(e.disabled=i),c&32&&(e.checked=f[5]),c&4096&&r!==(r=f[12])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function HA(n){let e,t,i,l,s,o=n[22].name+"",r,a,u,f,c;function d(){return n[14](n[22])}return{c(){e=b("input"),l=M(),s=b("label"),r=Z(o),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.checked=i=n[1][n[22].id],p(s,"for",a=n[12]),p(s,"title",u=n[22].name)},m(m,h){w(m,e,h),w(m,l,h),w(m,s,h),k(s,r),f||(c=K(e,"change",d),f=!0)},p(m,h){n=m,h&4096&&t!==(t=n[12])&&p(e,"id",t),h&3&&i!==(i=n[1][n[22].id])&&(e.checked=i),h&1&&o!==(o=n[22].name+"")&&se(r,o),h&4096&&a!==(a=n[12])&&p(s,"for",a),h&1&&u!==(u=n[22].name)&&p(s,"title",u)},d(m){m&&(v(e),v(l),v(s)),f=!1,c()}}}function I_(n,e){let t,i,l,s;return i=new ce({props:{class:"form-field",$$slots:{default:[HA,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),V(i.$$.fragment),l=M(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){w(o,t,r),H(i,t,null),k(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(E(i.$$.fragment,o),s=!0)},o(o){A(i.$$.fragment,o),s=!1},d(o){o&&v(t),z(i)}}}function zA(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[qA,RA],h=[];function _(g,y){return g[4]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[7]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,u),h[f].m(u,null),d=!0},p(g,y){(!d||y&128)&&se(o,g[7]);let S=f;f=_(g),f===S?h[f].p(g,y):(ie(),A(h[S],1,1,()=>{h[S]=null}),le(),c=h[f],c?c.p(g,y):(c=h[f]=m[f](g),c.c()),E(c,1),c.m(u,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function VA(n){let e,t,i,l;return e=new gi({}),i=new bn({props:{$$slots:{default:[zA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,[o]){const r={};o&33554687&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function BA(n,e,t){let i,l,s,o;We(n,Lt,L=>t(7,o=L)),xt(Lt,o="Export collections",o);const r="export_"+j.randomString(5);let a,u=[],f={},c=!1;d();async function d(){t(4,c=!0);try{t(0,u=await re.collections.getFullList({batch:100,$cancelKey:r})),t(0,u=j.sortCollections(u));for(let L of u)delete L.created,delete L.updated;y()}catch(L){re.error(L)}t(4,c=!1)}function m(){j.downloadJson(Object.values(f),"pb_schema")}function h(){j.copyToClipboard(i),So("The configuration was copied to your clipboard!",3e3)}function _(){s?g():y()}function g(){t(1,f={})}function y(){t(1,f={});for(const L of u)t(1,f[L.id]=L,f)}function S(L){f[L.id]?delete f[L.id]:t(1,f[L.id]=L,f),t(1,f)}const T=()=>_(),$=L=>S(L),C=()=>h();function O(L){te[L?"unshift":"push"](()=>{a=L,t(3,a)})}const D=L=>{if(L.ctrlKey&&L.code==="KeyA"){L.preventDefault();const R=window.getSelection(),F=document.createRange();F.selectNodeContents(a),R.removeAllRanges(),R.addRange(F)}},I=()=>m();return n.$$.update=()=>{n.$$.dirty&2&&t(6,i=JSON.stringify(Object.values(f),null,4)),n.$$.dirty&2&&t(2,l=Object.keys(f).length),n.$$.dirty&5&&t(5,s=u.length&&l===u.length)},[u,f,l,a,c,s,i,o,m,h,_,S,r,T,$,C,O,D,I]}class UA extends ge{constructor(e){super(),_e(this,e,BA,VA,me,{})}}function A_(n,e,t){const i=n.slice();return i[14]=e[t],i}function L_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function N_(n,e,t){const i=n.slice();return i[14]=e[t],i}function P_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function F_(n,e,t){const i=n.slice();return i[14]=e[t],i}function R_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function q_(n,e,t){const i=n.slice();return i[30]=e[t],i}function WA(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&j_(),a=n[0].name!==n[1].name&&H_(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=Z(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),k(e,t),a&&a.m(e,null),k(e,i),k(e,l),k(l,o)},p(u,f){u[9]?r||(r=j_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=H_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&se(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function YA(n){var o;let e,t,i,l=((o=n[0])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Deleted",t=M(),i=b("strong"),s=Z(l),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var u;a[0]&1&&l!==(l=((u=r[0])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function KA(n){var o;let e,t,i,l=((o=n[1])==null?void 0:o.name)+"",s;return{c(){e=b("span"),e.textContent="Added",t=M(),i=b("strong"),s=Z(l),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),k(i,s)},p(r,a){var u;a[0]&2&&l!==(l=((u=r[1])==null?void 0:u.name)+"")&&se(s,l)},d(r){r&&(v(e),v(t),v(i))}}}function j_(n){let e;return{c(){e=b("span"),e.textContent="Changed",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function H_(n){let e,t=n[0].name+"",i,l,s;return{c(){e=b("strong"),i=Z(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&1&&t!==(t=o[0].name+"")&&se(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function z_(n){var h,_;let e,t,i,l,s,o,r=n[12]((h=n[0])==null?void 0:h[n[30]])+"",a,u,f,c,d=n[12]((_=n[1])==null?void 0:_[n[30]])+"",m;return{c(){var g,y,S,T,$,C;e=b("tr"),t=b("td"),i=b("span"),i.textContent=`${n[30]}`,l=M(),s=b("td"),o=b("pre"),a=Z(r),u=M(),f=b("td"),c=b("pre"),m=Z(d),p(t,"class","min-width svelte-lmkr38"),p(o,"class","txt"),p(s,"class","svelte-lmkr38"),x(s,"changed-old-col",!n[10]&&hn((g=n[0])==null?void 0:g[n[30]],(y=n[1])==null?void 0:y[n[30]])),x(s,"changed-none-col",n[10]),p(c,"class","txt"),p(f,"class","svelte-lmkr38"),x(f,"changed-new-col",!n[5]&&hn((S=n[0])==null?void 0:S[n[30]],(T=n[1])==null?void 0:T[n[30]])),x(f,"changed-none-col",n[5]),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",hn(($=n[0])==null?void 0:$[n[30]],(C=n[1])==null?void 0:C[n[30]]))},m(g,y){w(g,e,y),k(e,t),k(t,i),k(e,l),k(e,s),k(s,o),k(o,a),k(e,u),k(e,f),k(f,c),k(c,m)},p(g,y){var S,T,$,C,O,D,I,L;y[0]&1&&r!==(r=g[12]((S=g[0])==null?void 0:S[g[30]])+"")&&se(a,r),y[0]&3075&&x(s,"changed-old-col",!g[10]&&hn((T=g[0])==null?void 0:T[g[30]],($=g[1])==null?void 0:$[g[30]])),y[0]&1024&&x(s,"changed-none-col",g[10]),y[0]&2&&d!==(d=g[12]((C=g[1])==null?void 0:C[g[30]])+"")&&se(m,d),y[0]&2083&&x(f,"changed-new-col",!g[5]&&hn((O=g[0])==null?void 0:O[g[30]],(D=g[1])==null?void 0:D[g[30]])),y[0]&32&&x(f,"changed-none-col",g[5]),y[0]&2051&&x(e,"txt-primary",hn((I=g[0])==null?void 0:I[g[30]],(L=g[1])==null?void 0:L[g[30]]))},d(g){g&&v(e)}}}function V_(n){let e,t=fe(n[6]),i=[];for(let l=0;l<t.length;l+=1)i[l]=U_(F_(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s[0]&4160){t=fe(l[6]);let o;for(o=0;o<t.length;o+=1){const r=F_(l,t,o);i[o]?i[o].p(r,s):(i[o]=U_(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(l){l&&v(e),ot(i,l)}}}function B_(n){let e,t,i=n[17]+"",l,s,o,r,a=n[12](n[18])+"",u,f,c,d;return{c(){e=b("tr"),t=b("td"),l=Z(i),s=M(),o=b("td"),r=b("pre"),u=Z(a),f=M(),c=b("td"),d=M(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","changed-old-col svelte-lmkr38"),p(c,"class","changed-none-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(m,h){w(m,e,h),k(e,t),k(t,l),k(e,s),k(e,o),k(o,r),k(r,u),k(e,f),k(e,c),k(e,d)},p(m,h){h[0]&64&&i!==(i=m[17]+"")&&se(l,i),h[0]&64&&a!==(a=m[12](m[18])+"")&&se(u,a)},d(m){m&&v(e)}}}function U_(n){let e,t,i,l,s=n[14].name+"",o,r,a,u,f,c,d,m=n[14].name+"",h,_,g,y,S=fe(Object.entries(n[14])),T=[];for(let $=0;$<S.length;$+=1)T[$]=B_(R_(n,S,$));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Z("field: "),o=Z(s),r=M(),a=b("span"),u=Z("Deleted - "),f=b("small"),c=Z("All stored data related to "),d=b("strong"),h=Z(m),_=Z(" will be deleted!"),g=M();for(let $=0;$<T.length;$+=1)T[$].c();y=ye(),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($,C){w($,e,C),k(e,t),k(t,i),k(i,l),k(i,o),k(t,r),k(t,a),k(a,u),k(a,f),k(f,c),k(f,d),k(d,h),k(f,_),w($,g,C);for(let O=0;O<T.length;O+=1)T[O]&&T[O].m($,C);w($,y,C)},p($,C){if(C[0]&64&&s!==(s=$[14].name+"")&&se(o,s),C[0]&64&&m!==(m=$[14].name+"")&&se(h,m),C[0]&4160){S=fe(Object.entries($[14]));let O;for(O=0;O<S.length;O+=1){const D=R_($,S,O);T[O]?T[O].p(D,C):(T[O]=B_(D),T[O].c(),T[O].m(y.parentNode,y))}for(;O<T.length;O+=1)T[O].d(1);T.length=S.length}},d($){$&&(v(e),v(g),v(y)),ot(T,$)}}}function W_(n){let e;return{c(){e=b("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&&v(e)}}}function Y_(n){var _;let e,t,i=n[17]+"",l,s,o,r,a=n[12]((_=An(n[3],n[14].id))==null?void 0:_[n[17]])+"",u,f,c,d,m=n[12](n[23])+"",h;return{c(){var g,y,S;e=b("tr"),t=b("td"),l=Z(i),s=M(),o=b("td"),r=b("pre"),u=Z(a),f=M(),c=b("td"),d=b("pre"),h=Z(m),p(t,"class","min-width field-key-col svelte-lmkr38"),p(r,"class","txt"),p(o,"class","svelte-lmkr38"),x(o,"changed-old-col",hn((g=An(n[3],n[14].id))==null?void 0:g[n[17]],n[23])),p(d,"class","txt"),p(c,"class","svelte-lmkr38"),x(c,"changed-new-col",hn((y=An(n[3],n[14].id))==null?void 0:y[n[17]],n[23])),p(e,"class","svelte-lmkr38"),x(e,"txt-primary",hn((S=An(n[3],n[14].id))==null?void 0:S[n[17]],n[23]))},m(g,y){w(g,e,y),k(e,t),k(t,l),k(e,s),k(e,o),k(o,r),k(r,u),k(e,f),k(e,c),k(c,d),k(d,h)},p(g,y){var S,T,$,C;y[0]&128&&i!==(i=g[17]+"")&&se(l,i),y[0]&136&&a!==(a=g[12]((S=An(g[3],g[14].id))==null?void 0:S[g[17]])+"")&&se(u,a),y[0]&136&&x(o,"changed-old-col",hn((T=An(g[3],g[14].id))==null?void 0:T[g[17]],g[23])),y[0]&128&&m!==(m=g[12](g[23])+"")&&se(h,m),y[0]&136&&x(c,"changed-new-col",hn(($=An(g[3],g[14].id))==null?void 0:$[g[17]],g[23])),y[0]&136&&x(e,"txt-primary",hn((C=An(g[3],g[14].id))==null?void 0:C[g[17]],g[23]))},d(g){g&&v(e)}}}function K_(n){let e,t,i,l,s=n[14].name+"",o,r,a=hn(An(n[3],n[14].id),An(n[4],n[14].id)),u,f,c=a&&W_(),d=fe(Object.entries(n[14])),m=[];for(let h=0;h<d.length;h+=1)m[h]=Y_(P_(n,d,h));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Z("field: "),o=Z(s),r=M(),c&&c.c(),u=M();for(let h=0;h<m.length;h+=1)m[h].c();f=ye(),p(i,"class","txt"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(h,_){w(h,e,_),k(e,t),k(t,i),k(i,l),k(i,o),k(t,r),c&&c.m(t,null),w(h,u,_);for(let g=0;g<m.length;g+=1)m[g]&&m[g].m(h,_);w(h,f,_)},p(h,_){if(_[0]&128&&s!==(s=h[14].name+"")&&se(o,s),_[0]&152&&(a=hn(An(h[3],h[14].id),An(h[4],h[14].id))),a?c||(c=W_(),c.c(),c.m(t,null)):c&&(c.d(1),c=null),_[0]&4232){d=fe(Object.entries(h[14]));let g;for(g=0;g<d.length;g+=1){const y=P_(h,d,g);m[g]?m[g].p(y,_):(m[g]=Y_(y),m[g].c(),m[g].m(f.parentNode,f))}for(;g<m.length;g+=1)m[g].d(1);m.length=d.length}},d(h){h&&(v(e),v(u),v(f)),c&&c.d(),ot(m,h)}}}function J_(n){let e,t,i=n[17]+"",l,s,o,r,a,u,f=n[12](n[18])+"",c,d;return{c(){e=b("tr"),t=b("td"),l=Z(i),s=M(),o=b("td"),r=M(),a=b("td"),u=b("pre"),c=Z(f),d=M(),p(t,"class","min-width field-key-col svelte-lmkr38"),p(o,"class","changed-none-col svelte-lmkr38"),p(u,"class","txt"),p(a,"class","changed-new-col svelte-lmkr38"),p(e,"class","txt-primary svelte-lmkr38")},m(m,h){w(m,e,h),k(e,t),k(t,l),k(e,s),k(e,o),k(e,r),k(e,a),k(a,u),k(u,c),k(e,d)},p(m,h){h[0]&256&&i!==(i=m[17]+"")&&se(l,i),h[0]&256&&f!==(f=m[12](m[18])+"")&&se(c,f)},d(m){m&&v(e)}}}function Z_(n){let e,t,i,l,s=n[14].name+"",o,r,a,u,f,c=fe(Object.entries(n[14])),d=[];for(let m=0;m<c.length;m+=1)d[m]=J_(L_(n,c,m));return{c(){e=b("tr"),t=b("th"),i=b("span"),l=Z("field: "),o=Z(s),r=M(),a=b("span"),a.textContent="Added",u=M();for(let m=0;m<d.length;m+=1)d[m].c();f=ye(),p(i,"class","txt"),p(a,"class","label label-success m-l-5 svelte-lmkr38"),p(t,"class","min-width svelte-lmkr38"),p(t,"colspan","3"),p(e,"class","svelte-lmkr38")},m(m,h){w(m,e,h),k(e,t),k(t,i),k(i,l),k(i,o),k(t,r),k(t,a),w(m,u,h);for(let _=0;_<d.length;_+=1)d[_]&&d[_].m(m,h);w(m,f,h)},p(m,h){if(h[0]&256&&s!==(s=m[14].name+"")&&se(o,s),h[0]&4352){c=fe(Object.entries(m[14]));let _;for(_=0;_<c.length;_+=1){const g=L_(m,c,_);d[_]?d[_].p(g,h):(d[_]=J_(g),d[_].c(),d[_].m(f.parentNode,f))}for(;_<d.length;_+=1)d[_].d(1);d.length=c.length}},d(m){m&&(v(e),v(u),v(f)),ot(d,m)}}}function JA(n){let e,t,i,l,s,o,r,a,u;function f($,C){var O,D;return(O=$[0])!=null&&O.id?(D=$[1])!=null&&D.id?WA:YA:KA}let c=f(n),d=c(n),m=fe(n[11]),h=[];for(let $=0;$<m.length;$+=1)h[$]=z_(q_(n,m,$));let _=(n[2]||n[5])&&V_(n),g=fe(n[7]),y=[];for(let $=0;$<g.length;$+=1)y[$]=K_(N_(n,g,$));let S=fe(n[8]),T=[];for(let $=0;$<S.length;$+=1)T[$]=Z_(A_(n,S,$));return{c(){e=b("div"),d.c(),t=M(),i=b("table"),l=b("thead"),l.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>',s=M(),o=b("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=M(),_&&_.c(),a=M();for(let $=0;$<y.length;$+=1)y[$].c();u=M();for(let $=0;$<T.length;$+=1)T[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,C){w($,e,C),d.m(e,null),w($,t,C),w($,i,C),k(i,l),k(i,s),k(i,o);for(let O=0;O<h.length;O+=1)h[O]&&h[O].m(o,null);k(o,r),_&&_.m(o,null),k(o,a);for(let O=0;O<y.length;O+=1)y[O]&&y[O].m(o,null);k(o,u);for(let O=0;O<T.length;O+=1)T[O]&&T[O].m(o,null)},p($,C){if(c===(c=f($))&&d?d.p($,C):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),C[0]&7203){m=fe($[11]);let O;for(O=0;O<m.length;O+=1){const D=q_($,m,O);h[O]?h[O].p(D,C):(h[O]=z_(D),h[O].c(),h[O].m(o,r))}for(;O<h.length;O+=1)h[O].d(1);h.length=m.length}if($[2]||$[5]?_?_.p($,C):(_=V_($),_.c(),_.m(o,a)):_&&(_.d(1),_=null),C[0]&4248){g=fe($[7]);let O;for(O=0;O<g.length;O+=1){const D=N_($,g,O);y[O]?y[O].p(D,C):(y[O]=K_(D),y[O].c(),y[O].m(o,u))}for(;O<y.length;O+=1)y[O].d(1);y.length=g.length}if(C[0]&4352){S=fe($[8]);let O;for(O=0;O<S.length;O+=1){const D=A_($,S,O);T[O]?T[O].p(D,C):(T[O]=Z_(D),T[O].c(),T[O].m(o,null))}for(;O<T.length;O+=1)T[O].d(1);T.length=S.length}},i:Q,o:Q,d($){$&&(v(e),v(t),v(i)),d.d(),ot(h,$),_&&_.d(),ot(y,$),ot(T,$)}}}function An(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function hn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function ZA(n,e,t){let i,l,s,{collectionA:o=j.initCollection()}=e,{collectionB:r=j.initCollection()}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const h=Object.keys(j.initCollection()).filter(y=>!["schema","created","updated"].includes(y));function _(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":j.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,l=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,s=j.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,s,l,h,g]}class GA extends ge{constructor(e){super(),_e(this,e,ZA,JA,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function G_(n,e,t){const i=n.slice();return i[17]=e[t],i}function X_(n){let e,t;return e=new GA({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l&4&&(s.collectionA=i[17].old),l&4&&(s.collectionB=i[17].new),l&8&&(s.deleteMissing=i[3]),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function XA(n){let e,t,i=fe(n[2]),l=[];for(let o=0;o<i.length;o+=1)l[o]=X_(G_(n,i,o));const s=o=>A(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ye()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=fe(o[2]);let a;for(a=0;a<i.length;a+=1){const u=G_(o,i,a);l[a]?(l[a].p(u,r),E(l[a],1)):(l[a]=X_(u),l[a].c(),E(l[a],1),l[a].m(e.parentNode,e))}for(ie(),a=i.length;a<l.length;a+=1)s(a);le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)A(l[r]);t=!1},d(o){o&&v(e),ot(l,o)}}}function QA(n){let e;return{c(){e=b("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function xA(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=Z("Close"),i=M(),l=b("button"),s=b("span"),s.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-expanded"),l.disabled=n[4],x(l,"btn-loading",n[4])},m(a,u){w(a,e,u),k(e,t),w(a,i,u),w(a,l,u),k(l,s),o||(r=[K(e,"click",n[0]),K(l,"click",n[9])],o=!0)},p(a,u){u&16&&(e.disabled=a[4]),u&16&&(l.disabled=a[4]),u&16&&x(l,"btn-loading",a[4])},d(a){a&&(v(e),v(i),v(l)),o=!1,we(r)}}}function e7(n){let e,t,i={class:"full-width-popup import-popup",overlayClose:!1,escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[xA],header:[QA],default:[XA]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&1048604&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}function t7(n,e,t){const i=lt();let l,s=[],o=[],r=[],a=!1,u=!1;function f($,C,O=!1){t(7,s=$),t(8,o=C),t(3,a=O),l==null||l.show()}function c(){return l==null?void 0:l.hide()}function d(){t(2,r=[]);for(const $ of s){const C=j.findByKey(o,"id",$.id)||null;(a&&!(C!=null&&C.id)||C!=null&&C.id&&j.hasCollectionChanges($,C,a))&&r.push({old:$,new:C})}for(const $ of o){const C=j.findByKey(s,"id",$.id)||null;C!=null&&C.id||r.push({old:C,new:$})}}function m(){const $=[];if(a)for(const C of s){const O=j.findByKey(o,"id",C.id);if(!O)$.push(C.name+".*");else{const D=Array.isArray(C.schema)?C.schema:[];for(const I of D)j.findByKey(O.schema,"id",I.id)||$.push(`${C.name}.${I.name} (${I.id})`)}}$.length?fn(`Do you really want to delete the following collection fields and their related records data:
|
||
- ${$.join(`
|
||
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await re.collections.import(o,a),Pt("Successfully imported collections configuration."),i("submit")}catch($){re.error($)}t(4,u=!1),c()}}const _=()=>m(),g=()=>!u;function y($){te[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Ce.call(this,n,$)}function T($){Ce.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,_,g,y,S,T]}class n7 extends ge{constructor(e){super(),_e(this,e,t7,e7,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Q_(n,e,t){const i=n.slice();return i[34]=e[t],i}function x_(n,e,t){const i=n.slice();return i[37]=e[t],i}function eg(n,e,t){const i=n.slice();return i[34]=e[t],i}function i7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D,I;a=new ce({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[s7,({uniqueId:U})=>({42:U}),({uniqueId:U})=>[0,U?2048:0]]},$$scope:{ctx:n}}});let L=n[1].length&&ng(n),R=!1,F=n[6]&&n[1].length&&!n[7]&&ig(),N=n[6]&&n[1].length&&n[7]&&lg(n),P=n[13].length&&hg(n),q=!!n[0]&&_g(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=Z(`Paste below the collections configuration you want to import or
|
||
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=M(),V(a.$$.fragment),u=M(),L&&L.c(),f=M(),c=M(),F&&F.c(),d=M(),N&&N.c(),m=M(),P&&P.c(),h=M(),_=b("div"),q&&q.c(),g=M(),y=b("div"),S=M(),T=b("button"),$=b("span"),$.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"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(y,"class","flex-fill"),p($,"class","txt"),p(T,"type","button"),p(T,"class","btn btn-expanded btn-warning m-l-auto"),T.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(U,Y){w(U,e,Y),n[22](e),w(U,t,Y),w(U,i,Y),k(i,l),k(l,s),k(l,o),w(U,r,Y),H(a,U,Y),w(U,u,Y),L&&L.m(U,Y),w(U,f,Y),w(U,c,Y),F&&F.m(U,Y),w(U,d,Y),N&&N.m(U,Y),w(U,m,Y),P&&P.m(U,Y),w(U,h,Y),w(U,_,Y),q&&q.m(_,null),k(_,g),k(_,y),k(_,S),k(_,T),k(T,$),O=!0,D||(I=[K(e,"change",n[23]),K(o,"click",n[24]),K(T,"click",n[20])],D=!0)},p(U,Y){(!O||Y[0]&4096)&&x(o,"btn-loading",U[12]);const J={};Y[0]&64&&(J.class="form-field "+(U[6]?"":"field-error")),Y[0]&65|Y[1]&6144&&(J.$$scope={dirty:Y,ctx:U}),a.$set(J),U[1].length?L?(L.p(U,Y),Y[0]&2&&E(L,1)):(L=ng(U),L.c(),E(L,1),L.m(f.parentNode,f)):L&&(ie(),A(L,1,1,()=>{L=null}),le()),U[6]&&U[1].length&&!U[7]?F||(F=ig(),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),U[6]&&U[1].length&&U[7]?N?N.p(U,Y):(N=lg(U),N.c(),N.m(m.parentNode,m)):N&&(N.d(1),N=null),U[13].length?P?P.p(U,Y):(P=hg(U),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),U[0]?q?q.p(U,Y):(q=_g(U),q.c(),q.m(_,g)):q&&(q.d(1),q=null),(!O||Y[0]&16384&&C!==(C=!U[14]))&&(T.disabled=C)},i(U){O||(E(a.$$.fragment,U),E(L),E(R),O=!0)},o(U){A(a.$$.fragment,U),A(L),A(R),O=!1},d(U){U&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(h),v(_)),n[22](null),z(a,U),L&&L.d(U),F&&F.d(U),N&&N.d(U),P&&P.d(U),q&&q.d(),D=!1,we(I)}}}function l7(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function tg(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function s7(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&tg();return{c(){e=b("label"),t=Z("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ye(),p(e,"for",i=n[42]),p(e,"class","p-b-10"),p(s,"id",o=n[42]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),k(e,t),w(d,l,m),w(d,s,m),oe(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=K(s,"input",n[25]),u=!0)},p(d,m){m[1]&2048&&i!==(i=d[42])&&p(e,"for",i),m[1]&2048&&o!==(o=d[42])&&p(s,"id",o),m[0]&1&&oe(s,d[0]),d[0]&&!d[6]?c||(c=tg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function ng(n){let e,t;return e=new ce({props:{class:"form-field form-field-toggle",$$slots:{default:[o7,({uniqueId:i})=>({42:i}),({uniqueId:i})=>[0,i?2048:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&6144&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){A(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function o7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("input"),l=M(),s=b("label"),o=Z("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[42]),e.disabled=i=!n[6],p(s,"for",r=n[42])},m(f,c){w(f,e,c),e.checked=n[5],w(f,l,c),w(f,s,c),k(s,o),a||(u=K(e,"change",n[26]),a=!0)},p(f,c){c[1]&2048&&t!==(t=f[42])&&p(e,"id",t),c[0]&64&&i!==(i=!f[6])&&(e.disabled=i),c[0]&32&&(e.checked=f[5]),c[1]&2048&&r!==(r=f[42])&&p(s,"for",r)},d(f){f&&(v(e),v(l),v(s)),a=!1,u()}}}function ig(n){let e;return{c(){e=b("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&&v(e)}}}function lg(n){let e,t,i,l,s,o=n[9].length&&sg(n),r=n[3].length&&ag(n),a=n[8].length&&dg(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),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),k(i,l),r&&r.m(i,null),k(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=sg(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=ag(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=dg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function sg(n){let e=[],t=new Map,i,l=fe(n[9]);const s=o=>o[34].id;for(let o=0;o<l.length;o+=1){let r=eg(n,l,o),a=s(r);t.set(a,e[o]=rg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(l=fe(o[9]),e=at(e,r,s,1,o,l,t,i.parentNode,Li,rg,i,eg))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function og(n){let e,t=n[34].id+"",i;return{c(){e=b("small"),i=Z(t),p(e,"class","txt-hint")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&512&&t!==(t=l[34].id+"")&&se(i,t)},d(l){l&&v(e)}}}function rg(n,e){let t,i,l,s,o,r=e[34].name+"",a,u,f,c=e[34].id&&og(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Deleted",l=M(),s=b("div"),o=b("strong"),a=Z(r),u=M(),c&&c.c(),f=M(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(s,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(d,m){w(d,t,m),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),c&&c.m(s,null),k(t,f)},p(d,m){e=d,m[0]&512&&r!==(r=e[34].name+"")&&se(a,r),e[34].id?c?c.p(e,m):(c=og(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&v(t),c&&c.d()}}}function ag(n){let e=[],t=new Map,i,l=fe(n[3]);const s=o=>o[37].old.id+o[37].new.id;for(let o=0;o<l.length;o+=1){let r=x_(n,l,o),a=s(r);t.set(a,e[o]=cg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&8&&(l=fe(o[3]),e=at(e,r,s,1,o,l,t,i.parentNode,Li,cg,i,x_))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function ug(n){let e,t=n[37].old.name+"",i,l,s;return{c(){e=b("strong"),i=Z(t),l=M(),s=b("i"),p(e,"class","txt-strikethrough txt-hint"),p(s,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),k(e,i),w(o,l,r),w(o,s,r)},p(o,r){r[0]&8&&t!==(t=o[37].old.name+"")&&se(i,t)},d(o){o&&(v(e),v(l),v(s))}}}function fg(n){let e,t=n[37].new.id+"",i;return{c(){e=b("small"),i=Z(t),p(e,"class","txt-hint")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&8&&t!==(t=l[37].new.id+"")&&se(i,t)},d(l){l&&v(e)}}}function cg(n,e){let t,i,l,s,o,r,a=e[37].new.name+"",u,f,c,d=e[37].old.name!==e[37].new.name&&ug(e),m=e[37].new.id&&fg(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Changed",l=M(),s=b("div"),d&&d.c(),o=M(),r=b("strong"),u=Z(a),f=M(),m&&m.c(),c=M(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(s,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(h,_){w(h,t,_),k(t,i),k(t,l),k(t,s),d&&d.m(s,null),k(s,o),k(s,r),k(r,u),k(s,f),m&&m.m(s,null),k(t,c)},p(h,_){e=h,e[37].old.name!==e[37].new.name?d?d.p(e,_):(d=ug(e),d.c(),d.m(s,o)):d&&(d.d(1),d=null),_[0]&8&&a!==(a=e[37].new.name+"")&&se(u,a),e[37].new.id?m?m.p(e,_):(m=fg(e),m.c(),m.m(s,null)):m&&(m.d(1),m=null)},d(h){h&&v(t),d&&d.d(),m&&m.d()}}}function dg(n){let e=[],t=new Map,i,l=fe(n[8]);const s=o=>o[34].id;for(let o=0;o<l.length;o+=1){let r=Q_(n,l,o),a=s(r);t.set(a,e[o]=mg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(l=fe(o[8]),e=at(e,r,s,1,o,l,t,i.parentNode,Li,mg,i,Q_))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function pg(n){let e,t=n[34].id+"",i;return{c(){e=b("small"),i=Z(t),p(e,"class","txt-hint")},m(l,s){w(l,e,s),k(e,i)},p(l,s){s[0]&256&&t!==(t=l[34].id+"")&&se(i,t)},d(l){l&&v(e)}}}function mg(n,e){let t,i,l,s,o,r=e[34].name+"",a,u,f,c=e[34].id&&pg(e);return{key:n,first:null,c(){t=b("div"),i=b("span"),i.textContent="Added",l=M(),s=b("div"),o=b("strong"),a=Z(r),u=M(),c&&c.c(),f=M(),p(i,"class","label label-success list-label svelte-1jx20fl"),p(s,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(d,m){w(d,t,m),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,u),c&&c.m(s,null),k(t,f)},p(d,m){e=d,m[0]&256&&r!==(r=e[34].name+"")&&se(a,r),e[34].id?c?c.p(e,m):(c=pg(e),c.c(),c.m(s,null)):c&&(c.d(1),c=null)},d(d){d&&v(t),c&&c.d()}}}function hg(n){let e,t,i,l,s,o,r,a;return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=M(),l=b("div"),l.innerHTML=`<string>Some of the imported collections share the same name and/or fields but are
|
||
imported with different IDs. You can replace them in the import if you want
|
||
to.</string>`,s=M(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(l,"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),k(e,t),k(e,i),k(e,l),k(e,s),k(e,o),r||(a=K(o,"click",n[28]),r=!0)},p:Q,d(u){u&&v(e),r=!1,a()}}}function _g(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[29]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function r7(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[l7,i7],h=[];function _(g,y){return g[4]?0:1}return f=_(n),c=h[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[15]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(g,r,y),w(g,a,y),k(a,u),h[f].m(u,null),d=!0},p(g,y){(!d||y[0]&32768)&&se(o,g[15]);let S=f;f=_(g),f===S?h[f].p(g,y):(ie(),A(h[S],1,1,()=>{h[S]=null}),le(),c=h[f],c?c.p(g,y):(c=h[f]=m[f](g),c.c()),E(c,1),c.m(u,null))},i(g){d||(E(c),d=!0)},o(g){A(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function a7(n){let e,t,i,l,s,o;e=new gi({}),i=new bn({props:{$$slots:{default:[r7]},$$scope:{ctx:n}}});let r={};return s=new n7({props:r}),n[30](s),s.$on("submit",n[31]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,l,u),H(s,a,u),o=!0},p(a,u){const f={};u[0]&63487|u[1]&4096&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};s.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(s.$$.fragment,a),o=!0)},o(a){A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),z(e,a),z(i,a),n[30](null),z(s,a)}}}function u7(n,e,t){let i,l,s,o,r,a,u;We(n,Lt,ee=>t(15,u=ee)),xt(Lt,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],g=!0,y=[],S=!1,T=!1;$();async function $(){t(4,S=!0);try{t(21,_=await re.collections.getFullList(200));for(let ee of _)delete ee.created,delete ee.updated}catch(ee){re.error(ee)}t(4,S=!1)}function C(){if(t(3,y=[]),!!i)for(let ee of h){const ue=j.findByKey(_,"id",ee.id);!(ue!=null&&ue.id)||!j.hasCollectionChanges(ue,ee,g)||y.push({new:ee,old:ue})}}function O(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let ee of h)delete ee.created,delete ee.updated,ee.schema=j.filterDuplicatesByKey(ee.schema)}function D(){var ee,ue;for(let Oe of h){const He=j.findByKey(_,"name",Oe.name)||j.findByKey(_,"id",Oe.id);if(!He)continue;const Je=Oe.id,xe=He.id;Oe.id=xe;const bt=Array.isArray(He.schema)?He.schema:[],kt=Array.isArray(Oe.schema)?Oe.schema:[];for(const yt of kt){const Ot=j.findByKey(bt,"name",yt.name);Ot&&Ot.id&&(yt.id=Ot.id)}for(let yt of h)if(Array.isArray(yt.schema))for(let Ot of yt.schema)(ee=Ot.options)!=null&&ee.collectionId&&((ue=Ot.options)==null?void 0:ue.collectionId)===Je&&(Ot.options.collectionId=xe)}t(0,d=JSON.stringify(h,null,4))}function I(ee){t(12,m=!0);const ue=new FileReader;ue.onload=async Oe=>{t(12,m=!1),t(10,f.value="",f),t(0,d=Oe.target.result),await Qt(),h.length||(ii("Invalid collections configuration."),L())},ue.onerror=Oe=>{console.warn(Oe),ii("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ue.readAsText(ee)}function L(){t(0,d=""),t(10,f.value="",f),Zt({})}function R(){const ee=T?j.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,ee,g)}function F(ee){te[ee?"unshift":"push"](()=>{f=ee,t(10,f)})}const N=()=>{f.files.length&&I(f.files[0])},P=()=>{f.click()};function q(){d=this.value,t(0,d)}function U(){T=this.checked,t(5,T)}function Y(){g=this.checked,t(2,g)}const J=()=>D(),B=()=>L();function W(ee){te[ee?"unshift":"push"](()=>{c=ee,t(11,c)})}const pe=()=>{L(),$()};return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&T!==null&&O(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(ee=>!!ee.id&&!!ee.name).length),n.$$.dirty[0]&2097254&&t(9,l=_.filter(ee=>i&&!T&&g&&!j.findByKey(h,"id",ee.id))),n.$$.dirty[0]&2097218&&t(8,s=h.filter(ee=>i&&!j.findByKey(_,"id",ee.id))),n.$$.dirty[0]&6&&(typeof h<"u"||typeof g<"u")&&C(),n.$$.dirty[0]&777&&t(7,o=!!d&&(l.length||s.length||y.length)),n.$$.dirty[0]&208&&t(14,r=!S&&i&&o),n.$$.dirty[0]&2097154&&t(13,a=h.filter(ee=>{let ue=j.findByKey(_,"name",ee.name)||j.findByKey(_,"id",ee.id);if(!ue)return!1;if(ue.id!=ee.id)return!0;const Oe=Array.isArray(ue.schema)?ue.schema:[],He=Array.isArray(ee.schema)?ee.schema:[];for(const Je of He){if(j.findByKey(Oe,"id",Je.id))continue;const bt=j.findByKey(Oe,"name",Je.name);if(bt&&Je.id!=bt.id)return!0}return!1}))},[d,h,g,y,S,T,i,o,s,l,f,c,m,a,r,u,$,D,I,L,R,_,F,N,P,q,U,Y,J,B,W,pe]}class f7 extends ge{constructor(e){super(),_e(this,e,u7,a7,me,{},null,[-1,-1])}}function c7(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Z("Backup name"),l=M(),s=b("input"),r=M(),a=b("em"),a.textContent="Must be in the format [a-z0-9_-].zip",p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),p(s,"placeholder","Leave empty to autogenerate"),p(s,"pattern","^[a-z0-9_-]+\\.zip$"),p(a,"class","help-block")},m(c,d){w(c,e,d),k(e,t),w(c,l,d),w(c,s,d),oe(s,n[2]),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[7]),u=!0)},p(c,d){d&32768&&i!==(i=c[15])&&p(e,"for",i),d&32768&&o!==(o=c[15])&&p(s,"id",o),d&4&&s.value!==c[2]&&oe(s,c[2])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function d7(n){let e,t,i,l,s,o,r;return l=new ce({props:{class:"form-field m-0",name:"name",$$slots:{default:[c7,({uniqueId:a})=>({15:a}),({uniqueId:a})=>a?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
|
||
database will be temporary "locked" (this usually happens only during the ZIP generation).</p> <p class="txt-bold">If you are using S3 storage for the collections file upload, you'll have to backup them
|
||
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=M(),i=b("form"),V(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),H(l,i,null),s=!0,o||(r=K(i,"submit",Ue(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(E(l.$$.fragment,a),s=!0)},o(a){A(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),z(l),o=!1,r()}}}function p7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function m7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){w(a,e,u),k(e,t),w(a,i,u),w(a,l,u),k(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function h7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[m7],header:[p7],default:[d7]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[10](null),z(e,l)}}}function _7(n,e,t){const i=lt(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function u(S){Zt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await re.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),Pt("Successfully generated new backup.")}catch(S){S.isAbort||re.error(S)}clearTimeout(a),t(3,r=!1)}}Ss(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(So("A backup has already been started, please wait."),!1):!0,h=()=>(r&&So("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _(S){te[S?"unshift":"push"](()=>{s=S,t(1,s)})}function g(S){Ce.call(this,n,S)}function y(S){Ce.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,_,g,y]}class g7 extends ge{constructor(e){super(),_e(this,e,_7,h7,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function b7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Backup name"),l=M(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[2]),r||(a=K(s,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(s,"id",o),f&4&&s.value!==u[2]&&oe(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function k7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;return u=new ol({props:{value:n[1]}}),m=new ce({props:{class:"form-field required m-0",name:"name",$$slots:{default:[b7,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution and use it only with trusted backups!</p> <p>Backup restore is experimental and works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
|
||
the backup and will restart the application process.</p> <p>This means that on success all of your data (including app settings, users, admins, etc.) will
|
||
be replaced with the ones from the backup.</p> <p>Nothing will happen if the backup is invalid or incompatible (ex. missing
|
||
<code>data.db</code> file).</p></div>`,t=M(),i=b("div"),l=Z(`Type the backup name
|
||
`),s=b("div"),o=b("span"),r=Z(n[1]),a=M(),V(u.$$.fragment),f=Z(`
|
||
to confirm:`),c=M(),d=b("form"),V(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),k(i,l),k(i,s),k(s,o),k(o,r),k(s,a),H(u,s,null),k(i,f),w(y,c,S),w(y,d,S),H(m,d,null),h=!0,_||(g=K(d,"submit",Ue(n[7])),_=!0)},p(y,S){(!h||S&2)&&se(r,y[1]);const T={};S&2&&(T.value=y[1]),u.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:y}),m.$set($)},i(y){h||(E(u.$$.fragment,y),E(m.$$.fragment,y),h=!0)},o(y){A(u.$$.fragment,y),A(m.$$.fragment,y),h=!1},d(y){y&&(v(e),v(t),v(i),v(c),v(d)),z(u),z(m),_=!1,g()}}}function y7(n){let e,t,i,l;return{c(){e=b("h4"),t=Z("Restore "),i=b("strong"),l=Z(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),k(e,t),k(e,i),k(i,l)},p(s,o){o&2&&se(l,s[1])},d(s){s&&v(e)}}}function v7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Z("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),k(e,t),w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function w7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[v7],header:[y7],default:[k7]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[11](null),z(e,l)}}}function S7(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Zt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await re.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(T){clearTimeout(u),T!=null&&T.isAbort||(t(4,a=!1),ii(((S=T.response)==null?void 0:S.message)||T.message))}}}Ss(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ce.call(this,n,S)}function y(S){Ce.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,h,_,g,y]}class $7 extends ge{constructor(e){super(),_e(this,e,S7,w7,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function gg(n,e,t){const i=n.slice();return i[22]=e[t],i}function bg(n,e,t){const i=n.slice();return i[19]=e[t],i}function T7(n){let e=[],t=new Map,i,l,s=fe(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let u=gg(n,s,a),f=o(u);t.set(f,e[a]=yg(f,u))}let r=null;return s.length||(r=kg()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ye(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);w(a,i,u),r&&r.m(a,u),l=!0},p(a,u){u&876&&(s=fe(a[3]),ie(),e=at(e,u,o,1,a,s,t,i.parentNode,At,yg,i,gg),le(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=kg(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)E(e[u]);l=!0}},o(a){for(let u=0;u<e.length;u+=1)A(e[u]);l=!1},d(a){a&&v(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function C7(n){let e,t=fe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=vg(bg(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&8){t=fe(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=bg(l,t,o);i[o]?i[o].p(r,s):(i[o]=vg(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:Q,o:Q,d(l){l&&v(e),ot(i,l)}}}function kg(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="txt">No backups yet.</span> ',p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yg(n,e){let t,i,l,s,o,r=e[22].key+"",a,u,f,c,d,m=j.formattedFileSize(e[22].size)+"",h,_,g,y,S,T,$,C,O,D,I,L,R,F,N,P,q,U,Y,J;function B(){return e[10](e[22])}function W(){return e[11](e[22])}function pe(){return e[12](e[22])}return{key:n,first:null,c(){t=b("div"),i=b("i"),l=M(),s=b("div"),o=b("span"),a=Z(r),f=M(),c=b("span"),d=Z("("),h=Z(m),_=Z(")"),g=M(),y=b("div"),S=b("button"),T=b("i"),C=M(),O=b("button"),D=b("i"),L=M(),R=b("button"),F=b("i"),P=M(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(o,"title",u=e[22].key),p(c,"class","size txt-hint txt-nowrap"),p(s,"class","content"),p(T,"class","ri-download-line"),p(S,"type","button"),p(S,"class","btn btn-sm btn-circle btn-hint btn-transparent"),S.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(S,"aria-label","Download"),x(S,"btn-loading",e[5][e[22].key]),p(D,"class","ri-restart-line"),p(O,"type","button"),p(O,"class","btn btn-sm btn-circle btn-hint btn-transparent"),O.disabled=I=e[6][e[22].key],p(O,"aria-label","Restore"),p(F,"class","ri-delete-bin-7-line"),p(R,"type","button"),p(R,"class","btn btn-sm btn-circle btn-hint btn-transparent"),R.disabled=N=e[6][e[22].key],p(R,"aria-label","Delete"),x(R,"btn-loading",e[6][e[22].key]),p(y,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(ee,ue){w(ee,t,ue),k(t,i),k(t,l),k(t,s),k(s,o),k(o,a),k(s,f),k(s,c),k(c,d),k(c,h),k(c,_),k(t,g),k(t,y),k(y,S),k(S,T),k(y,C),k(y,O),k(O,D),k(y,L),k(y,R),k(R,F),k(t,P),U=!0,Y||(J=[$e(Pe.call(null,S,"Download")),K(S,"click",Ue(B)),$e(Pe.call(null,O,"Restore")),K(O,"click",Ue(W)),$e(Pe.call(null,R,"Delete")),K(R,"click",Ue(pe))],Y=!0)},p(ee,ue){e=ee,(!U||ue&8)&&r!==(r=e[22].key+"")&&se(a,r),(!U||ue&8&&u!==(u=e[22].key))&&p(o,"title",u),(!U||ue&8)&&m!==(m=j.formattedFileSize(e[22].size)+"")&&se(h,m),(!U||ue&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(S.disabled=$),(!U||ue&40)&&x(S,"btn-loading",e[5][e[22].key]),(!U||ue&72&&I!==(I=e[6][e[22].key]))&&(O.disabled=I),(!U||ue&72&&N!==(N=e[6][e[22].key]))&&(R.disabled=N),(!U||ue&72)&&x(R,"btn-loading",e[6][e[22].key])},i(ee){U||(ee&&Ke(()=>{U&&(q||(q=Fe(t,et,{duration:150},!0)),q.run(1))}),U=!0)},o(ee){ee&&(q||(q=Fe(t,et,{duration:150},!1)),q.run(0)),U=!1},d(ee){ee&&v(t),ee&&q&&q.end(),Y=!1,we(J)}}}function vg(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="skeleton-loader"></span> ',p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function O7(n){let e,t,i;return{c(){e=b("span"),t=M(),i=b("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function M7(n){let e,t,i;return{c(){e=b("i"),t=M(),i=b("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},d(l){l&&(v(e),v(t),v(i))}}}function D7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_;const g=[C7,T7],y=[];function S(I,L){return I[4]?0:1}i=S(n),l=y[i]=g[i](n);function T(I,L){return I[7]?M7:O7}let $=T(n),C=$(n),O={};f=new g7({props:O}),n[14](f),f.$on("submit",n[15]);let D={};return d=new $7({props:D}),n[16](d),{c(){e=b("div"),t=b("div"),l.c(),s=M(),o=b("div"),r=b("button"),C.c(),u=M(),V(f.$$.fragment),c=M(),V(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(I,L){w(I,e,L),k(e,t),y[i].m(t,null),k(e,s),k(e,o),k(o,r),C.m(r,null),w(I,u,L),H(f,I,L),w(I,c,L),H(d,I,L),m=!0,h||(_=K(r,"click",n[13]),h=!0)},p(I,[L]){let R=i;i=S(I),i===R?y[i].p(I,L):(ie(),A(y[R],1,1,()=>{y[R]=null}),le(),l=y[i],l?l.p(I,L):(l=y[i]=g[i](I),l.c()),E(l,1),l.m(t,null)),$!==($=T(I))&&(C.d(1),C=$(I),C&&(C.c(),C.m(r,null))),(!m||L&144&&a!==(a=I[4]||!I[7]))&&(r.disabled=a);const F={};f.$set(F);const N={};d.$set(N)},i(I){m||(E(l),E(f.$$.fragment,I),E(d.$$.fragment,I),m=!0)},o(I){A(l),A(f.$$.fragment,I),A(d.$$.fragment,I),m=!1},d(I){I&&(v(e),v(u),v(c)),y[i].d(),C.d(),n[14](null),z(f,I),n[16](null),z(d,I),h=!1,_()}}}function E7(n,e,t){let i,l,s=[],o=!1,r={},a={},u=!0;f(),h();async function f(){t(4,o=!0);try{t(3,s=await re.backups.getFullList()),s.sort((O,D)=>O.modified<D.modified?1:O.modified>D.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(re.error(O),t(4,o=!1))}}async function c(O){if(!r[O]){t(5,r[O]=!0,r);try{const D=await re.getAdminFileToken(),I=re.backups.getDownloadUrl(D,O);j.download(I)}catch(D){D.isAbort||re.error(D)}delete r[O],t(5,r)}}function d(O){fn(`Do you really want to delete ${O}?`,()=>m(O))}async function m(O){if(!a[O]){t(6,a[O]=!0,a);try{await re.backups.delete(O),j.removeByKey(s,"name",O),f(),Pt(`Successfully deleted ${O}.`)}catch(D){D.isAbort||re.error(D)}delete a[O],t(6,a)}}async function h(){var O;try{const D=await re.health.check({$autoCancel:!1}),I=u;t(7,u=((O=D==null?void 0:D.data)==null?void 0:O.canBackup)||!1),I!=u&&u&&f()}catch{}}Kt(()=>{let O=setInterval(()=>{h()},3e3);return()=>{clearInterval(O)}});const _=O=>c(O.key),g=O=>l.show(O.key),y=O=>d(O.key),S=()=>i==null?void 0:i.show();function T(O){te[O?"unshift":"push"](()=>{i=O,t(1,i)})}const $=()=>{f()};function C(O){te[O?"unshift":"push"](()=>{l=O,t(2,l)})}return[f,i,l,s,o,r,a,u,c,d,_,g,y,S,T,$,C]}class I7 extends ge{constructor(e){super(),_e(this,e,E7,D7,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function A7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("i"),l=M(),s=b("input"),p(t,"class","ri-upload-cloud-line"),p(e,"type","button"),p(e,"class",i="btn btn-circle btn-transparent "+n[0]),p(e,"aria-label","Upload backup"),x(e,"btn-loading",n[2]),x(e,"btn-disabled",n[2]),p(s,"type","file"),p(s,"accept","application/zip"),p(s,"class","hidden")},m(a,u){w(a,e,u),k(e,t),w(a,l,u),w(a,s,u),n[5](s),o||(r=[$e(Pe.call(null,e,"Upload backup")),K(e,"click",n[4]),K(s,"change",n[3])],o=!0)},p(a,[u]){u&1&&i!==(i="btn btn-circle btn-transparent "+a[0])&&p(e,"class",i),u&5&&x(e,"btn-loading",a[2]),u&5&&x(e,"btn-disabled",a[2])},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s)),n[5](null),o=!1,we(r)}}}const wg="upload_backup";function L7(n,e,t){const i=lt();let{class:l=""}=e,s,o=!1;async function r(f){var d,m,h,_,g;if(o||!((m=(d=f==null?void 0:f.target)==null?void 0:d.files)!=null&&m.length))return;t(2,o=!0);const c=new FormData;c.set("file",f.target.files[0]);try{await re.backups.upload(c,{requestKey:wg}),t(2,o=!1),i("success"),Pt("Successfully uploaded a new backup.")}catch(y){y.isAbort||(t(2,o=!1),(g=(_=(h=y.response)==null?void 0:h.data)==null?void 0:_.file)!=null&&g.message?ii(y.response.data.file.message):re.error(y))}}Ss(()=>{re.cancelRequest(wg)});const a=()=>s==null?void 0:s.click();function u(f){te[f?"unshift":"push"](()=>{s=f,t(1,s)})}return n.$$set=f=>{"class"in f&&t(0,l=f.class)},[l,s,o,r,a,u]}class N7 extends ge{constructor(e){super(),_e(this,e,L7,A7,me,{class:0})}}function P7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function F7(n){let e;return{c(){e=b("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Sg(n){var U,Y,J;let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D;t=new ce({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[R7,({uniqueId:B})=>({31:B}),({uniqueId:B})=>[0,B?1:0]]},$$scope:{ctx:n}}});let I=n[2]&&$g(n);function L(B){n[24](B)}function R(B){n[25](B)}function F(B){n[26](B)}let N={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(U=n[0].backups)==null?void 0:U.s3};n[1].backups.s3!==void 0&&(N.config=n[1].backups.s3),n[7]!==void 0&&(N.isTesting=n[7]),n[8]!==void 0&&(N.testError=n[8]),r=new o0({props:N}),te.push(()=>be(r,"config",L)),te.push(()=>be(r,"isTesting",R)),te.push(()=>be(r,"testError",F));let P=((J=(Y=n[1].backups)==null?void 0:Y.s3)==null?void 0:J.enabled)&&!n[9]&&!n[5]&&Tg(n),q=n[9]&&Cg(n);return{c(){e=b("form"),V(t.$$.fragment),i=M(),I&&I.c(),l=M(),s=b("div"),o=M(),V(r.$$.fragment),c=M(),d=b("div"),m=b("div"),h=M(),P&&P.c(),_=M(),q&&q.c(),g=M(),y=b("button"),S=b("span"),S.textContent="Save changes",p(s,"class","clearfix m-b-base"),p(m,"class","flex-fill"),p(S,"class","txt"),p(y,"type","submit"),p(y,"class","btn btn-expanded"),y.disabled=T=!n[9]||n[5],x(y,"btn-loading",n[5]),p(d,"class","flex"),p(e,"class","block"),p(e,"autocomplete","off")},m(B,W){w(B,e,W),H(t,e,null),k(e,i),I&&I.m(e,null),k(e,l),k(e,s),k(e,o),H(r,e,null),k(e,c),k(e,d),k(d,m),k(d,h),P&&P.m(d,null),k(d,_),q&&q.m(d,null),k(d,g),k(d,y),k(y,S),C=!0,O||(D=[K(y,"click",n[28]),K(e,"submit",Ue(n[11]))],O=!0)},p(B,W){var ue,Oe,He;const pe={};W[0]&4|W[1]&3&&(pe.$$scope={dirty:W,ctx:B}),t.$set(pe),B[2]?I?(I.p(B,W),W[0]&4&&E(I,1)):(I=$g(B),I.c(),E(I,1),I.m(e,l)):I&&(ie(),A(I,1,1,()=>{I=null}),le());const ee={};W[0]&1&&(ee.originalConfig=(ue=B[0].backups)==null?void 0:ue.s3),!a&&W[0]&2&&(a=!0,ee.config=B[1].backups.s3,ke(()=>a=!1)),!u&&W[0]&128&&(u=!0,ee.isTesting=B[7],ke(()=>u=!1)),!f&&W[0]&256&&(f=!0,ee.testError=B[8],ke(()=>f=!1)),r.$set(ee),(He=(Oe=B[1].backups)==null?void 0:Oe.s3)!=null&&He.enabled&&!B[9]&&!B[5]?P?P.p(B,W):(P=Tg(B),P.c(),P.m(d,_)):P&&(P.d(1),P=null),B[9]?q?q.p(B,W):(q=Cg(B),q.c(),q.m(d,g)):q&&(q.d(1),q=null),(!C||W[0]&544&&T!==(T=!B[9]||B[5]))&&(y.disabled=T),(!C||W[0]&32)&&x(y,"btn-loading",B[5])},i(B){C||(E(t.$$.fragment,B),E(I),E(r.$$.fragment,B),B&&Ke(()=>{C&&($||($=Fe(e,et,{duration:150},!0)),$.run(1))}),C=!0)},o(B){A(t.$$.fragment,B),A(I),A(r.$$.fragment,B),B&&($||($=Fe(e,et,{duration:150},!1)),$.run(0)),C=!1},d(B){B&&v(e),z(t),I&&I.d(),z(r),P&&P.d(),q&&q.d(),B&&$&&$.end(),O=!1,we(D)}}}function R7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Z("Enable auto backups"),p(e,"type","checkbox"),p(e,"id",t=n[31]),e.required=!0,p(l,"for",o=n[31])},m(u,f){w(u,e,f),e.checked=n[2],w(u,i,f),w(u,l,f),k(l,s),r||(a=K(e,"change",n[17]),r=!0)},p(u,f){f[1]&1&&t!==(t=u[31])&&p(e,"id",t),f[0]&4&&(e.checked=u[2]),f[1]&1&&o!==(o=u[31])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function $g(n){let e,t,i,l,s,o,r,a,u;return l=new ce({props:{class:"form-field required",name:"backups.cron",$$slots:{default:[j7,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),r=new ce({props:{class:"form-field required",name:"backups.cronMaxKeep",$$slots:{default:[H7,({uniqueId:f})=>({31:f}),({uniqueId:f})=>[0,f?1:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("div"),V(r.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(t,"class","grid p-t-base p-b-sm"),p(e,"class","block")},m(f,c){w(f,e,c),k(e,t),k(t,i),H(l,i,null),k(t,s),k(t,o),H(r,o,null),u=!0},p(f,c){const d={};c[0]&3|c[1]&3&&(d.$$scope={dirty:c,ctx:f}),l.$set(d);const m={};c[0]&2|c[1]&3&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(E(l.$$.fragment,f),E(r.$$.fragment,f),f&&Ke(()=>{u&&(a||(a=Fe(e,et,{duration:150},!0)),a.run(1))}),u=!0)},o(f){A(l.$$.fragment,f),A(r.$$.fragment,f),f&&(a||(a=Fe(e,et,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&v(e),z(l),z(r),f&&a&&a.end()}}}function q7(n){let e,t,i,l,s,o,r,a,u;return{c(){e=b("button"),e.innerHTML='<span class="txt">Every day at 00:00h</span>',t=M(),i=b("button"),i.innerHTML='<span class="txt">Every sunday at 00:00h</span>',l=M(),s=b("button"),s.innerHTML='<span class="txt">Every Mon and Wed at 00:00h</span>',o=M(),r=b("button"),r.innerHTML='<span class="txt">Every first day of the month at 00:00h</span>',p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item closable"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(r,"type","button"),p(r,"class","dropdown-item closable")},m(f,c){w(f,e,c),w(f,t,c),w(f,i,c),w(f,l,c),w(f,s,c),w(f,o,c),w(f,r,c),a||(u=[K(e,"click",n[19]),K(i,"click",n[20]),K(s,"click",n[21]),K(r,"click",n[22])],a=!0)},p:Q,d(f){f&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r)),a=!1,we(u)}}}function j7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-right",$$slots:{default:[q7]},$$scope:{ctx:n}}}),{c(){var F,N;e=b("label"),t=Z("Cron expression"),l=M(),s=b("input"),a=M(),u=b("div"),f=b("button"),c=b("span"),c.textContent="Presets",d=M(),m=b("i"),h=M(),V(_.$$.fragment),g=M(),y=b("div"),S=b("p"),T=Z(`Supports numeric list, steps, ranges or
|
||
`),$=b("span"),$.textContent="macros",C=Z(`.
|
||
`),O=b("br"),D=Z(`
|
||
The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((N=(F=n[0])==null?void 0:F.backups)!=null&&N.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p($,"class","link-primary"),p(y,"class","help-block")},m(F,N){var P,q;w(F,e,N),k(e,t),w(F,l,N),w(F,s,N),oe(s,n[1].backups.cron),w(F,a,N),w(F,u,N),k(u,f),k(f,c),k(f,d),k(f,m),k(f,h),H(_,f,null),w(F,g,N),w(F,y,N),k(y,S),k(S,T),k(S,$),k(S,C),k(S,O),k(S,D),I=!0,(q=(P=n[0])==null?void 0:P.backups)!=null&&q.cron||s.focus(),L||(R=[K(s,"input",n[18]),$e(Pe.call(null,$,`@yearly
|
||
@annually
|
||
@monthly
|
||
@weekly
|
||
@daily
|
||
@midnight
|
||
@hourly`))],L=!0)},p(F,N){var q,U;(!I||N[1]&1&&i!==(i=F[31]))&&p(e,"for",i),(!I||N[1]&1&&o!==(o=F[31]))&&p(s,"id",o),(!I||N[0]&1&&r!==(r=!((U=(q=F[0])==null?void 0:q.backups)!=null&&U.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==F[1].backups.cron&&oe(s,F[1].backups.cron);const P={};N[0]&2|N[1]&2&&(P.$$scope={dirty:N,ctx:F}),_.$set(P)},i(F){I||(E(_.$$.fragment,F),I=!0)},o(F){A(_.$$.fragment,F),I=!1},d(F){F&&(v(e),v(l),v(s),v(a),v(u),v(g),v(y)),z(_),L=!1,we(R)}}}function H7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Z("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){w(u,e,f),k(e,t),w(u,l,f),w(u,s,f),oe(s,n[1].backups.cronMaxKeep),r||(a=K(s,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(s,"id",o),f[0]&2&&it(s.value)!==u[1].backups.cronMaxKeep&&oe(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Tg(n){let e;function t(s,o){return s[7]?B7:s[8]?V7:z7}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function z7(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function V7(n){let e,t,i,l;return{c(){e=b("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(s,o){var r;w(s,e,o),i||(l=$e(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Mt(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function B7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function Cg(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),k(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function U7(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S,T,$,C,O,D,I,L,R,F;m=new Jo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new N7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};y=new I7({props:N}),n[15](y);function P(J,B){return J[6]?F7:P7}let q=P(n),U=q(n),Y=n[6]&&!n[4]&&Sg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Z(n[10]),r=M(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),V(m.$$.fragment),h=M(),V(_.$$.fragment),g=M(),V(y.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),O=b("span"),O.textContent="Backups options",D=M(),U.c(),I=M(),Y&&Y.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,B){w(J,e,B),k(e,t),k(t,i),k(t,l),k(t,s),k(s,o),w(J,r,B),w(J,a,B),k(a,u),k(u,f),k(f,c),k(f,d),H(m,f,null),k(f,h),H(_,f,null),k(u,g),H(y,u,null),k(u,S),k(u,T),k(u,$),k(u,C),k(C,O),k(C,D),U.m(C,null),k(u,I),Y&&Y.m(u,null),L=!0,R||(F=[K(C,"click",n[16]),K(u,"submit",Ue(n[11]))],R=!0)},p(J,B){(!L||B[0]&1024)&&se(o,J[10]);const W={};y.$set(W),q!==(q=P(J))&&(U.d(1),U=q(J),U&&(U.c(),U.m(C,null))),(!L||B[0]&16)&&(C.disabled=J[4]),(!L||B[0]&16)&&x(C,"btn-loading",J[4]),J[6]&&!J[4]?Y?(Y.p(J,B),B[0]&80&&E(Y,1)):(Y=Sg(J),Y.c(),E(Y,1),Y.m(u,null)):Y&&(ie(),A(Y,1,1,()=>{Y=null}),le())},i(J){L||(E(m.$$.fragment,J),E(_.$$.fragment,J),E(y.$$.fragment,J),E(Y),L=!0)},o(J){A(m.$$.fragment,J),A(_.$$.fragment,J),A(y.$$.fragment,J),A(Y),L=!1},d(J){J&&(v(e),v(r),v(a)),z(m),z(_),n[15](null),z(y),U.d(),Y&&Y.d(),R=!1,we(F)}}}function W7(n){let e,t,i,l;return e=new gi({}),i=new bn({props:{$$slots:{default:[U7]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(i,s,o),l=!0},p(s,o){const r={};o[0]&2047|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(E(e.$$.fragment,s),E(i.$$.fragment,s),l=!0)},o(s){A(e.$$.fragment,s),A(i.$$.fragment,s),l=!1},d(s){s&&v(t),z(e,s),z(i,s)}}}function Y7(n,e,t){let i,l;We(n,Lt,B=>t(10,l=B)),xt(Lt,l="Backups",l);let s,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,h=null;_();async function _(){t(4,a=!0);try{const B=await re.settings.getAll()||{};y(B)}catch(B){re.error(B)}t(4,a=!1)}async function g(){if(!(u||!i)){t(5,u=!0);try{const B=await re.settings.update(j.filterRedactedProps(r));await T(),y(B),Pt("Successfully saved application settings.")}catch(B){re.error(B)}t(5,u=!1)}}function y(B={}){t(1,r={backups:(B==null?void 0:B.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function T(){return s==null?void 0:s.loadBackups()}function $(B){te[B?"unshift":"push"](()=>{s=B,t(3,s)})}const C=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},L=()=>{t(1,r.backups.cron="0 0 * * 0",r)},R=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},F=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=it(this.value),t(1,r),t(2,c)}function P(B){n.$$.not_equal(r.backups.s3,B)&&(r.backups.s3=B,t(1,r),t(2,c))}function q(B){m=B,t(7,m)}function U(B){h=B,t(8,h)}const Y=()=>S(),J=()=>g();return n.$$.update=()=>{var B;n.$$.dirty[0]&1&&t(14,f=JSON.stringify(o)),n.$$.dirty[0]&6&&!c&&(B=r==null?void 0:r.backups)!=null&&B.cron&&(li("backups.cron"),t(1,r.backups.cron="",r)),n.$$.dirty[0]&16386&&t(9,i=f!=JSON.stringify(r))},[o,r,c,s,a,u,d,m,h,i,l,g,S,T,f,$,C,O,D,I,L,R,F,N,P,q,U,Y,J]}class K7 extends ge{constructor(e){super(),_e(this,e,Y7,W7,me,{},null,[-1,-1])}}const Rt=[async n=>{const e=new URLSearchParams(window.location.search);return n.location!=="/"&&e.has("installer")?nl("/"):!0}],J7={"/login":Nt({component:KE,conditions:Rt.concat([n=>!re.authStore.isValid]),userData:{showAppSidebar:!1}}),"/request-password-reset":Nt({asyncComponent:()=>tt(()=>import("./PageAdminRequestPasswordReset-CbPBMY-4.js"),[],import.meta.url),conditions:Rt.concat([n=>!re.authStore.isValid]),userData:{showAppSidebar:!1}}),"/confirm-password-reset/:token":Nt({asyncComponent:()=>tt(()=>import("./PageAdminConfirmPasswordReset-6rzV_bds.js"),[],import.meta.url),conditions:Rt.concat([n=>!re.authStore.isValid]),userData:{showAppSidebar:!1}}),"/collections":Nt({component:mE,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/logs":Nt({component:p$,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings":Nt({component:nI,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/admins":Nt({component:zE,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/mail":Nt({component:BI,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/storage":Nt({component:fA,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/auth-providers":Nt({component:OA,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/tokens":Nt({component:FA,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/export-collections":Nt({component:UA,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/import-collections":Nt({component:f7,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/settings/backups":Nt({component:K7,conditions:Rt.concat([n=>re.authStore.isValid]),userData:{showAppSidebar:!0}}),"/users/confirm-password-reset/:token":Nt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-C0SXqP-7.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/auth/confirm-password-reset/:token":Nt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmPasswordReset-C0SXqP-7.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/users/confirm-verification/:token":Nt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-hM3-wQxV.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/auth/confirm-verification/:token":Nt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmVerification-hM3-wQxV.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/users/confirm-email-change/:token":Nt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-cSlikB_9.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/auth/confirm-email-change/:token":Nt({asyncComponent:()=>tt(()=>import("./PageRecordConfirmEmailChange-cSlikB_9.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-success":Nt({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectSuccess-DQF4mc25.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"/auth/oauth2-redirect-failure":Nt({asyncComponent:()=>tt(()=>import("./PageOAuth2RedirectFailure-Ds0U5_vH.js"),[],import.meta.url),conditions:Rt,userData:{showAppSidebar:!1}}),"*":Nt({component:Rv,userData:{showAppSidebar:!1}})};function Z7(n,{from:e,to:t},i={}){const l=getComputedStyle(n),s=l.transform==="none"?"":l.transform,[o,r]=l.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*o/t.width-(t.left+o),u=e.top+e.height*r/t.height-(t.top+r),{delay:f=0,duration:c=m=>Math.sqrt(m)*120,easing:d=Ko}=i;return{delay:f,duration:Mt(c)?c(Math.sqrt(a*a+u*u)):c,easing:d,css:(m,h)=>{const _=h*a,g=h*u,y=m+h*e.width/t.width,S=m+h*e.height/t.height;return`transform: ${s} translate(${_}px, ${g}px) scale(${y}, ${S});`}}}function Og(n,e,t){const i=n.slice();return i[2]=e[t],i}function G7(n){let e;return{c(){e=b("i"),p(e,"class","ri-alert-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function X7(n){let e;return{c(){e=b("i"),p(e,"class","ri-error-warning-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Q7(n){let e;return{c(){e=b("i"),p(e,"class","ri-checkbox-circle-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function x7(n){let e;return{c(){e=b("i"),p(e,"class","ri-information-line")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function Mg(n,e){let t,i,l,s,o=e[2].message+"",r,a,u,f,c,d,m,h=Q,_,g,y;function S(O,D){return O[2].type==="info"?x7:O[2].type==="success"?Q7:O[2].type==="warning"?X7:G7}let T=S(e),$=T(e);function C(){return e[1](e[2])}return{key:n,first:null,c(){t=b("div"),i=b("div"),$.c(),l=M(),s=b("div"),r=Z(o),a=M(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=M(),p(i,"class","icon"),p(s,"class","content"),p(u,"type","button"),p(u,"class","close"),p(t,"class","alert txt-break"),x(t,"alert-info",e[2].type=="info"),x(t,"alert-success",e[2].type=="success"),x(t,"alert-danger",e[2].type=="error"),x(t,"alert-warning",e[2].type=="warning"),this.first=t},m(O,D){w(O,t,D),k(t,i),$.m(i,null),k(t,l),k(t,s),k(s,r),k(t,a),k(t,u),k(t,f),_=!0,g||(y=K(u,"click",Ue(C)),g=!0)},p(O,D){e=O,T!==(T=S(e))&&($.d(1),$=T(e),$&&($.c(),$.m(i,null))),(!_||D&1)&&o!==(o=e[2].message+"")&&se(r,o),(!_||D&1)&&x(t,"alert-info",e[2].type=="info"),(!_||D&1)&&x(t,"alert-success",e[2].type=="success"),(!_||D&1)&&x(t,"alert-danger",e[2].type=="error"),(!_||D&1)&&x(t,"alert-warning",e[2].type=="warning")},r(){m=t.getBoundingClientRect()},f(){A0(t),h(),qg(t,m)},a(){h(),h=I0(t,m,Z7,{duration:150})},i(O){_||(O&&Ke(()=>{_&&(d&&d.end(1),c=zg(t,et,{duration:150}),c.start())}),_=!0)},o(O){c&&c.invalidate(),O&&(d=ka(t,cs,{duration:150})),_=!1},d(O){O&&v(t),$.d(),O&&d&&d.end(),g=!1,y()}}}function eL(n){let e,t=[],i=new Map,l,s=fe(n[0]);const o=r=>r[2].message;for(let r=0;r<s.length;r+=1){let a=Og(n,s,r),u=o(a);i.set(u,t[r]=Mg(u,a))}return{c(){e=b("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]&&t[u].m(e,null);l=!0},p(r,[a]){if(a&1){s=fe(r[0]),ie();for(let u=0;u<t.length;u+=1)t[u].r();t=at(t,a,o,1,r,s,i,e,R0,Mg,null,Og);for(let u=0;u<t.length;u+=1)t[u].a();le()}},i(r){if(!l){for(let a=0;a<s.length;a+=1)E(t[a]);l=!0}},o(r){for(let a=0;a<t.length;a+=1)A(t[a]);l=!1},d(r){r&&v(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function tL(n,e,t){let i;return We(n,Wo,s=>t(0,i=s)),[i,s=>x1(s)]}class nL extends ge{constructor(e){super(),_e(this,e,tL,eL,me,{})}}function iL(n){var l;let e,t=((l=n[1])==null?void 0:l.text)+"",i;return{c(){e=b("h4"),i=Z(t),p(e,"class","block center txt-break"),p(e,"slot","header")},m(s,o){w(s,e,o),k(e,i)},p(s,o){var r;o&2&&t!==(t=((r=s[1])==null?void 0:r.text)+"")&&se(i,t)},d(s){s&&v(e)}}}function lL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="No",i=M(),l=b("button"),s=b("span"),s.textContent="Yes",p(t,"class","txt"),e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent btn-expanded-sm"),e.disabled=n[2],p(s,"class","txt"),p(l,"type","button"),p(l,"class","btn btn-danger btn-expanded"),l.disabled=n[2],x(l,"btn-loading",n[2])},m(a,u){w(a,e,u),k(e,t),w(a,i,u),w(a,l,u),k(l,s),e.focus(),o||(r=[K(e,"click",n[4]),K(l,"click",n[5])],o=!0)},p(a,u){u&4&&(e.disabled=a[2]),u&4&&(l.disabled=a[2]),u&4&&x(l,"btn-loading",a[2])},d(a){a&&(v(e),v(i),v(l)),o=!1,we(r)}}}function sL(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:[lL],header:[iL]},$$scope:{ctx:n}};return e=new Gt({props:i}),n[6](e),e.$on("hide",n[7]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,[s]){const o={};s&4&&(o.overlayClose=!l[2]),s&4&&(o.escClose=!l[2]),s&271&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){A(e.$$.fragment,l),t=!1},d(l){n[6](null),z(e,l)}}}function oL(n,e,t){let i;We(n,Ja,c=>t(1,i=c));let l,s=!1,o=!1;const r=()=>{t(3,o=!1),l==null||l.hide()},a=async()=>{i!=null&&i.yesCallback&&(t(2,s=!0),await Promise.resolve(i.yesCallback()),t(2,s=!1)),t(3,o=!0),l==null||l.hide()};function u(c){te[c?"unshift":"push"](()=>{l=c,t(0,l)})}const f=async()=>{!o&&(i!=null&&i.noCallback)&&i.noCallback(),await Qt(),t(3,o=!1),Gb()};return n.$$.update=()=>{n.$$.dirty&3&&i!=null&&i.text&&(t(3,o=!1),l==null||l.show())},[l,i,s,o,r,a,u,f]}class rL extends ge{constructor(e){super(),_e(this,e,oL,sL,me,{})}}function Dg(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,y,S;return _=new On({props:{class:"dropdown dropdown-nowrap dropdown-upside dropdown-left",$$slots:{default:[aL]},$$scope:{ctx:n}}}),{c(){var T;e=b("aside"),t=b("a"),t.innerHTML='<img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>',i=M(),l=b("nav"),s=b("a"),s.innerHTML='<i class="ri-database-2-line"></i>',o=M(),r=b("a"),r.innerHTML='<i class="ri-line-chart-line"></i>',a=M(),u=b("a"),u.innerHTML='<i class="ri-tools-line"></i>',f=M(),c=b("div"),d=b("img"),h=M(),V(_.$$.fragment),p(t,"href","/"),p(t,"class","logo logo-sm"),p(s,"href","/collections"),p(s,"class","menu-item"),p(s,"aria-label","Collections"),p(r,"href","/logs"),p(r,"class","menu-item"),p(r,"aria-label","Logs"),p(u,"href","/settings"),p(u,"class","menu-item"),p(u,"aria-label","Settings"),p(l,"class","main-menu"),en(d.src,m="./images/avatars/avatar"+(((T=n[0])==null?void 0:T.avatar)||0)+".svg")||p(d,"src",m),p(d,"alt","Avatar"),p(d,"aria-hidden","true"),p(c,"tabindex","0"),p(c,"role","button"),p(c,"aria-label","Logged admin menu"),p(c,"class","thumb thumb-circle link-hint closable"),p(e,"class","app-sidebar")},m(T,$){w(T,e,$),k(e,t),k(e,i),k(e,l),k(l,s),k(l,o),k(l,r),k(l,a),k(l,u),k(e,f),k(e,c),k(c,d),k(c,h),H(_,c,null),g=!0,y||(S=[$e(ln.call(null,t)),$e(ln.call(null,s)),$e(Ln.call(null,s,{path:"/collections/?.*",className:"current-route"})),$e(Pe.call(null,s,{text:"Collections",position:"right"})),$e(ln.call(null,r)),$e(Ln.call(null,r,{path:"/logs/?.*",className:"current-route"})),$e(Pe.call(null,r,{text:"Logs",position:"right"})),$e(ln.call(null,u)),$e(Ln.call(null,u,{path:"/settings/?.*",className:"current-route"})),$e(Pe.call(null,u,{text:"Settings",position:"right"}))],y=!0)},p(T,$){var O;(!g||$&1&&!en(d.src,m="./images/avatars/avatar"+(((O=T[0])==null?void 0:O.avatar)||0)+".svg"))&&p(d,"src",m);const C={};$&4096&&(C.$$scope={dirty:$,ctx:T}),_.$set(C)},i(T){g||(E(_.$$.fragment,T),g=!0)},o(T){A(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(_),y=!1,we(S)}}}function aL(n){let e,t,i,l,s,o,r;return{c(){e=b("a"),e.innerHTML='<i class="ri-shield-user-line" aria-hidden="true"></i> <span class="txt">Manage admins</span>',t=M(),i=b("hr"),l=M(),s=b("button"),s.innerHTML='<i class="ri-logout-circle-line" aria-hidden="true"></i> <span class="txt">Logout</span>',p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(e,"role","menuitem"),p(s,"type","button"),p(s,"class","dropdown-item closable"),p(s,"role","menuitem")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,l,u),w(a,s,u),o||(r=[$e(ln.call(null,e)),K(s,"click",n[7])],o=!0)},p:Q,d(a){a&&(v(e),v(t),v(i),v(l),v(s)),o=!1,we(r)}}}function Eg(n){let e,t,i;return t=new Qa({props:{conf:j.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(l,s){w(l,e,s),H(t,e,null),i=!0},p:Q,i(l){i||(E(t.$$.fragment,l),i=!0)},o(l){A(t.$$.fragment,l),i=!1},d(l){l&&v(e),z(t)}}}function uL(n){var g;let e,t,i,l,s,o,r,a,u,f,c,d,m;document.title=e=j.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let h=((g=n[0])==null?void 0:g.id)&&n[1]&&Dg(n);o=new Y0({props:{routes:J7}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new nL({}),f=new rL({});let _=n[1]&&!n[2]&&Eg(n);return{c(){t=M(),i=b("div"),h&&h.c(),l=M(),s=b("div"),V(o.$$.fragment),r=M(),V(a.$$.fragment),u=M(),V(f.$$.fragment),c=M(),_&&_.c(),d=ye(),p(s,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),h&&h.m(i,null),k(i,l),k(i,s),H(o,s,null),k(s,r),H(a,s,null),w(y,u,S),H(f,y,S),w(y,c,S),_&&_.m(y,S),w(y,d,S),m=!0},p(y,[S]){var T;(!m||S&24)&&e!==(e=j.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),(T=y[0])!=null&&T.id&&y[1]?h?(h.p(y,S),S&3&&E(h,1)):(h=Dg(y),h.c(),E(h,1),h.m(i,l)):h&&(ie(),A(h,1,1,()=>{h=null}),le()),y[1]&&!y[2]?_?(_.p(y,S),S&6&&E(_,1)):(_=Eg(y),_.c(),E(_,1),_.m(d.parentNode,d)):_&&(ie(),A(_,1,1,()=>{_=null}),le())},i(y){m||(E(h),E(o.$$.fragment,y),E(a.$$.fragment,y),E(f.$$.fragment,y),E(_),m=!0)},o(y){A(h),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(_),m=!1},d(y){y&&(v(t),v(i),v(u),v(c),v(d)),h&&h.d(),z(o),z(a),z(f,y),_&&_.d(y)}}}function fL(n,e,t){let i,l,s,o;We(n,Qi,_=>t(10,i=_)),We(n,Co,_=>t(3,l=_)),We(n,Aa,_=>t(0,s=_)),We(n,Lt,_=>t(4,o=_));let r,a=!1,u=!1;function f(_){var g,y,S,T;((g=_==null?void 0:_.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=_==null?void 0:_.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=(T=_==null?void 0:_.detail)==null?void 0:T.location,xt(Lt,o="",o),Zt({}),Gb())}function c(){nl("/")}async function d(){var _,g;if(s!=null&&s.id)try{const y=await re.settings.getAll({$cancelKey:"initialAppSettings"});xt(Co,l=((_=y==null?void 0:y.meta)==null?void 0:_.appName)||"",l),xt(Qi,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){re.logout()}const h=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&d()},[s,a,u,l,o,f,c,m,h]}class cL extends ge{constructor(e){super(),_e(this,e,fL,uL,me,{})}}new cL({target:document.getElementById("app")});export{we as A,Pt as B,j as C,nl as D,ye as E,ib as F,jo as G,wl as H,Kt as I,We as J,Rn as K,lt as L,te as M,Yb as N,fe as O,ot as P,at as Q,Li as R,ge as S,At as T,O0 as U,E as a,v as b,V as c,z as d,le as e,w as f,ie as g,k as h,_e as i,$e as j,M as k,ln as l,H as m,b as n,p as o,re as p,Q as q,se as r,me as s,A as t,Z as u,ce as v,x as w,K as x,Ue as y,oe as z};
|