pocketbase/ui/dist/assets/index-284695d1.js

159 lines
971 KiB
JavaScript
Raw Normal View History

2023-09-30 19:43:12 +08:00
var V1=Object.defineProperty;var z1=(n,e,t)=>e in n?V1(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var tr=(n,e,t)=>(z1(n,typeof e!="symbol"?e+"":e,t),t);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const l of s)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const l={};return s.integrity&&(l.integrity=s.integrity),s.referrerPolicy&&(l.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?l.credentials="include":s.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function i(s){if(s.ep)return;s.ep=!0;const l=t(s);fetch(s.href,l)}})();function x(){}const kl=n=>n;function He(n,e){for(const t in e)n[t]=e[t];return n}function B1(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function e_(n){return n()}function fu(){return Object.create(null)}function $e(n){n.forEach(e_)}function At(n){return typeof n=="function"}function me(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Pl;function _n(n,e){return n===e?!0:(Pl||(Pl=document.createElement("a")),Pl.href=e,n===Pl.href)}function U1(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function W1(n){let e;return ha(n,t=>e=t)(),e}function Ke(n,e,t){n.$$.on_destroy.push(ha(e,t))}function Tt(n,e,t,i){if(n){const s=t_(n,e,t,i);return n[0](s)}}function t_(n,e,t,i){return n[1]&&i?He(t.ctx.slice(),n[1](i(e))):t.ctx}function Ct(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 $t(n,e,t,i,s,l){if(s){const o=t_(e,t,i,l);n.p(o,s)}}function Mt(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 Qt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function et(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 wi(n){return n??""}function sn(n,e,t){return n.set(t),e}function Te(n){return n&&At(n.destroy)?n.destroy:x}function cu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const n_=typeof window<"u";let Fo=n_?()=>window.performance.now():()=>Date.now(),ma=n_?n=>requestAnimationFrame(n):x;const vs=new Set;function i_(n){vs.forEach(e=>{e.c(n)||(vs.delete(e),e.f())}),vs.size!==0&&ma(i_)}function No(n){let e;return vs.size===0&&ma(i_),{promise:new Promise(t=>{vs.add(e={c:n,f:t})}),abort(){vs.delete(e)}}}function b(n,e){n.appendChild(e)}function s_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Y1(n){const e=v("style");return e.textContent="/* empty */",K1(s_(n),e),e.sheet}function K1(n,e){return b(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function k(n){n.parentNode&&n.parentNode.removeChild(n)}function gt(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function v(n){return document.createElement(n)}function U(n){return document.createTextNode(n)}function E(){return U(" ")}function Se(){return U("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function xe(n){return function(e){return e.preventDefault(),n.call(this,e)}}function An(n){return function(e){return e.stopPropagation(),n.call(this,e)}}function p(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}const J1=["width","height"];function fi(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value
2023-09-01 14:22:49 +08:00
`;for(let _=0;_<=1;_+=a){const y=e+(t-e)*l(_);u+=_*100+`%{${o(y,1-y)}}
`}const f=u+`100% {${o(t,1-t)}}
2023-09-30 19:43:12 +08:00
}`,c=`__svelte_${X1(f)}_${r}`,d=s_(n),{stylesheet:h,rules:g}=po.get(d)||Q1(d,n);g[c]||(g[c]=!0,h.insertRule(`@keyframes ${c} ${f}`,h.cssRules.length));const m=n.style.animation||"";return n.style.animation=`${m?`${m}, `:""}${c} ${i}ms linear ${s}ms 1 both`,ho+=1,c}function cl(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?l=>l.indexOf(e)<0:l=>l.indexOf("__svelte")===-1),s=t.length-i.length;s&&(n.style.animation=i.join(", "),ho-=s,ho||x1())}function x1(){ma(()=>{ho||(po.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&k(e)}),po.clear())})}function e0(n,e,t,i){if(!e)return x;const s=n.getBoundingClientRect();if(e.left===s.left&&e.right===s.right&&e.top===s.top&&e.bottom===s.bottom)return x;const{delay:l=0,duration:o=300,easing:r=kl,start:a=Fo()+l,end:u=a+o,tick:f=x,css:c}=t(n,{from:e,to:s},i);let d=!0,h=!1,g;function m(){c&&(g=fl(n,0,1,o,l,r,c)),l||(h=!0)}function _(){c&&cl(n,g),d=!1}return No(y=>{if(!h&&y>=a&&(h=!0),h&&y>=u&&(f(1,0),_()),!d)return!1;if(h){const S=y-a,C=0+1*r(S/o);f(C,1-C)}return!0}),m(),f(0,1),_}function t0(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,o_(n,s)}}function o_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),s=i.transform==="none"?"":i.transform;n.style.transform=`${s} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let dl;function yi(n){dl=n}function wl(){if(!dl)throw new Error("Function called outside component initialization");return dl}function Gt(n){wl().$$.on_mount.push(n)}function n0(n){wl().$$.after_update.push(n)}function Is(n){wl().$$.on_destroy.push(n)}function pt(){const n=wl();return(e,t,{cancelable:i=!1}={})=>{const s=n.$$.callbacks[e];if(s){const l=l_(e,t,{cancelable:i});return s.slice().forEach(o=>{o.call(n,l)}),!l.defaultPrevented}return!0}}function Fe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bs=[],te=[];let ys=[];const Hr=[],r_=Promise.resolve();let Vr=!1;function a_(){Vr||(Vr=!0,r_.then(ga))}function ln(){return a_(),r_}function Qe(n){ys.push(n)}function ye(n){Hr.push(n)}const nr=new Set;let ds=0;function ga(){if(ds!==0)return;const n=dl;do{try{for(;ds<bs.length;){const e=bs[ds];ds++,yi(e),i0(e.$$)}}catch(e){throw bs.length=0,ds=0,e}for(yi(null),bs.length=0,ds=0;te.length;)te.pop()();for(let e=0;e<ys.length;e+=1){const t=ys[e];nr.has(t)||(nr.add(t),t())}ys.length=0}while(bs.length);for(;Hr.length;)Hr.pop()();Vr=!1,nr.clear(),yi(n)}function i0(n){if(n.fragment!==null){n.update(),$e(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Qe)}}function s0(n){const e=[],t=[];ys.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),ys=e}let Hs;function _a(){return Hs||(Hs=Promise.resolve(),Hs.then(()=>{Hs=null})),Hs}function ts(n,e,t){n.dispatchEvent(l_(`${e?"intro":"outro"}${t}`))}const io=new Set;let ri;function ue(){ri={r:0,c:[],p:ri}}function fe(){ri.r||$e(ri.c),ri=ri.p}function A(n,e){n&&n.i&&(io.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(io.has(n))return;io.add(n),ri.c.push(()=>{io.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ba={duration:0};function u_(n,e,t){const i={direction:"in"};let s=e(n,t,i),l=!1,o,r,a=0;function u(){o&&cl(n,o)}function f(){const{delay:d=0,duration:h=300,easing:g=kl,tick:m=x,css:_}=s||ba;_&&(o=fl(n,0,1,h,d,g,_,a++)),m(0,1);const y=Fo()+d,S=y+h;r&&r.abort(),l=!0,Qe(()=>ts(n,!0,"start")),r=No(C=>{if(l){if(C>=S)return m(1,0),ts(n,!0,"end"),u(),l=!1;if(C>=y){const T=g((C-y)/h);m(T,1-T)}}return l})}let c=!1;return{start(){c||(c=!0,cl(n),At(s)?(s=s(i),_a().then(f)):f())},invalidate(){c=!1},end(){l&&(u(),l=!1)}}}function va(n,e,t){const i={direction:"out"};let s=e(n,t,i),l=!0,o;const r=ri;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=kl,tick:h=x,css:g}=s||ba;g&&(o=fl(n,1,0,c,f,d,g));const m=Fo()+f,_=m+c;Qe(()=>ts(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),No(y=>{if(l){if(y>=_)return h(0,1),ts(
2023-09-01 14:22:49 +08:00
`),t+=i.map(s=>{let l="";return s.name.includes("(")||s.name.includes(" ")?l+=s.name:l+="`"+s.name+"`",s.collate&&(l+=" COLLATE "+s.collate),s.sort&&(l+=" "+s.sort.toUpperCase()),l}).join(`,
`),i.length>1&&(t+=`
2023-09-30 19:43:12 +08:00
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=V.parseIndex(e);return i.tableName=t,V.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const s=V.parseIndex(e);let l=!1;for(let o of s.columns)o.name===t&&(o.name=i,l=!0);return l?V.buildIndex(s):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const s of i)if(e.includes(s))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(s=>`${s}~${e}`).join("||")}static initCollection(e){return Object.assign({id:"",created:"",updated:"",name:"",type:"base",system:!1,listRule:null,viewRule:null,createRule:null,updateRule:null,deleteRule:null,schema:[],indexes:[],options:{}},e)}static initSchemaField(e){return Object.assign({id:"",name:"",type:"text",system:!1,required:!1,options:{}},e)}}const zo=In([]);function bo(n,e=4e3){return Bo(n,"info",e)}function jt(n,e=3e3){return Bo(n,"success",e)}function ls(n,e=4500){return Bo(n,"error",e)}function Py(n,e=4500){return Bo(n,"warning",e)}function Bo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{mb(i)},t)};zo.update(s=>(Ia(s,i.message),V.pushOrReplaceByKey(s,i,"message"),s))}function mb(n){zo.update(e=>(Ia(e,n),e))}function Aa(){zo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=V.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),V.removeByKey(n,"message",t.message))}const $i=In({});function en(n){$i.set(n||{})}function ci(n){$i.update(e=>(V.deleteByPath(e,n),e))}const La=In({});function Gr(n){La.set(n||{})}const ii=In([]),Ti=In({}),vo=In(!1),gb=In({});function Fy(n){ii.update(e=>{const t=V.findByKey(e,"id",n);return t?Ti.set(t):e.length&&Ti.set(e[0]),e})}function Ny(n){Ti.update(e=>V.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),ii.update(e=>(V.pushOrReplaceByKey(e,n,"id"),Pa(),V.sortCollections(e)))}function Ry(n){ii.update(e=>(V.removeByKey(e,"id",n.id),Ti.update(t=>t.id===n.id?e[0]:t),Pa(),e))}async function qy(n=null){vo.set(!0);try{let e=await de.collections.getFullList(200,{sort:"+name"});e=V.sortCollections(e),ii.set(e);const t=n&&V.findByKey(e,"id",n);t?Ti.set(t):e.length&&Ti.set(e[0]),Pa()}catch(e){de.error(e)}vo.set(!1)}function Pa(){gb.update(n=>(ii.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(s=>{var l;return s.type=="file"&&((l=s.options)==null?void 0:l.protected)}));return e}),n))}const dr="pb_admin_file_token";qo.prototype.logout=function(n=!0){this.authStore.clear(),n&&Hi("/login")};qo.prototype.error=function(n,e=!0,t=""){if(!n||!(n instanceof Error)||n.isAbort)return;const i=(n==null?void 0:n.status)<<0||400,s=(n==null?void 0:n.data)||{},l=s.message||n.message||t;if(e&&l&&ls(l),V.isEmpty(s.data)||en(s.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),Hi("/")};qo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=W1(gb);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(dr)||"";return(!t||ka(t,10))&&(t&&localStorage.removeItem(dr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(dr,t),this._adminFileTokenRequest=null),t};class jy extends g_{save(e,t){super.save(e,t),t&&!t.collectionId&&Gr(t)}clear(){super.clear(),Gr(null)}}const de=new qo("../",new jy("pb_admin_auth"));de.authStore.model&&!de.authStore.model.collectionId&&Gr(de.authStore.model);const Hy=n=>({}),Yu=n=>({});function Vy(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;const g=n[3].default,m=Tt(g,n,n[2],null),_=n[3].footer,y=Tt(_,n,n[2],Yu);return{c(){e=v("div"),t=v("main"),m&&m.c(),i=E(),s=v("footer"),y&&y.c(),l=E(),o=v("a"),o.innerHTML='<i class="ri-book-open-line txt-sm"></i> <span class="txt">Docs</span>',r=E(),a=v("span"),a.textContent="|",u=E(),f=v("a"),c=v("span"),c.textContent="PocketBase v0.18.9",p(t,"class","page-content"),p(o,"href","https://pocketbase.io/docs/"),p(o,"target","_blank"),p(o,"rel","noopener
2023-09-01 14:22:49 +08:00
transform: ${u} translate(${(1-m)*c}${d}, ${(1-m)*h}${g});
opacity: ${a-f*_}`}}function it(n,{delay:e=0,duration:t=400,easing:i=Uo,axis:s="y"}={}){const l=getComputedStyle(n),o=+l.opacity,r=s==="y"?"height":"width",a=parseFloat(l[r]),u=s==="y"?["top","bottom"]:["left","right"],f=u.map(y=>`${y[0].toUpperCase()}${y.slice(1)}`),c=parseFloat(l[`padding${f[0]}`]),d=parseFloat(l[`padding${f[1]}`]),h=parseFloat(l[`margin${f[0]}`]),g=parseFloat(l[`margin${f[1]}`]),m=parseFloat(l[`border${f[0]}Width`]),_=parseFloat(l[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:y=>`overflow: hidden;opacity: ${Math.min(y*20,1)*o};${r}: ${y*a}px;padding-${u[0]}: ${y*c}px;padding-${u[1]}: ${y*d}px;margin-${u[0]}: ${y*h}px;margin-${u[1]}: ${y*g}px;border-${u[0]}-width: ${y*m}px;border-${u[1]}-width: ${y*_}px;`}}function Jt(n,{delay:e=0,duration:t=400,easing:i=Uo,start:s=0,opacity:l=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-s,f=r*(1-l);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2023-09-01 14:22:49 +08:00
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
2023-09-30 19:43:12 +08:00
`}}let Xr,Yi;const Qr="app-tooltip";function Ju(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ni(){return Yi=Yi||document.querySelector("."+Qr),Yi||(Yi=document.createElement("div"),Yi.classList.add(Qr),document.body.appendChild(Yi)),Yi}function bb(n,e){let t=Ni();if(!t.classList.contains("active")||!(e!=null&&e.text)){xr();return}t.textContent=e.text,t.className=Qr+" active",e.class&&t.classList.add(e.class),e.position&&t.classList.add(e.position),t.style.top="0px",t.style.left="0px";let i=t.offsetHeight,s=t.offsetWidth,l=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=l.top+l.height/2-i/2,r=l.left-s-a):e.position=="right"?(o=l.top+l.height/2-i/2,r=l.right+a):e.position=="top"?(o=l.top-i-a,r=l.left+l.width/2-s/2):e.position=="top-left"?(o=l.top-i-a,r=l.left):e.position=="top-right"?(o=l.top-i-a,r=l.right-s):e.position=="bottom-left"?(o=l.top+l.height+a,r=l.left):e.position=="bottom-right"?(o=l.top+l.height+a,r=l.right-s):(o=l.top+l.height+a,r=l.left+l.width/2-s/2),r+s>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-s),r=r>=0?r:0,o+i>document.documentElement.clientHeight&&(o=document.documentElement.clientHeight-i),o=o>=0?o:0,t.style.top=o+"px",t.style.left=r+"px"}function xr(){clearTimeout(Xr),Ni().classList.remove("active"),Ni().activeNode=void 0}function Yy(n,e){Ni().activeNode=n,clearTimeout(Xr),Xr=setTimeout(()=>{Ni().classList.add("active"),bb(n,e)},isNaN(e.delay)?0:e.delay)}function je(n,e){let t=Ju(e);function i(){Yy(n,t)}function s(){xr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",s),n.addEventListener("blur",s),(t.hideOnClick===!0||t.hideOnClick===null&&V.isFocusable(n))&&n.addEventListener("click",s),Ni(),{update(l){var o,r;t=Ju(l),(r=(o=Ni())==null?void 0:o.activeNode)!=null&&r.contains(n)&&bb(n,t)},destroy(){var l,o;(o=(l=Ni())==null?void 0:l.activeNode)!=null&&o.contains(n)&&xr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",s),n.removeEventListener("blur",s),n.removeEventListener("click",s)}}}function Gu(n,e,t){const i=n.slice();return i[12]=e[t],i}const Ky=n=>({}),Zu=n=>({uniqueId:n[4]});function Jy(n){let e,t,i=ge(n[3]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Xu(Gu(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&8){i=ge(o[3]);let a;for(a=0;a<i.length;a+=1){const u=Gu(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Xu(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ue(),a=i.length;a<s.length;a+=1)l(a);fe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){o&&k(e),gt(s,o)}}}function Gy(n){let e,t,i,s,l,o,r;return{c(){e=v("div"),t=v("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon")},m(a,u){w(a,e,u),b(e,t),l=!0,o||(r=Te(i=je.call(null,t,{position:"left",text:n[3].map(yo).join(`
`)})),o=!0)},p(a,u){i&&At(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(yo).join(`
`)})},i(a){l||(a&&Qe(()=>{l&&(s||(s=qe(t,Jt,{duration:150,start:.7},!0)),s.run(1))}),l=!0)},o(a){a&&(s||(s=qe(t,Jt,{duration:150,start:.7},!1)),s.run(0)),l=!1},d(a){a&&k(e),a&&s&&s.end(),o=!1,r()}}}function Xu(n){let e,t,i=yo(n[12])+"",s,l,o,r;return{c(){e=v("div"),t=v("pre"),s=U(i),l=E(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),b(e,t),b(t,s),b(e,l),r=!0},p(a,u){(!r||u&8)&&i!==(i=yo(a[12])+"")&&se(s,i)},i(a){r||(a&&Qe(()=>{r&&(o||(o=qe(e,it,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=qe(e,it,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&k(e),a&&o&&o.end()}}}function Zy(n){let e,t,i,s,l,o,r;const a=n[9].default,u=Tt(a,n,n[8],Zu),f=[Gy,Jy],c=[];function d(h,g){return h[0]&&h[3].length?0:1}return i=d(n),s=c[i]=f[i](n),{c(){e=v("div"),u&&u.c(),t=E(),s.c(),p(e,"class",n[1]),Q(e,"error",n[3].length)},m(h,g){w(h,e,g),u&&u.m(e,null),b(e,t),c[i].m(e,null),n[11](e),l=!0,o||(r=K(e,"click",n[10]),o=!0)},p(h,[g]){u&&u.p&&(!l||g&256)&&$t(u,a,h,h[8],l?Ct(a,h[8],g,Ky):Mt(h[8]),Zu);let m=i;i=d(h),i===m?c[i].p(h,g):(ue(),L(c[m],1,1,()=>{c[m]=null}),fe(),s=c[i],s?s.p(h,g):(s=c[i]=f[i](h),s.c()),A(s,1),s.m(e,null)),(!l||g&2)&&p(e,"class",h[1]),(!l||g&10)&&Q(e,"error",h[3].length)},i(h){l||(A(u,h),A(s),l=!0)},o(h){L(u,h),L(s),l=!1},d(h){h&&k(e),u&&u.d(h),c[i].d(),n[11](null),o=!1,r()}}}const Qu="Invalid value";function yo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Qu:n||Qu}function Xy(n,e,t){let i;Ke(n,$i,m=>t(7,i=m));let{$$slots:s={},$$scope:l}=e;const o="field_"+V.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ci(r)}Gt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function h(m){Fe.call(this,n,m)}function g(m){te[m?"unshift":"push"](()=>{f=m,t(2,f)})}return n.$$set=m=>{"name"in m&&t(5,r=m.name),"inlineError"in m&&t(0,a=m.inlineError),"class"in m&&t(1,u=m.class),"$$scope"in m&&t(8,l=m.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=V.toArray(V.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,l,s,h,g]}class pe extends ve{constructor(e){super(),be(this,e,Xy,Zy,me,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Qy(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Email"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","email"),p(l,"autocomplete","off"),p(l,"id",o=n[9]),l.required=!0,l.autofocus=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0]),l.focus(),r||(a=K(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]&&ae(l,u[0])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function xy(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Password"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(l,"type","password"),p(l,"autocomplete","new-password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[1]),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[6]),u=!0)},p(c,d){d&512&&i!==(i=c[9])&&p(e,"for",i),d&512&&o!==(o=c[9])&&p(l,"id",o),d&2&&l.value!==c[1]&&ae(l,c[1])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function ek(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Password confirm"),s=E(),l=v("input"),p(e,"for",i=n[9]),p(l,"type","password"),p(l,"minlength","10"),p(l,"id",o=n[9]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(l,"input",n[7]),r=!0)},p(u,f){f&512&&i!==(i=u[9])&&p(e,"for",i),f&512&&o!==(o=u[9])&&p(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function tk(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;return s=new pe({props:{class:"form-field required",name:"email",$$slots:{default:[Qy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field required",name:"password",$$slots:{default:[xy,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new pe({props:{class:"form-field required",name:"passwordConfirm",
2023-09-01 14:22:49 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-09-30 16:58:14 +08:00
*/function gi(){}const Nk=function(){let n=0;return function(){return n++}}();function ct(n){return n===null||typeof n>"u"}function Ot(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function nt(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}const Bt=n=>(typeof n=="number"||n instanceof Number)&&isFinite(+n);function Hn(n,e){return Bt(n)?n:e}function lt(n,e){return typeof n>"u"?e:n}const Rk=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100:n/e,vb=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function mt(n,e,t,i){let s,l,o;if(Ot(n))if(l=n.length,i)for(s=l-1;s>=0;s--)e.call(t,n[s],s);else for(s=0;s<l;s++)e.call(t,n[s],s);else if(nt(n))for(o=Object.keys(n),l=o.length,s=0;s<l;s++)e.call(t,n[o[s]],o[s])}function wo(n,e){let t,i,s,l;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(s=n[t],l=e[t],s.datasetIndex!==l.datasetIndex||s.index!==l.index)return!1;return!0}function So(n){if(Ot(n))return n.map(So);if(nt(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let s=0;for(;s<i;++s)e[t[s]]=So(n[t[s]]);return e}return n}function yb(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function qk(n,e,t,i){if(!yb(n))return;const s=e[n],l=t[n];nt(s)&&nt(l)?pl(s,l,i):e[n]=So(l)}function pl(n,e,t){const i=Ot(e)?e:[e],s=i.length;if(!nt(n))return n;t=t||{};const l=t.merger||qk;for(let o=0;o<s;++o){if(e=i[o],!nt(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 sl(n,e){return pl(n,e,{merger:jk})}function jk(n,e,t){if(!yb(n))return;const i=e[n],s=t[n];nt(i)&&nt(s)?sl(i,s):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=So(s))}const df={"":n=>n,x:n=>n.x,y:n=>n.y};function qi(n,e){return(df[e]||(df[e]=Hk(e)))(n)}function Hk(n){const e=Vk(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Vk(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 Na(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Jn=n=>typeof n<"u",ji=n=>typeof n=="function",pf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function zk(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const Vt=Math.PI,bt=2*Vt,Bk=bt+Vt,To=Number.POSITIVE_INFINITY,Uk=Vt/180,Ht=Vt/2,Ws=Vt/4,hf=Vt*2/3,Wn=Math.log10,ui=Math.sign;function mf(n){const e=Math.round(n);n=ll(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Wn(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function Wk(n){const e=[],t=Math.sqrt(n);let i;for(i=1;i<t;i++)n%i===0&&(e.push(i),e.push(n/i));return t===(t|0)&&e.push(t),e.sort((s,l)=>s-l).pop(),e}function Os(n){return!isNaN(parseFloat(n))&&isFinite(n)}function ll(n,e,t){return Math.abs(n-e)<t}function Yk(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function kb(n,e,t){let i,s,l;for(i=0,s=n.length;i<s;i++)l=n[i][t],isNaN(l)||(e.min=Math.min(e.min,l),e.max=Math.max(e.max,l))}function ti(n){return n*(Vt/180)}function Ra(n){return n*(180/Vt)}function gf(n){if(!Bt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function wb(n,e){const t=e.x-n.x,i=e.y-n.y,s=Math.sqrt(t*t+i*i);let l=Math.atan2(i,t);return l<-.5*Vt&&(l+=bt),{angle:l,distance:s}}function ea(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function Kk(n,e){return(n-e+Bk)%bt-Vt}function On(n){return(n%bt+bt)%bt}function hl(n,e,t,i){const s=On(n),l=On(e),o=On(t),r=On(l-s),a=On(o-s),u=On(s-l),f=On(s-o);return s===l||s===o||i&&l===o||r>a&&u<f}function dn(n,e,t){return Math.max(e,Math.min(t,n))}function Jk(n){return dn(n,-32768,32767)}function ml(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function qa(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 es=(n,e,t,i)=>qa(n,t,i?s=>n[s][e]<=t:s=>n[s][e]<t),Gk=(n,e,t)=>qa(n,t,i=>n[i][e]>=t);function Zk(n,e,
2023-09-01 14:22:49 +08:00
* @kurkle/color v0.2.1
* https://github.com/kurkle/color#readme
* (c) 2022 Jukka Kurkela
* Released under the MIT License
2023-09-30 16:58:14 +08:00
*/function Ml(n){return n+.5|0}const Li=(n,e,t)=>Math.max(Math.min(n,t),e);function el(n){return Li(Ml(n*2.55),0,255)}function Ri(n){return Li(Ml(n*255),0,255)}function vi(n){return Li(Ml(n/2.55)/100,0,1)}function kf(n){return Li(Ml(n*100),0,100)}const jn={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},ta=[..."0123456789ABCDEF"],e2=n=>ta[n&15],t2=n=>ta[(n&240)>>4]+ta[n&15],zl=n=>(n&240)>>4===(n&15),n2=n=>zl(n.r)&&zl(n.g)&&zl(n.b)&&zl(n.a);function i2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&jn[n[1]]*17,g:255&jn[n[2]]*17,b:255&jn[n[3]]*17,a:e===5?jn[n[4]]*17:255}:(e===7||e===9)&&(t={r:jn[n[1]]<<4|jn[n[2]],g:jn[n[3]]<<4|jn[n[4]],b:jn[n[5]]<<4|jn[n[6]],a:e===9?jn[n[7]]<<4|jn[n[8]]:255})),t}const s2=(n,e)=>n<255?e(n):"";function l2(n){var e=n2(n)?e2:t2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+s2(n.a,e):void 0}const o2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function Eb(n,e,t){const i=e*Math.min(t,1-t),s=(l,o=(l+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function r2(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 a2(n,e,t){const i=Eb(n,1,.5);let s;for(e+t>1&&(s=1/(e+t),e*=s,t*=s),s=0;s<3;s++)i[s]*=1-e-t,i[s]+=e;return i}function u2(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 ja(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=u2(t,i,s,f,l),a=a*60+.5),[a|0,u||0,r]}function Ha(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ri)}function Va(n,e,t){return Ha(Eb,n,e,t)}function f2(n,e,t){return Ha(a2,n,e,t)}function c2(n,e,t){return Ha(r2,n,e,t)}function Db(n){return(n%360+360)%360}function d2(n){const e=o2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?el(+e[5]):Ri(+e[5]));const s=Db(+e[2]),l=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=f2(s,l,o):e[1]==="hsv"?i=c2(s,l,o):i=Va(s,l,o),{r:i[0],g:i[1],b:i[2],a:t}}function p2(n,e){var t=ja(n);t[0]=Db(t[0]+e),t=Va(t),n.r=t[0],n.g=t[1],n.b=t[2]}function h2(n){if(!n)return;const e=ja(n),t=e[0],i=kf(e[1]),s=kf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${s}%, ${vi(n.a)})`:`hsl(${t}, ${i}%, ${s}%)`}const wf={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"},Sf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
2023-09-01 14:22:49 +08:00
* Chart.js v3.9.1
* https://www.chartjs.org
* (c) 2022 Chart.js Contributors
* Released under the MIT License
2023-09-30 16:58:14 +08:00
*/class _w{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=Cb.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,s)=>{if(!i.running||!i.items.length)return;const l=i.items;let o=l.length-1,r=!1,a;for(;o>=0;--o)a=l[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(l[o]=l[l.length-1],l.pop());r&&(s.draw(),this._notify(s,i,e,"progress")),l.length||(i.running=!1,this._notify(s,i,e,"complete"),i.initial=!1),t+=l.length}),this._lastDate=e,t===0&&(this._running=!1)}_getAnims(e){const t=this._charts;let i=t.get(e);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},t.set(e,i)),i}listen(e,t,i){this._getAnims(e).listeners[t].push(i)}add(e,t){!t||!t.length||this._getAnims(e).items.push(...t)}has(e){return this._getAnims(e).items.length>0}start(e){const t=this._charts.get(e);t&&(t.running=!0,t.start=Date.now(),t.duration=t.items.reduce((i,s)=>Math.max(i,s._duration),0),this._refresh())}running(e){if(!this._running)return!1;const t=this._charts.get(e);return!(!t||!t.running||!t.items.length)}stop(e){const t=this._charts.get(e);if(!t||!t.items.length)return;const i=t.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var _i=new _w;const Ff="transparent",bw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Cf(n||Ff),s=i.valid&&Cf(e||Ff);return s&&s.valid?s.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class vw{constructor(e,t,i,s){const l=t[i];s=Wl([e.to,s,l,e.from]);const o=Wl([e.from,l,s]);this._active=!0,this._fn=e.fn||bw[e.type||typeof o],this._easing=ol[e.easing]||ol.linear,this._start=Math.floor(Date.now()+(e.delay||0)),this._duration=this._total=Math.floor(e.duration),this._loop=!!e.loop,this._target=t,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const s=this._target[this._prop],l=i-this._start,o=this._duration-l;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=l,this._loop=!!e.loop,this._to=Wl([e.to,t,s,e.from]),this._from=Wl([e.from,s,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,s=this._prop,l=this._from,o=this._loop,r=this._to;let a;if(this._active=l!==r&&(o||t<i),!this._active){this._target[s]=r,this._notify(!0);return}if(t<0){this._target[s]=l;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[s]=this._fn(l,r,a)}wait(){const e=this._promises||(this._promises=[]);return new Promise((t,i)=>{e.push({res:t,rej:i})})}_notify(e){const t=e?"res":"rej",i=this._promises||[];for(let s=0;s<i.length;s++)i[s][t]()}}const yw=["x","y","borderWidth","radius","tension"],kw=["color","borderColor","backgroundColor"];ot.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 ww=Object.keys(ot.animation);ot.describe("animation",{_fallback:!1,_indexable:!1,_scriptable:n=>n!=="onProgress"&&n!=="onComplete"&&n!=="fn"});ot.set("animations",{colors:{type:"color",properties:kw},numbers:{type:"number",properties:yw}});ot.describe("animations",{_fallback:"animation"});ot.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:n=>n|0}}}});class Wb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!nt(e))return;const t=this._properties;Object.getOwnPropertyNames(e).forEach(i=>{const s=e[i];if(!nt(s))return;const l={};for(con
2023-09-01 14:22:49 +08:00
`)>-1?n.split(`
2023-09-30 16:58:14 +08:00
`):n}function qS(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 dc(n,e){const t=n.chart.ctx,{body:i,footer:s,title:l}=n,{boxWidth:o,boxHeight:r}=e,a=En(e.bodyFont),u=En(e.titleFont),f=En(e.footerFont),c=l.length,d=s.length,h=i.length,g=Gn(e.padding);let m=g.height,_=0,y=i.reduce((T,$)=>T+$.before.length+$.lines.length+$.after.length,0);if(y+=n.beforeBody.length+n.afterBody.length,c&&(m+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),y){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;m+=h*T+(y-h)*a.lineHeight+(y-1)*e.bodySpacing}d&&(m+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const C=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,mt(n.title,C),t.font=a.string,mt(n.beforeBody.concat(n.afterBody),C),S=e.displayColors?o+2+e.boxPadding:0,mt(i,T=>{mt(T.before,C),mt(T.lines,C),mt(T.after,C)}),S=0,t.font=f.string,mt(n.footer,C),t.restore(),_+=g.width,{width:_,height:m}}function jS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function HS(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 VS(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"),HS(u,n,e,t)&&(u="center"),u}function pc(n,e,t){const i=t.yAlign||e.yAlign||jS(n,t);return{xAlign:t.xAlign||e.xAlign||VS(n,e,t,i),yAlign:i}}function zS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function BS(n,e,t){let{y:i,height:s}=n;return e==="top"?i+=t:e==="bottom"?i-=s+t:i-=s/2,i}function hc(n,e,t,i){const{caretSize:s,caretPadding:l,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=s+l,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:h}=ws(o);let g=zS(e,r);const m=BS(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,h)+s),{x:dn(g,0,i.width-e.width),y:dn(m,0,i.height-e.height)}}function Ql(n,e,t){const i=Gn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function mc(n){return oi([],bi(n))}function US(n,e,t){return Vi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function gc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}class fa extends Mi{constructor(e){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=e.chart||e._chart,this._chart=this.chart,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(e){this.options=e,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const e=this._cachedAnimations;if(e)return e;const t=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&t.options.animation&&i.animations,l=new Wb(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(l)),l}getContext(){return this.$context||(this.$context=US(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=oi(r,bi(s)),r=oi(r,bi(l)),r=oi(r,bi(o)),r}getBeforeBody(e,t){return mc(t.callbacks.beforeBody.apply(this,[e]))}getBody(e,t){const{callbacks:i}=t,s=[];return mt(e,l=>{const o={before:[],lines:[],after:[]},r=gc(i,l);oi(o.before,bi(r.beforeLabel.call(this,l))
2023-09-01 14:22:49 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
2023-09-30 16:58:14 +08:00
*/const c4={datetime:Be.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:Be.TIME_WITH_SECONDS,minute:Be.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};Zb._date.override({_id:"luxon",_create:function(n){return Be.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return c4},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=Be.fromFormat(n,e,t):n=Be.fromISO(n,t):n instanceof Date?n=Be.fromJSDate(n,t):i==="object"&&!(n instanceof Be)&&(n=Be.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 Tc(n){let e,t,i;return{c(){e=v("div"),p(e,"class","chart-loader loader svelte-vh4sl8")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,Jt,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function d4(n){let e,t,i=n[1]===1?"log":"logs",s;return{c(){e=U(n[1]),t=E(),s=U(i)},m(l,o){w(l,e,o),w(l,t,o),w(l,s,o)},p(l,o){o&2&&se(e,l[1]),o&2&&i!==(i=l[1]===1?"log":"logs")&&se(s,i)},d(l){l&&(k(e),k(t),k(s))}}}function p4(n){let e;return{c(){e=U("Loading...")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function h4(n){let e,t,i,s,l,o=n[2]&&Tc();function r(f,c){return f[2]?p4:d4}let a=r(n),u=a(n);return{c(){e=v("div"),o&&o.c(),t=E(),i=v("canvas"),s=E(),l=v("div"),u.c(),p(i,"class","chart-canvas svelte-vh4sl8"),jr(i,"height","250px"),jr(i,"width","100%"),p(e,"class","chart-wrapper svelte-vh4sl8"),Q(e,"loading",n[2]),p(l,"class","txt-hint m-t-xs txt-right")},m(f,c){w(f,e,c),o&&o.m(e,null),b(e,t),b(e,i),n[8](i),w(f,s,c),w(f,l,c),u.m(l,null)},p(f,[c]){f[2]?o?c&4&&A(o,1):(o=Tc(),o.c(),A(o,1),o.m(e,t)):o&&(ue(),L(o,1,1,()=>{o=null}),fe()),c&4&&Q(e,"loading",f[2]),a===(a=r(f))&&u?u.p(f,c):(u.d(1),u=a(f),u&&(u.c(),u.m(l,null)))},i(f){A(o)},o(f){L(o)},d(f){f&&(k(e),k(s),k(l)),o&&o.d(),n[8](null),u.d()}}}function m4(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),de.logs.getRequestsStats({filter:[s,i].filter(Boolean).join("&&")}).then(h=>{c();for(let g of h)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total);r.push({x:new Date,y:void 0})}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),de.error(h,(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(1,a=0),t(7,r=[])}Gt(()=>(Io.register(zi,Zo,Jo,iu,Al,RS,WS),t(6,o=new Io(l,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#ef4565",pointBackgroundColor:"#ef4565",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},options:{animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3",borderColor:"#dee3e8"},ticks:{precision:0,maxTicksLimit:6,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{borderColor:"#dee3e8",color:h=>h.tick.major?"#edf0f3":""},ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:h=>h.tick.major?"#16161a":"#666f75"}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(h){te[h?"unshift":"push"](()=>{l=h,t(0,l)})}return n.$$set=h=>{"filter"in h&&t(3,i=h.filter),"presets"in h&&t(4,s=h.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof s<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].d
2023-09-01 14:22:49 +08:00
* Prism: Lightweight, robust, elegant syntax highlighting
*
* @license MIT <https://opensource.org/licenses/MIT>
* @author Lea Verou <https://lea.verou.me>
* @namespace
* @public
*/var t=function(i){var s=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,l=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S(C){return C instanceof a?new a(C.type,S(C.content),C.alias):Array.isArray(C)?C.map(S):C.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(S){return Object.prototype.toString.call(S).slice(8,-1)},objId:function(S){return S.__id||Object.defineProperty(S,"__id",{value:++l}),S.__id},clone:function S(C,T){T=T||{};var $,O;switch(r.util.type(C)){case"Object":if(O=r.util.objId(C),T[O])return T[O];$={},T[O]=$;for(var M in C)C.hasOwnProperty(M)&&($[M]=S(C[M],T));return $;case"Array":return O=r.util.objId(C),T[O]?T[O]:($=[],T[O]=$,C.forEach(function(D,I){$[I]=S(D,T)}),$);default:return C}},getLanguage:function(S){for(;S;){var C=s.exec(S.className);if(C)return C[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,C){S.className=S.className.replace(RegExp(s,"gi"),""),S.classList.add("language-"+C)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch($){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec($.stack)||[])[1];if(S){var C=document.getElementsByTagName("script");for(var T in C)if(C[T].src==S)return C[T]}return null}},isActive:function(S,C,T){for(var $="no-"+C;S;){var O=S.classList;if(O.contains(C))return!0;if(O.contains($))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,C){var T=r.util.clone(r.languages[S]);for(var $ in C)T[$]=C[$];return T},insertBefore:function(S,C,T,$){$=$||r.languages;var O=$[S],M={};for(var D in O)if(O.hasOwnProperty(D)){if(D==C)for(var I in T)T.hasOwnProperty(I)&&(M[I]=T[I]);T.hasOwnProperty(D)||(M[D]=O[D])}var F=$[S];return $[S]=M,r.languages.DFS(r.languages,function(P,N){N===F&&P!=S&&(this[P]=M)}),M},DFS:function S(C,T,$,O){O=O||{};var M=r.util.objId;for(var D in C)if(C.hasOwnProperty(D)){T.call(C,D,C[D],$||D);var I=C[D],F=r.util.type(I);F==="Object"&&!O[M(I)]?(O[M(I)]=!0,S(I,T,null,O)):F==="Array"&&!O[M(I)]&&(O[M(I)]=!0,S(I,T,D,O))}}},plugins:{},highlightAll:function(S,C){r.highlightAllUnder(document,S,C)},highlightAllUnder:function(S,C,T){var $={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",$),$.elements=Array.prototype.slice.apply($.container.querySelectorAll($.selector)),r.hooks.run("before-all-elements-highlight",$);for(var O=0,M;M=$.elements[O++];)r.highlightElement(M,C===!0,$.callback)},highlightElement:function(S,C,T){var $=r.util.getLanguage(S),O=r.languages[$];r.util.setLanguage(S,$);var M=S.parentElement;M&&M.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(M,$);var D=S.textContent,I={element:S,language:$,grammar:O,code:D};function F(N){I.highlightedCode=N,r.hooks.run("before-insert",I),I.element.innerHTML=I.highlightedCode,r.hooks.run("after-highlight",I),r.hooks.run("complete",I),T&&T.call(I.element)}if(r.hooks.run("before-sanity-check",I),M=I.element.parentElement,M&&M.nodeName.toLowerCase()==="pre"&&!M.hasAttribute("tabindex")&&M.setAttribute("tabindex","0"),!I.code){r.hooks.run("complete",I),T&&T.call(I.element);return}if(r.hooks.run("before-highlight",I),!I.grammar){F(r.util.encode(I.code));return}if(C&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(N){F(N.data)},P.postMessage(JSON.stringify({language:I.language,code:I.code,immediateClose:!0}))}else F(r.highlight(I.code,I.grammar,I.language))},highlight:function(S,C,T){var $={code:S,grammar:C,language:T};if(r.hooks.run("before-tokenize",$),!$.grammar)throw new Error('The language "'+$.language+'" has no grammar.');return $.tokens=r.tokenize($.code,$.grammar),r.hooks.run("after-tokenize",$),a.stringify(r.util.encode($.tokens),$.language)},tokenize:function(S,C){var T=C.rest;if(T){for(var $ in T)C[$]=T[$];delete C.rest}var O=new c;return d(O,O.head,S),f(S,O,C,O.head,0),g(O)},hooks:{all:{},add:function
2023-09-30 16:58:14 +08:00
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(I+1))}y.textContent=O,t.highlightElement(y)},function(O){_.setAttribute(r,f),y.textContent=O})}}),t.plugins.fileHighlight={highlight:function(_){for(var y=(_||document).querySelectorAll(c),S=0,C;C=y[S++];)t.highlightElement(C)}};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)}}()})(g1);var b4=g1.exports;const Xs=_4(b4);var v4={exports:{}};(function(n){(function(){if(typeof Prism>"u")return;var e=Object.assign||function(o,r){for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);return o};function t(o){this.defaults=e({},o)}function i(o){return o.replace(/-(\w)/g,function(r,a){return a.toUpperCase()})}function s(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var l={"remove-trailing":"boolean","remove-indent":"boolean","left-trim":"boolean","right-trim":"boolean","break-lines":"number",indent:"number","remove-initial-line-feed":"boolean","tabs-to-spaces":"number","spaces-to-tabs":"number"};t.prototype={setDefaults:function(o){this.defaults=e(this.defaults,o)},normalize:function(o,r){r=e(this.defaults,r);for(var a in r){var u=i(a);a!=="normalize"&&u!=="setDefaults"&&r[a]&&this[u]&&(o=this[u].call(this,o,r[a]))}return o},leftTrim:function(o){return o.replace(/^\s+/,"")},rightTrim:function(o){return o.replace(/\s+$/,"")},tabsToSpaces:function(o,r){return r=r|0||4,o.replace(/\t/g,new Array(++r).join(" "))},spacesToTabs:function(o,r){return r=r|0||4,o.replace(RegExp(" {"+r+"}","g")," ")},removeTrailing:function(o){return o.replace(/\s*?$/gm,"")},removeInitialLineFeed:function(o){return o.replace(/^(?:\r?\n|\r)/,"")},removeIndent:function(o){var r=o.match(/^[^\S\n\r]*(?=\S)/gm);return!r||!r[0].length||(r.sort(function(a,u){return a.length-u.length}),!r[0].length)?o:o.replace(RegExp("^"+r[0],"gm"),"")},indent:function(o,r){return o.replace(/^[^\S\n\r]*(?=\S)/gm,new Array(++r).join(" ")+"$&")},breakLines:function(o,r){r=r===!0?80:r|0||80;for(var a=o.split(`
2023-09-01 14:22:49 +08:00
`),u=0;u<a.length;++u)if(!(s(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var h=s(f[d]);c+=h,c>r&&(f[d]=`
`+f[d],c=h)}a[u]=f.join("")}return a.join(`
2023-09-30 19:43:12 +08:00
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in l)if(Object.hasOwnProperty.call(l,u)){var f=l[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,h="",g="",m=!1,_=0;_<d.length;++_){var y=d[_];y==o.element?m=!0:y.nodeName==="#text"&&(m?g+=y.nodeValue:h+=y.nodeValue,a.removeChild(y),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=h+o.code+g,o.code=r.normalize(o.code,o.settings);else{var S=h+o.element.innerHTML+g;o.element.innerHTML=r.normalize(S,o.settings),o.code=o.element.textContent}}}})})()})(v4);(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 y4(n){let e,t,i;return{c(){e=v("div"),t=v("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(s,l){w(s,e,l),b(e,t),t.innerHTML=n[1]},p(s,[l]){l&2&&(t.innerHTML=s[1]),l&1&&i!==(i="code-wrapper prism-light "+s[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:x,o:x,d(s){s&&k(e)}}}function k4(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=Xs.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Xs.highlight(a,Xs.languages[l]||Xs.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 Xs<"u"&&s&&t(1,o=r(s))},[i,o,s,l]}class _1 extends ve{constructor(e){super(),be(this,e,k4,y4,me,{class:0,content:2,language:3})}}const w4=n=>({}),$c=n=>({}),S4=n=>({}),Mc=n=>({});function Oc(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C=n[4]&&!n[2]&&Ec(n);const T=n[19].header,$=Tt(T,n,n[18],Mc);let O=n[4]&&n[2]&&Dc(n);const M=n[19].default,D=Tt(M,n,n[18],null),I=n[19].footer,F=Tt(I,n,n[18],$c);return{c(){e=v("div"),t=v("div"),s=E(),l=v("div"),o=v("div"),C&&C.c(),r=E(),$&&$.c(),a=E(),O&&O.c(),u=E(),f=v("div"),D&&D.c(),c=E(),d=v("div"),F&&F.c(),p(t,
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]),y&1&&(S.disabled=!V.isEmpty(_[0].options.onlyDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function jT(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[4](_)}let m={id:n[8]+".options.onlyDomains",disabled:!V.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(m.value=n[0].options.onlyDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.call(null,s,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&256&&l!==(l=_[8]+".options.onlyDomains"))&&p(e,"for",l);const S={};y&256&&(S.id=_[8]+".options.onlyDomains"),y&1&&(S.disabled=!V.isEmpty(_[0].options.exceptDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function HT(n){let e,t,i,s,l,o,r;return i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[qT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[jT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),p(t,"class","col-sm-6"),p(l,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),b(e,t),j(i,t,null),b(e,s),b(e,l),j(o,l,null),r=!0},p(a,u){const f={};u&2&&(f.name="schema."+a[1]+".options.exceptDomains"),u&769&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};u&2&&(c.name="schema."+a[1]+".options.onlyDomains"),u&769&&(c.$$scope={dirty:u,ctx:a}),o.$set(c)},i(a){r||(A(i.$$.fragment,a),A(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&k(e),H(i),H(o)}}}function VT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[5](r)}let o={$$slots:{options:[HT]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=He(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),te.push(()=>he(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function zT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(d){n.$$.not_equal(l.options.exceptDomains,d)&&(l.options.exceptDomains=d,t(0,l))}function a(d){n.$$.not_equal(l.options.onlyDomains,d)&&(l.options.onlyDomains=d,t(0,l))}function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(2,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,s,r,a,u,f,c]}class y1 extends ve{constructor(e){super(),be(this,e,zT,VT,me,{field:0,key:1})}}function BT(n){let e,t,i;const s=[{key:n[1]},n[2]];function l(r){n[3](r)}let o={};for(let r=0;r<s.length;r+=1)o=He(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new y1({props:o}),te.push(()=>he(e,"field",l)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&6?yt(s,[a&2&&{key:r[1]},a&4&&Pt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function UT(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e;function r(f){l=f,t(0,l)}function a(f){Fe.call(this,n,f)}function u(f){Fe.call(this,n,f)}return n.$$set=f=>{e=He(He({},e),Qt(f)),t(2,s=et(e,i)),"field"in f&&t(0,l=f.field),"key"in f&&t(1,o=f.key)},[l,o,s,r,a,u]}class WT extends ve{constructor(e){super(),be(this,e,UT,BT,me,{field:0,key:1})}}function YT(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("input"),i=E(),s=v("label"),l=v("span"),l.textContent="Strip urls domain",o=E(),r=v("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(l,"class","txt"),p(r,"class","ri-information-line link-hint"),p(s,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=[K(e,"change",n[3]),Te(je.call(null,r,{text:"This could help making the editor content more portable between environments since there will be no local base url to replace."}))],u=!0)},p(c,d){d&256&&t!==(t=c[8])&&p(e,"id",t),d&1&&(e.checked=c[0].options.convertUrls),d&256&&a!==(a=c[8])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function KT
2023-09-01 14:22:49 +08:00
<span class='flatpickr-weekday'>
`+G.join("</span><span class='flatpickr-weekday'>")+`
2023-09-01 14:22:49 +08:00
</span>
2023-09-30 19:43:12 +08:00
`}}function le(){t.calendarContainer.classList.add("hasWeeks");var Y=ft("div","flatpickr-weekwrapper");Y.appendChild(ft("span","flatpickr-weekday",t.l10n.weekAbbreviation));var G=ft("div","flatpickr-weeks");return Y.appendChild(G),{weekWrapper:Y,weekNumbers:G}}function ee(Y,G){G===void 0&&(G=!0);var ne=G?Y:Y-t.currentMonth;ne<0&&t._hidePrevMonthArrow===!0||ne>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ne,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,we("onYearChange"),R()),N(),we("onMonthChange"),an())}function ie(Y,G){if(Y===void 0&&(Y=!0),G===void 0&&(G=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,G===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ne=Lr(t.config),re=ne.hours,Me=ne.minutes,Le=ne.seconds;h(re,Me,Le)}t.redraw(),Y&&we("onChange")}function Ee(){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 Ne(){t.config!==void 0&&we("onDestroy");for(var Y=t._handlers.length;Y--;)t._handlers[Y].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var G=t.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ne){try{delete t[ne]}catch{}})}function Ve(Y){return t.calendarContainer.contains(Y)}function ze(Y){if(t.isOpen&&!t.config.inline){var G=Cn(Y),ne=Ve(G),re=G===t.input||G===t.altInput||t.element.contains(G)||Y.path&&Y.path.indexOf&&(~Y.path.indexOf(t.input)||~Y.path.indexOf(t.altInput)),Me=!re&&!ne&&!Ve(Y.relatedTarget),Le=!t.config.ignoredFocusElements.some(function(Pe){return Pe.contains(G)});Me&&Le&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&a(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function oe(Y){if(!(!Y||t.config.minDate&&Y<t.config.minDate.getFullYear()||t.config.maxDate&&Y>t.config.maxDate.getFullYear())){var G=Y,ne=t.currentYear!==G;t.currentYear=G||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ne&&(t.redraw(),we("onYearChange"),R())}}function Ce(Y,G){var ne;G===void 0&&(G=!0);var re=t.parseDate(Y,void 0,G);if(t.config.minDate&&re&&$n(re,t.config.minDate,G!==void 0?G:!t.minDateHasTime)<0||t.config.maxDate&&re&&$n(re,t.config.maxDate,G!==void 0?G:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
2023-09-01 14:22:49 +08:00
`),r=v("code"),r.textContent="multipart/form-data",a=U(`
requests, the following normalization rules are applied if the `),u=v("code"),u.textContent="json",f=U(` field
is a
`),c=v("strong"),c.textContent="plain string",d=U(`:
`),h=v("ul"),g=v("li"),g.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",m=E(),_=v("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",y=E(),S=v("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=E(),T=v("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",$=E(),O=v("li"),D=U(M),I=U(" is converted to the json "),F=v("code"),F.textContent='{"a":1,"b":2}',P=E(),N=v("li"),N.textContent="numeric strings are converted to json number",R=E(),q=v("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",B=E(),Z=v("li"),Z.textContent="any other string (empty string too) is double quoted",X=U(`
2023-09-01 14:22:49 +08:00
Alternatively, if you want to avoid the string value normalizations, you can wrap your
2023-09-30 19:43:12 +08:00
data inside an object, eg.`),J=v("code"),J.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ee,ie){w(ee,e,ie),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o),b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(h,g),b(h,m),b(h,_),b(h,y),b(h,S),b(h,C),b(h,T),b(h,$),b(h,O),b(O,D),b(O,I),b(O,F),b(h,P),b(h,N),b(h,R),b(h,q),b(h,B),b(h,Z),b(i,X),b(i,J),le=!0},i(ee){le||(ee&&Qe(()=>{le&&(W||(W=qe(e,it,{duration:150},!0)),W.run(1))}),le=!0)},o(ee){ee&&(W||(W=qe(e,it,{duration:150},!1)),W.run(0)),le=!1},d(ee){ee&&k(e),ee&&W&&W.end()}}}function jC(n){let e,t,i,s,l,o,r;function a(d,h){return d[2]?qC:RC}let u=a(n),f=u(n),c=n[2]&&yd();return{c(){e=v("button"),t=v("strong"),t.textContent="String value normalizations",i=E(),f.c(),s=E(),c&&c.c(),l=Se(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,h){w(d,e,h),b(e,t),b(e,i),f.m(e,null),w(d,s,h),c&&c.m(d,h),w(d,l,h),o||(r=K(e,"click",n[4]),o=!0)},p(d,h){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?h&4&&A(c,1):(c=yd(),c.c(),A(c,1),c.m(l.parentNode,l)):c&&(ue(),L(c,1,1,()=>{c=null}),fe())},d(d){d&&(k(e),k(s),k(l)),f.d(),c&&c.d(d),o=!1,r()}}}function HC(n){let e,t,i;const s=[{key:n[1]},n[3]];function l(r){n[5](r)}let o={$$slots:{options:[jC]},$$scope:{ctx:n}};for(let r=0;r<s.length;r+=1)o=He(o,s[r]);return n[0]!==void 0&&(o.field=n[0]),e=new pi({props:o}),te.push(()=>he(e,"field",l)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){z(e.$$.fragment)},m(r,a){j(e,r,a),i=!0},p(r,[a]){const u=a&10?yt(s,[a&2&&{key:r[1]},a&8&&Pt(r[3])]):{};a&260&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ye(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){H(e,r)}}}function VC(n,e,t){const i=["field","key"];let s=et(e,i),{field:l}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){l=d,t(0,l)}function f(d){Fe.call(this,n,d)}function c(d){Fe.call(this,n,d)}return n.$$set=d=>{e=He(He({},e),Qt(d)),t(3,s=et(e,i)),"field"in d&&t(0,l=d.field),"key"in d&&t(1,o=d.key)},[l,o,r,s,a,u,f,c]}class zC extends ve{constructor(e){super(),be(this,e,VC,HC,me,{field:0,key:1})}}function BC(n){let e,t=(n[0].ext||"N/A")+"",i,s,l,o=n[0].mimeType+"",r;return{c(){e=v("span"),i=U(t),s=E(),l=v("small"),r=U(o),p(e,"class","txt"),p(l,"class","txt-hint")},m(a,u){w(a,e,u),b(e,i),w(a,s,u),w(a,l,u),b(l,r)},p(a,[u]){u&1&&t!==(t=(a[0].ext||"N/A")+"")&&se(i,t),u&1&&o!==(o=a[0].mimeType+"")&&se(r,o)},i:x,o:x,d(a){a&&(k(e),k(s),k(l))}}}function UC(n,e,t){let{item:i={}}=e;return n.$$set=s=>{"item"in s&&t(0,i=s.item)},[i]}class kd extends ve{constructor(e){super(),be(this,e,UC,BC,me,{item:0})}}const WC=[{ext:".xpm",mimeType:"image/x-xpixmap"},{ext:".7z",mimeType:"application/x-7z-compressed"},{ext:".zip",mimeType:"application/zip"},{ext:".xlsx",mimeType:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"},{ext:".docx",mimeType:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"},{ext:".pptx",mimeType:"application/vnd.openxmlformats-officedocument.presentationml.presentation"},{ext:".epub",mimeType:"application/epub+zip"},{ext:".jar",mimeType:"application/jar"},{ext:".odt",mimeType:"application/vnd.oasis.opendocument.text"},{ext:".ott",mimeType:"application/vnd.oasis.opendocument.text-template"},{ext:".ods",mimeType:"application/vnd.oasis.opendocument.spreadsheet"},{ext:".ots",mimeType:"application/vnd.oasis.opendocument.spreadsheet-template"},{ext:".odp",mimeType:"application/vnd.oasis.opendocument.presentation"},{ext:".otp",mimeType:"application/vnd.oasis.opendocument.presentation-template"},{ext:".odg",mimeType:"application/vnd.oasis.opendocument.graphics"},{ext:".otg",mimeType:"application/vnd.oasis.opendocument.graphics-template"},{ext:".odf",mimeType:"application/vnd.oasis.opendocument.formula"},{ext:".odc",mimeType:"application/vnd.oasis.opendocument.chart"},{ext:".sxc",mimeType:"application/vnd.sun.xml.calc"},{ext:".pdf",mimeType:"application/pdf"},{ext:".fdf",mimeType:"application/vnd.fdf"},{ext:
Leave empty for no restriction.`,position:"top"})),S=!0)},p(O,M){(!y||M&4194304&&l!==(l=O[22]))&&p(e,"for",l);const D={};M&4194304&&(D.id=O[22]),M&8&&(D.items=O[3]),!a&&M&1&&(a=!0,D.keyOfSelected=O[0].options.mimeTypes,ye(()=>a=!1)),r.$set(D);const I={};M&16777217&&(I.$$scope={dirty:M,ctx:O}),_.$set(I)},i(O){y||(A(r.$$.fragment,O),A(_.$$.fragment,O),y=!0)},o(O){L(r.$$.fragment,O),L(_.$$.fragment,O),y=!1},d(O){O&&(k(e),k(o),k(u),k(f)),H(r,O),H(_),S=!1,C()}}}function ZC(n){let e;return{c(){e=v("ul"),e.innerHTML=`<li><strong>WxH</strong>
2023-09-01 14:22:49 +08:00
(eg. 100x50) - crop to WxH viewbox (from center)</li> <li><strong>WxHt</strong>
(eg. 100x50t) - crop to WxH viewbox (from top)</li> <li><strong>WxHb</strong>
(eg. 100x50b) - crop to WxH viewbox (from bottom)</li> <li><strong>WxHf</strong>
(eg. 100x50f) - fit inside a WxH viewbox (without cropping)</li> <li><strong>0xH</strong>
(eg. 0x50) - resize to H height preserving the aspect ratio</li> <li><strong>Wx0</strong>
2023-09-30 19:43:12 +08:00
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function XC(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$;function O(D){n[13](D)}let M={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(M.value=n[0].options.thumbs),r=new Rs({props:M}),te.push(()=>he(r,"value",O)),S=new Ln({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[ZC]},$$scope:{ctx:n}}}),{c(){e=v("label"),t=v("span"),t.textContent="Thumb sizes",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),c=v("span"),c.textContent="Use comma as separator.",d=E(),h=v("button"),g=v("span"),g.textContent="Supported formats",m=E(),_=v("i"),y=E(),z(S.$$.fragment),p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(h,"type","button"),p(h,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(D,I){w(D,e,I),b(e,t),b(e,i),b(e,s),w(D,o,I),j(r,D,I),w(D,u,I),w(D,f,I),b(f,c),b(f,d),b(f,h),b(h,g),b(h,m),b(h,_),b(h,y),j(S,h,null),C=!0,T||($=Te(je.call(null,s,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(D,I){(!C||I&4194304&&l!==(l=D[22]))&&p(e,"for",l);const F={};I&4194304&&(F.id=D[22]),!a&&I&1&&(a=!0,F.value=D[0].options.thumbs,ye(()=>a=!1)),r.$set(F);const P={};I&16777216&&(P.$$scope={dirty:I,ctx:D}),S.$set(P)},i(D){C||(A(r.$$.fragment,D),A(S.$$.fragment,D),C=!0)},o(D){L(r.$$.fragment,D),L(S.$$.fragment,D),C=!1},d(D){D&&(k(e),k(o),k(u),k(f)),H(r,D),H(S),T=!1,$()}}}function QC(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("label"),t=U("Max file size"),s=E(),l=v("input"),r=E(),a=v("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(l,"type","number"),p(l,"id",o=n[22]),p(l,"step","1"),p(l,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[14]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(l,"id",o),d&1&&dt(l.value)!==c[0].options.maxSize&&ae(l,c[0].options.maxSize)},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function wd(n){let e,t,i;return t=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[xC,({uniqueId:s})=>({22:s}),({uniqueId:s})=>s?4194304:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","col-sm-3")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l&2&&(o.name="schema."+s[1]+".options.maxSelect"),l&20971521&&(o.$$scope={dirty:l,ctx:s}),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function xC(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max select"),s=E(),l=v("input"),p(e,"for",i=n[22]),p(l,"id",o=n[22]),p(l,"type","number"),p(l,"step","1"),p(l,"min","2"),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[0].options.maxSelect),r||(a=K(l,"input",n[15]),r=!0)},p(u,f){f&4194304&&i!==(i=u[22])&&p(e,"for",i),f&4194304&&o!==(o=u[22])&&p(l,"id",o),f&1&&dt(l.value)!==u[0].options.maxSelect&&ae(l,u[0].options.maxSelect)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function e$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;i=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[GC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),o=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[XC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[QC,({uniqueId:m})=>({22:m}),({uniqueId:m})=>m?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&wd(n);return{c(){e=v("div"),t=v("div"),z(i.$$.fragment),s=E(),l=v("div"),z(o.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),d=E(),g&&g.c(),p(t,"clas
2023-09-01 14:22:49 +08:00
2023-09-30 19:43:12 +08:00
`),position:"top"})),c=!0)},p(m,_){var S,C;l&&At(l.update)&&_&20&&l.update.call(null,{text:[`Whether on ${((S=m[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,m[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((C=m[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
2023-09-01 14:22:49 +08:00
2023-09-30 19:43:12 +08:00
`),position:"top"}),(!f||_&8388608&&o!==(o=m[23]))&&p(e,"for",o);const y={};_&8388608&&(y.id=m[23]),!u&&_&1&&(u=!0,y.keyOfSelected=m[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(y)},i(m){f||(A(a.$$.fragment,m),f=!0)},o(m){L(a.$$.fragment,m),f=!1},d(m){m&&(k(e),k(r)),H(a,m),c=!1,d()}}}function p$(n){let e,t,i,s,l,o=!n[2]&&Sd(n);return s=new pe({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[d$,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),o&&o.c(),t=E(),i=v("div"),z(s.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){w(r,e,a),o&&o.m(e,null),b(e,t),b(e,i),j(s,i,null),l=!0},p(r,a){r[2]?o&&(ue(),L(o,1,1,()=>{o=null}),fe()):o?(o.p(r,a),a&4&&A(o,1)):(o=Sd(r),o.c(),A(o,1),o.m(e,t));const u={};a&2&&(u.name="schema."+r[1]+".options.cascadeDelete"),a&41943061&&(u.$$scope={dirty:a,ctx:r}),s.$set(u)},i(r){l||(A(o),A(s.$$.fragment,r),l=!0)},o(r){L(o),L(s.$$.fragment,r),l=!1},d(r){r&&k(e),o&&o.d(),H(s)}}}function h$(n){let e,t,i,s,l;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[p$],default:[u$,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=He(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new pi({props:a}),te.push(()=>he(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return s=new ou({props:u}),n[20](s),s.$on("save",n[21]),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment)},m(f,c){j(e,f,c),w(f,i,c),j(s,f,c),l=!0},p(f,[c]){const d=c&258?yt(o,[c&2&&{key:f[1]},c&256&&Pt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ye(()=>t=!1)),e.$set(d);const h={};s.$set(h)},i(f){l||(A(e.$$.fragment,f),A(s.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),L(s.$$.fragment,f),l=!1},d(f){f&&k(i),H(e,f),n[20](null),H(s,f)}}}function m$(n,e,t){var P;let i,s;const l=["field","key"];let o=et(e,l),r;Ke(n,ii,N=>t(10,r=N));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,h=((P=a.options)==null?void 0:P.maxSelect)==1,g=h;function m(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,h=!0),t(9,g=h)}function _(){a.options.minSelect=dt(this.value),t(0,a),t(9,g),t(2,h)}function y(){a.options.maxSelect=dt(this.value),t(0,a),t(9,g),t(2,h)}function S(N){n.$$.not_equal(a.options.cascadeDelete,N)&&(a.options.cascadeDelete=N,t(0,a),t(9,g),t(2,h))}const C=()=>d==null?void 0:d.show();function T(N){n.$$.not_equal(a.options.collectionId,N)&&(a.options.collectionId=N,t(0,a),t(9,g),t(2,h))}function $(N){h=N,t(2,h)}function O(N){a=N,t(0,a),t(9,g),t(2,h)}function M(N){Fe.call(this,n,N)}function D(N){Fe.call(this,n,N)}function I(N){te[N?"unshift":"push"](()=>{d=N,t(3,d)})}const F=N=>{var R,q;(q=(R=N==null?void 0:N.detail)==null?void 0:R.collection)!=null&&q.id&&N.detail.collection.type!="view"&&t(0,a.options.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=He(He({},e),Qt(N)),t(8,o=et(e,l)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>N.type!="view")),n.$$.dirty&516&&g!=h&&(t(9,g=h),h?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&V.isEmpty(a.options)&&m(),n.$$.dirty&1025&&t(4,s=r.find(N=>N.id==a.options.collectionId)||null)},[a,u,h,d,s,i,f,c,o,g,r,_,y,S,C,T,$,O,M,D,I,F]}class g$ extends ve{constructor(e){super(),be(this,e,m$,h$,me,{field:0,key:1})}}const _$=n=>({dragging:n&4,dragover:n&8}),Td=n=>({dragging:n[2],dragover:n[3]});function b$(n){let e,t,i,s,l;const o=n[10].default,r=Tt(o,n,n[9],Td);return{c(){e=v("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),Q(e,"dragging",n[2]),Q(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,s||(l=[K(e,"dragover",xe(n[11])),K(e,"dragleave",xe(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],s=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&$t(r,o,a,a[9],i?Ct(o,a[9],u,_$):Mt(a[9]),Td),(!i||u&2&&t!==(t=!a[1]))&&
2023-09-01 14:22:49 +08:00
`),t=v("code"),t.textContent="username",i=U(` ,
`),s=v("code"),s.textContent="email",l=U(` ,
`),o=v("code"),o.textContent="emailVisibility",r=U(` ,
2023-09-30 19:43:12 +08:00
`),a=v("code"),a.textContent="verified",p(t,"class","txt-sm"),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),w(u,s,f),w(u,l,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(k(e),k(t),k(i),k(s),k(l),k(o),k(r),k(a))}}}function y$(n){let e,t,i,s;function l(u){n[6](u,n[17],n[18],n[19])}function o(){return n[7](n[19])}var r=n[1][n[17].type];function a(u,f){let c={key:u[4](u[17])};return u[17]!==void 0&&(c.field=u[17]),{props:c}}return r&&(e=Et(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&z(e.$$.fragment),i=E()},m(u,f){e&&j(e,u,f),w(u,i,f),s=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){ue();const c=e;L(c.$$.fragment,1,0,()=>{H(c,1)}),fe()}r?(e=Et(r,a(n)),te.push(()=>he(e,"field",l)),e.$on("remove",o),e.$on("rename",n[8]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(r){const c={};f&1&&(c.key=n[4](n[17])),!t&&f&1&&(t=!0,c.field=n[17],ye(()=>t=!1)),e.$set(c)}},i(u){s||(e&&A(e.$$.fragment,u),s=!0)},o(u){e&&L(e.$$.fragment,u),s=!1},d(u){u&&k(i),e&&H(e,u)}}}function Md(n,e){let t,i,s,l;function o(a){e[9](a)}let r={index:e[19],disabled:e[17].toDelete||e[17].id&&e[17].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[y$]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Il({props:r}),te.push(()=>he(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=Se(),z(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),j(i,a,u),l=!0},p(a,u){e=a;const f={};u&1&&(f.index=e[19]),u&1&&(f.disabled=e[17].toDelete||e[17].id&&e[17].system),u&1048577&&(f.$$scope={dirty:u,ctx:e}),!s&&u&1&&(s=!0,f.list=e[0].schema,ye(()=>s=!1)),i.$set(f)},i(a){l||(A(i.$$.fragment,a),l=!0)},o(a){L(i.$$.fragment,a),l=!1},d(a){a&&k(t),H(i,a)}}}function k$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h=[],g=new Map,m,_,y,S,C,T,$,O,M=n[0].type==="auth"&&$d(),D=ge(n[0].schema);const I=N=>N[17];for(let N=0;N<D.length;N+=1){let R=Cd(n,D,N),q=I(R);g.set(q,h[N]=Md(q,R))}_=new lT({props:{class:"btn btn-block btn-outline"}}),_.$on("select",n[12]);function F(N){n[13](N)}let P={};return n[0]!==void 0&&(P.collection=n[0]),T=new tT({props:P}),te.push(()=>he(T,"collection",F)),{c(){e=v("div"),t=v("p"),i=U(`System fields:
2023-09-01 14:22:49 +08:00
`),s=v("code"),s.textContent="id",l=U(` ,
`),o=v("code"),o.textContent="created",r=U(` ,
`),a=v("code"),a.textContent="updated",u=E(),M&&M.c(),f=U(`
2023-09-30 19:43:12 +08:00
.`),c=E(),d=v("div");for(let N=0;N<h.length;N+=1)h[N].c();m=E(),z(_.$$.fragment),y=E(),S=v("hr"),C=E(),z(T.$$.fragment),p(s,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","schema-fields")},m(N,R){w(N,e,R),b(e,t),b(t,i),b(t,s),b(t,l),b(t,o),b(t,r),b(t,a),b(t,u),M&&M.m(t,null),b(t,f),w(N,c,R),w(N,d,R);for(let q=0;q<h.length;q+=1)h[q]&&h[q].m(d,null);w(N,m,R),j(_,N,R),w(N,y,R),w(N,S,R),w(N,C,R),j(T,N,R),O=!0},p(N,[R]){N[0].type==="auth"?M||(M=$d(),M.c(),M.m(t,f)):M&&(M.d(1),M=null),R&55&&(D=ge(N[0].schema),ue(),h=vt(h,R,I,1,N,D,g,d,Ut,Md,null,Cd),fe());const q={};!$&&R&1&&($=!0,q.collection=N[0],ye(()=>$=!1)),T.$set(q)},i(N){if(!O){for(let R=0;R<D.length;R+=1)A(h[R]);A(_.$$.fragment,N),A(T.$$.fragment,N),O=!0}},o(N){for(let R=0;R<h.length;R+=1)L(h[R]);L(_.$$.fragment,N),L(T.$$.fragment,N),O=!1},d(N){N&&(k(e),k(c),k(d),k(m),k(y),k(S),k(C)),M&&M.d();for(let R=0;R<h.length;R+=1)h[R].d();H(_,N),H(T,N)}}}function w$(n,e,t){let i,{collection:s}=e;const l={text:TT,number:IT,bool:FT,email:y1,url:WT,editor:ZT,date:dC,select:NC,json:zC,file:l$,relation:g$};function o(T){s.schema[T]&&(s.schema.splice(T,1),t(0,s))}function r(T="text"){const $=V.initSchemaField({name:a(),type:T});$.onMountSelect=!0,s.schema.push($),t(0,s)}function a(T="field"){let $="";for(;u(T+$);)++$;return T+$}function u(T){var $;return!!(($=s==null?void 0:s.schema)!=null&&$.find(O=>O.name===T))}function f(T){return i.findIndex($=>$===T)}function c(T,$){var O;!((O=s==null?void 0:s.schema)!=null&&O.length)||T===$||!$||t(0,s.indexes=s.indexes.map(M=>V.replaceIndexColumn(M,T,$)),s)}function d(T,$,O,M){O[M]=T,t(0,s)}const h=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function m(T){n.$$.not_equal(s.schema,T)&&(s.schema=T,t(0,s))}const _=T=>{if(!T.detail)return;const $=T.detail.target;$.style.opacity=0,setTimeout(()=>{var O;(O=$==null?void 0:$.style)==null||O.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage($,0,0)},y=()=>{en({})},S=T=>r(T.detail);function C(T){s=T,t(0,s)}return n.$$set=T=>{"collection"in T&&t(0,s=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof s.schema>"u"&&t(0,s.schema=[],s),n.$$.dirty&1&&(i=s.schema.filter(T=>!T.toDelete)||[])},[s,l,o,r,f,c,d,h,g,m,_,y,S,C]}class S$ extends ve{constructor(e){super(),be(this,e,w$,k$,me,{collection:0})}}const T$=n=>({isAdminOnly:n&512}),Od=n=>({isAdminOnly:n[9]}),C$=n=>({isAdminOnly:n&512}),Ed=n=>({isAdminOnly:n[9]}),$$=n=>({isAdminOnly:n&512}),Dd=n=>({isAdminOnly:n[9]});function M$(n){let e,t;return e=new pe({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[E$,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&528&&(l.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),s&8&&(l.name=i[3]),s&295655&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function O$(n){let e;return{c(){e=v("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Ad(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<i class="ri-lock-line"></i> <span class="txt">Set Admins only</span>',p(e,"type","button"),p(e,"class","btn btn-sm btn-transparent btn-hint lock-toggle svelte-1akuazq")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[11]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function Id(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<small class="txt svelte-1akuazq">Unlock and set custom rule</small> <div class="icon svelte-1akuazq"><i class="ri-lock-unlock-line svelte-1akuazq"></i></div>',p(e,"type","button"),p(e,"class","unlock-overlay svelte-1akuazq"),p(e,"aria-label","Unlock and set custom rule")},m(o,r){w(o,e,r),i=!0,s||(l=K(e,"click",n[10]),s=!0)},p:x,i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end()
<br/> <code>@request.auth.id != &quot;&quot; &amp;&amp; created &gt; &quot;2022-01-01 00:00:00&quot;</code>`,p(s,"class","m-b-0"),p(o,"class","inline-flex flex-gap-5"),p(a,"class","m-t-10 m-b-5"),p(f,"class","m-b-0"),p(d,"class","inline-flex flex-gap-5"),p(g,"class","m-t-10 m-b-5"),p(_,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,N){w(P,e,N),b(e,t),b(t,i),b(i,s),b(i,l),b(i,o);for(let R=0;R<F.length;R+=1)F[R]&&F[R].m(o,null);b(i,r),b(i,a),b(i,u),b(i,f),b(i,c),b(i,d),b(i,h),b(i,g),b(i,m),b(i,_),b(i,y),b(i,S),b(i,C),b(i,T),b(i,$),b(i,O),D=!0},p(P,N){if(N&4){I=ge(P[2]);let R;for(R=0;R<I.length;R+=1){const q=Pd(P,I,R);F[R]?F[R].p(q,N):(F[R]=Nd(q),F[R].c(),F[R].m(o,null))}for(;R<F.length;R+=1)F[R].d(1);F.length=I.length}},i(P){D||(P&&Qe(()=>{D&&(M||(M=qe(e,it,{duration:150},!0)),M.run(1))}),D=!0)},o(P){P&&(M||(M=qe(e,it,{duration:150},!1)),M.run(0)),D=!1},d(P){P&&k(e),gt(F,P),P&&M&&M.end()}}}function Nd(n){let e,t=n[11]+"",i;return{c(){e=v("code"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&4&&t!==(t=s[11]+"")&&se(i,t)},d(s){s&&k(e)}}}function Rd(n){let e,t,i,s,l,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[I$,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Cs({props:c}),te.push(()=>he(e,"rule",f));function d(_){n[7](_)}let h={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(h.rule=n[0].updateRule),s=new Cs({props:h}),te.push(()=>he(s,"rule",d));function g(_){n[8](_)}let m={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(m.rule=n[0].deleteRule),r=new Cs({props:m}),te.push(()=>he(r,"rule",g)),{c(){z(e.$$.fragment),i=E(),z(s.$$.fragment),o=E(),z(r.$$.fragment)},m(_,y){j(e,_,y),w(_,i,y),j(s,_,y),w(_,o,y),j(r,_,y),u=!0},p(_,y){const S={};y&1&&(S.collection=_[0]),y&17408&&(S.$$scope={dirty:y,ctx:_}),!t&&y&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const C={};y&1&&(C.collection=_[0]),!l&&y&1&&(l=!0,C.rule=_[0].updateRule,ye(()=>l=!1)),s.$set(C);const T={};y&1&&(T.collection=_[0]),!a&&y&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(s.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){L(e.$$.fragment,_),L(s.$$.fragment,_),L(r.$$.fragment,_),u=!1},d(_){_&&(k(i),k(o)),H(e,_),H(s,_),H(r,_)}}}function qd(n){let e,t,i;return{c(){e=v("i"),p(e,"class","ri-information-line link-hint")},m(s,l){w(s,e,l),t||(i=Te(je.call(null,e,{text:'The Create rule is executed after a "dry save" of the submitted data, giving you access to the main record fields as in every other rule.',position:"top"})),t=!0)},d(s){s&&k(e),t=!1,i()}}}function I$(n){let e,t=!n[10]&&qd();return{c(){t&&t.c(),e=Se()},m(i,s){t&&t.m(i,s),w(i,e,s)},p(i,s){i[10]?t&&(t.d(1),t=null):t||(t=qd(),t.c(),t.m(e.parentNode,e))},d(i){i&&k(e),t&&t.d(i)}}}function jd(n){let e,t,i;function s(o){n[9](o)}let l={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[L$]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(l.rule=n[0].options.manageRule),e=new Cs({props:l}),te.push(()=>he(e,"rule",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function L$(n){let e,t,i;return{c(){e=v("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
2023-09-01 14:22:49 +08:00
changing the password without requiring to enter the old one, directly updating the verified
2023-09-30 16:58:14 +08:00
state or email, etc.`,t=E(),i=v("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(s,l){w(s,e,l),w(s,t,l),w(s,i,l)},p:x,d(s){s&&(k(e),k(t),k(i))}}}function P$(n){var N,R;let e,t,i,s,l,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,h,g,m,_,y,S,C,T,$=n[1]&&Fd(n);function O(q){n[4](q)}let M={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(M.rule=n[0].listRule),f=new Cs({props:M}),te.push(()=>he(f,"rule",O));function D(q){n[5](q)}let I={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(I.rule=n[0].viewRule),h=new Cs({props:I}),te.push(()=>he(h,"rule",D));let F=((N=n[0])==null?void 0:N.type)!=="view"&&Rd(n),P=((R=n[0])==null?void 0:R.type)==="auth"&&jd(n);return{c(){e=v("div"),t=v("div"),i=v("p"),i.innerHTML=`All rules follow the
2023-09-01 14:22:49 +08:00
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
2023-09-30 19:43:12 +08:00
</a>.`,s=E(),l=v("button"),r=U(o),a=E(),$&&$.c(),u=E(),z(f.$$.fragment),d=E(),z(h.$$.fragment),m=E(),F&&F.c(),_=E(),P&&P.c(),y=Se(),p(l,"type","button"),p(l,"class","expand-handle txt-sm txt-bold txt-nowrap link-hint"),p(t,"class","flex txt-sm txt-hint m-b-5"),p(e,"class","block m-b-sm handle")},m(q,B){w(q,e,B),b(e,t),b(t,i),b(t,s),b(t,l),b(l,r),b(e,a),$&&$.m(e,null),w(q,u,B),j(f,q,B),w(q,d,B),j(h,q,B),w(q,m,B),F&&F.m(q,B),w(q,_,B),P&&P.m(q,B),w(q,y,B),S=!0,C||(T=K(l,"click",n[3]),C=!0)},p(q,[B]){var J,W;(!S||B&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?$?($.p(q,B),B&2&&A($,1)):($=Fd(q),$.c(),A($,1),$.m(e,null)):$&&(ue(),L($,1,1,()=>{$=null}),fe());const Z={};B&1&&(Z.collection=q[0]),!c&&B&1&&(c=!0,Z.rule=q[0].listRule,ye(()=>c=!1)),f.$set(Z);const X={};B&1&&(X.collection=q[0]),!g&&B&1&&(g=!0,X.rule=q[0].viewRule,ye(()=>g=!1)),h.$set(X),((J=q[0])==null?void 0:J.type)!=="view"?F?(F.p(q,B),B&1&&A(F,1)):(F=Rd(q),F.c(),A(F,1),F.m(_.parentNode,_)):F&&(ue(),L(F,1,1,()=>{F=null}),fe()),((W=q[0])==null?void 0:W.type)==="auth"?P?(P.p(q,B),B&1&&A(P,1)):(P=jd(q),P.c(),A(P,1),P.m(y.parentNode,y)):P&&(ue(),L(P,1,1,()=>{P=null}),fe())},i(q){S||(A($),A(f.$$.fragment,q),A(h.$$.fragment,q),A(F),A(P),S=!0)},o(q){L($),L(f.$$.fragment,q),L(h.$$.fragment,q),L(F),L(P),S=!1},d(q){q&&(k(e),k(u),k(d),k(m),k(_),k(y)),$&&$.d(),H(f,q),H(h,q),F&&F.d(q),P&&P.d(q),C=!1,T()}}}function F$(n,e,t){let i,{collection:s}=e,l=!1;const o=()=>t(1,l=!l);function r(h){n.$$.not_equal(s.listRule,h)&&(s.listRule=h,t(0,s))}function a(h){n.$$.not_equal(s.viewRule,h)&&(s.viewRule=h,t(0,s))}function u(h){n.$$.not_equal(s.createRule,h)&&(s.createRule=h,t(0,s))}function f(h){n.$$.not_equal(s.updateRule,h)&&(s.updateRule=h,t(0,s))}function c(h){n.$$.not_equal(s.deleteRule,h)&&(s.deleteRule=h,t(0,s))}function d(h){n.$$.not_equal(s.options.manageRule,h)&&(s.options.manageRule=h,t(0,s))}return n.$$set=h=>{"collection"in h&&t(0,s=h.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=V.getAllCollectionIdentifiers(s))},[s,l,i,o,r,a,u,f,c,d]}class N$ extends ve{constructor(e){super(),be(this,e,F$,P$,me,{collection:0})}}function Hd(n,e,t){const i=n.slice();return i[9]=e[t],i}function R$(n){let e,t,i,s;function l(a){n[5](a)}var o=n[1];function r(a,u){let f={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(f.value=a[0].options.query),{props:f}}return o&&(e=Et(o,r(n)),te.push(()=>he(e,"value",l)),e.$on("change",n[6])),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}o?(e=Et(o,r(a)),te.push(()=>he(e,"value",l)),e.$on("change",a[6]),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u&256&&(f.id=a[8]),!t&&u&1&&(t=!0,f.value=a[0].options.query,ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function q$(n){let e;return{c(){e=v("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Vd(n){let e,t,i=ge(n[3]),s=[];for(let l=0;l<i.length;l+=1)s[l]=zd(Hd(n,i,l));return{c(){e=v("div"),t=v("div");for(let l=0;l<s.length;l+=1)s[l].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(l,o){w(l,e,o),b(e,t);for(let r=0;r<s.length;r+=1)s[r]&&s[r].m(t,null)},p(l,o){if(o&8){i=ge(l[3]);let r;for(r=0;r<i.length;r+=1){const a=Hd(l,i,r);s[r]?s[r].p(a,o):(s[r]=zd(a),s[r].c(),s[r].m(t,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=i.length}},d(l){l&&k(e),gt(s,l)}}}function zd(n){let e,t=n[9]+"",i;return{c(){e=v("p"),i=U(t)},m(s,l){w(s,e,l),b(e,i)},p(s,l){l&8&&t!==(t=s[9]+"")&&se(i,t)},d(s){s&&k(e)}}}function j$(n){let e,t,i,s,l,o,r,a,u,f,c;const d=[q$,R$],h=[];function g(_,y){return _[2]?0:1}l=g(n),o=h[l]=d[l](n);let m=n[3].length&&Vd(n);return{c(){e=v("label"),t=v("span"),t.textContent="Select query",s=E(),o.c(),r=E(),a=v("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>
2023-09-01 14:22:49 +08:00
<br/>
If your query doesn&#39;t have a suitable one, you can use the universal
<code>(ROW_NUMBER() OVER()) as id</code>.</li> <li>Expressions must be aliased with a valid formatted field name (eg.
2023-09-30 19:43:12 +08:00
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=E(),m&&m.c(),f=Se(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),h[l].m(_,y),w(_,r,y),w(_,a,y),w(_,u,y),m&&m.m(_,y),w(_,f,y),c=!0},p(_,y){(!c||y&256&&i!==(i=_[8]))&&p(e,"for",i);let S=l;l=g(_),l===S?h[l].p(_,y):(ue(),L(h[S],1,1,()=>{h[S]=null}),fe(),o=h[l],o?o.p(_,y):(o=h[l]=d[l](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?m?m.p(_,y):(m=Vd(_),m.c(),m.m(f.parentNode,f)):m&&(m.d(1),m=null)},i(_){c||(A(o),c=!0)},o(_){L(o),c=!1},d(_){_&&(k(e),k(s),k(r),k(a),k(u),k(f)),h[l].d(_),m&&m.d(_)}}}function H$(n){let e,t;return e=new pe({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[j$,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,[s]){const l={};s&8&&(l.class="form-field required "+(i[3].length?"error":"")),s&4367&&(l.$$scope={dirty:s,ctx:i}),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function V$(n,e,t){let i;Ke(n,$i,c=>t(4,i=c));let{collection:s}=e,l,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=V.getNestedVal(c,"schema",null);if(V.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const h=V.extractColumnsFromQuery((g=s==null?void 0:s.options)==null?void 0:g.query);V.removeByValue(h,"id"),V.removeByValue(h,"created"),V.removeByValue(h,"updated");for(let m in d)for(let _ in d[m]){const y=d[m][_].message,S=h[m]||m;r.push(V.sentenize(S+": "+y))}}Gt(async()=>{t(2,o=!0);try{t(1,l=(await rt(()=>import("./CodeEditor-73c7d443.js"),["./CodeEditor-73c7d443.js","./index-9cd23da9.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(s.options.query,c)&&(s.options.query=c,t(0,s))}const f=()=>{r.length&&ci("schema")};return n.$$set=c=>{"collection"in c&&t(0,s=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[s,l,o,r,i,u,f]}class z$ extends ve{constructor(e){super(),be(this,e,V$,H$,me,{collection:0})}}const B$=n=>({active:n&1}),Bd=n=>({active:n[0]});function Ud(n){let e,t,i;const s=n[15].default,l=Tt(s,n,n[14],null);return{c(){e=v("div"),l&&l.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),l&&l.m(e,null),i=!0},p(o,r){l&&l.p&&(!i||r&16384)&&$t(l,s,o,o[14],i?Ct(s,o[14],r,null):Mt(o[14]),null)},i(o){i||(A(l,o),o&&Qe(()=>{i&&(t||(t=qe(e,it,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(l,o),o&&(t||(t=qe(e,it,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&k(e),l&&l.d(o),o&&t&&t.end()}}}function U$(n){let e,t,i,s,l,o,r;const a=n[15].header,u=Tt(a,n,n[14],Bd);let f=n[0]&&Ud(n);return{c(){e=v("div"),t=v("button"),u&&u.c(),i=E(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),Q(t,"interactive",n[3]),p(e,"class",s="accordion "+(n[7]?"drag-over":"")+" "+n[1]),Q(e,"active",n[0])},m(c,d){w(c,e,d),b(e,t),u&&u.m(t,null),b(e,i),f&&f.m(e,null),n[22](e),l=!0,o||(r=[K(t,"click",xe(n[17])),K(t,"drop",xe(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",xe(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!l||d&16385)&&$t(u,a,c,c[14],l?Ct(a,c[14],d,B$):Mt(c[14]),Bd),(!l||d&4)&&p(t,"draggable",c[2]),(!l||d&8)&&Q(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Ud(c),f.c(),A(f,1),f.m(e,null)):f&&(ue(),L(f,1,1,()=>{f=null}),fe()),(!l||d&130&&s!==(s="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",s),(!l||d&131)&&Q(e,"active",c[0])},i(c){l||(A(u,c),A(f),l=!0)},o(c){L(u,c),L(f),l=!1},d(c){c&&k(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,$e(r)}}}function W$(n,e,t){let{$$slots:i={},$$scope:s}=e;const l=pt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,h=!1;function g(){return!!f}function m(){S(),t(0,f=!0),l("expand")}function _(){t(0,f=!1),clearTimeout(r),l("collapse")}function y(){l("toggle"),f?_():m()}function S(){if(d&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of F)P.click()}}Gt
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!V.isEmpty(_[0].options.onlyEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function x$(n){let e,t,i,s,l,o,r,a,u,f,c,d,h;function g(_){n[8](_)}let m={id:n[12],disabled:!V.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(m.value=n[0].options.onlyEmailDomains),r=new Rs({props:m}),te.push(()=>he(r,"value",g)),{c(){e=v("label"),t=v("span"),t.textContent="Only domains",i=E(),s=v("i"),o=E(),z(r.$$.fragment),u=E(),f=v("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(s,"class","ri-information-line link-hint"),p(e,"for",l=n[12]),p(f,"class","help-block")},m(_,y){w(_,e,y),b(e,t),b(e,i),b(e,s),w(_,o,y),j(r,_,y),w(_,u,y),w(_,f,y),c=!0,d||(h=Te(je.call(null,s,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,y){(!c||y&4096&&l!==(l=_[12]))&&p(e,"for",l);const S={};y&4096&&(S.id=_[12]),y&1&&(S.disabled=!V.isEmpty(_[0].options.exceptEmailDomains)),!a&&y&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){L(r.$$.fragment,_),c=!1},d(_){_&&(k(e),k(o),k(u),k(f)),H(r,_),d=!1,h()}}}function eM(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[X$,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowEmailAuth&&Yd(n);return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?l?(l.p(o,r),r&1&&A(l,1)):(l=Yd(o),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),H(e,o),l&&l.d(o)}}}function tM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function nM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Kd(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function iM(n){let e,t,i,s,l,o;function r(c,d){return c[0].options.allowEmailAuth?nM:tM}let a=r(n),u=a(n),f=n[2]&&Kd();return{c(){e=v("div"),e.innerHTML='<i class="ri-mail-star-line"></i> <span class="txt">Email/Password</span>',t=E(),i=v("div"),s=E(),u.c(),l=E(),f&&f.c(),o=Se(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){w(c,e,d),w(c,t,d),w(c,i,d),w(c,s,d),u.m(c,d),w(c,l,d),f&&f.m(c,d),w(c,o,d)},p(c,d){a!==(a=r(c))&&(u.d(1),u=a(c),u&&(u.c(),u.m(l.parentNode,l))),c[2]?f?d&4&&A(f,1):(f=Kd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(t),k(i),k(s),k(l),k(o)),u.d(c),f&&f.d(c)}}}function sM(n){let e,t,i,s,l,o,r,a;return{c(){e=v("input"),i=E(),s=v("label"),l=U("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(s,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"change",n[9]),r=!0)},p(u,f){f&4096&&t!==(t=u[12])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&4096&&o!==(o=u[12])&&p(s,"for",o)},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function Jd(n){let e,t,i;return{c(){e=v("div"),e.innerHTML='<div class="flex p-t-base"><a href="#/settings/auth-providers" target="_blank" class="btn btn-sm btn-outline"><span class="txt">Manage OAuth2 providers</span></a></div>',p(e,"class","block")},m(s,l){w(s,e,l),i=!0},i(s){i||(s&&Qe(()=>{i&&(t||(t=qe(e,it,{duration:150},!0)),t.run(1))}),i=!0)},o(s){s&&(t||(t=qe(e,it,{duration:150},!1)),t.run(0)),i=!1},d(s){s&&k(e),s&&t&&t.end()}}}function lM(n){let e,t,i,s;e=new pe({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[sM,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let l=n[0].options.allowOAuth2Auth&&Jd();return{c(){z(e.$$.fragment),t=E(),l&&l.c(),i=Se()},m(o,r){j(e,o,r),w(o,t,r),l&&l.m(o,r),w(o,i,r),s=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?l?r&1&&A(l,1):(l=Jd(),l.c(),A(l,1),l.m(i.parentNode,i)):l&&(ue(),L(l,1,1,()=>{l=null}),fe())},i(o){s||(A(e.$$.fragment,o),A(l),s=!0)},o(o){L(e.$$.fragment,o),L(l),s=!1},d(o){o&&(k(t),k(i)),H(e,o),l&&l.d(o)}}}function oM(n){let e;return{c(){e=v("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function rM(n){let e;return{c(){e=v("span"),e.textContent="Enabled",p(e,"class","label label-s
Also note that some OAuth2 providers (like Twitter), don't return an email and the authentication may fail if the email field is required.`,position:"right"}))],u=!0)},p(c,d){d&4096&&t!==(t=c[12])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&4096&&a!==(a=c[12])&&p(s,"for",a)},d(c){c&&(k(e),k(i),k(s)),u=!1,$e(f)}}}function cM(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return s=new uo({props:{single:!0,$$slots:{header:[Z$],default:[K$]},$$scope:{ctx:n}}}),o=new uo({props:{single:!0,$$slots:{header:[iM],default:[eM]},$$scope:{ctx:n}}}),a=new uo({props:{single:!0,$$slots:{header:[aM],default:[lM]},$$scope:{ctx:n}}}),g=new pe({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[uM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new pe({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[fM,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=v("h4"),e.textContent="Auth methods",t=E(),i=v("div"),z(s.$$.fragment),l=E(),z(o.$$.fragment),r=E(),z(a.$$.fragment),u=E(),f=v("hr"),c=E(),d=v("h4"),d.textContent="General",h=E(),z(g.$$.fragment),m=E(),z(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,C){w(S,e,C),w(S,t,C),w(S,i,C),j(s,i,null),b(i,l),j(o,i,null),b(i,r),j(a,i,null),w(S,u,C),w(S,f,C),w(S,c,C),w(S,d,C),w(S,h,C),j(g,S,C),w(S,m,C),j(_,S,C),y=!0},p(S,[C]){const T={};C&8201&&(T.$$scope={dirty:C,ctx:S}),s.$set(T);const $={};C&8197&&($.$$scope={dirty:C,ctx:S}),o.$set($);const O={};C&8195&&(O.$$scope={dirty:C,ctx:S}),a.$set(O);const M={};C&12289&&(M.$$scope={dirty:C,ctx:S}),g.$set(M);const D={};C&12289&&(D.$$scope={dirty:C,ctx:S}),_.$set(D)},i(S){y||(A(s.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),y=!0)},o(S){L(s.$$.fragment,S),L(o.$$.fragment,S),L(a.$$.fragment,S),L(g.$$.fragment,S),L(_.$$.fragment,S),y=!1},d(S){S&&(k(e),k(t),k(i),k(u),k(f),k(c),k(d),k(h),k(m)),H(s),H(o),H(a),H(g,S),H(_,S)}}}function dM(n,e,t){let i,s,l,o;Ke(n,$i,m=>t(4,o=m));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(m){n.$$.not_equal(r.options.exceptEmailDomains,m)&&(r.options.exceptEmailDomains=m,t(0,r))}function c(m){n.$$.not_equal(r.options.onlyEmailDomains,m)&&(r.options.onlyEmailDomains=m,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function h(){r.options.minPasswordLength=dt(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=m=>{"collection"in m&&t(0,r=m.collection)},n.$$.update=()=>{var m,_,y,S;n.$$.dirty&1&&r.type==="auth"&&V.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,s=!V.isEmpty((m=o==null?void 0:o.options)==null?void 0:m.allowEmailAuth)||!V.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!V.isEmpty((y=o==null?void 0:o.options)==null?void 0:y.exceptEmailDomains)),n.$$.dirty&16&&t(1,l=!V.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,l,s,i,o,a,u,f,c,d,h,g]}class pM extends ve{constructor(e){super(),be(this,e,dM,cM,me,{collection:0})}}function Zd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Xd(n,e,t){const i=n.slice();return i[18]=e[t],i}function Qd(n,e,t){const i=n.slice();return i[18]=e[t],i}function xd(n){let e;return{c(){e=v("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function ep(n){let e,t,i,s,l=n[3]&&tp(n),o=!n[4]&&np(n);return{c(){e=v("h6"),e.textContent="Changes:",t=E(),i=v("ul"),l&&l.c(),s=E(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,a){w(r,e,a),w(r,t,a),w(r,i,a),l&&l.m(i,null),b(i,s),o&&o.m(i,null)},p(r,a){r[3]?l?l.p(r,a):(l=tp(r),l.c(),l.m(i,s)):l&&(l.d(1),l=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=np(r),o.c(),o.m(i,null))},d(r){r&&(k(e),k(t),k(i)),l&&l.d(),o&&o.d()}}}function tp(n)
2023-09-30 16:58:14 +08:00
`),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,_){w(m,e,_),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(m,_){var y,S;_&2&&l!==(l=((y=m[1])==null?void 0:y.name)+"")&&se(o,l),_&4&&c!==(c=((S=m[2])==null?void 0:S.name)+"")&&se(d,c)},d(m){m&&k(e)}}}function np(n){let e,t,i,s=ge(n[6]),l=[];for(let f=0;f<s.length;f+=1)l[f]=ip(Qd(n,s,f));let o=ge(n[8]),r=[];for(let f=0;f<o.length;f+=1)r[f]=sp(Xd(n,o,f));let a=ge(n[7]),u=[];for(let f=0;f<a.length;f+=1)u[f]=lp(Zd(n,a,f));return{c(){for(let f=0;f<l.length;f+=1)l[f].c();e=E();for(let f=0;f<r.length;f+=1)r[f].c();t=E();for(let f=0;f<u.length;f+=1)u[f].c();i=Se()},m(f,c){for(let d=0;d<l.length;d+=1)l[d]&&l[d].m(f,c);w(f,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(f,c);w(f,t,c);for(let d=0;d<u.length;d+=1)u[d]&&u[d].m(f,c);w(f,i,c)},p(f,c){if(c&64){s=ge(f[6]);let d;for(d=0;d<s.length;d+=1){const h=Qd(f,s,d);l[d]?l[d].p(h,c):(l[d]=ip(h),l[d].c(),l[d].m(e.parentNode,e))}for(;d<l.length;d+=1)l[d].d(1);l.length=s.length}if(c&256){o=ge(f[8]);let d;for(d=0;d<o.length;d+=1){const h=Xd(f,o,d);r[d]?r[d].p(h,c):(r[d]=sp(h),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&128){a=ge(f[7]);let d;for(d=0;d<a.length;d+=1){const h=Zd(f,a,d);u[d]?u[d].p(h,c):(u[d]=lp(h),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){f&&(k(e),k(t),k(i)),gt(l,f),gt(r,f),gt(u,f)}}}function ip(n){let e,t,i,s=n[18].name+"",l,o,r;return{c(){e=v("li"),t=U(`Multiple to single value conversion of field
`),i=v("strong"),l=U(s),o=E(),r=v("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,u){w(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o),b(e,r)},p(a,u){u&64&&s!==(s=a[18].name+"")&&se(l,s)},d(a){a&&k(e)}}}function sp(n){let e,t,i,s,l=n[18].originalName+"",o,r,a,u,f,c=n[18].name+"",d;return{c(){e=v("li"),t=v("div"),i=U(`Renamed field
2023-09-30 16:58:14 +08:00
`),s=v("strong"),o=U(l),r=E(),a=v("i"),u=E(),f=v("strong"),d=U(c),p(s,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(f,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(h,g){w(h,e,g),b(e,t),b(t,i),b(t,s),b(s,o),b(t,r),b(t,a),b(t,u),b(t,f),b(f,d)},p(h,g){g&256&&l!==(l=h[18].originalName+"")&&se(o,l),g&256&&c!==(c=h[18].name+"")&&se(d,c)},d(h){h&&k(e)}}}function lp(n){let e,t,i,s=n[18].name+"",l,o;return{c(){e=v("li"),t=U("Removed field "),i=v("span"),l=U(s),o=E(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),b(e,t),b(e,i),b(i,l),b(e,o)},p(r,a){a&128&&s!==(s=r[18].name+"")&&se(l,s)},d(r){r&&k(e)}}}function hM(n){let e,t,i,s,l,o,r,a,u=n[7].length&&xd(),f=n[9]&&ep(n);return{c(){e=v("div"),t=v("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=E(),s=v("div"),l=v("p"),l.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
2023-09-30 19:43:12 +08:00
you'll have to update it manually!`,o=E(),u&&u.c(),r=E(),f&&f.c(),a=Se(),p(t,"class","icon"),p(s,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),b(s,o),u&&u.m(s,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=xd(),u.c(),u.m(s,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=ep(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(k(e),k(r),k(a)),u&&u.d(),f&&f.d(c)}}}function mM(n){let e;return{c(){e=v("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function gM(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=v("button"),i.innerHTML='<span class="txt">Confirm</span>',e.autofocus=!0,p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn btn-expanded")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),e.focus(),s||(l=[K(e,"click",n[12]),K(i,"click",n[13])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function _M(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[gM],header:[mM],default:[hM]},$$scope:{ctx:n}};return e=new on({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&33555422&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[14](null),H(e,s)}}}function bM(n,e,t){let i,s,l,o,r,a;const u=pt();let f,c,d;async function h($,O){t(1,c=$),t(2,d=O),await ln(),i||l.length||o.length||r.length?f==null||f.show():m()}function g(){f==null||f.hide()}function m(){g(),u("confirm")}const _=()=>g(),y=()=>m();function S($){te[$?"unshift":"push"](()=>{f=$,t(5,f)})}function C($){Fe.call(this,n,$)}function T($){Fe.call(this,n,$)}return n.$$.update=()=>{var $,O,M;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,s=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,l=(($=d==null?void 0:d.schema)==null?void 0:$.filter(D=>D.id&&!D.toDelete&&D.originalName!=D.name))||[]),n.$$.dirty&4&&t(7,o=((O=d==null?void 0:d.schema)==null?void 0:O.filter(D=>D.id&&D.toDelete))||[]),n.$$.dirty&6&&t(6,r=((M=d==null?void 0:d.schema)==null?void 0:M.filter(D=>{var F,P,N;const I=(F=c==null?void 0:c.schema)==null?void 0:F.find(R=>R.id==D.id);return I?((P=I.options)==null?void 0:P.maxSelect)!=1&&((N=D.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!s||i)},[g,c,d,i,s,f,r,o,l,a,m,h,_,y,S,C,T]}class vM extends ve{constructor(e){super(),be(this,e,bM,_M,me,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function op(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function yM(n){let e,t,i;function s(o){n[35](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new S$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function kM(n){let e,t,i;function s(o){n[34](o)}let l={};return n[2]!==void 0&&(l.collection=n[2]),e=new z$({props:l}),te.push(()=>he(e,"collection",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function rp(n){let e,t,i,s;function l(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new N$({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),j(t,e,null),s=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){s||(A(t.$$.fragment,r),s=!0)},o(r){L(t.$$.fragment,r),s=!1},d(r){r&&k(e),H(t)}}}function ap(n){let e,t,i,s;function l(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new pM({props:o}),te.push(()=>he(t,"collection",l)),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","tab-item"),Q(e,"active",n[3]===As)},m(r
`),position:"left"})),i=!0)},p(l,[o]){t&&At(t.update)&&o&1&&t.update.call(null,{text:l[0].join(`
`),position:"left"})},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}const Ap="yyyy-MM-dd HH:mm:ss.SSS";function UM(n,e,t){let{model:i}=e,s=[];function l(){t(0,s=[]),i.created&&s.push("Created: "+V.formatToLocalDate(i.created,Ap)+" Local"),i.updated&&s.push("Updated: "+V.formatToLocalDate(i.updated,Ap)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&l()},[s,i]}class T1 extends ve{constructor(e){super(),be(this,e,UM,BM,me,{model:1})}}function WM(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class",t=n[2]?n[1]:n[0]),p(e,"aria-label","Copy")},m(o,r){w(o,e,r),s||(l=[Te(i=je.call(null,e,n[2]?"":"Copy")),K(e,"click",An(n[3]))],s=!0)},p(o,[r]){r&7&&t!==(t=o[2]?o[1]:o[0])&&p(e,"class",t),i&&At(i.update)&&r&4&&i.update.call(null,o[2]?"":"Copy")},i:x,o:x,d(o){o&&k(e),s=!1,$e(l)}}}function YM(n,e,t){let{value:i=""}=e,{idleClasses:s="ri-file-copy-line txt-sm link-hint"}=e,{successClasses:l="ri-check-line txt-sm txt-success"}=e,{successDuration:o=500}=e,r;function a(){i&&(V.copyToClipboard(i),clearTimeout(r),t(2,r=setTimeout(()=>{clearTimeout(r),t(2,r=null)},o)))}return Gt(()=>()=>{r&&clearTimeout(r)}),n.$$set=u=>{"value"in u&&t(4,i=u.value),"idleClasses"in u&&t(0,s=u.idleClasses),"successClasses"in u&&t(1,l=u.successClasses),"successDuration"in u&&t(5,o=u.successDuration)},[s,l,r,a,i,o]}class qs extends ve{constructor(e){super(),be(this,e,YM,WM,me,{value:4,idleClasses:0,successClasses:1,successDuration:5})}}function KM(n){let e,t,i,s,l,o,r,a,u,f;return l=new qs({props:{value:n[1]}}),{c(){e=v("div"),t=v("span"),i=U(n[1]),s=E(),z(l.$$.fragment),o=E(),r=v("i"),p(t,"class","secret svelte-1md8247"),p(r,"class","ri-refresh-line txt-sm link-hint"),p(r,"aria-label","Refresh"),p(e,"class","flex flex-gap-5 p-5")},m(c,d){w(c,e,d),b(e,t),b(t,i),n[6](t),b(e,s),j(l,e,null),b(e,o),b(e,r),a=!0,u||(f=[Te(je.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const h={};d&2&&(h.value=c[1]),l.$set(h)},i(c){a||(A(l.$$.fragment,c),a=!0)},o(c){L(l.$$.fragment,c),a=!1},d(c){c&&k(e),n[6](null),H(l),u=!1,$e(f)}}}function JM(n){let e,t,i,s,l,o,r,a,u,f;function c(h){n[7](h)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[KM]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),s=new Ln({props:d}),te.push(()=>he(s,"active",c)),s.$on("show",n[4]),{c(){e=v("button"),t=v("i"),i=E(),z(s.$$.fragment),p(t,"class","ri-sparkling-line"),p(e,"tabindex","-1"),p(e,"type","button"),p(e,"aria-label","Generate"),p(e,"class",o="btn btn-circle "+n[0]+" svelte-1md8247")},m(h,g){w(h,e,g),b(e,t),b(e,i),j(s,e,null),a=!0,u||(f=Te(r=je.call(null,e,n[3]?"":"Generate")),u=!0)},p(h,[g]){const m={};g&518&&(m.$$scope={dirty:g,ctx:h}),!l&&g&8&&(l=!0,m.active=h[3],ye(()=>l=!1)),s.$set(m),(!a||g&1&&o!==(o="btn btn-circle "+h[0]+" svelte-1md8247"))&&p(e,"class",o),r&&At(r.update)&&g&8&&r.update.call(null,h[3]?"":"Generate")},i(h){a||(A(s.$$.fragment,h),a=!0)},o(h){L(s.$$.fragment,h),a=!1},d(h){h&&k(e),H(s),u=!1,f()}}}function GM(n,e,t){const i=pt();let{class:s="btn-sm btn-hint btn-transparent"}=e,{length:l=32}=e,o="",r,a=!1;async function u(){if(t(1,o=V.randomSecret(l)),i("generate",o),await ln(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function f(d){te[d?"unshift":"push"](()=>{r=d,t(2,r)})}function c(d){a=d,t(3,a)}return n.$$set=d=>{"class"in d&&t(0,s=d.class),"length"in d&&t(5,l=d.length)},[s,o,r,a,u,l,f,c]}class C1 extends ve{constructor(e){super(),be(this,e,GM,JM,me,{class:0,length:5})}}function ZM(n){let e,t,i,s,l,o,r,a,u,f,c,d;return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="Username",o=E(),r=v("input"),p(t,"class",V.getFieldTypeIcon("user")),p(s,"class","txt"),p(e,"for",l=n[13]),p(r,"type","text"),p(r,"requried",a=!n[2]),p(r,"placeholder",u=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",f=n[13])},m(h,g){w(h,e,g),b(e,t),b(e,i),b(e,s),w(h,o,g),w(h,r,g),ae(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(h,g){g&8192&&l!==(l=h[13])&&p(e,"for",l),g&4&&a!==(a=!h[2])&&p(r,"requried",a),g&4&
2023-09-01 14:22:49 +08:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
2023-09-30 19:43:12 +08:00
`,name:n[4].name,$$slots:{default:[m6,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),j(t,e,null),i=!0,s||(l=[K(e,"dragover",xe(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],s=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
2023-09-01 14:22:49 +08:00
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
2023-09-30 19:43:12 +08:00
`),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&k(e),H(t),s=!1,$e(l)}}}function _6(n,e,t){let i,s,l,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,h=!1,g="";function m(B){V.removeByValue(f,B),t(2,f)}function _(B){V.pushUnique(f,B),t(2,f)}function y(B){V.isEmpty(u[B])||u.splice(B,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function C(B){var X,J;B.preventDefault(),t(9,h=!1);const Z=((X=B.dataTransfer)==null?void 0:X.files)||[];if(!(l||!Z.length)){for(const W of Z){const le=s.length+u.length-f.length;if(((J=r.options)==null?void 0:J.maxSelect)<=le)break;u.push(W)}t(1,u)}}Gt(async()=>{t(10,g=await de.getAdminFileToken(o.collectionId))});const T=B=>m(B),$=B=>_(B);function O(B){a=B,t(0,a),t(6,i),t(4,r)}const M=B=>y(B);function D(B){u=B,t(1,u)}function I(B){te[B?"unshift":"push"](()=>{c=B,t(7,c)})}const F=()=>{for(let B of c.files)u.push(B);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function N(B){te[B?"unshift":"push"](()=>{d=B,t(8,d)})}const R=()=>{t(9,h=!0)},q=()=>{t(9,h=!1)};return n.$$set=B=>{"record"in B&&t(3,o=B.record),"field"in B&&t(4,r=B.field),"value"in B&&t(0,a=B.value),"uploadedFiles"in B&&t(1,u=B.uploadedFiles),"deletedFileNames"in B&&t(2,f=B.deletedFileNames)},n.$$.update=()=>{var B,Z;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=V.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=V.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((B=r.options)==null?void 0:B.maxSelect)>1),n.$$.dirty[0]&65&&V.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,s=V.toArray(a)),n.$$.dirty[0]&54&&t(11,l=(s.length||u.length)&&((Z=r.options)==null?void 0:Z.maxSelect)<=s.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,s,i,c,d,h,g,l,m,_,y,C,T,$,O,M,D,I,F,P,N,R,q]}class b6 extends ve{constructor(e){super(),be(this,e,_6,g6,me,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function zp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function v6(n,e){e=zp(e),e!=null&&e.callback&&e.callback();function t(i){if(!(e!=null&&e.callback))return;i.target.scrollHeight-i.target.clientHeight-i.target.scrollTop<=e.threshold&&e.callback()}return n.addEventListener("scroll",t),n.addEventListener("resize",t),{update(i){e=zp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function Bp(n,e,t){const i=n.slice();i[5]=e[t];const s=V.toArray(i[0][i[5]]).slice(0,5);return i[6]=s,i}function Up(n,e,t){const i=n.slice();return i[9]=e[t],i}function Wp(n){let e,t;return e=new ru({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){z(e.$$.fragment)},m(i,s){j(e,i,s),t=!0},p(i,s){const l={};s&1&&(l.record=i[0]),s&5&&(l.filename=i[9]),e.$set(l)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){H(e,i)}}}function Yp(n){let e=!V.isEmpty(n[9]),t,i,s=e&&Wp(n);return{c(){s&&s.c(),t=Se()},m(l,o){s&&s.m(l,o),w(l,t,o),i=!0},p(l,o){o&5&&(e=!V.isEmpty(l[9])),e?s?(s.p(l,o),o&5&&A(s,1)):(s=Wp(l),s.c(),A(s,1),s.m(t.parentNode,t)):s&&(ue(),L(s,1,1,()=>{s=null}),fe())},i(l){i||(A(s),i=!0)},o(l){L(s),i=!1},d(l){l&&k(t),s&&s.d(l)}}}function Kp(n){let e,t,i=ge(n[6]),s=[];for(let o=0;o<i.length;o+=1)s[o]=Yp(Up(n,i,o));const l=o=>L(s[o],1,1,()=>{s[o]=null});return{c(){for(let o=0;o<s.length;o+=1)s[o].c();e=Se()},m(o,r){for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&5){i=ge(o[6]);let a;for(a=0;a<i.length;a+=1){const u=Up(o,i,a);s[a]?(s[a].p(u,r),A(s[a],1)):(s[a]=Yp(u),s[a].c(),A(s[a],1),s[a].m(e.parentNode,e))}for(ue(),a=i.length;a<s.length;a+=1)l(a);fe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(s[r]);t=!0}},o(o){s=s.filter(Boolean);for(let r=0;r<s.length;r+=1)L(s[r]);t=!1},d(o){o&&k(e),gt(s,o)}}}function y6(n){let e,t,i,s,l,o,r=V.truncate(V.displayValue(n[0],n[1]),70)+"",a,u,f,c,d=ge(n[2]),h=[];for(let m=0;m<d.length;m+=1)h[m]=Kp(Bp(n,d,m));const g=m=>L(h[m],1,1,()=>{h[m
`),I&&I.c(),h=E(),m.c(),_=Se(),p(e,"class","flex m-b-base flex-gap-10"),p(l,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(R,q){w(R,e,q),j(t,e,null),b(e,i),T&&T.m(e,null),w(R,s,q),w(R,l,q);for(let B=0;B<o.length;B+=1)o[B]&&o[B].m(l,null);M&&M.m(l,null),b(l,a),D&&D.m(l,null),w(R,f,q),w(R,c,q),b(c,d),I&&I.m(c,null),w(R,h,q),P[g].m(R,q),w(R,_,q),y=!0,S||(C=Te(u=v6.call(null,l,n[36])),S=!0)},p(R,q){const B={};q[0]&4&&(B.value=R[2]),q[0]&32&&(B.autocompleteCollection=R[5]),t.$set(B),R[11]?T&&(T.d(1),T=null):T?T.p(R,q):(T=Zp(R),T.c(),T.m(e,null)),q[0]&143252&&($=ge(R[8]),ue(),o=vt(o,q,O,1,R,$,r,l,Ut,th,a,Gp),fe(),!$.length&&M?M.p(R,q):$.length?M&&(M.d(1),M=null):(M=Xp(R),M.c(),M.m(l,a))),R[13]?D||(D=nh(),D.c(),D.m(l,null)):D&&(D.d(1),D=null),u&&At(u.update)&&q[0]&4104&&u.update.call(null,R[36]),R[4]>1?I?I.p(R,q):(I=ih(R),I.c(),I.m(c,null)):I&&(I.d(1),I=null);let Z=g;g=N(R),g===Z?P[g].p(R,q):(ue(),L(P[Z],1,1,()=>{P[Z]=null}),fe(),m=P[g],m?m.p(R,q):(m=P[g]=F[g](R),m.c()),A(m,1),m.m(_.parentNode,_))},i(R){if(!y){A(t.$$.fragment,R);for(let q=0;q<$.length;q+=1)A(o[q]);A(m),y=!0}},o(R){L(t.$$.fragment,R);for(let q=0;q<o.length;q+=1)L(o[q]);L(m),y=!1},d(R){R&&(k(e),k(s),k(l),k(f),k(c),k(h),k(_)),H(t),T&&T.d();for(let q=0;q<o.length;q+=1)o[q].d();M&&M.d(),D&&D.d(),I&&I.d(),P[g].d(R),S=!1,C()}}}function O6(n){var r;let e,t,i,s=(((r=n[5])==null?void 0:r.name)||"")+"",l,o;return{c(){e=v("h4"),t=U("Select "),i=v("strong"),l=U(s),o=U(" records")},m(a,u){w(a,e,u),b(e,t),b(e,i),b(i,l),b(e,o)},p(a,u){var f;u[0]&32&&s!==(s=(((f=a[5])==null?void 0:f.name)||"")+"")&&se(l,s)},d(a){a&&k(e)}}}function E6(n){let e,t,i,s,l;return{c(){e=v("button"),e.innerHTML='<span class="txt">Cancel</span>',t=E(),i=v("button"),i.innerHTML='<span class="txt">Set selection</span>',p(e,"type","button"),p(e,"class","btn btn-transparent"),p(i,"type","button"),p(i,"class","btn")},m(o,r){w(o,e,r),w(o,t,r),w(o,i,r),s||(l=[K(e,"click",n[28]),K(i,"click",n[29])],s=!0)},p:x,d(o){o&&(k(e),k(t),k(i)),s=!1,$e(l)}}}function D6(n){let e,t,i,s;const l=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[E6],header:[O6],default:[M6]},$$scope:{ctx:n}};for(let a=0;a<l.length;a+=1)o=He(o,l[a]);e=new on({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new M1({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),s=!0},p(a,u){const f=u[0]&524288?yt(l,[l[0],l[1],Pt(a[19])]):{};u[0]&16380|u[1]&33554432&&(f.$$scope={dirty:u,ctx:a}),e.$set(f);const c={};u[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){s||(A(e.$$.fragment,a),A(i.$$.fragment,a),s=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),s=!1},d(a){a&&k(t),n[39](null),H(e,a),n[42](null),H(i,a)}}}const no=50;function A6(n,e,t){let i,s,l,o,r,a,u,f;const c=["value","field","show","hide"];let d=et(e,c),h;Ke(n,ii,Oe=>t(26,h=Oe));const g=pt(),m="picker_"+V.randomString(5);let{value:_}=e,{field:y}=e,S,C,T="",$=[],O=[],M=1,D=0,I=!1,F=!1;function P(){return t(2,T=""),t(8,$=[]),t(6,O=[]),R(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function R(){const Oe=V.toArray(_);if(!s||!Oe.length)return;t(24,F=!0);let ht=[];const Ft=Oe.slice(),rn=[];for(;Ft.length>0;){const xt=[];for(const tn of Ft.splice(0,no))xt.push(`id="${tn}"`);rn.push(de.collection(s).getFullList(no,{filter:xt.join("||"),$autoCancel:!1}))}try{await Promise.all(rn).then(xt=>{ht=ht.concat(...xt)}),t(6,O=[]);for(const xt of Oe){const tn=V.findByKey(ht,"id",xt);tn&&O.push(tn)}T.trim()||t(8,$=V.filterDuplicatesByKey(O.concat($))),t(24,F=!1)}catch(xt){xt.isAbort||(de.error(xt),t(24,F=!1))}}async function q(Oe=!1){if(s){t(3,I=!0),Oe&&(T.trim()?t(8,$=[]):t(8,$=V.toArray(O).slice()));try{const ht=Oe?1:M+1,Ft=V.getAllCollectionIdentifiers(l),rn=await de.collection(s).getList(ht,no,{filter:V.normalizeSearchFilter(T,Ft),sort:o?"":"-created",skipTotal:1,$cancelKey:m+"loadList"});t(8,$=V.filterDuplicatesByKey($.concat(rn.items))),M=rn.page,t(23,D=rn.items.length),t(3,I=!1)}cat
2023-09-01 14:22:49 +08:00
...
2023-09-30 19:43:12 +08:00
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),b(e,t),w(c,s,d),w(c,l,d),ae(l,n[5]),w(c,r,d),w(c,a,d),u||(f=K(l,"input",n[16]),u=!0)},p(c,d){d&8388608&&i!==(i=c[23])&&p(e,"for",i),d&8388608&&o!==(o=c[23])&&p(l,"id",o),d&32&&ae(l,c[5])},d(c){c&&(k(e),k(s),k(l),k(r),k(a)),u=!1,f()}}}function gO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S;return s=new pe({props:{class:"form-field required",name:"clientId",$$slots:{default:[cO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new pe({props:{class:"form-field required",name:"teamId",$$slots:{default:[dO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),f=new pe({props:{class:"form-field required",name:"keyId",$$slots:{default:[pO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),h=new pe({props:{class:"form-field required",name:"duration",$$slots:{default:[hO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new pe({props:{class:"form-field required",name:"privateKey",$$slots:{default:[mO,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=v("form"),t=v("div"),i=v("div"),z(s.$$.fragment),l=E(),o=v("div"),z(r.$$.fragment),a=E(),u=v("div"),z(f.$$.fragment),c=E(),d=v("div"),z(h.$$.fragment),g=E(),z(m.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(C,T){w(C,e,T),b(e,t),b(t,i),j(s,i,null),b(t,l),b(t,o),j(r,o,null),b(t,a),b(t,u),j(f,u,null),b(t,c),b(t,d),j(h,d,null),b(t,g),j(m,t,null),_=!0,y||(S=K(e,"submit",xe(n[17])),y=!0)},p(C,T){const $={};T&25165828&&($.$$scope={dirty:T,ctx:C}),s.$set($);const O={};T&25165832&&(O.$$scope={dirty:T,ctx:C}),r.$set(O);const M={};T&25165840&&(M.$$scope={dirty:T,ctx:C}),f.$set(M);const D={};T&25165888&&(D.$$scope={dirty:T,ctx:C}),h.$set(D);const I={};T&25165856&&(I.$$scope={dirty:T,ctx:C}),m.$set(I)},i(C){_||(A(s.$$.fragment,C),A(r.$$.fragment,C),A(f.$$.fragment,C),A(h.$$.fragment,C),A(m.$$.fragment,C),_=!0)},o(C){L(s.$$.fragment,C),L(r.$$.fragment,C),L(f.$$.fragment,C),L(h.$$.fragment,C),L(m.$$.fragment,C),_=!1},d(C){C&&k(e),H(s),H(r),H(f),H(h),H(m),y=!1,S()}}}function _O(n){let e;return{c(){e=v("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function bO(n){let e,t,i,s,l,o,r,a,u,f;return{c(){e=v("button"),t=U("Close"),i=E(),s=v("button"),l=v("i"),o=E(),r=v("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(l,"class","ri-key-line"),p(r,"class","txt"),p(s,"type","submit"),p(s,"form",n[9]),p(s,"class","btn btn-expanded"),s.disabled=a=!n[8]||n[7],Q(s,"btn-loading",n[7])},m(c,d){w(c,e,d),b(e,t),w(c,i,d),w(c,s,d),b(s,l),b(s,o),b(s,r),u||(f=K(e,"click",n[0]),u=!0)},p(c,d){d&128&&(e.disabled=c[7]),d&384&&a!==(a=!c[8]||c[7])&&(s.disabled=a),d&128&&Q(s,"btn-loading",c[7])},d(c){c&&(k(e),k(i),k(s)),u=!1,f()}}}function vO(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[bO],header:[_O],default:[gO]},$$scope:{ctx:n}};return e=new on({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&128&&(o.overlayClose=!s[7]),l&128&&(o.escClose=!s[7]),l&128&&(o.beforeHide=s[18]),l&16777724&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[19](null),H(e,s)}}}const fo=15777e3;function yO(n,e,t){let i;const s=pt(),l="apple_secret_"+V.randomString(5);let o,r,a,u,f,c,d=!1;function h(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,c=F.duration||fo),en({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function m(){t(7,d=!0);try{const F=await de.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),jt("Successfully generated client secret."),s("submit",F),o==null||o.hide()}catch(F){de.error(F)}t(7,d=!1)}function _(){r=t
`),r=v("button"),r.textContent="Restore draft",a=E(),u=v("button"),u.innerHTML='<i class="ri-close-line"></i>',f=E(),c=v("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(l,"class","flex flex-gap-xs"),p(u,"type","button"),p(u,"class","close"),p(u,"aria-label","Discard draft"),p(t,"class","alert alert-info m-0"),p(c,"class","clearfix p-b-base"),p(e,"class","block")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(t,a),b(t,u),b(e,f),b(e,c),h=!0,g||(m=[K(r,"click",n[37]),Te(je.call(null,u,"Discard draft")),K(u,"click",xe(n[38]))],g=!0)},p:x,i(_){h||(d&&d.end(1),h=!0)},o(_){_&&(d=va(e,it,{duration:150})),h=!1},d(_){_&&k(e),_&&d&&d.end(),g=!1,$e(m)}}}function bh(n){let e,t,i;return t=new T1({props:{model:n[3]}}),{c(){e=v("div"),z(t.$$.fragment),p(e,"class","form-field-addon")},m(s,l){w(s,e,l),j(t,e,null),i=!0},p(s,l){const o={};l[0]&8&&(o.model=s[3]),t.$set(o)},i(s){i||(A(t.$$.fragment,s),i=!0)},o(s){L(t.$$.fragment,s),i=!1},d(s){s&&k(e),H(t)}}}function AO(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_=!n[6]&&bh(n);return{c(){e=v("label"),t=v("i"),i=E(),s=v("span"),s.textContent="id",l=E(),o=v("span"),a=E(),_&&_.c(),u=E(),f=v("input"),p(t,"class",wi(V.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(s,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[70]),p(f,"type","text"),p(f,"id",c=n[70]),p(f,"placeholder","Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=d=!n[6]},m(y,S){w(y,e,S),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),w(y,a,S),_&&_.m(y,S),w(y,u,S),w(y,f,S),ae(f,n[3].id),h=!0,g||(m=K(f,"input",n[39]),g=!0)},p(y,S){(!h||S[2]&256&&r!==(r=y[70]))&&p(e,"for",r),y[6]?_&&(ue(),L(_,1,1,()=>{_=null}),fe()):_?(_.p(y,S),S[0]&64&&A(_,1)):(_=bh(y),_.c(),A(_,1),_.m(u.parentNode,u)),(!h||S[2]&256&&c!==(c=y[70]))&&p(f,"id",c),(!h||S[0]&64&&d!==(d=!y[6]))&&(f.readOnly=d),S[0]&8&&f.value!==y[3].id&&ae(f,y[3].id)},i(y){h||(A(_),h=!0)},o(y){L(_),h=!1},d(y){y&&(k(e),k(a),k(u),k(f)),_&&_.d(y),g=!1,m()}}}function vh(n){var u,f;let e,t,i,s,l;function o(c){n[40](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new s5({props:r}),te.push(()=>he(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&yh();return{c(){z(e.$$.fragment),i=E(),a&&a.c(),s=Se()},m(c,d){j(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,s,d),l=!0},p(c,d){var g,m;const h={};d[0]&64&&(h.isNew=c[6]),d[0]&1&&(h.collection=c[0]),!t&&d[0]&8&&(t=!0,h.record=c[3],ye(()=>t=!1)),e.$set(h),(m=(g=c[0])==null?void 0:g.schema)!=null&&m.length?a||(a=yh(),a.c(),a.m(s.parentNode,s)):a&&(a.d(1),a=null)},i(c){l||(A(e.$$.fragment,c),l=!0)},o(c){L(e.$$.fragment,c),l=!1},d(c){c&&(k(i),k(s)),H(e,c),a&&a.d(c)}}}function yh(n){let e;return{c(){e=v("hr")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function IO(n){let e,t,i;function s(o){n[53](o,n[67])}let l={field:n[67]};return n[3][n[67].name]!==void 0&&(l.value=n[3][n[67].name]),e=new R6({props:l}),te.push(()=>he(e,"value",s)),{c(){z(e.$$.fragment)},m(o,r){j(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[67]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[67].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){H(e,o)}}}function LO(n){let e,t,i,s,l;function o(f){n[50](f,n[67])}function r(f){n[51](f,n[67])}function a(f){n[52](f,n[67])}let u={field:n[67],record:n[3]};return n[3][n[67].name]!==void 0&&(u.value=n[3][n[67].name]),n[4][n[67].name]!==void 0&&(u.uploadedFiles=n[4][n[67].name]),n[5][n[67].name]!==void 0&&(u.deletedFileNames=n[5][n[67].name]),e=new b6({props:u}),te.push(()=>he(e,"value",o)),te.push(()=>he(e,"uploadedFiles",r)),te.push(()=>he(e,"deletedFileNames",a)),{c(){z(e.$$.fragment)},m(f,c){j(e,f,c),l=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[67]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[67].name],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[67].name],ye(()=>i=!1)),!s&&c[0]&33&&(s=!0,d.deletedFileNames=n[5][n[67].name],ye(()=>s=!1)),e.$set(d)},i(f){l||(A(e.$$.fragment,f),l=!0)},o(f){L(e.$$.fragment,f),l=!1},d(f){H(e,f)}}}function PO(n){let e,t,i;function s(o){
2023-09-01 14:22:49 +08:00
record-panel
`+(n[15]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(n[13]&&!n[6]?"colored-header":"")+`
2023-09-30 19:43:12 +08:00
`,beforeHide:n[54],$$slots:{footer:[YO],header:[WO],default:[BO]},$$scope:{ctx:n}};return e=new on({props:i}),n[55](e),e.$on("hide",n[56]),e.$on("show",n[57]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,l){const o={};l[0]&41024&&(o.class=`
2023-09-01 14:22:49 +08:00
record-panel
`+(s[15]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(s[13]&&!s[6]?"colored-header":"")+`
2023-09-30 19:43:12 +08:00
`),l[0]&2176&&(o.beforeHide=s[54]),l[0]&30461|l[2]&512&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[55](null),H(e,s)}}}const ss="form",yl="providers";function JO(n,e,t){let i,s,l,o,r;const a=pt(),u="record_"+V.randomString(5);let{collection:f}=e,c,d=null,h=null,g=null,m=!1,_=!1,y={},S={},C=JSON.stringify(null),T=C,$=ss,O=!0,M=!1;function D(ce){return F(ce),t(11,_=!0),t(12,$=ss),c==null?void 0:c.show()}function I(){return c==null?void 0:c.hide()}async function F(ce){t(28,M=!1),en({}),t(2,d=ce||{}),t(3,h=structuredClone(d)),t(4,y={}),t(5,S={}),await ln(),t(9,g=R()),!g||Z(h,g)?t(9,g=null):(delete g.password,delete g.passwordConfirm),t(26,C=JSON.stringify(h)),t(28,M=!0)}async function P(ce){var Ze,It;en({}),t(2,d=ce||{}),t(4,y={}),t(5,S={});const we=((It=(Ze=f==null?void 0:f.schema)==null?void 0:Ze.filter(tt=>tt.type!="file"))==null?void 0:It.map(tt=>tt.name))||[];for(let tt in ce)we.includes(tt)||t(3,h[tt]=ce[tt],h);await ln(),t(26,C=JSON.stringify(h)),X()}function N(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function R(ce){try{const we=window.localStorage.getItem(N());if(we)return JSON.parse(we)}catch{}return ce}function q(ce){try{window.localStorage.setItem(N(),ce)}catch(we){console.warn("updateDraft failure:",we)}}function B(){g&&(t(3,h=g),t(9,g=null))}function Z(ce,we){var an;const Ze=structuredClone(ce||{}),It=structuredClone(we||{}),tt=(an=f==null?void 0:f.schema)==null?void 0:an.filter(Zt=>Zt.type==="file");for(let Zt of tt)delete Ze[Zt.name],delete It[Zt.name];return delete Ze.password,delete Ze.passwordConfirm,delete It.password,delete It.passwordConfirm,JSON.stringify(Ze)==JSON.stringify(It)}function X(){t(9,g=null),window.localStorage.removeItem(N())}async function J(ce=!0){if(!(m||!r||!(f!=null&&f.id))){t(10,m=!0);try{const we=le();let Ze;O?Ze=await de.collection(f.id).create(we):Ze=await de.collection(f.id).update(h.id,we),jt(O?"Successfully created record.":"Successfully updated record."),X(),ce?(t(11,_=!1),I()):P(Ze),a("save",{isNew:O,record:Ze})}catch(we){de.error(we)}t(10,m=!1)}}function W(){d!=null&&d.id&&mn("Do you really want to delete the selected record?",()=>de.collection(d.collectionId).delete(d.id).then(()=>{I(),jt("Successfully deleted record."),a("delete",d)}).catch(ce=>{de.error(ce)}))}function le(){const ce=structuredClone(h||{}),we=new FormData,Ze={id:ce.id},It={};for(const tt of(f==null?void 0:f.schema)||[])Ze[tt.name]=!0,tt.type=="json"&&(It[tt.name]=!0);i&&(Ze.username=!0,Ze.email=!0,Ze.emailVisibility=!0,Ze.password=!0,Ze.passwordConfirm=!0,Ze.verified=!0);for(const tt in ce)if(Ze[tt]){if(typeof ce[tt]>"u"&&(ce[tt]=null),It[tt]&&ce[tt]!=="")try{JSON.parse(ce[tt])}catch(an){const Zt={};throw Zt[tt]={code:"invalid_json",message:an.toString()},new Kn({status:400,response:{data:Zt}})}V.addValueToFormData(we,tt,ce[tt])}for(const tt in y){const an=V.toArray(y[tt]);for(const Zt of an)we.append(tt,Zt)}for(const tt in S){const an=V.toArray(S[tt]);for(const Zt of an)we.append(tt+"."+Zt,"")}return we}function ee(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent verification email to ${d.email}?`,()=>de.collection(f.id).requestVerification(d.email).then(()=>{jt(`Successfully sent verification email to ${d.email}.`)}).catch(ce=>{de.error(ce)}))}function ie(){!(f!=null&&f.id)||!(d!=null&&d.email)||mn(`Do you really want to sent password reset email to ${d.email}?`,()=>de.collection(f.id).requestPasswordReset(d.email).then(()=>{jt(`Successfully sent password reset email to ${d.email}.`)}).catch(ce=>{de.error(ce)}))}function Ee(){o?mn("You have unsaved changes. Do you really want to discard them?",()=>{Ne()}):Ne()}async function Ne(){let ce=d?structuredClone(d):null;if(ce){ce.id="",ce.created="",ce.updated="";const we=(f==null?void 0:f.schema)||[];for(const Ze of we)Ze.type==="file"&&delete ce[Ze.name]}X(),D(ce),await ln(),t(26,C="")}function Ve(ce){(ce.ctrlKey||ce.metaKey)&&ce.code=="KeyS"&&(ce.preventDefault(),ce.stopPropagation(),J(!1))}const ze=()=>I(),oe=()=>ee(),Ce=()
2023-09-01 14:22:49 +08:00
`),f=v("button"),f.textContent="{APP_NAME} ",c=U(`,
2023-09-30 16:58:14 +08:00
`),d=v("button"),d.textContent="{APP_URL} ",h=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(a,"class","help-block")},m(_,y){w(_,e,y),b(e,t),w(_,s,y),w(_,l,y),ae(l,n[0].subject),w(_,r,y),w(_,a,y),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),g||(m=[K(l,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],g=!0)},p(_,y){y[1]&1&&i!==(i=_[31])&&p(e,"for",i),y[1]&1&&o!==(o=_[31])&&p(l,"id",o),y[0]&1&&l.value!==_[0].subject&&ae(l,_[0].subject)},d(_){_&&(k(e),k(s),k(l),k(r),k(a)),g=!1,$e(m)}}}function iA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y;return{c(){e=v("label"),t=U("Action URL"),s=E(),l=v("input"),r=E(),a=v("div"),u=U(`Available placeholder parameters:
2023-09-01 14:22:49 +08:00
`),f=v("button"),f.textContent="{APP_NAME} ",c=U(`,
`),d=v("button"),d.textContent="{APP_URL} ",h=U(`,
2023-09-30 19:43:12 +08:00
`),g=v("button"),g.textContent="{TOKEN} ",m=U("."),p(e,"for",i=n[31]),p(l,"type","text"),p(l,"id",o=n[31]),p(l,"spellcheck","false"),l.required=!0,p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(g,"title","Required parameter"),p(a,"class","help-block")},m(S,C){w(S,e,C),b(e,t),w(S,s,C),w(S,l,C),ae(l,n[0].actionUrl),w(S,r,C),w(S,a,C),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),_||(y=[K(l,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,C){C[1]&1&&i!==(i=S[31])&&p(e,"for",i),C[1]&1&&o!==(o=S[31])&&p(l,"id",o),C[0]&1&&l.value!==S[0].actionUrl&&ae(l,S[0].actionUrl)},d(S){S&&(k(e),k(s),k(l),k(r),k(a)),_=!1,$e(y)}}}function sA(n){let e,t,i,s;return{c(){e=v("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(l,o){w(l,e,o),ae(e,n[0].body),i||(s=K(e,"input",n[21]),i=!0)},p(l,o){o[1]&1&&t!==(t=l[31])&&p(e,"id",t),o[0]&1&&ae(e,l[0].body)},i:x,o:x,d(l){l&&k(e),i=!1,s()}}}function lA(n){let e,t,i,s;function l(a){n[20](a)}var o=n[4];function r(a,u){let f={id:a[31],language:"html"};return a[0].body!==void 0&&(f.value=a[0].body),{props:f}}return o&&(e=Et(o,r(n)),te.push(()=>he(e,"value",l))),{c(){e&&z(e.$$.fragment),i=Se()},m(a,u){e&&j(e,a,u),w(a,i,u),s=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){ue();const f=e;L(f.$$.fragment,1,0,()=>{H(f,1)}),fe()}o?(e=Et(o,r(a)),te.push(()=>he(e,"value",l)),z(e.$$.fragment),A(e.$$.fragment,1),j(e,i.parentNode,i)):e=null}else if(o){const f={};u[1]&1&&(f.id=a[31]),!t&&u[0]&1&&(t=!0,f.value=a[0].body,ye(()=>t=!1)),e.$set(f)}},i(a){s||(e&&A(e.$$.fragment,a),s=!0)},o(a){e&&L(e.$$.fragment,a),s=!1},d(a){a&&k(i),e&&H(e,a)}}}function oA(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T;const $=[lA,sA],O=[];function M(D,I){return D[4]&&!D[5]?0:1}return l=M(n),o=O[l]=$[l](n),{c(){e=v("label"),t=U("Body (HTML)"),s=E(),o.c(),r=E(),a=v("div"),u=U(`Available placeholder parameters:
2023-09-01 14:22:49 +08:00
`),f=v("button"),f.textContent="{APP_NAME} ",c=U(`,
`),d=v("button"),d.textContent="{APP_URL} ",h=U(`,
`),g=v("button"),g.textContent="{TOKEN} ",m=U(`,
2023-09-30 19:43:12 +08:00
`),_=v("button"),_.textContent="{ACTION_URL} ",y=U("."),p(e,"for",i=n[31]),p(f,"type","button"),p(f,"class","label label-sm link-primary txt-mono"),p(d,"type","button"),p(d,"class","label label-sm link-primary txt-mono"),p(g,"type","button"),p(g,"class","label label-sm link-primary txt-mono"),p(_,"type","button"),p(_,"class","label label-sm link-primary txt-mono"),p(_,"title","Required parameter"),p(a,"class","help-block")},m(D,I){w(D,e,I),b(e,t),w(D,s,I),O[l].m(D,I),w(D,r,I),w(D,a,I),b(a,u),b(a,f),b(a,c),b(a,d),b(a,h),b(a,g),b(a,m),b(a,_),b(a,y),S=!0,C||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],C=!0)},p(D,I){(!S||I[1]&1&&i!==(i=D[31]))&&p(e,"for",i);let F=l;l=M(D),l===F?O[l].p(D,I):(ue(),L(O[F],1,1,()=>{O[F]=null}),fe(),o=O[l],o?o.p(D,I):(o=O[l]=$[l](D),o.c()),A(o,1),o.m(r.parentNode,r))},i(D){S||(A(o),S=!0)},o(D){L(o),S=!1},d(D){D&&(k(e),k(s),k(r),k(a)),O[l].d(D),C=!1,$e(T)}}}function rA(n){let e,t,i,s,l,o;return e=new pe({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[nA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new pe({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[iA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),l=new pe({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[oA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(r,a){j(e,r,a),w(r,t,a),j(i,r,a),w(r,s,a),j(l,r,a),o=!0},p(r,a){const u={};a[0]&2&&(u.name=r[1]+".subject"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),e.$set(u);const f={};a[0]&2&&(f.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),i.$set(f);const c={};a[0]&2&&(c.name=r[1]+".body"),a[0]&49|a[1]&3&&(c.$$scope={dirty:a,ctx:r}),l.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(l.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(l.$$.fragment,r),o=!1},d(r){r&&(k(t),k(s)),H(e,r),H(i,r),H(l,r)}}}function Am(n){let e,t,i,s,l;return{c(){e=v("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,s||(l=Te(je.call(null,e,{text:"Has errors",position:"left"})),s=!0)},i(o){i||(o&&Qe(()=>{i&&(t||(t=qe(e,Jt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=qe(e,Jt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&k(e),o&&t&&t.end(),s=!1,l()}}}function aA(n){let e,t,i,s,l,o,r,a,u,f=n[6]&&Am();return{c(){e=v("div"),t=v("i"),i=E(),s=v("span"),l=U(n[2]),o=E(),r=v("div"),a=E(),f&&f.c(),u=Se(),p(t,"class","ri-draft-line"),p(s,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),b(e,t),b(e,i),b(e,s),b(s,l),w(c,o,d),w(c,r,d),w(c,a,d),f&&f.m(c,d),w(c,u,d)},p(c,d){d[0]&4&&se(l,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Am(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(ue(),L(f,1,1,()=>{f=null}),fe())},d(c){c&&(k(e),k(o),k(r),k(a),k(u)),f&&f.d(c)}}}function uA(n){let e,t;const i=[n[8]];let s={$$slots:{header:[aA],default:[rA]},$$scope:{ctx:n}};for(let l=0;l<i.length;l+=1)s=He(s,i[l]);return e=new uo({props:s}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){z(e.$$.fragment)},m(l,o){j(e,l,o),t=!0},p(l,o){const r=o[0]&256?yt(i,[Pt(l[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:l}),e.$set(r)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[26](null),H(e,l)}}}let Im;function fA(n,e,t){let i;const s=["key","title","config","expand","collapse","collapseSiblings"];let l=et(e,s),o;Ke(n,$i,W=>t(12,o=W));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=Im,d=!1;function h(){f==null||f.expand()}function g(){f==null||f.collapse()}function m(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-73c7d443.js"),["./CodeEditor-73c7d443.js","./index-9cd23da9.js"],import.meta.url)).default),Im=c,t(5,d=!1))}function y(W){V.copyToClipboard(W),bo(`Copied ${W} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const C=()=>y("{APP_NAME}"),T=()=>y("{APP_U
2023-09-01 14:22:49 +08:00
from the
`),r=v("strong"),u=U(a),f=U(`
to the
`),c=v("strong"),h=U(d),g=U(`.
`),m=v("br"),_=U(`
There are numerous command line tools that can help you, such as:
`),y=v("a"),y.textContent=`rclone
`,S=U(`,
`),C=v("a"),C.textContent=`s5cmd
2023-09-30 19:43:12 +08:00
`,T=U(", etc."),$=E(),O=v("div"),p(i,"class","icon"),p(y,"href","https://github.com/rclone/rclone"),p(y,"target","_blank"),p(y,"rel","noopener noreferrer"),p(y,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(l,"class","content"),p(t,"class","alert alert-warning m-0"),p(O,"class","clearfix m-t-base")},m(F,P){w(F,e,P),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),b(l,r),b(r,u),b(l,f),b(l,c),b(c,h),b(l,g),b(l,m),b(l,_),b(l,y),b(l,S),b(l,C),b(l,T),b(e,$),b(e,O),D=!0},p(F,P){var N;(!D||P&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&se(u,a),(!D||P&2)&&d!==(d=F[1].s3.enabled?"S3 storage":"local file system")&&se(h,d)},i(F){D||(F&&Qe(()=>{D&&(M||(M=qe(e,it,{duration:150},!0)),M.run(1))}),D=!0)},o(F){F&&(M||(M=qe(e,it,{duration:150},!1)),M.run(0)),D=!1},d(F){F&&k(e),F&&M&&M.end()}}}function XA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&Hm(n);return{c(){t&&t.c(),e=Se()},m(s,l){t&&t.m(s,l),w(s,e,l)},p(s,l){var o;((o=s[0].s3)==null?void 0:o.enabled)!=s[1].s3.enabled?t?(t.p(s,l),l&3&&A(t,1)):(t=Hm(s),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(ue(),L(t,1,1,()=>{t=null}),fe())},d(s){s&&k(e),t&&t.d(s)}}}function Vm(n){let e;function t(l,o){return l[4]?e8:l[5]?xA:QA}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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){l&&k(e),s.d(l)}}}function QA(n){let e;return{c(){e=v("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function xA(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=je.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&At(t.update)&&o&32&&t.update.call(null,(r=l[5].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function e8(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function zm(n){let e,t,i,s;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent btn-hint"),e.disabled=n[3]},m(l,o){w(l,e,o),b(e,t),i||(s=K(e,"click",n[14]),i=!0)},p(l,o){o&8&&(e.disabled=l[3])},d(l){l&&k(e),i=!1,s()}}}function t8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;const y=[ZA,GA],S=[];function C(T,$){return T[2]?0:1}return d=C(n),h=S[d]=y[d](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[7]),r=E(),a=v("div"),u=v("form"),f=v("div"),f.innerHTML="<p>By default PocketBase uses the local file system to store uploaded files.</p> <p>If you have limited disk space, you could optionally connect to an S3 compatible storage.</p>",c=E(),h.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","content txt-xl m-b-base"),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(T,$){w(T,e,$),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(T,r,$),w(T,a,$),b(a,u),b(u,f),b(u,c),S[d].m(u,null),g=!0,m||(_=K(u,"submit",xe(n[16])),m=!0)},p(T,$){(!g||$&128)&&se(o,T[7]);let O=d;d=C(T),d===O?S[d].p(T,$):(ue(),L(S[O],1,1,()=>{S[O]=null}),fe(),h=S[d],h?h.p(T,$):(h=S[d]=y[d](T),h.c()),A(h,1),h.m(u,null))},i(T){g||(A(h),g=!0)},o(T){L(h),g=!1},d(T){T&&(k(e),k(r),k(a)),S[d].d(),m=!1,_()}}}function n8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[t8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(
another PocketBase environment.</p>`,t=E(),i=v("div"),s=v("button"),s.innerHTML='<span class="txt">Copy</span>',l=E(),z(o.$$.fragment),r=E(),a=v("div"),u=v("div"),f=E(),c=v("button"),c.innerHTML='<i class="ri-download-line"></i> <span class="txt">Download as JSON</span>',p(e,"class","content txt-xl m-b-base"),p(s,"type","button"),p(s,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(m,_){w(m,e,_),w(m,t,_),w(m,i,_),b(i,s),b(i,l),j(o,i,null),n[8](i),w(m,r,_),w(m,a,_),b(a,u),b(a,f),b(a,c),d=!0,h||(g=[K(s,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],h=!0)},p(m,_){const y={};_&4&&(y.content=m[2]),o.$set(y)},i(m){d||(A(o.$$.fragment,m),d=!0)},o(m){L(o.$$.fragment,m),d=!1},d(m){m&&(k(e),k(t),k(i),k(r),k(a)),H(o),n[8](null),h=!1,$e(g)}}}function L8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function P8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[L8,I8],g=[];function m(_,y){return _[1]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[3]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y&8)&&se(o,_[3]);let S=f;f=m(_),f===S?g[f].p(_,y):(ue(),L(g[S],1,1,()=>{g[S]=null}),fe(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function F8(n){let e,t,i,s;return e=new Oi({}),i=new Sn({props:{$$slots:{default:[P8]},$$scope:{ctx:n}}}),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment)},m(l,o){j(e,l,o),w(l,t,o),j(i,l,o),s=!0},p(l,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:l}),i.$set(r)},i(l){s||(A(e.$$.fragment,l),A(i.$$.fragment,l),s=!0)},o(l){L(e.$$.fragment,l),L(i.$$.fragment,l),s=!1},d(l){l&&k(t),H(e,l),H(i,l)}}}function N8(n,e,t){let i,s;Ke(n,Dt,_=>t(3,s=_)),sn(Dt,s="Export collections",s);const l="export_"+V.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await de.collections.getFullList(100,{$cancelKey:l,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){de.error(_)}t(1,a=!1)}function f(){V.downloadJson(r,"pb_schema")}function c(){V.copyToClipboard(i),bo("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function h(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const y=window.getSelection(),S=document.createRange();S.selectNodeContents(o),y.removeAllRanges(),y.addRange(S)}},m=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,s,f,c,r,d,h,g,m]}class R8 extends ve{constructor(e){super(),be(this,e,N8,F8,me,{})}}function ng(n,e,t){const i=n.slice();return i[14]=e[t],i}function ig(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function sg(n,e,t){const i=n.slice();return i[14]=e[t],i}function lg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function og(n,e,t){const i=n.slice();return i[14]=e[t],i}function rg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function ag(n,e,t){const i=n.slice();return i[30]=e[t],i}function q8(n){let e,t,i,s,l=n[1].name+"",o,r=n[9]&&ug(),a=n[0].name!==n[1].name&&fg(n);return{c(){e=v("div"),r&&r.c(),t=E(),a&&a.c(),i=E(),s=v("strong"),o=U(l),p(s,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),b(e,t),a&&a.m(e,null),b(e,i),b(e,s),b(s,o)},p(u,f){u[9]?r||(r=ug(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=fg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&l!==(l=u[1].name+"")&&se(o,l)},d(u){u&&k(e),r&&r.d(),a&&a.d()}}}function j8(n){var o;let e,t,i,s=((o=n[0])==null?voi
- ${T.join(`
2023-09-30 16:58:14 +08:00
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await de.collections.import(o,a),jt("Successfully imported collections configuration."),i("submit")}catch(T){de.error(T)}t(4,u=!1),c()}}const m=()=>h(),_=()=>!u;function y(T){te[T?"unshift":"push"](()=>{s=T,t(1,s)})}function S(T){Fe.call(this,n,T)}function C(T){Fe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(l)&&Array.isArray(o)&&d()},[c,s,r,a,u,h,f,l,o,m,_,y,S,C]}class G8 extends ve{constructor(e){super(),be(this,e,J8,K8,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function wg(n,e,t){const i=n.slice();return i[32]=e[t],i}function Sg(n,e,t){const i=n.slice();return i[35]=e[t],i}function Tg(n,e,t){const i=n.slice();return i[32]=e[t],i}function Z8(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M;a=new pe({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[Q8,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let D=!1,I=n[6]&&n[1].length&&!n[7]&&$g(),F=n[6]&&n[1].length&&n[7]&&Mg(n),P=n[13].length&&qg(n),N=!!n[0]&&jg(n);return{c(){e=v("input"),t=E(),i=v("div"),s=v("p"),l=U(`Paste below the collections configuration you want to import or
2023-09-30 19:43:12 +08:00
`),o=v("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=E(),z(a.$$.fragment),u=E(),f=E(),I&&I.c(),c=E(),F&&F.c(),d=E(),P&&P.c(),h=E(),g=v("div"),N&&N.c(),m=E(),_=v("div"),y=E(),S=v("button"),C=v("span"),C.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),Q(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p(C,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=T=!n[14],p(g,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),b(i,s),b(s,l),b(s,o),w(R,r,q),j(a,R,q),w(R,u,q),w(R,f,q),I&&I.m(R,q),w(R,c,q),F&&F.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,h,q),w(R,g,q),N&&N.m(g,null),b(g,m),b(g,_),b(g,y),b(g,S),b(S,C),$=!0,O||(M=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],O=!0)},p(R,q){(!$||q[0]&4096)&&Q(o,"btn-loading",R[12]);const B={};q[0]&64&&(B.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(B.$$scope={dirty:q,ctx:R}),a.$set(B),R[6]&&R[1].length&&!R[7]?I||(I=$g(),I.c(),I.m(c.parentNode,c)):I&&(I.d(1),I=null),R[6]&&R[1].length&&R[7]?F?F.p(R,q):(F=Mg(R),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),R[13].length?P?P.p(R,q):(P=qg(R),P.c(),P.m(h.parentNode,h)):P&&(P.d(1),P=null),R[0]?N?N.p(R,q):(N=jg(R),N.c(),N.m(g,m)):N&&(N.d(1),N=null),(!$||q[0]&16384&&T!==(T=!R[14]))&&(S.disabled=T)},i(R){$||(A(a.$$.fragment,R),A(D),$=!0)},o(R){L(a.$$.fragment,R),L(D),$=!1},d(R){R&&(k(e),k(t),k(i),k(r),k(u),k(f),k(c),k(d),k(h),k(g)),n[19](null),H(a,R),I&&I.d(R),F&&F.d(R),P&&P.d(R),N&&N.d(),O=!1,$e(M)}}}function X8(n){let e;return{c(){e=v("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:x,i:x,o:x,d(t){t&&k(e)}}}function Cg(n){let e;return{c(){e=v("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Q8(n){let e,t,i,s,l,o,r,a,u,f,c=!!n[0]&&!n[6]&&Cg();return{c(){e=v("label"),t=U("Collections"),s=E(),l=v("textarea"),r=E(),c&&c.c(),a=Se(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(l,"id",o=n[40]),p(l,"class","code"),p(l,"spellcheck","false"),p(l,"rows","15"),l.required=!0},m(d,h){w(d,e,h),b(e,t),w(d,s,h),w(d,l,h),ae(l,n[0]),w(d,r,h),c&&c.m(d,h),w(d,a,h),u||(f=K(l,"input",n[22]),u=!0)},p(d,h){h[1]&512&&i!==(i=d[40])&&p(e,"for",i),h[1]&512&&o!==(o=d[40])&&p(l,"id",o),h[0]&1&&ae(l,d[0]),d[0]&&!d[6]?c||(c=Cg(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(k(e),k(s),k(l),k(r),k(a)),c&&c.d(d),u=!1,f()}}}function $g(n){let e;return{c(){e=v("div"),e.innerHTML='<div class="icon"><i class="ri-information-line"></i></div> <div class="content"><string>Your collections configuration is already up-to-date!</string></div>',p(e,"class","alert alert-info")},m(t,i){w(t,e,i)},d(t){t&&k(e)}}}function Mg(n){let e,t,i,s,l,o=n[9].length&&Og(n),r=n[4].length&&Ag(n),a=n[8].length&&Fg(n);return{c(){e=v("h5"),e.textContent="Detected changes",t=E(),i=v("div"),o&&o.c(),s=E(),r&&r.c(),l=E(),a&&a.c(),p(e,"class","section-title"),p(i,"class","list")},m(u,f){w(u,e,f),w(u,t,f),w(u,i,f),o&&o.m(i,null),b(i,s),r&&r.m(i,null),b(i,l),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=Og(u),o.c(),o.m(i,s)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Ag(u),r.c(),r.m(i,l)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=Fg(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(k(e),k(t),k(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function Og(n){let e=[],t=new Map,i,s=ge(n[9]);const l=o=>o[32].id;for(let o=0;o<s.length;o+=1){let r=Tg(n,s,o),a=l(r);t.set(a,e[o]=Dg(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=Se()},m(o,r){for(let a=0;a<e.length;a+=1)e[a]&&e[a].m(o,r);w(o,i,r)},p(o,r){r[0]&512&&(s=ge(o[9]),e=vt(e,r,l,1,o,s,t,i.parentNode,rs,Dg,i,Tg))},d(o){o&&k(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function Eg(n){let e,t,i=n[32].id+"",s,l;return{c(){e=v("small"),t=U("("),s=U(i),l=U(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),b(e,t),b(e,s),b(e,l)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&se(s,i)},d(o){o&&k(e)}}}function Dg(n,e){let t,i,s,l,o=e[32].name+
2023-09-01 14:22:49 +08:00
imported with different IDs. You can replace them in the import if you want
2023-09-30 19:43:12 +08:00
to.</string>`,l=E(),o=v("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(s,"class","content"),p(o,"type","button"),p(o,"class","btn btn-warning btn-sm btn-outline"),p(e,"class","alert alert-warning m-t-base")},m(u,f){w(u,e,f),b(e,t),b(e,i),b(e,s),b(e,l),b(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:x,d(u){u&&k(e),r=!1,a()}}}function jg(n){let e,t,i;return{c(){e=v("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(s,l){w(s,e,l),t||(i=K(e,"click",n[25]),t=!0)},p:x,d(s){s&&k(e),t=!1,i()}}}function x8(n){let e,t,i,s,l,o,r,a,u,f,c,d;const h=[X8,Z8],g=[];function m(_,y){return _[5]?0:1}return f=m(n),c=g[f]=h[f](n),{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[15]),r=E(),a=v("div"),u=v("div"),c.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,y){w(_,e,y),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(_,r,y),w(_,a,y),b(a,u),g[f].m(u,null),d=!0},p(_,y){(!d||y[0]&32768)&&se(o,_[15]);let S=f;f=m(_),f===S?g[f].p(_,y):(ue(),L(g[S],1,1,()=>{g[S]=null}),fe(),c=g[f],c?c.p(_,y):(c=g[f]=h[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){L(c),d=!1},d(_){_&&(k(e),k(r),k(a)),g[f].d()}}}function eI(n){let e,t,i,s,l,o;e=new Oi({}),i=new Sn({props:{$$slots:{default:[x8]},$$scope:{ctx:n}}});let r={};return l=new G8({props:r}),n[27](l),l.$on("submit",n[28]),{c(){z(e.$$.fragment),t=E(),z(i.$$.fragment),s=E(),z(l.$$.fragment)},m(a,u){j(e,a,u),w(a,t,u),j(i,a,u),w(a,s,u),j(l,a,u),o=!0},p(a,u){const f={};u[0]&65535|u[1]&1024&&(f.$$scope={dirty:u,ctx:a}),i.$set(f);const c={};l.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(l.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(l.$$.fragment,a),o=!1},d(a){a&&(k(t),k(s)),H(e,a),H(i,a),n[27](null),H(l,a)}}}function tI(n,e,t){let i,s,l,o,r,a,u;Ke(n,Dt,W=>t(15,u=W)),sn(Dt,u="Import collections",u);let f,c,d="",h=!1,g=[],m=[],_=!0,y=[],S=!1;C();async function C(){t(5,S=!0);try{t(2,m=await de.collections.getFullList(200));for(let W of m)delete W.created,delete W.updated}catch(W){de.error(W)}t(5,S=!1)}function T(){if(t(4,y=[]),!!i)for(let W of g){const le=V.findByKey(m,"id",W.id);!(le!=null&&le.id)||!V.hasCollectionChanges(le,W,_)||y.push({new:W,old:le})}}function $(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=V.filterDuplicatesByKey(g)):t(1,g=[]);for(let W of g)delete W.created,delete W.updated,W.schema=V.filterDuplicatesByKey(W.schema)}function O(){var W,le;for(let ee of g){const ie=V.findByKey(m,"name",ee.name)||V.findByKey(m,"id",ee.id);if(!ie)continue;const Ee=ee.id,Ne=ie.id;ee.id=Ne;const Ve=Array.isArray(ie.schema)?ie.schema:[],ze=Array.isArray(ee.schema)?ee.schema:[];for(const oe of ze){const Ce=V.findByKey(Ve,"name",oe.name);Ce&&Ce.id&&(oe.id=Ce.id)}for(let oe of g)if(Array.isArray(oe.schema))for(let Ce of oe.schema)(W=Ce.options)!=null&&W.collectionId&&((le=Ce.options)==null?void 0:le.collectionId)===Ee&&(Ce.options.collectionId=Ne)}t(0,d=JSON.stringify(g,null,4))}function M(W){t(12,h=!0);const le=new FileReader;le.onload=async ee=>{t(12,h=!1),t(10,f.value="",f),t(0,d=ee.target.result),await ln(),g.length||(ls("Invalid collections configuration."),D())},le.onerror=ee=>{console.warn(ee),ls("Failed to load the imported JSON."),t(12,h=!1),t(10,f.value="",f)},le.readAsText(W)}function D(){t(0,d=""),t(10,f.value="",f),en({})}function I(W){te[W?"unshift":"push"](()=>{f=W,t(10,f)})}const F=()=>{f.files.length&&M(f.files[0])},P=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){_=this.checked,t(3,_)}const q=()=>O(),B=()=>D(),Z=()=>c==null?void 0:c.show(m,g,_);function X(W){te[W?"unshift":"push"](()=>{c=W,t(11,c)})}const J=()=>D();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&$(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(W=>!!W.id&&!!W.name).length),n.$$.dirty[0]&78&&t(9,s=m.filter(W=>i&&_&&!V.findByKey(g,"id",W.id))),n.
2023-09-01 14:22:49 +08:00
database will be temporary &quot;locked&quot; (this usually happens only during the ZIP generation).</p> <p class="txt-bold">If you are using S3 storage for the collections file upload, you&#39;ll have to backup them
2023-09-30 19:43:12 +08:00
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=E(),i=v("form"),z(s.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,u){w(a,e,u),w(a,t,u),w(a,i,u),j(s,i,null),l=!0,o||(r=K(i,"submit",xe(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),s.$set(f)},i(a){l||(A(s.$$.fragment,a),l=!0)},o(a){L(s.$$.fragment,a),l=!1},d(a){a&&(k(e),k(t),k(i)),H(s),o=!1,r()}}}function lI(n){let e;return{c(){e=v("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function oI(n){let e,t,i,s,l,o,r;return{c(){e=v("button"),t=v("span"),t.textContent="Cancel",i=E(),s=v("button"),l=v("span"),l.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[4]),p(s,"class","btn btn-expanded"),s.disabled=n[3],Q(s,"btn-loading",n[3])},m(a,u){w(a,e,u),b(e,t),w(a,i,u),w(a,s,u),b(s,l),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(s.disabled=a[3]),u&8&&Q(s,"btn-loading",a[3])},d(a){a&&(k(e),k(i),k(s)),o=!1,r()}}}function rI(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[oI],header:[lI],default:[sI]},$$scope:{ctx:n}};return e=new on({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&8&&(o.beforeOpen=s[8]),l&8&&(o.beforeHide=s[9]),l&65548&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[10](null),H(e,s)}}}function aI(n,e,t){const i=pt(),s="backup_create_"+V.randomString(5);let l,o="",r=!1,a;function u(S){en({}),t(3,r=!1),t(2,o=S||""),l==null||l.show()}function f(){return l==null?void 0:l.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await de.backups.create(o,{$cancelKey:s}),t(3,r=!1),f(),i("submit"),jt("Successfully generated new backup.")}catch(S){S.isAbort||de.error(S)}clearTimeout(a),t(3,r=!1)}}Is(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const h=()=>r?(bo("A backup has already been started, please wait."),!1):!0,g=()=>(r&&bo("The backup was started but may take a while to complete. You can come back later.",4500),!0);function m(S){te[S?"unshift":"push"](()=>{l=S,t(1,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return[f,l,o,r,s,c,u,d,h,g,m,_,y]}class uI extends ve{constructor(e){super(),be(this,e,aI,rI,me,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function fI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Backup name"),s=E(),l=v("input"),p(e,"for",i=n[15]),p(l,"type","text"),p(l,"id",o=n[15]),l.required=!0},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[2]),r||(a=K(l,"input",n[9]),r=!0)},p(u,f){f&32768&&i!==(i=u[15])&&p(e,"for",i),f&32768&&o!==(o=u[15])&&p(l,"id",o),f&4&&l.value!==u[2]&&ae(l,u[2])},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function cI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_;return u=new qs({props:{value:n[1]}}),h=new pe({props:{class:"form-field required m-0",name:"name",$$slots:{default:[fI,({uniqueId:y})=>({15:y}),({uniqueId:y})=>y?32768:0]},$$scope:{ctx:n}}}),{c(){e=v("div"),e.innerHTML=`<div class="icon"><i class="ri-alert-line"></i></div> <div class="content"><p class="txt-bold">Please proceed with caution.
2023-09-01 14:22:49 +08:00
<br/>
Backup restore is still experimental and currently works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
the backup and will restart the application process.</p> <p>Nothing will happen if the backup file is invalid or incompatible.</p></div>`,t=E(),i=v("div"),s=U(`Type the backup name
2023-09-30 16:58:14 +08:00
`),l=v("div"),o=v("span"),r=U(n[1]),a=E(),z(u.$$.fragment),f=U(`
2023-09-30 19:43:12 +08:00
to confirm:`),c=E(),d=v("form"),z(h.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(l,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(y,S){w(y,e,S),w(y,t,S),w(y,i,S),b(i,s),b(i,l),b(l,o),b(o,r),b(l,a),j(u,l,null),b(i,f),w(y,c,S),w(y,d,S),j(h,d,null),g=!0,m||(_=K(d,"submit",xe(n[7])),m=!0)},p(y,S){(!g||S&2)&&se(r,y[1]);const C={};S&2&&(C.value=y[1]),u.$set(C);const T={};S&98308&&(T.$$scope={dirty:S,ctx:y}),h.$set(T)},i(y){g||(A(u.$$.fragment,y),A(h.$$.fragment,y),g=!0)},o(y){L(u.$$.fragment,y),L(h.$$.fragment,y),g=!1},d(y){y&&(k(e),k(t),k(i),k(c),k(d)),H(u),H(h),m=!1,_()}}}function dI(n){let e,t,i,s;return{c(){e=v("h4"),t=U("Restore "),i=v("strong"),s=U(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(l,o){w(l,e,o),b(e,t),b(e,i),b(i,s)},p(l,o){o&2&&se(s,l[1])},d(l){l&&k(e)}}}function pI(n){let e,t,i,s,l,o,r,a;return{c(){e=v("button"),t=U("Cancel"),i=E(),s=v("button"),l=v("span"),l.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(l,"class","txt"),p(s,"type","submit"),p(s,"form",n[6]),p(s,"class","btn btn-expanded"),s.disabled=o=!n[5]||n[4],Q(s,"btn-loading",n[4])},m(u,f){w(u,e,f),b(e,t),w(u,i,f),w(u,s,f),b(s,l),r||(a=K(e,"click",n[0]),r=!0)},p(u,f){f&16&&(e.disabled=u[4]),f&48&&o!==(o=!u[5]||u[4])&&(s.disabled=o),f&16&&Q(s,"btn-loading",u[4])},d(u){u&&(k(e),k(i),k(s)),r=!1,a()}}}function hI(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[pI],header:[dI],default:[cI]},$$scope:{ctx:n}};return e=new on({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){z(e.$$.fragment)},m(s,l){j(e,s,l),t=!0},p(s,[l]){const o={};l&16&&(o.overlayClose=!s[4]),l&16&&(o.escClose=!s[4]),l&16&&(o.beforeHide=s[10]),l&65590&&(o.$$scope={dirty:l,ctx:s}),e.$set(o)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[11](null),H(e,s)}}}function mI(n,e,t){let i;const s="backup_restore_"+V.randomString(5);let l,o="",r="",a=!1,u=null;function f(S){en({}),t(2,r=""),t(1,o=S),t(4,a=!1),l==null||l.show()}function c(){return l==null?void 0:l.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await de.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(u),C!=null&&C.isAbort||(t(4,a=!1),ls(((S=C.response)==null?void 0:S.message)||C.message))}}}Is(()=>{clearTimeout(u)});function h(){r=this.value,t(2,r)}const g=()=>!a;function m(S){te[S?"unshift":"push"](()=>{l=S,t(3,l)})}function _(S){Fe.call(this,n,S)}function y(S){Fe.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,l,a,i,s,d,f,h,g,m,_,y]}class gI extends ve{constructor(e){super(),be(this,e,mI,hI,me,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function Hg(n,e,t){const i=n.slice();return i[22]=e[t],i}function Vg(n,e,t){const i=n.slice();return i[19]=e[t],i}function _I(n){let e=[],t=new Map,i,s,l=ge(n[3]);const o=a=>a[22].key;for(let a=0;a<l.length;a+=1){let u=Hg(n,l,a),f=o(u);t.set(f,e[a]=Bg(f,u))}let r=null;return l.length||(r=zg()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=Se(),r&&r.c()},m(a,u){for(let f=0;f<e.length;f+=1)e[f]&&e[f].m(a,u);w(a,i,u),r&&r.m(a,u),s=!0},p(a,u){u&876&&(l=ge(a[3]),ue(),e=vt(e,u,o,1,a,l,t,i.parentNode,Ut,Bg,i,Hg),fe(),!l.length&&r?r.p(a,u):l.length?r&&(r.d(1),r=null):(r=zg(),r.c(),r.m(i.parentNode,i)))},i(a){if(!s){for(let u=0;u<l.length;u+=1)A(e[u]);s=!0}},o(a){for(let u=0;u<e.length;u+=1)L(e[u]);s=!1},d(a){a&&k(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function bI(n){let e,t=ge(Array(n[3].length||1)),i=[];for(let s=0;s<t.length;s+=1)i[s]=Ug(Vg(n,t,s));return{c(){for(let s=0;s<i.length;s+=1)i[s].c();e=Se()},m(s,l){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(s,l);w(s,e,l)},p(s,l){if(l&8){t=ge(Array(s[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=Vg(s,t,o);i[o]?i[o].p(r,l):(i[o]=Ug(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:x,o:x,d(s){s&&k(e),gt(i,s)}}}f
`),T=v("span"),T.textContent="macros",$=U(`.
`),O=v("br"),M=U(`
2023-09-30 19:43:12 +08:00
The timezone is in UTC.`),p(e,"for",i=n[31]),l.required=!0,p(l,"type","text"),p(l,"id",o=n[31]),p(l,"class","txt-lg txt-mono"),p(l,"placeholder","* * * * *"),l.autofocus=r=!((N=(P=n[0])==null?void 0:P.backups)!=null&&N.cron),p(c,"class","txt"),p(h,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(y,"class","help-block")},m(P,N){var R,q;w(P,e,N),b(e,t),w(P,s,N),w(P,l,N),ae(l,n[1].backups.cron),w(P,a,N),w(P,u,N),b(u,f),b(f,c),b(f,d),b(f,h),b(f,g),j(m,f,null),w(P,_,N),w(P,y,N),b(y,S),b(S,C),b(S,T),b(S,$),b(S,O),b(S,M),D=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||l.focus(),I||(F=[K(l,"input",n[18]),Te(je.call(null,T,`@yearly
@annually
@monthly
@weekly
@daily
@midnight
2023-09-30 19:43:12 +08:00
@hourly`))],I=!0)},p(P,N){var q,B;(!D||N[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!D||N[1]&1&&o!==(o=P[31]))&&p(l,"id",o),(!D||N[0]&1&&r!==(r=!((B=(q=P[0])==null?void 0:q.backups)!=null&&B.cron)))&&(l.autofocus=r),N[0]&2&&l.value!==P[1].backups.cron&&ae(l,P[1].backups.cron);const R={};N[0]&2|N[1]&2&&(R.$$scope={dirty:N,ctx:P}),m.$set(R)},i(P){D||(A(m.$$.fragment,P),D=!0)},o(P){L(m.$$.fragment,P),D=!1},d(P){P&&(k(e),k(s),k(l),k(a),k(u),k(_),k(y)),H(m),I=!1,$e(F)}}}function II(n){let e,t,i,s,l,o,r,a;return{c(){e=v("label"),t=U("Max @auto backups to keep"),s=E(),l=v("input"),p(e,"for",i=n[31]),p(l,"type","number"),p(l,"id",o=n[31]),p(l,"min","1")},m(u,f){w(u,e,f),b(e,t),w(u,s,f),w(u,l,f),ae(l,n[1].backups.cronMaxKeep),r||(a=K(l,"input",n[23]),r=!0)},p(u,f){f[1]&1&&i!==(i=u[31])&&p(e,"for",i),f[1]&1&&o!==(o=u[31])&&p(l,"id",o),f[0]&2&&dt(l.value)!==u[1].backups.cronMaxKeep&&ae(l,u[1].backups.cronMaxKeep)},d(u){u&&(k(e),k(s),k(l)),r=!1,a()}}}function Jg(n){let e;function t(l,o){return l[7]?FI:l[8]?PI:LI}let i=t(n),s=i(n);return{c(){s.c(),e=Se()},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){l&&k(e),s.d(l)}}}function LI(n){let e;return{c(){e=v("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function PI(n){let e,t,i,s;return{c(){e=v("div"),e.innerHTML='<i class="ri-error-warning-line txt-warning"></i> <span class="txt">Failed to establish S3 connection</span>',p(e,"class","label label-sm label-warning entrance-right")},m(l,o){var r;w(l,e,o),i||(s=Te(t=je.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(l,o){var r;t&&At(t.update)&&o[0]&256&&t.update.call(null,(r=l[8].data)==null?void 0:r.message)},d(l){l&&k(e),i=!1,s()}}}function FI(n){let e;return{c(){e=v("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:x,d(t){t&&k(e)}}}function Gg(n){let e,t,i,s,l;return{c(){e=v("button"),t=v("span"),t.textContent="Reset",p(t,"class","txt"),p(e,"type","submit"),p(e,"class","btn btn-hint btn-transparent"),e.disabled=i=!n[9]||n[5]},m(o,r){w(o,e,r),b(e,t),s||(l=K(e,"click",n[27]),s=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&k(e),s=!1,l()}}}function NI(n){let e,t,i,s,l,o,r,a,u,f,c,d,h,g,m,_,y,S,C,T,$,O,M,D,I,F,P;h=new Yo({props:{class:"btn-sm",tooltip:"Refresh"}}),h.$on("refresh",n[13]),m=new $I({props:{class:"btn-sm"}}),m.$on("success",n[13]);let N={};y=new SI({props:N}),n[15](y);function R(X,J){return X[6]?OI:MI}let q=R(n),B=q(n),Z=n[6]&&!n[4]&&Yg(n);return{c(){e=v("header"),t=v("nav"),i=v("div"),i.textContent="Settings",s=E(),l=v("div"),o=U(n[10]),r=E(),a=v("div"),u=v("div"),f=v("div"),c=v("span"),c.textContent="Backup and restore your PocketBase data",d=E(),z(h.$$.fragment),g=E(),z(m.$$.fragment),_=E(),z(y.$$.fragment),S=E(),C=v("hr"),T=E(),$=v("button"),O=v("span"),O.textContent="Backups options",M=E(),B.c(),D=E(),Z&&Z.c(),p(i,"class","breadcrumb-item"),p(l,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(c,"class","txt-xl"),p(f,"class","flex m-b-sm flex-gap-10"),p(O,"class","txt"),p($,"type","button"),p($,"class","btn btn-secondary"),$.disabled=n[4],Q($,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(X,J){w(X,e,J),b(e,t),b(t,i),b(t,s),b(t,l),b(l,o),w(X,r,J),w(X,a,J),b(a,u),b(u,f),b(f,c),b(f,d),j(h,f,null),b(f,g),j(m,f,null),b(u,_),j(y,u,null),b(u,S),b(u,C),b(u,T),b(u,$),b($,O),b($,M),B.m($,null),b(u,D),Z&&Z.m(u,null),I=!0,F||(P=[K($,"click",n[16]),K(u,"submit",xe(n[11]))],F=!0)},p(X,J){(!I||J[0]&1024)&&se(o,X[10]);const W={};y.$set(W),q!==(q=R(X))&&(B.d(1),B=q(X),B&&(B.c(),B.m($,null))),(!I||J[0]&16)&&($.disabled=X[4]),(!I||J[0]&16)&&Q($,"btn-loading",X[4]),X[6]&&!X[4]?Z?(Z.p(X,J),J[0]&80&&A(Z,1)):(Z=Yg(X),Z.c(),A(Z,1),Z.m(u,null)):Z&&(ue(),L(Z,1,1,()=>{Z=null}),fe())},i(X){I||(A(h.$$.fragment,X),A(m.$$.fragment,X),A(y.$$.fragment,X),A(Z),I=!0)},o(X){L(h.$$.fragment,X),L(m.$$.fragment,X),L(