pocketbase/ui/dist/assets/index-4f1d7166.js

162 lines
988 KiB
JavaScript
Raw Normal View History

var m0=Object.defineProperty;var h0=(n,e,t)=>e in n?m0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ue=(n,e,t)=>(h0(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 l of document.querySelectorAll('link[rel="modulepreload"]'))i(l);new MutationObserver(l=>{for(const s of l)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&i(o)}).observe(document,{childList:!0,subtree:!0});function t(l){const s={};return l.integrity&&(s.integrity=l.integrity),l.referrerPolicy&&(s.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?s.credentials="include":l.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(l){if(l.ep)return;l.ep=!0;const s=t(l);fetch(l.href,s)}})();function Q(){}const vs=n=>n;function Fe(n,e){for(const t in e)n[t]=e[t];return n}function g0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function A_(n){return n()}function lu(){return Object.create(null)}function we(n){n.forEach(A_)}function $t(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Ls;function nn(n,e){return n===e?!0:(Ls||(Ls=document.createElement("a")),Ls.href=e,n===Ls.href)}function _0(n){return Object.keys(n).length===0}function ha(n,...e){if(n==null){for(const i of e)i(void 0);return Q}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function b0(n){let e;return ha(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ha(e,t))}function vt(n,e,t,i){if(n){const l=I_(n,e,t,i);return n[0](l)}}function I_(n,e,t,i){return n[1]&&i?Fe(t.ctx.slice(),n[1](i(e))):t.ctx}function wt(n,e,t,i){if(n[2]&&i){const l=n[2](i(t));if(e.dirty===void 0)return l;if(typeof l=="object"){const s=[],o=Math.max(e.dirty.length,l.length);for(let r=0;r<o;r+=1)s[r]=e.dirty[r]|l[r];return s}return e.dirty|l}return e.dirty}function St(n,e,t,i,l,s){if(l){const o=I_(e,t,i,s);n.p(o,l)}}function Tt(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 Kt(n){const e={};for(const t in n)t[0]!=="$"&&(e[t]=n[t]);return e}function Ze(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 Jn(n){return n??""}function tn(n,e,t){return n.set(t),e}function ve(n){return n&&$t(n.destroy)?n.destroy:Q}function su(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const L_=typeof window<"u";let Ho=L_?()=>window.performance.now():()=>Date.now(),ga=L_?n=>requestAnimationFrame(n):Q;const bl=new Set;function P_(n){bl.forEach(e=>{e.c(n)||(bl.delete(e),e.f())}),bl.size!==0&&ga(P_)}function zo(n){let e;return bl.size===0&&ga(P_),{promise:new Promise(t=>{bl.add(e={c:n,f:t})}),abort(){bl.delete(e)}}}function y(n,e){n.appendChild(e)}function F_(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function y0(n){const e=b("style");return e.textContent="/* empty */",k0(F_(n),e),e.sheet}function k0(n,e){return y(n.head||n,e),e.sheet}function w(n,e,t){n.insertBefore(e,t||null)}function v(n){n.parentNode&&n.parentNode.removeChild(n)}function at(n,e){for(let t=0;t<n.length;t+=1)n[t]&&n[t].d(e)}function b(n){return document.createElement(n)}function Y(n){return document.createTextNode(n)}function M(){return Y(" ")}function ke(){return Y("")}function K(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Ye(n){return function(e){return e.preventDefault(),n.call(this,e)}}function fn(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 v0=["width","height"];function ni(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-11-26 19:33:17 +08:00
`;for(let _=0;_<=1;_+=a){const k=e+(t-e)*s(_);u+=_*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${$0(f)}_${r}`,d=F_(n),{stylesheet:m,rules:g}=yo.get(d)||C0(d,n);g[c]||(g[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const h=n.style.animation||"";return n.style.animation=`${h?`${h}, `:""}${c} ${i}ms linear ${l}ms 1 both`,ko+=1,c}function us(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),l=t.length-i.length;l&&(n.style.animation=i.join(", "),ko-=l,ko||M0())}function M0(){ga(()=>{ko||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function O0(n,e,t,i){if(!e)return Q;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return Q;const{delay:s=0,duration:o=300,easing:r=vs,start:a=Ho()+s,end:u=a+o,tick:f=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,g;function h(){c&&(g=as(n,0,1,o,s,r,c)),s||(m=!0)}function _(){c&&us(n,g),d=!1}return zo(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),_()),!d)return!1;if(m){const S=k-a,$=0+1*r(S/o);f($,1-$)}return!0}),h(),f(0,1),_}function D0(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,l=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,R_(n,l)}}function R_(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),l=i.transform==="none"?"":i.transform;n.style.transform=`${l} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let fs;function di(n){fs=n}function ws(){if(!fs)throw new Error("Function called outside component initialization");return fs}function Vt(n){ws().$$.on_mount.push(n)}function E0(n){ws().$$.after_update.push(n)}function Ss(n){ws().$$.on_destroy.push(n)}function rt(){const n=ws();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=N_(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ee(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const _l=[],te=[];let yl=[];const Br=[],q_=Promise.resolve();let Ur=!1;function j_(){Ur||(Ur=!0,q_.then(_a))}function Qt(){return j_(),q_}function Ke(n){yl.push(n)}function ye(n){Br.push(n)}const lr=new Set;let pl=0;function _a(){if(pl!==0)return;const n=fs;do{try{for(;pl<_l.length;){const e=_l[pl];pl++,di(e),A0(e.$$)}}catch(e){throw _l.length=0,pl=0,e}for(di(null),_l.length=0,pl=0;te.length;)te.pop()();for(let e=0;e<yl.length;e+=1){const t=yl[e];lr.has(t)||(lr.add(t),t())}yl.length=0}while(_l.length);for(;Br.length;)Br.pop()();Ur=!1,lr.clear(),di(n)}function A0(n){if(n.fragment!==null){n.update(),we(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Ke)}}function I0(n){const e=[],t=[];yl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),yl=e}let ql;function ba(){return ql||(ql=Promise.resolve(),ql.then(()=>{ql=null})),ql}function Xi(n,e,t){n.dispatchEvent(N_(`${e?"intro":"outro"}${t}`))}const oo=new Set;let ei;function re(){ei={r:0,c:[],p:ei}}function ae(){ei.r||we(ei.c),ei=ei.p}function A(n,e){n&&n.i&&(oo.delete(n),n.i(e))}function I(n,e,t,i){if(n&&n.o){if(oo.has(n))return;oo.add(n),ei.c.push(()=>{oo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ya={duration:0};function H_(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&us(n,o)}function f(){const{delay:d=0,duration:m=300,easing:g=vs,tick:h=Q,css:_}=l||ya;_&&(o=as(n,0,1,m,d,g,_,a++)),h(0,1);const k=Ho()+d,S=k+m;r&&r.abort(),s=!0,Ke(()=>Xi(n,!0,"start")),r=zo($=>{if(s){if($>=S)return h(1,0),Xi(n,!0,"end"),u(),s=!1;if($>=k){const T=g(($-k)/m);h(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,us(n),$t(l)?(l=l(i),ba().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function ka(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=ei;r.r+=1;let a;function u(){const{delay:f=0,duration:c=300,easing:d=vs,tick:m=Q,css:g}=l||ya;g&&(o=as(n,1,0,c,f,d,g));const h=Ho()+f,_=h+c;Ke(()=>Xi(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),zo(k=>{if(s){if(k>=_)return m(0,1),Xi(
2023-11-26 19:33:17 +08:00
`),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=j.parseIndex(e);return i.tableName=t,j.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=j.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?j.buildIndex(l):e}static normalizeSearchFilter(e,t){if(e=(e||"").trim(),!e||!t.length)return e;const i=["=","!=","~","!~",">",">=","<","<="];for(const l of i)if(e.includes(l))return e;return e=isNaN(e)&&e!="true"&&e!="false"?`"${e.replace(/^[\"\'\`]|[\"\'\`]$/gm,"")}"`:e,t.map(l=>`${l}~${e}`).join("||")}static normalizeLogsFilter(e,t=[]){return j.normalizeSearchFilter(e,["level","message","data"].concat(t))}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)}static triggerResize(){window.dispatchEvent(new Event("resize"))}static getHashQueryParams(){let e="";const t=window.location.hash.indexOf("?");return t>-1&&(e=window.location.hash.substring(t+1)),Object.fromEntries(new URLSearchParams(e))}static replaceHashQueryParams(e){e=e||{};let t="",i=window.location.hash;const l=i.indexOf("?");l>-1&&(t=i.substring(l+1),i=i.substring(0,l));const s=new URLSearchParams(t);for(let a in e){const u=e[a];u===null?s.delete(a):s.set(a,u)}t=s.toString(),t!=""&&(i+="?"+t);let o=window.location.href;const r=o.indexOf("#");r>-1&&(o=o.substring(0,r)),window.location.replace(o+i)}}const Jo=Dn([]);function To(n,e=4e3){return Zo(n,"info",e)}function It(n,e=3e3){return Zo(n,"success",e)}function hi(n,e=4500){return Zo(n,"error",e)}function av(n,e=4500){return Zo(n,"warning",e)}function Zo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{J1(i)},t)};Jo.update(l=>(Ia(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function J1(n){Jo.update(e=>(Ia(e,n),e))}function Aa(){Jo.update(n=>{for(let e of n)Ia(n,e);return[]})}function Ia(n,e){let t;typeof e=="string"?t=j.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),j.removeByKey(n,"message",t.message))}const gi=Dn({});function Gt(n){gi.set(n||{})}function ii(n){gi.update(e=>(j.deleteByPath(e,n),e))}const La=Dn({});function Qr(n){La.set(n||{})}const zn=Dn([]),li=Dn({}),$o=Dn(!1),Z1=Dn({});function uv(n){zn.update(e=>{const t=j.findByKey(e,"id",n);return t?li.set(t):e.length&&li.set(e[0]),e})}function fv(n){li.update(e=>j.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),zn.update(e=>(j.pushOrReplaceByKey(e,n,"id"),Pa(),j.sortCollections(e)))}function cv(n){zn.update(e=>(j.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e[0]:t),Pa(),e))}async function dv(n=null){$o.set(!0);try{let e=await fe.collections.getFullList(200,{sort:"+name"});e=j.sortCollections(e),zn.set(e);const t=n&&j.findByKey(e,"id",n);t?li.set(t):e.length&&li.set(e[0]),Pa()}catch(e){fe.error(e)}$o.set(!1)}function Pa(){Z1.update(n=>(zn.update(e=>{var t;for(let i of e)n[i.id]=!!((t=i.schema)!=null&&t.find(l=>{var s;return l.type=="file"&&((s=l.options)==null?void 0:s.protected)}));return e}),n))}const mr="pb_admin_file_token";Uo.prototype.logout=function(n=!0){this.authStore.clear(),n&&il("/login")};Uo.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,l=(n==null?void 0:n.data)||{},s=l.message||n.message||t;if(e&&s&&hi(s),j.isEmpty(l.data)||Gt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),il("/")};Uo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=b0(Z1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(mr)||"";return(!t||va(t,10))&&(t&&localStorage.removeItem(mr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(mr,t),this._adminFileTokenRequest=null),t};class pv extends K_{save(e,t){super.s
2023-11-26 19:33:17 +08:00
transform: ${u} translate(${(1-h)*c}${d}, ${(1-h)*m}${g});
opacity: ${a-f*_}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Go,axis:l="y"}={}){const s=getComputedStyle(n),o=+s.opacity,r=l==="y"?"height":"width",a=parseFloat(s[r]),u=l==="y"?["top","bottom"]:["left","right"],f=u.map(k=>`${k[0].toUpperCase()}${k.slice(1)}`),c=parseFloat(s[`padding${f[0]}`]),d=parseFloat(s[`padding${f[1]}`]),m=parseFloat(s[`margin${f[0]}`]),g=parseFloat(s[`margin${f[1]}`]),h=parseFloat(s[`border${f[0]}Width`]),_=parseFloat(s[`border${f[1]}Width`]);return{delay:e,duration:t,easing:i,css:k=>`overflow: hidden;opacity: ${Math.min(k*20,1)*o};${r}: ${k*a}px;padding-${u[0]}: ${k*c}px;padding-${u[1]}: ${k*d}px;margin-${u[0]}: ${k*m}px;margin-${u[1]}: ${k*g}px;border-${u[0]}-width: ${k*h}px;border-${u[1]}-width: ${k*_}px;`}}function Yt(n,{delay:e=0,duration:t=400,easing:i=Go,start:l=0,opacity:s=0}={}){const o=getComputedStyle(n),r=+o.opacity,a=o.transform==="none"?"":o.transform,u=1-l,f=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>`
2023-11-26 19:33:17 +08:00
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let xr,Hi;const ea="app-tooltip";function Vu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ai(){return Hi=Hi||document.querySelector("."+ea),Hi||(Hi=document.createElement("div"),Hi.classList.add(ea),document.body.appendChild(Hi)),Hi}function X1(n,e){let t=Ai();if(!t.classList.contains("active")||!(e!=null&&e.text)){ta();return}t.textContent=e.text,t.className=ea+" 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,l=t.offsetWidth,s=n.getBoundingClientRect(),o=0,r=0,a=5;e.position=="left"?(o=s.top+s.height/2-i/2,r=s.left-l-a):e.position=="right"?(o=s.top+s.height/2-i/2,r=s.right+a):e.position=="top"?(o=s.top-i-a,r=s.left+s.width/2-l/2):e.position=="top-left"?(o=s.top-i-a,r=s.left):e.position=="top-right"?(o=s.top-i-a,r=s.right-l):e.position=="bottom-left"?(o=s.top+s.height+a,r=s.left):e.position=="bottom-right"?(o=s.top+s.height+a,r=s.right-l):(o=s.top+s.height+a,r=s.left+s.width/2-l/2),r+l>document.documentElement.clientWidth&&(r=document.documentElement.clientWidth-l),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 ta(){clearTimeout(xr),Ai().classList.remove("active"),Ai().activeNode=void 0}function kv(n,e){Ai().activeNode=n,clearTimeout(xr),xr=setTimeout(()=>{Ai().classList.add("active"),X1(n,e)},isNaN(e.delay)?0:e.delay)}function Pe(n,e){let t=Vu(e);function i(){kv(n,t)}function l(){ta()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&j.isFocusable(n))&&n.addEventListener("click",l),Ai(),{update(s){var o,r;t=Vu(s),(r=(o=Ai())==null?void 0:o.activeNode)!=null&&r.contains(n)&&X1(n,t)},destroy(){var s,o;(o=(s=Ai())==null?void 0:s.activeNode)!=null&&o.contains(n)&&ta(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Bu(n,e,t){const i=n.slice();return i[12]=e[t],i}const vv=n=>({}),Uu=n=>({uniqueId:n[4]});function wv(n){let e,t,i=pe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Wu(Bu(n,i,o));const s=o=>I(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ke()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&8){i=pe(o[3]);let a;for(a=0;a<i.length;a+=1){const u=Bu(o,i,a);l[a]?(l[a].p(u,r),A(l[a],1)):(l[a]=Wu(u),l[a].c(),A(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)I(l[r]);t=!1},d(o){o&&v(e),at(l,o)}}}function Sv(n){let e,t,i,l,s,o,r;return{c(){e=b("div"),t=b("i"),p(t,"class","ri-error-warning-fill txt-danger"),p(e,"class","form-field-addon inline-error-icon")},m(a,u){w(a,e,u),y(e,t),s=!0,o||(r=ve(i=Pe.call(null,t,{position:"left",text:n[3].map(Co).join(`
`)})),o=!0)},p(a,u){i&&$t(i.update)&&u&8&&i.update.call(null,{position:"left",text:a[3].map(Co).join(`
`)})},i(a){s||(a&&Ke(()=>{s&&(l||(l=Le(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Le(t,Yt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&v(e),a&&l&&l.end(),o=!1,r()}}}function Wu(n){let e,t,i=Co(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=Y(i),s=M(),p(e,"class","help-block help-block-error")},m(a,u){w(a,e,u),y(e,t),y(t,l),y(e,s),r=!0},p(a,u){(!r||u&8)&&i!==(i=Co(a[12])+"")&&se(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Le(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Le(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function Tv(n){let e,t,i,l,s,o,r;const a=n[9].default,u=vt(a,n,n[8],Uu),f=[Sv,wv],c=[];function d(m,g){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=f[i](n),{c(){e=b("div"),u&&u.c(),t=M(),l.c(),p(e,"class",n[1]),x(e,"error",n[3].length)},m(m,g){w(m,e,g),u&&u.m(e,null),y(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=K(e,"click",n[10]),o=!0)},p(m,[g]){u&&u.p&&(!s||g&256)&&St(u,a,m,m[8],s?wt(a,m[8],g,vv):Tt(m[8]),Uu);let h=i;i=d(m),i===h?c[i].p(m,g):(re(),I(c[h],1,1,()=>{c[h]=null}),ae(),l=c[i],l?l.p(m,g):(l=c[i]=f[i](m),l.c()),A(l,1),l.m(e,null)),(!s||g&2)&&p(e,"class",m[1]),(!s||g&10)&&x(e,"error",m[3].length)},i(m){s||(A(u,m),A(l),s=!0)},o(m){I(u,m),I(l),s=!1},d(m){m&&v(e),u&&u.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Yu="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Yu:n||Yu}function $v(n,e,t){let i;We(n,gi,h=>t(7,i=h));let{$$slots:l={},$$scope:s}=e;const o="field_"+j.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:u=void 0}=e,f,c=[];function d(){ii(r)}Vt(()=>(f.addEventListener("input",d),f.addEventListener("change",d),()=>{f.removeEventListener("input",d),f.removeEventListener("change",d)}));function m(h){Ee.call(this,n,h)}function g(h){te[h?"unshift":"push"](()=>{f=h,t(2,f)})}return n.$$set=h=>{"name"in h&&t(5,r=h.name),"inlineError"in h&&t(0,a=h.inlineError),"class"in h&&t(1,u=h.class),"$$scope"in h&&t(8,s=h.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=j.toArray(j.getNestedVal(i,r)))},[a,u,f,c,o,r,d,i,s,l,m,g]}class me extends _e{constructor(e){super(),ge(this,e,$v,Tv,he,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function Cv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Email"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","email"),p(s,"autocomplete","off"),p(s,"id",o=n[9]),s.required=!0,s.autofocus=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0]),s.focus(),r||(a=K(s,"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(s,"id",o),f&1&&s.value!==u[0]&&ue(s,u[0])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Mv(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Password"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Minimum 10 characters.",p(e,"for",i=n[9]),p(s,"type","password"),p(s,"autocomplete","new-password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[1]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&2&&s.value!==c[1]&&ue(s,c[1])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function Ov(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Password confirm"),l=M(),s=b("input"),p(e,"for",i=n[9]),p(s,"type","password"),p(s,"minlength","10"),p(s,"id",o=n[9]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ue(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function Dv(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return l=new me({props:{class:"form-field required",name:"email",$$slots:{default:[Cv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[Mv,({uniqueId:g})=>({9:g}),({uniqueId:g})=>g?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm",
2023-11-26 19:33:17 +08:00
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function Ds(n){return n+.5|0}const $i=(n,e,t)=>Math.max(Math.min(n,t),e);function Xl(n){return $i(Ds(n*2.55),0,255)}function Ii(n){return $i(Ds(n*255),0,255)}function fi(n){return $i(Ds(n/2.55)/100,0,1)}function mf(n){return $i(Ds(n*100),0,100)}const In={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},na=[..."0123456789ABCDEF"],u2=n=>na[n&15],f2=n=>na[(n&240)>>4]+na[n&15],Hs=n=>(n&240)>>4===(n&15),c2=n=>Hs(n.r)&&Hs(n.g)&&Hs(n.b)&&Hs(n.a);function d2(n){var e=n.length,t;return n[0]==="#"&&(e===4||e===5?t={r:255&In[n[1]]*17,g:255&In[n[2]]*17,b:255&In[n[3]]*17,a:e===5?In[n[4]]*17:255}:(e===7||e===9)&&(t={r:In[n[1]]<<4|In[n[2]],g:In[n[3]]<<4|In[n[4]],b:In[n[5]]<<4|In[n[6]],a:e===9?In[n[7]]<<4|In[n[8]]:255})),t}const p2=(n,e)=>n<255?e(n):"";function m2(n){var e=c2(n)?u2:f2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+p2(n.a,e):void 0}const h2=/^(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),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function g2(n,e,t){const i=(l,s=(l+n/60)%6)=>t-t*e*Math.max(Math.min(s,4-s,1),0);return[i(5),i(3),i(1)]}function _2(n,e,t){const i=eb(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function b2(n,e,t,i,l){return n===l?(e-t)/i+(e<t?6:0):e===l?(t-n)/i+2:(n-e)/i+4}function Fa(n){const t=n.r/255,i=n.g/255,l=n.b/255,s=Math.max(t,i,l),o=Math.min(t,i,l),r=(s+o)/2;let a,u,f;return s!==o&&(f=s-o,u=r>.5?f/(2-s-o):f/(s+o),a=b2(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Na(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ii)}function Ra(n,e,t){return Na(eb,n,e,t)}function y2(n,e,t){return Na(_2,n,e,t)}function k2(n,e,t){return Na(g2,n,e,t)}function tb(n){return(n%360+360)%360}function v2(n){const e=h2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Xl(+e[5]):Ii(+e[5]));const l=tb(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=y2(l,s,o):e[1]==="hsv"?i=k2(l,s,o):i=Ra(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function w2(n,e){var t=Fa(n);t[0]=tb(t[0]+e),t=Ra(t),n.r=t[0],n.g=t[1],n.b=t[2]}function S2(n){if(!n)return;const e=Fa(n),t=e[0],i=mf(e[1]),l=mf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const hf={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"},gf={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-11-26 19:33:17 +08:00
* Chart.js v4.4.0
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function ri(){}const A2=(()=>{let n=0;return()=>n++})();function yt(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 it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function jt(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function vn(n,e){return jt(n)?n:e}function ht(n,e){return typeof n>"u"?e:n}const I2=(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 gt(n,e,t,i){let l,s,o;if(Ot(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;l<s;l++)e.call(t,n[l],l);else if(it(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function Oo(n,e){let t,i,l,s;if(!n||!e||n.length!==e.length)return!1;for(t=0,i=n.length;t<i;++t)if(l=n[t],s=e[t],l.datasetIndex!==s.datasetIndex||l.index!==s.index)return!1;return!0}function Do(n){if(Ot(n))return n.map(Do);if(it(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=Do(n[t[l]]);return e}return n}function ib(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function L2(n,e,t,i){if(!ib(n))return;const l=e[n],s=t[n];it(l)&&it(s)?ps(l,s,i):e[n]=Do(s)}function ps(n,e,t){const i=Ot(e)?e:[e],l=i.length;if(!it(n))return n;t=t||{};const s=t.merger||L2;let o;for(let r=0;r<l;++r){if(o=i[r],!it(o))continue;const a=Object.keys(o);for(let u=0,f=a.length;u<f;++u)s(a[u],n,o,t)}return n}function ns(n,e){return ps(n,e,{merger:P2})}function P2(n,e,t){if(!ib(n))return;const i=e[n],l=t[n];it(i)&&it(l)?ns(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Do(l))}const bf={"":n=>n,x:n=>n.x,y:n=>n.y};function F2(n){const e=n.split("."),t=[];let i="";for(const l of e)i+=l,i.endsWith("\\")?i=i.slice(0,-1)+".":(t.push(i),i="");return t}function N2(n){const e=F2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Ml(n,e){return(bf[e]||(bf[e]=N2(e)))(n)}function qa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const ms=n=>typeof n<"u",Li=n=>typeof n=="function",yf=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function R2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const xt=Math.PI,On=2*xt,q2=On+xt,Eo=Number.POSITIVE_INFINITY,j2=xt/180,$n=xt/2,zi=xt/4,kf=xt*2/3,Ci=Math.log10,ti=Math.sign;function is(n,e,t){return Math.abs(n-e)<t}function vf(n){const e=Math.round(n);n=is(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Ci(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function H2(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((l,s)=>l-s).pop(),e}function Ao(n){return!isNaN(parseFloat(n))&&isFinite(n)}function z2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function lb(n,e,t){let i,l,s;for(i=0,l=n.length;i<l;i++)s=n[i][t],isNaN(s)||(e.min=Math.min(e.min,s),e.max=Math.max(e.max,s))}function Mi(n){return n*(xt/180)}function ja(n){return n*(180/xt)}function wf(n){if(!jt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function V2(n,e){const t=e.x-n.x,i=e.y-n.y,l=Math.sqrt(t*t+i*i);let s=Math.atan2(i,t);return s<-.5*xt&&(s+=On),{angle:s,distance:l}}function ia(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function B2(n,e){return(n-e+q2)%On-xt}function Sn(n){return(n%On+On)%On}function sb(n,e,t,i){const l=Sn(n),s=Sn(e),o=Sn(t),r=Sn(s-l),a=Sn(o-l),u=Sn(l-s),f=Sn(l-o);return l===s||l===o||i&&s===o||r>a&&u<f}function Kn(n,e,t){return Math.max(e,Math.min(t,n))}function U2(n){return Kn(n,-32768,32767)}function Io(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ha(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const la=(n,e,t,i)=>Ha(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),W2=(n,e,t)=>Ha(n,t,i=>n[i][e]>=t);function Y2(n,e,t){let i=0,l=n.length;for(;i<l&&n
2023-11-26 19:33:17 +08:00
* Chart.js v4.4.0
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class Qw{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(e,t,i,l){const s=t.listeners[l],o=t.duration;s.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=ab.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(e=Date.now()){let t=0;this._charts.forEach((i,l)=>{if(!i.running||!i.items.length)return;const s=i.items;let o=s.length-1,r=!1,a;for(;o>=0;--o)a=s[o],a._active?(a._total>i.duration&&(i.duration=a._total),a.tick(e),r=!0):(s[o]=s[s.length-1],s.pop());r&&(l.draw(),this._notify(l,i,e,"progress")),s.length||(i.running=!1,this._notify(l,i,e,"complete"),i.initial=!1),t+=s.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,l)=>Math.max(i,l._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 l=i.length-1;for(;l>=0;--l)i[l].cancel();t.items=[],this._notify(e,t,Date.now(),"complete")}remove(e){return this._charts.delete(e)}}var ai=new Qw;const qf="transparent",xw={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=Mf(n||qf),l=i.valid&&Mf(e||qf);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class e3{constructor(e,t,i,l){const s=t[i];l=Us([e.to,l,s,e.from]);const o=Us([e.from,s,l]);this._active=!0,this._fn=e.fn||xw[e.type||typeof o],this._easing=ls[e.easing]||ls.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=l,this._promises=void 0}active(){return this._active}update(e,t,i){if(this._active){this._notify(!1);const l=this._target[this._prop],s=i-this._start,o=this._duration-s;this._start=i,this._duration=Math.floor(Math.max(o,e.duration)),this._total+=s,this._loop=!!e.loop,this._to=Us([e.to,t,l,e.from]),this._from=Us([e.from,l,t])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(e){const t=e-this._start,i=this._duration,l=this._prop,s=this._from,o=this._loop,r=this._to;let a;if(this._active=s!==r&&(o||t<i),!this._active){this._target[l]=r,this._notify(!0);return}if(t<0){this._target[l]=s;return}a=t/i%2,a=o&&a>1?2-a:a,a=this._easing(Math.min(1,Math.max(0,a))),this._target[l]=this._fn(s,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 l=0;l<i.length;l++)i[l][t]()}}class wb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!it(e))return;const t=Object.keys(zt.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Ot(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=n3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&t3(e.options.$animations,i).then(()=>{e.options=i},()=>{}),s}_createAnimations(e,t){const i=this._properties,l=[],s=e.$animations||(e.$animations={}),o=Object.keys(t),r=Date.now();let a;for(a=o.length-1;a>=0;--a){const u=o[a];if(u.charAt(0)==="$")continue;if(u==="options"){l.push(...this._animateOptions(e,t));continue}const f=t[u];let c=s[u];const d=i.get(u);if(c)if(d&&c.active()){c.update(d,f,r);continue}else c.cancel();if(!d||!d.duration){e[u]=f;continue}s[u]=c=new e3(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size
2023-11-26 19:33:17 +08:00
`)>-1?n.split(`
`):n}function cS(n,e){const{element:t,datasetIndex:i,index:l}=e,s=n.getDatasetMeta(i).controller,{label:o,value:r}=s.getLabelAndValue(l);return{chart:n,label:o,parsed:s.getParsed(l),raw:n.data.datasets[i].data[l],formattedValue:r,dataset:s.getDataset(),dataIndex:l,datasetIndex:i,element:t}}function bc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=Cn(e.bodyFont),u=Cn(e.titleFont),f=Cn(e.footerFont),c=s.length,d=l.length,m=i.length,g=Hn(e.padding);let h=g.height,_=0,k=i.reduce((T,C)=>T+C.before.length+C.lines.length+C.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(h+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;h+=m*T+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(h+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const $=function(T){_=Math.max(_,t.measureText(T).width+S)};return t.save(),t.font=u.string,gt(n.title,$),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),$),S=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,$),gt(T.lines,$),gt(T.after,$)}),S=0,t.font=f.string,gt(n.footer,$),t.restore(),_+=g.width,{width:_,height:h}}function dS(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function pS(n,e,t,i){const{x:l,width:s}=i,o=t.caretSize+t.caretPadding;if(n==="left"&&l+s+o>e.width||n==="right"&&l-s-o<0)return!0}function mS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let u="center";return i==="center"?u=l<=(r+a)/2?"left":"right":l<=s/2?u="left":l>=o-s/2&&(u="right"),pS(u,n,e,t)&&(u="center"),u}function yc(n,e,t){const i=t.yAlign||e.yAlign||dS(n,t);return{xAlign:t.xAlign||e.xAlign||mS(n,e,t,i),yAlign:i}}function hS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function gS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function kc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,u=l+s,{topLeft:f,topRight:c,bottomLeft:d,bottomRight:m}=vl(o);let g=hS(e,r);const h=gS(e,a,u);return a==="center"?r==="left"?g+=u:r==="right"&&(g-=u):r==="left"?g-=Math.max(f,d)+l:r==="right"&&(g+=Math.max(c,m)+l),{x:Kn(g,0,i.width-e.width),y:Kn(h,0,i.height-e.height)}}function xs(n,e,t){const i=Hn(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function vc(n){return Qn([],ui(n))}function _S(n,e,t){return Fi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function wc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Hb={beforeTitle:ri,title(n){if(n.length>0){const e=n[0],t=e.chart.data.labels,i=t?t.length:0;if(this&&this.options&&this.options.mode==="dataset")return e.dataset.label||"";if(e.label)return e.label;if(i>0&&e.dataIndex<i)return t[e.dataIndex]}return""},afterTitle:ri,beforeBody:ri,beforeLabel:ri,label(n){if(this&&this.options&&this.options.mode==="dataset")return n.label+": "+n.formattedValue||n.formattedValue;let e=n.dataset.label||"";e&&(e+=": ");const t=n.formattedValue;return yt(t)||(e+=t),e},labelColor(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{borderColor:t.borderColor,backgroundColor:t.backgroundColor,borderWidth:t.borderWidth,borderDash:t.borderDash,borderDashOffset:t.borderDashOffset,borderRadius:0}},labelTextColor(){return this.options.bodyColor},labelPointStyle(n){const t=n.chart.getDatasetMeta(n.datasetIndex).controller.getStyle(n.dataIndex);return{pointStyle:t.pointStyle,rotation:t.rotation}},afterLabel:ri,afterBody:ri,beforeFooter:ri,footer:ri,afterFooter:ri};function dn(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?Hb[e].call(t,i):l}class fa extends As{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,this.options=e.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void
2023-11-26 19:33:17 +08:00
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const zS={datetime:He.DATETIME_MED_WITH_SECONDS,millisecond:"h:mm:ss.SSS a",second:He.TIME_WITH_SECONDS,minute:He.TIME_SIMPLE,hour:{hour:"numeric"},day:{day:"numeric",month:"short"},week:"DD",month:{month:"short",year:"numeric"},quarter:"'Q'q - yyyy",year:{year:"numeric"}};$b._date.override({_id:"luxon",_create:function(n){return He.fromMillis(n,this.options)},init(n){this.options.locale||(this.options.locale=n.locale)},formats:function(){return zS},parse:function(n,e){const t=this.options,i=typeof n;return n===null||i==="undefined"?null:(i==="number"?n=this._create(n):i==="string"?typeof e=="string"?n=He.fromFormat(n,e,t):n=He.fromISO(n,t):n instanceof Date?n=He.fromJSDate(n,t):i==="object"&&!(n instanceof He)&&(n=He.fromObject(n,t)),n.isValid?n.valueOf():null)},format:function(n,e){const t=this._create(n);return typeof e=="string"?t.toFormat(e):t.toLocaleString(e)},add:function(n,e,t){const i={};return i[t]=e,this._create(n).plus(i).valueOf()},diff:function(n,e,t){return this._create(n).diff(this._create(e)).as(t).valueOf()},startOf:function(n,e,t){if(e==="isoWeek"){t=Math.trunc(Math.min(Math.max(0,t),6));const i=this._create(n);return i.minus({days:(i.weekday-t+7)%7}).startOf("day").valueOf()}return e?this._create(n).startOf(e).valueOf():n},endOf:function(n,e){return this._create(n).endOf(e).valueOf()}});function Fc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function VS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c=n[2]&&Fc();return{c(){e=b("div"),t=b("div"),i=Y("Found "),l=Y(n[1]),s=M(),r=Y(o),a=M(),c&&c.c(),u=M(),f=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),x(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),x(e,"loading",n[2])},m(d,m){w(d,e,m),y(e,t),y(t,i),y(t,l),y(t,s),y(t,r),y(e,a),c&&c.m(e,null),y(e,u),y(e,f),n[8](f)},p(d,[m]){m&2&&se(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&se(r,o),m&4&&x(t,"hidden",d[2]),d[2]?c?m&4&&A(c,1):(c=Fc(),c.c(),A(c,1),c.m(e,u)):c&&(re(),I(c,1,1,()=>{c=null}),ae()),m&4&&x(e,"loading",d[2])},i(d){A(c)},o(d){I(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function BS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,u=!1;async function f(){return t(2,u=!0),fe.logs.getStats({filter:[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&")}).then(m=>{c();for(let g of m)r.push({x:new Date(g.date),y:g.total}),t(1,a+=g.total)}).catch(m=>{m!=null&&m.isAbort||(c(),console.warn(m),fe.error(m,(m==null?void 0:m.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(7,r=[]),t(1,a=0)}Vt(()=>(ci.register(co,ho,ca,da,_s,fS,bS),t(6,o=new ci(s,{type:"bar",data:{datasets:[{label:"Total requests",data:r,backgroundColor:"#e34562",maxBarThickness:40,borderRadius:2,minBarLength:7,hoverBackgroundColor:"#e34562"}]},options:{resizeDelay:250,maintainAspectRatio:!1,animation:!1,interaction:{intersect:!1,mode:"index"},scales:{y:{beginAtZero:!0,grid:{color:"#edf0f3"},border:{color:"#e4e9ec"},ticks:{precision:0,maxTicksLimit:4,autoSkip:!0,color:"#666f75"}},x:{type:"time",time:{unit:"hour",tooltipFormat:"DD h a"},grid:{color:m=>{var g;return(g=m.tick)!=null&&g.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var g;return(g=m.tick)!=null&&g.major?"#16161a":"#666f75"}}}},plugins:{legend:{display:!1}}}})),()=>o==null?void 0:o.destroy()));function d(m){te[m?"unshift":"push"](()=>{s=m,t(0,s)})}return n.$$set=m=>{"filter"in m&&t(3,i=m.filter),"presets"in m&&t(4,l=m.presets)},n.$$.update=()=>{n.$$.dirty&24&&(typeof i<"u"||typeof l<"u")&&f(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,u,i,l,f,o,r,d]}class US extends _e{constructor(e){super(),ge(this,e,BS,VS,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Nc=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?gl
2023-11-26 19:33:17 +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 l=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,s=0,o={},r={manual:i.Prism&&i.Prism.manual,disableWorkerMessageHandler:i.Prism&&i.Prism.disableWorkerMessageHandler,util:{encode:function S($){return $ instanceof a?new a($.type,S($.content),$.alias):Array.isArray($)?$.map(S):$.replace(/&/g,"&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:++s}),S.__id},clone:function S($,T){T=T||{};var C,D;switch(r.util.type($)){case"Object":if(D=r.util.objId($),T[D])return T[D];C={},T[D]=C;for(var O in $)$.hasOwnProperty(O)&&(C[O]=S($[O],T));return C;case"Array":return D=r.util.objId($),T[D]?T[D]:(C=[],T[D]=C,$.forEach(function(E,L){C[L]=S(E,T)}),C);default:return $}},getLanguage:function(S){for(;S;){var $=l.exec(S.className);if($)return $[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,$){S.className=S.className.replace(RegExp(l,"gi"),""),S.classList.add("language-"+$)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(C){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(S){var $=document.getElementsByTagName("script");for(var T in $)if($[T].src==S)return $[T]}return null}},isActive:function(S,$,T){for(var C="no-"+$;S;){var D=S.classList;if(D.contains($))return!0;if(D.contains(C))return!1;S=S.parentElement}return!!T}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,$){var T=r.util.clone(r.languages[S]);for(var C in $)T[C]=$[C];return T},insertBefore:function(S,$,T,C){C=C||r.languages;var D=C[S],O={};for(var E in D)if(D.hasOwnProperty(E)){if(E==$)for(var L in T)T.hasOwnProperty(L)&&(O[L]=T[L]);T.hasOwnProperty(E)||(O[E]=D[E])}var R=C[S];return C[S]=O,r.languages.DFS(r.languages,function(P,F){F===R&&P!=S&&(this[P]=O)}),O},DFS:function S($,T,C,D){D=D||{};var O=r.util.objId;for(var E in $)if($.hasOwnProperty(E)){T.call($,E,$[E],C||E);var L=$[E],R=r.util.type(L);R==="Object"&&!D[O(L)]?(D[O(L)]=!0,S(L,T,null,D)):R==="Array"&&!D[O(L)]&&(D[O(L)]=!0,S(L,T,E,D))}}},plugins:{},highlightAll:function(S,$){r.highlightAllUnder(document,S,$)},highlightAllUnder:function(S,$,T){var C={callback:T,container:S,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};r.hooks.run("before-highlightall",C),C.elements=Array.prototype.slice.apply(C.container.querySelectorAll(C.selector)),r.hooks.run("before-all-elements-highlight",C);for(var D=0,O;O=C.elements[D++];)r.highlightElement(O,$===!0,C.callback)},highlightElement:function(S,$,T){var C=r.util.getLanguage(S),D=r.languages[C];r.util.setLanguage(S,C);var O=S.parentElement;O&&O.nodeName.toLowerCase()==="pre"&&r.util.setLanguage(O,C);var E=S.textContent,L={element:S,language:C,grammar:D,code:E};function R(F){L.highlightedCode=F,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),T&&T.call(L.element)}if(r.hooks.run("before-sanity-check",L),O=L.element.parentElement,O&&O.nodeName.toLowerCase()==="pre"&&!O.hasAttribute("tabindex")&&O.setAttribute("tabindex","0"),!L.code){r.hooks.run("complete",L),T&&T.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){R(r.util.encode(L.code));return}if($&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(F){R(F.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else R(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,$,T){var C={code:S,grammar:$,language:T};if(r.hooks.run("before-tokenize",C),!C.grammar)throw new Error('The language "'+C.language+'" has no grammar.');return C.tokens=r.tokenize(C.code,C.grammar),r.hooks.run("after-tokenize",C),a.stringify(r.util.encode(C.tokens),C.language)},tokenize:function(S,$){var T=$.rest;if(T){for(var C in T)$[C]=T[C];delete $.rest}var D=new c;return d(D,D.head,S),f(S,D,$,D.head,0),g(D)},hooks:{all:{},add:function
`),_.hasAttribute("data-start")||_.setAttribute("data-start",String(L+1))}k.textContent=D,t.highlightElement(k)},function(D){_.setAttribute(r,f),k.textContent=D})}}),t.plugins.fileHighlight={highlight:function(_){for(var k=(_||document).querySelectorAll(c),S=0,$;$=k[S++];)t.highlightElement($)}};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)}}()})(Vb);var YS=Vb.exports;const Jl=WS(YS);var KS={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 l(o){for(var r=0,a=0;a<o.length;++a)o.charCodeAt(a)==" ".charCodeAt(0)&&(r+=3);return o.length+r}var s={"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-11-26 19:33:17 +08:00
`),u=0;u<a.length;++u)if(!(l(a[u])<=r)){for(var f=a[u].split(/(\s+)/g),c=0,d=0;d<f.length;++d){var m=l(f[d]);c+=m,c>r&&(f[d]=`
`+f[d],c=m)}a[u]=f.join("")}return a.join(`
`)}},n.exports&&(n.exports=t),Prism.plugins.NormalizeWhitespace=new t({"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Prism.hooks.add("before-sanity-check",function(o){var r=Prism.plugins.NormalizeWhitespace;if(!(o.settings&&o.settings["whitespace-normalization"]===!1)&&Prism.util.isActive(o.element,"whitespace-normalization",!0)){if((!o.element||!o.element.parentNode)&&o.code){o.code=r.normalize(o.code,o.settings);return}var a=o.element.parentNode;if(!(!o.code||!a||a.nodeName.toLowerCase()!=="pre")){o.settings==null&&(o.settings={});for(var u in s)if(Object.hasOwnProperty.call(s,u)){var f=s[u];if(a.hasAttribute("data-"+u))try{var c=JSON.parse(a.getAttribute("data-"+u)||"true");typeof c===f&&(o.settings[u]=c)}catch{}}for(var d=a.childNodes,m="",g="",h=!1,_=0;_<d.length;++_){var k=d[_];k==o.element?h=!0:k.nodeName==="#text"&&(h?g+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--_)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+g,o.code=r.normalize(o.code,o.settings);else{var S=m+o.element.innerHTML+g;o.element.innerHTML=r.normalize(S,o.settings),o.code=o.element.textContent}}}})})()})(KS);(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 JS(n){let e,t,i;return{c(){e=b("div"),t=b("code"),p(t,"class","svelte-10s5tkd"),p(e,"class",i="code-wrapper prism-light "+n[0]+" svelte-10s5tkd")},m(l,s){w(l,e,s),y(e,t),t.innerHTML=n[1]},p(l,[s]){s&2&&(t.innerHTML=l[1]),s&1&&i!==(i="code-wrapper prism-light "+l[0]+" svelte-10s5tkd")&&p(e,"class",i)},i:Q,o:Q,d(l){l&&v(e)}}}function ZS(n,e,t){let{class:i=""}=e,{content:l=""}=e,{language:s="javascript"}=e,o="";function r(a){return a=typeof a=="string"?a:"",a=Jl.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Jl.highlight(a,Jl.languages[s]||Jl.languages.javascript,s)}return n.$$set=a=>{"class"in a&&t(0,i=a.class),"content"in a&&t(2,l=a.content),"language"in a&&t(3,s=a.language)},n.$$.update=()=>{n.$$.dirty&4&&typeof Jl<"u"&&l&&t(1,o=r(l))},[i,o,l,s]}class Bb extends _e{constructor(e){super(),ge(this,e,ZS,JS,he,{class:0,content:2,language:3})}}const GS=n=>({}),Rc=n=>({}),XS=n=>({}),qc=n=>({});function jc(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$=n[4]&&!n[2]&&Hc(n);const T=n[19].header,C=vt(T,n,n[18],qc);let D=n[4]&&n[2]&&zc(n);const O=n[19].default,E=vt(O,n,n[18],null),L=n[19].footer,R=vt(L,n,n[18],Rc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),$&&$.c(),r=M(),C&&C.c(),a=M(),D&&D.c(),u=M(),f=b("div"),E&&E.c(),c=M(),d=b("div"),R&&R.c(),p(t,
`),i=b("div");for(let o=0;o<s.length;o+=1)s[o].c();p(i,"class","inline-flex flex-gap-5"),p(e,"class",n[0])},m(o,r){w(o,e,r),y(e,t),y(e,i);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(i,null)},p(o,[r]){r&1&&p(e,"class",o[0])},i:Q,o:Q,d(o){o&&v(e),at(s,o)}}}function gT(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class Wb extends _e{constructor(e){super(),ge(this,e,gT,hT,he,{class:0})}}function _T(n){let e,t,i,l,s,o,r,a,u;return t=new me({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[yT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[kT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[vT,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=M(),B(l.$$.fragment),s=M(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(f,c){w(f,e,c),z(t,e,null),y(e,i),z(l,e,null),y(e,s),z(o,e,null),r=!0,a||(u=K(e,"submit",Ye(n[7])),a=!0)},p(f,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:f}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:f}),l.$set(m);const g={};c&12582914&&(g.$$scope={dirty:c,ctx:f}),o.$set(g)},i(f){r||(A(t.$$.fragment,f),A(l.$$.fragment,f),A(o.$$.fragment,f),r=!0)},o(f){I(t.$$.fragment,f),I(l.$$.fragment,f),I(o.$$.fragment,f),r=!1},d(f){f&&v(e),V(t),V(l),V(o),a=!1,u()}}}function bT(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function yT(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max days retention"),l=M(),s=b("input"),r=M(),a=b("div"),a.innerHTML="Set to <code>0</code> to disable logs persistence.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),s.required=!0,p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[1].logs.maxDays),w(c,r,d),w(c,a,d),u||(f=K(s,"input",n[11]),u=!0)},p(c,d){d&4194304&&i!==(i=c[22])&&p(e,"for",i),d&4194304&&o!==(o=c[22])&&p(s,"id",o),d&2&&ut(s.value)!==c[1].logs.maxDays&&ue(s,c[1].logs.maxDays)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function kT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Wb({}),{c(){e=b("label"),t=Y("Min log level"),l=M(),s=b("input"),o=M(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",u=M(),B(f.$$.fragment),p(e,"for",i=n[22]),p(s,"type","number"),s.required=!0,p(s,"min","-100"),p(s,"max","100"),p(r,"class","help-block")},m(g,h){w(g,e,h),y(e,t),w(g,l,h),w(g,s,h),ue(s,n[1].logs.minLevel),w(g,o,h),w(g,r,h),y(r,a),y(r,u),z(f,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(g,h){(!c||h&4194304&&i!==(i=g[22]))&&p(e,"for",i),h&2&&ut(s.value)!==g[1].logs.minLevel&&ue(s,g[1].logs.minLevel)},i(g){c||(A(f.$$.fragment,g),c=!0)},o(g){I(f.$$.fragment,g),c=!1},d(g){g&&(v(e),v(l),v(s),v(o),v(r)),V(f),d=!1,m()}}}function vT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(u,f){w(u,e,f),e.checked=n[1].logs.logIp,w(u,i,f),w(u,l,f),y(l,s),r||(a=K(e,"change",n[13]),r=!0)},p(u,f){f&4194304&&t!==(t=u[22])&&p(e,"id",t),f&2&&(e.checked=u[1].logs.logIp),f&4194304&&o!==(o=u[22])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function wT(n){let e,t,i,l;const s=[bT,_T],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function ST(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function TT(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function N$(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[4](_)}let h={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(h.value=n[0].options.onlyDomains),r=new Fl({props:h}),te.push(()=>be(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[8]+".options.onlyDomains"),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Pe.call(null,l,{text:`List of domains that are ONLY allowed.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&256&&s!==(s=_[8]+".options.onlyDomains"))&&p(e,"for",s);const S={};k&256&&(S.id=_[8]+".options.onlyDomains"),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function R$(n){let e,t,i,l,s,o,r;return i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[F$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[N$,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,u){w(a,e,u),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,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){I(i.$$.fragment,a),I(o.$$.fragment,a),r=!1},d(a){a&&v(e),V(i),V(o)}}}function q$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[R$]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Fe(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(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){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function j$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(d){n.$$.not_equal(s.options.exceptDomains,d)&&(s.options.exceptDomains=d,t(0,s))}function a(d){n.$$.not_equal(s.options.onlyDomains,d)&&(s.options.onlyDomains=d,t(0,s))}function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Fe(Fe({},e),Kt(d)),t(2,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,l,r,a,u,f,c]}class Jb extends _e{constructor(e){super(),ge(this,e,j$,q$,he,{field:0,key:1})}}function H$(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[3](r)}let o={};for(let r=0;r<l.length;r+=1)o=Fe(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new Jb({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Ct(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){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function z$(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ee.call(this,n,f)}function u(f){Ee.call(this,n,f)}return n.$$set=f=>{e=Fe(Fe({},e),Kt(f)),t(2,l=Ze(e,i)),"field"in f&&t(0,s=f.field),"key"in f&&t(1,o=f.key)},[s,o,l,r,a,u]}class V$ extends _e{constructor(e){super(),ge(this,e,z$,H$,he,{field:0,key:1})}}function B$(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("input"),i=M(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[8]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[8])},m(c,d){w(c,e,d),e.checked=n[0].options.convertUrls,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[3]),ve(Pe.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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function U$
2023-11-26 19:33:17 +08:00
<span class='flatpickr-weekday'>
`+X.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function le(){t.calendarContainer.classList.add("hasWeeks");var Z=ct("div","flatpickr-weekwrapper");Z.appendChild(ct("span","flatpickr-weekday",t.l10n.weekAbbreviation));var X=ct("div","flatpickr-weeks");return Z.appendChild(X),{weekWrapper:Z,weekNumbers:X}}function ee(Z,X){X===void 0&&(X=!0);var ie=X?Z:Z-t.currentMonth;ie<0&&t._hidePrevMonthArrow===!0||ie>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=ie,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,bt("onYearChange"),N()),F(),bt("onMonthChange"),Jt())}function oe(Z,X){if(Z===void 0&&(Z=!0),X===void 0&&(X=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,X===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Fr(t.config),de=ie.hours,$e=ie.minutes,Ie=ie.seconds;m(de,$e,Ie)}t.redraw(),Z&&bt("onChange")}function Te(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),bt("onClose")}function je(){t.config!==void 0&&bt("onDestroy");for(var Z=t._handlers.length;Z--;)t._handlers[Z].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 X=t.calendarContainer.parentNode;if(X.lastChild&&X.removeChild(X.lastChild),X.parentNode){for(;X.firstChild;)X.parentNode.insertBefore(X.firstChild,X);X.parentNode.removeChild(X)}}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(ie){try{delete t[ie]}catch{}})}function Ve(Z){return t.calendarContainer.contains(Z)}function Qe(Z){if(t.isOpen&&!t.config.inline){var X=yn(Z),ie=Ve(X),de=X===t.input||X===t.altInput||t.element.contains(X)||Z.path&&Z.path.indexOf&&(~Z.path.indexOf(t.input)||~Z.path.indexOf(t.altInput)),$e=!de&&!ie&&!Ve(Z.relatedTarget),Ie=!t.config.ignoredFocusElements.some(function(Je){return Je.contains(X)});$e&&Ie&&(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 tt(Z){if(!(!Z||t.config.minDate&&Z<t.config.minDate.getFullYear()||t.config.maxDate&&Z>t.config.maxDate.getFullYear())){var X=Z,ie=t.currentYear!==X;t.currentYear=X||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)),ie&&(t.redraw(),bt("onYearChange"),N())}}function Ge(Z,X){var ie;X===void 0&&(X=!0);var de=t.parseDate(Z,void 0,X);if(t.config.minDate&&de&&kn(de,t.config.minDate,X!==void 0?X:!t.minDateHasTime)<0||t.config.maxDate&&de&&kn(de,t.config.maxDate,X!==void 0?X:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
2023-11-26 19:33:17 +08:00
`),r=b("code"),r.textContent="multipart/form-data",a=Y(`
requests, the following normalization rules are applied if the `),u=b("code"),u.textContent="json",f=Y(` field
is a
`),c=b("strong"),c.textContent="plain string",d=Y(`:
`),m=b("ul"),g=b("li"),g.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",h=M(),_=b("li"),_.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",k=M(),S=b("li"),S.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",$=M(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",C=M(),D=b("li"),E=Y(O),L=Y(" is converted to the json "),R=b("code"),R.textContent='{"a":1,"b":2}',P=M(),F=b("li"),F.textContent="numeric strings are converted to json number",N=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",W=M(),G=b("li"),G.textContent="any other string (empty string too) is double quoted",J=Y(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),H=b("code"),H.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,oe){w(ee,e,oe),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(m,g),y(m,h),y(m,_),y(m,k),y(m,S),y(m,$),y(m,T),y(m,C),y(m,D),y(D,E),y(D,L),y(D,R),y(m,P),y(m,F),y(m,N),y(m,q),y(m,W),y(m,G),y(i,J),y(i,H),le=!0},i(ee){le||(ee&&Ke(()=>{le&&(U||(U=Le(e,et,{duration:150},!0)),U.run(1))}),le=!0)},o(ee){ee&&(U||(U=Le(e,et,{duration:150},!1)),U.run(0)),le=!1},d(ee){ee&&v(e),ee&&U&&U.end()}}}function NC(n){let e,t,i,l,s,o,r;function a(d,m){return d[2]?FC:PC}let u=a(n),f=u(n),c=n[2]&&Nd();return{c(){e=b("button"),t=b("strong"),t.textContent="String value normalizations",i=M(),f.c(),l=M(),c&&c.c(),s=ke(),p(t,"class","txt"),p(e,"type","button"),p(e,"class","inline-flex txt-sm flex-gap-5 link-hint")},m(d,m){w(d,e,m),y(e,t),y(e,i),f.m(e,null),w(d,l,m),c&&c.m(d,m),w(d,s,m),o||(r=K(e,"click",n[4]),o=!0)},p(d,m){u!==(u=a(d))&&(f.d(1),f=u(d),f&&(f.c(),f.m(e,null))),d[2]?c?m&4&&A(c,1):(c=Nd(),c.c(),A(c,1),c.m(s.parentNode,s)):c&&(re(),I(c,1,1,()=>{c=null}),ae())},d(d){d&&(v(e),v(l),v(s)),f.d(),c&&c.d(d),o=!1,r()}}}function RC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[5](r)}let o={$$slots:{options:[NC]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Fe(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new si({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const u=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Ct(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){I(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function qC(n,e,t){const i=["field","key"];let l=Ze(e,i),{field:s}=e,{key:o=""}=e,r=!1;const a=()=>{t(2,r=!r)};function u(d){s=d,t(0,s)}function f(d){Ee.call(this,n,d)}function c(d){Ee.call(this,n,d)}return n.$$set=d=>{e=Fe(Fe({},e),Kt(d)),t(3,l=Ze(e,i)),"field"in d&&t(0,s=d.field),"key"in d&&t(1,o=d.key)},[s,o,r,l,a,u,f,c]}class jC extends _e{constructor(e){super(),ge(this,e,qC,RC,he,{field:0,key:1})}}function HC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=Y(t),l=M(),s=b("small"),r=Y(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,u){w(a,e,u),y(e,i),w(a,l,u),w(a,s,u),y(s,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:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function zC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Rd extends _e{constructor(e){super(),ge(this,e,zC,HC,he,{item:0})}}const VC=[{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(D,O){(!k||O&4194304&&s!==(s=D[22]))&&p(e,"for",s);const E={};O&4194304&&(E.id=D[22]),O&8&&(E.items=D[3]),!a&&O&1&&(a=!0,E.keyOfSelected=D[0].options.mimeTypes,ye(()=>a=!1)),r.$set(E);const L={};O&16777217&&(L.$$scope={dirty:O,ctx:D}),_.$set(L)},i(D){k||(A(r.$$.fragment,D),A(_.$$.fragment,D),k=!0)},o(D){I(r.$$.fragment,D),I(_.$$.fragment,D),k=!1},d(D){D&&(v(e),v(o),v(u),v(f)),V(r,D),V(_),S=!1,$()}}}function KC(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
2023-11-26 19:33:17 +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>
(eg. 100x0) - resize to W width preserving the aspect ratio</li>`,p(e,"class","m-0")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function JC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C;function D(E){n[13](E)}let O={id:n[22],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(O.value=n[0].options.thumbs),r=new Fl({props:O}),te.push(()=>be(r,"value",D)),S=new En({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[KC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),g=b("span"),g.textContent="Supported formats",h=M(),_=b("i"),k=M(),B(S.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[22]),p(c,"class","txt"),p(g,"class","txt link-primary"),p(_,"class","ri-arrow-drop-down-fill"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(f,"class","help-block")},m(E,L){w(E,e,L),y(e,t),y(e,i),y(e,l),w(E,o,L),z(r,E,L),w(E,u,L),w(E,f,L),y(f,c),y(f,d),y(f,m),y(m,g),y(m,h),y(m,_),y(m,k),z(S,m,null),$=!0,T||(C=ve(Pe.call(null,l,{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(E,L){(!$||L&4194304&&s!==(s=E[22]))&&p(e,"for",s);const R={};L&4194304&&(R.id=E[22]),!a&&L&1&&(a=!0,R.value=E[0].options.thumbs,ye(()=>a=!1)),r.$set(R);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:E}),S.$set(P)},i(E){$||(A(r.$$.fragment,E),A(S.$$.fragment,E),$=!0)},o(E){I(r.$$.fragment,E),I(S.$$.fragment,E),$=!1},d(E){E&&(v(e),v(o),v(u),v(f)),V(r,E),V(S),T=!1,C()}}}function ZC(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("label"),t=Y("Max file size"),l=M(),s=b("input"),r=M(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[22]),p(s,"type","number"),p(s,"id",o=n[22]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[0].options.maxSize),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&1&&ut(s.value)!==c[0].options.maxSize&&ue(s,c[0].options.maxSize)},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function qd(n){let e,t,i;return t=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[GC,({uniqueId:l})=>({22:l}),({uniqueId:l})=>l?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&20971521&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function GC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max select"),l=M(),s=b("input"),p(e,"for",i=n[22]),p(s,"id",o=n[22]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[0].options.maxSelect),r||(a=K(s,"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(s,"id",o),f&1&&ut(s.value)!==u[0].options.maxSelect&&ue(s,u[0].options.maxSelect)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function XC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;i=new me({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[YC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[JC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[ZC,({uniqueId:h})=>({22:h}),({uniqueId:h})=>h?4194304:0]},$$scope:{ctx:n}}});let g=!n[2]&&qd(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=M(),s=b("div"),B(o.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),d=M(),g&&g.c(),p(t,"clas
2023-11-26 19:33:17 +08:00
`),position:"top"})),c=!0)},p(h,_){var S,$;s&&$t(s.update)&&_&20&&s.update.call(null,{text:[`Whether on ${((S=h[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,h[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${(($=h[4])==null?void 0:$.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
`),position:"top"}),(!f||_&8388608&&o!==(o=h[23]))&&p(e,"for",o);const k={};_&8388608&&(k.id=h[23]),!u&&_&1&&(u=!0,k.keyOfSelected=h[0].options.cascadeDelete,ye(()=>u=!1)),a.$set(k)},i(h){f||(A(a.$$.fragment,h),f=!0)},o(h){I(a.$$.fragment,h),f=!1},d(h){h&&(v(e),v(r)),V(a,h),c=!1,d()}}}function f6(n){let e,t,i,l,s,o=!n[2]&&jd(n);return l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[u6,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),B(l.$$.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),y(e,t),y(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(re(),I(o,1,1,()=>{o=null}),ae()):o?(o.p(r,a),a&4&&A(o,1)):(o=jd(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}),l.$set(u)},i(r){s||(A(o),A(l.$$.fragment,r),s=!0)},o(r){I(o),I(l.$$.fragment,r),s=!1},d(r){r&&v(e),o&&o.d(),V(l)}}}function c6(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[f6],default:[o6,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=Fe(a,o[f]);n[0]!==void 0&&(a.field=n[0]),e=new si({props:a}),te.push(()=>be(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]);let u={};return l=new xa({props:u}),n[20](l),l.$on("save",n[21]),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment)},m(f,c){z(e,f,c),w(f,i,c),z(l,f,c),s=!0},p(f,[c]){const d=c&258?pt(o,[c&2&&{key:f[1]},c&256&&Ct(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 m={};l.$set(m)},i(f){s||(A(e.$$.fragment,f),A(l.$$.fragment,f),s=!0)},o(f){I(e.$$.fragment,f),I(l.$$.fragment,f),s=!1},d(f){f&&v(i),V(e,f),n[20](null),V(l,f)}}}function d6(n,e,t){var P;let i,l;const s=["field","key"];let o=Ze(e,s),r;We(n,zn,F=>t(10,r=F));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,m=((P=a.options)==null?void 0:P.maxSelect)==1,g=m;function h(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,g=m)}function _(){a.options.minSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function k(){a.options.maxSelect=ut(this.value),t(0,a),t(9,g),t(2,m)}function S(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,g),t(2,m))}const $=()=>d==null?void 0:d.show();function T(F){n.$$.not_equal(a.options.collectionId,F)&&(a.options.collectionId=F,t(0,a),t(9,g),t(2,m))}function C(F){m=F,t(2,m)}function D(F){a=F,t(0,a),t(9,g),t(2,m)}function O(F){Ee.call(this,n,F)}function E(F){Ee.call(this,n,F)}function L(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const R=F=>{var N,q;(q=(N=F==null?void 0:F.detail)==null?void 0:N.collection)!=null&&q.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=Fe(Fe({},e),Kt(F)),t(8,o=Ze(e,s)),"field"in F&&t(0,a=F.field),"key"in F&&t(1,u=F.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(F=>F.type!="view")),n.$$.dirty&516&&g!=m&&(t(9,g=m),m?(t(0,a.options.minSelect=null,a),t(0,a.options.maxSelect=1,a)):t(0,a.options.maxSelect=null,a)),n.$$.dirty&1&&j.isEmpty(a.options)&&h(),n.$$.dirty&1025&&t(4,l=r.find(F=>F.id==a.options.collectionId)||null)},[a,u,m,d,l,i,f,c,o,g,r,_,k,S,$,T,C,D,O,E,L,R]}class p6 extends _e{constructor(e){super(),ge(this,e,d6,c6,he,{field:0,key:1})}}const m6=n=>({dragging:n&4,dragover:n&8}),Hd=n=>({dragging:n[2],dragover:n[3]});function h6(n){let e,t,i,l,s;const o=n[10].default,r=vt(o,n,n[9],Hd);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),x(e,"dragging",n[2]),x(e,"dragover",n[3])},m(a,u){w(a,e,u),r&&r.m(e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[11])),K(e,"dragleave",Ye(n[12])),K(e,"dragend",n[13]),K(e,"dragstart",n[14]),K(e,"drop",n[15])],l=!0)},p(a,[u]){r&&r.p&&(!i||u&524)&&St(r,o,a,a[9],i?wt(o,a[9],u,m6):Tt(a[9]),Hd),(!i||u&2&&t!==(t=!a[1]))&&
2023-11-26 19:33:17 +08:00
`),t=b("code"),t.textContent="username",i=Y(` ,
`),l=b("code"),l.textContent="email",s=Y(` ,
`),o=b("code"),o.textContent="emailVisibility",r=Y(` ,
`),a=b("code"),a.textContent="verified",p(t,"class","txt-sm"),p(l,"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,l,f),w(u,s,f),w(u,o,f),w(u,r,f),w(u,a,f)},d(u){u&&(v(e),v(t),v(i),v(l),v(s),v(o),v(r),v(a))}}}function _6(n){let e,t,i,l;function s(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=Dt(r,a(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&B(e.$$.fragment),i=M()},m(u,f){e&&z(e,u,f),w(u,i,f),l=!0},p(u,f){if(n=u,f&1&&r!==(r=n[1][n[17].type])){if(e){re();const c=e;I(c.$$.fragment,1,0,()=>{V(c,1)}),ae()}r?(e=Dt(r,a(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8]),B(e.$$.fragment),A(e.$$.fragment,1),z(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){l||(e&&A(e.$$.fragment,u),l=!0)},o(u){e&&I(e.$$.fragment,u),l=!1},d(u){u&&v(i),e&&V(e,u)}}}function Bd(n,e){let t,i,l,s;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:[_6]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Is({props:r}),te.push(()=>be(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ke(),B(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),z(i,a,u),s=!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}),!l&&u&1&&(l=!0,f.list=e[0].schema,ye(()=>l=!1)),i.$set(f)},i(a){s||(A(i.$$.fragment,a),s=!0)},o(a){I(i.$$.fragment,a),s=!1},d(a){a&&v(t),V(i,a)}}}function b6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=[],g=new Map,h,_,k,S,$,T,C,D,O=n[0].type==="auth"&&Vd(),E=pe(n[0].schema);const L=F=>F[17];for(let F=0;F<E.length;F+=1){let N=zd(n,E,F),q=L(N);g.set(q,m[F]=Bd(q,N))}_=new n$({props:{class:"btn btn-block btn-outline"}}),_.$on("select",n[12]);function R(F){n[13](F)}let P={};return n[0]!==void 0&&(P.collection=n[0]),T=new QT({props:P}),te.push(()=>be(T,"collection",R)),{c(){e=b("div"),t=b("p"),i=Y(`System fields:
2023-11-26 19:33:17 +08:00
`),l=b("code"),l.textContent="id",s=Y(` ,
`),o=b("code"),o.textContent="created",r=Y(` ,
`),a=b("code"),a.textContent="updated",u=M(),O&&O.c(),f=Y(`
.`),c=M(),d=b("div");for(let F=0;F<m.length;F+=1)m[F].c();h=M(),B(_.$$.fragment),k=M(),S=b("hr"),$=M(),B(T.$$.fragment),p(l,"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(F,N){w(F,e,N),y(e,t),y(t,i),y(t,l),y(t,s),y(t,o),y(t,r),y(t,a),y(t,u),O&&O.m(t,null),y(t,f),w(F,c,N),w(F,d,N);for(let q=0;q<m.length;q+=1)m[q]&&m[q].m(d,null);w(F,h,N),z(_,F,N),w(F,k,N),w(F,S,N),w(F,$,N),z(T,F,N),D=!0},p(F,[N]){F[0].type==="auth"?O||(O=Vd(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),N&55&&(E=pe(F[0].schema),re(),m=dt(m,N,L,1,F,E,g,d,Lt,Bd,null,zd),ae());const q={};!C&&N&1&&(C=!0,q.collection=F[0],ye(()=>C=!1)),T.$set(q)},i(F){if(!D){for(let N=0;N<E.length;N+=1)A(m[N]);A(_.$$.fragment,F),A(T.$$.fragment,F),D=!0}},o(F){for(let N=0;N<m.length;N+=1)I(m[N]);I(_.$$.fragment,F),I(T.$$.fragment,F),D=!1},d(F){F&&(v(e),v(c),v(d),v(h),v(k),v(S),v($)),O&&O.d();for(let N=0;N<m.length;N+=1)m[N].d();V(_,F),V(T,F)}}}function y6(n,e,t){let i,{collection:l}=e;const s={text:v$,number:D$,bool:I$,email:Jb,url:V$,editor:K$,date:uC,select:LC,json:jC,file:n6,relation:p6};function o(T){l.schema[T]&&(l.schema.splice(T,1),t(0,l))}function r(T="text"){const C=j.initSchemaField({name:a(),type:T});C.onMountSelect=!0,l.schema.push(C),t(0,l)}function a(T="field"){let C="";for(;u(T+C);)++C;return T+C}function u(T){var C;return!!((C=l==null?void 0:l.schema)!=null&&C.find(D=>D.name===T))}function f(T){return i.findIndex(C=>C===T)}function c(T,C){var D;!((D=l==null?void 0:l.schema)!=null&&D.length)||T===C||!C||t(0,l.indexes=l.indexes.map(O=>j.replaceIndexColumn(O,T,C)),l)}function d(T,C,D,O){D[O]=T,t(0,l)}const m=T=>o(T),g=T=>c(T.detail.oldName,T.detail.newName);function h(T){n.$$.not_equal(l.schema,T)&&(l.schema=T,t(0,l))}const _=T=>{if(!T.detail)return;const C=T.detail.target;C.style.opacity=0,setTimeout(()=>{var D;(D=C==null?void 0:C.style)==null||D.removeProperty("opacity")},0),T.detail.dataTransfer.setDragImage(C,0,0)},k=()=>{Gt({})},S=T=>r(T.detail);function $(T){l=T,t(0,l)}return n.$$set=T=>{"collection"in T&&t(0,l=T.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(T=>!T.toDelete)||[])},[l,s,o,r,f,c,d,m,g,h,_,k,S,$]}class k6 extends _e{constructor(e){super(),ge(this,e,y6,b6,he,{collection:0})}}const v6=n=>({isAdminOnly:n&512}),Ud=n=>({isAdminOnly:n[9]}),w6=n=>({isAdminOnly:n&512}),Wd=n=>({isAdminOnly:n[9]}),S6=n=>({isAdminOnly:n&512}),Yd=n=>({isAdminOnly:n[9]});function T6(n){let e,t;return e=new me({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[C6,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function $6(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function Kd(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),t||(i=K(e,"click",n[11]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function Jd(n){let e,t,i,l,s;return{c(){e=b("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,l||(s=K(e,"click",n[10]),l=!0)},p:Q,i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.98},!1)),t.run(0)),i=!1},d(o){o&&v(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(l,"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,F){w(P,e,F),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let N=0;N<R.length;N+=1)R[N]&&R[N].m(o,null);y(i,r),y(i,a),y(i,u),y(i,f),y(i,c),y(i,d),y(i,m),y(i,g),y(i,h),y(i,_),y(i,k),y(i,S),y(i,$),y(i,T),y(i,C),y(i,D),E=!0},p(P,F){if(F&4){L=pe(P[2]);let N;for(N=0;N<L.length;N+=1){const q=Gd(P,L,N);R[N]?R[N].p(q,F):(R[N]=Qd(q),R[N].c(),R[N].m(o,null))}for(;N<R.length;N+=1)R[N].d(1);R.length=L.length}},i(P){E||(P&&Ke(()=>{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(P){P&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(P){P&&v(e),at(R,P),P&&O&&O.end()}}}function Qd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&se(i,t)},d(l){l&&v(e)}}}function xd(n){let e,t,i,l,s,o,r,a,u;function f(_){n[6](_)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[D6,({isAdminOnly:_})=>({10:_}),({isAdminOnly:_})=>_?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Tl({props:c}),te.push(()=>be(e,"rule",f));function d(_){n[7](_)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new Tl({props:m}),te.push(()=>be(l,"rule",d));function g(_){n[8](_)}let h={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(h.rule=n[0].deleteRule),r=new Tl({props:h}),te.push(()=>be(r,"rule",g)),{c(){B(e.$$.fragment),i=M(),B(l.$$.fragment),o=M(),B(r.$$.fragment)},m(_,k){z(e,_,k),w(_,i,k),z(l,_,k),w(_,o,k),z(r,_,k),u=!0},p(_,k){const S={};k&1&&(S.collection=_[0]),k&17408&&(S.$$scope={dirty:k,ctx:_}),!t&&k&1&&(t=!0,S.rule=_[0].createRule,ye(()=>t=!1)),e.$set(S);const $={};k&1&&($.collection=_[0]),!s&&k&1&&(s=!0,$.rule=_[0].updateRule,ye(()=>s=!1)),l.$set($);const T={};k&1&&(T.collection=_[0]),!a&&k&1&&(a=!0,T.rule=_[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(_){u||(A(e.$$.fragment,_),A(l.$$.fragment,_),A(r.$$.fragment,_),u=!0)},o(_){I(e.$$.fragment,_),I(l.$$.fragment,_),I(r.$$.fragment,_),u=!1},d(_){_&&(v(i),v(o)),V(e,_),V(l,_),V(r,_)}}}function ep(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){w(l,e,s),t||(i=ve(Pe.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(l){l&&v(e),t=!1,i()}}}function D6(n){let e,t=!n[10]&&ep();return{c(){t&&t.c(),e=ke()},m(i,l){t&&t.m(i,l),w(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=ep(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function tp(n){let e,t,i;function l(o){n[9](o)}let s={label:"Manage rule",formKey:"options.manageRule",placeholder:"",required:n[0].options.manageRule!==null,collection:n[0],$$slots:{default:[E6]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Tl({props:s}),te.push(()=>be(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(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){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function E6(n){let e,t,i;return{c(){e=b("p"),e.textContent=`This API rule gives admin-like permissions to allow fully managing the auth record(s), eg.
2023-11-26 19:33:17 +08:00
changing the password without requiring to enter the old one, directly updating the verified
state or email, etc.`,t=M(),i=b("p"),i.innerHTML="This rule is executed in addition to the <code>create</code> and <code>update</code> API rules."},m(l,s){w(l,e,s),w(l,t,s),w(l,i,s)},p:Q,d(l){l&&(v(e),v(t),v(i))}}}function A6(n){var F,N;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,g,h,_,k,S,$,T,C=n[1]&&Xd(n);function D(q){n[4](q)}let O={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(O.rule=n[0].listRule),f=new Tl({props:O}),te.push(()=>be(f,"rule",D));function E(q){n[5](q)}let L={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(L.rule=n[0].viewRule),m=new Tl({props:L}),te.push(()=>be(m,"rule",E));let R=((F=n[0])==null?void 0:F.type)!=="view"&&xd(n),P=((N=n[0])==null?void 0:N.type)==="auth"&&tp(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
2023-11-26 19:33:17 +08:00
<a href="https://pocketbase.io/docs/api-rules-and-filters/" target="_blank" rel="noopener noreferrer">PocketBase filter syntax and operators
</a>.`,l=M(),s=b("button"),r=Y(o),a=M(),C&&C.c(),u=M(),B(f.$$.fragment),d=M(),B(m.$$.fragment),h=M(),R&&R.c(),_=M(),P&&P.c(),k=ke(),p(s,"type","button"),p(s,"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,W){w(q,e,W),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),C&&C.m(e,null),w(q,u,W),z(f,q,W),w(q,d,W),z(m,q,W),w(q,h,W),R&&R.m(q,W),w(q,_,W),P&&P.m(q,W),w(q,k,W),S=!0,$||(T=K(s,"click",n[3]),$=!0)},p(q,[W]){var H,U;(!S||W&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&se(r,o),q[1]?C?(C.p(q,W),W&2&&A(C,1)):(C=Xd(q),C.c(),A(C,1),C.m(e,null)):C&&(re(),I(C,1,1,()=>{C=null}),ae());const G={};W&1&&(G.collection=q[0]),!c&&W&1&&(c=!0,G.rule=q[0].listRule,ye(()=>c=!1)),f.$set(G);const J={};W&1&&(J.collection=q[0]),!g&&W&1&&(g=!0,J.rule=q[0].viewRule,ye(()=>g=!1)),m.$set(J),((H=q[0])==null?void 0:H.type)!=="view"?R?(R.p(q,W),W&1&&A(R,1)):(R=xd(q),R.c(),A(R,1),R.m(_.parentNode,_)):R&&(re(),I(R,1,1,()=>{R=null}),ae()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,W),W&1&&A(P,1)):(P=tp(q),P.c(),A(P,1),P.m(k.parentNode,k)):P&&(re(),I(P,1,1,()=>{P=null}),ae())},i(q){S||(A(C),A(f.$$.fragment,q),A(m.$$.fragment,q),A(R),A(P),S=!0)},o(q){I(C),I(f.$$.fragment,q),I(m.$$.fragment,q),I(R),I(P),S=!1},d(q){q&&(v(e),v(u),v(d),v(h),v(_),v(k)),C&&C.d(),V(f,q),V(m,q),R&&R.d(q),P&&P.d(q),$=!1,T()}}}function I6(n,e,t){let i,{collection:l}=e,s=!1;const o=()=>t(1,s=!s);function r(m){n.$$.not_equal(l.listRule,m)&&(l.listRule=m,t(0,l))}function a(m){n.$$.not_equal(l.viewRule,m)&&(l.viewRule=m,t(0,l))}function u(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function f(m){n.$$.not_equal(l.updateRule,m)&&(l.updateRule=m,t(0,l))}function c(m){n.$$.not_equal(l.deleteRule,m)&&(l.deleteRule=m,t(0,l))}function d(m){n.$$.not_equal(l.options.manageRule,m)&&(l.options.manageRule=m,t(0,l))}return n.$$set=m=>{"collection"in m&&t(0,l=m.collection)},n.$$.update=()=>{n.$$.dirty&1&&t(2,i=j.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,u,f,c,d]}class L6 extends _e{constructor(e){super(),ge(this,e,I6,A6,he,{collection:0})}}function np(n,e,t){const i=n.slice();return i[9]=e[t],i}function P6(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Dt(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),A(e.$$.fragment,1),z(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){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function F6(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function ip(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=lp(np(n,i,s));return{c(){e=b("div"),t=b("div");for(let s=0;s<l.length;s+=1)l[s].c();p(t,"class","content"),p(e,"class","help-block help-block-error")},m(s,o){w(s,e,o),y(e,t);for(let r=0;r<l.length;r+=1)l[r]&&l[r].m(t,null)},p(s,o){if(o&8){i=pe(s[3]);let r;for(r=0;r<i.length;r+=1){const a=np(s,i,r);l[r]?l[r].p(a,o):(l[r]=lp(a),l[r].c(),l[r].m(t,null))}for(;r<l.length;r+=1)l[r].d(1);l.length=i.length}},d(s){s&&v(e),at(l,s)}}}function lp(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=Y(t)},m(l,s){w(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&se(i,t)},d(l){l&&v(e)}}}function N6(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[F6,P6],m=[];function g(_,k){return _[2]?0:1}s=g(n),o=m[s]=d[s](n);let h=n[3].length&&ip(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=M(),o.c(),r=M(),a=b("div"),a.innerHTML=`<ul><li>Wildcard columns (<code>*</code>
2023-11-26 19:33:17 +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.
<code>MAX(balance) as maxBalance</code>).</li></ul>`,u=M(),h&&h.c(),f=ke(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(_,k){w(_,e,k),y(e,t),w(_,l,k),m[s].m(_,k),w(_,r,k),w(_,a,k),w(_,u,k),h&&h.m(_,k),w(_,f,k),c=!0},p(_,k){(!c||k&256&&i!==(i=_[8]))&&p(e,"for",i);let S=s;s=g(_),s===S?m[s].p(_,k):(re(),I(m[S],1,1,()=>{m[S]=null}),ae(),o=m[s],o?o.p(_,k):(o=m[s]=d[s](_),o.c()),A(o,1),o.m(r.parentNode,r)),_[3].length?h?h.p(_,k):(h=ip(_),h.c(),h.m(f.parentNode,f)):h&&(h.d(1),h=null)},i(_){c||(A(o),c=!0)},o(_){I(o),c=!1},d(_){_&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(_),h&&h.d(_)}}}function R6(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[N6,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function q6(n,e,t){let i;We(n,gi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var g;t(3,r=[]);const d=j.getNestedVal(c,"schema",null);if(j.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=j.extractColumnsFromQuery((g=l==null?void 0:l.options)==null?void 0:g.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let h in d)for(let _ in d[h]){const k=d[h][_].message,S=m[h]||h;r.push(j.sentenize(S+": "+k))}}Vt(async()=>{t(2,o=!0);try{t(1,s=(await st(()=>import("./CodeEditor-779a52d1.js"),["./CodeEditor-779a52d1.js","./index-b30338ff.js"],import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function u(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const f=()=>{r.length&&ii("schema")};return n.$$set=c=>{"collection"in c&&t(0,l=c.collection)},n.$$.update=()=>{n.$$.dirty&16&&a(i)},[l,s,o,r,i,u,f]}class j6 extends _e{constructor(e){super(),ge(this,e,q6,R6,he,{collection:0})}}const H6=n=>({active:n&1}),sp=n=>({active:n[0]});function op(n){let e,t,i;const l=n[15].default,s=vt(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){w(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&St(s,l,o,o[14],i?wt(l,o[14],r,null):Tt(o[14]),null)},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function z6(n){let e,t,i,l,s,o,r;const a=n[15].header,u=vt(a,n,n[14],sp);let f=n[0]&&op(n);return{c(){e=b("div"),t=b("button"),u&&u.c(),i=M(),f&&f.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),x(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),x(e,"active",n[0])},m(c,d){w(c,e,d),y(e,t),u&&u.m(t,null),y(e,i),f&&f.m(e,null),n[22](e),s=!0,o||(r=[K(t,"click",Ye(n[17])),K(t,"drop",Ye(n[18])),K(t,"dragstart",n[19]),K(t,"dragenter",n[20]),K(t,"dragleave",n[21]),K(t,"dragover",Ye(n[16]))],o=!0)},p(c,[d]){u&&u.p&&(!s||d&16385)&&St(u,a,c,c[14],s?wt(a,c[14],d,H6):Tt(c[14]),sp),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&x(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=op(c),f.c(),A(f,1),f.m(e,null)):f&&(re(),I(f,1,1,()=>{f=null}),ae()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&x(e,"active",c[0])},i(c){s||(A(u,c),A(f),s=!0)},o(c){I(u,c),I(f),s=!1},d(c){c&&v(e),u&&u.d(c),f&&f.d(),n[22](null),o=!1,we(r)}}}function V6(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=rt();let o,r,{class:a=""}=e,{draggable:u=!1}=e,{active:f=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function g(){return!!f}function h(){S(),t(0,f=!0),s("expand")}function _(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?_():h()}function S(){if(d&&o.closest(".accordions")){const R=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of R)P.click()}}Vt
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function G6(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function g(_){n[8](_)}let h={id:n[12],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(h.value=n[0].options.onlyEmailDomains),r=new Fl({props:h}),te.push(()=>be(r,"value",g)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),B(r.$$.fragment),u=M(),f=b("div"),f.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[12]),p(f,"class","help-block")},m(_,k){w(_,e,k),y(e,t),y(e,i),y(e,l),w(_,o,k),z(r,_,k),w(_,u,k),w(_,f,k),c=!0,d||(m=ve(Pe.call(null,l,{text:`Email domains that are ONLY allowed to sign up.
This field is disabled if "Except domains" is set.`,position:"top"})),d=!0)},p(_,k){(!c||k&4096&&s!==(s=_[12]))&&p(e,"for",s);const S={};k&4096&&(S.id=_[12]),k&1&&(S.disabled=!j.isEmpty(_[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,S.value=_[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set(S)},i(_){c||(A(r.$$.fragment,_),c=!0)},o(_){I(r.$$.fragment,_),c=!1},d(_){_&&(v(e),v(o),v(u),v(f)),V(r,_),d=!1,m()}}}function X6(n){let e,t,i,l;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[J6,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&ap(n);return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&A(s,1)):(s=ap(o),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function Q6(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function x6(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function up(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function e5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?x6:Q6}let a=r(n),u=a(n),f=n[2]&&up();return{c(){e=b("div"),e.innerHTML='<i class="ri-mail-star-line"></i> <span class="txt">Email/Password</span>',t=M(),i=b("div"),l=M(),u.c(),s=M(),f&&f.c(),o=ke(),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,l,d),u.m(c,d),w(c,s,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(s.parentNode,s))),c[2]?f?d&4&&A(f,1):(f=up(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function t5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=M(),l=b("label"),s=Y("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[12]),p(l,"for",o=n[12])},m(u,f){w(u,e,f),e.checked=n[0].options.allowOAuth2Auth,w(u,i,f),w(u,l,f),y(l,s),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(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function fp(n){let e,t,i;return{c(){e=b("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(l,s){w(l,e,s),i=!0},i(l){i||(l&&Ke(()=>{i&&(t||(t=Le(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Le(e,et,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function n5(n){let e,t,i,l;e=new me({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[t5,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&fp();return{c(){B(e.$$.fragment),t=M(),s&&s.c(),i=ke()},m(o,r){z(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&12289&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&A(s,1):(s=fp(),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(re(),I(s,1,1,()=>{s=null}),ae())},i(o){l||(A(e.$$.fragment,o),A(s),l=!0)},o(o){I(e.$$.fragment,o),I(s),l=!1},d(o){o&&(v(t),v(i)),V(e,o),s&&s.d(o)}}}function i5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function l5(n){let e;return{c(){e=b("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(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function a5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return l=new go({props:{single:!0,$$slots:{header:[K6],default:[U6]},$$scope:{ctx:n}}}),o=new go({props:{single:!0,$$slots:{header:[e5],default:[X6]},$$scope:{ctx:n}}}),a=new go({props:{single:!0,$$slots:{header:[s5],default:[n5]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[o5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[r5,({uniqueId:S})=>({12:S}),({uniqueId:S})=>S?4096:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),B(l.$$.fragment),s=M(),B(o.$$.fragment),r=M(),B(a.$$.fragment),u=M(),f=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),B(g.$$.fragment),h=M(),B(_.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(S,$){w(S,e,$),w(S,t,$),w(S,i,$),z(l,i,null),y(i,s),z(o,i,null),y(i,r),z(a,i,null),w(S,u,$),w(S,f,$),w(S,c,$),w(S,d,$),w(S,m,$),z(g,S,$),w(S,h,$),z(_,S,$),k=!0},p(S,[$]){const T={};$&8201&&(T.$$scope={dirty:$,ctx:S}),l.$set(T);const C={};$&8197&&(C.$$scope={dirty:$,ctx:S}),o.$set(C);const D={};$&8195&&(D.$$scope={dirty:$,ctx:S}),a.$set(D);const O={};$&12289&&(O.$$scope={dirty:$,ctx:S}),g.$set(O);const E={};$&12289&&(E.$$scope={dirty:$,ctx:S}),_.$set(E)},i(S){k||(A(l.$$.fragment,S),A(o.$$.fragment,S),A(a.$$.fragment,S),A(g.$$.fragment,S),A(_.$$.fragment,S),k=!0)},o(S){I(l.$$.fragment,S),I(o.$$.fragment,S),I(a.$$.fragment,S),I(g.$$.fragment,S),I(_.$$.fragment,S),k=!1},d(S){S&&(v(e),v(t),v(i),v(u),v(f),v(c),v(d),v(m),v(h)),V(l),V(o),V(a),V(g,S),V(_,S)}}}function u5(n,e,t){let i,l,s,o;We(n,gi,h=>t(4,o=h));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function u(){r.options.allowEmailAuth=this.checked,t(0,r)}function f(h){n.$$.not_equal(r.options.exceptEmailDomains,h)&&(r.options.exceptEmailDomains=h,t(0,r))}function c(h){n.$$.not_equal(r.options.onlyEmailDomains,h)&&(r.options.onlyEmailDomains=h,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=ut(this.value),t(0,r)}function g(){r.options.requireEmail=this.checked,t(0,r)}return n.$$set=h=>{"collection"in h&&t(0,r=h.collection)},n.$$.update=()=>{var h,_,k,S;n.$$.dirty&1&&r.type==="auth"&&j.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!j.isEmpty((h=o==null?void 0:o.options)==null?void 0:h.allowEmailAuth)||!j.isEmpty((_=o==null?void 0:o.options)==null?void 0:_.onlyEmailDomains)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,u,f,c,d,m,g]}class f5 extends _e{constructor(e){super(),ge(this,e,u5,a5,he,{collection:0})}}function dp(n,e,t){const i=n.slice();return i[18]=e[t],i}function pp(n,e,t){const i=n.slice();return i[18]=e[t],i}function mp(n,e,t){const i=n.slice();return i[18]=e[t],i}function hp(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function gp(n){let e,t,i,l,s=n[3]&&_p(n),o=!n[4]&&bp(n);return{c(){e=b("h6"),e.textContent="Changes:",t=M(),i=b("ul"),s&&s.c(),l=M(),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),s&&s.m(i,null),y(i,l),o&&o.m(i,null)},p(r,a){r[3]?s?s.p(r,a):(s=_p(r),s.c(),s.m(i,l)):s&&(s.d(1),s=null),r[4]?o&&(o.d(1),o=null):o?o.p(r,a):(o=bp(r),o.c(),o.m(i,null))},d(r){r&&(v(e),v(t),v(i)),s&&s.d(),o&&o.d()}}}function _p(n)
`),l=b("strong"),o=Y(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Y(c),p(l,"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,_){w(h,e,_),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(h,_){var k,S;_&2&&s!==(s=((k=h[1])==null?void 0:k.name)+"")&&se(o,s),_&4&&c!==(c=((S=h[2])==null?void 0:S.name)+"")&&se(d,c)},d(h){h&&v(e)}}}function bp(n){let e,t,i,l=pe(n[6]),s=[];for(let f=0;f<l.length;f+=1)s[f]=yp(mp(n,l,f));let o=pe(n[8]),r=[];for(let f=0;f<o.length;f+=1)r[f]=kp(pp(n,o,f));let a=pe(n[7]),u=[];for(let f=0;f<a.length;f+=1)u[f]=vp(dp(n,a,f));return{c(){for(let f=0;f<s.length;f+=1)s[f].c();e=M();for(let f=0;f<r.length;f+=1)r[f].c();t=M();for(let f=0;f<u.length;f+=1)u[f].c();i=ke()},m(f,c){for(let d=0;d<s.length;d+=1)s[d]&&s[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){l=pe(f[6]);let d;for(d=0;d<l.length;d+=1){const m=mp(f,l,d);s[d]?s[d].p(m,c):(s[d]=yp(m),s[d].c(),s[d].m(e.parentNode,e))}for(;d<s.length;d+=1)s[d].d(1);s.length=l.length}if(c&256){o=pe(f[8]);let d;for(d=0;d<o.length;d+=1){const m=pp(f,o,d);r[d]?r[d].p(m,c):(r[d]=kp(m),r[d].c(),r[d].m(t.parentNode,t))}for(;d<r.length;d+=1)r[d].d(1);r.length=o.length}if(c&128){a=pe(f[7]);let d;for(d=0;d<a.length;d+=1){const m=dp(f,a,d);u[d]?u[d].p(m,c):(u[d]=vp(m),u[d].c(),u[d].m(i.parentNode,i))}for(;d<u.length;d+=1)u[d].d(1);u.length=a.length}},d(f){f&&(v(e),v(t),v(i)),at(s,f),at(r,f),at(u,f)}}}function yp(n){let e,t,i,l=n[18].name+"",s,o,r;return{c(){e=b("li"),t=Y(`Multiple to single value conversion of field
`),i=b("strong"),s=Y(l),o=M(),r=b("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),y(e,t),y(e,i),y(i,s),y(e,o),y(e,r)},p(a,u){u&64&&l!==(l=a[18].name+"")&&se(s,l)},d(a){a&&v(e)}}}function kp(n){let e,t,i,l,s=n[18].originalName+"",o,r,a,u,f,c=n[18].name+"",d;return{c(){e=b("li"),t=b("div"),i=Y(`Renamed field
`),l=b("strong"),o=Y(s),r=M(),a=b("i"),u=M(),f=b("strong"),d=Y(c),p(l,"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,g){w(m,e,g),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,u),y(t,f),y(f,d)},p(m,g){g&256&&s!==(s=m[18].originalName+"")&&se(o,s),g&256&&c!==(c=m[18].name+"")&&se(d,c)},d(m){m&&v(e)}}}function vp(n){let e,t,i,l=n[18].name+"",s,o;return{c(){e=b("li"),t=Y("Removed field "),i=b("span"),s=Y(l),o=M(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){w(r,e,a),y(e,t),y(e,i),y(i,s),y(e,o)},p(r,a){a&128&&l!==(l=r[18].name+"")&&se(s,l)},d(r){r&&v(e)}}}function c5(n){let e,t,i,l,s,o,r,a,u=n[7].length&&hp(),f=n[9]&&gp(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=M(),l=b("div"),s=b("p"),s.textContent=`If any of the collection changes is part of another collection rule, filter or view query,
you'll have to update it manually!`,o=M(),u&&u.c(),r=M(),f&&f.c(),a=ke(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),u&&u.m(l,null),w(c,r,d),f&&f.m(c,d),w(c,a,d)},p(c,d){c[7].length?u||(u=hp(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=gp(c),f.c(),f.m(a.parentNode,a)):f&&(f.d(1),f=null)},d(c){c&&(v(e),v(r),v(a)),u&&u.d(),f&&f.d(c)}}}function d5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function p5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=M(),i=b("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(),l||(s=[K(e,"click",n[12]),K(i,"click",n[13])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function m5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[p5],header:[d5],default:[c5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function h5(n,e,t){let i,l,s,o,r,a;const u=rt();let f,c,d;async function m(C,D){t(1,c=C),t(2,d=D),await Qt(),i||s.length||o.length||r.length?f==null||f.show():h()}function g(){f==null||f.hide()}function h(){g(),u("confirm")}const _=()=>g(),k=()=>h();function S(C){te[C?"unshift":"push"](()=>{f=C,t(5,f)})}function $(C){Ee.call(this,n,C)}function T(C){Ee.call(this,n,C)}return n.$$.update=()=>{var C,D,O;n.$$.dirty&6&&t(3,i=(c==null?void 0:c.name)!=(d==null?void 0:d.name)),n.$$.dirty&4&&t(4,l=(d==null?void 0:d.type)==="view"),n.$$.dirty&4&&t(8,s=((C=d==null?void 0:d.schema)==null?void 0:C.filter(E=>E.id&&!E.toDelete&&E.originalName!=E.name))||[]),n.$$.dirty&4&&t(7,o=((D=d==null?void 0:d.schema)==null?void 0:D.filter(E=>E.id&&E.toDelete))||[]),n.$$.dirty&6&&t(6,r=((O=d==null?void 0:d.schema)==null?void 0:O.filter(E=>{var R,P,F;const L=(R=c==null?void 0:c.schema)==null?void 0:R.find(N=>N.id==E.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((F=E.options)==null?void 0:F.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[g,c,d,i,l,f,r,o,s,a,h,m,_,k,S,$,T]}class g5 extends _e{constructor(e){super(),ge(this,e,h5,m5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function wp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function _5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new k6({props:s}),te.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(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){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function b5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new j6({props:s}),te.push(()=>be(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(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){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function Sp(n){let e,t,i,l;function s(r){n[36](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new L6({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),z(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ye(()=>i=!1)),t.$set(u)},i(r){l||(A(t.$$.fragment,r),l=!0)},o(r){I(t.$$.fragment,r),l=!1},d(r){r&&v(e),V(t)}}}function Tp(n){let e,t,i,l;function s(r){n[37](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new f5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),x(e,"active",n[3]===El)},m(r
2023-11-26 19:33:17 +08:00
`),position:"left"})),i=!0)},p(s,[o]){t&&$t(t.update)&&o&1&&t.update.call(null,{text:s[0].join(`
`),position:"left"})},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}const Qp="yyyy-MM-dd HH:mm:ss.SSS";function Y5(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,Qp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,Qp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class xb extends _e{constructor(e){super(),ge(this,e,Y5,W5,he,{model:1})}}function K5(n){let e,t,i,l,s,o,r,a,u,f;return s=new rl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=M(),B(s.$$.fragment),o=M(),r=b("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),y(e,t),y(t,i),n[6](t),y(e,l),z(s,e,null),y(e,o),y(e,r),a=!0,u||(f=[ve(Pe.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&se(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(A(s.$$.fragment,c),a=!0)},o(c){I(s.$$.fragment,c),a=!1},d(c){c&&v(e),n[6](null),V(s),u=!1,we(f)}}}function J5(n){let e,t,i,l,s,o,r,a,u,f;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[K5]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new En({props:d}),te.push(()=>be(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=M(),B(l.$$.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(m,g){w(m,e,g),y(e,t),y(e,i),z(l,e,null),a=!0,u||(f=ve(r=Pe.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[g]){const h={};g&518&&(h.$$scope={dirty:g,ctx:m}),!s&&g&8&&(s=!0,h.active=m[3],ye(()=>s=!1)),l.$set(h),(!a||g&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&$t(r.update)&&g&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(A(l.$$.fragment,m),a=!0)},o(m){I(l.$$.fragment,m),a=!1},d(m){m&&v(e),V(l),u=!1,f()}}}function Z5(n,e,t){const i=rt();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function u(){if(t(1,o=j.randomSecret(s)),i("generate",o),await Qt(),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,l=d.class),"length"in d&&t(5,s=d.length)},[l,o,r,a,u,s,f,c]}class e0 extends _e{constructor(e){super(),ge(this,e,Z5,J5,he,{class:0,length:5})}}function G5(n){let e,t,i,l,s,o,r,a,u,f,c,d;return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Username",o=M(),r=b("input"),p(t,"class",j.getFieldTypeIcon("user")),p(l,"class","txt"),p(e,"for",s=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(m,g){w(m,e,g),y(e,t),y(e,i),y(e,l),w(m,o,g),w(m,r,g),ue(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,g){g&8192&&s!==(s=m[13])&&p(e,"for",s),g&4&&a!==(a=!m[2])&&p(r,"requried",a),g&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),g&8192&&f!==(f=m[13])&&p(r,"id",f),g&1&&r.value!==m[0].username&&ue(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function X5(n){let e,t,i,l,s,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,g,h,_,k,S,$;return{c(){var T;e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="Email",o=M(),r=b("div"),a=b("button"),u=b("span"),f=Y("Public: "),d=Y(c),g=M(),h=b("input"),p(t,"class",j.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(u,"class","txt"),p(a,"type","button"),p(a,"class",m="btn btn-sm btn-transparent "+(n[0].emailVisibility?"btn-success":"btn-hint")),p(r,"class","form-field-addon email-visibility-addon svelte-1751a4d"),p(h,"type","email"),h.autofocus=n[2],p(h,"autocomplete","off"),p(h,"id",_=n[13]),h.required=k=(T=n[1].options)==null?void 0:T.requireEmail,p(h,"class","svelte-1751a4d")},m(T,C){w(T,e,C),y(e,t),y(e,i),y(e,l),w(T,o,C),w(T,r,C),y(r,a),y(a,u),y(u,f),
2023-11-26 19:33:17 +08:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[hO,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),z(t,e,null),i=!0,l||(s=[K(e,"dragover",Ye(n[25])),K(e,"dragleave",n[26]),K(e,"drop",n[15])],l=!0)},p(o,r){const a={};r[0]&528&&(a.class=`
2023-11-26 19:33:17 +08:00
form-field form-field-list form-field-file
`+(o[4].required?"required":"")+`
`+(o[9]?"dragover":"")+`
`),r[0]&16&&(a.name=o[4].name),r[0]&268439039|r[1]&64&&(a.$$scope={dirty:r,ctx:o}),t.$set(a)},i(o){i||(A(t.$$.fragment,o),i=!0)},o(o){I(t.$$.fragment,o),i=!1},d(o){o&&v(e),V(t),l=!1,we(s)}}}function _O(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:u=[]}=e,{deletedFileNames:f=[]}=e,c,d,m=!1,g="";function h(W){j.removeByValue(f,W),t(2,f)}function _(W){j.pushUnique(f,W),t(2,f)}function k(W){j.isEmpty(u[W])||u.splice(W,1),t(1,u)}function S(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:u,deletedFileNames:f},bubbles:!0}))}function $(W){var J,H;W.preventDefault(),t(9,m=!1);const G=((J=W.dataTransfer)==null?void 0:J.files)||[];if(!(s||!G.length)){for(const U of G){const le=l.length+u.length-f.length;if(((H=r.options)==null?void 0:H.maxSelect)<=le)break;u.push(U)}t(1,u)}}Vt(async()=>{t(10,g=await fe.getAdminFileToken(o.collectionId))});const T=W=>h(W),C=W=>_(W);function D(W){a=W,t(0,a),t(6,i),t(4,r)}const O=W=>k(W);function E(W){u=W,t(1,u)}function L(W){te[W?"unshift":"push"](()=>{c=W,t(7,c)})}const R=()=>{for(let W of c.files)u.push(W);t(1,u),t(7,c.value=null,c)},P=()=>c==null?void 0:c.click();function F(W){te[W?"unshift":"push"](()=>{d=W,t(8,d)})}const N=()=>{t(9,m=!0)},q=()=>{t(9,m=!1)};return n.$$set=W=>{"record"in W&&t(3,o=W.record),"field"in W&&t(4,r=W.field),"value"in W&&t(0,a=W.value),"uploadedFiles"in W&&t(1,u=W.uploadedFiles),"deletedFileNames"in W&&t(2,f=W.deletedFileNames)},n.$$.update=()=>{var W,G;n.$$.dirty[0]&2&&(Array.isArray(u)||t(1,u=j.toArray(u))),n.$$.dirty[0]&4&&(Array.isArray(f)||t(2,f=j.toArray(f))),n.$$.dirty[0]&16&&t(6,i=((W=r.options)==null?void 0:W.maxSelect)>1),n.$$.dirty[0]&65&&j.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=j.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||u.length)&&((G=r.options)==null?void 0:G.maxSelect)<=l.length+u.length-f.length),n.$$.dirty[0]&6&&(u!==-1||f!==-1)&&S()},[a,u,f,o,r,l,i,c,d,m,g,s,h,_,k,$,T,C,D,O,E,L,R,P,F,N,q]}class bO extends _e{constructor(e){super(),ge(this,e,_O,gO,he,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function fm(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function yO(n,e){e=fm(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=fm(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function cm(n,e,t){const i=n.slice();i[5]=e[t];const l=j.toArray(i[0][i[5]]).slice(0,5);return i[6]=l,i}function dm(n,e,t){const i=n.slice();return i[9]=e[t],i}function pm(n){let e,t;return e=new eu({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&5&&(s.filename=i[9]),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function mm(n){let e=!j.isEmpty(n[9]),t,i,l=e&&pm(n);return{c(){l&&l.c(),t=ke()},m(s,o){l&&l.m(s,o),w(s,t,o),i=!0},p(s,o){o&5&&(e=!j.isEmpty(s[9])),e?l?(l.p(s,o),o&5&&A(l,1)):(l=pm(s),l.c(),A(l,1),l.m(t.parentNode,t)):l&&(re(),I(l,1,1,()=>{l=null}),ae())},i(s){i||(A(l),i=!0)},o(s){I(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function hm(n){let e,t,i=pe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=mm(dm(n,i,o));const s=o=>I(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ke()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);w(o,e,r),t=!0},p(o,r){if(r&5){i=pe(o[6]);let a;for(a=0;a<i.length;a+=1){const u=dm(o,i,a);l[a]?(l[a].p(u,r),A(l[a],1)):(l[a]=mm(u),l[a].c(),A(l[a],1),l[a].m(e.parentNode,e))}for(re(),a=i.length;a<l.length;a+=1)s(a);ae()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)A(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)I(l[r]);t=!1},d(o){o&&v(e),at(l,o)}}}function kO(n){let e,t,i,l,s,o,r=j.truncate(j.displayValue(n[0],n[1]),70)+"",a,u,f,c,d=pe(n[2]),m=[];for(let h=0;h<d.length;h+=1)m[h]=hm(cm(n,d,h));const g=h=>I(m[h],1,1,()=>{m[h
`),L&&L.c(),m=M(),h.c(),_=ke(),p(e,"class","flex m-b-base flex-gap-10"),p(s,"class","list picker-list m-b-base svelte-1u8jhky"),p(c,"class","section-title")},m(N,q){w(N,e,q),z(t,e,null),y(e,i),T&&T.m(e,null),w(N,l,q),w(N,s,q);for(let W=0;W<o.length;W+=1)o[W]&&o[W].m(s,null);O&&O.m(s,null),y(s,a),E&&E.m(s,null),w(N,f,q),w(N,c,q),y(c,d),L&&L.m(c,null),w(N,m,q),P[g].m(N,q),w(N,_,q),k=!0,S||($=ve(u=yO.call(null,s,n[36])),S=!0)},p(N,q){const W={};q[0]&4&&(W.value=N[2]),q[0]&32&&(W.autocompleteCollection=N[5]),t.$set(W),N[11]?T&&(T.d(1),T=null):T?T.p(N,q):(T=bm(N),T.c(),T.m(e,null)),q[0]&143252&&(C=pe(N[8]),re(),o=dt(o,q,D,1,N,C,r,s,Lt,Sm,a,_m),ae(),!C.length&&O?O.p(N,q):C.length?O&&(O.d(1),O=null):(O=ym(N),O.c(),O.m(s,a))),N[13]?E||(E=Tm(),E.c(),E.m(s,null)):E&&(E.d(1),E=null),u&&$t(u.update)&&q[0]&4104&&u.update.call(null,N[36]),N[4]>1?L?L.p(N,q):(L=$m(N),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let G=g;g=F(N),g===G?P[g].p(N,q):(re(),I(P[G],1,1,()=>{P[G]=null}),ae(),h=P[g],h?h.p(N,q):(h=P[g]=R[g](N),h.c()),A(h,1),h.m(_.parentNode,_))},i(N){if(!k){A(t.$$.fragment,N);for(let q=0;q<C.length;q+=1)A(o[q]);A(h),k=!0}},o(N){I(t.$$.fragment,N);for(let q=0;q<o.length;q+=1)I(o[q]);I(h),k=!1},d(N){N&&(v(e),v(l),v(s),v(f),v(c),v(m),v(_)),V(t),T&&T.d();for(let q=0;q<o.length;q+=1)o[q].d();O&&O.d(),E&&E.d(),L&&L.d(),P[g].d(N),S=!1,$()}}}function OO(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=Y("Select "),i=b("strong"),s=Y(l),o=Y(" records")},m(a,u){w(a,e,u),y(e,t),y(e,i),y(i,s),y(e,o)},p(a,u){var f;u[0]&32&&l!==(l=(((f=a[5])==null?void 0:f.name)||"")+"")&&se(s,l)},d(a){a&&v(e)}}}function DO(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=M(),i=b("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),l||(s=[K(e,"click",n[28]),K(i,"click",n[29])],l=!0)},p:Q,d(o){o&&(v(e),v(t),v(i)),l=!1,we(s)}}}function EO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[DO],header:[OO],default:[MO]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Fe(o,s[a]);e=new Xt({props:o}),n[39](e),e.$on("hide",n[40]),e.$on("show",n[41]);let r={collection:n[5]};return i=new nu({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),l=!0},p(a,u){const f=u[0]&524288?pt(s,[s[0],s[1],Ct(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){l||(A(e.$$.fragment,a),A(i.$$.fragment,a),l=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),l=!1},d(a){a&&v(t),n[39](null),V(e,a),n[42](null),V(i,a)}}}const lo=50;function AO(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=Ze(e,c),m;We(n,zn,Se=>t(26,m=Se));const g=rt(),h="picker_"+j.randomString(5);let{value:_}=e,{field:k}=e,S,$,T="",C=[],D=[],O=1,E=0,L=!1,R=!1;function P(){return t(2,T=""),t(8,C=[]),t(6,D=[]),N(),q(!0),S==null?void 0:S.show()}function F(){return S==null?void 0:S.hide()}async function N(){const Se=j.toArray(_);if(!l||!Se.length)return;t(24,R=!0);let mt=[];const Bt=Se.slice(),cn=[];for(;Bt.length>0;){const on=[];for(const Vn of Bt.splice(0,lo))on.push(`id="${Vn}"`);cn.push(fe.collection(l).getFullList({batch:lo,filter:on.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(cn).then(on=>{mt=mt.concat(...on)}),t(6,D=[]);for(const on of Se){const Vn=j.findByKey(mt,"id",on);Vn&&D.push(Vn)}T.trim()||t(8,C=j.filterDuplicatesByKey(D.concat(C))),t(24,R=!1)}catch(on){on.isAbort||(fe.error(on),t(24,R=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&(T.trim()?t(8,C=[]):t(8,C=j.toArray(D).slice()));try{const mt=Se?1:O+1,Bt=j.getAllCollectionIdentifiers(s),cn=await fe.collection(l).getList(mt,lo,{filter:j.normalizeSearchFilter(T,Bt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:h+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(cn.i
2023-11-26 19:33:17 +08:00
(record: `+n[44].id+")")),K(e,"click",Ye(function(){$t(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(f,c){n=f,a===(a=r(n,c))&&u?u.p(n,c):(u.d(1),u=a(n),u&&(u.c(),u.m(e,i))),l&&$t(l.update)&&c[0]&32&&l.update.call(null,n[48]+`
(record: `+n[44].id+")"),c[0]&589856&&x(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,we(o)}}}function zm(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Hm(Nm(e,l,o));return{key:n,first:null,c(){t=ke();for(let o=0;o<s.length;o+=1)s[o].c();i=ke(),this.first=t},m(o,r){w(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);w(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=pe(e[45]);let a;for(a=0;a<l.length;a+=1){const u=Nm(e,l,a);s[a]?s[a].p(u,r):(s[a]=Hm(u),s[a].c(),s[a].m(i.parentNode,i))}for(;a<s.length;a+=1)s[a].d(1);s.length=l.length}},d(o){o&&(v(t),v(i)),at(s,o)}}}function Vm(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader loader-sm active"></span>',p(e,"class","block txt-center")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function GO(n){let e,t;function i(r,a){if(r[15])return KO;if(!r[6])return YO}let l=i(n),s=l&&l(n),o=n[6]&&Vm();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ke()},m(r,a){s&&s.m(r,a),w(r,e,a),o&&o.m(r,a),w(r,t,a)},p(r,a){l===(l=i(r))&&s?s.p(r,a):(s&&s.d(1),s=l&&l(r),s&&(s.c(),s.m(e.parentNode,e))),r[6]?o||(o=Vm(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(v(e),v(t)),s&&s.d(r),o&&o.d(r)}}}function XO(n){let e,t,i,l;const s=[WO,UO],o=[];function r(a,u){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ke()},m(a,u){o[e].m(a,u),w(a,i,u),l=!0},p(a,u){let f=e;e=r(a),e===f?o[e].p(a,u):(re(),I(o[f],1,1,()=>{o[f]=null}),ae(),t=o[e],t?t.p(a,u):(t=o[e]=s[e](a),t.c()),A(t,1),t.m(i.parentNode,i))},i(a){l||(A(t),l=!0)},o(a){I(t),l=!1},d(a){a&&v(i),o[e].d(a)}}}function QO(n){let e,t;return{c(){e=b("h4"),t=Y(n[0])},m(i,l){w(i,e,l),y(e,t)},p(i,l){l[0]&1&&se(t,i[0])},d(i){i&&v(e)}}}function Bm(n){let e,t;return e=new me({props:{class:"form-field file-picker-size-select",$$slots:{default:[xO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(A(e.$$.fragment,i),t=!0)},o(i){I(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function xO(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new _i({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function eD(n){var g;let e,t,i,l=j.hasImageExtension((g=n[9])==null?void 0:g.name),s,o,r,a,u,f,c,d,m=l&&Bm(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),m&&m.c(),s=M(),o=b("button"),r=b("span"),a=Y(n[1]),p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent m-r-auto"),e.disabled=n[6],p(r,"class","txt"),p(o,"type","button"),p(o,"class","btn btn-expanded"),o.disabled=u=!n[13]},m(h,_){w(h,e,_),y(e,t),w(h,i,_),m&&m.m(h,_),w(h,s,_),w(h,o,_),y(o,r),y(r,a),f=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(h,_){var k;(!f||_[0]&64)&&(e.disabled=h[6]),_[0]&512&&(l=j.hasImageExtension((k=h[9])==null?void 0:k.name)),l?m?(m.p(h,_),_[0]&512&&A(m,1)):(m=Bm(h),m.c(),A(m,1),m.m(s.parentNode,s)):m&&(re(),I(m,1,1,()=>{m=null}),ae()),(!f||_[0]&2)&&se(a,h[1]),(!f||_[0]&8192&&u!==(u=!h[13]))&&(o.disabled=u)},i(h){f||(A(m),f=!0)},o(h){I(m),f=!1},d(h){h&&(v(e),v(i),v(s),v(o)),m&&m.d(h),c=!1,we(d)}}}function tD(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[eD],header:[QO],default:[XO]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Fe(o,s[a]);e=new Xt({props:o}),n[33](e),e.$on("hide",n[34]),e.$on("show",n[35]);let r={collection:n[8]};return i=new nu({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?pt(s,[s[0],s[1],Ct(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.$
2023-11-26 19:33:17 +08:00
...
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){w(c,e,d),y(e,t),w(c,l,d),w(c,s,d),ue(s,n[5]),w(c,r,d),w(c,a,d),u||(f=K(s,"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(s,"id",o),d&32&&ue(s,c[5])},d(c){c&&(v(e),v(l),v(s),v(r),v(a)),u=!1,f()}}}function ID(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S;return l=new me({props:{class:"form-field required",name:"clientId",$$slots:{default:[MD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"teamId",$$slots:{default:[OD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"keyId",$$slots:{default:[DD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"duration",$$slots:{default:[ED,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"privateKey",$$slots:{default:[AD,({uniqueId:$})=>({23:$}),({uniqueId:$})=>$?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=M(),o=b("div"),B(r.$$.fragment),a=M(),u=b("div"),B(f.$$.fragment),c=M(),d=b("div"),B(m.$$.fragment),g=M(),B(h.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(u,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m($,T){w($,e,T),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,u),z(f,u,null),y(t,c),y(t,d),z(m,d,null),y(t,g),z(h,t,null),_=!0,k||(S=K(e,"submit",Ye(n[17])),k=!0)},p($,T){const C={};T&25165828&&(C.$$scope={dirty:T,ctx:$}),l.$set(C);const D={};T&25165832&&(D.$$scope={dirty:T,ctx:$}),r.$set(D);const O={};T&25165840&&(O.$$scope={dirty:T,ctx:$}),f.$set(O);const E={};T&25165888&&(E.$$scope={dirty:T,ctx:$}),m.$set(E);const L={};T&25165856&&(L.$$scope={dirty:T,ctx:$}),h.$set(L)},i($){_||(A(l.$$.fragment,$),A(r.$$.fragment,$),A(f.$$.fragment,$),A(m.$$.fragment,$),A(h.$$.fragment,$),_=!0)},o($){I(l.$$.fragment,$),I(r.$$.fragment,$),I(f.$$.fragment,$),I(m.$$.fragment,$),I(h.$$.fragment,$),_=!1},d($){$&&v(e),V(l),V(r),V(f),V(m),V(h),k=!1,S()}}}function LD(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function PD(n){let e,t,i,l,s,o,r,a,u,f;return{c(){e=b("button"),t=Y("Close"),i=M(),l=b("button"),s=b("i"),o=M(),r=b("span"),r.textContent="Generate and set secret",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[7],p(s,"class","ri-key-line"),p(r,"class","txt"),p(l,"type","submit"),p(l,"form",n[9]),p(l,"class","btn btn-expanded"),l.disabled=a=!n[8]||n[7],x(l,"btn-loading",n[7])},m(c,d){w(c,e,d),y(e,t),w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,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])&&(l.disabled=a),d&128&&x(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function FD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[PD],header:[LD],default:[ID]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const _o=15777e3;function ND(n,e,t){let i;const l=rt(),s="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function m(R={}){t(2,r=R.clientId||""),t(3,a=R.teamId||""),t(4,u=R.keyId||""),t(5,f=R.privateKey||""),t(6,c=R.duration||_o),Gt({}),o==null||o.show()}function g(){return o==null?void 0:o.hide()}async function h(){t(7,d=!0);try{const R=await fe.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),It("Successfully generated client secret."),l("submit",R),o==null||o.hide()}catch(R){fe.error(R)}t(7,d=!1)}function _(){r=t
`),r=b("button"),r.textContent="Restore draft",a=M(),u=b("button"),u.innerHTML='<i class="ri-close-line"></i>',f=M(),c=b("div"),p(i,"class","icon"),p(r,"type","button"),p(r,"class","btn btn-sm btn-secondary"),p(s,"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(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(t,a),y(t,u),y(e,f),y(e,c),m=!0,g||(h=[K(r,"click",n[38]),ve(Pe.call(null,u,"Discard draft")),K(u,"click",Ye(n[39]))],g=!0)},p:Q,i(_){m||(d&&d.end(1),m=!0)},o(_){_&&(d=ka(e,et,{duration:150})),m=!1},d(_){_&&v(e),_&&d&&d.end(),g=!1,we(h)}}}function Zm(n){let e,t,i;return t=new xb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(A(t.$$.fragment,l),i=!0)},o(l){I(t.$$.fragment,l),i=!1},d(l){l&&v(e),V(t)}}}function KD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k=!n[6]&&Zm(n);return{c(){e=b("label"),t=b("i"),i=M(),l=b("span"),l.textContent="id",s=M(),o=b("span"),a=M(),k&&k.c(),u=M(),f=b("input"),p(t,"class",Jn(j.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[72]),p(f,"type","text"),p(f,"id",c=n[72]),p(f,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(f,"minlength","15"),f.readOnly=m=!n[6]},m(S,$){w(S,e,$),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),w(S,a,$),k&&k.m(S,$),w(S,u,$),w(S,f,$),ue(f,n[3].id),g=!0,h||(_=K(f,"input",n[40]),h=!0)},p(S,$){(!g||$[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?k&&(re(),I(k,1,1,()=>{k=null}),ae()):k?(k.p(S,$),$[0]&64&&A(k,1)):(k=Zm(S),k.c(),A(k,1),k.m(u.parentNode,u)),(!g||$[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!g||$[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!g||$[0]&64&&m!==(m=!S[6]))&&(f.readOnly=m),$[0]&8&&f.value!==S[3].id&&ue(f,S[3].id)},i(S){g||(A(k),g=!0)},o(S){I(k),g=!1},d(S){S&&(v(e),v(a),v(u),v(f)),k&&k.d(S),h=!1,_()}}}function Gm(n){var u,f;let e,t,i,l,s;function o(c){n[41](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new lM({props:r}),te.push(()=>be(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&Xm();return{c(){B(e.$$.fragment),i=M(),a&&a.c(),l=ke()},m(c,d){z(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var g,h;const m={};d[0]&64&&(m.isNew=c[6]),d[0]&1&&(m.collection=c[0]),!t&&d[0]&8&&(t=!0,m.record=c[3],ye(()=>t=!1)),e.$set(m),(h=(g=c[0])==null?void 0:g.schema)!=null&&h.length?a||(a=Xm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(A(e.$$.fragment,c),s=!0)},o(c){I(e.$$.fragment,c),s=!1},d(c){c&&(v(i),v(l)),V(e,c),a&&a.d(c)}}}function Xm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function JD(n){let e,t,i;function l(o){n[54](o,n[69])}let s={field:n[69]};return n[3][n[69].name]!==void 0&&(s.value=n[3][n[69].name]),e=new RO({props:s}),te.push(()=>be(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[69]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[69].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function ZD(n){let e,t,i,l,s;function o(f){n[51](f,n[69])}function r(f){n[52](f,n[69])}function a(f){n[53](f,n[69])}let u={field:n[69],record:n[3]};return n[3][n[69].name]!==void 0&&(u.value=n[3][n[69].name]),n[4][n[69].name]!==void 0&&(u.uploadedFiles=n[4][n[69].name]),n[5][n[69].name]!==void 0&&(u.deletedFileNames=n[5][n[69].name]),e=new bO({props:u}),te.push(()=>be(e,"value",o)),te.push(()=>be(e,"uploadedFiles",r)),te.push(()=>be(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(f,c){z(e,f,c),s=!0},p(f,c){n=f;const d={};c[0]&1&&(d.field=n[69]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[69].name],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ye(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ye(()=>l=!1)),e.$set(d)},i(f){s||(A(e.$$.
2023-11-26 19:33:17 +08:00
record-panel
`+(n[16]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(n[14]&&!n[6]?"colored-header":"")+`
`,btnClose:!n[7],escClose:!n[7],overlayClose:!n[7],beforeHide:n[55],$$slots:{footer:[fE],header:[uE],default:[sE]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=`
2023-11-26 19:33:17 +08:00
record-panel
`+(l[16]?"overlay-panel-xl":"overlay-panel-lg")+`
`+(l[14]&&!l[6]?"colored-header":"")+`
`),s[0]&128&&(o.btnClose=!l[7]),s[0]&128&&(o.escClose=!l[7]),s[0]&128&&(o.overlayClose=!l[7]),s[0]&4352&&(o.beforeHide=l[55]),s[0]&60925|s[2]&2048&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[56](null),V(e,l)}}}const el="form",ks="providers";function dE(n,e,t){let i,l,s,o,r;const a=rt(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},m={},g=null,h=!1,_=!1,k={},S={},$=JSON.stringify(d),T=$,C=el,D=!0,O=!0;function E(ce){return F(ce),t(12,_=!0),t(13,C=el),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function R(){t(12,_=!1),L()}async function P(ce){if(ce&&typeof ce=="string"){try{return await fe.collection(f.id).getOne(ce)}catch(Me){Me.isAbort||(R(),console.warn("resolveModel:",Me),hi(`Unable to load record with id "${ce}"`))}return null}return ce}async function F(ce){t(7,O=!0),Gt({}),t(4,k={}),t(5,S={}),t(2,d=typeof ce=="string"?{id:ce,collectionId:f==null?void 0:f.id,collectionName:f==null?void 0:f.name}:ce||{}),t(3,m=structuredClone(d)),t(2,d=await P(ce)||{}),t(3,m=structuredClone(d)),await Qt(),t(10,g=W()),!g||H(m,g)?t(10,g=null):(delete g.password,delete g.passwordConfirm),t(28,$=JSON.stringify(m)),t(7,O=!1)}async function N(ce){var Xe,Jt;Gt({}),t(2,d=ce||{}),t(4,k={}),t(5,S={});const Me=((Jt=(Xe=f==null?void 0:f.schema)==null?void 0:Xe.filter(nt=>nt.type!="file"))==null?void 0:Jt.map(nt=>nt.name))||[];for(let nt in ce)Me.includes(nt)||t(3,m[nt]=ce[nt],m);await Qt(),t(28,$=JSON.stringify(m)),U()}function q(){return"record_draft_"+((f==null?void 0:f.id)||"")+"_"+((d==null?void 0:d.id)||"")}function W(ce){try{const Me=window.localStorage.getItem(q());if(Me)return JSON.parse(Me)}catch{}return ce}function G(ce){try{window.localStorage.setItem(q(),ce)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(q())}}function J(){g&&(t(3,m=g),t(10,g=null))}function H(ce,Me){var Bn;const Xe=structuredClone(ce||{}),Jt=structuredClone(Me||{}),nt=(Bn=f==null?void 0:f.schema)==null?void 0:Bn.filter(oi=>oi.type==="file");for(let oi of nt)delete Xe[oi.name],delete Jt[oi.name];const en=["expand","password","passwordConfirm"];for(let oi of en)delete Xe[oi],delete Jt[oi];return JSON.stringify(Xe)==JSON.stringify(Jt)}function U(){t(10,g=null),window.localStorage.removeItem(q())}async function le(ce=!0){if(!(h||!r||!(f!=null&&f.id))){t(11,h=!0);try{const Me=oe();let Xe;D?Xe=await fe.collection(f.id).create(Me):Xe=await fe.collection(f.id).update(m.id,Me),It(D?"Successfully created record.":"Successfully updated record."),U(),ce?R():N(Xe),a("save",{isNew:D,record:Xe})}catch(Me){fe.error(Me)}t(11,h=!1)}}function ee(){d!=null&&d.id&&an("Do you really want to delete the selected record?",()=>fe.collection(d.collectionId).delete(d.id).then(()=>{L(),It("Successfully deleted record."),a("delete",d)}).catch(ce=>{fe.error(ce)}))}function oe(){const ce=structuredClone(m||{}),Me=new FormData,Xe={id:ce.id},Jt={};for(const nt of(f==null?void 0:f.schema)||[])Xe[nt.name]=!0,nt.type=="json"&&(Jt[nt.name]=!0);i&&(Xe.username=!0,Xe.email=!0,Xe.emailVisibility=!0,Xe.password=!0,Xe.passwordConfirm=!0,Xe.verified=!0);for(const nt in ce)if(Xe[nt]){if(typeof ce[nt]>"u"&&(ce[nt]=null),Jt[nt]&&ce[nt]!=="")try{JSON.parse(ce[nt])}catch(en){const Bn={};throw Bn[nt]={code:"invalid_json",message:en.toString()},new qn({status:400,response:{data:Bn}})}j.addValueToFormData(Me,nt,ce[nt])}for(const nt in k){const en=j.toArray(k[nt]);for(const Bn of en)Me.append(nt,Bn)}for(const nt in S){const en=j.toArray(S[nt]);for(const Bn of en)Me.append(nt+"."+Bn,"")}return Me}function Te(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent verification email to ${d.email}?`,()=>fe.collection(f.id).requestVerification(d.email).then(()=>{It(`Successfully sent verification email to ${d.email}.`)}).catch(ce=>{fe.error(ce)}))}function je(){!(f!=null&&f.id)||!(d!=null&&d.email)||an(`Do you really want to sent password reset email to ${d.email}?`,()=>fe.collection(f.id).requestPasswordReset(d.email).then(()=>{It(`Successfully sent password reset ema
2023-11-26 19:33:17 +08:00
`),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.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(_,k){w(_,e,k),y(e,t),w(_,l,k),w(_,s,k),ue(s,n[0].subject),w(_,r,k),w(_,a,k),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),g||(h=[K(s,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],g=!0)},p(_,k){k[1]&1&&i!==(i=_[31])&&p(e,"for",i),k[1]&1&&o!==(o=_[31])&&p(s,"id",o),k[0]&1&&s.value!==_[0].subject&&ue(s,_[0].subject)},d(_){_&&(v(e),v(l),v(s),v(r),v(a)),g=!1,we(h)}}}function $A(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k;return{c(){e=b("label"),t=Y("Action URL"),l=M(),s=b("input"),r=M(),a=b("div"),u=Y(`Available placeholder parameters:
2023-11-26 19:33:17 +08:00
`),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=Y(`,
`),g=b("button"),g.textContent="{TOKEN} ",h=Y("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.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,$){w(S,e,$),y(e,t),w(S,l,$),w(S,s,$),ue(s,n[0].actionUrl),w(S,r,$),w(S,a,$),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),_||(k=[K(s,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(g,"click",n[19])],_=!0)},p(S,$){$[1]&1&&i!==(i=S[31])&&p(e,"for",i),$[1]&1&&o!==(o=S[31])&&p(s,"id",o),$[0]&1&&s.value!==S[0].actionUrl&&ue(s,S[0].actionUrl)},d(S){S&&(v(e),v(l),v(s),v(r),v(a)),_=!1,we(k)}}}function CA(n){let e,t,i,l;return{c(){e=b("textarea"),p(e,"id",t=n[31]),p(e,"class","txt-mono"),p(e,"spellcheck","false"),p(e,"rows","14"),e.required=!0},m(s,o){w(s,e,o),ue(e,n[0].body),i||(l=K(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&ue(e,s[0].body)},i:Q,o:Q,d(s){s&&v(e),i=!1,l()}}}function MA(n){let e,t,i,l;function s(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=Dt(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ke()},m(a,u){e&&z(e,a,u),w(a,i,u),l=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){re();const f=e;I(f.$$.fragment,1,0,()=>{V(f,1)}),ae()}o?(e=Dt(o,r(a)),te.push(()=>be(e,"value",s)),B(e.$$.fragment),A(e.$$.fragment,1),z(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){l||(e&&A(e.$$.fragment,a),l=!0)},o(a){e&&I(e.$$.fragment,a),l=!1},d(a){a&&v(i),e&&V(e,a)}}}function OA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T;const C=[MA,CA],D=[];function O(E,L){return E[4]&&!E[5]?0:1}return s=O(n),o=D[s]=C[s](n),{c(){e=b("label"),t=Y("Body (HTML)"),l=M(),o.c(),r=M(),a=b("div"),u=Y(`Available placeholder parameters:
2023-11-26 19:33:17 +08:00
`),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=Y(`,
`),g=b("button"),g.textContent="{TOKEN} ",h=Y(`,
`),_=b("button"),_.textContent="{ACTION_URL} ",k=Y("."),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(E,L){w(E,e,L),y(e,t),w(E,l,L),D[s].m(E,L),w(E,r,L),w(E,a,L),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,g),y(a,h),y(a,_),y(a,k),S=!0,$||(T=[K(f,"click",n[22]),K(d,"click",n[23]),K(g,"click",n[24]),K(_,"click",n[25])],$=!0)},p(E,L){(!S||L[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let R=s;s=O(E),s===R?D[s].p(E,L):(re(),I(D[R],1,1,()=>{D[R]=null}),ae(),o=D[s],o?o.p(E,L):(o=D[s]=C[s](E),o.c()),A(o,1),o.m(r.parentNode,r))},i(E){S||(A(o),S=!0)},o(E){I(o),S=!1},d(E){E&&(v(e),v(l),v(r),v(a)),D[s].d(E),$=!1,we(T)}}}function DA(n){let e,t,i,l,s,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[TA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new me({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[$A,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new me({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(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(r,a){z(e,r,a),w(r,t,a),z(i,r,a),w(r,l,a),z(s,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}),s.$set(c)},i(r){o||(A(e.$$.fragment,r),A(i.$$.fragment,r),A(s.$$.fragment,r),o=!0)},o(r){I(e.$$.fragment,r),I(i.$$.fragment,r),I(s.$$.fragment,r),o=!1},d(r){r&&(v(t),v(l)),V(e,r),V(i,r),V(s,r)}}}function ag(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){w(o,e,r),i=!0,l||(s=ve(Pe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Le(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Le(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&v(e),o&&t&&t.end(),l=!1,s()}}}function EA(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&ag();return{c(){e=b("div"),t=b("i"),i=M(),l=b("span"),s=Y(n[2]),o=M(),r=b("div"),a=M(),f&&f.c(),u=ke(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){w(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),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(s,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=ag(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(re(),I(f,1,1,()=>{f=null}),ae())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function AA(n){let e,t;const i=[n[8]];let l={$$slots:{header:[EA],default:[DA]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=Fe(l,i[s]);return e=new go({props:l}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){B(e.$$.fragment)},m(s,o){z(e,s,o),t=!0},p(s,o){const r=o[0]&256?pt(i,[Ct(s[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(A(e.$$.fragment,s),t=!0)},o(s){I(e.$$.fragment,s),t=!1},d(s){n[26](null),V(e,s)}}}let ug;function IA(n,e,t){let i;const l=["key","title","config","expand","collapse","collapseSiblings"];let s=Ze(e,l),o;We(n,gi,U=>t(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=ug,d=!1;function m(){f==null||f.expand()}function g(){f==null||f.collapse()}function h(){f==null||f.collapseSiblings()}async function _(){c||d||(t(5,d=!0),t(4,c=(await st(()=>import("./CodeEditor-779a52d1.js"),["./CodeEditor-779a52d1.js","./index-b30338ff.js"],import.meta.url)).default),ug=c,t(5,d=!1))}function k(U){j.copyToClipboard(U),To(`Copied ${U} to clipboard`,2e3)}_();function S(){u.subject=this.value,t(0,u)}const $=()=>k("{APP_NAME}"),T=()=>k("{APP_U
2023-11-26 19:33:17 +08:00
from the
`),r=b("strong"),u=Y(a),f=Y(`
to the
`),c=b("strong"),m=Y(d),g=Y(`.
`),h=b("br"),_=Y(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
`,S=Y(`,
`),$=b("a"),$.textContent=`s5cmd
`,T=Y(", etc."),C=M(),D=b("div"),p(i,"class","icon"),p(k,"href","https://github.com/rclone/rclone"),p(k,"target","_blank"),p(k,"rel","noopener noreferrer"),p(k,"class","txt-bold"),p($,"href","https://github.com/peak/s5cmd"),p($,"target","_blank"),p($,"rel","noopener noreferrer"),p($,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(R,P){w(R,e,P),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(r,u),y(s,f),y(s,c),y(c,m),y(s,g),y(s,h),y(s,_),y(s,k),y(s,S),y(s,$),y(s,T),y(e,C),y(e,D),E=!0},p(R,P){var F;(!E||P&1)&&a!==(a=(F=R[0].s3)!=null&&F.enabled?"S3 storage":"local file system")&&se(u,a),(!E||P&2)&&d!==(d=R[1].s3.enabled?"S3 storage":"local file system")&&se(m,d)},i(R){E||(R&&Ke(()=>{E&&(O||(O=Le(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(R){R&&(O||(O=Le(e,et,{duration:150},!1)),O.run(0)),E=!1},d(R){R&&v(e),R&&O&&O.end()}}}function yI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&_g(n);return{c(){t&&t.c(),e=ke()},m(l,s){t&&t.m(l,s),w(l,e,s)},p(l,s){var o;((o=l[0].s3)==null?void 0:o.enabled)!=l[1].s3.enabled?t?(t.p(l,s),s&3&&A(t,1)):(t=_g(l),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(re(),I(t,1,1,()=>{t=null}),ae())},d(l){l&&v(e),t&&t.d(l)}}}function bg(n){let e;function t(s,o){return s[4]?wI:s[5]?vI:kI}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function kI(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function vI(n){let e,t,i,l;return{c(){e=b("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(s,o){var r;w(s,e,o),i||(l=ve(t=Pe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function wI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function yg(n){let e,t,i,l;return{c(){e=b("button"),t=b("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(s,o){w(s,e,o),y(e,t),i||(l=K(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&v(e),i=!1,l()}}}function SI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;const k=[bI,_I],S=[];function $(T,C){return T[2]?0:1}return d=$(n),m=S[d]=k[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[7]),r=M(),a=b("div"),u=b("form"),f=b("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=M(),m.c(),p(i,"class","breadcrumb-item"),p(s,"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,C){w(T,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(T,r,C),w(T,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),g=!0,h||(_=K(u,"submit",Ye(n[16])),h=!0)},p(T,C){(!g||C&128)&&se(o,T[7]);let D=d;d=$(T),d===D?S[d].p(T,C):(re(),I(S[D],1,1,()=>{S[D]=null}),ae(),m=S[d],m?m.p(T,C):(m=S[d]=k[d](T),m.c()),A(m,1),m.m(u,null))},i(T){g||(A(m),g=!0)},o(T){I(m),g=!1},d(T){T&&(v(e),v(r),v(a)),S[d].d(),h=!1,_()}}}function TI(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[SI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(
another PocketBase environment.</p>`,t=M(),i=b("div"),l=b("button"),l.innerHTML='<span class="txt">Copy</span>',s=M(),B(o.$$.fragment),r=M(),a=b("div"),u=b("div"),f=M(),c=b("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(l,"type","button"),p(l,"class","btn btn-sm btn-transparent fade copy-schema svelte-jm5c4z"),p(i,"tabindex","0"),p(i,"class","export-preview svelte-jm5c4z"),p(u,"class","flex-fill"),p(c,"type","button"),p(c,"class","btn btn-expanded"),p(a,"class","flex m-t-base")},m(h,_){w(h,e,_),w(h,t,_),w(h,i,_),y(i,l),y(i,s),z(o,i,null),n[8](i),w(h,r,_),w(h,a,_),y(a,u),y(a,f),y(a,c),d=!0,m||(g=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(h,_){const k={};_&4&&(k.content=h[2]),o.$set(k)},i(h){d||(A(o.$$.fragment,h),d=!0)},o(h){I(o.$$.fragment,h),d=!1},d(h){h&&(v(e),v(t),v(i),v(r),v(a)),V(o),n[8](null),m=!1,we(g)}}}function tL(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function nL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[tL,eL],g=[];function h(_,k){return _[1]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[3]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k&8)&&se(o,_[3]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function iL(n){let e,t,i,l;return e=new bi({}),i=new _n({props:{$$slots:{default:[nL]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment)},m(s,o){z(e,s,o),w(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&8207&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(A(e.$$.fragment,s),A(i.$$.fragment,s),l=!0)},o(s){I(e.$$.fragment,s),I(i.$$.fragment,s),l=!1},d(s){s&&v(t),V(e,s),V(i,s)}}}function lL(n,e,t){let i,l;We(n,Et,_=>t(3,l=_)),tn(Et,l="Export collections",l);const s="export_"+j.randomString(5);let o,r=[],a=!1;u();async function u(){t(1,a=!0);try{t(6,r=await fe.collections.getFullList(100,{$cancelKey:s,sort:"updated"}));for(let _ of r)delete _.created,delete _.updated}catch(_){fe.error(_)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),To("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(_){te[_?"unshift":"push"](()=>{o=_,t(0,o)})}const g=_=>{if(_.ctrlKey&&_.code==="KeyA"){_.preventDefault();const k=window.getSelection(),S=document.createRange();S.selectNodeContents(o),k.removeAllRanges(),k.addRange(S)}},h=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,f,c,r,d,m,g,h]}class sL extends _e{constructor(e){super(),ge(this,e,lL,iL,he,{})}}function Lg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Pg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function Fg(n,e,t){const i=n.slice();return i[14]=e[t],i}function Ng(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function Rg(n,e,t){const i=n.slice();return i[14]=e[t],i}function qg(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function jg(n,e,t){const i=n.slice();return i[30]=e[t],i}function oL(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&Hg(),a=n[0].name!==n[1].name&&zg(n);return{c(){e=b("div"),r&&r.c(),t=M(),a&&a.c(),i=M(),l=b("strong"),o=Y(s),p(l,"class","txt"),p(e,"class","inline-flex fleg-gap-5")},m(u,f){w(u,e,f),r&&r.m(e,null),y(e,t),a&&a.m(e,null),y(e,i),y(e,l),y(l,o)},p(u,f){u[9]?r||(r=Hg(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=zg(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&se(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function rL(n){var o;let e,t,i,l=((o=n[0])==null?voi
2023-11-26 19:33:17 +08:00
- ${T.join(`
- `)}`,()=>{g()}):g()}async function g(){if(!u){t(4,u=!0);try{await fe.collections.import(o,a),It("Successfully imported collections configuration."),i("submit")}catch(T){fe.error(T)}t(4,u=!1),c()}}const h=()=>m(),_=()=>!u;function k(T){te[T?"unshift":"push"](()=>{l=T,t(1,l)})}function S(T){Ee.call(this,n,T)}function $(T){Ee.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,h,_,k,S,$]}class _L extends _e{constructor(e){super(),ge(this,e,gL,hL,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function xg(n,e,t){const i=n.slice();return i[32]=e[t],i}function e_(n,e,t){const i=n.slice();return i[35]=e[t],i}function t_(n,e,t){const i=n.slice();return i[32]=e[t],i}function bL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[kL,({uniqueId:N})=>({40:N}),({uniqueId:N})=>[0,N?512:0]]},$$scope:{ctx:n}}});let E=!1,L=n[6]&&n[1].length&&!n[7]&&i_(),R=n[6]&&n[1].length&&n[7]&&l_(n),P=n[13].length&&h_(n),F=!!n[0]&&g_(n);return{c(){e=b("input"),t=M(),i=b("div"),l=b("p"),s=Y(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=M(),B(a.$$.fragment),u=M(),f=M(),L&&L.c(),c=M(),R&&R.c(),d=M(),P&&P.c(),m=M(),g=b("div"),F&&F.c(),h=M(),_=b("div"),k=M(),S=b("button"),$=b("span"),$.textContent="Review",p(e,"type","file"),p(e,"class","hidden"),p(e,"accept",".json"),p(o,"class","btn btn-outline btn-sm m-l-5"),x(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(_,"class","flex-fill"),p($,"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(N,q){w(N,e,q),n[19](e),w(N,t,q),w(N,i,q),y(i,l),y(l,s),y(l,o),w(N,r,q),z(a,N,q),w(N,u,q),w(N,f,q),L&&L.m(N,q),w(N,c,q),R&&R.m(N,q),w(N,d,q),P&&P.m(N,q),w(N,m,q),w(N,g,q),F&&F.m(g,null),y(g,h),y(g,_),y(g,k),y(g,S),y(S,$),C=!0,D||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],D=!0)},p(N,q){(!C||q[0]&4096)&&x(o,"btn-loading",N[12]);const W={};q[0]&64&&(W.class="form-field "+(N[6]?"":"field-error")),q[0]&65|q[1]&1536&&(W.$$scope={dirty:q,ctx:N}),a.$set(W),N[6]&&N[1].length&&!N[7]?L||(L=i_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),N[6]&&N[1].length&&N[7]?R?R.p(N,q):(R=l_(N),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),N[13].length?P?P.p(N,q):(P=h_(N),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),N[0]?F?F.p(N,q):(F=g_(N),F.c(),F.m(g,h)):F&&(F.d(1),F=null),(!C||q[0]&16384&&T!==(T=!N[14]))&&(S.disabled=T)},i(N){C||(A(a.$$.fragment,N),A(E),C=!0)},o(N){I(a.$$.fragment,N),I(E),C=!1},d(N){N&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(g)),n[19](null),V(a,N),L&&L.d(N),R&&R.d(N),P&&P.d(N),F&&F.d(),D=!1,we(O)}}}function yL(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){w(t,e,i)},p:Q,i:Q,o:Q,d(t){t&&v(e)}}}function n_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function kL(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&n_();return{c(){e=b("label"),t=Y("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ke(),p(e,"for",i=n[40]),p(e,"class","p-b-10"),p(s,"id",o=n[40]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){w(d,e,m),y(e,t),w(d,l,m),w(d,s,m),ue(s,n[0]),w(d,r,m),c&&c.m(d,m),w(d,a,m),u||(f=K(s,"input",n[22]),u=!0)},p(d,m){m[1]&512&&i!==(i=d[40])&&p(e,"for",i),m[1]&512&&o!==(o=d[40])&&p(s,"id",o),m[0]&1&&ue(s,d[0]),d[0]&&!d[6]?c||(c=n_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(v(e),v(l),v(s),v(r),v(a)),c&&c.d(d),u=!1,f()}}}function i_(n){let e;return{c(){e=b("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&&v(e)}}}function l_(n){let e,t,i,l,s,o=n[9].length&&s_(n),r=n[4].length&&a_(n),a=n[8].length&&d_(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=M(),i=b("div"),o&&o.c(),l=M(),r&&r.c(),s=M(),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),y(i,l),r&&r.m(i,null),y(i,s),a&&a.m(i,null)},p(u,f){u[9].length?o?o.p(u,f):(o=s_(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=a_(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=d_(u),a.c(),a.m(i,null)):a&&(a.d(1),a=null)},d(u){u&&(v(e),v(t),v(i)),o&&o.d(),r&&r.d(),a&&a.d()}}}function s_(n){let e=[],t=new Map,i,l=pe(n[9]);const s=o=>o[32].id;for(let o=0;o<l.length;o+=1){let r=t_(n,l,o),a=s(r);t.set(a,e[o]=r_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ke()},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&&(l=pe(o[9]),e=dt(e,r,s,1,o,l,t,i.parentNode,Pi,r_,i,t_))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function o_(n){let e,t,i=n[32].id+"",l,s;return{c(){e=b("small"),t=Y("("),l=Y(i),s=Y(")"),p(e,"class","txt-hint")},m(o,r){w(o,e,r),y(e,t),y(e,l),y(e,s)},p(o,r){r[0]&512&&i!==(i=o[32].id+"")&&se(l,i)},d(o){o&&v(e)}}}function r_(n,e){let t,i,l,s,o=e[32].name+
2023-11-26 19:33:17 +08:00
imported with different IDs. You can replace them in the import if you want
to.</string>`,s=M(),o=b("button"),o.innerHTML='<span class="txt">Replace with original ids</span>',p(t,"class","icon"),p(l,"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),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),r||(a=K(o,"click",n[24]),r=!0)},p:Q,d(u){u&&v(e),r=!1,a()}}}function g_(n){let e,t,i;return{c(){e=b("button"),e.innerHTML='<span class="txt">Clear</span>',p(e,"type","button"),p(e,"class","btn btn-transparent link-hint")},m(l,s){w(l,e,s),t||(i=K(e,"click",n[25]),t=!0)},p:Q,d(l){l&&v(e),t=!1,i()}}}function vL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[yL,bL],g=[];function h(_,k){return _[5]?0:1}return f=h(n),c=g[f]=m[f](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[15]),r=M(),a=b("div"),u=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","panel"),p(a,"class","wrapper")},m(_,k){w(_,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(_,r,k),w(_,a,k),y(a,u),g[f].m(u,null),d=!0},p(_,k){(!d||k[0]&32768)&&se(o,_[15]);let S=f;f=h(_),f===S?g[f].p(_,k):(re(),I(g[S],1,1,()=>{g[S]=null}),ae(),c=g[f],c?c.p(_,k):(c=g[f]=m[f](_),c.c()),A(c,1),c.m(u,null))},i(_){d||(A(c),d=!0)},o(_){I(c),d=!1},d(_){_&&(v(e),v(r),v(a)),g[f].d()}}}function wL(n){let e,t,i,l,s,o;e=new bi({}),i=new _n({props:{$$slots:{default:[vL]},$$scope:{ctx:n}}});let r={};return s=new _L({props:r}),n[27](s),s.$on("submit",n[28]),{c(){B(e.$$.fragment),t=M(),B(i.$$.fragment),l=M(),B(s.$$.fragment)},m(a,u){z(e,a,u),w(a,t,u),z(i,a,u),w(a,l,u),z(s,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={};s.$set(c)},i(a){o||(A(e.$$.fragment,a),A(i.$$.fragment,a),A(s.$$.fragment,a),o=!0)},o(a){I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!1},d(a){a&&(v(t),v(l)),V(e,a),V(i,a),n[27](null),V(s,a)}}}function SL(n,e,t){let i,l,s,o,r,a,u;We(n,Et,U=>t(15,u=U)),tn(Et,u="Import collections",u);let f,c,d="",m=!1,g=[],h=[],_=!0,k=[],S=!1;$();async function $(){t(5,S=!0);try{t(2,h=await fe.collections.getFullList(200));for(let U of h)delete U.created,delete U.updated}catch(U){fe.error(U)}t(5,S=!1)}function T(){if(t(4,k=[]),!!i)for(let U of g){const le=j.findByKey(h,"id",U.id);!(le!=null&&le.id)||!j.hasCollectionChanges(le,U,_)||k.push({new:U,old:le})}}function C(){t(1,g=[]);try{t(1,g=JSON.parse(d))}catch{}Array.isArray(g)?t(1,g=j.filterDuplicatesByKey(g)):t(1,g=[]);for(let U of g)delete U.created,delete U.updated,U.schema=j.filterDuplicatesByKey(U.schema)}function D(){var U,le;for(let ee of g){const oe=j.findByKey(h,"name",ee.name)||j.findByKey(h,"id",ee.id);if(!oe)continue;const Te=ee.id,je=oe.id;ee.id=je;const Ve=Array.isArray(oe.schema)?oe.schema:[],Qe=Array.isArray(ee.schema)?ee.schema:[];for(const tt of Qe){const Ge=j.findByKey(Ve,"name",tt.name);Ge&&Ge.id&&(tt.id=Ge.id)}for(let tt of g)if(Array.isArray(tt.schema))for(let Ge of tt.schema)(U=Ge.options)!=null&&U.collectionId&&((le=Ge.options)==null?void 0:le.collectionId)===Te&&(Ge.options.collectionId=je)}t(0,d=JSON.stringify(g,null,4))}function O(U){t(12,m=!0);const le=new FileReader;le.onload=async ee=>{t(12,m=!1),t(10,f.value="",f),t(0,d=ee.target.result),await Qt(),g.length||(hi("Invalid collections configuration."),E())},le.onerror=ee=>{console.warn(ee),hi("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},le.readAsText(U)}function E(){t(0,d=""),t(10,f.value="",f),Gt({})}function L(U){te[U?"unshift":"push"](()=>{f=U,t(10,f)})}const R=()=>{f.files.length&&O(f.files[0])},P=()=>{f.click()};function F(){d=this.value,t(0,d)}function N(){_=this.checked,t(3,_)}const q=()=>D(),W=()=>E(),G=()=>c==null?void 0:c.show(h,g,_);function J(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const H=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),n.$$.dirty[0]&3&&t(6,i=!!d&&g.length&&g.length===g.filter(U=>!!U.id&&!!U.name).length),n.$$.dirty[0]&78&&t(9,l=h.filter(U=>i&&_&&!j.findByKey(g,"id",U.id))),n.
2023-11-26 19:33:17 +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
separately since they are not locally stored and will not be included in the final backup!</p></div>`,t=M(),i=b("form"),B(l.$$.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),z(l,i,null),s=!0,o||(r=K(i,"submit",Ye(n[5])),o=!0)},p(a,u){const f={};u&98308&&(f.$$scope={dirty:u,ctx:a}),l.$set(f)},i(a){s||(A(l.$$.fragment,a),s=!0)},o(a){I(l.$$.fragment,a),s=!1},d(a){a&&(v(e),v(t),v(i)),V(l),o=!1,r()}}}function ML(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function OL(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=M(),l=b("button"),s=b("span"),s.textContent="Start backup",p(t,"class","txt"),p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[3],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[4]),p(l,"class","btn btn-expanded"),l.disabled=n[3],x(l,"btn-loading",n[3])},m(a,u){w(a,e,u),y(e,t),w(a,i,u),w(a,l,u),y(l,s),o||(r=K(e,"click",n[0]),o=!0)},p(a,u){u&8&&(e.disabled=a[3]),u&8&&(l.disabled=a[3]),u&8&&x(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function DL(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[OL],header:[ML],default:[CL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function EL(n,e,t){const i=rt(),l="backup_create_"+j.randomString(5);let s,o="",r=!1,a;function u(S){Gt({}),t(3,r=!1),t(2,o=S||""),s==null||s.show()}function f(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{f()},1500);try{await fe.backups.create(o,{$cancelKey:l}),t(3,r=!1),f(),i("submit"),It("Successfully generated new backup.")}catch(S){S.isAbort||fe.error(S)}clearTimeout(a),t(3,r=!1)}}Ss(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(To("A backup has already been started, please wait."),!1):!0,g=()=>(r&&To("The backup was started but may take a while to complete. You can come back later.",4500),!0);function h(S){te[S?"unshift":"push"](()=>{s=S,t(1,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,g,h,_,k]}class AL extends _e{constructor(e){super(),ge(this,e,EL,DL,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function IL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Backup name"),l=M(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[2]),r||(a=K(s,"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(s,"id",o),f&4&&s.value!==u[2]&&ue(s,u[2])},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function LL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_;return u=new rl({props:{value:n[1]}}),m=new me({props:{class:"form-field required m-0",name:"name",$$slots:{default:[IL,({uniqueId:k})=>({15:k}),({uniqueId:k})=>k?32768:0]},$$scope:{ctx:n}}}),{c(){e=b("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-11-26 19:33:17 +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=M(),i=b("div"),l=Y(`Type the backup name
`),s=b("div"),o=b("span"),r=Y(n[1]),a=M(),B(u.$$.fragment),f=Y(`
to confirm:`),c=M(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-sm"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(k,S){w(k,e,S),w(k,t,S),w(k,i,S),y(i,l),y(i,s),y(s,o),y(o,r),y(s,a),z(u,s,null),y(i,f),w(k,c,S),w(k,d,S),z(m,d,null),g=!0,h||(_=K(d,"submit",Ye(n[7])),h=!0)},p(k,S){(!g||S&2)&&se(r,k[1]);const $={};S&2&&($.value=k[1]),u.$set($);const T={};S&98308&&(T.$$scope={dirty:S,ctx:k}),m.$set(T)},i(k){g||(A(u.$$.fragment,k),A(m.$$.fragment,k),g=!0)},o(k){I(u.$$.fragment,k),I(m.$$.fragment,k),g=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),V(u),V(m),h=!1,_()}}}function PL(n){let e,t,i,l;return{c(){e=b("h4"),t=Y("Restore "),i=b("strong"),l=Y(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){w(s,e,o),y(e,t),y(e,i),y(i,l)},p(s,o){o&2&&se(l,s[1])},d(s){s&&v(e)}}}function FL(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=Y("Cancel"),i=M(),l=b("button"),s=b("span"),s.textContent="Restore backup",p(e,"type","button"),p(e,"class","btn btn-transparent"),e.disabled=n[4],p(s,"class","txt"),p(l,"type","submit"),p(l,"form",n[6]),p(l,"class","btn btn-expanded"),l.disabled=o=!n[5]||n[4],x(l,"btn-loading",n[4])},m(u,f){w(u,e,f),y(e,t),w(u,i,f),w(u,l,f),y(l,s),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])&&(l.disabled=o),f&16&&x(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function NL(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[FL],header:[PL],default:[LL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(A(e.$$.fragment,l),t=!0)},o(l){I(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function RL(n,e,t){let i;const l="backup_restore_"+j.randomString(5);let s,o="",r="",a=!1,u=null;function f(S){Gt({}),t(2,r=""),t(1,o=S),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var S;if(!(!i||a)){clearTimeout(u),t(4,a=!0);try{await fe.backups.restore(o),u=setTimeout(()=>{window.location.reload()},2e3)}catch($){clearTimeout(u),$!=null&&$.isAbort||(t(4,a=!1),hi(((S=$.response)==null?void 0:S.message)||$.message))}}}Ss(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const g=()=>!a;function h(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function _(S){Ee.call(this,n,S)}function k(S){Ee.call(this,n,S)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,f,m,g,h,_,k]}class qL extends _e{constructor(e){super(),ge(this,e,RL,NL,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function __(n,e,t){const i=n.slice();return i[22]=e[t],i}function b_(n,e,t){const i=n.slice();return i[19]=e[t],i}function jL(n){let e=[],t=new Map,i,l,s=pe(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let u=__(n,s,a),f=o(u);t.set(f,e[a]=k_(f,u))}let r=null;return s.length||(r=y_()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ke(),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),l=!0},p(a,u){u&876&&(s=pe(a[3]),re(),e=dt(e,u,o,1,a,s,t,i.parentNode,Lt,k_,i,__),ae(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=y_(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let u=0;u<s.length;u+=1)A(e[u]);l=!0}},o(a){for(let u=0;u<e.length;u+=1)I(e[u]);l=!1},d(a){a&&v(i);for(let u=0;u<e.length;u+=1)e[u].d(a);r&&r.d(a)}}}function HL(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=v_(b_(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ke()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);w(l,e,s)},p(l,s){if(s&8){t=pe(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=b_(l,t,o);i[o]?i[o].p(r,s):(i[o]=v_(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:Q,o:Q,d(l){l&&v(e),at(i,l)}}}f
2023-11-26 19:33:17 +08:00
`),T=b("span"),T.textContent="macros",C=Y(`.
`),D=b("br"),O=Y(`
The timezone is in UTC.`),p(e,"for",i=n[31]),s.required=!0,p(s,"type","text"),p(s,"id",o=n[31]),p(s,"class","txt-lg txt-mono"),p(s,"placeholder","* * * * *"),s.autofocus=r=!((F=(P=n[0])==null?void 0:P.backups)!=null&&F.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(f,"type","button"),p(f,"class","btn btn-sm btn-outline p-r-0"),p(u,"class","form-field-addon"),p(T,"class","link-primary"),p(k,"class","help-block")},m(P,F){var N,q;w(P,e,F),y(e,t),w(P,l,F),w(P,s,F),ue(s,n[1].backups.cron),w(P,a,F),w(P,u,F),y(u,f),y(f,c),y(f,d),y(f,m),y(f,g),z(h,f,null),w(P,_,F),w(P,k,F),y(k,S),y(S,$),y(S,T),y(S,C),y(S,D),y(S,O),E=!0,(q=(N=n[0])==null?void 0:N.backups)!=null&&q.cron||s.focus(),L||(R=[K(s,"input",n[18]),ve(Pe.call(null,T,`@yearly
2023-11-26 19:33:17 +08:00
@annually
@monthly
@weekly
@daily
@midnight
@hourly`))],L=!0)},p(P,F){var q,W;(!E||F[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!E||F[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!E||F[0]&1&&r!==(r=!((W=(q=P[0])==null?void 0:q.backups)!=null&&W.cron)))&&(s.autofocus=r),F[0]&2&&s.value!==P[1].backups.cron&&ue(s,P[1].backups.cron);const N={};F[0]&2|F[1]&2&&(N.$$scope={dirty:F,ctx:P}),h.$set(N)},i(P){E||(A(h.$$.fragment,P),E=!0)},o(P){I(h.$$.fragment,P),E=!1},d(P){P&&(v(e),v(l),v(s),v(a),v(u),v(_),v(k)),V(h),L=!1,we(R)}}}function eP(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=Y("Max @auto backups to keep"),l=M(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(u,f){w(u,e,f),y(e,t),w(u,l,f),w(u,s,f),ue(s,n[1].backups.cronMaxKeep),r||(a=K(s,"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(s,"id",o),f[0]&2&&ut(s.value)!==u[1].backups.cronMaxKeep&&ue(s,u[1].backups.cronMaxKeep)},d(u){u&&(v(e),v(l),v(s)),r=!1,a()}}}function $_(n){let e;function t(s,o){return s[7]?iP:s[8]?nP:tP}let i=t(n),l=i(n);return{c(){l.c(),e=ke()},m(s,o){l.m(s,o),w(s,e,o)},p(s,o){i===(i=t(s))&&l?l.p(s,o):(l.d(1),l=i(s),l&&(l.c(),l.m(e.parentNode,e)))},d(s){s&&v(e),l.d(s)}}}function tP(n){let e;return{c(){e=b("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:Q,d(t){t&&v(e)}}}function nP(n){let e,t,i,l;return{c(){e=b("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(s,o){var r;w(s,e,o),i||(l=ve(t=Pe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&$t(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&v(e),i=!1,l()}}}function iP(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){w(t,e,i)},p:Q,d(t){t&&v(e)}}}function C_(n){let e,t,i,l,s;return{c(){e=b("button"),t=b("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),y(e,t),l||(s=K(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&v(e),l=!1,s()}}}function lP(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,g,h,_,k,S,$,T,C,D,O,E,L,R,P;m=new Xo({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),h=new JL({props:{class:"btn-sm"}}),h.$on("success",n[13]);let F={};k=new WL({props:F}),n[15](k);function N(J,H){return J[6]?GL:ZL}let q=N(n),W=q(n),G=n[6]&&!n[4]&&S_(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=M(),s=b("div"),o=Y(n[10]),r=M(),a=b("div"),u=b("div"),f=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=M(),B(m.$$.fragment),g=M(),B(h.$$.fragment),_=M(),B(k.$$.fragment),S=M(),$=b("hr"),T=M(),C=b("button"),D=b("span"),D.textContent="Backups options",O=M(),W.c(),E=M(),G&&G.c(),p(i,"class","breadcrumb-item"),p(s,"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(D,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-secondary"),C.disabled=n[4],x(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(J,H){w(J,e,H),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(J,r,H),w(J,a,H),y(a,u),y(u,f),y(f,c),y(f,d),z(m,f,null),y(f,g),z(h,f,null),y(u,_),z(k,u,null),y(u,S),y(u,$),y(u,T),y(u,C),y(C,D),y(C,O),W.m(C,null),y(u,E),G&&G.m(u,null),L=!0,R||(P=[K(C,"click",n[16]),K(u,"submit",Ye(n[11]))],R=!0)},p(J,H){(!L||H[0]&1024)&&se(o,J[10]);const U={};k.$set(U),q!==(q=N(J))&&(W.d(1),W=q(J),W&&(W.c(),W.m(C,null))),(!L||H[0]&16)&&(C.disabled=J[4]),(!L||H[0]&16)&&x(C,"btn-loading",J[4]),J[6]&&!J[4]?G?(G.p(J,H),H[0]&80&&A(G,1)):(G=S_(J),G.c(),A(G,1),G.m(u,null)):G&&(re(),I(G,1,1,()=>{G=null}),ae())},i(J){L||(A(m.$$.fragment,J),A(h.$$.fragment,J),A(k.$$.fragment,J),A(G),L=!0)},o(J){I(m.$$.fragment,J),I(h.$$.fragment,J),I(