632 lines
796 KiB
JavaScript
632 lines
796 KiB
JavaScript
|
const __=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 le(){}const pl=n=>n;function ct(n,e){for(const t in e)n[t]=e[t];return n}function jh(n){return n()}function Ka(){return Object.create(null)}function Je(n){n.forEach(jh)}function Bn(n){return typeof n=="function"}function De(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let El;function Jn(n,e){return El||(El=document.createElement("a")),El.href=e,n===El.href}function b_(n){return Object.keys(n).length===0}function qh(n,...e){if(n==null)return le;const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function yt(n,e,t){n.$$.on_destroy.push(qh(e,t))}function Cn(n,e,t,i){if(n){const s=Vh(n,e,t,i);return n[0](s)}}function Vh(n,e,t,i){return n[1]&&i?ct(t.ctx.slice(),n[1](i(e))):t.ctx}function Mn(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 Tn(n,e,t,i,s,l){if(s){const o=Vh(e,t,i,l);n.p(o,s)}}function Dn(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 ai(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 Za(n){return n==null?"":n}function fn(n,e,t){return n.set(t),e}function Ue(n){return n&&Bn(n.destroy)?n.destroy:le}const zh=typeof window<"u";let Ao=zh?()=>window.performance.now():()=>Date.now(),sa=zh?n=>requestAnimationFrame(n):le;const ms=new Set;function Bh(n){ms.forEach(e=>{e.c(n)||(ms.delete(e),e.f())}),ms.size!==0&&sa(Bh)}function Po(n){let e;return ms.size===0&&sa(Bh),{promise:new Promise(t=>{ms.add(e={c:n,f:t})}),abort(){ms.delete(e)}}}function h(n,e){n.appendChild(e)}function Uh(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function v_(n){const e=_("style");return y_(Uh(n),e),e.sheet}function y_(n,e){h(n.head||n,e)}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode.removeChild(n)}function Gn(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function _(n){return document.createElement(n)}function N(n){return document.createTextNode(n)}function T(){return N(" ")}function xe(){return N("")}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 Xn(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function Wh(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 ri(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value=n[i]=e[i]:t[i]&&t[i].set?n[i]=e[i]:p(n,i,e[i])}function At(n){return n===""?null:+n}function k_(n){return Array.from(n.childNodes)}function he(n,e){e=""+e,n.wholeText!==e&&(n.data=e)}function Ce(n,e){n.value=e==null?"":e}function Ja(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 Yh(n,e,{bubbles:t=!1,cancelable:i=!1}={}){const s=document.createEvent("CustomEvent");return s.ini
|
||
|
`;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_${w_(f)}_${r}`,d=Uh(n),{stylesheet:m,rules:g}=oo.get(d)||S_(d,n);g[c]||(g[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const v=n.style.animation||"";return n.style.animation=`${v?`${v}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ro+=1,c}function sl(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(", "),ro-=s,ro||$_())}function $_(){sa(()=>{ro||(oo.forEach(n=>{const{stylesheet:e}=n;let t=e.cssRules.length;for(;t--;)e.deleteRule(t);n.rules={}}),oo.clear())})}function C_(n,e,t,i){if(!e)return le;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return le;const{delay:l=0,duration:o=300,easing:r=pl,start:a=Ao()+l,end:u=a+o,tick:f=le,css:c}=t(n,{from:e,to:s},i);let d=!0,m=!1,g;function v(){c&&(g=il(n,0,1,o,l,r,c)),l||(m=!0)}function b(){c&&sl(n,g),d=!1}return Po(y=>{if(!m&&y>=a&&(m=!0),m&&y>=u&&(f(1,0),b()),!d)return!1;if(m){const $=y-a,S=0+1*r($/o);f(S,1-S)}return!0}),v(),f(0,1),b}function M_(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,Kh(n,s)}}function Kh(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 ll;function Zs(n){ll=n}function Lo(){if(!ll)throw new Error("Function called outside component initialization");return ll}function Un(n){Lo().$$.on_mount.push(n)}function T_(n){Lo().$$.after_update.push(n)}function D_(n){Lo().$$.on_destroy.push(n)}function ln(){const n=Lo();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=Yh(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function at(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Bs=[],ge=[],eo=[],Mr=[],Zh=Promise.resolve();let Tr=!1;function Jh(){Tr||(Tr=!0,Zh.then(Gh))}function xn(){return Jh(),Zh}function Ot(n){eo.push(n)}function He(n){Mr.push(n)}const Go=new Set;let Al=0;function Gh(){const n=ll;do{for(;Al<Bs.length;){const e=Bs[Al];Al++,Zs(e),O_(e.$$)}for(Zs(null),Bs.length=0,Al=0;ge.length;)ge.pop()();for(let e=0;e<eo.length;e+=1){const t=eo[e];Go.has(t)||(Go.add(t),t())}eo.length=0}while(Bs.length);for(;Mr.length;)Mr.pop()();Tr=!1,Go.clear(),Zs(n)}function O_(n){if(n.fragment!==null){n.update(),Je(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ot)}}let As;function la(){return As||(As=Promise.resolve(),As.then(()=>{As=null})),As}function Xi(n,e,t){n.dispatchEvent(Yh(`${e?"intro":"outro"}${t}`))}const to=new Set;let ii;function Pe(){ii={r:0,c:[],p:ii}}function Le(){ii.r||Je(ii.c),ii=ii.p}function A(n,e){n&&n.i&&(to.delete(n),n.i(e))}function P(n,e,t,i){if(n&&n.o){if(to.has(n))return;to.add(n),ii.c.push(()=>{to.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const oa={duration:0};function Xh(n,e,t){let i=e(n,t),s=!1,l,o,r=0;function a(){l&&sl(n,l)}function u(){const{delay:c=0,duration:d=300,easing:m=pl,tick:g=le,css:v}=i||oa;v&&(l=il(n,0,1,d,c,m,v,r++)),g(0,1);const b=Ao()+c,y=b+d;o&&o.abort(),s=!0,Ot(()=>Xi(n,!0,"start")),o=Po($=>{if(s){if($>=y)return g(1,0),Xi(n,!0,"end"),a(),s=!1;if($>=b){const S=m(($-b)/d);g(S,1-S)}}return s})}let f=!1;return{start(){f||(f=!0,sl(n),Bn(i)?(i=i(),la().then(u)):u())},invalidate(){f=!1},end(){s&&(a(),s=!1)}}}function Qh(n,e,t){let i=e(n,t),s=!0,l;const o=ii;o.r+=1;function r(){const{delay:a=0,duration:u=300,easing:f=pl,tick:c=le,css:d}=i||oa;d&&(l=il(n,1,0,u,a,f,d));const m=Ao()+a,g=m+u;Ot(()=>Xi(n,!1,"start")),Po(v=>{if(s){if(v>=g)return c(0,1),Xi(n,!1,"end"),--o.r||Je(o.c),!1;if(v>=m){const b=f((v-m)/u);c(1-b,b)}}return s})}return Bn(i)?la().then(()=>{i=i(),r()}):r(),{end(a){a&&i.tick&&i.tick(1,0),s&&(l&&sl(n,l),s=!1)}}}function ot(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 X0(n){let e,t,i,s,l,o,r,a,u=!n[0]&&Mu();const f=n[2].default,c=Cn(f,n,n[1],null);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),u&&u.c(),l=T(),c&&c.c(),o=T(),r=_("div"),p(t,"class","flex-fill"),p(s,"class","wrapper wrapper-sm m-b-xl svelte-1wbawr2"),p(r,"class","flex-fill"),p(e,"class","page-wrapper full-page-panel svelte-1wbawr2")},m(d,m){w(d,e,m),h(e,t),h(e,i),h(e,s),u&&u.m(s,null),h(s,l),c&&c.m(s,null),h(e,o),h(e,r),a=!0},p(d,[m]){d[0]?u&&(u.d(1),u=null):u||(u=Mu(),u.c(),u.m(s,l)),c&&c.p&&(!a||m&2)&&Tn(c,f,d,d[1],a?Mn(f,d[1],m,null):Dn(d[1]),null)},i(d){a||(A(c,d),a=!0)},o(d){P(c,d),a=!1},d(d){d&&k(e),u&&u.d(),c&&c.d(d)}}}function Q0(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(1,s=o.$$scope)},[l,s,i]}class ag extends Ee{constructor(e){super(),Oe(this,e,Q0,X0,De,{nobranding:0})}}function Tu(n,e,t){const i=n.slice();return i[11]=e[t],i}const x0=n=>({}),Du=n=>({uniqueId:n[3]});function e1(n){let e=(n[11]||mo)+"",t;return{c(){t=N(e)},m(i,s){w(i,t,s)},p(i,s){s&4&&e!==(e=(i[11]||mo)+"")&&he(t,e)},d(i){i&&k(t)}}}function t1(n){var i,s;let e=(((i=n[11])==null?void 0:i.message)||((s=n[11])==null?void 0:s.code)||mo)+"",t;return{c(){t=N(e)},m(l,o){w(l,t,o)},p(l,o){var r,a;o&4&&e!==(e=(((r=l[11])==null?void 0:r.message)||((a=l[11])==null?void 0:a.code)||mo)+"")&&he(t,e)},d(l){l&&k(t)}}}function Ou(n){let e,t;function i(o,r){return typeof o[11]=="object"?t1:e1}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),h(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 n1(n){let e,t,i,s,l;const o=n[7].default,r=Cn(o,n,n[6],Du);let a=n[2],u=[];for(let f=0;f<a.length;f+=1)u[f]=Ou(Tu(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),h(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)&&Tn(r,o,f,f[6],i?Mn(o,f[6],c,x0):Dn(f[6]),Du),c&4){a=f[2];let d;for(d=0;d<a.length;d+=1){const m=Tu(f,a,d);u[d]?u[d].p(m,c):(u[d]=Ou(m),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||(A(r,f),i=!0)},o(f){P(r,f),i=!1},d(f){f&&k(e),r&&r.d(f),Gn(u,f),n[9](null),s=!1,l()}}}const mo="Invalid value";function i1(n,e,t){let i;yt(n,ls,g=>t(5,i=g));let{$$slots:s={},$$scope:l}=e;const o="field_"+W.randomString(7);let{name:r=""}=e,{class:a=void 0}=e,u,f=[];function c(){rg(r)}Un(()=>(u.addEventListener("input",c),u.addEventListener("change",c),()=>{u.removeEventListener("input",c),u.removeEventListener("change",c)}));function d(g){at.call(this,n,g)}function m(g){ge[g?"unshift":"push"](()=>{u=g,t(1,u)})}return n.$$set=g=>{"name"in g&&t(4,r=g.name),"class"in g&&t(0,a=g.class),"$$scope"in g&&t(6,l=g.$$scope)},n.$$.update=()=>{n.$$.dirty&48&&t(2,f=W.toArray(W.getNestedVal(i,r)))},[a,u,f,o,r,i,l,s,d,m]}class Ie extends Ee{constructor(e){super(),Oe(this,e,i1,n1,De,{name:4,class:0})}}function s1(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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]&&Ce(l,u[0])},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function l1(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("Password"),s=T(),l=_("input"),r=T(),a=_("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10
|
||
|
<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(g,v){w(g,e,v),h(e,t),h(e,i),V(s,e,null),h(e,l),V(o,e,null),h(e,r),V(a,e,null),h(e,u),h(e,f),c=!0,d||(m=G(e,"submit",Yt(n[4])),d=!0)},p(g,[v]){const b={};v&1537&&(b.$$scope={dirty:v,ctx:g}),s.$set(b);const y={};v&1538&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&1540&&($.$$scope={dirty:v,ctx:g}),a.$set($),v&8&&ie(f,"btn-disabled",g[3]),v&8&&ie(f,"btn-loading",g[3])},i(g){c||(A(s.$$.fragment,g),A(o.$$.fragment,g),A(a.$$.fragment,g),c=!0)},o(g){P(s.$$.fragment,g),P(o.$$.fragment,g),P(a.$$.fragment,g),c=!1},d(g){g&&k(e),z(s),z(o),z(a),d=!1,m()}}}function a1(n,e,t){const i=ln();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 u1 extends Ee{constructor(e){super(),Oe(this,e,a1,r1,De,{})}}function Eu(n){let e,t;return e=new ag({props:{$$slots:{default:[f1]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s&9&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function f1(n){let e,t;return e=new u1({}),e.$on("submit",n[1]),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p:le,i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function c1(n){let e,t,i=n[0]&&Eu(n);return{c(){i&&i.c(),e=xe()},m(s,l){i&&i.m(s,l),w(s,e,l),t=!0},p(s,[l]){s[0]?i?(i.p(s,l),l&1&&A(i,1)):(i=Eu(s),i.c(),A(i,1),i.m(e.parentNode,e)):i&&(Pe(),P(i,1,1,()=>{i=null}),Le())},i(s){t||(A(i),t=!0)},o(s){P(i),t=!1},d(s){i&&i.d(s),s&&k(e)}}}function d1(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?yi("/collections"):be.logout()}return[i,async()=>{t(0,i=!1),await xn(),window.location.search=""}]}class p1 extends Ee{constructor(e){super(),Oe(this,e,d1,c1,De,{})}}const Rt=ei(""),go=ei("");function qo(n){const e=n-1;return e*e*e+1}function _o(n,{delay:e=0,duration:t=400,easing:i=pl}={}){const s=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:l=>`opacity: ${l*s}`}}function jn(n,{delay:e=0,duration:t=400,easing:i=qo,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)=>`
|
||
|
transform: ${u} translate(${(1-c)*s}px, ${(1-c)*l}px);
|
||
|
opacity: ${a-f*d}`}}function en(n,{delay:e=0,duration:t=400,easing:i=qo}={}){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:m=>`overflow: hidden;opacity: ${Math.min(m*20,1)*l};height: ${m*o}px;padding-top: ${m*r}px;padding-bottom: ${m*a}px;margin-top: ${m*u}px;margin-bottom: ${m*f}px;border-top-width: ${m*c}px;border-bottom-width: ${m*d}px;`}}function qn(n,{delay:e=0,duration:t=400,easing:i=qo,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 h1(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),Ce(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]&&Ce(e,l[7])},i:le,o:le,d(l){l&&k(e),n[13](null),i=!1,s()}}}function m1(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)),ge.push(()=>Ne(e,"value",l)),e.$on("submit",n[10])),{c(){e&&B(e.$$.fragment),i=xe()},m(a,u){e&&V(e,a,u),w(a,i,u),s=!0},p(a,u){const f={};if(u&8&&(f.extraAutocompleteKeys=a[3]),u&4&&(f.baseCollection=a[2]),u&3&&(f.placeholder=a[0]||a[1]),!t&&u&128&&(t=!0,f.value=a[7],He(()=>t=!1)),o!==(o=a[4])){if(e){Pe();const c=e;P(c.$$.fragment,1,0,()=>{z(c,1)}),Le()}o?(e=new o(r(a)),ge.push(()=>Ne(e,"value",l)),e.$on("submit",a[10]),B(e.$$.fragment),A(e.$$.fragment,1),V(e,i.parentNode,i)):e=null}else o&&e.$set(f)},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&P(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&z(e,a)}}}function Au(n){let e,t,i,s,l,o,r=n[7]!==n[0]&&Pu();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&&A(r,1):(r=Pu(),r.c(),A(r,1),r.m(e.parentNode,e)):r&&(Pe(),P(r,1,1,()=>{r=null}),Le())},i(a){s||(A(r),a&&Ot(()=>{i||(i=ot(t,jn,{duration:150,x:5},!0)),i.run(1)}),s=!0)},o(a){P(r),a&&(i||(i=ot(t,jn,{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 Pu(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&&Ot(()=>{t||(t=ot(e,jn,{duration:150,x:5},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=ot(e,jn,{duration:150,x:5},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function g1(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[m1,h1],m=[];function g(b,y){return b[4]&&!b[5]?0:1}o=g(n),r=m[o]=d[o](n);let v=(n[0].length||n[7].length)&&Au(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),h(e,t),h(t,i),h(i,s),h(t,l),m[o].m(t,null),h(t,a),v&&v.m(t,null),u=!0,f||(c=[G(t,"submit",Yt(n[10])),G(e,"click",Xn(n[11]))],f=!0)},p(b,[y]){let $=o;o=g(b),o===$?m[o].p(b,y):(Pe(),P(m[$],1,1,()=>{m[$]=null}),Le(),r=m[o],r?r.p(b,y):(r=m[o]=d[o](b),r.c()),A(r,1),r.m(t,a)),b[0].length||b[7].length?v?(v.p(b,y),y&129&&A(v,1)):(v=Au(b),v.c(),A(v,1),v.m(t,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){u||(A(r),A(v),u=!0)},o(b){P(r),P(v),u=!1},d(b){b&&k(e),m[o].d(),v&&v.d(),f=!1,Je(c)}}}function _1(n,e,t){const i=ln(),s="search_"+W.randomString(7);let{value:l=""}=e,{placeholder:o='Search filter, ex. created > "2022-01-01"...'}=e,{autocompleteCollection:r=new En}=e,{extraAutocompleteKeys:a=[]}=e,u,f=!1,c,d="";function m(M=!0){t(7,d=""),M&&(c==null||c.focus()),i("clear")}function g(){t(0,l=d),i("submit",l)}async function v(){u||f||(t(5,f=!0),t(4,u=(await Zi(()=>import("./FilterAutocompleteInput.92765a8b.js"),[],import.meta.url)).default),t(5,f=!1))}Un(()=>{v()});function b(M){at.call(this,n,M)}function y(M){d=M,t(7,d),t(0,l)}function $(M){ge[M?"unshift":"push"](()=>{c=M,t(6,c)})}function S(){d=this.value,t(7,d),t(0,l)}const C=()=>{m(!1),g()};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,m,g,b,y,$,S,C]}class Vo extends Ee{constructor(e){sup
|
||
|
<span class="txt">method</span>`,p(e,"class","col-header-content")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function D1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="url",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function O1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="referer",p(t,"class",W.getFieldTypeIcon("url")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function E1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="status",p(t,"class",W.getFieldTypeIcon("number")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function A1(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function Iu(n){let e;function t(l,o){return l[6]?L1:P1}let i=t(n),s=i(n);return{c(){s.c(),e=xe()},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 P1(n){var r;let e,t,i,s,l,o=((r=n[0])==null?void 0:r.length)&&Nu(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),h(e,t),h(t,i),h(t,s),o&&o.m(t,null),h(e,l)},p(a,u){var f;(f=a[0])!=null&&f.length?o?o.p(a,u):(o=Nu(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function L1(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:le,d(t){t&&k(e)}}}function Nu(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:le,d(s){s&&k(e),t=!1,i()}}}function Ru(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 Hu(n,e){var re,me,ve;let t,i,s,l=((re=e[21].method)==null?void 0:re.toUpperCase())+"",o,r,a,u,f,c=e[21].url+"",d,m,g,v,b,y,$=(e[21].referer||"N/A")+"",S,C,M,D,O,E=e[21].status+"",L,F,R,H,te,Q,j,X,U,Z,oe=(((me=e[21].meta)==null?void 0:me.errorMessage)||((ve=e[21].meta)==null?void 0:ve.errorData))&&Ru();H=new bi({props:{date:e[21].created}});function ae(){return e[16](e[21])}function Te(...Y){return e[17](e[21],...Y)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("span"),o=N(l),a=T(),u=_("td"),f=_("span"),d=N(c),g=T(),oe&&oe.c(),v=T(),b=_("td"),y=_("span"),S=N($),M=T(),D=_("td"),O=_("span"),L=N(E),F=T(),R=_("td"),B(H.$$.fragment),te=T(),Q=_("td"),Q.innerHTML='<i class="ri-arrow-right-line"></i>',j=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",m=e[21].url),p(u,"class","col-type-text col-field-url"),p(y,"class","txt txt-ellipsis"),p(y,"title",C=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(Q,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Y,Se){w(Y,t,Se),h(t,i),h(i,s),h(s,o),h(t,a),h(t,u),h(u,f),h(f,d),h(u,g),oe&&oe.m(u,null),h(t,v),h(t,b),h(b,y),h(y,S),h(t,M),h(t,D),h(D,O),h(O,L),h(t,F),h(t,R),V(H,R,null),h(t,te),h(t,Q),h(t,j),X=!0,U||(Z=[G(t,"click",ae),G(t,"keydown",Te)],U=!0)},p(Y,Se){var J,we,Re;e=Y,(!X||Se&8)&&l!==(l=((J=e[21].method)==null?void 0:J.toUpperCase())+"")&&he(o,l),(!X||Se&8&&r!==(r="label txt-uppercase "+e[9][e[21].method.toLowerCase()]))&&p(s,"class",r),(!X||Se&8)&&c!==(c=e[21].url+"")&&he(d,c),(!X||Se&8&&m!==(m=e[21].url))&&p(f,"title",m),((we=e[21].meta)==null?void 0:we.errorMessage)||((Re=e[21].meta)==null?void 0:Re.errorData)?oe||(oe=Ru(),oe.c(),oe.m(u,null)):oe&&(oe.d(1),oe=null),(!X||Se&8)&&$!==($=(e[21].referer||"N/A")+"")&&he(S,$),(!X||Se&8&&C!==(C=e[21].referer))&&p(y,"title",C),Se&8&&ie(y,"txt-hint",!e[21].referer),(!X||Se&8)&&E!==(E=e[21].status+"")&&he(L,E),Se&8&&ie(O,"label-danger",e[21].status>=400);const x={};Se&8&&(x.date=e[21].created),H.$set(x)},i(Y){X||(A(H.$$.fragment,Y),X=!0)},o(Y){P(H.$$.fragment,Y),X=!1},d(Y){Y&&k(t),oe&&oe.d(),z(H),U=!1,Je(Z)}}}function ju(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),h(e,t),h(e,s),h(e,l),h(e,o)},p(r,a){a&8&&i!==(i=r[3].length+"")&&he(s,i),a&16&&he(o,r[4])},d(r){r&&k(e)}}}function qu(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=N("Load more ("),o=N(l),r=N(")"),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),h(e,t),h(t,i),h(i,s),h(i,o),h(i,r),a||(u=G(t,"click",n[19]),a=!0)},p(f,c){c&24&&l!==(l=f[4]-f[3].length+"")&&he(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 F1(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S,C,M,D,O=[],E=new Map,L,F,R,H;function te(J){n[11](J)}let Q={disable:!0,class:"col-field-method",name:"method",$$slots:{default:[T1]},$$scope:{ctx:n}};n[1]!==void 0&&(Q.sort=n[1]),l=new nn({props:Q}),ge.push(()=>Ne(l,"sort",te));function j(J){n[12](J)}let X={disable:!0,class:"col-type-text col-field-url",name:"url",$$slots:{
|
||
|
* Chart.js v3.9.1
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/function di(){}const R1=function(){let n=0;return function(){return n++}}();function Tt(n){return n===null||typeof n>"u"}function It(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 ft(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Wt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Ln(n,e){return Wt(n)?n:e}function _t(n,e){return typeof n>"u"?e:n}const H1=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,fg=(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 Dt(n,e,t,i){let s,l,o;if(It(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(ft(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function bo(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 vo(n){if(It(n))return n.map(vo);if(ft(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=vo(n[t[s]]);return e}return n}function cg(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function j1(n,e,t,i){if(!cg(n))return;const s=e[n],l=t[n];ft(s)&&ft(l)?ol(s,l,i):e[n]=vo(l)}function ol(n,e,t){const i=It(e)?e:[e],s=i.length;if(!ft(n))return n;t=t||{};const l=t.merger||j1;for(let o=0;o<s;++o){if(e=i[o],!ft(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 Xs(n,e){return ol(n,e,{merger:q1})}function q1(n,e,t){if(!cg(n))return;const i=e[n],s=t[n];ft(i)&&ft(s)?Xs(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=vo(s))}const Vu={"":n=>n,x:n=>n.x,y:n=>n.y};function Li(n,e){return(Vu[e]||(Vu[e]=V1(e)))(n)}function V1(n){const e=z1(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function z1(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 ya(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Vn=n=>typeof n<"u",Fi=n=>typeof n=="function",zu=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function B1(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Ut=Math.PI,Et=2*Ut,U1=Et+Ut,yo=Number.POSITIVE_INFINITY,W1=Ut/180,Bt=Ut/2,Ns=Ut/4,Bu=Ut*2/3,Rn=Math.log10,li=Math.sign;function Uu(n){const e=Math.round(n);n=Qs(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Rn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Y1(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 ws(n){return!isNaN(parseFloat(n))&&isFinite(n)}function Qs(n,e,t){return Math.abs(n-e)<t}function K1(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function dg(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 Zn(n){return n*(Ut/180)}function ka(n){return n*(180/Ut)}function Wu(n){if(!Wt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function pg(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 zr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Z1(n,e){return(n-e+U1)%Et-Ut}function Sn(n){return(n%Et+Et)%Et}function rl(n,e,t,i){const s=Sn(n),l=Sn(e),o=Sn(t),r=Sn(l-s),a=Sn(o-s),u=Sn(s-l),f=Sn(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function an(n,e,t){return Math.max(e,Math.min(t,n))}function J1(n){return an(n,-32768,32767)}function al(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function wa(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,s=0,l;for(;i-s>1;)l=s+i>>1,t(l)?s=l:i=l;return{lo:s,hi:i}}const Gi=(n,e,t,i)=>wa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),G1=(n,e,t)=>wa(n,t,i=>n[i][e]>=t);function X1(n,e,
|
||
|
* @kurkle/color v0.2.1
|
||
|
* https://github.com/kurkle/color#readme
|
||
|
* (c) 2022 Jukka Kurkela
|
||
|
* Released under the MIT License
|
||
|
*/function vl(n){return n+.5|0}const Oi=(n,e,t)=>Math.max(Math.min(n,t),e);function Ys(n){return Oi(vl(n*2.55),0,255)}function Pi(n){return Oi(vl(n*255),0,255)}function mi(n){return Oi(vl(n/2.55)/100,0,1)}function Gu(n){return Oi(vl(n*100),0,100)}const Pn={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},Br=[..."0123456789ABCDEF"],tv=n=>Br[n&15],nv=n=>Br[(n&240)>>4]+Br[n&15],Hl=n=>(n&240)>>4===(n&15),iv=n=>Hl(n.r)&&Hl(n.g)&&Hl(n.b)&&Hl(n.a);function sv(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&Pn[n[1]]*17,g:255&Pn[n[2]]*17,b:255&Pn[n[3]]*17,a:e===5?Pn[n[4]]*17:255}:(e===7||e===9)&&(t={r:Pn[n[1]]<<4|Pn[n[2]],g:Pn[n[3]]<<4|Pn[n[4]],b:Pn[n[5]]<<4|Pn[n[6]],a:e===9?Pn[n[7]]<<4|Pn[n[8]]:255})),t}const lv=(n,e)=>n<255?e(n):"";function ov(n){var e=iv(n)?tv:nv;return n?"#"+e(n.r)+e(n.g)+e(n.b)+lv(n.a,e):void 0}const rv=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function yg(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 av(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 uv(n,e,t){const i=yg(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 fv(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=fv(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function $a(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Pi)}function Ca(n,e,t){return $a(yg,n,e,t)}function cv(n,e,t){return $a(uv,n,e,t)}function dv(n,e,t){return $a(av,n,e,t)}function kg(n){return(n%360+360)%360}function pv(n){const e=rv.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Ys(+e[5]):Pi(+e[5]));const s=kg(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=cv(s,l,o):e[1]==="hsv"?i=dv(s,l,o):i=Ca(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function hv(n,e){var t=Sa(n);t[0]=kg(t[0]+e),t=Ca(t),n.r=t[0],n.g=t[1],n.b=t[2]}function mv(n){if(!n)return;const e=Sa(n),t=e[0],i=Gu(e[1]),s=Gu(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${mi(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"},Qu={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
|
||
|
* Chart.js v3.9.1
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 Chart.js Contributors
|
||
|
* Released under the MIT License
|
||
|
*/class by{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,s){const l=t.listeners[s],o=t.duration;l.forEach(r=>r({chart:e,initial:t.initial,numSteps:o,currentStep:Math.min(i-t.start,o)}))}_refresh(){this._request||(this._running=!0,this._request=gg.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);!t||(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var pi=new by;const cf="transparent",vy={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=ef(n||cf),s=i.valid&&ef(e||cf);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class yy{constructor(e,t,i,s){const l=t[i];s=Vl([e.to,s,l,e.from]);const o=Vl([e.from,l,s]);this._active=!0,this._fn=e.fn||vy[e.type||typeof o],this._easing=xs[e.easing]||xs.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=Vl([e.to,t,s,e.from]),this._from=Vl([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 ky=["x","y","borderWidth","radius","tension"],wy=["color","borderColor","backgroundColor"];bt.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 Sy=Object.keys(bt.animation);bt.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});bt.set("animations",{colors:{type:"color",properties:wy},numbers:{type:"number",properties:ky}});bt.describe("animations",{_fallback:"animation"});bt.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 Ng{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!ft(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!ft(s))return;const l={};for(co
|
||
|
`)>-1?n.split(`
|
||
|
`):n}function jw(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 zf(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=$n(e.bodyFont),u=$n(e.titleFont),f=$n(e.footerFont),c=l.length,d=s.length,m=i.length,g=zn(e.padding);let v=g.height,b=0,y=i.reduce((C,M)=>C+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 C=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;v+=m*C+(y-m)*a.lineHeight+(y-1)*e.bodySpacing}d&&(v+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let $=0;const S=function(C){b=Math.max(b,t.measureText(C).width+$)};return t.save(),t.font=u.string,Dt(n.title,S),t.font=a.string,Dt(n.beforeBody.concat(n.afterBody),S),$=e.displayColors?o+2+e.boxPadding:0,Dt(i,C=>{Dt(C.before,S),Dt(C.lines,S),Dt(C.after,S)}),$=0,t.font=f.string,Dt(n.footer,S),t.restore(),b+=g.width,{width:b,height:v}}function qw(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function Vw(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 zw(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"),Vw(u,n,e,t)&&(u="center"),u}function Bf(n,e,t){const i=t.yAlign||e.yAlign||qw(n,t);return{xAlign:t.xAlign||e.xAlign||zw(n,e,t,i),yAlign:i}}function Bw(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function Uw(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function Uf(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=_s(o);let g=Bw(e,r);const v=Uw(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+s:r==="right"&&(g+=Math.max(c,m)+s),{x:an(g,0,i.width-e.width),y:an(v,0,i.height-e.height)}}function Zl(n,e,t){const i=zn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function Wf(n){return ni([],hi(n))}function Ww(n,e,t){return Ii(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function Yf(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class Qr extends wi{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 Ng(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=Ww(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=ni(r,hi(s)),r=ni(r,hi(l)),r=ni(r,hi(o)),r}getBeforeBody(e,t){return Wf(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return Dt(e,l=>{const o={before:[],lines:[],after:[]},r=Yf(i,l);ni(o.before,hi(r.beforeLabel.call(this,l))
|
||
|
* chartjs-adapter-luxon v1.2.0
|
||
|
* https://www.chartjs.org
|
||
|
* (c) 2022 chartjs-adapter-luxon Contributors
|
||
|
* Released under the MIT license
|
||
|
*/const d2={datetime:Ze.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Ze.TIME_WITH_SECONDS,minute:Ze.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Vg._date.override({_id:"luxon",_create:function(n){return Ze.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return d2},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=Ze.fromFormat(n,e,t):n=Ze.fromISO(n,t):n instanceof Date?n=Ze.fromJSDate(n,t):i==="object"&&!(n instanceof Ze)&&(n=Ze.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function ec(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&&Ot(()=>{t||(t=ot(e,qn,{duration:150},!0)),t.run(1)}),i=!0)},o(s){s&&(t||(t=ot(e,qn,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function p2(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=N(n[1]),t=T(),s=N(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&he(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&he(s,i)},d(l){l&&k(e),l&&k(t),l&&k(s)}}}function h2(n){let e;return{c(){e=N("Loading...")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function m2(n){let e,t,i,s,l,o=n[2]&&ec();function r(f,c){return f[2]?h2:p2}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"),Ja(i,"height","250px"),Ja(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),h(e,t),h(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=ec(),o.c(),A(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){A(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 g2(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(m=>{c();for(let g of m)r.push({x:W.getDateTime(g.date).toLocal().toJSDate(),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),be.errorResponseHandler(m,!1))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Un(()=>(Do.register(Ni,Yo,Uo,Va,Sl,Hw,Yw),t(6,o=new Do(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:m=>m.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>m.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){ge[m?"unshift":"push"](()=>{l=m,t(0,l)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,s=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o
|
||
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
||
|
*
|
||
|
* @license MIT <https://opensource.org/licenses/MIT>
|
||
|
* @author Lea Verou <https://lea.verou.me>
|
||
|
* @namespace
|
||
|
* @public
|
||
|
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function $(S){return S instanceof a?new a(S.type,$(S.content),S.alias):Array.isArray(S)?S.map($):S.replace(/&/g,"&").replace(/</g,"<").replace(/\u00a0/g," ")},type:function($){return Object.prototype.toString.call($).slice(8,-1)},objId:function($){return $.__id||Object.defineProperty($,"__id",{value:++l}),$.__id},clone:function $(S,C){C=C||{};var M,D;switch(r.util.type(S)){case"Object":if(D=r.util.objId(S),C[D])return C[D];M={},C[D]=M;for(var O in S)S.hasOwnProperty(O)&&(M[O]=$(S[O],C));return M;case"Array":return D=r.util.objId(S),C[D]?C[D]:(M=[],C[D]=M,S.forEach(function(E,L){M[L]=$(E,C)}),M);default:return S}},getLanguage:function($){for(;$;){var S=s.exec($.className);if(S)return S[1].toLowerCase();$=$.parentElement}return"none"},setLanguage:function($,S){$.className=$.className.replace(RegExp(s,"gi"),""),$.classList.add("language-"+S)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(M){var $=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(M.stack)||[])[1];if($){var S=document.getElementsByTagName("script");for(var C in S)if(S[C].src==$)return S[C]}return null}},isActive:function($,S,C){for(var M="no-"+S;$;){var D=$.classList;if(D.contains(S))return!0;if(D.contains(M))return!1;$=$.parentElement}return!!C}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function($,S){var C=r.util.clone(r.languages[$]);for(var M in S)C[M]=S[M];return C},insertBefore:function($,S,C,M){M=M||r.languages;var D=M[$],O={};for(var E in D)if(D.hasOwnProperty(E)){if(E==S)for(var L in C)C.hasOwnProperty(L)&&(O[L]=C[L]);C.hasOwnProperty(E)||(O[E]=D[E])}var F=M[$];return M[$]=O,r.languages.DFS(r.languages,function(R,H){H===F&&R!=$&&(this[R]=O)}),O},DFS:function $(S,C,M,D){D=D||{};var O=r.util.objId;for(var E in S)if(S.hasOwnProperty(E)){C.call(S,E,S[E],M||E);var L=S[E],F=r.util.type(L);F==="Object"&&!D[O(L)]?(D[O(L)]=!0,$(L,C,null,D)):F==="Array"&&!D[O(L)]&&(D[O(L)]=!0,$(L,C,E,D))}}},plugins:{},highlightAll:function($,S){r.highlightAllUnder(document,$,S)},highlightAllUnder:function($,S,C){var M={callback:C,container:$,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",M),M.elements=Array.prototype.slice.apply(M.container.querySelectorAll(M.selector)),r.hooks.run("before-all-elements-highlight",M);for(var D=0,O;O=M.elements[D++];)r.highlightElement(O,S===!0,M.callback)},highlightElement:function($,S,C){var M=r.util.getLanguage($),D=r.languages[M];r.util.setLanguage($,M);var O=$.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,M);var E=$.textContent,L={element:$,language:M,grammar:D,code:E};function F(H){L.highlightedCode=H,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),C&&C.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),C&&C.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(S&&i.Worker){var R=new Worker(r.filename);R.onmessage=function(H){F(H.data)},R.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else F(r.highlight(L.code,L.grammar,L.language))},highlight:function($,S,C){var M={code:$,grammar:S,language:C};if(r.hooks.run("before-tokenize",M),!M.grammar)throw new Error('The language "'+M.language+'" has no grammar.');return M.tokens=r.tokenize(M.code,M.grammar),r.hooks.run("after-tokenize",M),a.stringify(r.util.encode(M.tokens),M.language)},tokenize:function($,S){var C=S.rest;if(C){for(var M in C)S[M]=C[M];delete S.rest}var D=new c;return d(D,D.head,$),f($,D,S,D.head,0),g(D)},hooks:{all:{},add:function
|
||
|
`),b.hasAttribute("data-start")||b.setAttribute("data-start",String(L+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),$=0,S;S=y[$++];)t.highlightElement(S)}};var g=!1;t.fileHighlight=function(){g||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),g=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(r_);const zs=r_.exports;var b2={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(`
|
||
|
`),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 m=a[d];m==l.element?c=!0:m.nodeName==="#text"&&(c?f+=m.nodeValue:u+=m.nodeValue,r.removeChild(m),--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 g=u+l.element.innerHTML+f;l.element.innerHTML=o.normalize(g,l.settings),l.code=l.element.textContent}}}})})()})(b2);(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 v2(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),h(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:le,o:le,d(s){s&&k(e)}}}function y2(n,e,t){let{class:i=""}=e,{content:s=""}=e,{language:l="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=zs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),zs.highlight(a,zs.languages[l]||zs.languages.javascript,l)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,s=a.content),"language"in a&&t(3,l=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof zs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class hn extends Ee{constructor(e){super(),Oe(this,e,y2,v2,De,{class:0,content:2,language:3})}}const k2=n=>({}),nc=n=>({}),w2=n=>({}),ic=n=>({});function sc(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S=n[4]&&!n[2]&&lc(n);const C=n[18].header,M=Cn(C,n,n[17],ic);let D=n[4]&&n[2]&&oc(n);const O=n[18].default,E=Cn(O,n,n[17],null),L=n[18].footer,F=Cn(L,n,n[17],nc);return{c(){e=_("div"),t=_("div"),s=T(),l=_("div"),o=_("div"),S&&S.c(),r=T(),M&&M.c(),a=T(),D&&D.c(),u=T(),f=_("div"),E&&E.c(),c=T(),d=_("div"),F&&F.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",m="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 $={};y&16&&($.id=b[4]),y&1&&($.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),z(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function DS(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function g(b){n[3](b)}let v={id:n[4]+".options.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new as({props:v}),ge.push(()=>Ne(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),B(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),h(e,t),h(e,i),h(e,s),w(b,o,y),V(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(m=Ue(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 $={};y&16&&($.id=b[4]+".options.onlyDomains"),y&1&&($.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),z(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function OS(n){let e,t,i,s,l,o,r;return i=new Ie({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[TS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),o=new Ie({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[DS,({uniqueId:a})=>({4:a}),({uniqueId:a})=>a?16:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=T(),l=_("div"),B(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),h(e,t),V(i,t,null),h(e,s),h(e,l),V(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||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){P(i.$$.fragment,a),P(o.$$.fragment,a),r=!1},d(a){a&&k(e),z(i),z(o)}}}function ES(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 c_ extends Ee{constructor(e){super(),Oe(this,e,ES,OS,De,{key:1,options:0})}}function AS(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 c_({props:r}),ge.push(()=>Ne(e,"key",l)),ge.push(()=>Ne(e,"options",o)),{c(){B(e.$$.fragment)},m(a,u){V(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||(A(e.$$.fragment,a),s=!0)},o(a){P(e.$$.fragment,a),s=!1},d(a){z(e,a)}}}function PS(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 LS extends Ee{constructor(e){super(),Oe(this,e,PS,AS,De,{key:0,options:1})}}var yr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],bs={_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
|
||
|
<span class='flatpickr-weekday'>
|
||
|
`+q.join("</span><span class='flatpickr-weekday'>")+`
|
||
|
</span>
|
||
|
`}}function ae(){t.calendarContainer.classList.add("hasWeeks");var I=$t("div","flatpickr-weekwrapper");I.appendChild($t("span","flatpickr-weekday",t.l10n.weekAbbreviation));var q=$t("div","flatpickr-weeks");return I.appendChild(q),{weekWrapper:I,weekNumbers:q}}function Te(I,q){q===void 0&&(q=!0);var ee=q?I:I-t.currentMonth;ee<0&&t._hidePrevMonthArrow===!0||ee>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ee,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,We("onYearChange"),te()),H(),We("onMonthChange"),rt())}function re(I,q){if(I===void 0&&(I=!0),q===void 0&&(q=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,q===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ee=$r(t.config),ue=ee.hours,Ae=ee.minutes,se=ee.seconds;m(ue,Ae,se)}t.redraw(),I&&We("onChange")}function me(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),We("onClose")}function ve(){t.config!==void 0&&We("onDestroy");for(var I=t._handlers.length;I--;)t._handlers[I].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 q=t.calendarContainer.parentNode;if(q.lastChild&&q.removeChild(q.lastChild),q.parentNode){for(;q.firstChild;)q.parentNode.insertBefore(q.firstChild,q);q.parentNode.removeChild(q)}}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(ee){try{delete t[ee]}catch{}})}function Y(I){return t.calendarContainer.contains(I)}function Se(I){if(t.isOpen&&!t.config.inline){var q=kn(I),ee=Y(q),ue=q===t.input||q===t.altInput||t.element.contains(q)||I.path&&I.path.indexOf&&(~I.path.indexOf(t.input)||~I.path.indexOf(t.altInput)),Ae=!ue&&!ee&&!Y(I.relatedTarget),se=!t.config.ignoredFocusElements.some(function(ye){return ye.contains(q)});Ae&&se&&(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 x(I){if(!(!I||t.config.minDate&&I<t.config.minDate.getFullYear()||t.config.maxDate&&I>t.config.maxDate.getFullYear())){var q=I,ee=t.currentYear!==q;t.currentYear=q||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)),ee&&(t.redraw(),We("onYearChange"),te())}}function J(I,q){var ee;q===void 0&&(q=!0);var ue=t.parseDate(I,void 0,q);if(t.config.minDate&&ue&&wn(ue,t.config.minDate,q!==void 0?q:!t.minDateHasTime)<0||t.config.maxDate&&ue&&wn(ue,t.config.maxDate,q!==void 0?q:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return
|
||
|
`),d=_("span"),m=_("span"),m.textContent="Choose presets",g=T(),B(v.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[10]),p(m,"class","txt link-primary"),p(d,"class","inline-flex"),p(f,"class","help-block")},m(M,D){w(M,e,D),h(e,t),h(e,i),h(e,s),w(M,o,D),V(r,M,D),w(M,u,D),w(M,f,D),h(f,c),h(f,d),h(d,m),h(d,g),V(v,d,null),b=!0,y||($=Ue(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 E={};D&2049&&(E.$$scope={dirty:D,ctx:M}),v.$set(E)},i(M){b||(A(r.$$.fragment,M),A(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),z(r,M),M&&k(u),M&&k(f),z(v),y=!1,$()}}}function o$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function g(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 as({props:v}),ge.push(()=>Ne(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Thumb sizes",i=T(),s=_("i"),o=T(),B(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),h(e,t),h(e,i),h(e,s),w(b,o,y),V(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(m=Ue(Ct.call(null,s,{text:"List of thumb sizes for image files. 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 $={};y&1024&&($.id=b[10]),!a&&y&1&&(a=!0,$.value=b[0].thumbs,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),z(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function r$(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;return i=new Ie({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[n$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),o=new Ie({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[i$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),u=new Ie({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[l$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),d=new Ie({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[o$,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=T(),l=_("div"),B(o.$$.fragment),r=T(),a=_("div"),B(u.$$.fragment),f=T(),c=_("div"),B(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(g,v){w(g,e,v),h(e,t),V(i,t,null),h(e,s),h(e,l),V(o,l,null),h(e,r),h(e,a),V(u,a,null),h(e,f),h(e,c),V(d,c,null),m=!0},p(g,[v]){const b={};v&2&&(b.name="schema."+g[1]+".options.maxSize"),v&3073&&(b.$$scope={dirty:v,ctx:g}),i.$set(b);const y={};v&2&&(y.name="schema."+g[1]+".options.maxSelect"),v&3073&&(y.$$scope={dirty:v,ctx:g}),o.$set(y);const $={};v&2&&($.name="schema."+g[1]+".options.mimeTypes"),v&3073&&($.$$scope={dirty:v,ctx:g}),u.$set($);const S={};v&2&&(S.name="schema."+g[1]+".options.thumbs"),v&3073&&(S.$$scope={dirty:v,ctx:g}),d.$set(S)},i(g){m||(A(i.$$.fragment,g),A(o.$$.fragment,g),A(u.$$.fragment,g),A(d.$$.fragment,g),m=!0)},o(g){P(i.$$.fragment,g),P(o.$$.fragment,g),P(u.$$.fragment,g),P(d.$$.fragment,g),m=!1},d(g){g&&k(e),z(i),z(o),z(u),z(d)}}}function a$(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(m){n.$$.not_equal(s.mimeTypes,m)&&(s.mimeTypes=m,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(m){n.$$.not_equal(s.thumbs,m)&&(s.thumbs=m,t(0,s))}return n.$$set=m=>{"key"in m&&t(1,i=m.key),"options"in m&&t(0,s=m.options)},n.$$.update=()=>{n.$$.dirty&1&&W.isEmpty(s)&&t(0,s
|
||
|
form-field
|
||
|
required
|
||
|
`+(n[5]?"":"invalid")+`
|
||
|
`+(n[0].id&&n[0].system?"disabled":"")+`
|
||
|
`,name:"schema."+n[1]+".name",$$slots:{default:[w$,({uniqueId:H})=>({38:H}),({uniqueId:H})=>[0,H?128:0]]},$$scope:{ctx:n}}});const O=[L$,P$,A$,E$,O$,D$,T$,M$,C$,$$,S$],E=[];function L(H,te){return H[0].type==="text"?0:H[0].type==="number"?1:H[0].type==="bool"?2:H[0].type==="email"?3:H[0].type==="url"?4:H[0].type==="date"?5:H[0].type==="select"?6:H[0].type==="json"?7:H[0].type==="file"?8:H[0].type==="relation"?9:H[0].type==="user"?10:-1}~(f=L(n))&&(c=E[f]=O[f](n)),g=new Ie({props:{class:"form-field form-field-toggle m-0",name:"requried",$$slots:{default:[F$,({uniqueId:H})=>({38:H}),({uniqueId:H})=>[0,H?128:0]]},$$scope:{ctx:n}}});let F=n[0].type!=="file"&&Lc(n),R=!n[0].toDelete&&Fc(n);return{c(){e=_("form"),t=_("div"),i=_("div"),B(s.$$.fragment),l=T(),o=_("div"),B(r.$$.fragment),a=T(),u=_("div"),c&&c.c(),d=T(),m=_("div"),B(g.$$.fragment),v=T(),b=_("div"),F&&F.c(),y=T(),R&&R.c(),$=T(),S=_("input"),p(i,"class","col-sm-6"),p(o,"class","col-sm-6"),p(u,"class","col-sm-12 hidden-empty"),p(m,"class","col-sm-4 flex"),p(b,"class","col-sm-4 flex"),p(t,"class","grid"),p(S,"type","submit"),p(S,"class","hidden"),p(S,"tabindex","-1"),p(e,"class","field-form")},m(H,te){w(H,e,te),h(e,t),h(t,i),V(s,i,null),h(t,l),h(t,o),V(r,o,null),h(t,a),h(t,u),~f&&E[f].m(u,null),h(t,d),h(t,m),V(g,m,null),h(t,v),h(t,b),F&&F.m(b,null),h(t,y),R&&R.m(t,null),h(e,$),h(e,S),C=!0,M||(D=G(e,"submit",Yt(n[31])),M=!0)},p(H,te){const Q={};te[0]&1&&(Q.class="form-field required "+(H[0].id?"disabled":"")),te[0]&2&&(Q.name="schema."+H[1]+".type"),te[0]&1|te[1]&384&&(Q.$$scope={dirty:te,ctx:H}),s.$set(Q);const j={};te[0]&33&&(j.class=`
|
||
|
form-field
|
||
|
required
|
||
|
`+(H[5]?"":"invalid")+`
|
||
|
`+(H[0].id&&H[0].system?"disabled":"")+`
|
||
|
`),te[0]&2&&(j.name="schema."+H[1]+".name"),te[0]&33|te[1]&384&&(j.$$scope={dirty:te,ctx:H}),r.$set(j);let X=f;f=L(H),f===X?~f&&E[f].p(H,te):(c&&(Pe(),P(E[X],1,1,()=>{E[X]=null}),Le()),~f?(c=E[f],c?c.p(H,te):(c=E[f]=O[f](H),c.c()),A(c,1),c.m(u,null)):c=null);const U={};te[0]&1|te[1]&384&&(U.$$scope={dirty:te,ctx:H}),g.$set(U),H[0].type!=="file"?F?(F.p(H,te),te[0]&1&&A(F,1)):(F=Lc(H),F.c(),A(F,1),F.m(b,null)):F&&(Pe(),P(F,1,1,()=>{F=null}),Le()),H[0].toDelete?R&&(Pe(),P(R,1,1,()=>{R=null}),Le()):R?(R.p(H,te),te[0]&1&&A(R,1)):(R=Fc(H),R.c(),A(R,1),R.m(t,null))},i(H){C||(A(s.$$.fragment,H),A(r.$$.fragment,H),A(c),A(g.$$.fragment,H),A(F),A(R),C=!0)},o(H){P(s.$$.fragment,H),P(r.$$.fragment,H),P(c),P(g.$$.fragment,H),P(F),P(R),C=!1},d(H){H&&k(e),z(s),z(r),~f&&E[f].d(),z(g),F&&F.d(),R&&R.d(),M=!1,D()}}}function Nc(n){let e,t,i,s,l=n[0].system&&Rc(),o=!n[0].id&&Hc(n),r=n[0].required&&jc(),a=n[0].unique&&qc();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),h(e,t),o&&o.m(e,null),h(e,i),r&&r.m(e,null),h(e,s),a&&a.m(e,null)},p(u,f){u[0].system?l||(l=Rc(),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=Hc(u),o.c(),o.m(e,i)),u[0].required?r||(r=jc(),r.c(),r.m(e,s)):r&&(r.d(1),r=null),u[0].unique?a||(a=qc(),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 Rc(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 Hc(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 jc(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 qc(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 Vc(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=Ue(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ot(()=>{t||(t=ot(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ot(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function zc(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",Xn(n[15])),t=!0)},p:le,d(s){s&&k(e),t=!1,i()}}}function H$(n){let e,t,i,s,l,o,r=(n[0].name||"-")+"",a,u,f,c,d,m,g,v,b,y=!n[0].toDelete&&Nc(n),$=n[7]&&!n[0].system&&Vc(),S=n[0].toDelete&&zc(n);return{c(){e=_("div"),t=_("span"),i=_("i"),l=T(),o=_("strong"),a=N(r),f=T(),y&&y.c(),c=T(),d=_("div"),m=T(),$&&$.c(),g=T(),S&&S.c(),v=xe(),p(i,"class",s=Za(W.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(C,M){w(C,e,M),h(e,t),h(t,i),h(e,l),h(e,o),h(o,a),w(C,f,M),y&&y.m(C,M),w(C,c,M),w(C,d,M),w(C,m,M),$&&$.m(C,M),w(C,g,M),S&&S.m(C,M),w(C,v,M),b=!0},p(C,M){(!b||M[0]&1&&s!==(s=Za(W.getFieldTypeIcon(C[0].type))+" svelte-1tpxlm5"))&&p(i,"class",s),(!b||M[0]&1)&&r!==(r=(C[0].name||"-")+"")&&he(a,r),(!b||M[0]&1&&u!==(u=C[0].name))&&p(o,"title",u),M[0]&1&&ie(o,"txt-strikethrough",C[0].toDelete),C[0].toDelete?y&&(y.d(1),y=null):y?y.p(C,M):(y=Nc(C),y.c(),y.m(c.parentNode,c)),C[7]&&!C[0].system?$?M[0]&129&&A($,1):($=Vc(),$.c(),A($,1),$.m(g.parentNode,g)):$&&(Pe(),P($,1,1,()=>{$=null}),Le()),C[0].toDelete?S?S.p(C,M):(S=zc(C),S.c(),S.m(v.parentNode,v)):S&&(S.d(1),S=null)},i(C){b||(A($),b=!0)},o(C){P($),b=!1},d(C){C&&k(e),C&&k(f),y&&y.d(C),C&&k(c),C&&k(d),C&&k(m),$&&$.d(C),C&&k(g),S&&S.d(C),C&&k(v)}}}function j$(n){let e,t,i={single:!0,interactive:n[8],class:n[2]||n
|
||
|
<code>@request.query.*</code>
|
||
|
<code>@request.data.*</code>
|
||
|
<code>@request.user.*</code>`,S=T(),C=_("hr"),M=T(),D=_("p"),D.innerHTML="You could also add constraints and query other collections using the <em>@collection</em> filter:",O=T(),E=_("div"),E.innerHTML="<code>@collection.ANY_COLLECTION_NAME.*</code>",L=T(),F=_("hr"),R=T(),H=_("p"),H.innerHTML=`Example rule:
|
||
|
<br/>
|
||
|
<code>@request.user.id!="" && created>"2022-01-01 00:00:00"</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(b,"class","m-b-0"),p($,"class","inline-flex flex-gap-5"),p(C,"class","m-t-10 m-b-5"),p(D,"class","m-b-0"),p(E,"class","inline-flex flex-gap-5"),p(F,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(U,Z){w(U,e,Z),h(e,t),h(t,i),h(i,s),h(i,l),h(i,o),h(o,r),h(o,a),h(o,u),h(o,f),h(o,c),h(o,d);for(let oe=0;oe<X.length;oe+=1)X[oe].m(o,null);h(i,m),h(i,g),h(i,v),h(i,b),h(i,y),h(i,$),h(i,S),h(i,C),h(i,M),h(i,D),h(i,O),h(i,E),h(i,L),h(i,F),h(i,R),h(i,H),Q=!0},p(U,Z){if(Z&1){j=U[0].schema;let oe;for(oe=0;oe<j.length;oe+=1){const ae=Yc(U,j,oe);X[oe]?X[oe].p(ae,Z):(X[oe]=Zc(ae),X[oe].c(),X[oe].m(o,null))}for(;oe<X.length;oe+=1)X[oe].d(1);X.length=j.length}},i(U){Q||(U&&Ot(()=>{te||(te=ot(e,en,{duration:150},!0)),te.run(1)}),Q=!0)},o(U){U&&(te||(te=ot(e,en,{duration:150},!1)),te.run(0)),Q=!1},d(U){U&&k(e),Gn(X,U),U&&te&&te.end()}}}function W$(n){let e,t=n[19].name+"",i;return{c(){e=_("code"),i=N(t)},m(s,l){w(s,e,l),h(e,i)},p(s,l){l&1&&t!==(t=s[19].name+"")&&he(i,t)},d(s){s&&k(e)}}}function Y$(n){let e,t=n[19].name+"",i,s;return{c(){e=_("code"),i=N(t),s=N(".*")},m(l,o){w(l,e,o),h(e,i),h(e,s)},p(l,o){o&1&&t!==(t=l[19].name+"")&&he(i,t)},d(l){l&&k(e)}}}function Zc(n){let e;function t(l,o){return l[19].type==="relation"||l[19].type==="user"?Y$:W$}let i=t(n),s=i(n);return{c(){s.c(),e=xe()},m(l,o){s.m(l,o),w(l,e,o)},p(l,o){i===(i=t(l))&&s?s.p(l,o):(s.d(1),s=i(l),s&&(s.c(),s.m(e.parentNode,e)))},d(l){s.d(l),l&&k(e)}}}function K$(n){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=Wc(n,l,r),u=o(a);t.set(u,e[r]=Jc(u,a))}return{c(){for(let r=0;r<e.length;r+=1)e[r].c();i=xe()},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=ht(e,a,o,1,r,l,t,i.parentNode,Gt,Jc,i,Wc),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(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 Z$(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:le,i:le,o:le,d(t){t&&k(e)}}}function J$(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=[Ue(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,Je(i)}}}function G$(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=[Ue(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,Je(i)}}}function X$(n){let e;return{c(){e=N("Leave empty to grant everyone access")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Q$(n){let e;return{c(){e=N("Only admins will be able to access (unlock to change)")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function x$(n){let e,t=n[15]+"",i,s,l=Di(n[0][n[14]])?"Admins only":"Custom rule",o,r,a,u,f=n[14],c,d,m,g,v,b,y;function $(){return n[10](n[14])}const S=()=>n[11](u,f),C=()=>n[11](null,f);function M(R){n[12](R,n[14])}var D=n[4];function O(R){let H={baseCollection:R[0],disabled:Di(R[0][R[14]])};return R[0][R[14]]!==void 0&&(H.value=R[0][R[14]]),{props:H}}D&&(u=new D(O(n)),S(),ge.push(()=>Ne(u,"value",M)));function E(R,H){return H&1&&(g=null),g==null&&(g=!!Di(R[0][R[14]])),g?Q$:X$}let L=E(n,-1),F=L(n);return{c(){e=_("label"),i=N(t),s=N(" - "),o=N(l),a=T(),u&&B(u.$$.fragment),d=T(),m=_("div"),F.c(),p(e,"for",r=n[18]),p(m,"class","help-block")},m(R,H){w(R,e,H),h(e,i),h(e,s),h(e,o),w(R,a,H),u&&V(u,R,H),w(R,d,H),w(R,m,H),F.m(m,null),v=!0,b||(y=G(e,"click",$),b=!0)},p(R,H){n=R,(!
|
||
|
<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=N(o),a=T(),b&&b.c(),u=T(),c.c(),d=xe(),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(C,M){w(C,e,M),h(e,t),h(t,i),h(t,s),h(t,l),h(l,r),h(e,a),b&&b.m(e,null),w(C,u,M),$[f].m(C,M),w(C,d,M),m=!0,g||(v=G(l,"click",n[7]),g=!0)},p(C,[M]){(!m||M&4)&&o!==(o=C[2]?"Hide available fields":"Show available fields")&&he(r,o),C[2]?b?(b.p(C,M),M&4&&A(b,1)):(b=Kc(C),b.c(),A(b,1),b.m(e,null)):b&&(Pe(),P(b,1,1,()=>{b=null}),Le());let D=f;f=S(C),f===D?$[f].p(C,M):(Pe(),P($[D],1,1,()=>{$[D]=null}),Le(),c=$[f],c?c.p(C,M):(c=$[f]=y[f](C),c.c()),A(c,1),c.m(d.parentNode,d))},i(C){m||(A(b),A(c),m=!0)},o(C){P(b),P(c),m=!1},d(C){C&&k(e),b&&b.d(),C&&k(u),$[f].d(C),C&&k(d),g=!1,v()}}}function Di(n){return n===null}function tC(n,e,t){let{collection:i=new En}=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 Zi(()=>import("./FilterAutocompleteInput.92765a8b.js"),[],import.meta.url)).default)}catch(y){console.warn(y),t(4,r=null)}t(5,a=!1)}Un(()=>{f()});const c=()=>t(2,l=!l),d=async y=>{var $;t(0,i[y]=s[y]||"",i),await xn(),($=o[y])==null||$.focus()},m=y=>{t(1,s[y]=i[y],s),t(0,i[y]=null,i)},g=y=>{var $;return($=o[y])==null?void 0:$.focus()};function v(y,$){ge[y?"unshift":"push"](()=>{o[$]=y,t(3,o)})}function b(y,$){n.$$.not_equal(i[$],y)&&(i[$]=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,m,g,v,b]}class nC extends Ee{constructor(e){super(),Oe(this,e,tC,eC,De,{collection:0})}}function Gc(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 Qc(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 xc(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=N(`Renamed collection
|
||
|
`),s=_("strong"),o=N(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=N(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(m,g){w(m,e,g),h(e,t),h(t,i),h(t,s),h(s,o),h(t,r),h(t,a),h(t,u),h(t,f),h(f,d)},p(m,g){g&2&&l!==(l=m[1].originalName+"")&&he(o,l),g&2&&c!==(c=m[1].name+"")&&he(d,c)},d(m){m&&k(e)}}}function ed(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=N(`Renamed field
|
||
|
`),s=_("strong"),o=N(l),r=T(),a=_("i"),u=T(),f=_("strong"),d=N(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(m,g){w(m,e,g),h(e,t),h(t,i),h(t,s),h(s,o),h(t,r),h(t,a),h(t,u),h(t,f),h(f,d)},p(m,g){g&16&&l!==(l=m[14].originalName+"")&&he(o,l),g&16&&c!==(c=m[14].name+"")&&he(d,c)},d(m){m&&k(e)}}}function td(n){let e,t,i,s=n[14].name+"",l,o;return{c(){e=_("li"),t=N("Removed field "),i=_("span"),l=N(s),o=T(),p(i,"class","txt-bold"),p(e,"class","txt-danger")},m(r,a){w(r,e,a),h(e,t),h(e,i),h(i,l),h(e,o)},p(r,a){a&8&&s!==(s=r[14].name+"")&&he(l,s)},d(r){r&&k(e)}}}function iC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=n[3].length&&Qc(),g=n[5]&&xc(n),v=n[4],b=[];for(let S=0;S<v.length;S+=1)b[S]=ed(Xc(n,v,S));let y=n[3],$=[];for(let S=0;S<y.length;S+=1)$[S]=td(Gc(n,y,S));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(),m&&m.c(),r=T(),a=_("h6"),a.textContent="Changes:",u=T(),f=_("ul"),g&&g.c(),c=T();for(let S=0;S<b.length;S+=1)b[S].c();d=T();for(let S=0;S<$.length;S+=1)$[S].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(S,C){w(S,e,C),h(e,t),h(e,i),h(e,s),h(s,l),h(s,o),m&&m.m(s,null),w(S,r,C),w(S,a,C),w(S,u,C),w(S,f,C),g&&g.m(f,null),h(f,c);for(let M=0;M<b.length;M+=1)b[M].m(f,null);h(f,d);for(let M=0;M<$.length;M+=1)$[M].m(f,null)},p(S,C){if(S[3].length?m||(m=Qc(),m.c(),m.m(s,null)):m&&(m.d(1),m=null),S[5]?g?g.p(S,C):(g=xc(S),g.c(),g.m(f,c)):g&&(g.d(1),g=null),C&16){v=S[4];let M;for(M=0;M<v.length;M+=1){const D=Xc(S,v,M);b[M]?b[M].p(D,C):(b[M]=ed(D),b[M].c(),b[M].m(f,d))}for(;M<b.length;M+=1)b[M].d(1);b.length=v.length}if(C&8){y=S[3];let M;for(M=0;M<y.length;M+=1){const D=Gc(S,y,M);$[M]?$[M].p(D,C):($[M]=td(D),$[M].c(),$[M].m(f,null))}for(;M<$.length;M+=1)$[M].d(1);$.length=y.length}},d(S){S&&k(e),m&&m.d(),S&&k(r),S&&k(a),S&&k(u),S&&k(f),g&&g.d(),Gn(b,S),Gn($,S)}}}function sC(n){let e;return{c(){e=_("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function lC(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:le,d(o){o&&k(e),o&&k(t),o&&k(i),s=!1,Je(l)}}}function oC(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[lC],header:[sC],default:[iC]},$$scope:{ctx:n}};return e=new fi({props:i}),n[10](e),e.$on("hide",n[11]),e.$on("show",n[12]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&524346&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[10](null),z(e,s)}}}function rC(n,e,t){let i,s,l;const o=ln();let r,a;async function u(y){t(1,a=y),await xn(),!i&&!s.length&&!l.length?c():r==null||r.show()}function f(){r==null||r.hide()}function c(){f(),o("confirm")}const d=()=>f(),m=()=>c();function g(y){ge[y?"unshift":"push"](()=>{r=y,t(2,r)})}function v(y){at.call(this,n,y)}function b(y){at.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,m,g,v,b]}class aC extends Ee{constructor(e){super(),Oe(this,e,rC,oC,De,{show:7,hide:0})}get show(){return this.$$.ctx[7]}get hide(){return this.$$.ctx[0]}}function nd(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 nC({props:o}),ge.push(()=>Ne(t,"collection",l)),{c(){e=_("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),V(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],He(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){P(t.$$.fragment,r),s=!1},d(r){r&&k(e),z(t)}}}function uC(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 U$({props:a}),ge.push(()=>Ne(i,"collection",r));let u=n[9]===dl&&nd(n);return{c(){e=_("div"),t=_("div"),B(i.$$.fragment),l=T(),u&&u.c(),p(t,"class","tab-item"),ie(t,"active",n[9]===ns),p(e,"class","tabs-content svelte-b10vi")},m(f,c){w(f,e,c),h(e,t),V(i,t,null),h(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]===ns),f[9]===dl?u?(u.p(f,c),c[0]&512&&A(u,1)):(u=nd(f),u.c(),A(u,1),u.m(e,null)):u&&(Pe(),P(u,1,1,()=>{u=null}),Le())},i(f){o||(A(i.$$.fragment,f),A(u),o=!0)},o(f){P(i.$$.fragment,f),P(u),o=!1},d(f){f&&k(e),z(i),u&&u.d()}}}function id(n){let e,t,i,s,l,o,r;return o=new Ri({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:le,d(s){s&&k(e),t=!1,i()}}}function sd(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 cC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m=n[2].system&&sd();return{c(){e=_("label"),t=N("Name"),s=T(),l=_("input"),u=T(),m&&m.c(),f=xe(),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(g,v){w(g,e,v),h(e,t),w(g,s,v),w(g,l,v),w(g,u,v),m&&m.m(g,v),w(g,f,v),n[2].isNew&&l.focus(),c||(d=G(l,"input",n[21]),c=!0)},p(g,v){v[1]&128&&i!==(i=g[38])&&p(e,"for",i),v[1]&128&&o!==(o=g[38])&&p(l,"id",o),v[0]&2048&&(l.disabled=g[11]),v[0]&4&&r!==(r=g[2].isNew)&&(l.autofocus=r),v[0]&4&&a!==(a=g[2].name)&&l.value!==a&&(l.value=a),g[2].system?m||(m=sd(),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},d(g){g&&k(e),g&&k(s),g&&k(l),g&&k(u),m&&m.d(g),g&&k(f),c=!1,d()}}}function ld(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=Ue(t=Ct.call(null,e,n[12])),l=!0)},p(r,a){t&&Bn(t.update)&&a[0]&4096&&t.update.call(null,r[12])},i(r){s||(r&&Ot(()=>{i||(i=ot(e,qn,{duration:150,start:.7},!0)),i.run(1)}),s=!0)},o(r){r&&(i||(i=ot(e,qn,{duration:150,start:.7},!1)),i.run(0)),s=!1},d(r){r&&k(e),r&&i&&i.end(),l=!1,o()}}}function od(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=Ue(Ct.call(null,e,"Has errors")),s=!0)},i(o){i||(o&&Ot(()=>{t||(t=ot(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){o&&(t||(t=ot(e,qn,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function dC(n){var R,H,te,Q,j,X;let e,t=n[2].isNew?"New collection":"Edit collection",i,s,l,o,r,a,u,f,c,d,m,g,v=!W.isEmpty((R=n[4])==null?void 0:R.schema),b,y,$,S,C=!W.isEmpty((H=n[4])==null?void 0:H.listRule)||!W.isEmpty((te=n[4])==null?void 0:te.viewRule)||!W.isEmpty((Q=n[4])==null?void 0:Q.createRule)||!W.isEmpty((j=n[4])==null?void 0:j.updateRule)||!W.isEmpty((X=n[4])==null?void 0:X.deleteRule),M,D,O,E=!n[2].isNew&&!n[2].system&&id(n);r=new Ie({props:{class:"form-field required m-b-0 "+(n[11]?"disabled":""),name:"name",$$slots:{default:[cC,({uniqueId:U})=>({38:U}),({uniqueId:U})=>[0,U?128:0]]},$$scope:{ctx:n}}});let L=v&&ld(n),F=C&&od();return{c(){e=_("h4"),i=N(t),s=T(),E&&E.c(),l=T(),o=_("form"),B(r.$$.fragment),a=T(),u=_("input"),f=T(),c=_("div"),d=_("button"),m=_("span"),m.textContent="Fields",g=T(),L&&L.c(),b=T(),y=_("button"),$=_("span"),$.textContent="API Rules",S=T(),F&&F.c(),p(u,"type","submit"),p(u,"class","hidden"),p(u,"tabindex","-1"),p(o,"class","block"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","tab-item"),ie(d,"active",n[9]===ns),p($,"class","txt"),p(y,"type","button"),p(y,"class","tab-item"),ie(y,"active",n[9]===dl),p(c,"class","tabs-header stretched")},m(U,Z){w(U,e,Z),h(e,i),w(U,s,Z),E&&E.m(U,Z),w(U,l,Z),w(U,o,Z),V(r,o,null),h(o,a),h(o,u),w(U,f,Z),w(U,c,Z),h(c,d),h(d,m),h(d,g),L&&L.m(d,null),h(c,b),h(c,y),h(y,$),h(y,S),F&&F.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(U,Z){var ae,Te,re,me,ve,Y;(!M||Z[0]&4)&&t!==(t=U[2].isNew?"New collection":"Edit collection")&&he(i,t),!U[2].isNew&&!U[2].system?E?(E.p(U,Z),Z[0]&4&&A(E,1)):(E=id(U),E.c(),A(E,1),E.m(l.parentNode,l)):E&&(Pe(),P(E,1,1,()=>{E=null}),Le());const oe={};Z[0]&2048&&(oe.class="form-field required m-b-0 "+(U[11]?"disabled":"")),Z[0]&2052|Z[1]&384&&(oe.$$scope={dirty:Z,ctx:U}),r.$set(oe),Z[0]&16&&(v=!W.isEmpty((ae=U[4])==null?void 0:ae.schema)),v?L?(L.p(U,Z),Z[0]&16&&A(L,1)):(L=ld(U),L.c(),A(L,1),L.m(d,null)):L&&(Pe(),P(L,1,1,()=>{L=null}),Le()),Z[0]&512&&ie(d,"active",U[9]===ns),Z[0]&16&&(C=!W.isEmpty((Te=U[4])==null?void 0:Te.listRule)||!W.isEmpty((re=U[4])==null?void 0:re.viewRule)||!W.isEmpty((me=U[4])==null?void 0:me.createRu
|
||
|
<span class="txt">New collection</span>`,y=T(),B($.$$.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(F,R){w(F,e,R),h(e,t),h(t,i),h(i,s),h(s,l),h(i,o),h(i,r),Ce(r,n[0]),h(e,a),h(e,u),h(e,f),h(e,c);for(let H=0;H<d.length;H+=1)d[H].m(c,null);E&&E.m(c,null),h(e,g),h(e,v),h(v,b),w(F,y,R),V($,F,R),S=!0,C||(M=[G(l,"click",n[8]),G(r,"input",n[9]),G(b,"click",n[11])],C=!0)},p(F,[R]){R&16&&ie(l,"hidden",!F[4]),R&1&&r.value!==F[0]&&Ce(r,F[0]),R&16&&ie(i,"active",F[4]),R&106&&(D=F[3],d=ht(d,R,O,1,F,D,m,c,mn,fd,null,rd),!D.length&&E?E.p(F,R):D.length?E&&(E.d(1),E=null):(E=ad(F),E.c(),E.m(c,null)));const H={};$.$set(H)},i(F){S||(A($.$$.fragment,F),S=!0)},o(F){P($.$$.fragment,F),S=!1},d(F){F&&k(e);for(let R=0;R<d.length;R+=1)d[R].d();E&&E.d(),F&&k(y),n[12](null),z($,F),C=!1,Je(M)}}}function vC(n,e,t){let i,s,l,o,r;yt(n,oi,b=>t(5,o=b)),yt(n,Cs,b=>t(7,r=b));let a,u="";function f(b){fn(oi,o=b,o)}const c=()=>t(0,u="");function d(){u=this.value,t(0,u)}const m=b=>f(b),g=()=>a==null?void 0:a.show();function v(b){ge[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,m,g,v]}class yC extends Ee{constructor(e){super(),Oe(this,e,vC,bC,De,{})}}function kC(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U,Z,oe,ae,Te,re,me,ve,Y,Se,x,J,we,Re,ze,K,pe,ce,ke,Ge;return{c(){e=_("p"),e.innerHTML=`The syntax basically follows the format
|
||
|
<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=N(` - is one of:
|
||
|
`),u=_("br"),f=T(),c=_("ul"),d=_("li"),m=_("code"),m.textContent="=",g=T(),v=_("span"),v.textContent="Equal",b=T(),y=_("li"),$=_("code"),$.textContent="!=",S=T(),C=_("span"),C.textContent="NOT equal",M=T(),D=_("li"),O=_("code"),O.textContent=">",E=T(),L=_("span"),L.textContent="Greater than",F=T(),R=_("li"),H=_("code"),H.textContent=">=",te=T(),Q=_("span"),Q.textContent="Greater than or equal",j=T(),X=_("li"),U=_("code"),U.textContent="<",Z=T(),oe=_("span"),oe.textContent="Less than or equal",ae=T(),Te=_("li"),re=_("code"),re.textContent="<=",me=T(),ve=_("span"),ve.textContent="Less than or equal",Y=T(),Se=_("li"),x=_("code"),x.textContent="~",J=T(),we=_("span"),we.textContent=`Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for wildcard
|
||
|
match)`,Re=T(),ze=_("li"),K=_("code"),K.textContent="!~",pe=T(),ce=_("span"),ce.textContent=`NOT Like/Contains (if not specified auto wraps the right string OPERAND in a "%" for
|
||
|
wildcard match)`,ke=T(),Ge=_("p"),Ge.innerHTML=`To group and combine several expressions you could use brackets
|
||
|
<code>(...)</code>, <code>&&</code> (AND) and <code>||</code> (OR) tokens.`,p(r,"class","txt-danger"),p(m,"class","filter-op svelte-1w7s5nw"),p(v,"class","txt-hint"),p($,"class","filter-op svelte-1w7s5nw"),p(C,"class","txt-hint"),p(O,"class","filter-op svelte-1w7s5nw"),p(L,"class","txt-hint"),p(H,"class","filter-op svelte-1w7s5nw"),p(Q,"class","txt-hint"),p(U,"class","filter-op svelte-1w7s5nw"),p(oe,"class","txt-hint"),p(re,"class","filter-op svelte-1w7s5nw"),p(ve,"class","txt-hint"),p(x,"class","filter-op svelte-1w7s5nw"),p(we,"class","txt-hint"),p(K,"class","filter-op svelte-1w7s5nw"),p(ce,"class","txt-hint")},m(nt,et){w(nt,e,et),w(nt,t,et),w(nt,i,et),h(i,s),h(i,l),h(i,o),h(o,r),h(o,a),h(o,u),h(o,f),h(o,c),h(c,d),h(d,m),h(d,g),h(d,v),h(c,b),h(c,y),h(y,$),h(y,S),h(y,C),h(c,M),h(c,D),h(D,O),h(D,E),h(D,L),h(c,F),h(c,R),h(R,H),h(R,te),h(R,Q),h(c,j),h(c,X),h(X,U),h(X,Z),h(X,oe),h(c,ae),h(c,Te),h(Te,re),h(Te,me),h(Te,ve),h(c,Y),h(c,Se),h(Se,x),h(Se,J),h(Se,we),h(c,Re),h(c,ze),h(ze,K),h(ze,pe),h(ze,ce),w(nt,ke,et),w(nt,Ge,et)},p:le,i:le,o:le,d(nt){nt&&k(e),nt&&k(t),nt&&k(i),nt&&k(ke),nt&&k(Ge)}}}class wC extends Ee{constructor(e){super(),Oe(this,e,null,kC,De,{})}}function cd(n,e,t){const i=n.slice();return i[5]=e[t],i}function dd(n,e,t){const i=n.slice();return i[5]=e[t],i}function pd(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=N(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),h(t,i),h(i,l),h(t,o),r||(a=G(t,"click",u),r=!0)},p(f,c){e=f,c&2&&s!==(s=e[5].title+"")&&he(l,s),c&3&&ie(t,"active",e[0]===e[5].language)},d(f){f&&k(t),r=!1,a()}}}function hd(n,e){let t,i,s,l;return i=new hn({props:{language:e[5].language,content:e[5].content}}),{key:n,first:null,c(){t=_("div"),B(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),V(i,t,null),h(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||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),z(i)}}}function SC(n){let e,t,i=[],s=new Map,l,o,r=[],a=new Map,u,f=n[1];const c=g=>g[5].language;for(let g=0;g<f.length;g+=1){let v=dd(n,f,g),b=c(v);s.set(b,i[g]=pd(b,v))}let d=n[1];const m=g=>g[5].language;for(let g=0;g<d.length;g+=1){let v=cd(n,d,g),b=m(v);a.set(b,r[g]=hd(b,v))}return{c(){e=_("div"),t=_("div");for(let g=0;g<i.length;g+=1)i[g].c();l=T(),o=_("div");for(let g=0;g<r.length;g+=1)r[g].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(g,v){w(g,e,v),h(e,t);for(let b=0;b<i.length;b+=1)i[b].m(t,null);h(e,l),h(e,o);for(let b=0;b<r.length;b+=1)r[b].m(o,null);u=!0},p(g,[v]){v&3&&(f=g[1],i=ht(i,v,c,1,g,f,s,t,mn,pd,null,dd)),v&3&&(d=g[1],Pe(),r=ht(r,v,m,1,g,d,a,o,Gt,hd,null,cd),Le())},i(g){if(!u){for(let v=0;v<d.length;v+=1)A(r[v]);u=!0}},o(g){for(let v=0;v<r.length;v+=1)P(r[v]);u=!1},d(g){g&&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 md="pb_sdk_preference";function $C(n,e,t){let i,{js:s=""}=e,{dart:l=""}=e,o=localStorage.getItem(md)||"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(md,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 Es extends Ee{constructor(e){super(),Oe(this,e,$C,SC,De,{js:2,dart:3})}}function gd(n,e,t){const i=n.slice();return i[6]=e[t],i}function _d(n,e,t){const i=n.slice();return i[6]=e[t],i}function bd(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 vd(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
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
// fetch a paginated records list
|
||
|
const resultList = await client.records.getList('${(ci=n[0])==null?void 0:ci.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('${($l=n[0])==null?void 0:$l.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(
|
||
|
'${(us=n[0])==null?void 0:us.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('${(Cl=n[0])==null?void 0:Cl.name}', batch: 200, sort: '-created');
|
||
|
`}}),K=new hn({props:{content:`
|
||
|
// DESC by created and ASC by id
|
||
|
?sort=-created,id
|
||
|
`}}),Mt=new hn({props:{content:`
|
||
|
?filter=(id='abc' && created>'2022-01-01')
|
||
|
`}}),Ye=new wC({}),mt=new hn({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let pt=n[4];const on=je=>je[6].code;for(let je=0;je<pt.length;je+=1){let Xe=_d(n,pt,je),Xt=on(Xe);Ae.set(Xt,ue[je]=vd(Xt,Xe))}let qt=n[4];const Si=je=>je[6].code;for(let je=0;je<qt.length;je+=1){let Xe=gd(n,qt,je),Xt=Si(Xe);fe.set(Xt,Me[je]=yd(Xt,Xe))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=T(),Fe&&Fe.c(),d=T(),m=_("div"),g=_("p"),v=N("Fetch a paginated "),b=_("strong"),$=N(y),S=N(" records list."),C=T(),M=_("div"),M.textContent="Client SDKs example",D=T(),B(O.$$.fragment),E=T(),L=_("div"),L.textContent="Query parameters",F=T(),R=_("table"),H=_("thead"),H.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,te=T(),Q=_("tbody"),j=_("tr"),j.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(),U=_("tr"),U.innerHTML=`<td>perPage</td>
|
||
|
<td><span class="label">Number</span></td>
|
||
|
<td>Specify the max returned records per page (default to 30).</td>`,Z=T(),oe=_("tr"),ae=_("td"),ae.textContent="sort",Te=T(),re=_("td"),re.innerHTML='<span class="label">String</span>',me=T(),ve=_("td"),Y=N("Specify the records order attribute(s). "),Se=_("br"),x=N(`
|
||
|
Add `),J=_("code"),J.textContent="-",we=N(" / "),Re=_("code"),Re.textContent="+",ze=N(` (default) in front of the attribute for DESC / ASC order.
|
||
|
Ex.:
|
||
|
`),B(K.$$.fragment),pe=T(),ce=_("tr"),ke=_("td"),ke.textContent="filter",Ge=T(),nt=_("td"),nt.innerHTML='<span class="label">String</span>',et=T(),kt=_("td"),it=N(`Filter the returned records. Ex.:
|
||
|
`),B(Mt.$$.fragment),Be=T(),B(Ye.$$.fragment),dt=T(),ne=_("tr"),_e=_("td"),_e.textContent="expand",Ke=T(),lt=_("td"),lt.innerHTML='<span class="label">String</span>',ut=T(),tt=_("td"),wt=N(`Auto expand record relations. Ex.:
|
||
|
`),B(mt.$$.fragment),jt=N(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),Nt=_("br"),We=N(`
|
||
|
The expanded relations will be appended to each individual record under the
|
||
|
`),$e=_("code"),$e.textContent="@expand",Ve=N(" property (eg. "),Qe=_("code"),Qe.textContent='"@expand": {"rel1": {...}, ...}',rt=N(`). Only the
|
||
|
relations that the user has permissions to `),Pt=_("strong"),Pt.textContent="view",Ft=N(" will be expanded."),Lt=T(),st=_("div"),st.textContent="Responses",I=T(),q=_("div"),ee=_("div");for(let je=0;je<ue.length;je+=1)ue[je].c();se=T(),ye=_("div");for(let je=0;je<Me.length;je+=1)Me[je].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(M,"class","section-title"),p(L,"class","section-title"),p(R,"class","table-compact table-border m-b-lg"),p(st,"class","section-title"),p(ee,"class","tabs-header compact left"),p(ye,"class","tabs-content"),p(q,"class","tabs")},m(je,Xe){w(je,e,Xe),h(e,t),h(e,i),h(e,s),h(s,l),h(l,o),h(l,r),h(r,u),h(l,f),h(e,c),Fe&&Fe.m(e,null),w(je,d,Xe),w(je,m,Xe),h(m,g),h(g,v),h(g,b),h(b,$),h(g,S),w(je,C,Xe),w(je,M,Xe),w(je,D,Xe),V(O,je,Xe),w(je,E,Xe),w(je,L,Xe),w(je,F,Xe),w(je,R,Xe),h(R,H),h(R,te),h(R,Q),h(Q,j),h(Q,X),h(Q,U),h(Q,Z),h(Q,oe),h(oe,ae),h(oe,Te),h(oe,re),h(oe,me),h(oe,ve),h(ve,Y),h(ve,Se),h(ve,x),h(ve,J),h(ve,we),h(ve,Re),h(ve,ze),V(K,ve,null),h(Q,pe),h(Q,ce),h(ce,ke),h(ce,Ge),h(ce,nt),h(ce,et),h(ce,kt),h(kt,it),V(Mt,kt,null),h(kt,Be),V(Ye,kt,null),h(Q,dt),h(Q,ne),h(ne,_e),h(ne,Ke),h(ne,lt),h(ne,ut),h(ne,tt),h(tt,wt),V(mt,tt,null),h(tt,jt),h(tt,Nt),h(tt,We),h(tt,$e),h(tt,Ve),h(tt,Qe),h(tt,rt),h(tt,Pt),h(tt,Ft),w(je,Lt,Xe),w(je,st,Xe),w(je,I,Xe),w(je,q,Xe),h(q,ee);for(let Xt=0;Xt<ue.length;Xt+=1)ue[Xt].m(ee,null);h(q,se),h(q,ye);for(let Xt=0;Xt<Me.length;Xt+=1)Me[Xt].m(ye,null);de=!0},p(je,[Xe]){var Ml,Tl,Dl,Ol;(!de||Xe&1)&&a!==(a=je[0].name+"")&&he(u,a),je[1]?Fe||(Fe=bd(),Fe.c(),Fe.m(e,null)):Fe&&(Fe.d(1),Fe=null),(!de||Xe&1)&&y!==(y=je[0].name+"")&&he($,y);const Xt={};Xe&9&&(Xt.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${je[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
// fetch a paginated records list
|
||
|
const resultList = await client.records.getList('${(Ml=je[0])==null?void 0:Ml.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=je[0])==null?void 0:Tl.name}', 200 /* batch size */, {
|
||
|
sort: '-created',
|
||
|
});
|
||
|
`),Xe&9&&(Xt.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${je[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
// fetch a paginated records list
|
||
|
final result = await client.records.getList(
|
||
|
'${(Dl=je[0])==null?void 0:Dl.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('${(Ol=je[0])==null?void 0:Ol.name}', batch: 200, sort: '-created');
|
||
|
`),O.$set(Xt),Xe&20&&(pt=je[4],ue=ht(ue,Xe,on,1,je,pt,Ae,ee,mn,vd,null,_d)),Xe&20&&(qt=je[4],Pe(),Me=ht(Me,Xe,Si,1,je,qt,fe,ye,Gt,yd,null,gd),Le())},i(je){if(!de){A(O.$$.fragment,je),A(K.$$.fragment,je),A(Mt.$$.fragment,je),A(Ye.$$.fragment,je),A(mt.$$.fragment,je);for(let Xe=0;Xe<qt.length;Xe+=1)A(Me[Xe]);de=!0}},o(je){P(O.$$.fragment,je),P(K.$$.fragment,je),P(Mt.$$.fragment,je),P(Ye.$$.fragment,je),P(mt.$$.fragment,je);for(let Xe=0;Xe<Me.length;Xe+=1)P(Me[Xe]);de=!1},d(je){je&&k(e),Fe&&Fe.d(),je&&k(d),je&&k(m),je&&k(C),je&&k(M),je&&k(D),z(O,je),je&&k(E),je&&k(L),je&&k(F),je&&k(R),z(K),z(Mt),z(Ye),z(mt),je&&k(Lt),je&&k(st),je&&k(I),je&&k(q);for(let Xe=0;Xe<ue.length;Xe+=1)ue[Xe].d();for(let Xe=0;Xe<Me.length;Xe+=1)Me[Xe].d()}}}function MC(n,e,t){let i,s,{collection:l=new En}=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:[W.dummyCollectionRecord(l),W.dummyCollectionRecord(l)]},null,2)}),r.push({code:400,body:`
|
||
|
{
|
||
|
"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=window.location.href.substring(0,window.location.href.indexOf("/_"))||be.baseUrl),[l,i,o,s,r,a]}class TC extends Ee{constructor(e){super(),Oe(this,e,MC,CC,De,{collection:0})}}function kd(n,e,t){const i=n.slice();return i[6]=e[t],i}function wd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Sd(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 $d(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=N(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),h(t,s),h(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 Cd(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),B(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),V(i,t,null),h(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),z(i)}}}function DC(n){var Nt,We;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,m,g,v,b,y,$=n[0].name+"",S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U,Z,oe,ae,Te,re,me,ve,Y,Se,x,J,we,Re,ze,K,pe,ce,ke,Ge,nt,et,kt,it,Mt,Be=[],Ye=new Map,dt,ne,_e=[],Ke=new Map,lt,ut=n[1]&&Sd();E=new Es({props:{js:`
|
||
|
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('${(We=n[0])==null?void 0:We.name}', 'RECORD_ID', query: {
|
||
|
'expand': 'some_relation',
|
||
|
});
|
||
|
`}}),x=new hn({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let tt=n[4];const wt=$e=>$e[6].code;for(let $e=0;$e<tt.length;$e+=1){let Ve=wd(n,tt,$e),Qe=wt(Ve);Ye.set(Qe,Be[$e]=$d(Qe,Ve))}let mt=n[4];const jt=$e=>$e[6].code;for(let $e=0;$e<mt.length;$e+=1){let Ve=kd(n,mt,$e),Qe=jt(Ve);Ke.set(Qe,_e[$e]=Cd(Qe,Ve))}return{c(){e=_("div"),t=_("strong"),t.textContent="GET",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=T(),ut&&ut.c(),m=T(),g=_("div"),v=_("p"),b=N("Fetch a single "),y=_("strong"),S=N($),C=N(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),B(E.$$.fragment),L=T(),F=_("div"),F.textContent="Path Parameters",R=T(),H=_("table"),H.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>`,te=T(),Q=_("div"),Q.textContent="Query parameters",j=T(),X=_("table"),U=_("thead"),U.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,Z=T(),oe=_("tbody"),ae=_("tr"),Te=_("td"),Te.textContent="expand",re=T(),me=_("td"),me.innerHTML='<span class="label">String</span>',ve=T(),Y=_("td"),Se=N(`Auto expand record relations. Ex.:
|
||
|
`),B(x.$$.fragment),J=N(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),we=_("br"),Re=N(`
|
||
|
The expanded relations will be appended to the record under the
|
||
|
`),ze=_("code"),ze.textContent="@expand",K=N(" property (eg. "),pe=_("code"),pe.textContent='"@expand": {"rel1": {...}, ...}',ce=N(`). Only the
|
||
|
relations that the user has permissions to `),ke=_("strong"),ke.textContent="view",Ge=N(" will be expanded."),nt=T(),et=_("div"),et.textContent="Responses",kt=T(),it=_("div"),Mt=_("div");for(let $e=0;$e<Be.length;$e+=1)Be[$e].c();dt=T(),ne=_("div");for(let $e=0;$e<_e.length;$e+=1)_e[$e].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-info"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(F,"class","section-title"),p(H,"class","table-compact table-border m-b-lg"),p(Q,"class","section-title"),p(X,"class","table-compact table-border m-b-lg"),p(et,"class","section-title"),p(Mt,"class","tabs-header compact left"),p(ne,"class","tabs-content"),p(it,"class","tabs")},m($e,Ve){w($e,e,Ve),h(e,t),h(e,i),h(e,s),h(s,l),h(l,o),h(l,r),h(r,u),h(l,f),h(l,c),h(e,d),ut&&ut.m(e,null),w($e,m,Ve),w($e,g,Ve),h(g,v),h(v,b),h(v,y),h(y,S),h(v,C),w($e,M,Ve),w($e,D,Ve),w($e,O,Ve),V(E,$e,Ve),w($e,L,Ve),w($e,F,Ve),w($e,R,Ve),w($e,H,Ve),w($e,te,Ve),w($e,Q,Ve),w($e,j,Ve),w($e,X,Ve),h(X,U),h(X,Z),h(X,oe),h(oe,ae),h(ae,Te),h(ae,re),h(ae,me),h(ae,ve),h(ae,Y),h(Y,Se),V(x,Y,null),h(Y,J),h(Y,we),h(Y,Re),h(Y,ze),h(Y,K),h(Y,pe),h(Y,ce),h(Y,ke),h(Y,Ge),w($e,nt,Ve),w($e,et,Ve),w($e,kt,Ve),w($e,it,Ve),h(it,Mt);for(let Qe=0;Qe<Be.length;Qe+=1)Be[Qe].m(Mt,null);h(it,dt),h(it,ne);for(let Qe=0;Qe<_e.length;Qe+=1)_e[Qe].m(ne,null);lt=!0},p($e,[Ve]){var rt,Pt;(!lt||Ve&1)&&a!==(a=$e[0].name+"")&&he(u,a),$e[1]?ut||(ut=Sd(),ut.c(),ut.m(e,null)):ut&&(ut.d(1),ut=null),(!lt||Ve&1)&&$!==($=$e[0].name+"")&&he(S,$);const Qe={};Ve&9&&(Qe.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${$e[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const record = await client.records.getOne('${(rt=$e[0])==null?void 0:rt.name}', 'RECORD_ID', {
|
||
|
expand: 'some_relation'
|
||
|
});
|
||
|
`),Ve&9&&(Qe.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',
|
||
|
});
|
||
|
`),E.$set(Qe),Ve&20&&(tt=$e[4],Be=ht(Be,Ve,wt,1,$e,tt,Ye,Mt,mn,$d,null,wd)),Ve&20&&(mt=$e[4],Pe(),_e=ht(_e,Ve,jt,1,$e,mt,Ke,ne,Gt,Cd,null,kd),Le())},i($e){if(!lt){A(E.$$.fragment,$e),A(x.$$.fragment,$e);for(let Ve=0;Ve<mt.length;Ve+=1)A(_e[Ve]);lt=!0}},o($e){P(E.$$.fragment,$e),P(x.$$.fragment,$e);for(let Ve=0;Ve<_e.length;Ve+=1)P(_e[Ve]);lt=!1},d($e){$e&&k(e),ut&&ut.d(),$e&&k(m),$e&&k(g),$e&&k(M),$e&&k(D),$e&&k(O),z(E,$e),$e&&k(L),$e&&k(F),$e&&k(R),$e&&k(H),$e&&k(te),$e&&k(Q),$e&&k(j),$e&&k(X),z(x),$e&&k(nt),$e&&k(et),$e&&k(kt),$e&&k(it);for(let Ve=0;Ve<Be.length;Ve+=1)Be[Ve].d();for(let Ve=0;Ve<_e.length;Ve+=1)_e[Ve].d()}}}function OC(n,e,t){let i,s,{collection:l=new En}=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(W.dummyCollectionRecord(l),null,2)}),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=window.location.href.substring(0,window.location.href.indexOf("/_"))||be.baseUrl),[l,i,o,s,r,a]}class EC extends Ee{constructor(e){super(),Oe(this,e,OC,DC,De,{collection:0})}}function Md(n,e,t){const i=n.slice();return i[6]=e[t],i}function Td(n,e,t){const i=n.slice();return i[6]=e[t],i}function Dd(n,e,t){const i=n.slice();return i[11]=e[t],i}function Od(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 AC(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 PC(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 LC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},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")&&he(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function FC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},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")&&he(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function IC(n){let e,t,i,s,l;return{c(){e=N("FormData object."),t=_("br"),i=N(`
|
||
|
Set to `),s=_("code"),s.textContent="null",l=N(" 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:le,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function NC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function RC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function HC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function jC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function qC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Ed(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",m,g,v,b;function y(O,E){return O[11].required?PC:AC}let $=y(e),S=$(e);function C(O,E){if(O[11].type==="text")return qC;if(O[11].type==="number")return jC;if(O[11].type==="json")return HC;if(O[11].type==="email")return RC;if(O[11].type==="url")return NC;if(O[11].type==="file")return IC;if(O[11].type==="relation")return FC;if(O[11].type==="user")return LC}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=N(r),u=T(),f=_("td"),c=_("span"),m=N(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),h(t,i),h(i,s),S.m(s,null),h(s,l),h(s,o),h(o,a),h(t,u),h(t,f),h(f,c),h(c,m),h(t,g),h(t,v),D&&D.m(v,null),h(t,b)},p(O,E){e=O,$!==($=y(e))&&(S.d(1),S=$(e),S&&(S.c(),S.m(s,l))),E&1&&r!==(r=e[11].name+"")&&he(a,r),E&1&&d!==(d=W.getFieldValueType(e[11])+"")&&he(m,d),M===(M=C(e))&&D?D.p(e,E):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&k(t),S.d(),D&&D.d()}}}function Ad(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=N(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),h(t,s),h(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&he(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function Pd(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),B(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),V(i,t,null),h(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||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),z(i)}}}function VC(n){var ee,ue,Ae;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,m,g,v,b,y=n[0].name+"",$,S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U,Z,oe,ae,Te=[],re=new Map,me,ve,Y,Se,x,J,we,Re,ze,K,pe,ce,ke,Ge,nt,et,kt,it,Mt,Be,Ye,dt,ne,_e,Ke,lt,ut,tt,wt,mt=[],jt=new Map,Nt,We,$e=[],Ve=new Map,Qe,rt=n[4]&&Od();R=new Es({props:{js:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.create('${(ee=n[0])==null?void 0:ee.name}', data);
|
||
|
`,dart:`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
final body = <String, dynamic>{ ... };
|
||
|
|
||
|
final record = await client.records.create('${(ue=n[0])==null?void 0:ue.name}', body: body);
|
||
|
`}});let Pt=(Ae=n[0])==null?void 0:Ae.schema;const Ft=se=>se[11].name;for(let se=0;se<Pt.length;se+=1){let ye=Dd(n,Pt,se),Me=Ft(ye);re.set(Me,Te[se]=Ed(Me,ye))}nt=new hn({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let Lt=n[2];const st=se=>se[6].code;for(let se=0;se<Lt.length;se+=1){let ye=Td(n,Lt,se),Me=st(ye);jt.set(Me,mt[se]=Ad(Me,ye))}let I=n[2];const q=se=>se[6].code;for(let se=0;se<I.length;se+=1){let ye=Md(n,I,se),Me=q(ye);Ve.set(Me,$e[se]=Pd(Me,ye))}return{c(){e=_("div"),t=_("strong"),t.textContent="POST",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records"),c=T(),rt&&rt.c(),d=T(),m=_("div"),g=_("p"),v=N("Create a new "),b=_("strong"),$=N(y),S=N(" record."),C=T(),M=_("p"),M.innerHTML=`Body parameters could be sent as <code>application/json</code> or
|
||
|
<code>multipart/form-data</code>.`,D=T(),O=_("p"),O.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",E=T(),L=_("div"),L.textContent="Client SDKs example",F=T(),B(R.$$.fragment),H=T(),te=_("div"),te.textContent="Body Parameters",Q=T(),j=_("table"),X=_("thead"),X.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="50%">Description</th></tr>`,U=T(),Z=_("tbody"),oe=_("tr"),oe.innerHTML=`<td><div class="inline-flex"><span class="label label-warning">Optional</span>
|
||
|
<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>`,ae=T();for(let se=0;se<Te.length;se+=1)Te[se].c();me=T(),ve=_("div"),ve.textContent="Query parameters",Y=T(),Se=_("table"),x=_("thead"),x.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,J=T(),we=_("tbody"),Re=_("tr"),ze=_("td"),ze.textContent="expand",K=T(),pe=_("td"),pe.innerHTML='<span class="label">String</span>',ce=T(),ke=_("td"),Ge=N(`Auto expand relations when returning the created record. Ex.:
|
||
|
`),B(nt.$$.fragment),et=N(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),kt=_("br"),it=N(`
|
||
|
The expanded relations will be appended to the record under the
|
||
|
`),Mt=_("code"),Mt.textContent="@expand",Be=N(" property (eg. "),Ye=_("code"),Ye.textContent='"@expand": {"rel1": {...}, ...}',dt=N(`). Only the
|
||
|
relations that the user has permissions to `),ne=_("strong"),ne.textContent="view",_e=N(" will be expanded."),Ke=T(),lt=_("div"),lt.textContent="Responses",ut=T(),tt=_("div"),wt=_("div");for(let se=0;se<mt.length;se+=1)mt[se].c();Nt=T(),We=_("div");for(let se=0;se<$e.length;se+=1)$e[se].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-success"),p(m,"class","content m-b-base"),p(L,"class","section-title"),p(te,"class","section-title"),p(j,"class","table-compact table-border m-b-lg"),p(ve,"class","section-title"),p(Se,"class","table-compact table-border m-b-lg"),p(lt,"class","section-title"),p(wt,"class","tabs-header compact left"),p(We,"class","tabs-content"),p(tt,"class","tabs")},m(se,ye){w(se,e,ye),h(e,t),h(e,i),h(e,s),h(s,l),h(l,o),h(l,r),h(r,u),h(l,f),h(e,c),rt&&rt.m(e,null),w(se,d,ye),w(se,m,ye),h(m,g),h(g,v),h(g,b),h(b,$),h(g,S),h(m,C),h(m,M),h(m,D),h(m,O),w(se,E,ye),w(se,L,ye),w(se,F,ye),V(R,se,ye),w(se,H,ye),w(se,te,ye),w(se,Q,ye),w(se,j,ye),h(j,X),h(j,U),h(j,Z),h(Z,oe),h(Z,ae);for(let Me=0;Me<Te.length;Me+=1)Te[Me].m(Z,null);w(se,me,ye),w(se,ve,ye),w(se,Y,ye),w(se,Se,ye),h(Se,x),h(Se,J),h(Se,we),h(we,Re),h(Re,ze),h(Re,K),h(Re,pe),h(Re,ce),h(Re,ke),h(ke,Ge),V(nt,ke,null),h(ke,et),h(ke,kt),h(ke,it),h(ke,Mt),h(ke,Be),h(ke,Ye),h(ke,dt),h(ke,ne),h(ke,_e),w(se,Ke,ye),w(se,lt,ye),w(se,ut,ye),w(se,tt,ye),h(tt,wt);for(let Me=0;Me<mt.length;Me+=1)mt[Me].m(wt,null);h(tt,Nt),h(tt,We);for(let Me=0;Me<$e.length;Me+=1)$e[Me].m(We,null);Qe=!0},p(se,[ye]){var fe,de,Fe;(!Qe||ye&1)&&a!==(a=se[0].name+"")&&he(u,a),se[4]?rt||(rt=Od(),rt.c(),rt.m(e,null)):rt&&(rt.d(1),rt=null),(!Qe||ye&1)&&y!==(y=se[0].name+"")&&he($,y);const Me={};ye&9&&(Me.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${se[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.create('${(fe=se[0])==null?void 0:fe.name}', data);
|
||
|
`),ye&9&&(Me.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${se[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
final body = <String, dynamic>{ ... };
|
||
|
|
||
|
final record = await client.records.create('${(de=se[0])==null?void 0:de.name}', body: body);
|
||
|
`),R.$set(Me),ye&1&&(Pt=(Fe=se[0])==null?void 0:Fe.schema,Te=ht(Te,ye,Ft,1,se,Pt,re,Z,mn,Ed,null,Dd)),ye&6&&(Lt=se[2],mt=ht(mt,ye,st,1,se,Lt,jt,wt,mn,Ad,null,Td)),ye&6&&(I=se[2],Pe(),$e=ht($e,ye,q,1,se,I,Ve,We,Gt,Pd,null,Md),Le())},i(se){if(!Qe){A(R.$$.fragment,se),A(nt.$$.fragment,se);for(let ye=0;ye<I.length;ye+=1)A($e[ye]);Qe=!0}},o(se){P(R.$$.fragment,se),P(nt.$$.fragment,se);for(let ye=0;ye<$e.length;ye+=1)P($e[ye]);Qe=!1},d(se){se&&k(e),rt&&rt.d(),se&&k(d),se&&k(m),se&&k(E),se&&k(L),se&&k(F),z(R,se),se&&k(H),se&&k(te),se&&k(Q),se&&k(j);for(let ye=0;ye<Te.length;ye+=1)Te[ye].d();se&&k(me),se&&k(ve),se&&k(Y),se&&k(Se),z(nt),se&&k(Ke),se&&k(lt),se&&k(ut),se&&k(tt);for(let ye=0;ye<mt.length;ye+=1)mt[ye].d();for(let ye=0;ye<$e.length;ye+=1)$e[ye].d()}}}function zC(n,e,t){let i,s,{collection:l=new En}=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(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||
|
{
|
||
|
"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=window.location.href.substring(0,window.location.href.indexOf("/_"))||be.baseUrl),[l,o,r,s,i,a]}class BC extends Ee{constructor(e){super(),Oe(this,e,zC,VC,De,{collection:0})}}function Ld(n,e,t){const i=n.slice();return i[6]=e[t],i}function Fd(n,e,t){const i=n.slice();return i[6]=e[t],i}function Id(n,e,t){const i=n.slice();return i[11]=e[t],i}function Nd(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 UC(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 WC(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 YC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("User "),i=N(t),s=N(".")},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")&&he(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function KC(n){var l;let e,t=((l=n[11].options)==null?void 0:l.maxSelect)>1?"ids":"id",i,s;return{c(){e=N("Relation record "),i=N(t),s=N(".")},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")&&he(i,t)},d(o){o&&k(e),o&&k(i),o&&k(s)}}}function ZC(n){let e,t,i,s,l;return{c(){e=N("FormData object."),t=_("br"),i=N(`
|
||
|
Set to `),s=_("code"),s.textContent="null",l=N(" 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:le,d(o){o&&k(e),o&&k(t),o&&k(i),o&&k(s),o&&k(l)}}}function JC(n){let e;return{c(){e=N("URL address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function GC(n){let e;return{c(){e=N("Email address.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function XC(n){let e;return{c(){e=N("JSON array or object.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function QC(n){let e;return{c(){e=N("Number value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function xC(n){let e;return{c(){e=N("Plain text value.")},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function Rd(n,e){let t,i,s,l,o,r=e[11].name+"",a,u,f,c,d=W.getFieldValueType(e[11])+"",m,g,v,b;function y(O,E){return O[11].required?WC:UC}let $=y(e),S=$(e);function C(O,E){if(O[11].type==="text")return xC;if(O[11].type==="number")return QC;if(O[11].type==="json")return XC;if(O[11].type==="email")return GC;if(O[11].type==="url")return JC;if(O[11].type==="file")return ZC;if(O[11].type==="relation")return KC;if(O[11].type==="user")return YC}let M=C(e),D=M&&M(e);return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),S.c(),l=T(),o=_("span"),a=N(r),u=T(),f=_("td"),c=_("span"),m=N(d),g=T(),v=_("td"),D&&D.c(),b=T(),p(s,"class","inline-flex"),p(c,"class","label"),this.first=t},m(O,E){w(O,t,E),h(t,i),h(i,s),S.m(s,null),h(s,l),h(s,o),h(o,a),h(t,u),h(t,f),h(f,c),h(c,m),h(t,g),h(t,v),D&&D.m(v,null),h(t,b)},p(O,E){e=O,$!==($=y(e))&&(S.d(1),S=$(e),S&&(S.c(),S.m(s,l))),E&1&&r!==(r=e[11].name+"")&&he(a,r),E&1&&d!==(d=W.getFieldValueType(e[11])+"")&&he(m,d),M===(M=C(e))&&D?D.p(e,E):(D&&D.d(1),D=M&&M(e),D&&(D.c(),D.m(v,null)))},d(O){O&&k(t),S.d(),D&&D.d()}}}function Hd(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=N(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),h(t,s),h(t,l),o||(r=G(t,"click",a),o=!0)},p(u,f){e=u,f&4&&i!==(i=e[6].code+"")&&he(s,i),f&6&&ie(t,"active",e[1]===e[6].code)},d(u){u&&k(t),o=!1,r()}}}function jd(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),B(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),V(i,t,null),h(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||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),z(i)}}}function e3(n){var se,ye,Me;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,m,g,v,b,y,$=n[0].name+"",S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U,Z,oe,ae,Te,re,me,ve=[],Y=new Map,Se,x,J,we,Re,ze,K,pe,ce,ke,Ge,nt,et,kt,it,Mt,Be,Ye,dt,ne,_e,Ke,lt,ut,tt,wt,mt,jt,Nt,We=[],$e=new Map,Ve,Qe,rt=[],Pt=new Map,Ft,Lt=n[4]&&Nd();H=new Es({props:{js:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.update('${(se=n[0])==null?void 0:se.name}', 'RECORD_ID', data);
|
||
|
`,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 st=(Me=n[0])==null?void 0:Me.schema;const I=fe=>fe[11].name;for(let fe=0;fe<st.length;fe+=1){let de=Id(n,st,fe),Fe=I(de);Y.set(Fe,ve[fe]=Rd(Fe,de))}it=new hn({props:{content:`
|
||
|
?expand=rel1,rel2.subrel21.subrel22
|
||
|
`}});let q=n[2];const ee=fe=>fe[6].code;for(let fe=0;fe<q.length;fe+=1){let de=Fd(n,q,fe),Fe=ee(de);$e.set(Fe,We[fe]=Hd(Fe,de))}let ue=n[2];const Ae=fe=>fe[6].code;for(let fe=0;fe<ue.length;fe+=1){let de=Ld(n,ue,fe),Fe=Ae(de);Pt.set(Fe,rt[fe]=jd(Fe,de))}return{c(){e=_("div"),t=_("strong"),t.textContent="PATCH",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=T(),Lt&&Lt.c(),m=T(),g=_("div"),v=_("p"),b=N("Update a single "),y=_("strong"),S=N($),C=N(" 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(),E=_("p"),E.innerHTML="File upload is supported only via <code>multipart/form-data</code>.",L=T(),F=_("div"),F.textContent="Client SDKs example",R=T(),B(H.$$.fragment),te=T(),Q=_("div"),Q.textContent="Path parameters",j=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>`,U=T(),Z=_("div"),Z.textContent="Body Parameters",oe=T(),ae=_("table"),Te=_("thead"),Te.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="50%">Description</th></tr>`,re=T(),me=_("tbody");for(let fe=0;fe<ve.length;fe+=1)ve[fe].c();Se=T(),x=_("div"),x.textContent="Query parameters",J=T(),we=_("table"),Re=_("thead"),Re.innerHTML=`<tr><th>Param</th>
|
||
|
<th>Type</th>
|
||
|
<th width="60%">Description</th></tr>`,ze=T(),K=_("tbody"),pe=_("tr"),ce=_("td"),ce.textContent="expand",ke=T(),Ge=_("td"),Ge.innerHTML='<span class="label">String</span>',nt=T(),et=_("td"),kt=N(`Auto expand relations when returning the updated record. Ex.:
|
||
|
`),B(it.$$.fragment),Mt=N(`
|
||
|
Supports up to 6-levels depth nested relations expansion. `),Be=_("br"),Ye=N(`
|
||
|
The expanded relations will be appended to the record under the
|
||
|
`),dt=_("code"),dt.textContent="@expand",ne=N(" property (eg. "),_e=_("code"),_e.textContent='"@expand": {"rel1": {...}, ...}',Ke=N(`). Only the
|
||
|
relations that the user has permissions to `),lt=_("strong"),lt.textContent="view",ut=N(" will be expanded."),tt=T(),wt=_("div"),wt.textContent="Responses",mt=T(),jt=_("div"),Nt=_("div");for(let fe=0;fe<We.length;fe+=1)We[fe].c();Ve=T(),Qe=_("div");for(let fe=0;fe<rt.length;fe+=1)rt[fe].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-warning"),p(g,"class","content m-b-base"),p(F,"class","section-title"),p(Q,"class","section-title"),p(X,"class","table-compact table-border m-b-lg"),p(Z,"class","section-title"),p(ae,"class","table-compact table-border m-b-lg"),p(x,"class","section-title"),p(we,"class","table-compact table-border m-b-lg"),p(wt,"class","section-title"),p(Nt,"class","tabs-header compact left"),p(Qe,"class","tabs-content"),p(jt,"class","tabs")},m(fe,de){w(fe,e,de),h(e,t),h(e,i),h(e,s),h(s,l),h(l,o),h(l,r),h(r,u),h(l,f),h(l,c),h(e,d),Lt&&Lt.m(e,null),w(fe,m,de),w(fe,g,de),h(g,v),h(v,b),h(v,y),h(y,S),h(v,C),h(g,M),h(g,D),h(g,O),h(g,E),w(fe,L,de),w(fe,F,de),w(fe,R,de),V(H,fe,de),w(fe,te,de),w(fe,Q,de),w(fe,j,de),w(fe,X,de),w(fe,U,de),w(fe,Z,de),w(fe,oe,de),w(fe,ae,de),h(ae,Te),h(ae,re),h(ae,me);for(let Fe=0;Fe<ve.length;Fe+=1)ve[Fe].m(me,null);w(fe,Se,de),w(fe,x,de),w(fe,J,de),w(fe,we,de),h(we,Re),h(we,ze),h(we,K),h(K,pe),h(pe,ce),h(pe,ke),h(pe,Ge),h(pe,nt),h(pe,et),h(et,kt),V(it,et,null),h(et,Mt),h(et,Be),h(et,Ye),h(et,dt),h(et,ne),h(et,_e),h(et,Ke),h(et,lt),h(et,ut),w(fe,tt,de),w(fe,wt,de),w(fe,mt,de),w(fe,jt,de),h(jt,Nt);for(let Fe=0;Fe<We.length;Fe+=1)We[Fe].m(Nt,null);h(jt,Ve),h(jt,Qe);for(let Fe=0;Fe<rt.length;Fe+=1)rt[Fe].m(Qe,null);Ft=!0},p(fe,[de]){var pt,on,qt;(!Ft||de&1)&&a!==(a=fe[0].name+"")&&he(u,a),fe[4]?Lt||(Lt=Nd(),Lt.c(),Lt.m(e,null)):Lt&&(Lt.d(1),Lt=null),(!Ft||de&1)&&$!==($=fe[0].name+"")&&he(S,$);const Fe={};de&9&&(Fe.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${fe[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
const data = { ... };
|
||
|
|
||
|
const record = await client.records.update('${(pt=fe[0])==null?void 0:pt.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('${(on=fe[0])==null?void 0:on.name}', 'RECORD_ID', body: body);
|
||
|
`),H.$set(Fe),de&1&&(st=(qt=fe[0])==null?void 0:qt.schema,ve=ht(ve,de,I,1,fe,st,Y,me,mn,Rd,null,Id)),de&6&&(q=fe[2],We=ht(We,de,ee,1,fe,q,$e,Nt,mn,Hd,null,Fd)),de&6&&(ue=fe[2],Pe(),rt=ht(rt,de,Ae,1,fe,ue,Pt,Qe,Gt,jd,null,Ld),Le())},i(fe){if(!Ft){A(H.$$.fragment,fe),A(it.$$.fragment,fe);for(let de=0;de<ue.length;de+=1)A(rt[de]);Ft=!0}},o(fe){P(H.$$.fragment,fe),P(it.$$.fragment,fe);for(let de=0;de<rt.length;de+=1)P(rt[de]);Ft=!1},d(fe){fe&&k(e),Lt&&Lt.d(),fe&&k(m),fe&&k(g),fe&&k(L),fe&&k(F),fe&&k(R),z(H,fe),fe&&k(te),fe&&k(Q),fe&&k(j),fe&&k(X),fe&&k(U),fe&&k(Z),fe&&k(oe),fe&&k(ae);for(let de=0;de<ve.length;de+=1)ve[de].d();fe&&k(Se),fe&&k(x),fe&&k(J),fe&&k(we),z(it),fe&&k(tt),fe&&k(wt),fe&&k(mt),fe&&k(jt);for(let de=0;de<We.length;de+=1)We[de].d();for(let de=0;de<rt.length;de+=1)rt[de].d()}}}function t3(n,e,t){let i,s,{collection:l=new En}=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(W.dummyCollectionRecord(l),null,2)},{code:400,body:`
|
||
|
{
|
||
|
"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=window.location.href.substring(0,window.location.href.indexOf("/_"))||be.baseUrl),[l,o,r,s,i,a]}class n3 extends Ee{constructor(e){super(),Oe(this,e,t3,e3,De,{collection:0})}}function qd(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 zd(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 Bd(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=N(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),h(t,s),h(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 Ud(n,e){let t,i,s,l;return i=new hn({props:{content:e[6].body}}),{key:n,first:null,c(){t=_("div"),B(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),V(i,t,null),h(t,s),l=!0},p(o,r){e=o,r&20&&ie(t,"active",e[2]===e[6].code)},i(o){l||(A(i.$$.fragment,o),l=!0)},o(o){P(i.$$.fragment,o),l=!1},d(o){o&&k(t),z(i)}}}function i3(n){var Re,ze;let e,t,i,s,l,o,r,a=n[0].name+"",u,f,c,d,m,g,v,b,y,$=n[0].name+"",S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U,Z=[],oe=new Map,ae,Te,re=[],me=new Map,ve,Y=n[1]&&zd();E=new Es({props:{js:`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
await client.records.delete('${(Re=n[0])==null?void 0:Re.name}', 'RECORD_ID');
|
||
|
`,dart:`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${n[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
await client.records.delete('${(ze=n[0])==null?void 0:ze.name}', 'RECORD_ID');
|
||
|
`}});let Se=n[4];const x=K=>K[6].code;for(let K=0;K<Se.length;K+=1){let pe=Vd(n,Se,K),ce=x(pe);oe.set(ce,Z[K]=Bd(ce,pe))}let J=n[4];const we=K=>K[6].code;for(let K=0;K<J.length;K+=1){let pe=qd(n,J,K),ce=we(pe);me.set(ce,re[K]=Ud(ce,pe))}return{c(){e=_("div"),t=_("strong"),t.textContent="DELETE",i=T(),s=_("div"),l=_("p"),o=N("/api/collections/"),r=_("strong"),u=N(a),f=N("/records/"),c=_("strong"),c.textContent=":id",d=T(),Y&&Y.c(),m=T(),g=_("div"),v=_("p"),b=N("Delete a single "),y=_("strong"),S=N($),C=N(" record."),M=T(),D=_("div"),D.textContent="Client SDKs example",O=T(),B(E.$$.fragment),L=T(),F=_("div"),F.textContent="Path parameters",R=T(),H=_("table"),H.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 delete.</td></tr></tbody>`,te=T(),Q=_("div"),Q.textContent="Responses",j=T(),X=_("div"),U=_("div");for(let K=0;K<Z.length;K+=1)Z[K].c();ae=T(),Te=_("div");for(let K=0;K<re.length;K+=1)re[K].c();p(t,"class","label label-primary"),p(s,"class","content"),p(e,"class","alert alert-danger"),p(g,"class","content m-b-base"),p(D,"class","section-title"),p(F,"class","section-title"),p(H,"class","table-compact table-border m-b-lg"),p(Q,"class","section-title"),p(U,"class","tabs-header compact left"),p(Te,"class","tabs-content"),p(X,"class","tabs")},m(K,pe){w(K,e,pe),h(e,t),h(e,i),h(e,s),h(s,l),h(l,o),h(l,r),h(r,u),h(l,f),h(l,c),h(e,d),Y&&Y.m(e,null),w(K,m,pe),w(K,g,pe),h(g,v),h(v,b),h(v,y),h(y,S),h(v,C),w(K,M,pe),w(K,D,pe),w(K,O,pe),V(E,K,pe),w(K,L,pe),w(K,F,pe),w(K,R,pe),w(K,H,pe),w(K,te,pe),w(K,Q,pe),w(K,j,pe),w(K,X,pe),h(X,U);for(let ce=0;ce<Z.length;ce+=1)Z[ce].m(U,null);h(X,ae),h(X,Te);for(let ce=0;ce<re.length;ce+=1)re[ce].m(Te,null);ve=!0},p(K,[pe]){var ke,Ge;(!ve||pe&1)&&a!==(a=K[0].name+"")&&he(u,a),K[1]?Y||(Y=zd(),Y.c(),Y.m(e,null)):Y&&(Y.d(1),Y=null),(!ve||pe&1)&&$!==($=K[0].name+"")&&he(S,$);const ce={};pe&9&&(ce.js=`
|
||
|
import PocketBase from 'pocketbase';
|
||
|
|
||
|
const client = new PocketBase('${K[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
await client.records.delete('${(ke=K[0])==null?void 0:ke.name}', 'RECORD_ID');
|
||
|
`),pe&9&&(ce.dart=`
|
||
|
import 'package:pocketbase/pocketbase.dart';
|
||
|
|
||
|
final client = PocketBase('${K[3]}');
|
||
|
|
||
|
...
|
||
|
|
||
|
await client.records.delete('${(Ge=K[0])==null?void 0:Ge.name}', 'RECORD_ID');
|
||
|
`),E.$set(ce),pe&20&&(Se=K[4],Z=ht(Z,pe,x,1,K,Se,oe,U,mn,Bd,null,Vd)),pe&20&&(J=K[4],Pe(),re=ht(re,pe,we,1,K,J,me,Te,Gt,Ud,null,qd),Le())},i(K){if(!ve){A(E.$$.fragment,K);for(let pe=0;pe<J.length;pe+=1)A(re[pe]);ve=!0}},o(K){P(E.$$.fragment,K);for(let pe=0;pe<re.length;pe+=1)P(re[pe]);ve=!1},d(K){K&&k(e),Y&&Y.d(),K&&k(m),K&&k(g),K&&k(M),K&&k(D),K&&k(O),z(E,K),K&&k(L),K&&k(F),K&&k(R),K&&k(H),K&&k(te),K&&k(Q),K&&k(j),K&&k(X);for(let pe=0;pe<Z.length;pe+=1)Z[pe].d();for(let pe=0;pe<re.length;pe+=1)re[pe].d()}}}function s3(n,e,t){let i,s,{collection:l=new En}=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:`
|
||
|
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=window.location.href.substring(0,window.location.href.indexOf("/_"))||be.baseUrl),[l,i,o,s,r,a]}class l3 extends Ee{constructor(e){super(),Oe(this,e,s3,i3,De,{collection:0})}}function o3(n){var m,g,v,b,y,$,S,C;let e,t,i,s,l,o,r,a,u,f,c,d;return r=new Es({props:{js:`
|
||
|
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('${(m=n[0])==null?void 0:m.name}', function (e) {
|
||
|
console.log(e.record);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.realtime.subscribe('${(g=n[0])==null?void 0:g.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('${($=n[0])==null?void 0:$.name}/RECORD_ID', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.realtime.unsubscribe() // remove all subscriptions
|
||
|
client.realtime.unsubscribe('${(S=n[0])==null?void 0:S.name}') // remove only the collection subscription
|
||
|
client.realtime.unsubscribe('${(C=n[0])==null?void 0:C.name}/RECORD_ID') // remove only the record subscription
|
||
|
`}}),c=new hn({props:{content:JSON.stringify({action:"create",record:W.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>
|
||
|
<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 "Event data format" 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'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'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(),B(r.$$.fragment),a=T(),u=_("div"),u.textContent="Event data format",f=T(),B(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),V(r,M,D),w(M,a,D),w(M,u,D),w(M,f,D),V(c,M,D),d=!0},p(M,[D]){var L,F,R,H,te,Q,j,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('${(L=M[0])==null?void 0:L.name}', function (e) {
|
||
|
console.log(e.record);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.realtime.subscribe('${(F=M[0])==null?void 0:F.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('${(H=M[0])==null?void 0:H.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('${(te=M[0])==null?void 0:te.name}', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Subscribe to changes in a single record
|
||
|
client.realtime.subscribe('${(Q=M[0])==null?void 0:Q.name}/RECORD_ID', (e) {
|
||
|
print(e.record);
|
||
|
});
|
||
|
|
||
|
// Unsubscribe
|
||
|
client.realtime.unsubscribe() // remove all subscriptions
|
||
|
client.realtime.unsubscribe('${(j=M[0])==null?void 0:j.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 E={};D&1&&(E.content=JSON.stringify({action:"create",record:W.dummyCollectionRecord(M[0])},null,2).replace('"action": "create"','"action": "create" // create, update or delete')),c.$set(E)},i(M){d||(A(r.$$.fragment,M),A(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),z(r,M),M&&k(a),M&&k(u),M&&k(f),z(c,M)}}}function r3(n,e,t){let i,{collection:s=new En}=e;return n.$$set=l=>{"collection"in l&&t(0,s=l.collection)},t(1,i=window.location.href.substring(0,window.location.href.indexOf("/_"))||be.baseUrl),[s,i]}class a3 extends Ee{constructor(e){super(),Oe(this,e,r3,o3,De,{collection:0})}}function Wd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Yd(n,e,t){const i=n.slice();return i[14]=e[t],i}function Kd(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&&B(t.$$.fragment),i=T(),p(e,"class","tab-item active")},m(r,a){w(r,e,a),t&&V(t,e,null),h(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,()=>{z(f,1)}),Le()}l?(t=new l(o(r)),B(t.$$.fragment),A(t.$$.fragment,1),V(t,e,i)):t=null}else l&&t.$set(u)},i(r){s||(t&&A(t.$$.fragment,r),s=!0)},o(r){t&&P(t.$$.fragment,r),s=!1},d(r){r&&k(e),t&&z(t)}}}function Zd(n,e){let t,i,s,l=e[4]===e[14].id&&Kd(e);return{key:n,first:null,c(){t=xe(),l&&l.c(),i=xe(),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&&A(l,1)):(l=Kd(e),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(l),s=!0)},o(o){P(l),s=!1},d(o){o&&k(t),l&&l.d(o),o&&k(i)}}}function u3(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=Wd(n,l,r),u=o(a);i.set(u,t[r]=Zd(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=ht(t,a,o,1,r,l,i,e,Gt,Zd,null,Wd),Le())},i(r){if(!s){for(let a=0;a<l.length;a+=1)A(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 Jd(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=N(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),h(t,i),h(i,l),h(t,o),r||(a=[G(t,"click",u),G(t,"keydown",Wh(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,Je(a)}}}function f3(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 m=Yd(n,f,d),g=c(m);u.set(g,a[d]=Jd(g,m))}return{c(){e=_("h4"),t=_("strong"),s=N(i),l=N(" 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,m){w(d,e,m),h(e,t),h(t,s),h(e,l),w(d,o,m),w(d,r,m);for(let g=0;g<a.length;g+=1)a[g].m(r,null)},p(d,m){m&8&&i!==(i=d[3].name+"")&&he(s,i),m&114&&(f=d[5],a=ht(a,m,c,1,d,f,u,r,mn,Jd,null,Yd))},d(d){d&&k(e),d&&k(o),d&&k(r);for(let m=0;m<a.length;m+=1)a[m].d()}}}function c3(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:le,d(s){s&&k(e),t=!1,i()}}}function d3(n){let e,t,i={class:"overlay-panel-xl colored-header collection-panel",$$slots:{footer:[c3],header:[f3],default:[u3]},$$scope:{ctx:n}};return e=new fi({props:i}),n[11](e),e.$on("hide",n[12]),e.$on("show",n[13]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,[l]){const o={};l&524312&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[11](null),z(e,s)}}}function p3(n,e,t){const i=[{id:"list",label:"List",component:TC},{id:"view",label:"View",component:EC},{id:"create",label:"Create",component:BC},{id:"update",label:"
|
||
|
<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),h(e,t),n[16](t),h(e,i),h(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,Je(o)}}}function p4(n){let e,t,i,s,l,o=n[3].name+"",r,a,u,f,c=[],d=new Map,m,g,v,b=n[4];const y=D=>D[25];for(let D=0;D<b.length;D+=1){let O=Qd(n,b,D),E=y(O);d.set(E,c[D]=xd(E,O))}let $=n[0],S=[];for(let D=0;D<$.length;D+=1)S[D]=ep(Xd(n,$,D));const C=D=>P(S[D],1,1,()=>{S[D]=null});let M=!n[8]&&tp(n);return{c(){e=_("label"),t=_("i"),s=T(),l=_("span"),r=N(o),u=T(),f=_("div");for(let D=0;D<c.length;D+=1)c[D].c();m=T();for(let D=0;D<S.length;D+=1)S[D].c();g=T(),M&&M.c(),p(t,"class",i=W.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),h(e,t),h(e,s),h(e,l),h(l,r),w(D,u,O),w(D,f,O);for(let E=0;E<c.length;E+=1)c[E].m(f,null);h(f,m);for(let E=0;E<S.length;E+=1)S[E].m(f,null);h(f,g),M&&M.m(f,null),n[19](f),v=!0},p(D,O){if((!v||O&8&&i!==(i=W.getFieldTypeIcon(D[3].type)))&&p(t,"class",i),(!v||O&8)&&o!==(o=D[3].name+"")&&he(r,o),(!v||O&2097152&&a!==(a=D[21]))&&p(e,"for",a),O&1558&&(b=D[4],Pe(),c=ht(c,O,y,1,D,b,d,f,Gt,xd,m,Qd),Le()),O&2049){$=D[0];let E;for(E=0;E<$.length;E+=1){const L=Xd(D,$,E);S[E]?(S[E].p(L,O),A(S[E],1)):(S[E]=ep(L),S[E].c(),A(S[E],1),S[E].m(f,g))}for(Pe(),E=$.length;E<S.length;E+=1)C(E);Le()}D[8]?M&&(M.d(1),M=null):M?M.p(D,O):(M=tp(D),M.c(),M.m(f,null))},i(D){if(!v){for(let O=0;O<b.length;O+=1)A(c[O]);for(let O=0;O<$.length;O+=1)A(S[O]);v=!0}},o(D){for(let O=0;O<c.length;O+=1)P(c[O]);S=S.filter(Boolean);for(let O=0;O<S.length;O+=1)P(S[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();Gn(S,D),M&&M.d(),n[19](null)}}}function h4(n){let e,t;return e=new Ie({props:{class:"form-field form-field-file "+(n[3].required?"required":""),name:n[3].name,$$slots:{default:[p4,({uniqueId:i})=>({21:i}),({uniqueId:i})=>i?2097152:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field 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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function m4(n,e,t){let i,s,l,{record:o}=e,{value:r=""}=e,{uploadedFiles:a=[]}=e,{deletedFileIndexes:u=[]}=e,{field:f=new yn}=e,c,d;function m(E){W.removeByValue(u,E),t(1,u)}function g(E){W.pushUnique(u,E),t(1,u)}function v(E){W.isEmpty(a[E])||a.splice(E,1),t(0,a)}function b(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:r,uploadedFiles:a,deletedFileIndexes:u},bubbles:!0}))}const y=E=>m(E),$=E=>g(E),S=E=>v(E);function C(E){ge[E?"unshift":"push"](()=>{c=E,t(6,c)})}const M=()=>{for(let E of c.files)a.push(E);t(0,a),t(6,c.value=null,c)},D=()=>c==null?void 0:c.click();function O(E){ge[E?"unshift":"push"](()=>{d=E,t(7,d)})}return n.$$set=E=>{"record"in E&&t(2,o=E.record),"value"in E&&t(12,r=E.value),"uploadedFiles"in E&&t(0,a=E.uploadedFiles),"deletedFileIndexes"in E&&t(1,u=E.deletedFileIndexes),"field"in E&&t(3,f=E.field)},n.$$.update=()=>{var E,L;n.$$.dirty&1&&(Array.isArray(a)||t(0,a=W.toArray(a))),n.$$.dirty&2&&(Array.isArray(u)||t(1,u=W.toArray(u))),n.$$.dirty&8&&t(5,i=((E=f.options)==null?void 0:E.maxSelect)>1),n.$$.dirty&4128&&W.isEmpty(r)&&t(12,r=i?[]:""),n.$$.dirty&4096&&t(4,s=W.toArray(r)),n.$$.dirty&27&&t(8,l=(s.length||a.length)&&((L=f.options)==null?void 0:L.maxSelect)<=s.length+a.length-u.length),n.$$.dirty&3&&(a!==-1||u!==-1)&&b()},[a,u,o,f,s,i,c,d,l,m,g,v,r,y,$,S,C,M,D,O]}class g4 extends Ee{constructor(e){super(),Oe(this,e,m4,h4,De,{record:2,value:12,uploadedFiles:0,deletedFileIndexes:1,field:3})}}function np(n){let e,t;return{c(){e=_("small"),t=N(n[1]),p(e,"class","block txt-hint txt-ellipsis")},m(i,s){w(i,e,s),h(e,t)},p(i,s){s&2&&he(t,i[1])},d(i){i&&k(e)}}}function _4(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:le,d(t){t&&k(e)}}}function j4(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 R4({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function q4(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 T4({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function V4(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 g4({props:u}),ge.push(()=>Ne(e,"value",o)),ge.push(()=>Ne(e,"uploadedFiles",r)),ge.push(()=>Ne(e,"deletedFileIndexes",a)),{c(){B(e.$$.fragment)},m(f,c){V(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[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||(A(e.$$.fragment,f),l=!0)},o(f){P(e.$$.fragment,f),l=!1},d(f){z(e,f)}}}function z4(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 J3({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function B4(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 W3({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function U4(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 V3({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function W4(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 R3({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function Y4(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 L3({props:l}),ge.push(()=>Ne(e,"value",s)),{c(){B(e.$$.fragment)},m(o,r){V(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[40]),!t&&r[0]&5&&(t=!0,a.value=n[2][n[40].name],He(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){P(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function K4(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 O3({props:l}),ge.push(()=>Ne(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:le,d(s){s&&k(e),t=!1,i()}}}function Q4(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]&&cp(n);return{c(){e=_("h4"),i=N(t),s=T(),o=N(l),r=N(" record"),a=T(),c&&c.c(),u=xe()},m(d,m){w(d,e,m),h(e,i),h(e,s),h(e,o),h(e,r),w(d,a,m),c&&c.m(d,m),w(d,u,m),f=!0},p(d,m){(!f||m[0]&4)&&t!==(t=d[2].isNew?"New":"Edit")&&he(i,t),(!f||m[0]&1)&&l!==(l=d[0].name+"")&&he(o,l),!d[2].isNew&&d[10]?c?(c.p(d,m),m[0]&1028&&A(c,1)):(c=cp(d),c.c(),A(c,1),c.m(u.parentNode,u)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){f||(A(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 x4(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=N(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),h(e,t),w(c,i,d),w(c,s,d),h(s,l),h(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")&&he(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 eM(n){let e,t,i={class:"overlay-panel-lg record-panel",beforeHide:n[32],$$slots:{footer:[x4],header:[Q4],default:[G4]},$$scope:{ctx:n}};return e=new fi({props:i}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]),{c(){B(e.$$.fragment)},m(s,l){V(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[33](null),z(e,s)}}}function dp(n){return JSON.stringify(n)}function tM(n,e,t){let i,s,l,o;const r=ln(),a="record_"+W.randomString(5);let{collection:u}=e,f,c=null,d=new ao,m=!1,g=!1,v={},b={},y="";function $(x){return C(x),t(8,g=!0),f==null?void 0:f.show()}function S(){return f==null?void 0:f.hide()}async function C(x){ki({}),c=x||{},t(2,d=x!=null&&x.clone?x.clone():new ao),t(3,v={}),t(4,b={}),await xn(),t(15,y=dp(d))}function M(){if(m||!l)return;t(7,m=!0);const x=O();let J;d.isNew?J=be.records.create(u==null?void 0:u.id,x):J=be.records.update(u==null?void 0:u.id,d.id,x),J.then(async we=>{un(d.isNew?"Successfully created record.":"Successfully updated record."),t(8,g=!1),S(),r("save",we)}).catch(we=>{be.errorResponseHandler(we)}).finally(()=>{t(7,m=!1)})}function D(){!(c!=null&&c.id)||vi("Do you really want to delete the selected record?",()=>be.records.delete(c["@collectionId"],c.id).then(()=>{S(),un("Successfully deleted record."),r("delete",c)}).catch(x=>{be.errorResponseHandler(x)}))}function O(){const x=(d==null?void 0:d.export())||{},J=new FormData,we={};for(const Re of(u==null?void 0:u.schema)||[])we[Re.name]=Re;for(const Re in x)!we[Re]||(typeof x[Re]>"u"&&(x[Re]=null),W.addValueToFormData(J,Re,x[Re]));for(const Re in v){const ze=W.toArray(v[Re]);for(const K of ze)J.append(Re,K)}for(const Re in b){const ze=W.toArray(b[Re]);for(const K of ze)J.append(Re+"."+K,"")}return J}const E=()=>S(),L=()=>D();function F(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function R(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function H(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function te(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function Q(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function j(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function X(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function U(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function Z(x,J){n.$$.not_equal(d[J.name],x)&&(d[J.name]=x,t(2,d))}function oe(x,J){n.$$.not_equal(v[J.name],x)&&(v[J.name]=x,t(3,v))}function ae(x,J){n.$$.not_equal(b[J.name],x)&&(b[J.name]=x,t(4,b))}function T
|
||
|
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function $p(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:le,d(s){s&&k(e),t=!1,i()}}}function Cp(n,e){let t,i,s;return i=new g_({props:{record:e[35],field:e[38]}}),{key:n,first:null,c(){t=xe(),B(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function Mp(n,e){let t,i,s,l,o,r,a,u,f,c,d,m,g,v=[],b=new Map,y,$,S,C,M,D,O,E,L,F,R,H;function te(){return e[25](e[35])}m=new Jo({props:{id:e[35].id}});let Q=e[11];const j=Z=>Z[38].name;for(let Z=0;Z<Q.length;Z+=1){let oe=yp(e,Q,Z),ae=j(oe);b.set(ae,v[Z]=Cp(ae,oe))}S=new bi({props:{date:e[35].created}}),D=new bi({props:{date:e[35].updated}});function X(){return e[26](e[35])}function U(...Z){return e[27](e[35],...Z)}return{key:n,first:null,c(){t=_("tr"),i=_("td"),s=_("div"),l=_("input"),a=T(),u=_("label"),c=T(),d=_("td"),B(m.$$.fragment),g=T();for(let Z=0;Z<v.length;Z+=1)v[Z].c();y=T(),$=_("td"),B(S.$$.fragment),C=T(),M=_("td"),B(D.$$.fragment),O=T(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',L=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($,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(Z,oe){w(Z,t,oe),h(t,i),h(i,s),h(s,l),h(s,a),h(s,u),h(t,c),h(t,d),V(m,d,null),h(t,g);for(let ae=0;ae<v.length;ae+=1)v[ae].m(t,null);h(t,y),h(t,$),V(S,$,null),h(t,C),h(t,M),V(D,M,null),h(t,O),h(t,E),h(t,L),F=!0,R||(H=[G(l,"change",te),G(s,"click",Xn(e[19])),G(t,"click",X),G(t,"keydown",U)],R=!0)},p(Z,oe){e=Z,(!F||oe[0]&8&&o!==(o="checkbox_"+e[35].id))&&p(l,"id",o),(!F||oe[0]&40&&r!==(r=e[5][e[35].id]))&&(l.checked=r),(!F||oe[0]&8&&f!==(f="checkbox_"+e[35].id))&&p(u,"for",f);const ae={};oe[0]&8&&(ae.id=e[35].id),m.$set(ae),oe[0]&2056&&(Q=e[11],Pe(),v=ht(v,oe,j,1,e,Q,b,t,Gt,Cp,y,yp),Le());const Te={};oe[0]&8&&(Te.date=e[35].created),S.$set(Te);const re={};oe[0]&8&&(re.date=e[35].updated),D.$set(re)},i(Z){if(!F){A(m.$$.fragment,Z);for(let oe=0;oe<Q.length;oe+=1)A(v[oe]);A(S.$$.fragment,Z),A(D.$$.fragment,Z),F=!0}},o(Z){P(m.$$.fragment,Z);for(let oe=0;oe<v.length;oe+=1)P(v[oe]);P(S.$$.fragment,Z),P(D.$$.fragment,Z),F=!1},d(Z){Z&&k(t),z(m);for(let oe=0;oe<v.length;oe+=1)v[oe].d();z(S),z(D),R=!1,Je(H)}}}function Tp(n){let e,t,i=n[3].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[4]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),h(e,t),h(e,s),h(e,l),h(e,o)},p(r,a){a[0]&8&&i!==(i=r[3].length+"")&&he(s,i),a[0]&16&&he(o,r[4])},d(r){r&&k(e)}}}function Dp(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=N("Load more ("),o=N(l),r=N(")"),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),h(e,t),h(t,i),h(i,s),h(i,o),h(i,r),a||(u=G(t,"click",n[29]),a=!0)},p(f,c){c[0]&24&&l!==(l=f[4]-f[3].length+"")&&he(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 Op(n){let e,t,i,s,l,o,r=n[6]===1?"record":"records",a,u,f,c,d,m,g,v,b,y,$;return{c(){e=_("div"),t=_("div"),i=N("Selected "),s=_("strong"),l=N(n[6]),o=T(),a=N(r),u=T(),f=_("button"),f.innerHTML='<span class="txt">Reset</span>',c=T(),d=_("div"),m=T(),g=_("button"),g.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,"b
|
||
|
<span class="txt">API Preview</span>`,S=T(),C=_("button"),C.innerHTML=`<i class="ri-add-line"></i>
|
||
|
<span class="txt">New record</span>`,M=T(),B(D.$$.fragment),O=T(),B(E.$$.fragment),p(o,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(m,"type","button"),p(m,"class","btn btn-secondary btn-circle"),p(d,"class","inline-flex gap-5"),p($,"type","button"),p($,"class","btn btn-outline"),p(C,"type","button"),p(C,"class","btn btn-expanded"),p(y,"class","btns-group"),p(s,"class","page-header"),p(i,"class","page-wrapper")},m(U,Z){V(e,U,Z),w(U,t,Z),w(U,i,Z),h(i,s),h(s,l),h(l,o),h(l,r),h(l,a),h(a,f),h(s,c),h(s,d),h(d,m),h(d,g),V(v,d,null),h(s,b),h(s,y),h(y,$),h(y,S),h(y,C),h(i,M),V(D,i,null),h(i,O),V(E,i,null),R=!0,H||(te=[Ue(Ct.call(null,m,{text:"Edit collection",position:"right"})),G(m,"click",n[12]),G($,"click",n[14]),G(C,"click",n[15])],H=!0)},p(U,Z){(!R||Z&4)&&u!==(u=U[2].name+"")&&he(f,u);const oe={};Z&1&&(oe.value=U[0]),Z&4&&(oe.autocompleteCollection=U[2]),D.$set(oe);const ae={};Z&4&&(ae.collection=U[2]),!L&&Z&1&&(L=!0,ae.filter=U[0],He(()=>L=!1)),!F&&Z&2&&(F=!0,ae.sort=U[1],He(()=>F=!1)),E.$set(ae)},i(U){R||(A(e.$$.fragment,U),A(v.$$.fragment,U),A(D.$$.fragment,U),A(E.$$.fragment,U),R=!0)},o(U){P(e.$$.fragment,U),P(v.$$.fragment,U),P(D.$$.fragment,U),P(E.$$.fragment,U),R=!1},d(U){z(e,U),U&&k(t),U&&k(i),z(v),z(D),n[17](null),z(E),H=!1,Je(te)}}}function TM(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),h(e,t),h(e,i),h(e,s),h(e,l),h(e,o),r||(a=G(o,"click",n[11]),r=!0)},p:le,i:le,o:le,d(u){u&&k(e),r=!1,a()}}}function DM(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:le,i:le,o:le,d(t){t&&k(e)}}}function OM(n){let e,t,i,s,l,o,r,a,u;const f=[DM,TM,MM],c=[];function d(b,y){return b[8]?0:b[7].length?2:1}e=d(n),t=c[e]=f[e](n);let m={};s=new Wa({props:m}),n[21](s);let g={};o=new h3({props:g}),n[22](o);let v={collection:n[2]};return a=new m_({props:v}),n[23](a),a.$on("save",n[24]),a.$on("delete",n[25]),{c(){t.c(),i=T(),B(s.$$.fragment),l=T(),B(o.$$.fragment),r=T(),B(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),V(s,b,y),w(b,l,y),V(o,b,y),w(b,r,y),V(a,b,y),u=!0},p(b,[y]){let $=e;e=d(b),e===$?c[e].p(b,y):(Pe(),P(c[$],1,1,()=>{c[$]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const C={};o.$set(C);const M={};y&4&&(M.collection=b[2]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(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),z(s,b),b&&k(l),n[22](null),z(o,b),b&&k(r),n[23](null),z(a,b)}}}function EM(n,e,t){let i,s,l,o,r,a;yt(n,oi,U=>t(2,s=U)),yt(n,Cs,U=>t(10,l=U)),yt(n,Io,U=>t(26,o=U)),yt(n,Rt,U=>t(27,r=U)),yt(n,ta,U=>t(8,a=U)),fn(Rt,r="Collections",r);const u=new URLSearchParams(o);let f,c,d,m,g=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,g="")}V2(b);const $=()=>f==null?void 0:f.show(),S=()=>f==null?void 0:f.show(s),C=()=>m==null?void 0:m.load(),M=()=>c==null?void 0:c.show(s),D=()=>d==null?void 0:d.show(),O=U=>t(0,g=U.detail);function E(U){ge[U?"unshift":"push"](()=>{m=U,t(6,m)})}function L(U){g=U,t(0,g)}function F(U){v=U,t(1,v)}const R=U=>d==null?void 0:d.show(U==null?void 0:U.detail);function H(U){ge[U?"unshift":"push"](()=>{f=U,t(3,f)})}function te(U){ge[U?"unshift":"push"](()=>{c=U,t(4,c)})}function Q(U){ge[U?"unshift":"push"](()=>{d=U,t(5,d)})}const j=()=>m==null?void 0:m.load(),X=()=>m==null?void 0:m.load();return n.$$.update=()=>{if(n.$$.dirty&1024&&t(7,i=l.filter(U=>U.name!="profiles")),n.$$.dirty&516&&(s==null?void 0:s.id)&&b!=s.id&&y(),n.$$.dirty&7&&(v||g||(s==null?void 0:s.id))){const U=new URLSearchParams({collectionId:(s==null?void 0:s.id)||"",filter:g,sort:v}).toString();yi("/collections?"+U)}},[g,v,s,f,c,d,m,i,a,b,l,$,S,C,M,D,O,E,L,F,R,H,te,Q,j,X]}class AM extends Ee{constructor(e){super(),Oe(this,e,EM,OM,De,{})}}function Ep(n){let e,t;return e=new Ie({props:{class:"form-field disabled",name:"id",$$slots:{default:[PM,({uniqueId:i})=>({31:i}),({uniqueId:i})=>[0,i?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(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||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function PM(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",W.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),h(e,t),h(e,i),h(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 Ap(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=Ue(Ct.call(null,e,"Verified")),t=!0)},d(s){s&&k(e),t=!1,i()}}}function LM(n){let e,t,i,s,l,o,r,a,u,f,c,d=n[1].verified&&Ap();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",W.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(m,g){w(m,e,g),h(e,t),h(e,i),h(e,s),w(m,o,g),d&&d.m(m,g),w(m,r,g),w(m,a,g),Ce(a,n[2]),f||(c=G(a,"input",n[19]),f=!0)},p(m,g){g[1]&1&&l!==(l=m[31])&&p(e,"for",l),m[1].verified?d||(d=Ap(),d.c(),d.m(r.parentNode,r)):d&&(d.d(1),d=null),g[1]&1&
|
||
|
<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:le,d(s){s&&k(e),t=!1,i()}}}function qM(n){let e,t,i,s,l=!n[1].verified&&Np(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=Np(o),l.c(),l.m(e.parentNode,e))},d(o){l&&l.d(o),o&&k(e),o&&k(t),i=!1,s()}}}function VM(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Ip(n);return{c(){m&&m.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=N(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(g,v){m&&m.m(g,v),w(g,e,v),w(g,t,v),h(t,i),w(g,s,v),w(g,l,v),h(l,o),h(o,a),f=!0,c||(d=G(t,"click",n[18]),c=!0)},p(g,v){g[1].isNew?m&&(Pe(),P(m,1,1,()=>{m=null}),Le()):m?(m.p(g,v),v[0]&2&&A(m,1)):(m=Ip(g),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||v[0]&32)&&(t.disabled=g[5]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&he(a,r),(!f||v[0]&1056&&u!==(u=!g[10]||g[5]))&&(l.disabled=u),v[0]&32&&ie(l,"btn-loading",g[5])},i(g){f||(A(m),f=!0)},o(g){P(m),f=!1},d(g){m&&m.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function zM(n){let e,t,i={popup:!0,class:"user-panel",beforeHide:n[24],$$slots:{footer:[VM],header:[jM],default:[HM]},$$scope:{ctx:n}};return e=new fi({props:i}),n[25](e),e.$on("hide",n[26]),e.$on("show",n[27]),{c(){B(e.$$.fragment)},m(s,l){V(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||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[25](null),z(e,s)}}}function BM(n,e,t){let i;const s=ln(),l="user_"+W.randomString(5);let o,r=new uo,a=!1,u=!1,f="",c="",d="",m=!1,g=!0;function v(Z){return y(Z),t(6,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(Z){ki({}),t(1,r=Z!=null&&Z.clone?Z.clone():new uo),$()}function $(){t(3,m=!1),t(9,g=!0),t(2,f=(r==null?void 0:r.email)||""),t(7,c=""),t(8,d="")}function S(){if(a||!i)return;t(5,a=!0);const Z={email:f};(r.isNew||m)&&(Z.password=c,Z.passwordConfirm=d);let oe;r.isNew?oe=be.users.create(Z):oe=be.users.update(r.id,Z),oe.then(async ae=>{g&&M(!1),t(6,u=!1),b(),un(r.isNew?"Successfully created user.":"Successfully updated user."),s("save",ae)}).catch(ae=>{be.errorResponseHandler(ae)}).finally(()=>{t(5,a=!1)})}function C(){!(r!=null&&r.id)||vi("Do you really want to delete the selected user?",()=>be.users.delete(r.id).then(()=>{t(6,u=!1),b(),un("Successfully deleted user."),s("delete",r)}).catch(Z=>{be.errorResponseHandler(Z)}))}function M(Z=!0){return be.users.requestVerification(r.isNew?f:r.email).then(()=>{t(6,u=!1),b(),Z&&un(`Successfully sent verification email to ${r.email}.`)}).catch(oe=>{be.errorResponseHandler(oe)})}const D=()=>M(),O=()=>C(),E=()=>b();function L(){f=this.value,t(2,f)}function F(){m=this.checked,t(3,m)}function R(){c=this.value,t(7,c)}function H(){d=this.value,t(8,d)}function te(){g=this.checked,t(9,g)}const Q=()=>i&&u?(vi("You have unsaved changes. Do you really want to close the panel?",()=>{t(6,u=!1),b()}),!1):!0;function j(Z){ge[Z?"unshift":"push"](()=>{o=Z,t(4,o)})}function X(Z){at.call(this,n,Z)}function U(Z){at.call(this,n,Z)}return n.$$.update=()=>{n.$$.dirty[0]&14&&t(10,i=r.isNew&&f!=""||m||f!==r.email)},[b,r,f,m,o,a,u,c,d,g,i,l,S,C,M,v,D,O,E,L,F,R,H,te,Q,j,X,U]}class UM extends Ee{constructor(e){super(),Oe(this,e,BM,zM,De,{show:15,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[15]}get hide(){return this.$$.ctx[0]}}function Rp(n,e,t){const i=n.slice();return i[40]=e[t],i}function Hp(n,e,t){const i=n.slice();return i[43]=e[t],i}function jp(n,e,t){const i=n.slice();return i[43]=e[t],i}function WM(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S,C,M,D,O,E,L,F,R=[],H=new Map,te,Q,j,X,U,Z,oe,ae,Te,re,me=[],ve=new Map,Y,Se,x,J,we;u=new zo({}),u.$on("refresh",n[17]),v=new Vo({props:{value:n[3],placeholder:"Search filter, eg. verified=1",extraAutocompleteKeys:["verified","email"]}})
|
||
|
<span class="txt">New user</span>`,g=T(),B(v.$$.fragment),b=T(),y=_("div"),$=_("table"),S=_("thead"),C=_("tr"),B(M.$$.fragment),O=T(),B(E.$$.fragment),F=T();for(let ne=0;ne<R.length;ne+=1)R[ne].c();te=T(),B(Q.$$.fragment),X=T(),B(U.$$.fragment),oe=T(),ae=_("th"),Te=T(),re=_("tbody");for(let ne=0;ne<me.length;ne+=1)me[ne].c();Be&&Be.c(),Y=T(),Ye&&Ye.c(),Se=T(),dt&&dt.c(),p(s,"class","breadcrumb-item"),p(i,"class","breadcrumbs"),p(r,"type","button"),p(r,"class","btn btn-secondary btn-circle"),p(c,"class","flex-fill"),p(m,"type","button"),p(m,"class","btn btn-expanded"),p(t,"class","page-header"),p(ae,"class","col-type-action min-width"),p($,"class","table"),ie($,"table-loading",n[10]),p(y,"class","table-wrapper"),p(e,"class","page-wrapper")},m(ne,_e){w(ne,e,_e),h(e,t),h(t,i),h(i,s),h(s,l),h(t,o),h(t,r),h(t,a),V(u,t,null),h(t,f),h(t,c),h(t,d),h(t,m),h(e,g),V(v,e,null),h(e,b),h(e,y),h(y,$),h($,S),h(S,C),V(M,C,null),h(C,O),V(E,C,null),h(C,F);for(let Ke=0;Ke<R.length;Ke+=1)R[Ke].m(C,null);h(C,te),V(Q,C,null),h(C,X),V(U,C,null),h(C,oe),h(C,ae),h($,Te),h($,re);for(let Ke=0;Ke<me.length;Ke+=1)me[Ke].m(re,null);Be&&Be.m(re,null),h(e,Y),Ye&&Ye.m(e,null),h(e,Se),dt&&dt.m(e,null),x=!0,J||(we=[Ue(Ct.call(null,r,{text:"Edit profile collection",position:"right"})),G(r,"click",n[16]),G(m,"click",n[18])],J=!0)},p(ne,_e){(!x||_e[0]&16384)&&he(l,ne[14]);const Ke={};_e[0]&8&&(Ke.value=ne[3]),v.$set(Ke);const lt={};_e[1]&131072&&(lt.$$scope={dirty:_e,ctx:ne}),!D&&_e[0]&16&&(D=!0,lt.sort=ne[4],He(()=>D=!1)),M.$set(lt);const ut={};_e[1]&131072&&(ut.$$scope={dirty:_e,ctx:ne}),!L&&_e[0]&16&&(L=!0,ut.sort=ne[4],He(()=>L=!1)),E.$set(ut),_e[0]&4096&&(ce=ne[12],R=ht(R,_e,ke,1,ne,ce,H,C,mn,qp,te,jp));const tt={};_e[1]&131072&&(tt.$$scope={dirty:_e,ctx:ne}),!j&&_e[0]&16&&(j=!0,tt.sort=ne[4],He(()=>j=!1)),Q.$set(tt);const wt={};_e[1]&131072&&(wt.$$scope={dirty:_e,ctx:ne}),!Z&&_e[0]&16&&(Z=!0,wt.sort=ne[4],He(()=>Z=!1)),U.$set(wt),_e[0]&5450&&(it=ne[1],Pe(),me=ht(me,_e,Mt,1,ne,it,ve,re,Gt,Up,null,Rp),Le(),!it.length&&Be?Be.p(ne,_e):it.length?Be&&(Be.d(1),Be=null):(Be=Vp(ne),Be.c(),Be.m(re,null))),_e[0]&1024&&ie($,"table-loading",ne[10]),ne[1].length?Ye?Ye.p(ne,_e):(Ye=Wp(ne),Ye.c(),Ye.m(e,Se)):Ye&&(Ye.d(1),Ye=null),ne[1].length&&ne[13]?dt?dt.p(ne,_e):(dt=Yp(ne),dt.c(),dt.m(e,null)):dt&&(dt.d(1),dt=null)},i(ne){if(!x){A(u.$$.fragment,ne),A(v.$$.fragment,ne),A(M.$$.fragment,ne),A(E.$$.fragment,ne),A(Q.$$.fragment,ne),A(U.$$.fragment,ne);for(let _e=0;_e<it.length;_e+=1)A(me[_e]);x=!0}},o(ne){P(u.$$.fragment,ne),P(v.$$.fragment,ne),P(M.$$.fragment,ne),P(E.$$.fragment,ne),P(Q.$$.fragment,ne),P(U.$$.fragment,ne);for(let _e=0;_e<me.length;_e+=1)P(me[_e]);x=!1},d(ne){ne&&k(e),z(u),z(v),z(M),z(E);for(let _e=0;_e<R.length;_e+=1)R[_e].d();z(Q),z(U);for(let _e=0;_e<me.length;_e+=1)me[_e].d();Be&&Be.d(),Ye&&Ye.d(),dt&&dt.d(),J=!1,Je(we)}}}function YM(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:le,i:le,o:le,d(t){t&&k(e)}}}function KM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function ZM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function qp(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=N("profile."),f=N(u),p(s,"class",l=W.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(m,g){w(m,t,g),h(t,i),h(i,s),h(i,o),h(i,r),h(r,a),h(r,f)},p(m,g){e=m,g[0]&4096&&l!==(l=W.getFieldTypeIcon(e[43].type))&&p(s,"class",l),g[0]&4096&&u!==(u=e[43].name+"")&&he(f,u),g[0]&4096&&c!==(c="col-type-"+e[43].type+" col-field-"+e[43].name)&&p(t,"class",c),g[0]&4096&&d!==(d=e[43].name)&&p(t,"name",d)},d(m){m&&k(t)}}}function JM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="created",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function GM(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="updated",p(t,"class",W.getFieldTypeIcon("date")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function Vp(n){let e;function t(l,o){return l[10]?QM:XM}let i=t(n),s=i(n);return{c(){s.c(),e=xe()},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 XM(n){var r;let e,t,i,s,l,o=((r=n[3])==null?void 0:r.length)&&zp(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),h(e,t),h(t,i),h(t,s),o&&o.m(t,null),h(e,l)},p(a,u){var f;(f=a[3])!=null&&f.length?o?o.p(a,u):(o=zp(a),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(a){a&&k(e),o&&o.d()}}}function QM(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:le,d(t){t&&k(e)}}}function zp(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:le,d(s){s&&k(e),t=!1,i()}}}function Bp(n,e){let t,i,s;return i=new g_({props:{field:e[43],record:e[40].profile||{}}}),{key:n,first:null,c(){t=xe(),B(i.$$.fragment),this.first=t},m(l,o){w(l,t,o),V(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||(A(i.$$.fragment,l),s=!0)},o(l){P(i.$$.fragment,l),s=!1},d(l){l&&k(t),z(i,l)}}}function Up(n,e){let t,i,s,l,o,r,a,u=e[40].email+"",f,c,d,m,g=e[40].verified?"Verified":"Unverified",v,b,y=[],$=new Map,S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U;s=new Jo({props:{id:e[40].id}});let Z=e[12];const oe=re=>re[43].name;for(let re=0;re<Z.length;re+=1){let me=Hp(e,Z,re),ve=oe(me);$.set(ve,y[re]=Bp(ve,me))}M=new bi({props:{date:e[40].created}}),E=new bi({props:{date:e[40].updated}});function ae(){return e[24](e[40])}function Te(){return e[25](e[40])}return{key:n,first:null,c(){t=_("tr"),i=_("td"),B(s.$$.fragment),l=T(),o=_("td"),r=_("div"),a=_("span"),f=N(u),d=T(),m=_("span"),v=N(g),b=T();for(let re=0;re<y.length;re+=1)y[re].c();S=T(),C=_("td"),B(M.$$.fragment),D=T(),O=_("td"),B(E.$$.fragment),L=T(),F=_("td"),R=_("button"),R.innerHTML=`<i class="ri-user-settings-line"></i>
|
||
|
<span class="txt">Edit user</span>`,H=T(),te=_("button"),te.innerHTML=`<i class="ri-profile-line"></i>
|
||
|
<span class="txt">Edit profile</span>`,Q=T(),p(i,"class","col-type-text col-field-id"),p(a,"class","txt"),p(a,"title",c=e[40].email),p(m,"class","label"),ie(m,"label-success",e[40].verified),ie(m,"label-warning",!e[40].verified),p(r,"class","inline-flex"),p(o,"class","col-type-email col-field-email"),p(C,"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(te,"type","button"),p(te,"class","btn btn-sm m-l-10"),p(F,"class","col-type-action min-width"),this.first=t},m(re,me){w(re,t,me),h(t,i),V(s,i,null),h(t,l),h(t,o),h(o,r),h(r,a),h(a,f),h(r,d),h(r,m),h(m,v),h(t,b);for(let ve=0;ve<y.length;ve+=1)y[ve].m(t,null);h(t,S),h(t,C),V(M,C,null),h(t,D),h(t,O),V(E,O,null),h(t,L),h(t,F),h(F,R),h(F,H),h(F,te),h(t,Q),j=!0,X||(U=[G(R,"click",Xn(ae)),G(te,"click",Xn(Te))],X=!0)},p(re,me){e=re;const ve={};me[0]&2&&(ve.id=e[40].id),s.$set(ve),(!j||me[0]&2)&&u!==(u=e[40].email+"")&&he(f,u),(!j||me[0]&2&&c!==(c=e[40].email))&&p(a,"title",c),(!j||me[0]&2)&&g!==(g=e[40].verified?"Verified":"Unverified")&&he(v,g),me[0]&2&&ie(m,"label-success",e[40].verified),me[0]&2&&ie(m,"label-warning",!e[40].verified),me[0]&4098&&(Z=e[12],Pe(),y=ht(y,me,oe,1,e,Z,$,t,Gt,Bp,S,Hp),Le());const Y={};me[0]&2&&(Y.date=e[40].created),M.$set(Y);const Se={};me[0]&2&&(Se.date=e[40].updated),E.$set(Se)},i(re){if(!j){A(s.$$.fragment,re);for(let me=0;me<Z.length;me+=1)A(y[me]);A(M.$$.fragment,re),A(E.$$.fragment,re),j=!0}},o(re){P(s.$$.fragment,re);for(let me=0;me<y.length;me+=1)P(y[me]);P(M.$$.fragment,re),P(E.$$.fragment,re),j=!1},d(re){re&&k(t),z(s);for(let me=0;me<y.length;me+=1)y[me].d();z(M),z(E),X=!1,Je(U)}}}function Wp(n){let e,t,i=n[1].length+"",s,l,o;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),o=N(n[2]),p(e,"class","block txt-hint txt-right m-t-sm")},m(r,a){w(r,e,a),h(e,t),h(e,s),h(e,l),h(e,o)},p(r,a){a[0]&2&&i!==(i=r[1].length+"")&&he(s,i),a[0]&4&&he(o,r[2])},d(r){r&&k(e)}}}function Yp(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=N("Load more ("),o=N(l),r=N(")"),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),h(e,t),h(t,i),h(i,s),h(i,o),h(i,r),a||(u=G(t,"click",n[27]),a=!0)},p(f,c){c[0]&6&&l!==(l=f[2]-f[1].length+"")&&he(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 xM(n){let e,t,i,s,l,o,r,a,u;const f=[YM,WM],c=[];function d(b,y){return b[11]?0:1}e=d(n),t=c[e]=f[e](n);let m={};s=new UM({props:m}),n[28](s),s.$on("save",n[29]),s.$on("delete",n[30]);let g={};o=new Wa({props:g}),n[31](o),o.$on("save",n[32]);let v={collection:n[5]};return a=new m_({props:v}),n[33](a),a.$on("save",n[34]),{c(){t.c(),i=T(),B(s.$$.fragment),l=T(),B(o.$$.fragment),r=T(),B(a.$$.fragment)},m(b,y){c[e].m(b,y),w(b,i,y),V(s,b,y),w(b,l,y),V(o,b,y),w(b,r,y),V(a,b,y),u=!0},p(b,y){let $=e;e=d(b),e===$?c[e].p(b,y):(Pe(),P(c[$],1,1,()=>{c[$]=null}),Le(),t=c[e],t?t.p(b,y):(t=c[e]=f[e](b),t.c()),A(t,1),t.m(i.parentNode,i));const S={};s.$set(S);const C={};o.$set(C);const M={};y[0]&32&&(M.collection=b[5]),a.$set(M)},i(b){u||(A(t),A(s.$$.fragment,b),A(o.$$.fragment,b),A(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[28](null),z(s,b),b&&k(l),n[31](null),z(o,b),b&&k(r),n[33](null),z(a,b)}}}function eT(n,e,t){let i,s,l,o;yt(n,Io,x=>t(35,l=x)),yt(n,Rt,x=>t(14,o=x)),fn(Rt,o="Users",o);const r=new URLSearchParams(l),a=["id","userId","created","updated"];let u,f,c,d=[],m=1,g=0,v=!1,b=r.get("filter")||"",y=r.get("sort")||"-created",$=new En,S=!1;O();async function C(x=1){return t(10,v=!0),x<=1&&M(),be.users.getList(x,50,{sort:y||"-created",filter:b}).then(J=>{t(10,v=!1),t(1,d=d.concat(J.items)),t(9,m=J.page),t(2,g=J.totalItems)}).catch(J=>{J!=null&&J.isAbort||(t(10,v=!1),console.warn(J),M(),be.errorResponseHandler(J,!1))})}
|
||
|
<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.textContent="Sync",d=T(),m=_("a"),m.innerHTML=`<i class="ri-uninstall-line"></i>
|
||
|
<span class="txt">Export collections</span>`,g=T(),v=_("a"),v.innerHTML=`<i class="ri-install-line"></i>
|
||
|
<span class="txt">Import collections</span>`,b=T(),y=_("div"),y.textContent="Authentication",$=T(),S=_("a"),S.innerHTML=`<i class="ri-lock-password-line"></i>
|
||
|
<span class="txt">Auth providers</span>`,C=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(m,"href","/settings/export-collections"),p(m,"class","sidebar-list-item"),p(v,"href","/settings/import-collections"),p(v,"class","sidebar-list-item"),p(y,"class","sidebar-title"),p(S,"href","/settings/auth-providers"),p(S,"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(F,R){w(F,e,R),h(e,t),h(t,i),h(t,s),h(t,l),h(t,o),h(t,r),h(t,a),h(t,u),h(t,f),h(t,c),h(t,d),h(t,m),h(t,g),h(t,v),h(t,b),h(t,y),h(t,$),h(t,S),h(t,C),h(t,M),h(t,D),h(t,O),E||(L=[Ue(In.call(null,l,{path:"/settings"})),Ue(dn.call(null,l)),Ue(In.call(null,r,{path:"/settings/mail/?.*"})),Ue(dn.call(null,r)),Ue(In.call(null,u,{path:"/settings/storage/?.*"})),Ue(dn.call(null,u)),Ue(In.call(null,m,{path:"/settings/export-collections/?.*"})),Ue(dn.call(null,m)),Ue(In.call(null,v,{path:"/settings/import-collections/?.*"})),Ue(dn.call(null,v)),Ue(In.call(null,S,{path:"/settings/auth-providers/?.*"})),Ue(dn.call(null,S)),Ue(In.call(null,M,{path:"/settings/tokens/?.*"})),Ue(dn.call(null,M)),Ue(In.call(null,O,{path:"/settings/admins/?.*"})),Ue(dn.call(null,O))],E=!0)},p:le,i:le,o:le,d(F){F&&k(e),E=!1,Je(L)}}}class Hi extends Ee{constructor(e){super(),Oe(this,e,null,nT,De,{})}}function Kp(n,e,t){const i=n.slice();return i[31]=e[t],i}function Zp(n){let e,t;return e=new Ie({props:{class:"form-field disabled",name:"id",$$slots:{default:[iT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741826|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function iT(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",W.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),h(e,t),h(e,i),h(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 Jp(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(),Jn(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),h(e,t),h(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,Je(r)}}}function sT(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",W.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),h(e,t),h(e,i),h(e,s),w(c,o,d),w(c,r,d),Ce(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]&&Ce(r,c[3])},d(c){c&&k(e),c&&k(o),c&&k(r),u=!1,f()}}}function Gp(n){let e,t;return e=new Ie({props:{class:"form-field form-field-toggle",$$slots:{default:[lT,({uniqueId:i})=>({30:i}),({uniqueId:i})=>[i?1073741824:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,s){const l={};s[0]&1073741840|s[1]&8&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(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:le,d(s){s&&k(e),t=!1,i()}}}function cT(n){let e,t,i,s,l,o,r=n[1].isNew?"Create":"Save changes",a,u,f,c,d,m=!n[1].isNew&&Qp(n);return{c(){m&&m.c(),e=T(),t=_("button"),i=_("span"),i.textContent="Cancel",s=T(),l=_("button"),o=_("span"),a=N(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(g,v){m&&m.m(g,v),w(g,e,v),w(g,t,v),h(t,i),w(g,s,v),w(g,l,v),h(l,o),h(o,a),f=!0,c||(d=G(t,"click",n[16]),c=!0)},p(g,v){g[1].isNew?m&&(Pe(),P(m,1,1,()=>{m=null}),Le()):m?(m.p(g,v),v[0]&2&&A(m,1)):(m=Qp(g),m.c(),A(m,1),m.m(e.parentNode,e)),(!f||v[0]&64)&&(t.disabled=g[6]),(!f||v[0]&2)&&r!==(r=g[1].isNew?"Create":"Save changes")&&he(a,r),(!f||v[0]&1088&&u!==(u=!g[10]||g[6]))&&(l.disabled=u),v[0]&64&&ie(l,"btn-loading",g[6])},i(g){f||(A(m),f=!0)},o(g){P(m),f=!1},d(g){m&&m.d(g),g&&k(e),g&&k(t),g&&k(s),g&&k(l),c=!1,d()}}}function dT(n){let e,t,i={popup:!0,class:"admin-panel",beforeHide:n[23],$$slots:{footer:[cT],header:[uT],default:[aT]},$$scope:{ctx:n}};return e=new fi({props:i}),n[24](e),e.$on("hide",n[25]),e.$on("show",n[26]),{c(){B(e.$$.fragment)},m(s,l){V(e,s,l),t=!0},p(s,l){const o={};l[0]&1152&&(o.beforeHide=s[23]),l[0]&1886|l[1]&8&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){P(e.$$.fragment,s),t=!1},d(s){n[24](null),z(e,s)}}}function pT(n,e,t){let i;const s=ln(),l="admin_"+W.randomString(5);let o,r=new ys,a=!1,u=!1,f=0,c="",d="",m="",g=!1;function v(U){return y(U),t(7,u=!0),o==null?void 0:o.show()}function b(){return o==null?void 0:o.hide()}function y(U){ki({}),t(1,r=U!=null&&U.clone?U.clone():new ys),$()}function $(){t(4,g=!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,m="")}function S(){if(a||!i)return;t(6,a=!0);const U={email:c,avatar:f};(r.isNew||g)&&(U.password=d,U.passwordConfirm=m);let Z;r.isNew?Z=be.admins.create(U):Z=be.admins.update(r.id,U),Z.then(async oe=>{var ae;t(7,u=!1),b(),un(r.isNew?"Successfully created admin.":"Successfully updated admin."),s("save",oe),((ae=be.authStore.model)==null?void 0:ae.id)===oe.id&&be.authStore.save(be.authStore.token,oe)}).catch(oe=>{be.errorResponseHandler(oe)}).finally(()=>{t(6,a=!1)})}function C(){!(r!=null&&r.id)||vi("Do you really want to delete the selected admin?",()=>be.admins.delete(r.id).then(()=>{t(7,u=!1),b(),un("Successfully deleted admin."),s("delete",r)}).catch(U=>{be.errorResponseHandler(U)}))}const M=()=>C(),D=()=>b(),O=U=>t(2,f=U),E=(U,Z)=>{(Z.code==="Enter"||Z.code==="Space")&&(Z.preventDefault(),t(2,f=U))};function L(){c=this.value,t(3,c)}function F(){g=this.checked,t(4,g)}function R(){d=this.value,t(8,d)}function H(){m=this.value,t(9,m)}const te=()=>i&&u?(vi("You have unsaved changes. Do you really want to close the panel?",()=>{t(7,u=!1),b()}),!1):!0;function Q(U){ge[U?"unshift":"push"](()=>{o=U,t(5,o)})}function j(U){at.call(this,n,U)}function X(U){at.call(this,n,U)}return n.$$.update=()=>{n.$$.dirty[0]&30&&t(10,i=r.isNew&&c!=""||g||c!==r.email||f!==r.avatar)},[b,r,f,c,g,o,a,u,d,m,i,l,S,C,v,M,D,O,E,L,F,R,H,te,Q,j,X]}class hT extends Ee{constructor(e){super(),Oe(this,e,pT,dT,De,{show:14,hide:0},null,[-1,-1])}get show(){return this.$$.ctx[14]}get hide(){return this.$$.ctx[0]}}function xp(n,e,t){const i=n.slice();return i[24]=e[t],i}function mT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="id",p(t,"class",W.getFieldTypeIcon("primary")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function gT(n){let e,t,i,s;return{c(){e=_("div"),t=_("i"),i=T(),s=_("span"),s.textContent="email",p(t,"class",W.getFieldTypeIcon("email")),p(s,"class","txt"),p(e,"class","col-header-content")},m(l,o){w(l,e,o),h(e,t),h(e,i),h(e,s)},p:le,d(l){l&&k(e)}}}function _T(n){let e,t,i,s;return{c(
|
||
|
`},m(t,i){w(t,e,i)},p:le,d(t){t&&k(e)}}}function th(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:le,d(s){s&&k(e),t=!1,i()}}}function nh(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 ih(n,e){let t,i,s,l,o,r,a,u,f,c,d,m,g=e[24].email+"",v,b,y,$,S,C,M,D,O,E,L,F,R,H;u=new Jo({props:{id:e[24].id}});let te=e[24].id===e[7].id&&nh();S=new bi({props:{date:e[24].created}}),D=new bi({props:{date:e[24].updated}});function Q(){return e[15](e[24])}function j(...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"),B(u.$$.fragment),f=T(),te&&te.c(),c=T(),d=_("td"),m=_("span"),v=N(g),y=T(),$=_("td"),B(S.$$.fragment),C=T(),M=_("td"),B(D.$$.fragment),O=T(),E=_("td"),E.innerHTML='<i class="ri-arrow-right-line"></i>',L=T(),Jn(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(m,"class","txt txt-ellipsis"),p(m,"title",b=e[24].email),p(d,"class","col-type-email col-field-email"),p($,"class","col-type-date col-field-created"),p(M,"class","col-type-date col-field-updated"),p(E,"class","col-type-action min-width"),p(t,"tabindex","0"),p(t,"class","row-handle"),this.first=t},m(X,U){w(X,t,U),h(t,i),h(i,s),h(s,l),h(t,r),h(t,a),V(u,a,null),h(a,f),te&&te.m(a,null),h(t,c),h(t,d),h(d,m),h(m,v),h(t,y),h(t,$),V(S,$,null),h(t,C),h(t,M),V(D,M,null),h(t,O),h(t,E),h(t,L),F=!0,R||(H=[G(t,"click",Q),G(t,"keydown",j)],R=!0)},p(X,U){e=X,(!F||U&16&&!Jn(l.src,o="./images/avatars/avatar"+(e[24].avatar||0)+".svg"))&&p(l,"src",o);const Z={};U&16&&(Z.id=e[24].id),u.$set(Z),e[24].id===e[7].id?te||(te=nh(),te.c(),te.m(a,null)):te&&(te.d(1),te=null),(!F||U&16)&&g!==(g=e[24].email+"")&&he(v,g),(!F||U&16&&b!==(b=e[24].email))&&p(m,"title",b);const oe={};U&16&&(oe.date=e[24].created),S.$set(oe);const ae={};U&16&&(ae.date=e[24].updated),D.$set(ae)},i(X){F||(A(u.$$.fragment,X),A(S.$$.fragment,X),A(D.$$.fragment,X),F=!0)},o(X){P(u.$$.fragment,X),P(S.$$.fragment,X),P(D.$$.fragment,X),F=!1},d(X){X&&k(t),z(u),te&&te.d(),z(S),z(D),R=!1,Je(H)}}}function sh(n){let e,t,i=n[4].length+"",s,l,o=n[4].length+"",r;return{c(){e=_("small"),t=N("Showing "),s=N(i),l=N(" of "),r=N(o),p(e,"class","block txt-hint txt-right m-t-sm")},m(a,u){w(a,e,u),h(e,t),h(e,s),h(e,l),h(e,r)},p(a,u){u&16&&i!==(i=a[4].length+"")&&he(s,i),u&16&&o!==(o=a[4].length+"")&&he(r,o)},d(a){a&&k(e)}}}function kT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S,C,M,D,O,E,L,F,R,H,te,Q,j,X,U,Z,oe,ae,Te,re,me,ve=[],Y=new Map,Se,x,J,we,Re,ze;e=new Hi({}),c=new zo({}),c.$on("refresh",n[8]),y=new Vo({props:{value:n[1],placeholder:"Search filter, eg. email='test@example.com'",extraAutocompleteKeys:["email"]}}),y.$on("submit",n[10]);function K(ne){n[11](ne)}let pe={class:"col-type-text",name:"id",$$slots:{default:[mT]},$$scope:{ctx:n}};n[2]!==void 0&&(pe.sort=n[2]),L=new nn({props:pe}),ge.push(()=>Ne(L,"sort",K));function ce(ne){n[12](ne)}let ke={class:"col-type-email col-field-email",name:"email",$$slots:{default:[gT]},$$scope:{ctx:n}};n[2]!==void 0&&(ke.sort=n[2]),H=new nn({props:ke}),ge.push(()=>Ne(H,"sort",ce));function Ge(ne){n[13](ne)}let nt={class:"col-type-date col-field-created",name:"created",$$slots:{default:[_T]},$$scope:{ctx:n}};n[2]!==void 0&&(nt.sort=n[2]),j=new nn({props:nt}),ge.push(()=>Ne(j,"sort",Ge));function et(ne){n[14](ne)}let kt={class:"col-type-date col-field-updated",name:"updated",$$slots:{default:[bT]},$$scope:{ctx:n}};n[2]!==void 0&&(kt.sort=n[2]),Z=new nn({props:kt}),ge.push(()=>Ne(Z,"sort",et));let it=n[4];const Mt=ne=>ne[24].id;for(let ne=0;ne<it.length;ne+=1){let _e=xp(n,it,ne),Ke=Mt(_e);Y.set(Ke,ve[ne]=ih(Ke,_e))}let Be=null;it.length||(Be=eh(n));let Ye=n[4].length&&sh(n),dt={};return J=new hT({props:dt}),n[1
|
||
|
<span class="txt">New admin</span>`,b=T(),B(y.$$.fragment),$=T(),S=_("div"),C=_("table"),M=_("thead"),D=_("tr"),O=_("th"),E=T(),B(L.$$.fragment),R=T(),B(H.$$.fragment),Q=T(),B(j.$$.fragment),U=T(),B(Z.$$.fragment),ae=T(),Te=_("th"),re=T(),me=_("tbody");for(let ne=0;ne<ve.length;ne+=1)ve[ne].c();Be&&Be.c(),Se=T(),Ye&&Ye.c(),x=T(),B(J.$$.fragment),p(o,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(m,"class","flex-fill"),p(v,"type","button"),p(v,"class","btn btn-expanded"),p(s,"class","page-header"),p(O,"class","min-width"),p(Te,"class","col-type-action min-width"),p(C,"class","table"),ie(C,"table-loading",n[5]),p(S,"class","table-wrapper"),p(i,"class","page-wrapper")},m(ne,_e){V(e,ne,_e),w(ne,t,_e),w(ne,i,_e),h(i,s),h(s,l),h(l,o),h(l,r),h(l,a),h(a,u),h(s,f),V(c,s,null),h(s,d),h(s,m),h(s,g),h(s,v),h(i,b),V(y,i,null),h(i,$),h(i,S),h(S,C),h(C,M),h(M,D),h(D,O),h(D,E),V(L,D,null),h(D,R),V(H,D,null),h(D,Q),V(j,D,null),h(D,U),V(Z,D,null),h(D,ae),h(D,Te),h(C,re),h(C,me);for(let Ke=0;Ke<ve.length;Ke+=1)ve[Ke].m(me,null);Be&&Be.m(me,null),h(i,Se),Ye&&Ye.m(i,null),w(ne,x,_e),V(J,ne,_e),we=!0,Re||(ze=G(v,"click",n[9]),Re=!0)},p(ne,[_e]){(!we||_e&64)&&he(u,ne[6]);const Ke={};_e&2&&(Ke.value=ne[1]),y.$set(Ke);const lt={};_e&134217728&&(lt.$$scope={dirty:_e,ctx:ne}),!F&&_e&4&&(F=!0,lt.sort=ne[2],He(()=>F=!1)),L.$set(lt);const ut={};_e&134217728&&(ut.$$scope={dirty:_e,ctx:ne}),!te&&_e&4&&(te=!0,ut.sort=ne[2],He(()=>te=!1)),H.$set(ut);const tt={};_e&134217728&&(tt.$$scope={dirty:_e,ctx:ne}),!X&&_e&4&&(X=!0,tt.sort=ne[2],He(()=>X=!1)),j.$set(tt);const wt={};_e&134217728&&(wt.$$scope={dirty:_e,ctx:ne}),!oe&&_e&4&&(oe=!0,wt.sort=ne[2],He(()=>oe=!1)),Z.$set(wt),_e&186&&(it=ne[4],Pe(),ve=ht(ve,_e,Mt,1,ne,it,Y,me,Gt,ih,null,xp),Le(),!it.length&&Be?Be.p(ne,_e):it.length?Be&&(Be.d(1),Be=null):(Be=eh(ne),Be.c(),Be.m(me,null))),_e&32&&ie(C,"table-loading",ne[5]),ne[4].length?Ye?Ye.p(ne,_e):(Ye=sh(ne),Ye.c(),Ye.m(i,null)):Ye&&(Ye.d(1),Ye=null);const mt={};J.$set(mt)},i(ne){if(!we){A(e.$$.fragment,ne),A(c.$$.fragment,ne),A(y.$$.fragment,ne),A(L.$$.fragment,ne),A(H.$$.fragment,ne),A(j.$$.fragment,ne),A(Z.$$.fragment,ne);for(let _e=0;_e<it.length;_e+=1)A(ve[_e]);A(J.$$.fragment,ne),we=!0}},o(ne){P(e.$$.fragment,ne),P(c.$$.fragment,ne),P(y.$$.fragment,ne),P(L.$$.fragment,ne),P(H.$$.fragment,ne),P(j.$$.fragment,ne),P(Z.$$.fragment,ne);for(let _e=0;_e<ve.length;_e+=1)P(ve[_e]);P(J.$$.fragment,ne),we=!1},d(ne){z(e,ne),ne&&k(t),ne&&k(i),z(c),z(y),z(L),z(H),z(j),z(Z);for(let _e=0;_e<ve.length;_e+=1)ve[_e].d();Be&&Be.d(),Ye&&Ye.d(),ne&&k(x),n[18](null),z(J,ne),Re=!1,ze()}}}function wT(n,e,t){let i,s,l;yt(n,Io,R=>t(21,i=R)),yt(n,Rt,R=>t(6,s=R)),yt(n,va,R=>t(7,l=R)),fn(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),m(),be.errorResponseHandler(R,!1))})}function m(){t(4,a=[])}const g=()=>d(),v=()=>r==null?void 0:r.show(),b=R=>t(1,f=R.detail);function y(R){c=R,t(2,c)}function $(R){c=R,t(2,c)}function S(R){c=R,t(2,c)}function C(R){c=R,t(2,c)}const M=R=>r==null?void 0:r.show(R),D=(R,H)=>{(H.code==="Enter"||H.code==="Space")&&(H.preventDefault(),r==null||r.show(R))},O=()=>t(1,f="");function E(R){ge[R?"unshift":"push"](()=>{r=R,t(3,r)})}const L=()=>d(),F=()=>d();return n.$$.update=()=>{if(n.$$.dirty&6&&c!==-1&&f!==-1){const R=new URLSearchParams({filter:f,sort:c}).toString();yi("/settings/admins?"+R),d()}},[d,f,c,r,a,u,s,l,g,v,b,y,$,S,C,M,D,O,E,L,F]}class ST extends Ee{constructor(e){super(),Oe(this,e,wT,kT,De,{loadAdmins:0})}get loadAdmins(){return this.$$.ctx[0]}}function $T(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Email"),s=T(),l=_("input"),p(e,"for",i=n[8]),p(l,"type","email"),p(l,"id",o=n[8]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),h(e,t),w(u,s,f),w(u,l,f),Ce(l,n[0]),l.focus(),r||(a=G(l,"input",n[4]),r=!0)},p(u,f){f&256&&i!==(i=u[8])&&p(e,"for",i),f
|
||
|
<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,m){w(d,e,m),h(e,t),h(e,i),V(s,e,null),h(e,l),V(o,e,null),h(e,r),h(e,a),u=!0,f||(c=G(e,"submit",Yt(n[3])),f=!0)},p(d,m){const g={};m&769&&(g.$$scope={dirty:m,ctx:d}),s.$set(g);const v={};m&770&&(v.$$scope={dirty:m,ctx:d}),o.$set(v),m&4&&ie(a,"btn-disabled",d[2]),m&4&&ie(a,"btn-loading",d[2])},i(d){u||(A(s.$$.fragment,d),A(o.$$.fragment,d),u=!0)},o(d){P(s.$$.fragment,d),P(o.$$.fragment,d),u=!1},d(d){d&&k(e),z(s),z(o),f=!1,c()}}}function TT(n){let e,t;return e=new ag({props:{$$slots:{default:[MT]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,s){V(e,i,s),t=!0},p(i,[s]){const l={};s&519&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){P(e.$$.fragment,i),t=!1},d(i){z(e,i)}}}function DT(n,e,t){let i;yt(n,Io,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(()=>{yi("/")}).catch(()=>{ho("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 OT extends Ee{constructor(e){super(),Oe(this,e,DT,TT,De,{})}}function ET(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$;return i=new Ie({props:{class:"form-field required",name:"meta.appName",$$slots:{default:[PT,({uniqueId:S})=>({14:S}),({uniqueId:S})=>S?16384:0]},$$scope:{ctx:n}}}),o=new Ie({props:{class:"form-field required",name:"meta.appUrl",$$slots:{default:[LT,({uniqueId:S})=>({14:S}),({uniqueId:S})=>S?16384:0]},$$scope:{ctx:n}}}),a=new Ie({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[FT,({uniqueId:S})=>({14:S}),({uniqueId:S})=>S?16384:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=T(),l=_("div"),B(o.$$.fragment),r=T(),B(a.$$.fragment),u=T(),f=_("div"),c=_("div"),d=T(),m=_("button"),g=_("span"),g.textContent="Save changes",p(t,"class","col-lg-6"),p(l,"class","col-lg-6"),p(c,"class","flex-fill"),p(g,"class","txt"),p(m,"type","submit"),p(m,"class","btn btn-expanded"),m.disabled=v=!n[3]||n[2],ie(m,"btn-loading",n[2]),p(f,"class","col-lg-12 flex"),p(e,"class","grid")},m(S,C){w(S,e,C),h(e,t),V(i,t,null),h(e,s),h(e,l),V(o,l,null),h(e,r),V(a,e,null),h(e,u),h(e,f),h(f,c),h(f,d),h(f,m),h(m,g),b=!0,y||($=G(m,"click",n[9]),y=!0)},p(S,C){const M={};C&49153&&(M.$$scope={dirty:C,ctx:S}),i.$set(M);const D={};C&49153&&(D.$$scope={dirty:C,ctx:S}),o.$set(D);const O={};C&49153&&(O.$$scope={dirty:C,ctx:S}),a.$set(O),(!b||C&12&&v!==(v=!S[3]||S[2]))&&(m.disabled=v),C&4&&ie(m,"btn-loading",S[2])},i(S){b||(A(i.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),b=!0)},o(S){P(i.$$.fragment,S),P(o.$$.fragment,S),P(a.$$.fragment,S),b=!1},d(S){S&&k(e),z(i),z(o),z(a),y=!1,$()}}}function AT(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function PT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].meta.appName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function LT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].meta.appUrl)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function FT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Logs max days retention"),s=T(),l=_("input"),p(e,"for",i=n[14]),p(
|
||
|
<div class="breadcrumb-item">Application</div></nav>`,l=T(),o=_("div"),r=_("form"),u.c(),p(s,"class","page-header"),p(r,"class","panel"),p(r,"autocomplete","off"),p(o,"class","wrapper"),p(i,"class","page-wrapper")},m(b,y){V(e,b,y),w(b,t,y),w(b,i,y),h(i,s),h(i,l),h(i,o),h(o,r),g[a].m(r,null),f=!0,c||(d=G(r,"submit",Yt(n[4])),c=!0)},p(b,[y]){let $=a;a=v(b),a===$?g[a].p(b,y):(Pe(),P(g[$],1,1,()=>{g[$]=null}),Le(),u=g[a],u?u.p(b,y):(u=g[a]=m[a](b),u.c()),A(u,1),u.m(r,null))},i(b){f||(A(e.$$.fragment,b),A(u),f=!0)},o(b){P(e.$$.fragment,b),P(u),f=!1},d(b){z(e,b),b&&k(t),b&&k(i),g[a].d(),c=!1,d()}}}function NT(n,e,t){let i,s,l;yt(n,go,y=>t(10,s=y)),yt(n,Rt,y=>t(11,l=y)),fn(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(W.filterRedactedProps(o));d(y),un("Successfully saved application settings.")}catch(y){be.errorResponseHandler(y)}t(2,a=!1)}}function d(y={}){var $;fn(go,s=($=y==null?void 0:y.meta)==null?void 0:$.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 m(){o.meta.appName=this.value,t(0,o)}function g(){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,m,g,v,b]}class RT extends Ee{constructor(e){super(),Oe(this,e,NT,IT,De,{})}}function HT(n){let e,t,i,s=[{type:"password"},{autocomplete:"new-password"},n[5]],l={};for(let o=0;o<s.length;o+=1)l=ct(l,s[o]);return{c(){e=_("input"),ri(e,l)},m(o,r){w(o,e,r),e.autofocus&&e.focus(),n[7](e),Ce(e,n[0]),t||(i=G(e,"input",n[8]),t=!0)},p(o,r){ri(e,l=gn(s,[{type:"password"},{autocomplete:"new-password"},r&32&&o[5]])),r&1&&e.value!==o[0]&&Ce(e,o[0])},d(o){o&&k(e),n[7](null),t=!1,i()}}}function jT(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=ct(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"),ri(s,a)},m(u,f){w(u,e,f),h(e,t),w(u,i,f),w(u,s,f),s.autofocus&&s.focus(),l||(o=[Ue(Ct.call(null,t,{position:"left",text:"Set new value"})),G(t,"click",n[6])],l=!0)},p(u,f){ri(s,a=gn(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,Je(o)}}}function qT(n){let e;function t(l,o){return l[3]?jT:HT}let i=t(n),s=i(n);return{c(){s.c(),e=xe()},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:le,o:le,d(l){s.d(l),l&&k(e)}}}function VT(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 xn(),r==null||r.focus()}const f=()=>u();function c(m){ge[m?"unshift":"push"](()=>{r=m,t(2,r)})}function d(){l=this.value,t(0,l)}return n.$$set=m=>{e=ct(ct({},e),ai(m)),t(5,s=Jt(e,i)),"value"in m&&t(0,l=m.value),"mask"in m&&t(1,o=m.mask)},n.$$.update=()=>{n.$$.dirty&3&&l===o&&t(3,a=!0)},[l,o,r,a,u,s,f,c,d]}class Ya extends Ee{constructor(e){super(),Oe(this,e,VT,qT,De,{value:0,mask:1})}}function zT(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S,C,M,D,O,E,L,F,R,H,te;i=new Ie({props:{class:"form-field required",name:"meta.senderName",$$slots:{default:[UT,({uniqueId:j})=>({23:j}),({uniqueId:j})=>j?8388608:0]},$$scope:{ctx:n}}}),o=new Ie({props:{class:"form-field required",name:"meta.senderAddress",$$slots:{default:[WT,({uniqueId:j})=>({23:j}),({uniqueId:j})=>j?8388608:0]},$$scope:{ctx:n}}}),a=new Ie({props:{class:"form-field required",name:"meta.userVerificationUrl",$$slots:{default:[YT,({uniqueId:j})=>({23:j}),({uniqueId:j})=>j?8388608:0]},$$scope:{ctx:n}}}),f=new Ie({props:{class:"form-field required",name:"meta.userResetPasswordUrl",$$slots:{default:[KT,({uniqueId:j})=>({23:j}),({uniqueId:j})=>j?8388608:0]},
|
||
|
<br/>
|
||
|
<strong class="txt-bold">For better emails deliverability it is recommended to enable the SMTP settings
|
||
|
below.</strong></p>`,y=T(),B($.$$.fragment),S=T(),Q&&Q.c(),C=T(),M=_("div"),D=_("div"),O=T(),E=_("button"),L=_("span"),L.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(L,"class","txt"),p(E,"type","submit"),p(E,"class","btn btn-expanded"),E.disabled=F=!n[3]||n[2],ie(E,"btn-loading",n[2]),p(M,"class","flex")},m(j,X){w(j,e,X),h(e,t),V(i,t,null),h(e,s),h(e,l),V(o,l,null),h(e,r),V(a,e,null),h(e,u),V(f,e,null),h(e,c),V(d,e,null),w(j,m,X),w(j,g,X),w(j,v,X),w(j,b,X),w(j,y,X),V($,j,X),w(j,S,X),Q&&Q.m(j,X),w(j,C,X),w(j,M,X),h(M,D),h(M,O),h(M,E),h(E,L),R=!0,H||(te=G(E,"click",n[19]),H=!0)},p(j,X){const U={};X&25165825&&(U.$$scope={dirty:X,ctx:j}),i.$set(U);const Z={};X&25165825&&(Z.$$scope={dirty:X,ctx:j}),o.$set(Z);const oe={};X&25165825&&(oe.$$scope={dirty:X,ctx:j}),a.$set(oe);const ae={};X&25165825&&(ae.$$scope={dirty:X,ctx:j}),f.$set(ae);const Te={};X&25165825&&(Te.$$scope={dirty:X,ctx:j}),d.$set(Te);const re={};X&25165825&&(re.$$scope={dirty:X,ctx:j}),$.$set(re),j[0].smtp.enabled?Q?(Q.p(j,X),X&1&&A(Q,1)):(Q=lh(j),Q.c(),A(Q,1),Q.m(C.parentNode,C)):Q&&(Pe(),P(Q,1,1,()=>{Q=null}),Le()),(!R||X&12&&F!==(F=!j[3]||j[2]))&&(E.disabled=F),X&4&&ie(E,"btn-loading",j[2])},i(j){R||(A(i.$$.fragment,j),A(o.$$.fragment,j),A(a.$$.fragment,j),A(f.$$.fragment,j),A(d.$$.fragment,j),A($.$$.fragment,j),A(Q),R=!0)},o(j){P(i.$$.fragment,j),P(o.$$.fragment,j),P(a.$$.fragment,j),P(f.$$.fragment,j),P(d.$$.fragment,j),P($.$$.fragment,j),P(Q),R=!1},d(j){j&&k(e),z(i),z(o),z(a),z(f),z(d),j&&k(m),j&&k(g),j&&k(v),j&&k(b),j&&k(y),z($,j),j&&k(S),Q&&Q.d(j),j&&k(C),j&&k(M),H=!1,te()}}}function BT(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function UT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].meta.senderName)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function WT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].meta.senderAddress)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function YT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("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),h(e,t),w(c,s,d),w(c,l,d),Ce(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&&Ce(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 KT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("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),h(e,t),w(c,s,d),w(c,l,d),Ce(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&&Ce(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 ZT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=_("label"),t=N("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
|
||
|
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),h(e,t),w(c,s,d),w(c,l,d),Ce(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&&Ce(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 JT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=N("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),h(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 lh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S;return i=new Ie({props:{class:"form-field required",name:"smtp.host",$$slots:{default:[GT,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),o=new Ie({props:{class:"form-field required",name:"smtp.port",$$slots:{default:[XT,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),u=new Ie({props:{class:"form-field required",name:"smtp.tls",$$slots:{default:[QT,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),d=new Ie({props:{class:"form-field",name:"smtp.username",$$slots:{default:[xT,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),v=new Ie({props:{class:"form-field",name:"smtp.password",$$slots:{default:[eD,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=T(),l=_("div"),B(o.$$.fragment),r=T(),a=_("div"),B(u.$$.fragment),f=T(),c=_("div"),B(d.$$.fragment),m=T(),g=_("div"),B(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(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(e,"class","grid")},m(C,M){w(C,e,M),h(e,t),V(i,t,null),h(e,s),h(e,l),V(o,l,null),h(e,r),h(e,a),V(u,a,null),h(e,f),h(e,c),V(d,c,null),h(e,m),h(e,g),V(v,g,null),h(e,b),h(e,y),S=!0},p(C,M){const D={};M&25165825&&(D.$$scope={dirty:M,ctx:C}),i.$set(D);const O={};M&25165825&&(O.$$scope={dirty:M,ctx:C}),o.$set(O);const E={};M&25165825&&(E.$$scope={dirty:M,ctx:C}),u.$set(E);const L={};M&25165825&&(L.$$scope={dirty:M,ctx:C}),d.$set(L);const F={};M&25165825&&(F.$$scope={dirty:M,ctx:C}),v.$set(F)},i(C){S||(A(i.$$.fragment,C),A(o.$$.fragment,C),A(u.$$.fragment,C),A(d.$$.fragment,C),A(v.$$.fragment,C),C&&Ot(()=>{$||($=ot(e,en,{duration:150},!0)),$.run(1)}),S=!0)},o(C){P(i.$$.fragment,C),P(o.$$.fragment,C),P(u.$$.fragment,C),P(d.$$.fragment,C),P(v.$$.fragment,C),C&&($||($=ot(e,en,{duration:150},!1)),$.run(0)),S=!1},d(C){C&&k(e),z(i),z(o),z(u),z(d),z(v),C&&$&&$.end()}}}function GT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].smtp.host)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function XT(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].smtp.port)},d(u){u&&k(e),u&&k(s),u&&k(l),r=!1,a()}}}function QT(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 rs({props:u}),ge.push(()=>Ne(
|
||
|
the
|
||
|
`),r=_("strong"),u=N(a),f=N(`
|
||
|
to the
|
||
|
`),c=_("strong"),m=N(d),g=N(`.
|
||
|
`),v=_("br"),b=N(`
|
||
|
There are numerous command line tools that can help you, such as:
|
||
|
`),y=_("a"),y.textContent=`rclone
|
||
|
`,$=N(`,
|
||
|
`),S=_("a"),S.textContent=`s5cmd
|
||
|
`,C=N(", 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(S,"href","https://github.com/peak/s5cmd"),p(S,"target","_blank"),p(S,"rel","noopener"),p(S,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(L,F){w(L,e,F),h(e,t),h(t,i),h(t,s),h(t,l),h(l,o),h(l,r),h(r,u),h(l,f),h(l,c),h(c,m),h(l,g),h(l,v),h(l,b),h(l,y),h(l,$),h(l,S),h(l,C),h(e,M),h(e,D),E=!0},p(L,F){(!E||F&8)&&a!==(a=L[3]?"S3 storage":"local file system")&&he(u,a),(!E||F&1)&&d!==(d=L[0].enabled?"S3 storage":"local file system")&&he(m,d)},i(L){E||(L&&Ot(()=>{O||(O=ot(e,en,{duration:150},!0)),O.run(1)}),E=!0)},o(L){L&&(O||(O=ot(e,en,{duration:150},!1)),O.run(0)),E=!1},d(L){L&&k(e),L&&O&&O.end()}}}function rh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v,b,y,$,S,C,M,D;return i=new Ie({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 Ie({props:{class:"form-field required",name:"s3.bucket",$$slots:{default:[aD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),u=new Ie({props:{class:"form-field required",name:"s3.region",$$slots:{default:[uD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),d=new Ie({props:{class:"form-field required",name:"s3.accessKey",$$slots:{default:[fD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),v=new Ie({props:{class:"form-field required",name:"s3.secret",$$slots:{default:[cD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),$=new Ie({props:{class:"form-field",name:"s3.forcePathStyle",$$slots:{default:[dD,({uniqueId:O})=>({19:O}),({uniqueId:O})=>O?524288:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=T(),l=_("div"),B(o.$$.fragment),r=T(),a=_("div"),B(u.$$.fragment),f=T(),c=_("div"),B(d.$$.fragment),m=T(),g=_("div"),B(v.$$.fragment),b=T(),y=_("div"),B($.$$.fragment),S=T(),C=_("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(g,"class","col-lg-6"),p(y,"class","col-lg-12"),p(C,"class","col-lg-12"),p(e,"class","grid")},m(O,E){w(O,e,E),h(e,t),V(i,t,null),h(e,s),h(e,l),V(o,l,null),h(e,r),h(e,a),V(u,a,null),h(e,f),h(e,c),V(d,c,null),h(e,m),h(e,g),V(v,g,null),h(e,b),h(e,y),V($,y,null),h(e,S),h(e,C),D=!0},p(O,E){const L={};E&1572865&&(L.$$scope={dirty:E,ctx:O}),i.$set(L);const F={};E&1572865&&(F.$$scope={dirty:E,ctx:O}),o.$set(F);const R={};E&1572865&&(R.$$scope={dirty:E,ctx:O}),u.$set(R);const H={};E&1572865&&(H.$$scope={dirty:E,ctx:O}),d.$set(H);const te={};E&1572865&&(te.$$scope={dirty:E,ctx:O}),v.$set(te);const Q={};E&1572865&&(Q.$$scope={dirty:E,ctx:O}),$.$set(Q)},i(O){D||(A(i.$$.fragment,O),A(o.$$.fragment,O),A(u.$$.fragment,O),A(d.$$.fragment,O),A(v.$$.fragment,O),A($.$$.fragment,O),O&&Ot(()=>{M||(M=ot(e,en,{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($.$$.fragment,O),O&&(M||(M=ot(e,en,{duration:150},!1)),M.run(0)),D=!1},d(O){O&&k(e),z(i),z(o),z(u),z(d),z(v),z($),O&&M&&M.end()}}}function rD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].endpoint)},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=N("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),h(e,t),w(u,s,f),w(u,l,f),Ce(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&&Ce(l,u[0].bucket)},d(
|
||
|
<p>If you have limited disk space, you could optionally connect to a S3 compatible storage.</p>`,g=T(),b.c(),p(o,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(s,"class","page-header"),p(m,"class","content txt-xl m-b-base"),p(d,"class","panel"),p(d,"autocomplete","off"),p(c,"class","wrapper"),p(i,"class","page-wrapper")},m(O,E){V(e,O,E),w(O,t,E),w(O,i,E),h(i,s),h(s,l),h(l,o),h(l,r),h(l,a),h(a,u),h(i,f),h(i,c),h(c,d),h(d,m),h(d,g),M[v].m(d,null),y=!0,$||(S=G(d,"submit",Yt(n[16])),$=!0)},p(O,[E]){(!y||E&32)&&he(u,O[5]);let L=v;v=D(O),v===L?M[v].p(O,E):(Pe(),P(M[L],1,1,()=>{M[L]=null}),Le(),b=M[v],b?b.p(O,E):(b=M[v]=C[v](O),b.c()),A(b,1),b.m(d,null))},i(O){y||(A(e.$$.fragment,O),A(b),y=!0)},o(O){P(e.$$.fragment,O),P(b),y=!1},d(O){z(e,O),O&&k(t),O&&k(i),M[v].d(),$=!1,S()}}}function hD(n,e,t){let i,s;yt(n,Rt,D=>t(5,s=D)),fn(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(W.filterRedactedProps({s3:l}));d(D),ki({}),un("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 m(){l.enabled=this.checked,t(0,l)}function g(){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 $(D){n.$$.not_equal(l.secret,D)&&(l.secret=D,t(0,l))}function S(){l.forcePathStyle=this.checked,t(0,l)}const C=()=>c(),M=()=>c();return n.$$.update=()=>{n.$$.dirty&129&&t(4,i=a!=JSON.stringify(l))},[l,o,r,u,i,s,c,a,m,g,v,b,y,$,S,C,M]}class mD extends Ee{constructor(e){super(),Oe(this,e,hD,pD,De,{})}}function gD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=N("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),h(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 ah(n){let e,t,i,s,l,o,r,a,u,f,c;return i=new Ie({props:{class:"form-field required",name:"emailPassword.minPasswordLength",$$slots:{default:[_D,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),o=new Ie({props:{class:"form-field "+(W.isEmpty(n[0].onlyDomains)?"":"disabled"),name:"emailPassword.exceptDomains",$$slots:{default:[bD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),u=new Ie({props:{class:"form-field "+(W.isEmpty(n[0].exceptDomains)?"":"disabled"),name:"emailPassword.onlyDomains",$$slots:{default:[vD,({uniqueId:d})=>({16:d}),({uniqueId:d})=>d?65536:0]},$$scope:{ctx:n}}}),{c(){e=_("div"),t=_("div"),B(i.$$.fragment),s=T(),l=_("div"),B(o.$$.fragment),r=T(),a=_("div"),B(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,m){w(d,e,m),h(e,t),V(i,t,null),h(e,s),h(e,l),V(o,l,null),h(e,r),h(e,a),V(u,a,null),c=!0},p(d,m){const g={};m&196609&&(g.$$scope={dirty:m,ctx:d}),i.$set(g);const v={};m&1&&(v.class="form-field "+(W.isEmpty(d[0].onlyDomains)?"":"disabled")),m&196609&&(v.$$scope={dirty:m,ctx:d}),o.$set(v);const b={};m&1&&(b.class="form-field "+(W.isEmpty(d[0].exceptDomains)?"":"disabled")),m&196609&&(b.$$scope={dirty:m,ctx:d}),u.$set(b)},i(d){c||(A(i.$$.fragment,d),A(o.$$.fragment,d),A(u.$$.fragment,d),d&&Ot(()=>{f||(f=ot(e,en,{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=ot(e,en,{duration:150},!1)),f.run(0)),c=!1},d(d){d&&k(e),z(i),z(o),z(u),d&&f&&f.end()}}}function _D(n){let e,t,i,s,l,o,r,a;return{c(){e=_("label"),t=N("Minimum password length"),s=T(),l=_("input"),p(e,"for",i=n[16]),p(l,"type","number"),p(l,"id",o=n[16]),l.required=!0,p(l,"min","5"),p(l,"max","200")},m(u,f){w(u,e,f)
|
||
|
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 $={};y&65536&&($.id=b[16]),y&1&&($.disabled=!W.isEmpty(b[0].onlyDomains)),!a&&y&1&&(a=!0,$.value=b[0].exceptDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),z(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function vD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m;function g(b){n[11](b)}let v={id:n[16]+".config.onlyDomains",disabled:!W.isEmpty(n[0].exceptDomains)};return n[0].onlyDomains!==void 0&&(v.value=n[0].onlyDomains),r=new as({props:v}),ge.push(()=>Ne(r,"value",g)),{c(){e=_("label"),t=_("span"),t.textContent="Only domains",i=T(),s=_("i"),o=T(),B(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),h(e,t),h(e,i),h(e,s),w(b,o,y),V(r,b,y),w(b,u,y),w(b,f,y),c=!0,d||(m=Ue(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 $={};y&65536&&($.id=b[16]+".config.onlyDomains"),y&1&&($.disabled=!W.isEmpty(b[0].exceptDomains)),!a&&y&1&&(a=!0,$.value=b[0].onlyDomains,He(()=>a=!1)),r.$set($)},i(b){c||(A(r.$$.fragment,b),c=!0)},o(b){P(r.$$.fragment,b),c=!1},d(b){b&&k(e),b&&k(o),z(r,b),b&&k(u),b&&k(f),d=!1,m()}}}function yD(n){let e,t,i,s;e=new Ie({props:{class:"form-field form-field-toggle m-b-0",name:"emailPassword.enabled",$$slots:{default:[gD,({uniqueId:o})=>({16:o}),({uniqueId:o})=>o?65536:0]},$$scope:{ctx:n}}});let l=n[0].enabled&&ah(n);return{c(){B(e.$$.fragment),t=T(),l&&l.c(),i=xe()},m(o,r){V(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&196609&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].enabled?l?(l.p(o,r),r&1&&A(l,1)):(l=ah(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(Pe(),P(l,1,1,()=>{l=null}),Le())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){P(e.$$.fragment,o),P(l),s=!1},d(o){z(e,o),o&&k(t),l&&l.d(o),o&&k(i)}}}function kD(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 wD(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 uh(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=Ue(Ct.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(Ot(()=>{t||(t=ot(e,qn,{duration:150,start:.7},!0)),t.run(1)}),i=!0)},o(o){t||(t=ot(e,qn,{duration:150,start:.7},!1)),t.run(0),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function SD(n){let e,t,i,s,l,o,r;function a(d,m){return d[0].enabled?wD:kD}let u=a(n),f=u(n),c=n[2]&&uh();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=xe(),p(e,"class","inline-flex"),p(s,"class","flex-fill")},m(d,m){w(d,e,m),w(d,t,m),f.m(d,m),w(d,i,m),w(d,s,m),w(d,l,m),c&&c.m(d,m),w(d,o,m),r=!0},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(i.parentNode,i))),d[2]?c?m&4&&A(c,1):(c=uh(),c.c(),A(c,1),c.m(o.parentNode,o)):c&&(Pe(),P(c,1,1,()=>{c=null}),Le())},i(d){r||(A(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 $D(n){let e,t;const i=[n[3]];let s={$$slots:{header:[SD],default:[yD]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=ct(s,i[l]);return e=new Ba({props:s}),n[12](e),e.$on("expand",n[13]),e.$on("collapse",n[14]),e.$on("toggle",n[15]),{c(){B(e.$$.fragment)},m(l,o){V(e,l,o),t=!0},p(l,[o]){const r=o&8?gn(i,[ui(l[3])]):{};o&131077&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){P(e.$$.fragment,l),t=!1},d(l){n[12](null),z(e,l)}}}function CD(n,e,t){let i;const s=["config","expand","collapse","collapseSiblings"];let l=Jt(e,s),o;yt(n,ls,C=>t(7,o=C));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 m(){r.minPasswordLength=At(this.value),t(0,r)}function g(C){n.$$.not_equal(r.exceptDomains,C)&&(r.exceptDomains=C,t(0,r))}function v(C){n.$$.not_equal(r.onlyDomains,C)&&(r.onlyDomains=C,t(0,r))}function b(C){ge[C?"unshift":"push"](()=>{a=C,t(1,a)})}function y(C){at.call(this,n,C)}function $(C){at.call(this,n,C)}function S(C){at.call(this,n,C)}return n.$$set=C=>{e=ct(ct({},e),ai(C)),t(3,l=Jt(e,s)),"config"in C&&t(0,r=C.config)},n.$$.update=()=>{n.$$.dirty&128&&t(2,i=!W.isEmpty(o==null?void 0:o.emailPassword))},[r,a,i,l,u,f,c,o,d,m,g,v,b,y,$,S]}class MD extends Ee{constructor(e){super(),Oe(this,e,CD,$D,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 TD(n){let e,t,i,s,l,o,r,a;return{c(){e=_("input"),i=T(),s=_("label"),l=N("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),h(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 fh(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g;l=new Ie({props:{class:"form-field required",name:n[1]+".clientId",$$slots:{default:[DD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),a=new Ie({props:{class:"form-field required",name:n[1]+".clientSecret",$$slots:{default:[OD,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}}),c=new Ie({props:{class:"form-field",name:n[1]+".allowRegistrations",$$slots:{default:[ED,({uniqueId:b})=>({22:b}),({uniqueId:b})=>b?4194304:0]},$$scope:{ctx:n}}});let v=n[4]&&ch(n);return{c(){e=_("div"),t=_("div"),i=T(),s=_("div"),B(l.$$.fragment),o=T(),r=_("div"),B(a.$$.fragment),u=T(),f=_("div"),B(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),h(e,t),h(e,i),h(e,s),V(l,s,null),h(e,o),h(e,r),V(a,r,null),h(e,u),h(e,f),V(c,f,null),h(e,d),v&&v.m(e,null),g=!0},p(b,y){const $={};y&2&&($.name=b[1]+".clientId"),y&12582913&&($.$$scope={dirty:y,ctx:b}),l.$set($);const S={};y&2&&(S.name=b[1]+".clientSecret"),y&12582913&&(S.$$scope={dirty:y,ctx:b}),a.$set(S);const C={};y&2&&(C.name=b[1]+".allowRegistrations"),y&12582913&&(C.$$scope={dirty:y,ctx:b}),c.$set(C),b[4]?v?(v.p(b,y),y&16&&A(v,1)):(v=ch(b),v.c(),A(v,1),v.m(e,null)):v&&(Pe(),P(v,1,1,()=>{v=null}),Le())},i(b){g||(A(l.$$.fragment,b),A(a.$$.fragment,b),A(c.$$.fragment,b),A(v),b&&Ot(()=>{m||(m=ot(e,en,{duration:200},!0)),m.run(1)}),g=!0)},o(b){P(l.$$.fragment,b),P(a.$$.fragment,b),P(c.$$.fragment,b),P(v),b&&(m||(m=ot(e,en,{duration:200},!1)),m.run(0)),g=!1},d(
|
||
|
another PocketBase environment.</p>`,t=T(),i=_("div"),s=_("button"),s.innerHTML='<span class="txt">Copy</span>',l=T(),B(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),h(i,s),h(i,l),V(o,i,null),n[8](i),w(v,r,b),w(v,a,b),h(a,u),h(a,f),h(a,c),d=!0,m||(g=[G(s,"click",n[7]),G(i,"keydown",n[9]),G(c,"click",n[10])],m=!0)},p(v,b){const y={};b&4&&(y.content=v[2]),o.$set(y)},i(v){d||(A(o.$$.fragment,v),d=!0)},o(v){P(o.$$.fragment,v),d=!1},d(v){v&&k(e),v&&k(t),v&&k(i),z(o),n[8](null),v&&k(r),v&&k(a),m=!1,Je(g)}}}function QD(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function xD(n){let e,t,i,s,l,o,r,a,u,f,c,d,m,g,v;e=new Hi({});const b=[QD,XD],y=[];function $(S,C){return S[1]?0:1}return m=$(n),g=y[m]=b[m](n),{c(){B(e.$$.fragment),t=T(),i=_("main"),s=_("header"),l=_("nav"),o=_("div"),o.textContent="Settings",r=T(),a=_("div"),u=N(n[3]),f=T(),c=_("div"),d=_("div"),g.c(),p(o,"class","breadcrumb-item"),p(a,"class","breadcrumb-item"),p(l,"class","breadcrumbs"),p(s,"class","page-header"),p(d,"class","panel"),p(c,"class","wrapper"),p(i,"class","page-wrapper")},m(S,C){V(e,S,C),w(S,t,C),w(S,i,C),h(i,s),h(s,l),h(l,o),h(l,r),h(l,a),h(a,u),h(i,f),h(i,c),h(c,d),y[m].m(d,null),v=!0},p(S,[C]){(!v||C&8)&&he(u,S[3]);let M=m;m=$(S),m===M?y[m].p(S,C):(Pe(),P(y[M],1,1,()=>{y[M]=null}),Le(),g=y[m],g?g.p(S,C):(g=y[m]=b[m](S),g.c()),A(g,1),g.m(d,null))},i(S){v||(A(e.$$.fragment,S),A(g),v=!0)},o(S){P(e.$$.fragment,S),P(g),v=!1},d(S){z(e,S),S&&k(t),S&&k(i),y[m].d()}}}function eO(n,e,t){let i,s;yt(n,Rt,b=>t(3,s=b)),fn(Rt,s="Export collections",s);const l="export_"+W.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(){W.downloadJson(r,"pb_schema")}function c(){W.copyToClipboard(i),J0("The collections list was copied to your clipboard!",3e3)}const d=()=>c();function m(b){ge[b?"unshift":"push"](()=>{o=b,t(0,o)})}const g=b=>{if(b.ctrlKey&&b.code==="KeyA"){b.preventDefault();const y=window.getSelection(),$=document.createRange();$.selectNodeContents(o),y.removeAllRanges(),y.addRange($)}},v=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,2))},[o,a,i,s,f,c,r,d,m,g,v]}class tO extends Ee{constructor(e){super(),Oe(this,e,eO,xD,De,{})}}function gh(n,e,t){const i=n.slice();return i[15]=e[t],i}function nO(n){let e,t,i,s,l,o=n[15].new.name+"",r,a=n[15].old.name!==n[15].new.name&&_h(n);return{c(){e=_("span"),e.textContent="Modified",t=T(),i=_("div"),a&&a.c(),s=T(),l=_("strong"),r=N(o),p(e,"class","label label-warning"),p(l,"class","txt"),p(i,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),a&&a.m(i,null),h(i,s),h(i,l),h(l,r)},p(u,f){u[15].old.name!==u[15].new.name?a?a.p(u,f):(a=_h(u),a.c(),a.m(i,s)):a&&(a.d(1),a=null),f&4&&o!==(o=u[15].new.name+"")&&he(r,o)},d(u){u&&k(e),u&&k(t),u&&k(i),a&&a.d()}}}function iO(n){var o;let e,t,i,s=((o=n[15].old)==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="Deleted",t=T(),i=_("strong"),l=N(s),p(e,"class","label label-danger")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),h(i,l)},p(r,a){var u;a&4&&s!==(s=((u=r[15].old)==null?void 0:u.name)+"")&&he(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function sO(n){var o;let e,t,i,s=((o=n[15].new)==null?void 0:o.name)+"",l;return{c(){e=_("span"),e.textContent="New",t=T(),i=_("strong"),l=N(s),p(e,"class","label label-success")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),h(i,l)},p(r,a){var u;a&4&&s!==(s=((u=r[15].new)==null?void 0:u.name)+"")&&he(l,s)},d(r){r&&k(e),r&&k(t),r&&k(i)}}}function _h(n){let e,t=n[15].old.name+"",i,s,l;return{c(){e=_("strong"),i=N(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),h(e,i),w(o,s,r),w(o,
|
||
|
`),o=_("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=T(),B(a.$$.fragment),u=T(),D&&D.c(),f=T(),O&&O.c(),c=T(),d=_("div"),E&&E.c(),m=T(),g=_("div"),v=T(),b=_("button"),y=_("span"),y.textContent="Review",p(t,"type","file"),p(t,"class","hidden"),p(t,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),ie(o,"btn-loading",n[11]),p(e,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p(y,"class","txt"),p(b,"type","button"),p(b,"class","btn btn-expanded btn-warning m-l-auto"),b.disabled=$=!n[12],p(d,"class","flex m-t-base")},m(L,F){w(L,e,F),h(e,t),n[16](t),h(e,i),h(e,s),h(s,l),h(s,o),w(L,r,F),V(a,L,F),w(L,u,F),D&&D.m(L,F),w(L,f,F),O&&O.m(L,F),w(L,c,F),w(L,d,F),E&&E.m(d,null),h(d,m),h(d,g),h(d,v),h(d,b),h(b,y),S=!0,C||(M=[G(t,"change",n[17]),G(o,"click",n[18]),G(b,"click",n[21])],C=!0)},p(L,F){F[0]&2048&&ie(o,"btn-loading",L[11]);const R={};F[0]&32&&(R.class="form-field "+(L[5]?"":"field-error")),F[0]&33|F[1]&48&&(R.$$scope={dirty:F,ctx:L}),a.$set(R),L[5]&&L[1].length&&!L[6]?D||(D=Sh(),D.c(),D.m(f.parentNode,f)):D&&(D.d(1),D=null),L[5]&&L[1].length&&L[6]?O?O.p(L,F):(O=$h(L),O.c(),O.m(c.parentNode,c)):O&&(O.d(1),O=null),L[0]?E?E.p(L,F):(E=Ih(L),E.c(),E.m(d,m)):E&&(E.d(1),E=null),(!S||F[0]&4096&&$!==($=!L[12]))&&(b.disabled=$)},i(L){S||(A(a.$$.fragment,L),S=!0)},o(L){P(a.$$.fragment,L),S=!1},d(L){L&&k(e),n[16](null),L&&k(r),z(a,L),L&&k(u),D&&D.d(L),L&&k(f),O&&O.d(L),L&&k(c),L&&k(d),E&&E.d(),C=!1,Je(M)}}}function pO(n){let e;return{c(){e=_("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:le,i:le,o:le,d(t){t&&k(e)}}}function wh(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 hO(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[5]&&wh();return{c(){e=_("label"),t=N("Collections"),s=T(),l=_("textarea"),r=T(),c&&c.c(),a=xe(),p(e,"for",i=n[35]),p(e,"class","p-b-10"),p(l,"id",o=n[35]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,m){w(d,e,m),h(e,t),w(d,s,m),w(d,l,m),Ce(l,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=G(l,"input",n[19]),u=!0)},p(d,m){m[1]&16&&i!==(i=d[35])&&p(e,"for",i),m[1]&16&&o!==(o=d[35])&&p(l,"id",o),m[0]&1&&Ce(l,d[0]),!!d[0]&&!d[5]?c||(c=wh(),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 Sh(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 $h(n){let e,t,i,s,l,o=n[8].length&&Ch(n),r=n[3].length&&Dh(n),a=n[7].length&&Ph(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),h(i,s),r&&r.m(i,null),h(i,l),a&&a.m(i,null)},p(u,f){u[8].length?o?o.p(u,f):(o=Ch(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[3].length?r?r.p(u,f):(r=Dh(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[7].length?a?a.p(u,f):(a=Ph(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 Ch(n){let e=[],t=new Map,i,s=n[8];const l=o=>o[27].id;for(let o=0;o<s.length;o+=1){let r=kh(n,s,o),a=l(r);t.set(a,e[o]=Th(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=xe()},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=ht(e,r,l,1,o,s,t,i.parentNode,mn,Th,i,kh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Mh(n){let e,t,i=n[27].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),h(e,t),h(e,s),h(e,l)},p(o,r){r[0]&256&&i!==(i=o[27].id+"")&&he(s,i)},d(o){o&&k(e)}}}function Th(n,e){let t,i,s,l,o=e[27].name+"",r,a,u,f=e[27].id&&Mh(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Deleted",s=T(),l=_("strong"),r=N(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),h(t,i),h(t,s),h(t,l),h(l,r),h(t,a),f&&f.m(t,null),h(t,u)},p(c,d){e=c,d[0]&256&&o!==(o=e[27].name+"")&&he(r,o),e[27].id?f?f.p(e,d):(f=Mh(e),f.c(),f.m(t,u)):f&&(f.d(1),f=null)},d(c){c&&k(t),f&&f.d()}}}function Dh(n){let e=[],t=new Map,i,s=n[3];const l=o=>o[30].old.id+o[30].new.id;for(let o=0;o<s.length;o+=1){let r=yh(n,s,o),a=l(r);t.set(a,e[o]=Ah(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=xe()},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]&8&&(s=o[3],e=ht(e,r,l,1,o,s,t,i.parentNode,mn,Ah,i,yh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Oh(n){let e,t=n[30].old.name+"",i,s;return{c(){e=_("span"),i=N(t),s=N(" -"),p(e,"class","txt-strikethrough txt-hint")},m(l,o){w(l,e,o),h(e,i),w(l,s,o)},p(l,o){o[0]&8&&t!==(t=l[30].old.name+"")&&he(i,t)},d(l){l&&k(e),l&&k(s)}}}function Eh(n){let e,t,i=n[30].new.id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),h(e,t),h(e,s),h(e,l)},p(o,r){r[0]&8&&i!==(i=o[30].new.id+"")&&he(s,i)},d(o){o&&k(e)}}}function Ah(n,e){let t,i,s,l,o,r=e[30].new.name+"",a,u,f,c=e[30].old.name!==e[30].new.name&&Oh(e),d=e[30].new.id&&Eh(e);return{key:n,first:null,c(){t=_("div"),i=_("span"),i.textContent="Modified",s=T(),l=_("strong"),c&&c.c(),o=T(),a=N(r),u=T(),d&&d.c(),f=T(),p(i,"class","label label-warning list-label svelte-1jx20fl"),p(t,"class","list-item"),this.first=t},m(m,g){w(m,t,g),h(t,i),h(t,s),h(t,l),c&&c.m(l,null),h(l,o),h(l,a),h(t,u),d&&d.m(t,null),h(t,f)},p(m,g){e=m,e[30].old.name!==e[30].new.name?c?c.p(e,g):(c=Oh(e),c.c(),c.m(l,o)):c&&(c.d(1),c=null),g[0]&8&&r!==(r=e[30].new.name+"")&&he(a,r),e[30].new.id?d?d.p(e,g):(d=Eh(e),d.c(),d.m(t,f)):d&&(d.d(1),d=null)},d(m){m&&k(t),c&&c.d(),d&&d.d()}}}function Ph(n){let e=[],t=new Map,i,s=n[7];const l=o=>o[27].id;for(let o=0;o<s.length;o+=1){let r=vh(n,s,o),a=l(r);t.set(a,e[o]=Fh(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=xe()},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]&128&&(s=o[7],e=ht(e,r,l,1,o,s,t,i.parentNode,mn,Fh,i,vh))},d(o){for(let r=0;r<e.length;r+=1)e[r].d(o);o&&k(i)}}}function Lh(n){let e,t,i=n[27].id+"",s,l;return{c(){e=_("small"),t=N("("),s=N(i),l=N(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),h(e,t),h(e,s),h(e,l)},p(o,r){r[0]&128&&i!==(i=o[27].id+"")&&he(s,i)},d(o){o&&k(e)}}}function Fh(n,e){let t,i,s,l,o=e[27].name+"",r,a,u,f=e[27].id&&L
|
||
|
<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=[Ue(dn.call(null,e)),G(l,"click",n[6])],o=!0)},p:le,d(a){a&&k(e),a&&k(t),a&&k(i),a&&k(s),a&&k(l),o=!1,Je(r)}}}function PO(n){var m;let e,t,i,s,l,o,r,a,u,f,c;document.title=e=W.joinNonEmpty([n[3],n[2],"PocketBase"]," - ");let d=((m=n[0])==null?void 0:m.id)&&n[1]&&Hh(n);return o=new H_({props:{routes:bO}}),o.$on("routeLoading",n[4]),o.$on("conditionsFailed",n[5]),a=new CO({}),f=new EO({}),{c(){t=T(),i=_("div"),d&&d.c(),s=T(),l=_("div"),B(o.$$.fragment),r=T(),B(a.$$.fragment),u=T(),B(f.$$.fragment),p(l,"class","app-body"),p(i,"class","app-layout")},m(g,v){w(g,t,v),w(g,i,v),d&&d.m(i,null),h(i,s),h(i,l),V(o,l,null),h(l,r),V(a,l,null),w(g,u,v),V(f,g,v),c=!0},p(g,[v]){var b;(!c||v&12)&&e!==(e=W.joinNonEmpty([g[3],g[2],"PocketBase"]," - "))&&(document.title=e),((b=g[0])==null?void 0:b.id)&&g[1]?d?(d.p(g,v),v&3&&A(d,1)):(d=Hh(g),d.c(),A(d,1),d.m(i,s)):d&&(Pe(),P(d,1,1,()=>{d=null}),Le())},i(g){c||(A(d),A(o.$$.fragment,g),A(a.$$.fragment,g),A(f.$$.fragment,g),c=!0)},o(g){P(d),P(o.$$.fragment,g),P(a.$$.fragment,g),P(f.$$.fragment,g),c=!1},d(g){g&&k(t),g&&k(i),d&&d.d(),z(o),z(a),g&&k(u),z(f,g)}}}function LO(n,e,t){let i,s,l;yt(n,go,d=>t(2,i=d)),yt(n,va,d=>t(0,s=d)),yt(n,Rt,d=>t(3,l=d));let o,r=!1;function a(d){var m,g,v,b;((m=d==null?void 0:d.detail)==null?void 0:m.location)!==o&&(t(1,r=!!((v=(g=d==null?void 0:d.detail)==null?void 0:g.userData)!=null&&v.showAppSidebar)),o=(b=d==null?void 0:d.detail)==null?void 0:b.location,fn(Rt,l="",l),ki({}),u_())}function u(){yi("/")}async function f(){var d;if(!!(s!=null&&s.id))try{const m=await be.settings.getAll({$cancelKey:"loadAppName"});fn(go,i=((d=m==null?void 0:m.meta)==null?void 0:d.appName)||"",i)}catch(m){console.warn("Failed to load app name.",m)}}function c(){be.logout()}return n.$$.update=()=>{n.$$.dirty&1&&s!=null&&s.id&&f()},[s,r,i,l,a,u,c]}class FO extends Ee{constructor(e){super(),Oe(this,e,LO,PO,De,{})}}new FO({target:document.getElementById("app")});export{Je as A,un as B,W as C,yi as D,xe as E,ag as F,yt as G,Cs as H,ln as I,Un as J,ge as K,En as P,Ee as S,P as a,T as b,B as c,z as d,_ as e,p as f,w as g,h,Oe as i,Ue as j,Pe as k,dn as l,V as m,Le as n,k as o,be as p,Ie as q,ie as r,De as s,A as t,G as u,Yt as v,N as w,he as x,le as y,Ce as z};
|