1
0
mirror of https://github.com/pocketbase/pocketbase.git synced 2024-12-12 21:30:01 +02:00
pocketbase/ui/dist/assets/index-a427923c.js

227 lines
967 KiB
JavaScript
Raw Normal View History

(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function te(){}const $l=n=>n;function je(n,e){for(const t in e)n[t]=e[t];return n}function j1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function x_(n){return n()}function _u(){return Object.create(null)}function De(n){n.forEach(x_)}function jt(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let jl;function _n(n,e){return jl||(jl=document.createElement("a")),jl.href=e,n===jl.href}function V1(n){return Object.keys(n).length===0}function ya(n,...e){if(n==null)return te;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function z1(n){let e;return ya(n,t=>e=t)(),e}function Ze(n,e,t){n.$$.on_destroy.push(ya(e,t))}function kt(n,e,t,i){if(n){const s=eg(n,e,t,i);return n[0](s)}}function eg(n,e,t,i){return n[1]&&i?je(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function St(n,e,t,i,s,l){if(s){const o=eg(e,t,i,l);n.p(o,s)}}function $t(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Gt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function et(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function os(n){return n??""}function ln(n,e,t){return n.set(t),e}function Oe(n){return n&&jt(n.destroy)?n.destroy:te}function gu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const tg=typeof window<"u";let qo=tg?()=>window.performance.now():()=>Date.now(),ka=tg?n=>requestAnimationFrame(n):te;const Ss=new Set;function ng(n){Ss.forEach(e=>{e.c(n)||(Ss.delete(e),e.f())}),Ss.size!==0&&ka(ng)}function jo(n){let e;return Ss.size===0&&ka(ng),{promise:new Promise(t=>{Ss.add(e={c:n,f:t})}),abort(){Ss.delete(e)}}}const H1=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;"WeakMap"in H1;function b(n,e){n.appendChild(e)}function ig(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function B1(n){const e=y("style");return U1(ig(n),e),e.sheet}function U1(n,e){return b(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function W(n){return document.createTextNode(n)}function D(){return W(" ")}function ke(){return W("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function tt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function In(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function m(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const W1=["width","height"];function ai(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set&&W1.indexOf(i)===-1?n[i]=e[i]:m(n,i,e[i])}function Y1(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(
`;for(let v=0;v<=1;v+=a){const k=e+(t-e)*l(v);u+=v*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,d=`__svelte_${J1(f)}_${r}`,p=ig(n),{stylesheet:h,rules:g}=_o.get(p)||Z1(p,n);g[d]||(g[d]=!0,h.insertRule(`@keyframes ${d} ${f}`,h.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${d} ${i}ms linear ${s}ms 1 both`,go+=1,d}function ml(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),go-=s,go||G1())}function G1(){ka(()=>{go||(_o.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),_o.clear())})}function X1(n,e,t,i){if(!e)return te;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return te;const{delay:l=0,duration:o=300,easing:r=$l,start:a=qo()+l,end:u=a+o,tick:f=te,css:d}=t(n,{from:e,to:s},i);let p=!0,h=!1,g;function _(){d&&(g=pl(n,0,1,o,l,r,d)),l||(h=!0)}function v(){d&&ml(n,g),p=!1}return jo(k=>{if(!h&&k>=a&&(h=!0),h&&k>=u&&(f(1,0),v()),!p)return!1;if(h){const $=k-a,C=0+1*r($/o);f(C,1-C)}return!0}),_(),f(0,1),v}function Q1(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,lg(n,s)}}function lg(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let hl;function vi(n){hl=n}function Tl(){if(!hl)throw new Error("Function called outside component initialization");return hl}function Xt(n){Tl().$$.on_mount.push(n)}function x1(n){Tl().$$.after_update.push(n)}function Vo(n){Tl().$$.on_destroy.push(n)}function Tt(){const n=Tl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=sg(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const ws=[],ne=[];let $s=[];const Br=[],og=Promise.resolve();let Ur=!1;function rg(){Ur||(Ur=!0,og.then(wa))}function cn(){return rg(),og}function xe(n){$s.push(n)}function _e(n){Br.push(n)}const lr=new Set;let _s=0;function wa(){if(_s!==0)return;const n=hl;do{try{for(;_s<ws.length;){const e=ws[_s];_s++,vi(e),e0(e.$$)}}catch(e){throw ws.length=0,_s=0,e}for(vi(null),ws.length=0,_s=0;ne.length;)ne.pop()();for(let e=0;e<$s.length;e+=1){const t=$s[e];lr.has(t)||(lr.add(t),t())}$s.length=0}while(ws.length);for(;Br.length;)Br.pop()();Ur=!1,lr.clear(),vi(n)}function e0(n){if(n.fragment!==null){n.update(),De(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(xe)}}function t0(n){const e=[],t=[];$s.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),$s=e}let Bs;function Sa(){return Bs||(Bs=Promise.resolve(),Bs.then(()=>{Bs=null})),Bs}function ns(n,e,t){n.dispatchEvent(sg(`${e?"intro":"outro"}${t}`))}const ro=new Set;let li;function ae(){li={r:0,c:[],p:li}}function ue(){li.r||De(li.c),li=li.p}function I(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),li.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const $a={duration:0};function ag(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ml(n,o)}function f(){const{delay:p=0,duration:h=300,easing:g=$l,tick:_=te,css:v}=s||$a;v&&(o=pl(n,0,1,h,p,g,v,a++)),_(0,1);const k=qo()+p,$=k+h;r&&r.abort(),l=!0,xe(()=>ns(n,!0,"start")),r=jo(C=>{if(l){if(C>=$)return _(1,0),ns(n,!0,"end"),u(),l=!1;if(C>=k){const T=g((C-k)/h);_(T,1-T)}}return l})}let d=!1;return{start(){d||(d=!0,ml(n),jt(s)?(s=s(i),Sa().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Ta(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=li;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=$l,tick:p=te,css:h}=s||$a;h&&(o=pl(n,1,0,f,u,d,h));const g=qo()+u,_=g+f;xe(()=>ns(n,!1,"start")),jo(v=>{if(l){if(v>=_)return p(0,1),ns(n,!1,"end"),--r.r||De(r.c),!1;if(v>=g
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=U.parseIndex(e);return i.tableName=t,U.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=U.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?U.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}}const Yo=Ln([]);function ko(n,e=4e3){return Ko(n,"info",e)}function Ht(n,e=3e3){return Ko(n,"success",e)}function As(n,e=4500){return Ko(n,"error",e)}function Ay(n,e=4500){return Ko(n,"warning",e)}function Ko(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{_b(i)},t)};Yo.update(s=>(Ra(s,i.message),U.pushOrReplaceByKey(s,i,"message"),s))}function _b(n){Yo.update(e=>(Ra(e,n),e))}function Fa(){Yo.update(n=>{for(let e of n)Ra(n,e);return[]})}function Ra(n,e){let t;typeof e=="string"?t=U.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),U.removeByKey(n,"message",t.message))}const Ti=Ln({});function tn(n){Ti.set(n||{})}function ui(n){Ti.update(e=>(U.deleteByPath(e,n),e))}const qa=Ln({});function ta(n){qa.set(n||{})}const di=Ln([]),fi=Ln({}),wo=Ln(!1),gb=Ln({});function Iy(n){di.update(e=>{const t=U.findByKey(e,"id",n);return t?fi.set(t):e.length&&fi.set(e[0]),e})}function Ly(n){fi.update(e=>U.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),di.update(e=>(U.pushOrReplaceByKey(e,n,"id"),ja(),U.sortCollections(e)))}function Py(n){di.update(e=>(U.removeByKey(e,"id",n.id),fi.update(t=>t.id===n.id?e[0]:t),ja(),e))}async function Ny(n=null){wo.set(!0);try{let e=await ce.collections.getFullList(200,{sort:"+name"});e=U.sortCollections(e),di.set(e);const t=n&&U.findByKey(e,"id",n);t?fi.set(t):e.length&&fi.set(e[0]),ja()}catch(e){ce.error(e)}wo.set(!1)}function ja(){gb.update(n=>(di.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const mr="pb_admin_file_token";Ho.prototype.logout=function(n=!0){this.authStore.clear(),n&&Vi("/login")};Ho.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&As(l)}if(U.isEmpty(s.data)||tn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Vi("/")};Ho.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=z1(gb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(mr)||"";return(!t||_g(t,10))&&(t&&localStorage.removeItem(mr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(mr,t),this._adminFileTokenRequest=null),t};class Fy extends gg{save(e,t){super.save(e,t),t instanceof rs&&ta(t)}clear(){super.clear(),ta(null)}}const ce=new Ho("../",new Fy("pb_admin_auth"));ce.authStore.model instanceof rs&&ta(ce.authStore.model);function Ry(n){let e,t,i,s,l,o,r,a,u,f,d,p;const h=n[3].default,g=kt(h,n,n[2],null);return{c(){e=y("div"),t=y("main"),g&&g.c(),i=D(),s=y("footer"),l=y("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=D(),r=y("span"),r.textContent="|",a=D(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.16.2",m(t,"class","page-content"),m(l,"href","https://pocketbase.io/docs/"),m(l,"target","_blank"),m(l,"rel","noopener noreferrer"),m(r,"class","delimiter"),m(f,"class","txt"),m(u,"href","https://github.com/pocketbase/pocketbase/releases"),m(u,"target","_blank"),m(u,"rel","noopener noreferrer"),m(u,"title","Releases"),m(s,"class","page-footer"),m(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(_,v){S(_,e,v),b(e,t),g&&g.m(t,null),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(u,f),p=!0},p(_,[v]){g&&g.p&&(!p||v&4)&&St(g,h,_,_[2],p?wt(h,_[2],v,null):$t(_[2]),null),(!p||v&2&&d!==(d="page-wrapper "+_[1]))&&m(e,"class",d),(!p||v&3)&&x(e,"center-content",_[0])},i(_){p||(I(g,_),p=!0)},o(_){L(g,_),p=!1},d(_){_&&w(e),g&&g.d(_)}}}function qy(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Sn extends be{constructor(e){super(),ge(this,e,qy,Ry,he,{center:0,class:1})}}function Xu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=y("div"),m(e,"class","block txt-center m-b-lg"),m(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function jy(n){let e,t,i,s=!n[0]&&Xu();const l=n[1].default,o=kt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=D(),o&&o.c(),m(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Xu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&St(o,l,r,r[2],i?wt(l,r[2],a,null):$t(r[2]),null)},i(r){i||(I(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function Vy(n){let e,t;return e=new Sn({props:{class:"full-page",center:!0,$$slots:{default:[jy]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function zy(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class bb extends be{constructor(e){super(),ge(this,e,zy,Vy,he,{nobranding:0})}}function Jo(n){const e=n-1;return e*e*e+1}function na(n,{delay:e=0,duration:t=400,easing:i=$l}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ci(n,{delay:e=0,duration:t=400,easing:i=Jo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[d,p]=gu(s),[h,g]=gu(l);return{delay:e,duration:t,easing:i,css:(_,v)=>`
transform: ${u} translate(${(1-_)*d}${p}, ${(1-_)*h}${g});
opacity: ${a-f*v}`}}function rt(n,{delay:e=0,duration:t=400,easing:i=Jo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),_=parseFloat(l[`border${f[0]}Width`]),v=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*h}px;margin-${u[1]}: ${k*g}px;border-${u[0]}-width: ${k*_}px;border-${u[1]}-width: ${k*v}px;`}}function Jt(n,{delay:e=0,duration:t=400,easing:i=Jo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(d,p)=>`
transform: ${a} scale(${1-u*p});
opacity: ${r-f*p}
`}}let ia,Ki;const sa="app-tooltip";function Qu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Fi(){return Ki=Ki||document.querySelector("."+sa),Ki||(Ki=document.createElement("div"),Ki.classList.add(sa),document.body.appendChild(Ki)),Ki}function vb(n,e){let t=Fi();if(!t.classList.contains("active")||!(e!=null&&e.text)){la();return}t.textContent=e.text,t.className=sa+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function la(){clearTimeout(ia),Fi().classList.remove("active"),Fi().activeNode=void 0}function Hy(n,e){Fi().activeNode=n,clearTimeout(ia),ia=setTimeout(()=>{Fi().classList.add("active"),vb(n,e)},isNaN(e.delay)?0:e.delay)}function Be(n,e){let t=Qu(e);function i(){Hy(n,t)}function s(){la()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&U.isFocusable(n))&&n.addEventListener("click",s),Fi(),{update(l){var o,r;t=Qu(l),(r=(o=Fi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&vb(n,t)},destroy(){var l,o;(o=(l=Fi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&la(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function xu(n,e,t){const i=n.slice();return i[12]=e[t],i}const By=n=>({}),ef=n=>({uniqueId:n[4]});function Uy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=tf(xu(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=xu(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=tf(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function Wy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("i"),m(t,"class","ri-error-warning-fill txt-danger"),m(e,"class","form-field-addon")},m(a,u){S(a,e,u),b(e,t),l=!0,o||(r=Oe(i=Be.call(null,t,{position:"left",text:n[3].map(So).join(`
`)})),o=!0)},p(a,u){i&&jt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(So).join(`
`)})},i(a){l||(a&&xe(()=>{l&&(s||(s=Ve(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function tf(n){let e,t,i=So(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=W(i),l=D(),m(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=So(a[12])+"")&&se(s,i)},i(a){r||(a&&xe(()=>{r&&(o||(o=Ve(e,rt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,rt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function Yy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=kt(a,n,n[8],ef),f=[Wy,Uy],d=[];function p(h,g){return h[0]&&h[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=D(),s.c(),m(e,"class",n[1]),x(e,"error",n[3].length)},m(h,g){S(h,e,g),u&&u.m(e,null),b(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(h,[g]){u&&u.p&&(!l||g&256)&&St(u,a,h,h[8],l?wt(a,h[8],g,By):$t(h[8]),ef);let _=i;i=p(h),i===_?d[i].p(h,g):(ae(),L(d[_],1,1,()=>{d[_]=null}),ue(),s=d[i],s?s.p(h,g):(s=d[i]=f[i](h),s.c()),I(s,1),s.m(e,null)),(!l||g&2)&&m(e,"class",h[1]),(!l||g&10)&&x(e,"error",h[3].length)},i(h){l||(I(u,h),I(s),l=!0)},o(h){L(u,h),L(s),l=!1},d(h){h&&w(e),u&&u.d(h),d[i].d(),n[11](null),o=!1,r()}}}const nf="Invalid value";function So(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||nf:n||nf}function Ky(n,e,t){let i;Ze(n,Ti,_=>t(7,i=_));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){ui(r)}Xt(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function h(_){Fe.call(this,n,_)}function g(_){ne[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,u=_.class),"$$scope"in _&&t(8,l=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=U.toArray(U.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,h,g]}class pe extends be{constructor(e){super(),ge(this,e,Ky,Yy,he,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Jy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Email"),s=D(),l=y("input"),m(e,"for",i=n[9]),m(l,"type","email"),m(l,"autocomplete","off"),m(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Zy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=W("Password"),s=D(),l=y("input"),r=D(),a=y("div"),a.textContent="Minimum 10 characters.",m(e,"for",i=n[9]),m(l,"type","password"),m(l,"autocomplete","new-password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0,m(a,"class","help-block")},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),re(l,n[1]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&m(e,"for",i),p&512&&o!==(o=d[9])&&m(l,"id",o),p&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Gy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Password confirm"),s=D(),l=y("input"),m(e,"for",i=n[9]),m(l,"type","password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function Xy(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Jy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[Zy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(f,"type","submit"),m(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),m(e,"class","block"),m(e,"autocomplete","off")},m(g,_){S(g,e,_),b(e,t),b(e,i),V(s,e,null),b(e,l),V(o,e,null),b(e,r),V(a,e,null),b(e,u),b(e,f),d=!0,p||(h=J(e,"submit",tt(n[4])),p=!0)},p(g,[_]){const v={};_&1537&&(v.$$scope={dirty:_,ctx:g}),s.$set(v);const k={};_&1538&&(k.$$scope={dirty:_,ctx:g}),o.$set(k);const $={};_&1540&&($.$$scope={dirty:_,ctx:g}),a.$set($),(!d||_&8)&&x(f,"btn-disabled",g[3]),(!d||_&8)&&x(f,"btn-loading",g[3])},i(g){d||(I(s.$$.fragment,g),I(o.$$.fragment,g),I(a.$$.fragment,g),d=!0)},o(g){L(s.$$.fragment,g),L(o.$$.fragment,g),L(a.$$.fragment,g),d=!1},d(g){g&&w(e),z(s),z(o),z(a),p=!1,h()}}}function Qy(n,e,t){const i=Tt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await ce.admins.create({email:s,password:l,passwordConfirm:o}),await ce.admins.authWithPassword(s,l),i("submit")}catch(p){ce.error(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class xy extends be{constructor(e){super(),ge(this,e,Qy,Xy,he,{})}}function sf(n){let e,t;return e=new bb({props:{$$slots:{default:[ek]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function ek(n){let e,t;return e=new xy({}),e.$on("submit",n[1]),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:te,i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function tk(n){let e,t,i=n[0]&&sf(n);return{c(){i&&i.c(),e=ke()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&I(i,1)):(i=sf(s),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(ae(),L(i,1,1,()=>{i=null}),ue())},i(s){t||(I(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function nk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){ce.logout(!1),t(0,i=!0);return}ce.authStore.isValid?Vi("/collections"):ce.logout()}return[i,async()=>{t(0,i=!1),await cn(),window.location.search=""}]}class ik extends be{constructor(e){super(),ge(this,e,nk,tk,he,{})}}const Mt=Ln(""),$o=Ln(""),Is=Ln(!1);function sk(n){let e,t,i,s;return{c(){e=y("input"),m(e,"type","text"),m(e,"id",n[8]),m(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),re(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&m(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:te,o:te,d(l){l&&w(e),n[13](null),i=!1,s()}}}function lk(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Rt(o,r(n)),ne.push(()=>de(e,"value",l)),e.$on("submit",n[10])),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],_e(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{z(d,1)}),ue()}o?(e=Rt(o,r(a)),ne.push(()=>de(e,"value",l)),e.$on("submit",a[10]),H(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&z(e,a)}}}function lf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Search</span>',m(e,"type","submit"),m(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=Ve(e,ci,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ci,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function of(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class
<span class="txt">Method</span>`,m(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function kk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="URL",m(t,"class",U.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function wk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Referer",m(t,"class",U.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function Sk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="User IP",m(t,"class",U.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function $k(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Status",m(t,"class",U.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function Tk(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="Created",m(t,"class",U.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function ff(n){let e;function t(l,o){return l[6]?Mk:Ck}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function Ck(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&cf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=cf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Mk(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function cf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function df(n){let e;return{c(){e=y("i"),m(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),m(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function pf(n,e){var Ce,Ge,_t;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,h,g,_,v,k,$=(e[23].referer||"N/A")+"",C,T,M,O,E,A=(e[23].userIp||"N/A")+"",P,N,F,R,q,j=e[23].status+"",B,Y,Q,Z,G,le,ee,me,ye,Me,ze=(((Ge=e[23].meta)==null?void 0:Ge.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&df();Z=new $i({props:{date:e[23].created}});function Ue(){return e[17](e[23])}function we(...Xe){return e[18](e[23],...Xe)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=W(l),a=D(),u=y("td"),f=y("span"),p=W(d),g=D(),ze&&ze.c(),_=D(),v=y("td"),k=y("span"),C=W($),M=D(),O=y("td"),E=y("span"),P=W(A),F=D(),R=y("td"),q=y("span"),B=W(j),Y=D(),Q=y("td"),H(Z.$$.fragment),G=D(),le=y("td"),le.innerHTML='<i class="ri-arrow-right-line"></i>',ee=D(),m(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),m(i,"class","col-type-text col-field-method min-width"),m(f,"class","txt txt-ellipsis"),m(f,"title",h=e[23].url),m(u,"class","col-type-text col-field-url"),m(k,"class","txt txt-ellipsis"),m(k,"title",T=e[23].referer),x(k,"txt-hint",!e[23].referer),m(v,"class","col-type-text col-field-referer"),m(E,"class","txt txt-ellipsis"),m(E,"title",N=e[23].userIp),x(E,"txt-hint",!e[23].userIp),m(O,"class","col-type-number col-field-userIp"),m(q,"class","label"),x(q,"label-danger",e[23].status>=400),m(R,"class","col-type-number col-field-status"),m(Q,"class","col-type-date col-field-created"),m(le,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Xe,Ke){S(Xe,t,Ke),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,p),b(u,g),ze&&ze.m(u,null),b(t,_),b(t,v),b(v,k),b(k,C),b(t,M),b(t,O),b(O,E),b(E,P),b(t,F),b(t,R),b(R,q),b(q,B),b(t,Y),b(t,Q),V(Z,Q,null),b(t,G),b(t,le),b(t,ee),me=!0,ye||(Me=[J(t,"click",Ue),J(t,"keydown",we)],ye=!0)},p(Xe,Ke){var fe,He,At;e=Xe,(!me||Ke&8)&&l!==(l=((fe=e[23].method)==null?void 0:fe.toUpperCase())+"")&&se(o,l),(!me||Ke&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&m(s,"class",r),(!me||Ke&8)&&d!==(d=e[23].url+"")&&se(p,d),(!me||Ke&8&&h!==(h=e[23].url))&&m(f,"title",h),(He=e[23].meta)!=null&&He.errorMessage||(At=e[23].meta)!=null&&At.errorData?ze||(ze=df(),ze.c(),ze.m(u,null)):ze&&(ze.d(1),ze=null),(!me||Ke&8)&&$!==($=(e[23].referer||"N/A")+"")&&se(C,$),(!me||Ke&8&&T!==(T=e[23].referer))&&m(k,"title",T),(!me||Ke&8)&&x(k,"txt-hint",!e[23].referer),(!me||Ke&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&se(P,A),(!me||Ke&8&&N!==(N=e[23].userIp))&&m(E,"title",N),(!me||Ke&8)&&x(E,"txt-hint",!e[23].userIp),(!me||Ke&8)&&j!==(j=e[23].status+"")&&se(B,j),(!me||Ke&8)&&x(q,"label-danger",e[23].status>=400);const Se={};Ke&8&&(Se.date=e[23].created),Z.$set(Se)},i(Xe){me||(I(Z.$$.fragment,Xe),me=!0)},o(Xe){L(Z.$$.fragment,Xe),me=!1},d(Xe){Xe&&w(t),ze&&ze.d(),z(Z),ye=!1,De(Me)}}}function Ok(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M,O,E,A,P=[],N=new Map,F;function R(we){n[11](we)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[yk]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new un({props:q}),ne.push(()=>de(s,"sort",R));function j(we){n[12](we)}let B={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[kk]},$$scope:{ctx:n}};n[1]!==void 0&&(B.sort=n[1]),r=new un({props:B}),ne.push(()=>de(r,"sort",j));function Y(we){n[13](we)}let Q={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[wk]},$$scope:{ctx:n}};n[1]!==void 0&&(Q.sort=n[1]),f=new un({props:Q}),ne.push(()=>de(f,"sort",Y));function Z(we){n[14](we)}let G={disable:!0,class:"col-type-number col-field-userIp",n
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function hi(){}const Ik=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function Ct(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function jn(n,e){return Bt(n)?n:e}function lt(n,e){return typeof n>"u"?e:n}const Lk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,yb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Nt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let s,l,o;if(Ct(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(nt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function To(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function Co(n){if(Ct(n))return n.map(Co);if(nt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=Co(n[t[s]]);return e}return n}function kb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Pk(n,e,t,i){if(!kb(n))return;const s=e[n],l=t[n];nt(s)&&nt(l)?_l(s,l,i):e[n]=Co(l)}function _l(n,e,t){const i=Ct(e)?e:[e],s=i.length;if(!nt(n))return n;t=t||{};const l=t.merger||Pk;for(let o=0;o<s;++o){if(e=i[o],!nt(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function rl(n,e){return _l(n,e,{merger:Nk})}function Nk(n,e,t){if(!kb(n))return;const i=e[n],s=t[n];nt(i)&&nt(s)?rl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Co(s))}const _f={"":n=>n,x:n=>n.x,y:n=>n.y};function qi(n,e){return(_f[e]||(_f[e]=Fk(e)))(n)}function Fk(n){const e=Rk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Rk(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function za(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Yn=n=>typeof n<"u",ji=n=>typeof n=="function",gf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function qk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const qt=Math.PI,bt=2*qt,jk=bt+qt,Mo=Number.POSITIVE_INFINITY,Vk=qt/180,Ft=qt/2,Js=qt/4,bf=qt*2/3,Un=Math.log10,ri=Math.sign;function vf(n){const e=Math.round(n);n=al(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Un(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function zk(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ls(n){return!isNaN(parseFloat(n))&&isFinite(n)}function al(n,e,t){return Math.abs(n-e)<t}function Hk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function wb(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(qt/180)}function Ha(n){return n*(180/qt)}function yf(n){if(!Bt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Sb(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*qt&&(l+=bt),{angle:l,distance:s}}function oa(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Bk(n,e){return(n-e+jk)%bt-qt}function En(n){return(n%bt+bt)%bt}function gl(n,e,t,i){const s=En(n),l=En(e),o=En(t),r=En(l-s),a=En(o-s),u=En(s-l),f=En(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function fn(n,e,t){return Math.max(e,Math.min(t,n))}function Uk(n){return fn(n,-32768,32767)}function bl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ba(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const ts=(n,e,t,i)=>Ba(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Wk=(n,e,t)=>Ba(n,t,i=>n[i][e]>=t);function Yk(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function Al(n){return n+.5|0}const Li=(n,e,t)=>Math.max(Math.min(n,t),e);function il(n){return Li(Al(n*2.55),0,255)}function Ri(n){return Li(Al(n*255),0,255)}function bi(n){return Li(Al(n/2.55)/100,0,1)}function Tf(n){return Li(Al(n*100),0,100)}const qn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ra=[..."0123456789ABCDEF"],Gk=n=>ra[n&15],Xk=n=>ra[(n&240)>>4]+ra[n&15],Kl=n=>(n&240)>>4===(n&15),Qk=n=>Kl(n.r)&&Kl(n.g)&&Kl(n.b)&&Kl(n.a);function xk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&qn[n[1]]*17,g:255&qn[n[2]]*17,b:255&qn[n[3]]*17,a:e===5?qn[n[4]]*17:255}:(e===7||e===9)&&(t={r:qn[n[1]]<<4|qn[n[2]],g:qn[n[3]]<<4|qn[n[4]],b:qn[n[5]]<<4|qn[n[6]],a:e===9?qn[n[7]]<<4|qn[n[8]]:255})),t}const e2=(n,e)=>n<255?e(n):"";function t2(n){var e=Qk(n)?Gk:Xk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+e2(n.a,e):void 0}const n2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Db(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function i2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function s2(n,e,t){const i=Db(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function l2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Ua(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=l2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Wa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Ya(n,e,t){return Wa(Db,n,e,t)}function o2(n,e,t){return Wa(s2,n,e,t)}function r2(n,e,t){return Wa(i2,n,e,t)}function Ab(n){return(n%360+360)%360}function a2(n){const e=n2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?il(+e[5]):Ri(+e[5]));const s=Ab(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=o2(s,l,o):e[1]==="hsv"?i=r2(s,l,o):i=Ya(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function u2(n,e){var t=Ua(n);t[0]=Ab(t[0]+e),t=Ya(t),n.r=t[0],n.g=t[1],n.b=t[2]}function f2(n){if(!n)return;const e=Ua(n),t=e[0],i=Tf(e[1]),s=Tf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${bi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Cf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},Mf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class pw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Cb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var _i=new pw;const jf="transparent",mw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Ef(n||jf),s=i.valid&&Ef(e||jf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class hw{constructor(e,t,i,s){const l=t[i];s=Gl([e.to,s,l,e.from]);const o=Gl([e.from,l,s]);this._active=!0,this._fn=e.fn||mw[e.type||typeof o],this._easing=ul[e.easing]||ul.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Gl([e.to,t,s,e.from]),this._from=Gl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const _w=["x","y","borderWidth","radius","tension"],gw=["color","borderColor","backgroundColor"];ot.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const bw=Object.keys(ot.animation);ot.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});ot.set("animations",{colors:{type:"color",properties:gw},numbers:{type:"number",properties:_w}});ot.describe("animations",{_fallback:"animation"});ot.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class Yb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!nt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!nt(s))return;const l={};for(con
`)>-1?n.split(`
`):n}function PS(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function _c(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Dn(e.bodyFont),u=Dn(e.titleFont),f=Dn(e.footerFont),d=l.length,p=s.length,h=i.length,g=Kn(e.padding);let _=g.height,v=0,k=i.reduce((T,M)=>T+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(_+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=h*T+(k-h)*a.lineHeight+(k-1)*e.bodySpacing}p&&(_+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let $=0;const C=function(T){v=Math.max(v,t.measureText(T).width+$)};return t.save(),t.font=u.string,mt(n.title,C),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,mt(i,T=>{mt(T.before,C),mt(T.lines,C),mt(T.after,C)}),$=0,t.font=f.string,mt(n.footer,C),t.restore(),v+=g.width,{width:v,height:_}}function NS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function FS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function RS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),FS(u,n,e,t)&&(u="center"),u}function gc(n,e,t){const i=t.yAlign||e.yAlign||NS(n,t);return{xAlign:t.xAlign||e.xAlign||RS(n,e,t,i),yAlign:i}}function qS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function jS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function bc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:h}=Cs(o);let g=qS(e,r);const _=jS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,p)+s:r==="right"&&(g+=Math.max(d,h)+s),{x:fn(g,0,i.width-e.width),y:fn(_,0,i.height-e.height)}}function io(n,e,t){const i=Kn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function vc(n){return si([],gi(n))}function VS(n,e,t){return zi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function yc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class _a extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new Yb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=VS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=si(r,gi(s)),r=si(r,gi(l)),r=si(r,gi(o)),r}getBeforeBody(e,t){return vc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=yc(i,l);si(o.before,gi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const r$={datetime:We.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:We.TIME_WITH_SECONDS,minute:We.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Xb._date.override({_id:"luxon",_create:function(n){return We.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return r$},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=We.fromFormat(n,e,t):n=We.fromISO(n,t):n instanceof Date?n=We.fromJSDate(n,t):i==="object"&&!(n instanceof We)&&(n=We.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Oc(n){let e,t,i;return{c(){e=y("div"),m(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=Ve(e,Jt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Jt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function a$(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=W(n[1]),t=D(),s=W(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function u$(n){let e;return{c(){e=W("Loading...")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function f$(n){let e,t,i,s,l,o=n[2]&&Oc();function r(f,d){return f[2]?u$:a$}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=D(),i=y("canvas"),s=D(),l=y("div"),u.c(),m(i,"class","chart-canvas svelte-vh4sl8"),Hr(i,"height","250px"),Hr(i,"width","100%"),m(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),m(l,"class","txt-hint m-t-xs txt-right")},m(f,d){S(f,e,d),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),S(f,s,d),S(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&I(o,1):(o=Oc(),o.c(),I(o,1),o.m(e,t)):o&&(ae(),L(o,1,1,()=>{o=null}),ue()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){I(o)},o(f){L(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function c$(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),ce.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{d();for(let g of h)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(d(),console.warn(h),ce.error(h,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}Xt(()=>(No.register(Hi,er,Qo,au,Nl,LS,zS),t(6,o=new No(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function p(h){ne[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update()
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function $(C){return C instanceof a?new a(C.type,$(C.content),C.alias):Array.isArray(C)?C.map($):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(C,T){T=T||{};var M,O;switch(r.util.type(C)){case"Object":if(O=r.util.objId(C),T[O])return T[O];M={},T[O]=M;for(var E in C)C.hasOwnProperty(E)&&(M[E]=$(C[E],T));return M;case"Array":return O=r.util.objId(C),T[O]?T[O]:(M=[],T[O]=M,C.forEach(function(A,P){M[P]=$(A,T)}),M);default:return C}},getLanguage:function($){for(;$;){var C=s.exec($.className);if(C)return C[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,C){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if($){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==$)return C[T]}return null}},isActive:function($,C,T){for(var M="no-"+C;$;){var O=$.classList;if(O.contains(C))return!0;if(O.contains(M))return!1;$=$.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,C){var T=r.util.clone(r.languages[$]);for(var M in C)T[M]=C[M];return T},insertBefore:function($,C,T,M){M=M||r.languages;var O=M[$],E={};for(var A in O)if(O.hasOwnProperty(A)){if(A==C)for(var P in T)T.hasOwnProperty(P)&&(E[P]=T[P]);T.hasOwnProperty(A)||(E[A]=O[A])}var N=M[$];return M[$]=E,r.languages.DFS(r.languages,function(F,R){R===N&&F!=$&&(this[F]=E)}),E},DFS:function $(C,T,M,O){O=O||{};var E=r.util.objId;for(var A in C)if(C.hasOwnProperty(A)){T.call(C,A,C[A],M||A);var P=C[A],N=r.util.type(P);N==="Object"&&!O[E(P)]?(O[E(P)]=!0,$(P,T,null,O)):N==="Array"&&!O[E(P)]&&(O[E(P)]=!0,$(P,T,A,O))}}},plugins:{},highlightAll:function($,C){r.highlightAllUnder(document,$,C)},highlightAllUnder:function($,C,T){var M={callback:T,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var O=0,E;E=M.elements[O++];)r.highlightElement(E,C===!0,M.callback)},highlightElement:function($,C,T){var M=r.util.getLanguage($),O=r.languages[M];r.util.setLanguage($,M);var E=$.parentElement;E&&E.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(E,M);var A=$.textContent,P={element:$,language:M,grammar:O,code:A};function N(R){P.highlightedCode=R,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),T&&T.call(P.element)}if(r.hooks.run("before-sanity-check",P),E=P.element.parentElement,E&&E.nodeName.toLowerCase()==="pre"&&!E.hasAttribute("tabindex")&&E.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),T&&T.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){N(r.util.encode(P.code));return}if(C&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(R){N(R.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else N(r.highlight(P.code,P.grammar,P.language))},highlight:function($,C,T){var M={code:$,grammar:C,language:T};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function($,C){var T=C.rest;if(T){for(var M in T)C[M]=T[M];delete C.rest}var O=new d;return p(O,O.head,$),f($,O,C,O.head,0),g(O)},hooks:{all:{},add:function
`),v.hasAttribute("data-start")||v.setAttribute("data-start",String(P+1))}k.textContent=O,t.highlightElement(k)},function(O){v.setAttribute(r,f),k.textContent=O})}}),t.plugins.fileHighlight={highlight:function(v){for(var k=(v||document).querySelectorAll(d),$=0,C;C=k[$++];)t.highlightElement(C)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(g1);var m$=g1.exports;const el=p$(m$);var h$={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),d=0,p=0;p<f.length;++p){var h=s(f[p]);d+=h,d>r&&(f[p]=`
`+f[p],d=h)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,h="",g="",_=!1,v=0;v<p.length;++v){var k=p[v];k==o.element?_=!0:k.nodeName==="#text"&&(_?g+=k.nodeValue:h+=k.nodeValue,a.removeChild(k),--v)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var $=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize($,o.settings),o.code=o.element.textContent}}}})})()})(h$);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function _$(n){let e,t,i;return{c(){e=y("div"),t=y("code"),m(t,"class","svelte-10s5tkd"),m(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&m(e,"class",i)},i:te,o:te,d(s){s&&w(e)}}}function g$(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=el.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),el.highlight(a,el.languages[l]||el.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof el<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class b1 extends be{constructor(e){super(),ge(this,e,g$,_$,he,{class:0,content:2,language:3})}}const b$=n=>({}),Dc=n=>({}),v$=n=>({}),Ac=n=>({});function Ic(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C=n[4]&&!n[2]&&Lc(n);const T=n[19].header,M=kt(T,n,n[18],Ac);let O=n[4]&&n[2]&&Pc(n);const E=n[19].default,A=kt(E,n,n[18],null),P=n[19].footer,N=kt(P,n,n[18],Dc);return{c(){e=y("div"),t=y("div"),s=D(),l=y("div"),o=y("div"),C&&C.c(),r=D(),M&&M.c(),a=D(),O&&O.c(),u=D(),f=y("div"),A&&A.c(),d=D(),p=y("div"),N&&N.c(),m(
<span class="txt">New index</span>`,f=D(),H(d.$$.fragment),m(e,"class","section-title"),m(u,"type","button"),m(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),m(r,"class","indexes-list svelte-167lbwu")},m(E,A){S(E,e,A),b(e,t),b(e,s),b(e,l),S(E,o,A),S(E,r,A);for(let P=0;P<k.length;P+=1)k[P]&&k[P].m(r,null);b(r,a),b(r,u),S(E,f,A),V(d,E,A),h=!0,g||(_=J(u,"click",n[5]),g=!0)},p(E,[A]){var N,F,R;if((!h||A&1)&&i!==(i=(((F=(N=E[0])==null?void 0:N.indexes)==null?void 0:F.length)||0)+"")&&se(s,i),A&7){v=((R=E[0])==null?void 0:R.indexes)||[];let q;for(q=0;q<v.length;q+=1){const j=Uc(E,v,q);k[q]?k[q].p(j,A):(k[q]=Yc(j),k[q].c(),k[q].m(r,a))}for(;q<k.length;q+=1)k[q].d(1);k.length=v.length}const P={};!p&&A&1&&(p=!0,P.collection=E[0],_e(()=>p=!1)),d.$set(P)},i(E){h||(I(d.$$.fragment,E),h=!0)},o(E){L(d.$$.fragment,E),h=!1},d(E){E&&w(e),E&&w(o),E&&w(r),ht(k,E),E&&w(f),n[6](null),z(d,E),g=!1,_()}}}const Kc=n=>n.name;function G$(n,e,t){let i;Ze(n,Ti,h=>t(2,i=h));let{collection:s}=e,l;function o(h,g){for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==h){t(0,s.indexes[_]=g,s),ui("indexes."+_);return}s.indexes.push(g),t(0,s)}const r=(h,g)=>l==null?void 0:l.show(h,g),a=()=>l==null?void 0:l.show();function u(h){ne[h?"unshift":"push"](()=>{l=h,t(1,l)})}function f(h){s=h,t(0,s)}const d=h=>{for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==h.detail){s.indexes.splice(g,1),ui("indexes."+g);break}t(0,s)},p=h=>{o(h.detail.old,h.detail.new)};return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},[s,l,i,o,r,a,u,f,d,p]}class X$ extends be{constructor(e){super(),ge(this,e,G$,Z$,he,{collection:0})}}function Jc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Zc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),o=W(l),r=D(),m(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),m(s,"class","txt"),m(e,"tabindex","0"),m(e,"class","dropdown-item closable svelte-1gz9b6p")},m(p,h){S(p,e,h),b(e,t),b(e,i),b(e,s),b(s,o),b(e,r),a||(u=[J(e,"click",In(f)),J(e,"keydown",In(d))],a=!0)},p(p,h){n=p},d(p){p&&w(e),a=!1,De(u)}}}function Q$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Zc(Jc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ke()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Jc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Zc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function x$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Jn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[Q$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=D(),s=y("div"),s.textContent="New field",l=D(),H(o.$$.fragment),m(t,"class","ri-add-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),b(e,l),V(o,e,null),a=!0,u||(f=J(e,"click",n[1]),u=!0)},p(d,[p]){const h={};p&512&&(h.$$scope={dirty:p,ctx:d}),o.$set(h),(!a||p&1&&r!==(r="field-types-btn "+d[0]+" svelte-1gz9b6p"))&&m(e,"class",r)},i(d){a||(I(o.$$.fragment,d),a=!0)},o(d){L(o.$$.fragment,d),a=!1},d(d){d&&w(e),z(o),u=!1,f()}}}function eT(n,e,t){let{class:i=""}=e;const s=Tt(),l=[{label:"Plain text",value:"text",icon:U.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:U.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:U.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:U.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:U.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:U.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:U.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:U.getFieldTypeIcon("select")},{label:"File",value:"file",icon:U.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:U.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:U.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Sp
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(v,k){(!d||k&256&&l!==(l=v[8]))&&m(e,"for",l);const $={};k&256&&($.id=v[8]),k&1&&($.disabled=!U.isEmpty(v[0].options.onlyDomains)),!a&&k&1&&(a=!0,$.value=v[0].options.exceptDomains,_e(()=>a=!1)),r.$set($)},i(v){d||(I(r.$$.fragment,v),d=!0)},o(v){L(r.$$.fragment,v),d=!1},d(v){v&&w(e),v&&w(o),z(r,v),v&&w(u),v&&w(f),p=!1,h()}}}function LT(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(v){n[4](v)}let _={id:n[8]+".options.onlyDomains",disabled:!U.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new zs({props:_}),ne.push(()=>de(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[8]+".options.onlyDomains"),m(f,"class","help-block")},m(v,k){S(v,e,k),b(e,t),b(e,i),b(e,s),S(v,o,k),V(r,v,k),S(v,u,k),S(v,f,k),d=!0,p||(h=Oe(Be.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(v,k){(!d||k&256&&l!==(l=v[8]+".options.onlyDomains"))&&m(e,"for",l);const $={};k&256&&($.id=v[8]+".options.onlyDomains"),k&1&&($.disabled=!U.isEmpty(v[0].options.exceptDomains)),!a&&k&1&&(a=!0,$.value=v[0].options.onlyDomains,_e(()=>a=!1)),r.$set($)},i(v){d||(I(r.$$.fragment,v),d=!0)},o(v){L(r.$$.fragment,v),d=!1},d(v){v&&w(e),v&&w(o),z(r,v),v&&w(u),v&&w(f),p=!1,h()}}}function PT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[IT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[LT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(a,u){S(a,e,u),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&769&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&w(e),z(i),z(o)}}}function NT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[PT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){H(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function FT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(p){n.$$.not_equal(l.options.exceptDomains,p)&&(l.options.exceptDomains=p,t(0,l))}function a(p){n.$$.not_equal(l.options.onlyDomains,p)&&(l.options.onlyDomains=p,t(0,l))}function u(p){l=p,t(0,l)}function f(p){Fe.call(this,n,p)}function d(p){Fe.call(this,n,p)}return n.$$set=p=>{e=je(je({},e),Gt(p)),t(2,s=et(e,i)),"field"in p&&t(0,l=p.field),"key"in p&&t(1,o=p.key)},[l,o,s,r,a,u,f,d]}class k1 extends be{constructor(e){super(),ge(this,e,FT,NT,he,{field:0,key:1})}}function RT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new k1({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){H(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function qT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),Gt(f)),t(2,s=et(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class jT extends be{constructor(e){super(),ge(this,e,qT,RT,he,{field:0,key:1})}}function VT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){H(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?Ot(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function zT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=je(je({},e),Gt(f)),t(2,
<span class='flatpickr-weekday'>
`+X.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function le(){t.calendarContainer.classList.add("hasWeeks");var K=ct("div","flatpickr-weekwrapper");K.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return K.appendChild(X),{weekWrapper:K,weekNumbers:X}}function ee(K,X){X===void 0&&(X=!0);var ie=X?K:K-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Re("onYearChange"),q()),R(),Re("onMonthChange"),Fn())}function me(K,X){if(K===void 0&&(K=!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 ie=Nr(t.config),oe=ie.hours,Te=ie.minutes,Le=ie.seconds;h(oe,Te,Le)}t.redraw(),K&&Re("onChange")}function ye(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Re("onClose")}function Me(){t.config!==void 0&&Re("onDestroy");for(var K=t._handlers.length;K--;)t._handlers[K].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var 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(ie){try{delete t[ie]}catch{}})}function ze(K){return t.calendarContainer.contains(K)}function Ue(K){if(t.isOpen&&!t.config.inline){var X=Mn(K),ie=ze(X),oe=X===t.input||X===t.altInput||t.element.contains(X)||K.path&&K.path.indexOf&&(~K.path.indexOf(t.input)||~K.path.indexOf(t.altInput)),Te=!oe&&!ie&&!ze(K.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Ne){return Ne.contains(X)});Te&&Le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function we(K){if(!(!K||t.config.minDate&&K<t.config.minDate.getFullYear()||t.config.maxDate&&K>t.config.maxDate.getFullYear())){var X=K,ie=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)),ie&&(t.redraw(),Re("onYearChange"),q())}}function Ce(K,X){var ie;X===void 0&&(X=!0);var oe=t.parseDate(K,void 0,X);if(t.config.minDate&&oe&&On(oe,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&oe&&On(oe,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
`),r=y("code"),r.textContent="multipart/form-data",a=W(`
requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=W(` field
is a
`),d=y("strong"),d.textContent="plain string",p=W(`:
`),h=y("ul"),g=y("li"),g.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=D(),v=y("li"),v.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=D(),$=y("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=D(),T=y("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=D(),O=y("li"),A=W(E),P=W(" is converted to the json "),N=y("code"),N.textContent='{"a":1,"b":2}',F=D(),R=y("li"),R.textContent="numeric strings are converted to json number",q=D(),j=y("li"),j.textContent="double quoted strings are left as they are (aka. without normalizations)",B=D(),Y=y("li"),Y.textContent="any other string (empty string too) is double quoted",Q=W(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),Z=y("code"),Z.textContent='{"data": anything}',m(i,"class","content"),m(t,"class","alert alert-warning m-b-0 m-t-10"),m(e,"class","block")},m(ee,me){S(ee,e,me),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,d),b(i,p),b(i,h),b(h,g),b(h,_),b(h,v),b(h,k),b(h,$),b(h,C),b(h,T),b(h,M),b(h,O),b(O,A),b(O,P),b(O,N),b(h,F),b(h,R),b(h,q),b(h,j),b(h,B),b(h,Y),b(i,Q),b(i,Z),le=!0},i(ee){le||(ee&&xe(()=>{le&&(G||(G=Ve(e,rt,{duration:150},!0)),G.run(1))}),le=!0)},o(ee){ee&&(G||(G=Ve(e,rt,{duration:150},!1)),G.run(0)),le=!1},d(ee){ee&&w(e),ee&&G&&G.end()}}}function AC(n){let e,t,i,s,l,o,r;function a(p,h){return p[2]?DC:EC}let u=a(n),f=u(n),d=n[2]&&Td();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),d&&d.c(),l=ke(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,h){S(p,e,h),b(e,t),b(e,i),f.m(e,null),S(p,s,h),d&&d.m(p,h),S(p,l,h),o||(r=J(e,"click",n[4]),o=!0)},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?h&4&&I(d,1):(d=Td(),d.c(),I(d,1),d.m(l.parentNode,l)):d&&(ae(),L(d,1,1,()=>{d=null}),ue())},d(p){p&&w(e),f.d(),p&&w(s),d&&d.d(p),p&&w(l),o=!1,r()}}}function IC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[AC]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=je(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),ne.push(()=>de(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){H(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?Ot(s,[a&2&&{key:r[1]},a&8&&Qt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],_e(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function LC(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(p){l=p,t(0,l)}function f(p){Fe.call(this,n,p)}function d(p){Fe.call(this,n,p)}return n.$$set=p=>{e=je(je({},e),Gt(p)),t(3,s=et(e,i)),"field"in p&&t(0,l=p.field),"key"in p&&t(1,o=p.key)},[l,o,r,s,a,u,f,d]}class PC extends be{constructor(e){super(),ge(this,e,LC,IC,he,{field:0,key:1})}}function NC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=W(t),s=D(),l=y("small"),r=W(o),m(e,"class","txt"),m(l,"class","txt-hint")},m(a,u){S(a,e,u),b(e,i),S(a,s,u),S(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:te,o:te,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function FC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Cd extends be{constructor(e){super(),ge(this,e,FC,NC,he,{item:0})}}const RC=[{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.f
Leave empty for no restriction.`,position:"top"})),$=!0)},p(O,E){(!k||E&4194304&&l!==(l=O[22]))&&m(e,"for",l);const A={};E&4194304&&(A.id=O[22]),E&8&&(A.items=O[3]),!a&&E&1&&(a=!0,A.keyOfSelected=O[0].options.mimeTypes,_e(()=>a=!1)),r.$set(A);const P={};E&16777217&&(P.$$scope={dirty:E,ctx:O}),v.$set(P)},i(O){k||(I(r.$$.fragment,O),I(v.$$.fragment,O),k=!0)},o(O){L(r.$$.fragment,O),L(v.$$.fragment,O),k=!1},d(O){O&&w(e),O&&w(o),z(r,O),O&&w(u),O&&w(f),z(v),$=!1,C()}}}function HC(n){let e;return{c(){e=y("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,m(e,"class","m-0")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function BC(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M;function O(A){n[13](A)}let E={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(E.value=n[0].options.thumbs),r=new zs({props:E}),ne.push(()=>de(r,"value",O)),$=new Jn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[HC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=D(),h=y("button"),g=y("span"),g.textContent="Supported formats",_=D(),v=y("i"),k=D(),H($.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[22]),m(d,"class","txt"),m(g,"class","txt link-primary"),m(v,"class","ri-arrow-drop-down-fill"),m(h,"type","button"),m(h,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(A,P){S(A,e,P),b(e,t),b(e,i),b(e,s),S(A,o,P),V(r,A,P),S(A,u,P),S(A,f,P),b(f,d),b(f,p),b(f,h),b(h,g),b(h,_),b(h,v),b(h,k),V($,h,null),C=!0,T||(M=Oe(Be.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(A,P){(!C||P&4194304&&l!==(l=A[22]))&&m(e,"for",l);const N={};P&4194304&&(N.id=A[22]),!a&&P&1&&(a=!0,N.value=A[0].options.thumbs,_e(()=>a=!1)),r.$set(N);const F={};P&16777216&&(F.$$scope={dirty:P,ctx:A}),$.$set(F)},i(A){C||(I(r.$$.fragment,A),I($.$$.fragment,A),C=!0)},o(A){L(r.$$.fragment,A),L($.$$.fragment,A),C=!1},d(A){A&&w(e),A&&w(o),z(r,A),A&&w(u),A&&w(f),z($),T=!1,M()}}}function UC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=W("Max file size"),s=D(),l=y("input"),r=D(),a=y("div"),a.textContent="Must be in bytes.",m(e,"for",i=n[22]),m(l,"type","number"),m(l,"id",o=n[22]),m(l,"step","1"),m(l,"min","0"),m(a,"class","help-block")},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),re(l,n[0].options.maxSize),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[14]),u=!0)},p(d,p){p&4194304&&i!==(i=d[22])&&m(e,"for",i),p&4194304&&o!==(o=d[22])&&m(l,"id",o),p&1&&pt(l.value)!==d[0].options.maxSize&&re(l,d[0].options.maxSize)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function Md(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[WC,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),m(e,"class","col-sm-3")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&w(e),z(t)}}}function WC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Max select"),s=D(),l=y("input"),m(e,"for",i=n[22]),m(l,"id",o=n[22]),m(l,"type","number"),m(l,"step","1"),m(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.maxSelect),r||(a=J(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&m(e,"for",i),f&4194304&&o!==(o=u[22])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.maxSelect&&re(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function YC(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[zC,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[BC,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[UC,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&Md(n);return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),a=D(),u=y("div"),H(f.$$.fragment),p=
<span class="txt">New collection</span>`,m(i,"type","button"),m(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[17]),s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function xC(n){let e,t,i;function s(o){n[18](o)}let l={id:n[29],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],readonly:!n[30]||n[0].id,$$slots:{afterOptions:[QC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Bi({props:l}),ne.push(()=>de(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[0]&1073741825&&(a.readonly=!o[30]||o[0].id),r[0]&16|r[1]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function e4(n){let e,t,i;function s(o){n[19](o)}let l={id:n[29],items:n[8],readonly:!n[30]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Bi({props:l}),ne.push(()=>de(e,"keyOfSelected",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&1073741824&&(a.readonly=!o[30]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function t4(n){let e,t,i,s,l,o,r,a,u,f;return i=new pe({props:{class:"form-field required "+(n[30]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[xC,({uniqueId:d})=>({29:d}),({uniqueId:d})=>[d?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[30]?"":"readonly"),inlineError:!0,$$slots:{default:[e4,({uniqueId:d})=>({29:d}),({uniqueId:d})=>[d?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=D(),H(i.$$.fragment),s=D(),l=y("div"),o=D(),H(r.$$.fragment),a=D(),u=y("div"),m(e,"class","separator"),m(l,"class","separator"),m(u,"class","separator")},m(d,p){S(d,e,p),S(d,t,p),V(i,d,p),S(d,s,p),S(d,l,p),S(d,o,p),V(r,d,p),S(d,a,p),S(d,u,p),f=!0},p(d,p){const h={};p[0]&1073741824&&(h.class="form-field required "+(d[30]?"":"readonly")),p[0]&2&&(h.name="schema."+d[1]+".options.collectionId"),p[0]&1610612761|p[1]&1&&(h.$$scope={dirty:p,ctx:d}),i.$set(h);const g={};p[0]&1073741824&&(g.class="form-field form-field-single-multiple-select "+(d[30]?"":"readonly")),p[0]&1610612740|p[1]&1&&(g.$$scope={dirty:p,ctx:d}),r.$set(g)},i(d){f||(I(i.$$.fragment,d),I(r.$$.fragment,d),f=!0)},o(d){L(i.$$.fragment,d),L(r.$$.fragment,d),f=!1},d(d){d&&w(e),d&&w(t),z(i,d),d&&w(s),d&&w(l),d&&w(o),z(r,d),d&&w(a),d&&w(u)}}}function Od(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[n4,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[i4,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),i=D(),s=y("div"),H(l.$$.fragment),m(e,"class","col-sm-6"),m(s,"class","col-sm-6")},m(r,a){S(r,e,a),V(t,e,null),S(r,i,a),S(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&536870913|a[1]&1&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&536870913|a[1]&1&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(I(t.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&w(e),z(t),r&&w(i),r&&w(s),z(l)}}}function n4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Min select"),s=D(),l=y("input"),m(e,"for",i=n[29]),m(l,"type","number"),m(l,"id",o=n[29]),m(l,"step","1"),m(l,"min","1"),m(l,"placeholder","No min limit")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.minSelect
`),t=y("code"),t.textContent="username",i=W(` ,
`),s=y("code"),s.textContent="email",l=W(` ,
`),o=y("code"),o.textContent="emailVisibility",r=W(` ,
`),a=y("code"),a.textContent="verified",m(t,"class","txt-sm"),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function p4(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u){let f={key:u[4](u[17])};return u[17]!==void 0&&(f.field=u[17]),{props:f}}return r&&(e=Rt(r,a(n)),ne.push(()=>de(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&H(e.$$.fragment),i=D()},m(u,f){e&&V(e,u,f),S(u,i,f),s=!0},p(u,f){n=u;const d={};if(f&1&&(d.key=n[4](n[17])),!t&&f&1&&(t=!0,d.field=n[17],_e(()=>t=!1)),f&1&&r!==(r=n[1][n[17].type])){if(e){ae();const p=e;L(p.$$.fragment,1,0,()=>{z(p,1)}),ue()}r?(e=Rt(r,a(n)),ne.push(()=>de(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),H(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else r&&e.$set(d)},i(u){s||(e&&I(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){e&&z(e,u),u&&w(i)}}}function Id(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[p4]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Fl({props:r}),ne.push(()=>de(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,_e(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&w(t),z(i,a)}}}function m4(n){let e,t,i,s,l,o,r,a,u,f,d,p,h=[],g=new Map,_,v,k,$,C,T,M,O,E=n[0].$isAuth&&Ad(),A=n[0].schema;const P=R=>R[17];for(let R=0;R<A.length;R+=1){let q=Dd(n,A,R),j=P(q);g.set(j,h[R]=Id(j,q))}v=new tT({props:{class:"btn btn-block btn-outline"}}),v.$on("select",n[12]);function N(R){n[13](R)}let F={};return n[0]!==void 0&&(F.collection=n[0]),T=new X$({props:F}),ne.push(()=>de(T,"collection",N)),{c(){e=y("div"),t=y("p"),i=W(`System fields:
`),s=y("code"),s.textContent="id",l=W(` ,
`),o=y("code"),o.textContent="created",r=W(` ,
`),a=y("code"),a.textContent="updated",u=D(),E&&E.c(),f=W(`
.`),d=D(),p=y("div");for(let R=0;R<h.length;R+=1)h[R].c();_=D(),H(v.$$.fragment),k=D(),$=y("hr"),C=D(),H(T.$$.fragment),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm"),m(t,"class","txt-sm"),m(e,"class","block m-b-25"),m(p,"class","schema-fields")},m(R,q){S(R,e,q),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),E&&E.m(t,null),b(t,f),S(R,d,q),S(R,p,q);for(let j=0;j<h.length;j+=1)h[j]&&h[j].m(p,null);S(R,_,q),V(v,R,q),S(R,k,q),S(R,$,q),S(R,C,q),V(T,R,q),O=!0},p(R,[q]){R[0].$isAuth?E||(E=Ad(),E.c(),E.m(t,f)):E&&(E.d(1),E=null),q&55&&(A=R[0].schema,ae(),h=vt(h,q,P,1,R,A,g,p,Ut,Id,null,Dd),ue());const j={};!M&&q&1&&(M=!0,j.collection=R[0],_e(()=>M=!1)),T.$set(j)},i(R){if(!O){for(let q=0;q<A.length;q+=1)I(h[q]);I(v.$$.fragment,R),I(T.$$.fragment,R),O=!0}},o(R){for(let q=0;q<h.length;q+=1)L(h[q]);L(v.$$.fragment,R),L(T.$$.fragment,R),O=!1},d(R){R&&w(e),E&&E.d(),R&&w(d),R&&w(p);for(let q=0;q<h.length;q+=1)h[q].d();R&&w(_),z(v,R),R&&w(k),R&&w($),R&&w(C),z(T,R)}}}function h4(n,e,t){let i,{collection:s=new kn}=e;const l={text:yT,number:CT,bool:ET,email:k1,url:jT,editor:HT,date:sC,select:OC,json:PC,file:XC,relation:u4};function o(T){s.schema[T]&&(s.schema.splice(T,1),t(0,s))}function r(T="text"){const M=new wn({name:a(),type:T});M.onMountSelect=!0,s.schema.push(M),t(0,s)}function a(T="field"){let M="";for(;u(T+M);)++M;return T+M}function u(T){return!!s.schema.find(M=>M.name===T)}function f(T){return i.findIndex(M=>M===T)}function d(T,M){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||T===M||!M||t(0,s.indexes=s.indexes.map(E=>U.replaceIndexColumn(E,T,M)),s)}function p(T,M,O,E){O[E]=T,t(0,s)}const h=T=>o(T),g=T=>d(T.detail.oldName,T.detail.newName);function _(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const v=T=>{if(!T.detail)return;const M=T.detail.target;M.style.opacity=0,setTimeout(()=>{var O;(O=M==null?void 0:M.style)==null||O.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage(M,0,0)},k=()=>{tn({})},$=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new kn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,d,p,h,g,_,v,k,$,C]}class _4 extends be{constructor(e){super(),ge(this,e,h4,m4,he,{collection:0})}}const g4=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),b4=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]}),v4=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]});function y4(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[w4,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function k4(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","txt-center")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function Fd(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Rd(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,m(e,"type","button"),m(e,"class","unlock-overlay svelte-1akuazq"),m(e,"aria-label","Unlock and set custom rule")},m(o,r){S(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:te,i(o){i||(o&&xe(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function w4(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,d,p,h,g,_,v,k,$;const C=n[12].beforeLabel,T=kt(C,n,n[15],Nd),M=n[12].afterLabel,O=kt(M,n,n[15],Pd);let E=!n[9]&&Fd(n);function A(j){n[14](j)}var P=n[7];function N(j){let B={id:j[18],baseCollection:j[1],disabled:j[9],placeholder:j[9]?"":j[5]};return j[0]!==void 0&&(B.value=j[0]),{props:B}}P&&(h=Rt(P,N(n)),n[13](h),ne.push(()=>de(h,"value",A)));let F=n[9]&&Rd(n);const R=n[12].default,q=kt(R,n,n[15],Ld);return{c(){e=y("div"),t=y("label"),T&&T.c(),i=D(),s=y("span"),l=W(n[2]),o=D(),a=W(r),u=D(),O&&O.c(),f=D(),E&&E.c(),p=D(),h&&H(h.$$.fragment),_=D(),F&&F.c(),v=D(),k=y("div"),q&&q.c(),m(s,"class","txt"),x(s,"txt-hint",n[9]),m(t,"for",d=n[18]),m(e,"class","input-wrapper svelte-1akuazq"),m(k,"class","help-block")},m(j,B){S(j,e,B),b(e,t),T&&T.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),O&&O.m(t,null),b(t,f),E&&E.m(t,null),b(e,p),h&&V(h,e,null),b(e,_),F&&F.m(e,null),S(j,v,B),S(j,k,B),q&&q.m(k,null),$=!0},p(j,B){T&&T.p&&(!$||B&33280)&&St(T,C,j,j[15],$?wt(C,j[15],B,v4):$t(j[15]),Nd),(!$||B&4)&&se(l,j[2]),(!$||B&512)&&r!==(r=j[9]?"- Admins only":"")&&se(a,r),(!$||B&512)&&x(s,"txt-hint",j[9]),O&&O.p&&(!$||B&33280)&&St(O,M,j,j[15],$?wt(M,j[15],B,b4):$t(j[15]),Pd),j[9]?E&&(E.d(1),E=null):E?E.p(j,B):(E=Fd(j),E.c(),E.m(t,null)),(!$||B&262144&&d!==(d=j[18]))&&m(t,"for",d);const Y={};if(B&262144&&(Y.id=j[18]),B&2&&(Y.baseCollection=j[1]),B&512&&(Y.disabled=j[9]),B&544&&(Y.placeholder=j[9]?"":j[5]),!g&&B&1&&(g=!0,Y.value=j[0],_e(()=>g=!1)),B&128&&P!==(P=j[7])){if(h){ae();const Q=h;L(Q.$$.fragment,1,0,()=>{z(Q,1)}),ue()}P?(h=Rt(P,N(j)),j[13](h),ne.push(()=>de(h,"value",A)),H(h.$$.fragment),I(h.$$.fragment,1),V(h,e,_)):h=null}else P&&h.$set(Y);j[9]?F?(F.p(j,B),B&512&&I(F,1)):(F=Rd(j),F.c(),I(F,1),F.m(e,null)):F&&(ae(),L(F,1,1,()=>{F=null}),ue()),q&&q.p&&(!$||B&33280)&&St(q,R,j,j[15],$?wt(R,j[15],B,g4):$t(j[15]),Ld)},i(j){$||(I(T,j),I(O,j),h&&I(h.$$.fragment,j),I(F),I(q,j),$=!0)},o(j){L(T,j),L(O,j),h&&L(h.$$.fragment,j),L(F),L(q,j),$=!1},d(j){j&&w(e),T&&T.d(j),O&&O.d(j),E&&E.d(),n[13](null),h&&z(h),F&&F.d(),j&&w(v),j&&w(k),q&&q.d(j)}}}function S4(n){let e,t,i,s;const l=[k4,y4],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),L(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let qd;function $4(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,h=null,g=qd,_=!1;v();async function v(){g||_||(t(8,_=!0),t(7,g=(await ut(()=>import("./FilterAutocompleteInput-1ba8a8ee.js"),["./FilterAutocompleteInput-1ba8a8ee.js","./index-8b57b6cd.js"],import.meta.url)).default),qd=g,t(8,_=!1))}async function k(){t(0,r=h||""),await cn(),p==null||p.focus()}async function $(){h=r,t(0,r=null)}function C(M){ne[M?"unshift":"push"](()=>{p=M,t(6,p)})}function T(M){r=M,t(0,r)}return n.$$set=M=>{"collection"in M&&t(1,o=M.collection),"rule"in M&&t(0,r=M.rule),"label"in M&&t(2,a=M.label),"formKey"in M&&t(3,u=M.formKey),"required"in M&&t(4,f=M.required),"placeholder"in M&&t(5,d=M.placeholder),"$$scope"in M&&t(15,l=M.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,g,_,i,k,$,s,C,T,l]}class Es extends be{constructor(e){super(),ge(this,e,$4,S4,he,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function jd(n,e,t){const i=n.sli
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,h=D(),g=y("hr"),_=D(),v=y("p"),v.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=D(),$=y("div"),$.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",C=D(),T=y("hr"),M=D(),O=y("p"),O.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,m(s,"class","m-b-0"),m(o,"class","inline-flex flex-gap-5"),m(a,"class","m-t-10 m-b-5"),m(f,"class","m-b-0"),m(p,"class","inline-flex flex-gap-5"),m(g,"class","m-t-10 m-b-5"),m(v,"class","m-b-0"),m($,"class","inline-flex flex-gap-5"),m(T,"class","m-t-10 m-b-5"),m(i,"class","content"),m(t,"class","alert alert-warning m-0")},m(F,R){S(F,e,R),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let q=0;q<N.length;q+=1)N[q]&&N[q].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,d),b(i,p),b(i,h),b(i,g),b(i,_),b(i,v),b(i,k),b(i,$),b(i,C),b(i,T),b(i,M),b(i,O),A=!0},p(F,R){if(R&4){P=F[2];let q;for(q=0;q<P.length;q+=1){const j=jd(F,P,q);N[q]?N[q].p(j,R):(N[q]=zd(j),N[q].c(),N[q].m(o,null))}for(;q<N.length;q+=1)N[q].d(1);N.length=P.length}},i(F){A||(F&&xe(()=>{A&&(E||(E=Ve(e,rt,{duration:150},!0)),E.run(1))}),A=!0)},o(F){F&&(E||(E=Ve(e,rt,{duration:150},!1)),E.run(0)),A=!1},d(F){F&&w(e),ht(N,F),F&&E&&E.end()}}}function zd(n){let e,t=n[11]+"",i;return{c(){e=y("code"),i=W(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&w(e)}}}function Hd(n){let e,t,i,s,l,o,r,a,u;function f(v){n[6](v)}let d={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[T4,({isAdminOnly:v})=>({10:v}),({isAdminOnly:v})=>v?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Es({props:d}),ne.push(()=>de(e,"rule",f));function p(v){n[7](v)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Es({props:h}),ne.push(()=>de(s,"rule",p));function g(v){n[8](v)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new Es({props:_}),ne.push(()=>de(r,"rule",g)),{c(){H(e.$$.fragment),i=D(),H(s.$$.fragment),o=D(),H(r.$$.fragment)},m(v,k){V(e,v,k),S(v,i,k),V(s,v,k),S(v,o,k),V(r,v,k),u=!0},p(v,k){const $={};k&1&&($.collection=v[0]),k&17408&&($.$$scope={dirty:k,ctx:v}),!t&&k&1&&(t=!0,$.rule=v[0].createRule,_e(()=>t=!1)),e.$set($);const C={};k&1&&(C.collection=v[0]),!l&&k&1&&(l=!0,C.rule=v[0].updateRule,_e(()=>l=!1)),s.$set(C);const T={};k&1&&(T.collection=v[0]),!a&&k&1&&(a=!0,T.rule=v[0].deleteRule,_e(()=>a=!1)),r.$set(T)},i(v){u||(I(e.$$.fragment,v),I(s.$$.fragment,v),I(r.$$.fragment,v),u=!0)},o(v){L(e.$$.fragment,v),L(s.$$.fragment,v),L(r.$$.fragment,v),u=!1},d(v){z(e,v),v&&w(i),z(s,v),v&&w(o),z(r,v)}}}function Bd(n){let e,t,i;return{c(){e=y("i"),m(e,"class","ri-information-line link-hint")},m(s,l){S(s,e,l),t||(i=Oe(Be.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&w(e),t=!1,i()}}}function T4(n){let e,t=!n[10]&&Bd();return{c(){t&&t.c(),e=ke()},m(i,s){t&&t.m(i,s),S(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=Bd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&w(e)}}}function Ud(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[C4]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Es({props:l}),ne.push(()=>de(e,"rule",s)),{c(){H(e.$$.fragment)},m(o,r){V(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,_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function C4(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=y("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:te,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function M4(n){var R,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,h,g,_,v,k,$,C,T,M=n[1]&&Vd(n);function O(j){n[4](j)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),f=new Es({props:E}),ne.push(()=>de(f,"rule",O));function A(j){n[5](j)}let P={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(P.rule=n[0].viewRule),h=new Es({props:P}),ne.push(()=>de(h,"rule",A));let N=!((R=n[0])!=null&&R.$isView)&&Hd(n),F=((q=n[0])==null?void 0:q.$isAuth)&&Ud(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=y("button"),r=W(o),a=D(),M&&M.c(),u=D(),H(f.$$.fragment),p=D(),H(h.$$.fragment),_=D(),N&&N.c(),v=D(),F&&F.c(),k=ke(),m(l,"type","button"),m(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),m(t,"class","flex txt-sm txt-hint m-b-5"),m(e,"class","block m-b-sm handle")},m(j,B){S(j,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),M&&M.m(e,null),S(j,u,B),V(f,j,B),S(j,p,B),V(h,j,B),S(j,_,B),N&&N.m(j,B),S(j,v,B),F&&F.m(j,B),S(j,k,B),$=!0,C||(T=J(l,"click",n[3]),C=!0)},p(j,[B]){var Z,G;(!$||B&2)&&o!==(o=j[1]?"Hide available fields":"Show available fields")&&se(r,o),j[1]?M?(M.p(j,B),B&2&&I(M,1)):(M=Vd(j),M.c(),I(M,1),M.m(e,null)):M&&(ae(),L(M,1,1,()=>{M=null}),ue());const Y={};B&1&&(Y.collection=j[0]),!d&&B&1&&(d=!0,Y.rule=j[0].listRule,_e(()=>d=!1)),f.$set(Y);const Q={};B&1&&(Q.collection=j[0]),!g&&B&1&&(g=!0,Q.rule=j[0].viewRule,_e(()=>g=!1)),h.$set(Q),(Z=j[0])!=null&&Z.$isView?N&&(ae(),L(N,1,1,()=>{N=null}),ue()):N?(N.p(j,B),B&1&&I(N,1)):(N=Hd(j),N.c(),I(N,1),N.m(v.parentNode,v)),(G=j[0])!=null&&G.$isAuth?F?(F.p(j,B),B&1&&I(F,1)):(F=Ud(j),F.c(),I(F,1),F.m(k.parentNode,k)):F&&(ae(),L(F,1,1,()=>{F=null}),ue())},i(j){$||(I(M),I(f.$$.fragment,j),I(h.$$.fragment,j),I(N),I(F),$=!0)},o(j){L(M),L(f.$$.fragment,j),L(h.$$.fragment,j),L(N),L(F),$=!1},d(j){j&&w(e),M&&M.d(),j&&w(u),z(f,j),j&&w(p),z(h,j),j&&w(_),N&&N.d(j),j&&w(v),F&&F.d(j),j&&w(k),C=!1,T()}}}function O4(n,e,t){let i,{collection:s=new kn}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function d(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function p(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=U.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class E4 extends be{constructor(e){super(),ge(this,e,O4,M4,he,{collection:0})}}function Wd(n,e,t){const i=n.slice();return i[9]=e[t],i}function D4(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Rt(o,r(n)),ne.push(()=>de(e,"value",l)),e.$on("change",n[6])),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,_e(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{z(d,1)}),ue()}o?(e=Rt(o,r(a)),ne.push(()=>de(e,"value",l)),e.$on("change",a[6]),H(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&z(e,a)}}}function A4(n){let e;return{c(){e=y("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function Yd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Kd(Wd(n,i,l));return{c(){e=y("div"),t=y("div");for(let l=0;l<s.length;l+=1)s[l].c();m(t,"class","content"),m(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),b(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=Wd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Kd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),ht(s,l)}}}function Kd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=W(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&se(i,t)},d(s){s&&w(e)}}}function I4(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[A4,D4],h=[];function g(v,k){return v[2]?0:1}l=g(n),o=h[l]=p[l](n);let _=n[3].length&&Yd(n);return{c(){e=y("label"),t=y("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=y("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not supported
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
<li>Expressions must be aliased with a valid formatted field name (eg.
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=D(),_&&_.c(),f=ke(),m(t,"class","txt"),m(e,"for",i=n[8]),m(a,"class","help-block")},m(v,k){S(v,e,k),b(e,t),S(v,s,k),h[l].m(v,k),S(v,r,k),S(v,a,k),S(v,u,k),_&&_.m(v,k),S(v,f,k),d=!0},p(v,k){(!d||k&256&&i!==(i=v[8]))&&m(e,"for",i);let $=l;l=g(v),l===$?h[l].p(v,k):(ae(),L(h[$],1,1,()=>{h[$]=null}),ue(),o=h[l],o?o.p(v,k):(o=h[l]=p[l](v),o.c()),I(o,1),o.m(r.parentNode,r)),v[3].length?_?_.p(v,k):(_=Yd(v),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(v){d||(I(o),d=!0)},o(v){L(o),d=!1},d(v){v&&w(e),v&&w(s),h[l].d(v),v&&w(r),v&&w(a),v&&w(u),_&&_.d(v),v&&w(f)}}}function L4(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[I4,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function P4(n,e,t){let i;Ze(n,Ti,d=>t(4,i=d));let{collection:s=new kn}=e,l,o=!1,r=[];function a(d){var g;t(3,r=[]);const p=U.getNestedVal(d,"schema",null);if(U.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const h=U.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);U.removeByValue(h,"id"),U.removeByValue(h,"created"),U.removeByValue(h,"updated");for(let _ in p)for(let v in p[_]){const k=p[_][v].message,$=h[_]||_;r.push(U.sentenize($+": "+k))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await ut(()=>import("./CodeEditor-2dc6de7d.js"),["./CodeEditor-2dc6de7d.js","./index-8b57b6cd.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&ui("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class N4 extends be{constructor(e){super(),ge(this,e,P4,L4,he,{collection:0})}}const F4=n=>({active:n&1}),Jd=n=>({active:n[0]});function Zd(n){let e,t,i;const s=n[15].default,l=kt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),m(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&St(l,s,o,o[14],i?wt(s,o[14],r,null):$t(o[14]),null)},i(o){i||(I(l,o),o&&xe(()=>{i&&(t||(t=Ve(e,rt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=Ve(e,rt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function R4(n){let e,t,i,s,l,o,r;const a=n[15].header,u=kt(a,n,n[14],Jd);let f=n[0]&&Zd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=D(),f&&f.c(),m(t,"type","button"),m(t,"class","accordion-header"),m(t,"draggable",n[2]),x(t,"interactive",n[3]),m(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){S(d,e,p),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",tt(n[17])),J(t,"drop",tt(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",tt(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&St(u,a,d,d[14],l?wt(a,d[14],p,F4):$t(d[14]),Jd),(!l||p&4)&&m(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&I(f,1)):(f=Zd(d),f.c(),I(f,1),f.m(e,null)):f&&(ae(),L(f,1,1,()=>{f=null}),ue()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&m(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(I(u,d),I(f),l=!0)},o(d){L(u,d),L(f),l=!1},d(d){d&&w(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,De(r)}}}function q4(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,h=!1;function g(){return!!f}function _(){$(),t(0,f=!0),l("expand")}function v(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?v():_()}function $(){if(p&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const
<span class="txt">Username/Password</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=ke(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),S(p,s,h),f.m(p,h),S(p,l,h),d&&d.m(p,h),S(p,o,h),r=!0},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?h&8&&I(d,1):(d=Gd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(ae(),L(d,1,1,()=>{d=null}),ue())},i(p){r||(I(d),r=!0)},o(p){L(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function U4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=W("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),b(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Xd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(U.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[W4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(U.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[Y4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(U.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(U.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(I(i.$$.fragment,u),I(o.$$.fragment,u),u&&xe(()=>{a&&(r||(r=Ve(e,rt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=Ve(e,rt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),z(i),z(o),u&&r&&r.end()}}}function W4(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(v){n[7](v)}let _={id:n[12],disabled:!U.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(_.value=n[0].options.exceptEmailDomains),r=new zs({props:_}),ne.push(()=>de(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(v,k){S(v,e,k),b(e,t),b(e,i),b(e,s),S(v,o,k),V(r,v,k),S(v,u,k),S(v,f,k),d=!0,p||(h=Oe(Be.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(v,k){(!d||k&4096&&l!==(l=v[12]))&&m(e,"for",l);const $={};k&4096&&($.id=v[12]),k&1&&($.disabled=!U.isEmpty(v[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,$.value=v[0].options.exceptEmailDomains,_e(()=>a=!1)),r.$set($)},i(v){d||(I(r.$$.fragment,v),d=!0)},o(v){L(r.$$.fragment,v),d=!1},d(v){v&&w(e),v&&w(o),z(r,v),v&&w(u),v&&w(f),p=!1,h()}}}function Y4(n){let e,t,i,s,l,o,r,a,u,f,d,p,h;function g(v){n[8](v)}let _={id:n[12],disabled:!U.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new zs({props:_}),ne.push(()=>de(r,"value",g)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=D(),s=y("i"),o=D(),H(r.$$.fragment),u=D(),f=y("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(v,k){S(v,e,k),b(e,t),b(e,i),b(e,s),S(v,o,k),V(r,v,k),S(v,u,k),S(v,f,k),d=!0,p||(h=Oe(Be.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(v,k){(!d||k&4096&&l!==(l=v[12]))&&m(e,"for",l);const $={};k&4096&&($.id=v[12]),k&1&&($.disabled=!U.isEmpty(v[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,$.value=v[0].options.onlyEmailDomains,_e(()=>a=!1)),r.$set($)},i(v){d||(I(r.$$.fragment,v),d=!0)},o(v){L(r.$$.fragment,v),d=!1},d(v){v&&w(e),v&&w(o),z(r,v),v&&w(u),v&&w(f),p=!1,h()}}}function K4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[U4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Xd(n);return{c(){H(e.$$.fragment),t=D(),l&&l.c(),i=ke()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&I(l,1)):(l=Xd(o),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){z(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function J4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Z4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Qd(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Oe(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function G4(n){let e,t,i,s,l,o,r;function a(p,h){return p[0].options.allowEmailAuth?Z4:J4}let u=a(n),f=u(n),d=n[2]&&Qd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=ke(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),S(p,s,h),f.m(p,h),S(p,l,h),d&&d.m(p,h),S(p,o,h),r=!0},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?h&4&&I(d,1):(d=Qd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(ae(),L(d,1,1,()=>{d=null}),ue())},i(p){r||(I(d),r=!0)},o(p){L(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function X4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=W("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),b(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function xd(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',m(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=Ve(e,rt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,rt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Q4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[X4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&xd();return{c(){H(e.$$.fragment),t=D(),l&&l.c(),i=ke()},m(o,r){V(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&I(l,1):(l=xd(),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){z(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function x4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function eM(n){let e;return{c(){e=y("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ep(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Oe(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function tM(n){let e,t,i,s,l,o,r;function a(p,h){return p[0].options.allowOAuth2Auth?eM:x4}let u=a(n),f=u(n),d=n[1]&&ep();return{c(){e=y("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=y("div"),s=D(),f.c(),l=D(),d&&d.c(),o=ke(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),S(p,s,h),f.m(p,h),S(p,l,h),d&&d.m(p,h),S(p,o,h),r=!0},p(p,h){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?h&2&&I(d,1):(d=ep(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(ae(),L(d,1,1,()=>{d=null}),ue())},i(p){r||(I(d),r=!0)},o(p){L(d),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),p&&w(s),f.d(p),p&&w(l),d&&d.d(p),p&&w(o)}}}function nM(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Minimum password length"),s=D(),l=y("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12]),l.required=!0,m(l,"min","6"),m(l,"max","72")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&m(e,"for",i),f&4096&&o!==(o=u[12])&&m(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function iM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=D(),s=y("label"),l=y("span"),l.textContent="Always require email",o=D(),r=y("i"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(l,"class","txt"),m(r,"class","ri-information-line txt-sm link-hint"),m(s,"for",a=n[12])},m(d,p){S(d,e,p),e.checked=n[0].options.requireEmail,S(d,i,p),S(d,s,p),b(s,l),b(s,o),b(s,r),u||(f=[J(e,"change",n[11]),Oe(Be.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(d,p){p&4096&&t!==(t=d[12])&&m(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&m(s,"for",a)},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,De(f)}}}function sM(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k;return s=new po({props:{single:!0,$$slots:{header:[B4],default:[V4]},$$scope:{ctx:n}}}),o=new po({props:{single:!0,$$slots:{header:[G4],default:[K4]},$$scope:{ctx:n}}}),a=new po({props:{single:!0,$$slots:{header:[tM],default:[Q4]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[nM,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),v=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[iM,({uniqueId:$})=>({12:$}),({uniqueId:$})=>$?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=D(),i=y("div"),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),f=y("hr"),d=D(),p=y("h4"),p.textContent="General",h=D(),H(g.$$.fragment),_=D(),H(v.$$.fragment),m(e,"class","section-title"),m(i,"class","accordions"),m(p,"class","section-title")},m($,C){S($,e,C),S($,t,C),S($,i,C),V(s,i,null),b(i,l),V(o,i,null),b(i,r),V(a,i,null),S($,u,C),S($,f,C),S($,d,C),S($,p,C),S($,h,C),V(g,$,C),S($,_,C),V(v,$,C),k=!0},p($,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:$}),s.$set(T);const M={};C&8197&&(M.$$scope={dirty:C,ctx:$}),o.$set(M);const O={};C&8195&&(O.$$scope={dirty:C,ctx:$}),a.$set(O);const E={};C&12289&&(E.$$scope={dirty:C,ctx:$}),g.$set(E);const A={};C&12289&&(A.$$scope={dirty:C,ctx:$}),v.$set(A)},i($){k||(I(s.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(g.$$.fragment,$),I(v.$$.fragment,$),k=!0)},o($){L(s.$$.fragment,$),L(o.$$.fragment,$),L(a.$$.fragment,$),L(g.$$.fragment,$),L(v.$$.fragment,$),k=!1},d($){$&&w(e),$&&w(t),$&&w(i),z(s),z(o),z(a),$&&w(u),$&&w(f),$&&w(d),$&&w(p),$&&w(h),z(g,$),$&&w(_),z(v,$)}}}function lM(n,e,t){let i,s,l,o;Ze(n,Ti,_=>t(4,o=_));let{collection:r=new kn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(_){n.$$.not_equal(r.options.exceptEmailDomains,_)&&(r.options.exceptEmailDomains=_,t(0,r))}function d(_){n.$$.not_equal(r.options.onlyEmailDomains,_)&&(r.options.onlyEmailDomains=_,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=pt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=_=>{"collection"in _&&t(0,r=_.collection)},n.$$.update=()=>{var _,v,k,$;n.$$.dirty&1&&r.$isAuth&&U.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!U.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.allowEmailAuth)||!U.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!U.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!U.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,h,g]}class oM extends be{constructor(e){super(),ge(this,e,lM,sM,he,{collection:0})}}function tp(n,e,t){const i=n.slice();return i[17]=e[t],i}function np(n,e,t){const i=n.slice();return i[17]=e[t],i}function ip(n,e,t){const i=n.slice();return i[17]=e[t],i}function sp(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lp(n){var r;let e,t,i,s,l=n[3]&&op(n),o=!((r=n[2])!=null&&r.$isView)&&rp(n);return{c(){e=y("h6"),e.textContent="Changes:",t=D(),i=y("ul"),l&&l.c(),s=D(),o&&o.c(),m(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=op(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.$isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=rp
`),s=y("strong"),o=W(l),r=D(),a=y("i"),u=D(),f=y("strong"),p=W(d),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(_,v){S(_,e,v),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,p)},p(_,v){var k,$;v&2&&l!==(l=((k=_[1])==null?void 0:k.name)+"")&&se(o,l),v&4&&d!==(d=(($=_[2])==null?void 0:$.name)+"")&&se(p,d)},d(_){_&&w(e)}}}function rp(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=ap(ip(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=up(np(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=fp(tp(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=D();for(let f=0;f<r.length;f+=1)r[f].c();t=D();for(let f=0;f<u.length;f+=1)u[f].c();i=ke()},m(f,d){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(f,d);S(f,e,d);for(let p=0;p<r.length;p+=1)r[p]&&r[p].m(f,d);S(f,t,d);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(f,d);S(f,i,d)},p(f,d){if(d&32){s=f[5];let p;for(p=0;p<s.length;p+=1){const h=ip(f,s,p);l[p]?l[p].p(h,d):(l[p]=ap(h),l[p].c(),l[p].m(e.parentNode,e))}for(;p<l.length;p+=1)l[p].d(1);l.length=s.length}if(d&128){o=f[7];let p;for(p=0;p<o.length;p+=1){const h=np(f,o,p);r[p]?r[p].p(h,d):(r[p]=up(h),r[p].c(),r[p].m(t.parentNode,t))}for(;p<r.length;p+=1)r[p].d(1);r.length=o.length}if(d&64){a=f[6];let p;for(p=0;p<a.length;p+=1){const h=tp(f,a,p);u[p]?u[p].p(h,d):(u[p]=fp(h),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){ht(l,f),f&&w(e),ht(r,f),f&&w(t),ht(u,f),f&&w(i)}}}function ap(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=W(`Multiple to single value conversion of field
`),i=y("strong"),l=W(s),o=D(),r=y("em"),r.textContent="(will keep only the last array item)",m(r,"class","txt-sm"),m(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&se(l,s)},d(a){a&&w(e)}}}function up(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,d=n[17].name+"",p;return{c(){e=y("li"),t=y("div"),i=W(`Renamed field
`),s=y("strong"),o=W(l),r=D(),a=y("i"),u=D(),f=y("strong"),p=W(d),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(h,g){S(h,e,g),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,p)},p(h,g){g&128&&l!==(l=h[17].originalName+"")&&se(o,l),g&128&&d!==(d=h[17].name+"")&&se(p,d)},d(h){h&&w(e)}}}function fp(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=W("Removed field "),i=y("span"),l=W(s),o=D(),m(i,"class","txt-bold"),m(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&se(l,s)},d(r){r&&w(e)}}}function rM(n){let e,t,i,s,l,o,r,a,u=n[6].length&&sp(),f=n[8]&&lp(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=D(),u&&u.c(),r=D(),f&&f.c(),a=ke(),m(t,"class","icon"),m(s,"class","content txt-bold"),m(e,"class","alert alert-warning")},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),S(d,r,p),f&&f.m(d,p),S(d,a,p)},p(d,p){d[6].length?u||(u=sp(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=lp(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&w(e),u&&u.d(),d&&w(r),f&&f.d(d),d&&w(a)}}}function aM(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function uM(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function fM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[uM],header:[aM],default:[rM]},$$scope:{ctx:n}};return e=new on({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){H(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[13](null),z(e,s)}}}function cM(n,e,t){let i,s,l,o,r;const a=Tt();let u,f,d;async function p(T,M){t(1,f=T),t(2,d=M),await cn(),i||s.length||l.length||o.length?u==null||u.show():g()}function h(){u==null||u.hide()}function g(){h(),a("confirm")}const _=()=>h(),v=()=>g();function k(T){ne[T?"unshift":"push"](()=>{u=T,t(4,u)})}function $(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{var T,M,O;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((T=d==null?void 0:d.schema)==null?void 0:T.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(6,l=((M=d==null?void 0:d.schema)==null?void 0:M.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(5,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>{var P,N,F;const A=(P=f==null?void 0:f.schema)==null?void 0:P.find(R=>R.id==E.id);return A?((N=A.options)==null?void 0:N.maxSelect)!=1&&((F=E.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.$isView)||i)},[h,f,d,i,u,o,l,s,r,g,p,_,v,k,$,C]}class dM extends be{constructor(e){super(),ge(this,e,cM,fM,he,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function cp(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function pM(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new _4({props:l}),ne.push(()=>de(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function mM(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new N4({props:l}),ne.push(()=>de(e,"collection",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function dp(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new E4({props:o}),ne.push(()=>de(t,"collection",l)),{c(){e=y("div"),H(t.$$.fragment),m(e,"class","tab-item active")},m(r,a){S(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],_e(()=>i=!1)),t.$set(u)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&w(e),z(t)}}}function pp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new oM({props:o}),ne.push(()=>de(t,"collection",l)),{c(){e=y("div"),H(t.$$.fragment),m(e,"class","tab-item"),x(e,"active",n[3]===Fs)},m(r,a){S(r,e,a),V(t,e,null),s=!0
<span class="txt">Duplicate</span>`,t=D(),i=y("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",In(tt(n[25])))],s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function hp(n){let e,t,i,s;return i=new Jn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[gM]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=D(),H(i.$$.fragment),m(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),z(i,l)}}}function _p(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=D(),l=y("span"),r=W(o),a=W(" collection"),u=D(),m(t,"class",i=os(U.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),m(l,"class","txt"),m(e,"type","button"),m(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(h,g){S(h,e,g),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(d=J(e,"click",p),f=!0)},p(h,g){n=h,g[0]&64&&i!==(i=os(U.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&m(t,"class",i),g[0]&64&&o!==(o=n[48]+"")&&se(r,o),g[0]&68&&x(e,"selected",n[47]==n[2].type)},d(h){h&&w(e),f=!1,d()}}}function gM(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=_p(cp(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ke()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=cp(s,t,o);i[o]?i[o].p(r,l):(i[o]=_p(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&w(e)}}}function gp(n){let e;return{c(){e=y("div"),e.textContent="System collection",m(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function bM(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k=(n[6][n[2].type]||"N/A")+"",$,C,T,M,O,E,A,P,N,F=n[2].$isNew&&hp(n),R=n[2].system&&gp();return{c(){e=y("label"),t=W("Name"),s=D(),l=y("input"),f=D(),d=y("div"),p=y("button"),h=y("span"),g=D(),_=y("span"),v=W("Type: "),$=W(k),C=D(),F&&F.c(),O=D(),R&&R.c(),E=ke(),m(e,"for",i=n[46]),m(l,"type","text"),m(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],m(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,m(l,"placeholder",a=n[2].$isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,m(_,"class","txt"),m(p,"type","button"),m(p,"class",T="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=M=!n[2].$isNew,m(d,"class","form-field-addon")},m(q,j){S(q,e,j),b(e,t),S(q,s,j),S(q,l,j),S(q,f,j),S(q,d,j),b(d,p),b(p,h),b(p,g),b(p,_),b(_,v),b(_,$),b(p,C),F&&F.m(p,null),S(q,O,j),R&&R.m(q,j),S(q,E,j),A=!0,n[2].$isNew&&l.focus(),P||(N=J(l,"input",n[26]),P=!0)},p(q,j){(!A||j[1]&32768&&i!==(i=q[46]))&&m(e,"for",i),(!A||j[1]&32768&&o!==(o=q[46]))&&m(l,"id",o),(!A||j[0]&8192)&&(l.disabled=q[13]),(!A||j[0]&4&&r!==(r=q[2].$isNew))&&(l.autofocus=r),(!A||j[0]&4&&a!==(a=q[2].$isAuth?'eg. "users"':'eg. "posts"'))&&m(l,"placeholder",a),(!A||j[0]&4&&u!==(u=q[2].name)&&l.value!==u)&&(l.value=u),(!A||j[0]&68)&&k!==(k=(q[6][q[2].type]||"N/A")+"")&&se($,k),q[2].$isNew?F?(F.p(q,j),j[0]&4&&I(F,1)):(F=hp(q),F.c(),I(F,1),F.m(p,null)):F&&(ae(),L(F,1,1,()=>{F=null}),ue()),(!A||j[0]&4&&T!==(T="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&m(p,"class",T),(!A||j[0]&4&&M!==(M=!q[2].$isNew))&&(p.disabled=M),q[2].system?R||(R=gp(),R.c(),R.m(E.parentNode,E)):R&&(R.d(1),R=null)},i(q){A||(I(F),A=!0)},o(q){L(F),A=!1},d(q){q&&w(e),q&&w(s),q&&w(l),q&&w(f),q&&w(d),F&&F.d(),q&&w(O),R&&R.d(q),q&&w(E),P=!1,N()}}}function bp(n){let e,t,i,s,l,o;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=Oe(t=Be.call(null,e,n[11])),l=!0)},p(r,a){t&&jt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{s&&(i||(i=Ve(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i
<span class="txt">New collection</span>`,m(t,"type","button"),m(t,"class","btn btn-block btn-outline"),m(e,"class","sidebar-footer")},m(l,o){S(l,e,o),b(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:te,d(l){l&&w(e),i=!1,s()}}}function $M(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],h=new Map,g,_,v,k,$,C,T=n[3];const M=P=>P[15].id;for(let P=0;P<T.length;P+=1){let N=$p(n,T,P),F=M(N);h.set(F,p[P]=Mp(F,N))}let O=null;T.length||(O=Tp(n));let E=!n[7]&&Op(n),A={};return v=new du({props:A}),n[13](v),v.$on("save",n[14]),{c(){e=y("aside"),t=y("header"),i=y("div"),s=y("div"),l=y("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=y("input"),a=D(),u=y("hr"),f=D(),d=y("div");for(let P=0;P<p.length;P+=1)p[P].c();O&&O.c(),g=D(),E&&E.c(),_=D(),H(v.$$.fragment),m(l,"type","button"),m(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),m(s,"class","form-field-addon"),m(r,"type","text"),m(r,"placeholder","Search collections..."),m(i,"class","form-field search"),x(i,"active",n[4]),m(t,"class","sidebar-header"),m(u,"class","m-t-5 m-b-xs"),m(d,"class","sidebar-content"),x(d,"fade",n[6]),x(d,"sidebar-content-compact",n[3].length>20),m(e,"class","page-sidebar collection-sidebar")},m(P,N){S(P,e,N),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),re(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,d);for(let F=0;F<p.length;F+=1)p[F]&&p[F].m(d,null);O&&O.m(d,null),b(e,g),E&&E.m(e,null),S(P,_,N),V(v,P,N),k=!0,$||(C=[J(l,"click",n[10]),J(r,"input",n[11])],$=!0)},p(P,[N]){(!k||N&16)&&x(l,"hidden",!P[4]),N&1&&r.value!==P[0]&&re(r,P[0]),(!k||N&16)&&x(i,"active",P[4]),N&42&&(T=P[3],p=vt(p,N,M,1,P,T,h,d,us,Mp,null,$p),!T.length&&O?O.p(P,N):T.length?O&&(O.d(1),O=null):(O=Tp(P),O.c(),O.m(d,null))),(!k||N&64)&&x(d,"fade",P[6]),(!k||N&8)&&x(d,"sidebar-content-compact",P[3].length>20),P[7]?E&&(E.d(1),E=null):E?E.p(P,N):(E=Op(P),E.c(),E.m(e,null));const F={};v.$set(F)},i(P){k||(I(v.$$.fragment,P),k=!0)},o(P){L(v.$$.fragment,P),k=!1},d(P){P&&w(e);for(let N=0;N<p.length;N+=1)p[N].d();O&&O.d(),E&&E.d(),P&&w(_),n[13](null),z(v,P),$=!1,De(C)}}}function TM(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function CM(n,e,t){let i,s,l,o,r,a,u;Ze(n,fi,$=>t(5,o=$)),Ze(n,di,$=>t(9,r=$)),Ze(n,wo,$=>t(6,a=$)),Ze(n,Is,$=>t(7,u=$));let f,d="";function p($){ln(fi,o=$,o)}const h=()=>t(0,d="");function g(){d=this.value,t(0,d)}const _=()=>f==null?void 0:f.show();function v($){ne[$?"unshift":"push"](()=>{f=$,t(2,f)})}const k=$=>{var C;(C=$.detail)!=null&&C.isNew&&$.detail.collection&&p($.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&TM(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter($=>$.id==d||$.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,h,g,_,v,k]}class MM extends be{constructor(e){super(),ge(this,e,CM,$M,he,{})}}function Ep(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function Dp(n){n[18]=n[19].default}function Ap(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ip(n){let e;return{c(){e=y("hr"),m(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Lp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&Ip();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=ke(),d&&d.c(),s=D(),l=y("button"),r=W(o),a=D(),m(l,"type","button"),m(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(h,g){S(h,t,g),d&&d.m(h,g),S(h,s,g),S(h,l,g),b(l,r),b(l,a),u||(f=J(l,"click",p),u=!0)},p(h,g){e=h,g&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=Ip(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),g&8&&o!==(o=e[15].label+"")&&se(r,o),g&40&&x(l,"active",e[5]===e[14])},d(h){h&&w(t),d&&d.d(h),h&&w(s),h&&w(l),u=!1,f()}}}function Pp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:DM,then:EM,catch:OM,value:19,blocks:[,,,]};return bu(t=n[15].component,s),{c(){e=ke(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.a
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[G6,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),H(t.$$.fragment),m(e,"class","block")},m(o,r){S(o,e,r),V(t,e,null),i=!0,s||(l=[J(e,"dragover",tt(n[25])),J(e,"dragleave",n[26]),J(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
`),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(I(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&w(e),z(t),s=!1,De(l)}}}function Q6(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileNames:u=[]}=e,{field:f=new wn}=e,d,p,h=!1,g="";function _(B){U.removeByValue(u,B),t(2,u)}function v(B){U.pushUnique(u,B),t(2,u)}function k(B){U.isEmpty(a[B])||a.splice(B,1),t(1,a)}function $(){p==null||p.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileNames:u},bubbles:!0}))}function C(B){var Q,Z;B.preventDefault(),t(9,h=!1);const Y=((Q=B.dataTransfer)==null?void 0:Q.files)||[];if(!(l||!Y.length)){for(const G of Y){const le=s.length+a.length-u.length;if(((Z=f.options)==null?void 0:Z.maxSelect)<=le)break;a.push(G)}t(1,a)}}Xt(async()=>{t(10,g=await ce.getAdminFileToken(o.collectionId))});const T=B=>_(B),M=B=>v(B);function O(B){r=B,t(0,r),t(6,i),t(4,f)}const E=B=>k(B);function A(B){a=B,t(1,a)}function P(B){ne[B?"unshift":"push"](()=>{d=B,t(7,d)})}const N=()=>{for(let B of d.files)a.push(B);t(1,a),t(7,d.value=null,d)},F=()=>d==null?void 0:d.click();function R(B){ne[B?"unshift":"push"](()=>{p=B,t(8,p)})}const q=()=>{t(9,h=!0)},j=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"value"in B&&t(0,r=B.value),"uploadedFiles"in B&&t(1,a=B.uploadedFiles),"deletedFileNames"in B&&t(2,u=B.deletedFileNames),"field"in B&&t(4,f=B.field)},n.$$.update=()=>{var B,Y;n.$$.dirty[0]&2&&(Array.isArray(a)||t(1,a=U.toArray(a))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=U.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((B=f.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&U.isEmpty(r)&&t(0,r=i?[]:""),n.$$.dirty[0]&1&&t(5,s=U.toArray(r)),n.$$.dirty[0]&54&&t(11,l=(s.length||a.length)&&((Y=f.options)==null?void 0:Y.maxSelect)<=s.length+a.length-u.length),n.$$.dirty[0]&6&&(a!==-1||u!==-1)&&$()},[r,a,u,o,f,s,i,d,p,h,g,l,_,v,k,C,T,M,O,E,A,P,N,F,R,q,j]}class x6 extends be{constructor(e){super(),ge(this,e,Q6,X6,he,{record:3,value:0,uploadedFiles:1,deletedFileNames:2,field:4},null,[-1,-1])}}function Wp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function e5(n,e){e=Wp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Wp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Yp(n,e,t){const i=n.slice();i[6]=e[t];const s=U.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Kp(n,e,t){const i=n.slice();return i[10]=e[t],i}function Jp(n){let e,t;return e=new pu({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function Zp(n){let e=!U.isEmpty(n[10]),t,i,s=e&&Jp(n);return{c(){s&&s.c(),t=ke()},m(l,o){s&&s.m(l,o),S(l,t,o),i=!0},p(l,o){o&3&&(e=!U.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&I(s,1)):(s=Jp(l),s.c(),I(s,1),s.m(t.parentNode,t)):s&&(ae(),L(s,1,1,()=>{s=null}),ue())},i(l){i||(I(s),i=!0)},o(l){L(s),i=!1},d(l){s&&s.d(l),l&&w(t)}}}function Gp(n){let e,t,i=n[7],s=[];for(let o=0;o<i.length;o+=1)s[o]=Zp(Kp(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&3){i=o[7];let a;for(a=0;a<i.length;a+=1){const u=Kp(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=Zp(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function t5(n){let e,t,i,s,l,o,r=U.truncate(U.displayValue(n[0],n[2]),70)+"",a,u,f,d,p=n[1],h=[];for(let _=0;_<p.length;_+=1)h[_]=Gp(Yp(n,p,_));const g=_=>L(h[_],1,1,()=>{h[_
`),E&&E.c(),p=D(),g.c(),_=ke(),m(e,"class","flex m-b-base flex-gap-10"),m(l,"class","list picker-list m-b-base svelte-1u8jhky"),m(f,"class","section-title")},m(R,q){S(R,e,q),V(t,e,null),b(e,i),C&&C.m(e,null),S(R,s,q),S(R,l,q);for(let j=0;j<o.length;j+=1)o[j]&&o[j].m(l,null);O&&O.m(l,null),S(R,u,q),S(R,f,q),b(f,d),E&&E.m(f,null),S(R,p,q),P[h].m(R,q),S(R,_,q),v=!0,k||($=Oe(a=e5.call(null,l,n[36])),k=!0)},p(R,q){var Y;const j={};q[0]&4&&(j.value=R[2]),q[0]&1024&&(j.autocompleteCollection=R[10]),t.$set(j),(Y=R[10])!=null&&Y.$isView?C&&(C.d(1),C=null):C?C.p(R,q):(C=xp(R),C.c(),C.m(e,null)),q[0]&145324&&(T=R[3],ae(),o=vt(o,q,M,1,R,T,r,l,Ut,im,null,Qp),ue(),!T.length&&O?O.p(R,q):T.length?O&&(O.d(1),O=null):(O=em(R),O.c(),O.m(l,null))),a&&jt(a.update)&&q[0]&2064&&a.update.call(null,R[36]),R[5]>1?E?E.p(R,q):(E=sm(R),E.c(),E.m(f,null)):E&&(E.d(1),E=null);let B=h;h=N(R),h===B?P[h].p(R,q):(ae(),L(P[B],1,1,()=>{P[B]=null}),ue(),g=P[h],g?g.p(R,q):(g=P[h]=A[h](R),g.c()),I(g,1),g.m(_.parentNode,_))},i(R){if(!v){I(t.$$.fragment,R);for(let q=0;q<T.length;q+=1)I(o[q]);I(g),v=!0}},o(R){L(t.$$.fragment,R);for(let q=0;q<o.length;q+=1)L(o[q]);L(g),v=!1},d(R){R&&w(e),z(t),C&&C.d(),R&&w(s),R&&w(l);for(let q=0;q<o.length;q+=1)o[q].d();O&&O.d(),R&&w(u),R&&w(f),E&&E.d(),R&&w(p),P[h].d(R),R&&w(_),k=!1,$()}}}function c5(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=W("Select "),i=y("strong"),l=W(s),o=W(" records")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&se(l,s)},d(a){a&&w(e)}}}function d5(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=y("button"),i.innerHTML='<span class="txt">Set selection</span>',m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,De(l)}}}function p5(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[d5],header:[c5],default:[f5]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=je(o,l[a]);e=new on({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new T1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),s=!0},p(a,u){const f=u[0]&524288?Ot(l,[l[0],l[1],Qt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&1024&&(d.collection=a[10]),i.$set(d)},i(a){s||(I(e.$$.fragment,a),I(i.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),s=!1},d(a){n[39](null),z(e,a),a&&w(t),n[42](null),z(i,a)}}}const Rr=100;function m5(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=et(e,d),h;Ze(n,di,Pe=>t(26,h=Pe));const g=Tt(),_="picker_"+U.randomString(5);let{value:v}=e,{field:k}=e,$,C,T="",M=[],O=[],E=1,A=0,P=!1,N=!1;function F(){return t(2,T=""),t(3,M=[]),t(6,O=[]),q(),j(!0),$==null?void 0:$.show()}function R(){return $==null?void 0:$.hide()}async function q(){const Pe=U.toArray(v);if(!s||!Pe.length)return;t(24,N=!0);let $e=[];const it=Pe.slice(),It=[];for(;it.length>0;){const Vt=[];for(const Wt of it.splice(0,Rr))Vt.push(`id="${Wt}"`);It.push(ce.collection(s).getFullList(Rr,{filter:Vt.join("||"),$autoCancel:!1}))}try{await Promise.all(It).then(Vt=>{$e=$e.concat(...Vt)}),t(6,O=[]);for(const Vt of Pe){const Wt=U.findByKey($e,"id",Vt);Wt&&O.push(Wt)}T.trim()||t(3,M=U.filterDuplicatesByKey(O.concat(M)))}catch(Vt){ce.error(Vt)}t(24,N=!1)}async function j(Pe=!1){if(s){t(4,P=!0),Pe&&(T.trim()?t(3,M=[]):t(3,M=U.toArray(O).slice()));try{const $e=Pe?1:E+1,it=U.getAllCollectionIdentifiers(o),It=await ce.collection(s).getList($e,Rr,{filter:U.normalizeSearchFilter(T,it),sort:o!=null&&o.$isView?"":"-created",$cancelKey:_+"loadList"});t(3,M=U.filterDuplicatesByKey(M.concat(It.items))),E=It.page,t(23,A=It.totalItems)}catch($e){ce.error($e)}t(4,P=!1)}}function B(Pe){i==1?t(6,O=
`,m(e,"class","list-item")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function _5(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new ir({props:{record:n[20],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[10](n[20])}return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),o=y("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),m(t,"class","content"),m(o,"type","button"),m(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),m(l,"class","actions"),m(e,"class","list-item"),x(e,"dragging",n[23]),x(e,"dragover",n[24])},m(h,g){S(h,e,g),b(e,t),V(i,t,null),b(e,s),b(e,l),b(l,o),S(h,r,g),a=!0,u||(f=[Oe(Be.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(h,g){var v;n=h;const _={};g&16&&(_.record=n[20]),g&4&&(_.displayFields=(v=n[2].options)==null?void 0:v.displayFields),i.$set(_),(!a||g&8388608)&&x(e,"dragging",n[23]),(!a||g&16777216)&&x(e,"dragover",n[24])},i(h){a||(I(i.$$.fragment,h),a=!0)},o(h){L(i.$$.fragment,h),a=!1},d(h){h&&w(e),z(i),h&&w(r),u=!1,De(f)}}}function cm(n,e){let t,i,s,l;function o(a){e[11](a)}let r={group:e[2].name+"_relation",index:e[22],disabled:!e[6],$$slots:{default:[_5,({dragging:a,dragover:u})=>({23:a,24:u}),({dragging:a,dragover:u})=>(a?8388608:0)|(u?16777216:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Fl({props:r}),ne.push(()=>de(i,"list",o)),i.$on("sort",e[12]),{key:n,first:null,c(){t=ke(),H(i.$$.fragment),this.first=t},m(a,u){S(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[22]),u&64&&(f.disabled=!e[6]),u&293601300&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],_e(()=>s=!1)),i.$set(f)},i(a){l||(I(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&w(t),z(i,a)}}}function g5(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p=[],h=new Map,g,_,v,k,$,C,T=n[4];const M=E=>E[20].id;for(let E=0;E<T.length;E+=1){let A=om(n,T,E),P=M(A);h.set(P,p[E]=cm(P,A))}let O=null;return T.length||(O=am(n)),{c(){e=y("label"),t=y("i"),s=D(),l=y("span"),r=W(o),u=D(),f=y("div"),d=y("div");for(let E=0;E<p.length;E+=1)p[E].c();O&&O.c(),g=D(),_=y("div"),v=y("button"),v.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,m(t,"class",i=os(U.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),m(l,"class","txt"),m(e,"for",a=n[19]),m(d,"class","relations-list svelte-1ynw0pc"),m(v,"type","button"),m(v,"class","btn btn-transparent btn-sm btn-block"),m(_,"class","list-item list-item-btn"),m(f,"class","list")},m(E,A){S(E,e,A),b(e,t),b(e,s),b(e,l),b(l,r),S(E,u,A),S(E,f,A),b(f,d);for(let P=0;P<p.length;P+=1)p[P]&&p[P].m(d,null);O&&O.m(d,null),b(f,g),b(f,_),b(_,v),k=!0,$||(C=J(v,"click",n[13]),$=!0)},p(E,A){(!k||A&4&&i!==(i=os(U.getFieldTypeIcon(E[2].type))+" svelte-1ynw0pc"))&&m(t,"class",i),(!k||A&4)&&o!==(o=E[2].name+"")&&se(r,o),(!k||A&524288&&a!==(a=E[19]))&&m(e,"for",a),A&25166325&&(T=E[4],ae(),p=vt(p,A,M,1,E,T,h,d,Ut,cm,null,om),ue(),!T.length&&O?O.p(E,A):T.length?O&&(O.d(1),O=null):(O=am(E),O.c(),O.m(d,null)))},i(E){if(!k){for(let A=0;A<T.length;A+=1)I(p[A]);k=!0}},o(E){for(let A=0;A<p.length;A+=1)L(p[A]);k=!1},d(E){E&&w(e),E&&w(u),E&&w(f);for(let A=0;A<p.length;A+=1)p[A].d();O&&O.d(),$=!1,C()}}}function b5(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[g5,({uniqueId:r})=>({19:r}),({uniqueId:r})=>r?524288:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[14](e);let o={value:n[0],field:n[2]};return i=new h5({props:o}),n[15](i),i.$on("save",n[16]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&268959863&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[14](null),z(e,r),r&&w(t),n[15](null),z(i,r)}}}const dm=100;function v5(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new wn}=e,r,a=[],u=!1,f;function d(){if(u)return!1;const O=U.toArray(s);return t(4,a=a.filter(E=>O.includes(E.id))),O.length!=a.length}async function p(){var P,N;const O=U.toArray(s);if(t(4,a=[]),!((P=o==null?void 0:o.options)!=null&&P.collectionId)||!O.length){t(5,u=!1);return}t(5,u=!0);const E=O.slice(),A=[];for(;E.length>0;){const F=[];for(const R of E.splice(0,dm))F.push(`id="${R}"`);A.push(ce.collection((N=o==null?void 0:o.options)==null?void 0:N.collectionId).getFullList(dm,{filter:F.join("||"),$autoCancel:!1}))}try{let F=[];await Promise.all(A).then(R=>{F=F.concat(...R)});for(const R of O){const q=U.findByKey(F,"id",R);q&&a.push(q)}t(4,a)}catch(F){ce.error(F)}t(5,u=!1)}function h(O){U.removeByKey(a,"id",O.id),t(4,a),g()}function g(){var O;i?t(0,s=a.map(E=>E.id)):t(0,s=((O=a[0])==null?void 0:O.id)||"")}Vo(()=>{clearTimeout(f)});const _=O=>h(O);function v(O){a=O,t(4,a)}const k=()=>{g()},$=()=>l==null?void 0:l.show();function C(O){ne[O?"unshift":"push"](()=>{r=O,t(3,r)})}function T(O){ne[O?"unshift":"push"](()=>{l=O,t(1,l)})}const M=O=>{var E;t(4,a=O.detail||[]),t(0,s=i?a.map(A=>A.id):((E=a[0])==null?void 0:E.id)||"")};return n.$$set=O=>{"value"in O&&t(0,s=O.value),"picker"in O&&t(1,l=O.picker),"field"in O&&t(2,o=O.field)},n.$$.update=()=>{var O;n.$$.dirty&4&&t(6,i=((O=o.options)==null?void 0:O.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed()),n.$$.dirty&529&&d()&&(clearTimeout(f),t(9,f=setTimeout(p,0)))},[s,l,o,r,a,u,i,h,g,f,_,v,k,$,C,T,M]}class y5 extends be{constructor(e){super(),ge(this,e,v5,b5,he,{value:0,picker:1,field:2})}}const k5=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressSta
...
-----END PRIVATE KEY-----`),m(a,"class","help-block")},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),re(l,n[5]),S(d,r,p),S(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&m(e,"for",i),p&8388608&&o!==(o=d[23])&&m(l,"id",o),p&32&&re(l,d[5])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),u=!1,f()}}}function x5(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[J5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[Z5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[G5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[X5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Q5,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),H(s.$$.fragment),l=D(),o=y("div"),H(r.$$.fragment),a=D(),u=y("div"),H(f.$$.fragment),d=D(),p=y("div"),H(h.$$.fragment),g=D(),H(_.$$.fragment),m(i,"class","col-lg-6"),m(o,"class","col-lg-6"),m(u,"class","col-lg-6"),m(p,"class","col-lg-6"),m(t,"class","grid"),m(e,"id",n[9]),m(e,"autocomplete","off")},m(C,T){S(C,e,T),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),b(t,a),b(t,u),V(f,u,null),b(t,d),b(t,p),V(h,p,null),b(t,g),V(_,t,null),v=!0,k||($=J(e,"submit",tt(n[17])),k=!0)},p(C,T){const M={};T&25165828&&(M.$$scope={dirty:T,ctx:C}),s.$set(M);const O={};T&25165832&&(O.$$scope={dirty:T,ctx:C}),r.$set(O);const E={};T&25165840&&(E.$$scope={dirty:T,ctx:C}),f.$set(E);const A={};T&25165888&&(A.$$scope={dirty:T,ctx:C}),h.$set(A);const P={};T&25165856&&(P.$$scope={dirty:T,ctx:C}),_.$set(P)},i(C){v||(I(s.$$.fragment,C),I(r.$$.fragment,C),I(f.$$.fragment,C),I(h.$$.fragment,C),I(_.$$.fragment,C),v=!0)},o(C){L(s.$$.fragment,C),L(r.$$.fragment,C),L(f.$$.fragment,C),L(h.$$.fragment,C),L(_.$$.fragment,C),v=!1},d(C){C&&w(e),z(s),z(r),z(f),z(h),z(_),k=!1,$()}}}function eO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function tO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=W("Close"),i=D(),s=y("button"),l=y("i"),o=D(),r=y("span"),r.textContent="Generate and set secret",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[7],m(l,"class","ri-key-line"),m(r,"class","txt"),m(s,"type","submit"),m(s,"form",n[9]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){S(d,e,p),b(e,t),S(d,i,p),S(d,s,p),b(s,l),b(s,o),b(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function nO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[tO],header:[eO],default:[x5]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){H(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),z(e,s)}}}const mo=15777e3;function iO(n,e,t){let i;const s=Tt(),l="apple_secret_"+U.randomString(5);let o,r,a,u,f,d,p=!1;function h(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,d=N.duration||mo),tn({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function _(){t(7,p=!0);try{const N=await ce.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Ht("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){ce.error(N)}t(7,p=!1)}f
`),r=y("button"),r.textContent="Restore draft",a=D(),u=y("button"),u.innerHTML='<i class="ri-close-line"></i>',f=D(),d=y("div"),m(i,"class","icon"),m(r,"type","button"),m(r,"class","btn btn-sm btn-secondary"),m(l,"class","flex flex-gap-xs"),m(u,"type","button"),m(u,"class","close"),m(u,"aria-label","Discard draft"),m(t,"class","alert alert-info m-0"),m(d,"class","clearfix p-b-base"),m(e,"class","block")},m(v,k){S(v,e,k),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,d),h=!0,g||(_=[J(r,"click",n[36]),Oe(Be.call(null,u,"Discard draft")),J(u,"click",tt(n[37]))],g=!0)},p:te,i(v){h||(p&&p.end(1),h=!0)},o(v){p=Ta(e,rt,{duration:150}),h=!1},d(v){v&&w(e),v&&p&&p.end(),g=!1,De(_)}}}function bm(n){let e,t,i,s,l;return{c(){e=y("div"),t=y("i"),m(t,"class","ri-calendar-event-line txt-disabled"),m(e,"class","form-field-addon")},m(o,r){S(o,e,r),b(e,t),s||(l=Oe(i=Be.call(null,t,{text:`Created: ${n[3].created}
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&jt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&w(e),s=!1,l()}}}function mO(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_=!n[6]&&bm(n);return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="id",l=D(),o=y("span"),a=D(),_&&_.c(),u=D(),f=y("input"),m(t,"class",os(U.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),m(s,"class","txt"),m(o,"class","flex-fill"),m(e,"for",r=n[69]),m(f,"type","text"),m(f,"id",d=n[69]),m(f,"placeholder","Leave empty to auto generate..."),m(f,"minlength","15"),f.readOnly=p=!n[6]},m(v,k){S(v,e,k),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),S(v,a,k),_&&_.m(v,k),S(v,u,k),S(v,f,k),re(f,n[3].id),h||(g=J(f,"input",n[38]),h=!0)},p(v,k){k[2]&128&&r!==(r=v[69])&&m(e,"for",r),v[6]?_&&(_.d(1),_=null):_?_.p(v,k):(_=bm(v),_.c(),_.m(u.parentNode,u)),k[2]&128&&d!==(d=v[69])&&m(f,"id",d),k[0]&64&&p!==(p=!v[6])&&(f.readOnly=p),k[0]&8&&f.value!==v[3].id&&re(f,v[3].id)},d(v){v&&w(e),v&&w(a),_&&_.d(v),v&&w(u),v&&w(f),h=!1,g()}}}function vm(n){var u,f;let e,t,i,s,l;function o(d){n[39](d)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new UM({props:r}),ne.push(()=>de(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&ym();return{c(){H(e.$$.fragment),i=D(),a&&a.c(),s=ke()},m(d,p){V(e,d,p),S(d,i,p),a&&a.m(d,p),S(d,s,p),l=!0},p(d,p){var g,_;const h={};p[0]&64&&(h.isNew=d[6]),p[0]&1&&(h.collection=d[0]),!t&&p[0]&8&&(t=!0,h.record=d[3],_e(()=>t=!1)),e.$set(h),(_=(g=d[0])==null?void 0:g.schema)!=null&&_.length?a||(a=ym(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(I(e.$$.fragment,d),l=!0)},o(d){L(e.$$.fragment,d),l=!1},d(d){z(e,d),d&&w(i),a&&a.d(d),d&&w(s)}}}function ym(n){let e;return{c(){e=y("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function hO(n){let e,t,i;function s(o){n[52](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new y5({props:l}),ne.push(()=>de(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function _O(n){let e,t,i,s,l;function o(f){n[49](f,n[66])}function r(f){n[50](f,n[66])}function a(f){n[51](f,n[66])}let u={field:n[66],record:n[3]};return n[3][n[66].name]!==void 0&&(u.value=n[3][n[66].name]),n[4][n[66].name]!==void 0&&(u.uploadedFiles=n[4][n[66].name]),n[5][n[66].name]!==void 0&&(u.deletedFileNames=n[5][n[66].name]),e=new x6({props:u}),ne.push(()=>de(e,"value",o)),ne.push(()=>de(e,"uploadedFiles",r)),ne.push(()=>de(e,"deletedFileNames",a)),{c(){H(e.$$.fragment)},m(f,d){V(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[66]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[66].name],_e(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[66].name],_e(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileNames=n[5][n[66].name],_e(()=>s=!1)),e.$set(p)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){z(e,f)}}}function gO(n){let e,t,i;function s(o){n[48](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new T6({props:l}),ne.push(()=>de(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function bO(n){let e,t,i;function s(o){n[47](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new k6({props:l}),ne.push(()=>de(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[66]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[66].name],_e(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function vO(n){let e,t,i;function s(o){n[46](o,n[66])}let l={field:n[66]};return n[3][n[66].name]!==void 0&&(l.value=n[3][n[66].name]),e=new g6({props:l}),ne.push(()=>de(e,"value",s)),{c(){H(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1
<span class="txt">Send verification email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[30]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Tm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[31]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function MO(n){let e,t,i,s,l,o,r,a=n[0].$isAuth&&!n[2].verified&&n[2].email&&$m(n),u=n[0].$isAuth&&n[2].email&&Tm(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=y("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),S(f,e,d),u&&u.m(f,d),S(f,t,d),S(f,i,d),S(f,s,d),S(f,l,d),o||(r=[J(i,"click",n[32]),J(l,"click",In(tt(n[33])))],o=!0)},p(f,d){f[0].$isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=$m(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].$isAuth&&f[2].email?u?u.p(f,d):(u=Tm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,De(r)}}}function Cm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=D(),s=y("button"),s.textContent="Authorized providers",m(t,"type","button"),m(t,"class","tab-item"),x(t,"active",n[12]===ls),m(s,"type","button"),m(s,"class","tab-item"),x(s,"active",n[12]===Sl),m(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[J(t,"click",n[34]),J(s,"click",n[35])],l=!0)},p(r,a){a[0]&4096&&x(t,"active",r[12]===ls),a[0]&4096&&x(s,"active",r[12]===Sl)},d(r){r&&w(e),l=!1,De(o)}}}function OO(n){var _;let e,t=n[6]?"New":"Edit",i,s,l,o=((_=n[0])==null?void 0:_.name)+"",r,a,u,f,d,p,h=!n[6]&&Sm(n),g=n[0].$isAuth&&!n[6]&&Cm(n);return{c(){e=y("h4"),i=W(t),s=D(),l=y("strong"),r=W(o),a=W(" record"),u=D(),h&&h.c(),f=D(),g&&g.c(),d=ke(),m(e,"class","panel-title svelte-qc5ngu")},m(v,k){S(v,e,k),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),S(v,u,k),h&&h.m(v,k),S(v,f,k),g&&g.m(v,k),S(v,d,k),p=!0},p(v,k){var $;(!p||k[0]&64)&&t!==(t=v[6]?"New":"Edit")&&se(i,t),(!p||k[0]&1)&&o!==(o=(($=v[0])==null?void 0:$.name)+"")&&se(r,o),v[6]?h&&(ae(),L(h,1,1,()=>{h=null}),ue()):h?(h.p(v,k),k[0]&64&&I(h,1)):(h=Sm(v),h.c(),I(h,1),h.m(f.parentNode,f)),v[0].$isAuth&&!v[6]?g?g.p(v,k):(g=Cm(v),g.c(),g.m(d.parentNode,d)):g&&(g.d(1),g=null)},i(v){p||(I(h),p=!0)},o(v){L(h),p=!1},d(v){v&&w(e),v&&w(u),h&&h.d(v),v&&w(f),g&&g.d(v),v&&w(d)}}}function EO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),r=W(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[10],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[15]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[13]||n[10],x(s,"btn-loading",n[10])},m(d,p){S(d,e,p),b(e,t),S(d,i,p),S(d,s,p),b(s,l),b(l,r),u||(f=J(e,"click",n[29]),u=!0)},p(d,p){p[0]&1024&&(e.disabled=d[10]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&se(r,o),p[0]&9216&&a!==(a=!d[13]||d[10])&&(s.disabled=a),p[0]&1024&&x(s,"btn-loading",d[10])},d(d){d&&w(e),d&&w(i),d&&w(s),u=!1,f()}}}function DO(n){var s;let e,t,i={class:`
record-panel
`+(n[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.$isAuth&&!n[6]?"colored-header":"")+`
`,beforeHide:n[53],$$slots:{footer:[EO],header:[OO],default:[CO]},$$scope:{ctx:n}};return e=new on({props:i}),n[54](e),e.$on("hide",n[55]),e.$on("show",n[56]),{c(){H(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&16449&&(r.class=`
record-panel
`+(l[14]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.$isAuth&&!l[6]?"colored-header":"")+`
`),o[0]&2176&&(r.beforeHide=l[53]),o[0]&14077|o[2]&256&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[54](null),z(e,l)}}}const ls="form",Sl="providers";function AO(n,e,t){let i,s,l,o;const r=Tt(),a="record_"+U.randomString(5);let{collection:u}=e,f,d=null,p=null,h=null,g=!1,_=!1,v={},k={},$=JSON.stringify(null),C=$,T=ls,M=!0,O=!1;function E(ve){return P(ve),t(11,_=!0),t(12,T=ls),f==null?void 0:f.show()}function A(){return f==null?void 0:f.hide()}async function P(ve){t(27,O=!1),tn({}),t(2,d=ve||new wi),t(3,p=d.$clone()),t(4,v={}),t(5,k={}),await cn(),t(9,h=R()),!h||B(p,h)?t(9,h=null):(delete h.password,delete h.passwordConfirm),t(25,$=JSON.stringify(p)),t(27,O=!0)}async function N(ve){var Re,Qe;tn({}),t(2,d=ve||new wi),t(4,v={}),t(5,k={});const Ae=((Qe=(Re=u==null?void 0:u.schema)==null?void 0:Re.filter(Et=>Et.type!="file"))==null?void 0:Qe.map(Et=>Et.name))||[];for(let Et in ve.$export())Ae.includes(Et)||t(3,p[Et]=ve[Et],p);await cn(),t(25,$=JSON.stringify(p)),Y()}function F(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function R(ve){try{const Ae=window.localStorage.getItem(F());if(Ae)return new wi(JSON.parse(Ae))}catch{}return ve}function q(ve){window.localStorage.setItem(F(),ve)}function j(){h&&(t(3,p=h),t(9,h=null))}function B(ve,Ae){var Tn;const Re=ve==null?void 0:ve.$clone(),Qe=Ae==null?void 0:Ae.$clone(),Et=(Tn=u==null?void 0:u.schema)==null?void 0:Tn.filter(Fn=>Fn.type==="file");for(let Fn of Et)Re==null||delete Re[Fn.name],Qe==null||delete Qe[Fn.name];return Re==null||delete Re.password,Re==null||delete Re.passwordConfirm,Qe==null||delete Qe.password,Qe==null||delete Qe.passwordConfirm,JSON.stringify(Re)==JSON.stringify(Qe)}function Y(){t(9,h=null),window.localStorage.removeItem(F())}function Q(ve=!0){if(g||!o||!(u!=null&&u.id))return;t(10,g=!0);const Ae=G();let Re;M?Re=ce.collection(u.id).create(Ae):Re=ce.collection(u.id).update(p.id,Ae),Re.then(Qe=>{Ht(M?"Successfully created record.":"Successfully updated record."),Y(),ve?(t(11,_=!1),A()):N(Qe),r("save",Qe)}).catch(Qe=>{ce.error(Qe)}).finally(()=>{t(10,g=!1)})}function Z(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>ce.collection(d.collectionId).delete(d.id).then(()=>{A(),Ht("Successfully deleted record."),r("delete",d)}).catch(ve=>{ce.error(ve)}))}function G(){const ve=(p==null?void 0:p.$export())||{},Ae=new FormData,Re={id:ve.id};for(const Qe of(u==null?void 0:u.schema)||[])Re[Qe.name]=!0;u!=null&&u.isAuth&&(Re.username=!0,Re.email=!0,Re.emailVisibility=!0,Re.password=!0,Re.passwordConfirm=!0,Re.verified=!0);for(const Qe in ve)Re[Qe]&&(typeof ve[Qe]>"u"&&(ve[Qe]=null),U.addValueToFormData(Ae,Qe,ve[Qe]));for(const Qe in v){const Et=U.toArray(v[Qe]);for(const Tn of Et)Ae.append(Qe,Tn)}for(const Qe in k){const Et=U.toArray(k[Qe]);for(const Tn of Et)Ae.append(Qe+"."+Tn,"")}return Ae}function le(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>ce.collection(u.id).requestVerification(d.email).then(()=>{Ht(`Successfully sent verification email to ${d.email}.`)}).catch(ve=>{ce.error(ve)}))}function ee(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>ce.collection(u.id).requestPasswordReset(d.email).then(()=>{Ht(`Successfully sent password reset email to ${d.email}.`)}).catch(ve=>{ce.error(ve)}))}function me(){l?mn("You have unsaved changes. Do you really want to discard them?",()=>{ye()}):ye()}async function ye(){const ve=d==null?void 0:d.$clone();if(ve){ve.id="",ve.created="",ve.updated="";const Ae=(u==null?void 0:u.schema)||[];for(const Re of Ae)Re.type==="file"&&delete ve[Re.name]}Y(),E(ve),await cn(),t(25,$="")}function Me(ve){(ve.ctrlKey||ve.metaKey)&&ve.code=="KeyS"&&(ve.preventDefault(),ve.stopPropagation(),Q(!1))}const ze=()=>A(),Ue=()=>le(),we=()=>ee(),Ce=()=>me(),Ge=()=>Z(),_t=()=>t(12,T=ls),Xe=()=>t(12,T=Sl),Ke=()=>j(),Se=()=>Y();function fe(){p.id=this.value,t(3,p)}function He(ve){p=ve,t(3,p)}fu
`},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function vE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function yE(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function nh(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=D(),r=y("label"),m(i,"type","checkbox"),m(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],m(r,"for",a="checkbox_"+n[55].id),m(t,"class","form-field"),m(e,"class","bulk-select-col min-width")},m(p,h){S(p,e,h),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[J(i,"change",d),J(t,"click",In(n[26]))],u=!0)},p(p,h){n=p,h[0]&16&&s!==(s="checkbox_"+n[55].id)&&m(i,"id",s),h[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),h[0]&16&&a!==(a="checkbox_"+n[55].id)&&m(r,"for",a)},d(p){p&&w(e),u=!1,De(f)}}}function ih(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new Rl({props:{value:n[55].id}});let d=n[2].$isAuth&&sh(n);return{c(){e=y("td"),t=y("div"),i=y("div"),H(s.$$.fragment),l=D(),o=y("div"),a=W(r),u=D(),d&&d.c(),m(o,"class","txt"),m(i,"class","label"),m(t,"class","flex flex-gap-5"),m(e,"class","col-type-text col-field-id")},m(p,h){S(p,e,h),b(e,t),b(t,i),V(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),d&&d.m(t,null),f=!0},p(p,h){const g={};h[0]&16&&(g.value=p[55].id),s.$set(g),(!f||h[0]&16)&&r!==(r=p[55].id+"")&&se(a,r),p[2].$isAuth?d?d.p(p,h):(d=sh(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(I(s.$$.fragment,p),f=!0)},o(p){L(s.$$.fragment,p),f=!1},d(p){p&&w(e),z(s),d&&d.d()}}}function sh(n){let e;function t(l,o){return l[55].verified?wE:kE}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function kE(n){let e,t,i;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=Oe(Be.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function wE(n){let e,t,i;return{c(){e=y("i"),m(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=Oe(Be.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function lh(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&oh(n),o=i&&rh(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=ke()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=oh(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=rh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function oh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!U.isEmpty(o[55].username)),t?$E:SE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),m(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function SE(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=W(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].username)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&se(i,t),o[0]&16&&s!==(s=l[55].username)&&m(e,"title",s)},d(l){l&&w(e)}}}function $E(n){let e;return{c(){e=y("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function rh(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!U.isEmpty(o[55].email)),t?CE:TE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),m(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function TE(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=W(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].email)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].emai
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function qE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,h,g,_,v,k,$,C,T,M,O,E,A,P,N,F=!n[10]&&gh(n);d=new Go({}),d.$on("refresh",n[16]);let R=!n[2].$isView&&bh(n);k=new Zo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(Y){n[21](Y)}function j(Y){n[22](Y)}let B={collection:n[2]};return n[0]!==void 0&&(B.filter=n[0]),n[1]!==void 0&&(B.sort=n[1]),M=new PE({props:B}),n[20](M),ne.push(()=>de(M,"filter",q)),ne.push(()=>de(M,"sort",j)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=D(),l=y("div"),r=W(o),a=D(),u=y("div"),F&&F.c(),f=D(),H(d.$$.fragment),p=D(),h=y("div"),g=y("button"),g.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,_=D(),R&&R.c(),v=D(),H(k.$$.fragment),$=D(),C=y("div"),T=D(),H(M.$$.fragment),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(u,"class","inline-flex gap-5"),m(g,"type","button"),m(g,"class","btn btn-outline"),m(h,"class","btns-group"),m(e,"class","page-header"),m(C,"class","clearfix m-b-base")},m(Y,Q){S(Y,e,Q),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),F&&F.m(u,null),b(u,f),V(d,u,null),b(e,p),b(e,h),b(h,g),b(h,_),R&&R.m(h,null),S(Y,v,Q),V(k,Y,Q),S(Y,$,Q),S(Y,C,Q),S(Y,T,Q),V(M,Y,Q),A=!0,P||(N=J(g,"click",n[17]),P=!0)},p(Y,Q){(!A||Q[0]&4)&&o!==(o=Y[2].name+"")&&se(r,o),Y[10]?F&&(F.d(1),F=null):F?F.p(Y,Q):(F=gh(Y),F.c(),F.m(u,f)),Y[2].$isView?R&&(R.d(1),R=null):R?R.p(Y,Q):(R=bh(Y),R.c(),R.m(h,null));const Z={};Q[0]&1&&(Z.value=Y[0]),Q[0]&4&&(Z.autocompleteCollection=Y[2]),k.$set(Z);const G={};Q[0]&4&&(G.collection=Y[2]),!O&&Q[0]&1&&(O=!0,G.filter=Y[0],_e(()=>O=!1)),!E&&Q[0]&2&&(E=!0,G.sort=Y[1],_e(()=>E=!1)),M.$set(G)},i(Y){A||(I(d.$$.fragment,Y),I(k.$$.fragment,Y),I(M.$$.fragment,Y),A=!0)},o(Y){L(d.$$.fragment,Y),L(k.$$.fragment,Y),L(M.$$.fragment,Y),A=!1},d(Y){Y&&w(e),F&&F.d(),z(d),R&&R.d(),Y&&w(v),z(k,Y),Y&&w($),Y&&w(C),Y&&w(T),n[20](null),z(M,Y),P=!1,N()}}}function jE(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=D(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,m(e,"class","m-b-10"),m(i,"type","button"),m(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=J(i,"click",n[14]),s=!0)},p:te,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function VE(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",m(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function zE(n){let e,t,i;function s(r,a){return r[10]?VE:jE}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),m(t,"class","icon"),m(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function HE(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,m(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function BE(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[RE,FE,NE],h=[];function g(C,T){return C[3]&&!C[9].length?0:C[9].length?2:1}e=g(n),t=h[e]=p[e](n);let _={};s=new du({props:_}),n[25](s);let v={};o=new NM({props:v}),n[26](o);let k={collection:n[2]};a=new T1({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let $={collection:n[2]};return f=new aE({props:$}),n[30](f),{c(){t.c(),i=D(),H(s.$$.fragment),l=D(),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment)},m(C,T){h[e].m(C,T),S(C,i,T),V(s,C,T),S(C,l,T),V(o,C,T),S(C,r,T),V(a,C,T),S(C,u,T),V(f,C,T),d=!0},p(C,T){let M=e;e=g(C),e===M?h[e].p(C,T):(ae(),L(h[M],1,1,()=>{h[M]=null}),ue(),t=h[e],t?t.p(C,T):(t=h[e]=p[e](C),t.c()),I(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const E={};o.$set(E);const A={};T[0]&4&&(A.collection=C[2]),a.$set(A);const P={};T[0]&4&&(P.collection=C[2]),f.$set(P)},i(C){d||(I(t),I(s.$$.fragment,C),I(o.$$.fragment,C),I(a.$$.fragment,C),I(f.$$.fragment,C),d=!0)},o(C){L(t),L(s.$$.fragment,C),L(o.$$.fragment,C),L(a.$$.fragment,C),L(f.$$.fragment,C),d=!1},d(C){h[e].d(C),C&&w(i),n[25](null),z(s,C),C&&w(l),n[26](null),z(o,C),C&&w(r),n[27](null),z(a,C),C&&w(u),n[30](null),z(f,C)}}}function UE(n,e,t){let i,s,l,o,r,a,u;Ze(n,fi,ee=>t(2,s=ee)),Ze(n,Mt,ee=>t(31,l=ee)),Ze(n,wo,ee=>t(3,o=ee)),Ze(n,Ca,ee=>t(13,r=ee)),Ze(n,di,ee=>t(9,a=ee)),Ze(n,Is,ee=>t(10,u=ee));const f=new URLSearchParams(r);let d,p,h,g,_,v=f.get("filter")||"",k=f.get("sort")||"",$=f.get("collectionId")||(s==null?void 0:s.id);function C(){t(11,$=s==null?void 0:s.id),t(0,v=""),t(1,k="-created"),s!=null&&s.$isView&&!U.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}Ny($);const T=()=>d==null?void 0:d.show(),M=()=>d==null?void 0:d.show(s),O=()=>_==null?void 0:_.load(),E=()=>p==null?void 0:p.show(s),A=()=>h==null?void 0:h.show(),P=ee=>t(0,v=ee.detail);function N(ee){ne[ee?"unshift":"push"](()=>{_=ee,t(8,_)})}function F(ee){v=ee,t(0,v)}function R(ee){k=ee,t(1,k)}const q=ee=>{s.$isView?g.show(ee==null?void 0:ee.detail):h==null||h.show(ee==null?void 0:ee.detail)},j=()=>h==null?void 0:h.show();function B(ee){ne[ee?"unshift":"push"](()=>{d=ee,t(4,d)})}function Y(ee){ne[ee?"unshift":"push"](()=>{p=ee,t(5,p)})}function Q(ee){ne[ee?"unshift":"push"](()=>{h=ee,t(6,h)})}const Z=()=>_==null?void 0:_.reloadLoadedPages(),G=()=>_==null?void 0:_.reloadLoadedPages();function le(ee){ne[ee?"unshift":"push"](()=>{g=ee,t(7,g)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=$&&Iy(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&$!=s.id&&C(),n.$$.dirty[0]&7&&(k||v||s!=null&&s.id)){const ee=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:v,sort:k}).toString();Vi("/collections?"+ee)}n.$$.dirty[0]&4&&ln(Mt,l=(s==null?void 0:s.name)||"Collections",l)},[v,k,s,o,d,p,h,g,_,a,u,$,i,r,T,M,O,E,A,P,N,F,R,q,j,B,Y,Q,Z,G,le]}class WE extends be{constructor(e){super(),ge(this,e,UE,BE,he,{},null,[-1,-1])}}function YE(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M,O,E,A,P,N,F;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=D(),l=y("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=y("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=y("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),d=y("a"),d.innerHTML=`<i class="ri-archive-line"></i>
<span class="txt">Backups</span>`,p=D(),h=y("div"),h.innerHTML='<span class="txt">Sync</span>',g=D(),_=y("a"),_.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,v=D(),k=y("a"),k.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,$=D(),C=y("div"),C.textContent="Authentication",T=D(),M=y("a"),M.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,O=D(),E=y("a"),E.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,A=D(),P=y("a"),P.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,m(i,"class","sidebar-title"),m(l,"href","/settings"),m(l,"class","sidebar-list-item"),m(r,"href","/settings/mail"),m(r,"class","sidebar-list-item"),m(u,"href","/settings/storage"),m(u,"class","sidebar-list-item"),m(d,"href","/settings/backups"),m(d,"class","sidebar-list-item"),m(h,"class","sidebar-title"),m(_,"href","/settings/export-collections"),m(_,"class","sidebar-list-item"),m(k,"href","/settings/import-collections"),m(k,"class","sidebar-list-item"),m(C,"class","sidebar-title"),m(M,"href","/settings/auth-providers"),m(M,"class","sidebar-list-item"),m(E,"href","/settings/tokens"),m(E,"class","sidebar-list-item"),m(P,"href","/settings/admins"),m(P,"class","sidebar-list-item"),m(t,"class","sidebar-content"),m(e,"class","page-sidebar settings-sidebar")},m(R,q){S(R,e,q),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,d),b(t,p),b(t,h),b(t,g),b(t,_),b(t,v),b(t,k),b(t,$),b(t,C),b(t,T),b(t,M),b(t,O),b(t,E),b(t,A),b(t,P),N||(F=[Oe(zn.call(null,l,{path:"/settings"})),Oe(rn.call(null,l)),Oe(zn.call(null,r,{path:"/settings/mail/?.*"})),Oe(rn.call(null,r)),Oe(zn.call(null,u,{path:"/settings/storage/?.*"})),Oe(rn.call(null,u)),Oe(zn.call(null,d,{path:"/settings/backups/?.*"})),Oe(rn.call(null,d)),Oe(zn.call(null,_,{path:"/settings/export-collections/?.*"})),Oe(rn.call(null,_)),Oe(zn.call(null,k,{path:"/settings/import-collections/?.*"})),Oe(rn.call(null,k)),Oe(zn.call(null,M,{path:"/settings/auth-providers/?.*"})),Oe(rn.call(null,M)),Oe(zn.call(null,E,{path:"/settings/tokens/?.*"})),Oe(rn.call(null,E)),Oe(zn.call(null,P,{path:"/settings/admins/?.*"})),Oe(rn.call(null,P))],N=!0)},p:te,i:te,o:te,d(R){R&&w(e),N=!1,De(F)}}}class Mi extends be{constructor(e){super(),ge(this,e,null,YE,he,{})}}function vh(n,e,t){const i=n.slice();return i[30]=e[t],i}function yh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[KE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="id",o=D(),r=y("div"),a=y("i"),f=D(),d=y("input"),m(t,"class",U.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"for",l=n[29]),m(a,"class","ri-calendar-event-line txt-disabled"),m(r,"class","form-field-addon"),m(d,"type","text"),m(d,"id",p=n[29]),d.value=h=n[1].id,d.readOnly=!0},m(v,k){S(v,e,k),b(e,t),b(e,i),b(e,s),S(v,o,k),S(v,r,k),b(r,a),S(v,f,k),S(v,d,k),g||(_=Oe(u=Be.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),g=!0)},p(v,k){k[0]&536870912&&l!==(l=v[29])&&m(e,"for",l),u&&jt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${v[1].created}
Updated: ${v[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=v[29])&&m(d,"id",p),k[0]&2&&h!==(h=v[1].id)&&d.value!==h&&(d.value=h)},d(v){v&&w(e),v&&w(o),v&&w(r),v&&w(f),v&&w(d),g=!1,_()}}}function kh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=D(),_n(t.src,i="./images/avatars/avatar"+n[30]+".svg")||m(t,"src",i),m(t,"alt","Avatar "+n[30]),m(e,"type","button"),m(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),b(e,t),b(e,s),o||(r=J(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&m(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function JE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Email",o=D(),r=y("input"),m(t,"class",U.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","email"),m(r,"autocomplete","off"),m(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),S(d,o,p),S(d,r,p),re(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&m(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&m(r,"id",a),p[0]&8&&r.value!==d[3]&&re(r,d[3])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function wh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[ZE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function ZE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=W("Change password"),m(e,"type","checkbox"),m(e,"id",t=n[29]),m(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),b(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&m(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Sh(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[GE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[XE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),H(s.$$.fragment),l=D(),o=y("div"),H(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),m(e,"class","col-12")},m(f,d){S(f,e,d),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const h={};d[0]&536871424|d[1]&4&&(h.$$scope={dirty:d,ctx:f}),r.$set(h)},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=Ve(t,rt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=Ve(t,rt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),z(s),z(r),f&&a&&a.end()}}}function GE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password",o=D(),r=y("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),S(d,o,p),S(d,r,p),re(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&m(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&m(r,"id",a),p[0]&256&&r.value!==d[8]&&re(r,d[8])},d(d){d&&w(e),d&&w(o),d&&w(r),u=!1,f()}}}function XE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=D(),s=y("span"),s.textContent="Password confirm",o=D(),r=y("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),S(d,o,p),S(d,r,p),re(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&m(e,"for",l),p
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function tD(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,h=!n[1].$isNew&&$h(n);return{c(){h&&h.c(),e=D(),t=y("button"),i=y("span"),i.textContent="Cancel",s=D(),l=y("button"),o=y("span"),a=W(r),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-transparent"),t.disabled=n[6],m(o,"class","txt"),m(l,"type","submit"),m(l,"form",n[11]),m(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(g,_){h&&h.m(g,_),S(g,e,_),S(g,t,_),b(t,i),S(g,s,_),S(g,l,_),b(l,o),b(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(g,_){g[1].$isNew?h&&(ae(),L(h,1,1,()=>{h=null}),ue()):h?(h.p(g,_),_[0]&2&&I(h,1)):(h=$h(g),h.c(),I(h,1),h.m(e.parentNode,e)),(!f||_[0]&64)&&(t.disabled=g[6]),(!f||_[0]&2)&&r!==(r=g[1].$isNew?"Create":"Save changes")&&se(a,r),(!f||_[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),(!f||_[0]&64)&&x(l,"btn-loading",g[6])},i(g){f||(I(h),f=!0)},o(g){L(h),f=!1},d(g){h&&h.d(g),g&&w(e),g&&w(t),g&&w(s),g&&w(l),d=!1,p()}}}function nD(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[tD],header:[xE],default:[QE]},$$scope:{ctx:n}};return e=new on({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){H(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[23](null),z(e,s)}}}function iD(n,e,t){let i;const s=Tt(),l="admin_"+U.randomString(5);let o,r=new rs,a=!1,u=!1,f=0,d="",p="",h="",g=!1;function _(Y){return k(Y),t(7,u=!0),o==null?void 0:o.show()}function v(){return o==null?void 0:o.hide()}function k(Y){t(1,r=Y!=null&&Y.$clone?Y.$clone():new rs),$()}function $(){t(4,g=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,h=""),tn({})}function C(){if(a||!i)return;t(6,a=!0);const Y={email:d,avatar:f};(r.$isNew||g)&&(Y.password=p,Y.passwordConfirm=h);let Q;r.$isNew?Q=ce.admins.create(Y):Q=ce.admins.update(r.id,Y),Q.then(async Z=>{var G;t(7,u=!1),v(),Ht(r.$isNew?"Successfully created admin.":"Successfully updated admin."),((G=ce.authStore.model)==null?void 0:G.id)===Z.id&&ce.authStore.save(ce.authStore.token,Z),s("save",Z)}).catch(Z=>{ce.error(Z)}).finally(()=>{t(6,a=!1)})}function T(){r!=null&&r.id&&mn("Do you really want to delete the selected admin?",()=>ce.admins.delete(r.id).then(()=>{t(7,u=!1),v(),Ht("Successfully deleted admin."),s("delete",r)}).catch(Y=>{ce.error(Y)}))}const M=()=>T(),O=()=>v(),E=Y=>t(2,f=Y);function A(){d=this.value,t(3,d)}function P(){g=this.checked,t(4,g)}function N(){p=this.value,t(8,p)}function F(){h=this.value,t(9,h)}const R=()=>i&&u?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),v()}),!1):!0;function q(Y){ne[Y?"unshift":"push"](()=>{o=Y,t(5,o)})}function j(Y){Fe.call(this,n,Y)}function B(Y){Fe.call(this,n,Y)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||g||d!==r.email||f!==r.avatar)},[v,r,f,d,g,o,a,u,p,h,i,l,C,T,_,M,O,E,A,P,N,F,R,q,j,B]}class sD extends be{constructor(e){super(),ge(this,e,iD,nD,he,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function Th(n,e,t){const i=n.slice();return i[24]=e[t],i}function lD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="id",m(t,"class",U.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function oD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="email",m(t,"class",U.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:te,d(l){l&&w(e)}}}function rD(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),s.textContent="created",m(t,"class",U.getFieldTypeIcon("da
`},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function Mh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function Oh(n){let e;return{c(){e=y("span"),e.textContent="You",m(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Eh(n,e){let t,i,s,l,o,r,a,u,f,d,p,h=e[24].id+"",g,_,v,k,$,C=e[24].email+"",T,M,O,E,A,P,N,F,R,q,j,B,Y,Q;f=new Rl({props:{value:e[24].id}});let Z=e[24].id===e[7].id&&Oh();A=new $i({props:{date:e[24].created}}),F=new $i({props:{date:e[24].updated}});function G(){return e[15](e[24])}function le(...ee){return e[16](e[24],...ee)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=D(),a=y("td"),u=y("div"),H(f.$$.fragment),d=D(),p=y("span"),g=W(h),_=D(),Z&&Z.c(),v=D(),k=y("td"),$=y("span"),T=W(C),O=D(),E=y("td"),H(A.$$.fragment),P=D(),N=y("td"),H(F.$$.fragment),R=D(),q=y("td"),q.innerHTML='<i class="ri-arrow-right-line"></i>',j=D(),_n(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||m(l,"src",o),m(l,"alt","Admin avatar"),m(s,"class","thumb thumb-sm thumb-circle"),m(i,"class","min-width"),m(p,"class","txt"),m(u,"class","label"),m(a,"class","col-type-text col-field-id"),m($,"class","txt txt-ellipsis"),m($,"title",M=e[24].email),m(k,"class","col-type-email col-field-email"),m(E,"class","col-type-date col-field-created"),m(N,"class","col-type-date col-field-updated"),m(q,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(ee,me){S(ee,t,me),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),V(f,u,null),b(u,d),b(u,p),b(p,g),b(a,_),Z&&Z.m(a,null),b(t,v),b(t,k),b(k,$),b($,T),b(t,O),b(t,E),V(A,E,null),b(t,P),b(t,N),V(F,N,null),b(t,R),b(t,q),b(t,j),B=!0,Y||(Q=[J(t,"click",G),J(t,"keydown",le)],Y=!0)},p(ee,me){e=ee,(!B||me&16&&!_n(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&m(l,"src",o);const ye={};me&16&&(ye.value=e[24].id),f.$set(ye),(!B||me&16)&&h!==(h=e[24].id+"")&&se(g,h),e[24].id===e[7].id?Z||(Z=Oh(),Z.c(),Z.m(a,null)):Z&&(Z.d(1),Z=null),(!B||me&16)&&C!==(C=e[24].email+"")&&se(T,C),(!B||me&16&&M!==(M=e[24].email))&&m($,"title",M);const Me={};me&16&&(Me.date=e[24].created),A.$set(Me);const ze={};me&16&&(ze.date=e[24].updated),F.$set(ze)},i(ee){B||(I(f.$$.fragment,ee),I(A.$$.fragment,ee),I(F.$$.fragment,ee),B=!0)},o(ee){L(f.$$.fragment,ee),L(A.$$.fragment,ee),L(F.$$.fragment,ee),B=!1},d(ee){ee&&w(t),z(f),Z&&Z.d(),z(A),z(F),Y=!1,De(Q)}}}function cD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M=[],O=new Map,E;function A(G){n[11](G)}let P={class:"col-type-text",name:"id",$$slots:{default:[lD]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),o=new un({props:P}),ne.push(()=>de(o,"sort",A));function N(G){n[12](G)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[oD]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new un({props:F}),ne.push(()=>de(u,"sort",N));function R(G){n[13](G)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[rD]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new un({props:q}),ne.push(()=>de(p,"sort",R));function j(G){n[14](G)}let B={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[aD]},$$scope:{ctx:n}};n[2]!==void 0&&(B.sort=n[2]),_=new un({props:B}),ne.push(()=>de(_,"sort",j));let Y=n[4];const Q=G=>G[24].id;for(let G=0;G<Y.length;G+=1){let le=Th(n,Y,G),ee=Q(le);O.set(ee,M[G]=Eh(ee,le))}let Z=null;return Y.length||(Z=Ch(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=D(),H(o.$$.fragment),a=D(),H(u.$$.fragment),d=D(),H(p.$$.fragment),g=D(),H(_.$$.fragment),k=D(),$=y("th"),C=D(),T=y("tbody");for(let G=0;G<M.length;G+=1)M[G].c();Z&&Z.c(),m(s,"class","min-width"),m($,"class","col-type-action min-width"),m(e,"class","table"),x(e,"table-loading",n[5])},m(G,le){S(G,e,le),b(e,t),b(t,i),b(i,s),b(i,l),V(o,i,null),b(i,a),V(u,i,null),b(i,d),V(p,i,null),b(i,g),V(_,i,null),b(i,k),b(i,$),b(e,C),b(e,T
<span class="txt">New admin</span>`,h=D(),H(g.$$.fragment),_=D(),v=y("div"),k=D(),H($.$$.fragment),C=D(),A&&A.c(),T=ke(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(f,"class","flex-fill"),m(p,"type","button"),m(p,"class","btn btn-expanded"),m(e,"class","page-header"),m(v,"class","clearfix m-b-base")},m(P,N){S(P,e,N),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),V(a,e,null),b(e,u),b(e,f),b(e,d),b(e,p),S(P,h,N),V(g,P,N),S(P,_,N),S(P,v,N),S(P,k,N),V($,P,N),S(P,C,N),A&&A.m(P,N),S(P,T,N),M=!0,O||(E=J(p,"click",n[9]),O=!0)},p(P,N){(!M||N&64)&&se(o,P[6]);const F={};N&2&&(F.value=P[1]),g.$set(F);const R={};N&134217918&&(R.$$scope={dirty:N,ctx:P}),$.$set(R),P[4].length?A?A.p(P,N):(A=Dh(P),A.c(),A.m(T.parentNode,T)):A&&(A.d(1),A=null)},i(P){M||(I(a.$$.fragment,P),I(g.$$.fragment,P),I($.$$.fragment,P),M=!0)},o(P){L(a.$$.fragment,P),L(g.$$.fragment,P),L($.$$.fragment,P),M=!1},d(P){P&&w(e),z(a),P&&w(h),z(g,P),P&&w(_),P&&w(v),P&&w(k),z($,P),P&&w(C),A&&A.d(P),P&&w(T),O=!1,E()}}}function pD(n){let e,t,i,s,l,o;e=new Mi({}),i=new Sn({props:{$$slots:{default:[dD]},$$scope:{ctx:n}}});let r={};return l=new sD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){z(e,a),a&&w(t),z(i,a),a&&w(s),n[18](null),z(l,a)}}}function mD(n,e,t){let i,s,l;Ze(n,Ca,F=>t(21,i=F)),Ze(n,Mt,F=>t(6,s=F)),Ze(n,qa,F=>t(7,l=F)),ln(Mt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){t(5,u=!0),t(4,a=[]);const F=U.normalizeSearchFilter(f,["id","email","created","updated"]);return ce.admins.getFullList(100,{sort:d||"-created",filter:F}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),h(),ce.error(R,!1))})}function h(){t(4,a=[])}const g=()=>p(),_=()=>r==null?void 0:r.show(),v=F=>t(1,f=F.detail);function k(F){d=F,t(2,d)}function $(F){d=F,t(2,d)}function C(F){d=F,t(2,d)}function T(F){d=F,t(2,d)}const M=F=>r==null?void 0:r.show(F),O=(F,R)=>{(R.code==="Enter"||R.code==="Space")&&(R.preventDefault(),r==null||r.show(F))},E=()=>t(1,f="");function A(F){ne[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>p(),N=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:d}).toString();Vi("/settings/admins?"+F),p()}},[p,f,d,r,a,u,s,l,g,_,v,k,$,C,T,M,O,E,A,P,N]}class hD extends be{constructor(e){super(),ge(this,e,mD,pD,he,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function _D(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Email"),s=D(),l=y("input"),m(e,"for",i=n[8]),m(l,"type","email"),m(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&m(e,"for",i),f&256&&o!==(o=u[8])&&m(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function gD(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=W("Password"),s=D(),l=y("input"),r=D(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",m(e,"for",i=n[8]),m(l,"type","password"),m(l,"id",o=n[8]),l.required=!0,m(u,"href","/request-password-reset"),m(u,"class","link-hint"),m(a,"class","help-block")},m(p,h){S(p,e,h),b(e,t),S(p,s,h),S(p,l,h),re(l,n[1]),S(p,r,h),S(p,a,h),b(a,u),f||(d=[J(l,"input",n[5]),Oe(rn.call(null,u))],f=!0)},p(p,h){h&256&&i!==(i=p[8])&&m(e,"for",i),h&256&&o!==(o=p[8])&&m(l,"id",o),h&2&&l.value!==p[1]&&re(l,p[1])},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),p&&w(a),f=!1,De(d)}}}function bD(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[_D,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new pe({prop
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(a,"type","submit"),m(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),m(e,"class","block")},m(p,h){S(p,e,h),b(e,t),b(e,i),V(s,e,null),b(e,l),V(o,e,null),b(e,r),b(e,a),u=!0,f||(d=J(e,"submit",tt(n[3])),f=!0)},p(p,h){const g={};h&769&&(g.$$scope={dirty:h,ctx:p}),s.$set(g);const _={};h&770&&(_.$$scope={dirty:h,ctx:p}),o.$set(_),(!u||h&4)&&x(a,"btn-disabled",p[2]),(!u||h&4)&&x(a,"btn-loading",p[2])},i(p){u||(I(s.$$.fragment,p),I(o.$$.fragment,p),u=!0)},o(p){L(s.$$.fragment,p),L(o.$$.fragment,p),u=!1},d(p){p&&w(e),z(s),z(o),f=!1,d()}}}function vD(n){let e,t;return e=new bb({props:{$$slots:{default:[bD]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function yD(n,e,t){let i;Ze(n,Ca,d=>t(6,i=d));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),ce.admins.authWithPassword(l,o).then(()=>{Fa(),Vi("/")}).catch(()=>{As("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class kD extends be{constructor(e){super(),ge(this,e,yD,vD,he,{})}}function wD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[$D,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[TD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[CD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[MD,({uniqueId:E})=>({19:E}),({uniqueId:E})=>E?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&Ah(n);return{c(){e=y("div"),t=y("div"),H(i.$$.fragment),s=D(),l=y("div"),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment),d=D(),p=y("div"),h=y("div"),g=D(),O&&O.c(),_=D(),v=y("button"),k=y("span"),k.textContent="Save changes",m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(h,"class","flex-fill"),m(k,"class","txt"),m(v,"type","submit"),m(v,"class","btn btn-expanded"),v.disabled=$=!n[3]||n[2],x(v,"btn-loading",n[2]),m(p,"class","col-lg-12 flex"),m(e,"class","grid")},m(E,A){S(E,e,A),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),V(a,e,null),b(e,u),V(f,e,null),b(e,d),b(e,p),b(p,h),b(p,g),O&&O.m(p,null),b(p,_),b(p,v),b(v,k),C=!0,T||(M=J(v,"click",n[13]),T=!0)},p(E,A){const P={};A&1572865&&(P.$$scope={dirty:A,ctx:E}),i.$set(P);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:E}),o.$set(N);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:E}),a.$set(F);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:E}),f.$set(R),E[3]?O?O.p(E,A):(O=Ah(E),O.c(),O.m(p,_)):O&&(O.d(1),O=null),(!C||A&12&&$!==($=!E[3]||E[2]))&&(v.disabled=$),(!C||A&4)&&x(v,"btn-loading",E[2])},i(E){C||(I(i.$$.fragment,E),I(o.$$.fragment,E),I(a.$$.fragment,E),I(f.$$.fragment,E),C=!0)},o(E){L(i.$$.fragment,E),L(o.$$.fragment,E),L(a.$$.fragment,E),L(f.$$.fragment,E),C=!1},d(E){E&&w(e),z(i),z(o),z(a),z(f),O&&O.d(),T=!1,M()}}}function SD(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function $D(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Application name"),s=D(),l=y("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function TD(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Application url"),s=D(),l=y("i
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=y("div"),s=y("form"),o.c(),m(e,"class","page-header"),m(s,"class","panel"),m(s,"autocomplete","off"),m(i,"class","wrapper")},m(h,g){S(h,e,g),S(h,t,g),S(h,i,g),b(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",tt(n[4])),a=!0)},p(h,g){let _=l;l=p(h),l===_?d[l].p(h,g):(ae(),L(d[_],1,1,()=>{d[_]=null}),ue(),o=d[l],o?o.p(h,g):(o=d[l]=f[l](h),o.c()),I(o,1),o.m(s,null))},i(h){r||(I(o),r=!0)},o(h){L(o),r=!1},d(h){h&&w(e),h&&w(t),h&&w(i),d[l].d(),a=!1,u()}}}function ED(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[OD]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){z(e,l),l&&w(t),z(i,l)}}}function DD(n,e,t){let i,s,l,o;Ze(n,Is,O=>t(14,s=O)),Ze(n,$o,O=>t(15,l=O)),Ze(n,Mt,O=>t(16,o=O)),ln(Mt,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const O=await ce.settings.getAll()||{};g(O)}catch(O){ce.error(O)}t(1,u=!1)}async function h(){if(!(f||!i)){t(2,f=!0);try{const O=await ce.settings.update(U.filterRedactedProps(a));g(O),Ht("Successfully saved application settings.")}catch(O){ce.error(O)}t(2,f=!1)}}function g(O={}){var E,A;ln($o,l=(E=O==null?void 0:O.meta)==null?void 0:E.appName,l),ln(Is,s=!!((A=O==null?void 0:O.meta)!=null&&A.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function _(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function v(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function $(){a.logs.maxDays=pt(this.value),t(0,a)}function C(){a.meta.hideControls=this.checked,t(0,a)}const T=()=>_(),M=()=>h();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,h,_,r,d,v,k,$,C,T,M]}class AD extends be{constructor(e){super(),ge(this,e,DD,ED,he,{})}}function ID(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=je(l,s[o]);return{c(){e=y("input"),ai(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){ai(e,l=Ot(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function LD(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=je(a,r[u]);return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=y("input"),m(t,"type","button"),m(t,"class","btn btn-transparent btn-circle"),m(e,"class","form-field-addon"),ai(s,a)},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[Oe(Be.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ai(s,a=Ot(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,De(o)}}}function PD(n){let e;function t(l,o){return l[3]?LD:ID}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:te,o:te,d(l){s.d(l),l&&w(e)}}}function ND(n,e,t){const i=["value","mask"];let s=et(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await cn(),r==null||r.focus()}const f=()=>u();function d(h){ne[h?"unshift":"push"](()=>{r=h,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=h=>{e=je(je({},e),Gt(h)),t(5,s=et(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,d,p]}class hu extends be{constructor(e){super(),ge(this,e,ND,PD,he,{value:0,mask:1})}}function FD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;return{c(){e=y("label"),t=W("Subject"),s=D(),l=y("input"),r=D(),a=y("div"),u=W(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=W(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,h=W("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(p,"type","button"),m(p,"class","label label-sm link-primary txt-mono"),m(a,"class","help-block")},m(v,k){S(v,e,k),b(e,t),S(v,s,k),S(v,l,k),re(l,n[0].subject),S(v,r,k),S(v,a,k),b(a,u),b(a,f),b(a,d),b(a,p),b(a,h),g||(_=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],g=!0)},p(v,k){k[1]&1&&i!==(i=v[31])&&m(e,"for",i),k[1]&1&&o!==(o=v[31])&&m(l,"id",o),k[0]&1&&l.value!==v[0].subject&&re(l,v[0].subject)},d(v){v&&w(e),v&&w(s),v&&w(l),v&&w(r),v&&w(a),g=!1,De(_)}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k;return{c(){e=y("label"),t=W("Action URL"),s=D(),l=y("input"),r=D(),a=y("div"),u=W(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=W(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,h=W(`,
`),g=y("button"),g.textContent=`{TOKEN}
`,_=W("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(p,"type","button"),m(p,"class","label label-sm link-primary txt-mono"),m(g,"type","button"),m(g,"class","label label-sm link-primary txt-mono"),m(g,"title","Required parameter"),m(a,"class","help-block")},m($,C){S($,e,C),b(e,t),S($,s,C),S($,l,C),re(l,n[0].actionUrl),S($,r,C),S($,a,C),b(a,u),b(a,f),b(a,d),b(a,p),b(a,h),b(a,g),b(a,_),v||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(g,"click",n[19])],v=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&m(e,"for",i),C[1]&1&&o!==(o=$[31])&&m(l,"id",o),C[0]&1&&l.value!==$[0].actionUrl&&re(l,$[0].actionUrl)},d($){$&&w(e),$&&w(s),$&&w(l),$&&w(r),$&&w(a),v=!1,De(k)}}}function qD(n){let e,t,i,s;return{c(){e=y("textarea"),m(e,"id",t=n[31]),m(e,"class","txt-mono"),m(e,"spellcheck","false"),m(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),re(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&m(e,"id",t),o[0]&1&&re(e,l[0].body)},i:te,o:te,d(l){l&&w(e),i=!1,s()}}}function jD(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Rt(o,r(n)),ne.push(()=>de(e,"value",l))),{c(){e&&H(e.$$.fragment),i=ke()},m(a,u){e&&V(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,_e(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{z(d,1)}),ue()}o?(e=Rt(o,r(a)),ne.push(()=>de(e,"value",l)),H(e.$$.fragment),I(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&z(e,a)}}}function VD(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T;const M=[jD,qD],O=[];function E(A,P){return A[4]&&!A[5]?0:1}return l=E(n),o=O[l]=M[l](n),{c(){e=y("label"),t=W("Body (HTML)"),s=D(),o.c(),r=D(),a=y("div"),u=W(`Available placeholder parameters:
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=W(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,h=W(`,
`),g=y("button"),g.textContent=`{TOKEN}
`,_=W(`,
`),v=y("button"),v.textContent=`{ACTION_URL}
`,k=W("."),m(e,"for",i=n[31]),m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(p,"type","button"),m(p,"class","label label-sm link-primary txt-mono"),m(g,"type","button"),m(g,"class","label label-sm link-primary txt-mono"),m(v,"type","button"),m(v,"class","label label-sm link-primary txt-mono"),m(v,"title","Required parameter"),m(a,"class","help-block")},m(A,P){S(A,e,P),b(e,t),S(A,s,P),O[l].m(A,P),S(A,r,P),S(A,a,P),b(a,u),b(a,f),b(a,d),b(a,p),b(a,h),b(a,g),b(a,_),b(a,v),b(a,k),$=!0,C||(T=[J(f,"click",n[22]),J(p,"click",n[23]),J(g,"click",n[24]),J(v,"click",n[25])],C=!0)},p(A,P){(!$||P[1]&1&&i!==(i=A[31]))&&m(e,"for",i);let N=l;l=E(A),l===N?O[l].p(A,P):(ae(),L(O[N],1,1,()=>{O[N]=null}),ue(),o=O[l],o?o.p(A,P):(o=O[l]=M[l](A),o.c()),I(o,1),o.m(r.parentNode,r))},i(A){$||(I(o),$=!0)},o(A){L(o),$=!1},d(A){A&&w(e),A&&w(s),O[l].d(A),A&&w(r),A&&w(a),C=!1,De(T)}}}function zD(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[FD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[RD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[VD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(r,a){V(e,r,a),S(r,t,a),V(i,r,a),S(r,s,a),V(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){z(e,r),r&&w(t),z(i,r),r&&w(s),z(l,r)}}}function Ih(n){let e,t,i,s,l;return{c(){e=y("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=Oe(Be.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function HD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Ih();return{c(){e=y("div"),t=y("i"),i=D(),s=y("span"),l=W(n[2]),o=D(),r=y("div"),a=D(),f&&f.c(),u=ke(),m(t,"class","ri-draft-line"),m(s,"class","txt"),m(e,"class","inline-flex"),m(r,"class","flex-fill")},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),b(s,l),S(d,o,p),S(d,r,p),S(d,a,p),f&&f.m(d,p),S(d,u,p)},p(d,p){p[0]&4&&se(l,d[2]),d[6]?f?p[0]&64&&I(f,1):(f=Ih(),f.c(),I(f,1),f.m(u.parentNode,u)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(d){d&&w(e),d&&w(o),d&&w(r),d&&w(a),f&&f.d(d),d&&w(u)}}}function BD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[HD],default:[zD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=je(s,i[l]);return e=new po({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){H(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){const r=o[0]&256?Ot(i,[Qt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[26](null),z(e,l)}}}let Lh;function UD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=et(e,s),o;Ze(n,Ti,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=Lh,p=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function v(){d||p||(t(5,p=!0),t(4,d=(await ut(()=>import("./CodeEditor-2dc6de7d.js"),["./CodeEditor-2dc6de7d.js","./index-8b57b6cd.js"],import.meta.url)).default),Lh=d,t(5,p=!1))}function k(G){U.copyToClipboard(G),ko(`Copied ${G} to clipboard`,2e3)}v();function $(){u.subject=this.value,t(0,u)}const C=()=>k("{APP_NAME}"),T=()=>k("{APP_URL}");function M(){u.action
<span class="txt">Send test email</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded btn-outline")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function cA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),l.textContent="Save changes",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),b(s,l),r||(a=[J(e,"click",n[24]),J(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,De(a)}}}function dA(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v;const k=[eA,xD],$=[];function C(T,M){return T[2]?0:1}return p=C(n),h=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=W(n[5]),r=D(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",d=D(),h.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(T,M){S(T,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(T,r,M),S(T,a,M),b(a,u),b(u,f),b(u,d),$[p].m(u,null),g=!0,_||(v=J(u,"submit",tt(n[27])),_=!0)},p(T,M){(!g||M[0]&32)&&se(o,T[5]);let O=p;p=C(T),p===O?$[p].p(T,M):(ae(),L($[O],1,1,()=>{$[O]=null}),ue(),h=$[p],h?h.p(T,M):(h=$[p]=k[p](T),h.c()),I(h,1),h.m(u,null))},i(T){g||(I(h),g=!0)},o(T){L(h),g=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),_=!1,v()}}}function pA(n){let e,t,i,s,l,o;e=new Mi({}),i=new Sn({props:{$$slots:{default:[dA]},$$scope:{ctx:n}}});let r={};return l=new QD({props:r}),n[28](l),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){z(e,a),a&&w(t),z(i,a),a&&w(s),n[28](null),z(l,a)}}}function mA(n,e,t){let i,s,l;Ze(n,Mt,Z=>t(5,l=Z));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];ln(Mt,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;h();async function h(){t(2,d=!0);try{const Z=await ce.settings.getAll()||{};_(Z)}catch(Z){ce.error(Z)}t(2,d=!1)}async function g(){if(!(p||!s)){t(3,p=!0);try{const Z=await ce.settings.update(U.filterRedactedProps(f));_(Z),tn({}),Ht("Successfully saved mail settings.")}catch(Z){ce.error(Z)}t(3,p=!1)}}function _(Z={}){t(0,f={meta:(Z==null?void 0:Z.meta)||{},smtp:(Z==null?void 0:Z.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function v(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function k(){f.meta.senderName=this.value,t(0,f)}function $(){f.meta.senderAddress=this.value,t(0,f)}function C(Z){n.$$.not_equal(f.meta.verificationTemplate,Z)&&(f.meta.verificationTemplate=Z,t(0,f))}function T(Z){n.$$.not_equal(f.meta.resetPasswordTemplate,Z)&&(f.meta.resetPasswordTemplate=Z,t(0,f))}function M(Z){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,Z)&&(f.meta.confirmEmailChangeTemplate=Z,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function E(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=pt(this.value),t(0,f)}function P(Z){n.$$.not_equal(f.smtp.tls,Z)&&(f.smtp.tls=Z,t(0,f))}function N(Z){n.$$.not_equal(f.smtp.authMethod,Z)&&(f.smtp.authMethod=Z,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function R(Z){n.$$.not_equal(f.smtp.password,Z)&&(f.smtp.password=Z,t(0,f))}const q=()=>v(),j=()=>g(),B=()=>a==null?void 0:a.show(),Y=()=>g();function Q(Z){ne[Z?"unshift":"push"](
from the
`),r=y("strong"),u=W(a),f=W(`
to the
`),d=y("strong"),h=W(p),g=W(`.
`),_=y("br"),v=W(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
`,$=W(`,
`),C=y("a"),C.textContent=`s5cmd
`,T=W(", etc."),M=D(),O=y("div"),m(i,"class","icon"),m(k,"href","https://github.com/rclone/rclone"),m(k,"target","_blank"),m(k,"rel","noopener noreferrer"),m(k,"class","txt-bold"),m(C,"href","https://github.com/peak/s5cmd"),m(C,"target","_blank"),m(C,"rel","noopener noreferrer"),m(C,"class","txt-bold"),m(l,"class","content"),m(t,"class","alert alert-warning m-0"),m(O,"class","clearfix m-t-base")},m(N,F){S(N,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,d),b(d,h),b(l,g),b(l,_),b(l,v),b(l,k),b(l,$),b(l,C),b(l,T),b(e,M),b(e,O),A=!0},p(N,F){var R;(!A||F&1)&&a!==(a=(R=N[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&se(u,a),(!A||F&2)&&p!==(p=N[1].s3.enabled?"S3 storage":"local file system")&&se(h,p)},i(N){A||(N&&xe(()=>{A&&(E||(E=Ve(e,rt,{duration:150},!0)),E.run(1))}),A=!0)},o(N){N&&(E||(E=Ve(e,rt,{duration:150},!1)),E.run(0)),A=!1},d(N){N&&w(e),N&&E&&E.end()}}}function OA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Vh(n);return{c(){t&&t.c(),e=ke()},m(s,l){t&&t.m(s,l),S(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&I(t,1)):(t=Vh(s),t.c(),I(t,1),t.m(e.parentNode,e)):t&&(ae(),L(t,1,1,()=>{t=null}),ue())},d(s){t&&t.d(s),s&&w(e)}}}function zh(n){let e;function t(l,o){return l[4]?AA:l[5]?DA:EA}let i=t(n),s=i(n);return{c(){s.c(),e=ke()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function EA(n){let e;return{c(){e=y("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function DA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Oe(t=Be.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function AA(n){let e;return{c(){e=y("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function Hh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Reset",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),b(e,t),i||(s=J(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function IA(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v;const k=[MA,CA],$=[];function C(T,M){return T[2]?0:1}return p=C(n),h=$[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=W(n[7]),r=D(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,d=D(),h.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(T,M){S(T,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(T,r,M),S(T,a,M),b(a,u),b(u,f),b(u,d),$[p].m(u,null),g=!0,_||(v=J(u,"submit",tt(n[16])),_=!0)},p(T,M){(!g||M&128)&&se(o,T[7]);let O=p;p=C(T),p===O?$[p].p(T,M):(ae(),L($[O],1,1,()=>{$[O]=null}),ue(),h=$[p],h?h.p(T,M):(h=$[p]=k[p](T),h.c()),I(h,1),h.m(u,null))},i(T){g||(I(h),g=!0)},o(T){L(h),g=!1},d(T){T&&w(e),T&&w(r),T&&w(a),$[p].d(),_=!1,v()}}}function LA(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[IA]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){z(e,l),l&&w(t),z(i,l)}}}const PA="s3_test_request";function NA(n,e,t){let i,s,l;Ze(n,Mt,O=>t(7,l=O)),ln(Mt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null;p();async function p(){t(2,a=!0);try{const O=await ce.settings.getAll()||{};g(O)}catch(O){ce.error(O)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{ce.cancelRequest(PA);const O=await ce.settings.update(U.filterRedactedProps(r));tn({}),await g(O),Fa(),d?Ay("Successfully saved but failed to establish S3 connection."):Ht("Successfully saved files storage settings.")}catch(O){ce.error(O)}t(3,u=!1)}}async function g(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 v(O){n.$$.not_equal(r.s3,O)&&(r.s3=O,t(1,r))}function k(O){f=O,t(4,f)}function $(O){d=O,t(5,d)}const C=()=>_(),T=()=>h(),M=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,d,s,l,h,_,i,v,k,$,C,T,M]}class FA extends be{constructor(e){super(),ge(this,e,NA,LA,he,{})}}function RA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=D(),s=y("label"),l=W("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[20]),m(s,"for",o=n[20])},m(u,f){S(u,e,f),e.checked=n[1].enabled,S(u,i,f),S(u,s,f),b(s,l),r||(a=J(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&m(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function qA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=W("Client ID"),s=D(),l=y("input"),m(e,"for",i=n[20]),m(l,"type","text"),m(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,d){S(f,e,d),b(e,t),S(f,s,d),S(f,l,d),re(l,n[1].clientId),a||(u=J(l,"input",n[12]),a=!0)},p(f,d){d&1048576&&i!==(i=f[20])&&m(e,"for",i),d&1048576&&o!==(o=f[20])&&m(l,"id",o),d&2&&r!==(r=f[1].enabled)&&(l.required=r),d&2&&l.value!==f[1].clientId&&re(l,f[1].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function jA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new hu({props:u}),ne.push(()=>de(l,"value",a)),{c(){e=y("label"),t=W("Client secret"),s=D(),H(l.$$.fragment),m(e,"for",i=n[20])},m(f,d){S(f,e,d),b(e,t),S(f,s,d),V(l,f,d),r=!0},p(f,d){(!r||d&1048576&&i!==(i=f[20]))&&m(e,"for",i);const p={};d&1048576&&(p.id=f[20]),d&2&&(p.required=f[1].enabled),!o&&d&2&&(o=!0,p.value=f[1].clientSecret,_e(()=>o=!1)),l.$set(p)},i(f){r||(I(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&w(e),f&&w(s),z(l,f)}}}function Bh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Rt(o,r(n)),ne.push(()=>de(t,"config",l))),{c(){e=y("div"),t&&H(t.$$.fragment),m(e,"class","col-lg-12")},m(a,u){S(a,e,u),t&&V(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[
another PocketBase environment.</p>`,t=D(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),H(o.$$.fragment),r=D(),a=y("div"),u=y("div"),f=D(),d=y("button"),d.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,m(e,"class","content txt-xl m-b-base"),m(s,"type","button"),m(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),m(i,"tabindex","0"),m(i,"class","export-preview svelte-jm5c4z"),m(u,"class","flex-fill"),m(d,"type","button"),m(d,"class","btn btn-expanded"),m(a,"class","flex m-t-base")},m(_,v){S(_,e,v),S(_,t,v),S(_,i,v),b(i,s),b(i,l),V(o,i,null),n[8](i),S(_,r,v),S(_,a,v),b(a,u),b(a,f),b(a,d),p=!0,h||(g=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],h=!0)},p(_,v){const k={};v&4&&(k.content=_[2]),o.$set(k)},i(_){p||(I(o.$$.fragment,_),p=!0)},o(_){L(o.$$.fragment,_),p=!1},d(_){_&&w(e),_&&w(t),_&&w(i),z(o),n[8](null),_&&w(r),_&&w(a),h=!1,De(g)}}}function fI(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function cI(n){let e,t,i,s,l,o,r,a,u,f,d,p;const h=[fI,uI],g=[];function _(v,k){return v[1]?0:1}return f=_(n),d=g[f]=h[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=W(n[3]),r=D(),a=y("div"),u=y("div"),d.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(v,k){S(v,e,k),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(v,r,k),S(v,a,k),b(a,u),g[f].m(u,null),p=!0},p(v,k){(!p||k&8)&&se(o,v[3]);let $=f;f=_(v),f===$?g[f].p(v,k):(ae(),L(g[$],1,1,()=>{g[$]=null}),ue(),d=g[f],d?d.p(v,k):(d=g[f]=h[f](v),d.c()),I(d,1),d.m(u,null))},i(v){p||(I(d),p=!0)},o(v){L(d),p=!1},d(v){v&&w(e),v&&w(r),v&&w(a),g[f].d()}}}function dI(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[cI]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){z(e,l),l&&w(t),z(i,l)}}}function pI(n,e,t){let i,s;Ze(n,Mt,v=>t(3,s=v)),ln(Mt,s="Export collections",s);const l="export_"+U.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await ce.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let v of r)delete v.created,delete v.updated}catch(v){ce.error(v)}t(1,a=!1)}function f(){U.downloadJson(r,"pb_schema")}function d(){U.copyToClipboard(i),ko("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function h(v){ne[v?"unshift":"push"](()=>{o=v,t(0,o)})}const g=v=>{if(v.ctrlKey&&v.code==="KeyA"){v.preventDefault();const k=window.getSelection(),$=document.createRange();$.selectNodeContents(o),k.removeAllRanges(),k.addRange($)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,h,g,_]}class mI extends be{constructor(e){super(),ge(this,e,pI,dI,he,{})}}function n_(n,e,t){const i=n.slice();return i[14]=e[t],i}function i_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function s_(n,e,t){const i=n.slice();return i[14]=e[t],i}function l_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function o_(n,e,t){const i=n.slice();return i[14]=e[t],i}function r_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function a_(n,e,t){const i=n.slice();return i[30]=e[t],i}function hI(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&u_(),a=n[0].name!==n[1].name&&f_(n);return{c(){e=y("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=y("strong"),o=W(l),m(s,"class","txt"),m(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=u_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=f_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function _I(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=D(),i=y("strong"),l=W(s),m(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=y("tbody");for(let T=0;T<g.length;T+=1)g[T].c();r=D(),_&&_.c(),a=D();for(let T=0;T<k.length;T+=1)k[T].c();u=D();for(let T=0;T<C.length;T+=1)C[T].c();m(e,"class","section-title"),m(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(T,M){S(T,e,M),p.m(e,null),S(T,t,M),S(T,i,M),b(i,s),b(i,l),b(i,o);for(let O=0;O<g.length;O+=1)g[O]&&g[O].m(o,null);b(o,r),_&&_.m(o,null),b(o,a);for(let O=0;O<k.length;O+=1)k[O]&&k[O].m(o,null);b(o,u);for(let O=0;O<C.length;O+=1)C[O]&&C[O].m(o,null)},p(T,M){if(d===(d=f(T))&&p?p.p(T,M):(p.d(1),p=d(T),p&&(p.c(),p.m(e,null))),M[0]&7203){h=T[11];let O;for(O=0;O<h.length;O+=1){const E=a_(T,h,O);g[O]?g[O].p(E,M):(g[O]=c_(E),g[O].c(),g[O].m(o,r))}for(;O<g.length;O+=1)g[O].d(1);g.length=h.length}if(T[2]||T[5]?_?_.p(T,M):(_=d_(T),_.c(),_.m(o,a)):_&&(_.d(1),_=null),M[0]&4248){v=T[7];let O;for(O=0;O<v.length;O+=1){const E=s_(T,v,O);k[O]?k[O].p(E,M):(k[O]=g_(E),k[O].c(),k[O].m(o,u))}for(;O<k.length;O+=1)k[O].d(1);k.length=v.length}if(M[0]&4352){$=T[8];let O;for(O=0;O<$.length;O+=1){const E=n_(T,$,O);C[O]?C[O].p(E,M):(C[O]=v_(E),C[O].c(),C[O].m(o,null))}for(;O<C.length;O+=1)C[O].d(1);C.length=$.length}},i:te,o:te,d(T){T&&w(e),p.d(),T&&w(t),T&&w(i),ht(g,T),_&&_.d(),ht(k,T),ht(C,T)}}}function Hn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function bn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function vI(n,e,t){let i,s,l,{collectionA:o=new kn}=e,{collectionB:r=new kn}=e,{deleteMissing:a=!1}=e,u=[],f=[],d=[],p=[],h=[];const g=Object.keys(new kn().$export()).filter(k=>!["schema","created","updated"].includes(k));function _(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find($=>k.id==$.id))))}function v(k){return typeof k>"u"?"":U.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&_(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find($=>k.id==$.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find($=>$.id==k.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(k=>!u.find($=>$.id==k.id))),n.$$.dirty[0]&7&&t(9,l=U.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,h,l,s,g,v]}class yI extends be{constructor(e){super(),ge(this,e,vI,bI,he,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function y_(n,e,t){const i=n.slice();return i[17]=e[t],i}function k_(n){let e,t;return e=new yI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){H(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function kI(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=k_(y_(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ke()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=y_(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=k_(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){ht(s,o),o&&w(e)}}}function wI(n){let e;return{c(){e=y("h4"),e.textContent="Side-by-side diff",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function SI(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=W("Close"),i=D(),s=y("button"),l=y("span"),l.textContent="Confirm and import",m(e,"type","button"),m(e,"class","btn bt
- ${T.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await ce.collections.import(o,a),Ht("Successfully imported collections configuration."),i("submit")}catch(T){ce.error(T)}t(4,u=!1),d()}}const _=()=>h(),v=()=>!u;function k(T){ne[T?"unshift":"push"](()=>{s=T,t(1,s)})}function $(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,h,f,l,o,_,v,k,$,C]}class CI extends be{constructor(e){super(),ge(this,e,TI,$I,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function w_(n,e,t){const i=n.slice();return i[32]=e[t],i}function S_(n,e,t){const i=n.slice();return i[35]=e[t],i}function $_(n,e,t){const i=n.slice();return i[32]=e[t],i}function MI(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M,O,E;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[EI,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let A=!1,P=n[6]&&n[1].length&&!n[7]&&C_(),N=n[6]&&n[1].length&&n[7]&&M_(n),F=n[13].length&&q_(n),R=!!n[0]&&j_(n);return{c(){e=y("input"),t=D(),i=y("div"),s=y("p"),l=W(`Paste below the collections configuration you want to import or
`),o=y("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),H(a.$$.fragment),u=D(),f=D(),P&&P.c(),d=D(),N&&N.c(),p=D(),F&&F.c(),h=D(),g=y("div"),R&&R.c(),_=D(),v=y("div"),k=D(),$=y("button"),C=y("span"),C.textContent="Review",m(e,"type","file"),m(e,"class","hidden"),m(e,"accept",".json"),m(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),m(i,"class","content txt-xl m-b-base"),m(v,"class","flex-fill"),m(C,"class","txt"),m($,"type","button"),m($,"class","btn btn-expanded btn-warning m-l-auto"),$.disabled=T=!n[14],m(g,"class","flex m-t-base")},m(q,j){S(q,e,j),n[19](e),S(q,t,j),S(q,i,j),b(i,s),b(s,l),b(s,o),S(q,r,j),V(a,q,j),S(q,u,j),S(q,f,j),P&&P.m(q,j),S(q,d,j),N&&N.m(q,j),S(q,p,j),F&&F.m(q,j),S(q,h,j),S(q,g,j),R&&R.m(g,null),b(g,_),b(g,v),b(g,k),b(g,$),b($,C),M=!0,O||(E=[J(e,"change",n[20]),J(o,"click",n[21]),J($,"click",n[26])],O=!0)},p(q,j){(!M||j[0]&4096)&&x(o,"btn-loading",q[12]);const B={};j[0]&64&&(B.class="form-field "+(q[6]?"":"field-error")),j[0]&65|j[1]&1536&&(B.$$scope={dirty:j,ctx:q}),a.$set(B),q[6]&&q[1].length&&!q[7]?P||(P=C_(),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),q[6]&&q[1].length&&q[7]?N?N.p(q,j):(N=M_(q),N.c(),N.m(p.parentNode,p)):N&&(N.d(1),N=null),q[13].length?F?F.p(q,j):(F=q_(q),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),q[0]?R?R.p(q,j):(R=j_(q),R.c(),R.m(g,_)):R&&(R.d(1),R=null),(!M||j[0]&16384&&T!==(T=!q[14]))&&($.disabled=T)},i(q){M||(I(a.$$.fragment,q),I(A),M=!0)},o(q){L(a.$$.fragment,q),L(A),M=!1},d(q){q&&w(e),n[19](null),q&&w(t),q&&w(i),q&&w(r),z(a,q),q&&w(u),q&&w(f),P&&P.d(q),q&&w(d),N&&N.d(q),q&&w(p),F&&F.d(q),q&&w(h),q&&w(g),R&&R.d(),O=!1,De(E)}}}function OI(n){let e;return{c(){e=y("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:te,i:te,o:te,d(t){t&&w(e)}}}function T_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",m(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function EI(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&T_();return{c(){e=y("label"),t=W("Collections"),s=D(),l=y("textarea"),r=D(),d&&d.c(),a=ke(),m(e,"for",i=n[40]),m(e,"class","p-b-10"),m(l,"id",o=n[40]),m(l,"class","code"),m(l,"spellcheck","false"),m(l,"rows","15"),l.required=!0},m(p,h){S(p,e,h),b(e,t),S(p,s,h),S(p,l,h),re(l,n[0]),S(p,r,h),d&&d.m(p,h),S(p,a,h),u||(f=J(l,"input",n[22]),u=!0)},p(p,h){h[1]&512&&i!==(i=p[40])&&m(e,"for",i),h[1]&512&&o!==(o=p[40])&&m(l,"id",o),h[0]&1&&re(l,p[0]),p[0]&&!p[6]?d||(d=T_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&w(e),p&&w(s),p&&w(l),p&&w(r),d&&d.d(p),p&&w(a),u=!1,f()}}}function C_(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,m(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function M_(n){let e,t,i,s,l,o=n[9].length&&O_(n),r=n[4].length&&A_(n),a=n[8].length&&N_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=D(),i=y("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),m(e,"class","section-title"),m(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=O_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=A_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=N_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function O_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=$_(n,s,o),a=l(r);t.set(a,e[o]=D_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=vt(e,r,l,1,o,s,t,i.parentNode,us,D_,i,$_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function E_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=W("("),s=W(i),l=W(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&se(s,i)},d(o){o&&w(e)}}}function D_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&E_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=D(),l=y("strong"),r=W(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-danger list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(d,p){S(d,t,p),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(d,p){e=d,p[0]&512&&o!==(o=e[32].name+"")&&se(r,o),e[32].id?f?f.p(e,p):(f=E_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&w(t),f&&f.d()}}}function A_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=S_(n,s,o),a=l(r);t.set(a,e[o]=P_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=vt(e,r,l,1,o,s,t,i.parentNode,us,P_,i,S_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function I_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=y("strong"),i=W(t),s=D(),l=y("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&se(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function L_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=W("("),s=W(i),l=W(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&se(s,i)},d(o){o&&w(e)}}}function P_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,d,p=e[35].old.name!==e[35].new.name&&I_(e),h=e[35].new.id&&L_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Changed",s=D(),l=y("div"),p&&p.c(),o=D(),r=y("strong"),u=W(a),f=D(),h&&h.c(),d=D(),m(i,"class","label label-warning list-label svelte-1jx20fl"),m(l,"class","inline-flex flex-gap-5"),m(t,"class","list-item"),this.first=t},m(g,_){S(g,t,_),b(t,i),b(t,s),b(t,l),p&&p.m(l,null),b(l,o),b(l,r),b(r,u),b(l,f),h&&h.m(l,null),b(t,d)},p(g,_){e=g,e[35].old.name!==e[35].new.name?p?p.p(e,_):(p=I_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),_[0]&16&&a!==(a=e[35].new.name+"")&&se(u,a),e[35].new.id?h?h.p(e,_):(h=L_(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(g){g&&w(t),p&&p.d(),h&&h.d()}}}function N_(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=w_(n,s,o),a=l(r);t.set(a,e[o]=R_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ke()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=vt(e,r,l,1,o,s,t,i.parentNode,us,R_,i,w_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function F_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=W("("),s=W(i),l=W(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=y("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',m(t,"class","icon"),m(s,"class","content"),m(o,"type","button"),m(o,"class","btn btn-warning btn-sm btn-outline"),m(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:te,d(u){u&&w(e),r=!1,a()}}}function j_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:te,d(s){s&&w(e),t=!1,i()}}}function DI(n){let e,t,i,s,l,o,r,a,u,f,d,p;const h=[OI,MI],g=[];function _(v,k){return v[5]?0:1}return f=_(n),d=g[f]=h[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=W(n[15]),r=D(),a=y("div"),u=y("div"),d.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(v,k){S(v,e,k),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(v,r,k),S(v,a,k),b(a,u),g[f].m(u,null),p=!0},p(v,k){(!p||k[0]&32768)&&se(o,v[15]);let $=f;f=_(v),f===$?g[f].p(v,k):(ae(),L(g[$],1,1,()=>{g[$]=null}),ue(),d=g[f],d?d.p(v,k):(d=g[f]=h[f](v),d.c()),I(d,1),d.m(u,null))},i(v){p||(I(d),p=!0)},o(v){L(d),p=!1},d(v){v&&w(e),v&&w(r),v&&w(a),g[f].d()}}}function AI(n){let e,t,i,s,l,o;e=new Mi({}),i=new Sn({props:{$$slots:{default:[DI]},$$scope:{ctx:n}}});let r={};return l=new CI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment),s=D(),H(l.$$.fragment)},m(a,u){V(e,a,u),S(a,t,u),V(i,a,u),S(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){z(e,a),a&&w(t),z(i,a),a&&w(s),n[27](null),z(l,a)}}}function II(n,e,t){let i,s,l,o,r,a,u;Ze(n,Mt,G=>t(15,u=G)),ln(Mt,u="Import collections",u);let f,d,p="",h=!1,g=[],_=[],v=!0,k=[],$=!1;C();async function C(){t(5,$=!0);try{t(2,_=await ce.collections.getFullList(200));for(let G of _)delete G.created,delete G.updated}catch(G){ce.error(G)}t(5,$=!1)}function T(){if(t(4,k=[]),!!i)for(let G of g){const le=U.findByKey(_,"id",G.id);!(le!=null&&le.id)||!U.hasCollectionChanges(le,G,v)||k.push({new:G,old:le})}}function M(){t(1,g=[]);try{t(1,g=JSON.parse(p))}catch{}Array.isArray(g)?t(1,g=U.filterDuplicatesByKey(g)):t(1,g=[]);for(let G of g)delete G.created,delete G.updated,G.schema=U.filterDuplicatesByKey(G.schema)}function O(){var G,le;for(let ee of g){const me=U.findByKey(_,"name",ee.name)||U.findByKey(_,"id",ee.id);if(!me)continue;const ye=ee.id,Me=me.id;ee.id=Me;const ze=Array.isArray(me.schema)?me.schema:[],Ue=Array.isArray(ee.schema)?ee.schema:[];for(const we of Ue){const Ce=U.findByKey(ze,"name",we.name);Ce&&Ce.id&&(we.id=Ce.id)}for(let we of g)if(Array.isArray(we.schema))for(let Ce of we.schema)(G=Ce.options)!=null&&G.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===ye&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(g,null,4))}function E(G){t(12,h=!0);const le=new FileReader;le.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,p=ee.target.result),await cn(),g.length||(As("Invalid collections configuration."),A())},le.onerror=ee=>{console.warn(ee),As("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},le.readAsText(G)}function A(){t(0,p=""),t(10,f.value="",f),tn({})}function P(G){ne[G?"unshift":"push"](()=>{f=G,t(10,f)})}const N=()=>{f.files.length&&E(f.files[0])},F=()=>{f.click()};function R(){p=this.value,t(0,p)}function q(){v=this.checked,t(3,v)}const j=()=>O(),B=()=>A(),Y=()=>d==null?void 0:d.show(_,g,v);function Q(G){ne[G?"unshift":"push"](()=>{d=G,t(11,d)})}const Z=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!p&&g.length&&g.length===g.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=_.filter(G=>i&&v&&!U.findByKey(g,"id",G.i
2023-05-22 06:59:56 +02:00
<div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
database will be temporary &quot;locked&quot; (this usually happens only during the ZIP generation).</p>
<p class="txt-bold">If you are using S3 storage for the collections file upload, you&#39;ll have to backup them
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=D(),i=y("form"),H(s.$$.fragment),m(e,"class","alert alert-info"),m(i,"id",n[4]),m(i,"autocomplete","off")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),V(s,i,null),l=!0,o||(r=J(i,"submit",tt(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(I(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&w(e),a&&w(t),a&&w(i),z(s),o=!1,r()}}}function FI(n){let e;return{c(){e=y("h4"),e.textContent="Initialize new backup",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function RI(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=D(),s=y("button"),l=y("span"),l.textContent="Start backup",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[4]),m(s,"class","btn btn-expanded"),s.disabled=n[3],x(s,"btn-loading",n[3])},m(a,u){S(a,e,u),b(e,t),S(a,i,u),S(a,s,u),b(s,l),o||(r=J(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&x(s,"btn-loading",a[3])},d(a){a&&w(e),a&&w(i),a&&w(s),o=!1,r()}}}function qI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[RI],header:[FI],default:[NI]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){H(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),z(e,s)}}}function jI(n,e,t){const i=Tt(),s="backup_create_"+U.randomString(5);let l,o="",r=!1,a;function u($){tn({}),t(3,r=!1),t(2,o=$||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function d(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await ce.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),Ht("Successfully generated new backup.")}catch($){$.isAbort||ce.error($)}clearTimeout(a),t(3,r=!1)}}Vo(()=>{clearTimeout(a)});function p(){o=this.value,t(2,o)}const h=()=>r?(ko("A backup has already been started, please wait."),!1):!0,g=()=>(r&&ko("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _($){ne[$?"unshift":"push"](()=>{l=$,t(1,l)})}function v($){Fe.call(this,n,$)}function k($){Fe.call(this,n,$)}return[f,l,o,r,s,d,u,p,h,g,_,v,k]}class VI extends be{constructor(e){super(),ge(this,e,jI,qI,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function zI(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=W("Backup name"),s=D(),l=y("input"),m(e,"for",i=n[14]),m(l,"type","text"),m(l,"id",o=n[14]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),re(l,n[2]),r||(a=J(l,"input",n[9]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&m(e,"for",i),f&16384&&o!==(o=u[14])&&m(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function HI(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v;return u=new Rl({props:{value:n[1]}}),h=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[zI,({uniqueId:k})=>({14:k}),({uniqueId:k})=>k?16384:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div>
<div class="content"><p>Please proceed with caution.</p>
<p>The restore operation will replace your existing <code>pb_data</code> with the one from the backup
and will restart the application process!</p>
<p class="txt-bold">Backup restore is still experimental and currently works only on UNIX based systems.</p></div>`,t=D(),i=y("div"),s=W(`Type the backup name
`),l=y("div"),o=y("span"),r=W(n[1]),a=D(),H(u.$$.fragment),f=W(`
to confirm:`),d=D(),p=y("form"),H(h.$$.fragment),m(e,"class","alert alert-danger"),m(o,"class","txt"),m(l,"class","label"),m(i,"class","content m-b-sm"),m(p,"id",n[6]),m(p,"autocomplete","off")},m(k,$){S(k,e,$),S(k,t,$),S(k,i,$),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),V(u,l,null),b(i,f),S(k,d,$),S(k,p,$),V(h,p,null),g=!0,_||(v=J(p,"submit",tt(n[7])),_=!0)},p(k,$){(!g||$&2)&&se(r,k[1]);const C={};$&2&&(C.value=k[1]),u.$set(C);const T={};$&49156&&(T.$$scope={dirty:$,ctx:k}),h.$set(T)},i(k){g||(I(u.$$.fragment,k),I(h.$$.fragment,k),g=!0)},o(k){L(u.$$.fragment,k),L(h.$$.fragment,k),g=!1},d(k){k&&w(e),k&&w(t),k&&w(i),z(u),k&&w(d),k&&w(p),z(h),_=!1,v()}}}function BI(n){let e,t,i,s;return{c(){e=y("h4"),t=W("Restore "),i=y("strong"),s=W(n[1]),m(e,"class","center txt-break")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&w(e)}}}function UI(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=W("Cancel"),i=D(),s=y("button"),l=y("span"),l.textContent="Restore backup",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[4],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[6]),m(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],x(s,"btn-loading",n[4])},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),b(s,l),r||(a=J(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&x(s,"btn-loading",u[4])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function WI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[UI],header:[BI],default:[HI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){H(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&32822&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),z(e,s)}}}function YI(n,e,t){let i;const s="backup_restore_"+U.randomString(5);let l,o="",r="",a=!1;function u(k){tn({}),t(2,r=""),t(1,o=k),t(4,a=!1),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function d(){var k;if(!(!i||a)){t(4,a=!0);try{await ce.backups.restore(o),setTimeout(()=>{window.location.reload()},1e3)}catch($){$!=null&&$.isAbort||(t(4,a=!1),As(((k=$.response)==null?void 0:k.message)||$.message))}}}function p(){r=this.value,t(2,r)}const h=()=>!a;function g(k){ne[k?"unshift":"push"](()=>{l=k,t(3,l)})}function _(k){Fe.call(this,n,k)}function v(k){Fe.call(this,n,k)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[f,o,r,l,a,i,s,d,u,p,h,g,_,v]}class KI extends be{constructor(e){super(),ge(this,e,YI,WI,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function V_(n,e,t){const i=n.slice();return i[22]=e[t],i}function z_(n,e,t){const i=n.slice();return i[19]=e[t],i}function JI(n){let e=[],t=new Map,i,s,l=n[3];const o=a=>a[22].key;for(let a=0;a<l.length;a+=1){let u=V_(n,l,a),f=o(u);t.set(f,e[a]=B_(f,u))}let r=null;return l.length||(r=H_()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ke(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);S(a,i,u),r&&r.m(a,u),s=!0},p(a,u){u&876&&(l=a[3],ae(),e=vt(e,u,o,1,a,l,t,i.parentNode,Ut,B_,i,V_),ue(),!l.length&&r?r.p(a,u):l.length?r&&(r.d(1),r=null):(r=H_(),r.c(),r.m(i.parentNode,i)))},i(a){if(!s){for(let u=0;u<l.length;u+=1)I(e[u]);s=!0}},o(a){for(let u=0;u<e.length;u+=1)L(e[u]);s=!1},d(a){for(let u=0;u<e.length;u+=1)e[u].d(a);a&&w(i),r&&r.d(a)}}}function ZI(n){let e,t=Array(n[3].length||1),i=[];for(let s=0;s<t.length;s+=1)i[s]=U_(z_(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ke()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&8){t=Array(s[3].length||1);let o;for(o=0;o<t.length;o+=1){const r=z_(s,t,o);i[o]?i[o].p(r,l):(i[o]=U_(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:te,o:te,d(s){ht(i,s),s&&w(e)}}}function H_(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="txt">No backups yet.</
`,m(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function B_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,d,p=U.formattedFileSize(e[22].size)+"",h,g,_,v,k,$,C,T,M,O,E,A,P,N,F,R,q,j,B,Y;function Q(){return e[10](e[22])}function Z(){return e[11](e[22])}function G(){return e[12](e[22])}return{key:n,first:null,c(){t=y("div"),i=y("i"),s=D(),l=y("div"),o=y("span"),a=W(r),u=D(),f=y("span"),d=W("("),h=W(p),g=W(")"),_=D(),v=y("div"),k=y("button"),$=y("i"),T=D(),M=y("button"),O=y("i"),A=D(),P=y("button"),N=y("i"),R=D(),m(i,"class","ri-folder-zip-line"),m(o,"class","name backup-name svelte-1ulbkf5"),m(f,"class","size txt-hint txt-nowrap"),m(l,"class","content"),m($,"class","ri-download-line"),m(k,"type","button"),m(k,"class","btn btn-sm btn-circle btn-hint btn-transparent"),k.disabled=C=e[6][e[22].key]||e[5][e[22].key],m(k,"aria-label","Download"),x(k,"btn-loading",e[5][e[22].key]),m(O,"class","ri-restart-line"),m(M,"type","button"),m(M,"class","btn btn-sm btn-circle btn-hint btn-transparent"),M.disabled=E=e[6][e[22].key],m(M,"aria-label","Restore"),m(N,"class","ri-delete-bin-7-line"),m(P,"type","button"),m(P,"class","btn btn-sm btn-circle btn-hint btn-transparent"),P.disabled=F=e[6][e[22].key],m(P,"aria-label","Delete"),x(P,"btn-loading",e[6][e[22].key]),m(v,"class","actions nonintrusive"),m(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(le,ee){S(le,t,ee),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,u),b(l,f),b(f,d),b(f,h),b(f,g),b(t,_),b(t,v),b(v,k),b(k,$),b(v,T),b(v,M),b(M,O),b(v,A),b(v,P),b(P,N),b(t,R),j=!0,B||(Y=[Oe(Be.call(null,k,"Download")),J(k,"click",tt(Q)),Oe(Be.call(null,M,"Restore")),J(M,"click",tt(Z)),Oe(Be.call(null,P,"Delete")),J(P,"click",tt(G))],B=!0)},p(le,ee){e=le,(!j||ee&8)&&r!==(r=e[22].key+"")&&se(a,r),(!j||ee&8)&&p!==(p=U.formattedFileSize(e[22].size)+"")&&se(h,p),(!j||ee&104&&C!==(C=e[6][e[22].key]||e[5][e[22].key]))&&(k.disabled=C),(!j||ee&40)&&x(k,"btn-loading",e[5][e[22].key]),(!j||ee&72&&E!==(E=e[6][e[22].key]))&&(M.disabled=E),(!j||ee&72&&F!==(F=e[6][e[22].key]))&&(P.disabled=F),(!j||ee&72)&&x(P,"btn-loading",e[6][e[22].key])},i(le){j||(le&&xe(()=>{j&&(q||(q=Ve(t,rt,{duration:150},!0)),q.run(1))}),j=!0)},o(le){le&&(q||(q=Ve(t,rt,{duration:150},!1)),q.run(0)),j=!1},d(le){le&&w(t),le&&q&&q.end(),B=!1,De(Y)}}}function U_(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="skeleton-loader"></span>
`,m(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function GI(n){let e,t,i;return{c(){e=y("span"),t=D(),i=y("span"),i.textContent="Backup/restore operation is in process",m(e,"class","loader loader-sm"),m(i,"class","txt")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function XI(n){let e,t,i;return{c(){e=y("i"),t=D(),i=y("span"),i.textContent="Initialize new backup",m(e,"class","ri-play-circle-line"),m(i,"class","txt")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function QI(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_;const v=[ZI,JI],k=[];function $(A,P){return A[4]?0:1}i=$(n),s=k[i]=v[i](n);function C(A,P){return A[7]?XI:GI}let T=C(n),M=T(n),O={};f=new VI({props:O}),n[14](f),f.$on("submit",n[15]);let E={};return p=new KI({props:E}),n[16](p),{c(){e=y("div"),t=y("div"),s.c(),l=D(),o=y("div"),r=y("button"),M.c(),u=D(),H(f.$$.fragment),d=D(),H(p.$$.fragment),m(t,"class","list-content svelte-1ulbkf5"),m(r,"type","button"),m(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],m(o,"class","list-item list-item-btn"),m(e,"class","list list-compact")},m(A,P){S(A,e,P),b(e,t),k[i].m(t,null),b(e,l),b(e,o),b(o,r),M.m(r,null),S(A,u,P),V(f,A,P),S(A,d,P),V(p,A,P),h=!0,g||(_=J(r,"click",n[13]),g=!0)},p(A,[P]){let N=i;i=$(A),i===N?k[i].p(A,P):(ae(),L(k[N],1,1,()=>{k[N]=null}),ue(),s=k[i],s?s.p(A,P):(s=k[i]=v[i](A),s.c()),I(s,1),s.m(t,null)),T!==(T=C(A))&&(M.d(1),M=T(A),M&&(M.c(),M.m(r,null))),(!h||P&144&&a!==(a=A[4]||!A[7]))&&(r.disabled=a);const F={};f.$set(F);const R={};p.$set(R)},i(A){h||(I(s),I(f.$$.fragment,A),I(p.$$.fragment,A),h=!0)},o(A){L(s),L(f.$$.fragment,A),L(p.$$.fragment,A),h=!1},d(A){A&&w(e),k[i].d(),M.d(),A&&w(u),n[14](null),z(f,A),A&&w(d),n[16](null),z(p,A),g=!1,_()}}}function xI(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),g();async function f(){t(4,o=!0);try{t(3,l=await ce.backups.getFullList()),l.sort((O,E)=>O.modified<E.modified?1:O.modified>E.modified?-1:0),t(4,o=!1)}catch(O){O.isAbort||(ce.error(O),t(4,o=!1))}}async function d(O){if(!r[O]){t(5,r[O]=!0,r);try{const E=await ce.getAdminFileToken(),A=ce.backups.getDownloadUrl(E,O);U.download(A)}catch(E){E.isAbort||ce.error(E)}delete r[O],t(5,r)}}function p(O){mn(`Do you really want to delete ${O}?`,()=>h(O))}async function h(O){if(!a[O]){t(6,a[O]=!0,a);try{await ce.backups.delete(O),U.removeByKey(l,"name",O),f(),Ht(`Successfully deleted ${O}.`)}catch(E){E.isAbort||ce.error(E)}delete a[O],t(6,a)}}async function g(){var O;try{const E=await ce.health.check({$autoCancel:!1}),A=u;t(7,u=((O=E==null?void 0:E.data)==null?void 0:O.canBackup)||!1),A!=u&&u&&f()}catch{}}Xt(()=>{let O=setInterval(()=>{g()},3e3);return()=>{clearInterval(O)}});const _=O=>d(O.key),v=O=>s.show(O.key),k=O=>p(O.key),$=()=>i==null?void 0:i.show();function C(O){ne[O?"unshift":"push"](()=>{i=O,t(1,i)})}const T=()=>{f()};function M(O){ne[O?"unshift":"push"](()=>{s=O,t(2,s)})}return[f,i,s,l,o,r,a,u,d,p,_,v,k,$,C,T,M]}class e8 extends be{constructor(e){super(),ge(this,e,xI,QI,he,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function t8(n){let e;return{c(){e=y("i"),m(e,"class","ri-arrow-down-s-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function n8(n){let e;return{c(){e=y("i"),m(e,"class","ri-arrow-up-s-line")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function W_(n){var B,Y,Q;let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M,O,E;t=new pe({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[i8,({uniqueId:Z})=>({32:Z}),({uniqueId:Z})=>[0,Z?2:0]]},$$scope:{ctx:n}}});let A=n[2]&&Y_(n);function P(Z){n[25](Z)}function N(Z){n[26](Z)}function F(Z){n[27](Z)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(B=n[0].backups)==null?void 0:B.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new M1({props:R}),ne.push(()=>de(r,"config",P)),ne.push(()=>de(r,"isTesting",N)),ne.push(()=>de(r,"testError",F));let q=((Q=(Y=n[1].backups)==null?void 0:Y.s3)==null?vo
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function a8(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=Oe(t=Be.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function u8(n){let e;return{c(){e=y("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:te,d(t){t&&w(e)}}}function J_(n){let e,t,i,s,l;return{c(){e=y("button"),t=y("span"),t.textContent="Reset",m(t,"class","txt"),m(e,"type","submit"),m(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){S(o,e,r),b(e,t),s||(l=J(e,"click",n[28]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&w(e),s=!1,l()}}}function f8(n){let e,t,i,s,l,o,r,a,u,f,d,p,h,g,_,v,k,$,C,T,M,O,E,A,P;h=new Go({props:{class:"btn-sm",tooltip:"Reload backups list"}}),h.$on("refresh",n[15]);let N={};_=new e8({props:N}),n[16](_);function F(B,Y){return B[6]?n8:t8}let R=F(n),q=R(n),j=n[6]&&!n[4]&&W_(n);return{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=D(),l=y("div"),o=W(n[10]),r=D(),a=y("div"),u=y("div"),f=y("div"),d=y("span"),d.textContent="Backup and restore your PocketBase data",p=D(),H(h.$$.fragment),g=D(),H(_.$$.fragment),v=D(),k=y("hr"),$=D(),C=y("button"),T=y("span"),T.textContent="Backups options",M=D(),q.c(),O=D(),j&&j.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(d,"class","txt-xl"),m(f,"class","flex m-b-sm flex-gap-5"),m(T,"class","txt"),m(C,"type","button"),m(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m(B,Y){S(B,e,Y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(B,r,Y),S(B,a,Y),b(a,u),b(u,f),b(f,d),b(f,p),V(h,f,null),b(u,g),V(_,u,null),b(u,v),b(u,k),b(u,$),b(u,C),b(C,T),b(C,M),q.m(C,null),b(u,O),j&&j.m(u,null),E=!0,A||(P=[J(C,"click",n[17]),J(u,"submit",tt(n[11]))],A=!0)},p(B,Y){(!E||Y[0]&1024)&&se(o,B[10]);const Q={};_.$set(Q),R!==(R=F(B))&&(q.d(1),q=R(B),q&&(q.c(),q.m(C,null))),(!E||Y[0]&16)&&(C.disabled=B[4]),(!E||Y[0]&16)&&x(C,"btn-loading",B[4]),B[6]&&!B[4]?j?(j.p(B,Y),Y[0]&80&&I(j,1)):(j=W_(B),j.c(),I(j,1),j.m(u,null)):j&&(ae(),L(j,1,1,()=>{j=null}),ue())},i(B){E||(I(h.$$.fragment,B),I(_.$$.fragment,B),I(j),E=!0)},o(B){L(h.$$.fragment,B),L(_.$$.fragment,B),L(j),E=!1},d(B){B&&w(e),B&&w(r),B&&w(a),z(h),n[16](null),z(_),q.d(),j&&j.d(),A=!1,De(P)}}}function c8(n){let e,t,i,s;return e=new Mi({}),i=new Sn({props:{$$slots:{default:[f8]},$$scope:{ctx:n}}}),{c(){H(e.$$.fragment),t=D(),H(i.$$.fragment)},m(l,o){V(e,l,o),S(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&4&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){z(e,l),l&&w(t),z(i,l)}}}function d8(n,e,t){let i,s;Ze(n,Mt,G=>t(10,s=G)),ln(Mt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",d=!1,p=!1,h=!1,g=null;_();async function _(){t(4,a=!0);try{const G=await ce.settings.getAll()||{};k(G)}catch(G){ce.error(G)}t(4,a=!1)}async function v(){if(!(u||!i)){t(5,u=!0);try{const G=await ce.settings.update(U.filterRedactedProps(r));await C(),k(G),Ht("Successfully saved application settings.")}catch(G){ce.error(G)}t(5,u=!1)}}function k(G={}){t(1,r={backups:(G==null?void 0:G.backups)||{}}),t(2,d=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function $(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,d=r.backups.cron!="")}async function C(){await(l==null?void 0:l.loadBackups())}const T=()=>C();function M(G){ne[G?"unshift":"push"](()=>{l=G,t(3,l)})}const O=()=>t(6,p=!p);function E(){d=this.checked,t(2,d)}function A(){r.backups.cron=this.value,t(1,r),t(2,d)}const P=()=>{t(1,r.backups.cron="0 0 * * *",r)},N=()=>{t(1,r.backups.cron="0 0 * * 0",r)},F=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},R=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function q(){r.backups.cronMaxKeep=pt(this.value),t(1,r),t(2,d)}functi
<span class="txt">Manage admins</span>`,t=D(),i=y("hr"),s=D(),l=y("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,m(e,"href","/settings/admins"),m(e,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[Oe(rn.call(null,e)),J(l,"click",n[7])],o=!0)},p:te,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,De(r)}}}function Q_(n){let e,t,i;return t=new mu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:U.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),H(t.$$.fragment),m(e,"class","tinymce-preloader hidden")},m(s,l){S(s,e,l),V(t,e,null),i=!0},p:te,i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&w(e),z(t)}}}function E8(n){var v;let e,t,i,s,l,o,r,a,u,f,d,p,h;document.title=e=U.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let g=((v=n[0])==null?void 0:v.id)&&n[1]&&X_(n);o=new d0({props:{routes:m8}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new w8({}),f=new M8({});let _=n[1]&&!n[2]&&Q_(n);return{c(){t=D(),i=y("div"),g&&g.c(),s=D(),l=y("div"),H(o.$$.fragment),r=D(),H(a.$$.fragment),u=D(),H(f.$$.fragment),d=D(),_&&_.c(),p=ke(),m(l,"class","app-body"),m(i,"class","app-layout")},m(k,$){S(k,t,$),S(k,i,$),g&&g.m(i,null),b(i,s),b(i,l),V(o,l,null),b(l,r),V(a,l,null),S(k,u,$),V(f,k,$),S(k,d,$),_&&_.m(k,$),S(k,p,$),h=!0},p(k,[$]){var C;(!h||$&24)&&e!==(e=U.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(C=k[0])!=null&&C.id&&k[1]?g?(g.p(k,$),$&3&&I(g,1)):(g=X_(k),g.c(),I(g,1),g.m(i,s)):g&&(ae(),L(g,1,1,()=>{g=null}),ue()),k[1]&&!k[2]?_?(_.p(k,$),$&6&&I(_,1)):(_=Q_(k),_.c(),I(_,1),_.m(p.parentNode,p)):_&&(ae(),L(_,1,1,()=>{_=null}),ue())},i(k){h||(I(g),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(_),h=!0)},o(k){L(g),L(o.$$.fragment,k),L(a.$$.fragment,k),L(f.$$.fragment,k),L(_),h=!1},d(k){k&&w(t),k&&w(i),g&&g.d(),z(o),z(a),k&&w(u),z(f,k),k&&w(d),_&&_.d(k),k&&w(p)}}}function D8(n,e,t){let i,s,l,o;Ze(n,Is,_=>t(10,i=_)),Ze(n,$o,_=>t(3,s=_)),Ze(n,qa,_=>t(0,l=_)),Ze(n,Mt,_=>t(4,o=_));let r,a=!1,u=!1;function f(_){var v,k,$,C;((v=_==null?void 0:_.detail)==null?void 0:v.location)!==r&&(t(1,a=!!(($=(k=_==null?void 0:_.detail)==null?void 0:k.userData)!=null&&$.showAppSidebar)),r=(C=_==null?void 0:_.detail)==null?void 0:C.location,ln(Mt,o="",o),tn({}),y1())}function d(){Vi("/")}async function p(){var _,v;if(l!=null&&l.id)try{const k=await ce.settings.getAll({$cancelKey:"initialAppSettings"});ln($o,s=((_=k==null?void 0:k.meta)==null?void 0:_.appName)||"",s),ln(Is,i=!!((v=k==null?void 0:k.meta)!=null&&v.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function h(){ce.logout()}const g=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,h,g]}class A8 extends be{constructor(e){super(),ge(this,e,D8,E8,he,{})}}new A8({target:document.getElementById("app")});export{De as A,Ht as B,U as C,Vi as D,ke as E,bb as F,hg as G,Xt as H,Ze as I,di as J,Tt as K,ne as L,b1 as M,vt as N,Ho as O,us as P,Ut as Q,ht as R,be as S,kn as T,Hr as U,L as a,D as b,H as c,z as d,y as e,m as f,S as g,b as h,ge as i,Oe as j,ae as k,rn as l,V as m,ue as n,w as o,ce as p,pe as q,x as r,he as s,I as t,J as u,tt as v,W as w,se as x,te as y,re as z};