pocketbase/ui/dist/assets/index-d0922afb.js

201 lines
917 KiB
JavaScript
Raw Normal View History

2023-03-25 04:30:57 +08:00
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function Q(){}const Sl=n=>n;function Fe(n,e){for(const t in e)n[t]=e[t];return n}function cb(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function D_(n){return n()}function uu(){return Object.create(null)}function Ie(n){n.forEach(D_)}function Wt(n){return typeof n=="function"}function _e(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let jl;function Yn(n,e){return jl||(jl=document.createElement("a")),jl.href=e,n===jl.href}function db(n){return Object.keys(n).length===0}function E_(n,...e){if(n==null)return Q;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Ke(n,e,t){n.$$.on_destroy.push(E_(e,t))}function Pt(n,e,t,i){if(n){const s=A_(n,e,t,i);return n[0](s)}}function A_(n,e,t,i){return n[1]&&i?Fe(t.ctx.slice(),n[1](i(e))):t.ctx}function Lt(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 Nt(n,e,t,i,s,l){if(s){const o=A_(e,t,i,l);n.p(o,s)}}function Ft(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 Ht(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ge(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 Mi(n){return n??""}function Qt(n,e,t){return n.set(t),e}function Ee(n){return n&&Wt(n.destroy)?n.destroy:Q}function fu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const I_=typeof window<"u";let Ro=I_?()=>window.performance.now():()=>Date.now(),ma=I_?n=>requestAnimationFrame(n):Q;const vs=new Set;function P_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&ma(P_)}function qo(n){let e;return vs.size===0&&ma(P_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function v(n,e){n.appendChild(e)}function L_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function pb(n){const e=y("style");return mb(L_(n),e),e.sheet}function mb(n,e){return v(n.head||n,e),e.sheet}function $(n,e,t){n.insertBefore(e,t||null)}function S(n){n.parentNode&&n.parentNode.removeChild(n)}function ct(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function y(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function E(){return U(" ")}function Se(){return U("")}function J(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function pt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Cn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function h(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function ti(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:h(n,i,e[i])}function hb(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 gt(n){return n===""?null:+n}function _b(n){return Array.from(n.childNodes)}function le(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function ue(n,e){n.
2023-03-19 16:14:44 +08:00
`;for(let g=0;g<=1;g+=a){const k=e+(t-e)*l(g);u+=g*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
2023-03-25 04:30:57 +08:00
}`,d=`__svelte_${gb(f)}_${r}`,p=L_(n),{stylesheet:m,rules:_}=ho.get(p)||bb(p,n);_[d]||(_[d]=!0,m.insertRule(`@keyframes ${d} ${f}`,m.cssRules.length));const b=n.style.animation||"";return n.style.animation=`${b?`${b}, `:""}${d} ${i}ms linear ${s}ms 1 both`,_o+=1,d}function cl(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(", "),_o-=s,_o||vb())}function vb(){ma(()=>{_o||(ho.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&S(e)}),ho.clear())})}function yb(n,e,t,i){if(!e)return Q;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return Q;const{delay:l=0,duration:o=300,easing:r=Sl,start:a=Ro()+l,end:u=a+o,tick:f=Q,css:d}=t(n,{from:e,to:s},i);let p=!0,m=!1,_;function b(){d&&(_=fl(n,0,1,o,l,r,d)),l||(m=!0)}function g(){d&&cl(n,_),p=!1}return qo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),g()),!p)return!1;if(m){const w=k-a,T=0+1*r(w/o);f(T,1-T)}return!0}),b(),f(0,1),g}function kb(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,F_(n,s)}}function F_(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 dl;function fi(n){dl=n}function $l(){if(!dl)throw new Error("Function called outside component initialization");return dl}function en(n){$l().$$.on_mount.push(n)}function wb(n){$l().$$.after_update.push(n)}function R_(n){$l().$$.on_destroy.push(n)}function St(){const n=$l();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=N_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function de(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],se=[];let ys=[];const Rr=[],q_=Promise.resolve();let qr=!1;function j_(){qr||(qr=!0,q_.then(ha))}function an(){return j_(),q_}function xe(n){ys.push(n)}function we(n){Rr.push(n)}const nr=new Set;let ds=0;function ha(){if(ds!==0)return;const n=dl;do{try{for(;ds<bs.length;){const e=bs[ds];ds++,fi(e),Sb(e.$$)}}catch(e){throw bs.length=0,ds=0,e}for(fi(null),bs.length=0,ds=0;se.length;)se.pop()();for(let e=0;e<ys.length;e+=1){const t=ys[e];nr.has(t)||(nr.add(t),t())}ys.length=0}while(bs.length);for(;Rr.length;)Rr.pop()();qr=!1,nr.clear(),fi(n)}function Sb(n){if(n.fragment!==null){n.update(),Ie(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(xe)}}function $b(n){const e=[],t=[];ys.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let js;function _a(){return js||(js=Promise.resolve(),js.then(()=>{js=null})),js}function Xi(n,e,t){n.dispatchEvent(N_(`${e?"intro":"outro"}${t}`))}const ao=new Set;let Qn;function re(){Qn={r:0,c:[],p:Qn}}function ae(){Qn.r||Ie(Qn.c),Qn=Qn.p}function I(n,e){n&&n.i&&(ao.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(ao.has(n))return;ao.add(n),Qn.c.push(()=>{ao.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ga={duration:0};function Tb(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:p=0,duration:m=300,easing:_=Sl,tick:b=Q,css:g}=s||ga;g&&(o=fl(n,0,1,m,p,_,g,a++)),b(0,1);const k=Ro()+p,w=k+m;r&&r.abort(),l=!0,xe(()=>Xi(n,!0,"start")),r=qo(T=>{if(l){if(T>=w)return b(1,0),Xi(n,!0,"end"),u(),l=!1;if(T>=k){const C=_((T-k)/m);b(C,1-C)}}return l})}let d=!1;return{start(){d||(d=!0,cl(n),Wt(s)?(s=s(i),_a().then(f)):f())},invalidate(){d=!1},end(){l&&(u(),l=!1)}}}function Cb(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=Qn;r.r+=1;function a(){const{delay:u=0,duration:f=300,easing:d=Sl,tick:p=Q,css:m}=s||ga;m&&(o=fl(n,1,0,f,u,d,m));const _=Ro()+u,b=_+f;xe(()=>Xi(n,!1,"start")),qo(g=>{if(l){if(g>=b)return p(0,1),Xi(n,!1,"end"),--r.r||Ie(r.c),!1;if(g>=_){con
2023-03-21 21:55:42 +08:00
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+=`"${s.name}"`,s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+c.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
2023-03-24 04:59:02 +08:00
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=H.parseIndex(e);return i.tableName=t,H.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=H.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?H.buildIndex(s):e}}const Bo=jn([]);function Wg(n,e=4e3){return Uo(n,"info",e)}function Yt(n,e=3e3){return Uo(n,"success",e)}function ml(n,e=4500){return Uo(n,"error",e)}function xv(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(()=>{Yg(i)},t)};Bo.update(s=>(Ea(s,i.message),H.pushOrReplaceByKey(s,i,"message"),s))}function Yg(n){Bo.update(e=>(Ea(e,n),e))}function Da(){Bo.update(n=>{for(let e of n)Ea(n,e);return[]})}function Ea(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const ii=jn({});function gn(n){ii.set(n||{})}function mi(n){ii.update(e=>(H.deleteByPath(e,n),e))}const Aa=jn({});function Zr(n){Aa.set(n||{})}ya.prototype.logout=function(n=!0){this.authStore.clear(),n&&Ai("/login")};ya.prototype.errorResponseHandler=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{};if(e&&i!==404){let l=s.message||n.message||t;l&&ml(l)}if(H.isEmpty(s.data)||gn(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Ai("/")};class ey extends Y_{save(e,t){super.save(e,t),t instanceof ts&&Zr(t)}clear(){super.clear(),Zr(null)}}const me=new ya("../",new ey("pb_admin_auth"));me.authStore.model instanceof ts&&Zr(me.authStore.model);function ty(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=n[3].default,_=Pt(m,n,n[2],null);return{c(){e=y("div"),t=y("main"),_&&_.c(),i=E(),s=y("footer"),l=y("a"),l.innerHTML=`<i class="ri-book-open-line txt-sm"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Docs</span>`,o=E(),r=y("span"),r.textContent="|",a=E(),u=y("a"),f=y("span"),f.textContent="PocketBase v0.14.0",h(t,"class","page-content"),h(l,"href","https://pocketbase.io/docs/"),h(l,"target","_blank"),h(l,"rel","noopener noreferrer"),h(r,"class","delimiter"),h(f,"class","txt"),h(u,"href","https://github.com/pocketbase/pocketbase/releases"),h(u,"target","_blank"),h(u,"rel","noopener noreferrer"),h(u,"title","Releases"),h(s,"class","page-footer"),h(e,"class",d="page-wrapper "+n[1]),x(e,"center-content",n[0])},m(b,g){$(b,e,g),v(e,t),_&&_.m(t,null),v(e,i),v(e,s),v(s,l),v(s,o),v(s,r),v(s,a),v(s,u),v(u,f),p=!0},p(b,[g]){_&&_.p&&(!p||g&4)&&Nt(_,m,b,b[2],p?Lt(m,b[2],g,null):Ft(b[2]),null),(!p||g&2&&d!==(d="page-wrapper "+b[1]))&&h(e,"class",d),(!p||g&3)&&x(e,"center-content",b[0])},i(b){p||(I(_,b),p=!0)},o(b){P(_,b),p=!1},d(b){b&&S(e),_&&_.d(b)}}}function ny(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 Mn extends ve{constructor(e){super(),be(this,e,ny,ty,_e,{center:0,class:1})}}function Uu(n){let e,t,i;return{c(){e=y("div"),e.innerHTML=`<figure class="logo"><img src="./images/logo.svg" alt="PocketBase logo" width="40" height="40"/>
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=E(),i=y("div"),h(e,"class","block txt-center m-b-lg"),h(i,"class","clearfix")},m(s,l){$(s,e,l),$(s,t,l),$(s,i,l)},d(s){s&&S(e),s&&S(t),s&&S(i)}}}function iy(n){let e,t,i,s=!n[0]&&Uu();const l=n[1].default,o=Pt(l,n,n[2],null);return{c(){e=y("div"),s&&s.c(),t=E(),o&&o.c(),h(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){$(r,e,a),s&&s.m(e,null),v(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Uu(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Nt(o,l,r,r[2],i?Lt(l,r[2],a,null):Ft(r[2]),null)},i(r){i||(I(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&S(e),s&&s.d(),o&&o.d(r)}}}function sy(n){let e,t;return e=new Mn({props:{class:"full-page",center:!0,$$slots:{default:[iy]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&5&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ly(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 Kg extends ve{constructor(e){super(),be(this,e,ly,sy,_e,{nobranding:0})}}function Wo(n){const e=n-1;return e*e*e+1}function yo(n,{delay:e=0,duration:t=400,easing:i=Sl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function ni(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),[d,p]=fu(s),[m,_]=fu(l);return{delay:e,duration:t,easing:i,css:(b,g)=>`
2023-03-19 16:14:44 +08:00
transform: ${u} translate(${(1-b)*d}${p}, ${(1-b)*m}${_});
2023-03-24 04:59:02 +08:00
opacity: ${a-f*g}`}}function wt(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(k=>`${k[0].toUpperCase()}${k.slice(1)}`),d=parseFloat(l[`padding${f[0]}`]),p=parseFloat(l[`padding${f[1]}`]),m=parseFloat(l[`margin${f[0]}`]),_=parseFloat(l[`margin${f[1]}`]),b=parseFloat(l[`border${f[0]}Width`]),g=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*d}px;padding-${u[1]}: ${k*p}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*_}px;border-${u[0]}-width: ${k*b}px;border-${u[1]}-width: ${k*g}px;`}}function Et(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:(d,p)=>`
2023-03-19 16:14:44 +08:00
transform: ${a} scale(${1-u*p});
opacity: ${r-f*p}
2023-03-25 04:30:57 +08:00
`}}let Gr,zi;const Xr="app-tooltip";function Wu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ti(){return zi=zi||document.querySelector("."+Xr),zi||(zi=document.createElement("div"),zi.classList.add(Xr),document.body.appendChild(zi)),zi}function Jg(n,e){let t=Ti();if(!t.classList.contains("active")||!(e!=null&&e.text)){Qr();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 Qr(){clearTimeout(Gr),Ti().classList.remove("active"),Ti().activeNode=void 0}function oy(n,e){Ti().activeNode=n,clearTimeout(Gr),Gr=setTimeout(()=>{Ti().classList.add("active"),Jg(n,e)},isNaN(e.delay)?0:e.delay)}function Ue(n,e){let t=Wu(e);function i(){oy(n,t)}function s(){Qr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",s),Ti(),{update(l){var o,r;t=Wu(l),(r=(o=Ti())==null?void 0:o.activeNode)!=null&&r.contains(n)&&Jg(n,t)},destroy(){var l,o;(o=(l=Ti())==null?void 0:l.activeNode)!=null&&o.contains(n)&&Qr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Yu(n,e,t){const i=n.slice();return i[12]=e[t],i}const ry=n=>({}),Ku=n=>({uniqueId:n[4]});function ay(n){let e,t,i=n[3],s=[];for(let o=0;o<i.length;o+=1)s[o]=Ju(Yu(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);$(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=Yu(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=Ju(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ct(s,o),o&&S(e)}}}function uy(n){let e,t,i,s,l,o,r;return{c(){e=y("div"),t=y("i"),h(t,"class","ri-error-warning-fill txt-danger"),h(e,"class","form-field-addon")},m(a,u){$(a,e,u),v(e,t),l=!0,o||(r=Ee(i=Ue.call(null,t,{position:"left",text:n[3].map(ko).join(`
`)})),o=!0)},p(a,u){i&&Wt(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(ko).join(`
2023-03-25 04:30:57 +08:00
`)})},i(a){l||(a&&xe(()=>{l&&(s||(s=Ve(t,Et,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=Ve(t,Et,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&S(e),a&&s&&s.end(),o=!1,r()}}}function Ju(n){let e,t,i=ko(n[12])+"",s,l,o,r;return{c(){e=y("div"),t=y("pre"),s=U(i),l=E(),h(e,"class","help-block help-block-error")},m(a,u){$(a,e,u),v(e,t),v(t,s),v(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=ko(a[12])+"")&&le(s,i)},i(a){r||(a&&xe(()=>{r&&(o||(o=Ve(e,wt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Ve(e,wt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&S(e),a&&o&&o.end()}}}function fy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Pt(a,n,n[8],Ku),f=[uy,ay],d=[];function p(m,_){return m[0]&&m[3].length?0:1}return i=p(n),s=d[i]=f[i](n),{c(){e=y("div"),u&&u.c(),t=E(),s.c(),h(e,"class",n[1]),x(e,"error",n[3].length)},m(m,_){$(m,e,_),u&&u.m(e,null),v(e,t),d[i].m(e,null),n[11](e),l=!0,o||(r=J(e,"click",n[10]),o=!0)},p(m,[_]){u&&u.p&&(!l||_&256)&&Nt(u,a,m,m[8],l?Lt(a,m[8],_,ry):Ft(m[8]),Ku);let b=i;i=p(m),i===b?d[i].p(m,_):(re(),P(d[b],1,1,()=>{d[b]=null}),ae(),s=d[i],s?s.p(m,_):(s=d[i]=f[i](m),s.c()),I(s,1),s.m(e,null)),(!l||_&2)&&h(e,"class",m[1]),(!l||_&10)&&x(e,"error",m[3].length)},i(m){l||(I(u,m),I(s),l=!0)},o(m){P(u,m),P(s),l=!1},d(m){m&&S(e),u&&u.d(m),d[i].d(),n[11](null),o=!1,r()}}}const Zu="Invalid value";function ko(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Zu:n||Zu}function cy(n,e,t){let i;Ke(n,ii,b=>t(7,i=b));let{$$slots:s={},$$scope:l}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,d=[];function p(){mi(r)}en(()=>(f.addEventListener("input",p),f.addEventListener("change",p),()=>{f.removeEventListener("input",p),f.removeEventListener("change",p)}));function m(b){de.call(this,n,b)}function _(b){se[b?"unshift":"push"](()=>{f=b,t(2,f)})}return n.$$set=b=>{"name"in b&&t(5,r=b.name),"inlineError"in b&&t(0,a=b.inlineError),"class"in b&&t(1,u=b.class),"$$scope"in b&&t(8,l=b.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,d=H.toArray(H.getNestedVal(i,r)))},[a,u,f,d,o,r,p,i,l,s,m,_]}class pe extends ve{constructor(e){super(),be(this,e,cy,fy,_e,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function dy(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","email"),h(l,"autocomplete","off"),h(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function py(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Minimum 10 characters.",h(e,"for",i=n[9]),h(l,"type","password"),h(l,"autocomplete","new-password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0,h(a,"class","help-block")},m(d,p){$(d,e,p),v(e,t),$(d,s,p),$(d,l,p),ue(l,n[1]),$(d,r,p),$(d,a,p),u||(f=J(l,"input",n[6]),u=!0)},p(d,p){p&512&&i!==(i=d[9])&&h(e,"for",i),p&512&&o!==(o=d[9])&&h(l,"id",o),p&2&&l.value!==d[1]&&ue(l,d[1])},d(d){d&&S(e),d&&S(s),d&&S(l),d&&S(r),d&&S(a),u=!1,f()}}}function my(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Password confirm"),s=E(),l=y("input"),h(e,"for",i=n[9]),h(l,"type","password"),h(l,"minlength","10"),h(l,"id",o=n[9]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[2]),r||(a=J(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&h(e,"for",i),f&512&&o!==(o=u[9])&&h(l,"id",o),f&4&&l.value!==u[2]&&ue(l,u[2])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function hy(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[dy,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[py,({uniqueId:_})=>({9:_}),({uniqueId:_})=>_?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:
2023-03-27 00:19:44 +08:00
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(f,"type","submit"),h(f,"class","btn btn-lg btn-block btn-next"),x(f,"btn-disabled",n[3]),x(f,"btn-loading",n[3]),h(e,"class","block"),h(e,"autocomplete","off")},m(_,b){$(_,e,b),v(e,t),v(e,i),j(s,e,null),v(e,l),j(o,e,null),v(e,r),j(a,e,null),v(e,u),v(e,f),d=!0,p||(m=J(e,"submit",pt(n[4])),p=!0)},p(_,[b]){const g={};b&1537&&(g.$$scope={dirty:b,ctx:_}),s.$set(g);const k={};b&1538&&(k.$$scope={dirty:b,ctx:_}),o.$set(k);const w={};b&1540&&(w.$$scope={dirty:b,ctx:_}),a.$set(w),(!d||b&8)&&x(f,"btn-disabled",_[3]),(!d||b&8)&&x(f,"btn-loading",_[3])},i(_){d||(I(s.$$.fragment,_),I(o.$$.fragment,_),I(a.$$.fragment,_),d=!0)},o(_){P(s.$$.fragment,_),P(o.$$.fragment,_),P(a.$$.fragment,_),d=!1},d(_){_&&S(e),V(s),V(o),V(a),p=!1,m()}}}function _y(n,e,t){const i=St();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await me.admins.create({email:s,password:l,passwordConfirm:o}),await me.admins.authWithPassword(s,l),i("submit")}catch(p){me.errorResponseHandler(p)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function d(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,d]}class gy extends ve{constructor(e){super(),be(this,e,_y,hy,_e,{})}}function Gu(n){let e,t;return e=new Kg({props:{$$slots:{default:[by]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function by(n){let e,t;return e=new gy({}),e.$on("submit",n[1]),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:Q,i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function vy(n){let e,t,i=n[0]&&Gu(n);return{c(){i&&i.c(),e=Se()},m(s,l){i&&i.m(s,l),$(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&I(i,1)):(i=Gu(s),i.c(),I(i,1),i.m(e.parentNode,e)):i&&(re(),P(i,1,1,()=>{i=null}),ae())},i(s){t||(I(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&S(e)}}}function yy(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){me.logout(!1),t(0,i=!0);return}me.authStore.isValid?Ai("/collections"):me.logout()}return[i,async()=>{t(0,i=!1),await an(),window.location.search=""}]}class ky extends ve{constructor(e){super(),be(this,e,yy,vy,_e,{})}}const At=jn(""),wo=jn(""),Ms=jn(!1);function wy(n){let e,t,i,s;return{c(){e=y("input"),h(e,"type","text"),h(e,"id",n[8]),h(e,"placeholder",t=n[0]||n[1])},m(l,o){$(l,e,o),n[13](e),ue(e,n[7]),i||(s=J(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&h(e,"placeholder",t),o&128&&e.value!==l[7]&&ue(e,l[7])},i:Q,o:Q,d(l){l&&S(e),n[13](null),i=!1,s()}}}function Sy(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=Ot(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("submit",n[10])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),$(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],we(()=>t=!1)),u&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("submit",a[10]),z(e.$$.fragment),I(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&V(e,a)}}}function Xu(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Search</span>',h(e,"type","submit"),h(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){$(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=Ve(e,ni,{duration:150,x:5},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,ni,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&S(e),s&&t&&t.end()}}}function Qu(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"
2023-03-25 04:30:57 +08:00
<span class="txt">Method</span>`,h(e,"class","col-header-content")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function jy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="URL",h(t,"class",H.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function Vy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Referer",h(t,"class",H.getFieldTypeIcon("url")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function Hy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="User IP",h(t,"class",H.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function zy(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Status",h(t,"class",H.getFieldTypeIcon("number")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function By(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="Created",h(t,"class",H.getFieldTypeIcon("date")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function nf(n){let e;function t(l,o){return l[6]?Wy:Uy}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function Uy(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&sf(n);return{c(){e=y("tr"),t=y("td"),i=y("h6"),i.textContent="No logs found.",s=E(),o&&o.c(),l=E(),h(t,"colspan","99"),h(t,"class","txt-center txt-hint p-xs")},m(a,u){$(a,e,u),v(e,t),v(t,i),v(t,s),o&&o.m(t,null),v(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=sf(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&S(e),o&&o.d()}}}function Wy(n){let e;return{c(){e=y("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader m-0"></span></td>
`},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function sf(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[19]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function lf(n){let e;return{c(){e=y("i"),h(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),h(e,"title","Error")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function of(n,e){var Ce,Je,ht;let t,i,s,l=((Ce=e[23].method)==null?void 0:Ce.toUpperCase())+"",o,r,a,u,f,d=e[23].url+"",p,m,_,b,g,k,w=(e[23].referer||"N/A")+"",T,C,M,O,D,A=(e[23].userIp||"N/A")+"",L,N,R,F,q,B=e[23].status+"",Y,Z,ee,ie,X,fe,G,ce,he,Me,je=(((Je=e[23].meta)==null?void 0:Je.errorMessage)||((ht=e[23].meta)==null?void 0:ht.errorData))&&lf();ie=new hi({props:{date:e[23].created}});function He(){return e[17](e[23])}function ke(...Ze){return e[18](e[23],...Ze)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("span"),o=U(l),a=E(),u=y("td"),f=y("span"),p=U(d),_=E(),je&&je.c(),b=E(),g=y("td"),k=y("span"),T=U(w),M=E(),O=y("td"),D=y("span"),L=U(A),R=E(),F=y("td"),q=y("span"),Y=U(B),Z=E(),ee=y("td"),z(ie.$$.fragment),X=E(),fe=y("td"),fe.innerHTML='<i class="ri-arrow-right-line"></i>',G=E(),h(s,"class",r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]),h(i,"class","col-type-text col-field-method min-width"),h(f,"class","txt txt-ellipsis"),h(f,"title",m=e[23].url),h(u,"class","col-type-text col-field-url"),h(k,"class","txt txt-ellipsis"),h(k,"title",C=e[23].referer),x(k,"txt-hint",!e[23].referer),h(g,"class","col-type-text col-field-referer"),h(D,"class","txt txt-ellipsis"),h(D,"title",N=e[23].userIp),x(D,"txt-hint",!e[23].userIp),h(O,"class","col-type-number col-field-userIp"),h(q,"class","label"),x(q,"label-danger",e[23].status>=400),h(F,"class","col-type-number col-field-status"),h(ee,"class","col-type-date col-field-created"),h(fe,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(Ze,We){$(Ze,t,We),v(t,i),v(i,s),v(s,o),v(t,a),v(t,u),v(u,f),v(f,p),v(u,_),je&&je.m(u,null),v(t,b),v(t,g),v(g,k),v(k,T),v(t,M),v(t,O),v(O,D),v(D,L),v(t,R),v(t,F),v(F,q),v(q,Y),v(t,Z),v(t,ee),j(ie,ee,null),v(t,X),v(t,fe),v(t,G),ce=!0,he||(Me=[J(t,"click",He),J(t,"keydown",ke)],he=!0)},p(Ze,We){var qe,tt,Kt;e=Ze,(!ce||We&8)&&l!==(l=((qe=e[23].method)==null?void 0:qe.toUpperCase())+"")&&le(o,l),(!ce||We&8&&r!==(r="label txt-uppercase "+e[9][e[23].method.toLowerCase()]))&&h(s,"class",r),(!ce||We&8)&&d!==(d=e[23].url+"")&&le(p,d),(!ce||We&8&&m!==(m=e[23].url))&&h(f,"title",m),(tt=e[23].meta)!=null&&tt.errorMessage||(Kt=e[23].meta)!=null&&Kt.errorData?je||(je=lf(),je.c(),je.m(u,null)):je&&(je.d(1),je=null),(!ce||We&8)&&w!==(w=(e[23].referer||"N/A")+"")&&le(T,w),(!ce||We&8&&C!==(C=e[23].referer))&&h(k,"title",C),(!ce||We&8)&&x(k,"txt-hint",!e[23].referer),(!ce||We&8)&&A!==(A=(e[23].userIp||"N/A")+"")&&le(L,A),(!ce||We&8&&N!==(N=e[23].userIp))&&h(D,"title",N),(!ce||We&8)&&x(D,"txt-hint",!e[23].userIp),(!ce||We&8)&&B!==(B=e[23].status+"")&&le(Y,B),(!ce||We&8)&&x(q,"label-danger",e[23].status>=400);const te={};We&8&&(te.date=e[23].created),ie.$set(te)},i(Ze){ce||(I(ie.$$.fragment,Ze),ce=!0)},o(Ze){P(ie.$$.fragment,Ze),ce=!1},d(Ze){Ze&&S(t),je&&je.d(),V(ie),he=!1,Ie(Me)}}}function Yy(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M,O,D,A,L=[],N=new Map,R;function F(ke){n[11](ke)}let q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[qy]},$$scope:{ctx:n}};n[1]!==void 0&&(q.sort=n[1]),s=new Gt({props:q}),se.push(()=>ge(s,"sort",F));function B(ke){n[12](ke)}let Y={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[jy]},$$scope:{ctx:n}};n[1]!==void 0&&(Y.sort=n[1]),r=new Gt({props:Y}),se.push(()=>ge(r,"sort",B));function Z(ke){n[13](ke)}let ee={disable:!0,class:"col-type-text col-field-referer",name:"referer",$$slots:{default:[Vy]},$$scope:{ctx:n}};n[1]!==void 0&&(ee.sort=n[1]),f=new Gt({props:ee}),se.push(()=>ge(f,"sort",Z));function ie(ke){n[14](ke)}let X={disable:!0,class:"col-type-number col-fie
2023-03-19 16:14:44 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-03-25 04:30:57 +08:00
*/function oi(){}const Gy=function(){let n=0;return function(){return n++}}();function dt(n){return n===null||typeof n>"u"}function yt(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 Qe(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Rt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function An(n,e){return Rt(n)?n:e}function st(n,e){return typeof n>"u"?e:n}const Xy=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Zg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function Ct(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(yt(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(Qe(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function So(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 $o(n){if(yt(n))return n.map($o);if(Qe(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=$o(n[t[s]]);return e}return n}function Gg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function Qy(n,e,t,i){if(!Gg(n))return;const s=e[n],l=t[n];Qe(s)&&Qe(l)?hl(s,l,i):e[n]=$o(l)}function hl(n,e,t){const i=yt(e)?e:[e],s=i.length;if(!Qe(n))return n;t=t||{};const l=t.merger||Qy;for(let o=0;o<s;++o){if(e=i[o],!Qe(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 il(n,e){return hl(n,e,{merger:xy})}function xy(n,e,t){if(!Gg(n))return;const i=e[n],s=t[n];Qe(i)&&Qe(s)?il(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=$o(s))}const uf={"":n=>n,x:n=>n.x,y:n=>n.y};function Oi(n,e){return(uf[e]||(uf[e]=e2(e)))(n)}function e2(n){const e=t2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function t2(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 La(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Rn=n=>typeof n<"u",Di=n=>typeof n=="function",ff=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function n2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const It=Math.PI,_t=2*It,i2=_t+It,To=Number.POSITIVE_INFINITY,s2=It/180,Mt=It/2,Us=It/4,cf=It*2/3,Nn=Math.log10,ei=Math.sign;function df(n){const e=Math.round(n);n=sl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Nn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function l2(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 sl(n,e,t){return Math.abs(n-e)<t}function o2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Xg(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 Wn(n){return n*(It/180)}function Na(n){return n*(180/It)}function pf(n){if(!Rt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Qg(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*It&&(l+=_t),{angle:l,distance:s}}function xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function r2(n,e){return(n-e+i2)%_t-It}function Sn(n){return(n%_t+_t)%_t}function _l(n,e,t,i){const s=Sn(n),l=Sn(e),o=Sn(t),r=Sn(l-s),a=Sn(o-s),u=Sn(s-l),f=Sn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function Xt(n,e,t){return Math.max(e,Math.min(t,n))}function a2(n){return Xt(n,-32768,32767)}function gl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Fa(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 Gi=(n,e,t,i)=>Fa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),u2=(n,e,t)=>Fa(n,t,i=>n[i][e]>=t);function f2(n,e,
2023-03-19 16:14:44 +08:00
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
2023-03-25 04:30:57 +08:00
*/function Al(n){return n+.5|0}const wi=(n,e,t)=>Math.max(Math.min(n,t),e);function xs(n){return wi(Al(n*2.55),0,255)}function Ci(n){return wi(Al(n*255),0,255)}function ui(n){return wi(Al(n/2.55)/100,0,1)}function bf(n){return wi(Al(n*100),0,100)}const En={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},ea=[..."0123456789ABCDEF"],m2=n=>ea[n&15],h2=n=>ea[(n&240)>>4]+ea[n&15],Kl=n=>(n&240)>>4===(n&15),_2=n=>Kl(n.r)&&Kl(n.g)&&Kl(n.b)&&Kl(n.a);function g2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&En[n[1]]*17,g:255&En[n[2]]*17,b:255&En[n[3]]*17,a:e===5?En[n[4]]*17:255}:(e===7||e===9)&&(t={r:En[n[1]]<<4|En[n[2]],g:En[n[3]]<<4|En[n[4]],b:En[n[5]]<<4|En[n[6]],a:e===9?En[n[7]]<<4|En[n[8]]:255})),t}const b2=(n,e)=>n<255?e(n):"";function v2(n){var e=_2(n)?m2:h2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+b2(n.a,e):void 0}const y2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function l1(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 k2(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 w2(n,e,t){const i=l1(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 Ra(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 qa(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ci)}function ja(n,e,t){return qa(l1,n,e,t)}function $2(n,e,t){return qa(w2,n,e,t)}function T2(n,e,t){return qa(k2,n,e,t)}function o1(n){return(n%360+360)%360}function C2(n){const e=y2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?xs(+e[5]):Ci(+e[5]));const s=o1(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=$2(s,l,o):e[1]==="hsv"?i=T2(s,l,o):i=ja(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function M2(n,e){var t=Ra(n);t[0]=o1(t[0]+e),t=ja(t),n.r=t[0],n.g=t[1],n.b=t[2]}function O2(n){if(!n)return;const e=Ra(n),t=e[0],i=bf(e[1]),s=bf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${ui(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const vf={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"},yf={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:"
2023-03-19 16:14:44 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-03-25 04:30:57 +08:00
*/class Ak{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=t1.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 ri=new Ak;const If="transparent",Ik={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=wf(n||If),s=i.valid&&wf(e||If);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Pk{constructor(e,t,i,s){const l=t[i];s=Gl([e.to,s,l,e.from]);const o=Gl([e.from,l,s]);this._active=!0,this._fn=e.fn||Ik[e.type||typeof o],this._easing=ll[e.easing]||ll.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Gl([e.to,t,s,e.from]),this._from=Gl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const Lk=["x","y","borderWidth","radius","tension"],Nk=["color","borderColor","backgroundColor"];lt.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 Fk=Object.keys(lt.animation);lt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});lt.set("animations",{colors:{type:"color",properties:Nk},numbers:{type:"number",properties:Lk}});lt.describe("animations",{_fallback:"animation"});lt.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 k1{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!Qe(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!Qe(s))return;const l={};for(con
2023-03-19 16:14:44 +08:00
`)>-1?n.split(`
2023-03-25 04:30:57 +08:00
`):n}function Q3(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 uc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$n(e.bodyFont),u=$n(e.titleFont),f=$n(e.footerFont),d=l.length,p=s.length,m=i.length,_=qn(e.padding);let b=_.height,g=0,k=i.reduce((C,M)=>C+M.before.length+M.lines.length+M.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,d&&(b+=d*u.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),k){const C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;b+=m*C+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}p&&(b+=e.footerMarginTop+p*f.lineHeight+(p-1)*e.footerSpacing);let w=0;const T=function(C){g=Math.max(g,t.measureText(C).width+w)};return t.save(),t.font=u.string,mt(n.title,T),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),T),w=e.displayColors?o+2+e.boxPadding:0,mt(i,C=>{mt(C.before,T),mt(C.lines,T),mt(C.after,T)}),w=0,t.font=f.string,mt(n.footer,T),t.restore(),g+=_.width,{width:g,height:b}}function x3(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function eS(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 tS(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"),eS(u,n,e,t)&&(u="center"),u}function fc(n,e,t){const i=t.yAlign||e.yAlign||x3(n,t);return{xAlign:t.xAlign||e.xAlign||tS(n,e,t,i),yAlign:i}}function nS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function iS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function cc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:d,bottomLeft:p,bottomRight:m}=ws(o);let _=nS(e,r);const b=iS(e,a,u);return a==="center"?r==="left"?_+=u:r==="right"&&(_-=u):r==="left"?_-=Math.max(f,p)+s:r==="right"&&(_+=Math.max(d,m)+s),{x:Xt(_,0,i.width-e.width),y:Xt(b,0,i.height-e.height)}}function io(n,e,t){const i=qn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function dc(n){return Xn([],ai(n))}function sS(n,e,t){return Ii(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function pc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class ua extends _i{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 k1(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=sS(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=Xn(r,ai(s)),r=Xn(r,ai(l)),r=Xn(r,ai(o)),r}getBeforeBody(e,t){return dc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=pc(i,l);Xn(o.before,ai(r.beforeLabel.call(this,l))
2023-03-19 16:14:44 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
2023-03-25 04:30:57 +08:00
*/const TS={datetime:ze.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:ze.TIME_WITH_SECONDS,minute:ze.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};C1._date.override({_id:"luxon",_create:function(n){return ze.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return TS},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=ze.fromFormat(n,e,t):n=ze.fromISO(n,t):n instanceof Date?n=ze.fromJSDate(n,t):i==="object"&&!(n instanceof ze)&&(n=ze.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 kc(n){let e,t,i;return{c(){e=y("div"),h(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){$(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=Ve(e,Et,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,Et,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&S(e),s&&t&&t.end()}}}function CS(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){$(l,e,o),$(l,t,o),$(l,s,o)},p(l,o){o&2&&le(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&le(s,i)},d(l){l&&S(e),l&&S(t),l&&S(s)}}}function MS(n){let e;return{c(){e=U("Loading...")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function OS(n){let e,t,i,s,l,o=n[2]&&kc();function r(f,d){return f[2]?MS:CS}let a=r(n),u=a(n);return{c(){e=y("div"),o&&o.c(),t=E(),i=y("canvas"),s=E(),l=y("div"),u.c(),h(i,"class","chart-canvas svelte-vh4sl8"),Fr(i,"height","250px"),Fr(i,"width","100%"),h(e,"class","chart-wrapper svelte-vh4sl8"),x(e,"loading",n[2]),h(l,"class","txt-hint m-t-xs txt-right")},m(f,d){$(f,e,d),o&&o.m(e,null),v(e,t),v(e,i),n[8](i),$(f,s,d),$(f,l,d),u.m(l,null)},p(f,[d]){f[2]?o?d&4&&I(o,1):(o=kc(),o.c(),I(o,1),o.m(e,t)):o&&(re(),P(o,1,1,()=>{o=null}),ae()),d&4&&x(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,d):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){I(o)},o(f){P(o)},d(f){f&&S(e),o&&o.d(),n[8](null),f&&S(s),f&&S(l),u.d()}}}function DS(n,e,t){let{filter:i=""}=e,{presets:s=""}=e,l,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),me.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(m=>{d();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||(d(),console.warn(m),me.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function d(){t(1,a=0),t(7,r=[])}en(()=>(Po.register(Pi,Go,Jo,tu,Nl,X3,lS),t(6,o=new Po(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 p(m){se[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
2023-03-19 16:14:44 +08:00
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
2023-03-25 04:30:57 +08:00
*/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 w(T){return T instanceof a?new a(T.type,w(T.content),T.alias):Array.isArray(T)?T.map(w):T.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(w){return Object.prototype.toString.call(w).slice(8,-1)},objId:function(w){return w.__id||Object.defineProperty(w,"__id",{value:++l}),w.__id},clone:function w(T,C){C=C||{};var M,O;switch(r.util.type(T)){case"Object":if(O=r.util.objId(T),C[O])return C[O];M={},C[O]=M;for(var D in T)T.hasOwnProperty(D)&&(M[D]=w(T[D],C));return M;case"Array":return O=r.util.objId(T),C[O]?C[O]:(M=[],C[O]=M,T.forEach(function(A,L){M[L]=w(A,C)}),M);default:return T}},getLanguage:function(w){for(;w;){var T=s.exec(w.className);if(T)return T[1].toLowerCase();w=w.parentElement}return"none"},setLanguage:function(w,T){w.className=w.className.replace(RegExp(s,"gi"),""),w.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var w=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(w){var T=document.getElementsByTagName("script");for(var C in T)if(T[C].src==w)return T[C]}return null}},isActive:function(w,T,C){for(var M="no-"+T;w;){var O=w.classList;if(O.contains(T))return!0;if(O.contains(M))return!1;w=w.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(w,T){var C=r.util.clone(r.languages[w]);for(var M in T)C[M]=T[M];return C},insertBefore:function(w,T,C,M){M=M||r.languages;var O=M[w],D={};for(var A in O)if(O.hasOwnProperty(A)){if(A==T)for(var L in C)C.hasOwnProperty(L)&&(D[L]=C[L]);C.hasOwnProperty(A)||(D[A]=O[A])}var N=M[w];return M[w]=D,r.languages.DFS(r.languages,function(R,F){F===N&&R!=w&&(this[R]=D)}),D},DFS:function w(T,C,M,O){O=O||{};var D=r.util.objId;for(var A in T)if(T.hasOwnProperty(A)){C.call(T,A,T[A],M||A);var L=T[A],N=r.util.type(L);N==="Object"&&!O[D(L)]?(O[D(L)]=!0,w(L,C,null,O)):N==="Array"&&!O[D(L)]&&(O[D(L)]=!0,w(L,C,A,O))}}},plugins:{},highlightAll:function(w,T){r.highlightAllUnder(document,w,T)},highlightAllUnder:function(w,T,C){var M={callback:C,container:w,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var O=0,D;D=M.elements[O++];)r.highlightElement(D,T===!0,M.callback)},highlightElement:function(w,T,C){var M=r.util.getLanguage(w),O=r.languages[M];r.util.setLanguage(w,M);var D=w.parentElement;D&&D.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(D,M);var A=w.textContent,L={element:w,language:M,grammar:O,code:A};function N(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),C&&C.call(L.element)}if(r.hooks.run("before-sanity-check",L),D=L.element.parentElement,D&&D.nodeName.toLowerCase()==="pre"&&!D.hasAttribute("tabindex")&&D.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),C&&C.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){N(r.util.encode(L.code));return}if(T&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(F){N(F.data)},R.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else N(r.highlight(L.code,L.grammar,L.language))},highlight:function(w,T,C){var M={code:w,grammar:T,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(w,T){var C=T.rest;if(C){for(var M in C)T[M]=C[M];delete T.rest}var O=new d;return p(O,O.head,w),f(w,O,T,O.head,0),_(O)},hooks:{all:{},add:function
`),g.hasAttribute("data-start")||g.setAttribute("data-start",String(L+1))}k.textContent=O,t.highlightElement(k)},function(O){g.setAttribute(r,f),k.textContent=O})}}),t.plugins.fileHighlight={highlight:function(g){for(var k=(g||document).querySelectorAll(d),w=0,T;T=k[w++];)t.highlightElement(T)}};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)}}()})(AS);const Gs=da;var Sc={},IS={get exports(){return Sc},set exports(n){Sc=n}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
2023-03-19 16:14:44 +08:00
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),d=0,p=0;p<f.length;++p){var m=s(f[p]);d+=m,d>r&&(f[p]=`
`+f[p],d=m)}a[u]=f.join("")}return a.join(`
2023-03-27 00:19:44 +08:00
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var d=JSON.parse(a.getAttribute("data-"+u)||"true");typeof d===f&&(o.settings[u]=d)}catch{}}for(var p=a.childNodes,m="",_="",b=!1,g=0;g<p.length;++g){var k=p[g];k==o.element?b=!0:k.nodeName==="#text"&&(b?_+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--g)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+_,o.code=r.normalize(o.code,o.settings);else{var w=m+o.element.innerHTML+_;o.element.innerHTML=r.normalize(w,o.settings),o.code=o.element.textContent}}}})})()})(IS);(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 PS(n){let e,t,i;return{c(){e=y("div"),t=y("code"),h(t,"class","svelte-10s5tkd"),h(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){$(s,e,l),v(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")&&h(e,"class",i)},i:Q,o:Q,d(s){s&&S(e)}}}function LS(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=Gs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Gs.highlight(a,Gs.languages[l]||Gs.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 Gs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class Y1 extends ve{constructor(e){super(),be(this,e,LS,PS,_e,{class:0,content:2,language:3})}}const NS=n=>({}),$c=n=>({}),FS=n=>({}),Tc=n=>({});function Cc(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T=n[4]&&!n[2]&&Mc(n);const C=n[19].header,M=Pt(C,n,n[18],Tc);let O=n[4]&&n[2]&&Oc(n);const D=n[19].default,A=Pt(D,n,n[18],null),L=n[19].footer,N=Pt(L,n,n[18],$c);return{c(){e=y("div"),t=y("div"),s=E(),l=y("div"),o=y("div"),T&&T.c(),r=E(),M&&M.c(),a=E(),O&&O.c(),u=E(),f=y("div"),A&&A.c(),d=E(),p=y("div"),N&&N.c(),h(t,
2023-03-25 04:30:57 +08:00
<span class="txt">New index</span>`,f=E(),z(d.$$.fragment),h(e,"class","section-title"),h(u,"type","button"),h(u,"class","btn btn-xs btn-transparent btn-pill btn-outline"),h(r,"class","indexes-list svelte-167lbwu")},m(D,A){$(D,e,A),v(e,t),v(e,s),v(e,l),$(D,o,A),$(D,r,A);for(let L=0;L<k.length;L+=1)k[L]&&k[L].m(r,null);v(r,a),v(r,u),$(D,f,A),j(d,D,A),m=!0,_||(b=J(u,"click",n[5]),_=!0)},p(D,[A]){var N,R,F;if((!m||A&1)&&i!==(i=(((R=(N=D[0])==null?void 0:N.indexes)==null?void 0:R.length)||0)+"")&&le(s,i),A&7){g=((F=D[0])==null?void 0:F.indexes)||[];let q;for(q=0;q<g.length;q+=1){const B=qc(D,g,q);k[q]?k[q].p(B,A):(k[q]=Vc(B),k[q].c(),k[q].m(r,a))}for(;q<k.length;q+=1)k[q].d(1);k.length=g.length}const L={};!p&&A&1&&(p=!0,L.collection=D[0],we(()=>p=!1)),d.$set(L)},i(D){m||(I(d.$$.fragment,D),m=!0)},o(D){P(d.$$.fragment,D),m=!1},d(D){D&&S(e),D&&S(o),D&&S(r),ct(k,D),D&&S(f),n[6](null),V(d,D),_=!1,b()}}}const Hc=n=>n.name;function h$(n,e,t){let i;Ke(n,ii,m=>t(2,i=m));let{collection:s}=e,l;function o(m,_){for(let b=0;b<s.indexes.length;b++)if(s.indexes[b]==m){t(0,s.indexes[b]=_,s),mi("indexes."+b);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){se[m?"unshift":"push"](()=>{l=m,t(1,l)})}function f(m){s=m,t(0,s)}const d=m=>{for(let _=0;_<s.indexes.length;_++)if(s.indexes[_]==m.detail){s.indexes.splice(_,1),mi("indexes."+_);break}t(0,s)},p=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,d,p]}class _$ extends ve{constructor(e){super(),be(this,e,h$,m$,_e,{collection:0})}}function zc(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bc(n){let e,t,i,s,l=n[6].label+"",o,r,a,u;function f(){return n[4](n[6])}function d(...p){return n[5](n[6],...p)}return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),o=U(l),r=E(),h(t,"class","icon "+n[6].icon+" svelte-1p626x7"),h(s,"class","txt"),h(e,"tabindex","0"),h(e,"class","dropdown-item closable svelte-1p626x7")},m(p,m){$(p,e,m),v(e,t),v(e,i),v(e,s),v(s,o),v(e,r),a||(u=[J(e,"click",Cn(f)),J(e,"keydown",Cn(d))],a=!0)},p(p,m){n=p},d(p){p&&S(e),a=!1,Ie(u)}}}function g$(n){let e,t=n[2],i=[];for(let s=0;s<t.length;s+=1)i[s]=Bc(zc(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);$(s,e,l)},p(s,l){if(l&12){t=s[2];let o;for(o=0;o<t.length;o+=1){const r=zc(s,t,o);i[o]?i[o].p(r,l):(i[o]=Bc(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){ct(i,s),s&&S(e)}}}function b$(n){let e,t,i,s,l,o,r,a,u,f;return o=new Vn({props:{class:"dropdown field-types-dropdown",$$slots:{default:[g$]},$$scope:{ctx:n}}}),{c(){e=y("button"),t=y("i"),i=E(),s=y("div"),s.textContent="New field",l=E(),z(o.$$.fragment),h(t,"class","ri-add-line"),h(s,"class","txt"),h(e,"type","button"),h(e,"class",r=Mi(n[0])+" svelte-1p626x7")},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),v(e,l),j(o,e,null),a=!0,u||(f=J(e,"click",n[1]),u=!0)},p(d,[p]){const m={};p&512&&(m.$$scope={dirty:p,ctx:d}),o.$set(m),(!a||p&1&&r!==(r=Mi(d[0])+" svelte-1p626x7"))&&h(e,"class",r)},i(d){a||(I(o.$$.fragment,d),a=!0)},o(d){P(o.$$.fragment,d),a=!1},d(d){d&&S(e),V(o),u=!1,f()}}}function v$(n,e,t){let{class:i=""}=e;const s=St(),l=[{label:"Plain text",value:"text",icon:H.getFieldTypeIcon("text")},{label:"Rich editor",value:"editor",icon:H.getFieldTypeIcon("editor")},{label:"Number",value:"number",icon:H.getFieldTypeIcon("number")},{label:"Bool",value:"bool",icon:H.getFieldTypeIcon("bool")},{label:"Email",value:"email",icon:H.getFieldTypeIcon("email")},{label:"Url",value:"url",icon:H.getFieldTypeIcon("url")},{label:"DateTime",value:"date",icon:H.getFieldTypeIcon("date")},{label:"Select",value:"select",icon:H.getFieldTypeIcon("select")},{label:"File",value:"file",icon:H.getFieldTypeIcon("file")},{label:"Relation",value:"relation",icon:H.getFieldTypeIcon("relation")},{label:"JSON",value:"json",icon:H.getFieldTypeIcon("json")}];function o(u){s("select",u)}const r=u=>{o(u.value)},a=(u,f)=>{(f.code==="Enter"||f.code==="Space")&&o(u.value)};return n.$$
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(g,k){(!d||k&4096&&l!==(l=g[12]))&&h(e,"for",l);const w={};k&4096&&(w.id=g[12]),k&1&&(w.disabled=!H.isEmpty(g[0].options.onlyDomains)),!a&&k&1&&(a=!0,w.value=g[0].options.exceptDomains,we(()=>a=!1)),r.$set(w)},i(g){d||(I(r.$$.fragment,g),d=!0)},o(g){P(r.$$.fragment,g),d=!1},d(g){g&&S(e),g&&S(o),V(r,g),g&&S(u),g&&S(f),p=!1,m()}}}function G$(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(g){n[4](g)}let b={id:n[12]+".options.onlyDomains",disabled:!H.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(b.value=n[0].options.onlyDomains),r=new Rs({props:b}),se.push(()=>ge(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]+".options.onlyDomains"),h(f,"class","help-block")},m(g,k){$(g,e,k),v(e,t),v(e,i),v(e,s),$(g,o,k),j(r,g,k),$(g,u,k),$(g,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(g,k){(!d||k&4096&&l!==(l=g[12]+".options.onlyDomains"))&&h(e,"for",l);const w={};k&4096&&(w.id=g[12]+".options.onlyDomains"),k&1&&(w.disabled=!H.isEmpty(g[0].options.exceptDomains)),!a&&k&1&&(a=!0,w.value=g[0].options.onlyDomains,we(()=>a=!1)),r.$set(w)},i(g){d||(I(r.$$.fragment,g),d=!0)},o(g){P(r.$$.fragment,g),d=!1},d(g){g&&S(e),g&&S(o),V(r,g),g&&S(u),g&&S(f),p=!1,m()}}}function X$(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[Z$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[G$,({uniqueId:a})=>({12:a}),({uniqueId:a})=>a?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-sm-6"),h(l,"class","col-sm-6"),h(e,"class","grid grid-sm")},m(a,u){$(a,e,u),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&12289&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};u&2&&(d.name="schema."+a[1]+".options.onlyDomains"),u&12289&&(d.$$scope={dirty:u,ctx:a}),o.$set(d)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&S(e),V(i),V(o)}}}function Q$(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[X$]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Fe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&zt(r[2])]):{};a&8195&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],we(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function x$(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(g){n.$$.not_equal(l.options.exceptDomains,g)&&(l.options.exceptDomains=g,t(0,l))}function a(g){n.$$.not_equal(l.options.onlyDomains,g)&&(l.options.onlyDomains=g,t(0,l))}function u(g){l=g,t(0,l)}function f(g){de.call(this,n,g)}function d(g){de.call(this,n,g)}function p(g){de.call(this,n,g)}function m(g){de.call(this,n,g)}function _(g){de.call(this,n,g)}function b(g){de.call(this,n,g)}return n.$$set=g=>{e=Fe(Fe({},e),Ht(g)),t(2,s=Ge(e,i)),"field"in g&&t(0,l=g.field),"key"in g&&t(1,o=g.key)},[l,o,s,r,a,u,f,d,p,m,_,b]}class G1 extends ve{constructor(e){super(),be(this,e,x$,Q$,_e,{field:0,key:1})}}function eT(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=Fe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new G1({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("drop",n[6]),e.$on("dragstart",n[7]),e.$on("dragenter",n[8]),e.$on("dragleave",n[9]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?kt(s,[a&2&&{key:r[1]},a&4&&zt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],we(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function tT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e;function r(_){l=_,t(0,l)}function a(_){de.call(this,n,_)}function u(_){de.call(this,n,_)}function f(_){de.call(this,n,_)}function d(_){de.call(this,n,_)}function p(_){de.call(this,n,_)}function m(_){de.call(this,n,_)}return n.$$set=_=>{e=Fe(Fe({},e),Ht(_)),t(2,s=Ge(e,i)),"field"in _&&t(0,l=_.field),"key"in _&&t(1,o=_.key)},[l,o,s,r,a,u,f,d,p,m]}class nT extends ve{constructor(e){super(),be(this,e,tT,eT,_e,{field:0,key:1})}}function iT(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=Fe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[4]),e.$on(
2023-03-19 16:14:44 +08:00
<span class='flatpickr-weekday'>
`+K.join("</span><span class='flatpickr-weekday'>")+`
</span>
2023-03-25 04:30:57 +08:00
`}}function fe(){t.calendarContainer.classList.add("hasWeeks");var W=ut("div","flatpickr-weekwrapper");W.appendChild(ut("span","flatpickr-weekday",t.l10n.weekAbbreviation));var K=ut("div","flatpickr-weeks");return W.appendChild(K),{weekWrapper:W,weekNumbers:K}}function G(W,K){K===void 0&&(K=!0);var ne=K?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,et("onYearChange"),q()),F(),et("onMonthChange"),qi())}function ce(W,K){if(W===void 0&&(W=!0),K===void 0&&(K=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,K===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Er(t.config),oe=ne.hours,Te=ne.minutes,Ae=ne.seconds;m(oe,Te,Ae)}t.redraw(),W&&et("onChange")}function he(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),et("onClose")}function Me(){t.config!==void 0&&et("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 K=t.calendarContainer.parentNode;if(K.lastChild&&K.removeChild(K.lastChild),K.parentNode){for(;K.firstChild;)K.parentNode.insertBefore(K.firstChild,K);K.parentNode.removeChild(K)}}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 He(W){if(t.isOpen&&!t.config.inline){var K=kn(W),ne=je(K),oe=K===t.input||K===t.altInput||t.element.contains(K)||W.path&&W.path.indexOf&&(~W.path.indexOf(t.input)||~W.path.indexOf(t.altInput)),Te=!oe&&!ne&&!je(W.relatedTarget),Ae=!t.config.ignoredFocusElements.some(function(Le){return Le.contains(K)});Te&&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 K=W,ne=t.currentYear!==K;t.currentYear=K||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(),et("onYearChange"),q())}}function Ce(W,K){var ne;K===void 0&&(K=!0);var oe=t.parseDate(W,void 0,K);if(t.config.minDate&&oe&&wn(oe,t.config.minDate,K!==void 0?K:!t.minDateHasTime)<0||t.config.maxDate&&oe&&wn(oe,t.config.maxDate,K!==void 0?K:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)retu
2023-03-19 16:14:44 +08:00
`),r=y("code"),r.textContent="multipart/form-data",a=U(`
requests, the following normalization rules are applied if the `),u=y("code"),u.textContent="json",f=U(` field
is a
`),d=y("strong"),d.textContent="plain string",p=U(`:
2023-03-25 04:30:57 +08:00
`),m=y("ul"),_=y("li"),_.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",b=E(),g=y("li"),g.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=E(),w=y("li"),w.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",T=E(),C=y("li"),C.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",M=E(),O=y("li"),A=U(D),L=U(" is converted to the json "),N=y("code"),N.textContent='{"a":1,"b":2}',R=E(),F=y("li"),F.textContent="numeric strings are converted to json number",q=E(),B=y("li"),B.textContent="double quoted strings are left as they are (aka. without normalizations)",Y=E(),Z=y("li"),Z.textContent="any other string (empty string too) is double quoted",ee=U(`
2023-03-19 16:14:44 +08:00
Alternatively, if you want to avoid the string value normalizations, you can wrap your
2023-03-25 04:30:57 +08:00
data inside an object, eg.`),ie=y("code"),ie.textContent='{"data": anything}',h(i,"class","content"),h(t,"class","alert alert-warning m-b-0 m-t-10"),h(e,"class","block")},m(G,ce){$(G,e,ce),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o),v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(m,_),v(m,b),v(m,g),v(m,k),v(m,w),v(m,T),v(m,C),v(m,M),v(m,O),v(O,A),v(O,L),v(O,N),v(m,R),v(m,F),v(m,q),v(m,B),v(m,Y),v(m,Z),v(i,ee),v(i,ie),fe=!0},i(G){fe||(G&&xe(()=>{fe&&(X||(X=Ve(e,wt,{duration:150},!0)),X.run(1))}),fe=!0)},o(G){G&&(X||(X=Ve(e,wt,{duration:150},!1)),X.run(0)),fe=!1},d(G){G&&S(e),G&&X&&X.end()}}}function JT(n){let e,t,i,s,l,o,r;function a(p,m){return p[2]?KT:YT}let u=a(n),f=u(n),d=n[2]&&gd();return{c(){e=y("button"),t=y("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),d&&d.c(),l=Se(),h(t,"class","txt"),h(e,"type","button"),h(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(p,m){$(p,e,m),v(e,t),v(e,i),f.m(e,null),$(p,s,m),d&&d.m(p,m),$(p,l,m),o||(r=J(e,"click",n[4]),o=!0)},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(e,null))),p[2]?d?m&4&&I(d,1):(d=gd(),d.c(),I(d,1),d.m(l.parentNode,l)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},d(p){p&&S(e),f.d(),p&&S(s),d&&d.d(p),p&&S(l),o=!1,r()}}}function ZT(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[JT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=Fe(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),se.push(()=>ge(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("drop",n[8]),e.$on("dragstart",n[9]),e.$on("dragenter",n[10]),e.$on("dragleave",n[11]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?kt(s,[a&2&&{key:r[1]},a&8&&zt(r[3])]):{};a&4100&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],we(()=>t=!1)),e.$set(u)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){P(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function GT(n,e,t){const i=["field","key"];let s=Ge(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(g){l=g,t(0,l)}function f(g){de.call(this,n,g)}function d(g){de.call(this,n,g)}function p(g){de.call(this,n,g)}function m(g){de.call(this,n,g)}function _(g){de.call(this,n,g)}function b(g){de.call(this,n,g)}return n.$$set=g=>{e=Fe(Fe({},e),Ht(g)),t(3,s=Ge(e,i)),"field"in g&&t(0,l=g.field),"key"in g&&t(1,o=g.key)},[l,o,r,s,a,u,f,d,p,m,_,b]}class XT extends ve{constructor(e){super(),be(this,e,GT,ZT,_e,{field:0,key:1})}}function QT(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=y("span"),i=U(t),s=E(),l=y("small"),r=U(o),h(e,"class","txt"),h(l,"class","txt-hint")},m(a,u){$(a,e,u),v(e,i),$(a,s,u),$(a,l,u),v(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&S(e),a&&S(s),a&&S(l)}}}function xT(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class bd extends ve{constructor(e){super(),be(this,e,xT,QT,_e,{item:0})}}const eC=[{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.oas
Leave empty for no restriction.`,position:"top"})),w=!0)},p(O,D){(!k||D&33554432&&l!==(l=O[25]))&&h(e,"for",l);const A={};D&33554432&&(A.id=O[25]),D&8&&(A.items=O[3]),!a&&D&1&&(a=!0,A.keyOfSelected=O[0].options.mimeTypes,we(()=>a=!1)),r.$set(A);const L={};D&134217729&&(L.$$scope={dirty:D,ctx:O}),g.$set(L)},i(O){k||(I(r.$$.fragment,O),I(g.$$.fragment,O),k=!0)},o(O){P(r.$$.fragment,O),P(g.$$.fragment,O),k=!1},d(O){O&&S(e),O&&S(o),V(r,O),O&&S(u),O&&S(f),V(g),w=!1,T()}}}function lC(n){let e;return{c(){e=y("ul"),e.innerHTML=`<li><strong>WxH</strong>
2023-03-19 16:14:44 +08:00
(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>
2023-03-25 04:30:57 +08:00
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,h(e,"class","m-0")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function oC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M;function O(A){n[12](A)}let D={id:n[25],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(D.value=n[0].options.thumbs),r=new Rs({props:D}),se.push(()=>ge(r,"value",O)),w=new Vn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[lC]},$$scope:{ctx:n}}}),{c(){e=y("label"),t=y("span"),t.textContent="Thumb sizes",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),d=y("span"),d.textContent="Use comma as separator.",p=E(),m=y("button"),_=y("span"),_.textContent="Supported formats",b=E(),g=y("i"),k=E(),z(w.$$.fragment),h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[25]),h(d,"class","txt"),h(_,"class","txt link-primary"),h(g,"class","ri-arrow-drop-down-fill"),h(m,"type","button"),h(m,"class","inline-flex flex-gap-0"),h(f,"class","help-block")},m(A,L){$(A,e,L),v(e,t),v(e,i),v(e,s),$(A,o,L),j(r,A,L),$(A,u,L),$(A,f,L),v(f,d),v(f,p),v(f,m),v(m,_),v(m,b),v(m,g),v(m,k),j(w,m,null),T=!0,C||(M=Ee(Ue.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(A,L){(!T||L&33554432&&l!==(l=A[25]))&&h(e,"for",l);const N={};L&33554432&&(N.id=A[25]),!a&&L&1&&(a=!0,N.value=A[0].options.thumbs,we(()=>a=!1)),r.$set(N);const R={};L&134217728&&(R.$$scope={dirty:L,ctx:A}),w.$set(R)},i(A){T||(I(r.$$.fragment,A),I(w.$$.fragment,A),T=!0)},o(A){P(r.$$.fragment,A),P(w.$$.fragment,A),T=!1},d(A){A&&S(e),A&&S(o),V(r,A),A&&S(u),A&&S(f),V(w),C=!1,M()}}}function rC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=U("Max file size"),s=E(),l=y("input"),r=E(),a=y("div"),a.textContent="Must be in bytes.",h(e,"for",i=n[25]),h(l,"type","number"),h(l,"id",o=n[25]),h(l,"step","1"),h(l,"min","0"),h(a,"class","help-block")},m(d,p){$(d,e,p),v(e,t),$(d,s,p),$(d,l,p),ue(l,n[0].options.maxSize),$(d,r,p),$(d,a,p),u||(f=J(l,"input",n[13]),u=!0)},p(d,p){p&33554432&&i!==(i=d[25])&&h(e,"for",i),p&33554432&&o!==(o=d[25])&&h(l,"id",o),p&1&&gt(l.value)!==d[0].options.maxSize&&ue(l,d[0].options.maxSize)},d(d){d&&S(e),d&&S(s),d&&S(l),d&&S(r),d&&S(a),u=!1,f()}}}function vd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[aC,({uniqueId:s})=>({25:s}),({uniqueId:s})=>s?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","col-sm-3")},m(s,l){$(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&167772161&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&S(e),V(t)}}}function aC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"id",o=n[25]),h(l,"type","number"),h(l,"step","1"),h(l,"min","2"),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.maxSelect),r||(a=J(l,"input",n[14]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.maxSelect&&ue(l,u[0].options.maxSelect)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function uC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[sC,({uniqueId:b})=>({25:b}),({uniqueId:b})=>b?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[oC,({uniqueId:b})=>({25:b}),({uniqueId:b})=>b?33554432:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[rC,({uniqueId:b})=>({25:b}),({uniqueId:b})=>b?33554432:0]},$$scope:{ctx:n}}});let _=!n[2]&&vd(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),a=E(),u=y("div"),z(f.$$.f
<span class="txt">New collection</span>`,h(i,"type","button"),h(i,"class","btn btn-transparent btn-block btn-sm")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=J(i,"click",n[15]),s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,l()}}}function mC(n){let e,t,i;function s(o){n[16](o)}let l={id:n[32],searchable:n[3].length>5,selectPlaceholder:"Select collection *",noOptionsText:"No collections found",selectionKey:"id",items:n[3],disabled:!n[33],$$slots:{afterOptions:[pC]},$$scope:{ctx:n}};return n[0].options.collectionId!==void 0&&(l.keyOfSelected=n[0].options.collectionId),e=new Ni({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[0]&8&&(a.searchable=o[3].length>5),r[0]&8&&(a.items=o[3]),r[1]&4&&(a.disabled=!o[33]),r[0]&16|r[1]&8&&(a.$$scope={dirty:r,ctx:o}),!t&&r[0]&1&&(t=!0,a.keyOfSelected=o[0].options.collectionId,we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function hC(n){let e,t,i;function s(o){n[17](o)}let l={id:n[32],items:n[6],disabled:!n[33]};return n[2]!==void 0&&(l.keyOfSelected=n[2]),e=new Ni({props:l}),se.push(()=>ge(e,"keyOfSelected",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r[1]&2&&(a.id=o[32]),r[1]&4&&(a.disabled=!o[33]),!t&&r[0]&4&&(t=!0,a.keyOfSelected=o[2],we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function _C(n){let e,t,i,s;return e=new pe({props:{class:"form-field required "+(n[33]?"":"disabled"),inlineError:!0,name:"schema."+n[1]+".options.collectionId",$$slots:{default:[mC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field form-field-single-multiple-select "+(n[33]?"":"disabled"),inlineError:!0,$$slots:{default:[hC,({uniqueId:l})=>({32:l}),({uniqueId:l})=>[0,l?2:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),$(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[1]&4&&(r.class="form-field required "+(l[33]?"":"disabled")),o[0]&2&&(r.name="schema."+l[1]+".options.collectionId"),o[0]&25|o[1]&14&&(r.$$scope={dirty:o,ctx:l}),e.$set(r);const a={};o[1]&4&&(a.class="form-field form-field-single-multiple-select "+(l[33]?"":"disabled")),o[0]&4|o[1]&14&&(a.$$scope={dirty:o,ctx:l}),i.$set(a)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&S(t),V(i,l)}}}function yd(n){let e,t,i,s,l,o;return t=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.minSelect",$$slots:{default:[gC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[bC,({uniqueId:r})=>({32:r}),({uniqueId:r})=>[0,r?2:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),z(t.$$.fragment),i=E(),s=y("div"),z(l.$$.fragment),h(e,"class","col-sm-6"),h(s,"class","col-sm-6")},m(r,a){$(r,e,a),j(t,e,null),$(r,i,a),$(r,s,a),j(l,s,null),o=!0},p(r,a){const u={};a[0]&2&&(u.name="schema."+r[1]+".options.minSelect"),a[0]&1|a[1]&10&&(u.$$scope={dirty:a,ctx:r}),t.$set(u);const f={};a[0]&2&&(f.name="schema."+r[1]+".options.maxSelect"),a[0]&1|a[1]&10&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){o||(I(t.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(t.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){r&&S(e),V(t),r&&S(i),r&&S(s),V(l)}}}function gC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Min select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"),h(l,"id",o=n[32]),h(l,"step","1"),h(l,"min","1"),h(l,"placeholder","No min limit")},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.minSelect),r||(a=J(l,"input",n[11]),r=!0)},p(u,f){f[1]&2&&i!==(i=u[32])&&h(e,"for",i),f[1]&2&&o!==(o=u[32])&&h(l,"id",o),f[0]&1&&gt(l.value)!==u[0].options.minSelect&&ue(l,u[0].options.minSelect)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function bC(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Max select"),s=E(),l=y("input"),h(e,"for",i=n[32]),h(l,"type","number"
2023-03-19 16:14:44 +08:00
`),t=y("code"),t.textContent="username",i=U(` ,
`),s=y("code"),s.textContent="email",l=U(` ,
`),o=y("code"),o.textContent="emailVisibility",r=U(` ,
2023-03-25 04:30:57 +08:00
`),a=y("code"),a.textContent="verified",h(t,"class","txt-sm"),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm")},m(u,f){$(u,e,f),$(u,t,f),$(u,i,f),$(u,s,f),$(u,l,f),$(u,o,f),$(u,r,f),$(u,a,f)},d(u){u&&S(e),u&&S(t),u&&S(i),u&&S(s),u&&S(l),u&&S(o),u&&S(r),u&&S(a)}}}function Sd(n,e){let t,i,s,l,o;function r(m){e[7](m,e[17],e[18],e[19])}function a(){return e[8](e[19])}function u(...m){return e[10](e[19],...m)}function f(...m){return e[11](e[19],...m)}var d=e[1][e[17].type];function p(m){let _={key:m[4](m[17])};return m[17]!==void 0&&(_.field=m[17]),{props:_}}return d&&(i=Ot(d,p(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f)),{key:n,first:null,c(){t=Se(),i&&z(i.$$.fragment),l=Se(),this.first=t},m(m,_){$(m,t,_),i&&j(i,m,_),$(m,l,_),o=!0},p(m,_){e=m;const b={};if(_&1&&(b.key=e[4](e[17])),!s&&_&1&&(s=!0,b.field=e[17],we(()=>s=!1)),_&1&&d!==(d=e[1][e[17].type])){if(i){re();const g=i;P(g.$$.fragment,1,0,()=>{V(g,1)}),ae()}d?(i=Ot(d,p(e)),se.push(()=>ge(i,"field",r)),i.$on("remove",a),i.$on("rename",e[9]),i.$on("dragstart",u),i.$on("drop",f),z(i.$$.fragment),I(i.$$.fragment,1),j(i,l.parentNode,l)):i=null}else d&&i.$set(b)},i(m){o||(i&&I(i.$$.fragment,m),o=!0)},o(m){i&&P(i.$$.fragment,m),o=!1},d(m){m&&S(t),m&&S(l),i&&V(i,m)}}}function TC(n){let e,t,i,s,l,o,r,a,u,f,d,p,m=[],_=new Map,b,g,k,w,T,C,M,O,D=n[0].isAuth&&wd(),A=n[0].schema;const L=F=>F[17];for(let F=0;F<A.length;F+=1){let q=kd(n,A,F),B=L(q);_.set(B,m[F]=Sd(B,q))}g=new y$({props:{class:"btn btn-block btn-outline"}}),g.$on("select",n[12]);function N(F){n[13](F)}let R={};return n[0]!==void 0&&(R.collection=n[0]),C=new _$({props:R}),se.push(()=>ge(C,"collection",N)),{c(){e=y("div"),t=y("p"),i=U(`System fields:
2023-03-19 16:14:44 +08:00
`),s=y("code"),s.textContent="id",l=U(` ,
`),o=y("code"),o.textContent="created",r=U(` ,
`),a=y("code"),a.textContent="updated",u=E(),D&&D.c(),f=U(`
2023-03-25 04:30:57 +08:00
.`),d=E(),p=y("div");for(let F=0;F<m.length;F+=1)m[F].c();b=E(),z(g.$$.fragment),k=E(),w=y("hr"),T=E(),z(C.$$.fragment),h(s,"class","txt-sm"),h(o,"class","txt-sm"),h(a,"class","txt-sm"),h(t,"class","txt-sm"),h(e,"class","block m-b-25"),h(p,"class","accordions schema-fields")},m(F,q){$(F,e,q),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),D&&D.m(t,null),v(t,f),$(F,d,q),$(F,p,q);for(let B=0;B<m.length;B+=1)m[B]&&m[B].m(p,null);$(F,b,q),j(g,F,q),$(F,k,q),$(F,w,q),$(F,T,q),j(C,F,q),O=!0},p(F,[q]){F[0].isAuth?D||(D=wd(),D.c(),D.m(t,f)):D&&(D.d(1),D=null),q&119&&(A=F[0].schema,re(),m=Dt(m,q,L,1,F,A,_,p,un,Sd,null,kd),ae());const B={};!M&&q&1&&(M=!0,B.collection=F[0],we(()=>M=!1)),C.$set(B)},i(F){if(!O){for(let q=0;q<A.length;q+=1)I(m[q]);I(g.$$.fragment,F),I(C.$$.fragment,F),O=!0}},o(F){for(let q=0;q<m.length;q+=1)P(m[q]);P(g.$$.fragment,F),P(C.$$.fragment,F),O=!1},d(F){F&&S(e),D&&D.d(),F&&S(d),F&&S(p);for(let q=0;q<m.length;q+=1)m[q].d();F&&S(b),V(g,F),F&&S(k),F&&S(w),F&&S(T),V(C,F)}}}function CC(n,e){n&&(n.dataTransfer.effectAllowed="move",n.dataTransfer.dropEffect="move",n.dataTransfer.setData("text/plain",e))}function MC(n,e,t){let i,{collection:s=new _n}=e;const l={text:R$,number:B$,bool:Y$,email:G1,url:nT,editor:lT,date:kT,select:WT,json:XT,file:dC,relation:$C};function o(C){s.schema[C]&&(s.schema.splice(C,1),t(0,s))}function r(C="text"){const M=new bn({name:a(),type:C});M.onMountExpand=!0,s.schema.push(M),t(0,s)}function a(C="field"){let M="";for(;u(C+M);)++M;return C+M}function u(C){return!!s.schema.find(M=>M.name===C)}function f(C){return i.findIndex(M=>M===C)}function d(C,M){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||C===M||!M||t(0,s.indexes=s.indexes.map(D=>H.replaceIndexColumn(D,C,M)),s)}function p(C,M){if(!C)return;C.dataTransfer.dropEffect="move";const O=parseInt(C.dataTransfer.getData("text/plain")),D=s.schema;O<M?(D.splice(M+1,0,D[O]),D.splice(O,1)):(D.splice(M,0,D[O]),D.splice(O+1,1)),t(0,s.schema=D,s),gn({})}function m(C,M,O,D){O[D]=C,t(0,s)}const _=C=>o(C),b=C=>d(C.detail.oldName,C.detail.newName),g=(C,M)=>CC(M.detail,C),k=(C,M)=>p(M.detail,C),w=C=>r(C.detail);function T(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=s||new _n),t(0,s.schema=[],s)),n.$$.dirty&1&&(i=s.schema.filter(C=>!C.toDelete)||[])},[s,l,o,r,f,d,p,m,_,b,g,k,w,T]}class OC extends ve{constructor(e){super(),be(this,e,MC,TC,_e,{collection:0})}}const DC=n=>({isAdminOnly:n&512}),$d=n=>({isAdminOnly:n[9]});function EC(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[IC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function AC(n){let e;return{c(){e=y("div"),e.innerHTML='<span class="loader"></span>',h(e,"class","txt-center")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function Td(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-lock-line"></i>
<span class="txt">Set Admins only</span>`,h(e,"type","button"),h(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-17id62x")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[11]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function Cd(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML=`<div class="icon svelte-17id62x"><i class="ri-lock-unlock-line svelte-17id62x"></i></div>
2023-03-27 00:19:44 +08:00
<small class="txt svelte-17id62x">Unlock and set custom rule</small>`,h(e,"type","button"),h(e,"class","unlock-overlay svelte-17id62x"),h(e,"aria-label","Unlock and set custom rule")},m(o,r){$(o,e,r),i=!0,s||(l=J(e,"click",n[10]),s=!0)},p:Q,i(o){i||(o&&xe(()=>{i&&(t||(t=Ve(e,Et,{duration:100,start:.9},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:100,start:.9},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function IC(n){let e,t,i,s,l,o=n[9]?"- Admins only":"",r,a,u,f,d,p,m,_,b,g,k=!n[9]&&Td(n);function w(A){n[14](A)}var T=n[7];function C(A){let L={id:A[18],baseCollection:A[1],disabled:A[9],placeholder:A[9]?"":A[5]};return A[0]!==void 0&&(L.value=A[0]),{props:L}}T&&(d=Ot(T,C(n)),n[13](d),se.push(()=>ge(d,"value",w)));let M=n[9]&&Cd(n);const O=n[12].default,D=Pt(O,n,n[15],$d);return{c(){e=y("div"),t=y("label"),i=y("span"),s=U(n[2]),l=E(),r=U(o),a=E(),k&&k.c(),f=E(),d&&z(d.$$.fragment),m=E(),M&&M.c(),_=E(),b=y("div"),D&&D.c(),h(i,"class","txt"),x(i,"txt-hint",n[9]),h(t,"for",u=n[18]),h(e,"class","input-wrapper svelte-17id62x"),h(b,"class","help-block")},m(A,L){$(A,e,L),v(e,t),v(t,i),v(i,s),v(i,l),v(i,r),v(t,a),k&&k.m(t,null),v(e,f),d&&j(d,e,null),v(e,m),M&&M.m(e,null),$(A,_,L),$(A,b,L),D&&D.m(b,null),g=!0},p(A,L){(!g||L&4)&&le(s,A[2]),(!g||L&512)&&o!==(o=A[9]?"- Admins only":"")&&le(r,o),(!g||L&512)&&x(i,"txt-hint",A[9]),A[9]?k&&(k.d(1),k=null):k?k.p(A,L):(k=Td(A),k.c(),k.m(t,null)),(!g||L&262144&&u!==(u=A[18]))&&h(t,"for",u);const N={};if(L&262144&&(N.id=A[18]),L&2&&(N.baseCollection=A[1]),L&512&&(N.disabled=A[9]),L&544&&(N.placeholder=A[9]?"":A[5]),!p&&L&1&&(p=!0,N.value=A[0],we(()=>p=!1)),L&128&&T!==(T=A[7])){if(d){re();const R=d;P(R.$$.fragment,1,0,()=>{V(R,1)}),ae()}T?(d=Ot(T,C(A)),A[13](d),se.push(()=>ge(d,"value",w)),z(d.$$.fragment),I(d.$$.fragment,1),j(d,e,m)):d=null}else T&&d.$set(N);A[9]?M?(M.p(A,L),L&512&&I(M,1)):(M=Cd(A),M.c(),I(M,1),M.m(e,null)):M&&(re(),P(M,1,1,()=>{M=null}),ae()),D&&D.p&&(!g||L&33280)&&Nt(D,O,A,A[15],g?Lt(O,A[15],L,DC):Ft(A[15]),$d)},i(A){g||(d&&I(d.$$.fragment,A),I(M),I(D,A),g=!0)},o(A){d&&P(d.$$.fragment,A),P(M),P(D,A),g=!1},d(A){A&&S(e),k&&k.d(),n[13](null),d&&V(d),M&&M.d(),A&&S(_),A&&S(b),D&&D.d(A)}}}function PC(n){let e,t,i,s;const l=[AC,EC],o=[];function r(a,u){return a[8]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Se()},m(a,u){o[e].m(a,u),$(a,i,u),s=!0},p(a,[u]){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),P(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){s||(I(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&S(i)}}}let Md;function LC(n,e,t){let i,{$$slots:s={},$$scope:l}=e,{collection:o=null}=e,{rule:r=null}=e,{label:a="Rule"}=e,{formKey:u="rule"}=e,{required:f=!1}=e,{placeholder:d="Leave empty to grant everyone access..."}=e,p=null,m=null,_=Md,b=!1;g();async function g(){_||b||(t(8,b=!0),t(7,_=(await ft(()=>import("./FilterAutocompleteInput-c5decfe9.js"),["./FilterAutocompleteInput-c5decfe9.js","./index-6f704b4c.js"],import.meta.url)).default),Md=_,t(8,b=!1))}async function k(){t(0,r=m||""),await an(),p==null||p.focus()}async function w(){m=r,t(0,r=null)}function T(M){se[M?"unshift":"push"](()=>{p=M,t(6,p)})}function C(M){r=M,t(0,r)}return n.$$set=M=>{"collection"in M&&t(1,o=M.collection),"rule"in M&&t(0,r=M.rule),"label"in M&&t(2,a=M.label),"formKey"in M&&t(3,u=M.formKey),"required"in M&&t(4,f=M.required),"placeholder"in M&&t(5,d=M.placeholder),"$$scope"in M&&t(15,l=M.$$scope)},n.$$.update=()=>{n.$$.dirty&1&&t(9,i=r===null)},[r,o,a,u,f,d,p,_,b,i,k,w,s,T,C,l]}class Ts extends ve{constructor(e){super(),be(this,e,LC,PC,_e,{collection:1,rule:0,label:2,formKey:3,required:4,placeholder:5})}}function Od(n,e,t){const i=n.slice();return i[10]=e[t],i}function Dd(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M,O,D,A,L=n[2],N=[];for(let R=0;R<L.length;R+=1)N[R]=Ed(Od(n,L,R));return{c(){e=y("div"),t=y("div"),i=y("div"),s=y("p"),s.textContent="The following record fields are available:",l=E(),o=y("div");for(let R=0;R<N.length;R+=1)N[R].c();r=E(),a=y("hr"),u=E(),f=y("p"),f.innerHTML="The request fields
2023-03-19 16:14:44 +08:00
<code>@request.query.*</code>
<code>@request.data.*</code>
2023-03-25 04:30:57 +08:00
<code>@request.auth.*</code>`,m=E(),_=y("hr"),b=E(),g=y("p"),g.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",k=E(),w=y("div"),w.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",T=E(),C=y("hr"),M=E(),O=y("p"),O.innerHTML=`Example rule:
2023-03-19 16:14:44 +08:00
<br/>
2023-03-25 04:30:57 +08:00
<code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,h(s,"class","m-b-0"),h(o,"class","inline-flex flex-gap-5"),h(a,"class","m-t-10 m-b-5"),h(f,"class","m-b-0"),h(p,"class","inline-flex flex-gap-5"),h(_,"class","m-t-10 m-b-5"),h(g,"class","m-b-0"),h(w,"class","inline-flex flex-gap-5"),h(C,"class","m-t-10 m-b-5"),h(i,"class","content"),h(t,"class","alert alert-warning m-0")},m(R,F){$(R,e,F),v(e,t),v(t,i),v(i,s),v(i,l),v(i,o);for(let q=0;q<N.length;q+=1)N[q]&&N[q].m(o,null);v(i,r),v(i,a),v(i,u),v(i,f),v(i,d),v(i,p),v(i,m),v(i,_),v(i,b),v(i,g),v(i,k),v(i,w),v(i,T),v(i,C),v(i,M),v(i,O),A=!0},p(R,F){if(F&4){L=R[2];let q;for(q=0;q<L.length;q+=1){const B=Od(R,L,q);N[q]?N[q].p(B,F):(N[q]=Ed(B),N[q].c(),N[q].m(o,null))}for(;q<N.length;q+=1)N[q].d(1);N.length=L.length}},i(R){A||(R&&xe(()=>{A&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),A=!0)},o(R){R&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),A=!1},d(R){R&&S(e),ct(N,R),R&&D&&D.end()}}}function Ed(n){let e,t=n[10]+"",i;return{c(){e=y("code"),i=U(t)},m(s,l){$(s,e,l),v(e,i)},p(s,l){l&4&&t!==(t=s[10]+"")&&le(i,t)},d(s){s&&S(e)}}}function Ad(n){let e,t,i,s,l,o,r,a,u;function f(g){n[6](g)}let d={label:"Create rule",formKey:"createRule",collection:n[0]};n[0].createRule!==void 0&&(d.rule=n[0].createRule),e=new Ts({props:d}),se.push(()=>ge(e,"rule",f));function p(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 Ts({props:m}),se.push(()=>ge(s,"rule",p));function _(g){n[8](g)}let b={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(b.rule=n[0].deleteRule),r=new Ts({props:b}),se.push(()=>ge(r,"rule",_)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(g,k){j(e,g,k),$(g,i,k),j(s,g,k),$(g,o,k),j(r,g,k),u=!0},p(g,k){const w={};k&1&&(w.collection=g[0]),!t&&k&1&&(t=!0,w.rule=g[0].createRule,we(()=>t=!1)),e.$set(w);const T={};k&1&&(T.collection=g[0]),!l&&k&1&&(l=!0,T.rule=g[0].updateRule,we(()=>l=!1)),s.$set(T);const C={};k&1&&(C.collection=g[0]),!a&&k&1&&(a=!0,C.rule=g[0].deleteRule,we(()=>a=!1)),r.$set(C)},i(g){u||(I(e.$$.fragment,g),I(s.$$.fragment,g),I(r.$$.fragment,g),u=!0)},o(g){P(e.$$.fragment,g),P(s.$$.fragment,g),P(r.$$.fragment,g),u=!1},d(g){V(e,g),g&&S(i),V(s,g),g&&S(o),V(r,g)}}}function Id(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:[NC]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Ts({props:l}),se.push(()=>ge(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){j(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&8192&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function NC(n){let e,t,i;return{c(){e=y("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
2023-03-19 16:14:44 +08:00
changing the password without requiring to enter the old one, directly updating the verified
2023-03-25 04:30:57 +08:00
state or email, etc.`,t=E(),i=y("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){$(s,e,l),$(s,t,l),$(s,i,l)},p:Q,d(s){s&&S(e),s&&S(t),s&&S(i)}}}function FC(n){var F,q;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,d,p,m,_,b,g,k,w,T,C,M=n[1]&&Dd(n);function O(B){n[4](B)}let D={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(D.rule=n[0].listRule),f=new Ts({props:D}),se.push(()=>ge(f,"rule",O));function A(B){n[5](B)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Ts({props:L}),se.push(()=>ge(m,"rule",A));let N=!((F=n[0])!=null&&F.isView)&&Ad(n),R=((q=n[0])==null?void 0:q.isAuth)&&Id(n);return{c(){e=y("div"),t=y("div"),i=y("p"),i.innerHTML=`All rules follow the
2023-03-19 16:14:44 +08:00
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
2023-03-25 04:30:57 +08:00
</a>.`,s=E(),l=y("button"),r=U(o),a=E(),M&&M.c(),u=E(),z(f.$$.fragment),p=E(),z(m.$$.fragment),b=E(),N&&N.c(),g=E(),R&&R.c(),k=Se(),h(l,"type","button"),h(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),h(t,"class","flex txt-sm txt-hint m-b-5"),h(e,"class","block m-b-sm handle")},m(B,Y){$(B,e,Y),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),M&&M.m(e,null),$(B,u,Y),j(f,B,Y),$(B,p,Y),j(m,B,Y),$(B,b,Y),N&&N.m(B,Y),$(B,g,Y),R&&R.m(B,Y),$(B,k,Y),w=!0,T||(C=J(l,"click",n[3]),T=!0)},p(B,[Y]){var ie,X;(!w||Y&2)&&o!==(o=B[1]?"Hide available fields":"Show available fields")&&le(r,o),B[1]?M?(M.p(B,Y),Y&2&&I(M,1)):(M=Dd(B),M.c(),I(M,1),M.m(e,null)):M&&(re(),P(M,1,1,()=>{M=null}),ae());const Z={};Y&1&&(Z.collection=B[0]),!d&&Y&1&&(d=!0,Z.rule=B[0].listRule,we(()=>d=!1)),f.$set(Z);const ee={};Y&1&&(ee.collection=B[0]),!_&&Y&1&&(_=!0,ee.rule=B[0].viewRule,we(()=>_=!1)),m.$set(ee),(ie=B[0])!=null&&ie.isView?N&&(re(),P(N,1,1,()=>{N=null}),ae()):N?(N.p(B,Y),Y&1&&I(N,1)):(N=Ad(B),N.c(),I(N,1),N.m(g.parentNode,g)),(X=B[0])!=null&&X.isAuth?R?(R.p(B,Y),Y&1&&I(R,1)):(R=Id(B),R.c(),I(R,1),R.m(k.parentNode,k)):R&&(re(),P(R,1,1,()=>{R=null}),ae())},i(B){w||(I(M),I(f.$$.fragment,B),I(m.$$.fragment,B),I(N),I(R),w=!0)},o(B){P(M),P(f.$$.fragment,B),P(m.$$.fragment,B),P(N),P(R),w=!1},d(B){B&&S(e),M&&M.d(),B&&S(u),V(f,B),B&&S(p),V(m,B),B&&S(b),N&&N.d(B),B&&S(g),R&&R.d(B),B&&S(k),T=!1,C()}}}function RC(n,e,t){let i,{collection:s=new _n}=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 d(m){n.$$.not_equal(s.deleteRule,m)&&(s.deleteRule=m,t(0,s))}function p(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=H.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,d,p]}class qC extends ve{constructor(e){super(),be(this,e,RC,FC,_e,{collection:0})}}function Pd(n,e,t){const i=n.slice();return i[9]=e[t],i}function jC(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=Ot(o,r(n)),se.push(()=>ge(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),$(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,we(()=>t=!1)),u&2&&o!==(o=a[1])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>ge(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),I(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&V(e,a)}}}function VC(n){let e;return{c(){e=y("textarea"),e.disabled=!0,h(e,"rows","7"),h(e,"placeholder","Loading...")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function Ld(n){let e,t,i=n[3],s=[];for(let l=0;l<i.length;l+=1)s[l]=Nd(Pd(n,i,l));return{c(){e=y("div"),t=y("div");for(let l=0;l<s.length;l+=1)s[l].c();h(t,"class","content"),h(e,"class","help-block help-block-error")},m(l,o){$(l,e,o),v(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=Pd(l,i,r);s[r]?s[r].p(a,o):(s[r]=Nd(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&&S(e),ct(s,l)}}}function Nd(n){let e,t=n[9]+"",i;return{c(){e=y("p"),i=U(t)},m(s,l){$(s,e,l),v(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&le(i,t)},d(s){s&&S(e)}}}function HC(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[VC,jC],m=[];function _(g,k){return g[2]?0:1}l=_(n),o=m[l]=p[l](n);let b=n[3].length&&Ld(n);return{c(){e=y("label"),t=y("span"),t.textContent="Select query",s=E(),o.c(),r=E(),a=y("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>) are not support
2023-03-19 16:14:44 +08:00
<li>The query must have a unique <code>id</code> column.
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
2023-03-27 00:19:44 +08:00
<code>(ROW_NUMBER() OVER()) as id</code>.</li></ul>`,u=E(),b&&b.c(),f=Se(),h(t,"class","txt"),h(e,"for",i=n[8]),h(a,"class","help-block")},m(g,k){$(g,e,k),v(e,t),$(g,s,k),m[l].m(g,k),$(g,r,k),$(g,a,k),$(g,u,k),b&&b.m(g,k),$(g,f,k),d=!0},p(g,k){(!d||k&256&&i!==(i=g[8]))&&h(e,"for",i);let w=l;l=_(g),l===w?m[l].p(g,k):(re(),P(m[w],1,1,()=>{m[w]=null}),ae(),o=m[l],o?o.p(g,k):(o=m[l]=p[l](g),o.c()),I(o,1),o.m(r.parentNode,r)),g[3].length?b?b.p(g,k):(b=Ld(g),b.c(),b.m(f.parentNode,f)):b&&(b.d(1),b=null)},i(g){d||(I(o),d=!0)},o(g){P(o),d=!1},d(g){g&&S(e),g&&S(s),m[l].d(g),g&&S(r),g&&S(a),g&&S(u),b&&b.d(g),g&&S(f)}}}function zC(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[HC,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function BC(n,e,t){let i;Ke(n,ii,d=>t(4,i=d));let{collection:s=new _n}=e,l,o=!1,r=[];function a(d){var _;t(3,r=[]);const p=H.getNestedVal(d,"schema",null);if(H.isEmpty(p))return;if(p!=null&&p.message){r.push(p==null?void 0:p.message);return}const m=H.extractColumnsFromQuery((_=s==null?void 0:s.options)==null?void 0:_.query);H.removeByValue(m,"id"),H.removeByValue(m,"created"),H.removeByValue(m,"updated");for(let b in p)for(let g in p[b]){const k=p[b][g].message,w=m[b]||b;r.push(H.sentenize(w+": "+k))}}en(async()=>{t(2,o=!0);try{t(1,l=(await ft(()=>import("./CodeEditor-e7b4fbf7.js"),["./CodeEditor-e7b4fbf7.js","./index-6f704b4c.js"],import.meta.url)).default)}catch(d){console.warn(d)}t(2,o=!1)});function u(d){n.$$.not_equal(s.options.query,d)&&(s.options.query=d,t(0,s))}const f=()=>{r.length&&mi("schema")};return n.$$set=d=>{"collection"in d&&t(0,s=d.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class UC extends ve{constructor(e){super(),be(this,e,BC,zC,_e,{collection:0})}}const WC=n=>({active:n&1}),Fd=n=>({active:n[0]});function Rd(n){let e,t,i;const s=n[15].default,l=Pt(s,n,n[14],null);return{c(){e=y("div"),l&&l.c(),h(e,"class","accordion-content")},m(o,r){$(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&Nt(l,s,o,o[14],i?Lt(s,o[14],r,null):Ft(o[14]),null)},i(o){i||(I(l,o),o&&xe(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){P(l,o),o&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&S(e),l&&l.d(o),o&&t&&t.end()}}}function YC(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Pt(a,n,n[14],Fd);let f=n[0]&&Rd(n);return{c(){e=y("div"),t=y("button"),u&&u.c(),i=E(),f&&f.c(),h(t,"type","button"),h(t,"class","accordion-header"),h(t,"draggable",n[2]),x(t,"interactive",n[3]),h(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(d,p){$(d,e,p),v(e,t),u&&u.m(t,null),v(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[J(t,"click",pt(n[17])),J(t,"drop",pt(n[18])),J(t,"dragstart",n[19]),J(t,"dragenter",n[20]),J(t,"dragleave",n[21]),J(t,"dragover",pt(n[16]))],o=!0)},p(d,[p]){u&&u.p&&(!l||p&16385)&&Nt(u,a,d,d[14],l?Lt(a,d[14],p,WC):Ft(d[14]),Fd),(!l||p&4)&&h(t,"draggable",d[2]),(!l||p&8)&&x(t,"interactive",d[3]),d[0]?f?(f.p(d,p),p&1&&I(f,1)):(f=Rd(d),f.c(),I(f,1),f.m(e,null)):f&&(re(),P(f,1,1,()=>{f=null}),ae()),(!l||p&130&&s!==(s="accordion "+(d[7]?"drag-over":"")+" "+d[1]))&&h(e,"class",s),(!l||p&131)&&x(e,"active",d[0])},i(d){l||(I(u,d),I(f),l=!0)},o(d){P(u,d),P(f),l=!1},d(d){d&&S(e),u&&u.d(d),f&&f.d(),n[22](null),o=!1,Ie(r)}}}function KC(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=St();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:d=!0}=e,{single:p=!1}=e,m=!1;function _(){return!!f}function b(){w(),t(0,f=!0),l("expand")}function g(){t(0,f=!1),clearTimeout(r),l("collapse")}function k(){l("toggle"),f?g():b()}function w(){if(p&&o.closest(".accordions")){const N=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const
2023-03-25 04:30:57 +08:00
<span class="txt">Username/Password</span>`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){$(p,e,m),$(p,t,m),$(p,i,m),$(p,s,m),f.m(p,m),$(p,l,m),d&&d.m(p,m),$(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[3]?d?m&8&&I(d,1):(d=qd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&S(e),p&&S(t),p&&S(i),p&&S(s),f.d(p),p&&S(l),d&&d.d(p),p&&S(o)}}}function xC(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[0].options.allowEmailAuth,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[6]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowEmailAuth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function jd(n){let e,t,i,s,l,o,r,a;return i=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.onlyEmailDomains)?"":"disabled"),name:"options.exceptEmailDomains",$$slots:{default:[e4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field "+(H.isEmpty(n[0].options.exceptEmailDomains)?"":"disabled"),name:"options.onlyEmailDomains",$$slots:{default:[t4,({uniqueId:u})=>({12:u}),({uniqueId:u})=>u?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(e,"class","grid grid-sm p-t-sm")},m(u,f){$(u,e,f),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),a=!0},p(u,f){const d={};f&1&&(d.class="form-field "+(H.isEmpty(u[0].options.onlyEmailDomains)?"":"disabled")),f&12289&&(d.$$scope={dirty:f,ctx:u}),i.$set(d);const p={};f&1&&(p.class="form-field "+(H.isEmpty(u[0].options.exceptEmailDomains)?"":"disabled")),f&12289&&(p.$$scope={dirty:f,ctx:u}),o.$set(p)},i(u){a||(I(i.$$.fragment,u),I(o.$$.fragment,u),u&&xe(()=>{a&&(r||(r=Ve(e,wt,{duration:150},!0)),r.run(1))}),a=!0)},o(u){P(i.$$.fragment,u),P(o.$$.fragment,u),u&&(r||(r=Ve(e,wt,{duration:150},!1)),r.run(0)),a=!1},d(u){u&&S(e),V(i),V(o),u&&r&&r.end()}}}function e4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(g){n[7](g)}let b={id:n[12],disabled:!H.isEmpty(n[0].options.onlyEmailDomains)};return n[0].options.exceptEmailDomains!==void 0&&(b.value=n[0].options.exceptEmailDomains),r=new Rs({props:b}),se.push(()=>ge(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Except domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(g,k){$(g,e,k),v(e,t),v(e,i),v(e,s),$(g,o,k),j(r,g,k),$(g,u,k),$(g,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are NOT allowed to sign up.
This field is disabled if "Only domains" is set.`,position:"top"})),p=!0)},p(g,k){(!d||k&4096&&l!==(l=g[12]))&&h(e,"for",l);const w={};k&4096&&(w.id=g[12]),k&1&&(w.disabled=!H.isEmpty(g[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,w.value=g[0].options.exceptEmailDomains,we(()=>a=!1)),r.$set(w)},i(g){d||(I(r.$$.fragment,g),d=!0)},o(g){P(r.$$.fragment,g),d=!1},d(g){g&&S(e),g&&S(o),V(r,g),g&&S(u),g&&S(f),p=!1,m()}}}function t4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m;function _(g){n[8](g)}let b={id:n[12],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(b.value=n[0].options.onlyEmailDomains),r=new Rs({props:b}),se.push(()=>ge(r,"value",_)),{c(){e=y("label"),t=y("span"),t.textContent="Only domains",i=E(),s=y("i"),o=E(),z(r.$$.fragment),u=E(),f=y("div"),f.textContent="Use comma as separator.",h(t,"class","txt"),h(s,"class","ri-information-line link-hint"),h(e,"for",l=n[12]),h(f,"class","help-block")},m(g,k){$(g,e,k),v(e,t),v(e,i),v(e,s),$(g,o,k),j(r,g,k),$(g,u,k),$(g,f,k),d=!0,p||(m=Ee(Ue.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),p=!0)},p(g,k){(!d||k&4096&&l!==(l=g[12]))&&h(e,"for",l);const w={};k&4096&&(w.id=g[12]),k&1&&(w.disabled=!H.isEmpty(g[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,w.value=g[0].options.onlyEmailDomains,we(()=>a=!1)),r.$set(w)},i(g){d||(I(r.$$.fragment,g),d=!0)},o(g){P(r.$$.fragment,g),d=!1},d(g){g&&S(e),g&&S(o),V(r,g),g&&S(u),g&&S(f),p=!1,m()}}}function n4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[xC,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&jd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),$(o,t,r),l&&l.m(o,r),$(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&I(l,1)):(l=jd(o),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&S(t),l&&l.d(o),o&&S(i)}}}function i4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function s4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Vd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function l4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowEmailAuth?s4:i4}let u=a(n),f=u(n),d=n[2]&&Vd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-mail-star-line"></i>
<span class="txt">Email/Password</span>`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){$(p,e,m),$(p,t,m),$(p,i,m),$(p,s,m),f.m(p,m),$(p,l,m),d&&d.m(p,m),$(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[2]?d?m&4&&I(d,1):(d=Vd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&S(e),p&&S(t),p&&S(i),p&&S(s),f.d(p),p&&S(l),d&&d.d(p),p&&S(o)}}}function o4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(s,"for",o=n[12])},m(u,f){$(u,e,f),e.checked=n[0].options.allowOAuth2Auth,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&h(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function Hd(n){let e,t,i;return{c(){e=y("div"),e.innerHTML='<div class="flex p-t-base"><a href="/_/#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',h(e,"class","block")},m(s,l){$(s,e,l),i=!0},i(s){i||(s&&xe(()=>{i&&(t||(t=Ve(e,wt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=Ve(e,wt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&S(e),s&&t&&t.end()}}}function r4(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[o4,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Hd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),$(o,t,r),l&&l.m(o,r),$(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&I(l,1):(l=Hd(),l.c(),I(l,1),l.m(i.parentNode,i)):l&&(re(),P(l,1,1,()=>{l=null}),ae())},i(o){s||(I(e.$$.fragment,o),I(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){V(e,o),o&&S(t),l&&l.d(o),o&&S(i)}}}function a4(n){let e;return{c(){e=y("span"),e.textContent="Disabled",h(e,"class","label")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function u4(n){let e;return{c(){e=y("span"),e.textContent="Enabled",h(e,"class","label label-success")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function zd(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(xe(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function f4(n){let e,t,i,s,l,o,r;function a(p,m){return p[0].options.allowOAuth2Auth?u4:a4}let u=a(n),f=u(n),d=n[1]&&zd();return{c(){e=y("div"),e.innerHTML=`<i class="ri-shield-star-line"></i>
<span class="txt">OAuth2</span>`,t=E(),i=y("div"),s=E(),f.c(),l=E(),d&&d.c(),o=Se(),h(e,"class","inline-flex"),h(i,"class","flex-fill")},m(p,m){$(p,e,m),$(p,t,m),$(p,i,m),$(p,s,m),f.m(p,m),$(p,l,m),d&&d.m(p,m),$(p,o,m),r=!0},p(p,m){u!==(u=a(p))&&(f.d(1),f=u(p),f&&(f.c(),f.m(l.parentNode,l))),p[1]?d?m&2&&I(d,1):(d=zd(),d.c(),I(d,1),d.m(o.parentNode,o)):d&&(re(),P(d,1,1,()=>{d=null}),ae())},i(p){r||(I(d),r=!0)},o(p){P(d),r=!1},d(p){p&&S(e),p&&S(t),p&&S(i),p&&S(s),f.d(p),p&&S(l),d&&d.d(p),p&&S(o)}}}function c4(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Minimum password length"),s=E(),l=y("input"),h(e,"for",i=n[12]),h(l,"type","number"),h(l,"id",o=n[12]),l.required=!0,h(l,"min","6"),h(l,"max","72")},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].options.minPasswordLength),r||(a=J(l,"input",n[10]),r=!0)},p(u,f){f&4096&&i!==(i=u[12])&&h(e,"for",i),f&4096&&o!==(o=u[12])&&h(l,"id",o),f&1&&gt(l.value)!==u[0].options.minPasswordLength&&ue(l,u[0].options.minPasswordLength)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function d4(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("input"),i=E(),s=y("label"),l=y("span"),l.textContent="Always require email",o=E(),r=y("i"),h(e,"type","checkbox"),h(e,"id",t=n[12]),h(l,"class","txt"),h(r,"class","ri-information-line txt-sm link-hint"),h(s,"for",a=n[12])},m(d,p){$(d,e,p),e.checked=n[0].options.requireEmail,$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=[J(e,"change",n[11]),Ee(Ue.call(null,r,{text:`The constraint is applied only for new records.
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(d,p){p&4096&&t!==(t=d[12])&&h(e,"id",t),p&1&&(e.checked=d[0].options.requireEmail),p&4096&&a!==(a=d[12])&&h(s,"for",a)},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,Ie(f)}}}function p4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k;return s=new ul({props:{single:!0,$$slots:{header:[QC],default:[ZC]},$$scope:{ctx:n}}}),o=new ul({props:{single:!0,$$slots:{header:[l4],default:[n4]},$$scope:{ctx:n}}}),a=new ul({props:{single:!0,$$slots:{header:[f4],default:[r4]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[c4,({uniqueId:w})=>({12:w}),({uniqueId:w})=>w?4096:0]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[d4,({uniqueId:w})=>({12:w}),({uniqueId:w})=>w?4096:0]},$$scope:{ctx:n}}}),{c(){e=y("h4"),e.textContent="Auth methods",t=E(),i=y("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=y("hr"),d=E(),p=y("h4"),p.textContent="General",m=E(),z(_.$$.fragment),b=E(),z(g.$$.fragment),h(e,"class","section-title"),h(i,"class","accordions"),h(p,"class","section-title")},m(w,T){$(w,e,T),$(w,t,T),$(w,i,T),j(s,i,null),v(i,l),j(o,i,null),v(i,r),j(a,i,null),$(w,u,T),$(w,f,T),$(w,d,T),$(w,p,T),$(w,m,T),j(_,w,T),$(w,b,T),j(g,w,T),k=!0},p(w,[T]){const C={};T&8201&&(C.$$scope={dirty:T,ctx:w}),s.$set(C);const M={};T&8197&&(M.$$scope={dirty:T,ctx:w}),o.$set(M);const O={};T&8195&&(O.$$scope={dirty:T,ctx:w}),a.$set(O);const D={};T&12289&&(D.$$scope={dirty:T,ctx:w}),_.$set(D);const A={};T&12289&&(A.$$scope={dirty:T,ctx:w}),g.$set(A)},i(w){k||(I(s.$$.fragment,w),I(o.$$.fragment,w),I(a.$$.fragment,w),I(_.$$.fragment,w),I(g.$$.fragment,w),k=!0)},o(w){P(s.$$.fragment,w),P(o.$$.fragment,w),P(a.$$.fragment,w),P(_.$$.fragment,w),P(g.$$.fragment,w),k=!1},d(w){w&&S(e),w&&S(t),w&&S(i),V(s),V(o),V(a),w&&S(u),w&&S(f),w&&S(d),w&&S(p),w&&S(m),V(_,w),w&&S(b),V(g,w)}}}function m4(n,e,t){let i,s,l,o;Ke(n,ii,b=>t(4,o=b));let{collection:r=new _n}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(b){n.$$.not_equal(r.options.exceptEmailDomains,b)&&(r.options.exceptEmailDomains=b,t(0,r))}function d(b){n.$$.not_equal(r.options.onlyEmailDomains,b)&&(r.options.onlyEmailDomains=b,t(0,r))}function p(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=gt(this.value),t(0,r)}function _(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=b=>{"collection"in b&&t(0,r=b.collection)},n.$$.update=()=>{var b,g,k,w;n.$$.dirty&1&&r.isAuth&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!H.isEmpty((b=o==null?void 0:o.options)==null?void 0:b.allowEmailAuth)||!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.onlyEmailDomains)||!H.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!H.isEmpty((w=o==null?void 0:o.options)==null?void 0:w.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,d,p,m,_]}class h4 extends ve{constructor(e){super(),be(this,e,m4,p4,_e,{collection:0})}}function Bd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Ud(n,e,t){const i=n.slice();return i[17]=e[t],i}function Wd(n,e,t){const i=n.slice();return i[17]=e[t],i}function Yd(n){let e;return{c(){e=y("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function Kd(n){var r;let e,t,i,s,l=n[3]&&Jd(n),o=!((r=n[2])!=null&&r.isView)&&Zd(n);return{c(){e=y("h6"),e.textContent="Changes:",t=E(),i=y("ul"),l&&l.c(),s=E(),o&&o.c(),h(i,"class","changes-list svelte-xqpcsf")},m(a,u){$(a,e,u),$(a,t,u),$(a,i,u),l&&l.m(i,null),v(i,s),o&&o.m(i,null)},p(a,u){var f;a[3]?l?l.p(a,u):(l=Jd(a),l.c(),l.m(i,s)):l&&(l.d(1),l=null),(f=a[2])!=null&&f.isView?o&&(o.d(1),o=null):o?o.p(a,u):(o=Zd(a)
`),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(b,g){$(b,e,g),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(b,g){var k,w;g&2&&l!==(l=((k=b[1])==null?void 0:k.name)+"")&&le(o,l),g&4&&d!==(d=((w=b[2])==null?void 0:w.name)+"")&&le(p,d)},d(b){b&&S(e)}}}function Zd(n){let e,t,i,s=n[5],l=[];for(let f=0;f<s.length;f+=1)l[f]=Gd(Wd(n,s,f));let o=n[7],r=[];for(let f=0;f<o.length;f+=1)r[f]=Xd(Ud(n,o,f));let a=n[6],u=[];for(let f=0;f<a.length;f+=1)u[f]=Qd(Bd(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=Se()},m(f,d){for(let p=0;p<l.length;p+=1)l[p]&&l[p].m(f,d);$(f,e,d);for(let p=0;p<r.length;p+=1)r[p]&&r[p].m(f,d);$(f,t,d);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(f,d);$(f,i,d)},p(f,d){if(d&32){s=f[5];let p;for(p=0;p<s.length;p+=1){const m=Wd(f,s,p);l[p]?l[p].p(m,d):(l[p]=Gd(m),l[p].c(),l[p].m(e.parentNode,e))}for(;p<l.length;p+=1)l[p].d(1);l.length=s.length}if(d&128){o=f[7];let p;for(p=0;p<o.length;p+=1){const m=Ud(f,o,p);r[p]?r[p].p(m,d):(r[p]=Xd(m),r[p].c(),r[p].m(t.parentNode,t))}for(;p<r.length;p+=1)r[p].d(1);r.length=o.length}if(d&64){a=f[6];let p;for(p=0;p<a.length;p+=1){const m=Bd(f,a,p);u[p]?u[p].p(m,d):(u[p]=Qd(m),u[p].c(),u[p].m(i.parentNode,i))}for(;p<u.length;p+=1)u[p].d(1);u.length=a.length}},d(f){ct(l,f),f&&S(e),ct(r,f),f&&S(t),ct(u,f),f&&S(i)}}}function Gd(n){let e,t,i,s=n[17].name+"",l,o,r;return{c(){e=y("li"),t=U(`Multiple to single value conversion of field
`),i=y("strong"),l=U(s),o=E(),r=y("em"),r.textContent="(will keep only the last array item)",h(r,"class","txt-sm"),h(e,"class","svelte-xqpcsf")},m(a,u){$(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o),v(e,r)},p(a,u){u&32&&s!==(s=a[17].name+"")&&le(l,s)},d(a){a&&S(e)}}}function Xd(n){let e,t,i,s,l=n[17].originalName+"",o,r,a,u,f,d=n[17].name+"",p;return{c(){e=y("li"),t=y("div"),i=U(`Renamed field
`),s=y("strong"),o=U(l),r=E(),a=y("i"),u=E(),f=y("strong"),p=U(d),h(s,"class","txt-strikethrough txt-hint"),h(a,"class","ri-arrow-right-line txt-sm"),h(f,"class","txt"),h(t,"class","inline-flex"),h(e,"class","svelte-xqpcsf")},m(m,_){$(m,e,_),v(e,t),v(t,i),v(t,s),v(s,o),v(t,r),v(t,a),v(t,u),v(t,f),v(f,p)},p(m,_){_&128&&l!==(l=m[17].originalName+"")&&le(o,l),_&128&&d!==(d=m[17].name+"")&&le(p,d)},d(m){m&&S(e)}}}function Qd(n){let e,t,i,s=n[17].name+"",l,o;return{c(){e=y("li"),t=U("Removed field "),i=y("span"),l=U(s),o=E(),h(i,"class","txt-bold"),h(e,"class","txt-danger svelte-xqpcsf")},m(r,a){$(r,e,a),v(e,t),v(e,i),v(i,l),v(e,o)},p(r,a){a&64&&s!==(s=r[17].name+"")&&le(l,s)},d(r){r&&S(e)}}}function _4(n){let e,t,i,s,l,o,r,a,u=n[6].length&&Yd(),f=n[8]&&Kd(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=E(),s=y("div"),l=y("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),h(t,"class","icon"),h(s,"class","content txt-bold"),h(e,"class","alert alert-warning")},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),v(s,o),u&&u.m(s,null),$(d,r,p),f&&f.m(d,p),$(d,a,p)},p(d,p){d[6].length?u||(u=Yd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),d[8]?f?f.p(d,p):(f=Kd(d),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(d){d&&S(e),u&&u.d(),d&&S(r),f&&f.d(d),d&&S(a)}}}function g4(n){let e;return{c(){e=y("h4"),e.textContent="Confirm collection changes"},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function b4(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn btn-expanded")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),e.focus(),s||(l=[J(e,"click",n[11]),J(i,"click",n[12])],s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,Ie(l)}}}function v4(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[b4],header:[g4],default:[_4]},$$scope:{ctx:n}};return e=new vn({props:i}),n[13](e),e.$on("hide",n[14]),e.$on("show",n[15]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16777710&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[13](null),V(e,s)}}}function y4(n,e,t){let i,s,l,o,r;const a=St();let u,f,d;async function p(C,M){t(1,f=C),t(2,d=M),await an(),i||s.length||l.length||o.length?u==null||u.show():_()}function m(){u==null||u.hide()}function _(){m(),a("confirm")}const b=()=>m(),g=()=>_();function k(C){se[C?"unshift":"push"](()=>{u=C,t(4,u)})}function w(C){de.call(this,n,C)}function T(C){de.call(this,n,C)}return n.$$.update=()=>{var C,M,O;n.$$.dirty&6&&t(3,i=(f==null?void 0:f.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(7,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(6,l=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(5,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>{var L,N,R;const A=(L=f==null?void 0:f.schema)==null?void 0:L.find(F=>F.id==D.id);return A?((N=A.options)==null?void 0:N.maxSelect)!=1&&((R=D.options)==null?void 0:R.maxSelect)==1:!1}))||[]),n.$$.dirty&12&&t(8,r=!(d!=null&&d.isView)||i)},[m,f,d,i,u,o,l,s,r,_,p,b,g,k,w,T]}class k4 extends ve{constructor(e){super(),be(this,e,y4,v4,_e,{show:10,hide:0})}get show(){return this.$$.ctx[10]}get hide(){return this.$$.ctx[0]}}function xd(n,e,t){const i=n.slice();return i[47]=e[t][0],i[48]=e[t][1],i}function w4(n){let e,t,i;function s(o){n[33](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new OC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function S4(n){let e,t,i;function s(o){n[32](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new UC({props:l}),se.push(()=>ge(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ep(n){let e,t,i,s;function l(r){n[34](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new qC({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item active")},m(r,a){$(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],we(()=>i=!1)),t.$set(u)},i(r){s||(I(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&S(e),V(t)}}}function tp(n){let e,t,i,s;function l(r){n[35](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new h4({props:o}),se.push(()=>ge(t,"collection",l)),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tab-item"),x(e,"active",n[3]===As)},m(r,a){$(r,e,a),j(t,e,null),s=!0},p
2023-03-19 16:14:44 +08:00
<span class="txt">Duplicate</span>`,t=E(),i=y("button"),i.innerHTML=`<i class="ri-delete-bin-7-line"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable"),h(i,"type","button"),h(i,"class","dropdown-item txt-danger closable")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=[J(e,"click",n[24]),J(i,"click",Cn(pt(n[25])))],s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,Ie(l)}}}function ip(n){let e,t,i,s;return i=new Vn({props:{class:"dropdown dropdown-right dropdown-nowrap m-t-5",$$slots:{default:[C4]},$$scope:{ctx:n}}}),{c(){e=y("i"),t=E(),z(i.$$.fragment),h(e,"class","ri-arrow-down-s-fill")},m(l,o){$(l,e,o),$(l,t,o),j(i,l,o),s=!0},p(l,o){const r={};o[0]&68|o[1]&1048576&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&S(e),l&&S(t),V(i,l)}}}function sp(n){let e,t,i,s,l,o=n[48]+"",r,a,u,f,d;function p(){return n[27](n[47])}return{c(){e=y("button"),t=y("i"),s=E(),l=y("span"),r=U(o),a=U(" collection"),u=E(),h(t,"class",i=Mi(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb"),h(l,"class","txt"),h(e,"type","button"),h(e,"class","dropdown-item closable"),x(e,"selected",n[47]==n[2].type)},m(m,_){$(m,e,_),v(e,t),v(e,s),v(e,l),v(l,r),v(l,a),v(e,u),f||(d=J(e,"click",p),f=!0)},p(m,_){n=m,_[0]&64&&i!==(i=Mi(H.getCollectionTypeIcon(n[47]))+" svelte-12y0yzb")&&h(t,"class",i),_[0]&64&&o!==(o=n[48]+"")&&le(r,o),_[0]&68&&x(e,"selected",n[47]==n[2].type)},d(m){m&&S(e),f=!1,d()}}}function C4(n){let e,t=Object.entries(n[6]),i=[];for(let s=0;s<t.length;s+=1)i[s]=sp(xd(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);$(s,e,l)},p(s,l){if(l[0]&131140){t=Object.entries(s[6]);let o;for(o=0;o<t.length;o+=1){const r=xd(s,t,o);i[o]?i[o].p(r,l):(i[o]=sp(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){ct(i,s),s&&S(e)}}}function lp(n){let e;return{c(){e=y("div"),e.textContent="System collection",h(e,"class","help-block")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function M4(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k=(n[6][n[2].type]||"N/A")+"",w,T,C,M,O,D,A,L,N,R=n[2].$isNew&&ip(n),F=n[2].system&&lp();return{c(){e=y("label"),t=U("Name"),s=E(),l=y("input"),f=E(),d=y("div"),p=y("button"),m=y("span"),_=E(),b=y("span"),g=U("Type: "),w=U(k),T=E(),R&&R.c(),O=E(),F&&F.c(),D=Se(),h(e,"for",i=n[46]),h(l,"type","text"),h(l,"id",o=n[46]),l.required=!0,l.disabled=n[13],h(l,"spellcheck","false"),l.autofocus=r=n[2].$isNew,h(l,"placeholder",a=n[2].isAuth?'eg. "users"':'eg. "posts"'),l.value=u=n[2].name,h(b,"class","txt"),h(p,"type","button"),h(p,"class",C="btn btn-sm p-r-10 p-l-10 "+(n[2].$isNew?"btn-outline":"btn-transparent")),p.disabled=M=!n[2].$isNew,h(d,"class","form-field-addon")},m(q,B){$(q,e,B),v(e,t),$(q,s,B),$(q,l,B),$(q,f,B),$(q,d,B),v(d,p),v(p,m),v(p,_),v(p,b),v(b,g),v(b,w),v(p,T),R&&R.m(p,null),$(q,O,B),F&&F.m(q,B),$(q,D,B),A=!0,n[2].$isNew&&l.focus(),L||(N=J(l,"input",n[26]),L=!0)},p(q,B){(!A||B[1]&32768&&i!==(i=q[46]))&&h(e,"for",i),(!A||B[1]&32768&&o!==(o=q[46]))&&h(l,"id",o),(!A||B[0]&8192)&&(l.disabled=q[13]),(!A||B[0]&4&&r!==(r=q[2].$isNew))&&(l.autofocus=r),(!A||B[0]&4&&a!==(a=q[2].isAuth?'eg. "users"':'eg. "posts"'))&&h(l,"placeholder",a),(!A||B[0]&4&&u!==(u=q[2].name)&&l.value!==u)&&(l.value=u),(!A||B[0]&68)&&k!==(k=(q[6][q[2].type]||"N/A")+"")&&le(w,k),q[2].$isNew?R?(R.p(q,B),B[0]&4&&I(R,1)):(R=ip(q),R.c(),I(R,1),R.m(p,null)):R&&(re(),P(R,1,1,()=>{R=null}),ae()),(!A||B[0]&4&&C!==(C="btn btn-sm p-r-10 p-l-10 "+(q[2].$isNew?"btn-outline":"btn-transparent")))&&h(p,"class",C),(!A||B[0]&4&&M!==(M=!q[2].$isNew))&&(p.disabled=M),q[2].system?F||(F=lp(),F.c(),F.m(D.parentNode,D)):F&&(F.d(1),F=null)},i(q){A||(I(R),A=!0)},o(q){P(R),A=!1},d(q){q&&S(e),q&&S(s),q&&S(l),q&&S(f),q&&S(d),R&&R.d(),q&&S(O),F&&F.d(q),q&&S(D),L=!1,N()}}}function op(n){let e,t,i,s,l,o;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(r,a){$(r,e,a),s=!0,l||(o=Ee(t=Ue.call(null,e,n[11])),l=!0)},p(r,a){t&&Wt(t.update)&&a[0]&2048&&t.update.call(null,r[11])},i(r){s||(r&&xe(()=>{s&&(i||(i=Ve(e,Et,{duration:150,start:.7},!0)),i.run(1))}),s=!0)},o(r){r&&(i||(
2023-03-27 00:19:44 +08:00
<span class="txt">New collection</span>`,h(t,"type","button"),h(t,"class","btn btn-block btn-outline"),h(e,"class","sidebar-footer")},m(l,o){$(l,e,o),v(e,t),i||(s=J(t,"click",n[12]),i=!0)},p:Q,d(l){l&&S(e),i=!1,s()}}}function P4(n){let e,t,i,s,l,o,r,a,u,f,d,p=[],m=new Map,_,b,g,k,w,T,C=n[3];const M=L=>L[15].id;for(let L=0;L<C.length;L+=1){let N=dp(n,C,L),R=M(N);m.set(R,p[L]=hp(R,N))}let O=null;C.length||(O=pp(n));let D=!n[7]&&_p(n),A={};return g=new lu({props:A}),n[13](g),g.$on("save",n[14]),{c(){e=y("aside"),t=y("header"),i=y("div"),s=y("div"),l=y("button"),l.innerHTML='<i class="ri-close-line"></i>',o=E(),r=y("input"),a=E(),u=y("hr"),f=E(),d=y("div");for(let L=0;L<p.length;L+=1)p[L].c();O&&O.c(),_=E(),D&&D.c(),b=E(),z(g.$$.fragment),h(l,"type","button"),h(l,"class","btn btn-xs btn-transparent btn-circle btn-clear"),x(l,"hidden",!n[4]),h(s,"class","form-field-addon"),h(r,"type","text"),h(r,"placeholder","Search collections..."),h(i,"class","form-field search"),x(i,"active",n[4]),h(t,"class","sidebar-header"),h(u,"class","m-t-5 m-b-xs"),h(d,"class","sidebar-content"),x(d,"fade",n[6]),x(d,"sidebar-content-compact",n[3].length>20),h(e,"class","page-sidebar collection-sidebar")},m(L,N){$(L,e,N),v(e,t),v(t,i),v(i,s),v(s,l),v(i,o),v(i,r),ue(r,n[0]),v(e,a),v(e,u),v(e,f),v(e,d);for(let R=0;R<p.length;R+=1)p[R]&&p[R].m(d,null);O&&O.m(d,null),v(e,_),D&&D.m(e,null),$(L,b,N),j(g,L,N),k=!0,w||(T=[J(l,"click",n[10]),J(r,"input",n[11])],w=!0)},p(L,[N]){(!k||N&16)&&x(l,"hidden",!L[4]),N&1&&r.value!==L[0]&&ue(r,L[0]),(!k||N&16)&&x(i,"active",L[4]),N&42&&(C=L[3],p=Dt(p,N,M,1,L,C,m,d,is,hp,null,dp),!C.length&&O?O.p(L,N):C.length?O&&(O.d(1),O=null):(O=pp(L),O.c(),O.m(d,null))),(!k||N&64)&&x(d,"fade",L[6]),(!k||N&8)&&x(d,"sidebar-content-compact",L[3].length>20),L[7]?D&&(D.d(1),D=null):D?D.p(L,N):(D=_p(L),D.c(),D.m(e,null));const R={};g.$set(R)},i(L){k||(I(g.$$.fragment,L),k=!0)},o(L){P(g.$$.fragment,L),k=!1},d(L){L&&S(e);for(let N=0;N<p.length;N+=1)p[N].d();O&&O.d(),D&&D.d(),L&&S(b),n[13](null),V(g,L),w=!1,Ie(T)}}}function L4(){setTimeout(()=>{const n=document.querySelector(".collection-sidebar .sidebar-list-item.active");n&&(n==null||n.scrollIntoView({block:"nearest"}))},0)}function N4(n,e,t){let i,s,l,o,r,a,u;Ke(n,Ei,w=>t(5,o=w)),Ke(n,Li,w=>t(9,r=w)),Ke(n,No,w=>t(6,a=w)),Ke(n,Ms,w=>t(7,u=w));let f,d="";function p(w){Qt(Ei,o=w,o)}const m=()=>t(0,d="");function _(){d=this.value,t(0,d)}const b=()=>f==null?void 0:f.show();function g(w){se[w?"unshift":"push"](()=>{f=w,t(2,f)})}const k=w=>{var T;(T=w.detail)!=null&&T.isNew&&w.detail.collection&&p(w.detail.collection)};return n.$$.update=()=>{n.$$.dirty&512&&r&&L4(),n.$$.dirty&1&&t(1,i=d.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=d!==""),n.$$.dirty&515&&t(3,l=r.filter(w=>w.id==d||w.name.replace(/\s+/g,"").toLowerCase().includes(i)))},[d,i,f,l,s,o,a,u,p,r,m,_,b,g,k]}class F4 extends ve{constructor(e){super(),be(this,e,N4,P4,_e,{})}}function gp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i}function bp(n){n[18]=n[19].default}function vp(n,e,t){const i=n.slice();return i[14]=e[t][0],i[15]=e[t][1],i[21]=t,i}function yp(n){let e;return{c(){e=y("hr"),h(e,"class","m-t-sm m-b-sm")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function kp(n,e){let t,i=e[21]===Object.keys(e[6]).length,s,l,o=e[15].label+"",r,a,u,f,d=i&&yp();function p(){return e[9](e[14])}return{key:n,first:null,c(){t=Se(),d&&d.c(),s=E(),l=y("button"),r=U(o),a=E(),h(l,"type","button"),h(l,"class","sidebar-item"),x(l,"active",e[5]===e[14]),this.first=t},m(m,_){$(m,t,_),d&&d.m(m,_),$(m,s,_),$(m,l,_),v(l,r),v(l,a),u||(f=J(l,"click",p),u=!0)},p(m,_){e=m,_&8&&(i=e[21]===Object.keys(e[6]).length),i?d||(d=yp(),d.c(),d.m(s.parentNode,s)):d&&(d.d(1),d=null),_&8&&o!==(o=e[15].label+"")&&le(r,o),_&40&&x(l,"active",e[5]===e[14])},d(m){m&&S(t),d&&d.d(m),m&&S(s),m&&S(l),u=!1,f()}}}function wp(n){let e,t,i,s={ctx:n,current:null,token:null,hasCatch:!1,pending:j4,then:q4,catch:R4,value:19,blocks:[,,,]};return cu(t=n[15].component,s),{c(){e=Se(),s.block.c()},m(l,o){$(l,e,o),s.block.m(l,s.anchor=o),s.mount=()=>e.parentNode,s.an
2023-03-25 04:30:57 +08:00
`),D&&D.c(),p=E(),_.c(),b=Se(),h(e,"class","flex m-b-base flex-gap-10"),h(l,"class","list picker-list m-b-base svelte-1u8jhky"),h(f,"class","section-title")},m(F,q){$(F,e,q),j(t,e,null),v(e,i),T&&T.m(e,null),$(F,s,q),$(F,l,q);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(l,null);O&&O.m(l,null),$(F,u,q),$(F,f,q),v(f,d),D&&D.m(f,null),$(F,p,q),L[m].m(F,q),$(F,b,q),g=!0,k||(w=Ee(a=lM.call(null,l,n[36])),k=!0)},p(F,q){var Z;const B={};q[0]&4&&(B.value=F[2]),q[0]&1024&&(B.autocompleteCollection=F[10]),t.$set(B),(Z=F[10])!=null&&Z.isView?T&&(T.d(1),T=null):T?T.p(F,q):(T=zp(F),T.c(),T.m(e,null)),q[0]&145324&&(C=F[3],re(),o=Dt(o,q,M,1,F,C,r,l,un,Yp,null,Hp),ae(),!C.length&&O?O.p(F,q):C.length?O&&(O.d(1),O=null):(O=Bp(F),O.c(),O.m(l,null))),a&&Wt(a.update)&&q[0]&2064&&a.update.call(null,F[36]),F[5]>1?D?D.p(F,q):(D=Kp(F),D.c(),D.m(f,null)):D&&(D.d(1),D=null);let Y=m;m=N(F),m===Y?L[m].p(F,q):(re(),P(L[Y],1,1,()=>{L[Y]=null}),ae(),_=L[m],_?_.p(F,q):(_=L[m]=A[m](F),_.c()),I(_,1),_.m(b.parentNode,b))},i(F){if(!g){I(t.$$.fragment,F);for(let q=0;q<C.length;q+=1)I(o[q]);I(_),g=!0}},o(F){P(t.$$.fragment,F);for(let q=0;q<o.length;q+=1)P(o[q]);P(_),g=!1},d(F){F&&S(e),V(t),T&&T.d(),F&&S(s),F&&S(l);for(let q=0;q<o.length;q+=1)o[q].d();O&&O.d(),F&&S(u),F&&S(f),D&&D.d(),F&&S(p),L[m].d(F),F&&S(b),k=!1,w()}}}function yM(n){var r;let e,t,i,s=(((r=n[10])==null?void 0:r.name)||"")+"",l,o;return{c(){e=y("h4"),t=U("Select "),i=y("strong"),l=U(s),o=U(" records")},m(a,u){$(a,e,u),v(e,t),v(e,i),v(i,l),v(e,o)},p(a,u){var f;u[0]&1024&&s!==(s=(((f=a[10])==null?void 0:f.name)||"")+"")&&le(l,s)},d(a){a&&S(e)}}}function kM(n){let e,t,i,s,l;return{c(){e=y("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=y("button"),i.innerHTML='<span class="txt">Save selection</span>',h(e,"type","button"),h(e,"class","btn btn-transparent"),h(i,"type","button"),h(i,"class","btn")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=[J(e,"click",n[28]),J(i,"click",n[29])],s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,Ie(l)}}}function wM(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[kM],header:[yM],default:[vM]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=Fe(o,l[a]);e=new vn({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[10]};return i=new eb({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(a,u){j(e,a,u),$(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&524288?kt(l,[l[0],l[1],zt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const d={};u[0]&1024&&(d.collection=a[10]),i.$set(d)},i(a){s||(I(e.$$.fragment,a),I(i.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),s=!1},d(a){n[39](null),V(e,a),a&&S(t),n[42](null),V(i,a)}}}const Ir=100;function SM(n,e,t){let i,s,l,o,r,a,u,f;const d=["value","field","show","hide"];let p=Ge(e,d),m;Ke(n,Li,Ne=>t(26,m=Ne));const _=St(),b="picker_"+H.randomString(5);let{value:g}=e,{field:k}=e,w,T,C="",M=[],O=[],D=1,A=0,L=!1,N=!1;function R(){return t(2,C=""),t(3,M=[]),t(6,O=[]),q(),B(!0),w==null?void 0:w.show()}function F(){return w==null?void 0:w.hide()}async function q(){const Ne=H.toArray(g);if(!s||!Ne.length)return;t(24,N=!0);let $e=[];const Xe=Ne.slice(),ye=[];for(;Xe.length>0;){const Pe=[];for(const nt of Xe.splice(0,Ir))Pe.push(`id="${nt}"`);ye.push(me.collection(s).getFullList(Ir,{filter:Pe.join("||"),$autoCancel:!1}))}try{await Promise.all(ye).then(Pe=>{$e=$e.concat(...Pe)}),t(6,O=[]);for(const Pe of Ne){const nt=H.findByKey($e,"id",Pe);nt&&O.push(nt)}C.trim()||t(3,M=H.filterDuplicatesByKey(O.concat(M)))}catch(Pe){me.errorResponseHandler(Pe)}t(24,N=!1)}async function B(Ne=!1){if(s){t(4,L=!0),Ne&&(C.trim()?t(3,M=[]):t(3,M=H.toArray(O).slice()));try{const $e=Ne?1:D+1,Xe=await me.collection(s).getList($e,Ir,{filter:C,sort:o!=null&&o.isView?"":"-created",$cancelKey:b+"loadList"});t(3,M=H.filterDuplicatesByKey(M.concat(Xe.items))),D=Xe.page,t(23,A=Xe.totalItems)}catch($e){me.errorResponseHandler($e)}t(4,L=!1)}}function Y(Ne){i==1?t(6,O=[Ne]):u&&(H.pushOrReplaceByKey(O,Ne)
`,h(e,"class","list-item")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function em(n){var p;let e,t,i,s,l,o,r,a,u,f;i=new xo({props:{record:n[15],displayFields:(p=n[2].options)==null?void 0:p.displayFields}});function d(){return n[8](n[15])}return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),o=y("button"),o.innerHTML='<i class="ri-close-line"></i>',r=E(),h(t,"class","content"),h(o,"type","button"),h(o,"class","btn btn-transparent btn-hint btn-sm btn-circle btn-remove"),h(l,"class","actions"),h(e,"class","list-item")},m(m,_){$(m,e,_),v(e,t),j(i,t,null),v(e,s),v(e,l),v(l,o),v(e,r),a=!0,u||(f=[Ee(Ue.call(null,o,"Remove")),J(o,"click",d)],u=!0)},p(m,_){var g;n=m;const b={};_&16&&(b.record=n[15]),_&4&&(b.displayFields=(g=n[2].options)==null?void 0:g.displayFields),i.$set(b)},i(m){a||(I(i.$$.fragment,m),a=!0)},o(m){P(i.$$.fragment,m),a=!1},d(m){m&&S(e),V(i),u=!1,Ie(f)}}}function TM(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,b,g,k,w=n[4],T=[];for(let O=0;O<w.length;O+=1)T[O]=em(Zp(n,w,O));const C=O=>P(T[O],1,1,()=>{T[O]=null});let M=null;return w.length||(M=Xp(n)),{c(){e=y("label"),t=y("i"),s=E(),l=y("span"),r=U(o),u=E(),f=y("div"),d=y("div");for(let O=0;O<T.length;O+=1)T[O].c();M&&M.c(),p=E(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-magic-line"></i>
2023-03-19 16:14:44 +08:00
2023-03-25 04:30:57 +08:00
<span class="txt">Open picker</span>`,h(t,"class",i=Mi(H.getFieldTypeIcon(n[2].type))+" svelte-1ynw0pc"),h(l,"class","txt"),h(e,"for",a=n[14]),h(d,"class","relations-list svelte-1ynw0pc"),h(_,"type","button"),h(_,"class","btn btn-transparent btn-sm btn-block"),h(m,"class","list-item list-item-btn"),h(f,"class","list")},m(O,D){$(O,e,D),v(e,t),v(e,s),v(e,l),v(l,r),$(O,u,D),$(O,f,D),v(f,d);for(let A=0;A<T.length;A+=1)T[A]&&T[A].m(d,null);M&&M.m(d,null),v(f,p),v(f,m),v(m,_),b=!0,g||(k=J(_,"click",n[9]),g=!0)},p(O,D){if((!b||D&4&&i!==(i=Mi(H.getFieldTypeIcon(O[2].type))+" svelte-1ynw0pc"))&&h(t,"class",i),(!b||D&4)&&o!==(o=O[2].name+"")&&le(r,o),(!b||D&16384&&a!==(a=O[14]))&&h(e,"for",a),D&181){w=O[4];let A;for(A=0;A<w.length;A+=1){const L=Zp(O,w,A);T[A]?(T[A].p(L,D),I(T[A],1)):(T[A]=em(L),T[A].c(),I(T[A],1),T[A].m(d,null))}for(re(),A=w.length;A<T.length;A+=1)C(A);ae(),!w.length&&M?M.p(O,D):w.length?M&&(M.d(1),M=null):(M=Xp(O),M.c(),M.m(d,null))}},i(O){if(!b){for(let D=0;D<w.length;D+=1)I(T[D]);b=!0}},o(O){T=T.filter(Boolean);for(let D=0;D<T.length;D+=1)P(T[D]);b=!1},d(O){O&&S(e),O&&S(u),O&&S(f),ct(T,O),M&&M.d(),g=!1,k()}}}function CM(n){let e,t,i,s,l={class:"form-field form-field-list "+(n[2].required?"required":""),name:n[2].name,$$slots:{default:[TM,({uniqueId:r})=>({14:r}),({uniqueId:r})=>r?16384:0]},$$scope:{ctx:n}};e=new pe({props:l}),n[10](e);let o={value:n[0],field:n[2]};return i=new $M({props:o}),n[11](i),i.$on("save",n[12]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(r,a){j(e,r,a),$(r,t,a),j(i,r,a),s=!0},p(r,[a]){const u={};a&4&&(u.class="form-field form-field-list "+(r[2].required?"required":"")),a&4&&(u.name=r[2].name),a&2113591&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a&1&&(f.value=r[0]),a&4&&(f.field=r[2]),i.$set(f)},i(r){s||(I(e.$$.fragment,r),I(i.$$.fragment,r),s=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),s=!1},d(r){n[10](null),V(e,r),r&&S(t),n[11](null),V(i,r)}}}const tm=100;function MM(n,e,t){let i,{value:s}=e,{picker:l}=e,{field:o=new bn}=e,r,a=[],u=!1;f();async function f(){var C,M;const k=H.toArray(s);if(!((C=o==null?void 0:o.options)!=null&&C.collectionId)||!k.length){t(4,a=[]),t(5,u=!1);return}t(5,u=!0);const w=k.slice(),T=[];for(;w.length>0;){const O=[];for(const D of w.splice(0,tm))O.push(`id="${D}"`);T.push(me.collection((M=o==null?void 0:o.options)==null?void 0:M.collectionId).getFullList(tm,{filter:O.join("||"),$autoCancel:!1}))}try{let O=[];await Promise.all(T).then(D=>{O=O.concat(...D)});for(const D of k){const A=H.findByKey(O,"id",D);A&&a.push(A)}t(4,a)}catch(O){me.errorResponseHandler(O)}t(5,u=!1)}function d(k){var w;H.removeByKey(a,"id",k.id),t(4,a),i?t(0,s=a.map(T=>T.id)):t(0,s=((w=a[0])==null?void 0:w.id)||"")}const p=k=>d(k),m=()=>l==null?void 0:l.show();function _(k){se[k?"unshift":"push"](()=>{r=k,t(3,r)})}function b(k){se[k?"unshift":"push"](()=>{l=k,t(1,l)})}const g=k=>{var w;t(4,a=k.detail||[]),t(0,s=i?a.map(T=>T.id):((w=a[0])==null?void 0:w.id)||"")};return n.$$set=k=>{"value"in k&&t(0,s=k.value),"picker"in k&&t(1,l=k.picker),"field"in k&&t(2,o=k.field)},n.$$.update=()=>{var k;n.$$.dirty&4&&t(6,i=((k=o.options)==null?void 0:k.maxSelect)!=1),n.$$.dirty&9&&typeof s<"u"&&(r==null||r.changed())},[s,l,o,r,a,u,i,d,p,m,_,b,g]}class OM extends ve{constructor(e){super(),be(this,e,MM,CM,_e,{value:0,picker:1,field:2})}}const DM=["Activate","AddUndo","BeforeAddUndo","BeforeExecCommand","BeforeGetContent","BeforeRenderUI","BeforeSetContent","BeforePaste","Blur","Change","ClearUndos","Click","ContextMenu","Copy","Cut","Dblclick","Deactivate","Dirty","Drag","DragDrop","DragEnd","DragGesture","DragOver","Drop","ExecCommand","Focus","FocusIn","FocusOut","GetContent","Hide","Init","KeyDown","KeyPress","KeyUp","LoadContent","MouseDown","MouseEnter","MouseLeave","MouseMove","MouseOut","MouseOver","MouseUp","NodeChange","ObjectResizeStart","ObjectResized","ObjectSelected","Paste","PostProcess","PostRender","PreProcess","ProgressState","Redo","Remove","Reset","ResizeEditor","SaveContent","SelectionChange","SetAttrib","SetContent","Show","Submit","Undo","VisualAid"],EM=(n,
2023-03-19 16:14:44 +08:00
...
2023-03-25 04:48:32 +08:00
-----END PRIVATE KEY-----`),h(a,"class","help-block")},m(d,p){$(d,e,p),v(e,t),$(d,s,p),$(d,l,p),ue(l,n[5]),$(d,r,p),$(d,a,p),u||(f=J(l,"input",n[16]),u=!0)},p(d,p){p&8388608&&i!==(i=d[23])&&h(e,"for",i),p&8388608&&o!==(o=d[23])&&h(l,"id",o),p&32&&ue(l,d[5])},d(d){d&&S(e),d&&S(s),d&&S(l),d&&S(r),d&&S(a),u=!1,f()}}}function rO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[nO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[iO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[sO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[lO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),b=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[oO,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=y("form"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),a=E(),u=y("div"),z(f.$$.fragment),d=E(),p=y("div"),z(m.$$.fragment),_=E(),z(b.$$.fragment),h(i,"class","col-lg-6"),h(o,"class","col-lg-6"),h(u,"class","col-lg-6"),h(p,"class","col-lg-6"),h(t,"class","grid"),h(e,"id",n[9]),h(e,"autocomplete","off")},m(T,C){$(T,e,C),v(e,t),v(t,i),j(s,i,null),v(t,l),v(t,o),j(r,o,null),v(t,a),v(t,u),j(f,u,null),v(t,d),v(t,p),j(m,p,null),v(t,_),j(b,t,null),g=!0,k||(w=J(e,"submit",pt(n[17])),k=!0)},p(T,C){const M={};C&25165828&&(M.$$scope={dirty:C,ctx:T}),s.$set(M);const O={};C&25165832&&(O.$$scope={dirty:C,ctx:T}),r.$set(O);const D={};C&25165840&&(D.$$scope={dirty:C,ctx:T}),f.$set(D);const A={};C&25165888&&(A.$$scope={dirty:C,ctx:T}),m.$set(A);const L={};C&25165856&&(L.$$scope={dirty:C,ctx:T}),b.$set(L)},i(T){g||(I(s.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(m.$$.fragment,T),I(b.$$.fragment,T),g=!0)},o(T){P(s.$$.fragment,T),P(r.$$.fragment,T),P(f.$$.fragment,T),P(m.$$.fragment,T),P(b.$$.fragment,T),g=!1},d(T){T&&S(e),V(s),V(r),V(f),V(m),V(b),k=!1,w()}}}function aO(n){let e;return{c(){e=y("h4"),e.textContent="Generate Apple client secret",h(e,"class","center txt-break")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function uO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("i"),o=E(),r=y("span"),r.textContent="Generate and set secret",h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[7],h(l,"class","ri-key-line"),h(r,"class","txt"),h(s,"type","submit"),h(s,"form",n[9]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],x(s,"btn-loading",n[7])},m(d,p){$(d,e,p),v(e,t),$(d,i,p),$(d,s,p),v(s,l),v(s,o),v(s,r),u||(f=J(e,"click",n[0]),u=!0)},p(d,p){p&128&&(e.disabled=d[7]),p&384&&a!==(a=!d[8]||d[7])&&(s.disabled=a),p&128&&x(s,"btn-loading",d[7])},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,f()}}}function fO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[uO],header:[aO],default:[rO]},$$scope:{ctx:n}};return e=new vn({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[19](null),V(e,s)}}}const mo=15777e3;function cO(n,e,t){let i;const s=St(),l="apple_secret_"+H.randomString(5);let o,r,a,u,f,d,p=!1;function m(N={}){t(2,r=N.clientId||""),t(3,a=N.teamId||""),t(4,u=N.keyId||""),t(5,f=N.privateKey||""),t(6,d=N.duration||mo),gn({}),o==null||o.show()}function _(){return o==null?void 0:o.hide()}async function b(){t(7,p=!0);try{const N=await me.settings.generateAppleClientSecret(r,a,u,f.trim(),d);t(7,p=!1),Yt("Successfully generated client secret."),s("submit",N),o==null||o.hide()}catch(N){me.errorResponseHandler(
Updated: ${n[3].updated}`,position:"left"})),s=!0)},p(o,r){i&&Wt(i.update)&&r[0]&8&&i.update.call(null,{text:`Created: ${o[3].created}
2023-03-25 04:30:57 +08:00
Updated: ${o[3].updated}`,position:"left"})},d(o){o&&S(e),s=!1,l()}}}function wO(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b=!n[6]&&om(n);return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",l=E(),o=y("span"),a=E(),b&&b.c(),u=E(),f=y("input"),h(t,"class",H.getFieldTypeIcon("primary")),h(s,"class","txt"),h(o,"class","flex-fill"),h(e,"for",r=n[56]),h(f,"type","text"),h(f,"id",d=n[56]),h(f,"placeholder","Leave empty to auto generate..."),h(f,"minlength","15"),f.readOnly=p=!n[6]},m(g,k){$(g,e,k),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),$(g,a,k),b&&b.m(g,k),$(g,u,k),$(g,f,k),ue(f,n[3].id),m||(_=J(f,"input",n[30]),m=!0)},p(g,k){k[1]&33554432&&r!==(r=g[56])&&h(e,"for",r),g[6]?b&&(b.d(1),b=null):b?b.p(g,k):(b=om(g),b.c(),b.m(u.parentNode,u)),k[1]&33554432&&d!==(d=g[56])&&h(f,"id",d),k[0]&64&&p!==(p=!g[6])&&(f.readOnly=p),k[0]&8&&f.value!==g[3].id&&ue(f,g[3].id)},d(g){g&&S(e),g&&S(a),b&&b.d(g),g&&S(u),g&&S(f),m=!1,_()}}}function rm(n){var u,f;let e,t,i,s,l;function o(d){n[31](d)}let r={collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new x4({props:r}),se.push(()=>ge(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&am();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(d,p){j(e,d,p),$(d,i,p),a&&a.m(d,p),$(d,s,p),l=!0},p(d,p){var _,b;const m={};p[0]&1&&(m.collection=d[0]),!t&&p[0]&8&&(t=!0,m.record=d[3],we(()=>t=!1)),e.$set(m),(b=(_=d[0])==null?void 0:_.schema)!=null&&b.length?a||(a=am(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(d){l||(I(e.$$.fragment,d),l=!0)},o(d){P(e.$$.fragment,d),l=!1},d(d){V(e,d),d&&S(i),a&&a.d(d),d&&S(s)}}}function am(n){let e;return{c(){e=y("hr")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function SO(n){let e,t,i;function s(o){n[44](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new OM({props:l}),se.push(()=>ge(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function $O(n){let e,t,i,s,l;function o(f){n[41](f,n[53])}function r(f){n[42](f,n[53])}function a(f){n[43](f,n[53])}let u={field:n[53],record:n[3]};return n[3][n[53].name]!==void 0&&(u.value=n[3][n[53].name]),n[4][n[53].name]!==void 0&&(u.uploadedFiles=n[4][n[53].name]),n[5][n[53].name]!==void 0&&(u.deletedFileIndexes=n[5][n[53].name]),e=new sM({props:u}),se.push(()=>ge(e,"value",o)),se.push(()=>ge(e,"uploadedFiles",r)),se.push(()=>ge(e,"deletedFileIndexes",a)),{c(){z(e.$$.fragment)},m(f,d){j(e,f,d),l=!0},p(f,d){n=f;const p={};d[0]&1&&(p.field=n[53]),d[0]&8&&(p.record=n[3]),!t&&d[0]&9&&(t=!0,p.value=n[3][n[53].name],we(()=>t=!1)),!i&&d[0]&17&&(i=!0,p.uploadedFiles=n[4][n[53].name],we(()=>i=!1)),!s&&d[0]&33&&(s=!0,p.deletedFileIndexes=n[5][n[53].name],we(()=>s=!1)),e.$set(p)},i(f){l||(I(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){V(e,f)}}}function TO(n){let e,t,i;function s(o){n[40](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new L5({props:l}),se.push(()=>ge(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CO(n){let e,t,i;function s(o){n[39](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new E5({props:l}),se.push(()=>ge(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[53].name],we(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function MO(n){let e,t,i;function s(o){n[38](o,n[53])}let l={field:n[53]};return n[3][n[53].name]!==void 0&&(l.value=n[3][n[53].name]),e=new C5({props:l}),se.push(()=>ge(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[53]),!t&&r[0]&9&&(t=!0,a.va
<span class="txt">Send verification email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[24]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function pm(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Send password reset email</span>`,h(e,"type","button"),h(e,"class","dropdown-item closable")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function NO(n){let e,t,i,s,l,o,r,a=n[0].isAuth&&!n[2].verified&&n[2].email&&dm(n),u=n[0].isAuth&&n[2].email&&pm(n);return{c(){a&&a.c(),e=E(),u&&u.c(),t=E(),i=y("button"),i.innerHTML=`<i class="ri-file-copy-line"></i>
2023-03-19 16:14:44 +08:00
<span class="txt">Duplicate</span>`,s=E(),l=y("button"),l.innerHTML=`<i class="ri-delete-bin-7-line"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Delete</span>`,h(i,"type","button"),h(i,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item txt-danger closable")},m(f,d){a&&a.m(f,d),$(f,e,d),u&&u.m(f,d),$(f,t,d),$(f,i,d),$(f,s,d),$(f,l,d),o||(r=[J(i,"click",n[26]),J(l,"click",Cn(pt(n[27])))],o=!0)},p(f,d){f[0].isAuth&&!f[2].verified&&f[2].email?a?a.p(f,d):(a=dm(f),a.c(),a.m(e.parentNode,e)):a&&(a.d(1),a=null),f[0].isAuth&&f[2].email?u?u.p(f,d):(u=pm(f),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null)},d(f){a&&a.d(f),f&&S(e),u&&u.d(f),f&&S(t),f&&S(i),f&&S(s),f&&S(l),o=!1,Ie(r)}}}function mm(n){let e,t,i,s,l,o;return{c(){e=y("div"),t=y("button"),t.textContent="Account",i=E(),s=y("button"),s.textContent="Authorized providers",h(t,"type","button"),h(t,"class","tab-item"),x(t,"active",n[11]===es),h(s,"type","button"),h(s,"class","tab-item"),x(s,"active",n[11]===wl),h(e,"class","tabs-header stretched")},m(r,a){$(r,e,a),v(e,t),v(e,i),v(e,s),l||(o=[J(t,"click",n[28]),J(s,"click",n[29])],l=!0)},p(r,a){a[0]&2048&&x(t,"active",r[11]===es),a[0]&2048&&x(s,"active",r[11]===wl)},d(r){r&&S(e),l=!1,Ie(o)}}}function FO(n){var b;let e,t=n[6]?"New":"Edit",i,s,l,o=((b=n[0])==null?void 0:b.name)+"",r,a,u,f,d,p,m=!n[6]&&cm(n),_=n[0].isAuth&&!n[6]&&mm(n);return{c(){e=y("h4"),i=U(t),s=E(),l=y("strong"),r=U(o),a=U(" record"),u=E(),m&&m.c(),f=E(),_&&_.c(),d=Se()},m(g,k){$(g,e,k),v(e,i),v(e,s),v(e,l),v(l,r),v(e,a),$(g,u,k),m&&m.m(g,k),$(g,f,k),_&&_.m(g,k),$(g,d,k),p=!0},p(g,k){var w;(!p||k[0]&64)&&t!==(t=g[6]?"New":"Edit")&&le(i,t),(!p||k[0]&1)&&o!==(o=((w=g[0])==null?void 0:w.name)+"")&&le(r,o),g[6]?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(g,k),k[0]&64&&I(m,1)):(m=cm(g),m.c(),I(m,1),m.m(f.parentNode,f)),g[0].isAuth&&!g[6]?_?_.p(g,k):(_=mm(g),_.c(),_.m(d.parentNode,d)):_&&(_.d(1),_=null)},i(g){p||(I(m),p=!0)},o(g){P(m),p=!1},d(g){g&&S(e),g&&S(u),m&&m.d(g),g&&S(f),_&&_.d(g),g&&S(d)}}}function RO(n){let e,t,i,s,l,o=n[6]?"Create":"Save changes",r,a,u,f;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),r=U(o),h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent"),e.disabled=n[9],h(l,"class","txt"),h(s,"type","submit"),h(s,"form",n[14]),h(s,"class","btn btn-expanded"),s.disabled=a=!n[12]||n[9],x(s,"btn-loading",n[9])},m(d,p){$(d,e,p),v(e,t),$(d,i,p),$(d,s,p),v(s,l),v(l,r),u||(f=J(e,"click",n[23]),u=!0)},p(d,p){p[0]&512&&(e.disabled=d[9]),p[0]&64&&o!==(o=d[6]?"Create":"Save changes")&&le(r,o),p[0]&4608&&a!==(a=!d[12]||d[9])&&(s.disabled=a),p[0]&512&&x(s,"btn-loading",d[9])},d(d){d&&S(e),d&&S(i),d&&S(s),u=!1,f()}}}function qO(n){var s;let e,t,i={class:`
2023-03-19 16:14:44 +08:00
record-panel
`+(n[13]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((s=n[0])!=null&&s.isAuth&&!n[6]?"colored-header":"")+`
2023-03-24 04:59:02 +08:00
`,beforeHide:n[45],$$slots:{footer:[RO],header:[FO],default:[LO]},$$scope:{ctx:n}};return e=new vn({props:i}),n[46](e),e.$on("hide",n[47]),e.$on("show",n[48]),{c(){z(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){var a;const r={};o[0]&8257&&(r.class=`
2023-03-19 16:14:44 +08:00
record-panel
`+(l[13]?"overlay-panel-xl":"overlay-panel-lg")+`
`+((a=l[0])!=null&&a.isAuth&&!l[6]?"colored-header":"")+`
2023-03-25 04:30:57 +08:00
`),o[0]&1152&&(r.beforeHide=l[45]),o[0]&6781|o[1]&67108864&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[46](null),V(e,l)}}}const es="form",wl="providers";function hm(n){return JSON.stringify(n)}function jO(n,e,t){let i,s,l,o;const r=St(),a="record_"+H.randomString(5);let{collection:u}=e,f,d=null,p=new di,m=!1,_=!1,b={},g={},k="",w=es,T=!0;function C(ye){return O(ye),t(10,_=!0),t(11,w=es),f==null?void 0:f.show()}function M(){return f==null?void 0:f.hide()}async function O(ye){gn({}),t(2,d=ye||new di),ye!=null&&ye.$clone?t(3,p=ye.$clone()):t(3,p=new di),t(4,b={}),t(5,g={}),await an(),t(21,k=hm(p))}function D(){if(m||!o||!(u!=null&&u.id))return;t(9,m=!0);const ye=L();let Pe;T?Pe=me.collection(u.id).create(ye):Pe=me.collection(u.id).update(p.id,ye),Pe.then(nt=>{Yt(T?"Successfully created record.":"Successfully updated record."),t(10,_=!1),M(),r("save",nt)}).catch(nt=>{me.errorResponseHandler(nt)}).finally(()=>{t(9,m=!1)})}function A(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>me.collection(d.collectionId).delete(d.id).then(()=>{M(),Yt("Successfully deleted record."),r("delete",d)}).catch(ye=>{me.errorResponseHandler(ye)}))}function L(){const ye=(p==null?void 0:p.$export())||{},Pe=new FormData,nt={id:ye.id};for(const vt of(u==null?void 0:u.schema)||[])nt[vt.name]=!0;u!=null&&u.isAuth&&(nt.username=!0,nt.email=!0,nt.emailVisibility=!0,nt.password=!0,nt.passwordConfirm=!0,nt.verified=!0);for(const vt in ye)nt[vt]&&(typeof ye[vt]>"u"&&(ye[vt]=null),H.addValueToFormData(Pe,vt,ye[vt]));for(const vt in b){const On=H.toArray(b[vt]);for(const rt of On)Pe.append(vt,rt)}for(const vt in g){const On=H.toArray(g[vt]);for(const rt of On)Pe.append(vt+"."+rt,"")}return Pe}function N(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>me.collection(u.id).requestVerification(d.email).then(()=>{Yt(`Successfully sent verification email to ${d.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function R(){!(u!=null&&u.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>me.collection(u.id).requestPasswordReset(d.email).then(()=>{Yt(`Successfully sent password reset email to ${d.email}.`)}).catch(ye=>{me.errorResponseHandler(ye)}))}function F(){l?mn("You have unsaved changes. Do you really want to discard them?",()=>{q()}):q()}async function q(){const ye=d==null?void 0:d.$clone();if(ye){ye.id="",ye.created="",ye.updated="";const Pe=(u==null?void 0:u.schema)||[];for(const nt of Pe)nt.type==="file"&&delete ye[nt.name]}C(ye),await an(),t(21,k="")}const B=()=>M(),Y=()=>N(),Z=()=>R(),ee=()=>F(),ie=()=>A(),X=()=>t(11,w=es),fe=()=>t(11,w=wl);function G(){p.id=this.value,t(3,p)}function ce(ye){p=ye,t(3,p)}function he(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Me(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function je(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function He(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function ke(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Ce(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Je(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function ht(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function Ze(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function We(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}function te(ye,Pe){n.$$.not_equal(b[Pe.name],ye)&&(b[Pe.name]=ye,t(4,b))}function qe(ye,Pe){n.$$.not_equal(g[Pe.name],ye)&&(g[Pe.name]=ye,t(5,g))}function tt(ye,Pe){n.$$.not_equal(p[Pe.name],ye)&&(p[Pe.name]=ye,t(3,p))}const Kt=()=>l&&_?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(10,_=!1),M()}),!1):(gn({}),!0);function Ne(ye){se[ye?"unshift":"push"](()=>{f=ye,t(8,f)})}function $e(ye){de.call(this,n,ye)}function Xe(ye){de.call(this,n,ye)}return n.$$set=ye=>{"collection"in ye&&t(0,u=ye.collection)},
`},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function CD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-secondary btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[40]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function MD(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[39]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function Um(n){let e,t,i,s,l,o,r,a,u,f;function d(){return n[36](n[55])}return{c(){e=y("td"),t=y("div"),i=y("input"),o=E(),r=y("label"),h(i,"type","checkbox"),h(i,"id",s="checkbox_"+n[55].id),i.checked=l=n[6][n[55].id],h(r,"for",a="checkbox_"+n[55].id),h(t,"class","form-field"),h(e,"class","bulk-select-col min-width")},m(p,m){$(p,e,m),v(e,t),v(t,i),v(t,o),v(t,r),u||(f=[J(i,"change",d),J(t,"click",Cn(n[26]))],u=!0)},p(p,m){n=p,m[0]&16&&s!==(s="checkbox_"+n[55].id)&&h(i,"id",s),m[0]&80&&l!==(l=n[6][n[55].id])&&(i.checked=l),m[0]&16&&a!==(a="checkbox_"+n[55].id)&&h(r,"for",a)},d(p){p&&S(e),u=!1,Ie(f)}}}function Wm(n){let e,t,i,s,l,o,r=n[55].id+"",a,u,f;s=new er({props:{value:n[55].id}});let d=n[2].isAuth&&Ym(n);return{c(){e=y("td"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),a=U(r),u=E(),d&&d.c(),h(o,"class","txt"),h(i,"class","label"),h(t,"class","flex flex-gap-5"),h(e,"class","col-type-text col-field-id")},m(p,m){$(p,e,m),v(e,t),v(t,i),j(s,i,null),v(i,l),v(i,o),v(o,a),v(t,u),d&&d.m(t,null),f=!0},p(p,m){const _={};m[0]&16&&(_.value=p[55].id),s.$set(_),(!f||m[0]&16)&&r!==(r=p[55].id+"")&&le(a,r),p[2].isAuth?d?d.p(p,m):(d=Ym(p),d.c(),d.m(t,null)):d&&(d.d(1),d=null)},i(p){f||(I(s.$$.fragment,p),f=!0)},o(p){P(s.$$.fragment,p),f=!1},d(p){p&&S(e),V(s),d&&d.d()}}}function Ym(n){let e;function t(l,o){return l[55].verified?DD:OD}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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&&S(e)}}}function OD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-sm txt-hint")},m(s,l){$(s,e,l),t||(i=Ee(Ue.call(null,e,"Unverified")),t=!0)},d(s){s&&S(e),t=!1,i()}}}function DD(n){let e,t,i;return{c(){e=y("i"),h(e,"class","ri-checkbox-circle-fill txt-sm txt-success")},m(s,l){$(s,e,l),t||(i=Ee(Ue.call(null,e,"Verified")),t=!0)},d(s){s&&S(e),t=!1,i()}}}function Km(n){let e=!n[7].includes("@username"),t,i=!n[7].includes("@email"),s,l=e&&Jm(n),o=i&&Zm(n);return{c(){l&&l.c(),t=E(),o&&o.c(),s=Se()},m(r,a){l&&l.m(r,a),$(r,t,a),o&&o.m(r,a),$(r,s,a)},p(r,a){a[0]&128&&(e=!r[7].includes("@username")),e?l?l.p(r,a):(l=Jm(r),l.c(),l.m(t.parentNode,t)):l&&(l.d(1),l=null),a[0]&128&&(i=!r[7].includes("@email")),i?o?o.p(r,a):(o=Zm(r),o.c(),o.m(s.parentNode,s)):o&&(o.d(1),o=null)},d(r){l&&l.d(r),r&&S(t),o&&o.d(r),r&&S(s)}}}function Jm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].username)),t?AD:ED}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-username")},m(o,r){$(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&&S(e),l.d()}}}function ED(n){let e,t=n[55].username+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].username)},m(l,o){$(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].username+"")&&le(i,t),o[0]&16&&s!==(s=l[55].username)&&h(e,"title",s)},d(l){l&&S(e)}}}function AD(n){let e;return{c(){e=y("span"),e.textContent="N/A",h(e,"class","txt-hint")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Zm(n){let e,t;function i(o,r){return r[0]&16&&(t=null),t==null&&(t=!!H.isEmpty(o[55].email)),t?PD:ID}let s=i(n,[-1,-1,-1]),l=s(n);return{c(){e=y("td"),l.c(),h(e,"class","col-type-text col-field-email")},m(o,r){$(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&&S(e),l.d()}}}function ID(n){let e,t=n[55].email+"",i,s;return{c(){e=y("span"),i=U(t),h(e,"class","txt txt-ellipsis"),h(e,"title",s=n[55].email)},m(l,o){$(l,e,o),v(e,i)},p(l,o){o[0]&16&&t!==(t=l[55].email+"")
<span class="txt">New record</span>`,h(e,"type","button"),h(e,"class","btn btn-expanded")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[18]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function WD(n){let e,t,i,s,l,o=n[2].name+"",r,a,u,f,d,p,m,_,b,g,k,w,T,C,M,O,D,A,L,N,R=!n[10]&&lh(n);d=new Ia({}),d.$on("refresh",n[16]);let F=!n[2].isView&&oh(n);k=new Yo({props:{value:n[0],autocompleteCollection:n[2]}}),k.$on("submit",n[19]);function q(Z){n[21](Z)}function B(Z){n[22](Z)}let Y={collection:n[2]};return n[0]!==void 0&&(Y.filter=n[0]),n[1]!==void 0&&(Y.sort=n[1]),M=new HD({props:Y}),n[20](M),se.push(()=>ge(M,"filter",q)),se.push(()=>ge(M,"sort",B)),M.$on("select",n[23]),M.$on("new",n[24]),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Collections",s=E(),l=y("div"),r=U(o),a=E(),u=y("div"),R&&R.c(),f=E(),z(d.$$.fragment),p=E(),m=y("div"),_=y("button"),_.innerHTML=`<i class="ri-code-s-slash-line"></i>
<span class="txt">API Preview</span>`,b=E(),F&&F.c(),g=E(),z(k.$$.fragment),w=E(),T=y("div"),C=E(),z(M.$$.fragment),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(u,"class","inline-flex gap-5"),h(_,"type","button"),h(_,"class","btn btn-outline"),h(m,"class","btns-group"),h(e,"class","page-header"),h(T,"class","clearfix m-b-base")},m(Z,ee){$(Z,e,ee),v(e,t),v(t,i),v(t,s),v(t,l),v(l,r),v(e,a),v(e,u),R&&R.m(u,null),v(u,f),j(d,u,null),v(e,p),v(e,m),v(m,_),v(m,b),F&&F.m(m,null),$(Z,g,ee),j(k,Z,ee),$(Z,w,ee),$(Z,T,ee),$(Z,C,ee),j(M,Z,ee),A=!0,L||(N=J(_,"click",n[17]),L=!0)},p(Z,ee){(!A||ee[0]&4)&&o!==(o=Z[2].name+"")&&le(r,o),Z[10]?R&&(R.d(1),R=null):R?R.p(Z,ee):(R=lh(Z),R.c(),R.m(u,f)),Z[2].isView?F&&(F.d(1),F=null):F?F.p(Z,ee):(F=oh(Z),F.c(),F.m(m,null));const ie={};ee[0]&1&&(ie.value=Z[0]),ee[0]&4&&(ie.autocompleteCollection=Z[2]),k.$set(ie);const X={};ee[0]&4&&(X.collection=Z[2]),!O&&ee[0]&1&&(O=!0,X.filter=Z[0],we(()=>O=!1)),!D&&ee[0]&2&&(D=!0,X.sort=Z[1],we(()=>D=!1)),M.$set(X)},i(Z){A||(I(d.$$.fragment,Z),I(k.$$.fragment,Z),I(M.$$.fragment,Z),A=!0)},o(Z){P(d.$$.fragment,Z),P(k.$$.fragment,Z),P(M.$$.fragment,Z),A=!1},d(Z){Z&&S(e),R&&R.d(),V(d),F&&F.d(),Z&&S(g),V(k,Z),Z&&S(w),Z&&S(T),Z&&S(C),n[20](null),V(M,Z),L=!1,N()}}}function YD(n){let e,t,i,s,l;return{c(){e=y("h1"),e.textContent="Create your first collection to add records!",t=E(),i=y("button"),i.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,h(e,"class","m-b-10"),h(i,"type","button"),h(i,"class","btn btn-expanded-lg btn-lg")},m(o,r){$(o,e,r),$(o,t,r),$(o,i,r),s||(l=J(i,"click",n[14]),s=!0)},p:Q,d(o){o&&S(e),o&&S(t),o&&S(i),s=!1,l()}}}function KD(n){let e;return{c(){e=y("h1"),e.textContent="You don't have any collections yet.",h(e,"class","m-b-10")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function JD(n){let e,t,i;function s(r,a){return r[10]?KD:YD}let l=s(n),o=l(n);return{c(){e=y("div"),t=y("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=E(),o.c(),h(t,"class","icon"),h(e,"class","placeholder-section m-b-base")},m(r,a){$(r,e,a),v(e,t),v(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&&S(e),o.d()}}}function ZD(n){let e;return{c(){e=y("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,h(e,"class","placeholder-section m-b-base")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function GD(n){let e,t,i,s,l,o,r,a,u,f,d;const p=[UD,BD,zD],m=[];function _(T,C){return T[3]&&!T[9].length?0:T[9].length?2:1}e=_(n),t=m[e]=p[e](n);let b={};s=new lu({props:b}),n[25](s);let g={};o=new U4({props:g}),n[26](o);let k={collection:n[2]};a=new eb({props:k}),n[27](a),a.$on("save",n[28]),a.$on("delete",n[29]);let w={collection:n[2]};return f=new hD({props:w}),n[30](f),{c(){t.c(),i=E(),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment)},m(T,C){m[e].m(T,C),$(T,i,C),j(s,T,C),$(T,l,C),j(o,T,C),$(T,r,C),j(a,T,C),$(T,u,C),j(f,T,C),d=!0},p(T,C){let M=e;e=_(T),e===M?m[e].p(T,C):(re(),P(m[M],1,1,()=>{m[M]=null}),ae(),t=m[e],t?t.p(T,C):(t=m[e]=p[e](T),t.c()),I(t,1),t.m(i.parentNode,i));const O={};s.$set(O);const D={};o.$set(D);const A={};C[0]&4&&(A.collection=T[2]),a.$set(A);const L={};C[0]&4&&(L.collection=T[2]),f.$set(L)},i(T){d||(I(t),I(s.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(f.$$.fragment,T),d=!0)},o(T){P(t),P(s.$$.fragment,T),P(o.$$.fragment,T),P(a.$$.fragment,T),P(f.$$.fragment,T),d=!1},d(T){m[e].d(T),T&&S(i),n[25](null),V(s,T),T&&S(l),n[26](null),V(o,T),T&&S(r),n[27](null),V(a,T),T&&S(u),n[30](null),V(f,T)}}}function XD(n,e,t){let i,s,l,o,r,a,u;Ke(n,Ei,G=>t(2,s=G)),Ke(n,At,G=>t(31,l=G)),Ke(n,No,G=>t(3,o=G)),Ke(n,ba,G=>t(13,r=G)),Ke(n,Li,G=>t(9,a=G)),Ke(n,Ms,G=>t(10,u=G));const f=new URLSearchParams(r);let d,p,m,_,b,g=f.get("filter")||"",k=f.get("sort")||"",w=f.get("collectionId")||(s==null?void 0:s.id);function T(){t(11,w=s==null?void 0:s.id),t(0,g=""),t(1,k="-created"),s!=null&&s.isView&&!H.extractColumnsFromQuery(s.options.query).includes("created")&&t(1,k="")}J1(w);const C=()=>d==null?void 0:d.show(),M=()=>d==null?void 0:d.show(s),O=()=>b==null?void 0:b.load(),D=()=>p==null?void 0:p.show(s),A=()=>m==null?void 0:m.show(),L=G=>t(0,g=G.detail);function N(G){se[G?"unshift":"push"](()=>{b=G,t(8,b)})}function R(G){g=G,t(0,g)}function F(G){k=G,t(1,k)}const q=G=>{s.isView?_.show(G==null?void 0:G.detail):m==null||m.show(G==null?void 0:G.detail)},B=()=>m==null?void 0:m.show();function Y(G){se[G?"unshift":"push"](()=>{d=G,t(4,d)})}function Z(G){se[G?"unshift":"push"](()=>{p=G,t(5,p)})}function ee(G){se[G?"unshift":"push"](()=>{m=G,t(6,m)})}const ie=()=>b==null?void 0:b.reloadLoadedPages(),X=()=>b==null?void 0:b.reloadLoadedPages();function fe(G){se[G?"unshift":"push"](()=>{_=G,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")!=w&&e$(i.get("collectionId")),n.$$.dirty[0]&2052&&s!=null&&s.id&&w!=s.id&&T(),n.$$.dirty[0]&7&&(k||g||s!=null&&s.id)){const G=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:k}).toString();Ai("/collections?"+G)}n.$$.dirty[0]&4&&Qt(At,l=(s==null?void 0:s.name)||"Collections",l)},[g,k,s,o,d,p,m,_,b,a,u,w,i,r,C,M,O,D,A,L,N,R,F,q,B,Y,Z,ee,ie,X,fe]}class QD extends ve{constructor(e){super(),be(this,e,XD,GD,_e,{},null,[-1,-1])}}function xD(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M,O,D,A,L;return{c(){e=y("aside"),t=y("div"),i=y("div"),i.textContent="System",s=E(),l=y("a"),l.innerHTML=`<i class="ri-home-gear-line"></i>
2023-03-19 16:14:44 +08:00
<span class="txt">Application</span>`,o=E(),r=y("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=E(),u=y("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=E(),d=y("div"),d.innerHTML='<span class="txt">Sync</span>',p=E(),m=y("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,_=E(),b=y("a"),b.innerHTML=`<i class="ri-install-line"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Import collections</span>`,g=E(),k=y("div"),k.textContent="Authentication",w=E(),T=y("a"),T.innerHTML=`<i class="ri-lock-password-line"></i>
2023-03-24 04:59:02 +08:00
<span class="txt">Auth providers</span>`,C=E(),M=y("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,O=E(),D=y("a"),D.innerHTML=`<i class="ri-shield-user-line"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Admins</span>`,h(i,"class","sidebar-title"),h(l,"href","/settings"),h(l,"class","sidebar-list-item"),h(r,"href","/settings/mail"),h(r,"class","sidebar-list-item"),h(u,"href","/settings/storage"),h(u,"class","sidebar-list-item"),h(d,"class","sidebar-title"),h(m,"href","/settings/export-collections"),h(m,"class","sidebar-list-item"),h(b,"href","/settings/import-collections"),h(b,"class","sidebar-list-item"),h(k,"class","sidebar-title"),h(T,"href","/settings/auth-providers"),h(T,"class","sidebar-list-item"),h(M,"href","/settings/tokens"),h(M,"class","sidebar-list-item"),h(D,"href","/settings/admins"),h(D,"class","sidebar-list-item"),h(t,"class","sidebar-content"),h(e,"class","page-sidebar settings-sidebar")},m(N,R){$(N,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(t,o),v(t,r),v(t,a),v(t,u),v(t,f),v(t,d),v(t,p),v(t,m),v(t,_),v(t,b),v(t,g),v(t,k),v(t,w),v(t,T),v(t,C),v(t,M),v(t,O),v(t,D),A||(L=[Ee(Bn.call(null,l,{path:"/settings"})),Ee(sn.call(null,l)),Ee(Bn.call(null,r,{path:"/settings/mail/?.*"})),Ee(sn.call(null,r)),Ee(Bn.call(null,u,{path:"/settings/storage/?.*"})),Ee(sn.call(null,u)),Ee(Bn.call(null,m,{path:"/settings/export-collections/?.*"})),Ee(sn.call(null,m)),Ee(Bn.call(null,b,{path:"/settings/import-collections/?.*"})),Ee(sn.call(null,b)),Ee(Bn.call(null,T,{path:"/settings/auth-providers/?.*"})),Ee(sn.call(null,T)),Ee(Bn.call(null,M,{path:"/settings/tokens/?.*"})),Ee(sn.call(null,M)),Ee(Bn.call(null,D,{path:"/settings/admins/?.*"})),Ee(sn.call(null,D))],A=!0)},p:Q,i:Q,o:Q,d(N){N&&S(e),A=!1,Ie(L)}}}class Fi extends ve{constructor(e){super(),be(this,e,null,xD,_e,{})}}function rh(n,e,t){const i=n.slice();return i[30]=e[t],i}function ah(n){let e,t;return e=new pe({props:{class:"form-field readonly",name:"id",$$slots:{default:[eE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&536870914|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function eE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="id",o=E(),r=y("div"),a=y("i"),f=E(),d=y("input"),h(t,"class",H.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"for",l=n[29]),h(a,"class","ri-calendar-event-line txt-disabled"),h(r,"class","form-field-addon"),h(d,"type","text"),h(d,"id",p=n[29]),d.value=m=n[1].id,d.readOnly=!0},m(g,k){$(g,e,k),v(e,t),v(e,i),v(e,s),$(g,o,k),$(g,r,k),v(r,a),$(g,f,k),$(g,d,k),_||(b=Ee(u=Ue.call(null,a,{text:`Created: ${n[1].created}
Updated: ${n[1].updated}`,position:"left"})),_=!0)},p(g,k){k[0]&536870912&&l!==(l=g[29])&&h(e,"for",l),u&&Wt(u.update)&&k[0]&2&&u.update.call(null,{text:`Created: ${g[1].created}
2023-03-25 04:30:57 +08:00
Updated: ${g[1].updated}`,position:"left"}),k[0]&536870912&&p!==(p=g[29])&&h(d,"id",p),k[0]&2&&m!==(m=g[1].id)&&d.value!==m&&(d.value=m)},d(g){g&&S(e),g&&S(o),g&&S(r),g&&S(f),g&&S(d),_=!1,b()}}}function uh(n){let e,t,i,s,l,o,r;function a(){return n[17](n[30])}return{c(){e=y("button"),t=y("img"),s=E(),Yn(t.src,i="./images/avatars/avatar"+n[30]+".svg")||h(t,"src",i),h(t,"alt","Avatar "+n[30]),h(e,"type","button"),h(e,"class",l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))},m(u,f){$(u,e,f),v(e,t),v(e,s),o||(r=J(e,"click",a),o=!0)},p(u,f){n=u,f[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[30]==n[2]?"thumb-active":"thumb-sm"))&&h(e,"class",l)},d(u){u&&S(e),o=!1,r()}}}function tE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Email",o=E(),r=y("input"),h(t,"class",H.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","email"),h(r,"autocomplete","off"),h(r,"id",a=n[29]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[3]),u||(f=J(r,"input",n[18]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&8&&r.value!==d[3]&&ue(r,d[3])},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function fh(n){let e,t;return e=new pe({props:{class:"form-field form-field-toggle",$$slots:{default:[nE,({uniqueId:i})=>({29:i}),({uniqueId:i})=>[i?536870912:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&536870928|s[1]&4&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Change password"),h(e,"type","checkbox"),h(e,"id",t=n[29]),h(s,"for",o=n[29])},m(u,f){$(u,e,f),e.checked=n[4],$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[19]),r=!0)},p(u,f){f[0]&536870912&&t!==(t=u[29])&&h(e,"id",t),f[0]&16&&(e.checked=u[4]),f[0]&536870912&&o!==(o=u[29])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function ch(n){let e,t,i,s,l,o,r,a,u;return s=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[iE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"passwordConfirm",$$slots:{default:[sE,({uniqueId:f})=>({29:f}),({uniqueId:f})=>[f?536870912:0]]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),i=y("div"),z(s.$$.fragment),l=E(),o=y("div"),z(r.$$.fragment),h(i,"class","col-sm-6"),h(o,"class","col-sm-6"),h(t,"class","grid"),h(e,"class","col-12")},m(f,d){$(f,e,d),v(e,t),v(t,i),j(s,i,null),v(t,l),v(t,o),j(r,o,null),u=!0},p(f,d){const p={};d[0]&536871168|d[1]&4&&(p.$$scope={dirty:d,ctx:f}),s.$set(p);const m={};d[0]&536871424|d[1]&4&&(m.$$scope={dirty:d,ctx:f}),r.$set(m)},i(f){u||(I(s.$$.fragment,f),I(r.$$.fragment,f),f&&xe(()=>{u&&(a||(a=Ve(t,wt,{duration:150},!0)),a.run(1))}),u=!0)},o(f){P(s.$$.fragment,f),P(r.$$.fragment,f),f&&(a||(a=Ve(t,wt,{duration:150},!1)),a.run(0)),u=!1},d(f){f&&S(e),V(s),V(r),f&&a&&a.end()}}}function iE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[8]),u||(f=J(r,"input",n[20]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p[0]&536870912&&a!==(a=d[29])&&h(r,"id",a),p[0]&256&&r.value!==d[8]&&ue(r,d[8])},d(d){d&&S(e),d&&S(o),d&&S(r),u=!1,f()}}}function sE(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=y("label"),t=y("i"),i=E(),s=y("span"),s.textContent="Password confirm",o=E(),r=y("input"),h(t,"class","ri-lock-line"),h(s,"class","txt"),h(e,"for",l=n[29]),h(r,"type","password"),h(r,"autocomplete","new-password"),h(r,"id",a=n[29]),r.required=!0},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),$(d,o,p),$(d,r,p),ue(r,n[9]),u||(f=J(r,"input",n[21]),u=!0)},p(d,p){p[0]&536870912&&l!==(l=d[29])&&h(e,"for",l),p
<span class="txt">Delete</span>`,h(e,"type","button"),h(e,"class","dropdown-item txt-danger")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[15]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function aE(n){let e,t,i,s,l,o,r=n[1].$isNew?"Create":"Save changes",a,u,f,d,p,m=!n[1].$isNew&&dh(n);return{c(){m&&m.c(),e=E(),t=y("button"),i=y("span"),i.textContent="Cancel",s=E(),l=y("button"),o=y("span"),a=U(r),h(i,"class","txt"),h(t,"type","button"),h(t,"class","btn btn-transparent"),t.disabled=n[6],h(o,"class","txt"),h(l,"type","submit"),h(l,"form",n[11]),h(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],x(l,"btn-loading",n[6])},m(_,b){m&&m.m(_,b),$(_,e,b),$(_,t,b),v(t,i),$(_,s,b),$(_,l,b),v(l,o),v(o,a),f=!0,d||(p=J(t,"click",n[16]),d=!0)},p(_,b){_[1].$isNew?m&&(re(),P(m,1,1,()=>{m=null}),ae()):m?(m.p(_,b),b[0]&2&&I(m,1)):(m=dh(_),m.c(),I(m,1),m.m(e.parentNode,e)),(!f||b[0]&64)&&(t.disabled=_[6]),(!f||b[0]&2)&&r!==(r=_[1].$isNew?"Create":"Save changes")&&le(a,r),(!f||b[0]&1088&&u!==(u=!_[10]||_[6]))&&(l.disabled=u),(!f||b[0]&64)&&x(l,"btn-loading",_[6])},i(_){f||(I(m),f=!0)},o(_){P(m),f=!1},d(_){m&&m.d(_),_&&S(e),_&&S(t),_&&S(s),_&&S(l),d=!1,p()}}}function uE(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[22],$$slots:{footer:[aE],header:[oE],default:[lE]},$$scope:{ctx:n}};return e=new vn({props:i}),n[23](e),e.$on("hide",n[24]),e.$on("show",n[25]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[22]),l[0]&1886|l[1]&4&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[23](null),V(e,s)}}}function fE(n,e,t){let i;const s=St(),l="admin_"+H.randomString(5);let o,r=new ts,a=!1,u=!1,f=0,d="",p="",m="",_=!1;function b(Z){return k(Z),t(7,u=!0),o==null?void 0:o.show()}function g(){return o==null?void 0:o.hide()}function k(Z){t(1,r=Z!=null&&Z.$clone?Z.$clone():new ts),w()}function w(){t(4,_=!1),t(3,d=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,p=""),t(9,m=""),gn({})}function T(){if(a||!i)return;t(6,a=!0);const Z={email:d,avatar:f};(r.$isNew||_)&&(Z.password=p,Z.passwordConfirm=m);let ee;r.$isNew?ee=me.admins.create(Z):ee=me.admins.update(r.id,Z),ee.then(async ie=>{var X;t(7,u=!1),g(),Yt(r.$isNew?"Successfully created admin.":"Successfully updated admin."),s("save",ie),((X=me.authStore.model)==null?void 0:X.id)===ie.id&&me.authStore.save(me.authStore.token,ie)}).catch(ie=>{me.errorResponseHandler(ie)}).finally(()=>{t(6,a=!1)})}function C(){r!=null&&r.id&&mn("Do you really want to delete the selected admin?",()=>me.admins.delete(r.id).then(()=>{t(7,u=!1),g(),Yt("Successfully deleted admin."),s("delete",r)}).catch(Z=>{me.errorResponseHandler(Z)}))}const M=()=>C(),O=()=>g(),D=Z=>t(2,f=Z);function A(){d=this.value,t(3,d)}function L(){_=this.checked,t(4,_)}function N(){p=this.value,t(8,p)}function R(){m=this.value,t(9,m)}const F=()=>i&&u?(mn("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),g()}),!1):!0;function q(Z){se[Z?"unshift":"push"](()=>{o=Z,t(5,o)})}function B(Z){de.call(this,n,Z)}function Y(Z){de.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.$isNew&&d!=""||_||d!==r.email||f!==r.avatar)},[g,r,f,d,_,o,a,u,p,m,i,l,T,C,b,M,O,D,A,L,N,R,F,q,B,Y]}class cE extends ve{constructor(e){super(),be(this,e,fE,uE,_e,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function ph(n,e,t){const i=n.slice();return i[24]=e[t],i}function dE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="id",h(t,"class",H.getFieldTypeIcon("primary")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function pE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="email",h(t,"class",H.getFieldTypeIcon("email")),h(s,"class","txt"),h(e,"class","col-header-content")},m(l,o){$(l,e,o),v(e,t),v(e,i),v(e,s)},p:Q,d(l){l&&S(e)}}}function mE(n){let e,t,i,s;return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),s.textContent="create
`},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function hh(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear filters</span>',h(e,"type","button"),h(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[17]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function _h(n){let e;return{c(){e=y("span"),e.textContent="You",h(e,"class","label label-warning m-l-5")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function gh(n,e){let t,i,s,l,o,r,a,u,f,d,p,m=e[24].id+"",_,b,g,k,w,T=e[24].email+"",C,M,O,D,A,L,N,R,F,q,B,Y,Z,ee;f=new er({props:{value:e[24].id}});let ie=e[24].id===e[7].id&&_h();A=new hi({props:{date:e[24].created}}),R=new hi({props:{date:e[24].updated}});function X(){return e[15](e[24])}function fe(...G){return e[16](e[24],...G)}return{key:n,first:null,c(){t=y("tr"),i=y("td"),s=y("figure"),l=y("img"),r=E(),a=y("td"),u=y("div"),z(f.$$.fragment),d=E(),p=y("span"),_=U(m),b=E(),ie&&ie.c(),g=E(),k=y("td"),w=y("span"),C=U(T),O=E(),D=y("td"),z(A.$$.fragment),L=E(),N=y("td"),z(R.$$.fragment),F=E(),q=y("td"),q.innerHTML='<i class="ri-arrow-right-line"></i>',B=E(),Yn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||h(l,"src",o),h(l,"alt","Admin avatar"),h(s,"class","thumb thumb-sm thumb-circle"),h(i,"class","min-width"),h(p,"class","txt"),h(u,"class","label"),h(a,"class","col-type-text col-field-id"),h(w,"class","txt txt-ellipsis"),h(w,"title",M=e[24].email),h(k,"class","col-type-email col-field-email"),h(D,"class","col-type-date col-field-created"),h(N,"class","col-type-date col-field-updated"),h(q,"class","col-type-action min-width"),h(t,"tabindex","0"),h(t,"class","row-handle"),this.first=t},m(G,ce){$(G,t,ce),v(t,i),v(i,s),v(s,l),v(t,r),v(t,a),v(a,u),j(f,u,null),v(u,d),v(u,p),v(p,_),v(a,b),ie&&ie.m(a,null),v(t,g),v(t,k),v(k,w),v(w,C),v(t,O),v(t,D),j(A,D,null),v(t,L),v(t,N),j(R,N,null),v(t,F),v(t,q),v(t,B),Y=!0,Z||(ee=[J(t,"click",X),J(t,"keydown",fe)],Z=!0)},p(G,ce){e=G,(!Y||ce&16&&!Yn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&h(l,"src",o);const he={};ce&16&&(he.value=e[24].id),f.$set(he),(!Y||ce&16)&&m!==(m=e[24].id+"")&&le(_,m),e[24].id===e[7].id?ie||(ie=_h(),ie.c(),ie.m(a,null)):ie&&(ie.d(1),ie=null),(!Y||ce&16)&&T!==(T=e[24].email+"")&&le(C,T),(!Y||ce&16&&M!==(M=e[24].email))&&h(w,"title",M);const Me={};ce&16&&(Me.date=e[24].created),A.$set(Me);const je={};ce&16&&(je.date=e[24].updated),R.$set(je)},i(G){Y||(I(f.$$.fragment,G),I(A.$$.fragment,G),I(R.$$.fragment,G),Y=!0)},o(G){P(f.$$.fragment,G),P(A.$$.fragment,G),P(R.$$.fragment,G),Y=!1},d(G){G&&S(t),V(f),ie&&ie.d(),V(A),V(R),Z=!1,Ie(ee)}}}function bE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M=[],O=new Map,D;function A(X){n[11](X)}let L={class:"col-type-text",name:"id",$$slots:{default:[dE]},$$scope:{ctx:n}};n[2]!==void 0&&(L.sort=n[2]),o=new Gt({props:L}),se.push(()=>ge(o,"sort",A));function N(X){n[12](X)}let R={class:"col-type-email col-field-email",name:"email",$$slots:{default:[pE]},$$scope:{ctx:n}};n[2]!==void 0&&(R.sort=n[2]),u=new Gt({props:R}),se.push(()=>ge(u,"sort",N));function F(X){n[13](X)}let q={class:"col-type-date col-field-created",name:"created",$$slots:{default:[mE]},$$scope:{ctx:n}};n[2]!==void 0&&(q.sort=n[2]),p=new Gt({props:q}),se.push(()=>ge(p,"sort",F));function B(X){n[14](X)}let Y={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[hE]},$$scope:{ctx:n}};n[2]!==void 0&&(Y.sort=n[2]),b=new Gt({props:Y}),se.push(()=>ge(b,"sort",B));let Z=n[4];const ee=X=>X[24].id;for(let X=0;X<Z.length;X+=1){let fe=ph(n,Z,X),G=ee(fe);O.set(G,M[X]=gh(G,fe))}let ie=null;return Z.length||(ie=mh(n)),{c(){e=y("table"),t=y("thead"),i=y("tr"),s=y("th"),l=E(),z(o.$$.fragment),a=E(),z(u.$$.fragment),d=E(),z(p.$$.fragment),_=E(),z(b.$$.fragment),k=E(),w=y("th"),T=E(),C=y("tbody");for(let X=0;X<M.length;X+=1)M[X].c();ie&&ie.c(),h(s,"class","min-width"),h(w,"class","col-type-action min-width"),h(e,"class","table"),x(e,"table-loading",n[5])},m(X,fe){$(X,e,fe),v(e,t),v(t,i),v(i,s),v(i,l),j(o,i,null),v(i,a),j(u,i,null),v(i,d),j(p,i,null),v(i,_),j(b,i,null),v(i,k),v(i,w),v(e,T),v(e
<span class="txt">New admin</span>`,m=E(),z(_.$$.fragment),b=E(),g=y("div"),k=E(),z(w.$$.fragment),T=E(),A&&A.c(),C=Se(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(f,"class","flex-fill"),h(p,"type","button"),h(p,"class","btn btn-expanded"),h(e,"class","page-header"),h(g,"class","clearfix m-b-base")},m(L,N){$(L,e,N),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(e,r),j(a,e,null),v(e,u),v(e,f),v(e,d),v(e,p),$(L,m,N),j(_,L,N),$(L,b,N),$(L,g,N),$(L,k,N),j(w,L,N),$(L,T,N),A&&A.m(L,N),$(L,C,N),M=!0,O||(D=J(p,"click",n[9]),O=!0)},p(L,N){(!M||N&64)&&le(o,L[6]);const R={};N&2&&(R.value=L[1]),_.$set(R);const F={};N&134217918&&(F.$$scope={dirty:N,ctx:L}),w.$set(F),L[4].length?A?A.p(L,N):(A=bh(L),A.c(),A.m(C.parentNode,C)):A&&(A.d(1),A=null)},i(L){M||(I(a.$$.fragment,L),I(_.$$.fragment,L),I(w.$$.fragment,L),M=!0)},o(L){P(a.$$.fragment,L),P(_.$$.fragment,L),P(w.$$.fragment,L),M=!1},d(L){L&&S(e),V(a),L&&S(m),V(_,L),L&&S(b),L&&S(g),L&&S(k),V(w,L),L&&S(T),A&&A.d(L),L&&S(C),O=!1,D()}}}function yE(n){let e,t,i,s,l,o;e=new Fi({}),i=new Mn({props:{$$slots:{default:[vE]},$$scope:{ctx:n}}});let r={};return l=new cE({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),$(a,t,u),j(i,a,u),$(a,s,u),j(l,a,u),o=!0},p(a,[u]){const f={};u&134217982&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&S(t),V(i,a),a&&S(s),n[18](null),V(l,a)}}}function kE(n,e,t){let i,s,l;Ke(n,ba,R=>t(21,i=R)),Ke(n,At,R=>t(6,s=R)),Ke(n,Aa,R=>t(7,l=R)),Qt(At,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",d=o.get("sort")||"-created";function p(){return t(5,u=!0),t(4,a=[]),me.admins.getFullList(100,{sort:d||"-created",filter:f}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),m(),me.errorResponseHandler(R,!1))})}function m(){t(4,a=[])}const _=()=>p(),b=()=>r==null?void 0:r.show(),g=R=>t(1,f=R.detail);function k(R){d=R,t(2,d)}function w(R){d=R,t(2,d)}function T(R){d=R,t(2,d)}function C(R){d=R,t(2,d)}const M=R=>r==null?void 0:r.show(R),O=(R,F)=>{(F.code==="Enter"||F.code==="Space")&&(F.preventDefault(),r==null||r.show(R))},D=()=>t(1,f="");function A(R){se[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>p(),N=()=>p();return n.$$.update=()=>{if(n.$$.dirty&6&&d!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:d}).toString();Ai("/settings/admins?"+R),p()}},[p,f,d,r,a,u,s,l,_,b,g,k,w,T,C,M,O,D,A,L,N]}class wE extends ve{constructor(e){super(),be(this,e,kE,yE,_e,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function SE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Email"),s=E(),l=y("input"),h(e,"for",i=n[8]),h(l,"type","email"),h(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0]),l.focus(),r||(a=J(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&h(e,"for",i),f&256&&o!==(o=u[8])&&h(l,"id",o),f&1&&l.value!==u[0]&&ue(l,u[0])},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function $E(n){let e,t,i,s,l,o,r,a,u,f,d;return{c(){e=y("label"),t=U("Password"),s=E(),l=y("input"),r=E(),a=y("div"),u=y("a"),u.textContent="Forgotten password?",h(e,"for",i=n[8]),h(l,"type","password"),h(l,"id",o=n[8]),l.required=!0,h(u,"href","/request-password-reset"),h(u,"class","link-hint"),h(a,"class","help-block")},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[1]),$(p,r,m),$(p,a,m),v(a,u),f||(d=[J(l,"input",n[5]),Ee(sn.call(null,u))],f=!0)},p(p,m){m&256&&i!==(i=p[8])&&h(e,"for",i),m&256&&o!==(o=p[8])&&h(l,"id",o),m&2&&l.value!==p[1]&&ue(l,p[1])},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(r),p&&S(a),f=!1,Ie(d)}}}function TE(n){let e,t,i,s,l,o,r,a,u,f,d;return s=new pe({props:{class:"form-field required",name:"identity",$$slots:{default:[SE,({uniqueId:p})=>({8:p}),({uniqueId:p})=>p?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:
<i class="ri-arrow-right-line"></i>`,h(t,"class","content txt-center m-b-base"),h(a,"type","submit"),h(a,"class","btn btn-lg btn-block btn-next"),x(a,"btn-disabled",n[2]),x(a,"btn-loading",n[2]),h(e,"class","block")},m(p,m){$(p,e,m),v(e,t),v(e,i),j(s,e,null),v(e,l),j(o,e,null),v(e,r),v(e,a),u=!0,f||(d=J(e,"submit",pt(n[3])),f=!0)},p(p,m){const _={};m&769&&(_.$$scope={dirty:m,ctx:p}),s.$set(_);const b={};m&770&&(b.$$scope={dirty:m,ctx:p}),o.$set(b),(!u||m&4)&&x(a,"btn-disabled",p[2]),(!u||m&4)&&x(a,"btn-loading",p[2])},i(p){u||(I(s.$$.fragment,p),I(o.$$.fragment,p),u=!0)},o(p){P(s.$$.fragment,p),P(o.$$.fragment,p),u=!1},d(p){p&&S(e),V(s),V(o),f=!1,d()}}}function CE(n){let e,t;return e=new Kg({props:{$$slots:{default:[TE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function ME(n,e,t){let i;Ke(n,ba,d=>t(6,i=d));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),me.admins.authWithPassword(l,o).then(()=>{Da(),Ai("/")}).catch(()=>{ml("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 OE extends ve{constructor(e){super(),be(this,e,ME,CE,_e,{})}}function DE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M;i=new pe({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[AE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[IE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[PE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field form-field-toggle",name:"meta.hideControls",$$slots:{default:[LE,({uniqueId:D})=>({19:D}),({uniqueId:D})=>D?524288:0]},$$scope:{ctx:n}}});let O=n[3]&&vh(n);return{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),p=y("div"),m=y("div"),_=E(),O&&O.c(),b=E(),g=y("button"),k=y("span"),k.textContent="Save changes",h(t,"class","col-lg-6"),h(l,"class","col-lg-6"),h(m,"class","flex-fill"),h(k,"class","txt"),h(g,"type","submit"),h(g,"class","btn btn-expanded"),g.disabled=w=!n[3]||n[2],x(g,"btn-loading",n[2]),h(p,"class","col-lg-12 flex"),h(e,"class","grid")},m(D,A){$(D,e,A),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),j(a,e,null),v(e,u),j(f,e,null),v(e,d),v(e,p),v(p,m),v(p,_),O&&O.m(p,null),v(p,b),v(p,g),v(g,k),T=!0,C||(M=J(g,"click",n[13]),C=!0)},p(D,A){const L={};A&1572865&&(L.$$scope={dirty:A,ctx:D}),i.$set(L);const N={};A&1572865&&(N.$$scope={dirty:A,ctx:D}),o.$set(N);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:D}),a.$set(R);const F={};A&1572865&&(F.$$scope={dirty:A,ctx:D}),f.$set(F),D[3]?O?O.p(D,A):(O=vh(D),O.c(),O.m(p,b)):O&&(O.d(1),O=null),(!T||A&12&&w!==(w=!D[3]||D[2]))&&(g.disabled=w),(!T||A&4)&&x(g,"btn-loading",D[2])},i(D){T||(I(i.$$.fragment,D),I(o.$$.fragment,D),I(a.$$.fragment,D),I(f.$$.fragment,D),T=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(a.$$.fragment,D),P(f.$$.fragment,D),T=!1},d(D){D&&S(e),V(i),V(o),V(a),V(f),O&&O.d(),C=!1,M()}}}function EE(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function AE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application name"),s=E(),l=y("input"),h(e,"for",i=n[19]),h(l,"type","text"),h(l,"id",o=n[19]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[0].meta.appName),r||(a=J(l,"input",n[8]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&h(e,"for",i),f&524288&&o!==(o=u[19])&&h(l,"id",o),f&1&&l.value!==u[0].meta.appName&&ue(l,u[0].meta.appName)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function IE(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Application url"),s=E(),l=y("inpu
<div class="breadcrumb-item">Application</div></nav>`,t=E(),i=y("div"),s=y("form"),o.c(),h(e,"class","page-header"),h(s,"class","panel"),h(s,"autocomplete","off"),h(i,"class","wrapper")},m(m,_){$(m,e,_),$(m,t,_),$(m,i,_),v(i,s),d[l].m(s,null),r=!0,a||(u=J(s,"submit",pt(n[4])),a=!0)},p(m,_){let b=l;l=p(m),l===b?d[l].p(m,_):(re(),P(d[b],1,1,()=>{d[b]=null}),ae(),o=d[l],o?o.p(m,_):(o=d[l]=f[l](m),o.c()),I(o,1),o.m(s,null))},i(m){r||(I(o),r=!0)},o(m){P(o),r=!1},d(m){m&&S(e),m&&S(t),m&&S(i),d[l].d(),a=!1,u()}}}function FE(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[NE]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),$(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048591&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&S(t),V(i,l)}}}function RE(n,e,t){let i,s,l,o;Ke(n,Ms,O=>t(14,s=O)),Ke(n,wo,O=>t(15,l=O)),Ke(n,At,O=>t(16,o=O)),Qt(At,o="Application settings",o);let r={},a={},u=!1,f=!1,d="";p();async function p(){t(1,u=!0);try{const O=await me.settings.getAll()||{};_(O)}catch(O){me.errorResponseHandler(O)}t(1,u=!1)}async function m(){if(!(f||!i)){t(2,f=!0);try{const O=await me.settings.update(H.filterRedactedProps(a));_(O),Yt("Successfully saved application settings.")}catch(O){me.errorResponseHandler(O)}t(2,f=!1)}}function _(O={}){var D,A;Qt(wo,l=(D=O==null?void 0:O.meta)==null?void 0:D.appName,l),Qt(Ms,s=!!((A=O==null?void 0:O.meta)!=null&&A.hideControls),s),t(0,a={meta:(O==null?void 0:O.meta)||{},logs:(O==null?void 0:O.logs)||{}}),t(6,r=JSON.parse(JSON.stringify(a)))}function b(){t(0,a=JSON.parse(JSON.stringify(r||{})))}function g(){a.meta.appName=this.value,t(0,a)}function k(){a.meta.appUrl=this.value,t(0,a)}function w(){a.logs.maxDays=gt(this.value),t(0,a)}function T(){a.meta.hideControls=this.checked,t(0,a)}const C=()=>b(),M=()=>m();return n.$$.update=()=>{n.$$.dirty&64&&t(7,d=JSON.stringify(r)),n.$$.dirty&129&&t(3,i=d!=JSON.stringify(a))},[a,u,f,i,m,b,r,d,g,k,w,T,C,M]}class qE extends ve{constructor(e){super(),be(this,e,RE,FE,_e,{})}}function jE(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=Fe(l,s[o]);return{c(){e=y("input"),ti(e,l)},m(o,r){$(o,e,r),e.autofocus&&e.focus(),n[7](e),ue(e,n[0]),t||(i=J(e,"input",n[8]),t=!0)},p(o,r){ti(e,l=kt(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&ue(e,o[0])},d(o){o&&S(e),n[7](null),t=!1,i()}}}function VE(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=Fe(a,r[u]);return{c(){e=y("div"),t=y("button"),t.innerHTML='<i class="ri-key-line"></i>',i=E(),s=y("input"),h(t,"type","button"),h(t,"class","btn btn-transparent btn-circle"),h(e,"class","form-field-addon"),ti(s,a)},m(u,f){$(u,e,f),v(e,t),$(u,i,f),$(u,s,f),s.autofocus&&s.focus(),l||(o=[Ee(Ue.call(null,t,{position:"left",text:"Set new value"})),J(t,"click",n[6])],l=!0)},p(u,f){ti(s,a=kt(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&S(e),u&&S(i),u&&S(s),l=!1,Ie(o)}}}function HE(n){let e;function t(l,o){return l[3]?VE:jE}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},m(l,o){s.m(l,o),$(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:Q,o:Q,d(l){s.d(l),l&&S(e)}}}function zE(n,e,t){const i=["value","mask"];let s=Ge(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await an(),r==null||r.focus()}const f=()=>u();function d(m){se[m?"unshift":"push"](()=>{r=m,t(2,r)})}function p(){l=this.value,t(0,l)}return n.$$set=m=>{e=Fe(Fe({},e),Ht(m)),t(5,s=Ge(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,d,p]}class au extends ve{constructor(e){super(),be(this,e,zE,HE,_e,{value:0,mask:1})}}function BE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b;return{c(){e=y("label"),t=U("Subject"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder paramete
2023-03-19 16:14:44 +08:00
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
2023-03-25 04:30:57 +08:00
`,m=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(a,"class","help-block")},m(g,k){$(g,e,k),v(e,t),$(g,s,k),$(g,l,k),ue(l,n[0].subject),$(g,r,k),$(g,a,k),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),_||(b=[J(l,"input",n[13]),J(f,"click",n[14]),J(p,"click",n[15])],_=!0)},p(g,k){k[1]&1&&i!==(i=g[31])&&h(e,"for",i),k[1]&1&&o!==(o=g[31])&&h(l,"id",o),k[0]&1&&l.value!==g[0].subject&&ue(l,g[0].subject)},d(g){g&&S(e),g&&S(s),g&&S(l),g&&S(r),g&&S(a),_=!1,Ie(b)}}}function UE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k;return{c(){e=y("label"),t=U("Action URL"),s=E(),l=y("input"),r=E(),a=y("div"),u=U(`Available placeholder parameters:
2023-03-19 16:14:44 +08:00
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U(`,
`),_=y("button"),_.textContent=`{TOKEN}
2023-03-25 04:30:57 +08:00
`,b=U("."),h(e,"for",i=n[31]),h(l,"type","text"),h(l,"id",o=n[31]),h(l,"spellcheck","false"),l.required=!0,h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(_,"title","Required parameter"),h(a,"class","help-block")},m(w,T){$(w,e,T),v(e,t),$(w,s,T),$(w,l,T),ue(l,n[0].actionUrl),$(w,r,T),$(w,a,T),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,b),g||(k=[J(l,"input",n[16]),J(f,"click",n[17]),J(p,"click",n[18]),J(_,"click",n[19])],g=!0)},p(w,T){T[1]&1&&i!==(i=w[31])&&h(e,"for",i),T[1]&1&&o!==(o=w[31])&&h(l,"id",o),T[0]&1&&l.value!==w[0].actionUrl&&ue(l,w[0].actionUrl)},d(w){w&&S(e),w&&S(s),w&&S(l),w&&S(r),w&&S(a),g=!1,Ie(k)}}}function WE(n){let e,t,i,s;return{c(){e=y("textarea"),h(e,"id",t=n[31]),h(e,"class","txt-mono"),h(e,"spellcheck","false"),h(e,"rows","14"),e.required=!0},m(l,o){$(l,e,o),ue(e,n[0].body),i||(s=J(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&h(e,"id",t),o[0]&1&&ue(e,l[0].body)},i:Q,o:Q,d(l){l&&S(e),i=!1,s()}}}function YE(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=Ot(o,r(n)),se.push(()=>ge(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),$(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,we(()=>t=!1)),u[0]&16&&o!==(o=a[4])){if(e){re();const d=e;P(d.$$.fragment,1,0,()=>{V(d,1)}),ae()}o?(e=Ot(o,r(a)),se.push(()=>ge(e,"value",l)),z(e.$$.fragment),I(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&I(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&S(i),e&&V(e,a)}}}function KE(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C;const M=[YE,WE],O=[];function D(A,L){return A[4]&&!A[5]?0:1}return l=D(n),o=O[l]=M[l](n),{c(){e=y("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=y("div"),u=U(`Available placeholder parameters:
2023-03-19 16:14:44 +08:00
`),f=y("button"),f.textContent=`{APP_NAME}
`,d=U(`,
`),p=y("button"),p.textContent=`{APP_URL}
`,m=U(`,
`),_=y("button"),_.textContent=`{TOKEN}
`,b=U(`,
`),g=y("button"),g.textContent=`{ACTION_URL}
2023-03-27 00:19:44 +08:00
`,k=U("."),h(e,"for",i=n[31]),h(f,"type","button"),h(f,"class","label label-sm link-primary txt-mono"),h(p,"type","button"),h(p,"class","label label-sm link-primary txt-mono"),h(_,"type","button"),h(_,"class","label label-sm link-primary txt-mono"),h(g,"type","button"),h(g,"class","label label-sm link-primary txt-mono"),h(g,"title","Required parameter"),h(a,"class","help-block")},m(A,L){$(A,e,L),v(e,t),$(A,s,L),O[l].m(A,L),$(A,r,L),$(A,a,L),v(a,u),v(a,f),v(a,d),v(a,p),v(a,m),v(a,_),v(a,b),v(a,g),v(a,k),w=!0,T||(C=[J(f,"click",n[22]),J(p,"click",n[23]),J(_,"click",n[24]),J(g,"click",n[25])],T=!0)},p(A,L){(!w||L[1]&1&&i!==(i=A[31]))&&h(e,"for",i);let N=l;l=D(A),l===N?O[l].p(A,L):(re(),P(O[N],1,1,()=>{O[N]=null}),ae(),o=O[l],o?o.p(A,L):(o=O[l]=M[l](A),o.c()),I(o,1),o.m(r.parentNode,r))},i(A){w||(I(o),w=!0)},o(A){P(o),w=!1},d(A){A&&S(e),A&&S(s),O[l].d(A),A&&S(r),A&&S(a),T=!1,Ie(C)}}}function JE(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[BE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[UE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[KE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){j(e,r,a),$(r,t,a),j(i,r,a),$(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const d={};a[0]&2&&(d.name=r[1]+".body"),a[0]&49|a[1]&3&&(d.$$scope={dirty:a,ctx:r}),l.$set(d)},i(r){o||(I(e.$$.fragment,r),I(i.$$.fragment,r),I(l.$$.fragment,r),o=!0)},o(r){P(e.$$.fragment,r),P(i.$$.fragment,r),P(l.$$.fragment,r),o=!1},d(r){V(e,r),r&&S(t),V(i,r),r&&S(s),V(l,r)}}}function yh(n){let e,t,i,s,l;return{c(){e=y("i"),h(e,"class","ri-error-warning-fill txt-danger")},m(o,r){$(o,e,r),i=!0,s||(l=Ee(Ue.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&xe(()=>{i&&(t||(t=Ve(e,Et,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Ve(e,Et,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&S(e),o&&t&&t.end(),s=!1,l()}}}function ZE(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&yh();return{c(){e=y("div"),t=y("i"),i=E(),s=y("span"),l=U(n[2]),o=E(),r=y("div"),a=E(),f&&f.c(),u=Se(),h(t,"class","ri-draft-line"),h(s,"class","txt"),h(e,"class","inline-flex"),h(r,"class","flex-fill")},m(d,p){$(d,e,p),v(e,t),v(e,i),v(e,s),v(s,l),$(d,o,p),$(d,r,p),$(d,a,p),f&&f.m(d,p),$(d,u,p)},p(d,p){p[0]&4&&le(l,d[2]),d[6]?f?p[0]&64&&I(f,1):(f=yh(),f.c(),I(f,1),f.m(u.parentNode,u)):f&&(re(),P(f,1,1,()=>{f=null}),ae())},d(d){d&&S(e),d&&S(o),d&&S(r),d&&S(a),f&&f.d(d),d&&S(u)}}}function GE(n){let e,t;const i=[n[8]];let s={$$slots:{header:[ZE],default:[JE]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=Fe(s,i[l]);return e=new ul({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){z(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?kt(i,[zt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[26](null),V(e,l)}}}let kh;function XE(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=Ge(e,s),o;Ke(n,ii,X=>t(12,o=X));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,d=kh,p=!1;function m(){f==null||f.expand()}function _(){f==null||f.collapse()}function b(){f==null||f.collapseSiblings()}async function g(){d||p||(t(5,p=!0),t(4,d=(await ft(()=>import("./CodeEditor-e7b4fbf7.js"),["./CodeEditor-e7b4fbf7.js","./index-6f704b4c.js"],import.meta.url)).default),kh=d,t(5,p=!1))}function k(X){H.copyToClipboard(X),Wg(`Copied ${X} to clipboard`,2e3)}g();function w(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),C=()=>k("{APP_URL}");function M(){u.action
2023-03-25 04:30:57 +08:00
<span class="txt">Send test email</span>`,h(e,"type","button"),h(e,"class","btn btn-expanded btn-outline")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[26]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function bA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",i=E(),s=y("button"),l=y("span"),l.textContent="Save changes",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3],h(l,"class","txt"),h(s,"type","submit"),h(s,"class","btn btn-expanded"),s.disabled=o=!n[4]||n[3],x(s,"btn-loading",n[3])},m(u,f){$(u,e,f),v(e,t),$(u,i,f),$(u,s,f),v(s,l),r||(a=[J(e,"click",n[24]),J(s,"click",n[25])],r=!0)},p(u,f){f[0]&8&&(e.disabled=u[3]),f[0]&24&&o!==(o=!u[4]||u[3])&&(s.disabled=o),f[0]&8&&x(s,"btn-loading",u[3])},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,Ie(a)}}}function vA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g;const k=[rA,oA],w=[];function T(C,M){return C[2]?0:1}return p=T(n),m=w[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[5]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML="<p>Configure common settings for sending emails.</p>",d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,M){$(C,e,M),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(C,r,M),$(C,a,M),v(a,u),v(u,f),v(u,d),w[p].m(u,null),_=!0,b||(g=J(u,"submit",pt(n[27])),b=!0)},p(C,M){(!_||M[0]&32)&&le(o,C[5]);let O=p;p=T(C),p===O?w[p].p(C,M):(re(),P(w[O],1,1,()=>{w[O]=null}),ae(),m=w[p],m?m.p(C,M):(m=w[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){P(m),_=!1},d(C){C&&S(e),C&&S(r),C&&S(a),w[p].d(),b=!1,g()}}}function yA(n){let e,t,i,s,l,o;e=new Fi({}),i=new Mn({props:{$$slots:{default:[vA]},$$scope:{ctx:n}}});let r={};return l=new lA({props:r}),n[28](l),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),$(a,t,u),j(i,a,u),$(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&63|u[1]&2&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&S(t),V(i,a),a&&S(s),n[28](null),V(l,a)}}}function kA(n,e,t){let i,s,l;Ke(n,At,ie=>t(5,l=ie));const o=[{label:"Auto (StartTLS)",value:!1},{label:"Always",value:!0}],r=[{label:"PLAIN (default)",value:"PLAIN"},{label:"LOGIN",value:"LOGIN"}];Qt(At,l="Mail settings",l);let a,u={},f={},d=!1,p=!1;m();async function m(){t(2,d=!0);try{const ie=await me.settings.getAll()||{};b(ie)}catch(ie){me.errorResponseHandler(ie)}t(2,d=!1)}async function _(){if(!(p||!s)){t(3,p=!0);try{const ie=await me.settings.update(H.filterRedactedProps(f));b(ie),gn({}),Yt("Successfully saved mail settings.")}catch(ie){me.errorResponseHandler(ie)}t(3,p=!1)}}function b(ie={}){t(0,f={meta:(ie==null?void 0:ie.meta)||{},smtp:(ie==null?void 0:ie.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 k(){f.meta.senderName=this.value,t(0,f)}function w(){f.meta.senderAddress=this.value,t(0,f)}function T(ie){n.$$.not_equal(f.meta.verificationTemplate,ie)&&(f.meta.verificationTemplate=ie,t(0,f))}function C(ie){n.$$.not_equal(f.meta.resetPasswordTemplate,ie)&&(f.meta.resetPasswordTemplate=ie,t(0,f))}function M(ie){n.$$.not_equal(f.meta.confirmEmailChangeTemplate,ie)&&(f.meta.confirmEmailChangeTemplate=ie,t(0,f))}function O(){f.smtp.enabled=this.checked,t(0,f)}function D(){f.smtp.host=this.value,t(0,f)}function A(){f.smtp.port=gt(this.value),t(0,f)}function L(ie){n.$$.not_equal(f.smtp.tls,ie)&&(f.smtp.tls=ie,t(0,f))}function N(ie){n.$$.not_equal(f.smtp.authMethod,ie)&&(f.smtp.authMethod=ie,t(0,f))}function R(){f.smtp.username=this.value,t(0,f)}function F(ie){n.$$.not_equal(f.smtp.password,ie)&&(f.smtp.password=ie,t(0,f))}const q=()=>g(),B=()=>_(),Y=()=>a==null?v
2023-03-19 16:14:44 +08:00
the
`),r=y("strong"),u=U(a),f=U(`
to the
`),d=y("strong"),m=U(p),_=U(`.
`),b=y("br"),g=U(`
There are numerous command line tools that can help you, such as:
`),k=y("a"),k.textContent=`rclone
`,w=U(`,
2023-03-25 04:30:57 +08:00
`),T=y("a"),T.textContent=`s5cmd
`,C=U(", etc."),M=E(),O=y("div"),h(i,"class","icon"),h(k,"href","https://github.com/rclone/rclone"),h(k,"target","_blank"),h(k,"rel","noopener noreferrer"),h(k,"class","txt-bold"),h(T,"href","https://github.com/peak/s5cmd"),h(T,"target","_blank"),h(T,"rel","noopener noreferrer"),h(T,"class","txt-bold"),h(l,"class","content"),h(t,"class","alert alert-warning m-0"),h(O,"class","clearfix m-t-base")},m(N,R){$(N,e,R),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),v(l,r),v(r,u),v(l,f),v(l,d),v(d,m),v(l,_),v(l,b),v(l,g),v(l,k),v(l,w),v(l,T),v(l,C),v(e,M),v(e,O),A=!0},p(N,R){var F;(!A||R&1)&&a!==(a=(F=N[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&le(u,a),(!A||R&2)&&p!==(p=N[1].s3.enabled?"S3 storage":"local file system")&&le(m,p)},i(N){A||(N&&xe(()=>{A&&(D||(D=Ve(e,wt,{duration:150},!0)),D.run(1))}),A=!0)},o(N){N&&(D||(D=Ve(e,wt,{duration:150},!1)),D.run(0)),A=!1},d(N){N&&S(e),N&&D&&D.end()}}}function Mh(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M,O;return i=new pe({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[CA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[MA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),u=new pe({props:{class:"form-field required",name:"s3.region",$$slots:{default:[OA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),p=new pe({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[DA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),b=new pe({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[EA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),w=new pe({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[AA,({uniqueId:D})=>({25:D}),({uniqueId:D})=>D?33554432:0]},$$scope:{ctx:n}}}),{c(){e=y("div"),t=y("div"),z(i.$$.fragment),s=E(),l=y("div"),z(o.$$.fragment),r=E(),a=y("div"),z(u.$$.fragment),f=E(),d=y("div"),z(p.$$.fragment),m=E(),_=y("div"),z(b.$$.fragment),g=E(),k=y("div"),z(w.$$.fragment),T=E(),C=y("div"),h(t,"class","col-lg-6"),h(l,"class","col-lg-3"),h(a,"class","col-lg-3"),h(d,"class","col-lg-6"),h(_,"class","col-lg-6"),h(k,"class","col-lg-12"),h(C,"class","col-lg-12"),h(e,"class","grid")},m(D,A){$(D,e,A),v(e,t),j(i,t,null),v(e,s),v(e,l),j(o,l,null),v(e,r),v(e,a),j(u,a,null),v(e,f),v(e,d),j(p,d,null),v(e,m),v(e,_),j(b,_,null),v(e,g),v(e,k),j(w,k,null),v(e,T),v(e,C),O=!0},p(D,A){const L={};A&100663298&&(L.$$scope={dirty:A,ctx:D}),i.$set(L);const N={};A&100663298&&(N.$$scope={dirty:A,ctx:D}),o.$set(N);const R={};A&100663298&&(R.$$scope={dirty:A,ctx:D}),u.$set(R);const F={};A&100663298&&(F.$$scope={dirty:A,ctx:D}),p.$set(F);const q={};A&100663298&&(q.$$scope={dirty:A,ctx:D}),b.$set(q);const B={};A&100663298&&(B.$$scope={dirty:A,ctx:D}),w.$set(B)},i(D){O||(I(i.$$.fragment,D),I(o.$$.fragment,D),I(u.$$.fragment,D),I(p.$$.fragment,D),I(b.$$.fragment,D),I(w.$$.fragment,D),D&&xe(()=>{O&&(M||(M=Ve(e,wt,{duration:150},!0)),M.run(1))}),O=!0)},o(D){P(i.$$.fragment,D),P(o.$$.fragment,D),P(u.$$.fragment,D),P(p.$$.fragment,D),P(b.$$.fragment,D),P(w.$$.fragment,D),D&&(M||(M=Ve(e,wt,{duration:150},!1)),M.run(0)),O=!1},d(D){D&&S(e),V(i),V(o),V(u),V(p),V(b),V(w),D&&M&&M.end()}}}function CA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Endpoint"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[1].s3.endpoint),r||(a=J(l,"input",n[12]),r=!0)},p(u,f){f&33554432&&i!==(i=u[25])&&h(e,"for",i),f&33554432&&o!==(o=u[25])&&h(l,"id",o),f&2&&l.value!==u[1].s3.endpoint&&ue(l,u[1].s3.endpoint)},d(u){u&&S(e),u&&S(s),u&&S(l),r=!1,a()}}}function MA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("label"),t=U("Bucket"),s=E(),l=y("input"),h(e,"for",i=n[25]),h(l,"type","text"),h(l,"id",o=n[25]),l.required=!0},m(u,f){$(u,e,f),v(e,t),$(u,s,f),$(u,l,f),ue(l,n[1].s3.bucket),r||(a=J(l,"input",n[13]),r=!0)},p(u,f){f&33554432&&i!==(i=u[2
<span class="txt">S3 connected successfully</span>`,h(e,"class","label label-sm label-success entrance-right")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function PA(n){let e,t,i,s;return{c(){e=y("div"),e.innerHTML=`<i class="ri-error-warning-line txt-warning"></i>
<span class="txt">Failed to establish S3 connection</span>`,h(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;$(l,e,o),i||(s=Ee(t=Ue.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&Wt(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&S(e),i=!1,s()}}}function LA(n){let e;return{c(){e=y("span"),h(e,"class","loader loader-sm")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function Dh(n){let e,t,i,s;return{c(){e=y("button"),t=y("span"),t.textContent="Cancel",h(t,"class","txt"),h(e,"type","button"),h(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){$(l,e,o),v(e,t),i||(s=J(e,"click",n[18]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&S(e),i=!1,s()}}}function NA(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g;const k=[$A,SA],w=[];function T(C,M){return C[2]?0:1}return p=T(n),m=w[p]=k[p](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[7]),r=E(),a=y("div"),u=y("form"),f=y("div"),f.innerHTML=`<p>By default PocketBase uses the local file system to store uploaded files.</p>
2023-03-27 00:19:44 +08:00
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,d=E(),m.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(f,"class","content txt-xl m-b-base"),h(u,"class","panel"),h(u,"autocomplete","off"),h(a,"class","wrapper")},m(C,M){$(C,e,M),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(C,r,M),$(C,a,M),v(a,u),v(u,f),v(u,d),w[p].m(u,null),_=!0,b||(g=J(u,"submit",pt(n[20])),b=!0)},p(C,M){(!_||M&128)&&le(o,C[7]);let O=p;p=T(C),p===O?w[p].p(C,M):(re(),P(w[O],1,1,()=>{w[O]=null}),ae(),m=w[p],m?m.p(C,M):(m=w[p]=k[p](C),m.c()),I(m,1),m.m(u,null))},i(C){_||(I(m),_=!0)},o(C){P(m),_=!1},d(C){C&&S(e),C&&S(r),C&&S(a),w[p].d(),b=!1,g()}}}function FA(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[NA]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),$(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&67109119&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&S(t),V(i,l)}}}const ro="s3_test_request";function RA(n,e,t){let i,s,l;Ke(n,At,F=>t(7,l=F)),Qt(At,l="Files storage",l);let o={},r={},a=!1,u=!1,f=!1,d=null,p=null;m();async function m(){t(2,a=!0);try{const F=await me.settings.getAll()||{};b(F)}catch(F){me.errorResponseHandler(F)}t(2,a=!1)}async function _(){if(!(u||!s)){t(3,u=!0);try{me.cancelRequest(ro);const F=await me.settings.update(H.filterRedactedProps(r));gn({}),await b(F),Da(),d?xv("Successfully saved but failed to establish S3 connection."):Yt("Successfully saved files storage settings.")}catch(F){me.errorResponseHandler(F)}t(3,u=!1)}}async function b(F={}){t(1,r={s3:(F==null?void 0:F.s3)||{}}),t(0,o=JSON.parse(JSON.stringify(r))),await k()}async function g(){t(1,r=JSON.parse(JSON.stringify(o||{}))),await k()}async function k(){if(t(5,d=null),!!r.s3.enabled){me.cancelRequest(ro),clearTimeout(p),p=setTimeout(()=>{me.cancelRequest(ro),addErrorToast("S3 test connection timeout.")},3e4),t(4,f=!0);try{await me.settings.testS3({$cancelKey:ro})}catch(F){t(5,d=F)}t(4,f=!1),clearTimeout(p)}}en(()=>()=>{clearTimeout(p)});function w(){r.s3.enabled=this.checked,t(1,r)}function T(){r.s3.endpoint=this.value,t(1,r)}function C(){r.s3.bucket=this.value,t(1,r)}function M(){r.s3.region=this.value,t(1,r)}function O(){r.s3.accessKey=this.value,t(1,r)}function D(F){n.$$.not_equal(r.s3.secret,F)&&(r.s3.secret=F,t(1,r))}function A(){r.s3.forcePathStyle=this.checked,t(1,r)}const L=()=>g(),N=()=>_(),R=()=>_();return n.$$.update=()=>{n.$$.dirty&1&&t(10,i=JSON.stringify(o)),n.$$.dirty&1026&&t(6,s=i!=JSON.stringify(r))},[o,r,a,u,f,d,s,l,_,g,i,w,T,C,M,O,D,A,L,N,R]}class qA extends ve{constructor(e){super(),be(this,e,RA,FA,_e,{})}}function jA(n){let e,t,i,s,l,o,r,a;return{c(){e=y("input"),i=E(),s=y("label"),l=U("Enable"),h(e,"type","checkbox"),h(e,"id",t=n[21]),h(s,"for",o=n[21])},m(u,f){$(u,e,f),e.checked=n[0].enabled,$(u,i,f),$(u,s,f),v(s,l),r||(a=J(e,"change",n[13]),r=!0)},p(u,f){f&2097152&&t!==(t=u[21])&&h(e,"id",t),f&1&&(e.checked=u[0].enabled),f&2097152&&o!==(o=u[21])&&h(s,"for",o)},d(u){u&&S(e),u&&S(i),u&&S(s),r=!1,a()}}}function VA(n){let e,t,i,s,l,o,r,a,u;return{c(){e=y("label"),t=U("Client ID"),s=E(),l=y("input"),h(e,"for",i=n[21]),h(l,"type","text"),h(l,"id",o=n[21]),l.required=r=n[0].enabled},m(f,d){$(f,e,d),v(e,t),$(f,s,d),$(f,l,d),ue(l,n[0].clientId),a||(u=J(l,"input",n[14]),a=!0)},p(f,d){d&2097152&&i!==(i=f[21])&&h(e,"for",i),d&2097152&&o!==(o=f[21])&&h(l,"id",o),d&1&&r!==(r=f[0].enabled)&&(l.required=r),d&1&&l.value!==f[0].clientId&&ue(l,f[0].clientId)},d(f){f&&S(e),f&&S(s),f&&S(l),a=!1,u()}}}function HA(n){let e,t,i,s,l,o,r;function a(f){n[15](f)}let u={id:n[21],required:n[0].enabled};return n[0].clientSecret!==void 0&&(u.value=n[0].clientSecret),l=new au({props:u}),se.push(()=>ge(l,"value",a)),{c(){e=y("label"),t=U("Client secret"),s=E(),z(l.$$.fragment),h(e,"for",i=n[21])},m(f,d){$(f,e,d),v(e,t),$(f,s,d),j(l,f,d),r=!0},p(f,d){(!r||d&2097152&&i!==(i=f[21]))&&h(e,"for"
2023-03-24 04:59:02 +08:00
another PocketBase environment.</p>`,t=E(),i=y("div"),s=y("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),z(o.$$.fragment),r=E(),a=y("div"),u=y("div"),f=E(),d=y("button"),d.innerHTML=`<i class="ri-download-line"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Download as JSON</span>`,h(e,"class","content txt-xl m-b-base"),h(s,"type","button"),h(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),h(i,"tabindex","0"),h(i,"class","export-preview svelte-jm5c4z"),h(u,"class","flex-fill"),h(d,"type","button"),h(d,"class","btn btn-expanded"),h(a,"class","flex m-t-base")},m(b,g){$(b,e,g),$(b,t,g),$(b,i,g),v(i,s),v(i,l),j(o,i,null),n[8](i),$(b,r,g),$(b,a,g),v(a,u),v(a,f),v(a,d),p=!0,m||(_=[J(s,"click",n[7]),J(i,"keydown",n[9]),J(d,"click",n[10])],m=!0)},p(b,g){const k={};g&4&&(k.content=b[2]),o.$set(k)},i(b){p||(I(o.$$.fragment,b),p=!0)},o(b){P(o.$$.fragment,b),p=!1},d(b){b&&S(e),b&&S(t),b&&S(i),V(o),n[8](null),b&&S(r),b&&S(a),m=!1,Ie(_)}}}function u6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function f6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[u6,a6],_=[];function b(g,k){return g[1]?0:1}return f=b(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[3]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(g,k){$(g,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(g,r,k),$(g,a,k),v(a,u),_[f].m(u,null),p=!0},p(g,k){(!p||k&8)&&le(o,g[3]);let w=f;f=b(g),f===w?_[f].p(g,k):(re(),P(_[w],1,1,()=>{_[w]=null}),ae(),d=_[f],d?d.p(g,k):(d=_[f]=m[f](g),d.c()),I(d,1),d.m(u,null))},i(g){p||(I(d),p=!0)},o(g){P(d),p=!1},d(g){g&&S(e),g&&S(r),g&&S(a),_[f].d()}}}function c6(n){let e,t,i,s;return e=new Fi({}),i=new Mn({props:{$$slots:{default:[f6]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),$(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(I(e.$$.fragment,l),I(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){V(e,l),l&&S(t),V(i,l)}}}function d6(n,e,t){let i,s;Ke(n,At,g=>t(3,s=g)),Qt(At,s="Export collections",s);const l="export_"+H.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await me.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let g of r)delete g.created,delete g.updated}catch(g){me.errorResponseHandler(g)}t(1,a=!1)}function f(){H.downloadJson(r,"pb_schema")}function d(){H.copyToClipboard(i),Wg("The configuration was copied to your clipboard!",3e3)}const p=()=>d();function m(g){se[g?"unshift":"push"](()=>{o=g,t(0,o)})}const _=g=>{if(g.ctrlKey&&g.code==="KeyA"){g.preventDefault();const k=window.getSelection(),w=document.createRange();w.selectNodeContents(o),k.removeAllRanges(),k.addRange(w)}},b=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,d,r,p,m,_,b]}class p6 extends ve{constructor(e){super(),be(this,e,d6,c6,_e,{})}}function Hh(n,e,t){const i=n.slice();return i[14]=e[t],i}function zh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Bh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Uh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Wh(n,e,t){const i=n.slice();return i[14]=e[t],i}function Yh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Kh(n,e,t){const i=n.slice();return i[30]=e[t],i}function m6(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Jh(),a=n[0].name!==n[1].name&&Zh(n);return{c(){e=y("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=y("strong"),o=U(l),h(s,"class","txt"),h(e,"class","inline-flex fleg-gap-5")},m(u,f){$(u,e,f),r&&r.m(e,null),v(e,t),a&&a.m(e,null),v(e,i),v(e,s),v(s,o)},p(u,f){u[9]?r||(r=Jh(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Zh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&le(o,l)},d(u){u&&S(e),r&&r.d(),a&&a.d()}}}function h6(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=y("span"),e.textContent="Deleted",t=E(),i=y("strong"),l=U(s),h(e,"class","label label-danger")},m(r,a){$(r,e,a),$(r,t,a),$(r,i,a),v(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=
2023-03-19 16:14:44 +08:00
<th width="10%" class="svelte-lmkr38">Old</th>
2023-03-25 04:30:57 +08:00
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=E(),o=y("tbody");for(let C=0;C<_.length;C+=1)_[C].c();r=E(),b&&b.c(),a=E();for(let C=0;C<k.length;C+=1)k[C].c();u=E();for(let C=0;C<T.length;C+=1)T[C].c();h(e,"class","section-title"),h(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m(C,M){$(C,e,M),p.m(e,null),$(C,t,M),$(C,i,M),v(i,s),v(i,l),v(i,o);for(let O=0;O<_.length;O+=1)_[O]&&_[O].m(o,null);v(o,r),b&&b.m(o,null),v(o,a);for(let O=0;O<k.length;O+=1)k[O]&&k[O].m(o,null);v(o,u);for(let O=0;O<T.length;O+=1)T[O]&&T[O].m(o,null)},p(C,M){if(d===(d=f(C))&&p?p.p(C,M):(p.d(1),p=d(C),p&&(p.c(),p.m(e,null))),M[0]&7203){m=C[11];let O;for(O=0;O<m.length;O+=1){const D=Kh(C,m,O);_[O]?_[O].p(D,M):(_[O]=Gh(D),_[O].c(),_[O].m(o,r))}for(;O<_.length;O+=1)_[O].d(1);_.length=m.length}if(C[2]||C[5]?b?b.p(C,M):(b=Xh(C),b.c(),b.m(o,a)):b&&(b.d(1),b=null),M[0]&4248){g=C[7];let O;for(O=0;O<g.length;O+=1){const D=Bh(C,g,O);k[O]?k[O].p(D,M):(k[O]=n_(D),k[O].c(),k[O].m(o,u))}for(;O<k.length;O+=1)k[O].d(1);k.length=g.length}if(M[0]&4352){w=C[8];let O;for(O=0;O<w.length;O+=1){const D=Hh(C,w,O);T[O]?T[O].p(D,M):(T[O]=s_(D),T[O].c(),T[O].m(o,null))}for(;O<T.length;O+=1)T[O].d(1);T.length=w.length}},i:Q,o:Q,d(C){C&&S(e),p.d(),C&&S(t),C&&S(i),ct(_,C),b&&b.d(),ct(k,C),ct(T,C)}}}function Pn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function dn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function b6(n,e,t){let i,s,l,{collectionA:o=new _n}=e,{collectionB:r=new _n}=e,{deleteMissing:a=!1}=e,u=[],f=[],d=[],p=[],m=[];const _=Object.keys(new _n().$export()).filter(k=>!["schema","created","updated"].includes(k));function b(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(k=>!f.find(w=>k.id==w.id))))}function g(k){return typeof k>"u"?"":H.isObject(k)?JSON.stringify(k,null,4):k}return n.$$set=k=>{"collectionA"in k&&t(0,o=k.collectionA),"collectionB"in k&&t(1,r=k.collectionB),"deleteMissing"in k&&t(2,a=k.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&b(),n.$$.dirty[0]&24&&t(6,d=u.filter(k=>!f.find(w=>k.id==w.id))),n.$$.dirty[0]&24&&t(7,p=f.filter(k=>u.find(w=>w.id==k.id))),n.$$.dirty[0]&24&&t(8,m=f.filter(k=>!u.find(w=>w.id==k.id))),n.$$.dirty[0]&7&&t(9,l=H.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,d,p,m,l,s,_,g]}class v6 extends ve{constructor(e){super(),be(this,e,b6,g6,_e,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function l_(n,e,t){const i=n.slice();return i[17]=e[t],i}function o_(n){let e,t;return e=new v6({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&4&&(l.collectionA=i[17].old),s&4&&(l.collectionB=i[17].new),s&8&&(l.deleteMissing=i[3]),e.$set(l)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function y6(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=o_(l_(n,i,o));const l=o=>P(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);$(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=l_(o,i,a);s[a]?(s[a].p(u,r),I(s[a],1)):(s[a]=o_(u),s[a].c(),I(s[a],1),s[a].m(e.parentNode,e))}for(re(),a=i.length;a<s.length;a+=1)l(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)P(s[r]);t=!1},d(o){ct(s,o),o&&S(e)}}}function k6(n){let e;return{c(){e=y("h4"),e.textContent="Side-by-side diff",h(e,"class","center txt-break")},m(t,i){$(t,e,i)},p:Q,d(t){t&&S(e)}}}function w6(n){let e,t,i,s,l,o,r;return{c(){e=y("button"),t=U("Close"),i=E(),s=y("button"),l=y("span"),l.textContent="Confirm and import",h(e,"type","button"),h(e,"class","btn btn-t
2023-03-22 00:52:13 +08:00
- ${C.join(`
2023-03-25 04:30:57 +08:00
- `)}`,()=>{_()}):_()}async function _(){if(!u){t(4,u=!0);try{await me.collections.import(o,a),Yt("Successfully imported collections configuration."),i("submit")}catch(C){me.errorResponseHandler(C)}t(4,u=!1),d()}}const b=()=>m(),g=()=>!u;function k(C){se[C?"unshift":"push"](()=>{s=C,t(1,s)})}function w(C){de.call(this,n,C)}function T(C){de.call(this,n,C)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&p()},[d,s,r,a,u,m,f,l,o,b,g,k,w,T]}class T6 extends ve{constructor(e){super(),be(this,e,$6,S6,_e,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function r_(n,e,t){const i=n.slice();return i[32]=e[t],i}function a_(n,e,t){const i=n.slice();return i[35]=e[t],i}function u_(n,e,t){const i=n.slice();return i[32]=e[t],i}function C6(n){let e,t,i,s,l,o,r,a,u,f,d,p,m,_,b,g,k,w,T,C,M,O,D;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[O6,({uniqueId:q})=>({40:q}),({uniqueId:q})=>[0,q?512:0]]},$$scope:{ctx:n}}});let A=!1,L=n[6]&&n[1].length&&!n[7]&&c_(),N=n[6]&&n[1].length&&n[7]&&d_(n),R=n[13].length&&S_(n),F=!!n[0]&&$_(n);return{c(){e=y("input"),t=E(),i=y("div"),s=y("p"),l=U(`Paste below the collections configuration you want to import or
`),o=y("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=E(),z(a.$$.fragment),u=E(),f=E(),L&&L.c(),d=E(),N&&N.c(),p=E(),R&&R.c(),m=E(),_=y("div"),F&&F.c(),b=E(),g=y("div"),k=E(),w=y("button"),T=y("span"),T.textContent="Review",h(e,"type","file"),h(e,"class","hidden"),h(e,"accept",".json"),h(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),h(i,"class","content txt-xl m-b-base"),h(g,"class","flex-fill"),h(T,"class","txt"),h(w,"type","button"),h(w,"class","btn btn-expanded btn-warning m-l-auto"),w.disabled=C=!n[14],h(_,"class","flex m-t-base")},m(q,B){$(q,e,B),n[19](e),$(q,t,B),$(q,i,B),v(i,s),v(s,l),v(s,o),$(q,r,B),j(a,q,B),$(q,u,B),$(q,f,B),L&&L.m(q,B),$(q,d,B),N&&N.m(q,B),$(q,p,B),R&&R.m(q,B),$(q,m,B),$(q,_,B),F&&F.m(_,null),v(_,b),v(_,g),v(_,k),v(_,w),v(w,T),M=!0,O||(D=[J(e,"change",n[20]),J(o,"click",n[21]),J(w,"click",n[26])],O=!0)},p(q,B){(!M||B[0]&4096)&&x(o,"btn-loading",q[12]);const Y={};B[0]&64&&(Y.class="form-field "+(q[6]?"":"field-error")),B[0]&65|B[1]&1536&&(Y.$$scope={dirty:B,ctx:q}),a.$set(Y),q[6]&&q[1].length&&!q[7]?L||(L=c_(),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),q[6]&&q[1].length&&q[7]?N?N.p(q,B):(N=d_(q),N.c(),N.m(p.parentNode,p)):N&&(N.d(1),N=null),q[13].length?R?R.p(q,B):(R=S_(q),R.c(),R.m(m.parentNode,m)):R&&(R.d(1),R=null),q[0]?F?F.p(q,B):(F=$_(q),F.c(),F.m(_,b)):F&&(F.d(1),F=null),(!M||B[0]&16384&&C!==(C=!q[14]))&&(w.disabled=C)},i(q){M||(I(a.$$.fragment,q),I(A),M=!0)},o(q){P(a.$$.fragment,q),P(A),M=!1},d(q){q&&S(e),n[19](null),q&&S(t),q&&S(i),q&&S(r),V(a,q),q&&S(u),q&&S(f),L&&L.d(q),q&&S(d),N&&N.d(q),q&&S(p),R&&R.d(q),q&&S(m),q&&S(_),F&&F.d(),O=!1,Ie(D)}}}function M6(n){let e;return{c(){e=y("div"),h(e,"class","loader")},m(t,i){$(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&S(e)}}}function f_(n){let e;return{c(){e=y("div"),e.textContent="Invalid collections configuration.",h(e,"class","help-block help-block-error")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function O6(n){let e,t,i,s,l,o,r,a,u,f,d=!!n[0]&&!n[6]&&f_();return{c(){e=y("label"),t=U("Collections"),s=E(),l=y("textarea"),r=E(),d&&d.c(),a=Se(),h(e,"for",i=n[40]),h(e,"class","p-b-10"),h(l,"id",o=n[40]),h(l,"class","code"),h(l,"spellcheck","false"),h(l,"rows","15"),l.required=!0},m(p,m){$(p,e,m),v(e,t),$(p,s,m),$(p,l,m),ue(l,n[0]),$(p,r,m),d&&d.m(p,m),$(p,a,m),u||(f=J(l,"input",n[22]),u=!0)},p(p,m){m[1]&512&&i!==(i=p[40])&&h(e,"for",i),m[1]&512&&o!==(o=p[40])&&h(l,"id",o),m[0]&1&&ue(l,p[0]),p[0]&&!p[6]?d||(d=f_(),d.c(),d.m(a.parentNode,a)):d&&(d.d(1),d=null)},d(p){p&&S(e),p&&S(s),p&&S(l),p&&S(r),d&&d.d(p),p&&S(a),u=!1,f()}}}function c_(n){let e;return{c(){e=y("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,h(e,"class","alert alert-info")},m(t,i){$(t,e,i)},d(t){t&&S(e)}}}function d_(n){let e,t,i,s,l,o=n[9].length&&p_(n),r=n[4].length&&__(n),a=n[8].length&&y_(n);return{c(){e=y("h5"),e.textContent="Detected changes",t=E(),i=y("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),h(e,"class","section-title"),h(i,"class","list")},m(u,f){$(u,e,f),$(u,t,f),$(u,i,f),o&&o.m(i,null),v(i,s),r&&r.m(i,null),v(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=p_(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=__(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=y_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&S(e),u&&S(t),u&&S(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function p_(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=u_(n,s,o),a=l(r);t.set(a,e[o]=h_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);$(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=Dt(e,r,l,1,o,s,t,i.parentNode,is,h_,i,u_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&S(i)}}}function m_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){$(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&le(s,i)},d(o){o&&S(e)}}}function h_(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&m_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Deleted",s=E(),l=y("strong"),r=U(o),a=E(),f&&f.c(),u=E(),h(i,"class","label label-danger list-label svelte-1jx20fl"),h(t,"class","list-item"),this.first=t},m(d,p){$(d,t,p),v(t,i),v(t,s),v(t,l),v(l,r),v(t,a),f&&f.m(t,null),v(t,u)},p(d,p){e=d,p[0]&512&&o!==(o=e[32].name+"")&&le(r,o),e[32].id?f?f.p(e,p):(f=m_(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(d){d&&S(t),f&&f.d()}}}function __(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=a_(n,s,o),a=l(r);t.set(a,e[o]=v_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);$(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=Dt(e,r,l,1,o,s,t,i.parentNode,is,v_,i,a_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&S(i)}}}function g_(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=y("strong"),i=U(t),s=E(),l=y("i"),h(e,"class","txt-strikethrough txt-hint"),h(l,"class","ri-arrow-right-line txt-sm")},m(o,r){$(o,e,r),v(e,i),$(o,s,r),$(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&le(i,t)},d(o){o&&S(e),o&&S(s),o&&S(l)}}}function b_(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){$(o,e,r),v(e,t),v(e,s),v(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&le(s,i)},d(o){o&&S(e)}}}function v_(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,d,p=e[35].old.name!==e[35].new.name&&g_(e),m=e[35].new.id&&b_(e);return{key:n,first:null,c(){t=y("div"),i=y("span"),i.textContent="Changed",s=E(),l=y("div"),p&&p.c(),o=E(),r=y("strong"),u=U(a),f=E(),m&&m.c(),d=E(),h(i,"class","label label-warning list-label svelte-1jx20fl"),h(l,"class","inline-flex flex-gap-5"),h(t,"class","list-item"),this.first=t},m(_,b){$(_,t,b),v(t,i),v(t,s),v(t,l),p&&p.m(l,null),v(l,o),v(l,r),v(r,u),v(l,f),m&&m.m(l,null),v(t,d)},p(_,b){e=_,e[35].old.name!==e[35].new.name?p?p.p(e,b):(p=g_(e),p.c(),p.m(l,o)):p&&(p.d(1),p=null),b[0]&16&&a!==(a=e[35].new.name+"")&&le(u,a),e[35].new.id?m?m.p(e,b):(m=b_(e),m.c(),m.m(l,null)):m&&(m.d(1),m=null)},d(_){_&&S(t),p&&p.d(),m&&m.d()}}}function y_(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=r_(n,s,o),a=l(r);t.set(a,e[o]=w_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);$(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=Dt(e,r,l,1,o,s,t,i.parentNode,is,w_,i,r_))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&S(i)}}}function k_(n){let e,t,i=n[32].id+"",s,l;return{c(){e=y("small"),t=U("("),s=U(i),l=U(")"),h(e,"class","txt-hint")},m(o,r){$(o,e,r
2023-03-19 16:14:44 +08:00
imported with different IDs. You can replace them in the import if you want
2023-03-27 00:19:44 +08:00
to.</string>`,l=E(),o=y("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',h(t,"class","icon"),h(s,"class","content"),h(o,"type","button"),h(o,"class","btn btn-warning btn-sm btn-outline"),h(e,"class","alert alert-warning m-t-base")},m(u,f){$(u,e,f),v(e,t),v(e,i),v(e,s),v(e,l),v(e,o),r||(a=J(o,"click",n[24]),r=!0)},p:Q,d(u){u&&S(e),r=!1,a()}}}function $_(n){let e,t,i;return{c(){e=y("button"),e.innerHTML='<span class="txt">Clear</span>',h(e,"type","button"),h(e,"class","btn btn-transparent link-hint")},m(s,l){$(s,e,l),t||(i=J(e,"click",n[25]),t=!0)},p:Q,d(s){s&&S(e),t=!1,i()}}}function D6(n){let e,t,i,s,l,o,r,a,u,f,d,p;const m=[M6,C6],_=[];function b(g,k){return g[5]?0:1}return f=b(n),d=_[f]=m[f](n),{c(){e=y("header"),t=y("nav"),i=y("div"),i.textContent="Settings",s=E(),l=y("div"),o=U(n[15]),r=E(),a=y("div"),u=y("div"),d.c(),h(i,"class","breadcrumb-item"),h(l,"class","breadcrumb-item"),h(t,"class","breadcrumbs"),h(e,"class","page-header"),h(u,"class","panel"),h(a,"class","wrapper")},m(g,k){$(g,e,k),v(e,t),v(t,i),v(t,s),v(t,l),v(l,o),$(g,r,k),$(g,a,k),v(a,u),_[f].m(u,null),p=!0},p(g,k){(!p||k[0]&32768)&&le(o,g[15]);let w=f;f=b(g),f===w?_[f].p(g,k):(re(),P(_[w],1,1,()=>{_[w]=null}),ae(),d=_[f],d?d.p(g,k):(d=_[f]=m[f](g),d.c()),I(d,1),d.m(u,null))},i(g){p||(I(d),p=!0)},o(g){P(d),p=!1},d(g){g&&S(e),g&&S(r),g&&S(a),_[f].d()}}}function E6(n){let e,t,i,s,l,o;e=new Fi({}),i=new Mn({props:{$$slots:{default:[D6]},$$scope:{ctx:n}}});let r={};return l=new T6({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),$(a,t,u),j(i,a,u),$(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const d={};l.$set(d)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){V(e,a),a&&S(t),V(i,a),a&&S(s),n[27](null),V(l,a)}}}function A6(n,e,t){let i,s,l,o,r,a,u;Ke(n,At,X=>t(15,u=X)),Qt(At,u="Import collections",u);let f,d,p="",m=!1,_=[],b=[],g=!0,k=[],w=!1;T();async function T(){t(5,w=!0);try{t(2,b=await me.collections.getFullList(200));for(let X of b)delete X.created,delete X.updated}catch(X){me.errorResponseHandler(X)}t(5,w=!1)}function C(){if(t(4,k=[]),!!i)for(let X of _){const fe=H.findByKey(b,"id",X.id);!(fe!=null&&fe.id)||!H.hasCollectionChanges(fe,X,g)||k.push({new:X,old:fe})}}function M(){t(1,_=[]);try{t(1,_=JSON.parse(p))}catch{}Array.isArray(_)?t(1,_=H.filterDuplicatesByKey(_)):t(1,_=[]);for(let X of _)delete X.created,delete X.updated,X.schema=H.filterDuplicatesByKey(X.schema)}function O(){var X,fe;for(let G of _){const ce=H.findByKey(b,"name",G.name)||H.findByKey(b,"id",G.id);if(!ce)continue;const he=G.id,Me=ce.id;G.id=Me;const je=Array.isArray(ce.schema)?ce.schema:[],He=Array.isArray(G.schema)?G.schema:[];for(const ke of He){const Ce=H.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)(X=Ce.options)!=null&&X.collectionId&&((fe=Ce.options)==null?void 0:fe.collectionId)===he&&(Ce.options.collectionId=Me)}t(0,p=JSON.stringify(_,null,4))}function D(X){t(12,m=!0);const fe=new FileReader;fe.onload=async G=>{t(12,m=!1),t(10,f.value="",f),t(0,p=G.target.result),await an(),_.length||(ml("Invalid collections configuration."),A())},fe.onerror=G=>{console.warn(G),ml("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},fe.readAsText(X)}function A(){t(0,p=""),t(10,f.value="",f),gn({})}function L(X){se[X?"unshift":"push"](()=>{f=X,t(10,f)})}const N=()=>{f.files.length&&D(f.files[0])},R=()=>{f.click()};function F(){p=this.value,t(0,p)}function q(){g=this.checked,t(3,g)}const B=()=>O(),Y=()=>A(),Z=()=>d==null?void 0:d.show(b,_,g);function ee(X){se[X?"unshift":"push"](()=>{d=X,t(11,d)})}const ie=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof p<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!p&&_.length&&_.length===_.filter(X=>!!X.id&&!!X.name).length),n.$$.dirty[0]&78&&t(9,s=b.filter(X=>i&&g&&!H.findByKey(_,"id"
2023-03-19 16:14:44 +08:00
<span class="txt">Manage admins</span>`,t=E(),i=y("hr"),s=E(),l=y("button"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
2023-03-25 04:30:57 +08:00
<span class="txt">Logout</span>`,h(e,"href","/settings/admins"),h(e,"class","dropdown-item closable"),h(l,"type","button"),h(l,"class","dropdown-item closable")},m(a,u){$(a,e,u),$(a,t,u),$(a,i,u),$(a,s,u),$(a,l,u),o||(r=[Ee(sn.call(null,e)),J(l,"click",n[7])],o=!0)},p:Q,d(a){a&&S(e),a&&S(t),a&&S(i),a&&S(s),a&&S(l),o=!1,Ie(r)}}}function O_(n){let e,t,i;return t=new ru({props:{scriptSrc:"./libs/tinymce/tinymce.min.js",conf:H.defaultEditorOptions()}}),t.$on("init",n[8]),{c(){e=y("div"),z(t.$$.fragment),h(e,"class","tinymce-preloader hidden")},m(s,l){$(s,e,l),j(t,e,null),i=!0},p:Q,i(s){i||(I(t.$$.fragment,s),i=!0)},o(s){P(t.$$.fragment,s),i=!1},d(s){s&&S(e),V(t)}}}function J6(n){var g;let e,t,i,s,l,o,r,a,u,f,d,p,m;document.title=e=H.joinNonEmpty([n[4],n[3],"PocketBase"]," - ");let _=((g=n[0])==null?void 0:g.id)&&n[1]&&M_(n);o=new Fb({props:{routes:P6}}),o.$on("routeLoading",n[5]),o.$on("conditionsFailed",n[6]),a=new H6({}),f=new Y6({});let b=n[1]&&!n[2]&&O_(n);return{c(){t=E(),i=y("div"),_&&_.c(),s=E(),l=y("div"),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),z(f.$$.fragment),d=E(),b&&b.c(),p=Se(),h(l,"class","app-body"),h(i,"class","app-layout")},m(k,w){$(k,t,w),$(k,i,w),_&&_.m(i,null),v(i,s),v(i,l),j(o,l,null),v(l,r),j(a,l,null),$(k,u,w),j(f,k,w),$(k,d,w),b&&b.m(k,w),$(k,p,w),m=!0},p(k,[w]){var T;(!m||w&24)&&e!==(e=H.joinNonEmpty([k[4],k[3],"PocketBase"]," - "))&&(document.title=e),(T=k[0])!=null&&T.id&&k[1]?_?(_.p(k,w),w&3&&I(_,1)):(_=M_(k),_.c(),I(_,1),_.m(i,s)):_&&(re(),P(_,1,1,()=>{_=null}),ae()),k[1]&&!k[2]?b?(b.p(k,w),w&6&&I(b,1)):(b=O_(k),b.c(),I(b,1),b.m(p.parentNode,p)):b&&(re(),P(b,1,1,()=>{b=null}),ae())},i(k){m||(I(_),I(o.$$.fragment,k),I(a.$$.fragment,k),I(f.$$.fragment,k),I(b),m=!0)},o(k){P(_),P(o.$$.fragment,k),P(a.$$.fragment,k),P(f.$$.fragment,k),P(b),m=!1},d(k){k&&S(t),k&&S(i),_&&_.d(),V(o),V(a),k&&S(u),V(f,k),k&&S(d),b&&b.d(k),k&&S(p)}}}function Z6(n,e,t){let i,s,l,o;Ke(n,Ms,b=>t(10,i=b)),Ke(n,wo,b=>t(3,s=b)),Ke(n,Aa,b=>t(0,l=b)),Ke(n,At,b=>t(4,o=b));let r,a=!1,u=!1;function f(b){var g,k,w,T;((g=b==null?void 0:b.detail)==null?void 0:g.location)!==r&&(t(1,a=!!((w=(k=b==null?void 0:b.detail)==null?void 0:k.userData)!=null&&w.showAppSidebar)),r=(T=b==null?void 0:b.detail)==null?void 0:T.location,Qt(At,o="",o),gn({}),Z1())}function d(){Ai("/")}async function p(){var b,g;if(l!=null&&l.id)try{const k=await me.settings.getAll({$cancelKey:"initialAppSettings"});Qt(wo,s=((b=k==null?void 0:k.meta)==null?void 0:b.appName)||"",s),Qt(Ms,i=!!((g=k==null?void 0:k.meta)!=null&&g.hideControls),i)}catch(k){k!=null&&k.isAbort||console.warn("Failed to load app settings.",k)}}function m(){me.logout()}const _=()=>{t(2,u=!0)};return n.$$.update=()=>{n.$$.dirty&1&&l!=null&&l.id&&p()},[l,a,u,s,o,f,d,m,_]}class G6 extends ve{constructor(e){super(),be(this,e,Z6,J6,_e,{})}}new G6({target:document.getElementById("app")});export{Ie as A,Yt as B,H as C,Ai as D,Se as E,Kg as F,ya as G,vu as H,Ke as I,Li as J,St as K,en as L,se as M,Y1 as N,Dt as O,is as P,un as Q,_n as R,ve as S,Fr as T,P as a,E as b,z as c,V as d,y as e,h as f,$ as g,v as h,be as i,Ee as j,re as k,sn as l,j as m,ae as n,S as o,me as p,pe as q,x as r,_e as s,I as t,J as u,pt as v,U as w,le as x,Q as y,ue as z};