pocketbase/ui/dist/assets/index.02c04c04.js

639 lines
814 KiB
JavaScript
Raw Normal View History

(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerpolicy&&(l.referrerPolicy=s.referrerpolicy),s.crossorigin==="use-credentials"?l.credentials="include":s.crossorigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function re(){}const gl=n=>n;function pt(n,e){for(const t in e)n[t]=e[t];return n}function lm(n){return n()}function Za(){return Object.create(null)}function Qe(n){n.forEach(lm)}function Kn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ll;function xn(n,e){return Ll||(Ll=document.createElement("a")),Ll.href=e,n===Ll.href}function R_(n){return Object.keys(n).length===0}function om(n,...e){if(n==null)return re;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function kt(n,e,t){n.$$.on_destroy.push(om(e,t))}function wn(n,e,t,i){if(n){const s=rm(n,e,t,i);return n[0](s)}}function rm(n,e,t,i){return n[1]&&i?pt(t.ctx.slice(),n[1](i(e))):t.ctx}function $n(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 Sn(n,e,t,i,s,l){if(s){const o=rm(e,t,i,l);n.p(o,s)}}function Cn(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 di(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Jt(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 Ja(n){return n==null?"":n}function dn(n,e,t){return n.set(t),e}function Ye(n){return n&&Kn(n.destroy)?n.destroy:re}const am=typeof window<"u";let Lo=am?()=>window.performance.now():()=>Date.now(),la=am?n=>requestAnimationFrame(n):re;const bs=new Set;function um(n){bs.forEach(e=>{e.c(n)||(bs.delete(e),e.f())}),bs.size!==0&&la(um)}function Io(n){let e;return bs.size===0&&la(um),{promise:new Promise(t=>{bs.add(e={c:n,f:t})}),abort(){bs.delete(e)}}}function g(n,e){n.appendChild(e)}function fm(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function H_(n){const e=_("style");return j_(fm(n),e),e.sheet}function j_(n,e){g(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function xt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function F(n){return document.createTextNode(n)}function T(){return F(" ")}function Je(){return F("")}function G(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Yt(n){return function(e){return e.preventDefault(),n.call(this,e)}}function ei(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function cm(n){return function(e){e.target===this&&n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function fi(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]:p(n,i,e[i])}function At(n){return n===""?null:+n}function q_(n){return Array.from(n.childNodes)}function ue(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Me(n,e){n.value=e==null?"":e}function Ga(n,e,t,i){t===null?n.style.removeProperty(e):n.style.setProperty(e,t,i?"important":"")}function ie(n,e,t){n.classList[t?"add":"remove"](e)}function dm(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.initCustomEve
2022-08-11 01:37:41 +08:00
`;for(let b=0;b<=1;b+=a){const y=e+(t-e)*l(b);u+=b*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${V_(f)}_${r}`,d=fm(n),{stylesheet:h,rules:m}=ao.get(d)||z_(d,n);m[c]||(m[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,uo+=1,c}function rl(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(", "),uo-=s,uo||B_())}function B_(){la(()=>{uo||(ao.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),ao.clear())})}function U_(n,e,t,i){if(!e)return re;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return re;const{delay:l=0,duration:o=300,easing:r=gl,start:a=Lo()+l,end:u=a+o,tick:f=re,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,m;function v(){c&&(m=ol(n,0,1,o,l,r,c)),l||(h=!0)}function b(){c&&rl(n,m),d=!1}return Io(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),b()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),v(),f(0,1),b}function W_(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,pm(n,s)}}function pm(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 al;function Xs(n){al=n}function Fo(){if(!al)throw new Error("Function called outside component initialization");return al}function Zn(n){Fo().$$.on_mount.push(n)}function Y_(n){Fo().$$.after_update.push(n)}function K_(n){Fo().$$.on_destroy.push(n)}function on(){const n=Fo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=dm(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function ut(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Ys=[],he=[],no=[],Tr=[],hm=Promise.resolve();let Dr=!1;function mm(){Dr||(Dr=!0,hm.then(gm))}function ni(){return mm(),hm}function Dt(n){no.push(n)}function He(n){Tr.push(n)}const Qo=new Set;let Il=0;function gm(){const n=al;do{for(;Il<Ys.length;){const e=Ys[Il];Il++,Xs(e),Z_(e.$$)}for(Xs(null),Ys.length=0,Il=0;he.length;)he.pop()();for(let e=0;e<no.length;e+=1){const t=no[e];Qo.has(t)||(Qo.add(t),t())}no.length=0}while(Ys.length);for(;Tr.length;)Tr.pop()();Dr=!1,Qo.clear(),Xs(n)}function Z_(n){if(n.fragment!==null){n.update(),Qe(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Dt)}}let Is;function oa(){return Is||(Is=Promise.resolve(),Is.then(()=>{Is=null})),Is}function es(n,e,t){n.dispatchEvent(dm(`${e?"intro":"outro"}${t}`))}const io=new Set;let oi;function Pe(){oi={r:0,c:[],p:oi}}function Le(){oi.r||Qe(oi.c),oi=oi.p}function E(n,e){n&&n.i&&(io.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),oi.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ra={duration:0};function _m(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&rl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:h=gl,tick:m=re,css:v}=i||ra;v&&(l=ol(n,0,1,d,c,h,v,r++)),m(0,1);const b=Lo()+c,y=b+d;o&&o.abort(),s=!0,Dt(()=>es(n,!0,"start")),o=Io(S=>{if(s){if(S>=y)return m(1,0),es(n,!0,"end"),a(),s=!1;if(S>=b){const C=h((S-b)/d);m(C,1-C)}}return s})}let f=!1;return{start(){f||(f=!0,rl(n),Kn(i)?(i=i(),oa().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function bm(n,e,t){let i=e(n,t),s=!0,l;const o=oi;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=gl,tick:c=re,css:d}=i||ra;d&&(l=ol(n,1,0,u,a,f,d));const h=Lo()+a,m=h+u;Dt(()=>es(n,!1,"start")),Io(v=>{if(s){if(v>=m)return c(0,1),es(n,!1,"end"),--o.r||Qe(o.c),!1;if(v>=h){const b=f((v-h)/u);c(1-b,b)}}return s})}return Kn(i)?oa().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&rl(n,l),s=!1)}}}function rt(n,e,t,i){let s=e(n,t),l=i?0:1,o=nu
<span class="txt">Pocket<strong>Base</strong></span></figure>`,t=T(),i=_("div"),p(e,"class","block txt-center m-b-lg"),p(i,"class","clearfix")},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},d(s){s&&k(e),s&&k(t),s&&k(i)}}}function b1(n){let e,t,i,s=!n[0]&&Du();const l=n[1].default,o=wn(l,n,n[2],null);return{c(){e=_("div"),s&&s.c(),t=T(),o&&o.c(),p(e,"class","wrapper wrapper-sm m-b-xl panel-wrapper svelte-lxxzfu")},m(r,a){w(r,e,a),s&&s.m(e,null),g(e,t),o&&o.m(e,null),i=!0},p(r,a){r[0]?s&&(s.d(1),s=null):s||(s=Du(),s.c(),s.m(e,t)),o&&o.p&&(!i||a&4)&&Sn(o,l,r,r[2],i?$n(l,r[2],a,null):Cn(r[2]),null)},i(r){i||(E(o,r),i=!0)},o(r){P(o,r),i=!1},d(r){r&&k(e),s&&s.d(),o&&o.d(r)}}}function v1(n){let e,t;return e=new Dn({props:{class:"full-page",center:!0,$$slots:{default:[b1]},$$scope:{ctx:n}}}),{c(){V(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function y1(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 Dg extends Ee{constructor(e){super(),Oe(this,e,y1,v1,De,{nobranding:0})}}function Ou(n,e,t){const i=n.slice();return i[11]=e[t],i}const k1=n=>({}),Eu=n=>({uniqueId:n[3]});function w1(n){let e=(n[11]||_o)+"",t;return{c(){t=F(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||_o)+"")&&ue(t,e)},d(i){i&&k(t)}}}function $1(n){var s,l;let e,t=(((s=n[11])==null?void 0:s.message)||((l=n[11])==null?void 0:l.code)||_o)+"",i;return{c(){e=_("pre"),i=F(t)},m(o,r){w(o,e,r),g(e,i)},p(o,r){var a,u;r&4&&t!==(t=(((a=o[11])==null?void 0:a.message)||((u=o[11])==null?void 0:u.code)||_o)+"")&&ue(i,t)},d(o){o&&k(e)}}}function Au(n){let e,t;function i(o,r){return typeof o[11]=="object"?$1:w1}let s=i(n),l=s(n);return{c(){e=_("div"),l.c(),t=T(),p(e,"class","help-block help-block-error")},m(o,r){w(o,e,r),l.m(e,null),g(e,t)},p(o,r){s===(s=i(o))&&l?l.p(o,r):(l.d(1),l=s(o),l&&(l.c(),l.m(e,t)))},d(o){o&&k(e),l.d()}}}function S1(n){let e,t,i,s,l;const o=n[7].default,r=wn(o,n,n[6],Eu);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Au(Ou(n,a,f));return{c(){e=_("div"),r&&r.c(),t=T();for(let f=0;f<u.length;f+=1)u[f].c();p(e,"class",n[0]),ie(e,"error",n[2].length)},m(f,c){w(f,e,c),r&&r.m(e,null),g(e,t);for(let d=0;d<u.length;d+=1)u[d].m(e,null);n[9](e),i=!0,s||(l=G(e,"click",n[8]),s=!0)},p(f,[c]){if(r&&r.p&&(!i||c&64)&&Sn(r,o,f,f[6],i?$n(o,f[6],c,k1):Cn(f[6]),Eu),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const h=Ou(f,a,d);u[d]?u[d].p(h,c):(u[d]=Au(h),u[d].c(),u[d].m(e,null))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}(!i||c&1)&&p(e,"class",f[0]),c&5&&ie(e,"error",f[2].length)},i(f){i||(E(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),xt(u,f),n[9](null),s=!1,l()}}}const _o="Invalid value";function C1(n,e,t){let i;kt(n,as,m=>t(5,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+U.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){Tg(r)}Zn(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(m){ut.call(this,n,m)}function h(m){he[m?"unshift":"push"](()=>{u=m,t(1,u)})}return n.$$set=m=>{"name"in m&&t(4,r=m.name),"class"in m&&t(0,a=m.class),"$$scope"in m&&t(6,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=U.toArray(U.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,h]}class Ne extends Ee{constructor(e){super(),Oe(this,e,C1,S1,De,{name:4,class:0})}}function M1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Email"),s=T(),l=_("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0]),l.focus(),r||(a=G(l,"input",n[5]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&1&&l.value!==u[0]&&Me(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function T1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("Password"),s=T(),l=_("input"),r=T(),a=_("div
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(f,"type","submit"),p(f,"class","btn btn-lg btn-block btn-next"),ie(f,"btn-disabled",n[3]),ie(f,"btn-loading",n[3]),p(e,"class","block"),p(e,"autocomplete","off")},m(m,v){w(m,e,v),g(e,t),g(e,i),j(s,e,null),g(e,l),j(o,e,null),g(e,r),j(a,e,null),g(e,u),g(e,f),c=!0,d||(h=G(e,"submit",Yt(n[4])),d=!0)},p(m,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:m}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:m}),o.$set(y);const S={};v&1540&&(S.$$scope={dirty:v,ctx:m}),a.$set(S),v&8&&ie(f,"btn-disabled",m[3]),v&8&&ie(f,"btn-loading",m[3])},i(m){c||(E(s.$$.fragment,m),E(o.$$.fragment,m),E(a.$$.fragment,m),c=!0)},o(m){P(s.$$.fragment,m),P(o.$$.fragment,m),P(a.$$.fragment,m),c=!1},d(m){m&&k(e),q(s),q(o),q(a),d=!1,h()}}}function E1(n,e,t){const i=on();let s="",l="",o="",r=!1;async function a(){if(!r){t(3,r=!0);try{await be.admins.create({email:s,password:l,passwordConfirm:o}),await be.admins.authViaEmail(s,l),i("submit")}catch(d){be.errorResponseHandler(d)}t(3,r=!1)}}function u(){s=this.value,t(0,s)}function f(){l=this.value,t(1,l)}function c(){o=this.value,t(2,o)}return[s,l,o,r,a,u,f,c]}class A1 extends Ee{constructor(e){super(),Oe(this,e,E1,O1,De,{})}}function Pu(n){let e,t;return e=new Dg({props:{$$slots:{default:[P1]},$$scope:{ctx:n}}}),{c(){V(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function P1(n){let e,t;return e=new A1({}),e.$on("submit",n[1]),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p:re,i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function L1(n){let e,t,i=n[0]&&Pu(n);return{c(){i&&i.c(),e=Je()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&E(i,1)):(i=Pu(s),i.c(),E(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(E(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function I1(n,e,t){let i=!1;s();function s(){if(t(0,i=!1),new URLSearchParams(window.location.search).has("installer")){be.logout(!1),t(0,i=!0);return}be.authStore.isValid?$i("/collections"):be.logout()}return[i,async()=>{t(0,i=!1),await ni(),window.location.search=""}]}class F1 extends Ee{constructor(e){super(),Oe(this,e,I1,L1,De,{})}}const Rt=ii(""),bo=ii("");function zo(n){const e=n-1;return e*e*e+1}function vo(n,{delay:e=0,duration:t=400,easing:i=gl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function Bn(n,{delay:e=0,duration:t=400,easing:i=zo,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);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2022-08-11 01:37:41 +08:00
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
opacity: ${a-f*d}`}}function tn(n,{delay:e=0,duration:t=400,easing:i=zo}={}){const s=getComputedStyle(n),l=+s.opacity,o=parseFloat(s.height),r=parseFloat(s.paddingTop),a=parseFloat(s.paddingBottom),u=parseFloat(s.marginTop),f=parseFloat(s.marginBottom),c=parseFloat(s.borderTopWidth),d=parseFloat(s.borderBottomWidth);return{delay:e,duration:t,easing:i,css:h=>`overflow: hidden;opacity: ${Math.min(h*20,1)*l};height: ${h*o}px;padding-top: ${h*r}px;padding-bottom: ${h*a}px;margin-top: ${h*u}px;margin-bottom: ${h*f}px;border-top-width: ${h*c}px;border-bottom-width: ${h*d}px;`}}function Un(n,{delay:e=0,duration:t=400,easing:i=zo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}function N1(n){let e,t,i,s;return{c(){e=_("input"),p(e,"type","text"),p(e,"id",n[8]),p(e,"placeholder",t=n[0]||n[1])},m(l,o){w(l,e,o),n[13](e),Me(e,n[7]),i||(s=G(e,"input",n[14]),i=!0)},p(l,o){o&3&&t!==(t=l[0]||l[1])&&p(e,"placeholder",t),o&128&&e.value!==l[7]&&Me(e,l[7])},i:re,o:re,d(l){l&&k(e),n[13](null),i=!1,s()}}}function R1(n){let e,t,i,s;function l(a){n[12](a)}var o=n[4];function r(a){let u={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=new o(r(n)),he.push(()=>Re(e,"value",l)),e.$on("submit",n[10])),{c(){e&&V(e.$$.fragment),i=Je()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{q(c,1)}),Le()}o?(e=new o(r(a)),he.push(()=>Re(e,"value",l)),e.$on("submit",a[10]),V(e.$$.fragment),E(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&E(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&q(e,a)}}}function Lu(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Iu();return{c(){r&&r.c(),e=T(),t=_("button"),t.innerHTML='<span class="txt">Clear</span>',p(t,"type","button"),p(t,"class","btn btn-secondary btn-sm btn-hint p-l-xs p-r-xs m-l-10")},m(a,u){r&&r.m(a,u),w(a,e,u),w(a,t,u),s=!0,l||(o=G(t,"click",n[15]),l=!0)},p(a,u){a[7]!==a[0]?r?u&129&&E(r,1):(r=Iu(),r.c(),E(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(E(r),a&&Dt(()=>{i||(i=rt(t,Bn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=rt(t,Bn,{duration:150,x:5},!1)),i.run(0)),s=!1},d(a){r&&r.d(a),a&&k(e),a&&k(t),a&&i&&i.end(),l=!1,o()}}}function Iu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Search</span>',p(e,"type","submit"),p(e,"class","btn btn-expanded btn-sm btn-warning")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Dt(()=>{t||(t=rt(e,Bn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=rt(e,Bn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function H1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[R1,N1],h=[];function m(b,y){return b[4]&&!b[5]?0:1}o=m(n),r=h[o]=d[o](n);let v=(n[0].length||n[7].length)&&Lu(n);return{c(){e=_("div"),t=_("form"),i=_("label"),s=_("i"),l=T(),r.c(),a=T(),v&&v.c(),p(s,"class","ri-search-line"),p(i,"for",n[8]),p(i,"class","m-l-10 txt-xl"),p(t,"class","searchbar"),p(e,"class","searchbar-wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(i,s),g(t,l),h[o].m(t,null),g(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Yt(n[10])),G(e,"click",ei(n[11]))],f=!0)},p(b,[y]){let S=o;o=m(b),o===S?h[o].p(b,y):(Pe(),P(h[S],1,1,()=>{h[S]=null}),Le(),r=h[o],r?r.p(b,y):(r=h[o]=d[o](b),r.c()),E(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&E(v,1)):(v=Lu(b),v.c(),E(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(E(r),E(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),h[o].d(),v&&v.d(),f=!1,Qe(c)}}}function j1(n,e,t){const i=on(),s="search_"+U.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new fn}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function h(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function m(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Xi(()=>import("./FilterAutocompleteInput.8c09e039.js"),[],import.meta.url)).default),t(5,f=!1))}Zn(()=>{v()});function b(M){ut.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function S(M){he[M?"unshift":"push"](()=>{c=M,t(6,c)})}function C(){d=this.value,t(7,d),t(0,l)}const $=()=>{h(!1),m()};return n.$$set=M=>{"value"in M&&t(0,l=M.value),"placeholder"in M&&t(1,o=M.placeholder),"autocompleteCollection"in M&&t(2,r=M.autocompleteCollection),"extraAutocompleteKeys"in M&&t(3,a=M.extraAutocompleteKeys)},n.$$.update=()=>{n.$$.dirty&1&&typeof l=="string"&&t(7,d=l)},[l,o,r,a,u,f,c,d,s,h,m,b,y,S,C,$]}class Bo extends Ee{constructor(e){sup
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function G1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function X1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",U.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Q1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",U.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function x1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Ru(n){let e;function t(l,o){return l[6]?tv:ev}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function ev(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Hu(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No logs found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Hu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function tv(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Hu(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function ju(n){let e;return{c(){e=_("i"),p(e,"class","ri-error-warning-line txt-danger m-l-5 m-r-5"),p(e,"title","Error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qu(n,e){var se,ge,ke;let t,i,s,l=((se=e[21].method)==null?void 0:se.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,h,m,v,b,y,S=(e[21].referer||"N/A")+"",C,$,M,D,O,A=e[21].status+"",I,L,R,B,K,J,H,X,W,te,x=(((ge=e[21].meta)==null?void 0:ge.errorMessage)||((ke=e[21].meta)==null?void 0:ke.errorData))&&ju();B=new wi({props:{date:e[21].created}});function oe(){return e[16](e[21])}function me(...Y){return e[17](e[21],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=F(l),a=T(),u=_("td"),f=_("span"),d=F(c),m=T(),x&&x.c(),v=T(),b=_("td"),y=_("span"),C=F(S),M=T(),D=_("td"),O=_("span"),I=F(A),L=T(),R=_("td"),V(B.$$.fragment),K=T(),J=_("td"),J.innerHTML='<i class="ri-arrow-right-line"></i>',H=T(),p(s,"class",r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]),p(i,"class","col-type-text col-field-method min-width"),p(f,"class","txt txt-ellipsis"),p(f,"title",h=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",$=e[21].referer),ie(y,"txt-hint",!e[21].referer),p(b,"class","col-type-text col-field-referer"),p(O,"class","label"),ie(O,"label-danger",e[21].status>=400),p(D,"class","col-type-number col-field-status"),p(R,"class","col-type-date col-field-created"),p(J,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,ve){w(Y,t,ve),g(t,i),g(i,s),g(s,o),g(t,a),g(t,u),g(u,f),g(f,d),g(u,m),x&&x.m(u,null),g(t,v),g(t,b),g(b,y),g(y,C),g(t,M),g(t,D),g(D,O),g(O,I),g(t,L),g(t,R),j(B,R,null),g(t,K),g(t,J),g(t,H),X=!0,W||(te=[G(t,"click",oe),G(t,"keydown",me)],W=!0)},p(Y,ve){var Q,Se,je;e=Y,(!X||ve&8)&&l!==(l=((Q=e[21].method)==null?void 0:Q.toUpperCase())+"")&&ue(o,l),(!X||ve&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!X||ve&8)&&c!==(c=e[21].url+"")&&ue(d,c),(!X||ve&8&&h!==(h=e[21].url))&&p(f,"title",h),((Se=e[21].meta)==null?void 0:Se.errorMessage)||((je=e[21].meta)==null?void 0:je.errorData)?x||(x=ju(),x.c(),x.m(u,null)):x&&(x.d(1),x=null),(!X||ve&8)&&S!==(S=(e[21].referer||"N/A")+"")&&ue(C,S),(!X||ve&8&&$!==($=e[21].referer))&&p(y,"title",$),ve&8&&ie(y,"txt-hint",!e[21].referer),(!X||ve&8)&&A!==(A=e[21].status+"")&&ue(I,A),ve&8&&ie(O,"label-danger",e[21].status>=400);const ee={};ve&8&&(ee.date=e[21].created),B.$set(ee)},i(Y){X||(E(B.$$.fragment,Y),X=!0)},o(Y){P(B.$$.fragment,Y),X=!1},d(Y){Y&&k(t),x&&x.d(),q(B),W=!1,Qe(te)}}}function Vu(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&ue(s,i),a&16&&ue(o,r[4])},d(r){r&&k(e)}}}function zu(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[6]),ie(t,"btn-disabled",n[6]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c&64&&ie(t,"btn-loading",f[6]),c&64&&ie(t,"btn-disabled",f[6])},d(f){f&&k(e),a=!1,u()}}}function nv(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O=[],A=new Map,I,L,R,B;function K(Q){n[11](Q)}let J={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[J1]},$$scope:{ctx:n}};n[1]!==void 0&&(J.sort=n[1]),l=new sn({props:J}),he.push(()=>Re(l,"sort",K));function H(Q){n[12](Q)}let X={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{default:[G1]}
2022-08-11 01:37:41 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/function gi(){}const lv=function(){let n=0;return function(){return n++}}();function Mt(n){return n===null||typeof n>"u"}function Ft(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 dt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Nn(n,e){return Wt(n)?n:e}function gt(n,e){return typeof n>"u"?e:n}const ov=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,Eg=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function zt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function Tt(n,e,t,i){let s,l,o;if(Ft(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(dt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function yo(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 ko(n){if(Ft(n))return n.map(ko);if(dt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=ko(n[t[s]]);return e}return n}function Ag(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function rv(n,e,t,i){if(!Ag(n))return;const s=e[n],l=t[n];dt(s)&&dt(l)?ul(s,l,i):e[n]=ko(l)}function ul(n,e,t){const i=Ft(e)?e:[e],s=i.length;if(!dt(n))return n;t=t||{};const l=t.merger||rv;for(let o=0;o<s;++o){if(e=i[o],!dt(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 el(n,e){return ul(n,e,{merger:av})}function av(n,e,t){if(!Ag(n))return;const i=e[n],s=t[n];dt(i)&&dt(s)?el(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=ko(s))}const Bu={"":n=>n,x:n=>n.x,y:n=>n.y};function Ni(n,e){return(Bu[e]||(Bu[e]=uv(e)))(n)}function uv(n){const e=fv(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function fv(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 ka(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Wn=n=>typeof n<"u",Ri=n=>typeof n=="function",Uu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function cv(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,Et=2*Ut,dv=Et+Ut,wo=Number.POSITIVE_INFINITY,pv=Ut/180,Bt=Ut/2,js=Ut/4,Wu=Ut*2/3,Vn=Math.log10,ai=Math.sign;function Yu(n){const e=Math.round(n);n=tl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Vn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function hv(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 Cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function tl(n,e,t){return Math.abs(n-e)<t}function mv(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function Pg(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function Qn(n){return n*(Ut/180)}function wa(n){return n*(180/Ut)}function Ku(n){if(!Wt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function Lg(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*Ut&&(l+=Et),{angle:l,distance:s}}function Br(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function gv(n,e){return(n-e+dv)%Et-Ut}function An(n){return(n%Et+Et)%Et}function fl(n,e,t,i){const s=An(n),l=An(e),o=An(t),r=An(l-s),a=An(o-s),u=An(s-l),f=An(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function un(n,e,t){return Math.max(e,Math.min(t,n))}function _v(n){return un(n,-32768,32767)}function cl(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function $a(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 xi=(n,e,t,i)=>$a(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),bv=(n,e,t)=>$a(n,t,i=>n[i][e]>=t);function vv(n,e,
2022-08-11 01:37:41 +08:00
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
*/function wl(n){return n+.5|0}const Pi=(n,e,t)=>Math.max(Math.min(n,t),e);function Js(n){return Pi(wl(n*2.55),0,255)}function Fi(n){return Pi(wl(n*255),0,255)}function vi(n){return Pi(wl(n/2.55)/100,0,1)}function Qu(n){return Pi(wl(n*100),0,100)}const Fn={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},Ur=[..."0123456789ABCDEF"],$v=n=>Ur[n&15],Sv=n=>Ur[(n&240)>>4]+Ur[n&15],Vl=n=>(n&240)>>4===(n&15),Cv=n=>Vl(n.r)&&Vl(n.g)&&Vl(n.b)&&Vl(n.a);function Mv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Fn[n[1]]*17,g:255&Fn[n[2]]*17,b:255&Fn[n[3]]*17,a:e===5?Fn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Fn[n[1]]<<4|Fn[n[2]],g:Fn[n[3]]<<4|Fn[n[4]],b:Fn[n[5]]<<4|Fn[n[6]],a:e===9?Fn[n[7]]<<4|Fn[n[8]]:255})),t}const Tv=(n,e)=>n<255?e(n):"";function Dv(n){var e=Cv(n)?$v:Sv;return n?"#"+e(n.r)+e(n.g)+e(n.b)+Tv(n.a,e):void 0}const Ov=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function qg(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 Ev(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 Av(n,e,t){const i=qg(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 Pv(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 Sa(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=Pv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ca(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Fi)}function Ma(n,e,t){return Ca(qg,n,e,t)}function Lv(n,e,t){return Ca(Av,n,e,t)}function Iv(n,e,t){return Ca(Ev,n,e,t)}function Vg(n){return(n%360+360)%360}function Fv(n){const e=Ov.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Js(+e[5]):Fi(+e[5]));const s=Vg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=Lv(s,l,o):e[1]==="hsv"?i=Iv(s,l,o):i=Ma(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function Nv(n,e){var t=Sa(n);t[0]=Vg(t[0]+e),t=Ma(t),n.r=t[0],n.g=t[1],n.b=t[2]}function Rv(n){if(!n)return;const e=Sa(n),t=e[0],i=Qu(e[1]),s=Qu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${vi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const xu={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"},ef={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:"
2022-08-11 01:37:41 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
*/class qy{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=Ng.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var _i=new qy;const pf="transparent",Vy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=nf(n||pf),s=i.valid&&nf(e||pf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class zy{constructor(e,t,i,s){const l=t[i];s=Ul([e.to,s,l,e.from]);const o=Ul([e.from,l,s]);this._active=!0,this._fn=e.fn||Vy[e.type||typeof o],this._easing=nl[e.easing]||nl.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=Ul([e.to,t,s,e.from]),this._from=Ul([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 By=["x","y","borderWidth","radius","tension"],Uy=["color","borderColor","backgroundColor"];_t.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 Wy=Object.keys(_t.animation);_t.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});_t.set("animations",{colors:{type:"color",properties:Uy},numbers:{type:"number",properties:By}});_t.describe("animations",{_fallback:"animation"});_t.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 n_{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!dt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!dt(s))return;const l={};for(co
2022-08-11 01:37:41 +08:00
`)>-1?n.split(`
`):n}function rw(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 Uf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=Pn(e.bodyFont),u=Pn(e.titleFont),f=Pn(e.footerFont),c=l.length,d=s.length,h=i.length,m=Yn(e.padding);let v=m.height,b=0,y=i.reduce(($,M)=>$+M.before.length+M.lines.length+M.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(v+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=h*$+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function($){b=Math.max(b,t.measureText($).width+S)};return t.save(),t.font=u.string,Tt(n.title,C),t.font=a.string,Tt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,Tt(i,$=>{Tt($.before,C),Tt($.lines,C),Tt($.after,C)}),S=0,t.font=f.string,Tt(n.footer,C),t.restore(),b+=m.width,{width:b,height:v}}function aw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function uw(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 fw(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"),uw(u,n,e,t)&&(u="center"),u}function Wf(n,e,t){const i=t.yAlign||e.yAlign||aw(n,t);return{xAlign:t.xAlign||e.xAlign||fw(n,e,t,i),yAlign:i}}function cw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function dw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Yf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ys(o);let m=cw(e,r);const v=dw(e,a,u);return a==="center"?r==="left"?m+=u:r==="right"&&(m-=u):r==="left"?m-=Math.max(f,d)+s:r==="right"&&(m+=Math.max(c,h)+s),{x:un(m,0,i.width-e.width),y:un(v,0,i.height-e.height)}}function Xl(n,e,t){const i=Yn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Kf(n){return li([],bi(n))}function pw(n,e,t){return Hi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Zf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class xr extends Ci{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new n_(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=pw(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=li(r,bi(s)),r=li(r,bi(l)),r=li(r,bi(o)),r}getBeforeBody(e,t){return Kf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Tt(e,l=>{const o={before:[],lines:[],after:[]},r=Zf(i,l);li(o.before,bi(r.beforeLabel.call(this,l))
2022-08-11 01:37:41 +08:00
* chartjs-adapter-luxon v1.2.0
* https://www.chartjs.org
* (c) 2022 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const Iw={datetime:Xe.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Xe.TIME_WITH_SECONDS,minute:Xe.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};r_._date.override({_id:"luxon",_create:function(n){return Xe.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return Iw},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=Xe.fromFormat(n,e,t):n=Xe.fromISO(n,t):n instanceof Date?n=Xe.fromJSDate(n,t):i==="object"&&!(n instanceof Xe)&&(n=Xe.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 nc(n){let e,t,i;return{c(){e=_("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Dt(()=>{t||(t=rt(e,Un,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=rt(e,Un,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function Fw(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=F(n[1]),t=T(),s=F(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&ue(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&ue(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function Nw(n){let e;return{c(){e=F("Loading...")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Rw(n){let e,t,i,s,l,o=n[2]&&nc();function r(f,c){return f[2]?Nw:Fw}let a=r(n),u=a(n);return{c(){e=_("div"),o&&o.c(),t=T(),i=_("canvas"),s=T(),l=_("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),Ga(i,"height","250px"),Ga(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),ie(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),g(e,t),g(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&E(o,1):(o=nc(),o.c(),E(o,1),o.m(e,t)):o&&(Pe(),P(o,1,1,()=>{o=null}),Le()),c&4&&ie(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){E(o)},o(f){P(o)},d(f){f&&k(e),o&&o.d(),n[8](null),f&&k(s),f&&k(l),u.d()}}}function Hw(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),be.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let m of h)r.push({x:U.getDateTime(m.date).toLocal().toJSDate(),y:m.total}),t(1,a+=m.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),be.errorResponseHandler(h,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Zn(()=>(Eo.register(ji,Zo,Yo,za,Ml,ow,hw),t(6,o=new Eo(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){he[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o
2022-08-11 01:37:41 +08:00
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S(C,$){$=$||{};var M,D;switch(r.util.type(C)){case"Object":if(D=r.util.objId(C),$[D])return $[D];M={},$[D]=M;for(var O in C)C.hasOwnProperty(O)&&(M[O]=S(C[O],$));return M;case"Array":return D=r.util.objId(C),$[D]?$[D]:(M=[],$[D]=M,C.forEach(function(A,I){M[I]=S(A,$)}),M);default:return C}},getLanguage:function(S){for(;S;){var C=s.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var $ in C)if(C[$].src==S)return C[$]}return null}},isActive:function(S,C,$){for(var M="no-"+C;S;){var D=S.classList;if(D.contains(C))return!0;if(D.contains(M))return!1;S=S.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var $=r.util.clone(r.languages[S]);for(var M in C)$[M]=C[M];return $},insertBefore:function(S,C,$,M){M=M||r.languages;var D=M[S],O={};for(var A in D)if(D.hasOwnProperty(A)){if(A==C)for(var I in $)$.hasOwnProperty(I)&&(O[I]=$[I]);$.hasOwnProperty(A)||(O[A]=D[A])}var L=M[S];return M[S]=O,r.languages.DFS(r.languages,function(R,B){B===L&&R!=S&&(this[R]=O)}),O},DFS:function S(C,$,M,D){D=D||{};var O=r.util.objId;for(var A in C)if(C.hasOwnProperty(A)){$.call(C,A,C[A],M||A);var I=C[A],L=r.util.type(I);L==="Object"&&!D[O(I)]?(D[O(I)]=!0,S(I,$,null,D)):L==="Array"&&!D[O(I)]&&(D[O(I)]=!0,S(I,$,A,D))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,$){var M={callback:$,container:S,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 D=0,O;O=M.elements[D++];)r.highlightElement(O,C===!0,M.callback)},highlightElement:function(S,C,$){var M=r.util.getLanguage(S),D=r.languages[M];r.util.setLanguage(S,M);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var A=S.textContent,I={element:S,language:M,grammar:D,code:A};function L(B){I.highlightedCode=B,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),$&&$.call(I.element)}if(r.hooks.run("before-sanity-check",I),O=I.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),$&&$.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){L(r.util.encode(I.code));return}if(C&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(B){L(B.data)},R.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else L(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,C,$){var M={code:S,grammar:C,language:$};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function(S,C){var $=C.rest;if($){for(var M in $)C[M]=$[M];delete C.rest}var D=new c;return d(D,D.head,S),f(S,D,C,D.head,0),m(D)},hooks:{all:{},add:function
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(I+1))}y.textContent=D,t.highlightElement(y)},function(D){b.setAttribute(r,f),y.textContent=D})}}),t.plugins.fileHighlight={highlight:function(b){for(var y=(b||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};var m=!1;t.fileHighlight=function(){m||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),m=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(T_);const Ws=T_.exports;var qw={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(l,o){for(var r in o)o.hasOwnProperty(r)&&(l[r]=o[r]);return l};function t(l){this.defaults=e({},l)}function i(l){return l.replace(/-(\w)/g,function(o,r){return r.toUpperCase()})}function s(l){for(var o=0,r=0;r<l.length;++r)l.charCodeAt(r)==" ".charCodeAt(0)&&(o+=3);return l.length+o}t.prototype={setDefaults:function(l){this.defaults=e(this.defaults,l)},normalize:function(l,o){o=e(this.defaults,o);for(var r in o){var a=i(r);r!=="normalize"&&a!=="setDefaults"&&o[r]&&this[a]&&(l=this[a].call(this,l,o[r]))}return l},leftTrim:function(l){return l.replace(/^\s+/,"")},rightTrim:function(l){return l.replace(/\s+$/,"")},tabsToSpaces:function(l,o){return o=o|0||4,l.replace(/\t/g,new Array(++o).join(" "))},spacesToTabs:function(l,o){return o=o|0||4,l.replace(RegExp(" {"+o+"}","g")," ")},removeTrailing:function(l){return l.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(l){return l.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(l){var o=l.match(/^[^\S\n\r]*(?=\S)/gm);return!o||!o[0].length||(o.sort(function(r,a){return r.length-a.length}),!o[0].length)?l:l.replace(RegExp("^"+o[0],"gm"),"")},indent:function(l,o){return l.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++o).join(" ")+"$&")},breakLines:function(l,o){o=o===!0?80:o|0||80;for(var r=l.split(`
2022-08-11 01:37:41 +08:00
`),a=0;a<r.length;++a)if(!(s(r[a])<=o)){for(var u=r[a].split(/(\s+)/g),f=0,c=0;c<u.length;++c){var d=s(u[c]);f+=d,f>o&&(u[c]=`
`+u[c],f=d)}r[a]=u.join("")}return r.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(l){var o=Prism.plugins.NormalizeWhitespace;if(!(l.settings&&l.settings["whitespace-normalization"]===!1)&&!!Prism.util.isActive(l.element,"whitespace-normalization",!0)){if((!l.element||!l.element.parentNode)&&l.code){l.code=o.normalize(l.code,l.settings);return}var r=l.element.parentNode;if(!(!l.code||!r||r.nodeName.toLowerCase()!=="pre")){for(var a=r.childNodes,u="",f="",c=!1,d=0;d<a.length;++d){var h=a[d];h==l.element?c=!0:h.nodeName==="#text"&&(c?f+=h.nodeValue:u+=h.nodeValue,r.removeChild(h),--d)}if(!l.element.children.length||!Prism.plugins.KeepMarkup)l.code=u+l.code+f,l.code=o.normalize(l.code,l.settings);else{var m=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(m,l.settings),l.code=l.element.textContent}}}})})()})(qw);(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 Vw(n){let e,t,i;return{c(){e=_("div"),t=_("code"),p(t,"class","svelte-1ua9m3i"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-1ua9m3i")},m(s,l){w(s,e,l),g(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-1ua9m3i")&&p(e,"class",i)},i:re,o:re,d(s){s&&k(e)}}}function zw(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=Ws.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Ws.highlight(a,Ws.languages[l]||Ws.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 Ws<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class gn extends Ee{constructor(e){super(),Oe(this,e,zw,Vw,De,{class:0,content:2,language:3})}}const Bw=n=>({}),sc=n=>({}),Uw=n=>({}),lc=n=>({});function oc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C=n[4]&&!n[2]&&rc(n);const $=n[18].header,M=wn($,n,n[17],lc);let D=n[4]&&n[2]&&ac(n);const O=n[18].default,A=wn(O,n,n[17],null),I=n[18].footer,L=wn(I,n,n[17],sc);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),C&&C.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),A&&A.c(),c=T(),d=_("div"),L&&L.c(),p(t,"class","overlay"),p(o,"class","overlay-panel-section panel-header"),p(f,"class","overlay-panel-section panel-content"),p(d,"class","overlay-panel-section panel-footer"),p(l,"class",h="overlay-panel "+n[1]+" "+n[8]),i
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]))&&p(e,"for",l);const S={};y&16&&(S.id=b[4]),y&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function X$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),he.push(()=>Re(r,"value",m)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[4]+".options.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(Ct.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&16&&l!==(l=b[4]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&16&&(S.id=b[4]+".options.onlyDomains"),y&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function Q$(n){let e,t,i,s,l,o,r;return i=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[G$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[X$,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid")},m(a,u){w(a,e,u),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),r=!0},p(a,[u]){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&49&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&49&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(E(i.$$.fragment,a),E(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),q(i),q(o)}}}function x$(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){n.$$.not_equal(s.exceptDomains,r)&&(s.exceptDomains=r,t(0,s))}function o(r){n.$$.not_equal(s.onlyDomains,r)&&(s.onlyDomains=r,t(0,s))}return n.$$set=r=>{"key"in r&&t(1,i=r.key),"options"in r&&t(0,s=r.options)},[s,i,l,o]}class A_ extends Ee{constructor(e){super(),Oe(this,e,x$,Q$,De,{key:1,options:0})}}function eS(n){let e,t,i,s;function l(a){n[2](a)}function o(a){n[3](a)}let r={};return n[0]!==void 0&&(r.key=n[0]),n[1]!==void 0&&(r.options=n[1]),e=new A_({props:r}),he.push(()=>Re(e,"key",l)),he.push(()=>Re(e,"options",o)),{c(){V(e.$$.fragment)},m(a,u){j(e,a,u),s=!0},p(a,[u]){const f={};!t&&u&1&&(t=!0,f.key=a[0],He(()=>t=!1)),!i&&u&2&&(i=!0,f.options=a[1],He(()=>i=!1)),e.$set(f)},i(a){s||(E(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){q(e,a)}}}function tS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(r){i=r,t(0,i)}function o(r){s=r,t(1,s)}return n.$$set=r=>{"key"in r&&t(0,i=r.key),"options"in r&&t(1,s=r.options)},[i,s,l,o]}class nS extends Ee{constructor(e){super(),Oe(this,e,tS,eS,De,{key:0,options:1})}}var kr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ks={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(n){return typeof console<"u"&&console.warn(n)},getWeek:function(n){var e=new Date(n.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var t=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-t.getTime())/864e5-3+(t.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/x
2022-08-11 01:37:41 +08:00
<span class='flatpickr-weekday'>
`+z.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function oe(){t.calendarContainer.classList.add("hasWeeks");var N=St("div","flatpickr-weekwrapper");N.appendChild(St("span","flatpickr-weekday",t.l10n.weekAbbreviation));var z=St("div","flatpickr-weeks");return N.appendChild(z),{weekWrapper:N,weekNumbers:z}}function me(N,z){z===void 0&&(z=!0);var ne=z?N:N-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,Ke("onYearChange"),K()),B(),Ke("onMonthChange"),at())}function se(N,z){if(N===void 0&&(N=!0),z===void 0&&(z=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,z===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Cr(t.config),ae=ne.hours,Ae=ne.minutes,le=ne.seconds;h(ae,Ae,le)}t.redraw(),N&&Ke("onChange")}function ge(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),Ke("onClose")}function ke(){t.config!==void 0&&Ke("onDestroy");for(var N=t._handlers.length;N--;)t._handlers[N].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 z=t.calendarContainer.parentNode;if(z.lastChild&&z.removeChild(z.lastChild),z.parentNode){for(;z.firstChild;)z.parentNode.insertBefore(z.firstChild,z);z.parentNode.removeChild(z)}}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 Y(N){return t.calendarContainer.contains(N)}function ve(N){if(t.isOpen&&!t.config.inline){var z=On(N),ne=Y(z),ae=z===t.input||z===t.altInput||t.element.contains(z)||N.path&&N.path.indexOf&&(~N.path.indexOf(t.input)||~N.path.indexOf(t.altInput)),Ae=!ae&&!ne&&!Y(N.relatedTarget),le=!t.config.ignoredFocusElements.some(function(ye){return ye.contains(z)});Ae&&le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function ee(N){if(!(!N||t.config.minDate&&N<t.config.minDate.getFullYear()||t.config.maxDate&&N>t.config.maxDate.getFullYear())){var z=N,ne=t.currentYear!==z;t.currentYear=z||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(),Ke("onYearChange"),K())}}function Q(N,z){var ne;z===void 0&&(z=!0);var ae=t.parseDate(N,void 0,z);if(t.config.minDate&&ae&&En(ae,t.config.minDate,z!==void 0?z:!t.minDateHasTime)<0||t.config.maxDate&&ae&&En(ae,t.config.maxDate,z!==void 0?z:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!
2022-08-11 01:37:41 +08:00
`),d=_("span"),h=_("span"),h.textContent="Choose presets",m=T(),V(v.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(h,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m(M,D){w(M,e,D),g(e,t),g(e,i),g(e,s),w(M,o,D),j(r,M,D),w(M,u,D),w(M,f,D),g(f,c),g(f,d),g(d,h),g(d,m),j(v,d,null),b=!0,y||(S=Ye(Ct.call(null,s,{text:`Allow files ONLY with the listed mime types.
Leave empty for no restriction.`,position:"top"})),y=!0)},p(M,D){(!b||D&1024&&l!==(l=M[10]))&&p(e,"for",l);const O={};D&1024&&(O.id=M[10]),!a&&D&1&&(a=!0,O.value=M[0].mimeTypes,He(()=>a=!1)),r.$set(O);const A={};D&2049&&(A.$$scope={dirty:D,ctx:M}),v.$set(A)},i(M){b||(E(r.$$.fragment,M),E(v.$$.fragment,M),b=!0)},o(M){P(r.$$.fragment,M),P(v.$$.fragment,M),b=!1},d(M){M&&k(e),M&&k(o),q(r,M),M&&k(u),M&&k(f),q(v),y=!1,S()}}}function OS(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[9](b)}let v={id:n[10],placeholder:"eg. 50x50, 480x720"};return n[0].thumbs!==void 0&&(v.value=n[0].thumbs),r=new cs({props:v}),he.push(()=>Re(r,"value",m)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(Ct.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs will be generated lazily on first access.",position:"top"})),d=!0)},p(b,y){(!c||y&1024&&l!==(l=b[10]))&&p(e,"for",l);const S={};y&1024&&(S.id=b[10]),!a&&y&1&&(a=!0,S.value=b[0].thumbs,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function ES(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return i=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[CS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[MS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[DS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[OS,({uniqueId:m})=>({10:m}),({uniqueId:m})=>m?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(a,"class","col-sm-12"),p(c,"class","col-sm-12"),p(e,"class","grid")},m(m,v){w(m,e,v),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),g(e,f),g(e,c),j(d,c,null),h=!0},p(m,[v]){const b={};v&2&&(b.name="schema."+m[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:m}),i.$set(b);const y={};v&2&&(y.name="schema."+m[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:m}),o.$set(y);const S={};v&2&&(S.name="schema."+m[1]+".options.mimeTypes"),v&3073&&(S.$$scope={dirty:v,ctx:m}),u.$set(S);const C={};v&2&&(C.name="schema."+m[1]+".options.thumbs"),v&3073&&(C.$$scope={dirty:v,ctx:m}),d.$set(C)},i(m){h||(E(i.$$.fragment,m),E(o.$$.fragment,m),E(u.$$.fragment,m),E(d.$$.fragment,m),h=!0)},o(m){P(i.$$.fragment,m),P(o.$$.fragment,m),P(u.$$.fragment,m),P(d.$$.fragment,m),h=!1},d(m){m&&k(e),q(i),q(o),q(u),q(d)}}}function AS(n,e,t){let{key:i=""}=e,{options:s={}}=e;function l(){s.maxSize=At(this.value),t(0,s)}function o(){s.maxSelect=At(this.value),t(0,s)}function r(h){n.$$.not_equal(s.mimeTypes,h)&&(s.mimeTypes=h,t(0,s))}const a=()=>{t(0,s.mimeTypes=["application/pdf","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],s)},u=()=>{t(0,s.mimeTypes=["image/jpg","image/jpeg","image/png","image/svg+xml","image/gif"],s)},f=()=>{t(0,s.mimeTypes=["video/mp4","video/x-ms-wmv","video/quicktime","video/3gpp"],s)},c=()=>{t(0,s.mimeTypes=["application/zip","application/x-7z-compressed","application/x-rar-compressed"],s)};function d(h){n.$$.not_equal(s.thumbs,h)&&(s.thumbs=h,t(0,s))}return n.$$set=h=>{"key"in h&&t(1,i=h.key),"options"in h&&t(0,s=h.opt
2022-08-11 01:37:41 +08:00
form-field
required
`+(n[5]?"":"invalid")+`
`+(n[0].id&&n[0].system?"disabled":"")+`
`,name:"schema."+n[1]+".name",$$slots:{default:[WS,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});const O=[n3,t3,e3,xS,QS,XS,GS,JS,ZS,KS,YS],A=[];function I(B,K){return B[0].type==="text"?0:B[0].type==="number"?1:B[0].type==="bool"?2:B[0].type==="email"?3:B[0].type==="url"?4:B[0].type==="date"?5:B[0].type==="select"?6:B[0].type==="json"?7:B[0].type==="file"?8:B[0].type==="relation"?9:B[0].type==="user"?10:-1}~(f=I(n))&&(c=A[f]=O[f](n)),m=new Ne({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[i3,({uniqueId:B})=>({38:B}),({uniqueId:B})=>[0,B?128:0]]},$$scope:{ctx:n}}});let L=n[0].type!=="file"&&Fc(n),R=!n[0].toDelete&&Nc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),V(s.$$.fragment),l=T(),o=_("div"),V(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),h=_("div"),V(m.$$.fragment),v=T(),b=_("div"),L&&L.c(),y=T(),R&&R.c(),S=T(),C=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(h,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(C,"type","submit"),p(C,"class","hidden"),p(C,"tabindex","-1"),p(e,"class","field-form")},m(B,K){w(B,e,K),g(e,t),g(t,i),j(s,i,null),g(t,l),g(t,o),j(r,o,null),g(t,a),g(t,u),~f&&A[f].m(u,null),g(t,d),g(t,h),j(m,h,null),g(t,v),g(t,b),L&&L.m(b,null),g(t,y),R&&R.m(t,null),g(e,S),g(e,C),$=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(B,K){const J={};K[0]&1&&(J.class="form-field required "+(B[0].id?"disabled":"")),K[0]&2&&(J.name="schema."+B[1]+".type"),K[0]&1|K[1]&384&&(J.$$scope={dirty:K,ctx:B}),s.$set(J);const H={};K[0]&33&&(H.class=`
2022-08-11 01:37:41 +08:00
form-field
required
`+(B[5]?"":"invalid")+`
`+(B[0].id&&B[0].system?"disabled":"")+`
`),K[0]&2&&(H.name="schema."+B[1]+".name"),K[0]&33|K[1]&384&&(H.$$scope={dirty:K,ctx:B}),r.$set(H);let X=f;f=I(B),f===X?~f&&A[f].p(B,K):(c&&(Pe(),P(A[X],1,1,()=>{A[X]=null}),Le()),~f?(c=A[f],c?c.p(B,K):(c=A[f]=O[f](B),c.c()),E(c,1),c.m(u,null)):c=null);const W={};K[0]&1|K[1]&384&&(W.$$scope={dirty:K,ctx:B}),m.$set(W),B[0].type!=="file"?L?(L.p(B,K),K[0]&1&&E(L,1)):(L=Fc(B),L.c(),E(L,1),L.m(b,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),B[0].toDelete?R&&(Pe(),P(R,1,1,()=>{R=null}),Le()):R?(R.p(B,K),K[0]&1&&E(R,1)):(R=Nc(B),R.c(),E(R,1),R.m(t,null))},i(B){$||(E(s.$$.fragment,B),E(r.$$.fragment,B),E(c),E(m.$$.fragment,B),E(L),E(R),$=!0)},o(B){P(s.$$.fragment,B),P(r.$$.fragment,B),P(c),P(m.$$.fragment,B),P(L),P(R),$=!1},d(B){B&&k(e),q(s),q(r),~f&&A[f].d(),q(m),L&&L.d(),R&&R.d(),M=!1,D()}}}function Hc(n){let e,t,i,s,l=n[0].system&&jc(),o=!n[0].id&&qc(n),r=n[0].required&&Vc(),a=n[0].unique&&zc();return{c(){e=_("div"),l&&l.c(),t=T(),o&&o.c(),i=T(),r&&r.c(),s=T(),a&&a.c(),p(e,"class","inline-flex")},m(u,f){w(u,e,f),l&&l.m(e,null),g(e,t),o&&o.m(e,null),g(e,i),r&&r.m(e,null),g(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=jc(),l.c(),l.m(e,t)):l&&(l.d(1),l=null),u[0].id?o&&(o.d(1),o=null):o?o.p(u,f):(o=qc(u),o.c(),o.m(e,i)),u[0].required?r||(r=Vc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=zc(),a.c(),a.m(e,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),l&&l.d(),o&&o.d(),r&&r.d(),a&&a.d()}}}function jc(n){let e;return{c(){e=_("span"),e.textContent="System",p(e,"class","label label-danger")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function qc(n){let e;return{c(){e=_("span"),e.textContent="New",p(e,"class","label"),ie(e,"label-warning",n[8]&&!n[0].toDelete)},m(t,i){w(t,e,i)},p(t,i){i[0]&257&&ie(e,"label-warning",t[8]&&!t[0].toDelete)},d(t){t&&k(e)}}}function Vc(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function zc(n){let e;return{c(){e=_("span"),e.textContent="Unique",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bc(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=rt(e,Un,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=rt(e,Un,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function Uc(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Restore</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-danger btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",ei(n[15])),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function r3(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,h,m,v,b,y=!n[0].toDelete&&Hc(n),S=n[7]&&!n[0].system&&Bc(),C=n[0].toDelete&&Uc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=F(r),f=T(),y&&y.c(),c=T(),d=_("div"),h=T(),S&&S.c(),m=T(),C&&C.c(),v=Je(),p(i,"class",s=Ja(U.getFieldTypeIcon(n[0].type))+" svelte-1tpxlm5"),p(t,"class","icon field-type"),p(o,"class","title field-name svelte-1tpxlm5"),p(o,"title",u=n[0].name),ie(o,"txt-strikethrough",n[0].toDelete),p(e,"class","inline-flex"),p(d,"class","flex-fill")},m($,M){w($,e,M),g(e,t),g(t,i),g(e,l),g(e,o),g(o,a),w($,f,M),y&&y.m($,M),w($,c,M),w($,d,M),w($,h,M),S&&S.m($,M),w($,m,M),C&&C.m($,M),w($,v,M),b=!0},p($,M){(!b||M[0]&1&&s!==(s=Ja(U.getFieldTypeIcon($[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=($[0].name||"-")+"")&&ue(a,r),(!b||M[0]&1&&u!==(u=$[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",$[0].toDelete),$[0].toDelete?y&&(y.d(1),y=null):y?y.p($,M):(y=Hc($),y.c(),y.m(c.parentNode,c)),$[7]&&!$[0].system?S?M[0]&129&&E(S,1):(S=Bc(),S.c(),E(S,1),S.m(m.parentNode,m)):S&&(Pe(),P(S,1,1,()=>{S=null}),Le()),$[0].toDelete?C?C.p($,M):(C=Uc($),C.c(),C.m(v.parentNode,v)):C&&(C.d(1),C=null)},i($){b||(E(S),b=!0)},o($){P(S),b=!1},d($){$&&k(e),$&&k(f),y&&y.d($),$&&k(c),$&&k(d),$&&k(h),S&&S.d($),$&&k(m),C&&C.d($),$&&k(v)}}}function a3(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n[0].toDelete|
2022-08-11 01:37:41 +08:00
<code>@request.query.*</code>
<code>@request.data.*</code>
<code>@request.user.*</code>`,C=T(),$=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=T(),A=_("div"),A.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",I=T(),L=_("hr"),R=T(),B=_("p"),B.innerHTML=`Example rule:
<br/>
<code>@request.user.id!=&quot;&quot; &amp;&amp; created&gt;&quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(m,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(A,"class","inline-flex flex-gap-5"),p(L,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(W,te){w(W,e,te),g(e,t),g(t,i),g(i,s),g(i,l),g(i,o),g(o,r),g(o,a),g(o,u),g(o,f),g(o,c),g(o,d);for(let x=0;x<X.length;x+=1)X[x].m(o,null);g(i,h),g(i,m),g(i,v),g(i,b),g(i,y),g(i,S),g(i,C),g(i,$),g(i,M),g(i,D),g(i,O),g(i,A),g(i,I),g(i,L),g(i,R),g(i,B),J=!0},p(W,te){if(te&1){H=W[0].schema;let x;for(x=0;x<H.length;x+=1){const oe=Zc(W,H,x);X[x]?X[x].p(oe,te):(X[x]=Gc(oe),X[x].c(),X[x].m(o,null))}for(;x<X.length;x+=1)X[x].d(1);X.length=H.length}},i(W){J||(W&&Dt(()=>{K||(K=rt(e,tn,{duration:150},!0)),K.run(1)}),J=!0)},o(W){W&&(K||(K=rt(e,tn,{duration:150},!1)),K.run(0)),J=!1},d(W){W&&k(e),xt(X,W),W&&K&&K.end()}}}function h3(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=F(t)},m(s,l){w(s,e,l),g(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&ue(i,t)},d(s){s&&k(e)}}}function m3(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=F(t),s=F(".*")},m(l,o){w(l,e,o),g(e,i),g(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&ue(i,t)},d(l){l&&k(e)}}}function Gc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?m3:h3}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function g3(n){let e=[],t=new Map,i,s,l=Object.entries(n[6]);const o=r=>r[14];for(let r=0;r<l.length;r+=1){let a=Kc(n,l,r),u=o(a);t.set(u,e[r]=Xc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=Je()},m(r,a){for(let u=0;u<e.length;u+=1)e[u].m(r,a);w(r,i,a),s=!0},p(r,a){a&262235&&(l=Object.entries(r[6]),Pe(),e=bt(e,a,o,1,r,l,t,i.parentNode,Gt,Xc,i,Kc),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(e[a]);s=!0}},o(r){for(let a=0;a<e.length;a+=1)P(e[a]);s=!1},d(r){for(let a=0;a<e.length;a+=1)e[a].d(r);r&&k(i)}}}function _3(n){let e;return{c(){e=_("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function b3(n){let e,t,i;function s(){return n[9](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(Ct.call(null,e,"Lock and set to Admins only")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Qe(i)}}}function v3(n){let e,t,i;function s(){return n[8](n[14])}return{c(){e=_("button"),e.innerHTML='<i class="ri-lock-unlock-line"></i>',p(e,"type","button"),p(e,"class","rule-toggle-btn btn btn-circle btn-outline btn-success svelte-fjxz7k")},m(l,o){w(l,e,o),t||(i=[Ye(Ct.call(null,e,"Unlock and set custom rule")),G(e,"click",s)],t=!0)},p(l,o){n=l},d(l){l&&k(e),t=!1,Qe(i)}}}function y3(n){let e;return{c(){e=F("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function k3(n){let e;return{c(){e=F("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function w3(n){let e,t=n[15]+"",i,s,l=Ai(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,h,m,v,b,y;function S(){return n[10](n[14])}const C=()=>n[11](u,f),$=()=>n[11](null,f);function M(R){n[12](R,n[14])}var D=n[4];function O(R){let B={baseCollection:R[0],disabled:Ai(R[0][R[14]])};return R[0][R[14]]!==void 0&&(B.value=R[0][R[14]]),{props:B}}D&&(u=new D(O(n)),C(),he.push(()=>Re(u,"value",M)));function A(R,B){return B&1&&(m=null),m==null&&(m=!!Ai(R[0][R[14]])),m?k3:y3}let I=A(n,-1),L=I(n);return{c(){e=_("label"),i=F(t),s=F(" - "),o=F(l),a=T(),u&&V(u.$$.fragment),d=T(),h=_("div"),L.c(),p(e,"for",r=n[18]),p(h,"class","help-block")},m(R,B){w(R,e,B),g(e,i),g(e,s),g(e,o),w(R,a,B),u&&j(u,R,B),w(R,d,B),w(R,h,B),L.m(h,null),v=!0,b||(y=G(e,"click",S),b=!0)},p(R,B){n=R,(!v||B&1)&&l!==(l=Ai(n
2022-08-11 01:37:41 +08:00
<a href="https://pocketbase.io/docs/manage-collections#rules-filters-syntax" target="_blank" rel="noopener">PocketBase filter syntax and operators
</a>.`,s=T(),l=_("span"),r=F(o),a=T(),b&&b.c(),u=T(),c.c(),d=Je(),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex"),p(e,"class","block m-b-base")},m($,M){w($,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),b&&b.m(e,null),w($,u,M),S[f].m($,M),w($,d,M),h=!0,m||(v=G(l,"click",n[7]),m=!0)},p($,[M]){(!h||M&4)&&o!==(o=$[2]?"Hide available fields":"Show available fields")&&ue(r,o),$[2]?b?(b.p($,M),M&4&&E(b,1)):(b=Jc($),b.c(),E(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=C($),f===D?S[f].p($,M):(Pe(),P(S[D],1,1,()=>{S[D]=null}),Le(),c=S[f],c?c.p($,M):(c=S[f]=y[f]($),c.c()),E(c,1),c.m(d.parentNode,d))},i($){h||(E(b),E(c),h=!0)},o($){P(b),P(c),h=!1},d($){$&&k(e),b&&b.d(),$&&k(u),S[f].d($),$&&k(d),m=!1,v()}}}function Ai(n){return n===null}function S3(n,e,t){let{collection:i=new fn}=e,s={},l=!1,o={},r,a=!1;const u={listRule:"List Action",viewRule:"View Action",createRule:"Create Action",updateRule:"Update Action",deleteRule:"Delete Action"};async function f(){t(5,a=!0);try{t(4,r=(await Xi(()=>import("./FilterAutocompleteInput.8c09e039.js"),[],import.meta.url)).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Zn(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var S;t(0,i[y]=s[y]||"",i),await ni(),(S=o[y])==null||S.focus()},h=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},m=y=>{var S;return(S=o[y])==null?void 0:S.focus()};function v(y,S){he[y?"unshift":"push"](()=>{o[S]=y,t(3,o)})}function b(y,S){n.$$.not_equal(i[S],y)&&(i[S]=y,t(0,i))}return n.$$set=y=>{"collection"in y&&t(0,i=y.collection)},[i,s,l,o,r,a,u,c,d,h,m,v,b]}class C3 extends Ee{constructor(e){super(),Oe(this,e,S3,$3,De,{collection:0})}}function Qc(n,e,t){const i=n.slice();return i[14]=e[t],i}function xc(n,e,t){const i=n.slice();return i[14]=e[t],i}function ed(n){let e;return{c(){e=_("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function td(n){let e,t,i,s,l=n[1].originalName+"",o,r,a,u,f,c=n[1].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed collection
2022-08-11 01:37:41 +08:00
`),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,m){w(h,e,m),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(h,m){m&2&&l!==(l=h[1].originalName+"")&&ue(o,l),m&2&&c!==(c=h[1].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function nd(n){let e,t,i,s,l=n[14].originalName+"",o,r,a,u,f,c=n[14].name+"",d;return{c(){e=_("li"),t=_("div"),i=F(`Renamed field
`),s=_("strong"),o=F(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=F(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex")},m(h,m){w(h,e,m),g(e,t),g(t,i),g(t,s),g(s,o),g(t,r),g(t,a),g(t,u),g(t,f),g(f,d)},p(h,m){m&16&&l!==(l=h[14].originalName+"")&&ue(o,l),m&16&&c!==(c=h[14].name+"")&&ue(d,c)},d(h){h&&k(e)}}}function id(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=F("Removed field "),i=_("span"),l=F(s),o=T(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),g(e,t),g(e,i),g(i,l),g(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&ue(l,s)},d(r){r&&k(e)}}}function M3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[3].length&&ed(),m=n[5]&&td(n),v=n[4],b=[];for(let C=0;C<v.length;C+=1)b[C]=nd(xc(n,v,C));let y=n[3],S=[];for(let C=0;C<y.length;C+=1)S[C]=id(Qc(n,y,C));return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=T(),s=_("div"),l=_("p"),l.textContent=`If any of the following changes is part of another collection rule or filter, you'll have to
update it manually!`,o=T(),h&&h.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),m&&m.c(),c=T();for(let C=0;C<b.length;C+=1)b[C].c();d=T();for(let C=0;C<S.length;C+=1)S[C].c();p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning"),p(f,"class","changes-list svelte-1ghly2p")},m(C,$){w(C,e,$),g(e,t),g(e,i),g(e,s),g(s,l),g(s,o),h&&h.m(s,null),w(C,r,$),w(C,a,$),w(C,u,$),w(C,f,$),m&&m.m(f,null),g(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);g(f,d);for(let M=0;M<S.length;M+=1)S[M].m(f,null)},p(C,$){if(C[3].length?h||(h=ed(),h.c(),h.m(s,null)):h&&(h.d(1),h=null),C[5]?m?m.p(C,$):(m=td(C),m.c(),m.m(f,c)):m&&(m.d(1),m=null),$&16){v=C[4];let M;for(M=0;M<v.length;M+=1){const D=xc(C,v,M);b[M]?b[M].p(D,$):(b[M]=nd(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if($&8){y=C[3];let M;for(M=0;M<y.length;M+=1){const D=Qc(C,y,M);S[M]?S[M].p(D,$):(S[M]=id(D),S[M].c(),S[M].m(f,null))}for(;M<S.length;M+=1)S[M].d(1);S.length=y.length}},d(C){C&&k(e),h&&h.d(),C&&k(r),C&&k(a),C&&k(u),C&&k(f),m&&m.d(),xt(b,C),xt(S,C)}}}function T3(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function D3(n){let e,t,i,s,l;return{c(){e=_("button"),e.innerHTML='<span class="txt">Cancel</span>',t=T(),i=_("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-secondary"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[G(e,"click",n[8]),G(i,"click",n[9])],s=!0)},p:re,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Qe(l)}}}function O3(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[D3],header:[T3],default:[M3]},$$scope:{ctx:n}};return e=new hi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),q(e,s)}}}function E3(n,e,t){let i,s,l;const o=on();let r,a;async function u(y){t(1,a=y),await ni(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),h=()=>c();function m(y){he[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){ut.call(this,n,y)}function b(y){ut.call(this,n,y)}return n.$$.update=()=>{n.$$.dirty&2&&t(5,i=(a==null?void 0:a.originalName)!=(a==null?void 0:a.name)),n.$$.dirty&2&&t(4,s=(a==null?void 0:a.schema.filter(y=>y.id&&!y.toDelete&&y.originalName!=y.name))||[]),n.$$.dirty&2&&t(3,l=(a==null?void 0:a.schema.filter(y=>y.id&&y.toDelete))||[])},[f,a,r,l,s,i,c,u,d,h,m,v,b]}class A3 extends Ee{constructor(e){super(),Oe(this,e,E3,O3,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function sd(n){let e,t,i,s;function l(r){n[26](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new C3({props:o}),he.push(()=>Re(t,"collection",l)),{c(){e=_("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(E(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),q(t)}}}function P3(n){let e,t,i,s,l,o;function r(f){n[25](f)}let a={};n[2]!==void 0&&(a.collection=n[2]),i=new p3({props:a}),he.push(()=>Re(i,"collection",r));let u=n[9]===ml&&sd(n);return{c(){e=_("div"),t=_("div"),V(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===ls),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),g(e,t),j(i,t,null),g(e,l),u&&u.m(e,null),o=!0},p(f,c){const d={};!s&&c[0]&4&&(s=!0,d.collection=f[2],He(()=>s=!1)),i.$set(d),c[0]&512&&ie(t,"active",f[9]===ls),f[9]===ml?u?(u.p(f,c),c[0]&512&&E(u,1)):(u=sd(f),u.c(),E(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},i(f){o||(E(i.$$.fragment,f),E(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),q(i),u&&u.d()}}}function ld(n){let e,t,i,s,l,o,r;return o=new qi({props:{class:"dropdown dropdown-right m
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[20]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function od(n){let e;return{c(){e=_("div"),e.textContent="System collection",p(e,"class","help-block")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function I3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=n[2].system&&od();return{c(){e=_("label"),t=F("Name"),s=T(),l=_("input"),u=T(),h&&h.c(),f=Je(),p(e,"for",i=n[38]),p(l,"type","text"),p(l,"id",o=n[38]),l.required=!0,l.disabled=n[11],p(l,"spellcheck","false"),l.autofocus=r=n[2].isNew,p(l,"placeholder",'eg. "posts"'),l.value=a=n[2].name},m(m,v){w(m,e,v),g(e,t),w(m,s,v),w(m,l,v),w(m,u,v),h&&h.m(m,v),w(m,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(m,v){v[1]&128&&i!==(i=m[38])&&p(e,"for",i),v[1]&128&&o!==(o=m[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=m[11]),v[0]&4&&r!==(r=m[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=m[2].name)&&l.value!==a&&(l.value=a),m[2].system?h||(h=od(),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},d(m){m&&k(e),m&&k(s),m&&k(l),m&&k(u),h&&h.d(m),m&&k(f),c=!1,d()}}}function rd(n){let e,t,i,s,l,o;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(r,a){w(r,e,a),s=!0,l||(o=Ye(t=Ct.call(null,e,n[12])),l=!0)},p(r,a){t&&Kn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Dt(()=>{i||(i=rt(e,Un,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=rt(e,Un,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function ad(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Dt(()=>{t||(t=rt(e,Un,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=rt(e,Un,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function F3(n){var R,B,K,J,H,X;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,h,m,v=!U.isEmpty((R=n[4])==null?void 0:R.schema),b,y,S,C,$=!U.isEmpty((B=n[4])==null?void 0:B.listRule)||!U.isEmpty((K=n[4])==null?void 0:K.viewRule)||!U.isEmpty((J=n[4])==null?void 0:J.createRule)||!U.isEmpty((H=n[4])==null?void 0:H.updateRule)||!U.isEmpty((X=n[4])==null?void 0:X.deleteRule),M,D,O,A=!n[2].isNew&&!n[2].system&&ld(n);r=new Ne({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[I3,({uniqueId:W})=>({38:W}),({uniqueId:W})=>[0,W?128:0]]},$$scope:{ctx:n}}});let I=v&&rd(n),L=$&&ad();return{c(){e=_("h4"),i=F(t),s=T(),A&&A.c(),l=T(),o=_("form"),V(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),h=_("span"),h.textContent="Fields",m=T(),I&&I.c(),b=T(),y=_("button"),S=_("span"),S.textContent="API Rules",C=T(),L&&L.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(h,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===ls),p(S,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===ml),p(c,"class","tabs-header stretched")},m(W,te){w(W,e,te),g(e,i),w(W,s,te),A&&A.m(W,te),w(W,l,te),w(W,o,te),j(r,o,null),g(o,a),g(o,u),w(W,f,te),w(W,c,te),g(c,d),g(d,h),g(d,m),I&&I.m(d,null),g(c,b),g(c,y),g(y,S),g(y,C),L&&L.m(y,null),M=!0,D||(O=[G(o,"submit",Yt(n[22])),G(d,"click",n[23]),G(y,"click",n[24])],D=!0)},p(W,te){var oe,me,se,ge,ke,Y;(!M||te[0]&4)&&t!==(t=W[2].isNew?"New collection":"Edit collection")&&ue(i,t),!W[2].isNew&&!W[2].system?A?(A.p(W,te),te[0]&4&&E(A,1)):(A=ld(W),A.c(),E(A,1),A.m(l.parentNode,l)):A&&(Pe(),P(A,1,1,()=>{A=null}),Le());const x={};te[0]&2048&&(x.class="form-field required m-b-0 "+(W[11]?"disabled":"")),te[0]&2052|te[1]&384&&(x.$$scope={dirty:te,ctx:W}),r.$set(x),te[0]&16&&(v=!U.isEmpty((oe=W[4])==null?void 0:oe.schema)),v?I?(I.p(W,te),te[0]&16&&E(I,1)):(I=rd(W),I.c(),E(I,1),I.m(d,null)):I&&(Pe(),P(I,1,1,()=>{I=null}),Le()),te[0]&512&&ie(d,"active",W[9]===ls),te[0]&16&&($=!U.isEmpty((me=W[4])==null?void 0:me.listRule)||!U.isEmpty((se=W[4])==null?void 0:se.viewRule)||!U.isEmpty((ge=W[4])==null?void
<span class="txt">New collection</span>`,y=T(),V(S.$$.fragment),p(l,"type","button"),p(l,"class","btn btn-xs btn-secondary btn-circle btn-clear"),ie(l,"hidden",!n[4]),p(s,"class","form-field-addon"),p(r,"type","text"),p(r,"placeholder","Search collections..."),p(i,"class","form-field search"),ie(i,"active",n[4]),p(t,"class","sidebar-header"),p(u,"class","m-t-5 m-b-xs"),p(c,"class","sidebar-content"),p(b,"type","button"),p(b,"class","btn btn-block btn-outline"),p(v,"class","sidebar-footer"),p(e,"class","page-sidebar collection-sidebar")},m(L,R){w(L,e,R),g(e,t),g(t,i),g(i,s),g(s,l),g(i,o),g(i,r),Me(r,n[0]),g(e,a),g(e,u),g(e,f),g(e,c);for(let B=0;B<d.length;B+=1)d[B].m(c,null);A&&A.m(c,null),g(e,m),g(e,v),g(v,b),w(L,y,R),j(S,L,R),C=!0,$||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],$=!0)},p(L,[R]){R&16&&ie(l,"hidden",!L[4]),R&1&&r.value!==L[0]&&Me(r,L[0]),R&16&&ie(i,"active",L[4]),R&106&&(D=L[3],d=bt(d,R,O,1,L,D,h,c,Mn,dd,null,ud),!D.length&&A?A.p(L,R):D.length?A&&(A.d(1),A=null):(A=fd(L),A.c(),A.m(c,null)));const B={};S.$set(B)},i(L){C||(E(S.$$.fragment,L),C=!0)},o(L){P(S.$$.fragment,L),C=!1},d(L){L&&k(e);for(let R=0;R<d.length;R+=1)d[R].d();A&&A.d(),L&&k(y),n[12](null),q(S,L),$=!1,Qe(M)}}}function z3(n,e,t){let i,s,l,o,r;kt(n,ui,b=>t(5,o=b)),kt(n,Ds,b=>t(7,r=b));let a,u="";function f(b){dn(ui,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const h=b=>f(b),m=()=>a==null?void 0:a.show();function v(b){he[b?"unshift":"push"](()=>{a=b,t(2,a)})}return n.$$.update=()=>{n.$$.dirty&1&&t(1,i=u.replace(/\s+/g,"").toLowerCase()),n.$$.dirty&1&&t(4,s=u!==""),n.$$.dirty&131&&t(3,l=r.filter(b=>b.name!="profiles"&&(b.id==u||b.name.replace(/\s+/g,"").toLowerCase().includes(i))))},[u,i,a,l,s,o,f,r,c,d,h,m,v]}class B3 extends Ee{constructor(e){super(),Oe(this,e,z3,V3,De,{})}}function U3(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
2022-08-11 01:37:41 +08:00
<code><span class="txt-success">OPERAND</span>
<span class="txt-danger">OPERATOR</span>
<span class="txt-success">OPERAND</span></code>, where:`,t=T(),i=_("ul"),s=_("li"),s.innerHTML=`<code class="txt-success">OPERAND</code> - could be any of the above field literal, string (single or double
quoted), number, null, true, false`,l=T(),o=_("li"),r=_("code"),r.textContent="OPERATOR",a=F(` - is one of:
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),h=_("code"),h.textContent="=",m=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),S=_("code"),S.textContent="!=",C=T(),$=_("span"),$.textContent="NOT equal",M=T(),D=_("li"),O=_("code"),O.textContent=">",A=T(),I=_("span"),I.textContent="Greater than",L=T(),R=_("li"),B=_("code"),B.textContent=">=",K=T(),J=_("span"),J.textContent="Greater than or equal",H=T(),X=_("li"),W=_("code"),W.textContent="<",te=T(),x=_("span"),x.textContent="Less than or equal",oe=T(),me=_("li"),se=_("code"),se.textContent="<=",ge=T(),ke=_("span"),ke.textContent="Less than or equal",Y=T(),ve=_("li"),ee=_("code"),ee.textContent="~",Q=T(),Se=_("span"),Se.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
2022-08-11 01:37:41 +08:00
match)`,je=T(),Ue=_("li"),Z=_("code"),Z.textContent="!~",pe=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
wildcard match)`,we=T(),Ze=_("p"),Ze.innerHTML=`To group and combine several expressions you could use brackets
<code>(...)</code>, <code>&amp;&amp;</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(h,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p(S,"class","filter-op svelte-1w7s5nw"),p($,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(I,"class","txt-hint"),p(B,"class","filter-op svelte-1w7s5nw"),p(J,"class","txt-hint"),p(W,"class","filter-op svelte-1w7s5nw"),p(x,"class","txt-hint"),p(se,"class","filter-op svelte-1w7s5nw"),p(ke,"class","txt-hint"),p(ee,"class","filter-op svelte-1w7s5nw"),p(Se,"class","txt-hint"),p(Z,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(tt,We){w(tt,e,We),w(tt,t,We),w(tt,i,We),g(i,s),g(i,l),g(i,o),g(o,r),g(o,a),g(o,u),g(o,f),g(o,c),g(c,d),g(d,h),g(d,m),g(d,v),g(c,b),g(c,y),g(y,S),g(y,C),g(y,$),g(c,M),g(c,D),g(D,O),g(D,A),g(D,I),g(c,L),g(c,R),g(R,B),g(R,K),g(R,J),g(c,H),g(c,X),g(X,W),g(X,te),g(X,x),g(c,oe),g(c,me),g(me,se),g(me,ge),g(me,ke),g(c,Y),g(c,ve),g(ve,ee),g(ve,Q),g(ve,Se),g(c,je),g(c,Ue),g(Ue,Z),g(Ue,pe),g(Ue,ce),w(tt,we,We),w(tt,Ze,We)},p:re,i:re,o:re,d(tt){tt&&k(e),tt&&k(t),tt&&k(i),tt&&k(we),tt&&k(Ze)}}}class W3 extends Ee{constructor(e){super(),Oe(this,e,null,U3,De,{})}}function pd(n,e,t){const i=n.slice();return i[5]=e[t],i}function hd(n,e,t){const i=n.slice();return i[5]=e[t],i}function md(n,e){let t,i,s=e[5].title+"",l,o,r,a;function u(){return e[4](e[5])}return{key:n,first:null,c(){t=_("button"),i=_("div"),l=F(s),o=T(),p(i,"class","txt"),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(f,c){w(f,t,c),g(t,i),g(i,l),g(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&ue(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function gd(n,e){let t,i,s,l;return i=new gn({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item svelte-1maocj6"),ie(t,"active",e[0]===e[5].language),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o;const a={};r&2&&(a.language=e[5].language),r&2&&(a.content=e[5].content),i.$set(a),r&3&&ie(t,"active",e[0]===e[5].language)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function Y3(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=m=>m[5].language;for(let m=0;m<f.length;m+=1){let v=hd(n,f,m),b=c(v);s.set(b,i[m]=md(b,v))}let d=n[1];const h=m=>m[5].language;for(let m=0;m<d.length;m+=1){let v=pd(n,d,m),b=h(v);a.set(b,r[m]=gd(b,v))}return{c(){e=_("div"),t=_("div");for(let m=0;m<i.length;m+=1)i[m].c();l=T(),o=_("div");for(let m=0;m<r.length;m+=1)r[m].c();p(t,"class","tabs-header compact left"),p(o,"class","tabs-content"),p(e,"class","tabs sdk-tabs m-b-lg svelte-1maocj6")},m(m,v){w(m,e,v),g(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);g(e,l),g(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(m,[v]){v&3&&(f=m[1],i=bt(i,v,c,1,m,f,s,t,Mn,md,null,hd)),v&3&&(d=m[1],Pe(),r=bt(r,v,h,1,m,d,a,o,Gt,gd,null,pd),Le())},i(m){if(!u){for(let v=0;v<d.length;v+=1)E(r[v]);u=!0}},o(m){for(let v=0;v<r.length;v+=1)P(r[v]);u=!1},d(m){m&&k(e);for(let v=0;v<i.length;v+=1)i[v].d();for(let v=0;v<r.length;v+=1)r[v].d()}}}const _d="pb_sdk_preference";function K3(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(_d)||"javascript";const r=a=>t(0,o=a.language);return n.$$set=a=>{"js"in a&&t(2,s=a.js),"dart"in a&&t(3,l=a.dart)},n.$$.update=()=>{n.$$.dirty&1&&o&&localStorage.setItem(_d,o),n.$$.dirty&12&&t(1,i=[{title:"JavaScript",language:"javascript",content:s},{title:"Dart",language:"dart",content:l}])},[o,i,s,l,r]}class Ls extends Ee{constructor(e){super(),Oe(this,e,K3,Y3,De,{js:2,dart:3})}}function bd(n,e,t){const i=n.slice();return i[6]=e[t],i}function vd(n,e,t){const i=n.slice();return i[6]=e[t],i}function yd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function kd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("d
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(mi=n[0])==null?void 0:mi.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(Tl=n[0])==null?void 0:Tl.name}', 200 /* batch size */, {
sort: '-created',
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(ds=n[0])==null?void 0:ds.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Dl=n[0])==null?void 0:Dl.name}', batch: 200, sort: '-created');
`}}),Z=new gn({props:{content:`
// DESC by created and ASC by id
?sort=-created,id
`}}),ze=new gn({props:{content:`
?filter=(id='abc' && created>'2022-01-01')
`}}),st=new W3({}),wt=new gn({props:{content:`
2022-08-11 01:37:41 +08:00
?expand=rel1,rel2.subrel21.subrel22
`}});let ht=n[4];const rn=qe=>qe[6].code;for(let qe=0;qe<ht.length;qe+=1){let xe=vd(n,ht,qe),Xt=rn(xe);Ae.set(Xt,ae[qe]=kd(Xt,xe))}let qt=n[4];const Mi=qe=>qe[6].code;for(let qe=0;qe<qt.length;qe+=1){let xe=bd(n,qt,qe),Xt=Mi(xe);fe.set(Xt,Te[qe]=wd(Xt,xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=T(),Fe&&Fe.c(),d=T(),h=_("div"),m=_("p"),v=F("Fetch a paginated "),b=_("strong"),S=F(y),C=F(" records list."),$=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),V(O.$$.fragment),A=T(),I=_("div"),I.textContent="Query parameters",L=T(),R=_("table"),B=_("thead"),B.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr>`,K=T(),J=_("tbody"),H=_("tr"),H.innerHTML=`<td>page</td>
<td><span class="label">Number</span></td>
<td>The page (aka. offset) of the paginated list (default to 1).</td>`,X=T(),W=_("tr"),W.innerHTML=`<td>perPage</td>
2022-08-11 01:37:41 +08:00
<td><span class="label">Number</span></td>
<td>Specify the max returned records per page (default to 30).</td>`,te=T(),x=_("tr"),oe=_("td"),oe.textContent="sort",me=T(),se=_("td"),se.innerHTML='<span class="label">String</span>',ge=T(),ke=_("td"),Y=F("Specify the records order attribute(s). "),ve=_("br"),ee=F(`
Add `),Q=_("code"),Q.textContent="-",Se=F(" / "),je=_("code"),je.textContent="+",Ue=F(` (default) in front of the attribute for DESC / ASC order.
2022-08-11 01:37:41 +08:00
Ex.:
`),V(Z.$$.fragment),pe=T(),ce=_("tr"),we=_("td"),we.textContent="filter",Ze=T(),tt=_("td"),tt.innerHTML='<span class="label">String</span>',We=T(),it=_("td"),Ce=F(`Filter the returned records. Ex.:
2022-08-11 01:37:41 +08:00
`),V(ze.$$.fragment),Ge=T(),V(st.$$.fragment),ct=T(),_e=_("tr"),Ie=_("td"),Ie.textContent="expand",nt=T(),ft=_("td"),ft.innerHTML='<span class="label">String</span>',vt=T(),ot=_("td"),Ot=F(`Auto expand record relations. Ex.:
`),V(wt.$$.fragment),jt=F(`
Supports up to 6-levels depth nested relations expansion. `),Nt=_("br"),Ke=F(`
The expanded relations will be appended to each individual record under the
`),$e=_("code"),$e.textContent="@expand",Be=F(" property (eg. "),et=_("code"),et.textContent='"@expand": {"rel1": {...}, ...}',at=F(`). Only the
relations that the user has permissions to `),Pt=_("strong"),Pt.textContent="view",It=F(" will be expanded."),Lt=T(),lt=_("div"),lt.textContent="Responses",N=T(),z=_("div"),ne=_("div");for(let qe=0;qe<ae.length;qe+=1)ae[qe].c();le=T(),ye=_("div");for(let qe=0;qe<Te.length;qe+=1)Te[qe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(h,"class","content m-b-base"),p(M,"class","section-title"),p(I,"class","section-title"),p(R,"class","table-compact table-border m-b-lg"),p(lt,"class","section-title"),p(ne,"class","tabs-header compact left"),p(ye,"class","tabs-content"),p(z,"class","tabs")},m(qe,xe){w(qe,e,xe),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),g(r,u),g(l,f),g(e,c),Fe&&Fe.m(e,null),w(qe,d,xe),w(qe,h,xe),g(h,m),g(m,v),g(m,b),g(b,S),g(m,C),w(qe,$,xe),w(qe,M,xe),w(qe,D,xe),j(O,qe,xe),w(qe,A,xe),w(qe,I,xe),w(qe,L,xe),w(qe,R,xe),g(R,B),g(R,K),g(R,J),g(J,H),g(J,X),g(J,W),g(J,te),g(J,x),g(x,oe),g(x,me),g(x,se),g(x,ge),g(x,ke),g(ke,Y),g(ke,ve),g(ke,ee),g(ke,Q),g(ke,Se),g(ke,je),g(ke,Ue),j(Z,ke,null),g(J,pe),g(J,ce),g(ce,we),g(ce,Ze),g(ce,tt),g(ce,We),g(ce,it),g(it,Ce),j(ze,it,null),g(it,Ge),j(st,it,null),g(J,ct),g(J,_e),g(_e,Ie),g(_e,nt),g(_e,ft),g(_e,vt),g(_e,ot),g(ot,Ot),j(wt,ot,null),g(ot,jt),g(ot,Nt),g(ot,Ke),g(ot,$e),g(ot,Be),g(ot,et),g(ot,at),g(ot,Pt),g(ot,It),w(qe,Lt,xe),w(qe,lt,xe),w(qe,N,xe),w(qe,z,xe),g(z,ne);for(let Xt=0;Xt<ae.length;Xt+=1)ae[Xt].m(ne,null);g(z,le),g(z,ye);for(let Xt=0;Xt<Te.length;Xt+=1)Te[Xt].m(ye,null);de=!0},p(qe,[xe]){var Ol,El,Al,Pl;(!de||xe&1)&&a!==(a=qe[0].name+"")&&ue(u,a),qe[1]?Fe||(Fe=yd(),Fe.c(),Fe.m(e,null)):Fe&&(Fe.d(1),Fe=null),(!de||xe&1)&&y!==(y=qe[0].name+"")&&ue(S,y);const Xt={};xe&9&&(Xt.js=`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${qe[3]}');
...
// fetch a paginated records list
const resultList = await client.records.getList('${(Ol=qe[0])==null?void 0:Ol.name}', 1, 50, {
filter: 'created >= "2022-01-01 00:00:00"',
});
// alternatively you can also fetch all records at once via getFullList:
const records = await client.records.getFullList('${(El=qe[0])==null?void 0:El.name}', 200 /* batch size */, {
sort: '-created',
});
`),xe&9&&(Xt.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${qe[3]}');
...
// fetch a paginated records list
final result = await client.records.getList(
'${(Al=qe[0])==null?void 0:Al.name}',
page: 1,
perPage: 50,
filter: 'created >= "2022-01-01 00:00:00"',
);
// alternatively you can also fetch all records at once via getFullList:
final records = await client.records.getFullList('${(Pl=qe[0])==null?void 0:Pl.name}', batch: 200, sort: '-created');
`),O.$set(Xt),xe&20&&(ht=qe[4],ae=bt(ae,xe,rn,1,qe,ht,Ae,ne,Mn,kd,null,vd)),xe&20&&(qt=qe[4],Pe(),Te=bt(Te,xe,Mi,1,qe,qt,fe,ye,Gt,wd,null,bd),Le())},i(qe){if(!de){E(O.$$.fragment,qe),E(Z.$$.fragment,qe),E(ze.$$.fragment,qe),E(st.$$.fragment,qe),E(wt.$$.fragment,qe);for(let xe=0;xe<qt.length;xe+=1)E(Te[xe]);de=!0}},o(qe){P(O.$$.fragment,qe),P(Z.$$.fragment,qe),P(ze.$$.fragment,qe),P(st.$$.fragment,qe),P(wt.$$.fragment,qe);for(let xe=0;xe<Te.length;xe+=1)P(Te[xe]);de=!1},d(qe){qe&&k(e),Fe&&Fe.d(),qe&&k(d),qe&&k(h),qe&&k($),qe&&k(M),qe&&k(D),q(O,qe),qe&&k(A),qe&&k(I),qe&&k(L),qe&&k(R),q(Z),q(ze),q(st),q(wt),qe&&k(Lt),qe&&k(lt),qe&&k(N),qe&&k(z);for(let xe=0;xe<ae.length;xe+=1)ae[xe].d();for(let xe=0;xe<Te.length;xe+=1)Te[xe].d()}}}function J3(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.listRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify({page:1,perPage:30,totalItems:2,items:[U.dummyCollectionRecord(l),U.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
2022-08-11 01:37:41 +08:00
{
"code": 400,
"message": "Something went wrong while processing your request. Invalid filter.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,i,o,s,r,a]}class G3 extends Ee{constructor(e){super(),Oe(this,e,J3,Z3,De,{collection:0})}}function $d(n,e,t){const i=n.slice();return i[6]=e[t],i}function Sd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Cd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Md(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Td(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function X3(n){var Nt,Ke;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y,S=n[0].name+"",C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge=[],st=new Map,ct,_e,Ie=[],nt=new Map,ft,vt=n[1]&&Cd();A=new Ls({props:{js:`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const record = await client.records.getOne('${(Nt=n[0])==null?void 0:Nt.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final record = await client.records.getOne('${(Ke=n[0])==null?void 0:Ke.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`}}),ee=new gn({props:{content:`
?expand=rel1,rel2.subrel21.subrel22
`}});let ot=n[4];const Ot=$e=>$e[6].code;for(let $e=0;$e<ot.length;$e+=1){let Be=Sd(n,ot,$e),et=Ot(Be);st.set(et,Ge[$e]=Md(et,Be))}let wt=n[4];const jt=$e=>$e[6].code;for(let $e=0;$e<wt.length;$e+=1){let Be=$d(n,wt,$e),et=jt(Be);nt.set(et,Ie[$e]=Td(et,Be))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),vt&&vt.c(),h=T(),m=_("div"),v=_("p"),b=F("Fetch a single "),y=_("strong"),C=F(S),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),V(A.$$.fragment),I=T(),L=_("div"),L.textContent="Path Parameters",R=T(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to view.</td></tr></tbody>`,K=T(),J=_("div"),J.textContent="Query parameters",H=T(),X=_("table"),W=_("thead"),W.innerHTML=`<tr><th>Param</th>
2022-08-11 01:37:41 +08:00
<th>Type</th>
<th width="60%">Description</th></tr>`,te=T(),x=_("tbody"),oe=_("tr"),me=_("td"),me.textContent="expand",se=T(),ge=_("td"),ge.innerHTML='<span class="label">String</span>',ke=T(),Y=_("td"),ve=F(`Auto expand record relations. Ex.:
`),V(ee.$$.fragment),Q=F(`
2022-08-11 01:37:41 +08:00
Supports up to 6-levels depth nested relations expansion. `),Se=_("br"),je=F(`
The expanded relations will be appended to the record under the
`),Ue=_("code"),Ue.textContent="@expand",Z=F(" property (eg. "),pe=_("code"),pe.textContent='"@expand": {"rel1": {...}, ...}',ce=F(`). Only the
relations that the user has permissions to `),we=_("strong"),we.textContent="view",Ze=F(" will be expanded."),tt=T(),We=_("div"),We.textContent="Responses",it=T(),Ce=_("div"),ze=_("div");for(let $e=0;$e<Ge.length;$e+=1)Ge[$e].c();ct=T(),_e=_("div");for(let $e=0;$e<Ie.length;$e+=1)Ie[$e].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(m,"class","content m-b-base"),p(D,"class","section-title"),p(L,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(J,"class","section-title"),p(X,"class","table-compact table-border m-b-lg"),p(We,"class","section-title"),p(ze,"class","tabs-header compact left"),p(_e,"class","tabs-content"),p(Ce,"class","tabs")},m($e,Be){w($e,e,Be),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(e,d),vt&&vt.m(e,null),w($e,h,Be),w($e,m,Be),g(m,v),g(v,b),g(v,y),g(y,C),g(v,$),w($e,M,Be),w($e,D,Be),w($e,O,Be),j(A,$e,Be),w($e,I,Be),w($e,L,Be),w($e,R,Be),w($e,B,Be),w($e,K,Be),w($e,J,Be),w($e,H,Be),w($e,X,Be),g(X,W),g(X,te),g(X,x),g(x,oe),g(oe,me),g(oe,se),g(oe,ge),g(oe,ke),g(oe,Y),g(Y,ve),j(ee,Y,null),g(Y,Q),g(Y,Se),g(Y,je),g(Y,Ue),g(Y,Z),g(Y,pe),g(Y,ce),g(Y,we),g(Y,Ze),w($e,tt,Be),w($e,We,Be),w($e,it,Be),w($e,Ce,Be),g(Ce,ze);for(let et=0;et<Ge.length;et+=1)Ge[et].m(ze,null);g(Ce,ct),g(Ce,_e);for(let et=0;et<Ie.length;et+=1)Ie[et].m(_e,null);ft=!0},p($e,[Be]){var at,Pt;(!ft||Be&1)&&a!==(a=$e[0].name+"")&&ue(u,a),$e[1]?vt||(vt=Cd(),vt.c(),vt.m(e,null)):vt&&(vt.d(1),vt=null),(!ft||Be&1)&&S!==(S=$e[0].name+"")&&ue(C,S);const et={};Be&9&&(et.js=`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${$e[3]}');
...
const record = await client.records.getOne('${(at=$e[0])==null?void 0:at.name}', 'RECORD_ID', {
expand: 'some_relation'
});
`),Be&9&&(et.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${$e[3]}');
...
final record = await client.records.getOne('${(Pt=$e[0])==null?void 0:Pt.name}', 'RECORD_ID', query: {
'expand': 'some_relation',
});
`),A.$set(et),Be&20&&(ot=$e[4],Ge=bt(Ge,Be,Ot,1,$e,ot,st,ze,Mn,Md,null,Sd)),Be&20&&(wt=$e[4],Pe(),Ie=bt(Ie,Be,jt,1,$e,wt,nt,_e,Gt,Td,null,$d),Le())},i($e){if(!ft){E(A.$$.fragment,$e),E(ee.$$.fragment,$e);for(let Be=0;Be<wt.length;Be+=1)E(Ie[Be]);ft=!0}},o($e){P(A.$$.fragment,$e),P(ee.$$.fragment,$e);for(let Be=0;Be<Ie.length;Be+=1)P(Ie[Be]);ft=!1},d($e){$e&&k(e),vt&&vt.d(),$e&&k(h),$e&&k(m),$e&&k(M),$e&&k(D),$e&&k(O),q(A,$e),$e&&k(I),$e&&k(L),$e&&k(R),$e&&k(B),$e&&k(K),$e&&k(J),$e&&k(H),$e&&k(X),q(ee),$e&&k(tt),$e&&k(We),$e&&k(it),$e&&k(Ce);for(let Be=0;Be<Ge.length;Be+=1)Ge[Be].d();for(let Be=0;Be<Ie.length;Be+=1)Ie[Be].d()}}}function Q3(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.viewRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:200,body:JSON.stringify(U.dummyCollectionRecord(l),null,2)}),i&&r.push({code:403,body:`
2022-08-11 01:37:41 +08:00
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,i,o,s,r,a]}class x3 extends Ee{constructor(e){super(),Oe(this,e,Q3,X3,De,{collection:0})}}function Dd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Od(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ed(n,e,t){const i=n.slice();return i[11]=e[t],i}function Ad(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function eC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function tC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function iC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function sC(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:re,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function lC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function oC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function rC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function aC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function uC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Pd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=U.getFieldValueType(e[11])+"",h,m,v,b;function y(O,A){return O[11].required?tC:eC}let S=y(e),C=S(e);function $(O,A){if(O[11].type==="text")return uC;if(O[11].type==="number")return aC;if(O[11].type==="json")return rC;if(O[11].type==="email")return oC;if(O[11].type==="url")return lC;if(O[11].type==="file")return sC;if(O[11].type==="relation")return iC;if(O[11].type==="user")return nC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),m=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,A){w(O,t,A),g(t,i),g(i,s),C.m(s,null),g(s,l),g(s,o),g(o,a),g(t,u),g(t,f),g(f,c),g(c,h),g(t,m),g(t,v),D&&D.m(v,null),g(t,b)},p(O,A){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(s,l))),A&1&&r!==(r=e[11].name+"")&&ue(a,r),A&1&&d!==(d=U.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,A):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&k(t),C.d(),D&&D.d()}}}function Ld(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Id(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function fC(n){var ne,ae,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y=n[0].name+"",S,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me=[],se=new Map,ge,ke,Y,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge,st,ct,_e,Ie,nt,ft,vt,ot,Ot,wt=[],jt=new Map,Nt,Ke,$e=[],Be=new Map,et,at=n[4]&&Ad();R=new Ls({props:{js:`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.create('${(ne=n[0])==null?void 0:ne.name}', data);
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(ae=n[0])==null?void 0:ae.name}', body: body);
`}});let Pt=(Ae=n[0])==null?void 0:Ae.schema;const It=le=>le[11].name;for(let le=0;le<Pt.length;le+=1){let ye=Ed(n,Pt,le),Te=It(ye);se.set(Te,me[le]=Pd(Te,ye))}tt=new gn({props:{content:`
2022-08-11 01:37:41 +08:00
?expand=rel1,rel2.subrel21.subrel22
`}});let Lt=n[2];const lt=le=>le[6].code;for(let le=0;le<Lt.length;le+=1){let ye=Od(n,Lt,le),Te=lt(ye);jt.set(Te,wt[le]=Ld(Te,ye))}let N=n[2];const z=le=>le[6].code;for(let le=0;le<N.length;le+=1){let ye=Dd(n,N,le),Te=z(ye);Be.set(Te,$e[le]=Id(Te,ye))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records"),c=T(),at&&at.c(),d=T(),h=_("div"),m=_("p"),v=F("Create a new "),b=_("strong"),S=F(y),C=F(" record."),$=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
2022-08-11 01:37:41 +08:00
<code>multipart/form-data</code>.`,D=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",A=T(),I=_("div"),I.textContent="Client SDKs example",L=T(),V(R.$$.fragment),B=T(),K=_("div"),K.textContent="Body Parameters",J=T(),H=_("table"),X=_("thead"),X.innerHTML=`<tr><th>Param</th>
<th>Type</th>
<th width="50%">Description</th></tr>`,W=T(),te=_("tbody"),x=_("tr"),x.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
2022-08-11 01:37:41 +08:00
<span>id</span></div></td>
<td><span class="label">String</span></td>
<td><strong>15 characters string</strong> to store as record ID.
<br/>
If not set, it will be auto generated.</td>`,oe=T();for(let le=0;le<me.length;le+=1)me[le].c();ge=T(),ke=_("div"),ke.textContent="Query parameters",Y=T(),ve=_("table"),ee=_("thead"),ee.innerHTML=`<tr><th>Param</th>
2022-08-11 01:37:41 +08:00
<th>Type</th>
<th width="60%">Description</th></tr>`,Q=T(),Se=_("tbody"),je=_("tr"),Ue=_("td"),Ue.textContent="expand",Z=T(),pe=_("td"),pe.innerHTML='<span class="label">String</span>',ce=T(),we=_("td"),Ze=F(`Auto expand relations when returning the created record. Ex.:
2022-08-11 01:37:41 +08:00
`),V(tt.$$.fragment),We=F(`
Supports up to 6-levels depth nested relations expansion. `),it=_("br"),Ce=F(`
The expanded relations will be appended to the record under the
`),ze=_("code"),ze.textContent="@expand",Ge=F(" property (eg. "),st=_("code"),st.textContent='"@expand": {"rel1": {...}, ...}',ct=F(`). Only the
relations that the user has permissions to `),_e=_("strong"),_e.textContent="view",Ie=F(" will be expanded."),nt=T(),ft=_("div"),ft.textContent="Responses",vt=T(),ot=_("div"),Ot=_("div");for(let le=0;le<wt.length;le+=1)wt[le].c();Nt=T(),Ke=_("div");for(let le=0;le<$e.length;le+=1)$e[le].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(h,"class","content m-b-base"),p(I,"class","section-title"),p(K,"class","section-title"),p(H,"class","table-compact table-border m-b-lg"),p(ke,"class","section-title"),p(ve,"class","table-compact table-border m-b-lg"),p(ft,"class","section-title"),p(Ot,"class","tabs-header compact left"),p(Ke,"class","tabs-content"),p(ot,"class","tabs")},m(le,ye){w(le,e,ye),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),g(r,u),g(l,f),g(e,c),at&&at.m(e,null),w(le,d,ye),w(le,h,ye),g(h,m),g(m,v),g(m,b),g(b,S),g(m,C),g(h,$),g(h,M),g(h,D),g(h,O),w(le,A,ye),w(le,I,ye),w(le,L,ye),j(R,le,ye),w(le,B,ye),w(le,K,ye),w(le,J,ye),w(le,H,ye),g(H,X),g(H,W),g(H,te),g(te,x),g(te,oe);for(let Te=0;Te<me.length;Te+=1)me[Te].m(te,null);w(le,ge,ye),w(le,ke,ye),w(le,Y,ye),w(le,ve,ye),g(ve,ee),g(ve,Q),g(ve,Se),g(Se,je),g(je,Ue),g(je,Z),g(je,pe),g(je,ce),g(je,we),g(we,Ze),j(tt,we,null),g(we,We),g(we,it),g(we,Ce),g(we,ze),g(we,Ge),g(we,st),g(we,ct),g(we,_e),g(we,Ie),w(le,nt,ye),w(le,ft,ye),w(le,vt,ye),w(le,ot,ye),g(ot,Ot);for(let Te=0;Te<wt.length;Te+=1)wt[Te].m(Ot,null);g(ot,Nt),g(ot,Ke);for(let Te=0;Te<$e.length;Te+=1)$e[Te].m(Ke,null);et=!0},p(le,[ye]){var fe,de,Fe;(!et||ye&1)&&a!==(a=le[0].name+"")&&ue(u,a),le[4]?at||(at=Ad(),at.c(),at.m(e,null)):at&&(at.d(1),at=null),(!et||ye&1)&&y!==(y=le[0].name+"")&&ue(S,y);const Te={};ye&9&&(Te.js=`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${le[3]}');
2022-08-11 01:37:41 +08:00
...
const data = { ... };
const record = await client.records.create('${(fe=le[0])==null?void 0:fe.name}', data);
2022-08-11 01:37:41 +08:00
`),ye&9&&(Te.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${le[3]}');
2022-08-11 01:37:41 +08:00
...
final body = <String, dynamic>{ ... };
final record = await client.records.create('${(de=le[0])==null?void 0:de.name}', body: body);
`),R.$set(Te),ye&1&&(Pt=(Fe=le[0])==null?void 0:Fe.schema,me=bt(me,ye,It,1,le,Pt,se,te,Mn,Pd,null,Ed)),ye&6&&(Lt=le[2],wt=bt(wt,ye,lt,1,le,Lt,jt,Ot,Mn,Ld,null,Od)),ye&6&&(N=le[2],Pe(),$e=bt($e,ye,z,1,le,N,Be,Ke,Gt,Id,null,Dd),Le())},i(le){if(!et){E(R.$$.fragment,le),E(tt.$$.fragment,le);for(let ye=0;ye<N.length;ye+=1)E($e[ye]);et=!0}},o(le){P(R.$$.fragment,le),P(tt.$$.fragment,le);for(let ye=0;ye<$e.length;ye+=1)P($e[ye]);et=!1},d(le){le&&k(e),at&&at.d(),le&&k(d),le&&k(h),le&&k(A),le&&k(I),le&&k(L),q(R,le),le&&k(B),le&&k(K),le&&k(J),le&&k(H);for(let ye=0;ye<me.length;ye+=1)me[ye].d();le&&k(ge),le&&k(ke),le&&k(Y),le&&k(ve),q(tt),le&&k(nt),le&&k(ft),le&&k(vt),le&&k(ot);for(let ye=0;ye<wt.length;ye+=1)wt[ye].d();for(let ye=0;ye<$e.length;ye+=1)$e[ye].d()}}}function cC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.createRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(l),null,2)},{code:400,body:`
2022-08-11 01:37:41 +08:00
{
"code": 400,
"message": "Failed to create record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`}])},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,o,r,s,i,a]}class dC extends Ee{constructor(e){super(),Oe(this,e,cC,fC,De,{collection:0})}}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Nd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Rd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Hd(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function pC(n){let e;return{c(){e=_("span"),e.textContent="Optional",p(e,"class","label label-warning")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function hC(n){let e;return{c(){e=_("span"),e.textContent="Required",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function mC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("User "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function gC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=F("Relation record "),i=F(t),s=F(".")},m(o,r){w(o,e,r),w(o,i,r),w(o,s,r)},p(o,r){var a;r&1&&t!==(t=((a=o[11].options)==null?void 0:a.maxSelect)>1?"ids":"id")&&ue(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function _C(n){let e,t,i,s,l;return{c(){e=F("FormData object."),t=_("br"),i=F(`
Set to `),s=_("code"),s.textContent="null",l=F(" to delete already uploaded file(s).")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),w(o,s,r),w(o,l,r)},p:re,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function bC(n){let e;return{c(){e=F("URL address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function vC(n){let e;return{c(){e=F("Email address.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function yC(n){let e;return{c(){e=F("JSON array or object.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function kC(n){let e;return{c(){e=F("Number value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function wC(n){let e;return{c(){e=F("Plain text value.")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function jd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=U.getFieldValueType(e[11])+"",h,m,v,b;function y(O,A){return O[11].required?hC:pC}let S=y(e),C=S(e);function $(O,A){if(O[11].type==="text")return wC;if(O[11].type==="number")return kC;if(O[11].type==="json")return yC;if(O[11].type==="email")return vC;if(O[11].type==="url")return bC;if(O[11].type==="file")return _C;if(O[11].type==="relation")return gC;if(O[11].type==="user")return mC}let M=$(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),C.c(),l=T(),o=_("span"),a=F(r),u=T(),f=_("td"),c=_("span"),h=F(d),m=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,A){w(O,t,A),g(t,i),g(i,s),C.m(s,null),g(s,l),g(s,o),g(o,a),g(t,u),g(t,f),g(f,c),g(c,h),g(t,m),g(t,v),D&&D.m(v,null),g(t,b)},p(O,A){e=O,S!==(S=y(e))&&(C.d(1),C=S(e),C&&(C.c(),C.m(s,l))),A&1&&r!==(r=e[11].name+"")&&ue(a,r),A&1&&d!==(d=U.getFieldValueType(e[11])+"")&&ue(h,d),M===(M=$(e))&&D?D.p(e,A):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&k(t),C.d(),D&&D.d()}}}function qd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&ue(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Vd(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[1]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o;const a={};r&4&&(a.content=e[6].body),i.$set(a),r&6&&ie(t,"active",e[1]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function $C(n){var le,ye,Te;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y,S=n[0].name+"",C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me,se,ge,ke=[],Y=new Map,ve,ee,Q,Se,je,Ue,Z,pe,ce,we,Ze,tt,We,it,Ce,ze,Ge,st,ct,_e,Ie,nt,ft,vt,ot,Ot,wt,jt,Nt,Ke=[],$e=new Map,Be,et,at=[],Pt=new Map,It,Lt=n[4]&&Hd();B=new Ls({props:{js:`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
const data = { ... };
const record = await client.records.update('${(le=n[0])==null?void 0:le.name}', 'RECORD_ID', data);
2022-08-11 01:37:41 +08:00
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(ye=n[0])==null?void 0:ye.name}', 'RECORD_ID', body: body);
`}});let lt=(Te=n[0])==null?void 0:Te.schema;const N=fe=>fe[11].name;for(let fe=0;fe<lt.length;fe+=1){let de=Rd(n,lt,fe),Fe=N(de);Y.set(Fe,ke[fe]=jd(Fe,de))}Ce=new gn({props:{content:`
2022-08-11 01:37:41 +08:00
?expand=rel1,rel2.subrel21.subrel22
`}});let z=n[2];const ne=fe=>fe[6].code;for(let fe=0;fe<z.length;fe+=1){let de=Nd(n,z,fe),Fe=ne(de);$e.set(Fe,Ke[fe]=qd(Fe,de))}let ae=n[2];const Ae=fe=>fe[6].code;for(let fe=0;fe<ae.length;fe+=1){let de=Fd(n,ae,fe),Fe=Ae(de);Pt.set(Fe,at[fe]=Vd(Fe,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),Lt&&Lt.c(),h=T(),m=_("div"),v=_("p"),b=F("Update a single "),y=_("strong"),C=F(S),$=F(" record."),M=T(),D=_("p"),D.innerHTML=`Body parameters could be sent as <code>application/json</code> or
<code>multipart/form-data</code>.`,O=T(),A=_("p"),A.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",I=T(),L=_("div"),L.textContent="Client SDKs example",R=T(),V(B.$$.fragment),K=T(),J=_("div"),J.textContent="Path parameters",H=T(),X=_("table"),X.innerHTML=`<thead><tr><th>Param</th>
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to update.</td></tr></tbody>`,W=T(),te=_("div"),te.textContent="Body Parameters",x=T(),oe=_("table"),me=_("thead"),me.innerHTML=`<tr><th>Param</th>
2022-08-11 01:37:41 +08:00
<th>Type</th>
<th width="50%">Description</th></tr>`,se=T(),ge=_("tbody");for(let fe=0;fe<ke.length;fe+=1)ke[fe].c();ve=T(),ee=_("div"),ee.textContent="Query parameters",Q=T(),Se=_("table"),je=_("thead"),je.innerHTML=`<tr><th>Param</th>
2022-08-11 01:37:41 +08:00
<th>Type</th>
<th width="60%">Description</th></tr>`,Ue=T(),Z=_("tbody"),pe=_("tr"),ce=_("td"),ce.textContent="expand",we=T(),Ze=_("td"),Ze.innerHTML='<span class="label">String</span>',tt=T(),We=_("td"),it=F(`Auto expand relations when returning the updated record. Ex.:
2022-08-11 01:37:41 +08:00
`),V(Ce.$$.fragment),ze=F(`
Supports up to 6-levels depth nested relations expansion. `),Ge=_("br"),st=F(`
The expanded relations will be appended to the record under the
`),ct=_("code"),ct.textContent="@expand",_e=F(" property (eg. "),Ie=_("code"),Ie.textContent='"@expand": {"rel1": {...}, ...}',nt=F(`). Only the
relations that the user has permissions to `),ft=_("strong"),ft.textContent="view",vt=F(" will be expanded."),ot=T(),Ot=_("div"),Ot.textContent="Responses",wt=T(),jt=_("div"),Nt=_("div");for(let fe=0;fe<Ke.length;fe+=1)Ke[fe].c();Be=T(),et=_("div");for(let fe=0;fe<at.length;fe+=1)at[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(m,"class","content m-b-base"),p(L,"class","section-title"),p(J,"class","section-title"),p(X,"class","table-compact table-border m-b-lg"),p(te,"class","section-title"),p(oe,"class","table-compact table-border m-b-lg"),p(ee,"class","section-title"),p(Se,"class","table-compact table-border m-b-lg"),p(Ot,"class","section-title"),p(Nt,"class","tabs-header compact left"),p(et,"class","tabs-content"),p(jt,"class","tabs")},m(fe,de){w(fe,e,de),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(e,d),Lt&&Lt.m(e,null),w(fe,h,de),w(fe,m,de),g(m,v),g(v,b),g(v,y),g(y,C),g(v,$),g(m,M),g(m,D),g(m,O),g(m,A),w(fe,I,de),w(fe,L,de),w(fe,R,de),j(B,fe,de),w(fe,K,de),w(fe,J,de),w(fe,H,de),w(fe,X,de),w(fe,W,de),w(fe,te,de),w(fe,x,de),w(fe,oe,de),g(oe,me),g(oe,se),g(oe,ge);for(let Fe=0;Fe<ke.length;Fe+=1)ke[Fe].m(ge,null);w(fe,ve,de),w(fe,ee,de),w(fe,Q,de),w(fe,Se,de),g(Se,je),g(Se,Ue),g(Se,Z),g(Z,pe),g(pe,ce),g(pe,we),g(pe,Ze),g(pe,tt),g(pe,We),g(We,it),j(Ce,We,null),g(We,ze),g(We,Ge),g(We,st),g(We,ct),g(We,_e),g(We,Ie),g(We,nt),g(We,ft),g(We,vt),w(fe,ot,de),w(fe,Ot,de),w(fe,wt,de),w(fe,jt,de),g(jt,Nt);for(let Fe=0;Fe<Ke.length;Fe+=1)Ke[Fe].m(Nt,null);g(jt,Be),g(jt,et);for(let Fe=0;Fe<at.length;Fe+=1)at[Fe].m(et,null);It=!0},p(fe,[de]){var ht,rn,qt;(!It||de&1)&&a!==(a=fe[0].name+"")&&ue(u,a),fe[4]?Lt||(Lt=Hd(),Lt.c(),Lt.m(e,null)):Lt&&(Lt.d(1),Lt=null),(!It||de&1)&&S!==(S=fe[0].name+"")&&ue(C,S);const Fe={};de&9&&(Fe.js=`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${fe[3]}');
...
const data = { ... };
const record = await client.records.update('${(ht=fe[0])==null?void 0:ht.name}', 'RECORD_ID', data);
`),de&9&&(Fe.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${fe[3]}');
...
final body = <String, dynamic>{ ... };
final record = await client.records.update('${(rn=fe[0])==null?void 0:rn.name}', 'RECORD_ID', body: body);
`),B.$set(Fe),de&1&&(lt=(qt=fe[0])==null?void 0:qt.schema,ke=bt(ke,de,N,1,fe,lt,Y,ge,Mn,jd,null,Rd)),de&6&&(z=fe[2],Ke=bt(Ke,de,ne,1,fe,z,$e,Nt,Mn,qd,null,Nd)),de&6&&(ae=fe[2],Pe(),at=bt(at,de,Ae,1,fe,ae,Pt,et,Gt,Vd,null,Fd),Le())},i(fe){if(!It){E(B.$$.fragment,fe),E(Ce.$$.fragment,fe);for(let de=0;de<ae.length;de+=1)E(at[de]);It=!0}},o(fe){P(B.$$.fragment,fe),P(Ce.$$.fragment,fe);for(let de=0;de<at.length;de+=1)P(at[de]);It=!1},d(fe){fe&&k(e),Lt&&Lt.d(),fe&&k(h),fe&&k(m),fe&&k(I),fe&&k(L),fe&&k(R),q(B,fe),fe&&k(K),fe&&k(J),fe&&k(H),fe&&k(X),fe&&k(W),fe&&k(te),fe&&k(x),fe&&k(oe);for(let de=0;de<ke.length;de+=1)ke[de].d();fe&&k(ve),fe&&k(ee),fe&&k(Q),fe&&k(Se),q(Ce),fe&&k(ot),fe&&k(Ot),fe&&k(wt),fe&&k(jt);for(let de=0;de<Ke.length;de+=1)Ke[de].d();for(let de=0;de<at.length;de+=1)at[de].d()}}}function SC(n,e,t){let i,s,{collection:l=new fn}=e,o=200,r=[];const a=u=>t(1,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{var u,f;n.$$.dirty&1&&t(4,i=(l==null?void 0:l.updateRule)===null),n.$$.dirty&1&&t(2,r=[{code:200,body:JSON.stringify(U.dummyCollectionRecord(l),null,2)},{code:400,body:`
2022-08-11 01:37:41 +08:00
{
"code": 400,
"message": "Failed to update record.",
"data": {
"${(f=(u=l==null?void 0:l.schema)==null?void 0:u[0])==null?void 0:f.name}": {
"code": "validation_required",
"message": "Missing required value."
}
}
}
`},{code:403,body:`
{
"code": 403,
"message": "You are not allowed to perform this request.",
"data": {}
}
`},{code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}])},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,o,r,s,i,a]}class CC extends Ee{constructor(e){super(),Oe(this,e,SC,$C,De,{collection:0})}}function zd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Bd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Ud(n){let e;return{c(){e=_("p"),e.innerHTML="Requires <code>Authorization: Admin TOKEN</code> header",p(e,"class","txt-hint txt-sm txt-right")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Wd(n,e){let t,i=e[6].code+"",s,l,o,r;function a(){return e[5](e[6])}return{key:n,first:null,c(){t=_("button"),s=F(i),l=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(u,f){w(u,t,f),g(t,s),g(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&20&&ie(t,"active",e[2]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Yd(n,e){let t,i,s,l;return i=new gn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),V(i.$$.fragment),s=T(),p(t,"class","tab-item"),ie(t,"active",e[2]===e[6].code),this.first=t},m(o,r){w(o,t,r),j(i,t,null),g(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(E(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),q(i)}}}function MC(n){var je,Ue;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,h,m,v,b,y,S=n[0].name+"",C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te=[],x=new Map,oe,me,se=[],ge=new Map,ke,Y=n[1]&&Ud();A=new Ls({props:{js:`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[3]}');
...
await client.records.delete('${(je=n[0])==null?void 0:je.name}', 'RECORD_ID');
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[3]}');
...
await client.records.delete('${(Ue=n[0])==null?void 0:Ue.name}', 'RECORD_ID');
`}});let ve=n[4];const ee=Z=>Z[6].code;for(let Z=0;Z<ve.length;Z+=1){let pe=Bd(n,ve,Z),ce=ee(pe);x.set(ce,te[Z]=Wd(ce,pe))}let Q=n[4];const Se=Z=>Z[6].code;for(let Z=0;Z<Q.length;Z+=1){let pe=zd(n,Q,Z),ce=Se(pe);ge.set(ce,se[Z]=Yd(ce,pe))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=F("/api/collections/"),r=_("strong"),u=F(a),f=F("/records/"),c=_("strong"),c.textContent=":id",d=T(),Y&&Y.c(),h=T(),m=_("div"),v=_("p"),b=F("Delete a single "),y=_("strong"),C=F(S),$=F(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),V(A.$$.fragment),I=T(),L=_("div"),L.textContent="Path parameters",R=T(),B=_("table"),B.innerHTML=`<thead><tr><th>Param</th>
2022-08-11 01:37:41 +08:00
<th>Type</th>
<th width="60%">Description</th></tr></thead>
<tbody><tr><td>id</td>
<td><span class="label">String</span></td>
<td>ID of the record to delete.</td></tr></tbody>`,K=T(),J=_("div"),J.textContent="Responses",H=T(),X=_("div"),W=_("div");for(let Z=0;Z<te.length;Z+=1)te[Z].c();oe=T(),me=_("div");for(let Z=0;Z<se.length;Z+=1)se[Z].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(m,"class","content m-b-base"),p(D,"class","section-title"),p(L,"class","section-title"),p(B,"class","table-compact table-border m-b-lg"),p(J,"class","section-title"),p(W,"class","tabs-header compact left"),p(me,"class","tabs-content"),p(X,"class","tabs")},m(Z,pe){w(Z,e,pe),g(e,t),g(e,i),g(e,s),g(s,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(e,d),Y&&Y.m(e,null),w(Z,h,pe),w(Z,m,pe),g(m,v),g(v,b),g(v,y),g(y,C),g(v,$),w(Z,M,pe),w(Z,D,pe),w(Z,O,pe),j(A,Z,pe),w(Z,I,pe),w(Z,L,pe),w(Z,R,pe),w(Z,B,pe),w(Z,K,pe),w(Z,J,pe),w(Z,H,pe),w(Z,X,pe),g(X,W);for(let ce=0;ce<te.length;ce+=1)te[ce].m(W,null);g(X,oe),g(X,me);for(let ce=0;ce<se.length;ce+=1)se[ce].m(me,null);ke=!0},p(Z,[pe]){var we,Ze;(!ke||pe&1)&&a!==(a=Z[0].name+"")&&ue(u,a),Z[1]?Y||(Y=Ud(),Y.c(),Y.m(e,null)):Y&&(Y.d(1),Y=null),(!ke||pe&1)&&S!==(S=Z[0].name+"")&&ue(C,S);const ce={};pe&9&&(ce.js=`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${Z[3]}');
...
await client.records.delete('${(we=Z[0])==null?void 0:we.name}', 'RECORD_ID');
2022-08-11 01:37:41 +08:00
`),pe&9&&(ce.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${Z[3]}');
...
await client.records.delete('${(Ze=Z[0])==null?void 0:Ze.name}', 'RECORD_ID');
`),A.$set(ce),pe&20&&(ve=Z[4],te=bt(te,pe,ee,1,Z,ve,x,W,Mn,Wd,null,Bd)),pe&20&&(Q=Z[4],Pe(),se=bt(se,pe,Se,1,Z,Q,ge,me,Gt,Yd,null,zd),Le())},i(Z){if(!ke){E(A.$$.fragment,Z);for(let pe=0;pe<Q.length;pe+=1)E(se[pe]);ke=!0}},o(Z){P(A.$$.fragment,Z);for(let pe=0;pe<se.length;pe+=1)P(se[pe]);ke=!1},d(Z){Z&&k(e),Y&&Y.d(),Z&&k(h),Z&&k(m),Z&&k(M),Z&&k(D),Z&&k(O),q(A,Z),Z&&k(I),Z&&k(L),Z&&k(R),Z&&k(B),Z&&k(K),Z&&k(J),Z&&k(H),Z&&k(X);for(let pe=0;pe<te.length;pe+=1)te[pe].d();for(let pe=0;pe<se.length;pe+=1)se[pe].d()}}}function TC(n,e,t){let i,s,{collection:l=new fn}=e,o=204,r=[];const a=u=>t(2,o=u.code);return n.$$set=u=>{"collection"in u&&t(0,l=u.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(1,i=(l==null?void 0:l.deleteRule)===null),n.$$.dirty&3&&l!=null&&l.id&&(r.push({code:204,body:`
2022-08-11 01:37:41 +08:00
null
`}),r.push({code:400,body:`
{
"code": 400,
"message": "Failed to delete record. Make sure that the record is not part of a required relation reference.",
"data": {}
}
`}),i&&r.push({code:403,body:`
{
"code": 403,
"message": "Only admins can access this action.",
"data": {}
}
`}),r.push({code:404,body:`
{
"code": 404,
"message": "The requested resource wasn't found.",
"data": {}
}
`}))},t(3,s=U.getApiExampleUrl(be.baseUrl)),[l,i,o,s,r,a]}class DC extends Ee{constructor(e){super(),Oe(this,e,TC,MC,De,{collection:0})}}function OC(n){var h,m,v,b,y,S,C,$;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Ls({props:{js:`
2022-08-11 01:37:41 +08:00
import PocketBase from 'pocketbase';
const client = new PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(h=n[0])==null?void 0:h.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(m=n[0])==null?void 0:m.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(v=n[0])==null?void 0:v.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(b=n[0])==null?void 0:b.name}/RECORD_ID') // remove only the record subscription
`,dart:`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${n[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(y=n[0])==null?void 0:y.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(S=n[0])==null?void 0:S.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}') // remove only the collection subscription
client.realtime.unsubscribe('${($=n[0])==null?void 0:$.name}/RECORD_ID') // remove only the record subscription
`}}),c=new gn({props:{content:JSON.stringify({action:"create",record:U.dummyCollectionRecord(n[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')}}),{c(){e=_("div"),e.innerHTML=`<strong class="label label-primary">SSE</strong>
2022-08-11 01:37:41 +08:00
<div class="content"><p>/api/realtime</p></div>`,t=T(),i=_("div"),i.innerHTML=`<p>Subscribe to realtime changes via Server-Sent Events (SSE).</p>
<p>Events are send for <strong>create</strong>, <strong>update</strong>
and <strong>delete</strong> record operations (see &quot;Event data format&quot; section below).</p>
<div class="alert alert-info m-t-10"><div class="icon"><i class="ri-information-line"></i></div>
<div class="contet"><p><strong>You could subscribe to a single record or to an entire collection.</strong></p>
<p>When you subscribe to a <strong>single record</strong>, the collection&#39;s
<strong>ViewRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p>
<p>When you subscribe to an <strong>entire collection</strong>, the collection&#39;s
<strong>ListRule</strong> will be used to determine whether the subscriber has access to receive
the event message.</p></div></div>`,s=T(),l=_("div"),l.textContent="Client SDKs example",o=T(),V(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),V(c.$$.fragment),p(e,"class","alert"),p(i,"class","content m-b-base"),p(l,"class","section-title"),p(u,"class","section-title")},m(M,D){w(M,e,D),w(M,t,D),w(M,i,D),w(M,s,D),w(M,l,D),w(M,o,D),j(r,M,D),w(M,a,D),w(M,u,D),w(M,f,D),j(c,M,D),d=!0},p(M,[D]){var I,L,R,B,K,J,H,X;const O={};D&3&&(O.js=`
import PocketBase from 'pocketbase';
const client = new PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(I=M[0])==null?void 0:I.name}', function (e) {
console.log(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(L=M[0])==null?void 0:L.name}/RECORD_ID', function (e) {
console.log(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(R=M[0])==null?void 0:R.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(B=M[0])==null?void 0:B.name}/RECORD_ID') // remove only the record subscription
`),D&3&&(O.dart=`
import 'package:pocketbase/pocketbase.dart';
final client = PocketBase('${M[1]}');
...
// (Optionally) authenticate
client.users.authViaEmail('test@example.com', '123456');
// Subscribe to changes in any record from the collection
client.realtime.subscribe('${(K=M[0])==null?void 0:K.name}', (e) {
print(e.record);
});
// Subscribe to changes in a single record
client.realtime.subscribe('${(J=M[0])==null?void 0:J.name}/RECORD_ID', (e) {
print(e.record);
});
// Unsubscribe
client.realtime.unsubscribe() // remove all subscriptions
client.realtime.unsubscribe('${(H=M[0])==null?void 0:H.name}') // remove only the collection subscription
client.realtime.unsubscribe('${(X=M[0])==null?void 0:X.name}/RECORD_ID') // remove only the record subscription
`),r.$set(O);const A={};D&1&&(A.content=JSON.stringify({action:"create",record:U.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(A)},i(M){d||(E(r.$$.fragment,M),E(c.$$.fragment,M),d=!0)},o(M){P(r.$$.fragment,M),P(c.$$.fragment,M),d=!1},d(M){M&&k(e),M&&k(t),M&&k(i),M&&k(s),M&&k(l),M&&k(o),q(r,M),M&&k(a),M&&k(u),M&&k(f),q(c,M)}}}function EC(n,e,t){let i,{collection:s=new fn}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=U.getApiExampleUrl(be.baseUrl)),[s,i]}class AC extends Ee{constructor(e){super(),Oe(this,e,EC,OC,De,{collection:0})}}function Kd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Zd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Jd(n){let e,t,i,s;var l=n[14].component;function o(r){return{props:{collection:r[3]}}}return l&&(t=new l(o(n))),{c(){e=_("div"),t&&V(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&j(t,e,null),g(e,i),s=!0},p(r,a){const u={};if(a&8&&(u.collection=r[3]),l!==(l=r[14].component)){if(t){Pe();const f=t;P(f.$$.fragment,1,0,()=>{q(f,1)}),Le()}l?(t=new l(o(r)),V(t.$$.fragment),E(t.$$.fragment,1),j(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&E(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&q(t)}}}function Gd(n,e){let t,i,s,l=e[4]===e[14].id&&Jd(e);return{key:n,first:null,c(){t=Je(),l&&l.c(),i=Je(),this.first=t},m(o,r){w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){e=o,e[4]===e[14].id?l?(l.p(e,r),r&16&&E(l,1)):(l=Jd(e),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(E(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function PC(n){let e,t=[],i=new Map,s,l=n[5];const o=r=>r[14].id;for(let r=0;r<l.length;r+=1){let a=Kd(n,l,r),u=o(a);i.set(u,t[r]=Gd(u,a))}return{c(){e=_("div");for(let r=0;r<t.length;r+=1)t[r].c();p(e,"class","tabs-content")},m(r,a){w(r,e,a);for(let u=0;u<t.length;u+=1)t[u].m(e,null);s=!0},p(r,a){a&56&&(l=r[5],Pe(),t=bt(t,a,o,1,r,l,i,e,Gt,Gd,null,Kd),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)E(t[a]);s=!0}},o(r){for(let a=0;a<t.length;a+=1)P(t[a]);s=!1},d(r){r&&k(e);for(let a=0;a<t.length;a+=1)t[a].d()}}}function Xd(n,e){let t,i,s=e[14].label+"",l,o,r,a;function u(){return e[9](e[14])}function f(...c){return e[10](e[14],...c)}return{key:n,first:null,c(){t=_("button"),i=_("span"),l=F(s),o=T(),p(i,"class","txt"),p(t,"tabindex","0"),p(t,"class","tab-item"),ie(t,"active",e[4]===e[14].id),this.first=t},m(c,d){w(c,t,d),g(t,i),g(i,l),g(t,o),r||(a=[G(t,"click",u),G(t,"keydown",cm(f))],r=!0)},p(c,d){e=c,d&48&&ie(t,"active",e[4]===e[14].id)},d(c){c&&k(t),r=!1,Qe(a)}}}function LC(n){let e,t,i=n[3].name+"",s,l,o,r,a=[],u=new Map,f=n[5];const c=d=>d[14].id;for(let d=0;d<f.length;d+=1){let h=Zd(n,f,d),m=c(h);u.set(m,a[d]=Xd(m,h))}return{c(){e=_("h4"),t=_("strong"),s=F(i),l=F(" records API"),o=T(),r=_("div");for(let d=0;d<a.length;d+=1)a[d].c();p(r,"class","tabs-header stretched")},m(d,h){w(d,e,h),g(e,t),g(t,s),g(e,l),w(d,o,h),w(d,r,h);for(let m=0;m<a.length;m+=1)a[m].m(r,null)},p(d,h){h&8&&i!==(i=d[3].name+"")&&ue(s,i),h&114&&(f=d[5],a=bt(a,h,c,1,d,f,u,r,Mn,Xd,null,Zd))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let h=0;h<a.length;h+=1)a[h].d()}}}function IC(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Close</span>',p(e,"type","button"),p(e,"class","btn btn-secondary")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[8]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function FC(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[IC],header:[LC],default:[PC]},$$scope:{ctx:n}};return e=new hi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),q(e,s)}}}function NC(n,e,t){const i=[{id:"list",label:"List",component:G3},{id:"view",label:"View",component:x3},{id:"create",label:"Create",component:dC},{id:"update",label:"Update",component:CC},{id:"delete",label:"Delete",
<span class="txt">Upload new file</span>`,p(t,"type","file"),p(t,"class","hidden"),t.multiple=n[5],p(s,"type","button"),p(s,"class","btn btn-secondary btn-sm btn-block"),p(e,"class","list-item btn-list-item")},m(r,a){w(r,e,a),g(e,t),n[16](t),g(e,i),g(e,s),l||(o=[G(t,"change",n[17]),G(s,"click",n[18])],l=!0)},p(r,a){a&32&&(t.multiple=r[5])},d(r){r&&k(e),n[16](null),l=!1,Qe(o)}}}function N4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,h,m,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let O=ep(n,b,D),A=y(O);d.set(A,c[D]=tp(A,O))}let S=n[0],C=[];for(let D=0;D<S.length;D+=1)C[D]=np(xd(n,S,D));const $=D=>P(C[D],1,1,()=>{C[D]=null});let M=!n[8]&&ip(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=F(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();h=T();for(let D=0;D<C.length;D+=1)C[D].c();m=T(),M&&M.c(),p(t,"class",i=U.getFieldTypeIcon(n[3].type)),p(l,"class","txt"),p(e,"for",a=n[21]),p(f,"class","files-list")},m(D,O){w(D,e,O),g(e,t),g(e,s),g(e,l),g(l,r),w(D,u,O),w(D,f,O);for(let A=0;A<c.length;A+=1)c[A].m(f,null);g(f,h);for(let A=0;A<C.length;A+=1)C[A].m(f,null);g(f,m),M&&M.m(f,null),n[19](f),v=!0},p(D,O){if((!v||O&8&&i!==(i=U.getFieldTypeIcon(D[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=D[3].name+"")&&ue(r,o),(!v||O&2097152&&a!==(a=D[21]))&&p(e,"for",a),O&1558&&(b=D[4],Pe(),c=bt(c,O,y,1,D,b,d,f,Gt,tp,h,ep),Le()),O&2049){S=D[0];let A;for(A=0;A<S.length;A+=1){const I=xd(D,S,A);C[A]?(C[A].p(I,O),E(C[A],1)):(C[A]=np(I),C[A].c(),E(C[A],1),C[A].m(f,m))}for(Pe(),A=S.length;A<C.length;A+=1)$(A);Le()}D[8]?M&&(M.d(1),M=null):M?M.p(D,O):(M=ip(D),M.c(),M.m(f,null))},i(D){if(!v){for(let O=0;O<b.length;O+=1)E(c[O]);for(let O=0;O<S.length;O+=1)E(C[O]);v=!0}},o(D){for(let O=0;O<c.length;O+=1)P(c[O]);C=C.filter(Boolean);for(let O=0;O<C.length;O+=1)P(C[O]);v=!1},d(D){D&&k(e),D&&k(u),D&&k(f);for(let O=0;O<c.length;O+=1)c[O].d();xt(C,D),M&&M.d(),n[19](null)}}}function R4(n){let e,t;return e=new Ne({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[N4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field form-field-file "+(i[3].required?"required":"")),s&8&&(l.name=i[3].name),s&136315391&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function H4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new Tn}=e,c,d;function h(A){U.removeByValue(u,A),t(1,u)}function m(A){U.pushUnique(u,A),t(1,u)}function v(A){U.isEmpty(a[A])||a.splice(A,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=A=>h(A),S=A=>m(A),C=A=>v(A);function $(A){he[A?"unshift":"push"](()=>{c=A,t(6,c)})}const M=()=>{for(let A of c.files)a.push(A);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function O(A){he[A?"unshift":"push"](()=>{d=A,t(7,d)})}return n.$$set=A=>{"record"in A&&t(2,o=A.record),"value"in A&&t(12,r=A.value),"uploadedFiles"in A&&t(0,a=A.uploadedFiles),"deletedFileIndexes"in A&&t(1,u=A.deletedFileIndexes),"field"in A&&t(3,f=A.field)},n.$$.update=()=>{var A,I;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=U.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=U.toArray(u))),n.$$.dirty&8&&t(5,i=((A=f.options)==null?void 0:A.maxSelect)>1),n.$$.dirty&4128&&U.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=U.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((I=f.options)==null?void 0:I.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,h,m,v,r,y,S,C,$,M,D,O]}class j4 extends Ee{constructor(e){super(),Oe(this,e,H4,R4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function sp(n){let e,t;return{c(){e=_("small"),t=F(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),g(e,t)},p(i,s){s&2&&ue(t,i[1])},d(i){i&&k(e)}}}function q4(n){let e,t,i,s,l,o=n[0].id
`,p(e,"class","block txt-center txt-disabled")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function aM(n){let e,t,i;function s(o){n[31](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new oM({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function uM(n){let e,t,i;function s(o){n[30](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new G4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function fM(n){let e,t,i,s,l;function o(f){n[27](f,n[40])}function r(f){n[28](f,n[40])}function a(f){n[29](f,n[40])}let u={field:n[40],record:n[2]};return n[2][n[40].name]!==void 0&&(u.value=n[2][n[40].name]),n[3][n[40].name]!==void 0&&(u.uploadedFiles=n[3][n[40].name]),n[4][n[40].name]!==void 0&&(u.deletedFileIndexes=n[4][n[40].name]),e=new j4({props:u}),he.push(()=>Re(e,"value",o)),he.push(()=>Re(e,"uploadedFiles",r)),he.push(()=>Re(e,"deletedFileIndexes",a)),{c(){V(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[40]),c[0]&4&&(d.record=n[2]),!t&&c[0]&5&&(t=!0,d.value=n[2][n[40].name],He(()=>t=!1)),!i&&c[0]&9&&(i=!0,d.uploadedFiles=n[3][n[40].name],He(()=>i=!1)),!s&&c[0]&17&&(s=!0,d.deletedFileIndexes=n[4][n[40].name],He(()=>s=!1)),e.$set(d)},i(f){l||(E(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){q(e,f)}}}function cM(n){let e,t,i;function s(o){n[26](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new b4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function dM(n){let e,t,i;function s(o){n[25](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new h4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function pM(n){let e,t,i;function s(o){n[24](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new f4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function hM(n){let e,t,i;function s(o){n[23](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new o4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function mM(n){let e,t,i;function s(o){n[22](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new n4({props:l}),he.push(()=>Re(e,"value",s)),{c(){V(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(E(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){q(e,o)}}}function gM(n){let e,t,i;function s(o){n[21](o,n[40])}let l={field:n[40]};return n[2][n[40].name]!==void 0&&(l.value=n[2][n[40].name]),e=new QC({props:l}),he.push(()=>Re(e,"value",
<span class="txt">Delete</span>`,p(e,"tabindex","0"),p(e,"class","dropdown-item closable")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[18]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function kM(n){let e,t=n[2].isNew?"New":"Edit",i,s,l=n[0].name+"",o,r,a,u,f,c=!n[2].isNew&&n[10]&&pp(n);return{c(){e=_("h4"),i=F(t),s=T(),o=F(l),r=F(" record"),a=T(),c&&c.c(),u=Je()},m(d,h){w(d,e,h),g(e,i),g(e,s),g(e,o),g(e,r),w(d,a,h),c&&c.m(d,h),w(d,u,h),f=!0},p(d,h){(!f||h[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&ue(i,t),(!f||h[0]&1)&&l!==(l=d[0].name+"")&&ue(o,l),!d[2].isNew&&d[10]?c?(c.p(d,h),h[0]&1028&&E(c,1)):(c=pp(d),c.c(),E(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(E(c),f=!0)},o(d){P(c),f=!1},d(d){d&&k(e),d&&k(a),c&&c.d(d),d&&k(u)}}}function wM(n){let e,t,i,s,l,o=n[2].isNew?"Create":"Save changes",r,a,u,f;return{c(){e=_("button"),t=_("span"),t.textContent="Cancel",i=T(),s=_("button"),l=_("span"),r=F(o),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=n[7],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[11]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[9]||n[7],ie(s,"btn-loading",n[7])},m(c,d){w(c,e,d),g(e,t),w(c,i,d),w(c,s,d),g(s,l),g(l,r),u||(f=G(e,"click",n[17]),u=!0)},p(c,d){d[0]&128&&(e.disabled=c[7]),d[0]&4&&o!==(o=c[2].isNew?"Create":"Save changes")&&ue(r,o),d[0]&640&&a!==(a=!c[9]||c[7])&&(s.disabled=a),d[0]&128&&ie(s,"btn-loading",c[7])},d(c){c&&k(e),c&&k(i),c&&k(s),u=!1,f()}}}function $M(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[wM],header:[kM],default:[vM]},$$scope:{ctx:n}};return e=new hi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&288&&(o.beforeHide=s[32]),l[0]&1693|l[1]&8192&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),q(e,s)}}}function hp(n){return JSON.stringify(n)}function SM(n,e,t){let i,s,l,o;const r=on(),a="record_"+U.randomString(5);let{collection:u}=e,f,c=null,d=new fo,h=!1,m=!1,v={},b={},y="";function S(ee){return $(ee),t(8,m=!0),f==null?void 0:f.show()}function C(){return f==null?void 0:f.hide()}async function $(ee){Si({}),c=ee||{},t(2,d=ee!=null&&ee.clone?ee.clone():new fo),t(3,v={}),t(4,b={}),await ni(),t(15,y=hp(d))}function M(){if(h||!l)return;t(7,h=!0);const ee=O();let Q;d.isNew?Q=be.records.create(u==null?void 0:u.id,ee):Q=be.records.update(u==null?void 0:u.id,d.id,ee),Q.then(async Se=>{cn(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,m=!1),C(),r("save",Se)}).catch(Se=>{be.errorResponseHandler(Se)}).finally(()=>{t(7,h=!1)})}function D(){!(c!=null&&c.id)||ci("Do you really want to delete the selected record?",()=>be.records.delete(c["@collectionId"],c.id).then(()=>{C(),cn("Successfully deleted record."),r("delete",c)}).catch(ee=>{be.errorResponseHandler(ee)}))}function O(){const ee=(d==null?void 0:d.export())||{},Q=new FormData,Se={};for(const je of(u==null?void 0:u.schema)||[])Se[je.name]=je;for(const je in ee)!Se[je]||(typeof ee[je]>"u"&&(ee[je]=null),U.addValueToFormData(Q,je,ee[je]));for(const je in v){const Ue=U.toArray(v[je]);for(const Z of Ue)Q.append(je,Z)}for(const je in b){const Ue=U.toArray(b[je]);for(const Z of Ue)Q.append(je+"."+Z,"")}return Q}const A=()=>C(),I=()=>D();function L(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function R(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function B(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function K(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function J(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function H(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function X(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function W(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function te(ee,Q){n.$$.not_equal(d[Q.name],ee)&&(d[Q.name]=ee,t(2,d))}function x(ee,Q){n.$$.not_equal(v[Q.name],ee)&&(v[Q.name]=ee,t(3,v))}function oe(ee,Q){n.$$.not_equa
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Mp(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[28]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Tp(n,e){let t,i,s;return i=new N_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=Je(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&8&&(r.record=e[35]),o[0]&2048&&(r.field=e[38]),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Dp(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,m,v=[],b=new Map,y,S,C,$,M,D,O,A,I,L,R,B;function K(){return e[25](e[35])}h=new Xo({props:{id:e[35].id}});let J=e[11];const H=te=>te[38].name;for(let te=0;te<J.length;te+=1){let x=wp(e,J,te),oe=H(x);b.set(oe,v[te]=Tp(oe,x))}C=new wi({props:{date:e[35].created}}),D=new wi({props:{date:e[35].updated}});function X(){return e[26](e[35])}function W(...te){return e[27](e[35],...te)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),V(h.$$.fragment),m=T();for(let te=0;te<v.length;te+=1)v[te].c();y=T(),S=_("td"),V(C.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),O=T(),A=_("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',I=T(),p(l,"type","checkbox"),p(l,"id",o="checkbox_"+e[35].id),l.checked=r=e[5][e[35].id],p(u,"for",f="checkbox_"+e[35].id),p(s,"class","form-field"),p(i,"class","bulk-select-col min-width"),p(d,"class","col-type-text col-field-id"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(te,x){w(te,t,x),g(t,i),g(i,s),g(s,l),g(s,a),g(s,u),g(t,c),g(t,d),j(h,d,null),g(t,m);for(let oe=0;oe<v.length;oe+=1)v[oe].m(t,null);g(t,y),g(t,S),j(C,S,null),g(t,$),g(t,M),j(D,M,null),g(t,O),g(t,A),g(t,I),L=!0,R||(B=[G(l,"change",K),G(s,"click",ei(e[19])),G(t,"click",X),G(t,"keydown",W)],R=!0)},p(te,x){e=te,(!L||x[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!L||x[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!L||x[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const oe={};x[0]&8&&(oe.id=e[35].id),h.$set(oe),x[0]&2056&&(J=e[11],Pe(),v=bt(v,x,H,1,e,J,b,t,Gt,Tp,y,wp),Le());const me={};x[0]&8&&(me.date=e[35].created),C.$set(me);const se={};x[0]&8&&(se.date=e[35].updated),D.$set(se)},i(te){if(!L){E(h.$$.fragment,te);for(let x=0;x<J.length;x+=1)E(v[x]);E(C.$$.fragment,te),E(D.$$.fragment,te),L=!0}},o(te){P(h.$$.fragment,te);for(let x=0;x<v.length;x+=1)P(v[x]);P(C.$$.fragment,te),P(D.$$.fragment,te),L=!1},d(te){te&&k(t),q(h);for(let x=0;x<v.length;x+=1)v[x].d();q(C),q(D),R=!1,Qe(B)}}}function Op(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&ue(s,i),a[0]&16&&ue(o,r[4])},d(r){r&&k(e)}}}function Ep(n){let e,t,i,s,l=n[4]-n[3].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[8]),ie(t,"btn-disabled",n[8]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=G(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&ue(o,l),c[0]&256&&ie(t,"btn-loading",f[8]),c[0]&256&&ie(t,"btn-disabled",f[8])},d(f){f&&k(e),a=!1,u()}}}function Ap(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,h,m,v,b,y,S;return{c(){e=_("div"),t=_("div"),i=F("Selected "),s=_("strong"),l=F(n[6]),o=T(),a=F(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),h=T(),m=_("button"),m.innerHTML='<span class="txt">Delete selected</span>',p(t,"class","txt"),p(f,"type","button"),p(f,"class","btn btn-xs btn-secondary btn-outline p-l-5 p-r-5"),ie(f,"bt
2022-08-11 01:37:41 +08:00
<span class="txt">API Preview</span>`,b=T(),y=_("button"),y.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">New record</span>`,S=T(),V(C.$$.fragment),$=T(),V(M.$$.fragment),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"type","button"),p(f,"class","btn btn-secondary btn-circle"),p(u,"class","inline-flex gap-5"),p(v,"type","button"),p(v,"class","btn btn-outline"),p(y,"type","button"),p(y,"class","btn btn-expanded"),p(m,"class","btns-group"),p(e,"class","page-header")},m(J,H){w(J,e,H),g(e,t),g(t,i),g(t,s),g(t,l),g(l,r),g(e,a),g(e,u),g(u,f),g(u,c),j(d,u,null),g(e,h),g(e,m),g(m,v),g(m,b),g(m,y),w(J,S,H),j(C,J,H),w(J,$,H),j(M,J,H),A=!0,I||(L=[Ye(Ct.call(null,f,{text:"Edit collection",position:"right"})),G(f,"click",n[12]),G(v,"click",n[14]),G(y,"click",n[15])],I=!0)},p(J,H){(!A||H&4)&&o!==(o=J[2].name+"")&&ue(r,o);const X={};H&1&&(X.value=J[0]),H&4&&(X.autocompleteCollection=J[2]),C.$set(X);const W={};H&4&&(W.collection=J[2]),!D&&H&1&&(D=!0,W.filter=J[0],He(()=>D=!1)),!O&&H&2&&(O=!0,W.sort=J[1],He(()=>O=!1)),M.$set(W)},i(J){A||(E(d.$$.fragment,J),E(C.$$.fragment,J),E(M.$$.fragment,J),A=!0)},o(J){P(d.$$.fragment,J),P(C.$$.fragment,J),P(M.$$.fragment,J),A=!1},d(J){J&&k(e),q(d),J&&k(S),q(C,J),J&&k($),n[17](null),q(M,J),I=!1,Qe(L)}}}function xM(n){let e,t,i,s,l,o,r,a;return{c(){e=_("div"),t=_("div"),t.innerHTML='<i class="ri-database-2-line"></i>',i=T(),s=_("h1"),s.textContent="Create your first collection to add records!",l=T(),o=_("button"),o.innerHTML=`<i class="ri-add-line"></i>
<span class="txt">Create new collection</span>`,p(t,"class","icon"),p(s,"class","m-b-10"),p(o,"type","button"),p(o,"class","btn btn-expanded-lg btn-lg"),p(e,"class","placeholder-section m-b-base")},m(u,f){w(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:re,d(u){u&&k(e),r=!1,a()}}}function eT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading collections...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function tT(n){let e,t,i,s,l,o,r,a,u;const f=[XM,GM,JM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let h={};s=new Ya({props:h}),n[21](s);let m={};o=new RC({props:m}),n[22](o);let v={collection:n[2]};return a=new F_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),V(s.$$.fragment),l=T(),V(o.$$.fragment),r=T(),V(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),j(s,b,y),w(b,l,y),j(o,b,y),w(b,r,y),j(a,b,y),u=!0},p(b,[y]){let S=e;e=d(b),e===S?c[e].p(b,y):(Pe(),P(c[S],1,1,()=>{c[S]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),E(t,1),t.m(i.parentNode,i));const C={};s.$set(C);const $={};o.$set($);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(E(t),E(s.$$.fragment,b),E(o.$$.fragment,b),E(a.$$.fragment,b),u=!0)},o(b){P(t),P(s.$$.fragment,b),P(o.$$.fragment,b),P(a.$$.fragment,b),u=!1},d(b){c[e].d(b),b&&k(i),n[21](null),q(s,b),b&&k(l),n[22](null),q(o,b),b&&k(r),n[23](null),q(a,b)}}}function nT(n,e,t){let i,s,l,o,r,a;kt(n,ui,W=>t(2,s=W)),kt(n,Ds,W=>t(10,l=W)),kt(n,Ro,W=>t(26,o=W)),kt(n,Rt,W=>t(27,r=W)),kt(n,na,W=>t(8,a=W)),dn(Rt,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,h,m=u.get("filter")||"",v=u.get("sort")||"-created",b=u.get("collectionId")||"";function y(){t(9,b=s.id),t(1,v="-created"),t(0,m="")}f$(b);const S=()=>f==null?void 0:f.show(),C=()=>f==null?void 0:f.show(s),$=()=>h==null?void 0:h.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),O=W=>t(0,m=W.detail);function A(W){he[W?"unshift":"push"](()=>{h=W,t(6,h)})}function I(W){m=W,t(0,m)}function L(W){v=W,t(1,v)}const R=W=>d==null?void 0:d.show(W==null?void 0:W.detail);function B(W){he[W?"unshift":"push"](()=>{f=W,t(3,f)})}function K(W){he[W?"unshift":"push"](()=>{c=W,t(4,c)})}function J(W){he[W?"unshift":"push"](()=>{d=W,t(5,d)})}const H=()=>h==null?void 0:h.load(),X=()=>h==null?void 0:h.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(W=>W.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||m||(s==null?void 0:s.id))){const W=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:m,sort:v}).toString();$i("/collections?"+W)}},[m,v,s,f,c,d,h,i,a,b,l,S,C,$,M,D,O,A,I,L,R,B,K,J,H,X]}class iT extends Ee{constructor(e){super(),Oe(this,e,nT,tT,De,{})}}function Pp(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[sT,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&2|s[1]&3&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function sT(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[31]),p(r,"type","text"),p(r,"id",a=n[31]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),g(e,t),g(e,i),g(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[1]&1&&l!==(l=f[31])&&p(e,"for",l),c[1]&1&&a!==(a=f[31])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Lp(n){let e,t,i;return{c(){e=_("div"),e.innerHTML='<i class="ri-shield-check-line"></i>',p(e,"class","form-field-addon txt-success")},m(s,l){w(s,e,l),t||(i=Ye(Ct.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function lT(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Lp();return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),d&&d.c(),r=T(),a=_("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[31]),p(a,"type","email"),p(a,"autocomplete","off"),p(a,"id",u=n[31]),a.required=!0},m(h,m){w(h,e,m),g(e,t),g(e,i),g(e,s),w(h,o,m),d&&d.m(h,m),w(h,r,m),w(h,a,m),Me(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(h,m){m[1]&1&&l!==(l=h[31])&&p(e,"for",l),h[1].verified?d||(d=Lp(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),m[1]&1&&u!==(u=
<span class="txt">Send verification email</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[16]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function dT(n){let e,t,i,s,l=!n[1].verified&&Hp(n);return{c(){l&&l.c(),e=T(),t=_("button"),t.innerHTML=`<i class="ri-delete-bin-7-line"></i>
<span class="txt">Delete</span>`,p(t,"type","button"),p(t,"class","dropdown-item")},m(o,r){l&&l.m(o,r),w(o,e,r),w(o,t,r),i||(s=G(t,"click",n[17]),i=!0)},p(o,r){o[1].verified?l&&(l.d(1),l=null):l?l.p(o,r):(l=Hp(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function pT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&Rp(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[5],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[5],ie(l,"btn-loading",n[5])},m(m,v){h&&h.m(m,v),w(m,e,v),w(m,t,v),g(t,i),w(m,s,v),w(m,l,v),g(l,o),g(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(m,v){m[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(m,v),v[0]&2&&E(h,1)):(h=Rp(m),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=m[5]),(!f||v[0]&2)&&r!==(r=m[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1056&&u!==(u=!m[10]||m[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",m[5])},i(m){f||(E(h),f=!0)},o(m){P(h),f=!1},d(m){h&&h.d(m),m&&k(e),m&&k(t),m&&k(s),m&&k(l),c=!1,d()}}}function hT(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[pT],header:[cT],default:[fT]},$$scope:{ctx:n}};return e=new hi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1088&&(o.beforeHide=s[24]),l[0]&1966|l[1]&2&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),q(e,s)}}}function mT(n,e,t){let i;const s=on(),l="user_"+U.randomString(5);let o,r=new co,a=!1,u=!1,f="",c="",d="",h=!1,m=!0;function v(te){return y(te),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(te){Si({}),t(1,r=te!=null&&te.clone?te.clone():new co),S()}function S(){t(3,h=!1),t(9,m=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function C(){if(a||!i)return;t(5,a=!0);const te={email:f};(r.isNew||h)&&(te.password=c,te.passwordConfirm=d);let x;r.isNew?x=be.users.create(te):x=be.users.update(r.id,te),x.then(async oe=>{m&&M(!1),t(6,u=!1),b(),cn(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",oe)}).catch(oe=>{be.errorResponseHandler(oe)}).finally(()=>{t(5,a=!1)})}function $(){!(r!=null&&r.id)||ci("Do you really want to delete the selected user?",()=>be.users.delete(r.id).then(()=>{t(6,u=!1),b(),cn("Successfully deleted user."),s("delete",r)}).catch(te=>{be.errorResponseHandler(te)}))}function M(te=!0){return be.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),te&&cn(`Successfully sent verification email to ${r.email}.`)}).catch(x=>{be.errorResponseHandler(x)})}const D=()=>M(),O=()=>$(),A=()=>b();function I(){f=this.value,t(2,f)}function L(){h=this.checked,t(3,h)}function R(){c=this.value,t(7,c)}function B(){d=this.value,t(8,d)}function K(){m=this.checked,t(9,m)}const J=()=>i&&u?(ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function H(te){he[te?"unshift":"push"](()=>{o=te,t(4,o)})}function X(te){ut.call(this,n,te)}function W(te){ut.call(this,n,te)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||h||f!==r.email)},[b,r,f,h,o,a,u,c,d,m,i,l,C,$,M,v,D,O,A,I,L,R,B,K,J,H,X,W]}class gT extends Ee{constructor(e){super(),Oe(this,e,mT,hT,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function jp(n,e,t){const i=n.slice();return i[40]=e[t],i}function qp(n,e,t){const i=n.slice();return i[43]=e[t],i}function Vp(n,e,t){const i=n.slice();return i[43]=e[t],i}function _T(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L=[],R=new Map,B,K,J,H,X,W,te,x,oe,me,se=[],ge=new Map,ke,Y,ve,ee,Q,Se;a=new Uo({}),a.$on("refresh",n[17]),m=new Bo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verifie
<span class="txt">New user</span>`,h=T(),V(m.$$.fragment),v=T(),b=_("div"),y=_("table"),S=_("thead"),C=_("tr"),V($.$$.fragment),D=T(),V(O.$$.fragment),I=T();for(let _e=0;_e<L.length;_e+=1)L[_e].c();B=T(),V(K.$$.fragment),H=T(),V(X.$$.fragment),te=T(),x=_("th"),oe=T(),me=_("tbody");for(let _e=0;_e<se.length;_e+=1)se[_e].c();Ge&&Ge.c(),ke=T(),st&&st.c(),Y=T(),ct&&ct.c(),ve=Je(),p(i,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(o,"type","button"),p(o,"class","btn btn-secondary btn-circle"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p(x,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[10]),p(b,"class","table-wrapper")},m(_e,Ie){w(_e,e,Ie),g(e,t),g(t,i),g(i,s),g(e,l),g(e,o),g(e,r),j(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),w(_e,h,Ie),j(m,_e,Ie),w(_e,v,Ie),w(_e,b,Ie),g(b,y),g(y,S),g(S,C),j($,C,null),g(C,D),j(O,C,null),g(C,I);for(let nt=0;nt<L.length;nt+=1)L[nt].m(C,null);g(C,B),j(K,C,null),g(C,H),j(X,C,null),g(C,te),g(C,x),g(y,oe),g(y,me);for(let nt=0;nt<se.length;nt+=1)se[nt].m(me,null);Ge&&Ge.m(me,null),w(_e,ke,Ie),st&&st.m(_e,Ie),w(_e,Y,Ie),ct&&ct.m(_e,Ie),w(_e,ve,Ie),ee=!0,Q||(Se=[Ye(Ct.call(null,o,{text:"Edit profile collection",position:"right"})),G(o,"click",n[16]),G(d,"click",n[18])],Q=!0)},p(_e,Ie){(!ee||Ie[0]&16384)&&ue(s,_e[14]);const nt={};Ie[0]&8&&(nt.value=_e[3]),m.$set(nt);const ft={};Ie[1]&131072&&(ft.$$scope={dirty:Ie,ctx:_e}),!M&&Ie[0]&16&&(M=!0,ft.sort=_e[4],He(()=>M=!1)),$.$set(ft);const vt={};Ie[1]&131072&&(vt.$$scope={dirty:Ie,ctx:_e}),!A&&Ie[0]&16&&(A=!0,vt.sort=_e[4],He(()=>A=!1)),O.$set(vt),Ie[0]&4096&&(ce=_e[12],L=bt(L,Ie,we,1,_e,ce,R,C,Mn,zp,B,Vp));const ot={};Ie[1]&131072&&(ot.$$scope={dirty:Ie,ctx:_e}),!J&&Ie[0]&16&&(J=!0,ot.sort=_e[4],He(()=>J=!1)),K.$set(ot);const Ot={};Ie[1]&131072&&(Ot.$$scope={dirty:Ie,ctx:_e}),!W&&Ie[0]&16&&(W=!0,Ot.sort=_e[4],He(()=>W=!1)),X.$set(Ot),Ie[0]&5450&&(Ce=_e[1],Pe(),se=bt(se,Ie,ze,1,_e,Ce,ge,me,Gt,Yp,null,jp),Le(),!Ce.length&&Ge?Ge.p(_e,Ie):Ce.length?Ge&&(Ge.d(1),Ge=null):(Ge=Bp(_e),Ge.c(),Ge.m(me,null))),Ie[0]&1024&&ie(y,"table-loading",_e[10]),_e[1].length?st?st.p(_e,Ie):(st=Kp(_e),st.c(),st.m(Y.parentNode,Y)):st&&(st.d(1),st=null),_e[1].length&&_e[13]?ct?ct.p(_e,Ie):(ct=Zp(_e),ct.c(),ct.m(ve.parentNode,ve)):ct&&(ct.d(1),ct=null)},i(_e){if(!ee){E(a.$$.fragment,_e),E(m.$$.fragment,_e),E($.$$.fragment,_e),E(O.$$.fragment,_e),E(K.$$.fragment,_e),E(X.$$.fragment,_e);for(let Ie=0;Ie<Ce.length;Ie+=1)E(se[Ie]);ee=!0}},o(_e){P(a.$$.fragment,_e),P(m.$$.fragment,_e),P($.$$.fragment,_e),P(O.$$.fragment,_e),P(K.$$.fragment,_e),P(X.$$.fragment,_e);for(let Ie=0;Ie<se.length;Ie+=1)P(se[Ie]);ee=!1},d(_e){_e&&k(e),q(a),_e&&k(h),q(m,_e),_e&&k(v),_e&&k(b),q($),q(O);for(let Ie=0;Ie<L.length;Ie+=1)L[Ie].d();q(K),q(X);for(let Ie=0;Ie<se.length;Ie+=1)se[Ie].d();Ge&&Ge.d(),_e&&k(ke),st&&st.d(_e),_e&&k(Y),ct&&ct.d(_e),_e&&k(ve),Q=!1,Qe(Se)}}}function bT(n){let e;return{c(){e=_("div"),e.innerHTML=`<span class="loader loader-lg"></span>
<h1>Loading users...</h1>`,p(e,"class","placeholder-section m-b-base")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function vT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function yT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function zp(n,e){let t,i,s,l,o,r,a,u=e[43].name+"",f,c,d;return{key:n,first:null,c(){t=_("th"),i=_("div"),s=_("i"),o=T(),r=_("span"),a=F("profile."),f=F(u),p(s,"class",l=U.getFieldTypeIcon(e[43].type)),p(r,"class","txt"),p(i,"class","col-header-content"),p(t,"class",c="col-type-"+e[43].type+" col-field-"+e[43].name),p(t,"name",d=e[43].name),this.first=t},m(h,m){w(h,t,m),g(t,i),g(i,s),g(i,o),g(i,r),g(r,a),g(r,f)},p(h,m){e=h,m[0]&4096&&l!==(l=U.getFieldTypeIcon(e[43].type))&&p(s,"class",l),m[0]&4096&&u!==(u=e[43].name+"")&&ue(f,u),m[0]&4096&&c!==(c="col-type-"+e[43].type+" col-field-"+e[43].name)&&p(t,"class",c),m[0]&4096&&d!==(d=e[43].name)&&p(t,"name",d)},d(h){h&&k(t)}}}function kT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function wT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",U.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function Bp(n){let e;function t(l,o){return l[10]?ST:$T}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function $T(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&Up(n);return{c(){e=_("tr"),t=_("td"),i=_("h6"),i.textContent="No users found.",s=T(),o&&o.c(),l=T(),p(t,"colspan","99"),p(t,"class","txt-center txt-hint p-xs")},m(a,u){w(a,e,u),g(e,t),g(t,i),g(t,s),o&&o.m(t,null),g(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=Up(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function ST(n){let e;return{c(){e=_("tr"),e.innerHTML=`<td colspan="99" class="p-xs"><span class="skeleton-loader"></span></td>
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function Up(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[26]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function Wp(n,e){let t,i,s;return i=new N_({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=Je(),V(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),j(i,l,o),s=!0},p(l,o){e=l;const r={};o[0]&4096&&(r.field=e[43]),o[0]&2&&(r.record=e[40].profile||{}),i.$set(r)},i(l){s||(E(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),q(i,l)}}}function Yp(n,e){let t,i,s,l,o,r,a,u=e[40].email+"",f,c,d,h,m=e[40].verified?"Verified":"Unverified",v,b,y=[],S=new Map,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W;s=new Xo({props:{id:e[40].id}});let te=e[12];const x=se=>se[43].name;for(let se=0;se<te.length;se+=1){let ge=qp(e,te,se),ke=x(ge);S.set(ke,y[se]=Wp(ke,ge))}M=new wi({props:{date:e[40].created}}),A=new wi({props:{date:e[40].updated}});function oe(){return e[24](e[40])}function me(){return e[25](e[40])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),V(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=F(u),d=T(),h=_("span"),v=F(m),b=T();for(let se=0;se<y.length;se+=1)y[se].c();C=T(),$=_("td"),V(M.$$.fragment),D=T(),O=_("td"),V(A.$$.fragment),I=T(),L=_("td"),R=_("button"),R.innerHTML=`<i class="ri-user-settings-line"></i>
2022-08-11 01:37:41 +08:00
<span class="txt">Edit user</span>`,B=T(),K=_("button"),K.innerHTML=`<i class="ri-profile-line"></i>
<span class="txt">Edit profile</span>`,J=T(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[40].email),p(h,"class","label"),ie(h,"label-success",e[40].verified),ie(h,"label-warning",!e[40].verified),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(O,"class","col-type-date col-field-updated"),p(R,"type","button"),p(R,"class","btn btn-sm btn-outline"),p(K,"type","button"),p(K,"class","btn btn-sm m-l-10"),p(L,"class","col-type-action min-width"),this.first=t},m(se,ge){w(se,t,ge),g(t,i),j(s,i,null),g(t,l),g(t,o),g(o,r),g(r,a),g(a,f),g(r,d),g(r,h),g(h,v),g(t,b);for(let ke=0;ke<y.length;ke+=1)y[ke].m(t,null);g(t,C),g(t,$),j(M,$,null),g(t,D),g(t,O),j(A,O,null),g(t,I),g(t,L),g(L,R),g(L,B),g(L,K),g(t,J),H=!0,X||(W=[G(R,"click",ei(oe)),G(K,"click",ei(me))],X=!0)},p(se,ge){e=se;const ke={};ge[0]&2&&(ke.id=e[40].id),s.$set(ke),(!H||ge[0]&2)&&u!==(u=e[40].email+"")&&ue(f,u),(!H||ge[0]&2&&c!==(c=e[40].email))&&p(a,"title",c),(!H||ge[0]&2)&&m!==(m=e[40].verified?"Verified":"Unverified")&&ue(v,m),ge[0]&2&&ie(h,"label-success",e[40].verified),ge[0]&2&&ie(h,"label-warning",!e[40].verified),ge[0]&4098&&(te=e[12],Pe(),y=bt(y,ge,x,1,e,te,S,t,Gt,Wp,C,qp),Le());const Y={};ge[0]&2&&(Y.date=e[40].created),M.$set(Y);const ve={};ge[0]&2&&(ve.date=e[40].updated),A.$set(ve)},i(se){if(!H){E(s.$$.fragment,se);for(let ge=0;ge<te.length;ge+=1)E(y[ge]);E(M.$$.fragment,se),E(A.$$.fragment,se),H=!0}},o(se){P(s.$$.fragment,se);for(let ge=0;ge<y.length;ge+=1)P(y[ge]);P(M.$$.fragment,se),P(A.$$.fragment,se),H=!1},d(se){se&&k(t),q(s);for(let ge=0;ge<y.length;ge+=1)y[ge].d();q(M),q(A),X=!1,Qe(W)}}}function Kp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),o=F(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),g(e,t),g(e,s),g(e,l),g(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&ue(s,i),a[0]&4&&ue(o,r[2])},d(r){r&&k(e)}}}function Zp(n){let e,t,i,s,l=n[2]-n[1].length+"",o,r,a,u;return{c(){e=_("div"),t=_("button"),i=_("span"),s=F("Load more ("),o=F(l),r=F(")"),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-lg btn-secondary btn-expanded"),ie(t,"btn-loading",n[10]),ie(t,"btn-disabled",n[10]),p(e,"class","block txt-center m-t-xs")},m(f,c){w(f,e,c),g(e,t),g(t,i),g(i,s),g(i,o),g(i,r),a||(u=G(t,"click",n[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&ue(o,l),c[0]&1024&&ie(t,"btn-loading",f[10]),c[0]&1024&&ie(t,"btn-disabled",f[10])},d(f){f&&k(e),a=!1,u()}}}function CT(n){let e,t,i,s;const l=[bT,_T],o=[];function r(a,u){return a[11]?0:1}return e=r(n),t=o[e]=l[e](n),{c(){t.c(),i=Je()},m(a,u){o[e].m(a,u),w(a,i,u),s=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(Pe(),P(o[f],1,1,()=>{o[f]=null}),Le(),t=o[e],t?t.p(a,u):(t=o[e]=l[e](a),t.c()),E(t,1),t.m(i.parentNode,i))},i(a){s||(E(t),s=!0)},o(a){P(t),s=!1},d(a){o[e].d(a),a&&k(i)}}}function MT(n){let e,t,i,s,l,o,r,a;e=new Dn({props:{$$slots:{default:[CT]},$$scope:{ctx:n}}});let u={};i=new gT({props:u}),n[28](i),i.$on("save",n[29]),i.$on("delete",n[30]);let f={};l=new Ya({props:f}),n[31](l),l.$on("save",n[32]);let c={collection:n[5]};return r=new F_({props:c}),n[33](r),r.$on("save",n[34]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment),o=T(),V(r.$$.fragment)},m(d,h){j(e,d,h),w(d,t,h),j(i,d,h),w(d,s,h),j(l,d,h),w(d,o,h),j(r,d,h),a=!0},p(d,h){const m={};h[0]&32766|h[1]&131072&&(m.$$scope={dirty:h,ctx:d}),e.$set(m);const v={};i.$set(v);const b={};l.$set(b);const y={};h[0]&32&&(y.collection=d[5]),r.$set(y)},i(d){a||(E(e.$$.fragment,d),E(i.$$.fragment,d),E(l.$$.fragment,d),E(r.$$.fragment,d),a=!0)},o(d){P(e.$$.fragment,d),P(i.$$.fragment,d),P(l.$$.fragment,d),P(r.$$.fragment,d),a=!1},d(d){q(e,d),d&&k(t),n[28](null),q(i,d),d&&k(s),n[31](null),q(l,d),d&&k(o),n[33](null),q(r,d)}}}function TT(n,e,t){let i,s,l,o;kt(n,Ro,ee=>t(35,l=ee)),kt(n,Rt,ee=>t(14,o=ee)),dn(Rt,o="Users",o);const r=new URLSearchParams(l),a=["id","userId","created","updated"];let u,f,c,d=[],h=1,m=0,v=!1,b=r.get("filter")||"",y=r
2022-08-11 01:37:41 +08:00
<span class="txt">Application</span>`,o=T(),r=_("a"),r.innerHTML=`<i class="ri-send-plane-2-line"></i>
<span class="txt">Mail settings</span>`,a=T(),u=_("a"),u.innerHTML=`<i class="ri-archive-drawer-line"></i>
<span class="txt">Files storage</span>`,f=T(),c=_("div"),c.innerHTML=`<span class="txt">Sync</span>
<small class="label label-danger label-compact">Experimental</small>`,d=T(),h=_("a"),h.innerHTML=`<i class="ri-uninstall-line"></i>
<span class="txt">Export collections</span>`,m=T(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
<span class="txt">Import collections</span>`,b=T(),y=_("div"),y.textContent="Authentication",S=T(),C=_("a"),C.innerHTML=`<i class="ri-lock-password-line"></i>
<span class="txt">Auth providers</span>`,$=T(),M=_("a"),M.innerHTML=`<i class="ri-key-line"></i>
<span class="txt">Token options</span>`,D=T(),O=_("a"),O.innerHTML=`<i class="ri-shield-user-line"></i>
<span class="txt">Admins</span>`,p(i,"class","sidebar-title"),p(l,"href","/settings"),p(l,"class","sidebar-list-item"),p(r,"href","/settings/mail"),p(r,"class","sidebar-list-item"),p(u,"href","/settings/storage"),p(u,"class","sidebar-list-item"),p(c,"class","sidebar-title"),p(h,"href","/settings/export-collections"),p(h,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(C,"href","/settings/auth-providers"),p(C,"class","sidebar-list-item"),p(M,"href","/settings/tokens"),p(M,"class","sidebar-list-item"),p(O,"href","/settings/admins"),p(O,"class","sidebar-list-item"),p(t,"class","sidebar-content"),p(e,"class","page-sidebar settings-sidebar")},m(L,R){w(L,e,R),g(e,t),g(t,i),g(t,s),g(t,l),g(t,o),g(t,r),g(t,a),g(t,u),g(t,f),g(t,c),g(t,d),g(t,h),g(t,m),g(t,v),g(t,b),g(t,y),g(t,S),g(t,C),g(t,$),g(t,M),g(t,D),g(t,O),A||(I=[Ye(Hn.call(null,l,{path:"/settings"})),Ye(hn.call(null,l)),Ye(Hn.call(null,r,{path:"/settings/mail/?.*"})),Ye(hn.call(null,r)),Ye(Hn.call(null,u,{path:"/settings/storage/?.*"})),Ye(hn.call(null,u)),Ye(Hn.call(null,h,{path:"/settings/export-collections/?.*"})),Ye(hn.call(null,h)),Ye(Hn.call(null,v,{path:"/settings/import-collections/?.*"})),Ye(hn.call(null,v)),Ye(Hn.call(null,C,{path:"/settings/auth-providers/?.*"})),Ye(hn.call(null,C)),Ye(Hn.call(null,M,{path:"/settings/tokens/?.*"})),Ye(hn.call(null,M)),Ye(Hn.call(null,O,{path:"/settings/admins/?.*"})),Ye(hn.call(null,O))],A=!0)},p:re,i:re,o:re,d(L){L&&k(e),A=!1,Qe(I)}}}class Vi extends Ee{constructor(e){super(),Oe(this,e,null,OT,De,{})}}function Jp(n,e,t){const i=n.slice();return i[31]=e[t],i}function Gp(n){let e,t;return e=new Ne({props:{class:"form-field disabled",name:"id",$$slots:{default:[ET,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function ET(n){let e,t,i,s,l,o,r,a,u;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="ID",o=T(),r=_("input"),p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","text"),p(r,"id",a=n[30]),r.value=u=n[1].id,r.disabled=!0},m(f,c){w(f,e,c),g(e,t),g(e,i),g(e,s),w(f,o,c),w(f,r,c)},p(f,c){c[0]&1073741824&&l!==(l=f[30])&&p(e,"for",l),c[0]&1073741824&&a!==(a=f[30])&&p(r,"id",a),c[0]&2&&u!==(u=f[1].id)&&r.value!==u&&(r.value=u)},d(f){f&&k(e),f&&k(o),f&&k(r)}}}function Xp(n){let e,t,i,s,l,o,r;function a(){return n[17](n[31])}function u(...f){return n[18](n[31],...f)}return{c(){e=_("figure"),t=_("img"),s=T(),xn(t.src,i="./images/avatars/avatar"+n[31]+".svg")||p(t,"src",i),p(t,"alt","Avatar "+n[31]),p(e,"tabindex","0"),p(e,"class",l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))},m(f,c){w(f,e,c),g(e,t),g(e,s),o||(r=[G(e,"click",a),G(e,"keydown",u)],o=!0)},p(f,c){n=f,c[0]&4&&l!==(l="link-fade thumb thumb-circle "+(n[31]==n[2]?"thumb-active":"thumb-sm"))&&p(e,"class",l)},d(f){f&&k(e),o=!1,Qe(r)}}}function AT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=_("i"),i=T(),s=_("span"),s.textContent="Email",o=T(),r=_("input"),p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"for",l=n[30]),p(r,"type","email"),p(r,"autocomplete","off"),p(r,"id",a=n[30]),r.required=!0},m(c,d){w(c,e,d),g(e,t),g(e,i),g(e,s),w(c,o,d),w(c,r,d),Me(r,n[3]),u||(f=G(r,"input",n[19]),u=!0)},p(c,d){d[0]&1073741824&&l!==(l=c[30])&&p(e,"for",l),d[0]&1073741824&&a!==(a=c[30])&&p(r,"id",a),d[0]&8&&r.value!==c[3]&&Me(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Qp(n){let e,t;return e=new Ne({props:{class:"form-field form-field-toggle",$$slots:{default:[PT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}
<span class="txt">Delete</span>`,p(e,"type","button"),p(e,"class","dropdown-item")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[15]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function HT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,h=!n[1].isNew&&eh(n);return{c(){h&&h.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=F(r),p(i,"class","txt"),p(t,"type","button"),p(t,"class","btn btn-secondary"),t.disabled=n[6],p(o,"class","txt"),p(l,"type","submit"),p(l,"form",n[11]),p(l,"class","btn btn-expanded"),l.disabled=u=!n[10]||n[6],ie(l,"btn-loading",n[6])},m(m,v){h&&h.m(m,v),w(m,e,v),w(m,t,v),g(t,i),w(m,s,v),w(m,l,v),g(l,o),g(o,a),f=!0,c||(d=G(t,"click",n[16]),c=!0)},p(m,v){m[1].isNew?h&&(Pe(),P(h,1,1,()=>{h=null}),Le()):h?(h.p(m,v),v[0]&2&&E(h,1)):(h=eh(m),h.c(),E(h,1),h.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=m[6]),(!f||v[0]&2)&&r!==(r=m[1].isNew?"Create":"Save changes")&&ue(a,r),(!f||v[0]&1088&&u!==(u=!m[10]||m[6]))&&(l.disabled=u),v[0]&64&&ie(l,"btn-loading",m[6])},i(m){f||(E(h),f=!0)},o(m){P(h),f=!1},d(m){h&&h.d(m),m&&k(e),m&&k(t),m&&k(s),m&&k(l),c=!1,d()}}}function jT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[HT],header:[NT],default:[FT]},$$scope:{ctx:n}};return e=new hi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){V(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(E(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),q(e,s)}}}function qT(n,e,t){let i;const s=on(),l="admin_"+U.randomString(5);let o,r=new $s,a=!1,u=!1,f=0,c="",d="",h="",m=!1;function v(W){return y(W),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(W){Si({}),t(1,r=W!=null&&W.clone?W.clone():new $s),S()}function S(){t(4,m=!1),t(3,c=(r==null?void 0:r.email)||""),t(2,f=(r==null?void 0:r.avatar)||0),t(8,d=""),t(9,h="")}function C(){if(a||!i)return;t(6,a=!0);const W={email:c,avatar:f};(r.isNew||m)&&(W.password=d,W.passwordConfirm=h);let te;r.isNew?te=be.admins.create(W):te=be.admins.update(r.id,W),te.then(async x=>{var oe;t(7,u=!1),b(),cn(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",x),((oe=be.authStore.model)==null?void 0:oe.id)===x.id&&be.authStore.save(be.authStore.token,x)}).catch(x=>{be.errorResponseHandler(x)}).finally(()=>{t(6,a=!1)})}function $(){!(r!=null&&r.id)||ci("Do you really want to delete the selected admin?",()=>be.admins.delete(r.id).then(()=>{t(7,u=!1),b(),cn("Successfully deleted admin."),s("delete",r)}).catch(W=>{be.errorResponseHandler(W)}))}const M=()=>$(),D=()=>b(),O=W=>t(2,f=W),A=(W,te)=>{(te.code==="Enter"||te.code==="Space")&&(te.preventDefault(),t(2,f=W))};function I(){c=this.value,t(3,c)}function L(){m=this.checked,t(4,m)}function R(){d=this.value,t(8,d)}function B(){h=this.value,t(9,h)}const K=()=>i&&u?(ci("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function J(W){he[W?"unshift":"push"](()=>{o=W,t(5,o)})}function H(W){ut.call(this,n,W)}function X(W){ut.call(this,n,W)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||m||c!==r.email||f!==r.avatar)},[b,r,f,c,m,o,a,u,d,h,i,l,C,$,v,M,D,O,A,I,L,R,B,K,J,H,X]}class VT extends Ee{constructor(e){super(),Oe(this,e,qT,jT,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function th(n,e,t){const i=n.slice();return i[24]=e[t],i}function zT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",U.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function BT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",U.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),g(e,t),g(e,i),g(e,s)},p:re,d(l){l&&k(e)}}}function UT(n){let e,t,i,s;return{c(
`},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function ih(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear filters</span>',p(e,"type","button"),p(e,"class","btn btn-hint btn-expanded m-t-sm")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[17]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function sh(n){let e;return{c(){e=_("span"),e.textContent="You",p(e,"class","label label-warning m-l-5")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function lh(n,e){let t,i,s,l,o,r,a,u,f,c,d,h,m=e[24].email+"",v,b,y,S,C,$,M,D,O,A,I,L,R,B;u=new Xo({props:{id:e[24].id}});let K=e[24].id===e[7].id&&sh();C=new wi({props:{date:e[24].created}}),D=new wi({props:{date:e[24].updated}});function J(){return e[15](e[24])}function H(...X){return e[16](e[24],...X)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("figure"),l=_("img"),r=T(),a=_("td"),V(u.$$.fragment),f=T(),K&&K.c(),c=T(),d=_("td"),h=_("span"),v=F(m),y=T(),S=_("td"),V(C.$$.fragment),$=T(),M=_("td"),V(D.$$.fragment),O=T(),A=_("td"),A.innerHTML='<i class="ri-arrow-right-line"></i>',I=T(),xn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg")||p(l,"src",o),p(l,"alt","Admin avatar"),p(s,"class","thumb thumb-sm thumb-circle"),p(i,"class","min-width"),p(a,"class","col-type-text col-field-id"),p(h,"class","txt txt-ellipsis"),p(h,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p(S,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(A,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(X,W){w(X,t,W),g(t,i),g(i,s),g(s,l),g(t,r),g(t,a),j(u,a,null),g(a,f),K&&K.m(a,null),g(t,c),g(t,d),g(d,h),g(h,v),g(t,y),g(t,S),j(C,S,null),g(t,$),g(t,M),j(D,M,null),g(t,O),g(t,A),g(t,I),L=!0,R||(B=[G(t,"click",J),G(t,"keydown",H)],R=!0)},p(X,W){e=X,(!L||W&16&&!xn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const te={};W&16&&(te.id=e[24].id),u.$set(te),e[24].id===e[7].id?K||(K=sh(),K.c(),K.m(a,null)):K&&(K.d(1),K=null),(!L||W&16)&&m!==(m=e[24].email+"")&&ue(v,m),(!L||W&16&&b!==(b=e[24].email))&&p(h,"title",b);const x={};W&16&&(x.date=e[24].created),C.$set(x);const oe={};W&16&&(oe.date=e[24].updated),D.$set(oe)},i(X){L||(E(u.$$.fragment,X),E(C.$$.fragment,X),E(D.$$.fragment,X),L=!0)},o(X){P(u.$$.fragment,X),P(C.$$.fragment,X),P(D.$$.fragment,X),L=!1},d(X){X&&k(t),q(u),K&&K.d(),q(C),q(D),R=!1,Qe(B)}}}function oh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=F("Showing "),s=F(i),l=F(" of "),r=F(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),g(e,t),g(e,s),g(e,l),g(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&ue(s,i),u&16&&o!==(o=a[4].length+"")&&ue(r,o)},d(a){a&&k(e)}}}function ZT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L,R,B,K,J,H,X,W,te,x,oe,me=[],se=new Map,ge,ke,Y,ve,ee;a=new Uo({}),a.$on("refresh",n[8]),m=new Bo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),m.$on("submit",n[10]);function Q(Ce){n[11](Ce)}let Se={class:"col-type-text",name:"id",$$slots:{default:[zT]},$$scope:{ctx:n}};n[2]!==void 0&&(Se.sort=n[2]),D=new sn({props:Se}),he.push(()=>Re(D,"sort",Q));function je(Ce){n[12](Ce)}let Ue={class:"col-type-email col-field-email",name:"email",$$slots:{default:[BT]},$$scope:{ctx:n}};n[2]!==void 0&&(Ue.sort=n[2]),I=new sn({props:Ue}),he.push(()=>Re(I,"sort",je));function Z(Ce){n[13](Ce)}let pe={class:"col-type-date col-field-created",name:"created",$$slots:{default:[UT]},$$scope:{ctx:n}};n[2]!==void 0&&(pe.sort=n[2]),B=new sn({props:pe}),he.push(()=>Re(B,"sort",Z));function ce(Ce){n[14](Ce)}let we={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[WT]},$$scope:{ctx:n}};n[2]!==void 0&&(we.sort=n[2]),H=new sn({props:we}),he.push(()=>Re(H,"sort",ce));let Ze=n[4];const tt=Ce=>Ce[24].id;for(let Ce=0;Ce<Ze.length;Ce+=1){let ze=th(n,Ze,Ce),Ge=tt(ze);se.set(Ge,me[Ce]=lh(Ge,ze))}let We=null;Ze.length||(We=nh(n));let it=n[4].length&&oh(n);return{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(
<span class="txt">New admin</span>`,h=T(),V(m.$$.fragment),v=T(),b=_("div"),y=_("table"),S=_("thead"),C=_("tr"),$=_("th"),M=T(),V(D.$$.fragment),A=T(),V(I.$$.fragment),R=T(),V(B.$$.fragment),J=T(),V(H.$$.fragment),W=T(),te=_("th"),x=T(),oe=_("tbody");for(let Ce=0;Ce<me.length;Ce+=1)me[Ce].c();We&&We.c(),ge=T(),it&&it.c(),ke=Je(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(f,"class","flex-fill"),p(d,"type","button"),p(d,"class","btn btn-expanded"),p(e,"class","page-header"),p($,"class","min-width"),p(te,"class","col-type-action min-width"),p(y,"class","table"),ie(y,"table-loading",n[5]),p(b,"class","table-wrapper")},m(Ce,ze){w(Ce,e,ze),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(e,r),j(a,e,null),g(e,u),g(e,f),g(e,c),g(e,d),w(Ce,h,ze),j(m,Ce,ze),w(Ce,v,ze),w(Ce,b,ze),g(b,y),g(y,S),g(S,C),g(C,$),g(C,M),j(D,C,null),g(C,A),j(I,C,null),g(C,R),j(B,C,null),g(C,J),j(H,C,null),g(C,W),g(C,te),g(y,x),g(y,oe);for(let Ge=0;Ge<me.length;Ge+=1)me[Ge].m(oe,null);We&&We.m(oe,null),w(Ce,ge,ze),it&&it.m(Ce,ze),w(Ce,ke,ze),Y=!0,ve||(ee=G(d,"click",n[9]),ve=!0)},p(Ce,ze){(!Y||ze&64)&&ue(o,Ce[6]);const Ge={};ze&2&&(Ge.value=Ce[1]),m.$set(Ge);const st={};ze&134217728&&(st.$$scope={dirty:ze,ctx:Ce}),!O&&ze&4&&(O=!0,st.sort=Ce[2],He(()=>O=!1)),D.$set(st);const ct={};ze&134217728&&(ct.$$scope={dirty:ze,ctx:Ce}),!L&&ze&4&&(L=!0,ct.sort=Ce[2],He(()=>L=!1)),I.$set(ct);const _e={};ze&134217728&&(_e.$$scope={dirty:ze,ctx:Ce}),!K&&ze&4&&(K=!0,_e.sort=Ce[2],He(()=>K=!1)),B.$set(_e);const Ie={};ze&134217728&&(Ie.$$scope={dirty:ze,ctx:Ce}),!X&&ze&4&&(X=!0,Ie.sort=Ce[2],He(()=>X=!1)),H.$set(Ie),ze&186&&(Ze=Ce[4],Pe(),me=bt(me,ze,tt,1,Ce,Ze,se,oe,Gt,lh,null,th),Le(),!Ze.length&&We?We.p(Ce,ze):Ze.length?We&&(We.d(1),We=null):(We=nh(Ce),We.c(),We.m(oe,null))),ze&32&&ie(y,"table-loading",Ce[5]),Ce[4].length?it?it.p(Ce,ze):(it=oh(Ce),it.c(),it.m(ke.parentNode,ke)):it&&(it.d(1),it=null)},i(Ce){if(!Y){E(a.$$.fragment,Ce),E(m.$$.fragment,Ce),E(D.$$.fragment,Ce),E(I.$$.fragment,Ce),E(B.$$.fragment,Ce),E(H.$$.fragment,Ce);for(let ze=0;ze<Ze.length;ze+=1)E(me[ze]);Y=!0}},o(Ce){P(a.$$.fragment,Ce),P(m.$$.fragment,Ce),P(D.$$.fragment,Ce),P(I.$$.fragment,Ce),P(B.$$.fragment,Ce),P(H.$$.fragment,Ce);for(let ze=0;ze<me.length;ze+=1)P(me[ze]);Y=!1},d(Ce){Ce&&k(e),q(a),Ce&&k(h),q(m,Ce),Ce&&k(v),Ce&&k(b),q(D),q(I),q(B),q(H);for(let ze=0;ze<me.length;ze+=1)me[ze].d();We&&We.d(),Ce&&k(ge),it&&it.d(Ce),Ce&&k(ke),ve=!1,ee()}}}function JT(n){let e,t,i,s,l,o;e=new Vi({}),i=new Dn({props:{$$slots:{default:[ZT]},$$scope:{ctx:n}}});let r={};return l=new VT({props:r}),n[18](l),l.$on("save",n[19]),l.$on("delete",n[20]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(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 c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[18](null),q(l,a)}}}function GT(n,e,t){let i,s,l;kt(n,Ro,R=>t(21,i=R)),kt(n,Rt,R=>t(6,s=R)),kt(n,ya,R=>t(7,l=R)),dn(Rt,s="Admins",s);const o=new URLSearchParams(i);let r,a=[],u=!1,f=o.get("filter")||"",c=o.get("sort")||"-created";function d(){return t(5,u=!0),t(4,a=[]),be.admins.getFullList(100,{sort:c||"-created",filter:f}).then(R=>{t(4,a=R),t(5,u=!1)}).catch(R=>{R!=null&&R.isAbort||(t(5,u=!1),console.warn(R),h(),be.errorResponseHandler(R,!1))})}function h(){t(4,a=[])}const m=()=>d(),v=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function y(R){c=R,t(2,c)}function S(R){c=R,t(2,c)}function C(R){c=R,t(2,c)}function $(R){c=R,t(2,c)}const M=R=>r==null?void 0:r.show(R),D=(R,B)=>{(B.code==="Enter"||B.code==="Space")&&(B.preventDefault(),r==null||r.show(R))},O=()=>t(1,f="");function A(R){he[R?"unshift":"push"](()=>{r=R,t(3,r)})}const I=()=>d(),L=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:c}).toString();$i("/settings/admins?"+R),d()}},[d,f,c,r,a,u,s,l,m,v,b,y,S,C,$,M,D,O,
<i class="ri-arrow-right-line"></i>`,p(t,"class","content txt-center m-b-base"),p(a,"type","submit"),p(a,"class","btn btn-lg btn-block btn-next"),ie(a,"btn-disabled",n[2]),ie(a,"btn-loading",n[2]),p(e,"class","block")},m(d,h){w(d,e,h),g(e,t),g(e,i),j(s,e,null),g(e,l),j(o,e,null),g(e,r),g(e,a),u=!0,f||(c=G(e,"submit",Yt(n[3])),f=!0)},p(d,h){const m={};h&769&&(m.$$scope={dirty:h,ctx:d}),s.$set(m);const v={};h&770&&(v.$$scope={dirty:h,ctx:d}),o.$set(v),h&4&&ie(a,"btn-disabled",d[2]),h&4&&ie(a,"btn-loading",d[2])},i(d){u||(E(s.$$.fragment,d),E(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&k(e),q(s),q(o),f=!1,c()}}}function tD(n){let e,t;return e=new Dg({props:{$$slots:{default:[eD]},$$scope:{ctx:n}}}),{c(){V(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function nD(n,e,t){let i;kt(n,Ro,c=>t(6,i=c));const s=new URLSearchParams(i);let l=s.get("demoEmail")||"",o=s.get("demoPassword")||"",r=!1;function a(){if(!r)return t(2,r=!0),be.admins.authViaEmail(l,o).then(()=>{$i("/")}).catch(()=>{go("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 iD extends Ee{constructor(e){super(),Oe(this,e,nD,tD,De,{})}}function sD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S;return i=new Ne({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[oD,({uniqueId:C})=>({14:C}),({uniqueId:C})=>C?16384:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[rD,({uniqueId:C})=>({14:C}),({uniqueId:C})=>C?16384:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[aD,({uniqueId:C})=>({14:C}),({uniqueId:C})=>C?16384:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),h=_("button"),m=_("span"),m.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(m,"class","txt"),p(h,"type","submit"),p(h,"class","btn btn-expanded"),h.disabled=v=!n[3]||n[2],ie(h,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(C,$){w(C,e,$),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),j(a,e,null),g(e,u),g(e,f),g(f,c),g(f,d),g(f,h),g(h,m),b=!0,y||(S=G(h,"click",n[9]),y=!0)},p(C,$){const M={};$&49153&&(M.$$scope={dirty:$,ctx:C}),i.$set(M);const D={};$&49153&&(D.$$scope={dirty:$,ctx:C}),o.$set(D);const O={};$&49153&&(O.$$scope={dirty:$,ctx:C}),a.$set(O),(!b||$&12&&v!==(v=!C[3]||C[2]))&&(h.disabled=v),$&4&&ie(h,"btn-loading",C[2])},i(C){b||(E(i.$$.fragment,C),E(o.$$.fragment,C),E(a.$$.fragment,C),b=!0)},o(C){P(i.$$.fragment,C),P(o.$$.fragment,C),P(a.$$.fragment,C),b=!1},d(C){C&&k(e),q(i),q(o),q(a),y=!1,S()}}}function lD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function oD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Application name"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appName),r||(a=G(l,"input",n[6]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appName&&Me(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function rD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Application url"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(l,"type","text"),p(l,"id",o=n[14]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.appUrl),r||(a=G(l,"input",n[7]),r=!0)},p(u,f){f&16384&&i!==(i=u[14])&&p(e,"for",i),f&16384&&o!==(o=u[14])&&p(l,"id",o),f&1&&l.value!==u[0].meta.appUrl&&Me(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function aD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Logs max days retention"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(
<div class="breadcrumb-item">Application</div></nav>`,t=T(),i=_("div"),s=_("form"),o.c(),p(e,"class","page-header"),p(s,"class","panel"),p(s,"autocomplete","off"),p(i,"class","wrapper")},m(h,m){w(h,e,m),w(h,t,m),w(h,i,m),g(i,s),c[l].m(s,null),r=!0,a||(u=G(s,"submit",Yt(n[4])),a=!0)},p(h,m){let v=l;l=d(h),l===v?c[l].p(h,m):(Pe(),P(c[v],1,1,()=>{c[v]=null}),Le(),o=c[l],o?o.p(h,m):(o=c[l]=f[l](h),o.c()),E(o,1),o.m(s,null))},i(h){r||(E(o),r=!0)},o(h){P(o),r=!1},d(h){h&&k(e),h&&k(t),h&&k(i),c[l].d(),a=!1,u()}}}function fD(n){let e,t,i,s;return e=new Vi({}),i=new Dn({props:{$$slots:{default:[uD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&32783&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function cD(n,e,t){let i,s,l;kt(n,bo,y=>t(10,s=y)),kt(n,Rt,y=>t(11,l=y)),dn(Rt,l="Application settings",l);let o={},r=!1,a=!1,u="";f();async function f(){t(1,r=!0);try{const y=await be.settings.getAll()||{};d(y)}catch(y){be.errorResponseHandler(y)}t(1,r=!1)}async function c(){if(!(a||!i)){t(2,a=!0);try{const y=await be.settings.update(U.filterRedactedProps(o));d(y),cn("Successfully saved application settings.")}catch(y){be.errorResponseHandler(y)}t(2,a=!1)}}function d(y={}){var S;dn(bo,s=(S=y==null?void 0:y.meta)==null?void 0:S.appName,s),t(0,o={meta:(y==null?void 0:y.meta)||{},logs:(y==null?void 0:y.logs)||{}}),t(5,u=JSON.stringify(o))}function h(){o.meta.appName=this.value,t(0,o)}function m(){o.meta.appUrl=this.value,t(0,o)}function v(){o.logs.maxDays=At(this.value),t(0,o)}const b=()=>c();return n.$$.update=()=>{n.$$.dirty&33&&t(3,i=u!=JSON.stringify(o))},[o,r,a,i,c,u,h,m,v,b]}class dD extends Ee{constructor(e){super(),Oe(this,e,cD,fD,De,{})}}function pD(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=pt(l,s[o]);return{c(){e=_("input"),fi(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Me(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){fi(e,l=_n(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Me(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function hD(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=pt(a,r[u]);return{c(){e=_("div"),t=_("button"),t.innerHTML='<i class="ri-key-line"></i>',i=T(),s=_("input"),p(t,"type","button"),p(t,"class","btn btn-secondary btn-circle"),p(e,"class","form-field-addon"),fi(s,a)},m(u,f){w(u,e,f),g(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Ye(Ct.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){fi(s,a=_n(r,[{readOnly:!0},{type:"text"},f&2&&{placeholder:u[1]},f&32&&u[5]]))},d(u){u&&k(e),u&&k(i),u&&k(s),l=!1,Qe(o)}}}function mD(n){let e;function t(l,o){return l[3]?hD:pD}let i=t(n),s=i(n);return{c(){s.c(),e=Je()},m(l,o){s.m(l,o),w(l,e,o)},p(l,[o]){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},i:re,o:re,d(l){s.d(l),l&&k(e)}}}function gD(n,e,t){const i=["value","mask"];let s=Jt(e,i),{value:l=""}=e,{mask:o="******"}=e,r,a=!1;async function u(){t(0,l=""),t(3,a=!1),await ni(),r==null||r.focus()}const f=()=>u();function c(h){he[h?"unshift":"push"](()=>{r=h,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=h=>{e=pt(pt({},e),di(h)),t(5,s=Jt(e,i)),"value"in h&&t(0,l=h.value),"mask"in h&&t(1,o=h.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Ka extends Ee{constructor(e){super(),Oe(this,e,gD,mD,De,{value:0,mask:1})}}function _D(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O,A,I,L,R,B,K;i=new Ne({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[vD,({uniqueId:H})=>({23:H}),({uniqueId:H})=>H?8388608:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[yD,({uniqueId:H})=>({23:H}),({uniqueId:H})=>H?8388608:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:
2022-08-11 01:37:41 +08:00
<br/>
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
below.</strong></p>`,y=T(),V(S.$$.fragment),C=T(),J&&J.c(),$=T(),M=_("div"),D=_("div"),O=T(),A=_("button"),I=_("span"),I.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(e,"class","grid"),p(b,"class","content m-b-sm"),p(D,"class","flex-fill"),p(I,"class","txt"),p(A,"type","submit"),p(A,"class","btn btn-expanded"),A.disabled=L=!n[3]||n[2],ie(A,"btn-loading",n[2]),p(M,"class","flex")},m(H,X){w(H,e,X),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),j(a,e,null),g(e,u),j(f,e,null),g(e,c),j(d,e,null),w(H,h,X),w(H,m,X),w(H,v,X),w(H,b,X),w(H,y,X),j(S,H,X),w(H,C,X),J&&J.m(H,X),w(H,$,X),w(H,M,X),g(M,D),g(M,O),g(M,A),g(A,I),R=!0,B||(K=G(A,"click",n[19]),B=!0)},p(H,X){const W={};X&25165825&&(W.$$scope={dirty:X,ctx:H}),i.$set(W);const te={};X&25165825&&(te.$$scope={dirty:X,ctx:H}),o.$set(te);const x={};X&25165825&&(x.$$scope={dirty:X,ctx:H}),a.$set(x);const oe={};X&25165825&&(oe.$$scope={dirty:X,ctx:H}),f.$set(oe);const me={};X&25165825&&(me.$$scope={dirty:X,ctx:H}),d.$set(me);const se={};X&25165825&&(se.$$scope={dirty:X,ctx:H}),S.$set(se),H[0].smtp.enabled?J?(J.p(H,X),X&1&&E(J,1)):(J=rh(H),J.c(),E(J,1),J.m($.parentNode,$)):J&&(Pe(),P(J,1,1,()=>{J=null}),Le()),(!R||X&12&&L!==(L=!H[3]||H[2]))&&(A.disabled=L),X&4&&ie(A,"btn-loading",H[2])},i(H){R||(E(i.$$.fragment,H),E(o.$$.fragment,H),E(a.$$.fragment,H),E(f.$$.fragment,H),E(d.$$.fragment,H),E(S.$$.fragment,H),E(J),R=!0)},o(H){P(i.$$.fragment,H),P(o.$$.fragment,H),P(a.$$.fragment,H),P(f.$$.fragment,H),P(d.$$.fragment,H),P(S.$$.fragment,H),P(J),R=!1},d(H){H&&k(e),q(i),q(o),q(a),q(f),q(d),H&&k(h),H&&k(m),H&&k(v),H&&k(b),H&&k(y),q(S,H),H&&k(C),J&&J.d(H),H&&k($),H&&k(M),B=!1,K()}}}function bD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function vD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Sender name"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.senderName),r||(a=G(l,"input",n[8]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderName&&Me(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function yD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Sender address"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","email"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].meta.senderAddress),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].meta.senderAddress&&Me(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function kD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("User verification page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user verification email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),Me(l,n[0].meta.userVerificationUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[10]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&1&&l.value!==c[0].meta.userVerificationUrl&&Me(l,c[0].meta.userVerificationUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function wD(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("User reset password page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user password reset email. Available placeholder parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),Me(l,n[0].meta.userResetPasswordUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[11]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&1&&l.value!==c[0].meta.userResetPasswordUrl&&Me(l,c[0].meta.userResetPasswordUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function $D(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=F("User confirm email change page url"),s=T(),l=_("input"),r=T(),a=_("div"),a.innerHTML=`Used in the user email change confirmation email. Available placeholder
2022-08-11 01:37:41 +08:00
parameters:
<code>%APP_URL%</code>, <code>%TOKEN%</code>.`,p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),g(e,t),w(c,s,d),w(c,l,d),Me(l,n[0].meta.userConfirmEmailChangeUrl),w(c,r,d),w(c,a,d),u||(f=G(l,"input",n[12]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&1&&l.value!==c[0].meta.userConfirmEmailChangeUrl&&Me(l,c[0].meta.userConfirmEmailChangeUrl)},d(c){c&&k(e),c&&k(s),c&&k(l),c&&k(r),c&&k(a),u=!1,f()}}}function SD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Use SMTP mail server"),p(e,"type","checkbox"),p(e,"id",t=n[23]),e.required=!0,p(s,"for",o=n[23])},m(u,f){w(u,e,f),e.checked=n[0].smtp.enabled,w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[13]),r=!0)},p(u,f){f&8388608&&t!==(t=u[23])&&p(e,"id",t),f&1&&(e.checked=u[0].smtp.enabled),f&8388608&&o!==(o=u[23])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function rh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C;return i=new Ne({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[CD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[MD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[TD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field",name:"smtp.username",$$slots:{default:[DD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field",name:"smtp.password",$$slots:{default:[OD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),m=_("div"),V(v.$$.fragment),b=T(),y=_("div"),p(t,"class","col-lg-6"),p(l,"class","col-lg-3"),p(a,"class","col-lg-3"),p(c,"class","col-lg-6"),p(m,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m($,M){w($,e,M),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),g(e,f),g(e,c),j(d,c,null),g(e,h),g(e,m),j(v,m,null),g(e,b),g(e,y),C=!0},p($,M){const D={};M&25165825&&(D.$$scope={dirty:M,ctx:$}),i.$set(D);const O={};M&25165825&&(O.$$scope={dirty:M,ctx:$}),o.$set(O);const A={};M&25165825&&(A.$$scope={dirty:M,ctx:$}),u.$set(A);const I={};M&25165825&&(I.$$scope={dirty:M,ctx:$}),d.$set(I);const L={};M&25165825&&(L.$$scope={dirty:M,ctx:$}),v.$set(L)},i($){C||(E(i.$$.fragment,$),E(o.$$.fragment,$),E(u.$$.fragment,$),E(d.$$.fragment,$),E(v.$$.fragment,$),$&&Dt(()=>{S||(S=rt(e,tn,{duration:150},!0)),S.run(1)}),C=!0)},o($){P(i.$$.fragment,$),P(o.$$.fragment,$),P(u.$$.fragment,$),P(d.$$.fragment,$),P(v.$$.fragment,$),$&&(S||(S=rt(e,tn,{duration:150},!1)),S.run(0)),C=!1},d($){$&&k(e),q(i),q(o),q(u),q(d),q(v),$&&S&&S.end()}}}function CD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("SMTP server host"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","text"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].smtp.host),r||(a=G(l,"input",n[14]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&l.value!==u[0].smtp.host&&Me(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function MD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Port"),s=T(),l=_("input"),p(e,"for",i=n[23]),p(l,"type","number"),p(l,"id",o=n[23]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].smtp.port),r||(a=G(l,"input",n[15]),r=!0)},p(u,f){f&8388608&&i!==(i=u[23])&&p(e,"for",i),f&8388608&&o!==(o=u[23])&&p(l,"id",o),f&1&&At(l.value)!==u[0].smtp.port&&Me(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function TD(n){let e,t,i,s,l,o,r;function a(f){n[16](f)}let u={id:n[23],items:n[5]};return n[0].smtp.tls!==void 0&&(u.keyOfSelected=n[0].smtp.tls),l=new fs({props:u}),he.push(()=>Re(
2022-08-11 01:37:41 +08:00
the
`),r=_("strong"),u=F(a),f=F(`
to the
`),c=_("strong"),h=F(d),m=F(`.
`),v=_("br"),b=F(`
There are numerous command line tools that can help you, such as:
`),y=_("a"),y.textContent=`rclone
`,S=F(`,
`),C=_("a"),C.textContent=`s5cmd
`,$=F(", etc."),M=T(),D=_("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(I,L){w(I,e,L),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),g(l,r),g(r,u),g(l,f),g(l,c),g(c,h),g(l,m),g(l,v),g(l,b),g(l,y),g(l,S),g(l,C),g(l,$),g(e,M),g(e,D),A=!0},p(I,L){(!A||L&8)&&a!==(a=I[3]?"S3 storage":"local file system")&&ue(u,a),(!A||L&1)&&d!==(d=I[0].enabled?"S3 storage":"local file system")&&ue(h,d)},i(I){A||(I&&Dt(()=>{O||(O=rt(e,tn,{duration:150},!0)),O.run(1)}),A=!0)},o(I){I&&(O||(O=rt(e,tn,{duration:150},!1)),O.run(0)),A=!1},d(I){I&&k(e),I&&O&&O.end()}}}function uh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D;return i=new Ne({props:{class:"form-field required",name:"s3.endpoint",$$slots:{default:[RD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[HD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field required",name:"s3.region",$$slots:{default:[jD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),d=new Ne({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[qD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),v=new Ne({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[VD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),S=new Ne({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[zD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),f=T(),c=_("div"),V(d.$$.fragment),h=T(),m=_("div"),V(v.$$.fragment),b=T(),y=_("div"),V(S.$$.fragment),C=T(),$=_("div"),p(t,"class","col-lg-12"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(c,"class","col-lg-6"),p(m,"class","col-lg-6"),p(y,"class","col-lg-12"),p($,"class","col-lg-12"),p(e,"class","grid")},m(O,A){w(O,e,A),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),g(e,f),g(e,c),j(d,c,null),g(e,h),g(e,m),j(v,m,null),g(e,b),g(e,y),j(S,y,null),g(e,C),g(e,$),D=!0},p(O,A){const I={};A&1572865&&(I.$$scope={dirty:A,ctx:O}),i.$set(I);const L={};A&1572865&&(L.$$scope={dirty:A,ctx:O}),o.$set(L);const R={};A&1572865&&(R.$$scope={dirty:A,ctx:O}),u.$set(R);const B={};A&1572865&&(B.$$scope={dirty:A,ctx:O}),d.$set(B);const K={};A&1572865&&(K.$$scope={dirty:A,ctx:O}),v.$set(K);const J={};A&1572865&&(J.$$scope={dirty:A,ctx:O}),S.$set(J)},i(O){D||(E(i.$$.fragment,O),E(o.$$.fragment,O),E(u.$$.fragment,O),E(d.$$.fragment,O),E(v.$$.fragment,O),E(S.$$.fragment,O),O&&Dt(()=>{M||(M=rt(e,tn,{duration:150},!0)),M.run(1)}),D=!0)},o(O){P(i.$$.fragment,O),P(o.$$.fragment,O),P(u.$$.fragment,O),P(d.$$.fragment,O),P(v.$$.fragment,O),P(S.$$.fragment,O),O&&(M||(M=rt(e,tn,{duration:150},!1)),M.run(0)),D=!1},d(O){O&&k(e),q(i),q(o),q(u),q(d),q(v),q(S),O&&M&&M.end()}}}function RD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Endpoint"),s=T(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].endpoint),r||(a=G(l,"input",n[9]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].endpoint&&Me(l,u[0].endpoint)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function HD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=F("Bucket"),s=T(),l=_("input"),p(e,"for",i=n[19]),p(l,"type","text"),p(l,"id",o=n[19]),l.required=!0},m(u,f){w(u,e,f),g(e,t),w(u,s,f),w(u,l,f),Me(l,n[0].bucket),r||(a=G(l,"input",n[10]),r=!0)},p(u,f){f&524288&&i!==(i=u[19])&&p(e,"for",i),f&524288&&o!==(o=u[19])&&p(l,"id",o),f&1&&l.value!==u[0].bucket&&Me(l,u[0].bucket)},d(u){
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,c=T(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m($,M){w($,e,M),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w($,r,M),w($,a,M),g(a,u),g(u,f),g(u,c),S[d].m(u,null),m=!0,v||(b=G(u,"submit",Yt(n[16])),v=!0)},p($,M){(!m||M&32)&&ue(o,$[5]);let D=d;d=C($),d===D?S[d].p($,M):(Pe(),P(S[D],1,1,()=>{S[D]=null}),Le(),h=S[d],h?h.p($,M):(h=S[d]=y[d]($),h.c()),E(h,1),h.m(u,null))},i($){m||(E(h),m=!0)},o($){P(h),m=!1},d($){$&&k(e),$&&k(r),$&&k(a),S[d].d(),v=!1,b()}}}function UD(n){let e,t,i,s;return e=new Vi({}),i=new Dn({props:{$$slots:{default:[BD]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&1048639&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function WD(n,e,t){let i,s;kt(n,Rt,D=>t(5,s=D)),dn(Rt,s="Files storage",s);let l={},o=!1,r=!1,a="",u=!1;f();async function f(){t(1,o=!0);try{const D=await be.settings.getAll()||{};d(D)}catch(D){be.errorResponseHandler(D)}t(1,o=!1)}async function c(){if(!(r||!i)){t(2,r=!0);try{const D=await be.settings.update(U.filterRedactedProps({s3:l}));d(D),Si({}),cn("Successfully saved Files storage settings.")}catch(D){be.errorResponseHandler(D)}t(2,r=!1)}}function d(D={}){t(0,l=(D==null?void 0:D.s3)||{}),t(3,u=l.enabled),t(7,a=JSON.stringify(l))}function h(){l.enabled=this.checked,t(0,l)}function m(){l.endpoint=this.value,t(0,l)}function v(){l.bucket=this.value,t(0,l)}function b(){l.region=this.value,t(0,l)}function y(){l.accessKey=this.value,t(0,l)}function S(D){n.$$.not_equal(l.secret,D)&&(l.secret=D,t(0,l))}function C(){l.forcePathStyle=this.checked,t(0,l)}const $=()=>c(),M=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(4,i=a!=JSON.stringify(l))},[l,o,r,u,i,s,c,a,h,m,v,b,y,S,C,$,M]}class YD extends Ee{constructor(e){super(),Oe(this,e,WD,UD,De,{})}}function KD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[16]),p(s,"for",o=n[16])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[8]),r=!0)},p(u,f){f&65536&&t!==(t=u[16])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&65536&&o!==(o=u[16])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function fh(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ne({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[ZD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ne({props:{class:"form-field "+(U.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[JD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ne({props:{class:"form-field "+(U.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[GD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),V(i.$$.fragment),s=T(),l=_("div"),V(o.$$.fragment),r=T(),a=_("div"),V(u.$$.fragment),p(t,"class","col-sm-12 m-t-sm"),p(l,"class","col-lg-6"),p(a,"class","col-lg-6"),p(e,"class","grid")},m(d,h){w(d,e,h),g(e,t),j(i,t,null),g(e,s),g(e,l),j(o,l,null),g(e,r),g(e,a),j(u,a,null),c=!0},p(d,h){const m={};h&196609&&(m.$$scope={dirty:h,ctx:d}),i.$set(m);const v={};h&1&&(v.class="form-field "+(U.isEmpty(d[0].onlyDomains)?"":"disabled")),h&196609&&(v.$$scope={dirty:h,ctx:d}),o.$set(v);const b={};h&1&&(b.class="form-field "+(U.isEmpty(d[0].exceptDomains)?"":"disabled")),h&196609&&(b.$$scope={dirty:h,ctx:d}),u.$set(b)},i(d){c||(E(i.$$.fragment,d),E(o.$$.fragment,d),E(u.$$.fragment,d),d&&Dt(()=>{f||(f=rt(e,tn,{duration:150},!0)),f.run(1)}),c=!0)},o(d){P(i.$$.fragment,d),P(o.$$.fragment,d),P(u.$$.fragment,d),d&&(f||(f=rt(e,tn,{du
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]))&&p(e,"for",l);const S={};y&65536&&(S.id=b[16]),y&1&&(S.disabled=!U.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,S.value=b[0].exceptDomains,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function GD(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function m(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!U.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new cs({props:v}),he.push(()=>Re(r,"value",m)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),V(r.$$.fragment),u=T(),f=_("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[16]+".config.onlyDomains"),p(f,"class","help-block")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),w(b,o,y),j(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(h=Ye(Ct.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(b,y){(!c||y&65536&&l!==(l=b[16]+".config.onlyDomains"))&&p(e,"for",l);const S={};y&65536&&(S.id=b[16]+".config.onlyDomains"),y&1&&(S.disabled=!U.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,S.value=b[0].onlyDomains,He(()=>a=!1)),r.$set(S)},i(b){c||(E(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),q(r,b),b&&k(u),b&&k(f),d=!1,h()}}}function XD(n){let e,t,i,s;e=new Ne({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[KD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&fh(n);return{c(){V(e.$$.fragment),t=T(),l&&l.c(),i=Je()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&E(l,1)):(l=fh(o),l.c(),E(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(E(e.$$.fragment,o),E(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){q(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function QD(n){let e;return{c(){e=_("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function xD(n){let e;return{c(){e=_("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ch(n){let e,t,i,s,l;return{c(){e=_("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Ye(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Dt(()=>{t||(t=rt(e,Un,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=rt(e,Un,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function eO(n){let e,t,i,s,l,o,r;function a(d,h){return d[0].enabled?xD:QD}let u=a(n),f=u(n),c=n[2]&&ch();return{c(){e=_("div"),e.innerHTML=`<i class="ri-mail-lock-line"></i>
<span class="txt">Email/Password</span>`,t=T(),f.c(),i=T(),s=_("div"),l=T(),c&&c.c(),o=Je(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,h){w(d,e,h),w(d,t,h),f.m(d,h),w(d,i,h),w(d,s,h),w(d,l,h),c&&c.m(d,h),w(d,o,h),r=!0},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?h&4&&E(c,1):(c=ch(),c.c(),E(c,1),c.m(o.parentNode,o)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){r||(E(c),r=!0)},o(d){P(c),r=!1},d(d){d&&k(e),d&&k(t),f.d(d),d&&k(i),d&&k(s),d&&k(l),c&&c.d(d),d&&k(o)}}}function tO(n){let e,t;const i=[n[3]];let s={$$slots:{header:[eO],default:[XD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=pt(s,i[l]);return e=new Ua({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){V(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,[o]){const r=o&8?_n(i,[pi(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(E(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),q(e,l)}}}function nO(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Jt(e,s),o;kt(n,as,$=>t(7,o=$));let{config:r={}}=e,a;function u(){a==null||a.expand()}function f(){a==null||a.collapse()}function c(){a==null||a.collapseSiblings()}function d(){r.enabled=this.checked,t(0,r)}function h(){r.minPasswordLength=At(this.value),t(0,r)}function m($){n.$$.not_equal(r.exceptDomains,$)&&(r.exceptDomains=$,t(0,r))}function v($){n.$$.not_equal(r.onlyDomains,$)&&(r.onlyDomains=$,t(0,r))}function b($){he[$?"unshift":"push"](()=>{a=$,t(1,a)})}function y($){ut.call(this,n,$)}function S($){ut.call(this,n,$)}function C($){ut.call(this,n,$)}return n.$$set=$=>{e=pt(pt({},e),di($)),t(3,l=Jt(e,s)),"config"in $&&t(0,r=$.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!U.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,h,m,v,b,y,S,C]}class iO extends Ee{constructor(e){super(),Oe(this,e,nO,tO,De,{config:0,expand:4,collapse:5,collapseSiblings:6})}get expand(){return this.$$.ctx[4]}get collapse(){return this.$$.ctx[5]}get collapseSiblings(){return this.$$.ctx[6]}}function sO(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=F("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(s,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[0].enabled,w(u,i,f),w(u,s,f),g(s,l),r||(a=G(e,"change",n[11]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&1&&(e.checked=u[0].enabled),f&4194304&&o!==(o=u[22])&&p(s,"for",o)},d(u){u&&k(e),u&&k(i),u&&k(s),r=!1,a()}}}function dh(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m;l=new Ne({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[lO,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Ne({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[oO,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Ne({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[rO,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&ph(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),V(l.$$.fragment),o=T(),r=_("div"),V(a.$$.fragment),u=T(),f=_("div"),V(c.$$.fragment),d=T(),v&&v.c(),p(t,"class","col-12 spacing"),p(s,"class","col-lg-6"),p(r,"class","col-lg-6"),p(f,"class","col-lg-12"),p(e,"class","grid")},m(b,y){w(b,e,y),g(e,t),g(e,i),g(e,s),j(l,s,null),g(e,o),g(e,r),j(a,r,null),g(e,u),g(e,f),j(c,f,null),g(e,d),v&&v.m(e,null),m=!0},p(b,y){const S={};y&2&&(S.name=b[1]+".clientId"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),l.$set(S);const C={};y&2&&(C.name=b[1]+".clientSecret"),y&12582913&&(C.$$scope={dirty:y,ctx:b}),a.$set(C);const $={};y&2&&($.name=b[1]+".allowRegistrations"),y&12582913&&($.$$scope={dirty:y,ctx:b}),c.$set($),b[4]?v?(v.p(b,y),y&16&&E(v,1)):(v=ph(b),v.c(),E(v,1),v.m(e,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){m||(E(l.$$.fragment,b),E(a.$$.fragment,b),E(c.$$.fragment,b),E(v),b&&Dt(()=>{h||(h=rt(e,tn,{duration:200},!0)),h.run(1)}),m=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(h||(h=rt(e,tn,{duration:200},!1)),h.run(0)),m=!1},d(
2022-08-11 01:37:41 +08:00
another PocketBase environment.</p>`,t=T(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=T(),V(o.$$.fragment),r=T(),a=_("div"),u=_("div"),f=T(),c=_("button"),c.innerHTML=`<i class="ri-download-line"></i>
<span class="txt">Download as JSON</span>`,p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-secondary fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(v,b){w(v,e,b),w(v,t,b),w(v,i,b),g(i,s),g(i,l),j(o,i,null),n[8](i),w(v,r,b),w(v,a,b),g(a,u),g(a,f),g(a,c),d=!0,h||(m=[G(s,"click",n[7]),G(i,"keydown",n[9]),G(c,"click",n[10])],h=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(E(o.$$.fragment,v),d=!0)},o(v){P(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),q(o),n[8](null),v&&k(r),v&&k(a),h=!1,Qe(m)}}}function AO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function PO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[AO,EO],m=[];function v(b,y){return b[1]?0:1}return f=v(n),c=m[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[3]),r=T(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(b,r,y),w(b,a,y),g(a,u),m[f].m(u,null),d=!0},p(b,y){(!d||y&8)&&ue(o,b[3]);let S=f;f=v(b),f===S?m[f].p(b,y):(Pe(),P(m[S],1,1,()=>{m[S]=null}),Le(),c=m[f],c?c.p(b,y):(c=m[f]=h[f](b),c.c()),E(c,1),c.m(u,null))},i(b){d||(E(c),d=!0)},o(b){P(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),m[f].d()}}}function LO(n){let e,t,i,s;return e=new Vi({}),i=new Dn({props:{$$slots:{default:[PO]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment)},m(l,o){j(e,l,o),w(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||(E(e.$$.fragment,l),E(i.$$.fragment,l),s=!0)},o(l){P(e.$$.fragment,l),P(i.$$.fragment,l),s=!1},d(l){q(e,l),l&&k(t),q(i,l)}}}function IO(n,e,t){let i,s;kt(n,Rt,b=>t(3,s=b)),dn(Rt,s="Export collections",s);const l="export_"+U.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await be.collections.getFullList(100,{$cancelKey:l}));for(let b of r)delete b.created,delete b.updated}catch(b){be.errorResponseHandler(b)}t(1,a=!1)}function f(){U.downloadJson(r,"pb_schema")}function c(){U.copyToClipboard(i),h1("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(b){he[b?"unshift":"push"](()=>{o=b,t(0,o)})}const m=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,m,v]}class FO extends Ee{constructor(e){super(),Oe(this,e,IO,LO,De,{})}}function bh(n,e,t){const i=n.slice();return i[14]=e[t],i}function vh(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function yh(n,e,t){const i=n.slice();return i[14]=e[t],i}function kh(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 $h(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Sh(n,e,t){const i=n.slice();return i[30]=e[t],i}function NO(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&Ch(),a=n[0].name!==n[1].name&&Mh(n);return{c(){e=_("div"),r&&r.c(),t=T(),a&&a.c(),i=T(),s=_("strong"),o=F(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),g(e,t),a&&a.m(e,null),g(e,i),g(e,s),g(s,o)},p(u,f){u[9]?r||(r=Ch(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=Mh(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&ue(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function RO(n){var o;let e,t,i,s=((o=n[0])==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=T(),i=_("strong"),l=F(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),g(i,l)},p(r,a){var u;a[0]&1&&s!==(s=((u=r[0])==null?vo
2022-08-11 01:37:41 +08:00
<th width="10%" class="svelte-lmkr38">Old</th>
<th width="10%" class="svelte-lmkr38">New</th></tr>`,l=T(),o=_("tbody");for(let $=0;$<m.length;$+=1)m[$].c();r=T(),v&&v.c(),a=T();for(let $=0;$<y.length;$+=1)y[$].c();u=T();for(let $=0;$<C.length;$+=1)C[$].c();p(e,"class","section-title"),p(i,"class","table collections-diff-table m-b-base svelte-lmkr38")},m($,M){w($,e,M),d.m(e,null),w($,t,M),w($,i,M),g(i,s),g(i,l),g(i,o);for(let D=0;D<m.length;D+=1)m[D].m(o,null);g(o,r),v&&v.m(o,null),g(o,a);for(let D=0;D<y.length;D+=1)y[D].m(o,null);g(o,u);for(let D=0;D<C.length;D+=1)C[D].m(o,null)},p($,M){if(c===(c=f($))&&d?d.p($,M):(d.d(1),d=c($),d&&(d.c(),d.m(e,null))),M[0]&7203){h=$[11];let D;for(D=0;D<h.length;D+=1){const O=Sh($,h,D);m[D]?m[D].p(O,M):(m[D]=Th(O),m[D].c(),m[D].m(o,r))}for(;D<m.length;D+=1)m[D].d(1);m.length=h.length}if($[2]||$[5]?v?v.p($,M):(v=Dh($),v.c(),v.m(o,a)):v&&(v.d(1),v=null),M[0]&4248){b=$[7];let D;for(D=0;D<b.length;D+=1){const O=yh($,b,D);y[D]?y[D].p(O,M):(y[D]=Lh(O),y[D].c(),y[D].m(o,u))}for(;D<y.length;D+=1)y[D].d(1);y.length=b.length}if(M[0]&4352){S=$[8];let D;for(D=0;D<S.length;D+=1){const O=bh($,S,D);C[D]?C[D].p(O,M):(C[D]=Fh(O),C[D].c(),C[D].m(o,null))}for(;D<C.length;D+=1)C[D].d(1);C.length=S.length}},i:re,o:re,d($){$&&k(e),d.d(),$&&k(t),$&&k(i),xt(m,$),v&&v.d(),xt(y,$),xt(C,$)}}}function jn(n,e){n=n||[];for(let t of n)if(t.id==e)return t;return null}function vn(n,e){return n===e?!1:JSON.stringify(n)!==JSON.stringify(e)}function qO(n,e,t){let i,s,l,{collectionA:o=new fn}=e,{collectionB:r=new fn}=e,{deleteMissing:a=!1}=e,u=[],f=[],c=[],d=[],h=[];const m=Object.keys(new fn().export()).filter(y=>!["schema","created","updated"].includes(y));function v(){t(4,f=Array.isArray(r==null?void 0:r.schema)?r==null?void 0:r.schema.concat():[]),a||t(4,f=f.concat(u.filter(y=>!f.find(S=>y.id==S.id))))}function b(y){return typeof y>"u"?"":U.isObject(y)?JSON.stringify(y,null,4):y}return n.$$set=y=>{"collectionA"in y&&t(0,o=y.collectionA),"collectionB"in y&&t(1,r=y.collectionB),"deleteMissing"in y&&t(2,a=y.deleteMissing)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(5,i=!(r!=null&&r.id)&&!(r!=null&&r.name)),n.$$.dirty[0]&33&&t(10,s=!i&&!(o!=null&&o.id)),n.$$.dirty[0]&1&&t(3,u=Array.isArray(o==null?void 0:o.schema)?o==null?void 0:o.schema.concat():[]),n.$$.dirty[0]&7&&(typeof(o==null?void 0:o.schema)<"u"||typeof(r==null?void 0:r.schema)<"u"||typeof a<"u")&&v(),n.$$.dirty[0]&24&&t(6,c=u.filter(y=>!f.find(S=>y.id==S.id))),n.$$.dirty[0]&24&&t(7,d=f.filter(y=>u.find(S=>S.id==y.id))),n.$$.dirty[0]&24&&t(8,h=f.filter(y=>!u.find(S=>S.id==y.id))),n.$$.dirty[0]&7&&t(9,l=U.hasCollectionChanges(o,r,a))},[o,r,a,u,f,i,c,d,h,l,s,m,b]}class VO extends Ee{constructor(e){super(),Oe(this,e,qO,jO,De,{collectionA:0,collectionB:1,deleteMissing:2},null,[-1,-1])}}function Nh(n,e,t){const i=n.slice();return i[17]=e[t],i}function Rh(n){let e,t;return e=new VO({props:{collectionA:n[17].old,collectionB:n[17].new,deleteMissing:n[3]}}),{c(){V(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||(E(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){q(e,i)}}}function zO(n){let e,t,i=n[2],s=[];for(let o=0;o<i.length;o+=1)s[o]=Rh(Nh(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=Je()},m(o,r){for(let a=0;a<s.length;a+=1)s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&12){i=o[2];let a;for(a=0;a<i.length;a+=1){const u=Nh(o,i,a);s[a]?(s[a].p(u,r),E(s[a],1)):(s[a]=Rh(u),s[a].c(),E(s[a],1),s[a].m(e.parentNode,e))}for(Pe(),a=i.length;a<s.length;a+=1)l(a);Le()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)E(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){xt(s,o),o&&k(e)}}}function BO(n){let e;return{c(){e=_("h4"),e.textContent="Side-by-side diff",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:re,d(t){t&&k(e)}}}function UO(n){let e,t,i,s,l,o,r;return{c(){e=_("button"),t=F("Close"),i=T(),s=_("button"),l=_("span"),l.textContent="Confirm and import",p(e,"type","button"),p(e,"class","btn btn-secondary"),e.disabled=
2022-08-11 01:37:41 +08:00
- ${$.join(`
- `)}`,()=>{m()}):m()}async function m(){if(!u){t(4,u=!0);try{await be.collections.import(o,a),cn("Successfully imported collections configuration."),i("submit")}catch($){be.errorResponseHandler($)}t(4,u=!1),c()}}const v=()=>h(),b=()=>!u;function y($){he[$?"unshift":"push"](()=>{s=$,t(1,s)})}function S($){ut.call(this,n,$)}function C($){ut.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,v,b,y,S,C]}class KO extends Ee{constructor(e){super(),Oe(this,e,YO,WO,De,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function Hh(n,e,t){const i=n.slice();return i[32]=e[t],i}function jh(n,e,t){const i=n.slice();return i[35]=e[t],i}function qh(n,e,t){const i=n.slice();return i[32]=e[t],i}function ZO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,m,v,b,y,S,C,$,M,D,O;a=new Ne({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[GO,({uniqueId:K})=>({40:K}),({uniqueId:K})=>[0,K?512:0]]},$$scope:{ctx:n}}});let A=!1,I=n[6]&&n[1].length&&!n[7]&&zh(),L=n[6]&&n[1].length&&n[7]&&Bh(n),R=n[13].length&&em(n),B=!!n[0]&&tm(n);return{c(){e=_("input"),t=T(),i=_("div"),s=_("p"),l=F(`Paste below the collections configuration you want to import or
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=T(),V(a.$$.fragment),u=T(),f=T(),I&&I.c(),c=T(),L&&L.c(),d=T(),R&&R.c(),h=T(),m=_("div"),B&&B.c(),v=T(),b=_("div"),y=T(),S=_("button"),C=_("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ie(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(b,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=$=!n[14],p(m,"class","flex m-t-base")},m(K,J){w(K,e,J),n[19](e),w(K,t,J),w(K,i,J),g(i,s),g(s,l),g(s,o),w(K,r,J),j(a,K,J),w(K,u,J),w(K,f,J),I&&I.m(K,J),w(K,c,J),L&&L.m(K,J),w(K,d,J),R&&R.m(K,J),w(K,h,J),w(K,m,J),B&&B.m(m,null),g(m,v),g(m,b),g(m,y),g(m,S),g(S,C),M=!0,D||(O=[G(e,"change",n[20]),G(o,"click",n[21]),G(S,"click",n[26])],D=!0)},p(K,J){J[0]&4096&&ie(o,"btn-loading",K[12]);const H={};J[0]&64&&(H.class="form-field "+(K[6]?"":"field-error")),J[0]&65|J[1]&1536&&(H.$$scope={dirty:J,ctx:K}),a.$set(H),K[6]&&K[1].length&&!K[7]?I||(I=zh(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),K[6]&&K[1].length&&K[7]?L?L.p(K,J):(L=Bh(K),L.c(),L.m(d.parentNode,d)):L&&(L.d(1),L=null),K[13].length?R?R.p(K,J):(R=em(K),R.c(),R.m(h.parentNode,h)):R&&(R.d(1),R=null),K[0]?B?B.p(K,J):(B=tm(K),B.c(),B.m(m,v)):B&&(B.d(1),B=null),(!M||J[0]&16384&&$!==($=!K[14]))&&(S.disabled=$)},i(K){M||(E(a.$$.fragment,K),E(A),M=!0)},o(K){P(a.$$.fragment,K),P(A),M=!1},d(K){K&&k(e),n[19](null),K&&k(t),K&&k(i),K&&k(r),q(a,K),K&&k(u),K&&k(f),I&&I.d(K),K&&k(c),L&&L.d(K),K&&k(d),R&&R.d(K),K&&k(h),K&&k(m),B&&B.d(),D=!1,Qe(O)}}}function JO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:re,i:re,o:re,d(t){t&&k(e)}}}function Vh(n){let e;return{c(){e=_("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function GO(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Vh();return{c(){e=_("label"),t=F("Collections"),s=T(),l=_("textarea"),r=T(),c&&c.c(),a=Je(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),g(e,t),w(d,s,h),w(d,l,h),Me(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=G(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&Me(l,d[0]),!!d[0]&&!d[6]?c||(c=Vh(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&k(e),d&&k(s),d&&k(l),d&&k(r),c&&c.d(d),d&&k(a),u=!1,f()}}}function zh(n){let e;return{c(){e=_("div"),e.innerHTML=`<div class="icon"><i class="ri-information-line"></i></div>
<div class="content"><string>Your collections configuration is already up-to-date!</string></div>`,p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Bh(n){let e,t,i,s,l,o=n[9].length&&Uh(n),r=n[4].length&&Kh(n),a=n[8].length&&Xh(n);return{c(){e=_("h5"),e.textContent="Detected changes",t=T(),i=_("div"),o&&o.c(),s=T(),r&&r.c(),l=T(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),g(i,s),r&&r.m(i,null),g(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Uh(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Kh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Xh(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&k(e),u&&k(t),u&&k(i),o&&o.d(),r&&r.d(),a&&a.d()}}}function Uh(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=qh(n,s,o),a=l(r);t.set(a,e[o]=Yh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Je()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=o[9],e=bt(e,r,l,1,o,s,t,i.parentNode,Mn,Yh,i,qh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Wh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Yh(n,e){let t,i,s,l,o=e[32].name+"",r,a,u,f=e[32].id&&Wh(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=T(),l=_("strong"),r=F(o),a=T(),f&&f.c(),u=T(),p(i,"class","label label-danger list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(c,d){w(c,t,d),g(t,i),g(t,s),g(t,l),g(l,r),g(t,a),f&&f.m(t,null),g(t,u)},p(c,d){e=c,d[0]&512&&o!==(o=e[32].name+"")&&ue(r,o),e[32].id?f?f.p(e,d):(f=Wh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Kh(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=jh(n,s,o),a=l(r);t.set(a,e[o]=Gh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Je()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&16&&(s=o[4],e=bt(e,r,l,1,o,s,t,i.parentNode,Mn,Gh,i,jh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Zh(n){let e,t=n[35].old.name+"",i,s,l;return{c(){e=_("strong"),i=F(t),s=T(),l=_("i"),p(e,"class","txt-strikethrough txt-hint"),p(l,"class","ri-arrow-right-line txt-sm")},m(o,r){w(o,e,r),g(e,i),w(o,s,r),w(o,l,r)},p(o,r){r[0]&16&&t!==(t=o[35].old.name+"")&&ue(i,t)},d(o){o&&k(e),o&&k(s),o&&k(l)}}}function Jh(n){let e,t,i=n[35].new.id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(e,l)},p(o,r){r[0]&16&&i!==(i=o[35].new.id+"")&&ue(s,i)},d(o){o&&k(e)}}}function Gh(n,e){let t,i,s,l,o,r,a=e[35].new.name+"",u,f,c,d=e[35].old.name!==e[35].new.name&&Zh(e),h=e[35].new.id&&Jh(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Changed",s=T(),l=_("div"),d&&d.c(),o=T(),r=_("strong"),u=F(a),f=T(),h&&h.c(),c=T(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(l,"class","inline-flex flex-gap-5"),p(t,"class","list-item"),this.first=t},m(m,v){w(m,t,v),g(t,i),g(t,s),g(t,l),d&&d.m(l,null),g(l,o),g(l,r),g(r,u),g(l,f),h&&h.m(l,null),g(t,c)},p(m,v){e=m,e[35].old.name!==e[35].new.name?d?d.p(e,v):(d=Zh(e),d.c(),d.m(l,o)):d&&(d.d(1),d=null),v[0]&16&&a!==(a=e[35].new.name+"")&&ue(u,a),e[35].new.id?h?h.p(e,v):(h=Jh(e),h.c(),h.m(l,null)):h&&(h.d(1),h=null)},d(m){m&&k(t),d&&d.d(),h&&h.d()}}}function Xh(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=Hh(n,s,o),a=l(r);t.set(a,e[o]=xh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Je()},m(o,r){for(let a=0;a<e.length;a+=1)e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&256&&(s=o[8],e=bt(e,r,l,1,o,s,t,i.parentNode,Mn,xh,i,Hh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Qh(n){let e,t,i=n[32].id+"",s,l;return{c(){e=_("small"),t=F("("),s=F(i),l=F(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),g(e,t),g(e,s),g(
2022-08-11 01:37:41 +08:00
imported with different IDs. You can replace them in the import if you want
to.</string>`,l=T(),o=_("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),g(e,t),g(e,i),g(e,s),g(e,l),g(e,o),r||(a=G(o,"click",n[24]),r=!0)},p:re,d(u){u&&k(e),r=!1,a()}}}function tm(n){let e,t,i;return{c(){e=_("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-secondary link-hint")},m(s,l){w(s,e,l),t||(i=G(e,"click",n[25]),t=!0)},p:re,d(s){s&&k(e),t=!1,i()}}}function XO(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[JO,ZO],m=[];function v(b,y){return b[5]?0:1}return f=v(n),c=m[f]=h[f](n),{c(){e=_("header"),t=_("nav"),i=_("div"),i.textContent="Settings",s=T(),l=_("div"),o=F(n[15]),r=T(),a=_("div"),u=_("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(b,y){w(b,e,y),g(e,t),g(t,i),g(t,s),g(t,l),g(l,o),w(b,r,y),w(b,a,y),g(a,u),m[f].m(u,null),d=!0},p(b,y){(!d||y[0]&32768)&&ue(o,b[15]);let S=f;f=v(b),f===S?m[f].p(b,y):(Pe(),P(m[S],1,1,()=>{m[S]=null}),Le(),c=m[f],c?c.p(b,y):(c=m[f]=h[f](b),c.c()),E(c,1),c.m(u,null))},i(b){d||(E(c),d=!0)},o(b){P(c),d=!1},d(b){b&&k(e),b&&k(r),b&&k(a),m[f].d()}}}function QO(n){let e,t,i,s,l,o;e=new Vi({}),i=new Dn({props:{$$slots:{default:[XO]},$$scope:{ctx:n}}});let r={};return l=new KO({props:r}),n[27](l),l.$on("submit",n[28]),{c(){V(e.$$.fragment),t=T(),V(i.$$.fragment),s=T(),V(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(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 c={};l.$set(c)},i(a){o||(E(e.$$.fragment,a),E(i.$$.fragment,a),E(l.$$.fragment,a),o=!0)},o(a){P(e.$$.fragment,a),P(i.$$.fragment,a),P(l.$$.fragment,a),o=!1},d(a){q(e,a),a&&k(t),q(i,a),a&&k(s),n[27](null),q(l,a)}}}function xO(n,e,t){let i,s,l,o,r,a,u;kt(n,Rt,x=>t(15,u=x)),dn(Rt,u="Import collections",u);let f,c,d="",h=!1,m=[],v=[],b=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,v=await be.collections.getFullList(200));for(let x of v)delete x.created,delete x.updated}catch(x){be.errorResponseHandler(x)}t(5,S=!1)}function $(){if(t(4,y=[]),!!i)for(let x of m){const oe=U.findByKey(v,"id",x.id);!(oe!=null&&oe.id)||!U.hasCollectionChanges(oe,x,b)||y.push({new:x,old:oe})}}function M(){t(1,m=[]);try{t(1,m=JSON.parse(d))}catch{}Array.isArray(m)?t(1,m=U.filterDuplicatesByKey(m)):t(1,m=[]);for(let x of m)delete x.created,delete x.updated,x.schema=U.filterDuplicatesByKey(x.schema)}function D(){var x,oe;for(let me of m){const se=U.findByKey(v,"name",me.name)||U.findByKey(v,"id",me.id);if(!se)continue;const ge=me.id,ke=se.id;me.id=ke;const Y=Array.isArray(se.schema)?se.schema:[],ve=Array.isArray(me.schema)?me.schema:[];for(const ee of ve){const Q=U.findByKey(Y,"name",ee.name);Q&&Q.id&&(ee.id=Q.id)}for(let ee of m)if(!!Array.isArray(ee.schema))for(let Q of ee.schema)((x=Q.options)==null?void 0:x.collectionId)&&((oe=Q.options)==null?void 0:oe.collectionId)===ge&&(Q.options.collectionId=ke)}t(0,d=JSON.stringify(m,null,4))}function O(x){t(12,h=!0);const oe=new FileReader;oe.onload=async me=>{t(12,h=!1),t(10,f.value="",f),t(0,d=me.target.result),await ni(),m.length||(go("Invalid collections configuration."),A())},oe.onerror=me=>{console.warn(me),go("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},oe.readAsText(x)}function A(){t(0,d=""),t(10,f.value="",f),Si({})}function I(x){he[x?"unshift":"push"](()=>{f=x,t(10,f)})}const L=()=>{f.files.length&&O(f.files[0])},R=()=>{f.click()};function B(){d=this.value,t(0,d)}function K(){b=this.checked,t(3,b)}const J=()=>D(),H=()=>A(),X=()=>c==null?void 0:c.show(v,m,b);function W(x){he[x?"unshift":"push"](()=>{c=x,t(11,c)})}const te=()=>A();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&m.length&&m.length===m.filter(x=>!!x.id&&!!x.name).length),n.$$.dirty[0]&78&&t(9,s=v.filter(x=>i&&b&&!U.findBy
2022-08-11 01:37:41 +08:00
<span class="txt">Manage admins</span>`,t=T(),i=_("hr"),s=T(),l=_("div"),l.innerHTML=`<i class="ri-logout-circle-line"></i>
<span class="txt">Logout</span>`,p(e,"href","/settings/admins"),p(e,"class","dropdown-item closable"),p(l,"tabindex","0"),p(l,"class","dropdown-item closable")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),w(a,s,u),w(a,l,u),o||(r=[Ye(hn.call(null,e)),G(l,"click",n[6])],o=!0)},p:re,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Qe(r)}}}function gE(n){var h;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=U.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((h=n[0])==null?void 0:h.id)&&n[1]&&sm(n);return o=new i0({props:{routes:tE}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new uE({}),f=new hE({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),V(o.$$.fragment),r=T(),V(a.$$.fragment),u=T(),V(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(m,v){w(m,t,v),w(m,i,v),d&&d.m(i,null),g(i,s),g(i,l),j(o,l,null),g(l,r),j(a,l,null),w(m,u,v),j(f,m,v),c=!0},p(m,[v]){var b;(!c||v&12)&&e!==(e=U.joinNonEmpty([m[3],m[2],"PocketBase"]," - "))&&(document.title=e),((b=m[0])==null?void 0:b.id)&&m[1]?d?(d.p(m,v),v&3&&E(d,1)):(d=sm(m),d.c(),E(d,1),d.m(i,s)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le())},i(m){c||(E(d),E(o.$$.fragment,m),E(a.$$.fragment,m),E(f.$$.fragment,m),c=!0)},o(m){P(d),P(o.$$.fragment,m),P(a.$$.fragment,m),P(f.$$.fragment,m),c=!1},d(m){m&&k(t),m&&k(i),d&&d.d(),q(o),q(a),m&&k(u),q(f,m)}}}function _E(n,e,t){let i,s,l;kt(n,bo,d=>t(2,i=d)),kt(n,ya,d=>t(0,s=d)),kt(n,Rt,d=>t(3,l=d));let o,r=!1;function a(d){var h,m,v,b;((h=d==null?void 0:d.detail)==null?void 0:h.location)!==o&&(t(1,r=!!((v=(m=d==null?void 0:d.detail)==null?void 0:m.userData)!=null&&v.showAppSidebar)),o=(b=d==null?void 0:d.detail)==null?void 0:b.location,dn(Rt,l="",l),Si({}),O_())}function u(){$i("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const h=await be.settings.getAll({$cancelKey:"loadAppName"});dn(bo,i=((d=h==null?void 0:h.meta)==null?void 0:d.appName)||"",i)}catch(h){console.warn("Failed to load app name.",h)}}function c(){be.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class bE extends Ee{constructor(e){super(),Oe(this,e,_E,gE,De,{})}}new bE({target:document.getElementById("app")});export{Qe as A,cn as B,U as C,$i as D,Je as E,Dg as F,kt as G,Ds as H,on as I,fn as J,Zn as K,he as L,Ee as S,P as a,T as b,V as c,q as d,_ as e,p as f,w as g,g as h,Oe as i,Ye as j,Pe as k,hn as l,j as m,Le as n,k as o,be as p,Ne as q,ie as r,De as s,E as t,G as u,Yt as v,F as w,ue as x,re as y,Me as z};