pocketbase/ui/dist/assets/index-96bcf9fd.js

163 lines
984 KiB
JavaScript
Raw Normal View History

var xb=Object.defineProperty;var e0=(n,e,t)=>e in n?xb(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ue=(n,e,t)=>(e0(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 ks=n=>n;function Ne(n,e){for(const t in e)n[t]=e[t];return n}function t0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function vg(n){return n()}function nu(){return Object.create(null)}function we(n){n.forEach(vg)}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 Is;function nn(n,e){return n===e?!0:(Is||(Is=document.createElement("a")),Is.href=e,n===Is.href)}function n0(n){return Object.keys(n).length===0}function ca(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 i0(n){let e;return ca(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ca(e,t))}function kt(n,e,t,i){if(n){const l=wg(n,e,t,i);return n[0](l)}}function wg(n,e,t,i){return n[1]&&i?Ne(t.ctx.slice(),n[1](i(e))):t.ctx}function vt(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 wt(n,e,t,i,l,s){if(l){const o=wg(e,t,i,s);n.p(o,l)}}function St(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 Ge(n,e){const t={};e=new Set(e);for(const i in n)!e.has(i)&&i[0]!=="$"&&(t[i]=n[i]);return t}function 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 iu(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Sg=typeof window<"u";let jo=Sg?()=>window.performance.now():()=>Date.now(),da=Sg?n=>requestAnimationFrame(n):Q;const _l=new Set;function $g(n){_l.forEach(e=>{e.c(n)||(_l.delete(e),e.f())}),_l.size!==0&&da($g)}function Ho(n){let e;return _l.size===0&&da($g),{promise:new Promise(t=>{_l.add(e={c:n,f:t})}),abort(){_l.delete(e)}}}function y(n,e){n.appendChild(e)}function Tg(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function l0(n){const e=b("style");return e.textContent="/* empty */",s0(Tg(n),e),e.sheet}function s0(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 ut(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 ye(){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 o0=["width","height"];function ti(n,e){const t=Object.getOwnPropertyDescriptors(n.__proto__);for(const i in e)e[i]==null?n.removeAttribute(i):i==="style"?n.style.cssText=e[i]:i==="__value"?n.value
`;for(let g=0;g<=1;g+=a){const k=e+(t-e)*s(g);u+=g*100+`%{${o(k,1-k)}}
`}const f=u+`100% {${o(t,1-t)}}
}`,c=`__svelte_${f0(f)}_${r}`,d=Tg(n),{stylesheet:m,rules:h}=yo.get(d)||c0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${f}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,ko+=1,c}function as(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||d0())}function d0(){da(()=>{ko||(yo.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&v(e)}),yo.clear())})}function p0(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=ks,start:a=jo()+s,end:u=a+o,tick:f=Q,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=rs(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&as(n,h),d=!1}return Ho(k=>{if(!m&&k>=a&&(m=!0),m&&k>=u&&(f(1,0),g()),!d)return!1;if(m){const S=k-a,T=0+1*r(S/o);f(T,1-T)}return!0}),_(),f(0,1),g}function m0(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,Mg(n,l)}}function Mg(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 us;function di(n){us=n}function vs(){if(!us)throw new Error("Function called outside component initialization");return us}function Vt(n){vs().$$.on_mount.push(n)}function h0(n){vs().$$.after_update.push(n)}function ws(n){vs().$$.on_destroy.push(n)}function ot(){const n=vs();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Cg(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Ae(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const hl=[],te=[];let gl=[];const jr=[],Og=Promise.resolve();let Hr=!1;function Dg(){Hr||(Hr=!0,Og.then(pa))}function Qt(){return Dg(),Og}function Ke(n){gl.push(n)}function ke(n){jr.push(n)}const ir=new Set;let cl=0;function pa(){if(cl!==0)return;const n=us;do{try{for(;cl<hl.length;){const e=hl[cl];cl++,di(e),_0(e.$$)}}catch(e){throw hl.length=0,cl=0,e}for(di(null),hl.length=0,cl=0;te.length;)te.pop()();for(let e=0;e<gl.length;e+=1){const t=gl[e];ir.has(t)||(ir.add(t),t())}gl.length=0}while(hl.length);for(;jr.length;)jr.pop()();Hr=!1,ir.clear(),di(n)}function _0(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 g0(n){const e=[],t=[];gl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),gl=e}let Fl;function ma(){return Fl||(Fl=Promise.resolve(),Fl.then(()=>{Fl=null})),Fl}function Gi(n,e,t){n.dispatchEvent(Cg(`${e?"intro":"outro"}${t}`))}const oo=new Set;let ei;function oe(){ei={r:0,c:[],p:ei}}function re(){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 ha={duration:0};function Eg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function u(){o&&as(n,o)}function f(){const{delay:d=0,duration:m=300,easing:h=ks,tick:_=Q,css:g}=l||ha;g&&(o=rs(n,0,1,m,d,h,g,a++)),_(0,1);const k=jo()+d,S=k+m;r&&r.abort(),s=!0,Ke(()=>Gi(n,!0,"start")),r=Ho(T=>{if(s){if(T>=S)return _(1,0),Gi(n,!0,"end"),u(),s=!1;if(T>=k){const $=h((T-k)/m);_($,1-$)}}return s})}let c=!1;return{start(){c||(c=!0,as(n),$t(l)?(l=l(i),ma().then(f)):f())},invalidate(){c=!1},end(){s&&(u(),s=!1)}}}function _a(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=ks,tick:m=Q,css:h}=l||ha;h&&(o=rs(n,1,0,c,f,d,h));const _=jo()+f,g=_+c;Ke(()=>Gi(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),Ho(k=>{if(s){if(k>=g)return m(0,1),Gi(
`),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 Ko=Dn([]);function $o(n,e=4e3){return Jo(n,"info",e)}function It(n,e=3e3){return Jo(n,"success",e)}function ni(n,e=4500){return Jo(n,"error",e)}function Kk(n,e=4500){return Jo(n,"warning",e)}function Jo(n,e,t){t=t||4e3;const i={message:n,type:e,duration:t,timeout:setTimeout(()=>{q1(i)},t)};Ko.update(l=>(Oa(l,i.message),j.pushOrReplaceByKey(l,i,"message"),l))}function q1(n){Ko.update(e=>(Oa(e,n),e))}function Ma(){Ko.update(n=>{for(let e of n)Oa(n,e);return[]})}function Oa(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 _i=Dn({});function Gt(n){_i.set(n||{})}function ii(n){_i.update(e=>(j.deleteByPath(e,n),e))}const Da=Dn({});function Jr(n){Da.set(n||{})}const zn=Dn([]),li=Dn({}),To=Dn(!1),j1=Dn({});function Jk(n){zn.update(e=>{const t=j.findByKey(e,"id",n);return t?li.set(t):e.length&&li.set(e[0]),e})}function Zk(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"),Ea(),j.sortCollections(e)))}function Gk(n){zn.update(e=>(j.removeByKey(e,"id",n.id),li.update(t=>t.id===n.id?e[0]:t),Ea(),e))}async function Xk(n=null){To.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]),Ea()}catch(e){fe.error(e)}To.set(!1)}function Ea(){j1.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 pr="pb_admin_file_token";Bo.prototype.logout=function(n=!0){this.authStore.clear(),n&&nl("/login")};Bo.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&&ni(s),j.isEmpty(l.data)||Gt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),nl("/")};Bo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=i0(j1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(pr)||"";return(!t||ga(t,10))&&(t&&localStorage.removeItem(pr),this._adminFileTokenRequest||(this._adminFileTokenRequest=this.files.getToken()),t=await this._adminFileTokenRequest,localStorage.setItem(pr,t),this._adminFileTokenRequest=null),t};class Qk extends Rg{save(e,t){super.s
transform: ${u} translate(${(1-_)*c}${d}, ${(1-_)*m}${h});
opacity: ${a-f*g}`}}function et(n,{delay:e=0,duration:t=400,easing:i=Zo,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]}`]),h=parseFloat(s[`margin${f[1]}`]),_=parseFloat(s[`border${f[0]}Width`]),g=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*h}px;border-${u[0]}-width: ${k*_}px;border-${u[1]}-width: ${k*g}px;`}}function Yt(n,{delay:e=0,duration:t=400,easing:i=Zo,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)=>`
transform: ${a} scale(${1-u*d});
opacity: ${r-f*d}
`}}let Zr,ji;const Gr="app-tooltip";function Hu(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Ei(){return ji=ji||document.querySelector("."+Gr),ji||(ji=document.createElement("div"),ji.classList.add(Gr),document.body.appendChild(ji)),ji}function z1(n,e){let t=Ei();if(!t.classList.contains("active")||!(e!=null&&e.text)){Xr();return}t.textContent=e.text,t.className=Gr+" 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 Xr(){clearTimeout(Zr),Ei().classList.remove("active"),Ei().activeNode=void 0}function sv(n,e){Ei().activeNode=n,clearTimeout(Zr),Zr=setTimeout(()=>{Ei().classList.add("active"),z1(n,e)},isNaN(e.delay)?0:e.delay)}function Le(n,e){let t=Hu(e);function i(){sv(n,t)}function l(){Xr()}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),Ei(),{update(s){var o,r;t=Hu(s),(r=(o=Ei())==null?void 0:o.activeNode)!=null&&r.contains(n)&&z1(n,t)},destroy(){var s,o;(o=(s=Ei())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Xr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function zu(n,e,t){const i=n.slice();return i[12]=e[t],i}const ov=n=>({}),Vu=n=>({uniqueId:n[4]});function rv(n){let e,t,i=pe(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Bu(zu(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=ye()},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=zu(o,i,a);l[a]?(l[a].p(u,r),A(l[a],1)):(l[a]=Bu(u),l[a].c(),A(l[a],1),l[a].m(e.parentNode,e))}for(oe(),a=i.length;a<l.length;a+=1)s(a);re()}},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),ut(l,o)}}}function av(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=Le.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=Pe(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Pe(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 Bu(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])+"")&&le(l,i)},i(a){r||(a&&Ke(()=>{r&&(o||(o=Pe(e,et,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Pe(e,et,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&v(e),a&&o&&o.end()}}}function uv(n){let e,t,i,l,s,o,r;const a=n[9].default,u=kt(a,n,n[8],Vu),f=[av,rv],c=[];function d(m,h){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]),ee(e,"error",n[3].length)},m(m,h){w(m,e,h),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,[h]){u&&u.p&&(!s||h&256)&&wt(u,a,m,m[8],s?vt(a,m[8],h,ov):St(m[8]),Vu);let _=i;i=d(m),i===_?c[i].p(m,h):(oe(),I(c[_],1,1,()=>{c[_]=null}),re(),l=c[i],l?l.p(m,h):(l=c[i]=f[i](m),l.c()),A(l,1),l.m(e,null)),(!s||h&2)&&p(e,"class",m[1]),(!s||h&10)&&ee(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 Uu="Invalid value";function Co(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Uu:n||Uu}function fv(n,e,t){let i;We(n,_i,_=>t(7,i=_));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(_){Ae.call(this,n,_)}function h(_){te[_?"unshift":"push"](()=>{f=_,t(2,f)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,u=_.class),"$$scope"in _&&t(8,s=_.$$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,h]}class me extends ge{constructor(e){super(),_e(this,e,fv,uv,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 dv(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 pv(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 mv(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:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field required",name:"password",$$slots:{default:[dv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new me({props:{class:"form-field required",name:"passwordConfirm
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function Os(n){return n+.5|0}const Ti=(n,e,t)=>Math.max(Math.min(n,t),e);function Zl(n){return Ti(Os(n*2.55),0,255)}function Ai(n){return Ti(Os(n*255),0,255)}function fi(n){return Ti(Os(n/2.55)/100,0,1)}function rf(n){return Ti(Os(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},Qr=[..."0123456789ABCDEF"],Xv=n=>Qr[n&15],Qv=n=>Qr[(n&240)>>4]+Qr[n&15],js=n=>(n&240)>>4===(n&15),xv=n=>js(n.r)&&js(n.g)&&js(n.b)&&js(n.a);function e2(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 t2=(n,e)=>n<255?e(n):"";function n2(n){var e=xv(n)?Xv:Qv;return n?"#"+e(n.r)+e(n.g)+e(n.b)+t2(n.a,e):void 0}const i2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function U1(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 l2(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 s2(n,e,t){const i=U1(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 o2(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 Aa(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=o2(t,i,l,f,s),a=a*60+.5),[a|0,u||0,r]}function Ia(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Ai)}function La(n,e,t){return Ia(U1,n,e,t)}function r2(n,e,t){return Ia(s2,n,e,t)}function a2(n,e,t){return Ia(l2,n,e,t)}function W1(n){return(n%360+360)%360}function u2(n){const e=i2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Zl(+e[5]):Ai(+e[5]));const l=W1(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=r2(l,s,o):e[1]==="hsv"?i=a2(l,s,o):i=La(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function f2(n,e){var t=Aa(n);t[0]=W1(t[0]+e),t=La(t),n.r=t[0],n.g=t[1],n.b=t[2]}function c2(n){if(!n)return;const e=Aa(n),t=e[0],i=rf(e[1]),l=rf(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${fi(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const af={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"},uf={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"
* Chart.js v4.4.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/function ri(){}const y2=(()=>{let n=0;return()=>n++})();function Mt(n){return n===null||typeof n>"u"}function At(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 lt(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 bt(n,e){return typeof n>"u"?e:n}const k2=(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 ht(n,e,t,i){let l,s,o;if(At(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(lt(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(At(n))return n.map(Do);if(lt(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 K1(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function v2(n,e,t,i){if(!K1(n))return;const l=e[n],s=t[n];lt(l)&&lt(s)?ds(l,s,i):e[n]=Do(s)}function ds(n,e,t){const i=At(e)?e:[e],l=i.length;if(!lt(n))return n;t=t||{};const s=t.merger||v2;let o;for(let r=0;r<l;++r){if(o=i[r],!lt(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 es(n,e){return ds(n,e,{merger:w2})}function w2(n,e,t){if(!K1(n))return;const i=e[n],l=t[n];lt(i)&&lt(l)?es(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Do(l))}const cf={"":n=>n,x:n=>n.x,y:n=>n.y};function S2(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 $2(n){const e=S2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Eo(n,e){return(cf[e]||(cf[e]=$2(e)))(n)}function Pa(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ao=n=>typeof n<"u",Ii=n=>typeof n=="function",df=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function T2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const xt=Math.PI,On=2*xt,C2=On+xt,Io=Number.POSITIVE_INFINITY,M2=xt/180,Tn=xt/2,Hi=xt/4,pf=xt*2/3,Ci=Math.log10,$l=Math.sign;function ts(n,e,t){return Math.abs(n-e)<t}function mf(n){const e=Math.round(n);n=ts(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 O2(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 ps(n){return!isNaN(parseFloat(n))&&isFinite(n)}function D2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function J1(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 Na(n){return n*(180/xt)}function hf(n){if(!jt(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function E2(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 xr(n,e){return Math.sqrt(Math.pow(e.x-n.x,2)+Math.pow(e.y-n.y,2))}function A2(n,e){return(n-e+C2)%On-xt}function Sn(n){return(n%On+On)%On}function Z1(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 I2(n){return Kn(n,-32768,32767)}function G1(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Fa(n,e,t){t=t||(o=>n[o]<e);let i=n.length-1,l=0,s;for(;i-l>1;)s=l+i>>1,t(s)?l=s:i=s;return{lo:l,hi:i}}const Zi=(n,e,t,i)=>Fa(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),L2=(n,e,t)=>Fa(n,t,i=>n[i][e]>=t);function P2(n,e,t){let i=0,l=n.length;for(;i<l&&n
* Chart.js v4.4.1
* https://www.chartjs.org
* (c) 2023 Chart.js Contributors
* Released under the MIT License
*/class Uw{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=Q1.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 Uw;const Ef="transparent",Ww={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=kf(n||Ef),l=i.valid&&kf(e||Ef);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class Yw{constructor(e,t,i,l){const s=t[i];l=Bs([e.to,l,s,e.from]);const o=Bs([e.from,s,l]);this._active=!0,this._fn=e.fn||Ww[e.type||typeof o],this._easing=ns[e.easing]||ns.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=Bs([e.to,t,l,e.from]),this._from=Bs([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 fb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!lt(e))return;const t=Object.keys(zt.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!lt(s))return;const o={};for(const r of t)o[r]=s[r];(At(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=Jw(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&Kw(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 Yw(d,e,u,f),l.push(c)}return l}update(e,t){if(this._properties.size
`)>-1?n.split(`
`):n}function V4(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 ac(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,h=Hn(e.padding);let _=h.height,g=0,k=i.reduce(($,C)=>$+C.before.length+C.lines.length+C.after.length,0);if(k+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*u.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),k){const $=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*$+(k-m)*a.lineHeight+(k-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*f.lineHeight+(d-1)*e.footerSpacing);let S=0;const T=function($){g=Math.max(g,t.measureText($).width+S)};return t.save(),t.font=u.string,ht(n.title,T),t.font=a.string,ht(n.beforeBody.concat(n.afterBody),T),S=e.displayColors?o+2+e.boxPadding:0,ht(i,$=>{ht($.before,T),ht($.lines,T),ht($.after,T)}),S=0,t.font=f.string,ht(n.footer,T),t.restore(),g+=h.width,{width:g,height:_}}function B4(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function U4(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 W4(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"),U4(u,n,e,t)&&(u="center"),u}function uc(n,e,t){const i=t.yAlign||e.yAlign||B4(n,t);return{xAlign:t.xAlign||e.xAlign||W4(n,e,t,i),yAlign:i}}function Y4(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function K4(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function fc(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}=ls(o);let h=Y4(e,r);const _=K4(e,a,u);return a==="center"?r==="left"?h+=u:r==="right"&&(h-=u):r==="left"?h-=Math.max(f,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Kn(h,0,i.width-e.width),y:Kn(_,0,i.height-e.height)}}function Qs(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 cc(n){return Qn([],ui(n))}function J4(n,e,t){return Pi(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function dc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Cb={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 Mt(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"?Cb[e].call(t,i):l}class ra extends Es{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
* chartjs-adapter-luxon v1.3.1
* https://www.chartjs.org
* (c) 2023 chartjs-adapter-luxon Contributors
* Released under the MIT license
*/const hS={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"}};db._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 hS},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 $c(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=Pe(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Pe(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&v(e),l&&t&&t.end()}}}function _S(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,u,f,c=n[2]&&$c();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"),ee(t,"hidden",n[2]),p(f,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),ee(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&&le(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&le(r,o),m&4&&ee(t,"hidden",d[2]),d[2]?c?m&4&&A(c,1):(c=$c(),c.c(),A(c,1),c.m(e,u)):c&&(oe(),I(c,1,1,()=>{c=null}),re()),m&4&&ee(e,"loading",d[2])},i(d){A(c)},o(d){I(c)},d(d){d&&v(e),c&&c.d(),n[8](null)}}}function gS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,u=!1;async function f(){t(2,u=!0);const m=[l,j.normalizeLogsFilter(i)].filter(Boolean).join("&&");return fe.logs.getStats({filter:m}).then(h=>{c();for(let _ of h)r.push({x:new Date(_.date),y:_.total}),t(1,a+=_.total)}).catch(h=>{h!=null&&h.isAbort||(c(),console.warn(h),fe.error(h,!m||(h==null?void 0:h.status)!=400))}).finally(()=>{t(2,u=!1)})}function c(){t(7,r=[]),t(1,a=0)}Vt(()=>(ci.register(Oi,ho,co,aa,_s,z4,Z4),t(6,o=new ci(s,{type:"line",data:{datasets:[{label:"Total requests",data:r,borderColor:"#e34562",pointBackgroundColor:"#e34562",backgroundColor:"rgb(239,69,101,0.05)",borderWidth:2,pointRadius:1,pointBorderWidth:0,fill:!0}]},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 h;return(h=m.tick)!=null&&h.major?"#edf0f3":""}},color:"#e4e9ec",ticks:{maxTicksLimit:15,autoSkip:!0,maxRotation:0,major:{enabled:!0},color:m=>{var h;return(h=m.tick)!=null&&h.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 bS extends ge{constructor(e){super(),_e(this,e,gS,_S,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}var Tc=typeof globalThis<
* 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(T){return T instanceof a?new a(T.type,S(T.content),T.alias):Array.isArray(T)?T.map(S):T.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,$){$=$||{};var C,D;switch(r.util.type(T)){case"Object":if(D=r.util.objId(T),$[D])return $[D];C={},$[D]=C;for(var O in T)T.hasOwnProperty(O)&&(C[O]=S(T[O],$));return C;case"Array":return D=r.util.objId(T),$[D]?$[D]:(C=[],$[D]=C,T.forEach(function(E,L){C[L]=S(E,$)}),C);default:return T}},getLanguage:function(S){for(;S;){var T=l.exec(S.className);if(T)return T[1].toLowerCase();S=S.parentElement}return"none"},setLanguage:function(S,T){S.className=S.className.replace(RegExp(l,"gi"),""),S.classList.add("language-"+T)},currentScript:function(){if(typeof document>"u")return null;if("currentScript"in document&&1<2)return document.currentScript;try{throw new Error}catch(C){var S=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(C.stack)||[])[1];if(S){var T=document.getElementsByTagName("script");for(var $ in T)if(T[$].src==S)return T[$]}return null}},isActive:function(S,T,$){for(var C="no-"+T;S;){var D=S.classList;if(D.contains(T))return!0;if(D.contains(C))return!1;S=S.parentElement}return!!$}},languages:{plain:o,plaintext:o,text:o,txt:o,extend:function(S,T){var $=r.util.clone(r.languages[S]);for(var C in T)$[C]=T[C];return $},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==T)for(var L in $)$.hasOwnProperty(L)&&(O[L]=$[L]);$.hasOwnProperty(E)||(O[E]=D[E])}var F=C[S];return C[S]=O,r.languages.DFS(r.languages,function(P,N){N===F&&P!=S&&(this[P]=O)}),O},DFS:function S(T,$,C,D){D=D||{};var O=r.util.objId;for(var E in T)if(T.hasOwnProperty(E)){$.call(T,E,T[E],C||E);var L=T[E],F=r.util.type(L);F==="Object"&&!D[O(L)]?(D[O(L)]=!0,S(L,$,null,D)):F==="Array"&&!D[O(L)]&&(D[O(L)]=!0,S(L,$,E,D))}}},plugins:{},highlightAll:function(S,T){r.highlightAllUnder(document,S,T)},highlightAllUnder:function(S,T,$){var C={callback:$,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,T===!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 F(N){L.highlightedCode=N,r.hooks.run("before-insert",L),L.element.innerHTML=L.highlightedCode,r.hooks.run("after-highlight",L),r.hooks.run("complete",L),$&&$.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),$&&$.call(L.element);return}if(r.hooks.run("before-highlight",L),!L.grammar){F(r.util.encode(L.code));return}if(T&&i.Worker){var P=new Worker(r.filename);P.onmessage=function(N){F(N.data)},P.postMessage(JSON.stringify({language:L.language,code:L.code,immediateClose:!0}))}else F(r.highlight(L.code,L.grammar,L.language))},highlight:function(S,T,$){var C={code:S,grammar:T,language:$};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,T){var $=T.rest;if($){for(var C in $)T[C]=$[C];delete T.rest}var D=new c;return d(D,D.head,S),f(S,D,T,D.head,0),h(D)},hooks:{all:{},add:function
`),g.hasAttribute("data-start")||g.setAttribute("data-start",String(L+1))}k.textContent=D,t.highlightElement(k)},function(D){g.setAttribute(r,f),k.textContent=D})}}),t.plugins.fileHighlight={highlight:function(g){for(var k=(g||document).querySelectorAll(c),S=0,T;T=k[S++];)t.highlightElement(T)}};var h=!1;t.fileHighlight=function(){h||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),h=!0),t.plugins.fileHighlight.highlight.apply(this,arguments)}}()})(Ob);var kS=Ob.exports;const Yl=yS(kS);var vS={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(`
`),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="",h="",_=!1,g=0;g<d.length;++g){var k=d[g];k==o.element?_=!0:k.nodeName==="#text"&&(_?h+=k.nodeValue:m+=k.nodeValue,a.removeChild(k),--g)}if(!o.element.children.length||!Prism.plugins.KeepMarkup)o.code=m+o.code+h,o.code=r.normalize(o.code,o.settings);else{var S=m+o.element.innerHTML+h;o.element.innerHTML=r.normalize(S,o.settings),o.code=o.element.textContent}}}})})()})(vS);(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 wS(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 SS(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=Yl.plugins.NormalizeWhitespace.normalize(a,{"remove-trailing":!0,"remove-indent":!0,"left-trim":!0,"right-trim":!0}),Yl.highlight(a,Yl.languages[s]||Yl.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 Yl<"u"&&l&&t(1,o=r(l))},[i,o,l,s]}class Ja extends ge{constructor(e){super(),_e(this,e,SS,wS,he,{class:0,content:2,language:3})}}const $S=n=>({}),Cc=n=>({}),TS=n=>({}),Mc=n=>({});function Oc(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,T=n[4]&&!n[2]&&Dc(n);const $=n[19].header,C=kt($,n,n[18],Mc);let D=n[4]&&n[2]&&Ec(n);const O=n[19].default,E=kt(O,n,n[18],null),L=n[19].footer,F=kt(L,n,n[18],Cc);return{c(){e=b("div"),t=b("div"),l=M(),s=b("div"),o=b("div"),T&&T.c(),r=M(),C&&C.c(),a=M(),D&&D.c(),u=M(),f=b("div"),E&&E.c(),c=M(),d=b("div"),F&&F.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),ut(s,o)}}}function JS(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class Eb extends ge{constructor(e){super(),_e(this,e,JS,KS,he,{class:0})}}function ZS(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:[XS,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),l=new me({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[QS,({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:[xS,({uniqueId:f})=>({22:f}),({uniqueId:f})=>f?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),V(t.$$.fragment),i=M(),V(l.$$.fragment),s=M(),V(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(f,c){w(f,e,c),H(t,e,null),y(e,i),H(l,e,null),y(e,s),H(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 h={};c&12582914&&(h.$$scope={dirty:c,ctx:f}),o.$set(h)},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),z(t),z(l),z(o),a=!1,u()}}}function GS(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 XS(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&&st(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 QS(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;return f=new Eb({}),{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(),V(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(h,_){w(h,e,_),y(e,t),w(h,l,_),w(h,s,_),ue(s,n[1].logs.minLevel),w(h,o,_),w(h,r,_),y(r,a),y(r,u),H(f,r,null),c=!0,d||(m=K(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&st(s.value)!==h[1].logs.minLevel&&ue(s,h[1].logs.minLevel)},i(h){c||(A(f.$$.fragment,h),c=!0)},o(h){I(f.$$.fragment,h),c=!1},d(h){h&&(v(e),v(l),v(s),v(o),v(r)),z(f),d=!1,m()}}}function xS(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 e$(n){let e,t,i,l;const s=[GS,ZS],o=[];function r(a,u){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ye()},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):(oe(),I(o[f],1,1,()=>{o[f]=null}),re(),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 t$(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 n$(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(g,k){(!c||k&256&&s!==(s=g[8]))&&p(e,"for",s);const S={};k&256&&(S.id=g[8]),k&1&&(S.disabled=!j.isEmpty(g[0].options.onlyDomains)),!a&&k&1&&(a=!0,S.value=g[0].options.exceptDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){I(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function mT(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[4](g)}let _={id:n[8]+".options.onlyDomains",disabled:!j.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Ll({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),V(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(g,k){w(g,e,k),y(e,t),y(e,i),y(e,l),w(g,o,k),H(r,g,k),w(g,u,k),w(g,f,k),c=!0,d||(m=ve(Le.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(g,k){(!c||k&256&&s!==(s=g[8]+".options.onlyDomains"))&&p(e,"for",s);const S={};k&256&&(S.id=g[8]+".options.onlyDomains"),k&1&&(S.disabled=!j.isEmpty(g[0].options.exceptDomains)),!a&&k&1&&(a=!0,S.value=g[0].options.onlyDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){I(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function hT(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:[pT,({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:[mT,({uniqueId:a})=>({8:a}),({uniqueId:a})=>a?256:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(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),H(i,t,null),y(e,l),y(e,s),H(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),z(i),z(o)}}}function _T(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[hT]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ne(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(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Tt(r[2])]):{};a&515&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function gT(n,e,t){const i=["field","key"];let l=Ge(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){Ae.call(this,n,d)}function c(d){Ae.call(this,n,d)}return n.$$set=d=>{e=Ne(Ne({},e),Kt(d)),t(2,l=Ge(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 Lb extends ge{constructor(e){super(),_e(this,e,gT,_T,he,{field:0,key:1})}}function bT(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=Ne(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new Lb({props:o}),te.push(()=>be(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&6?pt(l,[a&2&&{key:r[1]},a&4&&Tt(r[2])]):{};!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function yT(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e;function r(f){s=f,t(0,s)}function a(f){Ae.call(this,n,f)}function u(f){Ae.call(this,n,f)}return n.$$set=f=>{e=Ne(Ne({},e),Kt(f)),t(2,l=Ge(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 kT extends ge{constructor(e){super(),_e(this,e,yT,bT,he,{field:0,key:1})}}function vT(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(Le.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 wT
<span class='flatpickr-weekday'>
`+X.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function ae(){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 x(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,gt("onYearChange"),R()),N(),gt("onMonthChange"),Jt())}function se(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=Ar(t.config),de=ie.hours,$e=ie.minutes,Ie=ie.seconds;m(de,$e,Ie)}t.redraw(),Z&&gt("onChange")}function De(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),gt("onClose")}function je(){t.config!==void 0&&gt("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 Ze(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(),gt("onYearChange"),R())}}function Xe(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)retu
2023-12-09 21:12:00 +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
2023-12-09 21:12:00 +08:00
`),c=b("strong"),c.textContent="plain string",d=Y(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=M(),g=b("li"),g.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>",T=M(),$=b("li"),$.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 "),F=b("code"),F.textContent='{"a":1,"b":2}',P=M(),N=b("li"),N.textContent="numeric strings are converted to json number",R=M(),q=b("li"),q.textContent="double quoted strings are left as they are (aka. without normalizations)",W=M(),J=b("li"),J.textContent="any other string (empty string too) is double quoted",G=Y(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),B=b("code"),B.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(x,se){w(x,e,se),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,h),y(m,_),y(m,g),y(m,k),y(m,S),y(m,T),y(m,$),y(m,C),y(m,D),y(D,E),y(D,L),y(D,F),y(m,P),y(m,N),y(m,R),y(m,q),y(m,W),y(m,J),y(i,G),y(i,B),ae=!0},i(x){ae||(x&&Ke(()=>{ae&&(U||(U=Pe(e,et,{duration:150},!0)),U.run(1))}),ae=!0)},o(x){x&&(U||(U=Pe(e,et,{duration:150},!1)),U.run(0)),ae=!1},d(x){x&&v(e),x&&U&&U.end()}}}function hC(n){let e,t,i,l,s,o,r,a,u,f,c;e=new me({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[dC,({uniqueId:g})=>({10:g}),({uniqueId:g})=>g?1024:0]},$$scope:{ctx:n}}});function d(g,k){return g[2]?mC:pC}let m=d(n),h=m(n),_=n[2]&&Cd();return{c(){V(e.$$.fragment),t=M(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=M(),h.c(),r=M(),_&&_.c(),a=ye(),p(l,"class","txt"),p(i,"type","button"),p(i,"class",o="btn btn-sm "+(n[2]?"btn-secondary":"btn-hint btn-transparent"))},m(g,k){H(e,g,k),w(g,t,k),w(g,i,k),y(i,l),y(i,s),h.m(i,null),w(g,r,k),_&&_.m(g,k),w(g,a,k),u=!0,f||(c=K(i,"click",n[5]),f=!0)},p(g,k){const S={};k&2&&(S.name="schema."+g[1]+".options.maxSize"),k&3073&&(S.$$scope={dirty:k,ctx:g}),e.$set(S),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!u||k&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?k&4&&A(_,1):(_=Cd(),_.c(),A(_,1),_.m(a.parentNode,a)):_&&(oe(),I(_,1,1,()=>{_=null}),re())},i(g){u||(A(e.$$.fragment,g),A(_),u=!0)},o(g){I(e.$$.fragment,g),I(_),u=!1},d(g){g&&(v(t),v(i),v(r),v(a)),z(e,g),h.d(),_&&_.d(g),f=!1,c()}}}function _C(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[hC]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ne(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[7]),e.$on("remove",n[8]),{c(){V(e.$$.fragment)},m(r,a){H(e,r,a),i=!0},p(r,[a]){const u=a&10?pt(l,[a&2&&{key:r[1]},a&8&&Tt(r[3])]):{};a&2055&&(u.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,u.field=r[0],ke(()=>t=!1)),e.$set(u)},i(r){i||(A(e.$$.fragment,r),i=!0)},o(r){I(e.$$.fragment,r),i=!1},d(r){z(e,r)}}}function gC(n,e,t){const i=["field","key"];let l=Ge(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function u(){s.options.maxSize=st(this.value),t(0,s)}const f=()=>{t(2,r=!r)};function c(h){s=h,t(0,s)}function d(h){Ae.call(this,n,h)}function m(h){Ae.call(this,n,h)}return n.$$set=h=>{e=Ne(Ne({},e),Kt(h)),t(3,l=Ge(e,i)),"field"in h&&t(0,s=h.field),"key"in h&&t(1,o=h.key)},n.$$.update=()=>{n.$$.dirty&1&&j.isEmpty(s.options)&&a()},[s,o,r,l,u,f,c,d,m]}class bC extends ge{constructor(e){super(),_e(this,e,gC,_C,he,{field:0,key:1})}}function yC(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")+"")&&le(i,t),u&1&&o!==(o=a[0].mimeType+"")&&le(r,o)},i:Q,o:Q,d(a){a&&(v(e),v(l),v(s))}}}function kC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Md extends ge{constructor(e){super(),_e(this,e,kC,yC,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:"
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,ke(()=>a=!1)),r.$set(E);const L={};O&16777217&&(L.$$scope={dirty:O,ctx:D}),g.$set(L)},i(D){k||(A(r.$$.fragment,D),A(g.$$.fragment,D),k=!0)},o(D){I(r.$$.fragment,D),I(g.$$.fragment,D),k=!1},d(D){D&&(v(e),v(o),v(u),v(f)),z(r,D),z(g),S=!1,T()}}}function CC(n){let e;return{c(){e=b("ul"),e.innerHTML=`<li><strong>WxH</strong>
(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 MC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,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 Ll({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:[CC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=M(),l=b("i"),o=M(),V(r.$$.fragment),u=M(),f=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=M(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=M(),g=b("i"),k=M(),V(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(h,"class","txt link-primary"),p(g,"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),H(r,E,L),w(E,u,L),w(E,f,L),y(f,c),y(f,d),y(f,m),y(m,h),y(m,_),y(m,g),y(m,k),H(S,m,null),T=!0,$||(C=ve(Le.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"})),$=!0)},p(E,L){(!T||L&4194304&&s!==(s=E[22]))&&p(e,"for",s);const F={};L&4194304&&(F.id=E[22]),!a&&L&1&&(a=!0,F.value=E[0].options.thumbs,ke(()=>a=!1)),r.$set(F);const P={};L&16777216&&(P.$$scope={dirty:L,ctx:E}),S.$set(P)},i(E){T||(A(r.$$.fragment,E),A(S.$$.fragment,E),T=!0)},o(E){I(r.$$.fragment,E),I(S.$$.fragment,E),T=!1},d(E){E&&(v(e),v(o),v(u),v(f)),z(r,E),z(S),$=!1,C()}}}function OC(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&&st(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 Od(n){let e,t,i;return t=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[DC,({uniqueId:l})=>({22:l}),({uniqueId:l})=>l?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){w(l,e,s),H(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),z(t)}}}function DC(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&&st(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 EC(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:[TC,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),o=new me({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[MC,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[OC,({uniqueId:_})=>({22:_}),({uniqueId:_})=>_?4194304:0]},$$scope:{ctx:n}}});let h=!n[2]&&Od(n);return{c(){e=b("div"),t=b("div"),V(i.$$.fragment),l=M(),s=b("div"),V(o.$$.fragment),a=M(),u=b("div"),V(f.$$.fragment),d=M(),h&&h.c(),p(t,"clas
`),position:"top"})),c=!0)},p(_,g){var S,T;s&&$t(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${((S=_[4])==null?void 0:S.name)||"relation"} record deletion to delete also the current corresponding collection record(s).`,_[2]?null:`For "Multiple" relation fields the cascade delete is triggered only when all ${((T=_[4])==null?void 0:T.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
`),position:"top"}),(!f||g&8388608&&o!==(o=_[23]))&&p(e,"for",o);const k={};g&8388608&&(k.id=_[23]),!u&&g&1&&(u=!0,k.keyOfSelected=_[0].options.cascadeDelete,ke(()=>u=!1)),a.$set(k)},i(_){f||(A(a.$$.fragment,_),f=!0)},o(_){I(a.$$.fragment,_),f=!1},d(_){_&&(v(e),v(r)),z(a,_),c=!1,d()}}}function BC(n){let e,t,i,l,s,o=!n[2]&&Dd(n);return l=new me({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[VC,({uniqueId:r})=>({23:r}),({uniqueId:r})=>r?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=M(),i=b("div"),V(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),H(l,i,null),s=!0},p(r,a){r[2]?o&&(oe(),I(o,1,1,()=>{o=null}),re()):o?(o.p(r,a),a&4&&A(o,1)):(o=Dd(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(),z(l)}}}function UC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(f){n[17](f)}let a={$$slots:{options:[BC],default:[jC,({interactive:f})=>({24:f}),({interactive:f})=>f?16777216:0]},$$scope:{ctx:n}};for(let f=0;f<o.length;f+=1)a=Ne(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(){V(e.$$.fragment),i=M(),V(l.$$.fragment)},m(f,c){H(e,f,c),w(f,i,c),H(l,f,c),s=!0},p(f,[c]){const d=c&258?pt(o,[c&2&&{key:f[1]},c&256&&Tt(f[8])]):{};c&50331711&&(d.$$scope={dirty:c,ctx:f}),!t&&c&1&&(t=!0,d.field=f[0],ke(()=>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),z(e,f),n[20](null),z(l,f)}}}function WC(n,e,t){var P;let i,l;const s=["field","key"];let o=Ge(e,s),r;We(n,zn,N=>t(10,r=N));let{field:a}=e,{key:u=""}=e;const f=[{label:"Single",value:!0},{label:"Multiple",value:!1}],c=[{label:"False",value:!1},{label:"True",value:!0}];let d=null,m=((P=a.options)==null?void 0:P.maxSelect)==1,h=m;function _(){t(0,a.options={maxSelect:1,collectionId:null,cascadeDelete:!1},a),t(2,m=!0),t(9,h=m)}function g(){a.options.minSelect=st(this.value),t(0,a),t(9,h),t(2,m)}function k(){a.options.maxSelect=st(this.value),t(0,a),t(9,h),t(2,m)}function S(N){n.$$.not_equal(a.options.cascadeDelete,N)&&(a.options.cascadeDelete=N,t(0,a),t(9,h),t(2,m))}const T=()=>d==null?void 0:d.show();function $(N){n.$$.not_equal(a.options.collectionId,N)&&(a.options.collectionId=N,t(0,a),t(9,h),t(2,m))}function C(N){m=N,t(2,m)}function D(N){a=N,t(0,a),t(9,h),t(2,m)}function O(N){Ae.call(this,n,N)}function E(N){Ae.call(this,n,N)}function L(N){te[N?"unshift":"push"](()=>{d=N,t(3,d)})}const F=N=>{var R,q;(q=(R=N==null?void 0:N.detail)==null?void 0:R.collection)!=null&&q.id&&N.detail.collection.type!="view"&&t(0,a.options.collectionId=N.detail.collection.id,a)};return n.$$set=N=>{e=Ne(Ne({},e),Kt(N)),t(8,o=Ge(e,s)),"field"in N&&t(0,a=N.field),"key"in N&&t(1,u=N.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(N=>N.type!="view")),n.$$.dirty&516&&h!=m&&(t(9,h=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)&&_(),n.$$.dirty&1025&&t(4,l=r.find(N=>N.id==a.options.collectionId)||null)},[a,u,m,d,l,i,f,c,o,h,r,g,k,S,T,$,C,D,O,E,L,F]}class YC extends ge{constructor(e){super(),_e(this,e,WC,UC,he,{field:0,key:1})}}const KC=n=>({dragging:n&4,dragover:n&8}),Ed=n=>({dragging:n[2],dragover:n[3]});function JC(n){let e,t,i,l,s;const o=n[10].default,r=kt(o,n,n[9],Ed);return{c(){e=b("div"),r&&r.c(),p(e,"draggable",t=!n[1]),p(e,"class","draggable svelte-28orm4"),ee(e,"dragging",n[2]),ee(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)&&wt(r,o,a,a[9],i?vt(o,a[9],u,KC):St(a[9]),Ed),(!i||u&2&&t!==(t=!a[1]))
2023-12-09 21:12:00 +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 GC(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=Ot(r,a(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8])),{c(){e&&V(e.$$.fragment),i=M()},m(u,f){e&&H(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){oe();const c=e;I(c.$$.fragment,1,0,()=>{z(c,1)}),re()}r?(e=Ot(r,a(n)),te.push(()=>be(e,"field",s)),e.$on("remove",o),e.$on("rename",n[8]),V(e.$$.fragment),A(e.$$.fragment,1),H(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],ke(()=>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&&z(e,u)}}}function Ld(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:[GC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new As({props:r}),te.push(()=>be(i,"list",o)),i.$on("drag",e[10]),i.$on("sort",e[11]),{key:n,first:null,c(){t=ye(),V(i.$$.fragment),this.first=t},m(a,u){w(a,t,u),H(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,ke(()=>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),z(i,a)}}}function XC(n){let e,t,i,l,s,o,r,a,u,f,c,d,m=[],h=new Map,_,g,k,S,T,$,C,D,O=n[0].type==="auth"&&Id(),E=pe(n[0].schema);const L=N=>N[17];for(let N=0;N<E.length;N+=1){let R=Ad(n,E,N),q=L(R);h.set(q,m[N]=Ld(q,R))}g=new P$({props:{class:"btn btn-block btn-outline"}}),g.$on("select",n[12]);function F(N){n[13](N)}let P={};return n[0]!==void 0&&(P.collection=n[0]),$=new E$({props:P}),te.push(()=>be($,"collection",F)),{c(){e=b("div"),t=b("p"),i=Y(`System fields:
2023-12-09 21:12:00 +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 N=0;N<m.length;N+=1)m[N].c();_=M(),V(g.$$.fragment),k=M(),S=b("hr"),T=M(),V($.$$.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(N,R){w(N,e,R),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(N,c,R),w(N,d,R);for(let q=0;q<m.length;q+=1)m[q]&&m[q].m(d,null);w(N,_,R),H(g,N,R),w(N,k,R),w(N,S,R),w(N,T,R),H($,N,R),D=!0},p(N,[R]){N[0].type==="auth"?O||(O=Id(),O.c(),O.m(t,f)):O&&(O.d(1),O=null),R&55&&(E=pe(N[0].schema),oe(),m=dt(m,R,L,1,N,E,h,d,Lt,Ld,null,Ad),re());const q={};!C&&R&1&&(C=!0,q.collection=N[0],ke(()=>C=!1)),$.$set(q)},i(N){if(!D){for(let R=0;R<E.length;R+=1)A(m[R]);A(g.$$.fragment,N),A($.$$.fragment,N),D=!0}},o(N){for(let R=0;R<m.length;R+=1)I(m[R]);I(g.$$.fragment,N),I($.$$.fragment,N),D=!1},d(N){N&&(v(e),v(c),v(d),v(_),v(k),v(S),v(T)),O&&O.d();for(let R=0;R<m.length;R+=1)m[R].d();z(g,N),z($,N)}}}function QC(n,e,t){let i,{collection:l}=e;const s={text:x$,number:rT,bool:fT,email:Lb,url:kT,editor:TT,date:zT,select:cC,json:bC,file:NC,relation:YC};function o($){l.schema[$]&&(l.schema.splice($,1),t(0,l))}function r($="text"){const C=j.initSchemaField({name:a(),type:$});C.onMountSelect=!0,l.schema.push(C),t(0,l)}function a($="field"){let C="";for(;u($+C);)++C;return $+C}function u($){var C;return!!((C=l==null?void 0:l.schema)!=null&&C.find(D=>D.name===$))}function f($){return i.findIndex(C=>C===$)}function c($,C){var D;!((D=l==null?void 0:l.schema)!=null&&D.length)||$===C||!C||t(0,l.indexes=l.indexes.map(O=>j.replaceIndexColumn(O,$,C)),l)}function d($,C,D,O){D[O]=$,t(0,l)}const m=$=>o($),h=$=>c($.detail.oldName,$.detail.newName);function _($){n.$$.not_equal(l.schema,$)&&(l.schema=$,t(0,l))}const g=$=>{if(!$.detail)return;const C=$.detail.target;C.style.opacity=0,setTimeout(()=>{var D;(D=C==null?void 0:C.style)==null||D.removeProperty("opacity")},0),$.detail.dataTransfer.setDragImage(C,0,0)},k=()=>{Gt({})},S=$=>r($.detail);function T($){l=$,t(0,l)}return n.$$set=$=>{"collection"in $&&t(0,l=$.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter($=>!$.toDelete)||[])},[l,s,o,r,f,c,d,m,h,_,g,k,S,T]}class xC extends ge{constructor(e){super(),_e(this,e,QC,XC,he,{collection:0})}}const e5=n=>({isAdminOnly:n&512}),Pd=n=>({isAdminOnly:n[9]}),t5=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]}),n5=n=>({isAdminOnly:n&512}),Fd=n=>({isAdminOnly:n[9]});function i5(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:[s5,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(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){z(e,i)}}}function l5(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 Rd(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 qd(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=Pe(e,Yt,{duration:150,start:.98},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Pe(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(h,"class","m-t-10 m-b-5"),p(g,"class","m-b-0"),p(S,"class","inline-flex flex-gap-5"),p($,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(P,N){w(P,e,N),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let R=0;R<F.length;R+=1)F[R]&&F[R].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,h),y(i,_),y(i,g),y(i,k),y(i,S),y(i,T),y(i,$),y(i,C),y(i,D),E=!0},p(P,N){if(N&4){L=pe(P[2]);let R;for(R=0;R<L.length;R+=1){const q=Hd(P,L,R);F[R]?F[R].p(q,N):(F[R]=Vd(q),F[R].c(),F[R].m(o,null))}for(;R<F.length;R+=1)F[R].d(1);F.length=L.length}},i(P){E||(P&&Ke(()=>{E&&(O||(O=Pe(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(P){P&&(O||(O=Pe(e,et,{duration:150},!1)),O.run(0)),E=!1},d(P){P&&v(e),ut(F,P),P&&O&&O.end()}}}function Vd(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]+"")&&le(i,t)},d(l){l&&v(e)}}}function Bd(n){let e,t,i,l,s,o,r,a,u;function f(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[a5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new vl({props:c}),te.push(()=>be(e,"rule",f));function d(g){n[7](g)}let m={label:"Update rule",formKey:"updateRule",collection:n[0]};n[0].updateRule!==void 0&&(m.rule=n[0].updateRule),l=new vl({props:m}),te.push(()=>be(l,"rule",d));function h(g){n[8](g)}let _={label:"Delete rule",formKey:"deleteRule",collection:n[0]};return n[0].deleteRule!==void 0&&(_.rule=n[0].deleteRule),r=new vl({props:_}),te.push(()=>be(r,"rule",h)),{c(){V(e.$$.fragment),i=M(),V(l.$$.fragment),o=M(),V(r.$$.fragment)},m(g,k){H(e,g,k),w(g,i,k),H(l,g,k),w(g,o,k),H(r,g,k),u=!0},p(g,k){const S={};k&1&&(S.collection=g[0]),k&17408&&(S.$$scope={dirty:k,ctx:g}),!t&&k&1&&(t=!0,S.rule=g[0].createRule,ke(()=>t=!1)),e.$set(S);const T={};k&1&&(T.collection=g[0]),!s&&k&1&&(s=!0,T.rule=g[0].updateRule,ke(()=>s=!1)),l.$set(T);const $={};k&1&&($.collection=g[0]),!a&&k&1&&(a=!0,$.rule=g[0].deleteRule,ke(()=>a=!1)),r.$set($)},i(g){u||(A(e.$$.fragment,g),A(l.$$.fragment,g),A(r.$$.fragment,g),u=!0)},o(g){I(e.$$.fragment,g),I(l.$$.fragment,g),I(r.$$.fragment,g),u=!1},d(g){g&&(v(i),v(o)),z(e,g),z(l,g),z(r,g)}}}function Ud(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(Le.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 a5(n){let e,t=!n[10]&&Ud();return{c(){t&&t.c(),e=ye()},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=Ud(),t.c(),t.m(e.parentNode,e))},d(i){i&&v(e),t&&t.d(i)}}}function Wd(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:[u5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new vl({props:s}),te.push(()=>be(e,"rule",l)),{c(){V(e.$$.fragment)},m(o,r){H(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,ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function u5(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.
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 f5(n){var N,R;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,u,f,c,d,m,h,_,g,k,S,T,$,C=n[1]&&zd(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 vl({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 vl({props:L}),te.push(()=>be(m,"rule",E));let F=((N=n[0])==null?void 0:N.type)!=="view"&&Bd(n),P=((R=n[0])==null?void 0:R.type)==="auth"&&Wd(n);return{c(){e=b("div"),t=b("div"),i=b("p"),i.innerHTML=`All rules follow the
<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(),V(f.$$.fragment),d=M(),V(m.$$.fragment),_=M(),F&&F.c(),g=M(),P&&P.c(),k=ye(),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),H(f,q,W),w(q,d,W),H(m,q,W),w(q,_,W),F&&F.m(q,W),w(q,g,W),P&&P.m(q,W),w(q,k,W),S=!0,T||($=K(s,"click",n[3]),T=!0)},p(q,[W]){var B,U;(!S||W&2)&&o!==(o=q[1]?"Hide available fields":"Show available fields")&&le(r,o),q[1]?C?(C.p(q,W),W&2&&A(C,1)):(C=zd(q),C.c(),A(C,1),C.m(e,null)):C&&(oe(),I(C,1,1,()=>{C=null}),re());const J={};W&1&&(J.collection=q[0]),!c&&W&1&&(c=!0,J.rule=q[0].listRule,ke(()=>c=!1)),f.$set(J);const G={};W&1&&(G.collection=q[0]),!h&&W&1&&(h=!0,G.rule=q[0].viewRule,ke(()=>h=!1)),m.$set(G),((B=q[0])==null?void 0:B.type)!=="view"?F?(F.p(q,W),W&1&&A(F,1)):(F=Bd(q),F.c(),A(F,1),F.m(g.parentNode,g)):F&&(oe(),I(F,1,1,()=>{F=null}),re()),((U=q[0])==null?void 0:U.type)==="auth"?P?(P.p(q,W),W&1&&A(P,1)):(P=Wd(q),P.c(),A(P,1),P.m(k.parentNode,k)):P&&(oe(),I(P,1,1,()=>{P=null}),re())},i(q){S||(A(C),A(f.$$.fragment,q),A(m.$$.fragment,q),A(F),A(P),S=!0)},o(q){I(C),I(f.$$.fragment,q),I(m.$$.fragment,q),I(F),I(P),S=!1},d(q){q&&(v(e),v(u),v(d),v(_),v(g),v(k)),C&&C.d(),z(f,q),z(m,q),F&&F.d(q),P&&P.d(q),T=!1,$()}}}function c5(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 d5 extends ge{constructor(e){super(),_e(this,e,c5,f5,he,{collection:0})}}function Yd(n,e,t){const i=n.slice();return i[9]=e[t],i}function p5(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=Ot(o,r(n)),te.push(()=>be(e,"value",s)),e.$on("change",n[6])),{c(){e&&V(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),l=!0},p(a,u){if(u&2&&o!==(o=a[1])){if(e){oe();const f=e;I(f.$$.fragment,1,0,()=>{z(f,1)}),re()}o?(e=Ot(o,r(a)),te.push(()=>be(e,"value",s)),e.$on("change",a[6]),V(e.$$.fragment),A(e.$$.fragment,1),H(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,ke(()=>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&&z(e,a)}}}function m5(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 Kd(n){let e,t,i=pe(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Jd(Yd(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=Yd(s,i,r);l[r]?l[r].p(a,o):(l[r]=Jd(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),ut(l,s)}}}function Jd(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]+"")&&le(i,t)},d(l){l&&v(e)}}}function h5(n){let e,t,i,l,s,o,r,a,u,f,c;const d=[m5,p5],m=[];function h(g,k){return g[2]?0:1}s=h(n),o=m[s]=d[s](n);let _=n[3].length&&Kd(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>
<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(),_&&_.c(),f=ye(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,k){w(g,e,k),y(e,t),w(g,l,k),m[s].m(g,k),w(g,r,k),w(g,a,k),w(g,u,k),_&&_.m(g,k),w(g,f,k),c=!0},p(g,k){(!c||k&256&&i!==(i=g[8]))&&p(e,"for",i);let S=s;s=h(g),s===S?m[s].p(g,k):(oe(),I(m[S],1,1,()=>{m[S]=null}),re(),o=m[s],o?o.p(g,k):(o=m[s]=d[s](g),o.c()),A(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,k):(_=Kd(g),_.c(),_.m(f.parentNode,f)):_&&(_.d(1),_=null)},i(g){c||(A(o),c=!0)},o(g){I(o),c=!1},d(g){g&&(v(e),v(l),v(r),v(a),v(u),v(f)),m[s].d(g),_&&_.d(g)}}}function _5(n){let e,t;return e=new me({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[h5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(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){z(e,i)}}}function g5(n,e,t){let i;We(n,_i,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;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((h=l==null?void 0:l.options)==null?void 0:h.query);j.removeByValue(m,"id"),j.removeByValue(m,"created"),j.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const k=d[_][g].message,S=m[_]||_;r.push(j.sentenize(S+": "+k))}}Vt(async()=>{t(2,o=!0);try{t(1,s=(await rt(()=>import("./CodeEditor-4e893dd8.js"),["./CodeEditor-4e893dd8.js","./index-9ee652b3.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 b5 extends ge{constructor(e){super(),_e(this,e,g5,_5,he,{collection:0})}}const y5=n=>({active:n&1}),Zd=n=>({active:n[0]});function Gd(n){let e,t,i;const l=n[15].default,s=kt(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)&&wt(s,l,o,o[14],i?vt(l,o[14],r,null):St(o[14]),null)},i(o){i||(A(s,o),o&&Ke(()=>{i&&(t||(t=Pe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(o){I(s,o),o&&(t||(t=Pe(e,et,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&v(e),s&&s.d(o),o&&t&&t.end()}}}function k5(n){let e,t,i,l,s,o,r;const a=n[15].header,u=kt(a,n,n[14],Zd);let f=n[0]&&Gd(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]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(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)&&wt(u,a,c,c[14],s?vt(a,c[14],d,y5):St(c[14]),Zd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?f?(f.p(c,d),d&1&&A(f,1)):(f=Gd(c),f.c(),A(f,1),f.m(e,null)):f&&(oe(),I(f,1,1,()=>{f=null}),re()),(!s||d&130&&l!==(l="accordion "+(c[7]?"drag-over":"")+" "+c[1]))&&p(e,"class",l),(!s||d&131)&&ee(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 v5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=ot();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 h(){return!!f}function _(){S(),t(0,f=!0),s("expand")}function g(){t(0,f=!1),clearTimeout(r),s("collapse")}function k(){s("toggle"),f?g():_()}function S(){if(d&&o.closest(".accordions")){const F=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.interactive");for(const P of F)P.click()
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,k){(!c||k&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};k&8192&&(S.id=g[13]),k&1&&(S.disabled=!j.isEmpty(g[0].options.onlyEmailDomains)),!a&&k&1&&(a=!0,S.value=g[0].options.exceptEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){I(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function D5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!j.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Ll({props:_}),te.push(()=>be(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=M(),l=b("i"),o=M(),V(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[13]),p(f,"class","help-block")},m(g,k){w(g,e,k),y(e,t),y(e,i),y(e,l),w(g,o,k),H(r,g,k),w(g,u,k),w(g,f,k),c=!0,d||(m=ve(Le.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(g,k){(!c||k&8192&&s!==(s=g[13]))&&p(e,"for",s);const S={};k&8192&&(S.id=g[13]),k&1&&(S.disabled=!j.isEmpty(g[0].options.exceptEmailDomains)),!a&&k&1&&(a=!0,S.value=g[0].options.onlyEmailDomains,ke(()=>a=!1)),r.$set(S)},i(g){c||(A(r.$$.fragment,g),c=!0)},o(g){I(r.$$.fragment,g),c=!1},d(g){g&&(v(e),v(o),v(u),v(f)),z(r,g),d=!1,m()}}}function E5(n){let e,t,i,l;e=new me({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[M5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Qd(n);return{c(){V(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowEmailAuth?s?(s.p(o,r),r&1&&A(s,1)):(s=Qd(o),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(oe(),I(s,1,1,()=>{s=null}),re())},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)),z(e,o),s&&s.d(o)}}}function A5(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 I5(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 xd(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(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Pe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Pe(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 L5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?I5:A5}let a=r(n),u=a(n),f=n[2]&&xd();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=ye(),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=xd(),f.c(),A(f,1),f.m(o.parentNode,o)):f&&(oe(),I(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(t),v(i),v(l),v(s),v(o)),u.d(c),f&&f.d(c)}}}function P5(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[13]),p(l,"for",o=n[13])},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&8192&&t!==(t=u[13])&&p(e,"id",t),f&1&&(e.checked=u[0].options.allowOAuth2Auth),f&8192&&o!==(o=u[13])&&p(l,"for",o)},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function ep(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=Pe(e,et,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Pe(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:[P5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&ep();return{c(){V(e.$$.fragment),t=M(),s&&s.c(),i=ye()},m(o,r){H(e,o,r),w(o,t,r),s&&s.m(o,r),w(o,i,r),l=!0},p(o,r){const a={};r&24577&&(a.$$scope={dirty:r,ctx:o}),e.$set(a),o[0].options.allowOAuth2Auth?s?r&1&&A(s,1):(s=ep(),s.c(),A(s,1),s.m(i.parentNode,i)):s&&(oe(),I(s,1,1,()=>{s=null}),re())},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)),z(e,o),s&&s.d(o)}}}function F5(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 R5(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&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.requireEmail),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function z5(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="Forbid authentication for unverified users",o=M(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(s,"class","txt"),p(r,"class","ri-information-line txt-sm link-hint"),p(l,"for",a=n[13])},m(c,d){w(c,e,d),e.checked=n[0].options.onlyVerified,w(c,i,d),w(c,l,d),y(l,s),y(l,o),y(l,r),u||(f=[K(e,"change",n[12]),ve(Le.call(null,r,{text:["If enabled, it returns 403 for new unverfied user authentication requests.","If you need more granular control, don't enable this option and instead use the `@request.auth.verified = true` rule in the specific collection(s) you are targeting."].join(`
`),position:"right"}))],u=!0)},p(c,d){d&8192&&t!==(t=c[13])&&p(e,"id",t),d&1&&(e.checked=c[0].options.onlyVerified),d&8192&&a!==(a=c[13])&&p(l,"for",a)},d(c){c&&(v(e),v(i),v(l)),u=!1,we(f)}}}function V5(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,T;return l=new _o({props:{single:!0,$$slots:{header:[C5],default:[S5]},$$scope:{ctx:n}}}),o=new _o({props:{single:!0,$$slots:{header:[L5],default:[E5]},$$scope:{ctx:n}}}),a=new _o({props:{single:!0,$$slots:{header:[q5],default:[N5]},$$scope:{ctx:n}}}),h=new me({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[j5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),g=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[H5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),S=new me({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[z5,({uniqueId:$})=>({13:$}),({uniqueId:$})=>$?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=M(),i=b("div"),V(l.$$.fragment),s=M(),V(o.$$.fragment),r=M(),V(a.$$.fragment),u=M(),f=b("hr"),c=M(),d=b("h4"),d.textContent="General",m=M(),V(h.$$.fragment),_=M(),V(g.$$.fragment),k=M(),V(S.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m($,C){w($,e,C),w($,t,C),w($,i,C),H(l,i,null),y(i,s),H(o,i,null),y(i,r),H(a,i,null),w($,u,C),w($,f,C),w($,c,C),w($,d,C),w($,m,C),H(h,$,C),w($,_,C),H(g,$,C),w($,k,C),H(S,$,C),T=!0},p($,[C]){const D={};C&16393&&(D.$$scope={dirty:C,ctx:$}),l.$set(D);const O={};C&16389&&(O.$$scope={dirty:C,ctx:$}),o.$set(O);const E={};C&16387&&(E.$$scope={dirty:C,ctx:$}),a.$set(E);const L={};C&24577&&(L.$$scope={dirty:C,ctx:$}),h.$set(L);const F={};C&24577&&(F.$$scope={dirty:C,ctx:$}),g.$set(F);const P={};C&24577&&(P.$$scope={dirty:C,ctx:$}),S.$set(P)},i($){T||(A(l.$$.fragment,$),A(o.$$.fragment,$),A(a.$$.fragment,$),A(h.$$.fragment,$),A(g.$$.fragment,$),A(S.$$.fragment,$),T=!0)},o($){I(l.$$.fragment,$),I(o.$$.fragment,$),I(a.$$.fragment,$),I(h.$$.fragment,$),I(g.$$.fragment,$),I(S.$$.fragment,$),T=!1},d($){$&&(v(e),v(t),v(i),v(u),v(f),v(c),v(d),v(m),v(_),v(k)),z(l),z(o),z(a),z(h,$),z(g,$),z(S,$)}}}function B5(n,e,t){let i,l,s,o;We(n,_i,g=>t(4,o=g));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(g){n.$$.not_equal(r.options.exceptEmailDomains,g)&&(r.options.exceptEmailDomains=g,t(0,r))}function c(g){n.$$.not_equal(r.options.onlyEmailDomains,g)&&(r.options.onlyEmailDomains=g,t(0,r))}function d(){r.options.allowOAuth2Auth=this.checked,t(0,r)}function m(){r.options.minPasswordLength=st(this.value),t(0,r)}function h(){r.options.requireEmail=this.checked,t(0,r)}function _(){r.options.onlyVerified=this.checked,t(0,r)}return n.$$set=g=>{"collection"in g&&t(0,r=g.collection)},n.$$.update=()=>{var g,k,S,T;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((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!j.isEmpty((k=o==null?void 0:o.options)==null?void 0:k.onlyEmailDomains)||!j.isEmpty((S=o==null?void 0:o.options)==null?void 0:S.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!j.isEmpty((T=o==null?void 0:o.options)==null?void 0:T.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,u,f,c,d,m,h,_]}class U5 extends ge{constructor(e){super(),_e(this,e,B5,V5,he,{collection:0})}}function np(n,e,t){const i=n.slice();return i[18]=e[t],i}function ip(n,e,t){const i=n.slice();return i[18]=e[t],i}function lp(n,e,t){const i=n.slice();return i[18]=e[t],i}function sp(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 op(n){let e,t,i,l,s=n[3]&&rp(n),o=!n[4]&&ap(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,
`),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(_,g){w(_,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(_,g){var k,S;g&2&&s!==(s=((k=_[1])==null?void 0:k.name)+"")&&le(o,s),g&4&&c!==(c=((S=_[2])==null?void 0:S.name)+"")&&le(d,c)},d(_){_&&v(e)}}}function ap(n){let e,t,i,l=pe(n[6]),s=[];for(let f=0;f<l.length;f+=1)s[f]=up(lp(n,l,f));let o=pe(n[8]),r=[];for(let f=0;f<o.length;f+=1)r[f]=fp(ip(n,o,f));let a=pe(n[7]),u=[];for(let f=0;f<a.length;f+=1)u[f]=cp(np(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=ye()},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=lp(f,l,d);s[d]?s[d].p(m,c):(s[d]=up(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=ip(f,o,d);r[d]?r[d].p(m,c):(r[d]=fp(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=np(f,a,d);u[d]?u[d].p(m,c):(u[d]=cp(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)),ut(s,f),ut(r,f),ut(u,f)}}}function up(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+"")&&le(s,l)},d(a){a&&v(e)}}}function fp(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,h){w(m,e,h),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,h){h&256&&s!==(s=m[18].originalName+"")&&le(o,s),h&256&&c!==(c=m[18].name+"")&&le(d,c)},d(m){m&&v(e)}}}function cp(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+"")&&le(s,l)},d(r){r&&v(e)}}}function W5(n){let e,t,i,l,s,o,r,a,u=n[7].length&&sp(),f=n[9]&&op(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=ye(),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=sp(),u.c(),u.m(l,null)):u&&(u.d(1),u=null),c[9]?f?f.p(c,d):(f=op(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 Y5(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 K5(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 J5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[K5],header:[Y5],default:[W5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){V(e.$$.fragment)},m(l,s){H(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),z(e,l)}}}function Z5(n,e,t){let i,l,s,o,r,a;const u=ot();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():_()}function h(){f==null||f.hide()}function _(){h(),u("confirm")}const g=()=>h(),k=()=>_();function S(C){te[C?"unshift":"push"](()=>{f=C,t(5,f)})}function T(C){Ae.call(this,n,C)}function $(C){Ae.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 F,P,N;const L=(F=c==null?void 0:c.schema)==null?void 0:F.find(R=>R.id==E.id);return L?((P=L.options)==null?void 0:P.maxSelect)!=1&&((N=E.options)==null?void 0:N.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,f,r,o,s,a,_,m,g,k,S,T,$]}class G5 extends ge{constructor(e){super(),_e(this,e,Z5,J5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function dp(n,e,t){const i=n.slice();return i[49]=e[t][0],i[50]=e[t][1],i}function X5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new xC({props:s}),te.push(()=>be(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function Q5(n){let e,t,i;function l(o){n[34](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new b5({props:s}),te.push(()=>be(e,"collection",l)),{c(){V(e.$$.fragment)},m(o,r){H(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function pp(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 d5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){w(r,e,a),H(t,e,null),l=!0},p(r,a){const u={};!i&&a[0]&4&&(i=!0,u.collection=r[2],ke(()=>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),z(t)}}}function mp(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 U5({props:o}),te.push(()=>be(t,"collection",s)),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[3]===Ml)},m(
`),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 Vp="yyyy-MM-dd HH:mm:ss.SSS";function C6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+j.formatToLocalDate(i.created,Vp)+" Local"),i.updated&&l.push("Updated: "+j.formatToLocalDate(i.updated,Vp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class qb extends ge{constructor(e){super(),_e(this,e,C6,T6,he,{model:1})}}function M6(n){let e,t,i,l,s,o,r,a,u,f;return s=new sl({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=Y(n[1]),l=M(),V(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),H(s,e,null),y(e,o),y(e,r),a=!0,u||(f=[ve(Le.call(null,r,"Refresh")),K(r,"click",n[4])],u=!0)},p(c,d){(!a||d&2)&&le(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),z(s),u=!1,we(f)}}}function O6(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:[M6]},$$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(),V(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,h){w(m,e,h),y(e,t),y(e,i),H(l,e,null),a=!0,u||(f=ve(r=Le.call(null,e,n[3]?"":"Generate")),u=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ke(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&$t(r.update)&&h&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),z(l),u=!1,f()}}}function D6(n,e,t){const i=ot();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 jb extends ge{constructor(e){super(),_e(this,e,D6,O6,he,{class:0,length:5})}}function E6(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,h){w(m,e,h),y(e,t),y(e,i),y(e,l),w(m,o,h),w(m,r,h),ue(r,n[0].username),c||(d=K(r,"input",n[5]),c=!0)},p(m,h){h&8192&&s!==(s=m[13])&&p(e,"for",s),h&4&&a!==(a=!m[2])&&p(r,"requried",a),h&4&&u!==(u=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",u),h&8192&&f!==(f=m[13])&&p(r,"id",f),h&1&&r.value!==m[0].username&&ue(r,m[0].username)},d(m){m&&(v(e),v(o),v(r)),c=!1,d()}}}function A6(n){let e,t,i,l,s,o,r,a,u,f,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,k,S,T;return{c(){var $;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),h=M(),_=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(_,"type","email"),_.autofocus=n[2],p(_,"autocomplete","off"),p(_,"id",g=n[13]),_.required=k=($=n[1].options)==null?void 0:$.requireEmail,p(_,"class","svelte-1751a4d")},m($,C){w($,e,C),y(e,t),y(e,i),y(e,l),w($,o,C),w($,r,C),y(r,a),y(a,u),y(u,f),
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[ZM,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","block")},m(o,r){w(o,e,r),H(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=`
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),z(t),l=!1,we(s)}}}function XM(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,h="";function _(W){j.removeByValue(f,W),t(2,f)}function g(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 T(W){var G,B;W.preventDefault(),t(9,m=!1);const J=((G=W.dataTransfer)==null?void 0:G.files)||[];if(!(s||!J.length)){for(const U of J){const ae=l.length+u.length-f.length;if(((B=r.options)==null?void 0:B.maxSelect)<=ae)break;u.push(U)}t(1,u)}}Vt(async()=>{t(10,h=await fe.getAdminFileToken(o.collectionId))});const $=W=>_(W),C=W=>g(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 F=()=>{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 N(W){te[W?"unshift":"push"](()=>{d=W,t(8,d)})}const R=()=>{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,J;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)&&((J=r.options)==null?void 0:J.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,h,s,_,g,k,T,$,C,D,O,E,L,F,P,N,R,q]}class QM extends ge{constructor(e){super(),_e(this,e,XM,GM,he,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function em(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function xM(n,e){e=em(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=em(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function tm(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 nm(n,e,t){const i=n.slice();return i[9]=e[t],i}function im(n){let e,t;return e=new Qa({props:{record:n[0],filename:n[9],size:"xs"}}),{c(){V(e.$$.fragment)},m(i,l){H(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){z(e,i)}}}function lm(n){let e=!j.isEmpty(n[9]),t,i,l=e&&im(n);return{c(){l&&l.c(),t=ye()},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=im(s),l.c(),A(l,1),l.m(t.parentNode,t)):l&&(oe(),I(l,1,1,()=>{l=null}),re())},i(s){i||(A(l),i=!0)},o(s){I(l),i=!1},d(s){s&&v(t),l&&l.d(s)}}}function sm(n){let e,t,i=pe(n[6]),l=[];for(let o=0;o<i.length;o+=1)l[o]=lm(nm(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=ye()},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=nm(o,i,a);l[a]?(l[a].p(u,r),A(l[a],1)):(l[a]=lm(u),l[a].c(),A(l[a],1),l[a].m(e.parentNode,e))}for(oe(),a=i.length;a<l.length;a+=1)s(a);re()}},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),ut(l,o)}}}function eO(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 _=0;_<d.length;_+=1)m[_]=sm(tm(n,d,_));const h=_=>I(m[_],1,1,()=>{m[_
`),L&&L.c(),m=M(),_.c(),g=ye(),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(R,q){w(R,e,q),H(t,e,null),y(e,i),$&&$.m(e,null),w(R,l,q),w(R,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(R,f,q),w(R,c,q),y(c,d),L&&L.m(c,null),w(R,m,q),P[h].m(R,q),w(R,g,q),k=!0,S||(T=ve(u=xM.call(null,s,n[36])),S=!0)},p(R,q){const W={};q[0]&4&&(W.value=R[2]),q[0]&32&&(W.autocompleteCollection=R[5]),t.$set(W),R[11]?$&&($.d(1),$=null):$?$.p(R,q):($=am(R),$.c(),$.m(e,null)),q[0]&143252&&(C=pe(R[8]),oe(),o=dt(o,q,D,1,R,C,r,s,Lt,pm,a,rm),re(),!C.length&&O?O.p(R,q):C.length?O&&(O.d(1),O=null):(O=um(R),O.c(),O.m(s,a))),R[13]?E||(E=mm(),E.c(),E.m(s,null)):E&&(E.d(1),E=null),u&&$t(u.update)&&q[0]&4104&&u.update.call(null,R[36]),R[4]>1?L?L.p(R,q):(L=hm(R),L.c(),L.m(c,null)):L&&(L.d(1),L=null);let J=h;h=N(R),h===J?P[h].p(R,q):(oe(),I(P[J],1,1,()=>{P[J]=null}),re(),_=P[h],_?_.p(R,q):(_=P[h]=F[h](R),_.c()),A(_,1),_.m(g.parentNode,g))},i(R){if(!k){A(t.$$.fragment,R);for(let q=0;q<C.length;q+=1)A(o[q]);A(_),k=!0}},o(R){I(t.$$.fragment,R);for(let q=0;q<o.length;q+=1)I(o[q]);I(_),k=!1},d(R){R&&(v(e),v(l),v(s),v(f),v(c),v(m),v(g)),z(t),$&&$.d();for(let q=0;q<o.length;q+=1)o[q].d();O&&O.d(),E&&E.d(),L&&L.d(),P[h].d(R),S=!1,T()}}}function aO(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)||"")+"")&&le(s,l)},d(a){a&&v(e)}}}function uO(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 fO(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[uO],header:[aO],default:[rO]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Ne(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 eu({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),l=!0},p(a,u){const f=u[0]&524288?pt(s,[s[0],s[1],Tt(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),z(e,a),n[42](null),z(i,a)}}}const lo=50;function cO(n,e,t){let i,l,s,o,r,a,u,f;const c=["value","field","show","hide"];let d=Ge(e,c),m;We(n,zn,Se=>t(26,m=Se));const h=ot(),_="picker_"+j.randomString(5);let{value:g}=e,{field:k}=e,S,T,$="",C=[],D=[],O=1,E=0,L=!1,F=!1;function P(){return t(2,$=""),t(8,C=[]),t(6,D=[]),R(),q(!0),S==null?void 0:S.show()}function N(){return S==null?void 0:S.hide()}async function R(){const Se=j.toArray(g);if(!l||!Se.length)return;t(24,F=!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)}$.trim()||t(8,C=j.filterDuplicatesByKey(D.concat(C))),t(24,F=!1)}catch(on){on.isAbort||(fe.error(on),t(24,F=!1))}}async function q(Se=!1){if(l){t(3,L=!0),Se&&($.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($,Bt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,C=j.filterDuplicatesByKey(C.concat(cn.i
2023-12-09 21:12:00 +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&&ee(e,"thumb-warning",n[16](n[44],n[48]))},d(f){f&&v(e),u.d(),s=!1,we(o)}}}function Am(n,e){let t,i,l=pe(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Em(Cm(e,l,o));return{key:n,first:null,c(){t=ye();for(let o=0;o<s.length;o+=1)s[o].c();i=ye(),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=Cm(e,l,a);s[a]?s[a].p(u,r):(s[a]=Em(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)),ut(s,o)}}}function Im(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 EO(n){let e,t;function i(r,a){if(r[15])return MO;if(!r[6])return CO}let l=i(n),s=l&&l(n),o=n[6]&&Im();return{c(){s&&s.c(),e=M(),o&&o.c(),t=ye()},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=Im(),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 AO(n){let e,t,i,l;const s=[TO,$O],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=ye()},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):(oe(),I(o[f],1,1,()=>{o[f]=null}),re(),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 IO(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&&le(t,i[0])},d(i){i&&v(e)}}}function Lm(n){let e,t;return e=new me({props:{class:"form-field file-picker-size-select",$$slots:{default:[LO,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment)},m(i,l){H(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){z(e,i)}}}function LO(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 gi({props:s}),te.push(()=>be(e,"keyOfSelected",l)),{c(){V(e.$$.fragment)},m(o,r){H(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function PO(n){var h;let e,t,i,l=j.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,u,f,c,d,m=l&&Lm(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(_,g){w(_,e,g),y(e,t),w(_,i,g),m&&m.m(_,g),w(_,s,g),w(_,o,g),y(o,r),y(r,a),f=!0,c||(d=[K(e,"click",n[2]),K(o,"click",n[21])],c=!0)},p(_,g){var k;(!f||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=j.hasImageExtension((k=_[9])==null?void 0:k.name)),l?m?(m.p(_,g),g[0]&512&&A(m,1)):(m=Lm(_),m.c(),A(m,1),m.m(s.parentNode,s)):m&&(oe(),I(m,1,1,()=>{m=null}),re()),(!f||g[0]&2)&&le(a,_[1]),(!f||g[0]&8192&&u!==(u=!_[13]))&&(o.disabled=u)},i(_){f||(A(m),f=!0)},o(_){I(m),f=!1},d(_){_&&(v(e),v(i),v(s),v(o)),m&&m.d(_),c=!1,we(d)}}}function NO(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[PO],header:[IO],default:[AO]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Ne(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 eu({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),l=!0},p(a,u){const f=u[0]&4194304?pt(s,[s[0],s[1],Tt(a[22])]):{};u[0]&131059|u[1]&8388608&&(f.$$scope={dirty:u,ctx:a}),e.
...
-----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 dD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S;return l=new me({props:{class:"form-field required",name:"clientId",$$slots:{default:[rD,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),r=new me({props:{class:"form-field required",name:"teamId",$$slots:{default:[aD,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),f=new me({props:{class:"form-field required",name:"keyId",$$slots:{default:[uD,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),m=new me({props:{class:"form-field required",name:"duration",$$slots:{default:[fD,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),_=new me({props:{class:"form-field required",name:"privateKey",$$slots:{default:[cD,({uniqueId:T})=>({23:T}),({uniqueId:T})=>T?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),V(l.$$.fragment),s=M(),o=b("div"),V(r.$$.fragment),a=M(),u=b("div"),V(f.$$.fragment),c=M(),d=b("div"),V(m.$$.fragment),h=M(),V(_.$$.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(T,e,$),y(e,t),y(t,i),H(l,i,null),y(t,s),y(t,o),H(r,o,null),y(t,a),y(t,u),H(f,u,null),y(t,c),y(t,d),H(m,d,null),y(t,h),H(_,t,null),g=!0,k||(S=K(e,"submit",Ye(n[17])),k=!0)},p(T,$){const C={};$&25165828&&(C.$$scope={dirty:$,ctx:T}),l.$set(C);const D={};$&25165832&&(D.$$scope={dirty:$,ctx:T}),r.$set(D);const O={};$&25165840&&(O.$$scope={dirty:$,ctx:T}),f.$set(O);const E={};$&25165888&&(E.$$scope={dirty:$,ctx:T}),m.$set(E);const L={};$&25165856&&(L.$$scope={dirty:$,ctx:T}),_.$set(L)},i(T){g||(A(l.$$.fragment,T),A(r.$$.fragment,T),A(f.$$.fragment,T),A(m.$$.fragment,T),A(_.$$.fragment,T),g=!0)},o(T){I(l.$$.fragment,T),I(r.$$.fragment,T),I(f.$$.fragment,T),I(m.$$.fragment,T),I(_.$$.fragment,T),g=!1},d(T){T&&v(e),z(l),z(r),z(f),z(m),z(_),k=!1,S()}}}function pD(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 mD(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],ee(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&&ee(l,"btn-loading",c[7])},d(c){c&&(v(e),v(i),v(l)),u=!1,f()}}}function hD(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[mD],header:[pD],default:[dD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){V(e.$$.fragment)},m(l,s){H(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),z(e,l)}}}const go=15777e3;function _D(n,e,t){let i;const l=ot(),s="apple_secret_"+j.randomString(5);let o,r,a,u,f,c,d=!1;function m(F={}){t(2,r=F.clientId||""),t(3,a=F.teamId||""),t(4,u=F.keyId||""),t(5,f=F.privateKey||""),t(6,c=F.duration||go),Gt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const F=await fe.settings.generateAppleClientSecret(r,a,u,f.trim(),c);t(7,d=!1),It("Successfully generated client secret."),l("submit",F),o==null||o.hide()}catch(F){fe.error(F)}t(7,d=!1)}function g(){r
`),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(g,k){w(g,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,h||(_=[K(r,"click",n[38]),ve(Le.call(null,u,"Discard draft")),K(u,"click",Ye(n[39]))],h=!0)},p:Q,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=_a(e,et,{duration:150})),m=!1},d(g){g&&v(e),g&&d&&d.end(),h=!1,we(_)}}}function jm(n){let e,t,i;return t=new qb({props:{model:n[3]}}),{c(){e=b("div"),V(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){w(l,e,s),H(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),z(t)}}}function MD(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k=!n[6]&&jm(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,T){w(S,e,T),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),w(S,a,T),k&&k.m(S,T),w(S,u,T),w(S,f,T),ue(f,n[3].id),h=!0,_||(g=K(f,"input",n[40]),_=!0)},p(S,T){(!h||T[2]&1024&&r!==(r=S[72]))&&p(e,"for",r),S[6]?k&&(oe(),I(k,1,1,()=>{k=null}),re()):k?(k.p(S,T),T[0]&64&&A(k,1)):(k=jm(S),k.c(),A(k,1),k.m(u.parentNode,u)),(!h||T[2]&1024&&c!==(c=S[72]))&&p(f,"id",c),(!h||T[0]&128&&d!==(d=S[7]?"":"Leave empty to auto generate..."))&&p(f,"placeholder",d),(!h||T[0]&64&&m!==(m=!S[6]))&&(f.readOnly=m),T[0]&8&&f.value!==S[3].id&&ue(f,S[3].id)},i(S){h||(A(k),h=!0)},o(S){I(k),h=!1},d(S){S&&(v(e),v(a),v(u),v(f)),k&&k.d(S),_=!1,g()}}}function Hm(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 q6({props:r}),te.push(()=>be(e,"record",o));let a=((f=(u=n[0])==null?void 0:u.schema)==null?void 0:f.length)&&zm();return{c(){V(e.$$.fragment),i=M(),a&&a.c(),l=ye()},m(c,d){H(e,c,d),w(c,i,d),a&&a.m(c,d),w(c,l,d),s=!0},p(c,d){var 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],ke(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=zm(),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)),z(e,c),a&&a.d(c)}}}function zm(n){let e;return{c(){e=b("hr")},m(t,i){w(t,e,i)},d(t){t&&v(e)}}}function OD(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 gO({props:s}),te.push(()=>be(e,"value",l)),{c(){V(e.$$.fragment)},m(o,r){H(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],ke(()=>t=!1)),e.$set(a)},i(o){i||(A(e.$$.fragment,o),i=!0)},o(o){I(e.$$.fragment,o),i=!1},d(o){z(e,o)}}}function DD(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 QM({props:u}),te.push(()=>be(e,"value",o)),te.push(()=>be(e,"uploadedFiles",r)),te.push(()=>be(e,"deletedFileNames",a)),{c(){V(e.$$.fragment)},m(f,c){H(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],ke(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[69].name],ke(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[69].name],ke(()=>l=!1)),e.$set(d)},i(f){s||(A(e.$$.
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:[UD],header:[BD],default:[jD]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[56](e),e.$on("hide",n[57]),e.$on("show",n[58]),{c(){V(e.$$.fragment)},m(l,s){H(e,l,s),t=!0},p(l,s){const o={};s[0]&81984&&(o.class=`
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),z(e,l)}}}const xi="form",ys="providers";function YD(n,e,t){let i,l,s,o,r;const a=ot(),u="record_"+j.randomString(5);let{collection:f}=e,c,d={},m={},h=null,_=!1,g=!1,k={},S={},T=JSON.stringify(d),$=T,C=xi,D=!0,O=!0;function E(ce){return N(ce),t(12,g=!0),t(13,C=xi),c==null?void 0:c.show()}function L(){return c==null?void 0:c.hide()}function F(){t(12,g=!1),L()}async function P(ce){if(ce&&typeof ce=="string"){try{return await fe.collection(f.id).getOne(ce)}catch(Ce){Ce.isAbort||(F(),console.warn("resolveModel:",Ce),ni(`Unable to load record with id "${ce}"`))}return null}return ce}async function N(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,h=W()),!h||B(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,T=JSON.stringify(m)),t(7,O=!1)}async function R(ce){var Qe,Jt;Gt({}),t(2,d=ce||{}),t(4,k={}),t(5,S={});const Ce=((Jt=(Qe=f==null?void 0:f.schema)==null?void 0:Qe.filter(nt=>nt.type!="file"))==null?void 0:Jt.map(nt=>nt.name))||[];for(let nt in ce)Ce.includes(nt)||t(3,m[nt]=ce[nt],m);await Qt(),t(28,T=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 Ce=window.localStorage.getItem(q());if(Ce)return JSON.parse(Ce)}catch{}return ce}function J(ce){try{window.localStorage.setItem(q(),ce)}catch(Ce){console.warn("updateDraft failure:",Ce),window.localStorage.removeItem(q())}}function G(){h&&(t(3,m=h),t(10,h=null))}function B(ce,Ce){var Bn;const Qe=structuredClone(ce||{}),Jt=structuredClone(Ce||{}),nt=(Bn=f==null?void 0:f.schema)==null?void 0:Bn.filter(oi=>oi.type==="file");for(let oi of nt)delete Qe[oi.name],delete Jt[oi.name];const en=["expand","password","passwordConfirm"];for(let oi of en)delete Qe[oi],delete Jt[oi];return JSON.stringify(Qe)==JSON.stringify(Jt)}function U(){t(10,h=null),window.localStorage.removeItem(q())}async function ae(ce=!0){if(!(_||!r||!(f!=null&&f.id))){t(11,_=!0);try{const Ce=se();let Qe;D?Qe=await fe.collection(f.id).create(Ce):Qe=await fe.collection(f.id).update(m.id,Ce),It(D?"Successfully created record.":"Successfully updated record."),U(),ce?F():R(Qe),a("save",{isNew:D,record:Qe})}catch(Ce){fe.error(Ce)}t(11,_=!1)}}function x(){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 se(){const ce=structuredClone(m||{}),Ce=new FormData,Qe={id:ce.id},Jt={};for(const nt of(f==null?void 0:f.schema)||[])Qe[nt.name]=!0,nt.type=="json"&&(Jt[nt.name]=!0);i&&(Qe.username=!0,Qe.email=!0,Qe.emailVisibility=!0,Qe.password=!0,Qe.passwordConfirm=!0,Qe.verified=!0);for(const nt in ce)if(Qe[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(Ce,nt,ce[nt])}for(const nt in k){const en=j.toArray(k[nt]);for(const Bn of en)Ce.append(nt,Bn)}for(const nt in S){const en=j.toArray(S[nt]);for(const Bn of en)Ce.append(nt+"."+Bn,"")}return Ce}function De(){!(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 emai
2023-12-09 21:12:00 +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(g,k){w(g,e,k),y(e,t),w(g,l,k),w(g,s,k),ue(s,n[0].subject),w(g,r,k),w(g,a,k),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),h||(_=[K(s,"input",n[13]),K(f,"click",n[14]),K(d,"click",n[15])],h=!0)},p(g,k){k[1]&1&&i!==(i=g[31])&&p(e,"for",i),k[1]&1&&o!==(o=g[31])&&p(s,"id",o),k[0]&1&&s.value!==g[0].subject&&ue(s,g[0].subject)},d(g){g&&(v(e),v(l),v(s),v(r),v(a)),h=!1,we(_)}}}function sA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,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-12-09 21:12:00 +08:00
`),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=Y(`,
`),h=b("button"),h.textContent="{TOKEN} ",_=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(h,"type","button"),p(h,"class","label label-sm link-primary txt-mono"),p(h,"title","Required parameter"),p(a,"class","help-block")},m(S,T){w(S,e,T),y(e,t),w(S,l,T),w(S,s,T),ue(s,n[0].actionUrl),w(S,r,T),w(S,a,T),y(a,u),y(a,f),y(a,c),y(a,d),y(a,m),y(a,h),y(a,_),g||(k=[K(s,"input",n[16]),K(f,"click",n[17]),K(d,"click",n[18]),K(h,"click",n[19])],g=!0)},p(S,T){T[1]&1&&i!==(i=S[31])&&p(e,"for",i),T[1]&1&&o!==(o=S[31])&&p(s,"id",o),T[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)),g=!1,we(k)}}}function oA(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 rA(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=Ot(o,r(n)),te.push(()=>be(e,"value",s))),{c(){e&&V(e.$$.fragment),i=ye()},m(a,u){e&&H(e,a,u),w(a,i,u),l=!0},p(a,u){if(u[0]&16&&o!==(o=a[4])){if(e){oe();const f=e;I(f.$$.fragment,1,0,()=>{z(f,1)}),re()}o?(e=Ot(o,r(a)),te.push(()=>be(e,"value",s)),V(e.$$.fragment),A(e.$$.fragment,1),H(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,ke(()=>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&&z(e,a)}}}function aA(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,T,$;const C=[rA,oA],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-12-09 21:12:00 +08:00
`),f=b("button"),f.textContent="{APP_NAME} ",c=Y(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=Y(`,
`),h=b("button"),h.textContent="{TOKEN} ",_=Y(`,
`),g=b("button"),g.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(h,"type","button"),p(h,"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(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,h),y(a,_),y(a,g),y(a,k),S=!0,T||($=[K(f,"click",n[22]),K(d,"click",n[23]),K(h,"click",n[24]),K(g,"click",n[25])],T=!0)},p(E,L){(!S||L[1]&1&&i!==(i=E[31]))&&p(e,"for",i);let F=s;s=O(E),s===F?D[s].p(E,L):(oe(),I(D[F],1,1,()=>{D[F]=null}),re(),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),T=!1,we($)}}}function uA(n){let e,t,i,l,s,o;return e=new me({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[lA,({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:[sA,({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:[aA,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(r,a){H(e,r,a),w(r,t,a),H(i,r,a),w(r,l,a),H(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)),z(e,r),z(i,r),z(s,r)}}}function Qh(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(Le.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Ke(()=>{i&&(t||(t=Pe(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Pe(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 fA(n){let e,t,i,l,s,o,r,a,u,f=n[6]&&Qh();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=ye(),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&&le(s,c[2]),c[6]?f?d[0]&64&&A(f,1):(f=Qh(),f.c(),A(f,1),f.m(u.parentNode,u)):f&&(oe(),I(f,1,1,()=>{f=null}),re())},d(c){c&&(v(e),v(o),v(r),v(a),v(u)),f&&f.d(c)}}}function cA(n){let e,t;const i=[n[8]];let l={$$slots:{header:[fA],default:[uA]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=Ne(l,i[s]);return e=new _o({props:l}),n[26](e),e.$on("expand",n[27]),e.$on("collapse",n[28]),e.$on("toggle",n[29]),{c(){V(e.$$.fragment)},m(s,o){H(e,s,o),t=!0},p(s,o){const r=o[0]&256?pt(i,[Tt(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),z(e,s)}}}let xh;function dA(n,e,t){let i;const l=["key","title","config","expand","collapse","collapseSiblings"];let s=Ge(e,l),o;We(n,_i,U=>t(12,o=U));let{key:r}=e,{title:a}=e,{config:u={}}=e,f,c=xh,d=!1;function m(){f==null||f.expand()}function h(){f==null||f.collapse()}function _(){f==null||f.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await rt(()=>import("./CodeEditor-4e893dd8.js"),["./CodeEditor-4e893dd8.js","./index-9ee652b3.js"],import.meta.url)).default),xh=c,t(5,d=!1))}function k(U){j.copyToClipboard(U),$o(`Copied ${U} to clipboard`,2e3)}g();function S(){u.subject=this.value,t(0,u)}const T=()=>k("{APP_NAME}"),$=()=>k("{APP_U
from the
2023-12-09 21:12:00 +08:00
`),r=b("strong"),u=Y(a),f=Y(`
to the
`),c=b("strong"),m=Y(d),h=Y(`.
`),_=b("br"),g=Y(`
There are numerous command line tools that can help you, such as:
`),k=b("a"),k.textContent=`rclone
2023-12-09 21:12:00 +08:00
`,S=Y(`,
`),T=b("a"),T.textContent=`s5cmd
`,$=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(T,"href","https://github.com/peak/s5cmd"),p(T,"target","_blank"),p(T,"rel","noopener noreferrer"),p(T,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(D,"class","clearfix m-t-base")},m(F,P){w(F,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,h),y(s,_),y(s,g),y(s,k),y(s,S),y(s,T),y(s,$),y(e,C),y(e,D),E=!0},p(F,P){var N;(!E||P&1)&&a!==(a=(N=F[0].s3)!=null&&N.enabled?"S3 storage":"local file system")&&le(u,a),(!E||P&2)&&d!==(d=F[1].s3.enabled?"S3 storage":"local file system")&&le(m,d)},i(F){E||(F&&Ke(()=>{E&&(O||(O=Pe(e,et,{duration:150},!0)),O.run(1))}),E=!0)},o(F){F&&(O||(O=Pe(e,et,{duration:150},!1)),O.run(0)),E=!1},d(F){F&&v(e),F&&O&&O.end()}}}function xA(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&r_(n);return{c(){t&&t.c(),e=ye()},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=r_(l),t.c(),A(t,1),t.m(e.parentNode,e)):t&&(oe(),I(t,1,1,()=>{t=null}),re())},d(l){l&&v(e),t&&t.d(l)}}}function a_(n){let e;function t(s,o){return s[4]?nI:s[5]?tI:eI}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},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 eI(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 tI(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=Le.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 nI(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 u_(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 iI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;const k=[QA,XA],S=[];function T($,C){return $[2]?0:1}return d=T(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($,C){w($,e,C),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w($,r,C),w($,a,C),y(a,u),y(u,f),y(u,c),S[d].m(u,null),h=!0,_||(g=K(u,"submit",Ye(n[16])),_=!0)},p($,C){(!h||C&128)&&le(o,$[7]);let D=d;d=T($),d===D?S[d].p($,C):(oe(),I(S[D],1,1,()=>{S[D]=null}),re(),m=S[d],m?m.p($,C):(m=S[d]=k[d]($),m.c()),A(m,1),m.m(u,null))},i($){h||(A(m),h=!0)},o($){I(m),h=!1},d($){$&&(v(e),v(r),v(a)),S[d].d(),_=!1,g()}}}function lI(n){let e,t,i,l;return e=new bi({}),i=new gn({props:{$$slots:{default:[iI]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(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),z(
another PocketBase environment.</p>`,t=M(),i=b("div"),l=b("button"),l.innerHTML='<span class="txt">Copy</span>',s=M(),V(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(_,g){w(_,e,g),w(_,t,g),w(_,i,g),y(i,l),y(i,s),H(o,i,null),n[8](i),w(_,r,g),w(_,a,g),y(a,u),y(a,f),y(a,c),d=!0,m||(h=[K(l,"click",n[7]),K(i,"keydown",n[9]),K(c,"click",n[10])],m=!0)},p(_,g){const k={};g&4&&(k.content=_[2]),o.$set(k)},i(_){d||(A(o.$$.fragment,_),d=!0)},o(_){I(o.$$.fragment,_),d=!1},d(_){_&&(v(e),v(t),v(i),v(r),v(a)),z(o),n[8](null),m=!1,we(h)}}}function NI(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 FI(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[NI,PI],h=[];function _(g,k){return g[1]?0:1}return f=_(n),c=h[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(g,k){w(g,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(g,r,k),w(g,a,k),y(a,u),h[f].m(u,null),d=!0},p(g,k){(!d||k&8)&&le(o,g[3]);let S=f;f=_(g),f===S?h[f].p(g,k):(oe(),I(h[S],1,1,()=>{h[S]=null}),re(),c=h[f],c?c.p(g,k):(c=h[f]=m[f](g),c.c()),A(c,1),c.m(u,null))},i(g){d||(A(c),d=!0)},o(g){I(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function RI(n){let e,t,i,l;return e=new bi({}),i=new gn({props:{$$slots:{default:[FI]},$$scope:{ctx:n}}}),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment)},m(s,o){H(e,s,o),w(s,t,o),H(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),z(e,s),z(i,s)}}}function qI(n,e,t){let i,l;We(n,Dt,g=>t(3,l=g)),tn(Dt,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 g of r)delete g.created,delete g.updated}catch(g){fe.error(g)}t(1,a=!1)}function f(){j.downloadJson(r,"pb_schema")}function c(){j.copyToClipboard(i),$o("The configuration was copied to your clipboard!",3e3)}const d=()=>c();function m(g){te[g?"unshift":"push"](()=>{o=g,t(0,o)})}const h=g=>{if(g.ctrlKey&&g.code==="KeyA"){g.preventDefault();const k=window.getSelection(),S=document.createRange();S.selectNodeContents(o),k.removeAllRanges(),k.addRange(S)}},_=()=>f();return n.$$.update=()=>{n.$$.dirty&64&&t(2,i=JSON.stringify(r,null,4))},[o,a,i,l,f,c,r,d,m,h,_]}class jI extends ge{constructor(e){super(),_e(this,e,qI,RI,he,{})}}function S_(n,e,t){const i=n.slice();return i[14]=e[t],i}function $_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function T_(n,e,t){const i=n.slice();return i[14]=e[t],i}function C_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[23]=e[t][1],i}function M_(n,e,t){const i=n.slice();return i[14]=e[t],i}function O_(n,e,t){const i=n.slice();return i[17]=e[t][0],i[18]=e[t][1],i}function D_(n,e,t){const i=n.slice();return i[30]=e[t],i}function HI(n){let e,t,i,l,s=n[1].name+"",o,r=n[9]&&E_(),a=n[0].name!==n[1].name&&A_(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=E_(),r.c(),r.m(e,t)):r&&(r.d(1),r=null),u[0].name!==u[1].name?a?a.p(u,f):(a=A_(u),a.c(),a.m(e,i)):a&&(a.d(1),a=null),f[0]&2&&s!==(s=u[1].name+"")&&le(o,s)},d(u){u&&v(e),r&&r.d(),a&&a.d()}}}function zI(n){var o;let e,t,i,l=((o=n[0])==null?voi
- ${$.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!u){t(4,u=!0);try{await fe.collections.import(o,a),It("Successfully imported collections configuration."),i("submit")}catch($){fe.error($)}t(4,u=!1),c()}}const _=()=>m(),g=()=>!u;function k($){te[$?"unshift":"push"](()=>{l=$,t(1,l)})}function S($){Ae.call(this,n,$)}function T($){Ae.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,u,m,f,s,o,_,g,k,S,T]}class XI extends ge{constructor(e){super(),_e(this,e,GI,ZI,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function B_(n,e,t){const i=n.slice();return i[32]=e[t],i}function U_(n,e,t){const i=n.slice();return i[35]=e[t],i}function W_(n,e,t){const i=n.slice();return i[32]=e[t],i}function QI(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,T,$,C,D,O;a=new me({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[eL,({uniqueId:R})=>({40:R}),({uniqueId:R})=>[0,R?512:0]]},$$scope:{ctx:n}}});let E=!1,L=n[6]&&n[1].length&&!n[7]&&K_(),F=n[6]&&n[1].length&&n[7]&&J_(n),P=n[13].length&&sg(n),N=!!n[0]&&og(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(),V(a.$$.fragment),u=M(),f=M(),L&&L.c(),c=M(),F&&F.c(),d=M(),P&&P.c(),m=M(),h=b("div"),N&&N.c(),_=M(),g=b("div"),k=M(),S=b("button"),T=b("span"),T.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"),ee(o,"btn-loading",n[12]),p(i,"class","content txt-xl m-b-base"),p(g,"class","flex-fill"),p(T,"class","txt"),p(S,"type","button"),p(S,"class","btn btn-expanded btn-warning m-l-auto"),S.disabled=$=!n[14],p(h,"class","flex m-t-base")},m(R,q){w(R,e,q),n[19](e),w(R,t,q),w(R,i,q),y(i,l),y(l,s),y(l,o),w(R,r,q),H(a,R,q),w(R,u,q),w(R,f,q),L&&L.m(R,q),w(R,c,q),F&&F.m(R,q),w(R,d,q),P&&P.m(R,q),w(R,m,q),w(R,h,q),N&&N.m(h,null),y(h,_),y(h,g),y(h,k),y(h,S),y(S,T),C=!0,D||(O=[K(e,"change",n[20]),K(o,"click",n[21]),K(S,"click",n[26])],D=!0)},p(R,q){(!C||q[0]&4096)&&ee(o,"btn-loading",R[12]);const W={};q[0]&64&&(W.class="form-field "+(R[6]?"":"field-error")),q[0]&65|q[1]&1536&&(W.$$scope={dirty:q,ctx:R}),a.$set(W),R[6]&&R[1].length&&!R[7]?L||(L=K_(),L.c(),L.m(c.parentNode,c)):L&&(L.d(1),L=null),R[6]&&R[1].length&&R[7]?F?F.p(R,q):(F=J_(R),F.c(),F.m(d.parentNode,d)):F&&(F.d(1),F=null),R[13].length?P?P.p(R,q):(P=sg(R),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),R[0]?N?N.p(R,q):(N=og(R),N.c(),N.m(h,_)):N&&(N.d(1),N=null),(!C||q[0]&16384&&$!==($=!R[14]))&&(S.disabled=$)},i(R){C||(A(a.$$.fragment,R),A(E),C=!0)},o(R){I(a.$$.fragment,R),I(E),C=!1},d(R){R&&(v(e),v(t),v(i),v(r),v(u),v(f),v(c),v(d),v(m),v(h)),n[19](null),z(a,R),L&&L.d(R),F&&F.d(R),P&&P.d(R),N&&N.d(),D=!1,we(O)}}}function xI(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 Y_(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 eL(n){let e,t,i,l,s,o,r,a,u,f,c=!!n[0]&&!n[6]&&Y_();return{c(){e=b("label"),t=Y("Collections"),l=M(),s=b("textarea"),r=M(),c&&c.c(),a=ye(),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=Y_(),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 K_(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 J_(n){let e,t,i,l,s,o=n[9].length&&Z_(n),r=n[4].length&&Q_(n),a=n[8].length&&ng(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=Z_(u),o.c(),o.m(i,l)):o&&(o.d(1),o=null),u[4].length?r?r.p(u,f):(r=Q_(u),r.c(),r.m(i,s)):r&&(r.d(1),r=null),u[8].length?a?a.p(u,f):(a=ng(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 Z_(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=W_(n,l,o),a=s(r);t.set(a,e[o]=X_(a,r))}return{c(){for(let o=0;o<e.length;o+=1)e[o].c();i=ye()},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,Li,X_,i,W_))},d(o){o&&v(i);for(let r=0;r<e.length;r+=1)e[r].d(o)}}}function G_(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+"")&&le(l,i)},d(o){o&&v(e)}}}function X_(n,e){let t,i,l,s,o=e[32].nam
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 og(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 tL(n){let e,t,i,l,s,o,r,a,u,f,c,d;const m=[xI,QI],h=[];function _(g,k){return g[5]?0:1}return f=_(n),c=h[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(g,k){w(g,e,k),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(g,r,k),w(g,a,k),y(a,u),h[f].m(u,null),d=!0},p(g,k){(!d||k[0]&32768)&&le(o,g[15]);let S=f;f=_(g),f===S?h[f].p(g,k):(oe(),I(h[S],1,1,()=>{h[S]=null}),re(),c=h[f],c?c.p(g,k):(c=h[f]=m[f](g),c.c()),A(c,1),c.m(u,null))},i(g){d||(A(c),d=!0)},o(g){I(c),d=!1},d(g){g&&(v(e),v(r),v(a)),h[f].d()}}}function nL(n){let e,t,i,l,s,o;e=new bi({}),i=new gn({props:{$$slots:{default:[tL]},$$scope:{ctx:n}}});let r={};return s=new XI({props:r}),n[27](s),s.$on("submit",n[28]),{c(){V(e.$$.fragment),t=M(),V(i.$$.fragment),l=M(),V(s.$$.fragment)},m(a,u){H(e,a,u),w(a,t,u),H(i,a,u),w(a,l,u),H(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)),z(e,a),z(i,a),n[27](null),z(s,a)}}}function iL(n,e,t){let i,l,s,o,r,a,u;We(n,Dt,U=>t(15,u=U)),tn(Dt,u="Import collections",u);let f,c,d="",m=!1,h=[],_=[],g=!0,k=[],S=!1;T();async function T(){t(5,S=!0);try{t(2,_=await fe.collections.getFullList(200));for(let U of _)delete U.created,delete U.updated}catch(U){fe.error(U)}t(5,S=!1)}function $(){if(t(4,k=[]),!!i)for(let U of h){const ae=j.findByKey(_,"id",U.id);!(ae!=null&&ae.id)||!j.hasCollectionChanges(ae,U,g)||k.push({new:U,old:ae})}}function C(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=j.filterDuplicatesByKey(h)):t(1,h=[]);for(let U of h)delete U.created,delete U.updated,U.schema=j.filterDuplicatesByKey(U.schema)}function D(){var U,ae;for(let x of h){const se=j.findByKey(_,"name",x.name)||j.findByKey(_,"id",x.id);if(!se)continue;const De=x.id,je=se.id;x.id=je;const Ve=Array.isArray(se.schema)?se.schema:[],Ze=Array.isArray(x.schema)?x.schema:[];for(const tt of Ze){const Xe=j.findByKey(Ve,"name",tt.name);Xe&&Xe.id&&(tt.id=Xe.id)}for(let tt of h)if(Array.isArray(tt.schema))for(let Xe of tt.schema)(U=Xe.options)!=null&&U.collectionId&&((ae=Xe.options)==null?void 0:ae.collectionId)===De&&(Xe.options.collectionId=je)}t(0,d=JSON.stringify(h,null,4))}function O(U){t(12,m=!0);const ae=new FileReader;ae.onload=async x=>{t(12,m=!1),t(10,f.value="",f),t(0,d=x.target.result),await Qt(),h.length||(ni("Invalid collections configuration."),E())},ae.onerror=x=>{console.warn(x),ni("Failed to load the imported JSON."),t(12,m=!1),t(10,f.value="",f)},ae.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 F=()=>{f.files.length&&O(f.files[0])},P=()=>{f.click()};function N(){d=this.value,t(0,d)}function R(){g=this.checked,t(3,g)}const q=()=>D(),W=()=>E(),J=()=>c==null?void 0:c.show(_,h,g);function G(U){te[U?"unshift":"push"](()=>{c=U,t(11,c)})}const B=()=>E();return n.$$.update=()=>{n.$$.dirty[0]&1&&typeof d<"u"&&C(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.length===h.filter(U=>!!U.id&&!!U.name).length),n.$$.dirty[0]&78&&t(9,l=_.filter(U=>i&&g&&!j.findByKey(h,"id",U.id))),n.$$.dirty[0]
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"),V(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),H(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)),z(l),o=!1,r()}}}function rL(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 aL(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],ee(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&&ee(l,"btn-loading",a[3])},d(a){a&&(v(e),v(i),v(l)),o=!1,r()}}}function uL(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[aL],header:[rL],default:[oL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){V(e.$$.fragment)},m(l,s){H(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),z(e,l)}}}function fL(n,e,t){const i=ot(),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)}}ws(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?($o("A backup has already been started, please wait."),!1):!0,h=()=>(r&&$o("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _(S){te[S?"unshift":"push"](()=>{s=S,t(1,s)})}function g(S){Ae.call(this,n,S)}function k(S){Ae.call(this,n,S)}return[f,s,o,r,l,c,u,d,m,h,_,g,k]}class cL extends ge{constructor(e){super(),_e(this,e,fL,uL,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function dL(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 pL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g;return u=new sl({props:{value:n[1]}}),m=new me({props:{class:"form-field required m-0",name:"name",$$slots:{default:[dL,({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.
<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
2023-12-09 21:12:00 +08:00
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(),V(u.$$.fragment),f=Y(`
to confirm:`),c=M(),d=b("form"),V(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),H(u,s,null),y(i,f),w(k,c,S),w(k,d,S),H(m,d,null),h=!0,_||(g=K(d,"submit",Ye(n[7])),_=!0)},p(k,S){(!h||S&2)&&le(r,k[1]);const T={};S&2&&(T.value=k[1]),u.$set(T);const $={};S&98308&&($.$$scope={dirty:S,ctx:k}),m.$set($)},i(k){h||(A(u.$$.fragment,k),A(m.$$.fragment,k),h=!0)},o(k){I(u.$$.fragment,k),I(m.$$.fragment,k),h=!1},d(k){k&&(v(e),v(t),v(i),v(c),v(d)),z(u),z(m),_=!1,g()}}}function mL(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&&le(l,s[1])},d(s){s&&v(e)}}}function hL(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],ee(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&&ee(l,"btn-loading",u[4])},d(u){u&&(v(e),v(i),v(l)),r=!1,a()}}}function _L(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[hL],header:[mL],default:[pL]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){V(e.$$.fragment)},m(l,s){H(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),z(e,l)}}}function gL(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(T){clearTimeout(u),T!=null&&T.isAbort||(t(4,a=!1),ni(((S=T.response)==null?void 0:S.message)||T.message))}}}ws(()=>{clearTimeout(u)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _(S){te[S?"unshift":"push"](()=>{s=S,t(3,s)})}function g(S){Ae.call(this,n,S)}function k(S){Ae.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,h,_,g,k]}class bL extends ge{constructor(e){super(),_e(this,e,gL,_L,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function rg(n,e,t){const i=n.slice();return i[22]=e[t],i}function ag(n,e,t){const i=n.slice();return i[19]=e[t],i}function yL(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=rg(n,s,a),f=o(u);t.set(f,e[a]=fg(f,u))}let r=null;return s.length||(r=ug()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ye(),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]),oe(),e=dt(e,u,o,1,a,s,t,i.parentNode,Lt,fg,i,rg),re(),!s.length&&r?r.p(a,u):s.length?r&&(r.d(1),r=null):(r=ug(),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 kL(n){let e,t=pe(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=cg(ag(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ye()},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=ag(l,t,o);i[o]?i[o].p(r,s):(i[o]=cg(),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),ut(i,l)}}
2023-12-09 21:12:00 +08:00
`),$=b("span"),$.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=!((N=(P=n[0])==null?void 0:P.backups)!=null&&N.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($,"class","link-primary"),p(k,"class","help-block")},m(P,N){var R,q;w(P,e,N),y(e,t),w(P,l,N),w(P,s,N),ue(s,n[1].backups.cron),w(P,a,N),w(P,u,N),y(u,f),y(f,c),y(f,d),y(f,m),y(f,h),H(_,f,null),w(P,g,N),w(P,k,N),y(k,S),y(S,T),y(S,$),y(S,C),y(S,D),y(S,O),E=!0,(q=(R=n[0])==null?void 0:R.backups)!=null&&q.cron||s.focus(),L||(F=[K(s,"input",n[18]),ve(Le.call(null,$,`@yearly
@annually
@monthly
@weekly
@daily
@midnight
@hourly`))],L=!0)},p(P,N){var q,W;(!E||N[1]&1&&i!==(i=P[31]))&&p(e,"for",i),(!E||N[1]&1&&o!==(o=P[31]))&&p(s,"id",o),(!E||N[0]&1&&r!==(r=!((W=(q=P[0])==null?void 0:q.backups)!=null&&W.cron)))&&(s.autofocus=r),N[0]&2&&s.value!==P[1].backups.cron&&ue(s,P[1].backups.cron);const R={};N[0]&2|N[1]&2&&(R.$$scope={dirty:N,ctx:P}),_.$set(R)},i(P){E||(A(_.$$.fragment,P),E=!0)},o(P){I(_.$$.fragment,P),E=!1},d(P){P&&(v(e),v(l),v(s),v(a),v(u),v(g),v(k)),z(_),L=!1,we(F)}}}function PL(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&&st(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 hg(n){let e;function t(s,o){return s[7]?RL:s[8]?FL:NL}let i=t(n),l=i(n);return{c(){l.c(),e=ye()},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 NL(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 FL(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=Le.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 RL(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 _g(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 qL(n){let e,t,i,l,s,o,r,a,u,f,c,d,m,h,_,g,k,S,T,$,C,D,O,E,L,F,P;m=new Go({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new OL({props:{class:"btn-sm"}}),_.$on("success",n[13]);let N={};k=new TL({props:N}),n[15](k);function R(G,B){return G[6]?EL:DL}let q=R(n),W=q(n),J=n[6]&&!n[4]&&pg(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(),V(m.$$.fragment),h=M(),V(_.$$.fragment),g=M(),V(k.$$.fragment),S=M(),T=b("hr"),$=M(),C=b("button"),D=b("span"),D.textContent="Backups options",O=M(),W.c(),E=M(),J&&J.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],ee(C,"btn-loading",n[4]),p(u,"class","panel"),p(u,"autocomplete","off"),p(a,"class","wrapper")},m(G,B){w(G,e,B),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),w(G,r,B),w(G,a,B),y(a,u),y(u,f),y(f,c),y(f,d),H(m,f,null),y(f,h),H(_,f,null),y(u,g),H(k,u,null),y(u,S),y(u,T),y(u,$),y(u,C),y(C,D),y(C,O),W.m(C,null),y(u,E),J&&J.m(u,null),L=!0,F||(P=[K(C,"click",n[16]),K(u,"submit",Ye(n[11]))],F=!0)},p(G,B){(!L||B[0]&1024)&&le(o,G[10]);const U={};k.$set(U),q!==(q=R(G))&&(W.d(1),W=q(G),W&&(W.c(),W.m(C,null))),(!L||B[0]&16)&&(C.disabled=G[4]),(!L||B[0]&16)&&ee(C,"btn-loading",G[4]),G[6]&&!G[4]?J?(J.p(G,B),B[0]&80&&A(J,1)):(J=pg(G),J.c(),A(J,1),J.m(u,null)):J&&(oe(),I(J,1,1,()=>{J=null}),re())},i(G){L||(A(m.$$.fragment,G),A(_.$$.fragment,G),A(k.$$.fragment,G),A(J),L=!0)},o(G){I(m.$$.fragment,G),I(_.$$.fragment,G),