232 lines
968 KiB
JavaScript
232 lines
968 KiB
JavaScript
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const vl=n=>n;function Re(n,e){for(const t in e)n[t]=e[t];return n}function q1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Q_(n){return n()}function du(){return Object.create(null)}function Oe(n){n.forEach(Q_)}function jt(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Pl;function gn(n,e){return Pl||(Pl=document.createElement("a")),Pl.href=e,n===Pl.href}function j1(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null)return x;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function z1(n){let e;return ha(n,t=>e=t)(),e}function Ke(n,e,t){n.$$.on_destroy.push(ha(e,t))}function wt(n,e,t,i){if(n){const s=x_(n,e,t,i);return n[0](s)}}function x_(n,e,t,i){return n[1]&&i?Re(t.ctx.slice(),n[1](i(e))):t.ctx}function St(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 Ct(n,e,t,i,s,l){if(s){const o=x_(e,t,i,l);n.p(o,s)}}function $t(n){if(n.ctx.length>32){const e=[],t=n.ctx.length/32;for(let i=0;i<t;i++)e[i]=-1;return e}return-1}function Gt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Xe(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function is(n){return n??""}function ln(n,e,t){return n.set(t),e}function $e(n){return n&&jt(n.destroy)?n.destroy:x}function pu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const eg=typeof window<"u";let Fo=eg?()=>window.performance.now():()=>Date.now(),_a=eg?n=>requestAnimationFrame(n):x;const bs=new Set;function tg(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&_a(tg)}function No(n){let e;return bs.size===0&&_a(tg),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function b(n,e){n.appendChild(e)}function ng(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function V1(n){const e=v("style");return H1(ng(n),e),e.sheet}function H1(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function ht(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function E(){return U(" ")}function ye(){return U("")}function Y(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Qe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Dn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const B1=["width","height"];function ri(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&&B1.indexOf(i)===-1?n[i]=e[i]:p(n,i,e[i])}function U1(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 pt(n){return n===""?null:+n}function W1(n){return Arr
|
||
|
`;for(let g=0;g<=1;g+=a){const y=e+(t-e)*l(g);u+=g*100+`%{${o(y,1-y)}}
|
||
|
`}const f=u+`100% {${o(t,1-t)}}
|
||
|
}`,c=`__svelte_${Y1(f)}_${r}`,d=ng(n),{stylesheet:m,rules:_}=co.get(d)||K1(d,n);_[c]||(_[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${s}ms 1 both`,po+=1,c}function ul(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(", "),po-=s,po||J1())}function J1(){_a(()=>{po||(co.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),co.clear())})}function Z1(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=vl,start:a=Fo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,_;function h(){c&&(_=al(n,0,1,o,l,r,c)),l||(m=!0)}function g(){c&&ul(n,_),d=!1}return No(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),g()),!d)return!1;if(m){const S=y-a,$=0+1*r(S/o);f($,1-$)}return!0}),h(),f(0,1),g}function G1(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,sg(n,s)}}function sg(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 fl;function gi(n){fl=n}function yl(){if(!fl)throw new Error("Function called outside component initialization");return fl}function Xt(n){yl().$$.on_mount.push(n)}function X1(n){yl().$$.after_update.push(n)}function Ro(n){yl().$$.on_destroy.push(n)}function Tt(){const n=yl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=ig(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gs=[],te=[];let vs=[];const jr=[],lg=Promise.resolve();let zr=!1;function og(){zr||(zr=!0,lg.then(ga))}function cn(){return og(),lg}function Ge(n){vs.push(n)}function he(n){jr.push(n)}const nr=new Set;let cs=0;function ga(){if(cs!==0)return;const n=fl;do{try{for(;cs<gs.length;){const e=gs[cs];cs++,gi(e),Q1(e.$$)}}catch(e){throw gs.length=0,cs=0,e}for(gi(null),gs.length=0,cs=0;te.length;)te.pop()();for(let e=0;e<vs.length;e+=1){const t=vs[e];nr.has(t)||(nr.add(t),t())}vs.length=0}while(gs.length);for(;jr.length;)jr.pop()();zr=!1,nr.clear(),gi(n)}function Q1(n){if(n.fragment!==null){n.update(),Oe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ge)}}function x1(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 ba(){return qs||(qs=Promise.resolve(),qs.then(()=>{qs=null})),qs}function xi(n,e,t){n.dispatchEvent(ig(`${e?"intro":"outro"}${t}`))}const io=new Set;let si;function ae(){si={r:0,c:[],p:si}}function ue(){si.r||Oe(si.c),si=si.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),si.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const va={duration:0};function rg(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&ul(n,o)}function f(){const{delay:d=0,duration:m=300,easing:_=vl,tick:h=x,css:g}=s||va;g&&(o=al(n,0,1,m,d,_,g,a++)),h(0,1);const y=Fo()+d,S=y+m;r&&r.abort(),l=!0,Ge(()=>xi(n,!0,"start")),r=No($=>{if(l){if($>=S)return h(1,0),xi(n,!0,"end"),u(),l=!1;if($>=y){const C=_(($-y)/m);h(C,1-C)}}return l})}let c=!1;return{start(){c||(c=!0,ul(n),jt(s)?(s=s(i),ba().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function ya(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=si;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:c=vl,tick:d=x,css:m}=s||va;m&&(o=al(n,1,0,f,u,c,m));const _=Fo()+u,h=_+f;Ge(()=>xi(n,!1,"start")),No(g=>{if(l){if(g>=h)return d(0,1),xi(n,!1,"end"),--r.r||Oe(r.c),!1;if(g>=_){con
|
||
|
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`,
|
||
|
`),i.length>1&&(t+=`
|
||
|
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=z.parseIndex(e);return i.tableName=t,z.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=z.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?z.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}}const Bo=An([]);function bo(n,e=4e3){return Uo(n,"info",e)}function Ht(n,e=3e3){return Uo(n,"success",e)}function Ts(n,e=4500){return Uo(n,"error",e)}function Dy(n,e=4500){return Uo(n,"warning",e)}function Uo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{hb(i)},t)};Bo.update(s=>(La(s,i.message),z.pushOrReplaceByKey(s,i,"message"),s))}function hb(n){Bo.update(e=>(La(e,n),e))}function Ia(){Bo.update(n=>{for(let e of n)La(n,e);return[]})}function La(n,e){let t;typeof e=="string"?t=z.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),z.removeByKey(n,"message",t.message))}const wi=An({});function tn(n){wi.set(n||{})}function ai(n){wi.update(e=>(z.deleteByPath(e,n),e))}const Pa=An({});function Gr(n){Pa.set(n||{})}const fi=An([]),yi=An({}),vo=An(!1),_b=An({});function Ay(n){fi.update(e=>{const t=z.findByKey(e,"id",n);return t?yi.set(t):e.length&&yi.set(e[0]),e})}function Iy(n){yi.update(e=>z.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),fi.update(e=>(z.pushOrReplaceByKey(e,n,"id"),Fa(),z.sortCollections(e)))}function Ly(n){fi.update(e=>(z.removeByKey(e,"id",n.id),yi.update(t=>t.id===n.id?e[0]:t),Fa(),e))}async function Py(n=null){vo.set(!0);try{let e=await fe.collections.getFullList(200,{sort:"+name"});e=z.sortCollections(e),fi.set(e);const t=n&&z.findByKey(e,"id",n);t?yi.set(t):e.length&&yi.set(e[0]),Fa()}catch(e){fe.error(e)}vo.set(!1)}function Fa(){_b.update(n=>(fi.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const cr="pb_admin_file_token";jo.prototype.logout=function(n=!0){this.authStore.clear(),n&&qi("/login")};jo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&Ts(l),z.isEmpty(s.data)||tn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),qi("/")};jo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=z1(_b);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(cr)||"";return(!t||hg(t,10))&&(t&&localStorage.removeItem(cr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(cr,t),this._adminFileTokenRequest=null),t};class Fy extends _g{save(e,t){super.save(e,t),t&&!t.collectionId&&Gr(t)}clear(){super.clear(),Gr(null)}}const fe=new jo("../",new Fy("pb_admin_auth"));fe.authStore.model&&!fe.authStore.model.collectionId&&Gr(fe.authStore.model);function Ny(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=n[3].default,_=wt(m,n,n[2],null);return{c(){e=v("div"),t=v("main"),_&&_.c(),i=E(),s=v("footer"),l=v("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
|
||
|
<span class="txt">Docs</span>`,o=E(),r=v("span"),r.textContent="|",a=E(),u=v("a"),f=v("span"),f.textContent="PocketBase v0.17.5",p(t,"class","page-content"),p(l,"href","https://pocketbase.io/docs/"),p(l,"target","_blank"),p(l,"rel","noopener noreferrer"),p(r,"class","delimiter"),p(f,"class","txt"),p(u,"href","https://github.com/pocketbase/pocketbase/releases"),p(u,"target","_blank"),p(u,"rel","noopener noreferrer"),p(u,"title","Releases"),p(s,"class","page-footer"),p(e,"class",c="page-wrapper "+n[1]),Q(e,"center-content",n[0])},m(h,g){w(h,e,g),b(e,t),_&&_.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(h,[g]){_&&_.p&&(!d||g&4)&&Ct(_,m,h,h[2],d?St(m,h[2],g,null):$t(h[2]),null),(!d||g&2&&c!==(c="page-wrapper "+h[1]))&&p(e,"class",c),(!d||g&3)&&Q(e,"center-content",h[0])},i(h){d||(A(_,h),d=!0)},o(h){L(_,h),d=!1},d(h){h&&k(e),_&&_.d(h)}}}function Ry(n,e,t){let{$$slots:i={},$$scope:s}=e,{center:l=!1}=e,{class:o=""}=e;return n.$$set=r=>{"center"in r&&t(0,l=r.center),"class"in r&&t(1,o=r.class),"$$scope"in r&&t(2,s=r.$$scope)},[l,o,s,i]}class Sn extends ve{constructor(e){super(),be(this,e,Ry,Ny,me,{center:0,class:1})}}function Ju(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=E(),i=v("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function qy(n){let e,t,i,s=!n[0]&&Ju();const l=n[1].default,o=wt(l,n,n[2],null);return{c(){e=v("div"),s&&s.c(),t=E(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),b(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Ju(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Ct(o,l,r,r[2],i?St(l,r[2],a,null):$t(r[2]),null)},i(r){i||(A(o,r),i=!0)},o(r){L(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function jy(n){let e,t;return e=new Sn({props:{class:"full-page",center:!0,$$slots:{default:[qy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function zy(n,e,t){let{$$slots:i={},$$scope:s}=e,{nobranding:l=!1}=e;return n.$$set=o=>{"nobranding"in o&&t(0,l=o.nobranding),"$$scope"in o&&t(2,s=o.$$scope)},[l,i,s]}class gb extends ve{constructor(e){super(),be(this,e,zy,jy,me,{nobranding:0})}}function Wo(n){const e=n-1;return e*e*e+1}function Xr(n,{delay:e=0,duration:t=400,easing:i=vl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ui(n,{delay:e=0,duration:t=400,easing:i=Wo,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]=pu(s),[m,_]=pu(l);return{delay:e,duration:t,easing:i,css:(h,g)=>`
|
||
|
transform: ${u} translate(${(1-h)*c}${d}, ${(1-h)*m}${_});
|
||
|
opacity: ${a-f*g}`}}function st(n,{delay:e=0,duration:t=400,easing:i=Wo,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]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),h=parseFloat(l[`border${f[0]}Width`]),g=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*m}px;margin-${u[1]}: ${y*_}px;border-${u[0]}-width: ${y*h}px;border-${u[1]}-width: ${y*g}px;`}}function Jt(n,{delay:e=0,duration:t=400,easing:i=Wo,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 Qr,Ui;const xr="app-tooltip";function Zu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Pi(){return Ui=Ui||document.querySelector("."+xr),Ui||(Ui=document.createElement("div"),Ui.classList.add(xr),document.body.appendChild(Ui)),Ui}function bb(n,e){let t=Pi();if(!t.classList.contains("active")||!(e!=null&&e.text)){ea();return}t.textContent=e.text,t.className=xr+" 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 ea(){clearTimeout(Qr),Pi().classList.remove("active"),Pi().activeNode=void 0}function Vy(n,e){Pi().activeNode=n,clearTimeout(Qr),Qr=setTimeout(()=>{Pi().classList.add("active"),bb(n,e)},isNaN(e.delay)?0:e.delay)}function ze(n,e){let t=Zu(e);function i(){Vy(n,t)}function s(){ea()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&z.isFocusable(n))&&n.addEventListener("click",s),Pi(),{update(l){var o,r;t=Zu(l),(r=(o=Pi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&bb(n,t)},destroy(){var l,o;(o=(l=Pi())==null?void 0:l.activeNode)!=null&&o.contains(n)&&ea(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Gu(n,e,t){const i=n.slice();return i[12]=e[t],i}const Hy=n=>({}),Xu=n=>({uniqueId:n[4]});function By(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Qu(Gu(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ye()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(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=Gu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Qu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){ht(s,o),o&&k(e)}}}function Uy(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon")},m(a,u){w(a,e,u),b(e,t),l=!0,o||(r=$e(i=ze.call(null,t,{position:"left",text:n[3].map(yo).join(`
|
||
|
`)})),o=!0)},p(a,u){i&&jt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(yo).join(`
|
||
|
`)})},i(a){l||(a&&Ge(()=>{l&&(s||(s=qe(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Qu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(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])+"")&&se(s,i)},i(a){r||(a&&Ge(()=>{r&&(o||(o=qe(e,st,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,st,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Wy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=wt(a,n,n[8],Xu),f=[Uy,By],c=[];function d(m,_){return m[0]&&m[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(m,_){w(m,e,_),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=Y(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Ct(u,a,m,m[8],l?St(a,m[8],_,Hy):$t(m[8]),Xu);let h=i;i=d(m),i===h?c[i].p(m,_):(ae(),L(c[h],1,1,()=>{c[h]=null}),ue(),s=c[i],s?s.p(m,_):(s=c[i]=f[i](m),s.c()),A(s,1),s.m(e,null)),(!l||_&2)&&p(e,"class",m[1]),(!l||_&10)&&Q(e,"error",m[3].length)},i(m){l||(A(u,m),A(s),l=!0)},o(m){L(u,m),L(s),l=!1},d(m){m&&k(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const xu="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||xu:n||xu}function Yy(n,e,t){let i;Ke(n,wi,h=>t(7,i=h));let{$$slots:s={},$$scope:l}=e;const o="field_"+z.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ai(r)}Xt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Fe.call(this,n,h)}function _(h){te[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,l=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=z.toArray(z.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,m,_]}class de extends ve{constructor(e){super(),be(this,e,Yy,Wy,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Ky(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Jy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[1]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&re(l,c[1])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function Zy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Gy(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return s=new de({props:{class:"form-field required",name:"email",$$slots:{default:[Ky,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[Jy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:
|
||
|
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),Q(f,"btn-disabled",n[3]),Q(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(_,h){w(_,e,h),b(e,t),b(e,i),V(s,e,null),b(e,l),V(o,e,null),b(e,r),V(a,e,null),b(e,u),b(e,f),c=!0,d||(m=Y(e,"submit",Qe(n[4])),d=!0)},p(_,[h]){const g={};h&1537&&(g.$$scope={dirty:h,ctx:_}),s.$set(g);const y={};h&1538&&(y.$$scope={dirty:h,ctx:_}),o.$set(y);const S={};h&1540&&(S.$$scope={dirty:h,ctx:_}),a.$set(S),(!c||h&8)&&Q(f,"btn-disabled",_[3]),(!c||h&8)&&Q(f,"btn-loading",_[3])},i(_){c||(A(s.$$.fragment,_),A(o.$$.fragment,_),A(a.$$.fragment,_),c=!0)},o(_){L(s.$$.fragment,_),L(o.$$.fragment,_),L(a.$$.fragment,_),c=!1},d(_){_&&k(e),H(s),H(o),H(a),d=!1,m()}}}function Xy(n,e,t){const i=Tt();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await fe.admins.create({email:s,password:l,passwordConfirm:o}),await fe.admins.authWithPassword(s,l),i("submit")}catch(d){fe.error(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 Qy extends ve{constructor(e){super(),be(this,e,Xy,Gy,me,{})}}function ef(n){let e,t;return e=new gb({props:{$$slots:{default:[xy]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function xy(n){let e,t;return e=new Qy({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:x,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function ek(n){let e,t,i=n[0]&&ef(n);return{c(){i&&i.c(),e=ye()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=ef(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(ae(),L(i,1,1,()=>{i=null}),ue())},i(s){t||(A(i),t=!0)},o(s){L(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function tk(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){fe.logout(!1),t(0,i=!0);return}fe.authStore.isValid?qi("/collections"):fe.logout()}return[i,async()=>{t(0,i=!1),await cn(),window.location.search=""}]}class nk extends ve{constructor(e){super(),be(this,e,tk,ek,me,{})}}const Dt=An(""),ko=An(""),Ms=An(!1);function ik(n){let e,t,i,s;return{c(){e=v("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),re(e,n[7]),i||(s=Y(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&re(e,l[7])},i:x,o:x,d(l){l&&k(e),n[13](null),i=!1,s()}}}function sk(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={id:a[8],singleLine:!0,disableRequestKeys:!0,disableIndirectCollectionsKeys:!0,extraAutocompleteKeys:a[3],baseCollection:a[2],placeholder:a[0]||a[1]};return a[7]!==void 0&&(u.value=a[7]),{props:u}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],he(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function tf(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,ui,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,ui,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function nf(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","
|
||
|
<span class="txt">Method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="URL",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function kk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Referer",p(t,"class",z.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function wk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="User IP",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Sk(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Status",p(t,"class",z.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function Ck(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="Created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function rf(n){let e;function t(l,o){return l[6]?Tk:$k}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function $k(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&af(n);return{c(){e=v("tr"),t=v("td"),i=v("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(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=af(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function Tk(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){w(t,e,i)},p:x,d(t){t&&k(e)}}}function af(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[19]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function uf(n){let e;return{c(){e=v("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ff(n,e){var Ce,Je,_t;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,c=e[23].url+"",d,m,_,h,g,y,S=(e[23].referer||"N/A")+"",$,C,T,M,O,D=(e[23].userIp||"N/A")+"",I,P,F,R,N,q=e[23].status+"",j,Z,X,K,J,le,ie,ee,Te,Pe,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((_t=e[23].meta)==null?void 0:_t.errorData))&&uf();K=new ki({props:{date:e[23].created}});function Ve(){return e[17](e[23])}function ke(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("span"),o=U(l),a=E(),u=v("td"),f=v("span"),d=U(c),_=E(),je&&je.c(),h=E(),g=v("td"),y=v("span"),$=U(S),T=E(),M=v("td"),O=v("span"),I=U(D),F=E(),R=v("td"),N=v("span"),j=U(q),Z=E(),X=v("td"),B(K.$$.fragment),J=E(),le=v("td"),le.innerHTML='<i class="ri-arrow-right-line"></i>',ie=E(),p(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",m=e[23].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=e[23].referer),Q(y,"txt-hint",!e[23].referer),p(g,"class","col-type-text col-field-referer"),p(O,"class","txt txt-ellipsis"),p(O,"title",P=e[23].userIp),Q(O,"txt-hint",!e[23].userIp),p(M,"class","col-type-number col-field-userIp"),p(N,"class","label"),Q(N,"label-danger",e[23].status>=400),p(R,"class","col-type-number col-field-status"),p(X,"class","col-type-date col-field-created"),p(le,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Ze,We){w(Ze,t,We),b(t,i),b(i,s),b(s,o),b(t,a),b(t,u),b(u,f),b(f,d),b(u,_),je&&je.m(u,null),b(t,h),b(t,g),b(g,y),b(y,$),b(t,T),b(t,M),b(M,O),b(O,I),b(t,F),b(t,R),b(R,N),b(N,j),b(t,Z),b(t,X),V(K,X,null),b(t,J),b(t,le),b(t,ie),ee=!0,Te||(Pe=[Y(t,"click",Ve),Y(t,"keydown",ke)],Te=!0)},p(Ze,We){var pe,_e,Ye;e=Ze,(!ee||We&8)&&l!==(l=((pe=e[23].method)==null?void 0:pe.toUpperCase())+"")&&se(o,l),(!ee||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&p(s,"class",r),(!ee||We&8)&&c!==(c=e[23].url+"")&&se(d,c),(!ee||We&8&&m!==(m=e[23].url))&&p(f,"title",m),(_e=e[23].meta)!=null&&_e.errorMessage||(Ye=e[23].meta)!=null&&Ye.errorData?je||(je=uf(),je.c(),je.m(u,null)):je&&(je.d(1),je=null),(!ee||We&8)&&S!==(S=(e[23].referer||"N/A")+"")&&se($,S),(!ee||We&8&&C!==(C=e[23].referer))&&p(y,"title",C),(!ee||We&8)&&Q(y,"txt-hint",!e[23].referer),(!ee||We&8)&&D!==(D=(e[23].userIp||"N/A")+"")&&se(I,D),(!ee||We&8&&P!==(P=e[23].userIp))&&p(O,"title",P),(!ee||We&8)&&Q(O,"txt-hint",!e[23].userIp),(!ee||We&8)&&q!==(q=e[23].status+"")&&se(j,q),(!ee||We&8)&&Q(N,"label-danger",e[23].status>=400);const yt={};We&8&&(yt.date=e[23].created),K.$set(yt)},i(Ze){ee||(A(K.$$.fragment,Ze),ee=!0)},o(Ze){L(K.$$.fragment,Ze),ee=!1},d(Ze){Ze&&k(t),je&&je.d(),H(K),Te=!1,Oe(Pe)}}}function Mk(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I=[],P=new Map,F;function R(ke){n[11](ke)}let N={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[vk]},$$scope:{ctx:n}};n[1]!==void 0&&(N.sort=n[1]),s=new un({props:N}),te.push(()=>ce(s,"sort",R));function q(ke){n[12](ke)}let j={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[yk]},$$scope:{ctx:n}};n[1]!==void 0&&(j.sort=n[1]),r=new un({props:j}),te.push(()=>ce(r,"sort",q));function Z(ke){n[13](ke)}let X={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[kk]},$$scope:{ctx:n}};n[1]!==void 0&&(X.sort=n[1]),f=new un({props:X}),te.push(()=>ce(f,"sort",Z));function K(ke){n[14](ke)}let J={disable:!0,class:"col-type-number col-field-userIp",nam
|
||
|
* Chart.js v3.9.1
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/function pi(){}const Ak=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function Ot(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 et(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Rn(n,e){return Bt(n)?n:e}function nt(n,e){return typeof n>"u"?e:n}const Ik=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,vb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Ft(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let s,l,o;if(Ot(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(et(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(Ot(n))return n.map(So);if(et(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 yb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Lk(n,e,t,i){if(!yb(n))return;const s=e[n],l=t[n];et(s)&&et(l)?cl(s,l,i):e[n]=So(l)}function cl(n,e,t){const i=Ot(e)?e:[e],s=i.length;if(!et(n))return n;t=t||{};const l=t.merger||Lk;for(let o=0;o<s;++o){if(e=i[o],!et(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 cl(n,e,{merger:Pk})}function Pk(n,e,t){if(!yb(n))return;const i=e[n],s=t[n];et(i)&&et(s)?nl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const pf={"":n=>n,x:n=>n.x,y:n=>n.y};function Ni(n,e){return(pf[e]||(pf[e]=Fk(e)))(n)}function Fk(n){const e=Nk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Nk(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 Ra(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Un=n=>typeof n<"u",Ri=n=>typeof n=="function",mf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function Rk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const qt=Math.PI,gt=2*qt,qk=gt+qt,Co=Number.POSITIVE_INFINITY,jk=qt/180,Nt=qt/2,Bs=qt/4,hf=qt*2/3,Hn=Math.log10,oi=Math.sign;function _f(n){const e=Math.round(n);n=il(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Hn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function zk(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function il(n,e,t){return Math.abs(n-e)<t}function Vk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function kb(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(qt/180)}function qa(n){return n*(180/qt)}function gf(n){if(!Bt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function wb(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*qt&&(l+=gt),{angle:l,distance:s}}function ta(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Hk(n,e){return(n-e+qk)%gt-qt}function Mn(n){return(n%gt+gt)%gt}function dl(n,e,t,i){const s=Mn(n),l=Mn(e),o=Mn(t),r=Mn(l-s),a=Mn(o-s),u=Mn(s-l),f=Mn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function fn(n,e,t){return Math.max(e,Math.min(t,n))}function Bk(n){return fn(n,-32768,32767)}function pl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function ja(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 Qi=(n,e,t,i)=>ja(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Uk=(n,e,t)=>ja(n,t,i=>n[i][e]>=t);function Wk(n,e,
|
||
|
* @kurkle/color v0.2.1
|
||
|
* https://github.com/kurkle/color#readme
|
||
|
* (c) 2022 Jukka Kurkela
|
||
|
* Released under the MIT License
|
||
|
*/function Tl(n){return n+.5|0}const Ai=(n,e,t)=>Math.max(Math.min(n,t),e);function Qs(n){return Ai(Tl(n*2.55),0,255)}function Fi(n){return Ai(Tl(n*255),0,255)}function _i(n){return Ai(Tl(n/2.55)/100,0,1)}function wf(n){return Ai(Tl(n*100),0,100)}const Nn={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],Zk=n=>na[n&15],Gk=n=>na[(n&240)>>4]+na[n&15],Hl=n=>(n&240)>>4===(n&15),Xk=n=>Hl(n.r)&&Hl(n.g)&&Hl(n.b)&&Hl(n.a);function Qk(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Nn[n[1]]*17,g:255&Nn[n[2]]*17,b:255&Nn[n[3]]*17,a:e===5?Nn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Nn[n[1]]<<4|Nn[n[2]],g:Nn[n[3]]<<4|Nn[n[4]],b:Nn[n[5]]<<4|Nn[n[6]],a:e===9?Nn[n[7]]<<4|Nn[n[8]]:255})),t}const xk=(n,e)=>n<255?e(n):"";function e2(n){var e=Xk(n)?Zk:Gk;return n?"#"+e(n.r)+e(n.g)+e(n.b)+xk(n.a,e):void 0}const t2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Eb(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 n2(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 i2(n,e,t){const i=Eb(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 s2(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 za(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=s2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Va(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Ha(n,e,t){return Va(Eb,n,e,t)}function l2(n,e,t){return Va(i2,n,e,t)}function o2(n,e,t){return Va(n2,n,e,t)}function Db(n){return(n%360+360)%360}function r2(n){const e=t2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Qs(+e[5]):Fi(+e[5]));const s=Db(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=l2(s,l,o):e[1]==="hsv"?i=o2(s,l,o):i=Ha(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function a2(n,e){var t=za(n);t[0]=Db(t[0]+e),t=Ha(t),n.r=t[0],n.g=t[1],n.b=t[2]}function u2(n){if(!n)return;const e=za(n),t=e[0],i=wf(e[1]),s=wf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${_i(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const Sf={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"},Cf={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 dw{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=$b.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 mi=new dw;const Nf="transparent",pw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Tf(n||Nf),s=i.valid&&Tf(e||Nf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class mw{constructor(e,t,i,s){const l=t[i];s=Wl([e.to,s,l,e.from]);const o=Wl([e.from,l,s]);this._active=!0,this._fn=e.fn||pw[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=Wl([e.to,t,s,e.from]),this._from=Wl([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 hw=["x","y","borderWidth","radius","tension"],_w=["color","borderColor","backgroundColor"];it.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 gw=Object.keys(it.animation);it.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});it.set("animations",{colors:{type:"color",properties:_w},numbers:{type:"number",properties:hw}});it.describe("animations",{_fallback:"animation"});it.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 Wb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!et(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!et(s))return;const l={};for(con
|
||
|
`)>-1?n.split(`
|
||
|
`):n}function LS(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 pc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=On(e.bodyFont),u=On(e.titleFont),f=On(e.footerFont),c=l.length,d=s.length,m=i.length,_=Wn(e.padding);let h=_.height,g=0,y=i.reduce((C,T)=>C+T.before.length+T.lines.length+T.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*C+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(C){g=Math.max(g,t.measureText(C).width+S)};return t.save(),t.font=u.string,mt(n.title,$),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,mt(i,C=>{mt(C.before,$),mt(C.lines,$),mt(C.after,$)}),S=0,t.font=f.string,mt(n.footer,$),t.restore(),g+=_.width,{width:g,height:h}}function PS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function FS(n,e,t,i){const{x:s,width:l}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&s+l+o>e.width||n==="right"&&s-l-o<0)return!0}function NS(n,e,t,i){const{x:s,width:l}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=s<=(r+a)/2?"left":"right":s<=l/2?u="left":s>=o-l/2&&(u="right"),FS(u,n,e,t)&&(u="center"),u}function mc(n,e,t){const i=t.yAlign||e.yAlign||PS(n,t);return{xAlign:t.xAlign||e.xAlign||NS(n,e,t,i),yAlign:i}}function RS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function qS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function hc(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:m}=ks(o);let _=RS(e,r);const h=qS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,d)+s:r==="right"&&(_+=Math.max(c,m)+s),{x:fn(_,0,i.width-e.width),y:fn(h,0,i.height-e.height)}}function Ql(n,e,t){const i=Wn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function _c(n){return ii([],hi(n))}function jS(n,e,t){return ji(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function gc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ca extends Si{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 Wb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=jS(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=ii(r,hi(s)),r=ii(r,hi(l)),r=ii(r,hi(o)),r}getBeforeBody(e,t){return _c(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=gc(i,l);ii(o.before,hi(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 o4={datetime:He.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:He.TIME_WITH_SECONDS,minute:He.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Gb._date.override({_id:"luxon",_create:function(n){return He.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return o4},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=He.fromFormat(n,e,t):n=He.fromISO(n,t):n instanceof Date?n=He.fromJSDate(n,t):i==="object"&&!(n instanceof He)&&(n=He.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 $c(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Jt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function r4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function a4(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function u4(n){let e,t,i,s,l,o=n[2]&&$c();function r(f,c){return f[2]?a4:r4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),qr(i,"height","250px"),qr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=$c(),o.c(),A(o,1),o.m(e,t)):o&&(ae(),L(o,1,1,()=>{o=null}),ue()),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){L(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function f4(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),fe.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{c();for(let _ of m)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),fe.error(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Xt(()=>(Io.register(zi,Xo,Zo,su,Dl,IS,zS),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:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())
|
||
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
||
|
*
|
||
|
* @license MIT <https://opensource.org/licenses/MIT>
|
||
|
* @author Lea Verou <https://lea.verou.me>
|
||
|
* @namespace
|
||
|
* @public
|
||
|
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S($,C){C=C||{};var T,M;switch(r.util.type($)){case"Object":if(M=r.util.objId($),C[M])return C[M];T={},C[M]=T;for(var O in $)$.hasOwnProperty(O)&&(T[O]=S($[O],C));return T;case"Array":return M=r.util.objId($),C[M]?C[M]:(T=[],C[M]=T,$.forEach(function(D,I){T[I]=S(D,C)}),T);default:return $}},getLanguage:function(S){for(;S;){var $=s.exec(S.className);if($)return $[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,$){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(T){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var C in $)if($[C].src==S)return $[C]}return null}},isActive:function(S,$,C){for(var T="no-"+$;S;){var M=S.classList;if(M.contains($))return!0;if(M.contains(T))return!1;S=S.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var C=r.util.clone(r.languages[S]);for(var T in $)C[T]=$[T];return C},insertBefore:function(S,$,C,T){T=T||r.languages;var M=T[S],O={};for(var D in M)if(M.hasOwnProperty(D)){if(D==$)for(var I in C)C.hasOwnProperty(I)&&(O[I]=C[I]);C.hasOwnProperty(D)||(O[D]=M[D])}var P=T[S];return T[S]=O,r.languages.DFS(r.languages,function(F,R){R===P&&F!=S&&(this[F]=O)}),O},DFS:function S($,C,T,M){M=M||{};var O=r.util.objId;for(var D in $)if($.hasOwnProperty(D)){C.call($,D,$[D],T||D);var I=$[D],P=r.util.type(I);P==="Object"&&!M[O(I)]?(M[O(I)]=!0,S(I,C,null,M)):P==="Array"&&!M[O(I)]&&(M[O(I)]=!0,S(I,C,D,M))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,C){var T={callback:C,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),r.hooks.run("before-all-elements-highlight",T);for(var M=0,O;O=T.elements[M++];)r.highlightElement(O,$===!0,T.callback)},highlightElement:function(S,$,C){var T=r.util.getLanguage(S),M=r.languages[T];r.util.setLanguage(S,T);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,T);var D=S.textContent,I={element:S,language:T,grammar:M,code:D};function P(R){I.highlightedCode=R,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),C&&C.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),C&&C.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){P(r.util.encode(I.code));return}if($&&i.Worker){var F=new Worker(r.filename);F.onmessage=function(R){P(R.data)},F.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else P(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,$,C){var T={code:S,grammar:$,language:C};if(r.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=r.tokenize(T.code,T.grammar),r.hooks.run("after-tokenize",T),a.stringify(r.util.encode(T.tokens),T.language)},tokenize:function(S,$){var C=$.rest;if(C){for(var T in C)$[T]=C[T];delete $.rest}var M=new c;return d(M,M.head,S),f(S,M,$,M.head,0),_(M)},hooks:{all:{},add:function
|
||
|
`),g.hasAttribute("data-start")||g.setAttribute("data-start",String(I+1))}y.textContent=M,t.highlightElement(y)},function(M){g.setAttribute(r,f),y.textContent=M})}}),t.plugins.fileHighlight={highlight:function(g){for(var y=(g||document).querySelectorAll(c),S=0,$;$=y[S++];)t.highlightElement($)}};var _=!1;t.fileHighlight=function(){_||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),_=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(_1);var p4=_1.exports;const Zs=d4(p4);var m4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
|
||
|
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=s(f[d]);c+=m,c>r&&(f[d]=`
|
||
|
`+f[d],c=m)}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,m="",_="",h=!1,g=0;g<d.length;++g){var y=d[g];y==o.element?h=!0:y.nodeName==="#text"&&(h?_+=y.nodeValue:m+=y.nodeValue,a.removeChild(y),--g)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+_,o.code=r.normalize(o.code,o.settings);else{var S=m+o.element.innerHTML+_;o.element.innerHTML=r.normalize(S,o.settings),o.code=o.element.textContent}}}})})()})(m4);(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 h4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(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")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function _4(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 g1 extends ve{constructor(e){super(),be(this,e,_4,h4,me,{class:0,content:2,language:3})}}const g4=n=>({}),Mc=n=>({}),b4=n=>({}),Oc=n=>({});function Ec(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$=n[4]&&!n[2]&&Dc(n);const C=n[19].header,T=wt(C,n,n[18],Oc);let M=n[4]&&n[2]&&Ac(n);const O=n[19].default,D=wt(O,n,n[18],null),I=n[19].footer,P=wt(I,n,n[18],Mc);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),$&&$.c(),r=E(),T&&T.c(),a=E(),M&&M.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),P&&P.c(),p(t,
|
||
|
<span class="txt">New index</span>`,f=E(),B(c.$$.fragment),p(e,"class","section-title"),p(u,"type","button"),p(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),p(r,"class","indexes-list svelte-167lbwu")},m(O,D){w(O,e,D),b(e,t),b(e,s),b(e,l),w(O,o,D),w(O,r,D);for(let I=0;I<y.length;I+=1)y[I]&&y[I].m(r,null);b(r,a),b(r,u),w(O,f,D),V(c,O,D),m=!0,_||(h=Y(u,"click",n[5]),_=!0)},p(O,[D]){var P,F,R;if((!m||D&1)&&i!==(i=(((F=(P=O[0])==null?void 0:P.indexes)==null?void 0:F.length)||0)+"")&&se(s,i),D&7){g=((R=O[0])==null?void 0:R.indexes)||[];let N;for(N=0;N<g.length;N+=1){const q=Vc(O,g,N);y[N]?y[N].p(q,D):(y[N]=Bc(q),y[N].c(),y[N].m(r,a))}for(;N<y.length;N+=1)y[N].d(1);y.length=g.length}const I={};!d&&D&1&&(d=!0,I.collection=O[0],he(()=>d=!1)),c.$set(I)},i(O){m||(A(c.$$.fragment,O),m=!0)},o(O){L(c.$$.fragment,O),m=!1},d(O){O&&k(e),O&&k(o),O&&k(r),ht(y,O),O&&k(f),n[6](null),H(c,O),_=!1,h()}}}const Uc=n=>n.name;function Z4(n,e,t){let i;Ke(n,wi,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let h=0;h<s.indexes.length;h++)if(s.indexes[h]==m){t(0,s.indexes[h]=_,s),ai("indexes."+h);return}s.indexes.push(_),t(0,s)}const r=(m,_)=>l==null?void 0:l.show(m,_),a=()=>l==null?void 0:l.show();function u(m){te[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const c=m=>{for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==m.detail){s.indexes.splice(_,1),ai("indexes."+_);break}t(0,s)},d=m=>{o(m.detail.old,m.detail.new)};return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},[s,l,i,o,r,a,u,f,c,d]}class G4 extends ve{constructor(e){super(),be(this,e,Z4,J4,me,{collection:0})}}function Wc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Yc(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=E(),s=v("span"),o=U(l),r=E(),p(t,"class","icon "+n[6].icon+" svelte-1gz9b6p"),p(s,"class","txt"),p(e,"tabindex","0"),p(e,"class","dropdown-item closable svelte-1gz9b6p")},m(d,m){w(d,e,m),b(e,t),b(e,i),b(e,s),b(s,o),b(e,r),a||(u=[Y(e,"click",Dn(f)),Y(e,"keydown",Dn(c))],a=!0)},p(d,m){n=d},d(d){d&&k(e),a=!1,Oe(u)}}}function X4(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Yc(Wc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ye()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=Wc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Yc(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&k(e)}}}function Q4(n){let e,t,i,s,l,o,r,a,u,f;return o=new Yn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[X4]},$$scope:{ctx:n}}}),{c(){e=v("button"),t=v("i"),i=E(),s=v("div"),s.textContent="New field",l=E(),B(o.$$.fragment),p(t,"class","ri-add-line"),p(s,"class","txt"),p(e,"type","button"),p(e,"class",r="field-types-btn "+n[0]+" svelte-1gz9b6p")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(e,l),V(o,e,null),a=!0,u||(f=Y(e,"click",n[1]),u=!0)},p(c,[d]){const m={};d&512&&(m.$$scope={dirty:d,ctx:c}),o.$set(m),(!a||d&1&&r!==(r="field-types-btn "+c[0]+" svelte-1gz9b6p"))&&p(e,"class",r)},i(c){a||(A(o.$$.fragment,c),a=!0)},o(c){L(o.$$.fragment,c),a=!1},d(c){c&&k(e),H(o),u=!1,f()}}}function x4(n,e,t){let{class:i=""}=e;const s=Tt(),l=[{label:"Plain text",value:"text",icon:z.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:z.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:z.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:z.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:z.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:z.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:z.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:z.getFieldTypeIcon("select")},{label:"File",value:"file",icon:z.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:z.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:z.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Sp
|
||
|
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,y){(!c||y&256&&l!==(l=g[8]))&&p(e,"for",l);const S={};y&256&&(S.id=g[8]),y&1&&(S.disabled=!z.isEmpty(g[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function IC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[4](g)}let h={id:n[8]+".options.onlyDomains",disabled:!z.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(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(g,y){(!c||y&256&&l!==(l=g[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=g[8]+".options.onlyDomains"),y&1&&(S.disabled=!z.isEmpty(g[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function LC(n){let e,t,i,s,l,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[AC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[IC,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function PC(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[LC]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Re(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ci({props:o}),te.push(()=>ce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function FC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(2,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class y1 extends ve{constructor(e){super(),be(this,e,FC,PC,me,{field:0,key:1})}}function NC(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=Re(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new y1({props:o}),te.push(()=>ce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function RC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=Re(Re({},e),Gt(f)),t(2,s=Xe(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class qC extends ve{constructor(e){super(),be(this,e,RC,NC,me,{field:0,key:1})}}function jC(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=Re(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ci({props:o}),te.push(()=>ce(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&6?At(s,[a&2&&{key:r[1]},a&4&&Qt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zC(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=Re(Re({},e),Gt(f)),t(2,
|
||
|
<span class='flatpickr-weekday'>
|
||
|
`+G.join("</span><span class='flatpickr-weekday'>")+`
|
||
|
</span>
|
||
|
`}}function le(){t.calendarContainer.classList.add("hasWeeks");var W=ft("div","flatpickr-weekwrapper");W.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ft("div","flatpickr-weeks");return W.appendChild(G),{weekWrapper:W,weekNumbers:G}}function ie(W,G){G===void 0&&(G=!0);var ne=G?W:W-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,we("onYearChange"),N()),R(),we("onMonthChange"),bn())}function ee(W,G){if(W===void 0&&(W=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Ir(t.config),oe=ne.hours,Se=ne.minutes,Ae=ne.seconds;m(oe,Se,Ae)}t.redraw(),W&&we("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),we("onClose")}function Pe(){t.config!==void 0&&we("onDestroy");for(var W=t._handlers.length;W--;)t._handlers[W].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 G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function je(W){return t.calendarContainer.contains(W)}function Ve(W){if(t.isOpen&&!t.config.inline){var G=$n(W),ne=je(G),oe=G===t.input||G===t.altInput||t.element.contains(G)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Se=!oe&&!ne&&!je(W.relatedTarget),Ae=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(G)});Se&&Ae&&(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 ke(W){if(!(!W||t.config.minDate&&W<t.config.minDate.getFullYear()||t.config.maxDate&&W>t.config.maxDate.getFullYear())){var G=W,ne=t.currentYear!==G;t.currentYear=G||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),we("onYearChange"),N())}}function Ce(W,G){var ne;G===void 0&&(G=!0);var oe=t.parseDate(W,void 0,G);if(t.config.minDate&&oe&&Tn(oe,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&oe&&Tn(oe,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
|
||
|
`),r=v("code"),r.textContent="multipart/form-data",a=U(`
|
||
|
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field
|
||
|
is a
|
||
|
`),c=v("strong"),c.textContent="plain string",d=U(`:
|
||
|
`),m=v("ul"),_=v("li"),_.innerHTML=""true" is converted to the json <code>true</code>",h=E(),g=v("li"),g.innerHTML=""false" is converted to the json <code>false</code>",y=E(),S=v("li"),S.innerHTML=""null" is converted to the json <code>null</code>",$=E(),C=v("li"),C.innerHTML=""[1,2,3]" is converted to the json <code>[1,2,3]</code>",T=E(),M=v("li"),D=U(O),I=U(" is converted to the json "),P=v("code"),P.textContent='{"a":1,"b":2}',F=E(),R=v("li"),R.textContent="numeric strings are converted to json number",N=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",j=E(),Z=v("li"),Z.textContent="any other string (empty string too) is double quoted",X=U(`
|
||
|
Alternatively, if you want to avoid the string value normalizations, you can wrap your
|
||
|
data inside an object, eg.`),K=v("code"),K.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ie,ee){w(ie,e,ee),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,m),b(m,_),b(m,h),b(m,g),b(m,y),b(m,S),b(m,$),b(m,C),b(m,T),b(m,M),b(M,D),b(M,I),b(M,P),b(m,F),b(m,R),b(m,N),b(m,q),b(m,j),b(m,Z),b(i,X),b(i,K),le=!0},i(ie){le||(ie&&Ge(()=>{le&&(J||(J=qe(e,st,{duration:150},!0)),J.run(1))}),le=!0)},o(ie){ie&&(J||(J=qe(e,st,{duration:150},!1)),J.run(0)),le=!1},d(ie){ie&&k(e),ie&&J&&J.end()}}}function D$(n){let e,t,i,s,l,o,r;function a(d,m){return d[2]?E$:O$}let u=a(n),f=u(n),c=n[2]&&wd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=ye(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),b(e,t),b(e,i),f.m(e,null),w(d,s,m),c&&c.m(d,m),w(d,l,m),o||(r=Y(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=wd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ae(),L(c,1,1,()=>{c=null}),ue())},d(d){d&&k(e),f.d(),d&&k(s),c&&c.d(d),d&&k(l),o=!1,r()}}}function A$(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[D$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Re(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new ci({props:o}),te.push(()=>ce(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){V(e,r,a),i=!0},p(r,[a]){const u=a&10?At(s,[a&2&&{key:r[1]},a&8&&Qt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],he(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function I$(n,e,t){const i=["field","key"];let s=Xe(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=Re(Re({},e),Gt(d)),t(3,s=Xe(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class L$ extends ve{constructor(e){super(),be(this,e,I$,A$,me,{field:0,key:1})}}function P$(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&k(e),a&&k(s),a&&k(l)}}}function F$(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class Sd extends ve{constructor(e){super(),be(this,e,F$,P$,me,{item:0})}}const N$=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf
|
||
|
Leave empty for no restriction.`,position:"top"})),S=!0)},p(M,O){(!y||O&4194304&&l!==(l=M[22]))&&p(e,"for",l);const D={};O&4194304&&(D.id=M[22]),O&8&&(D.items=M[3]),!a&&O&1&&(a=!0,D.keyOfSelected=M[0].options.mimeTypes,he(()=>a=!1)),r.$set(D);const I={};O&16777217&&(I.$$scope={dirty:O,ctx:M}),g.$set(I)},i(M){y||(A(r.$$.fragment,M),A(g.$$.fragment,M),y=!0)},o(M){L(r.$$.fragment,M),L(g.$$.fragment,M),y=!1},d(M){M&&k(e),M&&k(o),H(r,M),M&&k(u),M&&k(f),H(g),S=!1,$()}}}function V$(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>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function H$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T;function M(D){n[13](D)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Ns({props:O}),te.push(()=>ce(r,"value",M)),S=new Yn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[V$]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),m=v("button"),_=v("span"),_.textContent="Supported formats",h=E(),g=v("i"),y=E(),B(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(_,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),V(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,m),b(m,_),b(m,h),b(m,g),b(m,y),V(S,m,null),$=!0,C||(T=$e(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"})),C=!0)},p(D,I){(!$||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const P={};I&4194304&&(P.id=D[22]),!a&&I&1&&(a=!0,P.value=D[0].options.thumbs,he(()=>a=!1)),r.$set(P);const F={};I&16777216&&(F.$$scope={dirty:I,ctx:D}),S.$set(F)},i(D){$||(A(r.$$.fragment,D),A(S.$$.fragment,D),$=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),$=!1},d(D){D&&k(e),D&&k(o),H(r,D),D&&k(u),D&&k(f),H(S),C=!1,T()}}}function B$(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&pt(l.value)!==c[0].options.maxSize&&re(l,c[0].options.maxSize)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function Cd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[U$,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function U$(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.maxSelect),r||(a=Y(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.maxSelect&&re(l,u[0].options.maxSelect)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function W$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[z$,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[H$,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[B$,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let _=!n[2]&&Cd(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),a=E(),u=v("div"),B(f.$$.fragment),d=E
|
||
|
<span class="txt">New collection</span>`,p(i,"type","button"),p(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[17]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function Q$(n){let e,t,i;function s(o){n[18](o)}let l={id:n[29],searchable:n[6].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[6],readonly:!n[30]||n[0].id,$$slots:{afterOptions:[X$]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&64&&(a.searchable=o[6].length>5),r[0]&64&&(a.items=o[6]),r[0]&1073741825&&(a.readonly=!o[30]||o[0].id),r[0]&8|r[1]&1&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function x$(n){let e,t,i;function s(o){n[19](o)}let l={id:n[29],items:n[7],readonly:!n[30]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Vi({props:l}),te.push(()=>ce(e,"keyOfSelected",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r[0]&536870912&&(a.id=o[29]),r[0]&1073741824&&(a.readonly=!o[30]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function eT(n){let e,t,i,s,l,o,r,a,u,f;return i=new de({props:{class:"form-field required "+(n[30]?"":"readonly"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[Q$,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field form-field-single-multiple-select "+(n[30]?"":"readonly"),inlineError:!0,$$slots:{default:[x$,({uniqueId:c})=>({29:c}),({uniqueId:c})=>[c?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=E(),B(i.$$.fragment),s=E(),l=v("div"),o=E(),B(r.$$.fragment),a=E(),u=v("div"),p(e,"class","separator"),p(l,"class","separator"),p(u,"class","separator")},m(c,d){w(c,e,d),w(c,t,d),V(i,c,d),w(c,s,d),w(c,l,d),w(c,o,d),V(r,c,d),w(c,a,d),w(c,u,d),f=!0},p(c,d){const m={};d[0]&1073741824&&(m.class="form-field required "+(c[30]?"":"readonly")),d[0]&2&&(m.name="schema."+c[1]+".options.collectionId"),d[0]&1610612809|d[1]&1&&(m.$$scope={dirty:d,ctx:c}),i.$set(m);const _={};d[0]&1073741824&&(_.class="form-field form-field-single-multiple-select "+(c[30]?"":"readonly")),d[0]&1610612740|d[1]&1&&(_.$$scope={dirty:d,ctx:c}),r.$set(_)},i(c){f||(A(i.$$.fragment,c),A(r.$$.fragment,c),f=!0)},o(c){L(i.$$.fragment,c),L(r.$$.fragment,c),f=!1},d(c){c&&k(e),c&&k(t),H(i,c),c&&k(s),c&&k(l),c&&k(o),H(r,c),c&&k(a),c&&k(u)}}}function $d(n){let e,t,i,s,l,o;return t=new de({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[tT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[nT,({uniqueId:r})=>({29:r}),({uniqueId:r})=>[r?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),i=E(),s=v("div"),B(l.$$.fragment),p(e,"class","col-sm-6"),p(s,"class","col-sm-6")},m(r,a){w(r,e,a),V(t,e,null),w(r,i,a),w(r,s,a),V(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&536870913|a[1]&1&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&536870913|a[1]&1&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(A(t.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(t.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&k(e),H(t),r&&k(i),r&&k(s),H(l)}}}function tT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Min select"),s=E(),l=v("input"),p(e,"for",i=n[29]),p(l,"type","number"),p(l,"id",o=n[29]),p(l,"step","1"),p(l,"min","1"),p(l,"placeholder","No min limit")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.minSelect
|
||
|
|
||
|
`),position:"top"})),c=!0)},p(h,g){var S,$;l&&jt(l.update)&&g[0]&36&&l.update.call(null,{text:[`Whether on ${((S=h[5])==null?void 0:S.name)||"relation"} record deletion to delete also the corresponding current collection record(s).`,h[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=h[5])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
|
||
|
|
||
|
`),position:"top"}),(!f||g[0]&536870912&&o!==(o=h[29]))&&p(e,"for",o);const y={};g[0]&536870912&&(y.id=h[29]),!u&&g[0]&1&&(u=!0,y.keyOfSelected=h[0].options.cascadeDelete,he(()=>u=!1)),a.$set(y)},i(h){f||(A(a.$$.fragment,h),f=!0)},o(h){L(a.$$.fragment,h),f=!1},d(h){h&&k(e),h&&k(r),H(a,h),c=!1,d()}}}function lT(n){let e,t,i,s,l,o,r,a,u=!n[2]&&$d(n);return s=new de({props:{class:"form-field",name:"schema."+n[1]+".options.displayFields",$$slots:{default:[iT,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[sT,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),u&&u.c(),t=E(),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(f,c){w(f,e,c),u&&u.m(e,null),b(e,t),b(e,i),V(s,i,null),b(e,l),b(e,o),V(r,o,null),a=!0},p(f,c){f[2]?u&&(ae(),L(u,1,1,()=>{u=null}),ue()):u?(u.p(f,c),c[0]&4&&A(u,1)):(u=$d(f),u.c(),A(u,1),u.m(e,t));const d={};c[0]&2&&(d.name="schema."+f[1]+".options.displayFields"),c[0]&536870929|c[1]&1&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&2&&(m.name="schema."+f[1]+".options.cascadeDelete"),c[0]&536870949|c[1]&1&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){a||(A(u),A(s.$$.fragment,f),A(r.$$.fragment,f),a=!0)},o(f){L(u),L(s.$$.fragment,f),L(r.$$.fragment,f),a=!1},d(f){f&&k(e),u&&u.d(),H(s),H(r)}}}function oT(n){let e,t,i,s,l;const o=[{key:n[1]},n[9]];function r(f){n[20](f)}let a={$$slots:{options:[lT],default:[eT,({interactive:f})=>({30:f}),({interactive:f})=>[f?1073741824:0]]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=Re(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new ci({props:a}),te.push(()=>ce(e,"field",r)),e.$on("rename",n[21]),e.$on("remove",n[22]);let u={};return s=new au({props:u}),n[23](s),s.$on("save",n[24]),{c(){B(e.$$.fragment),i=E(),B(s.$$.fragment)},m(f,c){V(e,f,c),w(f,i,c),V(s,f,c),l=!0},p(f,c){const d=c[0]&514?At(o,[c[0]&2&&{key:f[1]},c[0]&512&&Qt(f[9])]):{};c[0]&1073741951|c[1]&1&&(d.$$scope={dirty:c,ctx:f}),!t&&c[0]&1&&(t=!0,d.field=f[0],he(()=>t=!1)),e.$set(d);const m={};s.$set(m)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){H(e,f),f&&k(i),n[23](null),H(s,f)}}}function rT(n,e,t){var X;let i,s;const l=["field","key"];let o=Xe(e,l),r;Ke(n,fi,K=>t(12,r=K));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}],d=["id","created","updated"],m=["username","email","emailVisibility","verified"];let _=null,h=[],g=null,y=((X=a.options)==null?void 0:X.maxSelect)==1,S=y;function $(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1,displayFields:[]},a),t(2,y=!0),t(11,S=y)}function C(){var K,J;if(t(4,h=d.slice(0)),!!s){s.type==="auth"&&t(4,h=h.concat(m));for(const le of s.schema)h.push(le.name);if(((J=(K=a.options)==null?void 0:K.displayFields)==null?void 0:J.length)>0)for(let le=a.options.displayFields.length-1;le>=0;le--)h.includes(a.options.displayFields[le])||a.options.displayFields.splice(le,1)}}function T(){a.options.minSelect=pt(this.value),t(0,a),t(11,S),t(2,y)}function M(){a.options.maxSelect=pt(this.value),t(0,a),t(11,S),t(2,y)}function O(K){n.$$.not_equal(a.options.displayFields,K)&&(a.options.displayFields=K,t(0,a),t(11,S),t(2,y))}function D(K){n.$$.not_equal(a.options.cascadeDelete,K)&&(a.options.cascadeDelete=K,t(0,a),t(11,S),t(2,y))}const I=()=>_==null?void 0:_.show();function P(K){n.$$.not_equal(a.options.collectionId,K)&&(a.options.collectionId=K,t(0,a),t(11,S),t(2,y))}function F(K){y=K,t(2,y)}function R(K){a=K,t(0,a),t(11,S),t(2,y)}function N(K){Fe.call(this,n,K)}function q(K){Fe.call(this,n,K)}function j(K){te[K?"unshift":"push"](()=>{_=K,t(3,_)})}const Z=K=>{var J,le;(le=(J=K==null?void 0:K.detail)==null?void 0:J.collection)!=null&&le.id&&K.detail.collection.type!="view"&&t(0,a.options.collectionId=K.detail.collection.id,a)};return n.$$set=K=>{e=Re(Re({},e),Gt(
|
||
|
`),t=v("code"),t.textContent="username",i=U(` ,
|
||
|
`),s=v("code"),s.textContent="email",l=U(` ,
|
||
|
`),o=v("code"),o.textContent="emailVisibility",r=U(` ,
|
||
|
`),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&k(e),u&&k(t),u&&k(i),u&&k(s),u&&k(l),u&&k(o),u&&k(r),u&&k(a)}}}function dT(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u){let f={key:u[4](u[17])};return u[17]!==void 0&&(f.field=u[17]),{props:f}}return r&&(e=Rt(r,a(n)),te.push(()=>ce(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=E()},m(u,f){e&&V(e,u,f),w(u,i,f),s=!0},p(u,f){n=u;const c={};if(f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],he(()=>t=!1)),f&1&&r!==(r=n[1][n[17].type])){if(e){ae();const d=e;L(d.$$.fragment,1,0,()=>{H(d,1)}),ue()}r?(e=Rt(r,a(n)),te.push(()=>ce(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else r&&e.$set(c)},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){e&&H(e,u),u&&k(i)}}}function Ed(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[dT]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Al({props:r}),te.push(()=>ce(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function pT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=[],_=new Map,h,g,y,S,$,C,T,M,O=n[0].type==="auth"&&Od(),D=n[0].schema;const I=R=>R[17];for(let R=0;R<D.length;R+=1){let N=Md(n,D,R),q=I(N);_.set(q,m[R]=Ed(q,N))}g=new eC({props:{class:"btn btn-block btn-outline"}}),g.$on("select",n[12]);function P(R){n[13](R)}let F={};return n[0]!==void 0&&(F.collection=n[0]),C=new G4({props:F}),te.push(()=>ce(C,"collection",P)),{c(){e=v("div"),t=v("p"),i=U(`System fields:
|
||
|
`),s=v("code"),s.textContent="id",l=U(` ,
|
||
|
`),o=v("code"),o.textContent="created",r=U(` ,
|
||
|
`),a=v("code"),a.textContent="updated",u=E(),O&&O.c(),f=U(`
|
||
|
.`),c=E(),d=v("div");for(let R=0;R<m.length;R+=1)m[R].c();h=E(),B(g.$$.fragment),y=E(),S=v("hr"),$=E(),B(C.$$.fragment),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","schema-fields")},m(R,N){w(R,e,N),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),w(R,c,N),w(R,d,N);for(let q=0;q<m.length;q+=1)m[q]&&m[q].m(d,null);w(R,h,N),V(g,R,N),w(R,y,N),w(R,S,N),w(R,$,N),V(C,R,N),M=!0},p(R,[N]){R[0].type==="auth"?O||(O=Od(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),N&55&&(D=R[0].schema,ae(),m=bt(m,N,I,1,R,D,_,d,Ut,Ed,null,Md),ue());const q={};!T&&N&1&&(T=!0,q.collection=R[0],he(()=>T=!1)),C.$set(q)},i(R){if(!M){for(let N=0;N<D.length;N+=1)A(m[N]);A(g.$$.fragment,R),A(C.$$.fragment,R),M=!0}},o(R){for(let N=0;N<m.length;N+=1)L(m[N]);L(g.$$.fragment,R),L(C.$$.fragment,R),M=!1},d(R){R&&k(e),O&&O.d(),R&&k(c),R&&k(d);for(let N=0;N<m.length;N+=1)m[N].d();R&&k(h),H(g,R),R&&k(y),R&&k(S),R&&k($),H(C,R)}}}function mT(n,e,t){let i,{collection:s}=e;const l={text:vC,number:$C,bool:OC,email:y1,url:qC,editor:VC,date:i$,select:M$,json:L$,file:G$,relation:aT};function o(C){s.schema[C]&&(s.schema.splice(C,1),t(0,s))}function r(C="text"){const T=z.initSchemaField({name:a(),type:C});T.onMountSelect=!0,s.schema.push(T),t(0,s)}function a(C="field"){let T="";for(;u(C+T);)++T;return C+T}function u(C){var T;return!!((T=s==null?void 0:s.schema)!=null&&T.find(M=>M.name===C))}function f(C){return i.findIndex(T=>T===C)}function c(C,T){var M;!((M=s==null?void 0:s.schema)!=null&&M.length)||C===T||!T||t(0,s.indexes=s.indexes.map(O=>z.replaceIndexColumn(O,C,T)),s)}function d(C,T,M,O){M[O]=C,t(0,s)}const m=C=>o(C),_=C=>c(C.detail.oldName,C.detail.newName);function h(C){n.$$.not_equal(s.schema,C)&&(s.schema=C,t(0,s))}const g=C=>{if(!C.detail)return;const T=C.detail.target;T.style.opacity=0,setTimeout(()=>{var M;(M=T==null?void 0:T.style)==null||M.removeProperty("opacity")},0),C.detail.dataTransfer.setDragImage(T,0,0)},y=()=>{tn({})},S=C=>r(C.detail);function $(C){s=C,t(0,s)}return n.$$set=C=>{"collection"in C&&t(0,s=C.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,c,d,m,_,h,g,y,S,$]}class hT extends ve{constructor(e){super(),be(this,e,mT,pT,me,{collection:0})}}const _T=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]}),gT=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),bT=n=>({isAdminOnly:n&512}),Id=n=>({isAdminOnly:n[9]});function vT(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[kT,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function yT(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ld(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>`,p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Pd(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML=`<small class="txt svelte-1akuazq">Unlock and set custom rule</small>
|
||
|
<div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>`,p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=Y(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function kT(n){let e,t,i,s,l,o,r=n[9]?"- Admins only":"",a,u,f,c,d,m,_,h,g,y,S;const $=n[12].beforeLabel,C=wt($,n,n[15],Id),T=n[12].afterLabel,M=wt(T,n,n[15],Ad);let O=!n[9]&&Ld(n);function D(q){n[14](q)}var I=n[7];function P(q){let j={id:q[18],baseCollection:q[1],disabled:q[9],placeholder:q[9]?"":q[5]};return q[0]!==void 0&&(j.value=q[0]),{props:j}}I&&(m=Rt(I,P(n)),n[13](m),te.push(()=>ce(m,"value",D)));let F=n[9]&&Pd(n);const R=n[12].default,N=wt(R,n,n[15],Dd);return{c(){e=v("div"),t=v("label"),C&&C.c(),i=E(),s=v("span"),l=U(n[2]),o=E(),a=U(r),u=E(),M&&M.c(),f=E(),O&&O.c(),d=E(),m&&B(m.$$.fragment),h=E(),F&&F.c(),g=E(),y=v("div"),N&&N.c(),p(s,"class","txt"),Q(s,"txt-hint",n[9]),p(t,"for",c=n[18]),p(e,"class","input-wrapper svelte-1akuazq"),p(y,"class","help-block")},m(q,j){w(q,e,j),b(e,t),C&&C.m(t,null),b(t,i),b(t,s),b(s,l),b(s,o),b(s,a),b(t,u),M&&M.m(t,null),b(t,f),O&&O.m(t,null),b(e,d),m&&V(m,e,null),b(e,h),F&&F.m(e,null),w(q,g,j),w(q,y,j),N&&N.m(y,null),S=!0},p(q,j){C&&C.p&&(!S||j&33280)&&Ct(C,$,q,q[15],S?St($,q[15],j,bT):$t(q[15]),Id),(!S||j&4)&&se(l,q[2]),(!S||j&512)&&r!==(r=q[9]?"- Admins only":"")&&se(a,r),(!S||j&512)&&Q(s,"txt-hint",q[9]),M&&M.p&&(!S||j&33280)&&Ct(M,T,q,q[15],S?St(T,q[15],j,gT):$t(q[15]),Ad),q[9]?O&&(O.d(1),O=null):O?O.p(q,j):(O=Ld(q),O.c(),O.m(t,null)),(!S||j&262144&&c!==(c=q[18]))&&p(t,"for",c);const Z={};if(j&262144&&(Z.id=q[18]),j&2&&(Z.baseCollection=q[1]),j&512&&(Z.disabled=q[9]),j&544&&(Z.placeholder=q[9]?"":q[5]),!_&&j&1&&(_=!0,Z.value=q[0],he(()=>_=!1)),j&128&&I!==(I=q[7])){if(m){ae();const X=m;L(X.$$.fragment,1,0,()=>{H(X,1)}),ue()}I?(m=Rt(I,P(q)),q[13](m),te.push(()=>ce(m,"value",D)),B(m.$$.fragment),A(m.$$.fragment,1),V(m,e,h)):m=null}else I&&m.$set(Z);q[9]?F?(F.p(q,j),j&512&&A(F,1)):(F=Pd(q),F.c(),A(F,1),F.m(e,null)):F&&(ae(),L(F,1,1,()=>{F=null}),ue()),N&&N.p&&(!S||j&33280)&&Ct(N,R,q,q[15],S?St(R,q[15],j,_T):$t(q[15]),Dd)},i(q){S||(A(C,q),A(M,q),m&&A(m.$$.fragment,q),A(F),A(N,q),S=!0)},o(q){L(C,q),L(M,q),m&&L(m.$$.fragment,q),L(F),L(N,q),S=!1},d(q){q&&k(e),C&&C.d(q),M&&M.d(q),O&&O.d(),n[13](null),m&&H(m),F&&F.d(),q&&k(g),q&&k(y),N&&N.d(q)}}}function wT(n){let e,t,i,s;const l=[yT,vT],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=ye()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(ae(),L(o[f],1,1,()=>{o[f]=null}),ue(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){s||(A(t),s=!0)},o(a){L(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}let Fd;function ST(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:c="Leave empty to grant everyone access..."}=e,d=null,m=null,_=Fd,h=!1;g();async function g(){_||h||(t(8,h=!0),t(7,_=(await at(()=>import("./FilterAutocompleteInput-0c84d8aa.js"),["./FilterAutocompleteInput-0c84d8aa.js","./index-fd4289fb.js"],import.meta.url)).default),Fd=_,t(8,h=!1))}async function y(){t(0,r=m||""),await cn(),d==null||d.focus()}async function S(){m=r,t(0,r=null)}function $(T){te[T?"unshift":"push"](()=>{d=T,t(6,d)})}function C(T){r=T,t(0,r)}return n.$$set=T=>{"collection"in T&&t(1,o=T.collection),"rule"in T&&t(0,r=T.rule),"label"in T&&t(2,a=T.label),"formKey"in T&&t(3,u=T.formKey),"required"in T&&t(4,f=T.required),"placeholder"in T&&t(5,c=T.placeholder),"$$scope"in T&&t(15,l=T.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,c,d,_,h,i,y,S,s,$,C,l]}class Cs extends ve{constructor(e){super(),be(this,e,ST,wT,me,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Nd(n,e,t){const i=n.slic
|
||
|
<code>@request.query.*</code>
|
||
|
<code>@request.data.*</code>
|
||
|
<code>@request.auth.*</code>`,m=E(),_=v("hr"),h=E(),g=v("p"),g.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",y=E(),S=v("div"),S.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",$=E(),C=v("hr"),T=E(),M=v("p"),M.innerHTML=`Example rule:
|
||
|
<br/>
|
||
|
<code>@request.auth.id != "" && created > "2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(_,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(F,R){w(F,e,R),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let N=0;N<P.length;N+=1)P[N]&&P[N].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,m),b(i,_),b(i,h),b(i,g),b(i,y),b(i,S),b(i,$),b(i,C),b(i,T),b(i,M),D=!0},p(F,R){if(R&4){I=F[2];let N;for(N=0;N<I.length;N+=1){const q=Nd(F,I,N);P[N]?P[N].p(q,R):(P[N]=qd(q),P[N].c(),P[N].m(o,null))}for(;N<P.length;N+=1)P[N].d(1);P.length=I.length}},i(F){D||(F&&Ge(()=>{D&&(O||(O=qe(e,st,{duration:150},!0)),O.run(1))}),D=!0)},o(F){F&&(O||(O=qe(e,st,{duration:150},!1)),O.run(0)),D=!1},d(F){F&&k(e),ht(P,F),F&&O&&O.end()}}}function qd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function jd(n){let e,t,i,s,l,o,r,a,u;function f(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[CT,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cs({props:c}),te.push(()=>ce(e,"rule",f));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),s=new Cs({props:m}),te.push(()=>ce(s,"rule",d));function _(g){n[8](g)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new Cs({props:h}),te.push(()=>ce(r,"rule",_)),{c(){B(e.$$.fragment),i=E(),B(s.$$.fragment),o=E(),B(r.$$.fragment)},m(g,y){V(e,g,y),w(g,i,y),V(s,g,y),w(g,o,y),V(r,g,y),u=!0},p(g,y){const S={};y&1&&(S.collection=g[0]),y&17408&&(S.$$scope={dirty:y,ctx:g}),!t&&y&1&&(t=!0,S.rule=g[0].createRule,he(()=>t=!1)),e.$set(S);const $={};y&1&&($.collection=g[0]),!l&&y&1&&(l=!0,$.rule=g[0].updateRule,he(()=>l=!1)),s.$set($);const C={};y&1&&(C.collection=g[0]),!a&&y&1&&(a=!0,C.rule=g[0].deleteRule,he(()=>a=!1)),r.$set(C)},i(g){u||(A(e.$$.fragment,g),A(s.$$.fragment,g),A(r.$$.fragment,g),u=!0)},o(g){L(e.$$.fragment,g),L(s.$$.fragment,g),L(r.$$.fragment,g),u=!1},d(g){H(e,g),g&&k(i),H(s,g),g&&k(o),H(r,g)}}}function zd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=$e(ze.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function CT(n){let e,t=!n[10]&&zd();return{c(){t&&t.c(),e=ye()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=zd(),t.c(),t.m(e.parentNode,e))},d(i){t&&t.d(i),i&&k(e)}}}function Vd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[$T]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),te.push(()=>ce(e,"rule",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function $T(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=E(),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){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&k(e),s&&k(t),s&&k(i)}}}function TT(n){var R,N;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,_,h,g,y,S,$,C,T=n[1]&&Rd(n);function M(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Cs({props:O}),te.push(()=>ce(f,"rule",M));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),m=new Cs({props:I}),te.push(()=>ce(m,"rule",D));let P=((R=n[0])==null?void 0:R.type)!=="view"&&jd(n),F=((N=n[0])==null?void 0:N.type)==="auth"&&Vd(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=E(),l=v("button"),r=U(o),a=E(),T&&T.c(),u=E(),B(f.$$.fragment),d=E(),B(m.$$.fragment),h=E(),P&&P.c(),g=E(),F&&F.c(),y=ye(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,j){w(q,e,j),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),T&&T.m(e,null),w(q,u,j),V(f,q,j),w(q,d,j),V(m,q,j),w(q,h,j),P&&P.m(q,j),w(q,g,j),F&&F.m(q,j),w(q,y,j),S=!0,$||(C=Y(l,"click",n[3]),$=!0)},p(q,[j]){var K,J;(!S||j&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?T?(T.p(q,j),j&2&&A(T,1)):(T=Rd(q),T.c(),A(T,1),T.m(e,null)):T&&(ae(),L(T,1,1,()=>{T=null}),ue());const Z={};j&1&&(Z.collection=q[0]),!c&&j&1&&(c=!0,Z.rule=q[0].listRule,he(()=>c=!1)),f.$set(Z);const X={};j&1&&(X.collection=q[0]),!_&&j&1&&(_=!0,X.rule=q[0].viewRule,he(()=>_=!1)),m.$set(X),((K=q[0])==null?void 0:K.type)!=="view"?P?(P.p(q,j),j&1&&A(P,1)):(P=jd(q),P.c(),A(P,1),P.m(g.parentNode,g)):P&&(ae(),L(P,1,1,()=>{P=null}),ue()),((J=q[0])==null?void 0:J.type)==="auth"?F?(F.p(q,j),j&1&&A(F,1)):(F=Vd(q),F.c(),A(F,1),F.m(y.parentNode,y)):F&&(ae(),L(F,1,1,()=>{F=null}),ue())},i(q){S||(A(T),A(f.$$.fragment,q),A(m.$$.fragment,q),A(P),A(F),S=!0)},o(q){L(T),L(f.$$.fragment,q),L(m.$$.fragment,q),L(P),L(F),S=!1},d(q){q&&k(e),T&&T.d(),q&&k(u),H(f,q),q&&k(d),H(m,q),q&&k(h),P&&P.d(q),q&&k(g),F&&F.d(q),q&&k(y),$=!1,C()}}}function MT(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(m){n.$$.not_equal(s.listRule,m)&&(s.listRule=m,t(0,s))}function a(m){n.$$.not_equal(s.viewRule,m)&&(s.viewRule=m,t(0,s))}function u(m){n.$$.not_equal(s.createRule,m)&&(s.createRule=m,t(0,s))}function f(m){n.$$.not_equal(s.updateRule,m)&&(s.updateRule=m,t(0,s))}function c(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function d(m){n.$$.not_equal(s.options.manageRule,m)&&(s.options.manageRule=m,t(0,s))}return n.$$set=m=>{"collection"in m&&t(0,s=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=z.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class OT extends ve{constructor(e){super(),be(this,e,MT,TT,me,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[9]=e[t],i}function ET(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(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,he(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function DT(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Bd(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Ud(Hd(n,i,l));return{c(){e=v("div"),t=v("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){w(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=Hd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Ud(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&&k(e),ht(s,l)}}}function Ud(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&se(i,t)},d(s){s&&k(e)}}}function AT(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[DT,ET],m=[];function _(g,y){return g[2]?0:1}l=_(n),o=m[l]=d[l](n);let h=n[3].length&&Bd(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=E(),o.c(),r=E(),a=v("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>)
|
||
|
<li>The query must have a unique <code>id</code> column.
|
||
|
<br/>
|
||
|
If your query doesn't have a suitable one, you can use the universal
|
||
|
<code>(ROW_NUMBER() OVER()) as id</code>.</li>
|
||
|
<li>Expressions must be aliased with a valid formatted field name (eg.
|
||
|
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=E(),h&&h.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,y){w(g,e,y),b(e,t),w(g,s,y),m[l].m(g,y),w(g,r,y),w(g,a,y),w(g,u,y),h&&h.m(g,y),w(g,f,y),c=!0},p(g,y){(!c||y&256&&i!==(i=g[8]))&&p(e,"for",i);let S=l;l=_(g),l===S?m[l].p(g,y):(ae(),L(m[S],1,1,()=>{m[S]=null}),ue(),o=m[l],o?o.p(g,y):(o=m[l]=d[l](g),o.c()),A(o,1),o.m(r.parentNode,r)),g[3].length?h?h.p(g,y):(h=Bd(g),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(g){c||(A(o),c=!0)},o(g){L(o),c=!1},d(g){g&&k(e),g&&k(s),m[l].d(g),g&&k(r),g&&k(a),g&&k(u),h&&h.d(g),g&&k(f)}}}function IT(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[AT,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function LT(n,e,t){let i;Ke(n,wi,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var _;t(3,r=[]);const d=z.getNestedVal(c,"schema",null);if(z.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=z.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);z.removeByValue(m,"id"),z.removeByValue(m,"created"),z.removeByValue(m,"updated");for(let h in d)for(let g in d[h]){const y=d[h][g].message,S=m[h]||h;r.push(z.sentenize(S+": "+y))}}Xt(async()=>{t(2,o=!0);try{t(1,l=(await at(()=>import("./CodeEditor-8fadd9a5.js"),["./CodeEditor-8fadd9a5.js","./index-fd4289fb.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&&ai("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 PT extends ve{constructor(e){super(),be(this,e,LT,IT,me,{collection:0})}}const FT=n=>({active:n&1}),Wd=n=>({active:n[0]});function Yd(n){let e,t,i;const s=n[15].default,l=wt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Ct(l,s,o,o[14],i?St(s,o[14],r,null):$t(o[14]),null)},i(o){i||(A(l,o),o&&Ge(()=>{i&&(t||(t=qe(e,st,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,st,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function NT(n){let e,t,i,s,l,o,r;const a=n[15].header,u=wt(a,n,n[14],Wd);let f=n[0]&&Yd(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(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=[Y(t,"click",Qe(n[17])),Y(t,"drop",Qe(n[18])),Y(t,"dragstart",n[19]),Y(t,"dragenter",n[20]),Y(t,"dragleave",n[21]),Y(t,"dragover",Qe(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&Ct(u,a,c,c[14],l?St(a,c[14],d,FT):$t(c[14]),Wd),(!l||d&4)&&p(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=Yd(c),f.c(),A(f,1),f.m(e,null)):f&&(ae(),L(f,1,1,()=>{f=null}),ue()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,Oe(r)}}}function RT(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=Tt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function _(){return!!f}function h(){S(),t(0,f=!0),l("expand")}function g(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?g():h()}function S(){if(d&&o.closest(".accordions")){const P=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const F of P)
|
||
|
<span class="txt">Username/Password</span>`,t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[3]?f?d&8&&A(f,1):(f=Kd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),u.d(c),c&&k(l),f&&f.d(c),c&&k(o)}}}function BT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowEmailAuth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Jd(n){let e,t,i,s,l,o,r,a;return i=new de({props:{class:"form-field "+(z.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[UT,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field "+(z.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[WT,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid grid-sm p-t-sm")},m(u,f){w(u,e,f),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),a=!0},p(u,f){const c={};f&1&&(c.class="form-field "+(z.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 "+(z.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&&Ge(()=>{a&&(r||(r=qe(e,st,{duration:150},!0)),r.run(1))}),a=!0)},o(u){L(i.$$.fragment,u),L(o.$$.fragment,u),u&&(r||(r=qe(e,st,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&k(e),H(i),H(o),u&&r&&r.end()}}}function UT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[7](g)}let h={id:n[12],disabled:!z.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(h.value=n[0].options.exceptEmailDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Except domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(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(g,y){(!c||y&4096&&l!==(l=g[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=g[12]),y&1&&(S.disabled=!z.isEmpty(g[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function WT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function _(g){n[8](g)}let h={id:n[12],disabled:!z.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Ns({props:h}),te.push(()=>ce(r,"value",_)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),B(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),V(r,g,y),w(g,u,y),w(g,f,y),c=!0,d||(m=$e(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(g,y){(!c||y&4096&&l!==(l=g[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=g[12]),y&1&&(S.disabled=!z.isEmpty(g[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,he(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&k(e),g&&k(o),H(r,g),g&&k(u),g&&k(f),d=!1,m()}}}function YT(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[BT,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Jd(n);return{c(){B(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){V(e,o,r),w(o,t,r),l&&l.m(o,r),w(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=Jd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function KT(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function JT(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Zd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function ZT(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?JT:KT}let a=r(n),u=a(n),f=n[2]&&Zd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
|
||
|
<span class="txt">Email/Password</span>`,t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Zd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),u.d(c),c&&k(l),f&&f.d(c),c&&k(o)}}}function GT(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function Gd(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>',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Ge(()=>{i&&(t||(t=qe(e,st,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,st,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function XT(n){let e,t,i,s;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[GT,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Gd();return{c(){B(e.$$.fragment),t=E(),l&&l.c(),i=ye()},m(o,r){V(e,o,r),w(o,t,r),l&&l.m(o,r),w(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=Gd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ae(),L(l,1,1,()=>{l=null}),ue())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){H(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function QT(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xT(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Xd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function eM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowOAuth2Auth?xT:QT}let a=r(n),u=a(n),f=n[1]&&Xd();return{c(){e=v("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
|
||
|
<span class="txt">OAuth2</span>`,t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=ye(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[1]?f?d&2&&A(f,1):(f=Xd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(t),c&&k(i),c&&k(s),u.d(c),c&&k(l),f&&f.d(c),c&&k(o)}}}function tM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Minimum password length"),s=E(),l=v("input"),p(e,"for",i=n[12]),p(l,"type","number"),p(l,"id",o=n[12]),l.required=!0,p(l,"min","6"),p(l,"max","72")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].options.minPasswordLength),r||(a=Y(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&p(e,"for",i),f&4096&&o!==(o=u[12])&&p(l,"id",o),f&1&&pt(l.value)!==u[0].options.minPasswordLength&&re(l,u[0].options.minPasswordLength)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function nM(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Always require email",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(s,"for",a=n[12])},m(c,d){w(c,e,d),e.checked=n[0].options.requireEmail,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[Y(e,"change",n[11]),$e(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])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,Oe(f)}}}function iM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y;return s=new ao({props:{single:!0,$$slots:{header:[HT],default:[jT]},$$scope:{ctx:n}}}),o=new ao({props:{single:!0,$$slots:{header:[ZT],default:[YT]},$$scope:{ctx:n}}}),a=new ao({props:{single:!0,$$slots:{header:[eM],default:[XT]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[tM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[nM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),B(s.$$.fragment),l=E(),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",m=E(),B(_.$$.fragment),h=E(),B(g.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,$){w(S,e,$),w(S,t,$),w(S,i,$),V(s,i,null),b(i,l),V(o,i,null),b(i,r),V(a,i,null),w(S,u,$),w(S,f,$),w(S,c,$),w(S,d,$),w(S,m,$),V(_,S,$),w(S,h,$),V(g,S,$),y=!0},p(S,[$]){const C={};$&8201&&(C.$$scope={dirty:$,ctx:S}),s.$set(C);const T={};$&8197&&(T.$$scope={dirty:$,ctx:S}),o.$set(T);const M={};$&8195&&(M.$$scope={dirty:$,ctx:S}),a.$set(M);const O={};$&12289&&(O.$$scope={dirty:$,ctx:S}),_.$set(O);const D={};$&12289&&(D.$$scope={dirty:$,ctx:S}),g.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(_.$$.fragment,S),A(g.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(_.$$.fragment,S),L(g.$$.fragment,S),y=!1},d(S){S&&k(e),S&&k(t),S&&k(i),H(s),H(o),H(a),S&&k(u),S&&k(f),S&&k(c),S&&k(d),S&&k(m),H(_,S),S&&k(h),H(g,S)}}}function sM(n,e,t){let i,s,l,o;Ke(n,wi,h=>t(4,o=h));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=pt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,g,y,S;n.$$.dirty&1&&r.type==="auth"&&z.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!z.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!z.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.onlyEmailDomains)||!z.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!z.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,m,_]}class lM extends ve{constructor(e){super(),be(this,e,sM,iM,me,{collection:0})}}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function tp(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function np(n){let e,t,i,s,l=n[3]&&ip(n),o=!n[4]&&sp(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=ip(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=sp(r),o.c(),o.m(i,null))},d(r){r&&k(e),r&&k(t),r&&k(i),l&&l
|
||
|
`),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(h,g){w(h,e,g),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(h,g){var y,S;g&2&&l!==(l=((y=h[1])==null?void 0:y.name)+"")&&se(o,l),g&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&k(e)}}}function sp(n){let e,t,i,s=n[6],l=[];for(let f=0;f<s.length;f+=1)l[f]=lp(ep(n,s,f));let o=n[8],r=[];for(let f=0;f<o.length;f+=1)r[f]=op(xd(n,o,f));let a=n[7],u=[];for(let f=0;f<a.length;f+=1)u[f]=rp(Qd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=E();for(let f=0;f<r.length;f+=1)r[f].c();t=E();for(let f=0;f<u.length;f+=1)u[f].c();i=ye()},m(f,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);w(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);w(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);w(f,i,c)},p(f,c){if(c&64){s=f[6];let d;for(d=0;d<s.length;d+=1){const m=ep(f,s,d);l[d]?l[d].p(m,c):(l[d]=lp(m),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&256){o=f[8];let d;for(d=0;d<o.length;d+=1){const m=xd(f,o,d);r[d]?r[d].p(m,c):(r[d]=op(m),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&128){a=f[7];let d;for(d=0;d<a.length;d+=1){const m=Qd(f,a,d);u[d]?u[d].p(m,c):(u[d]=rp(m),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){ht(l,f),f&&k(e),ht(r,f),f&&k(t),ht(u,f),f&&k(i)}}}function lp(n){let e,t,i,s=n[18].name+"",l,o,r;return{c(){e=v("li"),t=U(`Multiple to single value conversion of field
|
||
|
`),i=v("strong"),l=U(s),o=E(),r=v("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){w(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&64&&s!==(s=a[18].name+"")&&se(l,s)},d(a){a&&k(e)}}}function op(n){let e,t,i,s,l=n[18].originalName+"",o,r,a,u,f,c=n[18].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed field
|
||
|
`),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,_){w(m,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(m,_){_&256&&l!==(l=m[18].originalName+"")&&se(o,l),_&256&&c!==(c=m[18].name+"")&&se(d,c)},d(m){m&&k(e)}}}function rp(n){let e,t,i,s=n[18].name+"",l,o;return{c(){e=v("li"),t=U("Removed field "),i=v("span"),l=U(s),o=E(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&128&&s!==(s=r[18].name+"")&&se(l,s)},d(r){r&&k(e)}}}function oM(n){let e,t,i,s,l,o,r,a,u=n[7].length&&tp(),f=n[9]&&np(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=E(),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=E(),u&&u.c(),r=E(),f&&f.c(),a=ye(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=tp(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=np(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&k(e),u&&u.d(),c&&k(r),f&&f.d(c),c&&k(a)}}}function rM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function aM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[Y(e,"click",n[12]),Y(i,"click",n[13])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Oe(l)}}}function uM(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[aM],header:[rM],default:[oM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),H(e,s)}}}function fM(n,e,t){let i,s,l,o,r,a;const u=Tt();let f,c,d;async function m(T,M){t(1,c=T),t(2,d=M),await cn(),i||l.length||o.length||r.length?f==null||f.show():h()}function _(){f==null||f.hide()}function h(){_(),u("confirm")}const g=()=>_(),y=()=>h();function S(T){te[T?"unshift":"push"](()=>{f=T,t(5,f)})}function $(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{var T,M,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=((T=d==null?void 0:d.schema)==null?void 0:T.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>{var P,F,R;const I=(P=c==null?void 0:c.schema)==null?void 0:P.find(N=>N.id==D.id);return I?((F=I.options)==null?void 0:F.maxSelect)!=1&&((R=D.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[_,c,d,i,s,f,r,o,l,a,h,m,g,y,S,$,C]}class cM extends ve{constructor(e){super(),be(this,e,fM,uM,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function ap(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function dM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new hT({props:l}),te.push(()=>ce(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new PT({props:l}),te.push(()=>ce(e,"collection",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function up(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new OT({props:o}),te.push(()=>ce(t,"collection",l)),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],he(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function fp(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new lM({props:o}),te.push(()=>ce(t,"collection",l)),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===
|
||
|
<span class="txt">Duplicate</span>`,t=E(),i=v("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable"),p(i,"type","button"),p(i,"class","dropdown-item txt-danger closable")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[26]),Y(i,"click",Dn(Qe(n[27])))],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Oe(l)}}}function dp(n){let e,t,i,s;return i=new Yn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[_M]},$$scope:{ctx:n}}}),{c(){e=v("i"),t=E(),B(i.$$.fragment),p(e,"class","ri-arrow-down-s-fill")},m(l,o){w(l,e,o),w(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&4194304&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(i.$$.fragment,l),s=!0)},o(l){L(i.$$.fragment,l),s=!1},d(l){l&&k(e),l&&k(t),H(i,l)}}}function pp(n){let e,t,i,s,l,o=n[50]+"",r,a,u,f,c;function d(){return n[29](n[49])}return{c(){e=v("button"),t=v("i"),s=E(),l=v("span"),r=U(o),a=U(" collection"),u=E(),p(t,"class",i=is(z.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb"),p(l,"class","txt"),p(e,"type","button"),p(e,"class","dropdown-item closable"),Q(e,"selected",n[49]==n[2].type)},m(m,_){w(m,e,_),b(e,t),b(e,s),b(e,l),b(l,r),b(l,a),b(e,u),f||(c=Y(e,"click",d),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=is(z.getCollectionTypeIcon(n[49]))+" svelte-12y0yzb")&&p(t,"class",i),_[0]&64&&o!==(o=n[50]+"")&&se(r,o),_[0]&68&&Q(e,"selected",n[49]==n[2].type)},d(m){m&&k(e),f=!1,c()}}}function _M(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=pp(ap(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ye()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l[0]&524356){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=ap(s,t,o);i[o]?i[o].p(r,l):(i[o]=pp(r),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},d(s){ht(i,s),s&&k(e)}}}function mp(n){let e;return{c(){e=v("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function gM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y=(n[6][n[2].type]||"N/A")+"",S,$,C,T,M,O,D,I,P,F=!n[2].id&&dp(n),R=n[2].system&&mp();return{c(){e=v("label"),t=U("Name"),s=E(),l=v("input"),f=E(),c=v("div"),d=v("button"),m=v("span"),_=E(),h=v("span"),g=U("Type: "),S=U(y),$=E(),F&&F.c(),M=E(),R&&R.c(),O=ye(),p(e,"for",i=n[48]),p(l,"type","text"),p(l,"id",o=n[48]),l.required=!0,l.disabled=n[13],p(l,"spellcheck","false"),l.autofocus=r=!n[2].id,p(l,"placeholder",a=n[15]?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,p(h,"class","txt"),p(d,"type","button"),p(d,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].id?"btn-transparent":"btn-outline")),d.disabled=T=!!n[2].id,p(c,"class","form-field-addon")},m(N,q){w(N,e,q),b(e,t),w(N,s,q),w(N,l,q),w(N,f,q),w(N,c,q),b(c,d),b(d,m),b(d,_),b(d,h),b(h,g),b(h,S),b(d,$),F&&F.m(d,null),w(N,M,q),R&&R.m(N,q),w(N,O,q),D=!0,n[2].id||l.focus(),I||(P=Y(l,"input",n[28]),I=!0)},p(N,q){(!D||q[1]&131072&&i!==(i=N[48]))&&p(e,"for",i),(!D||q[1]&131072&&o!==(o=N[48]))&&p(l,"id",o),(!D||q[0]&8192)&&(l.disabled=N[13]),(!D||q[0]&4&&r!==(r=!N[2].id))&&(l.autofocus=r),(!D||q[0]&32768&&a!==(a=N[15]?'eg. "users"':'eg. "posts"'))&&p(l,"placeholder",a),(!D||q[0]&4&&u!==(u=N[2].name)&&l.value!==u)&&(l.value=u),(!D||q[0]&68)&&y!==(y=(N[6][N[2].type]||"N/A")+"")&&se(S,y),N[2].id?F&&(ae(),L(F,1,1,()=>{F=null}),ue()):F?(F.p(N,q),q[0]&4&&A(F,1)):(F=dp(N),F.c(),A(F,1),F.m(d,null)),(!D||q[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(N[2].id?"btn-transparent":"btn-outline")))&&p(d,"class",C),(!D||q[0]&4&&T!==(T=!!N[2].id))&&(d.disabled=T),N[2].system?R||(R=mp(),R.c(),R.m(O.parentNode,O)):R&&(R.d(1),R=null)},i(N){D||(A(F),D=!0)},o(N){L(F),D=!1},d(N){N&&k(e),N&&k(s),N&&k(l),N&&k(f),N&&k(c),F&&F.d(),N&&k(M),R&&R.d(N),N&&k(O),I=!1,P()}}}function hp(n){let e,t,i,s,l,o;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=$e(t=ze.call(null,e,n[11])),l=!0)},p(r,a){t&&jt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&Ge(()=>{s&&(i||(i=qe(e,Jt,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(i=qe(e,Jt,{duration:150,start:.7},!1)
|
||
|
<span class="txt">New collection</span>`,p(t,"type","button"),p(t,"class","btn btn-block btn-outline"),p(e,"class","sidebar-footer")},m(l,o){w(l,e,o),b(e,t),i||(s=Y(t,"click",n[12]),i=!0)},p:x,d(l){l&&k(e),i=!1,s()}}}function SM(n){let e,t,i,s,l,o,r,a,u,f,c,d=[],m=new Map,_,h,g,y,S,$,C=n[3];const T=I=>I[15].id;for(let I=0;I<C.length;I+=1){let P=kp(n,C,I),F=T(P);m.set(F,d[I]=Cp(F,P))}let M=null;C.length||(M=wp(n));let O=!n[7]&&$p(n),D={};return g=new au({props:D}),n[13](g),g.$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=E(),r=v("input"),a=E(),u=v("hr"),f=E(),c=v("div");for(let I=0;I<d.length;I+=1)d[I].c();M&&M.c(),_=E(),O&&O.c(),h=E(),B(g.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),Q(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),Q(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),Q(c,"fade",n[6]),Q(c,"sidebar-content-compact",n[3].length>20),p(e,"class","page-sidebar collection-sidebar")},m(I,P){w(I,e,P),b(e,t),b(t,i),b(i,s),b(s,l),b(i,o),b(i,r),re(r,n[0]),b(e,a),b(e,u),b(e,f),b(e,c);for(let F=0;F<d.length;F+=1)d[F]&&d[F].m(c,null);M&&M.m(c,null),b(e,_),O&&O.m(e,null),w(I,h,P),V(g,I,P),y=!0,S||($=[Y(l,"click",n[10]),Y(r,"input",n[11])],S=!0)},p(I,[P]){(!y||P&16)&&Q(l,"hidden",!I[4]),P&1&&r.value!==I[0]&&re(r,I[0]),(!y||P&16)&&Q(i,"active",I[4]),P&42&&(C=I[3],d=bt(d,P,T,1,I,C,m,c,ls,Cp,null,kp),!C.length&&M?M.p(I,P):C.length?M&&(M.d(1),M=null):(M=wp(I),M.c(),M.m(c,null))),(!y||P&64)&&Q(c,"fade",I[6]),(!y||P&8)&&Q(c,"sidebar-content-compact",I[3].length>20),I[7]?O&&(O.d(1),O=null):O?O.p(I,P):(O=$p(I),O.c(),O.m(e,null));const F={};g.$set(F)},i(I){y||(A(g.$$.fragment,I),y=!0)},o(I){L(g.$$.fragment,I),y=!1},d(I){I&&k(e);for(let P=0;P<d.length;P+=1)d[P].d();M&&M.d(),O&&O.d(),I&&k(h),n[13](null),H(g,I),S=!1,Oe($)}}}function CM(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function $M(n,e,t){let i,s,l,o,r,a,u;Ke(n,yi,S=>t(5,o=S)),Ke(n,fi,S=>t(9,r=S)),Ke(n,vo,S=>t(6,a=S)),Ke(n,Ms,S=>t(7,u=S));let f,c="";function d(S){ln(yi,o=S,o)}const m=()=>t(0,c="");function _(){c=this.value,t(0,c)}const h=()=>f==null?void 0:f.show();function g(S){te[S?"unshift":"push"](()=>{f=S,t(2,f)})}const y=S=>{var $;($=S.detail)!=null&&$.isNew&&S.detail.collection&&d(S.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&CM(),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(S=>S.id==c||S.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[c,i,f,l,s,o,a,u,d,r,m,_,h,g,y]}class TM extends ve{constructor(e){super(),be(this,e,$M,SM,me,{})}}function Tp(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 Op(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function Ep(n){let e;return{c(){e=v("hr"),p(e,"class","m-t-sm m-b-sm")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Dp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,c=i&&Ep();function d(){return e[9](e[14])}return{key:n,first:null,c(){t=ye(),c&&c.c(),s=E(),l=v("button"),r=U(o),a=E(),p(l,"type","button"),p(l,"class","sidebar-item"),Q(l,"active",e[5]===e[14]),this.first=t},m(m,_){w(m,t,_),c&&c.m(m,_),w(m,s,_),w(m,l,_),b(l,r),b(l,a),u||(f=Y(l,"click",d),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?c||(c=Ep(),c.c(),c.m(s.parentNode,s)):c&&(c.d(1),c=null),_&8&&o!==(o=e[15].label+"")&&se(r,o),_&40&&Q(l,"active",e[5]===e[14])},d(m){m&&k(t),c&&c.d(m),m&&k(s),m&&k(l),u=!1,f()}}}function Ap(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:EM,then:OM,catch:MM,value:19,blocks:[,,,]};return mu(t=n[15].component,s),{c(){e=ye(),s.block.c()},m(l,o){w(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.an
|
||
|
form-field form-field-list form-field-file
|
||
|
`+(n[4].required?"required":"")+`
|
||
|
`+(n[9]?"dragover":"")+`
|
||
|
`,name:n[4].name,$$slots:{default:[Z5,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),V(t,e,null),i=!0,s||(l=[Y(e,"dragover",Qe(n[25])),Y(e,"dragleave",n[26]),Y(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
|
||
|
form-field form-field-list form-field-file
|
||
|
`+(o[4].required?"required":"")+`
|
||
|
`+(o[9]?"dragover":"")+`
|
||
|
`),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),s=!1,Oe(l)}}}function X5(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,_="";function h(j){z.removeByValue(f,j),t(2,f)}function g(j){z.pushUnique(f,j),t(2,f)}function y(j){z.isEmpty(u[j])||u.splice(j,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(j){var X,K;j.preventDefault(),t(9,m=!1);const Z=((X=j.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const J of Z){const le=s.length+u.length-f.length;if(((K=r.options)==null?void 0:K.maxSelect)<=le)break;u.push(J)}t(1,u)}}Xt(async()=>{t(10,_=await fe.getAdminFileToken(o.collectionId))});const C=j=>h(j),T=j=>g(j);function M(j){a=j,t(0,a),t(6,i),t(4,r)}const O=j=>y(j);function D(j){u=j,t(1,u)}function I(j){te[j?"unshift":"push"](()=>{c=j,t(7,c)})}const P=()=>{for(let j of c.files)u.push(j);t(1,u),t(7,c.value=null,c)},F=()=>c==null?void 0:c.click();function R(j){te[j?"unshift":"push"](()=>{d=j,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=j=>{"record"in j&&t(3,o=j.record),"field"in j&&t(4,r=j.field),"value"in j&&t(0,a=j.value),"uploadedFiles"in j&&t(1,u=j.uploadedFiles),"deletedFileNames"in j&&t(2,f=j.deletedFileNames)},n.$$.update=()=>{var j,Z;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=z.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=z.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((j=r.options)==null?void 0:j.maxSelect)>1),n.$$.dirty[0]&65&&z.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=z.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,m,_,l,h,g,y,$,C,T,M,O,D,I,P,F,R,N,q]}class Q5 extends ve{constructor(e){super(),be(this,e,X5,G5,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Hp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function x5(n,e){e=Hp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=Hp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Bp(n,e,t){const i=n.slice();i[6]=e[t];const s=z.toArray(i[0][i[6]]).slice(0,5);return i[7]=s,i}function Up(n,e,t){const i=n.slice();return i[10]=e[t],i}function Wp(n){let e,t;return e=new uu({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&3&&(l.filename=i[10]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Yp(n){let e=!z.isEmpty(n[10]),t,i,s=e&&Wp(n);return{c(){s&&s.c(),t=ye()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&3&&(e=!z.isEmpty(l[10])),e?s?(s.p(l,o),o&3&&A(s,1)):(s=Wp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ae(),L(s,1,1,()=>{s=null}),ue())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){s&&s.d(l),l&&k(t)}}}function Kp(n){let e,t,i=n[7],s=[];for(let o=0;o<i.length;o+=1)s[o]=Yp(Up(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ye()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&3){i=o[7];let a;for(a=0;a<i.length;a+=1){const u=Up(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Yp(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){ht(s,o),o&&k(e)}}}function e6(n){let e,t,i,s,l,o,r=z.truncate(z.displayValue(n[0],n[2]),70)+"",a,u,f,c,d=n[1],m=[];for(let h=0;h<d.length;h+=1)m[h]=Kp(Bp(n,d,h));const _=h=>L(m[h],1,1,()=>{m[h]=null}
|
||
|
`),I&&I.c(),m=E(),h.c(),g=ye(),p(e,"class","flex m-b-base flex-gap-10"),p(l,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,q){w(N,e,q),V(t,e,null),b(e,i),C&&C.m(e,null),w(N,s,q),w(N,l,q);for(let j=0;j<o.length;j+=1)o[j]&&o[j].m(l,null);O&&O.m(l,null),b(l,a),D&&D.m(l,null),w(N,f,q),w(N,c,q),b(c,d),I&&I.m(c,null),w(N,m,q),F[_].m(N,q),w(N,g,q),y=!0,S||($=$e(u=x5.call(null,l,n[37])),S=!0)},p(N,q){const j={};q[0]&4&&(j.value=N[2]),q[0]&32&&(j.autocompleteCollection=N[5]),t.$set(j),N[11]?C&&(C.d(1),C=null):C?C.p(N,q):(C=Gp(N),C.c(),C.m(e,null)),q[0]&290708&&(T=N[8],ae(),o=bt(o,q,M,1,N,T,r,l,Ut,tm,a,Zp),ue(),!T.length&&O?O.p(N,q):T.length?O&&(O.d(1),O=null):(O=Xp(N),O.c(),O.m(l,a))),N[13]?D||(D=nm(),D.c(),D.m(l,null)):D&&(D.d(1),D=null),u&&jt(u.update)&&q[0]&4104&&u.update.call(null,N[37]),N[4]>1?I?I.p(N,q):(I=im(N),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=_;_=R(N),_===Z?F[_].p(N,q):(ae(),L(F[Z],1,1,()=>{F[Z]=null}),ue(),h=F[_],h?h.p(N,q):(h=F[_]=P[_](N),h.c()),A(h,1),h.m(g.parentNode,g))},i(N){if(!y){A(t.$$.fragment,N);for(let q=0;q<T.length;q+=1)A(o[q]);A(h),y=!0}},o(N){L(t.$$.fragment,N);for(let q=0;q<o.length;q+=1)L(o[q]);L(h),y=!1},d(N){N&&k(e),H(t),C&&C.d(),N&&k(s),N&&k(l);for(let q=0;q<o.length;q+=1)o[q].d();O&&O.d(),D&&D.d(),N&&k(f),N&&k(c),I&&I.d(),N&&k(m),F[_].d(N),N&&k(g),S=!1,$()}}}function a6(n){var r;let e,t,i,s=(((r=n[5])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=U("Select "),i=v("strong"),l=U(s),o=U(" records")},m(a,u){w(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&32&&s!==(s=(((f=a[5])==null?void 0:f.name)||"")+"")&&se(l,s)},d(a){a&&k(e)}}}function u6(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=v("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[Y(e,"click",n[29]),Y(i,"click",n[30])],s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Oe(l)}}}function f6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[20]];let o={$$slots:{footer:[u6],header:[a6],default:[r6]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Re(o,l[a]);e=new on({props:o}),n[40](e),e.$on("hide",n[41]),e.$on("show",n[42]);let r={collection:n[5]};return i=new C1({props:r}),n[43](i),i.$on("save",n[44]),i.$on("delete",n[45]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),s=!0},p(a,u){const f=u[0]&1048576?At(l,[l[0],l[1],Qt(a[20])]):{};u[0]&32764|u[1]&67108864&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),s=!1},d(a){n[40](null),H(e,a),a&&k(t),n[43](null),H(i,a)}}}const no=50;function c6(n,e,t){let i,s,l,o,r,a,u,f,c;const d=["value","field","show","hide"];let m=Xe(e,d),_;Ke(n,fi,Ie=>t(27,_=Ie));const h=Tt(),g="picker_"+z.randomString(5);let{value:y}=e,{field:S}=e,$,C,T="",M=[],O=[],D=1,I=0,P=!1,F=!1;function R(){return t(2,T=""),t(8,M=[]),t(6,O=[]),q(),j(!0),$==null?void 0:$.show()}function N(){return $==null?void 0:$.hide()}async function q(){const Ie=z.toArray(y);if(!s||!Ie.length)return;t(25,F=!0);let rt=[];const Ee=Ie.slice(),lt=[];for(;Ee.length>0;){const Et=[];for(const zt of Ee.splice(0,no))Et.push(`id="${zt}"`);lt.push(fe.collection(s).getFullList(no,{filter:Et.join("||"),$autoCancel:!1}))}try{await Promise.all(lt).then(Et=>{rt=rt.concat(...Et)}),t(6,O=[]);for(const Et of Ie){const zt=z.findByKey(rt,"id",Et);zt&&O.push(zt)}T.trim()||t(8,M=z.filterDuplicatesByKey(O.concat(M))),t(25,F=!1)}catch(Et){Et.isAbort||(fe.error(Et),t(25,F=!1))}}async function j(Ie=!1){if(s){t(3,P=!0),Ie&&(T.trim()?t(8,M=[]):t(8,M=z.toArray(O).slice()));try{const rt=Ie?1:D+1,Ee=z.getAllCollectionIdentifiers(o),lt=await fe.collection(s).getList(rt,no,{filter:z.normalizeSearchFilter(T,Ee),sort:r?"":"-created",skipTotal:1,$cancelKey:g+"loadList"});t(8,M=z.filterDuplicatesByKey(M.concat(lt.items))),D=lt.page,t(24,I=lt.items.le
|
||
|
`,p(e,"class","list-item")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function p6(n){var d;let e,t,i,s,l,o,r,a,u,f;i=new er({props:{record:n[20],displayFields:(d=n[2].options)==null?void 0:d.displayFields}});function c(){return n[10](n[20])}return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),o=v("button"),o.innerHTML='<i class="ri-close-line"></i>',r=E(),p(t,"class","content"),p(o,"type","button"),p(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),p(l,"class","actions"),p(e,"class","list-item"),Q(e,"dragging",n[23]),Q(e,"dragover",n[24])},m(m,_){w(m,e,_),b(e,t),V(i,t,null),b(e,s),b(e,l),b(l,o),w(m,r,_),a=!0,u||(f=[$e(ze.call(null,o,"Remove")),Y(o,"click",c)],u=!0)},p(m,_){var g;n=m;const h={};_&16&&(h.record=n[20]),_&4&&(h.displayFields=(g=n[2].options)==null?void 0:g.displayFields),i.$set(h),(!a||_&8388608)&&Q(e,"dragging",n[23]),(!a||_&16777216)&&Q(e,"dragover",n[24])},i(m){a||(A(i.$$.fragment,m),a=!0)},o(m){L(i.$$.fragment,m),a=!1},d(m){m&&k(e),H(i),m&&k(r),u=!1,Oe(f)}}}function fm(n,e){let t,i,s,l;function o(a){e[11](a)}let r={group:e[2].name+"_relation",index:e[22],disabled:!e[6],$$slots:{default:[p6,({dragging:a,dragover:u})=>({23:a,24:u}),({dragging:a,dragover:u})=>(a?8388608:0)|(u?16777216:0)]},$$scope:{ctx:e}};return e[4]!==void 0&&(r.list=e[4]),i=new Al({props:r}),te.push(()=>ce(i,"list",o)),i.$on("sort",e[12]),{key:n,first:null,c(){t=ye(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),V(i,a,u),l=!0},p(a,u){e=a;const f={};u&4&&(f.group=e[2].name+"_relation"),u&16&&(f.index=e[22]),u&64&&(f.disabled=!e[6]),u&293601300&&(f.$$scope={dirty:u,ctx:e}),!s&&u&16&&(s=!0,f.list=e[4],he(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function m6(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d=[],m=new Map,_,h,g,y,S,$,C=n[4];const T=O=>O[20].id;for(let O=0;O<C.length;O+=1){let D=lm(n,C,O),I=T(D);m.set(I,d[O]=fm(I,D))}let M=null;return C.length||(M=rm(n)),{c(){e=v("label"),t=v("i"),s=E(),l=v("span"),r=U(o),u=E(),f=v("div"),c=v("div");for(let O=0;O<d.length;O+=1)d[O].c();M&&M.c(),_=E(),h=v("div"),g=v("button"),g.innerHTML=`<i class="ri-magic-line"></i>
|
||
|
|
||
|
<span class="txt">Open picker</span>`,p(t,"class",i=is(z.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),p(l,"class","txt"),p(e,"for",a=n[19]),p(c,"class","relations-list svelte-1ynw0pc"),p(g,"type","button"),p(g,"class","btn btn-transparent btn-sm btn-block"),p(h,"class","list-item list-item-btn"),p(f,"class","list")},m(O,D){w(O,e,D),b(e,t),b(e,s),b(e,l),b(l,r),w(O,u,D),w(O,f,D),b(f,c);for(let I=0;I<d.length;I+=1)d[I]&&d[I].m(c,null);M&&M.m(c,null),b(f,_),b(f,h),b(h,g),y=!0,S||($=Y(g,"click",n[13]),S=!0)},p(O,D){(!y||D&4&&i!==(i=is(z.getFieldTypeIcon(O[2].type))+" svelte-1ynw0pc"))&&p(t,"class",i),(!y||D&4)&&o!==(o=O[2].name+"")&&se(r,o),(!y||D&524288&&a!==(a=O[19]))&&p(e,"for",a),D&25166325&&(C=O[4],ae(),d=bt(d,D,T,1,O,C,m,c,Ut,fm,null,lm),ue(),!C.length&&M?M.p(O,D):C.length?M&&(M.d(1),M=null):(M=rm(O),M.c(),M.m(c,null)))},i(O){if(!y){for(let D=0;D<C.length;D+=1)A(d[D]);y=!0}},o(O){for(let D=0;D<d.length;D+=1)L(d[D]);y=!1},d(O){O&&k(e),O&&k(u),O&&k(f);for(let D=0;D<d.length;D+=1)d[D].d();M&&M.d(),S=!1,$()}}}function h6(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[m6,({uniqueId:r})=>({19:r}),({uniqueId:r})=>r?524288:0]},$$scope:{ctx:n}};e=new de({props:l}),n[14](e);let o={value:n[0],field:n[2]};return i=new d6({props:o}),n[15](i),i.$on("save",n[16]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(r,a){V(e,r,a),w(r,t,a),V(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&268959863&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(A(e.$$.fragment,r),A(i.$$.fragment,r),s=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),s=!1},d(r){n[14](null),H(e,r),r&&k(t),n[15](null),H(i,r)}}}const cm=100;function _6(n,e,t){let i,{field:s}=e,{value:l}=e,{picker:o}=e,r,a=[],u=!1,f;function c(){if(u)return!1;const M=z.toArray(l);return t(4,a=a.filter(O=>M.includes(O.id))),M.length!=a.length}async function d(){var I,P;const M=z.toArray(l);if(t(4,a=[]),!((I=s==null?void 0:s.options)!=null&&I.collectionId)||!M.length){t(5,u=!1);return}t(5,u=!0);const O=M.slice(),D=[];for(;O.length>0;){const F=[];for(const R of O.splice(0,cm))F.push(`id="${R}"`);D.push(fe.collection((P=s==null?void 0:s.options)==null?void 0:P.collectionId).getFullList(cm,{filter:F.join("||"),$autoCancel:!1}))}try{let F=[];await Promise.all(D).then(R=>{F=F.concat(...R)});for(const R of M){const N=z.findByKey(F,"id",R);N&&a.push(N)}t(4,a),_()}catch(F){fe.error(F)}t(5,u=!1)}function m(M){z.removeByKey(a,"id",M.id),t(4,a),_()}function _(){var M;i?t(0,l=a.map(O=>O.id)):t(0,l=((M=a[0])==null?void 0:M.id)||"")}Ro(()=>{clearTimeout(f)});const h=M=>m(M);function g(M){a=M,t(4,a)}const y=()=>{_()},S=()=>o==null?void 0:o.show();function $(M){te[M?"unshift":"push"](()=>{r=M,t(3,r)})}function C(M){te[M?"unshift":"push"](()=>{o=M,t(1,o)})}const T=M=>{var O;t(4,a=M.detail||[]),t(0,l=i?a.map(D=>D.id):((O=a[0])==null?void 0:O.id)||"")};return n.$$set=M=>{"field"in M&&t(2,s=M.field),"value"in M&&t(0,l=M.value),"picker"in M&&t(1,o=M.picker)},n.$$.update=()=>{var M;n.$$.dirty&4&&t(6,i=((M=s.options)==null?void 0:M.maxSelect)!=1),n.$$.dirty&9&&typeof l<"u"&&(r==null||r.changed()),n.$$.dirty&529&&c()&&(t(5,u=!0),clearTimeout(f),t(9,f=setTimeout(d,0)))},[l,o,s,r,a,u,i,m,_,f,h,g,y,S,$,C,T]}class g6 extends ve{constructor(e){super(),be(this,e,_6,h6,me,{field:2,value:0,picker:1})}}const b6=["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","Prog
|
||
|
...
|
||
|
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),re(l,n[5]),w(c,r,d),w(c,a,d),u||(f=Y(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&re(l,c[5])},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function G6(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S;return s=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[W6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[Y6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[K6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[J6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[Z6,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),a=E(),u=v("div"),B(f.$$.fragment),c=E(),d=v("div"),B(m.$$.fragment),_=E(),B(h.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,C){w($,e,C),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),b(t,a),b(t,u),V(f,u,null),b(t,c),b(t,d),V(m,d,null),b(t,_),V(h,t,null),g=!0,y||(S=Y(e,"submit",Qe(n[17])),y=!0)},p($,C){const T={};C&25165828&&(T.$$scope={dirty:C,ctx:$}),s.$set(T);const M={};C&25165832&&(M.$$scope={dirty:C,ctx:$}),r.$set(M);const O={};C&25165840&&(O.$$scope={dirty:C,ctx:$}),f.$set(O);const D={};C&25165888&&(D.$$scope={dirty:C,ctx:$}),m.$set(D);const I={};C&25165856&&(I.$$scope={dirty:C,ctx:$}),h.$set(I)},i($){g||(A(s.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(h.$$.fragment,$),g=!0)},o($){L(s.$$.fragment,$),L(r.$$.fragment,$),L(f.$$.fragment,$),L(m.$$.fragment,$),L(h.$$.fragment,$),g=!1},d($){$&&k(e),H(s),H(r),H(f),H(m),H(h),y=!1,S()}}}function X6(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Q6(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=Y(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&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function x6(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[Q6],header:[X6],default:[G6]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const uo=15777e3;function eO(n,e,t){let i;const s=Tt(),l="apple_secret_"+z.randomString(5);let o,r,a,u,f,c,d=!1;function m(P={}){t(2,r=P.clientId||""),t(3,a=P.teamId||""),t(4,u=P.keyId||""),t(5,f=P.privateKey||""),t(6,c=P.duration||uo),tn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const P=await fe.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),Ht("Successfully generated client secret."),s("submit",P),o==null||o.hide()}catch(P){fe.error(P)}t(7,d=!1)}fu
|
||
|
`),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='<i class="ri-close-line"></i>',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(g,y){w(g,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),m=!0,_||(h=[Y(r,"click",n[37]),$e(ze.call(null,u,"Discard draft")),Y(u,"click",Qe(n[38]))],_=!0)},p:x,i(g){m||(d&&d.end(1),m=!0)},o(g){d=ya(e,st,{duration:150}),m=!1},d(g){g&&k(e),g&&d&&d.end(),_=!1,Oe(h)}}}function gm(n){let e,t,i,s,l;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-calendar-event-line txt-disabled"),p(e,"class","form-field-addon")},m(o,r){w(o,e,r),b(e,t),s||(l=$e(i=ze.call(null,t,{text:`Created: ${n[3].created}
|
||
|
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&jt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
|
||
|
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&k(e),s=!1,l()}}}function cO(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h=!n[6]&&gm(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),h&&h.c(),u=E(),f=v("input"),p(t,"class",is(z.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(f,"type","text"),p(f,"id",c=n[70]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(g,a,y),h&&h.m(g,y),w(g,u,y),w(g,f,y),re(f,n[3].id),m||(_=Y(f,"input",n[39]),m=!0)},p(g,y){y[2]&256&&r!==(r=g[70])&&p(e,"for",r),g[6]?h&&(h.d(1),h=null):h?h.p(g,y):(h=gm(g),h.c(),h.m(u.parentNode,u)),y[2]&256&&c!==(c=g[70])&&p(f,"id",c),y[0]&64&&d!==(d=!g[6])&&(f.readOnly=d),y[0]&8&&f.value!==g[3].id&&re(f,g[3].id)},d(g){g&&k(e),g&&k(a),h&&h.d(g),g&&k(u),g&&k(f),m=!1,_()}}}function bm(n){var u,f;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new BM({props:r}),te.push(()=>ce(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&vm();return{c(){B(e.$$.fragment),i=E(),a&&a.c(),s=ye()},m(c,d){V(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var _,h;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],he(()=>t=!1)),e.$set(m),(h=(_=c[0])==null?void 0:_.schema)!=null&&h.length?a||(a=vm(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){H(e,c),c&&k(i),a&&a.d(c),c&&k(s)}}}function vm(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function dO(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new g6({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function pO(n){let e,t,i,s,l;function o(f){n[50](f,n[67])}function r(f){n[51](f,n[67])}function a(f){n[52](f,n[67])}let u={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(u.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(u.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(u.deletedFileNames=n[5][n[67].name]),e=new Q5({props:u}),te.push(()=>ce(e,"value",o)),te.push(()=>ce(e,"uploadedFiles",r)),te.push(()=>ce(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,c){V(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],he(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],he(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],he(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function mO(n){let e,t,i;function s(o){n[49](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new C5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function hO(n){let e,t,i;function s(o){n[48](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new y5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],he(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function _O(n){let e,t,i;function s(o){n[47](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new _5({props:l}),te.push(()=>ce(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1
|
||
|
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[31]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Cm(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>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[32]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function CO(n){let e,t,i,s,l,o,r,a=n[13]&&!n[2].verified&&n[2].email&&Sm(n),u=n[13]&&n[2].email&&Cm(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=v("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
|
||
|
<span class="txt">Duplicate</span>`,s=E(),l=v("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
|
||
|
<span class="txt">Delete</span>`,p(i,"type","button"),p(i,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item txt-danger closable")},m(f,c){a&&a.m(f,c),w(f,e,c),u&&u.m(f,c),w(f,t,c),w(f,i,c),w(f,s,c),w(f,l,c),o||(r=[Y(i,"click",n[33]),Y(l,"click",Dn(Qe(n[34])))],o=!0)},p(f,c){f[13]&&!f[2].verified&&f[2].email?a?a.p(f,c):(a=Sm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[13]&&f[2].email?u?u.p(f,c):(u=Cm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&k(e),u&&u.d(f),f&&k(t),f&&k(i),f&&k(s),f&&k(l),o=!1,Oe(r)}}}function $m(n){let e,t,i,s,l,o;return{c(){e=v("div"),t=v("button"),t.textContent="Account",i=E(),s=v("button"),s.textContent="Authorized providers",p(t,"type","button"),p(t,"class","tab-item"),Q(t,"active",n[12]===ns),p(s,"type","button"),p(s,"class","tab-item"),Q(s,"active",n[12]===bl),p(e,"class","tabs-header stretched")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(e,s),l||(o=[Y(t,"click",n[35]),Y(s,"click",n[36])],l=!0)},p(r,a){a[0]&4096&&Q(t,"active",r[12]===ns),a[0]&4096&&Q(s,"active",r[12]===bl)},d(r){r&&k(e),l=!1,Oe(o)}}}function $O(n){var h;let e,t=n[6]?"New":"Edit",i,s,l,o=((h=n[0])==null?void 0:h.name)+"",r,a,u,f,c,d,m=!n[6]&&wm(n),_=n[13]&&!n[6]&&$m(n);return{c(){e=v("h4"),i=U(t),s=E(),l=v("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),c=ye(),p(e,"class","panel-title svelte-qc5ngu")},m(g,y){w(g,e,y),b(e,i),b(e,s),b(e,l),b(l,r),b(e,a),w(g,u,y),m&&m.m(g,y),w(g,f,y),_&&_.m(g,y),w(g,c,y),d=!0},p(g,y){var S;(!d||y[0]&64)&&t!==(t=g[6]?"New":"Edit")&&se(i,t),(!d||y[0]&1)&&o!==(o=((S=g[0])==null?void 0:S.name)+"")&&se(r,o),g[6]?m&&(ae(),L(m,1,1,()=>{m=null}),ue()):m?(m.p(g,y),y[0]&64&&A(m,1)):(m=wm(g),m.c(),A(m,1),m.m(f.parentNode,f)),g[13]&&!g[6]?_?_.p(g,y):(_=$m(g),_.c(),_.m(c.parentNode,c)):_&&(_.d(1),_=null)},i(g){d||(A(m),d=!0)},o(g){L(m),d=!1},d(g){g&&k(e),g&&k(u),m&&m.d(g),g&&k(f),_&&_.d(g),g&&k(c)}}}function TO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),r=U(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[10],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[16]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[14]||n[10],Q(s,"btn-loading",n[10])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(l,r),u||(f=Y(e,"click",n[30]),u=!0)},p(c,d){d[0]&1024&&(e.disabled=c[10]),d[0]&64&&o!==(o=c[6]?"Create":"Save changes")&&se(r,o),d[0]&17408&&a!==(a=!c[14]||c[10])&&(s.disabled=a),d[0]&1024&&Q(s,"btn-loading",c[10])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function MO(n){let e,t,i={class:`
|
||
|
record-panel
|
||
|
`+(n[15]?"overlay-panel-xl":"overlay-panel-lg")+`
|
||
|
`+(n[13]&&!n[6]?"colored-header":"")+`
|
||
|
`,beforeHide:n[54],$$slots:{footer:[TO],header:[$O],default:[SO]},$$scope:{ctx:n}};return e=new on({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=`
|
||
|
record-panel
|
||
|
`+(s[15]?"overlay-panel-xl":"overlay-panel-lg")+`
|
||
|
`+(s[13]&&!s[6]?"colored-header":"")+`
|
||
|
`),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),H(e,s)}}}const ns="form",bl="providers";function OO(n,e,t){let i,s,l,o,r;const a=Tt(),u="record_"+z.randomString(5);let{collection:f}=e,c,d=null,m=null,_=null,h=!1,g=!1,y={},S={},$=JSON.stringify(null),C=$,T=ns,M=!0,O=!1;function D(ge){return P(ge),t(11,g=!0),t(12,T=ns),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function P(ge){t(28,O=!1),tn({}),t(2,d=ge||{}),t(3,m=structuredClone(d)),t(4,y={}),t(5,S={}),await cn(),t(9,_=N()),!_||Z(m,_)?t(9,_=null):(delete _.password,delete _.passwordConfirm),t(26,$=JSON.stringify(m)),t(28,O=!0)}async function F(ge){var ct,xe;tn({}),t(2,d=ge||{}),t(4,y={}),t(5,S={});const we=((xe=(ct=f==null?void 0:f.schema)==null?void 0:ct.filter(Wt=>Wt.type!="file"))==null?void 0:xe.map(Wt=>Wt.name))||[];for(let Wt in ge)we.includes(Wt)||t(3,m[Wt]=ge[Wt],m);await cn(),t(26,$=JSON.stringify(m)),X()}function R(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function N(ge){try{const we=window.localStorage.getItem(R());if(we)return new Record(JSON.parse(we))}catch{}return ge}function q(ge){window.localStorage.setItem(R(),ge)}function j(){_&&(t(3,m=_),t(9,_=null))}function Z(ge,we){var bn;const ct=structuredClone(ge||{}),xe=structuredClone(we||{}),Wt=(bn=f==null?void 0:f.schema)==null?void 0:bn.filter(Pn=>Pn.type==="file");for(let Pn of Wt)delete ct[Pn.name],delete xe[Pn.name];return delete ct.password,delete ct.passwordConfirm,delete xe.password,delete xe.passwordConfirm,JSON.stringify(ct)==JSON.stringify(xe)}function X(){t(9,_=null),window.localStorage.removeItem(R())}function K(ge=!0){if(h||!r||!(f!=null&&f.id))return;t(10,h=!0);const we=le();let ct;M?ct=fe.collection(f.id).create(we):ct=fe.collection(f.id).update(m.id,we),ct.then(xe=>{Ht(M?"Successfully created record.":"Successfully updated record."),X(),ge?(t(11,g=!1),I()):F(xe),a("save",xe)}).catch(xe=>{fe.error(xe)}).finally(()=>{t(10,h=!1)})}function J(){d!=null&&d.id&&hn("Do you really want to delete the selected record?",()=>fe.collection(d.collectionId).delete(d.id).then(()=>{I(),Ht("Successfully deleted record."),a("delete",d)}).catch(ge=>{fe.error(ge)}))}function le(){const ge=structuredClone(m||{}),we=new FormData,ct={id:ge.id};for(const xe of(f==null?void 0:f.schema)||[])ct[xe.name]=!0;i&&(ct.username=!0,ct.email=!0,ct.emailVisibility=!0,ct.password=!0,ct.passwordConfirm=!0,ct.verified=!0);for(const xe in ge)ct[xe]&&(typeof ge[xe]>"u"&&(ge[xe]=null),z.addValueToFormData(we,xe,ge[xe]));for(const xe in y){const Wt=z.toArray(y[xe]);for(const bn of Wt)we.append(xe,bn)}for(const xe in S){const Wt=z.toArray(S[xe]);for(const bn of Wt)we.append(xe+"."+bn,"")}return we}function ie(){!(f!=null&&f.id)||!(d!=null&&d.email)||hn(`Do you really want to sent verification email to ${d.email}?`,()=>fe.collection(f.id).requestVerification(d.email).then(()=>{Ht(`Successfully sent verification email to ${d.email}.`)}).catch(ge=>{fe.error(ge)}))}function ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||hn(`Do you really want to sent password reset email to ${d.email}?`,()=>fe.collection(f.id).requestPasswordReset(d.email).then(()=>{Ht(`Successfully sent password reset email to ${d.email}.`)}).catch(ge=>{fe.error(ge)}))}function Te(){o?hn("You have unsaved changes. Do you really want to discard them?",()=>{Pe()}):Pe()}async function Pe(){let ge=d?structuredClone(d):null;if(ge){ge.id="",ge.created="",ge.updated="";const we=(f==null?void 0:f.schema)||[];for(const ct of we)ct.type==="file"&&delete ge[ct.name]}X(),D(ge),await cn(),t(26,$="")}function je(ge){(ge.ctrlKey||ge.metaKey)&&ge.code=="KeyS"&&(ge.preventDefault(),ge.stopPropagation(),K(!1))}const Ve=()=>I(),ke=()=>ie(),Ce=()=>ee(),Je=()=>Te(),_t=()=>J(),Ze=()=>t(12,T=ns),We=()=>t(12,T=bl),yt=()=>j(),pe=()=>X();function _e(){m.id=this.value,t(3,m)}function Ye(ge){m=ge,t(3,m)}function Mt(ge,we){n.$$.not_equal(m[we.name],ge)&&(m[we.name]=ge,t(3,m))}function Ie(ge,we){n.$$.not
|
||
|
`},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function _E(n){let e,t,i;return{c(){e=v("button"),e.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[42]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function gE(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[41]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function th(n){let e,t,i,s,l,o,r,a,u,f;function c(){return n[38](n[57])}return{c(){e=v("td"),t=v("div"),i=v("input"),o=E(),r=v("label"),p(i,"type","checkbox"),p(i,"id",s="checkbox_"+n[57].id),i.checked=l=n[5][n[57].id],p(r,"for",a="checkbox_"+n[57].id),p(t,"class","form-field"),p(e,"class","bulk-select-col min-width")},m(d,m){w(d,e,m),b(e,t),b(t,i),b(t,o),b(t,r),u||(f=[Y(i,"change",c),Y(t,"click",Dn(n[28]))],u=!0)},p(d,m){n=d,m[0]&8&&s!==(s="checkbox_"+n[57].id)&&p(i,"id",s),m[0]&40&&l!==(l=n[5][n[57].id])&&(i.checked=l),m[0]&8&&a!==(a="checkbox_"+n[57].id)&&p(r,"for",a)},d(d){d&&k(e),u=!1,Oe(f)}}}function nh(n){let e,t,i,s,l,o,r=n[57].id+"",a,u,f;s=new Il({props:{value:n[57].id}});let c=n[10]&&ih(n);return{c(){e=v("td"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),a=U(r),u=E(),c&&c.c(),p(o,"class","txt"),p(i,"class","label"),p(t,"class","flex flex-gap-5"),p(e,"class","col-type-text col-field-id")},m(d,m){w(d,e,m),b(e,t),b(t,i),V(s,i,null),b(i,l),b(i,o),b(o,a),b(t,u),c&&c.m(t,null),f=!0},p(d,m){const _={};m[0]&8&&(_.value=d[57].id),s.$set(_),(!f||m[0]&8)&&r!==(r=d[57].id+"")&&se(a,r),d[10]?c?c.p(d,m):(c=ih(d),c.c(),c.m(t,null)):c&&(c.d(1),c=null)},i(d){f||(A(s.$$.fragment,d),f=!0)},o(d){L(s.$$.fragment,d),f=!1},d(d){d&&k(e),H(s),c&&c.d()}}}function ih(n){let e;function t(l,o){return l[57].verified?vE:bE}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(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&&k(e)}}}function bE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){w(s,e,l),t||(i=$e(ze.call(null,e,"Unverified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function vE(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){w(s,e,l),t||(i=$e(ze.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function sh(n){let e=!n[6].includes("@username"),t,i=!n[6].includes("@email"),s,l=e&&lh(n),o=i&&oh(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=ye()},m(r,a){l&&l.m(r,a),w(r,t,a),o&&o.m(r,a),w(r,s,a)},p(r,a){a[0]&64&&(e=!r[6].includes("@username")),e?l?l.p(r,a):(l=lh(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&64&&(i=!r[6].includes("@email")),i?o?o.p(r,a):(o=oh(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&k(t),o&&o.d(r),r&&k(s)}}}function lh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!z.isEmpty(o[57].username)),t?kE:yE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-username")},m(o,r){w(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&&k(e),l.d()}}}function yE(n){let e,t=n[57].username+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[57].username)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[57].username+"")&&se(i,t),o[0]&8&&s!==(s=l[57].username)&&p(e,"title",s)},d(l){l&&k(e)}}}function kE(n){let e;return{c(){e=v("span"),e.textContent="N/A",p(e,"class","txt-hint")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oh(n){let e,t;function i(o,r){return r[0]&8&&(t=null),t==null&&(t=!!z.isEmpty(o[57].email)),t?SE:wE}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=v("td"),l.c(),p(e,"class","col-type-text col-field-email")},m(o,r){w(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&&k(e),l.d()}}}function wE(n){let e,t=n[57].email+"",i,s;return{c(){e=v("span"),i=U(t),p(e,"class","txt txt-ellipsis"),p(e,"title",s=n[57].email)},m(l,o){w(l,e,o),b(e,i)},p(l,o){o[0]&8&&t!==(t=l[57].email+"")&&se(i,t),o[0]&8&&s!==(
|
||
|
<span class="txt">New record</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[18]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function FE(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I,P,F=!n[10]&&_h(n);c=new Ko({}),c.$on("refresh",n[16]);let R=n[2].type!=="view"&&gh(n);y=new Yo({props:{value:n[0],autocompleteCollection:n[2]}}),y.$on("submit",n[19]);function N(Z){n[21](Z)}function q(Z){n[22](Z)}let j={collection:n[2]};return n[0]!==void 0&&(j.filter=n[0]),n[1]!==void 0&&(j.sort=n[1]),T=new AE({props:j}),n[20](T),te.push(()=>ce(T,"filter",N)),te.push(()=>ce(T,"sort",q)),T.$on("select",n[23]),T.$on("new",n[24]),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Collections",s=E(),l=v("div"),r=U(o),a=E(),u=v("div"),F&&F.c(),f=E(),B(c.$$.fragment),d=E(),m=v("div"),_=v("button"),_.innerHTML=`<i class="ri-code-s-slash-line"></i>
|
||
|
<span class="txt">API Preview</span>`,h=E(),R&&R.c(),g=E(),B(y.$$.fragment),S=E(),$=v("div"),C=E(),B(T.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(u,"class","inline-flex gap-5"),p(_,"type","button"),p(_,"class","btn btn-outline"),p(m,"class","btns-group"),p(e,"class","page-header"),p($,"class","clearfix m-b-base")},m(Z,X){w(Z,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),V(c,u,null),b(e,d),b(e,m),b(m,_),b(m,h),R&&R.m(m,null),w(Z,g,X),V(y,Z,X),w(Z,S,X),w(Z,$,X),w(Z,C,X),V(T,Z,X),D=!0,I||(P=Y(_,"click",n[17]),I=!0)},p(Z,X){(!D||X[0]&4)&&o!==(o=Z[2].name+"")&&se(r,o),Z[10]?F&&(F.d(1),F=null):F?F.p(Z,X):(F=_h(Z),F.c(),F.m(u,f)),Z[2].type!=="view"?R?R.p(Z,X):(R=gh(Z),R.c(),R.m(m,null)):R&&(R.d(1),R=null);const K={};X[0]&1&&(K.value=Z[0]),X[0]&4&&(K.autocompleteCollection=Z[2]),y.$set(K);const J={};X[0]&4&&(J.collection=Z[2]),!M&&X[0]&1&&(M=!0,J.filter=Z[0],he(()=>M=!1)),!O&&X[0]&2&&(O=!0,J.sort=Z[1],he(()=>O=!1)),T.$set(J)},i(Z){D||(A(c.$$.fragment,Z),A(y.$$.fragment,Z),A(T.$$.fragment,Z),D=!0)},o(Z){L(c.$$.fragment,Z),L(y.$$.fragment,Z),L(T.$$.fragment,Z),D=!1},d(Z){Z&&k(e),F&&F.d(),H(c),R&&R.d(),Z&&k(g),H(y,Z),Z&&k(S),Z&&k($),Z&&k(C),n[20](null),H(T,Z),I=!1,P()}}}function NE(n){let e,t,i,s,l;return{c(){e=v("h1"),e.textContent="Create your first collection to add records!",t=E(),i=v("button"),i.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">Create new collection</span>`,p(e,"class","m-b-10"),p(i,"type","button"),p(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=Y(i,"click",n[14]),s=!0)},p:x,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,l()}}}function RE(n){let e;return{c(){e=v("h1"),e.textContent="You don't have any collections yet.",p(e,"class","m-b-10")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function qE(n){let e,t,i;function s(r,a){return r[10]?RE:NE}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=E(),o.c(),p(t,"class","icon"),p(e,"class","placeholder-section m-b-base")},m(r,a){w(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&&k(e),o.d()}}}function jE(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="loader loader-lg"></span>
|
||
|
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zE(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[PE,LE,IE],m=[];function _($,C){return $[3]&&!$[9].length?0:$[9].length?2:1}e=_(n),t=m[e]=d[e](n);let h={};s=new au({props:h}),n[25](s);let g={};o=new PM({props:g}),n[26](o);let y={collection:n[2]};a=new C1({props:y}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let S={collection:n[2]};return f=new lE({props:S}),n[30](f),{c(){t.c(),i=E(),B(s.$$.fragment),l=E(),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),B(f.$$.fragment)},m($,C){m[e].m($,C),w($,i,C),V(s,$,C),w($,l,C),V(o,$,C),w($,r,C),V(a,$,C),w($,u,C),V(f,$,C),c=!0},p($,C){let T=e;e=_($),e===T?m[e].p($,C):(ae(),L(m[T],1,1,()=>{m[T]=null}),ue(),t=m[e],t?t.p($,C):(t=m[e]=d[e]($),t.c()),A(t,1),t.m(i.parentNode,i));const M={};s.$set(M);const O={};o.$set(O);const D={};C[0]&4&&(D.collection=$[2]),a.$set(D);const I={};C[0]&4&&(I.collection=$[2]),f.$set(I)},i($){c||(A(t),A(s.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(f.$$.fragment,$),c=!0)},o($){L(t),L(s.$$.fragment,$),L(o.$$.fragment,$),L(a.$$.fragment,$),L(f.$$.fragment,$),c=!1},d($){m[e].d($),$&&k(i),n[25](null),H(s,$),$&&k(l),n[26](null),H(o,$),$&&k(r),n[27](null),H(a,$),$&&k(u),n[30](null),H(f,$)}}}function VE(n,e,t){let i,s,l,o,r,a,u;Ke(n,yi,ee=>t(2,s=ee)),Ke(n,Dt,ee=>t(31,l=ee)),Ke(n,vo,ee=>t(3,o=ee)),Ke(n,ka,ee=>t(13,r=ee)),Ke(n,fi,ee=>t(9,a=ee)),Ke(n,Ms,ee=>t(10,u=ee));const f=new URLSearchParams(r);let c,d,m,_,h,g=f.get("filter")||"",y=f.get("sort")||"-created",S=f.get("collectionId")||(s==null?void 0:s.id);function $(){t(11,S=s==null?void 0:s.id),t(0,g=""),t(1,y="-created"),C()}async function C(){if(!y)return;const ee=z.getAllCollectionIdentifiers(s),Te=y.split(",").map(Pe=>Pe.startsWith("+")||Pe.startsWith("-")?Pe.substring(1):Pe);Te.filter(Pe=>ee.includes(Pe)).length!=Te.length&&(ee.includes("created")?t(1,y="-created"):t(1,y=""))}Py(S);const T=()=>c==null?void 0:c.show(),M=()=>c==null?void 0:c.show(s),O=()=>h==null?void 0:h.load(),D=()=>d==null?void 0:d.show(s),I=()=>m==null?void 0:m.show(),P=ee=>t(0,g=ee.detail);function F(ee){te[ee?"unshift":"push"](()=>{h=ee,t(8,h)})}function R(ee){g=ee,t(0,g)}function N(ee){y=ee,t(1,y)}const q=ee=>{s.type==="view"?_.show(ee==null?void 0:ee.detail):m==null||m.show(ee==null?void 0:ee.detail)},j=()=>m==null?void 0:m.show();function Z(ee){te[ee?"unshift":"push"](()=>{c=ee,t(4,c)})}function X(ee){te[ee?"unshift":"push"](()=>{d=ee,t(5,d)})}function K(ee){te[ee?"unshift":"push"](()=>{m=ee,t(6,m)})}const J=()=>h==null?void 0:h.reloadLoadedPages(),le=()=>h==null?void 0:h.reloadLoadedPages();function ie(ee){te[ee?"unshift":"push"](()=>{_=ee,t(7,_)})}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")!=S&&Ay(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&S!=s.id&&$(),n.$$.dirty[0]&4&&s!=null&&s.id&&C(),n.$$.dirty[0]&7&&(y||g||s!=null&&s.id)){const ee=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:y}).toString();qi("/collections?"+ee)}n.$$.dirty[0]&4&&ln(Dt,l=(s==null?void 0:s.name)||"Collections",l)},[g,y,s,o,c,d,m,_,h,a,u,S,i,r,T,M,O,D,I,P,F,R,N,q,j,Z,X,K,J,le,ie]}class HE extends ve{constructor(e){super(),be(this,e,VE,zE,me,{},null,[-1,-1])}}function BE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I,P,F;return{c(){e=v("aside"),t=v("div"),i=v("div"),i.textContent="System",s=E(),l=v("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
|
||
|
<span class="txt">Application</span>`,o=E(),r=v("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
|
||
|
<span class="txt">Mail settings</span>`,a=E(),u=v("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
|
||
|
<span class="txt">Files storage</span>`,f=E(),c=v("a"),c.innerHTML=`<i class="ri-archive-line"></i>
|
||
|
<span class="txt">Backups</span>`,d=E(),m=v("div"),m.innerHTML='<span class="txt">Sync</span>',_=E(),h=v("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
|
||
|
<span class="txt">Export collections</span>`,g=E(),y=v("a"),y.innerHTML=`<i class="ri-install-line"></i>
|
||
|
<span class="txt">Import collections</span>`,S=E(),$=v("div"),$.textContent="Authentication",C=E(),T=v("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
|
||
|
<span class="txt">Auth providers</span>`,M=E(),O=v("a"),O.innerHTML=`<i class="ri-key-line"></i>
|
||
|
<span class="txt">Token options</span>`,D=E(),I=v("a"),I.innerHTML=`<i class="ri-shield-user-line"></i>
|
||
|
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"href","/settings/backups"),p(c,"class","sidebar-list-item"),p(m,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(y,"href","/settings/import-collections"),p(y,"class","sidebar-list-item"),p($,"class","sidebar-title"),p(T,"href","/settings/auth-providers"),p(T,"class","sidebar-list-item"),p(O,"href","/settings/tokens"),p(O,"class","sidebar-list-item"),p(I,"href","/settings/admins"),p(I,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(R,N){w(R,e,N),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,m),b(t,_),b(t,h),b(t,g),b(t,y),b(t,S),b(t,$),b(t,C),b(t,T),b(t,M),b(t,O),b(t,D),b(t,I),P||(F=[$e(jn.call(null,l,{path:"/settings"})),$e(rn.call(null,l)),$e(jn.call(null,r,{path:"/settings/mail/?.*"})),$e(rn.call(null,r)),$e(jn.call(null,u,{path:"/settings/storage/?.*"})),$e(rn.call(null,u)),$e(jn.call(null,c,{path:"/settings/backups/?.*"})),$e(rn.call(null,c)),$e(jn.call(null,h,{path:"/settings/export-collections/?.*"})),$e(rn.call(null,h)),$e(jn.call(null,y,{path:"/settings/import-collections/?.*"})),$e(rn.call(null,y)),$e(jn.call(null,T,{path:"/settings/auth-providers/?.*"})),$e(rn.call(null,T)),$e(jn.call(null,O,{path:"/settings/tokens/?.*"})),$e(rn.call(null,O)),$e(jn.call(null,I,{path:"/settings/admins/?.*"})),$e(rn.call(null,I))],P=!0)},p:x,i:x,o:x,d(R){R&&k(e),P=!1,Oe(F)}}}class Ci extends ve{constructor(e){super(),be(this,e,null,BE,me,{})}}function bh(n,e,t){const i=n.slice();return i[31]=e[t],i}function vh(n){let e,t;return e=new de({props:{class:"form-field readonly",name:"id",$$slots:{default:[UE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",o=E(),r=v("div"),a=v("i"),f=E(),c=v("input"),p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(a,"class","ri-calendar-event-line txt-disabled"),p(r,"class","form-field-addon"),p(c,"type","text"),p(c,"id",d=n[30]),c.value=m=n[1].id,c.readOnly=!0},m(g,y){w(g,e,y),b(e,t),b(e,i),b(e,s),w(g,o,y),w(g,r,y),b(r,a),w(g,f,y),w(g,c,y),_||(h=$e(u=ze.call(null,a,{text:`Created: ${n[1].created}
|
||
|
Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(g,y){y[0]&1073741824&&l!==(l=g[30])&&p(e,"for",l),u&&jt(u.update)&&y[0]&2&&u.update.call(null,{text:`Created: ${g[1].created}
|
||
|
Updated: ${g[1].updated}`,position:"left"}),y[0]&1073741824&&d!==(d=g[30])&&p(c,"id",d),y[0]&2&&m!==(m=g[1].id)&&c.value!==m&&(c.value=m)},d(g){g&&k(e),g&&k(o),g&&k(r),g&&k(f),g&&k(c),_=!1,h()}}}function yh(n){let e,t,i,s,l,o,r;function a(){return n[18](n[31])}return{c(){e=v("button"),t=v("img"),s=E(),gn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"type","button"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){w(u,e,f),b(e,t),b(e,s),o||(r=Y(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(u){u&&k(e),o=!1,r()}}}function WE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Email",o=E(),r=v("input"),p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[3]),u||(f=Y(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&re(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function kh(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[YE,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function YE(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Change password"),p(e,"type","checkbox"),p(e,"id",t=n[30]),p(s,"for",o=n[30])},m(u,f){w(u,e,f),e.checked=n[4],w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[20]),r=!0)},p(u,f){f[0]&1073741824&&t!==(t=u[30])&&p(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&1073741824&&o!==(o=u[30])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function wh(n){let e,t,i,s,l,o,r,a,u;return s=new de({props:{class:"form-field required",name:"password",$$slots:{default:[KE,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[JE,({uniqueId:f})=>({30:f}),({uniqueId:f})=>[f?1073741824:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),i=v("div"),B(s.$$.fragment),l=E(),o=v("div"),B(r.$$.fragment),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(t,"class","grid"),p(e,"class","col-12")},m(f,c){w(f,e,c),b(e,t),b(t,i),V(s,i,null),b(t,l),b(t,o),V(r,o,null),u=!0},p(f,c){const d={};c[0]&1073742336|c[1]&8&&(d.$$scope={dirty:c,ctx:f}),s.$set(d);const m={};c[0]&1073742848|c[1]&8&&(m.$$scope={dirty:c,ctx:f}),r.$set(m)},i(f){u||(A(s.$$.fragment,f),A(r.$$.fragment,f),f&&Ge(()=>{u&&(a||(a=qe(t,st,{duration:150},!0)),a.run(1))}),u=!0)},o(f){L(s.$$.fragment,f),L(r.$$.fragment,f),f&&(a||(a=qe(t,st,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&k(e),H(s),H(r),f&&a&&a.end()}}}function KE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[9]),u||(f=Y(r,"input",n[21]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&512&&r.value!==c[9]&&re(r,c[9])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function JE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Password confirm",o=E(),r=v("input"),p(t,"class","ri-lock-line"),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","password"),p(r,"autocomplete","new-password"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),w(c,o,d),w(c,r,d),re(r,n[10]),u||(f=Y(r,"input",n[22]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&
|
||
|
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item txt-danger")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[16]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function QE(n){let e,t,i,s,l,o,r=n[5]?"Create":"Save changes",a,u,f,c,d,m=!n[5]&&Sh(n);return{c(){m&&m.c(),e=E(),t=v("button"),i=v("span"),i.textContent="Cancel",s=E(),l=v("button"),o=v("span"),a=U(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-transparent"),t.disabled=n[7],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[12]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[11]||n[7],Q(l,"btn-loading",n[7])},m(_,h){m&&m.m(_,h),w(_,e,h),w(_,t,h),b(t,i),w(_,s,h),w(_,l,h),b(l,o),b(o,a),f=!0,c||(d=Y(t,"click",n[17]),c=!0)},p(_,h){_[5]?m&&(ae(),L(m,1,1,()=>{m=null}),ue()):m?(m.p(_,h),h[0]&32&&A(m,1)):(m=Sh(_),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||h[0]&128)&&(t.disabled=_[7]),(!f||h[0]&32)&&r!==(r=_[5]?"Create":"Save changes")&&se(a,r),(!f||h[0]&2176&&u!==(u=!_[11]||_[7]))&&(l.disabled=u),(!f||h[0]&128)&&Q(l,"btn-loading",_[7])},i(_){f||(A(m),f=!0)},o(_){L(m),f=!1},d(_){m&&m.d(_),_&&k(e),_&&k(t),_&&k(s),_&&k(l),c=!1,d()}}}function xE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[QE],header:[GE],default:[ZE]},$$scope:{ctx:n}};return e=new on({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&2304&&(o.beforeHide=s[23]),l[0]&3774|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[24](null),H(e,s)}}}function eD(n,e,t){let i,s;const l=Tt(),o="admin_"+z.randomString(5);let r,a={},u=!1,f=!1,c=0,d="",m="",_="",h=!1;function g(X){return S(X),t(8,f=!0),r==null?void 0:r.show()}function y(){return r==null?void 0:r.hide()}function S(X){t(1,a=structuredClone(X||{})),$()}function $(){t(4,h=!1),t(3,d=(a==null?void 0:a.email)||""),t(2,c=(a==null?void 0:a.avatar)||0),t(9,m=""),t(10,_=""),tn({})}function C(){if(u||!s)return;t(7,u=!0);const X={email:d,avatar:c};(i||h)&&(X.password=m,X.passwordConfirm=_);let K;i?K=fe.admins.create(X):K=fe.admins.update(a.id,X),K.then(async J=>{var le;t(8,f=!1),y(),Ht(i?"Successfully created admin.":"Successfully updated admin."),((le=fe.authStore.model)==null?void 0:le.id)===J.id&&fe.authStore.save(fe.authStore.token,J),l("save",J)}).catch(J=>{fe.error(J)}).finally(()=>{t(7,u=!1)})}function T(){a!=null&&a.id&&hn("Do you really want to delete the selected admin?",()=>fe.admins.delete(a.id).then(()=>{t(8,f=!1),y(),Ht("Successfully deleted admin."),l("delete",a)}).catch(X=>{fe.error(X)}))}const M=()=>T(),O=()=>y(),D=X=>t(2,c=X);function I(){d=this.value,t(3,d)}function P(){h=this.checked,t(4,h)}function F(){m=this.value,t(9,m)}function R(){_=this.value,t(10,_)}const N=()=>s&&f?(hn("You have unsaved changes. Do you really want to close the panel?",()=>{t(8,f=!1),y()}),!1):!0;function q(X){te[X?"unshift":"push"](()=>{r=X,t(6,r)})}function j(X){Fe.call(this,n,X)}function Z(X){Fe.call(this,n,X)}return n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!!(a!=null&&a.id)),n.$$.dirty[0]&62&&t(11,s=i&&d!=""||h||d!==a.email||c!==a.avatar)},[y,a,c,d,h,i,r,u,f,m,_,s,o,C,T,g,M,O,D,I,P,F,R,N,q,j,Z]}class tD extends ve{constructor(e){super(),be(this,e,eD,xE,me,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Ch(n,e,t){const i=n.slice();return i[24]=e[t],i}function nD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="id",p(t,"class",z.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function iD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="email",p(t,"class",z.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(e,s)},p:x,d(l){l&&k(e)}}}function sD(n){let e,t,i,s;return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),s.textContent="created",p(t,"class",z.getFieldTypeIcon("date")),p(s,"class","tx
|
||
|
`},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Th(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[17]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Mh(n){let e;return{c(){e=v("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Oh(n,e){let t,i,s,l,o,r,a,u,f,c,d,m=e[24].id+"",_,h,g,y,S,$=e[24].email+"",C,T,M,O,D,I,P,F,R,N,q,j,Z,X;f=new Il({props:{value:e[24].id}});let K=e[24].id===e[7].id&&Mh();D=new ki({props:{date:e[24].created}}),F=new ki({props:{date:e[24].updated}});function J(){return e[15](e[24])}function le(...ie){return e[16](e[24],...ie)}return{key:n,first:null,c(){t=v("tr"),i=v("td"),s=v("figure"),l=v("img"),r=E(),a=v("td"),u=v("div"),B(f.$$.fragment),c=E(),d=v("span"),_=U(m),h=E(),K&&K.c(),g=E(),y=v("td"),S=v("span"),C=U($),M=E(),O=v("td"),B(D.$$.fragment),I=E(),P=v("td"),B(F.$$.fragment),R=E(),N=v("td"),N.innerHTML='<i class="ri-arrow-right-line"></i>',q=E(),gn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(d,"class","txt"),p(u,"class","label"),p(a,"class","col-type-text col-field-id"),p(S,"class","txt txt-ellipsis"),p(S,"title",T=e[24].email),p(y,"class","col-type-email col-field-email"),p(O,"class","col-type-date col-field-created"),p(P,"class","col-type-date col-field-updated"),p(N,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(ie,ee){w(ie,t,ee),b(t,i),b(i,s),b(s,l),b(t,r),b(t,a),b(a,u),V(f,u,null),b(u,c),b(u,d),b(d,_),b(a,h),K&&K.m(a,null),b(t,g),b(t,y),b(y,S),b(S,C),b(t,M),b(t,O),V(D,O,null),b(t,I),b(t,P),V(F,P,null),b(t,R),b(t,N),b(t,q),j=!0,Z||(X=[Y(t,"click",J),Y(t,"keydown",le)],Z=!0)},p(ie,ee){e=ie,(!j||ee&16&&!gn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Te={};ee&16&&(Te.value=e[24].id),f.$set(Te),(!j||ee&16)&&m!==(m=e[24].id+"")&&se(_,m),e[24].id===e[7].id?K||(K=Mh(),K.c(),K.m(a,null)):K&&(K.d(1),K=null),(!j||ee&16)&&$!==($=e[24].email+"")&&se(C,$),(!j||ee&16&&T!==(T=e[24].email))&&p(S,"title",T);const Pe={};ee&16&&(Pe.date=e[24].created),D.$set(Pe);const je={};ee&16&&(je.date=e[24].updated),F.$set(je)},i(ie){j||(A(f.$$.fragment,ie),A(D.$$.fragment,ie),A(F.$$.fragment,ie),j=!0)},o(ie){L(f.$$.fragment,ie),L(D.$$.fragment,ie),L(F.$$.fragment,ie),j=!1},d(ie){ie&&k(t),H(f),K&&K.d(),H(D),H(F),Z=!1,Oe(X)}}}function aD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T=[],M=new Map,O;function D(J){n[11](J)}let I={class:"col-type-text",name:"id",$$slots:{default:[nD]},$$scope:{ctx:n}};n[2]!==void 0&&(I.sort=n[2]),o=new un({props:I}),te.push(()=>ce(o,"sort",D));function P(J){n[12](J)}let F={class:"col-type-email col-field-email",name:"email",$$slots:{default:[iD]},$$scope:{ctx:n}};n[2]!==void 0&&(F.sort=n[2]),u=new un({props:F}),te.push(()=>ce(u,"sort",P));function R(J){n[13](J)}let N={class:"col-type-date col-field-created",name:"created",$$slots:{default:[sD]},$$scope:{ctx:n}};n[2]!==void 0&&(N.sort=n[2]),d=new un({props:N}),te.push(()=>ce(d,"sort",R));function q(J){n[14](J)}let j={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[lD]},$$scope:{ctx:n}};n[2]!==void 0&&(j.sort=n[2]),h=new un({props:j}),te.push(()=>ce(h,"sort",q));let Z=n[4];const X=J=>J[24].id;for(let J=0;J<Z.length;J+=1){let le=Ch(n,Z,J),ie=X(le);M.set(ie,T[J]=Oh(ie,le))}let K=null;return Z.length||(K=$h(n)),{c(){e=v("table"),t=v("thead"),i=v("tr"),s=v("th"),l=E(),B(o.$$.fragment),a=E(),B(u.$$.fragment),c=E(),B(d.$$.fragment),_=E(),B(h.$$.fragment),y=E(),S=v("th"),$=E(),C=v("tbody");for(let J=0;J<T.length;J+=1)T[J].c();K&&K.c(),p(s,"class","min-width"),p(S,"class","col-type-action min-width"),p(e,"class","table"),Q(e,"table-loading",n[5])},m(J,le){w(J,e,le),b(e,t),b(t,i),b(i,s),b(i,l),V(o,i,null),b(i,a),V(u,i,null),b(i,c),V(d,i,null),b(i,_),V(h,i,null),b(i,y),b(i,S),b(e,$),b(e,C);
|
||
|
<span class="txt">New admin</span>`,m=E(),B(_.$$.fragment),h=E(),g=v("div"),y=E(),B(S.$$.fragment),$=E(),D&&D.c(),C=ye(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(g,"class","clearfix m-b-base")},m(I,P){w(I,e,P),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(e,r),V(a,e,null),b(e,u),b(e,f),b(e,c),b(e,d),w(I,m,P),V(_,I,P),w(I,h,P),w(I,g,P),w(I,y,P),V(S,I,P),w(I,$,P),D&&D.m(I,P),w(I,C,P),T=!0,M||(O=Y(d,"click",n[9]),M=!0)},p(I,P){(!T||P&64)&&se(o,I[6]);const F={};P&2&&(F.value=I[1]),_.$set(F);const R={};P&134217918&&(R.$$scope={dirty:P,ctx:I}),S.$set(R),I[4].length?D?D.p(I,P):(D=Eh(I),D.c(),D.m(C.parentNode,C)):D&&(D.d(1),D=null)},i(I){T||(A(a.$$.fragment,I),A(_.$$.fragment,I),A(S.$$.fragment,I),T=!0)},o(I){L(a.$$.fragment,I),L(_.$$.fragment,I),L(S.$$.fragment,I),T=!1},d(I){I&&k(e),H(a),I&&k(m),H(_,I),I&&k(h),I&&k(g),I&&k(y),H(S,I),I&&k($),D&&D.d(I),I&&k(C),M=!1,O()}}}function fD(n){let e,t,i,s,l,o;e=new Ci({}),i=new Sn({props:{$$slots:{default:[uD]},$$scope:{ctx:n}}});let r={};return l=new tD({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),V(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[18](null),H(l,a)}}}function cD(n,e,t){let i,s,l;Ke(n,ka,F=>t(21,i=F)),Ke(n,Dt,F=>t(6,s=F)),Ke(n,Pa,F=>t(7,l=F)),ln(Dt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){t(5,u=!0),t(4,a=[]);const F=z.normalizeSearchFilter(f,["id","email","created","updated"]);return fe.admins.getFullList(100,{sort:c||"-created",filter:F}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),m(),fe.error(R,!1))})}function m(){t(4,a=[])}const _=()=>d(),h=()=>r==null?void 0:r.show(),g=F=>t(1,f=F.detail);function y(F){c=F,t(2,c)}function S(F){c=F,t(2,c)}function $(F){c=F,t(2,c)}function C(F){c=F,t(2,c)}const T=F=>r==null?void 0:r.show(F),M=(F,R)=>{(R.code==="Enter"||R.code==="Space")&&(R.preventDefault(),r==null||r.show(F))},O=()=>t(1,f="");function D(F){te[F?"unshift":"push"](()=>{r=F,t(3,r)})}const I=()=>d(),P=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const F=new URLSearchParams({filter:f,sort:c}).toString();qi("/settings/admins?"+F),d()}},[d,f,c,r,a,u,s,l,_,h,g,y,S,$,C,T,M,O,D,I,P]}class dD extends ve{constructor(e){super(),be(this,e,cD,fD,me,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function pD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0]),l.focus(),r||(a=Y(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f&256&&o!==(o=u[8])&&p(l,"id",o),f&1&&l.value!==u[0]&&re(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function mD(n){let e,t,i,s,l,o,r,a,u,f,c;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),u=v("a"),u.textContent="Forgotten password?",p(e,"for",i=n[8]),p(l,"type","password"),p(l,"id",o=n[8]),l.required=!0,p(u,"href","/request-password-reset"),p(u,"class","link-hint"),p(a,"class","help-block")},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[1]),w(d,r,m),w(d,a,m),b(a,u),f||(c=[Y(l,"input",n[5]),$e(rn.call(null,u))],f=!0)},p(d,m){m&256&&i!==(i=d[8])&&p(e,"for",i),m&256&&o!==(o=d[8])&&p(l,"id",o),m&2&&l.value!==d[1]&&re(l,d[1])},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),d&&k(a),f=!1,Oe(c)}}}function hD(n){let e,t,i,s,l,o,r,a,u,f,c;return s=new de({props:{class:"form-field required",name:"identity",$$slots:{default:[pD,({uniqueId:d})=>({8:d}),({uniqueId:d})=>d?256:0]},$$scope:{ctx:n}}}),o=new de({prop
|
||
|
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),Q(a,"btn-disabled",n[2]),Q(a,"btn-loading",n[2]),p(e,"class","block")},m(d,m){w(d,e,m),b(e,t),b(e,i),V(s,e,null),b(e,l),V(o,e,null),b(e,r),b(e,a),u=!0,f||(c=Y(e,"submit",Qe(n[3])),f=!0)},p(d,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:d}),s.$set(_);const h={};m&770&&(h.$$scope={dirty:m,ctx:d}),o.$set(h),(!u||m&4)&&Q(a,"btn-disabled",d[2]),(!u||m&4)&&Q(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){L(s.$$.fragment,d),L(o.$$.fragment,d),u=!1},d(d){d&&k(e),H(s),H(o),f=!1,c()}}}function _D(n){let e,t;return e=new gb({props:{$$slots:{default:[hD]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function gD(n,e,t){let i;Ke(n,ka,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),fe.admins.authWithPassword(l,o).then(()=>{Ia(),qi("/")}).catch(()=>{Ts("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 bD extends ve{constructor(e){super(),be(this,e,gD,_D,me,{})}}function vD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T;i=new de({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[kD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[wD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[SD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),f=new de({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[CD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}});let M=n[3]&&Dh(n);return{c(){e=v("div"),t=v("div"),B(i.$$.fragment),s=E(),l=v("div"),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),B(f.$$.fragment),c=E(),d=v("div"),m=v("div"),_=E(),M&&M.c(),h=E(),g=v("button"),y=v("span"),y.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(m,"class","flex-fill"),p(y,"class","txt"),p(g,"type","submit"),p(g,"class","btn btn-expanded"),g.disabled=S=!n[3]||n[2],Q(g,"btn-loading",n[2]),p(d,"class","col-lg-12 flex"),p(e,"class","grid")},m(O,D){w(O,e,D),b(e,t),V(i,t,null),b(e,s),b(e,l),V(o,l,null),b(e,r),V(a,e,null),b(e,u),V(f,e,null),b(e,c),b(e,d),b(d,m),b(d,_),M&&M.m(d,null),b(d,h),b(d,g),b(g,y),$=!0,C||(T=Y(g,"click",n[13]),C=!0)},p(O,D){const I={};D&1572865&&(I.$$scope={dirty:D,ctx:O}),i.$set(I);const P={};D&1572865&&(P.$$scope={dirty:D,ctx:O}),o.$set(P);const F={};D&1572865&&(F.$$scope={dirty:D,ctx:O}),a.$set(F);const R={};D&1572865&&(R.$$scope={dirty:D,ctx:O}),f.$set(R),O[3]?M?M.p(O,D):(M=Dh(O),M.c(),M.m(d,h)):M&&(M.d(1),M=null),(!$||D&12&&S!==(S=!O[3]||O[2]))&&(g.disabled=S),(!$||D&4)&&Q(g,"btn-loading",O[2])},i(O){$||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(a.$$.fragment,O),A(f.$$.fragment,O),$=!0)},o(O){L(i.$$.fragment,O),L(o.$$.fragment,O),L(a.$$.fragment,O),L(f.$$.fragment,O),$=!1},d(O){O&&k(e),H(i),H(o),H(a),H(f),M&&M.d(),C=!1,T()}}}function yD(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function kD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application name"),s=E(),l=v("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[0].meta.appName),r||(a=Y(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&re(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function wD(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Application URL"),s=E(),l=v("inpu
|
||
|
<div class="breadcrumb-item">Application</div></nav>`,t=E(),i=v("div"),s=v("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),c[l].m(s,null),r=!0,a||(u=Y(s,"submit",Qe(n[4])),a=!0)},p(m,_){let h=l;l=d(m),l===h?c[l].p(m,_):(ae(),L(c[h],1,1,()=>{c[h]=null}),ue(),o=c[l],o?o.p(m,_):(o=c[l]=f[l](m),o.c()),A(o,1),o.m(s,null))},i(m){r||(A(o),r=!0)},o(m){L(o),r=!1},d(m){m&&k(e),m&&k(t),m&&k(i),c[l].d(),a=!1,u()}}}function TD(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[$D]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function MD(n,e,t){let i,s,l,o;Ke(n,Ms,M=>t(14,s=M)),Ke(n,ko,M=>t(15,l=M)),Ke(n,Dt,M=>t(16,o=M)),ln(Dt,o="Application settings",o);let r={},a={},u=!1,f=!1,c="";d();async function d(){t(1,u=!0);try{const M=await fe.settings.getAll()||{};_(M)}catch(M){fe.error(M)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const M=await fe.settings.update(z.filterRedactedProps(a));_(M),Ht("Successfully saved application settings.")}catch(M){fe.error(M)}t(2,f=!1)}}function _(M={}){var O,D;ln(ko,l=(O=M==null?void 0:M.meta)==null?void 0:O.appName,l),ln(Ms,s=!!((D=M==null?void 0:M.meta)!=null&&D.hideControls),s),t(0,a={meta:(M==null?void 0:M.meta)||{},logs:(M==null?void 0:M.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function h(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function y(){a.meta.appUrl=this.value,t(0,a)}function S(){a.logs.maxDays=pt(this.value),t(0,a)}function $(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>h(),T=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,c=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=c!=JSON.stringify(a))},[a,u,f,i,m,h,r,c,g,y,S,$,C,T]}class OD extends ve{constructor(e){super(),be(this,e,MD,TD,me,{})}}function ED(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Re(l,s[o]);return{c(){e=v("input"),ri(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),re(e,n[0]),t||(i=Y(e,"input",n[8]),t=!0)},p(o,r){ri(e,l=At(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&re(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function DD(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=Re(a,r[u]);return{c(){e=v("div"),t=v("button"),t.innerHTML='<i class="ri-key-line"></i>',i=E(),s=v("input"),p(t,"type","button"),p(t,"class","btn btn-transparent btn-circle"),p(e,"class","form-field-addon"),ri(s,a)},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[$e(ze.call(null,t,{position:"left",text:"Set new value"})),Y(t,"click",n[6])],l=!0)},p(u,f){ri(s,a=At(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Oe(o)}}}function AD(n){let e;function t(l,o){return l[3]?DD:ED}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:x,o:x,d(l){s.d(l),l&&k(e)}}}function ID(n,e,t){const i=["value","mask"];let s=Xe(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await cn(),r==null||r.focus()}const f=()=>u();function c(m){te[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=Re(Re({},e),Gt(m)),t(5,s=Xe(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&t(3,a=l===o)},[l,o,r,a,u,s,f,c,d]}class cu extends ve{constructor(e){super(),be(this,e,ID,AD,me,{value:0,mask:1})}}function LD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;return{c(){e=v("label"),t=U("Subject"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters:
|
||
|
`),f=v("button"),f.textContent=`{APP_NAME}
|
||
|
`,c=U(`,
|
||
|
`),d=v("button"),d.textContent=`{APP_URL}
|
||
|
`,m=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(g,y){w(g,e,y),b(e,t),w(g,s,y),w(g,l,y),re(l,n[0].subject),w(g,r,y),w(g,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),_||(h=[Y(l,"input",n[13]),Y(f,"click",n[14]),Y(d,"click",n[15])],_=!0)},p(g,y){y[1]&1&&i!==(i=g[31])&&p(e,"for",i),y[1]&1&&o!==(o=g[31])&&p(l,"id",o),y[0]&1&&l.value!==g[0].subject&&re(l,g[0].subject)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(r),g&&k(a),_=!1,Oe(h)}}}function PD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y;return{c(){e=v("label"),t=U("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters:
|
||
|
`),f=v("button"),f.textContent=`{APP_NAME}
|
||
|
`,c=U(`,
|
||
|
`),d=v("button"),d.textContent=`{APP_URL}
|
||
|
`,m=U(`,
|
||
|
`),_=v("button"),_.textContent=`{TOKEN}
|
||
|
`,h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(S,$){w(S,e,$),b(e,t),w(S,s,$),w(S,l,$),re(l,n[0].actionUrl),w(S,r,$),w(S,a,$),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),b(a,_),b(a,h),g||(y=[Y(l,"input",n[16]),Y(f,"click",n[17]),Y(d,"click",n[18]),Y(_,"click",n[19])],g=!0)},p(S,$){$[1]&1&&i!==(i=S[31])&&p(e,"for",i),$[1]&1&&o!==(o=S[31])&&p(l,"id",o),$[0]&1&&l.value!==S[0].actionUrl&&re(l,S[0].actionUrl)},d(S){S&&k(e),S&&k(s),S&&k(l),S&&k(r),S&&k(a),g=!1,Oe(y)}}}function FD(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),re(e,n[0].body),i||(s=Y(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&re(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function ND(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Rt(o,r(n)),te.push(()=>ce(e,"value",l))),{c(){e&&B(e.$$.fragment),i=ye()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,he(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){ae();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),ue()}o?(e=Rt(o,r(a)),te.push(()=>ce(e,"value",l)),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function RD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C;const T=[ND,FD],M=[];function O(D,I){return D[4]&&!D[5]?0:1}return l=O(n),o=M[l]=T[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters:
|
||
|
`),f=v("button"),f.textContent=`{APP_NAME}
|
||
|
`,c=U(`,
|
||
|
`),d=v("button"),d.textContent=`{APP_URL}
|
||
|
`,m=U(`,
|
||
|
`),_=v("button"),_.textContent=`{TOKEN}
|
||
|
`,h=U(`,
|
||
|
`),g=v("button"),g.textContent=`{ACTION_URL}
|
||
|
`,y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),b(e,t),w(D,s,I),M[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,m),b(a,_),b(a,h),b(a,g),b(a,y),S=!0,$||(C=[Y(f,"click",n[22]),Y(d,"click",n[23]),Y(_,"click",n[24]),Y(g,"click",n[25])],$=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let P=l;l=O(D),l===P?M[l].p(D,I):(ae(),L(M[P],1,1,()=>{M[P]=null}),ue(),o=M[l],o?o.p(D,I):(o=M[l]=T[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&k(e),D&&k(s),M[l].d(D),D&&k(r),D&&k(a),$=!1,Oe(C)}}}function qD(n){let e,t,i,s,l,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[LD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[PD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[RD,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(r,a){V(e,r,a),w(r,t,a),V(i,r,a),w(r,s,a),V(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const 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){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){H(e,r),r&&k(t),H(i,r),r&&k(s),H(l,r)}}}function Ah(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=$e(ze.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Ge(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function jD(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Ah();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=ye(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Ah(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ae(),L(f,1,1,()=>{f=null}),ue())},d(c){c&&k(e),c&&k(o),c&&k(r),c&&k(a),f&&f.d(c),c&&k(u)}}}function zD(n){let e,t;const i=[n[8]];let s={$$slots:{header:[jD],default:[qD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Re(s,i[l]);return e=new ao({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){B(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,o){const r=o[0]&256?At(i,[Qt(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){L(e.$$.fragment,l),t=!1},d(l){n[26](null),H(e,l)}}}let Ih;function VD(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Xe(e,s),o;Ke(n,wi,J=>t(12,o=J));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Ih,d=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await at(()=>import("./CodeEditor-8fadd9a5.js"),["./CodeEditor-8fadd9a5.js","./index-fd4289fb.js"],import.meta.url)).default),Ih=c,t(5,d=!1))}function y(J){z.copyToClipboard(J),bo(`Copied ${J} to clipboard`,2e3)}g();function S(){u.subject=this.value,t(0,u)}const $=()=>y("{APP_NAME}"),C=()=>y("{APP_URL}");function T(){u.action
|
||
|
<span class="txt">Send test email</span>`,p(e,"type","button"),p(e,"class","btn btn-expanded btn-outline")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[26]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function aA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Save changes",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],Q(s,"btn-loading",n[3])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=[Y(e,"click",n[24]),Y(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&&k(e),u&&k(i),u&&k(s),r=!1,Oe(a)}}}function uA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;const y=[XD,GD],S=[];function $(C,T){return C[2]?0:1}return d=$(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[5]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",c=E(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(C,r,T),w(C,a,T),b(a,u),b(u,f),b(u,c),S[d].m(u,null),_=!0,h||(g=Y(u,"submit",Qe(n[27])),h=!0)},p(C,T){(!_||T[0]&32)&&se(o,C[5]);let M=d;d=$(C),d===M?S[d].p(C,T):(ae(),L(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(C,T):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,g()}}}function fA(n){let e,t,i,s,l,o;e=new Ci({}),i=new Sn({props:{$$slots:{default:[uA]},$$scope:{ctx:n}}});let r={};return l=new ZD({props:r}),n[28](l),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[28](null),H(l,a)}}}function cA(n,e,t){let i,s,l;Ke(n,Dt,K=>t(5,l=K));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];ln(Dt,l="Mail settings",l);let a,u={},f={},c=!1,d=!1;m();async function m(){t(2,c=!0);try{const K=await fe.settings.getAll()||{};h(K)}catch(K){fe.error(K)}t(2,c=!1)}async function _(){if(!(d||!s)){t(3,d=!0);try{const K=await fe.settings.update(z.filterRedactedProps(f));h(K),tn({}),Ht("Successfully saved mail settings.")}catch(K){fe.error(K)}t(3,d=!1)}}function h(K={}){t(0,f={meta:(K==null?void 0:K.meta)||{},smtp:(K==null?void 0:K.smtp)||{}}),f.smtp.authMethod||t(0,f.smtp.authMethod=r[0].value,f),t(10,u=JSON.parse(JSON.stringify(f)))}function g(){t(0,f=JSON.parse(JSON.stringify(u||{})))}function y(){f.meta.senderName=this.value,t(0,f)}function S(){f.meta.senderAddress=this.value,t(0,f)}function $(K){n.$$.not_equal(f.meta.verificationTemplate,K)&&(f.meta.verificationTemplate=K,t(0,f))}function C(K){n.$$.not_equal(f.meta.resetPasswordTemplate,K)&&(f.meta.resetPasswordTemplate=K,t(0,f))}function T(K){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,K)&&(f.meta.confirmEmailChangeTemplate=K,t(0,f))}function M(){f.smtp.enabled=this.checked,t(0,f)}function O(){f.smtp.host=this.value,t(0,f)}function D(){f.smtp.port=pt(this.value),t(0,f)}function I(K){n.$$.not_equal(f.smtp.tls,K)&&(f.smtp.tls=K,t(0,f))}function P(K){n.$$.not_equal(f.smtp.authMethod,K)&&(f.smtp.authMethod=K,t(0,f))}function F(){f.smtp.username=this.value,t(0,f)}function R(K){n.$$.not_equal(f.smtp.password,K)&&(f.smtp.password=K,t(0,f))}const N=()=>g(),q=()=>_(),j=()=>a==null?void 0:a.show(),Z=()=>_();function X(K){te[K?"unshift":"push"]((
|
||
|
from the
|
||
|
`),r=v("strong"),u=U(a),f=U(`
|
||
|
to the
|
||
|
`),c=v("strong"),m=U(d),_=U(`.
|
||
|
`),h=v("br"),g=U(`
|
||
|
There are numerous command line tools that can help you, such as:
|
||
|
`),y=v("a"),y.textContent=`rclone
|
||
|
`,S=U(`,
|
||
|
`),$=v("a"),$.textContent=`s5cmd
|
||
|
`,C=U(", etc."),T=E(),M=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(P,F){w(P,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,m),b(l,_),b(l,h),b(l,g),b(l,y),b(l,S),b(l,$),b(l,C),b(e,T),b(e,M),D=!0},p(P,F){var R;(!D||F&1)&&a!==(a=(R=P[0].s3)!=null&&R.enabled?"S3 storage":"local file system")&&se(u,a),(!D||F&2)&&d!==(d=P[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(P){D||(P&&Ge(()=>{D&&(O||(O=qe(e,st,{duration:150},!0)),O.run(1))}),D=!0)},o(P){P&&(O||(O=qe(e,st,{duration:150},!1)),O.run(0)),D=!1},d(P){P&&k(e),P&&O&&O.end()}}}function $A(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&jh(n);return{c(){t&&t.c(),e=ye()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=jh(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ae(),L(t,1,1,()=>{t=null}),ue())},d(s){t&&t.d(s),s&&k(e)}}}function zh(n){let e;function t(l,o){return l[4]?OA:l[5]?MA:TA}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function TA(n){let e;return{c(){e=v("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
|
||
|
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function MA(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>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=$e(t=ze.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function OA(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Vh(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=Y(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function EA(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;const y=[CA,SA],S=[];function $(C,T){return C[2]?0:1}return d=$(n),m=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),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=E(),m.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(C,T){w(C,e,T),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(C,r,T),w(C,a,T),b(a,u),b(u,f),b(u,c),S[d].m(u,null),_=!0,h||(g=Y(u,"submit",Qe(n[16])),h=!0)},p(C,T){(!_||T&128)&&se(o,C[7]);let M=d;d=$(C),d===M?S[d].p(C,T):(ae(),L(S[M],1,1,()=>{S[M]=null}),ue(),m=S[d],m?m.p(C,T):(m=S[d]=y[d](C),m.c()),A(m,1),m.m(u,null))},i(C){_||(A(m),_=!0)},o(C){L(m),_=!1},d(C){C&&k(e),C&&k(r),C&&k(a),S[d].d(),h=!1,g()}}}function DA(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[EA]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}const AA="s3_test_request";function IA(n,e,t){let i,s,l;Ke(n,Dt,M=>t(7,l=M)),ln(Dt,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,c=null;d();async function d(){t(2,a=!0);try{const M=await fe.settings.getAll()||{};_(M)}catch(M){fe.error(M)}t(2,a=!1)}async function m(){if(!(u||!s)){t(3,u=!0);try{fe.cancelRequest(AA);const M=await fe.settings.update(z.filterRedactedProps(r));tn({}),await _(M),Ia(),c?Dy("Successfully saved but failed to establish S3 connection."):Ht("Successfully saved files storage settings.")}catch(M){fe.error(M)}t(3,u=!1)}}async function _(M={}){t(1,r={s3:(M==null?void 0:M.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r)))}async function h(){t(1,r=JSON.parse(JSON.stringify(o||{})))}function g(M){n.$$.not_equal(r.s3,M)&&(r.s3=M,t(1,r))}function y(M){f=M,t(4,f)}function S(M){c=M,t(5,c)}const $=()=>h(),C=()=>m(),T=()=>m();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,m,h,i,g,y,S,$,C,T]}class LA extends ve{constructor(e){super(),be(this,e,IA,DA,me,{})}}function PA(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[20]),p(s,"for",o=n[20])},m(u,f){w(u,e,f),e.checked=n[1].enabled,w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"change",n[11]),r=!0)},p(u,f){f&1048576&&t!==(t=u[20])&&p(e,"id",t),f&2&&(e.checked=u[1].enabled),f&1048576&&o!==(o=u[20])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function FA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=v("label"),t=U("Client ID"),s=E(),l=v("input"),p(e,"for",i=n[20]),p(l,"type","text"),p(l,"id",o=n[20]),l.required=r=n[1].enabled},m(f,c){w(f,e,c),b(e,t),w(f,s,c),w(f,l,c),re(l,n[1].clientId),a||(u=Y(l,"input",n[12]),a=!0)},p(f,c){c&1048576&&i!==(i=f[20])&&p(e,"for",i),c&1048576&&o!==(o=f[20])&&p(l,"id",o),c&2&&r!==(r=f[1].enabled)&&(l.required=r),c&2&&l.value!==f[1].clientId&&re(l,f[1].clientId)},d(f){f&&k(e),f&&k(s),f&&k(l),a=!1,u()}}}function NA(n){let e,t,i,s,l,o,r;function a(f){n[13](f)}let u={id:n[20],required:n[1].enabled};return n[1].clientSecret!==void 0&&(u.value=n[1].clientSecret),l=new cu({props:u}),te.push(()=>ce(l,"value",a)),{c(){e=v("label"),t=U("Client secret"),s=E(),B(l.$$.fragment),p(e,"for",i=n[20])},m(f,c){w(f,e,c),b(e,t),w(f,s,c),V(l,f,c),r=!0},p(f,c){(!r||c&1048576&&i!==(i=f[20]))&&p(e,"for",i);const d={};c&1048576&&(d.id=f[20]),c&2&&(d.required=f[1].enabled),!o&&c&2&&(o=!0,d.value=f[1].clientSecret,he(()=>o=!1)),l.$set(d)},i(f){r||(A(l.$$.fragment,f),r=!0)},o(f){L(l.$$.fragment,f),r=!1},d(f){f&&k(e),f&&k(s),H(l,f)}}}function Hh(n){let e,t,i,s;function l(a){n[14](a)}var o=n[3].optionsComponent;function r(a){let u={key:a[3].key};return a[1]!==void 0&&(u.config=a[1]),{props:u}}return o&&(t=Rt(o,r(n)),te.push(()=>ce(t,"config",l))),{c(){e=v("div"),t&&B(t.$$.fragment),p(e,"class","col-lg-12")},m(a,u){w(a,e,u),t&&V(t,e,null),s=!0},p(a,u){const f={};if(u&8&&(f.key=a[3].key),!i&&u&2&&(i=!0,f.config=a[
|
||
|
another PocketBase environment.</p>`,t=E(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),B(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML=`<i class="ri-download-line"></i>
|
||
|
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(h,g){w(h,e,g),w(h,t,g),w(h,i,g),b(i,s),b(i,l),V(o,i,null),n[8](i),w(h,r,g),w(h,a,g),b(a,u),b(a,f),b(a,c),d=!0,m||(_=[Y(s,"click",n[7]),Y(i,"keydown",n[9]),Y(c,"click",n[10])],m=!0)},p(h,g){const y={};g&4&&(y.content=h[2]),o.$set(y)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){L(o.$$.fragment,h),d=!1},d(h){h&&k(e),h&&k(t),h&&k(i),H(o),n[8](null),h&&k(r),h&&k(a),m=!1,Oe(_)}}}function rI(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function aI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[rI,oI],_=[];function h(g,y){return g[1]?0:1}return f=h(n),c=_[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(g,r,y),w(g,a,y),b(a,u),_[f].m(u,null),d=!0},p(g,y){(!d||y&8)&&se(o,g[3]);let S=f;f=h(g),f===S?_[f].p(g,y):(ae(),L(_[S],1,1,()=>{_[S]=null}),ue(),c=_[f],c?c.p(g,y):(c=_[f]=m[f](g),c.c()),A(c,1),c.m(u,null))},i(g){d||(A(c),d=!0)},o(g){L(c),d=!1},d(g){g&&k(e),g&&k(r),g&&k(a),_[f].d()}}}function uI(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[aI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function fI(n,e,t){let i,s;Ke(n,Dt,g=>t(3,s=g)),ln(Dt,s="Export collections",s);const l="export_"+z.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await fe.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let g of r)delete g.created,delete g.updated}catch(g){fe.error(g)}t(1,a=!1)}function f(){z.downloadJson(r,"pb_schema")}function c(){z.copyToClipboard(i),bo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(g){te[g?"unshift":"push"](()=>{o=g,t(0,o)})}const _=g=>{if(g.ctrlKey&&g.code==="KeyA"){g.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},h=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,m,_,h]}class cI extends ve{constructor(e){super(),be(this,e,fI,uI,me,{})}}function t_(n,e,t){const i=n.slice();return i[14]=e[t],i}function n_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function i_(n,e,t){const i=n.slice();return i[14]=e[t],i}function s_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function l_(n,e,t){const i=n.slice();return i[14]=e[t],i}function o_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function r_(n,e,t){const i=n.slice();return i[30]=e[t],i}function dI(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&a_(),a=n[0].name!==n[1].name&&u_(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=a_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=u_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function pI(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=E(),i=v("strong"),l=U(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),b(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?voi
|
||
|
<th width="10%" class="svelte-lmkr38">Old</th>
|
||
|
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=E(),o=v("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=E(),h&&h.c(),a=E();for(let C=0;C<y.length;C+=1)y[C].c();u=E();for(let C=0;C<$.length;C+=1)$[C].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,T){w(C,e,T),d.m(e,null),w(C,t,T),w(C,i,T),b(i,s),b(i,l),b(i,o);for(let M=0;M<_.length;M+=1)_[M]&&_[M].m(o,null);b(o,r),h&&h.m(o,null),b(o,a);for(let M=0;M<y.length;M+=1)y[M]&&y[M].m(o,null);b(o,u);for(let M=0;M<$.length;M+=1)$[M]&&$[M].m(o,null)},p(C,T){if(c===(c=f(C))&&d?d.p(C,T):(d.d(1),d=c(C),d&&(d.c(),d.m(e,null))),T[0]&7203){m=C[11];let M;for(M=0;M<m.length;M+=1){const O=r_(C,m,M);_[M]?_[M].p(O,T):(_[M]=f_(O),_[M].c(),_[M].m(o,r))}for(;M<_.length;M+=1)_[M].d(1);_.length=m.length}if(C[2]||C[5]?h?h.p(C,T):(h=c_(C),h.c(),h.m(o,a)):h&&(h.d(1),h=null),T[0]&4248){g=C[7];let M;for(M=0;M<g.length;M+=1){const O=i_(C,g,M);y[M]?y[M].p(O,T):(y[M]=__(O),y[M].c(),y[M].m(o,u))}for(;M<y.length;M+=1)y[M].d(1);y.length=g.length}if(T[0]&4352){S=C[8];let M;for(M=0;M<S.length;M+=1){const O=t_(C,S,M);$[M]?$[M].p(O,T):($[M]=b_(O),$[M].c(),$[M].m(o,null))}for(;M<$.length;M+=1)$[M].d(1);$.length=S.length}},i:x,o:x,d(C){C&&k(e),d.d(),C&&k(t),C&&k(i),ht(_,C),h&&h.d(),ht(y,C),ht($,C)}}}function zn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function yn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function _I(n,e,t){let i,s,l,{collectionA:o=z.initCollection()}=e,{collectionB:r=z.initCollection()}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],m=[];const _=Object.keys(z.initCollection()).filter(y=>!["schema","created","updated"].includes(y));function h(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function g(y){return typeof y>"u"?"":z.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")&&h(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=z.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,m,l,s,_,g]}class gI extends ve{constructor(e){super(),be(this,e,_I,hI,me,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function v_(n,e,t){const i=n.slice();return i[17]=e[t],i}function y_(n){let e,t;return e=new gI({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function bI(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=y_(v_(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=ye()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=v_(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=y_(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ae(),a=i.length;a<s.length;a+=1)l(a);ue()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){ht(s,o),o&&k(e)}}}function vI(n){let e;return{c(){e=v("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function yI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("span"),l.textContent="Confirm and import",p(e,"type","button"
|
||
|
- ${C.join(`
|
||
|
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await fe.collections.import(o,a),Ht("Successfully imported collections configuration."),i("submit")}catch(C){fe.error(C)}t(4,u=!1),c()}}const h=()=>m(),g=()=>!u;function y(C){te[C?"unshift":"push"](()=>{s=C,t(1,s)})}function S(C){Fe.call(this,n,C)}function $(C){Fe.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,m,f,l,o,h,g,y,S,$]}class SI extends ve{constructor(e){super(),be(this,e,wI,kI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function k_(n,e,t){const i=n.slice();return i[32]=e[t],i}function w_(n,e,t){const i=n.slice();return i[35]=e[t],i}function S_(n,e,t){const i=n.slice();return i[32]=e[t],i}function CI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[TI,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&$_(),P=n[6]&&n[1].length&&n[7]&&T_(n),F=n[13].length&&R_(n),R=!!n[0]&&q_(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or
|
||
|
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=E(),B(a.$$.fragment),u=E(),f=E(),I&&I.c(),c=E(),P&&P.c(),d=E(),F&&F.c(),m=E(),_=v("div"),R&&R.c(),h=E(),g=v("div"),y=E(),S=v("button"),$=v("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p($,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=C=!n[14],p(_,"class","flex m-t-base")},m(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),b(i,s),b(s,l),b(s,o),w(N,r,q),V(a,N,q),w(N,u,q),w(N,f,q),I&&I.m(N,q),w(N,c,q),P&&P.m(N,q),w(N,d,q),F&&F.m(N,q),w(N,m,q),w(N,_,q),R&&R.m(_,null),b(_,h),b(_,g),b(_,y),b(_,S),b(S,$),T=!0,M||(O=[Y(e,"change",n[20]),Y(o,"click",n[21]),Y(S,"click",n[26])],M=!0)},p(N,q){(!T||q[0]&4096)&&Q(o,"btn-loading",N[12]);const j={};q[0]&64&&(j.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(j.$$scope={dirty:q,ctx:N}),a.$set(j),N[6]&&N[1].length&&!N[7]?I||(I=$_(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),N[6]&&N[1].length&&N[7]?P?P.p(N,q):(P=T_(N),P.c(),P.m(d.parentNode,d)):P&&(P.d(1),P=null),N[13].length?F?F.p(N,q):(F=R_(N),F.c(),F.m(m.parentNode,m)):F&&(F.d(1),F=null),N[0]?R?R.p(N,q):(R=q_(N),R.c(),R.m(_,h)):R&&(R.d(1),R=null),(!T||q[0]&16384&&C!==(C=!N[14]))&&(S.disabled=C)},i(N){T||(A(a.$$.fragment,N),A(D),T=!0)},o(N){L(a.$$.fragment,N),L(D),T=!1},d(N){N&&k(e),n[19](null),N&&k(t),N&&k(i),N&&k(r),H(a,N),N&&k(u),N&&k(f),I&&I.d(N),N&&k(c),P&&P.d(N),N&&k(d),F&&F.d(N),N&&k(m),N&&k(_),R&&R.d(),M=!1,Oe(O)}}}function $I(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function C_(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function TI(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&C_();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=ye(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){w(d,e,m),b(e,t),w(d,s,m),w(d,l,m),re(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=Y(l,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(l,"id",o),m[0]&1&&re(l,d[0]),d[0]&&!d[6]?c||(c=C_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function $_(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>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function T_(n){let e,t,i,s,l,o=n[9].length&&M_(n),r=n[4].length&&D_(n),a=n[8].length&&P_(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),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=M_(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=P_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function M_(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=S_(n,s,o),a=l(r);t.set(a,e[o]=E_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=bt(e,r,l,1,o,s,t,i.parentNode,ls,E_,i,S_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function O_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&se(s,i)},d(o){o&&k(e)}}}function E_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&O_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Deleted",s=E(),l=v("strong"),r=U(o),a=E(),f&&f.c(),u=E(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),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+"")&&se(r,o),e[32].id?f?f.p(e,d):(f=O_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(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=w_(n,s,o),a=l(r);t.set(a,e[o]=L_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=bt(e,r,l,1,o,s,t,i.parentNode,ls,L_,i,w_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function A_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=v("strong"),i=U(t),s=E(),l=v("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),b(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&se(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function I_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&se(s,i)},d(o){o&&k(e)}}}function L_(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&&A_(e),m=e[35].new.id&&I_(e);return{key:n,first:null,c(){t=v("div"),i=v("span"),i.textContent="Changed",s=E(),l=v("div"),d&&d.c(),o=E(),r=v("strong"),u=U(a),f=E(),m&&m.c(),c=E(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(_,h){w(_,t,h),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),m&&m.m(l,null),b(t,c)},p(_,h){e=_,e[35].old.name!==e[35].new.name?d?d.p(e,h):(d=A_(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),h[0]&16&&a!==(a=e[35].new.name+"")&&se(u,a),e[35].new.id?m?m.p(e,h):(m=I_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&k(t),d&&d.d(),m&&m.d()}}}function P_(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=k_(n,s,o),a=l(r);t.set(a,e[o]=N_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=bt(e,r,l,1,o,s,t,i.parentNode,ls,N_,i,k_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function F_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r
|
||
|
imported with different IDs. You can replace them in the import if you want
|
||
|
to.</string>`,l=E(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=Y(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function q_(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=Y(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function MI(n){let e,t,i,s,l,o,r,a,u,f,c,d;const m=[$I,CI],_=[];function h(g,y){return g[5]?0:1}return f=h(n),c=_[f]=m[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(g,y){w(g,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(g,r,y),w(g,a,y),b(a,u),_[f].m(u,null),d=!0},p(g,y){(!d||y[0]&32768)&&se(o,g[15]);let S=f;f=h(g),f===S?_[f].p(g,y):(ae(),L(_[S],1,1,()=>{_[S]=null}),ue(),c=_[f],c?c.p(g,y):(c=_[f]=m[f](g),c.c()),A(c,1),c.m(u,null))},i(g){d||(A(c),d=!0)},o(g){L(c),d=!1},d(g){g&&k(e),g&&k(r),g&&k(a),_[f].d()}}}function OI(n){let e,t,i,s,l,o;e=new Ci({}),i=new Sn({props:{$$slots:{default:[MI]},$$scope:{ctx:n}}});let r={};return l=new SI({props:r}),n[27](l),l.$on("submit",n[28]),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment),s=E(),B(l.$$.fragment)},m(a,u){V(e,a,u),w(a,t,u),V(i,a,u),w(a,s,u),V(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){H(e,a),a&&k(t),H(i,a),a&&k(s),n[27](null),H(l,a)}}}function EI(n,e,t){let i,s,l,o,r,a,u;Ke(n,Dt,J=>t(15,u=J)),ln(Dt,u="Import collections",u);let f,c,d="",m=!1,_=[],h=[],g=!0,y=[],S=!1;$();async function $(){t(5,S=!0);try{t(2,h=await fe.collections.getFullList(200));for(let J of h)delete J.created,delete J.updated}catch(J){fe.error(J)}t(5,S=!1)}function C(){if(t(4,y=[]),!!i)for(let J of _){const le=z.findByKey(h,"id",J.id);!(le!=null&&le.id)||!z.hasCollectionChanges(le,J,g)||y.push({new:J,old:le})}}function T(){t(1,_=[]);try{t(1,_=JSON.parse(d))}catch{}Array.isArray(_)?t(1,_=z.filterDuplicatesByKey(_)):t(1,_=[]);for(let J of _)delete J.created,delete J.updated,J.schema=z.filterDuplicatesByKey(J.schema)}function M(){var J,le;for(let ie of _){const ee=z.findByKey(h,"name",ie.name)||z.findByKey(h,"id",ie.id);if(!ee)continue;const Te=ie.id,Pe=ee.id;ie.id=Pe;const je=Array.isArray(ee.schema)?ee.schema:[],Ve=Array.isArray(ie.schema)?ie.schema:[];for(const ke of Ve){const Ce=z.findByKey(je,"name",ke.name);Ce&&Ce.id&&(ke.id=Ce.id)}for(let ke of _)if(Array.isArray(ke.schema))for(let Ce of ke.schema)(J=Ce.options)!=null&&J.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===Te&&(Ce.options.collectionId=Pe)}t(0,d=JSON.stringify(_,null,4))}function O(J){t(12,m=!0);const le=new FileReader;le.onload=async ie=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ie.target.result),await cn(),_.length||(Ts("Invalid collections configuration."),D())},le.onerror=ie=>{console.warn(ie),Ts("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(J)}function D(){t(0,d=""),t(10,f.value="",f),tn({})}function I(J){te[J?"unshift":"push"](()=>{f=J,t(10,f)})}const P=()=>{f.files.length&&O(f.files[0])},F=()=>{f.click()};function R(){d=this.value,t(0,d)}function N(){g=this.checked,t(3,g)}const q=()=>M(),j=()=>D(),Z=()=>c==null?void 0:c.show(h,_,g);function X(J){te[J?"unshift":"push"](()=>{c=J,t(11,c)})}const K=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&T(),n.$$.dirty[0]&3&&t(6,i=!!d&&_.length&&_.length===_.filter(J=>!!J.id&&!!J.name).length),n.$$.dirty[0]&78&&t(9,s=h.filter(J=>i&&g&&!z.findByKey(_,"id",J.id)
|
||
|
<div class="content"><p>Please note that during the backup other concurrent write requests may fail since the
|
||
|
database will be temporary "locked" (this usually happens only during the ZIP generation).</p>
|
||
|
<p class="txt-bold">If you are using S3 storage for the collections file upload, you'll have to backup them
|
||
|
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=E(),i=v("form"),B(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),V(s,i,null),l=!0,o||(r=Y(i,"submit",Qe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&k(e),a&&k(t),a&&k(i),H(s),o=!1,r()}}}function LI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=Y(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&k(e),a&&k(i),a&&k(s),o=!1,r()}}}function FI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[PI],header:[LI],default:[II]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function NI(n,e,t){const i=Tt(),s="backup_create_"+z.randomString(5);let l,o="",r=!1,a;function u(S){tn({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await fe.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),Ht("Successfully generated new backup.")}catch(S){S.isAbort||fe.error(S)}clearTimeout(a),t(3,r=!1)}}Ro(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(bo("A backup has already been started, please wait."),!1):!0,_=()=>(r&&bo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function g(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,m,_,h,g,y]}class RI extends ve{constructor(e){super(),be(this,e,NI,FI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function qI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[2]),r||(a=Y(l,"input",n[9]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&4&&l.value!==u[2]&&re(l,u[2])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function jI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g;return u=new Il({props:{value:n[1]}}),m=new de({props:{class:"form-field required m-0",name:"name",$$slots:{default:[qI,({uniqueId:y})=>({14:y}),({uniqueId:y})=>y?16384:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div>
|
||
|
<div class="content"><p>Please proceed with caution.</p>
|
||
|
<p>The restore operation will replace your existing <code>pb_data</code> with the one from the backup
|
||
|
and will restart the application process!</p>
|
||
|
<p class="txt-bold">Backup restore is still experimental and currently works only on UNIX based systems.</p></div>`,t=E(),i=v("div"),s=U(`Type the backup name
|
||
|
`),l=v("div"),o=v("span"),r=U(n[1]),a=E(),B(u.$$.fragment),f=U(`
|
||
|
to confirm:`),c=E(),d=v("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),V(u,l,null),b(i,f),w(y,c,S),w(y,d,S),V(m,d,null),_=!0,h||(g=Y(d,"submit",Qe(n[7])),h=!0)},p(y,S){(!_||S&2)&&se(r,y[1]);const $={};S&2&&($.value=y[1]),u.$set($);const C={};S&49156&&(C.$$scope={dirty:S,ctx:y}),m.$set(C)},i(y){_||(A(u.$$.fragment,y),A(m.$$.fragment,y),_=!0)},o(y){L(u.$$.fragment,y),L(m.$$.fragment,y),_=!1},d(y){y&&k(e),y&&k(t),y&&k(i),H(u),y&&k(c),y&&k(d),H(m),h=!1,g()}}}function zI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","center txt-break")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function VI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=Y(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function HI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[VI],header:[zI],default:[jI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&32822&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function BI(n,e,t){let i;const s="backup_restore_"+z.randomString(5);let l,o="",r="",a=!1;function u(y){tn({}),t(2,r=""),t(1,o=y),t(4,a=!1),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){var y;if(!(!i||a)){t(4,a=!0);try{await fe.backups.restore(o),setTimeout(()=>{window.location.reload()},1e3)}catch(S){S!=null&&S.isAbort||(t(4,a=!1),Ts(((y=S.response)==null?void 0:y.message)||S.message))}}}function d(){r=this.value,t(2,r)}const m=()=>!a;function _(y){te[y?"unshift":"push"](()=>{l=y,t(3,l)})}function h(y){Fe.call(this,n,y)}function g(y){Fe.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[f,o,r,l,a,i,s,c,u,d,m,_,h,g]}class UI extends ve{constructor(e){super(),be(this,e,BI,HI,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function j_(n,e,t){const i=n.slice();return i[22]=e[t],i}function z_(n,e,t){const i=n.slice();return i[19]=e[t],i}function WI(n){let e=[],t=new Map,i,s,l=n[3];const o=a=>a[22].key;for(let a=0;a<l.length;a+=1){let u=j_(n,l,a),f=o(u);t.set(f,e[a]=H_(f,u))}let r=null;return l.length||(r=V_()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ye(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);w(a,i,u),r&&r.m(a,u),s=!0},p(a,u){u&876&&(l=a[3],ae(),e=bt(e,u,o,1,a,l,t,i.parentNode,Ut,H_,i,j_),ue(),!l.length&&r?r.p(a,u):l.length?r&&(r.d(1),r=null):(r=V_(),r.c(),r.m(i.parentNode,i)))},i(a){if(!s){for(let u=0;u<l.length;u+=1)A(e[u]);s=!0}},o(a){for(let u=0;u<e.length;u+=1)L(e[u]);s=!1},d(a){for(let u=0;u<e.length;u+=1)e[u].d(a);a&&k(i),r&&r.d(a)}}}function YI(n){let e,t=Array(n[3].length||1),i=[];for(let s=0;s<t.length;s+=1)i[s]=B_(z_(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=ye()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l&8){t=Array(s[3].length||1);let o;for(o=0;o<t.length;o+=1){const r=z_(s,t,o);i[o]?i[o].p(r,l):(i[o]=B_(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:x,o:x,d(s){ht(i,s),s&&k(e)}}}function V_(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="txt">No backups yet.</sp
|
||
|
`,p(e,"class","list-item list-item-placeholder svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function H_(n,e){let t,i,s,l,o,r=e[22].key+"",a,u,f,c,d=z.formattedFileSize(e[22].size)+"",m,_,h,g,y,S,$,C,T,M,O,D,I,P,F,R,N,q,j,Z;function X(){return e[10](e[22])}function K(){return e[11](e[22])}function J(){return e[12](e[22])}return{key:n,first:null,c(){t=v("div"),i=v("i"),s=E(),l=v("div"),o=v("span"),a=U(r),u=E(),f=v("span"),c=U("("),m=U(d),_=U(")"),h=E(),g=v("div"),y=v("button"),S=v("i"),C=E(),T=v("button"),M=v("i"),D=E(),I=v("button"),P=v("i"),R=E(),p(i,"class","ri-folder-zip-line"),p(o,"class","name backup-name svelte-1ulbkf5"),p(f,"class","size txt-hint txt-nowrap"),p(l,"class","content"),p(S,"class","ri-download-line"),p(y,"type","button"),p(y,"class","btn btn-sm btn-circle btn-hint btn-transparent"),y.disabled=$=e[6][e[22].key]||e[5][e[22].key],p(y,"aria-label","Download"),Q(y,"btn-loading",e[5][e[22].key]),p(M,"class","ri-restart-line"),p(T,"type","button"),p(T,"class","btn btn-sm btn-circle btn-hint btn-transparent"),T.disabled=O=e[6][e[22].key],p(T,"aria-label","Restore"),p(P,"class","ri-delete-bin-7-line"),p(I,"type","button"),p(I,"class","btn btn-sm btn-circle btn-hint btn-transparent"),I.disabled=F=e[6][e[22].key],p(I,"aria-label","Delete"),Q(I,"btn-loading",e[6][e[22].key]),p(g,"class","actions nonintrusive"),p(t,"class","list-item svelte-1ulbkf5"),this.first=t},m(le,ie){w(le,t,ie),b(t,i),b(t,s),b(t,l),b(l,o),b(o,a),b(l,u),b(l,f),b(f,c),b(f,m),b(f,_),b(t,h),b(t,g),b(g,y),b(y,S),b(g,C),b(g,T),b(T,M),b(g,D),b(g,I),b(I,P),b(t,R),q=!0,j||(Z=[$e(ze.call(null,y,"Download")),Y(y,"click",Qe(X)),$e(ze.call(null,T,"Restore")),Y(T,"click",Qe(K)),$e(ze.call(null,I,"Delete")),Y(I,"click",Qe(J))],j=!0)},p(le,ie){e=le,(!q||ie&8)&&r!==(r=e[22].key+"")&&se(a,r),(!q||ie&8)&&d!==(d=z.formattedFileSize(e[22].size)+"")&&se(m,d),(!q||ie&104&&$!==($=e[6][e[22].key]||e[5][e[22].key]))&&(y.disabled=$),(!q||ie&40)&&Q(y,"btn-loading",e[5][e[22].key]),(!q||ie&72&&O!==(O=e[6][e[22].key]))&&(T.disabled=O),(!q||ie&72&&F!==(F=e[6][e[22].key]))&&(I.disabled=F),(!q||ie&72)&&Q(I,"btn-loading",e[6][e[22].key])},i(le){q||(le&&Ge(()=>{q&&(N||(N=qe(t,st,{duration:150},!0)),N.run(1))}),q=!0)},o(le){le&&(N||(N=qe(t,st,{duration:150},!1)),N.run(0)),q=!1},d(le){le&&k(t),le&&N&&N.end(),j=!1,Oe(Z)}}}function B_(n){let e;return{c(){e=v("div"),e.innerHTML=`<span class="skeleton-loader"></span>
|
||
|
`,p(e,"class","list-item list-item-loader svelte-1ulbkf5")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function KI(n){let e,t,i;return{c(){e=v("span"),t=E(),i=v("span"),i.textContent="Backup/restore operation is in process",p(e,"class","loader loader-sm"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function JI(n){let e,t,i;return{c(){e=v("i"),t=E(),i=v("span"),i.textContent="Initialize new backup",p(e,"class","ri-play-circle-line"),p(i,"class","txt")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function ZI(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h;const g=[YI,WI],y=[];function S(D,I){return D[4]?0:1}i=S(n),s=y[i]=g[i](n);function $(D,I){return D[7]?JI:KI}let C=$(n),T=C(n),M={};f=new RI({props:M}),n[14](f),f.$on("submit",n[15]);let O={};return d=new UI({props:O}),n[16](d),{c(){e=v("div"),t=v("div"),s.c(),l=E(),o=v("div"),r=v("button"),T.c(),u=E(),B(f.$$.fragment),c=E(),B(d.$$.fragment),p(t,"class","list-content svelte-1ulbkf5"),p(r,"type","button"),p(r,"class","btn btn-block btn-transparent"),r.disabled=a=n[4]||!n[7],p(o,"class","list-item list-item-btn"),p(e,"class","list list-compact")},m(D,I){w(D,e,I),b(e,t),y[i].m(t,null),b(e,l),b(e,o),b(o,r),T.m(r,null),w(D,u,I),V(f,D,I),w(D,c,I),V(d,D,I),m=!0,_||(h=Y(r,"click",n[13]),_=!0)},p(D,[I]){let P=i;i=S(D),i===P?y[i].p(D,I):(ae(),L(y[P],1,1,()=>{y[P]=null}),ue(),s=y[i],s?s.p(D,I):(s=y[i]=g[i](D),s.c()),A(s,1),s.m(t,null)),C!==(C=$(D))&&(T.d(1),T=C(D),T&&(T.c(),T.m(r,null))),(!m||I&144&&a!==(a=D[4]||!D[7]))&&(r.disabled=a);const F={};f.$set(F);const R={};d.$set(R)},i(D){m||(A(s),A(f.$$.fragment,D),A(d.$$.fragment,D),m=!0)},o(D){L(s),L(f.$$.fragment,D),L(d.$$.fragment,D),m=!1},d(D){D&&k(e),y[i].d(),T.d(),D&&k(u),n[14](null),H(f,D),D&&k(c),n[16](null),H(d,D),_=!1,h()}}}function GI(n,e,t){let i,s,l=[],o=!1,r={},a={},u=!0;f(),_();async function f(){t(4,o=!0);try{t(3,l=await fe.backups.getFullList()),l.sort((M,O)=>M.modified<O.modified?1:M.modified>O.modified?-1:0),t(4,o=!1)}catch(M){M.isAbort||(fe.error(M),t(4,o=!1))}}async function c(M){if(!r[M]){t(5,r[M]=!0,r);try{const O=await fe.getAdminFileToken(),D=fe.backups.getDownloadUrl(O,M);z.download(D)}catch(O){O.isAbort||fe.error(O)}delete r[M],t(5,r)}}function d(M){hn(`Do you really want to delete ${M}?`,()=>m(M))}async function m(M){if(!a[M]){t(6,a[M]=!0,a);try{await fe.backups.delete(M),z.removeByKey(l,"name",M),f(),Ht(`Successfully deleted ${M}.`)}catch(O){O.isAbort||fe.error(O)}delete a[M],t(6,a)}}async function _(){var M;try{const O=await fe.health.check({$autoCancel:!1}),D=u;t(7,u=((M=O==null?void 0:O.data)==null?void 0:M.canBackup)||!1),D!=u&&u&&f()}catch{}}Xt(()=>{let M=setInterval(()=>{_()},3e3);return()=>{clearInterval(M)}});const h=M=>c(M.key),g=M=>s.show(M.key),y=M=>d(M.key),S=()=>i==null?void 0:i.show();function $(M){te[M?"unshift":"push"](()=>{i=M,t(1,i)})}const C=()=>{f()};function T(M){te[M?"unshift":"push"](()=>{s=M,t(2,s)})}return[f,i,s,l,o,r,a,u,c,d,h,g,y,S,$,C,T]}class XI extends ve{constructor(e){super(),be(this,e,GI,ZI,me,{loadBackups:0})}get loadBackups(){return this.$$.ctx[0]}}function QI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-down-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xI(n){let e;return{c(){e=v("i"),p(e,"class","ri-arrow-up-s-line")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function U_(n){var j,Z,X;let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O;t=new de({props:{class:"form-field form-field-toggle m-t-base m-b-0",$$slots:{default:[e8,({uniqueId:K})=>({32:K}),({uniqueId:K})=>[0,K?2:0]]},$$scope:{ctx:n}}});let D=n[2]&&W_(n);function I(K){n[25](K)}function P(K){n[26](K)}function F(K){n[27](K)}let R={toggleLabel:"Store backups in S3 storage",testFilesystem:"backups",configKey:"backups.s3",originalConfig:(j=n[0].backups)==null?void 0:j.s3};n[1].backups.s3!==void 0&&(R.config=n[1].backups.s3),n[7]!==void 0&&(R.isTesting=n[7]),n[8]!==void 0&&(R.testError=n[8]),r=new T1({props:R}),te.push(()=>ce(r,"config",I)),te.push(()=>ce(r,"isTesting",P)),te.push(()=>ce(r,"testError",F));let N=((X=(Z=n[1].backups)==null?void 0:Z.s3)==null?voi
|
||
|
UTC.</p>`,p(e,"for",i=n[32]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[32]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((M=(T=n[0])==null?void 0:T.backups)!=null&&M.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(y,"class","help-block")},m(T,M){var O,D;w(T,e,M),b(e,t),w(T,s,M),w(T,l,M),re(l,n[1].backups.cron),w(T,a,M),w(T,u,M),b(u,f),b(f,c),b(f,d),b(f,m),b(f,_),V(h,f,null),w(T,g,M),w(T,y,M),S=!0,(D=(O=n[0])==null?void 0:O.backups)!=null&&D.cron||l.focus(),$||(C=Y(l,"input",n[19]),$=!0)},p(T,M){var D,I;(!S||M[1]&2&&i!==(i=T[32]))&&p(e,"for",i),(!S||M[1]&2&&o!==(o=T[32]))&&p(l,"id",o),(!S||M[0]&1&&r!==(r=!((I=(D=T[0])==null?void 0:D.backups)!=null&&I.cron)))&&(l.autofocus=r),M[0]&2&&l.value!==T[1].backups.cron&&re(l,T[1].backups.cron);const O={};M[0]&2|M[1]&4&&(O.$$scope={dirty:M,ctx:T}),h.$set(O)},i(T){S||(A(h.$$.fragment,T),S=!0)},o(T){L(h.$$.fragment,T),S=!1},d(T){T&&k(e),T&&k(s),T&&k(l),T&&k(a),T&&k(u),H(h),T&&k(g),T&&k(y),$=!1,C()}}}function i8(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[32]),p(l,"type","number"),p(l,"id",o=n[32]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),re(l,n[1].backups.cronMaxKeep),r||(a=Y(l,"input",n[24]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&p(e,"for",i),f[1]&2&&o!==(o=u[32])&&p(l,"id",o),f[0]&2&&pt(l.value)!==u[1].backups.cronMaxKeep&&re(l,u[1].backups.cronMaxKeep)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function Y_(n){let e;function t(l,o){return l[7]?o8:l[8]?l8:s8}let i=t(n),s=i(n);return{c(){s.c(),e=ye()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function s8(n){let e;return{c(){e=v("div"),e.innerHTML=`<i class="ri-checkbox-circle-line txt-success"></i>
|
||
|
<span class="txt">S3 connected successfully</span>`,p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function l8(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>`,p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=$e(t=ze.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&jt(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function o8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function K_(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=Y(e,"click",n[28]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function r8(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,_,h,g,y,S,$,C,T,M,O,D,I;m=new Ko({props:{class:"btn-sm",tooltip:"Reload backups list"}}),m.$on("refresh",n[15]);let P={};h=new XI({props:P}),n[16](h);function F(j,Z){return j[6]?xI:QI}let R=F(n),N=R(n),q=n[6]&&!n[4]&&U_(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),B(m.$$.fragment),_=E(),B(h.$$.fragment),g=E(),y=v("hr"),S=E(),$=v("button"),C=v("span"),C.textContent="Backups options",T=E(),N.c(),M=E(),q&&q.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-5"),p(C,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(j,Z){w(j,e,Z),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(j,r,Z),w(j,a,Z),b(a,u),b(u,f),b(f,c),b(f,d),V(m,f,null),b(u,_),V(h,u,null),b(u,g),b(u,y),b(u,S),b(u,$),b($,C),b($,T),N.m($,null),b(u,M),q&&q.m(u,null),O=!0,D||(I=[Y($,"click",n[17]),Y(u,"submit",Qe(n[11]))],D=!0)},p(j,Z){(!O||Z[0]&1024)&&se(o,j[10]);const X={};h.$set(X),R!==(R=F(j))&&(N.d(1),N=R(j),N&&(N.c(),N.m($,null))),(!O||Z[0]&16)&&($.disabled=j[4]),(!O||Z[0]&16)&&Q($,"btn-loading",j[4]),j[6]&&!j[4]?q?(q.p(j,Z),Z[0]&80&&A(q,1)):(q=U_(j),q.c(),A(q,1),q.m(u,null)):q&&(ae(),L(q,1,1,()=>{q=null}),ue())},i(j){O||(A(m.$$.fragment,j),A(h.$$.fragment,j),A(q),O=!0)},o(j){L(m.$$.fragment,j),L(h.$$.fragment,j),L(q),O=!1},d(j){j&&k(e),j&&k(r),j&&k(a),H(m),n[16](null),H(h),N.d(),q&&q.d(),D=!1,Oe(I)}}}function a8(n){let e,t,i,s;return e=new Ci({}),i=new Sn({props:{$$slots:{default:[r8]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=E(),B(i.$$.fragment)},m(l,o){V(e,l,o),w(l,t,o),V(i,l,o),s=!0},p(l,o){const r={};o[0]&2047|o[1]&4&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){H(e,l),l&&k(t),H(i,l)}}}function u8(n,e,t){let i,s;Ke(n,Dt,J=>t(10,s=J)),ln(Dt,s="Backups",s);let l,o={},r={},a=!1,u=!1,f="",c=!1,d=!1,m=!1,_=null;h();async function h(){t(4,a=!0);try{const J=await fe.settings.getAll()||{};y(J)}catch(J){fe.error(J)}t(4,a=!1)}async function g(){if(!(u||!i)){t(5,u=!0);try{const J=await fe.settings.update(z.filterRedactedProps(r));await $(),y(J),Ht("Successfully saved application settings.")}catch(J){fe.error(J)}t(5,u=!1)}}function y(J={}){t(1,r={backups:(J==null?void 0:J.backups)||{}}),t(2,c=r.backups.cron!=""),t(0,o=JSON.parse(JSON.stringify(r)))}function S(){t(1,r=JSON.parse(JSON.stringify(o||{backups:{}}))),t(2,c=r.backups.cron!="")}async function $(){await(l==null?void 0:l.loadBackups())}const C=()=>$();function T(J){te[J?"unshift":"push"](()=>{l=J,t(3,l)})}const M=()=>t(6,d=!d);function O(){c=this.checked,t(2,c)}function D(){r.backups.cron=this.value,t(1,r),t(2,c)}const I=()=>{t(1,r.backups.cron="0 0 * * *",r)},P=()=>{t(1,r.backups.cron="0 0 * * 0",r)},F=()=>{t(1,r.backups.cron="0 0 * * 1,3",r)},R=()=>{t(1,r.backups.cron="0 0 1 * *",r)};function N(){r.backups.cronMaxKeep=pt(this.value),t(1,r),t(2,c)}functio
|
||
|
<span class="txt">Manage admins</span>`,t=E(),i=v("hr"),s=E(),l=v("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
|
||
|
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"type","button"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[$e(rn.call(null,e)),Y(l,"click",n[7])],o=!0)},p:x,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Oe(r)}}}function X_(n){let e,t,i;return t=new fu({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:z.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=v("div"),B(t.$$.fragment),p(e,"class","tinymce-preloader hidden")},m(s,l){w(s,e,l),V(t,e,null),i=!0},p:x,i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function T8(n){var g;let e,t,i,s,l,o,r,a,u,f,c,d,m;document.title=e=z.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((g=n[0])==null?void 0:g.id)&&n[1]&&G_(n);o=new u0({props:{routes:c8}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new v8({}),f=new C8({});let h=n[1]&&!n[2]&&X_(n);return{c(){t=E(),i=v("div"),_&&_.c(),s=E(),l=v("div"),B(o.$$.fragment),r=E(),B(a.$$.fragment),u=E(),B(f.$$.fragment),c=E(),h&&h.c(),d=ye(),p(l,"class","app-body"),p(i,"class","app-layout")},m(y,S){w(y,t,S),w(y,i,S),_&&_.m(i,null),b(i,s),b(i,l),V(o,l,null),b(l,r),V(a,l,null),w(y,u,S),V(f,y,S),w(y,c,S),h&&h.m(y,S),w(y,d,S),m=!0},p(y,[S]){var $;(!m||S&24)&&e!==(e=z.joinNonEmpty([y[4],y[3],"PocketBase"]," - "))&&(document.title=e),($=y[0])!=null&&$.id&&y[1]?_?(_.p(y,S),S&3&&A(_,1)):(_=G_(y),_.c(),A(_,1),_.m(i,s)):_&&(ae(),L(_,1,1,()=>{_=null}),ue()),y[1]&&!y[2]?h?(h.p(y,S),S&6&&A(h,1)):(h=X_(y),h.c(),A(h,1),h.m(d.parentNode,d)):h&&(ae(),L(h,1,1,()=>{h=null}),ue())},i(y){m||(A(_),A(o.$$.fragment,y),A(a.$$.fragment,y),A(f.$$.fragment,y),A(h),m=!0)},o(y){L(_),L(o.$$.fragment,y),L(a.$$.fragment,y),L(f.$$.fragment,y),L(h),m=!1},d(y){y&&k(t),y&&k(i),_&&_.d(),H(o),H(a),y&&k(u),H(f,y),y&&k(c),h&&h.d(y),y&&k(d)}}}function M8(n,e,t){let i,s,l,o;Ke(n,Ms,h=>t(10,i=h)),Ke(n,ko,h=>t(3,s=h)),Ke(n,Pa,h=>t(0,l=h)),Ke(n,Dt,h=>t(4,o=h));let r,a=!1,u=!1;function f(h){var g,y,S,$;((g=h==null?void 0:h.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((S=(y=h==null?void 0:h.detail)==null?void 0:y.userData)!=null&&S.showAppSidebar)),r=($=h==null?void 0:h.detail)==null?void 0:$.location,ln(Dt,o="",o),tn({}),v1())}function c(){qi("/")}async function d(){var h,g;if(l!=null&&l.id)try{const y=await fe.settings.getAll({$cancelKey:"initialAppSettings"});ln(ko,s=((h=y==null?void 0:y.meta)==null?void 0:h.appName)||"",s),ln(Ms,i=!!((g=y==null?void 0:y.meta)!=null&&g.hideControls),i)}catch(y){y!=null&&y.isAbort||console.warn("Failed to load app settings.",y)}}function m(){fe.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&d()},[l,a,u,s,o,f,c,m,_]}class O8 extends ve{constructor(e){super(),be(this,e,M8,T8,me,{})}}new O8({target:document.getElementById("app")});export{Oe as A,Ht as B,z as C,qi as D,ye as E,gb as F,mg as G,Xt as H,Ke as I,fi as J,Tt as K,te as L,g1 as M,bt as N,jo as O,ls as P,Ut as Q,ht as R,ve as S,qr as T,L as a,E as b,B as c,H as d,v as e,p as f,w as g,b as h,be as i,$e as j,ae as k,rn as l,V as m,ue as n,k as o,fe as p,de as q,Q as r,me as s,A as t,Y as u,Qe as v,U as w,se as x,x as y,re as z};
|