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

201 lines
914 KiB
JavaScript
Raw Normal View History

2023-03-17 01:21:16 +08:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function X(){}const wl=n=>n;function Le(n,e){for(const t in e)n[t]=e[t];return n}function rb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function T_(n){return n()}function ru(){return Object.create(null)}function Ae(n){n.forEach(T_)}function Bt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let ql;function Un(n,e){return ql||(ql=document.createElement("a")),ql.href=e,n===ql.href}function ab(n){return Object.keys(n).length===0}function $_(n,...e){if(n==null)return X;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function We(n,e,t){n.$$.on_destroy.push($_(e,t))}function Et(n,e,t,i){if(n){const s=C_(n,e,t,i);return n[0](s)}}function C_(n,e,t,i){return n[1]&&i?Le(t.ctx.slice(),n[1](i(e))):t.ctx}function At(n,e,t,i){if(n[2]&&i){const s=n[2](i(t));if(e.dirty===void 0)return s;if(typeof s=="object"){const l=[],o=Math.max(e.dirty.length,s.length);for(let r=0;r<o;r+=1)l[r]=e.dirty[r]|s[r];return l}return e.dirty|s}return e.dirty}function It(n,e,t,i,s,l){if(s){const o=C_(e,t,i,l);n.p(o,s)}}function Pt(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function jt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Je(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function $i(n){return n??""}function Gt(n,e,t){return n.set(t),e}function De(n){return n&&Bt(n.destroy)?n.destroy:X}function au(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const M_=typeof window<"u";let Fo=M_?()=>window.performance.now():()=>Date.now(),pa=M_?n=>requestAnimationFrame(n):X;const bs=new Set;function O_(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&pa(O_)}function Ro(n){let e;return bs.size===0&&pa(O_),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function b(n,e){n.appendChild(e)}function D_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function ub(n){const e=v("style");return fb(D_(n),e),e.sheet}function fb(n,e){return b(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function at(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function B(n){return document.createTextNode(n)}function D(){return B(" ")}function we(){return B("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function ft(n){return function(e){return e.preventDefault(),n.call(this,e)}}function $n(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function m(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function xn(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:m(n,i,e[i])}function cb(n){let e;return{p(...t){e=t,e.forEach(i=>n.push(i))},r(){e.forEach(t=>n.splice(n.indexOf(t),1))}}}function ht(n){return n===""?null:+n}function db(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function ue(n,e){n.
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${pb(f)}_${r}`,d=D_(n),{stylesheet:p,rules:h}=mo.get(d)||mb(d,n);h[c]||(h[c]=!0,p.insertRule(`@keyframes ${c} ${f}`,p.cssRules.length));const g=n.style.animation||"";return n.style.animation=`${g?`${g}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function fl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||hb())}function hb(){pa(()=>{ho||(mo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),mo.clear())})}function _b(n,e,t,i){if(!e)return X;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return X;const{delay:l=0,duration:o=300,easing:r=wl,start:a=Fo()+l,end:u=a+o,tick:f=X,css:c}=t(n,{from:e,to:s},i);let d=!0,p=!1,h;function g(){c&&(h=ul(n,0,1,o,l,r,c)),l||(p=!0)}function _(){c&&fl(n,h),d=!1}return Ro(y=>{if(!p&&y>=a&&(p=!0),p&&y>=u&&(f(1,0),_()),!d)return!1;if(p){const k=y-a,T=0+1*r(k/o);f(T,1-T)}return!0}),g(),f(0,1),_}function gb(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,s=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,A_(n,s)}}function A_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let cl;function ai(n){cl=n}function Sl(){if(!cl)throw new Error("Function called outside component initialization");return cl}function Qt(n){Sl().$$.on_mount.push(n)}function bb(n){Sl().$$.after_update.push(n)}function I_(n){Sl().$$.on_destroy.push(n)}function vt(){const n=Sl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=E_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function de(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gs=[],se=[];let vs=[];const Fr=[],P_=Promise.resolve();let Rr=!1;function L_(){Rr||(Rr=!0,P_.then(ma))}function rn(){return L_(),P_}function et(n){vs.push(n)}function ke(n){Fr.push(n)}const tr=new Set;let cs=0;function ma(){if(cs!==0)return;const n=cl;do{try{for(;cs<gs.length;){const e=gs[cs];cs++,ai(e),vb(e.$$)}}catch(e){throw gs.length=0,cs=0,e}for(ai(null),gs.length=0,cs=0;se.length;)se.pop()();for(let e=0;e<vs.length;e+=1){const t=vs[e];tr.has(t)||(tr.add(t),t())}vs.length=0}while(gs.length);for(;Fr.length;)Fr.pop()();Rr=!1,tr.clear(),ai(n)}function vb(n){if(n.fragment!==null){n.update(),Ae(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(et)}}function yb(n){const e=[],t=[];vs.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),vs=e}let qs;function ha(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function Gi(n,e,t){n.dispatchEvent(E_(`${e?"intro":"outro"}${t}`))}const ro=new Set;let Gn;function re(){Gn={r:0,c:[],p:Gn}}function ae(){Gn.r||Ae(Gn.c),Gn=Gn.p}function A(n,e){n&&n.i&&(ro.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(ro.has(n))return;ro.add(n),Gn.c.push(()=>{ro.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const _a={duration:0};function kb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&fl(n,o)}function f(){const{delay:d=0,duration:p=300,easing:h=wl,tick:g=X,css:_}=s||_a;_&&(o=ul(n,0,1,p,d,h,_,a++)),g(0,1);const y=Fo()+d,k=y+p;r&&r.abort(),l=!0,et(()=>Gi(n,!0,"start")),r=Ro(T=>{if(l){if(T>=k)return g(1,0),Gi(n,!0,"end"),u(),l=!1;if(T>=y){const $=h((T-y)/p);g($,1-$)}}return l})}let c=!1;return{start(){c||(c=!0,fl(n),Bt(s)?(s=s(i),ha().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function wb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Gn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=wl,tick:d=X,css:p}=s||_a;p&&(o=ul(n,1,0,f,u,c,p));const h=Fo()+u,g=h+f;et(()=>Gi(n,!1,"start")),Ro(_=>{if(l){if(_>=g)return d(0,1),Gi(n,!1,"end"),--r.r||Ae(r.c),!1;if(_>=h){con
`,t+=e.columns.filter(i=>!!(i!=null&&i.column)).map(i=>{let s="";return i.column.includes("(")||i.column.includes(" ")?s+=i.column:s+=`"${i.column}"`,i.collate&&(s+=" COLLATE "+i.collate),i.sort&&(s+=" "+i.sort.toUpperCase()),s}).join(`,
`),t+=`
)`,e.expression&&(t+=` WHERE ${e.expression}`),t}static replaceIndexTableName(e,t){const i=H.parseIndex(e);return i.tableName=t,H.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=H.parseIndex(e);let l=!1;for(let o of s.columns)o.column===t&&(o.column=i,l=!0);return l?H.buildIndex(s):e}}const zo=Rn([]);function Vg(n,e=4e3){return Bo(n,"info",e)}function Ut(n,e=3e3){return Bo(n,"success",e)}function pl(n,e=4500){return Bo(n,"error",e)}function Zv(n,e=4500){return Bo(n,"warning",e)}function Bo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{Hg(i)},t)};zo.update(s=>(Da(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function Hg(n){zo.update(e=>(Da(e,n),e))}function Oa(){zo.update(n=>{for(let e of n)Da(n,e);return[]})}function Da(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const ti=Rn({});function _n(n){ti.set(n||{})}function ci(n){ti.update(e=>(H.deleteByPath(e,n),e))}const Ea=Rn({});function Jr(n){Ea.set(n||{})}va.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ei("/login")};va.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&pl(l)}if(H.isEmpty(s.data)||_n(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ei("/")};class Gv extends H_{save(e,t){super.save(e,t),t instanceof es&&Jr(t)}clear(){super.clear(),Jr(null)}}const me=new va("../",new Gv("pb_admin_auth"));me.authStore.model instanceof es&&Jr(me.authStore.model);function Xv(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=n[3].default,h=Et(p,n,n[2],null);return{c(){e=v("div"),t=v("main"),h&&h.c(),i=D(),s=v("footer"),l=v("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
<span class="txt">Docs</span>`,o=D(),r=v("span"),r.textContent="|",a=D(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.14.0",m(t,"class","page-content"),m(l,"href","https://pocketbase.io/docs/"),m(l,"target","_blank"),m(l,"rel","noopener noreferrer"),m(r,"class","delimiter"),m(f,"class","txt"),m(u,"href","https://github.com/pocketbase/pocketbase/releases"),m(u,"target","_blank"),m(u,"rel","noopener noreferrer"),m(u,"title","Releases"),m(s,"class","page-footer"),m(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(g,_){S(g,e,_),b(e,t),h&&h.m(t,null),b(e,i),b(e,s),b(s,l),b(s,o),b(s,r),b(s,a),b(s,u),b(u,f),d=!0},p(g,[_]){h&&h.p&&(!d||_&4)&&It(h,p,g,g[2],d?At(p,g[2],_,null):Pt(g[2]),null),(!d||_&2&&c!==(c="page-wrapper "+g[1]))&&m(e,"class",c),(!d||_&3)&&Q(e,"center-content",g[0])},i(g){d||(A(h,g),d=!0)},o(g){I(h,g),d=!1},d(g){g&&w(e),h&&h.d(g)}}}function Qv(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Cn extends ve{constructor(e){super(),be(this,e,Qv,Xv,_e,{center:0,class:1})}}function zu(n){let e,t,i;return{c(){e=v("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=D(),i=v("div"),m(e,"class","block txt-center m-b-lg"),m(i,"class","clearfix")},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},d(s){s&&w(e),s&&w(t),s&&w(i)}}}function xv(n){let e,t,i,s=!n[0]&&zu();const l=n[1].default,o=Et(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=D(),o&&o.c(),m(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){S(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=zu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&It(o,l,r,r[2],i?At(l,r[2],a,null):Pt(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){I(o,r),i=!1},d(r){r&&w(e),s&&s.d(),o&&o.d(r)}}}function ey(n){let e,t;return e=new Cn({props:{class:"full-page",center:!0,$$slots:{default:[xv]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function ty(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class zg extends ve{constructor(e){super(),be(this,e,ty,ey,_e,{nobranding:0})}}function Uo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=wl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ei(n,{delay:e=0,duration:t=400,easing:i=Uo,x:s=0,y:l=0,opacity:o=0}={}){const r=getComputedStyle(n),a=+r.opacity,u=r.transform==="none"?"":r.transform,f=a*(1-o),[c,d]=au(s),[p,h]=au(l);return{delay:e,duration:t,easing:i,css:(g,_)=>`
transform: ${u} translate(${(1-g)*c}${d}, ${(1-g)*p}${h});
opacity: ${a-f*_}`}}function Mt(n,{delay:e=0,duration:t=400,easing:i=Uo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),p=parseFloat(l[`margin${f[0]}`]),h=parseFloat(l[`margin${f[1]}`]),g=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*p}px;margin-${u[1]}: ${y*h}px;border-${u[0]}-width: ${y*g}px;border-${u[1]}-width: ${y*_}px;`}}function qt(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let Zr,Hi;const Gr="app-tooltip";function Bu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Si(){return Hi=Hi||document.querySelector("."+Gr),Hi||(Hi=document.createElement("div"),Hi.classList.add(Gr),document.body.appendChild(Hi)),Hi}function Bg(n,e){let t=Si();if(!t.classList.contains("active")||!(e!=null&&e.text)){Xr();return}t.textContent=e.text,t.className=Gr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function Xr(){clearTimeout(Zr),Si().classList.remove("active"),Si().activeNode=void 0}function ny(n,e){Si().activeNode=n,clearTimeout(Zr),Zr=setTimeout(()=>{Si().classList.add("active"),Bg(n,e)},isNaN(e.delay)?0:e.delay)}function ze(n,e){let t=Bu(e);function i(){ny(n,t)}function s(){Xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",s),Si(),{update(l){var o,r;t=Bu(l),(r=(o=Si())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Bg(n,t)},destroy(){var l,o;(o=(l=Si())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Xr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Uu(n,e,t){const i=n.slice();return i[12]=e[t],i}const iy=n=>({}),Wu=n=>({uniqueId:n[4]});function sy(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Yu(Uu(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=o[3];let a;for(a=0;a<i.length;a+=1){const u=Uu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Yu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function ly(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),m(t,"class","ri-error-warning-fill txt-danger"),m(e,"class","form-field-addon")},m(a,u){S(a,e,u),b(e,t),l=!0,o||(r=De(i=ze.call(null,t,{position:"left",text:n[3].map(yo).join(`
`)})),o=!0)},p(a,u){i&&Bt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(yo).join(`
`)})},i(a){l||(a&&et(()=>{l&&(s||(s=qe(t,qt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,qt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&w(e),a&&s&&s.end(),o=!1,r()}}}function Yu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=B(i),l=D(),m(e,"class","help-block help-block-error")},m(a,u){S(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=yo(a[12])+"")&&le(s,i)},i(a){r||(a&&et(()=>{r&&(o||(o=qe(e,Mt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,Mt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function oy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Et(a,n,n[8],Wu),f=[ly,sy],c=[];function d(p,h){return p[0]&&p[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=D(),s.c(),m(e,"class",n[1]),Q(e,"error",n[3].length)},m(p,h){S(p,e,h),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=K(e,"click",n[10]),o=!0)},p(p,[h]){u&&u.p&&(!l||h&256)&&It(u,a,p,p[8],l?At(a,p[8],h,iy):Pt(p[8]),Wu);let g=i;i=d(p),i===g?c[i].p(p,h):(re(),I(c[g],1,1,()=>{c[g]=null}),ae(),s=c[i],s?s.p(p,h):(s=c[i]=f[i](p),s.c()),A(s,1),s.m(e,null)),(!l||h&2)&&m(e,"class",p[1]),(!l||h&10)&&Q(e,"error",p[3].length)},i(p){l||(A(u,p),A(s),l=!0)},o(p){I(u,p),I(s),l=!1},d(p){p&&w(e),u&&u.d(p),c[i].d(),n[11](null),o=!1,r()}}}const Ku="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Ku:n||Ku}function ry(n,e,t){let i;We(n,ti,g=>t(7,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ci(r)}Qt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function p(g){de.call(this,n,g)}function h(g){se[g?"unshift":"push"](()=>{f=g,t(2,f)})}return n.$$set=g=>{"name"in g&&t(5,r=g.name),"inlineError"in g&&t(0,a=g.inlineError),"class"in g&&t(1,u=g.class),"$$scope"in g&&t(8,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=H.toArray(H.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,p,h]}class pe extends ve{constructor(e){super(),be(this,e,ry,oy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function ay(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("input"),m(e,"for",i=n[9]),m(l,"type","email"),m(l,"autocomplete","off"),m(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function uy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Minimum 10 characters.",m(e,"for",i=n[9]),m(l,"type","password"),m(l,"autocomplete","new-password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0,m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[1]),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&m(e,"for",i),d&512&&o!==(o=c[9])&&m(l,"id",o),d&2&&l.value!==c[1]&&ue(l,c[1])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function fy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Password confirm"),s=D(),l=v("input"),m(e,"for",i=n[9]),m(l,"type","password"),m(l,"minlength","10"),m(l,"id",o=n[9]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[2]),r||(a=K(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&m(e,"for",i),f&512&&o!==(o=u[9])&&m(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function cy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[ay,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[uy,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(f,"type","submit"),m(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),m(e,"class","block"),m(e,"autocomplete","off")},m(h,g){S(h,e,g),b(e,t),b(e,i),q(s,e,null),b(e,l),q(o,e,null),b(e,r),q(a,e,null),b(e,u),b(e,f),c=!0,d||(p=K(e,"submit",ft(n[4])),d=!0)},p(h,[g]){const _={};g&1537&&(_.$$scope={dirty:g,ctx:h}),s.$set(_);const y={};g&1538&&(y.$$scope={dirty:g,ctx:h}),o.$set(y);const k={};g&1540&&(k.$$scope={dirty:g,ctx:h}),a.$set(k),(!c||g&8)&&Q(f,"btn-disabled",h[3]),(!c||g&8)&&Q(f,"btn-loading",h[3])},i(h){c||(A(s.$$.fragment,h),A(o.$$.fragment,h),A(a.$$.fragment,h),c=!0)},o(h){I(s.$$.fragment,h),I(o.$$.fragment,h),I(a.$$.fragment,h),c=!1},d(h){h&&w(e),j(s),j(o),j(a),d=!1,p()}}}function dy(n,e,t){const i=vt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(d){me.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class py extends ve{constructor(e){super(),be(this,e,dy,cy,_e,{})}}function Ju(n){let e,t;return e=new zg({props:{$$slots:{default:[my]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function my(n){let e,t;return e=new py({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p:X,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function hy(n){let e,t,i=n[0]&&Ju(n);return{c(){i&&i.c(),e=we()},m(s,l){i&&i.m(s,l),S(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Ju(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(re(),I(i,1,1,()=>{i=null}),ae())},i(s){t||(A(i),t=!0)},o(s){I(i),t=!1},d(s){i&&i.d(s),s&&w(e)}}}function _y(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Ei("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await rn(),window.location.search=""}]}class gy extends ve{constructor(e){super(),be(this,e,_y,hy,_e,{})}}const Ot=Rn(""),ko=Rn(""),Cs=Rn(!1);function by(n){let e,t,i,s;return{c(){e=v("input"),m(e,"type","text"),m(e,"id",n[8]),m(e,"placeholder",t=n[0]||n[1])},m(l,o){S(l,e,o),n[13](e),ue(e,n[7]),i||(s=K(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&m(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:X,o:X,d(l){l&&w(e),n[13](null),i=!1,s()}}}function vy(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],ke(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function Zu(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Search</span>',m(e,"type","submit"),m(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,ei,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,ei,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function Gu(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"
<span class="txt">Method</span>`,m(e,"class","col-header-content")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Ny(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="URL",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Fy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Referer",m(t,"class",H.getFieldTypeIcon("url")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function Ry(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="User IP",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function qy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Status",m(t,"class",H.getFieldTypeIcon("number")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function jy(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="Created",m(t,"class",H.getFieldTypeIcon("date")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function ef(n){let e;function t(l,o){return l[6]?Hy:Vy}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function Vy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&tf(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=D(),o&&o.c(),l=D(),m(t,"colspan","99"),m(t,"class","txt-center txt-hint p-xs")},m(a,u){S(a,e,u),b(e,t),b(t,i),b(t,s),o&&o.m(t,null),b(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=tf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&w(e),o&&o.d()}}}function Hy(n){let e;return{c(){e=v("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function tf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[19]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function nf(n){let e;return{c(){e=v("i"),m(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),m(e,"title","Error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function sf(n,e){var $e,Ye,dt;let t,i,s,l=(($e=e[23].method)==null?void 0:$e.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,p,h,g,_,y,k=(e[23].referer||"N/A")+"",T,$,M,C,O,E=(e[23].userIp||"N/A")+"",P,L,F,N,R,z=e[23].status+"",W,J,x,ne,G,fe,Z,ce,he,Ce,Re=(((Ye=e[23].meta)==null?void 0:Ye.errorMessage)||((dt=e[23].meta)==null?void 0:dt.errorData))&&nf();ne=new di({props:{date:e[23].created}});function je(){return e[17](e[23])}function ye(...Ke){return e[18](e[23],...Ke)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=B(l),a=D(),u=v("td"),f=v("span"),d=B(c),h=D(),Re&&Re.c(),g=D(),_=v("td"),y=v("span"),T=B(k),M=D(),C=v("td"),O=v("span"),P=B(E),F=D(),N=v("td"),R=v("span"),W=B(z),J=D(),x=v("td"),V(ne.$$.fragment),G=D(),fe=v("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',Z=D(),m(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),m(i,"class","col-type-text col-field-method min-width"),m(f,"class","txt txt-ellipsis"),m(f,"title",p=e[23].url),m(u,"class","col-type-text col-field-url"),m(y,"class","txt txt-ellipsis"),m(y,"title",$=e[23].referer),Q(y,"txt-hint",!e[23].referer),m(_,"class","col-type-text col-field-referer"),m(O,"class","txt txt-ellipsis"),m(O,"title",L=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),m(C,"class","col-type-number col-field-userIp"),m(R,"class","label"),Q(R,"label-danger",e[23].status>=400),m(N,"class","col-type-number col-field-status"),m(x,"class","col-type-date col-field-created"),m(fe,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Ke,Be){S(Ke,t,Be),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,h),Re&&Re.m(u,null),b(t,g),b(t,_),b(_,y),b(y,T),b(t,M),b(t,C),b(C,O),b(O,P),b(t,F),b(t,N),b(N,R),b(R,W),b(t,J),b(t,x),q(ne,x,null),b(t,G),b(t,fe),b(t,Z),ce=!0,he||(Ce=[K(t,"click",je),K(t,"keydown",ye)],he=!0)},p(Ke,Be){var Fe,tt,Wt;e=Ke,(!ce||Be&8)&&l!==(l=((Fe=e[23].method)==null?void 0:Fe.toUpperCase())+"")&&le(o,l),(!ce||Be&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&m(s,"class",r),(!ce||Be&8)&&c!==(c=e[23].url+"")&&le(d,c),(!ce||Be&8&&p!==(p=e[23].url))&&m(f,"title",p),(tt=e[23].meta)!=null&&tt.errorMessage||(Wt=e[23].meta)!=null&&Wt.errorData?Re||(Re=nf(),Re.c(),Re.m(u,null)):Re&&(Re.d(1),Re=null),(!ce||Be&8)&&k!==(k=(e[23].referer||"N/A")+"")&&le(T,k),(!ce||Be&8&&$!==($=e[23].referer))&&m(y,"title",$),(!ce||Be&8)&&Q(y,"txt-hint",!e[23].referer),(!ce||Be&8)&&E!==(E=(e[23].userIp||"N/A")+"")&&le(P,E),(!ce||Be&8&&L!==(L=e[23].userIp))&&m(O,"title",L),(!ce||Be&8)&&Q(O,"txt-hint",!e[23].userIp),(!ce||Be&8)&&z!==(z=e[23].status+"")&&le(W,z),(!ce||Be&8)&&Q(R,"label-danger",e[23].status>=400);const ee={};Be&8&&(ee.date=e[23].created),ne.$set(ee)},i(Ke){ce||(A(ne.$$.fragment,Ke),ce=!0)},o(Ke){I(ne.$$.fragment,Ke),ce=!1},d(Ke){Ke&&w(t),Re&&Re.d(),j(ne),he=!1,Ae(Ce)}}}function zy(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P=[],L=new Map,F;function N(ye){n[11](ye)}let R={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[Ly]},$$scope:{ctx:n}};n[1]!==void 0&&(R.sort=n[1]),s=new Jt({props:R}),se.push(()=>ge(s,"sort",N));function z(ye){n[12](ye)}let W={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[Ny]},$$scope:{ctx:n}};n[1]!==void 0&&(W.sort=n[1]),r=new Jt({props:W}),se.push(()=>ge(r,"sort",z));function J(ye){n[13](ye)}let x={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Fy]},$$scope:{ctx:n}};n[1]!==void 0&&(x.sort=n[1]),f=new Jt({props:x}),se.push(()=>ge(f,"sort",J));function ne(ye){n[14](ye)}let G={disable:!0,class:"col-type-number col-field-userI
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function si(){}const Yy=function(){let n=0;return function(){return n++}}();function ut(n){return n===null||typeof n>"u"}function gt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function Ze(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Lt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Dn(n,e){return Lt(n)?n:e}function Qe(n,e){return typeof n>"u"?e:n}const Ky=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Ug=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function St(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function ct(n,e,t,i){let s,l,o;if(gt(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(Ze(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(gt(n))return n.map(So);if(Ze(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function Wg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Jy(n,e,t,i){if(!Wg(n))return;const s=e[n],l=t[n];Ze(s)&&Ze(l)?ml(s,l,i):e[n]=So(l)}function ml(n,e,t){const i=gt(e)?e:[e],s=i.length;if(!Ze(n))return n;t=t||{};const l=t.merger||Jy;for(let o=0;o<s;++o){if(e=i[o],!Ze(e))continue;const r=Object.keys(e);for(let a=0,u=r.length;a<u;++a)l(r[a],n,e,t)}return n}function nl(n,e){return ml(n,e,{merger:Zy})}function Zy(n,e,t){if(!Wg(n))return;const i=e[n],s=t[n];Ze(i)&&Ze(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const rf={"":n=>n,x:n=>n.x,y:n=>n.y};function Mi(n,e){return(rf[e]||(rf[e]=Gy(e)))(n)}function Gy(n){const e=Xy(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Xy(n){const e=n.split("."),t=[];let i="";for(const s of e)i+=s,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Nn=n=>typeof n<"u",Oi=n=>typeof n=="function",af=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Qy(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Dt=Math.PI,mt=2*Dt,xy=mt+Dt,To=Number.POSITIVE_INFINITY,e2=Dt/180,Tt=Dt/2,Bs=Dt/4,uf=Dt*2/3,Pn=Math.log10,Qn=Math.sign;function ff(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Pn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function t2(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Ms(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function n2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Yg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Bn(n){return n*(Dt/180)}function La(n){return n*(180/Dt)}function cf(n){if(!Lt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Kg(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Dt&&(l+=mt),{angle:l,distance:s}}function Qr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function i2(n,e){return(n-e+xy)%mt-Dt}function wn(n){return(n%mt+mt)%mt}function hl(n,e,t,i){const s=wn(n),l=wn(e),o=wn(t),r=wn(l-s),a=wn(o-s),u=wn(s-l),f=wn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Zt(n,e,t){return Math.max(e,Math.min(t,n))}function s2(n){return Zt(n,-32768,32767)}function _l(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Na(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Zi=(n,e,t,i)=>Na(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),l2=(n,e,t)=>Na(n,t,i=>n[i][e]>=t);function o2(n,e,
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function El(n){return n+.5|0}const yi=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return yi(El(n*2.55),0,255)}function Ti(n){return yi(El(n*255),0,255)}function ri(n){return yi(El(n/2.55)/100,0,1)}function _f(n){return yi(El(n*100),0,100)}const On={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},xr=[..."0123456789ABCDEF"],f2=n=>xr[n&15],c2=n=>xr[(n&240)>>4]+xr[n&15],Yl=n=>(n&240)>>4===(n&15),d2=n=>Yl(n.r)&&Yl(n.g)&&Yl(n.b)&&Yl(n.a);function p2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&On[n[1]]*17,g:255&On[n[2]]*17,b:255&On[n[3]]*17,a:e===5?On[n[4]]*17:255}:(e===7||e===9)&&(t={r:On[n[1]]<<4|On[n[2]],g:On[n[3]]<<4|On[n[4]],b:On[n[5]]<<4|On[n[6]],a:e===9?On[n[7]]<<4|On[n[8]]:255})),t}const m2=(n,e)=>n<255?e(n):"";function h2(n){var e=d2(n)?f2:c2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+m2(n.a,e):void 0}const _2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function e1(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function g2(n,e,t){const i=(s,l=(s+n/60)%6)=>t-t*e*Math.max(Math.min(l,4-l,1),0);return[i(5),i(3),i(1)]}function b2(n,e,t){const i=e1(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function v2(n,e,t,i,s){return n===s?(e-t)/i+(e<t?6:0):e===s?(t-n)/i+2:(n-e)/i+4}function Fa(n){const t=n.r/255,i=n.g/255,s=n.b/255,l=Math.max(t,i,s),o=Math.min(t,i,s),r=(l+o)/2;let a,u,f;return l!==o&&(f=l-o,u=r>.5?f/(2-l-o):f/(l+o),a=v2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ra(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ti)}function qa(n,e,t){return Ra(e1,n,e,t)}function y2(n,e,t){return Ra(b2,n,e,t)}function k2(n,e,t){return Ra(g2,n,e,t)}function t1(n){return(n%360+360)%360}function w2(n){const e=_2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):Ti(+e[5]));const s=t1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=y2(s,l,o):e[1]==="hsv"?i=k2(s,l,o):i=qa(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function S2(n,e){var t=Fa(n);t[0]=t1(t[0]+e),t=qa(t),n.r=t[0],n.g=t[1],n.b=t[2]}function T2(n){if(!n)return;const e=Fa(n),t=e[0],i=_f(e[1]),s=_f(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ri(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const gf={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},bf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class Mk{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=Gg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var li=new Mk;const Ef="transparent",Ok={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=yf(n||Ef),s=i.valid&&yf(e||Ef);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Dk{constructor(e,t,i,s){const l=t[i];s=Zl([e.to,s,l,e.from]);const o=Zl([e.from,l,s]);this._active=!0,this._fn=e.fn||Ok[e.type||typeof o],this._easing=sl[e.easing]||sl.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Zl([e.to,t,s,e.from]),this._from=Zl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const Ek=["x","y","borderWidth","radius","tension"],Ak=["color","borderColor","backgroundColor"];xe.set("animation",{delay:void 0,duration:1e3,easing:"easeOutQuart",fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0});const Ik=Object.keys(xe.animation);xe.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});xe.set("animations",{colors:{type:"color",properties:Ak},numbers:{type:"number",properties:Ek}});xe.describe("animations",{_fallback:"animation"});xe.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class _1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Ze(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Ze(s))return;const l={};for(con
`)>-1?n.split(`
`):n}function J3(n,e){const{element:t,datasetIndex:i,index:s}=e,l=n.getDatasetMeta(i).controller,{label:o,value:r}=l.getLabelAndValue(s);return{chart:n,label:o,parsed:l.getParsed(s),raw:n.data.datasets[i].data[s],formattedValue:r,dataset:l.getDataset(),dataIndex:s,datasetIndex:i,element:t}}function rc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Sn(e.bodyFont),u=Sn(e.titleFont),f=Sn(e.footerFont),c=l.length,d=s.length,p=i.length,h=Fn(e.padding);let g=h.height,_=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(g+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;g+=p*$+(y-p)*a.lineHeight+(y-1)*e.bodySpacing}d&&(g+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let k=0;const T=function($){_=Math.max(_,t.measureText($).width+k)};return t.save(),t.font=u.string,ct(n.title,T),t.font=a.string,ct(n.beforeBody.concat(n.afterBody),T),k=e.displayColors?o+2+e.boxPadding:0,ct(i,$=>{ct($.before,T),ct($.lines,T),ct($.after,T)}),k=0,t.font=f.string,ct(n.footer,T),t.restore(),_+=h.width,{width:_,height:g}}function Z3(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function G3(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function X3(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),G3(u,n,e,t)&&(u="center"),u}function ac(n,e,t){const i=t.yAlign||e.yAlign||Z3(n,t);return{xAlign:t.xAlign||e.xAlign||X3(n,e,t,i),yAlign:i}}function Q3(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function x3(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function uc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:p}=ks(o);let h=Q3(e,r);const g=x3(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+s:r==="right"&&(h+=Math.max(c,p)+s),{x:Zt(h,0,i.width-e.width),y:Zt(g,0,i.height-e.height)}}function no(n,e,t){const i=Fn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function fc(n){return Zn([],oi(n))}function eS(n,e,t){return Ai(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function cc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class aa extends pi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new _1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=eS(this.chart.getContext(),this,this._tooltipItems))}getTitle(e,t){const{callbacks:i}=t,s=i.beforeTitle.apply(this,[e]),l=i.title.apply(this,[e]),o=i.afterTitle.apply(this,[e]);let r=[];return r=Zn(r,oi(s)),r=Zn(r,oi(l)),r=Zn(r,oi(o)),r}getBeforeBody(e,t){return fc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return ct(e,l=>{const o={before:[],lines:[],after:[]},r=cc(i,l);Zn(o.before,oi(r.beforeLabel.call(this,l))
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const kS={datetime:Ve.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ve.TIME_WITH_SECONDS,minute:Ve.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};k1._date.override({_id:"luxon",_create:function(n){return Ve.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return kS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Ve.fromFormat(n,e,t):n=Ve.fromISO(n,t):n instanceof Date?n=Ve.fromJSDate(n,t):i==="object"&&!(n instanceof Ve)&&(n=Ve.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function vc(n){let e,t,i;return{c(){e=v("div"),m(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,qt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function wS(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=B(n[1]),t=D(),s=B(i)},m(l,o){S(l,e,o),S(l,t,o),S(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&w(e),l&&w(t),l&&w(s)}}}function SS(n){let e;return{c(){e=B("Loading...")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function TS(n){let e,t,i,s,l,o=n[2]&&vc();function r(f,c){return f[2]?SS:wS}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=D(),i=v("canvas"),s=D(),l=v("div"),u.c(),m(i,"class","chart-canvas svelte-vh4sl8"),Nr(i,"height","250px"),Nr(i,"width","100%"),m(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),m(l,"class","txt-hint m-t-xs txt-right")},m(f,c){S(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),S(f,s,c),S(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=vc(),o.c(),A(o,1),o.m(e,t)):o&&(re(),I(o,1,1,()=>{o=null}),ae()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){I(o)},d(f){f&&w(e),o&&o.d(),n[8](null),f&&w(s),f&&w(l),u.d()}}}function $S(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(p=>{c();for(let h of p)r.push({x:new Date(h.date),y:h.total}),t(1,a+=h.total);r.push({x:new Date,y:void 0})}).catch(p=>{p!=null&&p.isAbort||(c(),console.warn(p),me.errorResponseHandler(p,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Qt(()=>(Io.register(Ii,Zo,Ko,eu,Ll,K3,tS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:p=>p.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:p=>p.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(p){se[p?"unshift":"push"](()=>{l=p,t(0,l)})}return n.$$set=p=>{"filter"in p&&t(3,i=p.filter),"presets"in p&&t(4,s=p.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function k(T){return T instanceof a?new a(T.type,k(T.content),T.alias):Array.isArray(T)?T.map(k):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++l}),k.__id},clone:function k(T,$){$=$||{};var M,C;switch(r.util.type(T)){case"Object":if(C=r.util.objId(T),$[C])return $[C];M={},$[C]=M;for(var O in T)T.hasOwnProperty(O)&&(M[O]=k(T[O],$));return M;case"Array":return C=r.util.objId(T),$[C]?$[C]:(M=[],$[C]=M,T.forEach(function(E,P){M[P]=k(E,$)}),M);default:return T}},getLanguage:function(k){for(;k;){var T=s.exec(k.className);if(T)return T[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,T){k.className=k.className.replace(RegExp(s,"gi"),""),k.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(k){var T=document.getElementsByTagName("script");for(var $ in T)if(T[$].src==k)return T[$]}return null}},isActive:function(k,T,$){for(var M="no-"+T;k;){var C=k.classList;if(C.contains(T))return!0;if(C.contains(M))return!1;k=k.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(k,T){var $=r.util.clone(r.languages[k]);for(var M in T)$[M]=T[M];return $},insertBefore:function(k,T,$,M){M=M||r.languages;var C=M[k],O={};for(var E in C)if(C.hasOwnProperty(E)){if(E==T)for(var P in $)$.hasOwnProperty(P)&&(O[P]=$[P]);$.hasOwnProperty(E)||(O[E]=C[E])}var L=M[k];return M[k]=O,r.languages.DFS(r.languages,function(F,N){N===L&&F!=k&&(this[F]=O)}),O},DFS:function k(T,$,M,C){C=C||{};var O=r.util.objId;for(var E in T)if(T.hasOwnProperty(E)){$.call(T,E,T[E],M||E);var P=T[E],L=r.util.type(P);L==="Object"&&!C[O(P)]?(C[O(P)]=!0,k(P,$,null,C)):L==="Array"&&!C[O(P)]&&(C[O(P)]=!0,k(P,$,E,C))}}},plugins:{},highlightAll:function(k,T){r.highlightAllUnder(document,k,T)},highlightAllUnder:function(k,T,$){var M={callback:$,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var C=0,O;O=M.elements[C++];)r.highlightElement(O,T===!0,M.callback)},highlightElement:function(k,T,$){var M=r.util.getLanguage(k),C=r.languages[M];r.util.setLanguage(k,M);var O=k.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=k.textContent,P={element:k,language:M,grammar:C,code:E};function L(N){P.highlightedCode=N,r.hooks.run("before-insert",P),P.element.innerHTML=P.highlightedCode,r.hooks.run("after-highlight",P),r.hooks.run("complete",P),$&&$.call(P.element)}if(r.hooks.run("before-sanity-check",P),O=P.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!P.code){r.hooks.run("complete",P),$&&$.call(P.element);return}if(r.hooks.run("before-highlight",P),!P.grammar){L(r.util.encode(P.code));return}if(T&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(N){L(N.data)},F.postMessage(JSON.stringify({language:P.language,code:P.code,immediateClose:!0}))}else L(r.highlight(P.code,P.grammar,P.language))},highlight:function(k,T,$){var M={code:k,grammar:T,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(k,T){var $=T.rest;if($){for(var M in $)T[M]=$[M];delete T.rest}var C=new c;return d(C,C.head,k),f(k,C,T,C.head,0),h(C)},hooks:{all:{},add:function
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(P+1))}y.textContent=C,t.highlightElement(y)},function(C){_.setAttribute(r,f),y.textContent=C})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),k=0,T;T=y[k++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(MS);const Zs=ca;var kc={},OS={get exports(){return kc},set exports(n){kc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var p=s(f[d]);c+=p,c>r&&(f[d]=`
`+f[d],c=p)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,p="",h="",g=!1,_=0;_<d.length;++_){var y=d[_];y==o.element?g=!0:y.nodeName==="#text"&&(g?h+=y.nodeValue:p+=y.nodeValue,a.removeChild(y),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=p+o.code+h,o.code=r.normalize(o.code,o.settings);else{var k=p+o.element.innerHTML+h;o.element.innerHTML=r.normalize(k,o.settings),o.code=o.element.textContent}}}})})()})(OS);(function(n){var e=[/\b(?:async|sync|yield)\*/,/\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|covariant|default|deferred|do|dynamic|else|enum|export|extends|extension|external|factory|final|finally|for|get|hide|if|implements|import|in|interface|library|mixin|new|null|on|operator|part|rethrow|return|set|show|static|super|switch|sync|this|throw|try|typedef|var|void|while|with|yield)\b/],t=/(^|[^\w.])(?:[a-z]\w*\s*\.\s*)*(?:[A-Z]\w*\s*\.\s*)*/.source,i={pattern:RegExp(t+/[A-Z](?:[\d_A-Z]*[a-z]\w*)?\b/.source),lookbehind:!0,inside:{namespace:{pattern:/^[a-z]\w*(?:\s*\.\s*[a-z]\w*)*(?:\s*\.)?/,inside:{punctuation:/\./}}}};n.languages.dart=n.languages.extend("clike",{"class-name":[i,{pattern:RegExp(t+/[A-Z]\w*(?=\s+\w+\s*[;,=()])/.source),lookbehind:!0,inside:i.inside}],keyword:e,operator:/\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/}),n.languages.insertBefore("dart","string",{"string-literal":{pattern:/r?(?:("""|''')[\s\S]*?\1|(["'])(?:\\.|(?!\2)[^\\\r\n])*\2(?!\2))/,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$(?:\w+|\{(?:[^{}]|\{[^{}]*\})*\})/,lookbehind:!0,inside:{punctuation:/^\$\{?|\}$/,expression:{pattern:/[\s\S]+/,inside:n.languages.dart}}},string:/[\s\S]+/}},string:void 0}),n.languages.insertBefore("dart","class-name",{metadata:{pattern:/@\w+/,alias:"function"}}),n.languages.insertBefore("dart","class-name",{generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:e,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})})(Prism);function DS(n){let e,t,i;return{c(){e=v("div"),t=v("code"),m(t,"class","svelte-10s5tkd"),m(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){S(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&m(e,"class",i)},i:X,o:X,d(s){s&&w(e)}}}function ES(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Zs.highlight(a,Zs.languages[l]||Zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class H1 extends ve{constructor(e){super(),be(this,e,ES,DS,_e,{class:0,content:2,language:3})}}const AS=n=>({}),wc=n=>({}),IS=n=>({}),Sc=n=>({});function Tc(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T=n[4]&&!n[2]&&$c(n);const $=n[19].header,M=Et($,n,n[18],Sc);let C=n[4]&&n[2]&&Cc(n);const O=n[19].default,E=Et(O,n,n[18],null),P=n[19].footer,L=Et(P,n,n[18],wc);return{c(){e=v("div"),t=v("div"),s=D(),l=v("div"),o=v("div"),T&&T.c(),r=D(),M&&M.c(),a=D(),C&&C.c(),u=D(),f=v("div"),E&&E.c(),c=D(),d=v("div"),L&&L.c(),m(t,
<span class="txt">New index</span>`,f=D(),V(c.$$.fragment),m(e,"class","section-title"),m(u,"type","button"),m(u,"class","label label-primary link-fade svelte-167lbwu"),m(r,"class","indexes-list svelte-167lbwu")},m(O,E){S(O,e,E),b(e,t),b(e,s),b(e,l),S(O,o,E),S(O,r,E);for(let P=0;P<y.length;P+=1)y[P]&&y[P].m(r,null);b(r,a),b(r,u),S(O,f,E),q(c,O,E),p=!0,h||(g=K(u,"click",n[5]),h=!0)},p(O,[E]){var L,F,N;if((!p||E&1)&&i!==(i=(((F=(L=O[0])==null?void 0:L.indexes)==null?void 0:F.length)||0)+"")&&le(s,i),E&7){_=((N=O[0])==null?void 0:N.indexes)||[];let R;for(R=0;R<_.length;R+=1){const z=Fc(O,_,R);y[R]?y[R].p(z,E):(y[R]=qc(z),y[R].c(),y[R].m(r,a))}for(;R<y.length;R+=1)y[R].d(1);y.length=_.length}const P={};!d&&E&1&&(d=!0,P.collection=O[0],ke(()=>d=!1)),c.$set(P)},i(O){p||(A(c.$$.fragment,O),p=!0)},o(O){I(c.$$.fragment,O),p=!1},d(O){O&&w(e),O&&w(o),O&&w(r),at(y,O),O&&w(f),n[6](null),j(c,O),h=!1,g()}}}const jc=n=>n.column;function cT(n,e,t){let i;We(n,ti,p=>t(2,i=p));let{collection:s}=e,l;function o(p,h){for(let g=0;g<s.indexes.length;g++)if(s.indexes[g]==p){t(0,s.indexes[g]=h,s),ci("indexes."+g);return}s.indexes.push(h),t(0,s)}const r=(p,h)=>l==null?void 0:l.show(p,h),a=()=>l==null?void 0:l.show();function u(p){se[p?"unshift":"push"](()=>{l=p,t(1,l)})}function f(p){s=p,t(0,s)}const c=p=>{for(let h=0;h<s.indexes.length;h++)if(s.indexes[h]==p.detail){s.indexes.splice(h,1),ci("indexes."+h);break}t(0,s)},d=p=>{o(p.detail.old,p.detail.new)};return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},[s,l,i,o,r,a,u,f,c,d]}class dT extends ve{constructor(e){super(),be(this,e,cT,fT,_e,{collection:0})}}function Vc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Hc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function c(...d){return n[5](n[6],...d)}return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),o=B(l),r=D(),m(t,"class","icon "+n[6].icon+" svelte-1p626x7"),m(s,"class","txt"),m(e,"tabindex","0"),m(e,"class","dropdown-item closable svelte-1p626x7")},m(d,p){S(d,e,p),b(e,t),b(e,i),b(e,s),b(s,o),b(e,r),a||(u=[K(e,"click",$n(f)),K(e,"keydown",$n(c))],a=!0)},p(d,p){n=d},d(d){d&&w(e),a=!1,Ae(u)}}}function pT(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Hc(Vc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Vc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Hc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){at(i,s),s&&w(e)}}}function mT(n){let e,t,i,s,l,o,r,a,u,f;return o=new qn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[pT]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("i"),i=D(),s=v("div"),s.textContent="New field",l=D(),V(o.$$.fragment),m(t,"class","ri-add-line"),m(s,"class","txt"),m(e,"type","button"),m(e,"class",r=$i(n[0])+" svelte-1p626x7")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(e,l),q(o,e,null),a=!0,u||(f=K(e,"click",n[1]),u=!0)},p(c,[d]){const p={};d&512&&(p.$$scope={dirty:d,ctx:c}),o.$set(p),(!a||d&1&&r!==(r=$i(c[0])+" svelte-1p626x7"))&&m(e,"class",r)},i(c){a||(A(o.$$.fragment,c),a=!0)},o(c){I(o.$$.fragment,c),a=!1},d(c){c&&w(e),j(o),u=!1,f()}}}function hT(n,e,t){let{class:i=""}=e;const s=vt(),l=[{label:"Plain text",value:"text",icon:H.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:H.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:H.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:H.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:H.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:H.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:H.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:H.getFieldTypeIcon("select")},{label:"File",value:"file",icon:H.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:H.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:H.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$s
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function YT(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[4](_)}let g={id:n[12]+".options.onlyDomains",disabled:!H.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(g.value=n[0].options.onlyDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]+".options.onlyDomains"),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]+".options.onlyDomains"))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]+".options.onlyDomains"),y&1&&(k.disabled=!H.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function KT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[WT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[YT,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),m(t,"class","col-sm-6"),m(l,"class","col-sm-6"),m(e,"class","grid grid-sm")},m(a,u){S(a,e,u),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&w(e),j(i),j(o)}}}function JT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[KT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function ZT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(_){n.$$.not_equal(l.options.exceptDomains,_)&&(l.options.exceptDomains=_,t(0,l))}function a(_){n.$$.not_equal(l.options.onlyDomains,_)&&(l.options.onlyDomains=_,t(0,l))}function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(2,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,c,d,p,h,g]}class W1 extends ve{constructor(e){super(),be(this,e,ZT,JT,_e,{field:0,key:1})}}function GT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new W1({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&6?bt(s,[a&2&&{key:r[1]},a&4&&Vt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function XT(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e;function r(h){l=h,t(0,l)}function a(h){de.call(this,n,h)}function u(h){de.call(this,n,h)}function f(h){de.call(this,n,h)}function c(h){de.call(this,n,h)}function d(h){de.call(this,n,h)}function p(h){de.call(this,n,h)}return n.$$set=h=>{e=Le(Le({},e),jt(h)),t(2,s=Je(e,i)),"field"in h&&t(0,l=h.field),"key"in h&&t(1,o=h.key)},[l,o,s,r,a,u,f,c,d,p]}class QT extends ve{constructor(e){super(),be(this,e,XT,GT,_e,{field:0,key:1})}}function xT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[4]),e.$on(
<span class='flatpickr-weekday'>
`+Y.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var U=ot("div","flatpickr-weekwrapper");U.appendChild(ot("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Y=ot("div","flatpickr-weeks");return U.appendChild(Y),{weekWrapper:U,weekNumbers:Y}}function Z(U,Y){Y===void 0&&(Y=!0);var te=Y?U:U-t.currentMonth;te<0&&t._hidePrevMonthArrow===!0||te>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=te,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,Ge("onYearChange"),R()),N(),Ge("onMonthChange"),Ri())}function ce(U,Y){if(U===void 0&&(U=!0),Y===void 0&&(Y=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Y===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var te=Dr(t.config),oe=te.hours,Te=te.minutes,Ee=te.seconds;p(oe,Te,Ee)}t.redraw(),U&&Ge("onChange")}function he(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ge("onClose")}function Ce(){t.config!==void 0&&Ge("onDestroy");for(var U=t._handlers.length;U--;)t._handlers[U].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var Y=t.calendarContainer.parentNode;if(Y.lastChild&&Y.removeChild(Y.lastChild),Y.parentNode){for(;Y.firstChild;)Y.parentNode.insertBefore(Y.firstChild,Y);Y.parentNode.removeChild(Y)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(te){try{delete t[te]}catch{}})}function Re(U){return t.calendarContainer.contains(U)}function je(U){if(t.isOpen&&!t.config.inline){var Y=yn(U),te=Re(Y),oe=Y===t.input||Y===t.altInput||t.element.contains(Y)||U.path&&U.path.indexOf&&(~U.path.indexOf(t.input)||~U.path.indexOf(t.altInput)),Te=!oe&&!te&&!Re(U.relatedTarget),Ee=!t.config.ignoredFocusElements.some(function(Ie){return Ie.contains(Y)});Te&&Ee&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ye(U){if(!(!U||t.config.minDate&&U<t.config.minDate.getFullYear()||t.config.maxDate&&U>t.config.maxDate.getFullYear())){var Y=U,te=t.currentYear!==Y;t.currentYear=Y||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),te&&(t.redraw(),Ge("onYearChange"),R())}}function $e(U,Y){var te;Y===void 0&&(Y=!0);var oe=t.parseDate(U,void 0,Y);if(t.config.minDate&&oe&&kn(oe,t.config.minDate,Y!==void 0?Y:!t.minDateHasTime)<0||t.config.maxDate&&oe&&kn(oe,t.config.maxDate,Y!==void 0?Y:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
`),r=v("code"),r.textContent="multipart/form-data",a=B(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=B(` field
is a
`),c=v("strong"),c.textContent="plain string",d=B(`:
`),p=v("ul"),h=v("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",g=D(),_=v("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=D(),k=v("li"),k.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=D(),$=v("li"),$.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=D(),C=v("li"),E=B(O),P=B(" is converted to the json "),L=v("code"),L.textContent='{"a":1,"b":2}',F=D(),N=v("li"),N.textContent="numeric strings are converted to json number",R=D(),z=v("li"),z.textContent="double quoted strings are left as they are (aka. without normalizations)",W=D(),J=v("li"),J.textContent="any other string (empty string too) is double quoted",x=B(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),ne=v("code"),ne.textContent='{"data": anything}',m(i,"class","content"),m(t,"class","alert alert-warning m-b-0 m-t-10"),m(e,"class","block")},m(Z,ce){S(Z,e,ce),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,p),b(p,h),b(p,g),b(p,_),b(p,y),b(p,k),b(p,T),b(p,$),b(p,M),b(p,C),b(C,E),b(C,P),b(C,L),b(p,F),b(p,N),b(p,R),b(p,z),b(p,W),b(p,J),b(i,x),b(i,ne),fe=!0},i(Z){fe||(Z&&et(()=>{fe&&(G||(G=qe(e,Mt,{duration:150},!0)),G.run(1))}),fe=!0)},o(Z){Z&&(G||(G=qe(e,Mt,{duration:150},!1)),G.run(0)),fe=!1},d(Z){Z&&w(e),Z&&G&&G.end()}}}function U$(n){let e,t,i,s,l,o,r;function a(d,p){return d[2]?B$:z$}let u=a(n),f=u(n),c=n[2]&&hd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=D(),f.c(),s=D(),c&&c.c(),l=we(),m(t,"class","txt"),m(e,"type","button"),m(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,p){S(d,e,p),b(e,t),b(e,i),f.m(e,null),S(d,s,p),c&&c.m(d,p),S(d,l,p),o||(r=K(e,"click",n[4]),o=!0)},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?p&4&&A(c,1):(c=hd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&w(e),f.d(),d&&w(s),c&&c.d(d),d&&w(l),o=!1,r()}}}function W$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[U$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Le(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ni({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){V(e.$$.fragment)},m(r,a){q(e,r,a),i=!0},p(r,[a]){const u=a&10?bt(s,[a&2&&{key:r[1]},a&8&&Vt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){j(e,r)}}}function Y$(n,e,t){const i=["field","key"];let s=Je(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(_){l=_,t(0,l)}function f(_){de.call(this,n,_)}function c(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function h(_){de.call(this,n,_)}function g(_){de.call(this,n,_)}return n.$$set=_=>{e=Le(Le({},e),jt(_)),t(3,s=Je(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,r,s,a,u,f,c,d,p,h,g]}class K$ extends ve{constructor(e){super(),be(this,e,Y$,W$,_e,{field:0,key:1})}}function J$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=B(t),s=D(),l=v("small"),r=B(o),m(e,"class","txt"),m(l,"class","txt-hint")},m(a,u){S(a,e,u),b(e,i),S(a,s,u),S(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:X,o:X,d(a){a&&w(e),a&&w(s),a&&w(l)}}}function Z$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class _d extends ve{constructor(e){super(),be(this,e,Z$,J$,_e,{item:0})}}const G$=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasi
Leave empty for no restriction.`,position:"top"})),k=!0)},p(C,O){(!y||O&33554432&&l!==(l=C[25]))&&m(e,"for",l);const E={};O&33554432&&(E.id=C[25]),O&8&&(E.items=C[3]),!a&&O&1&&(a=!0,E.keyOfSelected=C[0].options.mimeTypes,ke(()=>a=!1)),r.$set(E);const P={};O&134217729&&(P.$$scope={dirty:O,ctx:C}),_.$set(P)},i(C){y||(A(r.$$.fragment,C),A(_.$$.fragment,C),y=!0)},o(C){I(r.$$.fragment,C),I(_.$$.fragment,C),y=!1},d(C){C&&w(e),C&&w(o),j(r,C),C&&w(u),C&&w(f),j(_),k=!1,T()}}}function tC(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
(eg. 100x50) - crop to WxH viewbox (from center)</li>
<li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li>
<li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li>
<li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li>
<li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li>
<li><strong>Wx0</strong>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,m(e,"class","m-0")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function nC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M;function C(E){n[12](E)}let O={id:n[25],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Fs({props:O}),se.push(()=>ge(r,"value",C)),k=new qn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[tC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=D(),p=v("button"),h=v("span"),h.textContent="Supported formats",g=D(),_=v("i"),y=D(),V(k.$$.fragment),m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[25]),m(c,"class","txt"),m(h,"class","txt link-primary"),m(_,"class","ri-arrow-drop-down-fill"),m(p,"type","button"),m(p,"class","inline-flex flex-gap-0"),m(f,"class","help-block")},m(E,P){S(E,e,P),b(e,t),b(e,i),b(e,s),S(E,o,P),q(r,E,P),S(E,u,P),S(E,f,P),b(f,c),b(f,d),b(f,p),b(p,h),b(p,g),b(p,_),b(p,y),q(k,p,null),T=!0,$||(M=De(ze.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),$=!0)},p(E,P){(!T||P&33554432&&l!==(l=E[25]))&&m(e,"for",l);const L={};P&33554432&&(L.id=E[25]),!a&&P&1&&(a=!0,L.value=E[0].options.thumbs,ke(()=>a=!1)),r.$set(L);const F={};P&134217728&&(F.$$scope={dirty:P,ctx:E}),k.$set(F)},i(E){T||(A(r.$$.fragment,E),A(k.$$.fragment,E),T=!0)},o(E){I(r.$$.fragment,E),I(k.$$.fragment,E),T=!1},d(E){E&&w(e),E&&w(o),j(r,E),E&&w(u),E&&w(f),j(k),$=!1,M()}}}function iC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=B("Max file size"),s=D(),l=v("input"),r=D(),a=v("div"),a.textContent="Must be in bytes.",m(e,"for",i=n[25]),m(l,"type","number"),m(l,"id",o=n[25]),m(l,"step","1"),m(l,"min","0"),m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[0].options.maxSize),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[13]),u=!0)},p(c,d){d&33554432&&i!==(i=c[25])&&m(e,"for",i),d&33554432&&o!==(o=c[25])&&m(l,"id",o),d&1&&ht(l.value)!==c[0].options.maxSize&&ue(l,c[0].options.maxSize)},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function gd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[sC,({uniqueId:s})=>({25:s}),({uniqueId:s})=>s?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","col-sm-3")},m(s,l){S(s,e,l),q(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&167772161&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){I(t.$$.fragment,s),i=!1},d(s){s&&w(e),j(t)}}}function sC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"id",o=n[25]),m(l,"type","number"),m(l,"step","1"),m(l,"min","2"),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.maxSelect),r||(a=K(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&1&&ht(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function lC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[eC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[nC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[iC,({uniqueId:g})=>({25:g}),({uniqueId:g})=>g?33554432:0]},$$scope:{ctx:n}}});let h=!n[2]&&gd(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),a=D(),u=v("div"),V(f.$$.f
<span class="txt">New collection</span>`,m(i,"type","button"),m(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[15]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function fC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33],$$slots:{afterOptions:[uC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[1]&4&&(a.disabled=!o[33]),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function cC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Li({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function dC(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[fC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[cC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function bd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[pC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[mC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),V(t.$$.fragment),i=D(),s=v("div"),V(l.$$.fragment),m(e,"class","col-sm-6"),m(s,"class","col-sm-6")},m(r,a){S(r,e,a),q(t,e,null),S(r,i,a),S(r,s,a),q(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(t.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){r&&w(e),j(t),r&&w(i),r&&w(s),j(l)}}}function pC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Min select"),s=D(),l=v("input"),m(e,"for",i=n[32]),m(l,"type","number"),m(l,"id",o=n[32]),m(l,"step","1"),m(l,"min","1"),m(l,"placeholder","No min limit")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minSelect),r||(a=K(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&m(e,"for",i),f[1]&2&&o!==(o=u[32])&&m(l,"id",o),f[0]&1&&ht(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function mC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Max select"),s=D(),l=v("input"),m(e,"for",i=n[32]),m(l,"type","number"
`),t=v("code"),t.textContent="username",i=B(` ,
`),s=v("code"),s.textContent="email",l=B(` ,
`),o=v("code"),o.textContent="emailVisibility",r=B(` ,
`),a=v("code"),a.textContent="verified",m(t,"class","txt-sm"),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),S(u,s,f),S(u,l,f),S(u,o,f),S(u,r,f),S(u,a,f)},d(u){u&&w(e),u&&w(t),u&&w(i),u&&w(s),u&&w(l),u&&w(o),u&&w(r),u&&w(a)}}}function kd(n,e){let t,i,s,l,o;function r(p){e[7](p,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...p){return e[10](e[19],...p)}function f(...p){return e[11](e[19],...p)}var c=e[1][e[17].type];function d(p){let h={key:p[4](p[17])};return p[17]!==void 0&&(h.field=p[17]),{props:h}}return c&&(i=$t(c,d(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=we(),i&&V(i.$$.fragment),l=we(),this.first=t},m(p,h){S(p,t,h),i&&q(i,p,h),S(p,l,h),o=!0},p(p,h){e=p;const g={};if(h&1&&(g.key=e[4](e[17])),!s&&h&1&&(s=!0,g.field=e[17],ke(()=>s=!1)),h&1&&c!==(c=e[1][e[17].type])){if(i){re();const _=i;I(_.$$.fragment,1,0,()=>{j(_,1)}),ae()}c?(i=$t(c,d(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),V(i.$$.fragment),A(i.$$.fragment,1),q(i,l.parentNode,l)):i=null}else c&&i.$set(g)},i(p){o||(i&&A(i.$$.fragment,p),o=!0)},o(p){i&&I(i.$$.fragment,p),o=!1},d(p){p&&w(t),p&&w(l),i&&j(i,p)}}}function kC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p=[],h=new Map,g,_,y,k,T,$,M,C,O=n[0].isAuth&&yd(),E=n[0].schema;const P=N=>N[17];for(let N=0;N<E.length;N+=1){let R=vd(n,E,N),z=P(R);h.set(z,p[N]=kd(z,R))}_=new _T({props:{class:"btn btn-block btn-outline"}}),_.$on("select",n[12]);function L(N){n[13](N)}let F={};return n[0]!==void 0&&(F.collection=n[0]),$=new dT({props:F}),se.push(()=>ge($,"collection",L)),{c(){e=v("div"),t=v("p"),i=B(`System fields:
`),s=v("code"),s.textContent="id",l=B(` ,
`),o=v("code"),o.textContent="created",r=B(` ,
`),a=v("code"),a.textContent="updated",u=D(),O&&O.c(),f=B(`
.`),c=D(),d=v("div");for(let N=0;N<p.length;N+=1)p[N].c();g=D(),V(_.$$.fragment),y=D(),k=v("div"),T=D(),V($.$$.fragment),m(s,"class","txt-sm"),m(o,"class","txt-sm"),m(a,"class","txt-sm"),m(t,"class","txt-sm"),m(e,"class","block m-b-25"),m(d,"class","accordions schema-fields"),m(k,"class","clearfix m-b-base")},m(N,R){S(N,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),O&&O.m(t,null),b(t,f),S(N,c,R),S(N,d,R);for(let z=0;z<p.length;z+=1)p[z]&&p[z].m(d,null);S(N,g,R),q(_,N,R),S(N,y,R),S(N,k,R),S(N,T,R),q($,N,R),C=!0},p(N,[R]){N[0].isAuth?O||(O=yd(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),R&119&&(E=N[0].schema,re(),p=Ct(p,R,P,1,N,E,h,d,an,kd,null,vd),ae());const z={};!M&&R&1&&(M=!0,z.collection=N[0],ke(()=>M=!1)),$.$set(z)},i(N){if(!C){for(let R=0;R<E.length;R+=1)A(p[R]);A(_.$$.fragment,N),A($.$$.fragment,N),C=!0}},o(N){for(let R=0;R<p.length;R+=1)I(p[R]);I(_.$$.fragment,N),I($.$$.fragment,N),C=!1},d(N){N&&w(e),O&&O.d(),N&&w(c),N&&w(d);for(let R=0;R<p.length;R+=1)p[R].d();N&&w(g),j(_,N),N&&w(y),N&&w(k),N&&w(T),j($,N)}}}function wC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function SC(n,e,t){let i,{collection:s=new hn}=e;const l={text:PT,number:jT,bool:zT,email:W1,url:QT,editor:t$,date:g$,select:H$,json:K$,file:aC,relation:yC};function o($){s.schema[$]&&(s.schema.splice($,1),t(0,s))}function r($="text"){const M=new gn({name:a(),type:$});M.onMountExpand=!0,s.schema.push(M),t(0,s)}function a($="field"){let M="";for(;u($+M);)++M;return $+M}function u($){return!!s.schema.find(M=>M.name===$)}function f($){return i.findIndex(M=>M===$)}function c($,M){var C;!((C=s==null?void 0:s.schema)!=null&&C.length)||$===M||!M||t(0,s.indexes=s.indexes.map(O=>H.replaceIndexColumn(O,$,M)),s)}function d($,M){if(!$)return;$.dataTransfer.dropEffect="move";const C=parseInt($.dataTransfer.getData("text/plain")),O=s.schema;C<M?(O.splice(M+1,0,O[C]),O.splice(C,1)):(O.splice(M,0,O[C]),O.splice(C+1,1)),t(0,s.schema=O,s),_n({})}function p($,M,C,O){C[O]=$,t(0,s)}const h=$=>o($),g=$=>c($.detail.oldName,$.detail.newName),_=($,M)=>wC(M.detail,$),y=($,M)=>d(M.detail,$),k=$=>r($.detail);function T($){s=$,t(0,s)}return n.$$set=$=>{"collection"in $&&t(0,s=$.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&(t(0,s=s||new hn),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter($=>!$.toDelete)||[])},[s,l,o,r,f,c,d,p,h,g,_,y,k,T]}class TC extends ve{constructor(e){super(),be(this,e,SC,kC,_e,{collection:0})}}const $C=n=>({isAdminOnly:n&256}),wd=n=>({isAdminOnly:n[8]});function CC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[8]?"disabled":""),name:n[3],$$slots:{default:[EC,({uniqueId:i})=>({17:i}),({uniqueId:i})=>i?131072:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&272&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[8]?"disabled":"")),s&8&&(l.name=i[3]),s&147815&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function MC(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',m(e,"class","txt-center")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function OC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[10]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function DC(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-lock-unlock-line"></i>
<span class="txt">Enable custom rule</span>`,m(e,"type","button"),m(e,"class","btn btn-sm btn-transparent btn-success lock-toggle svelte-5uq9tk")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[9]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function EC(n){let e,t,i,s,l,o=n[8]?"Admins only":"Custom rule",r,a,u,f,c,d,p,h,g;function _(E,P){return E[8]?DC:OC}let y=_(n),k=y(n);function T(E){n[13](E)}var $=n[6];function M(E){let P={id:E[17],baseCollection:E[1],disabled:E[8],placeholder:E[8]?"":"Leave empty to grant everyone access..."};return E[0]!==void 0&&(P.value=E[0]),{props:P}}$&&(c=$t($,M(n)),n[12](c),se.push(()=>ge(c,"value",T)));const C=n[11].default,O=Et(C,n,n[14],wd);return{c(){e=v("label"),t=v("span"),i=B(n[2]),s=D(),l=v("span"),r=B(o),a=D(),k.c(),f=D(),c&&V(c.$$.fragment),p=D(),h=v("div"),O&&O.c(),m(t,"class","txt"),Q(t,"txt-hint",n[8]),m(l,"class","label label-sm svelte-5uq9tk"),m(e,"for",u=n[17]),m(e,"class","svelte-5uq9tk"),m(h,"class","help-block")},m(E,P){S(E,e,P),b(e,t),b(t,i),b(e,s),b(e,l),b(l,r),b(e,a),k.m(e,null),S(E,f,P),c&&q(c,E,P),S(E,p,P),S(E,h,P),O&&O.m(h,null),g=!0},p(E,P){(!g||P&4)&&le(i,E[2]),(!g||P&256)&&Q(t,"txt-hint",E[8]),(!g||P&256)&&o!==(o=E[8]?"Admins only":"Custom rule")&&le(r,o),y===(y=_(E))&&k?k.p(E,P):(k.d(1),k=y(E),k&&(k.c(),k.m(e,null))),(!g||P&131072&&u!==(u=E[17]))&&m(e,"for",u);const L={};if(P&131072&&(L.id=E[17]),P&2&&(L.baseCollection=E[1]),P&256&&(L.disabled=E[8]),P&256&&(L.placeholder=E[8]?"":"Leave empty to grant everyone access..."),!d&&P&1&&(d=!0,L.value=E[0],ke(()=>d=!1)),P&64&&$!==($=E[6])){if(c){re();const F=c;I(F.$$.fragment,1,0,()=>{j(F,1)}),ae()}$?(c=$t($,M(E)),E[12](c),se.push(()=>ge(c,"value",T)),V(c.$$.fragment),A(c.$$.fragment,1),q(c,p.parentNode,p)):c=null}else $&&c.$set(L);O&&O.p&&(!g||P&16640)&&It(O,C,E,E[14],g?At(C,E[14],P,$C):Pt(E[14]),wd)},i(E){g||(c&&A(c.$$.fragment,E),A(O,E),g=!0)},o(E){c&&I(c.$$.fragment,E),I(O,E),g=!1},d(E){E&&w(e),k.d(),E&&w(f),n[12](null),c&&j(c,E),E&&w(p),E&&w(h),O&&O.d(E)}}}function AC(n){let e,t,i,s;const l=[MC,CC],o=[];function r(a,u){return a[7]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=we()},m(a,u){o[e].m(a,u),S(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){I(t),s=!1},d(a){o[e].d(a),a&&w(i)}}}let Sd;function IC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,c=null,d=null,p=Sd,h=!1;g();async function g(){p||h||(t(7,h=!0),t(6,p=(await rt(()=>import("./FilterAutocompleteInput-2b0e39bf.js"),["./FilterAutocompleteInput-2b0e39bf.js","./index-20adcf24.js"],import.meta.url)).default),Sd=p,t(7,h=!1))}async function _(){t(0,r=d||""),await rn(),c==null||c.focus()}async function y(){d=r,t(0,r=null)}function k($){se[$?"unshift":"push"](()=>{c=$,t(5,c)})}function T($){r=$,t(0,r)}return n.$$set=$=>{"collection"in $&&t(1,o=$.collection),"rule"in $&&t(0,r=$.rule),"label"in $&&t(2,a=$.label),"formKey"in $&&t(3,u=$.formKey),"required"in $&&t(4,f=$.required),"$$scope"in $&&t(14,l=$.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(8,i=r===null)},[r,o,a,u,f,c,p,h,i,_,y,s,k,T,l]}class Ts extends ve{constructor(e){super(),be(this,e,IC,AC,_e,{collection:1,rule:0,label:2,formKey:3,required:4})}}function Td(n,e,t){const i=n.slice();return i[10]=e[t],i}function $d(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P=n[2],L=[];for(let F=0;F<P.length;F+=1)L[F]=Cd(Td(n,P,F));return{c(){e=v("div"),t=v("div"),i=v("div"),s=v("p"),s.textContent="The following record fields are available:",l=D(),o=v("div");for(let F=0;F<L.length;F+=1)L[F].c();r=D(),a=v("hr"),u=D(),f=v("p"),f.innerHTML="The request fields could be accessed with the special <em>@request</em> filter:",c=D(),d=v("div"),d.innerHTML=`<code>@request.headers.*</code>
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.auth.*</code>`,p=D(),h=v("hr"),g=D(),_=v("p"),_.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",y=D(),k=v("div"),k.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=D(),$=v("hr"),M=D(),C=v("p"),C.innerHTML=`Example rule:
<br/>
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,m(s,"class","m-b-0"),m(o,"class","inline-flex flex-gap-5"),m(a,"class","m-t-10 m-b-5"),m(f,"class","m-b-0"),m(d,"class","inline-flex flex-gap-5"),m(h,"class","m-t-10 m-b-5"),m(_,"class","m-b-0"),m(k,"class","inline-flex flex-gap-5"),m($,"class","m-t-10 m-b-5"),m(i,"class","content"),m(t,"class","alert alert-warning m-0")},m(F,N){S(F,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R<L.length;R+=1)L[R]&&L[R].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,p),b(i,h),b(i,g),b(i,_),b(i,y),b(i,k),b(i,T),b(i,$),b(i,M),b(i,C),E=!0},p(F,N){if(N&4){P=F[2];let R;for(R=0;R<P.length;R+=1){const z=Td(F,P,R);L[R]?L[R].p(z,N):(L[R]=Cd(z),L[R].c(),L[R].m(o,null))}for(;R<L.length;R+=1)L[R].d(1);L.length=P.length}},i(F){E||(F&&et(()=>{E&&(O||(O=qe(e,Mt,{duration:150},!0)),O.run(1))}),E=!0)},o(F){F&&(O||(O=qe(e,Mt,{duration:150},!1)),O.run(0)),E=!1},d(F){F&&w(e),at(L,F),F&&O&&O.end()}}}function Cd(n){let e,t=n[10]+"",i;return{c(){e=v("code"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&w(e)}}}function Md(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Ts({props:c}),se.push(()=>ge(e,"rule",f));function d(_){n[7](_)}let p={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(p.rule=n[0].updateRule),s=new Ts({props:p}),se.push(()=>ge(s,"rule",d));function h(_){n[8](_)}let g={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(g.rule=n[0].deleteRule),r=new Ts({props:g}),se.push(()=>ge(r,"rule",h)),{c(){V(e.$$.fragment),i=D(),V(s.$$.fragment),o=D(),V(r.$$.fragment)},m(_,y){q(e,_,y),S(_,i,y),q(s,_,y),S(_,o,y),q(r,_,y),u=!0},p(_,y){const k={};y&1&&(k.collection=_[0]),!t&&y&1&&(t=!0,k.rule=_[0].createRule,ke(()=>t=!1)),e.$set(k);const T={};y&1&&(T.collection=_[0]),!l&&y&1&&(l=!0,T.rule=_[0].updateRule,ke(()=>l=!1)),s.$set(T);const $={};y&1&&($.collection=_[0]),!a&&y&1&&(a=!0,$.rule=_[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(s.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){j(e,_),_&&w(i),j(s,_),_&&w(o),j(r,_)}}}function Od(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",collection:n[0],$$slots:{default:[PC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),se.push(()=>ge(e,"rule",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.collection=o[0]),r&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function PC(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=D(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){S(s,e,l),S(s,t,l),S(s,i,l)},p:X,d(s){s&&w(e),s&&w(t),s&&w(i)}}}function LC(n){var N,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,p,h,g,_,y,k,T,$,M=n[1]&&$d(n);function C(z){n[4](z)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Ts({props:O}),se.push(()=>ge(f,"rule",C));function E(z){n[5](z)}let P={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(P.rule=n[0].viewRule),p=new Ts({props:P}),se.push(()=>ge(p,"rule",E));let L=!((N=n[0])!=null&&N.isView)&&Md(n),F=((R=n[0])==null?void 0:R.isAuth)&&Od(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,s=D(),l=v("button"),r=B(o),a=D(),M&&M.c(),u=D(),V(f.$$.fragment),d=D(),V(p.$$.fragment),g=D(),L&&L.c(),_=D(),F&&F.c(),y=we(),m(l,"type","button"),m(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),m(t,"class","flex txt-sm txt-hint m-b-5"),m(e,"class","block m-b-sm handle"),Q(e,"fade",!n[1])},m(z,W){S(z,e,W),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),M&&M.m(e,null),S(z,u,W),q(f,z,W),S(z,d,W),q(p,z,W),S(z,g,W),L&&L.m(z,W),S(z,_,W),F&&F.m(z,W),S(z,y,W),k=!0,T||($=K(l,"click",n[3]),T=!0)},p(z,[W]){var ne,G;(!k||W&2)&&o!==(o=z[1]?"Hide available fields":"Show available fields")&&le(r,o),z[1]?M?(M.p(z,W),W&2&&A(M,1)):(M=$d(z),M.c(),A(M,1),M.m(e,null)):M&&(re(),I(M,1,1,()=>{M=null}),ae()),(!k||W&2)&&Q(e,"fade",!z[1]);const J={};W&1&&(J.collection=z[0]),!c&&W&1&&(c=!0,J.rule=z[0].listRule,ke(()=>c=!1)),f.$set(J);const x={};W&1&&(x.collection=z[0]),!h&&W&1&&(h=!0,x.rule=z[0].viewRule,ke(()=>h=!1)),p.$set(x),(ne=z[0])!=null&&ne.isView?L&&(re(),I(L,1,1,()=>{L=null}),ae()):L?(L.p(z,W),W&1&&A(L,1)):(L=Md(z),L.c(),A(L,1),L.m(_.parentNode,_)),(G=z[0])!=null&&G.isAuth?F?(F.p(z,W),W&1&&A(F,1)):(F=Od(z),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(re(),I(F,1,1,()=>{F=null}),ae())},i(z){k||(A(M),A(f.$$.fragment,z),A(p.$$.fragment,z),A(L),A(F),k=!0)},o(z){I(M),I(f.$$.fragment,z),I(p.$$.fragment,z),I(L),I(F),k=!1},d(z){z&&w(e),M&&M.d(),z&&w(u),j(f,z),z&&w(d),j(p,z),z&&w(g),L&&L.d(z),z&&w(_),F&&F.d(z),z&&w(y),T=!1,$()}}}function NC(n,e,t){let i,{collection:s=new hn}=e,l=!1;const o=()=>t(1,l=!l);function r(p){n.$$.not_equal(s.listRule,p)&&(s.listRule=p,t(0,s))}function a(p){n.$$.not_equal(s.viewRule,p)&&(s.viewRule=p,t(0,s))}function u(p){n.$$.not_equal(s.createRule,p)&&(s.createRule=p,t(0,s))}function f(p){n.$$.not_equal(s.updateRule,p)&&(s.updateRule=p,t(0,s))}function c(p){n.$$.not_equal(s.deleteRule,p)&&(s.deleteRule=p,t(0,s))}function d(p){n.$$.not_equal(s.options.manageRule,p)&&(s.options.manageRule=p,t(0,s))}return n.$$set=p=>{"collection"in p&&t(0,s=p.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class FC extends ve{constructor(e){super(),be(this,e,NC,LC,_e,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[9]=e[t],i}function RC(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ke(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function qC(n){let e;return{c(){e=v("textarea"),e.disabled=!0,m(e,"rows","7"),m(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function Ed(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Ad(Dd(n,i,l));return{c(){e=v("div"),t=v("div");for(let l=0;l<s.length;l+=1)s[l].c();m(t,"class","content"),m(e,"class","help-block help-block-error")},m(l,o){S(l,e,o),b(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=l[3];let r;for(r=0;r<i.length;r+=1){const a=Dd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Ad(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&w(e),at(s,l)}}}function Ad(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=B(t)},m(s,l){S(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&w(e)}}}function jC(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[qC,RC],p=[];function h(_,y){return _[2]?0:1}l=h(n),o=p[l]=d[l](n);let g=n[3].length&&Ed(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=D(),o.c(),r=D(),a=v("div"),a.innerHTML=`<ul><li>Wildca
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=D(),g&&g.c(),f=we(),m(t,"class","txt"),m(e,"for",i=n[8]),m(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),p[l].m(_,y),S(_,r,y),S(_,a,y),S(_,u,y),g&&g.m(_,y),S(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&m(e,"for",i);let k=l;l=h(_),l===k?p[l].p(_,y):(re(),I(p[k],1,1,()=>{p[k]=null}),ae(),o=p[l],o?o.p(_,y):(o=p[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?g?g.p(_,y):(g=Ed(_),g.c(),g.m(f.parentNode,f)):g&&(g.d(1),g=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&w(e),_&&w(s),p[l].d(_),_&&w(r),_&&w(a),_&&w(u),g&&g.d(_),_&&w(f)}}}function VC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[jC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function HC(n,e,t){let i;We(n,ti,c=>t(4,i=c));let{collection:s=new hn}=e,l,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const p=H.extractColumnsFromQuery((h=s==null?void 0:s.options)==null?void 0:h.query);H.removeByValue(p,"id"),H.removeByValue(p,"created"),H.removeByValue(p,"updated");for(let g in d)for(let _ in d[g]){const y=d[g][_].message,k=p[g]||g;r.push(H.sentenize(k+": "+y))}}Qt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&ci("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class zC extends ve{constructor(e){super(),be(this,e,HC,VC,_e,{collection:0})}}const BC=n=>({active:n&1}),Id=n=>({active:n[0]});function Pd(n){let e,t,i;const s=n[15].default,l=Et(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),m(e,"class","accordion-content")},m(o,r){S(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&It(l,s,o,o[14],i?At(s,o[14],r,null):Pt(o[14]),null)},i(o){i||(A(l,o),o&&et(()=>{i&&(t||(t=qe(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(l,o),o&&(t||(t=qe(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),l&&l.d(o),o&&t&&t.end()}}}function UC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Et(a,n,n[14],Id);let f=n[0]&&Pd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=D(),f&&f.c(),m(t,"type","button"),m(t,"class","accordion-header"),m(t,"draggable",n[2]),Q(t,"interactive",n[3]),m(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){S(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[K(t,"click",ft(n[17])),K(t,"drop",ft(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",ft(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&It(u,a,c,c[14],l?At(a,c[14],d,BC):Pt(c[14]),Id),(!l||d&4)&&m(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Pd(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&m(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){I(u,c),I(f),l=!1},d(c){c&&w(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Ae(r)}}}function WC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=vt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,p=!1;function h(){return!!f}function g(){k(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():g()}function k(){if(d&&o.closest(".accordions")){const L=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const
<span class="txt">Username/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[3]?c?p&8&&A(c,1):(c=Ld(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function XC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowEmailAuth,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Nd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[QC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[xC,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(e,"class","grid grid-sm p-t-sm")},m(u,f){S(u,e,f),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(H.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(c.$$scope={dirty:f,ctx:u}),i.$set(c);const d={};f&1&&(d.class="form-field "+(H.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),o.$set(d)},i(u){a||(A(i.$$.fragment,u),A(o.$$.fragment,u),u&&et(()=>{a&&(r||(r=qe(e,Mt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){I(i.$$.fragment,u),I(o.$$.fragment,u),u&&(r||(r=qe(e,Mt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&w(e),j(i),j(o),u&&r&&r.end()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[7](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(g.value=n[0].options.exceptEmailDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function xC(n){let e,t,i,s,l,o,r,a,u,f,c,d,p;function h(_){n[8](_)}let g={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(g.value=n[0].options.onlyEmailDomains),r=new Fs({props:g}),se.push(()=>ge(r,"value",h)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=D(),s=v("i"),o=D(),V(r.$$.fragment),u=D(),f=v("div"),f.textContent="Use comma as separator.",m(t,"class","txt"),m(s,"class","ri-information-line link-hint"),m(e,"for",l=n[12]),m(f,"class","help-block")},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),q(r,_,y),S(_,u,y),S(_,f,y),c=!0,d||(p=De(ze.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&m(e,"for",l);const k={};y&4096&&(k.id=_[12]),y&1&&(k.disabled=!H.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,k.value=_[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(k)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&w(e),_&&w(o),j(r,_),_&&w(u),_&&w(f),d=!1,p()}}}function e4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[XC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Nd(n);return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Nd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function t4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function n4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Fd(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function i4(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowEmailAuth?n4:t4}let u=a(n),f=u(n),c=n[2]&&Fd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[2]?c?p&4&&A(c,1):(c=Fd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function s4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(s,"for",o=n[12])},m(u,f){S(u,e,f),e.checked=n[0].options.allowOAuth2Auth,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&m(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function Rd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',m(e,"class","block")},m(s,l){S(s,e,l),i=!0},i(s){i||(s&&et(()=>{i&&(t||(t=qe(e,Mt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Mt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&w(e),s&&t&&t.end()}}}function l4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[s4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Rd();return{c(){V(e.$$.fragment),t=D(),l&&l.c(),i=we()},m(o,r){q(e,o,r),S(o,t,r),l&&l.m(o,r),S(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Rd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){I(e.$$.fragment,o),I(l),s=!1},d(o){j(e,o),o&&w(t),l&&l.d(o),o&&w(i)}}}function o4(n){let e;return{c(){e=v("span"),e.textContent="Disabled",m(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function r4(n){let e;return{c(){e=v("span"),e.textContent="Enabled",m(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function qd(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function a4(n){let e,t,i,s,l,o,r;function a(d,p){return d[0].options.allowOAuth2Auth?r4:o4}let u=a(n),f=u(n),c=n[1]&&qd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=D(),i=v("div"),s=D(),f.c(),l=D(),c&&c.c(),o=we(),m(e,"class","inline-flex"),m(i,"class","flex-fill")},m(d,p){S(d,e,p),S(d,t,p),S(d,i,p),S(d,s,p),f.m(d,p),S(d,l,p),c&&c.m(d,p),S(d,o,p),r=!0},p(d,p){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(l.parentNode,l))),d[1]?c?p&2&&A(c,1):(c=qd(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},i(d){r||(A(c),r=!0)},o(d){I(c),r=!1},d(d){d&&w(e),d&&w(t),d&&w(i),d&&w(s),f.d(d),d&&w(l),c&&c.d(d),d&&w(o)}}}function u4(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Minimum password length"),s=D(),l=v("input"),m(e,"for",i=n[12]),m(l,"type","number"),m(l,"id",o=n[12]),l.required=!0,m(l,"min","6"),m(l,"max","72")},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=K(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&m(e,"for",i),f&4096&&o!==(o=u[12])&&m(l,"id",o),f&1&&ht(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function f4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=D(),s=v("label"),l=v("span"),l.textContent="Always require email",o=D(),r=v("i"),m(e,"type","checkbox"),m(e,"id",t=n[12]),m(l,"class","txt"),m(r,"class","ri-information-line txt-sm link-hint"),m(s,"for",a=n[12])},m(c,d){S(c,e,d),e.checked=n[0].options.requireEmail,S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[11]),De(ze.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&m(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&m(s,"for",a)},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,Ae(f)}}}function c4(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return s=new al({props:{single:!0,$$slots:{header:[GC],default:[KC]},$$scope:{ctx:n}}}),o=new al({props:{single:!0,$$slots:{header:[i4],default:[e4]},$$scope:{ctx:n}}}),a=new al({props:{single:!0,$$slots:{header:[a4],default:[l4]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[u4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[f4,({uniqueId:k})=>({12:k}),({uniqueId:k})=>k?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=D(),i=v("div"),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),f=v("hr"),c=D(),d=v("h4"),d.textContent="General",p=D(),V(h.$$.fragment),g=D(),V(_.$$.fragment),m(e,"class","section-title"),m(i,"class","accordions"),m(d,"class","section-title")},m(k,T){S(k,e,T),S(k,t,T),S(k,i,T),q(s,i,null),b(i,l),q(o,i,null),b(i,r),q(a,i,null),S(k,u,T),S(k,f,T),S(k,c,T),S(k,d,T),S(k,p,T),q(h,k,T),S(k,g,T),q(_,k,T),y=!0},p(k,[T]){const $={};T&8201&&($.$$scope={dirty:T,ctx:k}),s.$set($);const M={};T&8197&&(M.$$scope={dirty:T,ctx:k}),o.$set(M);const C={};T&8195&&(C.$$scope={dirty:T,ctx:k}),a.$set(C);const O={};T&12289&&(O.$$scope={dirty:T,ctx:k}),h.$set(O);const E={};T&12289&&(E.$$scope={dirty:T,ctx:k}),_.$set(E)},i(k){y||(A(s.$$.fragment,k),A(o.$$.fragment,k),A(a.$$.fragment,k),A(h.$$.fragment,k),A(_.$$.fragment,k),y=!0)},o(k){I(s.$$.fragment,k),I(o.$$.fragment,k),I(a.$$.fragment,k),I(h.$$.fragment,k),I(_.$$.fragment,k),y=!1},d(k){k&&w(e),k&&w(t),k&&w(i),j(s),j(o),j(a),k&&w(u),k&&w(f),k&&w(c),k&&w(d),k&&w(p),j(h,k),k&&w(g),j(_,k)}}}function d4(n,e,t){let i,s,l,o;We(n,ti,g=>t(4,o=g));let{collection:r=new hn}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function p(){r.options.minPasswordLength=ht(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,_,y,k;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!H.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!H.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,p,h]}class p4 extends ve{constructor(e){super(),be(this,e,d4,c4,_e,{collection:0})}}function jd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Vd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Hd(n,e,t){const i=n.slice();return i[17]=e[t],i}function zd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function Bd(n){var r;let e,t,i,s,l=n[3]&&Ud(n),o=!((r=n[2])!=null&&r.isView)&&Wd(n);return{c(){e=v("h6"),e.textContent="Changes:",t=D(),i=v("ul"),l&&l.c(),s=D(),o&&o.c(),m(i,"class","changes-list svelte-xqpcsf")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Ud(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Wd(a)
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(g,_){S(g,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(g,_){var y,k;_&2&&l!==(l=((y=g[1])==null?void 0:y.name)+"")&&le(o,l),_&4&&c!==(c=((k=g[2])==null?void 0:k.name)+"")&&le(d,c)},d(g){g&&w(e)}}}function Wd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=Yd(Hd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=Kd(Vd(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=Jd(jd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=D();for(let f=0;f<r.length;f+=1)r[f].c();t=D();for(let f=0;f<u.length;f+=1)u[f].c();i=we()},m(f,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);S(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);S(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);S(f,i,c)},p(f,c){if(c&32){s=f[5];let d;for(d=0;d<s.length;d+=1){const p=Hd(f,s,d);l[d]?l[d].p(p,c):(l[d]=Yd(p),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&128){o=f[7];let d;for(d=0;d<o.length;d+=1){const p=Vd(f,o,d);r[d]?r[d].p(p,c):(r[d]=Kd(p),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&64){a=f[6];let d;for(d=0;d<a.length;d+=1){const p=jd(f,a,d);u[d]?u[d].p(p,c):(u[d]=Jd(p),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){at(l,f),f&&w(e),at(r,f),f&&w(t),at(u,f),f&&w(i)}}}function Yd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=v("li"),t=B(`Multiple to single value conversion of field
`),i=v("strong"),l=B(s),o=D(),r=v("em"),r.textContent="(will keep only the last array item)",m(r,"class","txt-sm"),m(e,"class","svelte-xqpcsf")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&w(e)}}}function Kd(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,c=n[17].name+"",d;return{c(){e=v("li"),t=v("div"),i=B(`Renamed field
`),s=v("strong"),o=B(l),r=D(),a=v("i"),u=D(),f=v("strong"),d=B(c),m(s,"class","txt-strikethrough txt-hint"),m(a,"class","ri-arrow-right-line txt-sm"),m(f,"class","txt"),m(t,"class","inline-flex"),m(e,"class","svelte-xqpcsf")},m(p,h){S(p,e,h),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(p,h){h&128&&l!==(l=p[17].originalName+"")&&le(o,l),h&128&&c!==(c=p[17].name+"")&&le(d,c)},d(p){p&&w(e)}}}function Jd(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=v("li"),t=B("Removed field "),i=v("span"),l=B(s),o=D(),m(i,"class","txt-bold"),m(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&w(e)}}}function m4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&zd(),f=n[8]&&Bd(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=D(),u&&u.c(),r=D(),f&&f.c(),a=we(),m(t,"class","icon"),m(s,"class","content txt-bold"),m(e,"class","alert alert-warning")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),S(c,r,d),f&&f.m(c,d),S(c,a,d)},p(c,d){c[6].length?u||(u=zd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[8]?f?f.p(c,d):(f=Bd(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&w(e),u&&u.d(),c&&w(r),f&&f.d(c),c&&w(a)}}}function h4(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function _4(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn btn-expanded")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),s||(l=[K(e,"click",n[11]),K(i,"click",n[12])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function g4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[_4],header:[h4],default:[m4]},$$scope:{ctx:n}};return e=new bn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[13](null),j(e,s)}}}function b4(n,e,t){let i,s,l,o,r;const a=vt();let u,f,c;async function d($,M){t(1,f=$),t(2,c=M),await rn(),i||s.length||l.length||o.length?u==null||u.show():h()}function p(){u==null||u.hide()}function h(){p(),a("confirm")}const g=()=>p(),_=()=>h();function y($){se[$?"unshift":"push"](()=>{u=$,t(4,u)})}function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$.update=()=>{var $,M,C;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(c==null?void 0:c.name)),n.$$.dirty&4&&t(7,s=(($=c==null?void 0:c.schema)==null?void 0:$.filter(O=>O.id&&!O.toDelete&&O.originalName!=O.name))||[]),n.$$.dirty&4&&t(6,l=((M=c==null?void 0:c.schema)==null?void 0:M.filter(O=>O.id&&O.toDelete))||[]),n.$$.dirty&6&&t(5,o=((C=c==null?void 0:c.schema)==null?void 0:C.filter(O=>{var P,L,F;const E=(P=f==null?void 0:f.schema)==null?void 0:P.find(N=>N.id==O.id);return E?((L=E.options)==null?void 0:L.maxSelect)!=1&&((F=O.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(c!=null&&c.isView)||i)},[p,f,c,i,u,o,l,s,r,h,d,g,_,y,k,T]}class v4 extends ve{constructor(e){super(),be(this,e,b4,g4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function Zd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function y4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new TC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function k4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new zC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function Gd(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new FC({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item active")},m(r,a){S(r,e,a),q(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){I(t.$$.fragment,r),s=!1},d(r){r&&w(e),j(t)}}}function Xd(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new p4({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=v("div"),V(t.$$.fragment),m(e,"class","tab-item"),Q(e,"active",n[3]===Es)},m(r,a){S(r,e,a),q(t,e,null),s=!0},p
<span class="txt">Duplicate</span>`,t=D(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable"),m(i,"type","button"),m(i,"class","dropdown-item txt-danger closable")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[24]),K(i,"click",$n(ft(n[25])))],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function xd(n){let e,t,i,s;return i=new qn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[T4]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=D(),V(i.$$.fragment),m(e,"class","ri-arrow-down-s-fill")},m(l,o){S(l,e,o),S(l,t,o),q(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){I(i.$$.fragment,l),s=!1},d(l){l&&w(e),l&&w(t),j(i,l)}}}function ep(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,c;function d(){return n[27](n[47])}return{c(){e=v("button"),t=v("i"),s=D(),l=v("span"),r=B(o),a=B(" collection"),u=D(),m(t,"class",i=$i(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),m(l,"class","txt"),m(e,"type","button"),m(e,"class","dropdown-item closable"),Q(e,"selected",n[47]==n[2].type)},m(p,h){S(p,e,h),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=K(e,"click",d),f=!0)},p(p,h){n=p,h[0]&64&&i!==(i=$i(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&m(t,"class",i),h[0]&64&&o!==(o=n[48]+"")&&le(r,o),h[0]&68&&Q(e,"selected",n[47]==n[2].type)},d(p){p&&w(e),f=!1,c()}}}function T4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=ep(Zd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=we()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);S(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=Zd(s,t,o);i[o]?i[o].p(r,l):(i[o]=ep(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){at(i,s),s&&w(e)}}}function tp(n){let e;return{c(){e=v("div"),e.textContent="System collection",m(e,"class","help-block")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function $4(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y=(n[6][n[2].type]||"N/A")+"",k,T,$,M,C,O,E,P,L,F=n[2].isNew&&xd(n),N=n[2].system&&tp();return{c(){e=v("label"),t=B("Name"),s=D(),l=v("input"),f=D(),c=v("div"),d=v("button"),p=v("span"),h=D(),g=v("span"),_=B("Type: "),k=B(y),T=D(),F&&F.c(),C=D(),N&&N.c(),O=we(),m(e,"for",i=n[46]),m(l,"type","text"),m(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],m(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,m(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,m(g,"class","txt"),m(d,"type","button"),m(d,"class",$="btn btn-sm p-r-10 p-l-10 "+(n[2].isNew?"btn-outline":"btn-transparent")),d.disabled=M=!n[2].isNew,m(c,"class","form-field-addon")},m(R,z){S(R,e,z),b(e,t),S(R,s,z),S(R,l,z),S(R,f,z),S(R,c,z),b(c,d),b(d,p),b(d,h),b(d,g),b(g,_),b(g,k),b(d,T),F&&F.m(d,null),S(R,C,z),N&&N.m(R,z),S(R,O,z),E=!0,n[2].isNew&&l.focus(),P||(L=K(l,"input",n[26]),P=!0)},p(R,z){(!E||z[1]&32768&&i!==(i=R[46]))&&m(e,"for",i),(!E||z[1]&32768&&o!==(o=R[46]))&&m(l,"id",o),(!E||z[0]&8192)&&(l.disabled=R[13]),(!E||z[0]&4&&r!==(r=R[2].isNew))&&(l.autofocus=r),(!E||z[0]&4&&a!==(a=R[2].isAuth?'eg. "users"':'eg. "posts"'))&&m(l,"placeholder",a),(!E||z[0]&4&&u!==(u=R[2].name)&&l.value!==u)&&(l.value=u),(!E||z[0]&68)&&y!==(y=(R[6][R[2].type]||"N/A")+"")&&le(k,y),R[2].isNew?F?(F.p(R,z),z[0]&4&&A(F,1)):(F=xd(R),F.c(),A(F,1),F.m(d,null)):F&&(re(),I(F,1,1,()=>{F=null}),ae()),(!E||z[0]&4&&$!==($="btn btn-sm p-r-10 p-l-10 "+(R[2].isNew?"btn-outline":"btn-transparent")))&&m(d,"class",$),(!E||z[0]&4&&M!==(M=!R[2].isNew))&&(d.disabled=M),R[2].system?N||(N=tp(),N.c(),N.m(O.parentNode,O)):N&&(N.d(1),N=null)},i(R){E||(A(F),E=!0)},o(R){I(F),E=!1},d(R){R&&w(e),R&&w(s),R&&w(l),R&&w(f),R&&w(c),F&&F.d(),R&&w(C),N&&N.d(R),R&&w(O),P=!1,L()}}}function np(n){let e,t,i,s,l,o;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(r,a){S(r,e,a),s=!0,l||(o=De(t=ze.call(null,e,n[11])),l=!0)},p(r,a){t&&Bt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&et(()=>{s&&(i||(i=qe(e,qt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,qt
<span class="txt">New collection</span>`,m(t,"type","button"),m(t,"class","btn btn-block btn-outline"),m(e,"class","sidebar-footer")},m(l,o){S(l,e,o),b(e,t),i||(s=K(t,"click",n[12]),i=!0)},p:X,d(l){l&&w(e),i=!1,s()}}}function A4(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],p=new Map,h,g,_,y,k,T,$=n[3];const M=P=>P[15].id;for(let P=0;P<$.length;P+=1){let L=ap(n,$,P),F=M(L);p.set(F,d[P]=cp(F,L))}let C=null;$.length||(C=up(n));let O=!n[7]&&dp(n),E={};return _=new su({props:E}),n[13](_),_.$on("save",n[14]),{c(){e=v("aside"),t=v("header"),i=v("div"),s=v("div"),l=v("button"),l.innerHTML='<i class="ri-close-line"></i>',o=D(),r=v("input"),a=D(),u=v("hr"),f=D(),c=v("div");for(let P=0;P<d.length;P+=1)d[P].c();C&&C.c(),h=D(),O&&O.c(),g=D(),V(_.$$.fragment),m(l,"type","button"),m(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),m(s,"class","form-field-addon"),m(r,"type","text"),m(r,"placeholder","Search collections..."),m(i,"class","form-field search"),Q(i,"active",n[4]),m(t,"class","sidebar-header"),m(u,"class","m-t-5 m-b-xs"),m(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),m(e,"class","page-sidebar collection-sidebar")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),ue(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let F=0;F<d.length;F+=1)d[F]&&d[F].m(c,null);C&&C.m(c,null),b(e,h),O&&O.m(e,null),S(P,g,L),q(_,P,L),y=!0,k||(T=[K(l,"click",n[10]),K(r,"input",n[11])],k=!0)},p(P,[L]){(!y||L&16)&&Q(l,"hidden",!P[4]),L&1&&r.value!==P[0]&&ue(r,P[0]),(!y||L&16)&&Q(i,"active",P[4]),L&42&&($=P[3],d=Ct(d,L,M,1,P,$,p,c,ns,cp,null,ap),!$.length&&C?C.p(P,L):$.length?C&&(C.d(1),C=null):(C=up(P),C.c(),C.m(c,null))),(!y||L&64)&&Q(c,"fade",P[6]),(!y||L&8)&&Q(c,"sidebar-content-compact",P[3].length>20),P[7]?O&&(O.d(1),O=null):O?O.p(P,L):(O=dp(P),O.c(),O.m(e,null));const F={};_.$set(F)},i(P){y||(A(_.$$.fragment,P),y=!0)},o(P){I(_.$$.fragment,P),y=!1},d(P){P&&w(e);for(let L=0;L<d.length;L+=1)d[L].d();C&&C.d(),O&&O.d(),P&&w(g),n[13](null),j(_,P),k=!1,Ae(T)}}}function I4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function P4(n,e,t){let i,s,l,o,r,a,u;We(n,Di,k=>t(5,o=k)),We(n,Pi,k=>t(9,r=k)),We(n,Lo,k=>t(6,a=k)),We(n,Cs,k=>t(7,u=k));let f,c="";function d(k){Gt(Di,o=k,o)}const p=()=>t(0,c="");function h(){c=this.value,t(0,c)}const g=()=>f==null?void 0:f.show();function _(k){se[k?"unshift":"push"](()=>{f=k,t(2,f)})}const y=k=>{var T;(T=k.detail)!=null&&T.isNew&&k.detail.collection&&d(k.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&I4(),n.$$.dirty&1&&t(1,i=c.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=c!==""),n.$$.dirty&515&&t(3,l=r.filter(k=>k.id==c||k.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,p,h,g,_,y]}class L4 extends ve{constructor(e){super(),be(this,e,P4,A4,_e,{})}}function pp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function mp(n){n[18]=n[19].default}function hp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function _p(n){let e;return{c(){e=v("hr"),m(e,"class","m-t-sm m-b-sm")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function gp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&_p();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=we(),c&&c.c(),s=D(),l=v("button"),r=B(o),a=D(),m(l,"type","button"),m(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(p,h){S(p,t,h),c&&c.m(p,h),S(p,s,h),S(p,l,h),b(l,r),b(l,a),u||(f=K(l,"click",d),u=!0)},p(p,h){e=p,h&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=_p(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),h&8&&o!==(o=e[15].label+"")&&le(r,o),h&40&&Q(l,"active",e[5]===e[14])},d(p){p&&w(t),c&&c.d(p),p&&w(s),p&&w(l),u=!1,f()}}}function bp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:R4,then:F4,catch:N4,value:19,blocks:[,,,]};return uu(t=n[15].component,s),{c(){e=we(),s.block.c()},m(l,o){S(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.an
`),O&&O.c(),d=D(),h.c(),g=we(),m(e,"class","flex m-b-base flex-gap-10"),m(l,"class","list picker-list m-b-base svelte-1u8jhky"),m(f,"class","section-title")},m(N,R){S(N,e,R),q(t,e,null),b(e,i),T&&T.m(e,null),S(N,s,R),S(N,l,R);for(let z=0;z<o.length;z+=1)o[z]&&o[z].m(l,null);C&&C.m(l,null),S(N,u,R),S(N,f,R),b(f,c),O&&O.m(f,null),S(N,d,R),P[p].m(N,R),S(N,g,R),_=!0,y||(k=De(a=iM.call(null,l,n[36])),y=!0)},p(N,R){var J;const z={};R[0]&4&&(z.value=N[2]),R[0]&1024&&(z.autocompleteCollection=N[10]),t.$set(z),(J=N[10])!=null&&J.isView?T&&(T.d(1),T=null):T?T.p(N,R):(T=qp(N),T.c(),T.m(e,null)),R[0]&145324&&($=N[3],re(),o=Ct(o,R,M,1,N,$,r,l,an,zp,null,Rp),ae(),!$.length&&C?C.p(N,R):$.length?C&&(C.d(1),C=null):(C=jp(N),C.c(),C.m(l,null))),a&&Bt(a.update)&&R[0]&2064&&a.update.call(null,N[36]),N[5]>1?O?O.p(N,R):(O=Bp(N),O.c(),O.m(f,null)):O&&(O.d(1),O=null);let W=p;p=L(N),p===W?P[p].p(N,R):(re(),I(P[W],1,1,()=>{P[W]=null}),ae(),h=P[p],h?h.p(N,R):(h=P[p]=E[p](N),h.c()),A(h,1),h.m(g.parentNode,g))},i(N){if(!_){A(t.$$.fragment,N);for(let R=0;R<$.length;R+=1)A(o[R]);A(h),_=!0}},o(N){I(t.$$.fragment,N);for(let R=0;R<o.length;R+=1)I(o[R]);I(h),_=!1},d(N){N&&w(e),j(t),T&&T.d(),N&&w(s),N&&w(l);for(let R=0;R<o.length;R+=1)o[R].d();C&&C.d(),N&&w(u),N&&w(f),O&&O.d(),N&&w(d),P[p].d(N),N&&w(g),y=!1,k()}}}function bM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=B("Select "),i=v("strong"),l=B(s),o=B(" records")},m(a,u){S(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&w(e)}}}function vM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),i=v("button"),i.innerHTML='<span class="txt">Save selection</span>',m(e,"type","button"),m(e,"class","btn btn-transparent"),m(i,"type","button"),m(i,"class","btn")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,Ae(l)}}}function yM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[vM],header:[bM],default:[gM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Le(o,l[a]);e=new bn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new G1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),s=!0},p(a,u){const f=u[0]&524288?bt(l,[l[0],l[1],Vt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&1024&&(c.collection=a[10]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),s=!1},d(a){n[39](null),j(e,a),a&&w(t),n[42](null),j(i,a)}}}const Ar=100;function kM(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=Je(e,c),p;We(n,Pi,Pe=>t(26,p=Pe));const h=vt(),g="picker_"+H.randomString(5);let{value:_}=e,{field:y}=e,k,T,$="",M=[],C=[],O=1,E=0,P=!1,L=!1;function F(){return t(2,$=""),t(3,M=[]),t(6,C=[]),R(),z(!0),k==null?void 0:k.show()}function N(){return k==null?void 0:k.hide()}async function R(){const Pe=H.toArray(_);if(!s||!Pe.length)return;t(24,L=!0);let ie=[];const Se=Pe.slice(),st=[];for(;Se.length>0;){const nt=[];for(const kt of Se.splice(0,Ar))nt.push(`id="${kt}"`);st.push(me.collection(s).getFullList(Ar,{filter:nt.join("||"),$autoCancel:!1}))}try{await Promise.all(st).then(nt=>{ie=ie.concat(...nt)}),t(6,C=[]);for(const nt of Pe){const kt=H.findByKey(ie,"id",nt);kt&&C.push(kt)}$.trim()||t(3,M=H.filterDuplicatesByKey(C.concat(M)))}catch(nt){me.errorResponseHandler(nt)}t(24,L=!1)}async function z(Pe=!1){if(s){t(4,P=!0),Pe&&($.trim()?t(3,M=[]):t(3,M=H.toArray(C).slice()));try{const ie=Pe?1:O+1,Se=await me.collection(s).getList(ie,Ar,{filter:$,sort:o!=null&&o.isView?"":"-created",$cancelKey:g+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(Se.items))),O=Se.page,t(23,E=Se.totalItems)}catch(ie){me.errorResponseHandler(ie)}t(4,P=!1)}}function W(Pe){i==1?t(6,C=[Pe]):u&&(H.pushOrReplaceByKey(C,Pe)
`,m(e,"class","list-item")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Gp(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new Qo({props:{record:n[15],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[8](n[15])}return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=D(),m(t,"class","content"),m(o,"type","button"),m(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),m(l,"class","actions"),m(e,"class","list-item")},m(p,h){S(p,e,h),b(e,t),q(i,t,null),b(e,s),b(e,l),b(l,o),b(e,r),a=!0,u||(f=[De(ze.call(null,o,"Remove")),K(o,"click",c)],u=!0)},p(p,h){var _;n=p;const g={};h&16&&(g.record=n[15]),h&4&&(g.displayFields=(_=n[2].options)==null?void 0:_.displayFields),i.$set(g)},i(p){a||(A(i.$$.fragment,p),a=!0)},o(p){I(i.$$.fragment,p),a=!1},d(p){p&&w(e),j(i),u=!1,Ae(f)}}}function SM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,_,y,k=n[4],T=[];for(let C=0;C<k.length;C+=1)T[C]=Gp(Wp(n,k,C));const $=C=>I(T[C],1,1,()=>{T[C]=null});let M=null;return k.length||(M=Kp(n)),{c(){e=v("label"),t=v("i"),s=D(),l=v("span"),r=B(o),u=D(),f=v("div"),c=v("div");for(let C=0;C<T.length;C+=1)T[C].c();M&&M.c(),d=D(),p=v("div"),h=v("button"),h.innerHTML=`<i class="ri-magic-line"></i>
<span class="txt">Open picker</span>`,m(t,"class",i=$i(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),m(l,"class","txt"),m(e,"for",a=n[14]),m(c,"class","relations-list svelte-1ynw0pc"),m(h,"type","button"),m(h,"class","btn btn-transparent btn-sm btn-block"),m(p,"class","list-item list-item-btn"),m(f,"class","list")},m(C,O){S(C,e,O),b(e,t),b(e,s),b(e,l),b(l,r),S(C,u,O),S(C,f,O),b(f,c);for(let E=0;E<T.length;E+=1)T[E]&&T[E].m(c,null);M&&M.m(c,null),b(f,d),b(f,p),b(p,h),g=!0,_||(y=K(h,"click",n[9]),_=!0)},p(C,O){if((!g||O&4&&i!==(i=$i(H.getFieldTypeIcon(C[2].type))+" svelte-1ynw0pc"))&&m(t,"class",i),(!g||O&4)&&o!==(o=C[2].name+"")&&le(r,o),(!g||O&16384&&a!==(a=C[14]))&&m(e,"for",a),O&181){k=C[4];let E;for(E=0;E<k.length;E+=1){const P=Wp(C,k,E);T[E]?(T[E].p(P,O),A(T[E],1)):(T[E]=Gp(P),T[E].c(),A(T[E],1),T[E].m(c,null))}for(re(),E=k.length;E<T.length;E+=1)$(E);ae(),!k.length&&M?M.p(C,O):k.length?M&&(M.d(1),M=null):(M=Kp(C),M.c(),M.m(c,null))}},i(C){if(!g){for(let O=0;O<k.length;O+=1)A(T[O]);g=!0}},o(C){T=T.filter(Boolean);for(let O=0;O<T.length;O+=1)I(T[O]);g=!1},d(C){C&&w(e),C&&w(u),C&&w(f),at(T,C),M&&M.d(),_=!1,y()}}}function TM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[SM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new wM({props:o}),n[11](i),i.$on("save",n[12]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),s=!1},d(r){n[10](null),j(e,r),r&&w(t),n[11](null),j(i,r)}}}const Xp=100;function $M(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new gn}=e,r,a=[],u=!1;f();async function f(){var $,M;const y=H.toArray(s);if(!(($=o==null?void 0:o.options)!=null&&$.collectionId)||!y.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const k=y.slice(),T=[];for(;k.length>0;){const C=[];for(const O of k.splice(0,Xp))C.push(`id="${O}"`);T.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(Xp,{filter:C.join("||"),$autoCancel:!1}))}try{let C=[];await Promise.all(T).then(O=>{C=C.concat(...O)});for(const O of y){const E=H.findByKey(C,"id",O);E&&a.push(E)}t(4,a)}catch(C){me.errorResponseHandler(C)}t(5,u=!1)}function c(y){var k;H.removeByKey(a,"id",y.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((k=a[0])==null?void 0:k.id)||"")}const d=y=>c(y),p=()=>l==null?void 0:l.show();function h(y){se[y?"unshift":"push"](()=>{r=y,t(3,r)})}function g(y){se[y?"unshift":"push"](()=>{l=y,t(1,l)})}const _=y=>{var k;t(4,a=y.detail||[]),t(0,s=i?a.map(T=>T.id):((k=a[0])==null?void 0:k.id)||"")};return n.$$set=y=>{"value"in y&&t(0,s=y.value),"picker"in y&&t(1,l=y.picker),"field"in y&&t(2,o=y.field)},n.$$.update=()=>{var y;n.$$.dirty&4&&t(6,i=((y=o.options)==null?void 0:y.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,c,d,p,h,g,_]}class CM extends ve{constructor(e){super(),be(this,e,$M,TM,_e,{value:0,picker:1,field:2})}}const MM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],OM=(n,
...
-----END PRIVATE KEY-----`),m(a,"class","help-block")},m(c,d){S(c,e,d),b(e,t),S(c,s,d),S(c,l,d),ue(l,n[5]),S(c,r,d),S(c,a,d),u||(f=K(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&m(e,"for",i),d&8388608&&o!==(o=c[23])&&m(l,"id",o),d&32&&ue(l,c[5])},d(c){c&&w(e),c&&w(s),c&&w(l),c&&w(r),c&&w(a),u=!1,f()}}}function lO(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[eO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[tO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[nO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[iO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[sO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),a=D(),u=v("div"),V(f.$$.fragment),c=D(),d=v("div"),V(p.$$.fragment),h=D(),V(g.$$.fragment),m(i,"class","col-lg-6"),m(o,"class","col-lg-6"),m(u,"class","col-lg-6"),m(d,"class","col-lg-6"),m(t,"class","grid"),m(e,"id",n[9]),m(e,"autocomplete","off")},m(T,$){S(T,e,$),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),b(t,a),b(t,u),q(f,u,null),b(t,c),b(t,d),q(p,d,null),b(t,h),q(g,t,null),_=!0,y||(k=K(e,"submit",ft(n[17])),y=!0)},p(T,$){const M={};$&25165828&&(M.$$scope={dirty:$,ctx:T}),s.$set(M);const C={};$&25165832&&(C.$$scope={dirty:$,ctx:T}),r.$set(C);const O={};$&25165840&&(O.$$scope={dirty:$,ctx:T}),f.$set(O);const E={};$&25165888&&(E.$$scope={dirty:$,ctx:T}),p.$set(E);const P={};$&25165856&&(P.$$scope={dirty:$,ctx:T}),g.$set(P)},i(T){_||(A(s.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(p.$$.fragment,T),A(g.$$.fragment,T),_=!0)},o(T){I(s.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(p.$$.fragment,T),I(g.$$.fragment,T),_=!1},d(T){T&&w(e),j(s),j(r),j(f),j(p),j(g),y=!1,k()}}}function oO(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function rO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("i"),o=D(),r=v("span"),r.textContent="Generate and set secret",m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[7],m(l,"class","ri-key-line"),m(r,"class","txt"),m(s,"type","submit"),m(s,"form",n[9]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function aO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[rO],header:[oO],default:[lO]},$$scope:{ctx:n}};return e=new bn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[19](null),j(e,s)}}}const po=15777e3;function uO(n,e,t){let i;const s=vt(),l="apple_secret_"+H.randomString(5);let o,r,a,u,f,c,d=!1;function p(L={}){t(2,r=L.clientId||""),t(3,a=L.teamId||""),t(4,u=L.keyId||""),t(5,f=L.privateKey||""),t(6,c=L.duration||po),_n({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function g(){t(7,d=!0);try{const L=await me.send("/api/settings/apple/generate-client-secret",{method:"POST",body:{teamId:a,clientId:r,keyId:u,privateKey:f.trim(),duration:c}});t(7,d=!1),Ut("Successfully generated cl
Updated: ${n[2].updated}`,position:"left"})),_=!0)},p(k,T){T[1]&8388608&&r!==(r=k[54])&&m(e,"for",r),c&&Bt(c.update)&&T[0]&4&&c.update.call(null,{text:`Created: ${k[2].created}
Updated: ${k[2].updated}`,position:"left"}),T[1]&8388608&&h!==(h=k[54])&&m(p,"id",h),T[0]&4&&g!==(g=k[2].id)&&p.value!==g&&(p.value=g)},d(k){k&&w(e),k&&w(a),k&&w(u),k&&w(d),k&&w(p),_=!1,y()}}}function im(n){var u,f;let e,t,i,s,l;function o(c){n[29](c)}let r={collection:n[0]};n[2]!==void 0&&(r.record=n[2]),e=new X4({props:r}),se.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&sm();return{c(){V(e.$$.fragment),i=D(),a&&a.c(),s=we()},m(c,d){q(e,c,d),S(c,i,d),a&&a.m(c,d),S(c,s,d),l=!0},p(c,d){var h,g;const p={};d[0]&1&&(p.collection=c[0]),!t&&d[0]&4&&(t=!0,p.record=c[2],ke(()=>t=!1)),e.$set(p),(g=(h=c[0])==null?void 0:h.schema)!=null&&g.length?a||(a=sm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){I(e.$$.fragment,c),l=!1},d(c){j(e,c),c&&w(i),a&&a.d(c),c&&w(s)}}}function sm(n){let e;return{c(){e=v("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function kO(n){let e,t,i;function s(o){n[42](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new CM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function wO(n){let e,t,i,s,l;function o(f){n[39](f,n[51])}function r(f){n[40](f,n[51])}function a(f){n[41](f,n[51])}let u={field:n[51],record:n[2]};return n[2][n[51].name]!==void 0&&(u.value=n[2][n[51].name]),n[3][n[51].name]!==void 0&&(u.uploadedFiles=n[3][n[51].name]),n[4][n[51].name]!==void 0&&(u.deletedFileIndexes=n[4][n[51].name]),e=new nM({props:u}),se.push(()=>ge(e,"value",o)),se.push(()=>ge(e,"uploadedFiles",r)),se.push(()=>ge(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){q(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[51]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[51].name],ke(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[51].name],ke(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[51].name],ke(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){I(e.$$.fragment,f),l=!1},d(f){j(e,f)}}}function SO(n){let e,t,i;function s(o){n[38](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new I5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function TO(n){let e,t,i;function s(o){n[37](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new O5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function $O(n){let e,t,i;function s(o){n[36](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new T5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function CO(n){let e,t,i;function s(o){n[35](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new qM({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){q(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[51]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[51].name],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){j(e,o)}}}function MO(n){let e,t,i;function s(o){n[34](o,n[51])}let l={field:n[51]};return n[2][n[51].name]!==void 0&&(l.value=n[2][n[51].name]),e=new y5({props:l}),se.push(()=>ge(e,"value",s)),{c(){V(
<span class="txt">Send verification email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[23]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function um(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,m(e,"type","button"),m(e,"class","dropdown-item closable")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[24]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function PO(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[7].verified&&n[7].email&&am(n),u=n[0].isAuth&&n[7].email&&um(n);return{c(){a&&a.c(),e=D(),u&&u.c(),t=D(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
<span class="txt">Duplicate</span>`,s=D(),l=v("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,m(i,"type","button"),m(i,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),S(f,e,c),u&&u.m(f,c),S(f,t,c),S(f,i,c),S(f,s,c),S(f,l,c),o||(r=[K(i,"click",n[25]),K(l,"click",$n(ft(n[26])))],o=!0)},p(f,c){f[0].isAuth&&!f[7].verified&&f[7].email?a?a.p(f,c):(a=am(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[7].email?u?u.p(f,c):(u=um(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&w(e),u&&u.d(f),f&&w(t),f&&w(i),f&&w(s),f&&w(l),o=!1,Ae(r)}}}function fm(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=D(),s=v("button"),s.textContent="Authorized providers",m(t,"type","button"),m(t,"class","tab-item"),Q(t,"active",n[10]===xi),m(s,"type","button"),m(s,"class","tab-item"),Q(s,"active",n[10]===kl),m(e,"class","tabs-header stretched")},m(r,a){S(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[K(t,"click",n[27]),K(s,"click",n[28])],l=!0)},p(r,a){a[0]&1024&&Q(t,"active",r[10]===xi),a[0]&1024&&Q(s,"active",r[10]===kl)},d(r){r&&w(e),l=!1,Ae(o)}}}function LO(n){var g;let e,t=n[2].isNew?"New":"Edit",i,s,l,o=((g=n[0])==null?void 0:g.name)+"",r,a,u,f,c,d,p=!n[2].isNew&&rm(n),h=n[0].isAuth&&!n[2].isNew&&fm(n);return{c(){e=v("h4"),i=B(t),s=D(),l=v("strong"),r=B(o),a=B(" record"),u=D(),p&&p.c(),f=D(),h&&h.c(),c=we()},m(_,y){S(_,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),S(_,u,y),p&&p.m(_,y),S(_,f,y),h&&h.m(_,y),S(_,c,y),d=!0},p(_,y){var k;(!d||y[0]&4)&&t!==(t=_[2].isNew?"New":"Edit")&&le(i,t),(!d||y[0]&1)&&o!==(o=((k=_[0])==null?void 0:k.name)+"")&&le(r,o),_[2].isNew?p&&(re(),I(p,1,1,()=>{p=null}),ae()):p?(p.p(_,y),y[0]&4&&A(p,1)):(p=rm(_),p.c(),A(p,1),p.m(f.parentNode,f)),_[0].isAuth&&!_[2].isNew?h?h.p(_,y):(h=fm(_),h.c(),h.m(c.parentNode,c)):h&&(h.d(1),h=null)},i(_){d||(A(p),d=!0)},o(_){I(p),d=!1},d(_){_&&w(e),_&&w(u),p&&p.d(_),_&&w(f),h&&h.d(_),_&&w(c)}}}function NO(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),r=B(o),m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent"),e.disabled=n[8],m(l,"class","txt"),m(s,"type","submit"),m(s,"form",n[13]),m(s,"class","btn btn-expanded"),s.disabled=a=!n[11]||n[8],Q(s,"btn-loading",n[8])},m(c,d){S(c,e,d),b(e,t),S(c,i,d),S(c,s,d),b(s,l),b(l,r),u||(f=K(e,"click",n[22]),u=!0)},p(c,d){d[0]&256&&(e.disabled=c[8]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&le(r,o),d[0]&2304&&a!==(a=!c[11]||c[8])&&(s.disabled=a),d[0]&256&&Q(s,"btn-loading",c[8])},d(c){c&&w(e),c&&w(i),c&&w(s),u=!1,f()}}}function FO(n){var s;let e,t,i={class:`
record-panel
`+(n[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[2].isNew?"colored-header":"")+`
`,beforeHide:n[43],$$slots:{footer:[NO],header:[LO],default:[IO]},$$scope:{ctx:n}};return e=new bn({props:i}),n[44](e),e.$on("hide",n[45]),e.$on("show",n[46]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&4101&&(r.class=`
record-panel
`+(l[12]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[2].isNew?"colored-header":"")+`
`),o[0]&544&&(r.beforeHide=l[43]),o[0]&3485|o[1]&16777216&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[44](null),j(e,l)}}}const xi="form",kl="providers";function cm(n){return JSON.stringify(n)}function RO(n,e,t){let i,s,l,o;const r=vt(),a="record_"+H.randomString(5);let{collection:u}=e,f,c=null,d=new Ci,p=!1,h=!1,g={},_={},y="",k=xi;function T(ie){return M(ie),t(9,h=!0),t(10,k=xi),f==null?void 0:f.show()}function $(){return f==null?void 0:f.hide()}async function M(ie){_n({}),t(7,c=ie||{}),ie!=null&&ie.clone?t(2,d=ie.clone()):t(2,d=new Ci),t(3,g={}),t(4,_={}),await rn(),t(20,y=cm(d))}function C(){if(p||!o||!(u!=null&&u.id))return;t(8,p=!0);const ie=E();let Se;d.isNew?Se=me.collection(u.id).create(ie):Se=me.collection(u.id).update(d.id,ie),Se.then(st=>{Ut(d.isNew?"Successfully created record.":"Successfully updated record."),t(9,h=!1),$(),r("save",st)}).catch(st=>{me.errorResponseHandler(st)}).finally(()=>{t(8,p=!1)})}function O(){c!=null&&c.id&&pn("Do you really want to delete the selected record?",()=>me.collection(c.collectionId).delete(c.id).then(()=>{$(),Ut("Successfully deleted record."),r("delete",c)}).catch(ie=>{me.errorResponseHandler(ie)}))}function E(){const ie=(d==null?void 0:d.export())||{},Se=new FormData,st={};for(const nt of(u==null?void 0:u.schema)||[])st[nt.name]=!0;u!=null&&u.isAuth&&(st.username=!0,st.email=!0,st.emailVisibility=!0,st.password=!0,st.passwordConfirm=!0,st.verified=!0);for(const nt in ie)st[nt]&&(typeof ie[nt]>"u"&&(ie[nt]=null),H.addValueToFormData(Se,nt,ie[nt]));for(const nt in g){const kt=H.toArray(g[nt]);for(const xt of kt)Se.append(nt,xt)}for(const nt in _){const kt=H.toArray(_[nt]);for(const xt of kt)Se.append(nt+"."+xt,"")}return Se}function P(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent verification email to ${c.email}?`,()=>me.collection(u.id).requestVerification(c.email).then(()=>{Ut(`Successfully sent verification email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function L(){!(u!=null&&u.id)||!(c!=null&&c.email)||pn(`Do you really want to sent password reset email to ${c.email}?`,()=>me.collection(u.id).requestPasswordReset(c.email).then(()=>{Ut(`Successfully sent password reset email to ${c.email}.`)}).catch(ie=>{me.errorResponseHandler(ie)}))}function F(){l?pn("You have unsaved changes. Do you really want to discard them?",()=>{N()}):N()}async function N(){const ie=c==null?void 0:c.clone();if(ie){ie.id="",ie.created="",ie.updated="";const Se=(u==null?void 0:u.schema)||[];for(const st of Se)st.type==="file"&&delete ie[st.name]}T(ie),await rn(),t(20,y="")}const R=()=>$(),z=()=>P(),W=()=>L(),J=()=>F(),x=()=>O(),ne=()=>t(10,k=xi),G=()=>t(10,k=kl);function fe(ie){d=ie,t(2,d)}function Z(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function ce(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function he(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ce(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Re(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function je(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function ye(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function $e(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ye(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function dt(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}function Ke(ie,Se){n.$$.not_equal(g[Se.name],ie)&&(g[Se.name]=ie,t(3,g))}function Be(ie,Se){n.$$.not_equal(_[Se.name],ie)&&(_[Se.name]=ie,t(4,_))}function ee(ie,Se){n.$$.not_equal(d[Se.name],ie)&&(d[Se.name]=ie,t(2,d))}const Fe=()=>l&&h?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(9,h=!1),$()}),!1):(_n({}),!0);function tt(ie){se[ie?"unshift":"push"](()=>{f=ie,t(6,f)})}function Wt(ie){de.call(this,n,ie)}function Pe(ie){de.call(this,n,ie)}return n.$$set=ie=>{"collection"in ie&&t(0,u=ie.collection)},n.$$.update=()=>{var ie;n.$$.dirty[0]&1&&t(12,i=!!((
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function TD(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[40]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function $D(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[39]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function Vm(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[36](n[55])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=D(),r=v("label"),m(i,"type","checkbox"),m(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],m(r,"for",a="checkbox_"+n[55].id),m(t,"class","form-field"),m(e,"class","bulk-select-col min-width")},m(d,p){S(d,e,p),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[K(i,"change",c),K(t,"click",$n(n[26]))],u=!0)},p(d,p){n=d,p[0]&16&&s!==(s="checkbox_"+n[55].id)&&m(i,"id",s),p[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),p[0]&16&&a!==(a="checkbox_"+n[55].id)&&m(r,"for",a)},d(d){d&&w(e),u=!1,Ae(f)}}}function Hm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new xo({props:{value:n[55].id}});let c=n[2].isAuth&&zm(n);return{c(){e=v("td"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),a=B(r),u=D(),c&&c.c(),m(o,"class","txt"),m(i,"class","label"),m(t,"class","flex flex-gap-5"),m(e,"class","col-type-text col-field-id")},m(d,p){S(d,e,p),b(e,t),b(t,i),q(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,p){const h={};p[0]&16&&(h.value=d[55].id),s.$set(h),(!f||p[0]&16)&&r!==(r=d[55].id+"")&&le(a,r),d[2].isAuth?c?c.p(d,p):(c=zm(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){I(s.$$.fragment,d),f=!1},d(d){d&&w(e),j(s),c&&c.d()}}}function zm(n){let e;function t(l,o){return l[55].verified?MD:CD}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,o){i!==(i=t(l))&&(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&w(e)}}}function CD(n){let e,t,i;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){S(s,e,l),t||(i=De(ze.call(null,e,"Unverified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function MD(n){let e,t,i;return{c(){e=v("i"),m(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){S(s,e,l),t||(i=De(ze.call(null,e,"Verified")),t=!0)},d(s){s&&w(e),t=!1,i()}}}function Bm(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Um(n),o=i&&Wm(n);return{c(){l&&l.c(),t=D(),o&&o.c(),s=we()},m(r,a){l&&l.m(r,a),S(r,t,a),o&&o.m(r,a),S(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Um(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Wm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&w(t),o&&o.d(r),r&&w(s)}}}function Um(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?DD:OD}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),m(e,"class","col-type-text col-field-username")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function OD(n){let e,t=n[55].username+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].username)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&m(e,"title",s)},d(l){l&&w(e)}}}function DD(n){let e;return{c(){e=v("span"),e.textContent="N/A",m(e,"class","txt-hint")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function Wm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?AD:ED}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),m(e,"class","col-type-text col-field-email")},m(o,r){S(o,e,r),l.m(e,null)},p(o,r){s===(s=i(o,r))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,null)))},d(o){o&&w(e),l.d()}}}function ED(n){let e,t=n[55].email+"",i,s;return{c(){e=v("span"),i=B(t),m(e,"class","txt txt-ellipsis"),m(e,"title",s=n[55].email)},m(l,o){S(l,e,o),b(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")
<span class="txt">New record</span>`,m(e,"type","button"),m(e,"class","btn btn-expanded")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[18]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function BD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P,L,F=!n[10]&&th(n);c=new Aa({}),c.$on("refresh",n[16]);let N=!n[2].isView&&nh(n);y=new Wo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function R(J){n[21](J)}function z(J){n[22](J)}let W={collection:n[2]};return n[0]!==void 0&&(W.filter=n[0]),n[1]!==void 0&&(W.sort=n[1]),M=new jD({props:W}),n[20](M),se.push(()=>ge(M,"filter",R)),se.push(()=>ge(M,"sort",z)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=D(),l=v("div"),r=B(o),a=D(),u=v("div"),F&&F.c(),f=D(),V(c.$$.fragment),d=D(),p=v("div"),h=v("button"),h.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,g=D(),N&&N.c(),_=D(),V(y.$$.fragment),k=D(),T=v("div"),$=D(),V(M.$$.fragment),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(u,"class","inline-flex gap-5"),m(h,"type","button"),m(h,"class","btn btn-outline"),m(p,"class","btns-group"),m(e,"class","page-header"),m(T,"class","clearfix m-b-base")},m(J,x){S(J,e,x),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),b(e,u),F&&F.m(u,null),b(u,f),q(c,u,null),b(e,d),b(e,p),b(p,h),b(p,g),N&&N.m(p,null),S(J,_,x),q(y,J,x),S(J,k,x),S(J,T,x),S(J,$,x),q(M,J,x),E=!0,P||(L=K(h,"click",n[17]),P=!0)},p(J,x){(!E||x[0]&4)&&o!==(o=J[2].name+"")&&le(r,o),J[10]?F&&(F.d(1),F=null):F?F.p(J,x):(F=th(J),F.c(),F.m(u,f)),J[2].isView?N&&(N.d(1),N=null):N?N.p(J,x):(N=nh(J),N.c(),N.m(p,null));const ne={};x[0]&1&&(ne.value=J[0]),x[0]&4&&(ne.autocompleteCollection=J[2]),y.$set(ne);const G={};x[0]&4&&(G.collection=J[2]),!C&&x[0]&1&&(C=!0,G.filter=J[0],ke(()=>C=!1)),!O&&x[0]&2&&(O=!0,G.sort=J[1],ke(()=>O=!1)),M.$set(G)},i(J){E||(A(c.$$.fragment,J),A(y.$$.fragment,J),A(M.$$.fragment,J),E=!0)},o(J){I(c.$$.fragment,J),I(y.$$.fragment,J),I(M.$$.fragment,J),E=!1},d(J){J&&w(e),F&&F.d(),j(c),N&&N.d(),J&&w(_),j(y,J),J&&w(k),J&&w(T),J&&w($),n[20](null),j(M,J),P=!1,L()}}}function UD(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=D(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,m(e,"class","m-b-10"),m(i,"type","button"),m(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){S(o,e,r),S(o,t,r),S(o,i,r),s||(l=K(i,"click",n[14]),s=!0)},p:X,d(o){o&&w(e),o&&w(t),o&&w(i),s=!1,l()}}}function WD(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",m(e,"class","m-b-10")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function YD(n){let e,t,i;function s(r,a){return r[10]?WD:UD}let l=s(n),o=l(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=D(),o.c(),m(t,"class","icon"),m(e,"class","placeholder-section m-b-base")},m(r,a){S(r,e,a),b(e,t),b(e,i),o.m(e,null)},p(r,a){l===(l=s(r))&&o?o.p(r,a):(o.d(1),o=l(r),o&&(o.c(),o.m(e,null)))},d(r){r&&w(e),o.d()}}}function KD(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,m(e,"class","placeholder-section m-b-base")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function JD(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[zD,HD,VD],p=[];function h(T,$){return T[3]&&!T[9].length?0:T[9].length?2:1}e=h(n),t=p[e]=d[e](n);let g={};s=new su({props:g}),n[25](s);let _={};o=new z4({props:_}),n[26](o);let y={collection:n[2]};a=new G1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let k={collection:n[2]};return f=new pD({props:k}),n[30](f),{c(){t.c(),i=D(),V(s.$$.fragment),l=D(),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment)},m(T,$){p[e].m(T,$),S(T,i,$),q(s,T,$),S(T,l,$),q(o,T,$),S(T,r,$),q(a,T,$),S(T,u,$),q(f,T,$),c=!0},p(T,$){let M=e;e=h(T),e===M?p[e].p(T,$):(re(),I(p[M],1,1,()=>{p[M]=null}),ae(),t=p[e],t?t.p(T,$):(t=p[e]=d[e](T),t.c()),A(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const O={};o.$set(O);const E={};$[0]&4&&(E.collection=T[2]),a.$set(E);const P={};$[0]&4&&(P.collection=T[2]),f.$set(P)},i(T){c||(A(t),A(s.$$.fragment,T),A(o.$$.fragment,T),A(a.$$.fragment,T),A(f.$$.fragment,T),c=!0)},o(T){I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),c=!1},d(T){p[e].d(T),T&&w(i),n[25](null),j(s,T),T&&w(l),n[26](null),j(o,T),T&&w(r),n[27](null),j(a,T),T&&w(u),n[30](null),j(f,T)}}}function ZD(n,e,t){let i,s,l,o,r,a,u;We(n,Di,Z=>t(2,s=Z)),We(n,Ot,Z=>t(31,l=Z)),We(n,Lo,Z=>t(3,o=Z)),We(n,ga,Z=>t(13,r=Z)),We(n,Pi,Z=>t(9,a=Z)),We(n,Cs,Z=>t(10,u=Z));const f=new URLSearchParams(r);let c,d,p,h,g,_=f.get("filter")||"",y=f.get("sort")||"",k=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,k=s==null?void 0:s.id),t(0,_=""),t(1,y="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,y="")}B1(k);const $=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),C=()=>g==null?void 0:g.load(),O=()=>d==null?void 0:d.show(s),E=()=>p==null?void 0:p.show(),P=Z=>t(0,_=Z.detail);function L(Z){se[Z?"unshift":"push"](()=>{g=Z,t(8,g)})}function F(Z){_=Z,t(0,_)}function N(Z){y=Z,t(1,y)}const R=Z=>{s.isView?h.show(Z==null?void 0:Z.detail):p==null||p.show(Z==null?void 0:Z.detail)},z=()=>p==null?void 0:p.show();function W(Z){se[Z?"unshift":"push"](()=>{c=Z,t(4,c)})}function J(Z){se[Z?"unshift":"push"](()=>{d=Z,t(5,d)})}function x(Z){se[Z?"unshift":"push"](()=>{p=Z,t(6,p)})}const ne=()=>g==null?void 0:g.reloadLoadedPages(),G=()=>g==null?void 0:g.reloadLoadedPages();function fe(Z){se[Z?"unshift":"push"](()=>{h=Z,t(7,h)})}return n.$$.update=()=>{if(n.$$.dirty[0]&8192&&t(12,i=new URLSearchParams(r)),n.$$.dirty[0]&6152&&!o&&i.get("collectionId")&&i.get("collectionId")!=k&&GS(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&k!=s.id&&T(),n.$$.dirty[0]&7&&(y||_||s!=null&&s.id)){const Z=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:_,sort:y}).toString();Ei("/collections?"+Z)}n.$$.dirty[0]&4&&Gt(Ot,l=(s==null?void 0:s.name)||"Collections",l)},[_,y,s,o,c,d,p,h,g,a,u,k,i,r,$,M,C,O,E,P,L,F,N,R,z,W,J,x,ne,G,fe]}class GD extends ve{constructor(e){super(),be(this,e,ZD,JD,_e,{},null,[-1,-1])}}function XD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O,E,P;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=D(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
<span class="txt">Application</span>`,o=D(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=D(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=D(),c=v("div"),c.innerHTML='<span class="txt">Sync</span>',d=D(),p=v("a"),p.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,h=D(),g=v("a"),g.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,_=D(),y=v("div"),y.textContent="Authentication",k=D(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=D(),M=v("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,C=D(),O=v("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,m(i,"class","sidebar-title"),m(l,"href","/settings"),m(l,"class","sidebar-list-item"),m(r,"href","/settings/mail"),m(r,"class","sidebar-list-item"),m(u,"href","/settings/storage"),m(u,"class","sidebar-list-item"),m(c,"class","sidebar-title"),m(p,"href","/settings/export-collections"),m(p,"class","sidebar-list-item"),m(g,"href","/settings/import-collections"),m(g,"class","sidebar-list-item"),m(y,"class","sidebar-title"),m(T,"href","/settings/auth-providers"),m(T,"class","sidebar-list-item"),m(M,"href","/settings/tokens"),m(M,"class","sidebar-list-item"),m(O,"href","/settings/admins"),m(O,"class","sidebar-list-item"),m(t,"class","sidebar-content"),m(e,"class","page-sidebar settings-sidebar")},m(L,F){S(L,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),b(t,f),b(t,c),b(t,d),b(t,p),b(t,h),b(t,g),b(t,_),b(t,y),b(t,k),b(t,T),b(t,$),b(t,M),b(t,C),b(t,O),E||(P=[De(Hn.call(null,l,{path:"/settings"})),De(nn.call(null,l)),De(Hn.call(null,r,{path:"/settings/mail/?.*"})),De(nn.call(null,r)),De(Hn.call(null,u,{path:"/settings/storage/?.*"})),De(nn.call(null,u)),De(Hn.call(null,p,{path:"/settings/export-collections/?.*"})),De(nn.call(null,p)),De(Hn.call(null,g,{path:"/settings/import-collections/?.*"})),De(nn.call(null,g)),De(Hn.call(null,T,{path:"/settings/auth-providers/?.*"})),De(nn.call(null,T)),De(Hn.call(null,M,{path:"/settings/tokens/?.*"})),De(nn.call(null,M)),De(Hn.call(null,O,{path:"/settings/admins/?.*"})),De(nn.call(null,O))],E=!0)},p:X,i:X,o:X,d(L){L&&w(e),E=!1,Ae(P)}}}class Ni extends ve{constructor(e){super(),be(this,e,null,XD,_e,{})}}function ih(n,e,t){const i=n.slice();return i[30]=e[t],i}function sh(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[QD,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function QD(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="id",o=D(),r=v("div"),a=v("i"),f=D(),c=v("input"),m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"for",l=n[29]),m(a,"class","ri-calendar-event-line txt-disabled"),m(r,"class","form-field-addon"),m(c,"type","text"),m(c,"id",d=n[29]),c.value=p=n[1].id,c.readOnly=!0},m(_,y){S(_,e,y),b(e,t),b(e,i),b(e,s),S(_,o,y),S(_,r,y),b(r,a),S(_,f,y),S(_,c,y),h||(g=De(u=ze.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),h=!0)},p(_,y){y[0]&536870912&&l!==(l=_[29])&&m(e,"for",l),u&&Bt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${_[1].created}
Updated: ${_[1].updated}`,position:"left"}),y[0]&536870912&&d!==(d=_[29])&&m(c,"id",d),y[0]&2&&p!==(p=_[1].id)&&c.value!==p&&(c.value=p)},d(_){_&&w(e),_&&w(o),_&&w(r),_&&w(f),_&&w(c),h=!1,g()}}}function lh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=v("button"),t=v("img"),s=D(),Un(t.src,i="./images/avatars/avatar"+n[30]+".svg")||m(t,"src",i),m(t,"alt","Avatar "+n[30]),m(e,"type","button"),m(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){S(u,e,f),b(e,t),b(e,s),o||(r=K(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&m(e,"class",l)},d(u){u&&w(e),o=!1,r()}}}function xD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Email",o=D(),r=v("input"),m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","email"),m(r,"autocomplete","off"),m(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[3]),u||(f=K(r,"input",n[18]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&8&&r.value!==c[3]&&ue(r,c[3])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function oh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[eE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function eE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Change password"),m(e,"type","checkbox"),m(e,"id",t=n[29]),m(s,"for",o=n[29])},m(u,f){S(u,e,f),e.checked=n[4],S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&m(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function rh(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[tE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[nE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),V(s.$$.fragment),l=D(),o=v("div"),V(r.$$.fragment),m(i,"class","col-sm-6"),m(o,"class","col-sm-6"),m(t,"class","grid"),m(e,"class","col-12")},m(f,c){S(f,e,c),b(e,t),b(t,i),q(s,i,null),b(t,l),b(t,o),q(r,o,null),u=!0},p(f,c){const d={};c[0]&536871168|c[1]&4&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const p={};c[0]&536871424|c[1]&4&&(p.$$scope={dirty:c,ctx:f}),r.$set(p)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&et(()=>{u&&(a||(a=qe(t,Mt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){I(s.$$.fragment,f),I(r.$$.fragment,f),f&&(a||(a=qe(t,Mt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&w(e),j(s),j(r),f&&a&&a.end()}}}function tE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password",o=D(),r=v("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[8]),u||(f=K(r,"input",n[20]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d[0]&536870912&&a!==(a=c[29])&&m(r,"id",a),d[0]&256&&r.value!==c[8]&&ue(r,c[8])},d(c){c&&w(e),c&&w(o),c&&w(r),u=!1,f()}}}function nE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=D(),s=v("span"),s.textContent="Password confirm",o=D(),r=v("input"),m(t,"class","ri-lock-line"),m(s,"class","txt"),m(e,"for",l=n[29]),m(r,"type","password"),m(r,"autocomplete","new-password"),m(r,"id",a=n[29]),r.required=!0},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),S(c,o,d),S(c,r,d),ue(r,n[9]),u||(f=K(r,"input",n[21]),u=!0)},p(c,d){d[0]&536870912&&l!==(l=c[29])&&m(e,"for",l),d
<span class="txt">Delete</span>`,m(e,"type","button"),m(e,"class","dropdown-item txt-danger")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[15]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function oE(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,p=!n[1].isNew&&ah(n);return{c(){p&&p.c(),e=D(),t=v("button"),i=v("span"),i.textContent="Cancel",s=D(),l=v("button"),o=v("span"),a=B(r),m(i,"class","txt"),m(t,"type","button"),m(t,"class","btn btn-transparent"),t.disabled=n[6],m(o,"class","txt"),m(l,"type","submit"),m(l,"form",n[11]),m(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],Q(l,"btn-loading",n[6])},m(h,g){p&&p.m(h,g),S(h,e,g),S(h,t,g),b(t,i),S(h,s,g),S(h,l,g),b(l,o),b(o,a),f=!0,c||(d=K(t,"click",n[16]),c=!0)},p(h,g){h[1].isNew?p&&(re(),I(p,1,1,()=>{p=null}),ae()):p?(p.p(h,g),g[0]&2&&A(p,1)):(p=ah(h),p.c(),A(p,1),p.m(e.parentNode,e)),(!f||g[0]&64)&&(t.disabled=h[6]),(!f||g[0]&2)&&r!==(r=h[1].isNew?"Create":"Save changes")&&le(a,r),(!f||g[0]&1088&&u!==(u=!h[10]||h[6]))&&(l.disabled=u),(!f||g[0]&64)&&Q(l,"btn-loading",h[6])},i(h){f||(A(p),f=!0)},o(h){I(p),f=!1},d(h){p&&p.d(h),h&&w(e),h&&w(t),h&&w(s),h&&w(l),c=!1,d()}}}function rE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[oE],header:[sE],default:[iE]},$$scope:{ctx:n}};return e=new bn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){V(e.$$.fragment)},m(s,l){q(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[23](null),j(e,s)}}}function aE(n,e,t){let i;const s=vt(),l="admin_"+H.randomString(5);let o,r=new es,a=!1,u=!1,f=0,c="",d="",p="",h=!1;function g(J){return y(J),t(7,u=!0),o==null?void 0:o.show()}function _(){return o==null?void 0:o.hide()}function y(J){t(1,r=J!=null&&J.clone?J.clone():new es),k()}function k(){t(4,h=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,p=""),_n({})}function T(){if(a||!i)return;t(6,a=!0);const J={email:c,avatar:f};(r.isNew||h)&&(J.password=d,J.passwordConfirm=p);let x;r.isNew?x=me.admins.create(J):x=me.admins.update(r.id,J),x.then(async ne=>{var G;t(7,u=!1),_(),Ut(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ne),((G=me.authStore.model)==null?void 0:G.id)===ne.id&&me.authStore.save(me.authStore.token,ne)}).catch(ne=>{me.errorResponseHandler(ne)}).finally(()=>{t(6,a=!1)})}function $(){r!=null&&r.id&&pn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),_(),Ut("Successfully deleted admin."),s("delete",r)}).catch(J=>{me.errorResponseHandler(J)}))}const M=()=>$(),C=()=>_(),O=J=>t(2,f=J);function E(){c=this.value,t(3,c)}function P(){h=this.checked,t(4,h)}function L(){d=this.value,t(8,d)}function F(){p=this.value,t(9,p)}const N=()=>i&&u?(pn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),_()}),!1):!0;function R(J){se[J?"unshift":"push"](()=>{o=J,t(5,o)})}function z(J){de.call(this,n,J)}function W(J){de.call(this,n,J)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||h||c!==r.email||f!==r.avatar)},[_,r,f,c,h,o,a,u,d,p,i,l,T,$,g,M,C,O,E,P,L,F,N,R,z,W]}class uE extends ve{constructor(e){super(),be(this,e,aE,rE,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function uh(n,e,t){const i=n.slice();return i[24]=e[t],i}function fE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="id",m(t,"class",H.getFieldTypeIcon("primary")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function cE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="email",m(t,"class",H.getFieldTypeIcon("email")),m(s,"class","txt"),m(e,"class","col-header-content")},m(l,o){S(l,e,o),b(e,t),b(e,i),b(e,s)},p:X,d(l){l&&w(e)}}}function dE(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),s.textContent="created",m(t,"class"
`},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function ch(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',m(e,"type","button"),m(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[17]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function dh(n){let e;return{c(){e=v("span"),e.textContent="You",m(e,"class","label label-warning m-l-5")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ph(n,e){let t,i,s,l,o,r,a,u,f,c,d,p=e[24].id+"",h,g,_,y,k,T=e[24].email+"",$,M,C,O,E,P,L,F,N,R,z,W,J,x;f=new xo({props:{value:e[24].id}});let ne=e[24].id===e[7].id&&dh();E=new di({props:{date:e[24].created}}),F=new di({props:{date:e[24].updated}});function G(){return e[15](e[24])}function fe(...Z){return e[16](e[24],...Z)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=D(),a=v("td"),u=v("div"),V(f.$$.fragment),c=D(),d=v("span"),h=B(p),g=D(),ne&&ne.c(),_=D(),y=v("td"),k=v("span"),$=B(T),C=D(),O=v("td"),V(E.$$.fragment),P=D(),L=v("td"),V(F.$$.fragment),N=D(),R=v("td"),R.innerHTML='<i class="ri-arrow-right-line"></i>',z=D(),Un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||m(l,"src",o),m(l,"alt","Admin avatar"),m(s,"class","thumb thumb-sm thumb-circle"),m(i,"class","min-width"),m(d,"class","txt"),m(u,"class","label"),m(a,"class","col-type-text col-field-id"),m(k,"class","txt txt-ellipsis"),m(k,"title",M=e[24].email),m(y,"class","col-type-email col-field-email"),m(O,"class","col-type-date col-field-created"),m(L,"class","col-type-date col-field-updated"),m(R,"class","col-type-action min-width"),m(t,"tabindex","0"),m(t,"class","row-handle"),this.first=t},m(Z,ce){S(Z,t,ce),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),q(f,u,null),b(u,c),b(u,d),b(d,h),b(a,g),ne&&ne.m(a,null),b(t,_),b(t,y),b(y,k),b(k,$),b(t,C),b(t,O),q(E,O,null),b(t,P),b(t,L),q(F,L,null),b(t,N),b(t,R),b(t,z),W=!0,J||(x=[K(t,"click",G),K(t,"keydown",fe)],J=!0)},p(Z,ce){e=Z,(!W||ce&16&&!Un(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&m(l,"src",o);const he={};ce&16&&(he.value=e[24].id),f.$set(he),(!W||ce&16)&&p!==(p=e[24].id+"")&&le(h,p),e[24].id===e[7].id?ne||(ne=dh(),ne.c(),ne.m(a,null)):ne&&(ne.d(1),ne=null),(!W||ce&16)&&T!==(T=e[24].email+"")&&le($,T),(!W||ce&16&&M!==(M=e[24].email))&&m(k,"title",M);const Ce={};ce&16&&(Ce.date=e[24].created),E.$set(Ce);const Re={};ce&16&&(Re.date=e[24].updated),F.$set(Re)},i(Z){W||(A(f.$$.fragment,Z),A(E.$$.fragment,Z),A(F.$$.fragment,Z),W=!0)},o(Z){I(f.$$.fragment,Z),I(E.$$.fragment,Z),I(F.$$.fragment,Z),W=!1},d(Z){Z&&w(t),j(f),ne&&ne.d(),j(E),j(F),J=!1,Ae(x)}}}function _E(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M=[],C=new Map,O;function E(G){n[11](G)}let P={class:"col-type-text",name:"id",$$slots:{default:[fE]},$$scope:{ctx:n}};n[2]!==void 0&&(P.sort=n[2]),o=new Jt({props:P}),se.push(()=>ge(o,"sort",E));function L(G){n[12](G)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[cE]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new Jt({props:F}),se.push(()=>ge(u,"sort",L));function N(G){n[13](G)}let R={class:"col-type-date col-field-created",name:"created",$$slots:{default:[dE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),d=new Jt({props:R}),se.push(()=>ge(d,"sort",N));function z(G){n[14](G)}let W={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[pE]},$$scope:{ctx:n}};n[2]!==void 0&&(W.sort=n[2]),g=new Jt({props:W}),se.push(()=>ge(g,"sort",z));let J=n[4];const x=G=>G[24].id;for(let G=0;G<J.length;G+=1){let fe=uh(n,J,G),Z=x(fe);C.set(Z,M[G]=ph(Z,fe))}let ne=null;return J.length||(ne=fh(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=D(),V(o.$$.fragment),a=D(),V(u.$$.fragment),c=D(),V(d.$$.fragment),h=D(),V(g.$$.fragment),y=D(),k=v("th"),T=D(),$=v("tbody");for(let G=0;G<M.length;G+=1)M[G].c();ne&&ne.c(),m(s,"class","min-width"),m(k,"class","col-type-action min-width"),m(e,"class","table"),Q(e,"table-loading",n[5])},m(G,fe){S(G,e,fe),b(e,t),b(t,i),b(i,s),b(i,l),q(o,i,null),b(i,a),q(u,i,null),b(i,c),q(d,i,null),b(i,h),q(g,i,null),b(i,y),b(i,k),b(e,T),b(e,$);f
<span class="txt">New admin</span>`,p=D(),V(h.$$.fragment),g=D(),_=v("div"),y=D(),V(k.$$.fragment),T=D(),E&&E.c(),$=we(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(f,"class","flex-fill"),m(d,"type","button"),m(d,"class","btn btn-expanded"),m(e,"class","page-header"),m(_,"class","clearfix m-b-base")},m(P,L){S(P,e,L),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),q(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),S(P,p,L),q(h,P,L),S(P,g,L),S(P,_,L),S(P,y,L),q(k,P,L),S(P,T,L),E&&E.m(P,L),S(P,$,L),M=!0,C||(O=K(d,"click",n[9]),C=!0)},p(P,L){(!M||L&64)&&le(o,P[6]);const F={};L&2&&(F.value=P[1]),h.$set(F);const N={};L&134217918&&(N.$$scope={dirty:L,ctx:P}),k.$set(N),P[4].length?E?E.p(P,L):(E=mh(P),E.c(),E.m($.parentNode,$)):E&&(E.d(1),E=null)},i(P){M||(A(a.$$.fragment,P),A(h.$$.fragment,P),A(k.$$.fragment,P),M=!0)},o(P){I(a.$$.fragment,P),I(h.$$.fragment,P),I(k.$$.fragment,P),M=!1},d(P){P&&w(e),j(a),P&&w(p),j(h,P),P&&w(g),P&&w(_),P&&w(y),j(k,P),P&&w(T),E&&E.d(P),P&&w($),C=!1,O()}}}function bE(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[gE]},$$scope:{ctx:n}}});let r={};return l=new uE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[18](null),j(l,a)}}}function vE(n,e,t){let i,s,l;We(n,ga,F=>t(21,i=F)),We(n,Ot,F=>t(6,s=F)),We(n,Ea,F=>t(7,l=F)),Gt(Ot,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:c||"-created",filter:f}).then(F=>{t(4,a=F),t(5,u=!1)}).catch(F=>{F!=null&&F.isAbort||(t(5,u=!1),console.warn(F),p(),me.errorResponseHandler(F,!1))})}function p(){t(4,a=[])}const h=()=>d(),g=()=>r==null?void 0:r.show(),_=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function k(F){c=F,t(2,c)}function T(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}const M=F=>r==null?void 0:r.show(F),C=(F,N)=>{(N.code==="Enter"||N.code==="Space")&&(N.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function E(F){se[F?"unshift":"push"](()=>{r=F,t(3,r)})}const P=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();Ei("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,h,g,_,y,k,T,$,M,C,O,E,P,L]}class yE extends ve{constructor(e){super(),be(this,e,vE,bE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function kE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Email"),s=D(),l=v("input"),m(e,"for",i=n[8]),m(l,"type","email"),m(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0]),l.focus(),r||(a=K(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&m(e,"for",i),f&256&&o!==(o=u[8])&&m(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function wE(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=B("Password"),s=D(),l=v("input"),r=D(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",m(e,"for",i=n[8]),m(l,"type","password"),m(l,"id",o=n[8]),l.required=!0,m(u,"href","/request-password-reset"),m(u,"class","link-hint"),m(a,"class","help-block")},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[1]),S(d,r,p),S(d,a,p),b(a,u),f||(c=[K(l,"input",n[5]),De(nn.call(null,u))],f=!0)},p(d,p){p&256&&i!==(i=d[8])&&m(e,"for",i),p&256&&o!==(o=d[8])&&m(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),d&&w(a),f=!1,Ae(c)}}}function SE(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[kE,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:
<i class="ri-arrow-right-line"></i>`,m(t,"class","content txt-center m-b-base"),m(a,"type","submit"),m(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),m(e,"class","block")},m(d,p){S(d,e,p),b(e,t),b(e,i),q(s,e,null),b(e,l),q(o,e,null),b(e,r),b(e,a),u=!0,f||(c=K(e,"submit",ft(n[3])),f=!0)},p(d,p){const h={};p&769&&(h.$$scope={dirty:p,ctx:d}),s.$set(h);const g={};p&770&&(g.$$scope={dirty:p,ctx:d}),o.$set(g),(!u||p&4)&&Q(a,"btn-disabled",d[2]),(!u||p&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){I(s.$$.fragment,d),I(o.$$.fragment,d),u=!1},d(d){d&&w(e),j(s),j(o),f=!1,c()}}}function TE(n){let e,t;return e=new zg({props:{$$slots:{default:[SE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function $E(n,e,t){let i;We(n,ga,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Oa(),Ei("/")}).catch(()=>{pl("Invalid login credentials.")}).finally(()=>{t(2,r=!1)})}function u(){l=this.value,t(0,l)}function f(){o=this.value,t(1,o)}return[l,o,r,a,u,f]}class CE extends ve{constructor(e){super(),be(this,e,$E,TE,_e,{})}}function ME(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[DE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[EE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[AE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[IE,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let C=n[3]&&hh(n);return{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),c=D(),d=v("div"),p=v("div"),h=D(),C&&C.c(),g=D(),_=v("button"),y=v("span"),y.textContent="Save changes",m(t,"class","col-lg-6"),m(l,"class","col-lg-6"),m(p,"class","flex-fill"),m(y,"class","txt"),m(_,"type","submit"),m(_,"class","btn btn-expanded"),_.disabled=k=!n[3]||n[2],Q(_,"btn-loading",n[2]),m(d,"class","col-lg-12 flex"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),q(a,e,null),b(e,u),q(f,e,null),b(e,c),b(e,d),b(d,p),b(d,h),C&&C.m(d,null),b(d,g),b(d,_),b(_,y),T=!0,$||(M=K(_,"click",n[13]),$=!0)},p(O,E){const P={};E&1572865&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E&1572865&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),a.$set(F);const N={};E&1572865&&(N.$$scope={dirty:E,ctx:O}),f.$set(N),O[3]?C?C.p(O,E):(C=hh(O),C.c(),C.m(d,g)):C&&(C.d(1),C=null),(!T||E&12&&k!==(k=!O[3]||O[2]))&&(_.disabled=k),(!T||E&4)&&Q(_,"btn-loading",O[2])},i(O){T||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),T=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(a.$$.fragment,O),I(f.$$.fragment,O),T=!1},d(O){O&&w(e),j(i),j(o),j(a),j(f),C&&C.d(),$=!1,M()}}}function OE(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function DE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application name"),s=D(),l=v("input"),m(e,"for",i=n[19]),m(l,"type","text"),m(l,"id",o=n[19]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[0].meta.appName),r||(a=K(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&m(e,"for",i),f&524288&&o!==(o=u[19])&&m(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function EE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Application url"),s=D(),l=v("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=D(),i=v("div"),s=v("form"),o.c(),m(e,"class","page-header"),m(s,"class","panel"),m(s,"autocomplete","off"),m(i,"class","wrapper")},m(p,h){S(p,e,h),S(p,t,h),S(p,i,h),b(i,s),c[l].m(s,null),r=!0,a||(u=K(s,"submit",ft(n[4])),a=!0)},p(p,h){let g=l;l=d(p),l===g?c[l].p(p,h):(re(),I(c[g],1,1,()=>{c[g]=null}),ae(),o=c[l],o?o.p(p,h):(o=c[l]=f[l](p),o.c()),A(o,1),o.m(s,null))},i(p){r||(A(o),r=!0)},o(p){I(o),r=!1},d(p){p&&w(e),p&&w(t),p&&w(i),c[l].d(),a=!1,u()}}}function LE(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[PE]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function NE(n,e,t){let i,s,l,o;We(n,Cs,C=>t(14,s=C)),We(n,ko,C=>t(15,l=C)),We(n,Ot,C=>t(16,o=C)),Gt(Ot,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const C=await me.settings.getAll()||{};h(C)}catch(C){me.errorResponseHandler(C)}t(1,u=!1)}async function p(){if(!(f||!i)){t(2,f=!0);try{const C=await me.settings.update(H.filterRedactedProps(a));h(C),Ut("Successfully saved application settings.")}catch(C){me.errorResponseHandler(C)}t(2,f=!1)}}function h(C={}){var O,E;Gt(ko,l=(O=C==null?void 0:C.meta)==null?void 0:O.appName,l),Gt(Cs,s=!!((E=C==null?void 0:C.meta)!=null&&E.hideControls),s),t(0,a={meta:(C==null?void 0:C.meta)||{},logs:(C==null?void 0:C.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function g(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function _(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function k(){a.logs.maxDays=ht(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const $=()=>g(),M=()=>p();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,p,g,r,c,_,y,k,T,$,M]}class FE extends ve{constructor(e){super(),be(this,e,NE,LE,_e,{})}}function RE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Le(l,s[o]);return{c(){e=v("input"),xn(e,l)},m(o,r){S(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=K(e,"input",n[8]),t=!0)},p(o,r){xn(e,l=bt(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&w(e),n[7](null),t=!1,i()}}}function qE(n){let e,t,i,s,l,o,r=[{readOnly:!0},{type:"text"},{placeholder:n[1]},n[5]],a={};for(let u=0;u<r.length;u+=1)a=Le(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=D(),s=v("input"),m(t,"type","button"),m(t,"class","btn btn-transparent btn-circle"),m(e,"class","form-field-addon"),xn(s,a)},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),s.autofocus&&s.focus(),l||(o=[De(ze.call(null,t,{position:"left",text:"Set new value"})),K(t,"click",n[6])],l=!0)},p(u,f){xn(s,a=bt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&w(e),u&&w(i),u&&w(s),l=!1,Ae(o)}}}function jE(n){let e;function t(l,o){return l[3]?qE:RE}let i=t(n),s=i(n);return{c(){s.c(),e=we()},m(l,o){s.m(l,o),S(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:X,o:X,d(l){s.d(l),l&&w(e)}}}function VE(n,e,t){const i=["value","mask"];let s=Je(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await rn(),r==null||r.focus()}const f=()=>u();function c(p){se[p?"unshift":"push"](()=>{r=p,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=p=>{e=Le(Le({},e),jt(p)),t(5,s=Je(e,i)),"value"in p&&t(0,l=p.value),"mask"in p&&t(1,o=p.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class ou extends ve{constructor(e){super(),be(this,e,VE,jE,_e,{value:0,mask:1})}}function HE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g;return{c(){e=v("label"),t=B("Subject"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder paramete
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(a,"class","help-block")},m(_,y){S(_,e,y),b(e,t),S(_,s,y),S(_,l,y),ue(l,n[0].subject),S(_,r,y),S(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),h||(g=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],h=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&m(e,"for",i),y[1]&1&&o!==(o=_[31])&&m(l,"id",o),y[0]&1&&l.value!==_[0].subject&&ue(l,_[0].subject)},d(_){_&&w(e),_&&w(s),_&&w(l),_&&w(r),_&&w(a),h=!1,Ae(g)}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y;return{c(){e=v("label"),t=B("Action URL"),s=D(),l=v("input"),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B("."),m(e,"for",i=n[31]),m(l,"type","text"),m(l,"id",o=n[31]),m(l,"spellcheck","false"),l.required=!0,m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(h,"title","Required parameter"),m(a,"class","help-block")},m(k,T){S(k,e,T),b(e,t),S(k,s,T),S(k,l,T),ue(l,n[0].actionUrl),S(k,r,T),S(k,a,T),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),b(a,h),b(a,g),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],_=!0)},p(k,T){T[1]&1&&i!==(i=k[31])&&m(e,"for",i),T[1]&1&&o!==(o=k[31])&&m(l,"id",o),T[0]&1&&l.value!==k[0].actionUrl&&ue(l,k[0].actionUrl)},d(k){k&&w(e),k&&w(s),k&&w(l),k&&w(r),k&&w(a),_=!1,Ae(y)}}}function BE(n){let e,t,i,s;return{c(){e=v("textarea"),m(e,"id",t=n[31]),m(e,"class","txt-mono"),m(e,"spellcheck","false"),m(e,"rows","14"),e.required=!0},m(l,o){S(l,e,o),ue(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&m(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:X,o:X,d(l){l&&w(e),i=!1,s()}}}function UE(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=$t(o,r(n)),se.push(()=>ge(e,"value",l))),{c(){e&&V(e.$$.fragment),i=we()},m(a,u){e&&q(e,a,u),S(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ke(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{j(c,1)}),ae()}o?(e=$t(o,r(a)),se.push(()=>ge(e,"value",l)),V(e.$$.fragment),A(e.$$.fragment,1),q(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&I(e.$$.fragment,a),s=!1},d(a){a&&w(i),e&&j(e,a)}}}function WE(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$;const M=[UE,BE],C=[];function O(E,P){return E[4]&&!E[5]?0:1}return l=O(n),o=C[l]=M[l](n),{c(){e=v("label"),t=B("Body (HTML)"),s=D(),o.c(),r=D(),a=v("div"),u=B(`Available placeholder parameters:
`),f=v("button"),f.textContent=`{APP_NAME}
`,c=B(`,
`),d=v("button"),d.textContent=`{APP_URL}
`,p=B(`,
`),h=v("button"),h.textContent=`{TOKEN}
`,g=B(`,
`),_=v("button"),_.textContent=`{ACTION_URL}
`,y=B("."),m(e,"for",i=n[31]),m(f,"type","button"),m(f,"class","label label-sm link-primary txt-mono"),m(d,"type","button"),m(d,"class","label label-sm link-primary txt-mono"),m(h,"type","button"),m(h,"class","label label-sm link-primary txt-mono"),m(_,"type","button"),m(_,"class","label label-sm link-primary txt-mono"),m(_,"title","Required parameter"),m(a,"class","help-block")},m(E,P){S(E,e,P),b(e,t),S(E,s,P),C[l].m(E,P),S(E,r,P),S(E,a,P),b(a,u),b(a,f),b(a,c),b(a,d),b(a,p),b(a,h),b(a,g),b(a,_),b(a,y),k=!0,T||($=[K(f,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(_,"click",n[25])],T=!0)},p(E,P){(!k||P[1]&1&&i!==(i=E[31]))&&m(e,"for",i);let L=l;l=O(E),l===L?C[l].p(E,P):(re(),I(C[L],1,1,()=>{C[L]=null}),ae(),o=C[l],o?o.p(E,P):(o=C[l]=M[l](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){k||(A(o),k=!0)},o(E){I(o),k=!1},d(E){E&&w(e),E&&w(s),C[l].d(E),E&&w(r),E&&w(a),T=!1,Ae($)}}}function YE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[HE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[zE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[WE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(r,a){q(e,r,a),S(r,t,a),q(i,r,a),S(r,s,a),q(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!1},d(r){j(e,r),r&&w(t),j(i,r),r&&w(s),j(l,r)}}}function _h(n){let e,t,i,s,l;return{c(){e=v("i"),m(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,s||(l=De(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&et(()=>{i&&(t||(t=qe(e,qt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,qt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),s=!1,l()}}}function KE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&_h();return{c(){e=v("div"),t=v("i"),i=D(),s=v("span"),l=B(n[2]),o=D(),r=v("div"),a=D(),f&&f.c(),u=we(),m(t,"class","ri-draft-line"),m(s,"class","txt"),m(e,"class","inline-flex"),m(r,"class","flex-fill")},m(c,d){S(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),S(c,o,d),S(c,r,d),S(c,a,d),f&&f.m(c,d),S(c,u,d)},p(c,d){d[0]&4&&le(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=_h(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&w(e),c&&w(o),c&&w(r),c&&w(a),f&&f.d(c),c&&w(u)}}}function JE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[KE],default:[YE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Le(s,i[l]);return e=new al({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(l,o){q(e,l,o),t=!0},p(l,o){const r=o[0]&256?bt(i,[Vt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[26](null),j(e,l)}}}let gh;function ZE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Je(e,s),o;We(n,ti,G=>t(12,o=G));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=gh,d=!1;function p(){f==null||f.expand()}function h(){f==null||f.collapse()}function g(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-b80c0f73.js"),["./CodeEditor-b80c0f73.js","./index-20adcf24.js"],import.meta.url)).default),gh=c,t(5,d=!1))}function y(G){H.copyToClipboard(G),Vg(`Copied ${G} to clipboard`,2e3)}_();function k(){u.subject=this.value,t(0,u)}const T=()=>y("{APP_NAME}"),$=()=>y("{APP_URL}");function M(){u.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=K(e,"click",n[26]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function _A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=D(),s=v("button"),l=v("span"),l.textContent="Save changes",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],m(l,"class","txt"),m(s,"type","submit"),m(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){S(u,e,f),b(e,t),S(u,i,f),S(u,s,f),b(s,l),r||(a=[K(e,"click",n[24]),K(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&Q(s,"btn-loading",u[3])},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,Ae(a)}}}function gA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[lA,sA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[5]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[27])),g=!0)},p($,M){(!h||M[0]&32)&&le(o,$[5]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function bA(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[gA]},$$scope:{ctx:n}}});let r={};return l=new iA({props:r}),n[28](l),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[28](null),j(l,a)}}}function vA(n,e,t){let i,s,l;We(n,Ot,ne=>t(5,l=ne));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Gt(Ot,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;p();async function p(){t(2,c=!0);try{const ne=await me.settings.getAll()||{};g(ne)}catch(ne){me.errorResponseHandler(ne)}t(2,c=!1)}async function h(){if(!(d||!s)){t(3,d=!0);try{const ne=await me.settings.update(H.filterRedactedProps(f));g(ne),_n({}),Ut("Successfully saved mail settings.")}catch(ne){me.errorResponseHandler(ne)}t(3,d=!1)}}function g(ne={}){t(0,f={meta:(ne==null?void 0:ne.meta)||{},smtp:(ne==null?void 0:ne.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function _(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function k(){f.meta.senderAddress=this.value,t(0,f)}function T(ne){n.$$.not_equal(f.meta.verificationTemplate,ne)&&(f.meta.verificationTemplate=ne,t(0,f))}function $(ne){n.$$.not_equal(f.meta.resetPasswordTemplate,ne)&&(f.meta.resetPasswordTemplate=ne,t(0,f))}function M(ne){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ne)&&(f.meta.confirmEmailChangeTemplate=ne,t(0,f))}function C(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function E(){f.smtp.port=ht(this.value),t(0,f)}function P(ne){n.$$.not_equal(f.smtp.tls,ne)&&(f.smtp.tls=ne,t(0,f))}function L(ne){n.$$.not_equal(f.smtp.authMethod,ne)&&(f.smtp.authMethod=ne,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function N(ne){n.$$.not_equal(f.smtp.password,ne)&&(f.smtp.password=ne,t(0,f))}const R=()=>_(),z=()=>h(),W=()=>a==null?v
the
`),r=v("strong"),u=B(a),f=B(`
to the
`),c=v("strong"),p=B(d),h=B(`.
`),g=v("br"),_=B(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,k=B(`,
`),T=v("a"),T.textContent=`s5cmd
`,$=B(", etc."),M=D(),C=v("div"),m(i,"class","icon"),m(y,"href","https://github.com/rclone/rclone"),m(y,"target","_blank"),m(y,"rel","noopener noreferrer"),m(y,"class","txt-bold"),m(T,"href","https://github.com/peak/s5cmd"),m(T,"target","_blank"),m(T,"rel","noopener noreferrer"),m(T,"class","txt-bold"),m(l,"class","content"),m(t,"class","alert alert-warning m-0"),m(C,"class","clearfix m-t-base")},m(L,F){S(L,e,F),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,p),b(l,h),b(l,g),b(l,_),b(l,y),b(l,k),b(l,T),b(l,$),b(e,M),b(e,C),E=!0},p(L,F){var N;(!E||F&1)&&a!==(a=(N=L[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!E||F&2)&&d!==(d=L[1].s3.enabled?"S3 storage":"local file system")&&le(p,d)},i(L){E||(L&&et(()=>{E&&(O||(O=qe(e,Mt,{duration:150},!0)),O.run(1))}),E=!0)},o(L){L&&(O||(O=qe(e,Mt,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&w(e),L&&O&&O.end()}}}function Sh(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[TA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[$A,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[CA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),d=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[MA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[OA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),k=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[DA,({uniqueId:O})=>({25:O}),({uniqueId:O})=>O?33554432:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),V(i.$$.fragment),s=D(),l=v("div"),V(o.$$.fragment),r=D(),a=v("div"),V(u.$$.fragment),f=D(),c=v("div"),V(d.$$.fragment),p=D(),h=v("div"),V(g.$$.fragment),_=D(),y=v("div"),V(k.$$.fragment),T=D(),$=v("div"),m(t,"class","col-lg-6"),m(l,"class","col-lg-3"),m(a,"class","col-lg-3"),m(c,"class","col-lg-6"),m(h,"class","col-lg-6"),m(y,"class","col-lg-12"),m($,"class","col-lg-12"),m(e,"class","grid")},m(O,E){S(O,e,E),b(e,t),q(i,t,null),b(e,s),b(e,l),q(o,l,null),b(e,r),b(e,a),q(u,a,null),b(e,f),b(e,c),q(d,c,null),b(e,p),b(e,h),q(g,h,null),b(e,_),b(e,y),q(k,y,null),b(e,T),b(e,$),C=!0},p(O,E){const P={};E&100663298&&(P.$$scope={dirty:E,ctx:O}),i.$set(P);const L={};E&100663298&&(L.$$scope={dirty:E,ctx:O}),o.$set(L);const F={};E&100663298&&(F.$$scope={dirty:E,ctx:O}),u.$set(F);const N={};E&100663298&&(N.$$scope={dirty:E,ctx:O}),d.$set(N);const R={};E&100663298&&(R.$$scope={dirty:E,ctx:O}),g.$set(R);const z={};E&100663298&&(z.$$scope={dirty:E,ctx:O}),k.$set(z)},i(O){C||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(g.$$.fragment,O),A(k.$$.fragment,O),O&&et(()=>{C&&(M||(M=qe(e,Mt,{duration:150},!0)),M.run(1))}),C=!0)},o(O){I(i.$$.fragment,O),I(o.$$.fragment,O),I(u.$$.fragment,O),I(d.$$.fragment,O),I(g.$$.fragment,O),I(k.$$.fragment,O),O&&(M||(M=qe(e,Mt,{duration:150},!1)),M.run(0)),C=!1},d(O){O&&w(e),j(i),j(o),j(u),j(d),j(g),j(k),O&&M&&M.end()}}}function TA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Endpoint"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.endpoint),r||(a=K(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&m(e,"for",i),f&33554432&&o!==(o=u[25])&&m(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&w(e),u&&w(s),u&&w(l),r=!1,a()}}}function $A(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=B("Bucket"),s=D(),l=v("input"),m(e,"for",i=n[25]),m(l,"type","text"),m(l,"id",o=n[25]),l.required=!0},m(u,f){S(u,e,f),b(e,t),S(u,s,f),S(u,l,f),ue(l,n[1].s3.bucket),r||(a=K(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[2
<span class="txt">S3 connected successfully</span>`,m(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function AA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,m(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;S(l,e,o),i||(s=De(t=ze.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Bt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&w(e),i=!1,s()}}}function IA(n){let e;return{c(){e=v("span"),m(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function $h(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",m(t,"class","txt"),m(e,"type","button"),m(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){S(l,e,o),b(e,t),i||(s=K(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&w(e),i=!1,s()}}}function PA(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_;const y=[wA,kA],k=[];function T($,M){return $[2]?0:1}return d=T(n),p=k[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[7]),r=D(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=D(),p.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(f,"class","content txt-xl m-b-base"),m(u,"class","panel"),m(u,"autocomplete","off"),m(a,"class","wrapper")},m($,M){S($,e,M),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S($,r,M),S($,a,M),b(a,u),b(u,f),b(u,c),k[d].m(u,null),h=!0,g||(_=K(u,"submit",ft(n[20])),g=!0)},p($,M){(!h||M&128)&&le(o,$[7]);let C=d;d=T($),d===C?k[d].p($,M):(re(),I(k[C],1,1,()=>{k[C]=null}),ae(),p=k[d],p?p.p($,M):(p=k[d]=y[d]($),p.c()),A(p,1),p.m(u,null))},i($){h||(A(p),h=!0)},o($){I(p),h=!1},d($){$&&w(e),$&&w(r),$&&w(a),k[d].d(),g=!1,_()}}}function LA(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[PA]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}const oo="s3_test_request";function NA(n,e,t){let i,s,l;We(n,Ot,N=>t(7,l=N)),Gt(Ot,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null,d=null;p();async function p(){t(2,a=!0);try{const N=await me.settings.getAll()||{};g(N)}catch(N){me.errorResponseHandler(N)}t(2,a=!1)}async function h(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(oo);const N=await me.settings.update(H.filterRedactedProps(r));_n({}),await g(N),Oa(),c?Zv("Successfully saved but failed to establish S3 connection."):Ut("Successfully saved files storage settings.")}catch(N){me.errorResponseHandler(N)}t(3,u=!1)}}async function g(N={}){t(1,r={s3:(N==null?void 0:N.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await y()}async function _(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await y()}async function y(){if(t(5,c=null),!!r.s3.enabled){me.cancelRequest(oo),clearTimeout(d),d=setTimeout(()=>{me.cancelRequest(oo),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:oo})}catch(N){t(5,c=N)}t(4,f=!1),clearTimeout(d)}}Qt(()=>()=>{clearTimeout(d)});function k(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function $(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function C(){r.s3.accessKey=this.value,t(1,r)}function O(N){n.$$.not_equal(r.s3.secret,N)&&(r.s3.secret=N,t(1,r))}function E(){r.s3.forcePathStyle=this.checked,t(1,r)}const P=()=>_(),L=()=>h(),F=()=>h();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,c,s,l,h,_,i,k,T,$,M,C,O,E,P,L,F]}class FA extends ve{constructor(e){super(),be(this,e,NA,LA,_e,{})}}function RA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=D(),s=v("label"),l=B("Enable"),m(e,"type","checkbox"),m(e,"id",t=n[21]),m(s,"for",o=n[21])},m(u,f){S(u,e,f),e.checked=n[0].enabled,S(u,i,f),S(u,s,f),b(s,l),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&m(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&m(s,"for",o)},d(u){u&&w(e),u&&w(i),u&&w(s),r=!1,a()}}}function qA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=B("Client ID"),s=D(),l=v("input"),m(e,"for",i=n[21]),m(l,"type","text"),m(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,c){S(f,e,c),b(e,t),S(f,s,c),S(f,l,c),ue(l,n[0].clientId),a||(u=K(l,"input",n[14]),a=!0)},p(f,c){c&2097152&&i!==(i=f[21])&&m(e,"for",i),c&2097152&&o!==(o=f[21])&&m(l,"id",o),c&1&&r!==(r=f[0].enabled)&&(l.required=r),c&1&&l.value!==f[0].clientId&&ue(l,f[0].clientId)},d(f){f&&w(e),f&&w(s),f&&w(l),a=!1,u()}}}function jA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new ou({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=v("label"),t=B("Client secret"),s=D(),V(l.$$.fragment),m(e,"for",i=n[21])},m(f,c){S(f,e,c),b(e,t),S(f,s,c),q(l,f,c),r=!0},p(f,c){(!r||c&2097152&&i!==(i=f[21]))&&m(e,"for"
another PocketBase environment.</p>`,t=D(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=D(),V(o.$$.fragment),r=D(),a=v("div"),u=v("div"),f=D(),c=v("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,m(e,"class","content txt-xl m-b-base"),m(s,"type","button"),m(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),m(i,"tabindex","0"),m(i,"class","export-preview svelte-jm5c4z"),m(u,"class","flex-fill"),m(c,"type","button"),m(c,"class","btn btn-expanded"),m(a,"class","flex m-t-base")},m(g,_){S(g,e,_),S(g,t,_),S(g,i,_),b(i,s),b(i,l),q(o,i,null),n[8](i),S(g,r,_),S(g,a,_),b(a,u),b(a,f),b(a,c),d=!0,p||(h=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],p=!0)},p(g,_){const y={};_&4&&(y.content=g[2]),o.$set(y)},i(g){d||(A(o.$$.fragment,g),d=!0)},o(g){I(o.$$.fragment,g),d=!1},d(g){g&&w(e),g&&w(t),g&&w(i),j(o),n[8](null),g&&w(r),g&&w(a),p=!1,Ae(h)}}}function r6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function a6(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[r6,o6],h=[];function g(_,y){return _[1]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[3]),r=D(),a=v("div"),u=v("div"),c.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&le(o,_[3]);let k=f;f=g(_),f===k?h[f].p(_,y):(re(),I(h[k],1,1,()=>{h[k]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=p[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function u6(n){let e,t,i,s;return e=new Ni({}),i=new Cn({props:{$$slots:{default:[a6]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment)},m(l,o){q(e,l,o),S(l,t,o),q(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){I(e.$$.fragment,l),I(i.$$.fragment,l),s=!1},d(l){j(e,l),l&&w(t),j(i,l)}}}function f6(n,e,t){let i,s;We(n,Ot,_=>t(3,s=_)),Gt(Ot,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){me.errorResponseHandler(_)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function c(){H.copyToClipboard(i),Vg("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function p(_){se[_?"unshift":"push"](()=>{o=_,t(0,o)})}const h=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),k=document.createRange();k.selectNodeContents(o),y.removeAllRanges(),y.addRange(k)}},g=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,p,h,g]}class c6 extends ve{constructor(e){super(),be(this,e,f6,u6,_e,{})}}function Rh(n,e,t){const i=n.slice();return i[14]=e[t],i}function qh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function jh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Vh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Hh(n,e,t){const i=n.slice();return i[14]=e[t],i}function zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Bh(n,e,t){const i=n.slice();return i[30]=e[t],i}function d6(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Uh(),a=n[0].name!==n[1].name&&Wh(n);return{c(){e=v("div"),r&&r.c(),t=D(),a&&a.c(),i=D(),s=v("strong"),o=B(l),m(s,"class","txt"),m(e,"class","inline-flex fleg-gap-5")},m(u,f){S(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=Uh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Wh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&w(e),r&&r.d(),a&&a.d()}}}function p6(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=v("span"),e.textContent="Deleted",t=D(),i=v("strong"),l=B(s),m(e,"class","label label-danger")},m(r,a){S(r,e,a),S(r,t,a),S(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=D(),o=v("tbody");for(let $=0;$<h.length;$+=1)h[$].c();r=D(),g&&g.c(),a=D();for(let $=0;$<y.length;$+=1)y[$].c();u=D();for(let $=0;$<T.length;$+=1)T[$].c();m(e,"class","section-title"),m(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){S($,e,M),d.m(e,null),S($,t,M),S($,i,M),b(i,s),b(i,l),b(i,o);for(let C=0;C<h.length;C+=1)h[C]&&h[C].m(o,null);b(o,r),g&&g.m(o,null),b(o,a);for(let C=0;C<y.length;C+=1)y[C]&&y[C].m(o,null);b(o,u);for(let C=0;C<T.length;C+=1)T[C]&&T[C].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){p=$[11];let C;for(C=0;C<p.length;C+=1){const O=Bh($,p,C);h[C]?h[C].p(O,M):(h[C]=Yh(O),h[C].c(),h[C].m(o,r))}for(;C<h.length;C+=1)h[C].d(1);h.length=p.length}if($[2]||$[5]?g?g.p($,M):(g=Kh($),g.c(),g.m(o,a)):g&&(g.d(1),g=null),M[0]&4248){_=$[7];let C;for(C=0;C<_.length;C+=1){const O=jh($,_,C);y[C]?y[C].p(O,M):(y[C]=Qh(O),y[C].c(),y[C].m(o,u))}for(;C<y.length;C+=1)y[C].d(1);y.length=_.length}if(M[0]&4352){k=$[8];let C;for(C=0;C<k.length;C+=1){const O=Rh($,k,C);T[C]?T[C].p(O,M):(T[C]=e_(O),T[C].c(),T[C].m(o,null))}for(;C<T.length;C+=1)T[C].d(1);T.length=k.length}},i:X,o:X,d($){$&&w(e),d.d(),$&&w(t),$&&w(i),at(h,$),g&&g.d(),at(y,$),at(T,$)}}}function An(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function cn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function _6(n,e,t){let i,s,l,{collectionA:o=new hn}=e,{collectionB:r=new hn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],p=[];const h=Object.keys(new hn().export()).filter(y=>!["schema","created","updated"].includes(y));function g(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(k=>y.id==k.id))))}function _(y){return typeof y>"u"?"":H.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&g(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(k=>y.id==k.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(k=>k.id==y.id))),n.$$.dirty[0]&24&&t(8,p=f.filter(y=>!u.find(k=>k.id==y.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,p,l,s,h,_]}class g6 extends ve{constructor(e){super(),be(this,e,_6,h6,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function t_(n,e,t){const i=n.slice();return i[17]=e[t],i}function n_(n){let e,t;return e=new g6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(e.$$.fragment)},m(i,s){q(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){j(e,i)}}}function b6(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=n_(t_(n,i,o));const l=o=>I(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=we()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=t_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=n_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)I(s[r]);t=!1},d(o){at(s,o),o&&w(e)}}}function v6(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",m(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:X,d(t){t&&w(e)}}}function y6(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=B("Close"),i=D(),s=v("button"),l=v("span"),l.textContent="Confirm and import",m(e,"type","button"),m(e,"class","btn btn-tr
- ${$.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Ut("Successfully imported collections configuration."),i("submit")}catch($){me.errorResponseHandler($)}t(4,u=!1),c()}}const g=()=>p(),_=()=>!u;function y($){se[$?"unshift":"push"](()=>{s=$,t(1,s)})}function k($){de.call(this,n,$)}function T($){de.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,p,f,l,o,g,_,y,k,T]}class S6 extends ve{constructor(e){super(),be(this,e,w6,k6,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function i_(n,e,t){const i=n.slice();return i[32]=e[t],i}function s_(n,e,t){const i=n.slice();return i[35]=e[t],i}function l_(n,e,t){const i=n.slice();return i[32]=e[t],i}function T6(n){let e,t,i,s,l,o,r,a,u,f,c,d,p,h,g,_,y,k,T,$,M,C,O;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[C6,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,P=n[6]&&n[1].length&&!n[7]&&r_(),L=n[6]&&n[1].length&&n[7]&&a_(n),F=n[13].length&&v_(n),N=!!n[0]&&y_(n);return{c(){e=v("input"),t=D(),i=v("div"),s=v("p"),l=B(`Paste below the collections configuration you want to import or
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),V(a.$$.fragment),u=D(),f=D(),P&&P.c(),c=D(),L&&L.c(),d=D(),F&&F.c(),p=D(),h=v("div"),N&&N.c(),g=D(),_=v("div"),y=D(),k=v("button"),T=v("span"),T.textContent="Review",m(e,"type","file"),m(e,"class","hidden"),m(e,"accept",".json"),m(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),m(i,"class","content txt-xl m-b-base"),m(_,"class","flex-fill"),m(T,"class","txt"),m(k,"type","button"),m(k,"class","btn btn-expanded btn-warning m-l-auto"),k.disabled=$=!n[14],m(h,"class","flex m-t-base")},m(R,z){S(R,e,z),n[19](e),S(R,t,z),S(R,i,z),b(i,s),b(s,l),b(s,o),S(R,r,z),q(a,R,z),S(R,u,z),S(R,f,z),P&&P.m(R,z),S(R,c,z),L&&L.m(R,z),S(R,d,z),F&&F.m(R,z),S(R,p,z),S(R,h,z),N&&N.m(h,null),b(h,g),b(h,_),b(h,y),b(h,k),b(k,T),M=!0,C||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(k,"click",n[26])],C=!0)},p(R,z){(!M||z[0]&4096)&&Q(o,"btn-loading",R[12]);const W={};z[0]&64&&(W.class="form-field "+(R[6]?"":"field-error")),z[0]&65|z[1]&1536&&(W.$$scope={dirty:z,ctx:R}),a.$set(W),R[6]&&R[1].length&&!R[7]?P||(P=r_(),P.c(),P.m(c.parentNode,c)):P&&(P.d(1),P=null),R[6]&&R[1].length&&R[7]?L?L.p(R,z):(L=a_(R),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),R[13].length?F?F.p(R,z):(F=v_(R),F.c(),F.m(p.parentNode,p)):F&&(F.d(1),F=null),R[0]?N?N.p(R,z):(N=y_(R),N.c(),N.m(h,g)):N&&(N.d(1),N=null),(!M||z[0]&16384&&$!==($=!R[14]))&&(k.disabled=$)},i(R){M||(A(a.$$.fragment,R),A(E),M=!0)},o(R){I(a.$$.fragment,R),I(E),M=!1},d(R){R&&w(e),n[19](null),R&&w(t),R&&w(i),R&&w(r),j(a,R),R&&w(u),R&&w(f),P&&P.d(R),R&&w(c),L&&L.d(R),R&&w(d),F&&F.d(R),R&&w(p),R&&w(h),N&&N.d(),C=!1,Ae(O)}}}function $6(n){let e;return{c(){e=v("div"),m(e,"class","loader")},m(t,i){S(t,e,i)},p:X,i:X,o:X,d(t){t&&w(e)}}}function o_(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",m(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function C6(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&o_();return{c(){e=v("label"),t=B("Collections"),s=D(),l=v("textarea"),r=D(),c&&c.c(),a=we(),m(e,"for",i=n[40]),m(e,"class","p-b-10"),m(l,"id",o=n[40]),m(l,"class","code"),m(l,"spellcheck","false"),m(l,"rows","15"),l.required=!0},m(d,p){S(d,e,p),b(e,t),S(d,s,p),S(d,l,p),ue(l,n[0]),S(d,r,p),c&&c.m(d,p),S(d,a,p),u||(f=K(l,"input",n[22]),u=!0)},p(d,p){p[1]&512&&i!==(i=d[40])&&m(e,"for",i),p[1]&512&&o!==(o=d[40])&&m(l,"id",o),p[0]&1&&ue(l,d[0]),d[0]&&!d[6]?c||(c=o_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&w(e),d&&w(s),d&&w(l),d&&w(r),c&&c.d(d),d&&w(a),u=!1,f()}}}function r_(n){let e;return{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,m(e,"class","alert alert-info")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function a_(n){let e,t,i,s,l,o=n[9].length&&u_(n),r=n[4].length&&d_(n),a=n[8].length&&__(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=D(),i=v("div"),o&&o.c(),s=D(),r&&r.c(),l=D(),a&&a.c(),m(e,"class","section-title"),m(i,"class","list")},m(u,f){S(u,e,f),S(u,t,f),S(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=u_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=d_(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=__(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&w(e),u&&w(t),u&&w(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function u_(n){let e=[],t=new Map,i,s=n[9];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=l_(n,s,o),a=l(r);t.set(a,e[o]=c_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=Ct(e,r,l,1,o,s,t,i.parentNode,ns,c_,i,l_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function f_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&w(e)}}}function c_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&f_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=D(),l=v("strong"),r=B(o),a=D(),f&&f.c(),u=D(),m(i,"class","label label-danger list-label svelte-1jx20fl"),m(t,"class","list-item"),this.first=t},m(c,d){S(c,t,d),b(t,i),b(t,s),b(t,l),b(l,r),b(t,a),f&&f.m(t,null),b(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,d):(f=f_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&w(t),f&&f.d()}}}function d_(n){let e=[],t=new Map,i,s=n[4];const l=o=>o[35].old.id+o[35].new.id;for(let o=0;o<s.length;o+=1){let r=s_(n,s,o),a=l(r);t.set(a,e[o]=h_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=Ct(e,r,l,1,o,s,t,i.parentNode,ns,h_,i,s_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function p_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=B(t),s=D(),l=v("i"),m(e,"class","txt-strikethrough txt-hint"),m(l,"class","ri-arrow-right-line txt-sm")},m(o,r){S(o,e,r),b(e,i),S(o,s,r),S(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&w(e),o&&w(s),o&&w(l)}}}function m_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&w(e)}}}function h_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&p_(e),p=e[35].new.id&&m_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=D(),l=v("div"),d&&d.c(),o=D(),r=v("strong"),u=B(a),f=D(),p&&p.c(),c=D(),m(i,"class","label label-warning list-label svelte-1jx20fl"),m(l,"class","inline-flex flex-gap-5"),m(t,"class","list-item"),this.first=t},m(h,g){S(h,t,g),b(t,i),b(t,s),b(t,l),d&&d.m(l,null),b(l,o),b(l,r),b(r,u),b(l,f),p&&p.m(l,null),b(t,c)},p(h,g){e=h,e[35].old.name!==e[35].new.name?d?d.p(e,g):(d=p_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),g[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?p?p.p(e,g):(p=m_(e),p.c(),p.m(l,null)):p&&(p.d(1),p=null)},d(h){h&&w(t),d&&d.d(),p&&p.d()}}}function __(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=i_(n,s,o),a=l(r);t.set(a,e[o]=b_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=we()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);S(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=Ct(e,r,l,1,o,s,t,i.parentNode,ns,b_,i,i_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&w(i)}}}function g_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=B("("),s=B(i),l=B(")"),m(e,"class","txt-hint")},m(o,r){S(o,e,r
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=D(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',m(t,"class","icon"),m(s,"class","content"),m(o,"type","button"),m(o,"class","btn btn-warning btn-sm btn-outline"),m(e,"class","alert alert-warning m-t-base")},m(u,f){S(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:X,d(u){u&&w(e),r=!1,a()}}}function y_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',m(e,"type","button"),m(e,"class","btn btn-transparent link-hint")},m(s,l){S(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:X,d(s){s&&w(e),t=!1,i()}}}function M6(n){let e,t,i,s,l,o,r,a,u,f,c,d;const p=[$6,T6],h=[];function g(_,y){return _[5]?0:1}return f=g(n),c=h[f]=p[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=D(),l=v("div"),o=B(n[15]),r=D(),a=v("div"),u=v("div"),c.c(),m(i,"class","breadcrumb-item"),m(l,"class","breadcrumb-item"),m(t,"class","breadcrumbs"),m(e,"class","page-header"),m(u,"class","panel"),m(a,"class","wrapper")},m(_,y){S(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),S(_,r,y),S(_,a,y),b(a,u),h[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&le(o,_[15]);let k=f;f=g(_),f===k?h[f].p(_,y):(re(),I(h[k],1,1,()=>{h[k]=null}),ae(),c=h[f],c?c.p(_,y):(c=h[f]=p[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&w(e),_&&w(r),_&&w(a),h[f].d()}}}function O6(n){let e,t,i,s,l,o;e=new Ni({}),i=new Cn({props:{$$slots:{default:[M6]},$$scope:{ctx:n}}});let r={};return l=new S6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=D(),V(i.$$.fragment),s=D(),V(l.$$.fragment)},m(a,u){q(e,a,u),S(a,t,u),q(i,a,u),S(a,s,u),q(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!1},d(a){j(e,a),a&&w(t),j(i,a),a&&w(s),n[27](null),j(l,a)}}}function D6(n,e,t){let i,s,l,o,r,a,u;We(n,Ot,G=>t(15,u=G)),Gt(Ot,u="Import collections",u);let f,c,d="",p=!1,h=[],g=[],_=!0,y=[],k=!1;T();async function T(){t(5,k=!0);try{t(2,g=await me.collections.getFullList(200));for(let G of g)delete G.created,delete G.updated}catch(G){me.errorResponseHandler(G)}t(5,k=!1)}function $(){if(t(4,y=[]),!!i)for(let G of h){const fe=H.findByKey(g,"id",G.id);!(fe!=null&&fe.id)||!H.hasCollectionChanges(fe,G,_)||y.push({new:G,old:fe})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let G of h)delete G.created,delete G.updated,G.schema=H.filterDuplicatesByKey(G.schema)}function C(){var G,fe;for(let Z of h){const ce=H.findByKey(g,"name",Z.name)||H.findByKey(g,"id",Z.id);if(!ce)continue;const he=Z.id,Ce=ce.id;Z.id=Ce;const Re=Array.isArray(ce.schema)?ce.schema:[],je=Array.isArray(Z.schema)?Z.schema:[];for(const ye of je){const $e=H.findByKey(Re,"name",ye.name);$e&&$e.id&&(ye.id=$e.id)}for(let ye of h)if(Array.isArray(ye.schema))for(let $e of ye.schema)(G=$e.options)!=null&&G.collectionId&&((fe=$e.options)==null?void 0:fe.collectionId)===he&&($e.options.collectionId=Ce)}t(0,d=JSON.stringify(h,null,4))}function O(G){t(12,p=!0);const fe=new FileReader;fe.onload=async Z=>{t(12,p=!1),t(10,f.value="",f),t(0,d=Z.target.result),await rn(),h.length||(pl("Invalid collections configuration."),E())},fe.onerror=Z=>{console.warn(Z),pl("Failed to load the imported JSON."),t(12,p=!1),t(10,f.value="",f)},fe.readAsText(G)}function E(){t(0,d=""),t(10,f.value="",f),_n({})}function P(G){se[G?"unshift":"push"](()=>{f=G,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const z=()=>C(),W=()=>E(),J=()=>c==null?void 0:c.show(g,h,_);function x(G){se[G?"unshift":"push"](()=>{c=G,t(11,c)})}const ne=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(G=>!!G.id&&!!G.name).length),n.$$.dirty[0]&78&&t(9,s=g.filter(G=>i&&_&&!H.findByKey(h,"id",
<span class="txt">Manage admins</span>`,t=D(),i=v("hr"),s=D(),l=v("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,m(e,"href","/settings/admins"),m(e,"class","dropdown-item closable"),m(l,"type","button"),m(l,"class","dropdown-item closable")},m(a,u){S(a,e,u),S(a,t,u),S(a,i,u),S(a,s,u),S(a,l,u),o||(r=[De(nn.call(null,e)),K(l,"click",n[6])],o=!0)},p:X,d(a){a&&w(e),a&&w(t),a&&w(i),a&&w(s),a&&w(l),o=!1,Ae(r)}}}function Y6(n){var p;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=H.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((p=n[0])==null?void 0:p.id)&&n[1]&&S_(n);return o=new Ib({props:{routes:A6}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new j6({}),f=new U6({}),{c(){t=D(),i=v("div"),d&&d.c(),s=D(),l=v("div"),V(o.$$.fragment),r=D(),V(a.$$.fragment),u=D(),V(f.$$.fragment),m(l,"class","app-body"),m(i,"class","app-layout")},m(h,g){S(h,t,g),S(h,i,g),d&&d.m(i,null),b(i,s),b(i,l),q(o,l,null),b(l,r),q(a,l,null),S(h,u,g),q(f,h,g),c=!0},p(h,[g]){var _;(!c||g&12)&&e!==(e=H.joinNonEmpty([h[3],h[2],"PocketBase"]," - "))&&(document.title=e),(_=h[0])!=null&&_.id&&h[1]?d?(d.p(h,g),g&3&&A(d,1)):(d=S_(h),d.c(),A(d,1),d.m(i,s)):d&&(re(),I(d,1,1,()=>{d=null}),ae())},i(h){c||(A(d),A(o.$$.fragment,h),A(a.$$.fragment,h),A(f.$$.fragment,h),c=!0)},o(h){I(d),I(o.$$.fragment,h),I(a.$$.fragment,h),I(f.$$.fragment,h),c=!1},d(h){h&&w(t),h&&w(i),d&&d.d(),j(o),j(a),h&&w(u),j(f,h)}}}function K6(n,e,t){let i,s,l,o;We(n,Cs,p=>t(8,i=p)),We(n,ko,p=>t(2,s=p)),We(n,Ea,p=>t(0,l=p)),We(n,Ot,p=>t(3,o=p));let r,a=!1;function u(p){var h,g,_,y;((h=p==null?void 0:p.detail)==null?void 0:h.location)!==r&&(t(1,a=!!((_=(g=p==null?void 0:p.detail)==null?void 0:g.userData)!=null&&_.showAppSidebar)),r=(y=p==null?void 0:p.detail)==null?void 0:y.location,Gt(Ot,o="",o),_n({}),U1())}function f(){Ei("/")}async function c(){var p,h;if(l!=null&&l.id)try{const g=await me.settings.getAll({$cancelKey:"initialAppSettings"});Gt(ko,s=((p=g==null?void 0:g.meta)==null?void 0:p.appName)||"",s),Gt(Cs,i=!!((h=g==null?void 0:g.meta)!=null&&h.hideControls),i)}catch(g){g!=null&&g.isAbort||console.warn("Failed to load app settings.",g)}}function d(){me.logout()}return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&c()},[l,a,s,o,u,f,d]}class J6 extends ve{constructor(e){super(),be(this,e,K6,Y6,_e,{})}}new J6({target:document.getElementById("app")});export{Ae as A,Ut as B,H as C,Ei as D,we as E,zg as F,va as G,gu as H,We as I,Pi as J,vt as K,Qt as L,se as M,H1 as N,Ct as O,ns as P,an as Q,hn as R,ve as S,Nr as T,I as a,D as b,V as c,j as d,v as e,m as f,S as g,b as h,be as i,De as j,re as k,nn as l,q as m,ae as n,w as o,me as p,pe as q,Q as r,_e as s,A as t,K as u,ft as v,B as w,le as x,X as y,ue as z};