pocketbase/ui/dist/assets/index-Dxnq7b7H.js

158 lines
971 KiB
JavaScript
Raw Normal View History

2024-04-13 20:44:20 +08:00
function __vite__mapDeps(indexes) {
if (!__vite__mapDeps.viteFileDeps) {
__vite__mapDeps.viteFileDeps = ["./FilterAutocompleteInput-BciXxpa7.js","./index-Bfjvydfy.js","./CodeEditor-dWSAtOWY.js","./ListApiDocs-3G-vtbW4.js","./SdkTabs-DtbewOeA.js","./SdkTabs-lBWmLVyw.css","./FieldsQueryParam-CVsneoOn.js","./ListApiDocs-DhdAtA7Y.css","./ViewApiDocs-DhKxMG-g.js","./CreateApiDocs-CgLTNHGL.js","./UpdateApiDocs-j5w0Dj65.js","./DeleteApiDocs-CiCJ2h6k.js","./RealtimeApiDocs-qRWOaWAy.js","./AuthWithPasswordDocs-KjuyjMk2.js","./AuthWithOAuth2Docs-9gZ9hwvH.js","./AuthRefreshDocs-DumPRy8C.js","./RequestVerificationDocs-DCqmh1ko.js","./ConfirmVerificationDocs-C7BVcs19.js","./RequestPasswordResetDocs-D-22DAmZ.js","./ConfirmPasswordResetDocs-BGsBiiVR.js","./RequestEmailChangeDocs-B2LJ-kfg.js","./ConfirmEmailChangeDocs-DKZCgH6q.js","./AuthMethodsDocs-kjjrBjEu.js","./ListExternalAuthsDocs-Vkl7ubaf.js","./UnlinkExternalAuthDocs-ApBY4X0Z.js"]
2024-04-13 20:44:20 +08:00
}
return indexes.map((i) => __vite__mapDeps.viteFileDeps[i])
}
var u0=Object.defineProperty;var c0=(n,e,t)=>e in n?u0(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ge=(n,e,t)=>(c0(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 x(){}const bs=n=>n;function Ae(n,e){for(const t in e)n[t]=e[t];return n}function d0(n){return!!n&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"}function Cg(n){return n()}function Ga(){return Object.create(null)}function Te(n){n.forEach(Cg)}function Ot(n){return typeof n=="function"}function he(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Es;function tn(n,e){return n===e?!0:(Es||(Es=document.createElement("a")),Es.href=e,n===Es.href)}function p0(n){return Object.keys(n).length===0}function ra(n,...e){if(n==null){for(const i of e)i(void 0);return x}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function Og(n){let e;return ra(n,t=>e=t)(),e}function We(n,e,t){n.$$.on_destroy.push(ra(e,t))}function St(n,e,t,i){if(n){const l=Mg(n,e,t,i);return n[0](l)}}function Mg(n,e,t,i){return n[1]&&i?Ae(t.ctx.slice(),n[1](i(e))):t.ctx}function $t(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 Tt(n,e,t,i,l,s){if(l){const o=Mg(e,t,i,s);n.p(o,l)}}function Ct(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 Xe(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 Yn(n){return n??""}function en(n,e,t){return n.set(t),e}function $e(n){return n&&Ot(n.destroy)?n.destroy:x}function Xa(n){const e=typeof n=="string"&&n.match(/^\s*(-?[\d.]+)([^\s]*)\s*$/);return e?[parseFloat(e[1]),e[2]||"px"]:[n,"px"]}const Dg=typeof window<"u";let Ro=Dg?()=>window.performance.now():()=>Date.now(),aa=Dg?n=>requestAnimationFrame(n):x;const kl=new Set;function Eg(n){kl.forEach(e=>{e.c(n)||(kl.delete(e),e.f())}),kl.size!==0&&aa(Eg)}function qo(n){let e;return kl.size===0&&aa(Eg),{promise:new Promise(t=>{kl.add(e={c:n,f:t})}),abort(){kl.delete(e)}}}function y(n,e){n.appendChild(e)}function Ig(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function m0(n){const e=b("style");return e.textContent="/* empty */",h0(Ig(n),e),e.sheet}function h0(n,e){return y(n.head||n,e),e.sheet}function S(n,e,t){n.insertBefore(e,t||null)}function w(n){n.parentNode&&n.parentNode.removeChild(n)}function rt(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 J(n){return document.createTextNode(n)}function D(){return J(" ")}function ve(){return J("")}function Z(n,e,t,i){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t,i)}function Ue(n){return function(e){return e.preventDefault(),n.call(this,e)}}function Cn(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 _0=["width","height"];function ii(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 v=e+(t-e)*s(g);f+=g*100+`%{${o(v,1-v)}}
`}const u=f+`100% {${o(t,1-t)}}
}`,c=`__svelte_${y0(u)}_${r}`,d=Ig(n),{stylesheet:m,rules:h}=ko.get(d)||v0(d,n);h[c]||(h[c]=!0,m.insertRule(`@keyframes ${c} ${u}`,m.cssRules.length));const _=n.style.animation||"";return n.style.animation=`${_?`${_}, `:""}${c} ${i}ms linear ${l}ms 1 both`,yo+=1,c}function ss(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(", "),yo-=l,yo||w0())}function w0(){aa(()=>{yo||(ko.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&w(e)}),ko.clear())})}function S0(n,e,t,i){if(!e)return x;const l=n.getBoundingClientRect();if(e.left===l.left&&e.right===l.right&&e.top===l.top&&e.bottom===l.bottom)return x;const{delay:s=0,duration:o=300,easing:r=bs,start:a=Ro()+s,end:f=a+o,tick:u=x,css:c}=t(n,{from:e,to:l},i);let d=!0,m=!1,h;function _(){c&&(h=ls(n,0,1,o,s,r,c)),s||(m=!0)}function g(){c&&ss(n,h),d=!1}return qo(v=>{if(!m&&v>=a&&(m=!0),m&&v>=f&&(u(1,0),g()),!d)return!1;if(m){const $=v-a,C=0+1*r($/o);u(C,1-C)}return!0}),_(),u(0,1),g}function $0(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,Lg(n,l)}}function Lg(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 os;function pi(n){os=n}function ks(){if(!os)throw new Error("Function called outside component initialization");return os}function zt(n){ks().$$.on_mount.push(n)}function T0(n){ks().$$.after_update.push(n)}function ys(n){ks().$$.on_destroy.push(n)}function st(){const n=ks();return(e,t,{cancelable:i=!1}={})=>{const l=n.$$.callbacks[e];if(l){const s=Ag(e,t,{cancelable:i});return l.slice().forEach(o=>{o.call(n,s)}),!s.defaultPrevented}return!0}}function Oe(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const gl=[],te=[];let yl=[];const Rr=[],Ng=Promise.resolve();let qr=!1;function Pg(){qr||(qr=!0,Ng.then(fa))}function xt(){return Pg(),Ng}function Je(n){yl.push(n)}function ye(n){Rr.push(n)}const nr=new Set;let dl=0;function fa(){if(dl!==0)return;const n=os;do{try{for(;dl<gl.length;){const e=gl[dl];dl++,pi(e),C0(e.$$)}}catch(e){throw gl.length=0,dl=0,e}for(pi(null),gl.length=0,dl=0;te.length;)te.pop()();for(let e=0;e<yl.length;e+=1){const t=yl[e];nr.has(t)||(nr.add(t),t())}yl.length=0}while(gl.length);for(;Rr.length;)Rr.pop()();qr=!1,nr.clear(),pi(n)}function C0(n){if(n.fragment!==null){n.update(),Te(n.before_update);const e=n.dirty;n.dirty=[-1],n.fragment&&n.fragment.p(n.ctx,e),n.after_update.forEach(Je)}}function O0(n){const e=[],t=[];yl.forEach(i=>n.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),yl=e}let ql;function ua(){return ql||(ql=Promise.resolve(),ql.then(()=>{ql=null})),ql}function Ji(n,e,t){n.dispatchEvent(Ag(`${e?"intro":"outro"}${t}`))}const lo=new Set;let ti;function se(){ti={r:0,c:[],p:ti}}function oe(){ti.r||Te(ti.c),ti=ti.p}function I(n,e){n&&n.i&&(lo.delete(n),n.i(e))}function L(n,e,t,i){if(n&&n.o){if(lo.has(n))return;lo.add(n),ti.c.push(()=>{lo.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const ca={duration:0};function Fg(n,e,t){const i={direction:"in"};let l=e(n,t,i),s=!1,o,r,a=0;function f(){o&&ss(n,o)}function u(){const{delay:d=0,duration:m=300,easing:h=bs,tick:_=x,css:g}=l||ca;g&&(o=ls(n,0,1,m,d,h,g,a++)),_(0,1);const v=Ro()+d,$=v+m;r&&r.abort(),s=!0,Je(()=>Ji(n,!0,"start")),r=qo(C=>{if(s){if(C>=$)return _(1,0),Ji(n,!0,"end"),f(),s=!1;if(C>=v){const T=h((C-v)/m);_(T,1-T)}}return s})}let c=!1;return{start(){c||(c=!0,ss(n),Ot(l)?(l=l(i),ua().then(u)):u())},invalidate(){c=!1},end(){s&&(f(),s=!1)}}}function da(n,e,t){const i={direction:"out"};let l=e(n,t,i),s=!0,o;const r=ti;r.r+=1;let a;function f(){const{delay:u=0,duration:c=300,easing:d=bs,tick:m=x,css:h}=l||ca;h&&(o=ls(n,1,0,c,u,d,h));const _=Ro()+u,g=_+c;Je(()=>Ji(n,!1,"start")),"inert"in n&&(a=n.inert,n.inert=!0),qo(v=>{if(s){if(v>=g)return m(0,1),Ji(
2024-04-13 20:44:20 +08:00
`),t+=i.map(l=>{let s="";return l.name.includes("(")||l.name.includes(" ")?s+=l.name:s+="`"+l.name+"`",l.collate&&(s+=" COLLATE "+l.collate),l.sort&&(s+=" "+l.sort.toUpperCase()),s}).join(`,
`),i.length>1&&(t+=`
`),t+=")",e.where&&(t+=` WHERE ${e.where}`),t}static replaceIndexTableName(e,t){const i=H.parseIndex(e);return i.tableName=t,H.buildIndex(i)}static replaceIndexColumn(e,t,i){if(t===i)return e;const l=H.parseIndex(e);let s=!1;for(let o of l.columns)o.name===t&&(o.name=i,s=!0);return s?H.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 H.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 f=e[a];f===null?s.delete(a):s.set(a,f)}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=On([]);function To(n,e=4e3){return Jo(n,"info",e)}function Nt(n,e=3e3){return Jo(n,"success",e)}function li(n,e=4500){return Jo(n,"error",e)}function iv(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(()=>{Y1(i)},t)};Ko.update(l=>($a(l,i.message),H.pushOrReplaceByKey(l,i,"message"),l))}function Y1(n){Ko.update(e=>($a(e,n),e))}function Sa(){Ko.update(n=>{for(let e of n)$a(n,e);return[]})}function $a(n,e){let t;typeof e=="string"?t=H.findByKey(n,"message",e):t=e,t&&(clearTimeout(t.timeout),H.removeByKey(n,"message",t.message))}const hi=On({});function Gt(n){hi.set(n||{})}function si(n){hi.update(e=>(H.deleteByPath(e,n),e))}const Ta=On({});function Wr(n){Ta.set(n||{})}const qn=On([]),Jn=On({}),Co=On(!1),K1=On({});let Xl;typeof BroadcastChannel<"u"&&(Xl=new BroadcastChannel("collections"),Xl.onmessage=()=>{var n;Z1((n=Og(Jn))==null?void 0:n.id)});function J1(){Xl==null||Xl.postMessage("reload")}function lv(n){qn.update(e=>{const t=H.findByKey(e,"id",n);return t?Jn.set(t):e.length&&Jn.set(e[0]),e})}function sv(n){Jn.update(e=>H.isEmpty(e==null?void 0:e.id)||e.id===n.id?n:e),qn.update(e=>(H.pushOrReplaceByKey(e,n,"id"),Ca(),J1(),H.sortCollections(e)))}function ov(n){qn.update(e=>(H.removeByKey(e,"id",n.id),Jn.update(t=>t.id===n.id?e[0]:t),Ca(),J1(),e))}async function Z1(n=null){Co.set(!0);try{let e=await fe.collections.getFullList(200,{sort:"+name"});e=H.sortCollections(e),qn.set(e);const t=n&&H.findByKey(e,"id",n);t?Jn.set(t):e.length&&Jn.set(e[0]),Ca()}catch(e){fe.error(e)}Co.set(!1)}function Ca(){K1.update(n=>(qn.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 dr="pb_admin_file_token";zo.prototype.logout=function(n=!0){this.authStore.clear(),n&&nl("/login")};zo.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&&li(s),H.isEmpty(l.data)||Gt(l.data),i===401)return this.cancelAllRequests(),this.logout();if(i===403)return this.cancelAllRequests(),nl("/")};zo.prototype.getAdminFileToken=async function(n=""){let e=!0;if(n){const i=Og(K1);e=typeof i[n]<"u"?i[n]:!0}if(!e)return"";let t=localStorage.getItem(dr)||"";return(!t||pa(t,10))&&(t&&localStorage.removeItem(dr),this._adminFileTokenRequ
2024-04-13 20:44:20 +08:00
transform: ${f} translate(${(1-_)*c}${d}, ${(1-_)*m}${h});
opacity: ${a-u*g}`}}function tt(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]),f=l==="y"?["top","bottom"]:["left","right"],u=f.map(v=>`${v[0].toUpperCase()}${v.slice(1)}`),c=parseFloat(s[`padding${u[0]}`]),d=parseFloat(s[`padding${u[1]}`]),m=parseFloat(s[`margin${u[0]}`]),h=parseFloat(s[`margin${u[1]}`]),_=parseFloat(s[`border${u[0]}Width`]),g=parseFloat(s[`border${u[1]}Width`]);return{delay:e,duration:t,easing:i,css:v=>`overflow: hidden;opacity: ${Math.min(v*20,1)*o};${r}: ${v*a}px;padding-${f[0]}: ${v*c}px;padding-${f[1]}: ${v*d}px;margin-${f[0]}: ${v*m}px;margin-${f[1]}: ${v*h}px;border-${f[0]}-width: ${v*_}px;border-${f[1]}-width: ${v*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,f=1-l,u=r*(1-s);return{delay:e,duration:t,easing:i,css:(c,d)=>`
transform: ${a} scale(${1-f*d});
opacity: ${r-u*d}
`}}let Yr,Ri;const Kr="app-tooltip";function zf(n){return typeof n=="string"?{text:n,position:"bottom",hideOnClick:null}:n||{}}function Mi(){return Ri=Ri||document.querySelector("."+Kr),Ri||(Ri=document.createElement("div"),Ri.classList.add(Kr),document.body.appendChild(Ri)),Ri}function X1(n,e){let t=Mi();if(!t.classList.contains("active")||!(e!=null&&e.text)){Jr();return}t.textContent=e.text,t.className=Kr+" 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 Jr(){clearTimeout(Yr),Mi().classList.remove("active"),Mi().activeNode=void 0}function mv(n,e){Mi().activeNode=n,clearTimeout(Yr),Yr=setTimeout(()=>{Mi().classList.add("active"),X1(n,e)},isNaN(e.delay)?0:e.delay)}function Fe(n,e){let t=zf(e);function i(){mv(n,t)}function l(){Jr()}return n.addEventListener("mouseenter",i),n.addEventListener("mouseleave",l),n.addEventListener("blur",l),(t.hideOnClick===!0||t.hideOnClick===null&&H.isFocusable(n))&&n.addEventListener("click",l),Mi(),{update(s){var o,r;t=zf(s),(r=(o=Mi())==null?void 0:o.activeNode)!=null&&r.contains(n)&&X1(n,t)},destroy(){var s,o;(o=(s=Mi())==null?void 0:s.activeNode)!=null&&o.contains(n)&&Jr(),n.removeEventListener("mouseenter",i),n.removeEventListener("mouseleave",l),n.removeEventListener("blur",l),n.removeEventListener("click",l)}}}function Vf(n,e,t){const i=n.slice();return i[12]=e[t],i}const hv=n=>({}),Bf=n=>({uniqueId:n[4]});function _v(n){let e,t,i=ce(n[3]),l=[];for(let o=0;o<i.length;o+=1)l[o]=Uf(Vf(n,i,o));const s=o=>L(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ve()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&8){i=ce(o[3]);let a;for(a=0;a<i.length;a+=1){const f=Vf(o,i,a);l[a]?(l[a].p(f,r),I(l[a],1)):(l[a]=Uf(f),l[a].c(),I(l[a],1),l[a].m(e.parentNode,e))}for(se(),a=i.length;a<l.length;a+=1)s(a);oe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)L(l[r]);t=!1},d(o){o&&w(e),rt(l,o)}}}function gv(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,f){S(a,e,f),y(e,t),s=!0,o||(r=$e(i=Fe.call(null,t,{position:"left",text:n[3].map(Oo).join(`
`)})),o=!0)},p(a,f){i&&Ot(i.update)&&f&8&&i.update.call(null,{position:"left",text:a[3].map(Oo).join(`
`)})},i(a){s||(a&&Je(()=>{s&&(l||(l=Re(t,Yt,{duration:150,start:.7},!0)),l.run(1))}),s=!0)},o(a){a&&(l||(l=Re(t,Yt,{duration:150,start:.7},!1)),l.run(0)),s=!1},d(a){a&&w(e),a&&l&&l.end(),o=!1,r()}}}function Uf(n){let e,t,i=Oo(n[12])+"",l,s,o,r;return{c(){e=b("div"),t=b("pre"),l=J(i),s=D(),p(e,"class","help-block help-block-error")},m(a,f){S(a,e,f),y(e,t),y(t,l),y(e,s),r=!0},p(a,f){(!r||f&8)&&i!==(i=Oo(a[12])+"")&&re(l,i)},i(a){r||(a&&Je(()=>{r&&(o||(o=Re(e,tt,{duration:150},!0)),o.run(1))}),r=!0)},o(a){a&&(o||(o=Re(e,tt,{duration:150},!1)),o.run(0)),r=!1},d(a){a&&w(e),a&&o&&o.end()}}}function bv(n){let e,t,i,l,s,o,r;const a=n[9].default,f=St(a,n,n[8],Bf),u=[gv,_v],c=[];function d(m,h){return m[0]&&m[3].length?0:1}return i=d(n),l=c[i]=u[i](n),{c(){e=b("div"),f&&f.c(),t=D(),l.c(),p(e,"class",n[1]),ee(e,"error",n[3].length)},m(m,h){S(m,e,h),f&&f.m(e,null),y(e,t),c[i].m(e,null),n[11](e),s=!0,o||(r=Z(e,"click",n[10]),o=!0)},p(m,[h]){f&&f.p&&(!s||h&256)&&Tt(f,a,m,m[8],s?$t(a,m[8],h,hv):Ct(m[8]),Bf);let _=i;i=d(m),i===_?c[i].p(m,h):(se(),L(c[_],1,1,()=>{c[_]=null}),oe(),l=c[i],l?l.p(m,h):(l=c[i]=u[i](m),l.c()),I(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||(I(f,m),I(l),s=!0)},o(m){L(f,m),L(l),s=!1},d(m){m&&w(e),f&&f.d(m),c[i].d(),n[11](null),o=!1,r()}}}const Wf="Invalid value";function Oo(n){return typeof n=="object"?(n==null?void 0:n.message)||(n==null?void 0:n.code)||Wf:n||Wf}function kv(n,e,t){let i;We(n,hi,_=>t(7,i=_));let{$$slots:l={},$$scope:s}=e;const o="field_"+H.randomString(7);let{name:r=""}=e,{inlineError:a=!1}=e,{class:f=void 0}=e,u,c=[];function d(){si(r)}zt(()=>(u.addEventListener("input",d),u.addEventListener("change",d),()=>{u.removeEventListener("input",d),u.removeEventListener("change",d)}));function m(_){Oe.call(this,n,_)}function h(_){te[_?"unshift":"push"](()=>{u=_,t(2,u)})}return n.$$set=_=>{"name"in _&&t(5,r=_.name),"inlineError"in _&&t(0,a=_.inlineError),"class"in _&&t(1,f=_.class),"$$scope"in _&&t(8,s=_.$$scope)},n.$$.update=()=>{n.$$.dirty&160&&t(3,c=H.toArray(H.getNestedVal(i,r)))},[a,f,u,c,o,r,d,i,s,l,m,h]}class de extends be{constructor(e){super(),ge(this,e,kv,bv,he,{name:5,inlineError:0,class:1,changed:6})}get changed(){return this.$$.ctx[6]}}function yv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Email"),l=D(),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(f,u){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[0]),s.focus(),r||(a=Z(s,"input",n[5]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&1&&s.value!==f[0]&&ae(s,f[0])},d(f){f&&(w(e),w(l),w(s)),r=!1,a()}}}function vv(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=J("Password"),l=D(),s=b("input"),r=D(),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){S(c,e,d),y(e,t),S(c,l,d),S(c,s,d),ae(s,n[1]),S(c,r,d),S(c,a,d),f||(u=Z(s,"input",n[6]),f=!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]&&ae(s,c[1])},d(c){c&&(w(e),w(l),w(s),w(r),w(a)),f=!1,u()}}}function wv(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Password confirm"),l=D(),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(f,u){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[2]),r||(a=Z(s,"input",n[7]),r=!0)},p(f,u){u&512&&i!==(i=f[9])&&p(e,"for",i),u&512&&o!==(o=f[9])&&p(s,"id",o),u&4&&s.value!==f[2]&&ae(s,f[2])},d(f){f&&(w(e),w(l),w(s)),r=!1,a()}}}function Sv(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return l=new de({props:{class:"form-field required",name:"email",$$slots:{default:[yv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field required",name:"password",$$slots:{default:[vv,({uniqueId:h})=>({9:h}),({uniqueId:h})=>h?512:0]},$$scope:{ctx:n}}}),a=new de({props:{class:"form-field required",name:"passwordConfirm
2024-04-13 20:44:20 +08:00
* @kurkle/color v0.3.2
* https://github.com/kurkle/color#readme
* (c) 2023 Jukka Kurkela
* Released under the MIT License
*/function Cs(n){return n+.5|0}const Ti=(n,e,t)=>Math.max(Math.min(n,t),e);function Kl(n){return Ti(Cs(n*2.55),0,255)}function Di(n){return Ti(Cs(n*255),0,255)}function ci(n){return Ti(Cs(n/2.55)/100,0,1)}function ru(n){return Ti(Cs(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},Zr=[..."0123456789ABCDEF"],o2=n=>Zr[n&15],r2=n=>Zr[(n&240)>>4]+Zr[n&15],js=n=>(n&240)>>4===(n&15),a2=n=>js(n.r)&&js(n.g)&&js(n.b)&&js(n.a);function f2(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 u2=(n,e)=>n<255?e(n):"";function c2(n){var e=a2(n)?o2:r2;return n?"#"+e(n.r)+e(n.g)+e(n.b)+u2(n.a,e):void 0}const d2=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function eb(n,e,t){const i=e*Math.min(t,1-t),l=(s,o=(s+n/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[l(0),l(8),l(4)]}function p2(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 m2(n,e,t){const i=eb(n,1,.5);let l;for(e+t>1&&(l=1/(e+t),e*=l,t*=l),l=0;l<3;l++)i[l]*=1-e-t,i[l]+=e;return i}function h2(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 Oa(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,f,u;return s!==o&&(u=s-o,f=r>.5?u/(2-s-o):u/(s+o),a=h2(t,i,l,u,s),a=a*60+.5),[a|0,f||0,r]}function Ma(n,e,t,i){return(Array.isArray(e)?n(e[0],e[1],e[2]):n(e,t,i)).map(Di)}function Da(n,e,t){return Ma(eb,n,e,t)}function _2(n,e,t){return Ma(m2,n,e,t)}function g2(n,e,t){return Ma(p2,n,e,t)}function tb(n){return(n%360+360)%360}function b2(n){const e=d2.exec(n);let t=255,i;if(!e)return;e[5]!==i&&(t=e[6]?Kl(+e[5]):Di(+e[5]));const l=tb(+e[2]),s=+e[3]/100,o=+e[4]/100;return e[1]==="hwb"?i=_2(l,s,o):e[1]==="hsv"?i=g2(l,s,o):i=Da(l,s,o),{r:i[0],g:i[1],b:i[2],a:t}}function k2(n,e){var t=Oa(n);t[0]=tb(t[0]+e),t=Da(t),n.r=t[0],n.g=t[1],n.b=t[2]}function y2(n){if(!n)return;const e=Oa(n),t=e[0],i=ru(e[1]),l=ru(e[2]);return n.a<255?`hsla(${t}, ${i}%, ${l}%, ${ci(n.a)})`:`hsl(${t}, ${i}%, ${l}%)`}const au={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"},fu={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.2
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/function ai(){}const M2=(()=>{let n=0;return()=>n++})();function Ht(n){return n===null||typeof n>"u"}function Zt(n){if(Array.isArray&&Array.isArray(n))return!0;const e=Object.prototype.toString.call(n);return e.slice(0,7)==="[object"&&e.slice(-6)==="Array]"}function it(n){return n!==null&&Object.prototype.toString.call(n)==="[object Object]"}function rn(n){return(typeof n=="number"||n instanceof Number)&&isFinite(+n)}function Xn(n,e){return rn(n)?n:e}function wt(n,e){return typeof n>"u"?e:n}const D2=(n,e)=>typeof n=="string"&&n.endsWith("%")?parseFloat(n)/100*e:+n;function qt(n,e,t){if(n&&typeof n.call=="function")return n.apply(t,e)}function gt(n,e,t,i){let l,s,o;if(Zt(n))if(s=n.length,i)for(l=s-1;l>=0;l--)e.call(t,n[l],l);else for(l=0;l<s;l++)e.call(t,n[l],l);else if(it(n))for(o=Object.keys(n),s=o.length,l=0;l<s;l++)e.call(t,n[o[l]],o[l])}function Do(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 Eo(n){if(Zt(n))return n.map(Eo);if(it(n)){const e=Object.create(null),t=Object.keys(n),i=t.length;let l=0;for(;l<i;++l)e[t[l]]=Eo(n[t[l]]);return e}return n}function ib(n){return["__proto__","prototype","constructor"].indexOf(n)===-1}function E2(n,e,t,i){if(!ib(n))return;const l=e[n],s=t[n];it(l)&&it(s)?us(l,s,i):e[n]=Eo(s)}function us(n,e,t){const i=Zt(e)?e:[e],l=i.length;if(!it(n))return n;t=t||{};const s=t.merger||E2;let o;for(let r=0;r<l;++r){if(o=i[r],!it(o))continue;const a=Object.keys(o);for(let f=0,u=a.length;f<u;++f)s(a[f],n,o,t)}return n}function Ql(n,e){return us(n,e,{merger:I2})}function I2(n,e,t){if(!ib(n))return;const i=e[n],l=t[n];it(i)&&it(l)?Ql(i,l):Object.prototype.hasOwnProperty.call(e,n)||(e[n]=Eo(l))}const cu={"":n=>n,x:n=>n.x,y:n=>n.y};function A2(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 L2(n){const e=A2(n);return t=>{for(const i of e){if(i==="")break;t=t&&t[i]}return t}}function Io(n,e){return(cu[e]||(cu[e]=L2(e)))(n)}function Ea(n){return n.charAt(0).toUpperCase()+n.slice(1)}const Ao=n=>typeof n<"u",Ei=n=>typeof n=="function",du=(n,e)=>{if(n.size!==e.size)return!1;for(const t of n)if(!e.has(t))return!1;return!0};function N2(n){return n.type==="mouseup"||n.type==="click"||n.type==="contextmenu"}const on=Math.PI,Wn=2*on,P2=Wn+on,Lo=Number.POSITIVE_INFINITY,F2=on/180,Bn=on/2,qi=on/4,pu=on*2/3,Gr=Math.log10,Ol=Math.sign;function xl(n,e,t){return Math.abs(n-e)<t}function mu(n){const e=Math.round(n);n=xl(n,e,n/1e3)?e:n;const t=Math.pow(10,Math.floor(Gr(n))),i=n/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function R2(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 cs(n){return!isNaN(parseFloat(n))&&isFinite(n)}function q2(n,e){const t=Math.round(n);return t-e<=n&&t+e>=n}function j2(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 Yi(n){return n*(on/180)}function H2(n){return n*(180/on)}function hu(n){if(!rn(n))return;let e=1,t=0;for(;Math.round(n*e)/e!==n;)e*=10,t++;return t}function z2(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*on&&(s+=Wn),{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 V2(n,e){return(n-e+P2)%Wn-on}function ei(n){return(n%Wn+Wn)%Wn}function lb(n,e,t,i){const l=ei(n),s=ei(e),o=ei(t),r=ei(s-l),a=ei(o-l),f=ei(l-s),u=ei(l-o);return l===s||l===o||i&&s===o||r>a&&f<u}function Un(n,e,t){return Math.max(e,Math.min(t,n))}function B2(n){return Un(n,-32768,32767)}function sb(n,e,t,i=1e-6){return n>=Math.min(e,t)-i&&n<=Math.max(e,t)+i}function Ia(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 Ki=(n,e,t,i)=>Ia(n,t,i?l=>{const s=n[l][e];return s<t||s===t&&n[l+1][e]===t}:l=>n[l][e]<t),U2=(n,e,t)=>Ia(n,t,i=>n[i][e]>=t);function W2(n,e,t){let i=0,l=n.length;for(;i<l&&n
* Chart.js v4.4.2
* https://www.chartjs.org
* (c) 2024 Chart.js Contributors
* Released under the MIT License
*/class e3{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=rb.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 fi=new e3;const Lu="transparent",t3={boolean(n,e,t){return t>.5?e:n},color(n,e,t){const i=yu(n||Lu),l=i.valid&&yu(e||Lu);return l&&l.valid?l.mix(i,t).hexString():e},number(n,e,t){return n+(e-n)*t}};class n3{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||t3[e.type||typeof o],this._easing=es[e.easing]||es.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 vb{constructor(e,t){this._chart=e,this._properties=new Map,this.configure(t)}configure(e){if(!it(e))return;const t=Object.keys(Wt.animation),i=this._properties;Object.getOwnPropertyNames(e).forEach(l=>{const s=e[l];if(!it(s))return;const o={};for(const r of t)o[r]=s[r];(Zt(s.properties)&&s.properties||[l]).forEach(r=>{(r===l||!i.has(r))&&i.set(r,o)})})}_animateOptions(e,t){const i=t.options,l=l3(e,i);if(!l)return[];const s=this._createAnimations(l,i);return i.$shared&&i3(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 f=o[a];if(f.charAt(0)==="$")continue;if(f==="options"){l.push(...this._animateOptions(e,t));continue}const u=t[f];let c=s[f];const d=i.get(f);if(c)if(d&&c.active()){c.update(d,u,r);continue}else c.cancel();if(!d||!d.duration){e[f]=u;continue}s[f]=c=new n3(d,e,f,u),l.push(c)}return l}update(e,t){if(this._properties.size
`)>-1?n.split(`
`):n}function Q4(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 cc(n,e){const t=n.chart.ctx,{body:i,footer:l,title:s}=n,{boxWidth:o,boxHeight:r}=e,a=ni(e.bodyFont),f=ni(e.titleFont),u=ni(e.footerFont),c=s.length,d=l.length,m=i.length,h=Ii(e.padding);let _=h.height,g=0,v=i.reduce((T,O)=>T+O.before.length+O.lines.length+O.after.length,0);if(v+=n.beforeBody.length+n.afterBody.length,c&&(_+=c*f.lineHeight+(c-1)*e.titleSpacing+e.titleMarginBottom),v){const T=e.displayColors?Math.max(r,a.lineHeight):a.lineHeight;_+=m*T+(v-m)*a.lineHeight+(v-1)*e.bodySpacing}d&&(_+=e.footerMarginTop+d*u.lineHeight+(d-1)*e.footerSpacing);let $=0;const C=function(T){g=Math.max(g,t.measureText(T).width+$)};return t.save(),t.font=f.string,gt(n.title,C),t.font=a.string,gt(n.beforeBody.concat(n.afterBody),C),$=e.displayColors?o+2+e.boxPadding:0,gt(i,T=>{gt(T.before,C),gt(T.lines,C),gt(T.after,C)}),$=0,t.font=u.string,gt(n.footer,C),t.restore(),g+=h.width,{width:g,height:_}}function x4(n,e){const{y:t,height:i}=e;return t<i/2?"top":t>n.height-i/2?"bottom":"center"}function eS(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 tS(n,e,t,i){const{x:l,width:s}=t,{width:o,chartArea:{left:r,right:a}}=n;let f="center";return i==="center"?f=l<=(r+a)/2?"left":"right":l<=s/2?f="left":l>=o-s/2&&(f="right"),eS(f,n,e,t)&&(f="center"),f}function dc(n,e,t){const i=t.yAlign||e.yAlign||x4(n,t);return{xAlign:t.xAlign||e.xAlign||tS(n,e,t,i),yAlign:i}}function nS(n,e){let{x:t,width:i}=n;return e==="right"?t-=i:e==="center"&&(t-=i/2),t}function iS(n,e,t){let{y:i,height:l}=n;return e==="top"?i+=t:e==="bottom"?i-=l+t:i-=l/2,i}function pc(n,e,t,i){const{caretSize:l,caretPadding:s,cornerRadius:o}=n,{xAlign:r,yAlign:a}=t,f=l+s,{topLeft:u,topRight:c,bottomLeft:d,bottomRight:m}=uo(o);let h=nS(e,r);const _=iS(e,a,f);return a==="center"?r==="left"?h+=f:r==="right"&&(h-=f):r==="left"?h-=Math.max(u,d)+l:r==="right"&&(h+=Math.max(c,m)+l),{x:Un(h,0,i.width-e.width),y:Un(_,0,i.height-e.height)}}function Qs(n,e,t){const i=Ii(t.padding);return e==="center"?n.x+n.width/2:e==="right"?n.x+n.width-i.right:n.x+i.left}function mc(n){return Qn([],ui(n))}function lS(n,e,t){return sl(n,{tooltip:e,tooltipItems:t,type:"tooltip"})}function hc(n,e){const t=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return t?n.override(t):n}const Rb={beforeTitle:ai,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:ai,beforeBody:ai,beforeLabel:ai,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 Ht(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:ai,afterBody:ai,beforeFooter:ai,footer:ai,afterFooter:ai};function pn(n,e,t,i){const l=n[e].call(t,i);return typeof l>"u"?Rb[e].call(t,i):l}class la extends el{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 cS={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"}};Sb._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 cS},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 Sc(n){let e,t,i;return{c(){e=b("div"),p(e,"class","chart-loader loader svelte-12c378i")},m(l,s){S(l,e,s),i=!0},i(l){i||(l&&Je(()=>{i&&(t||(t=Re(e,Yt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Re(e,Yt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&w(e),l&&t&&t.end()}}}function dS(n){let e,t,i,l,s,o=n[1]==1?"log":"logs",r,a,f,u,c=n[2]&&Sc();return{c(){e=b("div"),t=b("div"),i=J("Found "),l=J(n[1]),s=D(),r=J(o),a=D(),c&&c.c(),f=D(),u=b("canvas"),p(t,"class","total-logs entrance-right svelte-12c378i"),ee(t,"hidden",n[2]),p(u,"class","chart-canvas svelte-12c378i"),p(e,"class","chart-wrapper svelte-12c378i"),ee(e,"loading",n[2])},m(d,m){S(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,f),y(e,u),n[8](u)},p(d,[m]){m&2&&re(l,d[1]),m&2&&o!==(o=d[1]==1?"log":"logs")&&re(r,o),m&4&&ee(t,"hidden",d[2]),d[2]?c?m&4&&I(c,1):(c=Sc(),c.c(),I(c,1),c.m(e,f)):c&&(se(),L(c,1,1,()=>{c=null}),oe()),m&4&&ee(e,"loading",d[2])},i(d){I(c)},o(d){L(c)},d(d){d&&w(e),c&&c.d(),n[8](null)}}}function pS(n,e,t){let{filter:i=""}=e,{presets:l=""}=e,s,o,r=[],a=0,f=!1;async function u(){t(2,f=!0);const m=[l,H.normalizeLogsFilter(i)].filter(Boolean).join("&&");return fe.logs.getStats({filter:m}).then(h=>{c(),h=H.toArray(h);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,f=!1)})}function c(){t(7,r=[]),t(1,a=0)}zt(()=>(di.register(Ci,ho,co,sa,ms,X4,sS),t(6,o=new di(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")&&u(),n.$$.dirty&192&&typeof r<"u"&&o&&(t(6,o.data.datasets[0].data=r,o),o.update())},[s,a,f,i,l,u,o,r,d]}class mS extends be{constructor(e){super(),ge(this,e,pS,dS,he,{filter:3,presets:4,load:5})}get load(){return this.$$.ctx[5]}}function h
`),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){S(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:x,o:x,d(o){o&&w(e),rt(s,o)}}}function zS(n,e,t){let{class:i=""}=e;return n.$$set=l=>{"class"in l&&t(0,i=l.class)},[i]}class Hb extends be{constructor(e){super(),ge(this,e,zS,HS,he,{class:0})}}function VS(n){let e,t,i,l,s,o,r,a,f;return t=new de({props:{class:"form-field required",name:"logs.maxDays",$$slots:{default:[US,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),l=new de({props:{class:"form-field",name:"logs.minLevel",$$slots:{default:[WS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field form-field-toggle",name:"logs.logIp",$$slots:{default:[YS,({uniqueId:u})=>({22:u}),({uniqueId:u})=>u?4194304:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),B(t.$$.fragment),i=D(),B(l.$$.fragment),s=D(),B(o.$$.fragment),p(e,"id",n[6]),p(e,"class","grid"),p(e,"autocomplete","off")},m(u,c){S(u,e,c),z(t,e,null),y(e,i),z(l,e,null),y(e,s),z(o,e,null),r=!0,a||(f=Z(e,"submit",Ue(n[7])),a=!0)},p(u,c){const d={};c&12582914&&(d.$$scope={dirty:c,ctx:u}),t.$set(d);const m={};c&12582914&&(m.$$scope={dirty:c,ctx:u}),l.$set(m);const h={};c&12582914&&(h.$$scope={dirty:c,ctx:u}),o.$set(h)},i(u){r||(I(t.$$.fragment,u),I(l.$$.fragment,u),I(o.$$.fragment,u),r=!0)},o(u){L(t.$$.fragment,u),L(l.$$.fragment,u),L(o.$$.fragment,u),r=!1},d(u){u&&w(e),V(t),V(l),V(o),a=!1,f()}}}function BS(n){let e;return{c(){e=b("div"),e.innerHTML='<div class="loader"></div>',p(e,"class","block txt-center")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function US(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=J("Max days retention"),l=D(),s=b("input"),r=D(),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){S(c,e,d),y(e,t),S(c,l,d),S(c,s,d),ae(s,n[1].logs.maxDays),S(c,r,d),S(c,a,d),f||(u=Z(s,"input",n[11]),f=!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&&lt(s.value)!==c[1].logs.maxDays&&ae(s,c[1].logs.maxDays)},d(c){c&&(w(e),w(l),w(s),w(r),w(a)),f=!1,u()}}}function WS(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;return u=new Hb({}),{c(){e=b("label"),t=J("Min log level"),l=D(),s=b("input"),o=D(),r=b("div"),a=b("p"),a.textContent="Logs with level below the minimum will be ignored.",f=D(),B(u.$$.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,_){S(h,e,_),y(e,t),S(h,l,_),S(h,s,_),ae(s,n[1].logs.minLevel),S(h,o,_),S(h,r,_),y(r,a),y(r,f),z(u,r,null),c=!0,d||(m=Z(s,"input",n[12]),d=!0)},p(h,_){(!c||_&4194304&&i!==(i=h[22]))&&p(e,"for",i),_&2&&lt(s.value)!==h[1].logs.minLevel&&ae(s,h[1].logs.minLevel)},i(h){c||(I(u.$$.fragment,h),c=!0)},o(h){L(u.$$.fragment,h),c=!1},d(h){h&&(w(e),w(l),w(s),w(o),w(r)),V(u),d=!1,m()}}}function YS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=D(),l=b("label"),s=J("Enable IP logging"),p(e,"type","checkbox"),p(e,"id",t=n[22]),p(l,"for",o=n[22])},m(f,u){S(f,e,u),e.checked=n[1].logs.logIp,S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(e,"change",n[13]),r=!0)},p(f,u){u&4194304&&t!==(t=f[22])&&p(e,"id",t),u&2&&(e.checked=f[1].logs.logIp),u&4194304&&o!==(o=f[22])&&p(l,"for",o)},d(f){f&&(w(e),w(i),w(l)),r=!1,a()}}}function KS(n){let e,t,i,l;const s=[BS,VS],o=[];function r(a,f){return a[4]?0:1}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},m(a,f){o[e].m(a,f),S(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),L(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){l||(I(t),l=!0)},o(a){L(t),l=!1},d(a){a&&w(i),o[e].d(a)}}}function JS(n){let e;return{c(){e=b("h4"),e.textContent="Logs settings"},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function ZS(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),l=b("button"),s=b("span"),s.textContent
2024-04-13 20:44:20 +08:00
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,v){(!c||v&512&&s!==(s=g[9]))&&p(e,"for",s);const $={};v&512&&($.id=g[9]),v&1&&($.disabled=!H.isEmpty(g[0].options.onlyDomains)),!a&&v&1&&(a=!0,$.value=g[0].options.exceptDomains,ye(()=>a=!1)),r.$set($)},i(g){c||(I(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&(w(e),w(o),w(f),w(u)),V(r,g),d=!1,m()}}}function rT(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[4](g)}let _={id:n[9]+".options.onlyDomains",disabled:!H.isEmpty(n[0].options.exceptDomains)};return n[0].options.onlyDomains!==void 0&&(_.value=n[0].options.onlyDomains),r=new Pl({props:_}),te.push(()=>ke(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=D(),l=b("i"),o=D(),B(r.$$.fragment),f=D(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[9]+".options.onlyDomains"),p(u,"class","help-block")},m(g,v){S(g,e,v),y(e,t),y(e,i),y(e,l),S(g,o,v),z(r,g,v),S(g,f,v),S(g,u,v),c=!0,d||(m=$e(Fe.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,v){(!c||v&512&&s!==(s=g[9]+".options.onlyDomains"))&&p(e,"for",s);const $={};v&512&&($.id=g[9]+".options.onlyDomains"),v&1&&($.disabled=!H.isEmpty(g[0].options.exceptDomains)),!a&&v&1&&(a=!0,$.value=g[0].options.onlyDomains,ye(()=>a=!1)),r.$set($)},i(g){c||(I(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&(w(e),w(o),w(f),w(u)),V(r,g),d=!1,m()}}}function aT(n){let e,t,i,l,s,o,r;return i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.exceptDomains",$$slots:{default:[oT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.onlyDomains",$$slots:{default:[rT,({uniqueId:a})=>({9:a}),({uniqueId:a})=>a?512:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=D(),s=b("div"),B(o.$$.fragment),p(t,"class","col-sm-6"),p(s,"class","col-sm-6"),p(e,"class","grid grid-sm")},m(a,f){S(a,e,f),y(e,t),z(i,t,null),y(e,l),y(e,s),z(o,s,null),r=!0},p(a,f){const u={};f&2&&(u.name="schema."+a[1]+".options.exceptDomains"),f&1537&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};f&2&&(c.name="schema."+a[1]+".options.onlyDomains"),f&1537&&(c.$$scope={dirty:f,ctx:a}),o.$set(c)},i(a){r||(I(i.$$.fragment,a),I(o.$$.fragment,a),r=!0)},o(a){L(i.$$.fragment,a),L(o.$$.fragment,a),r=!1},d(a){a&&w(e),V(i),V(o)}}}function fT(n){let e,t,i;const l=[{key:n[1]},n[2]];function s(r){n[5](r)}let o={$$slots:{options:[aT]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new oi({props:o}),te.push(()=>ke(e,"field",s)),e.$on("rename",n[6]),e.$on("remove",n[7]),e.$on("duplicate",n[8]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?mt(l,[a&2&&{key:r[1]},a&4&&Mt(r[2])]):{};a&1027&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ye(()=>t=!1)),e.$set(f)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function uT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(m){n.$$.not_equal(s.options.exceptDomains,m)&&(s.options.exceptDomains=m,t(0,s))}function a(m){n.$$.not_equal(s.options.onlyDomains,m)&&(s.options.onlyDomains=m,t(0,s))}function f(m){s=m,t(0,s)}function u(m){Oe.call(this,n,m)}function c(m){Oe.call(this,n,m)}function d(m){Oe.call(this,n,m)}return n.$$set=m=>{e=Ae(Ae({},e),Kt(m)),t(2,l=Xe(e,i)),"field"in m&&t(0,s=m.field),"key"in m&&t(1,o=m.key)},[s,o,l,r,a,f,u,c,d]}class Bb extends be{constructor(e){super(),ge(this,e,uT,fT,he,{field:0,key:1})}}function cT(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=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new Bb({props:o}),te.push(()=>ke(e,"field",s)),e.$on("rename",n[4]),e.$on("remove",n[5]),e.$on("duplicate",n[6]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&6?mt(l,[a&2&&{key:r[1]},a&4&&Mt(r[2])]):{};!t&&a&1&&(t=!0,f.field=r[0],ye(()=>t=!1)),e.$set(f)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function dT(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e;function r(c){s=c,t(0,s)}function a(c){Oe.call(this,n,c)}function f(c){Oe.call(this,n,c)}function u(c){Oe.call(this,n,c)}return n.$$set=c=>{e=Ae(Ae({},e),Kt(c)),t(2,l=Xe(e,i)),"field"in c&&t(0,s=c.field),"key"in c&&t(1,o=c.key)},[s,o,l,r,a,f,u]}class pT extends be{constructor(e){super(),ge(this,e,dT,cT,he,{field:0,key:1})}}function mT(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=D(),l=b("label"),s=b("span"),s.textContent="Strip urls domain",o=D(),r=b("i"),p(e,"type","checkbox"),p(e,"id",t=n[9]),p(s,"class","txt"),p(r,"class","ri-information-line link-hint"),p(l,"for",a=n[9])},m(c,d){S(c,e,d),e.checked=n[0].options.convertUrls,S(c,i,d),S(c,l,d),y(l,s),y(l,o),y(l,r),f||(u=[Z(e,"change",n[3]),$e(Fe.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."}))],f=!0)},p(c,d){d&512&&t!==(t=c[9])&&p(e,"id",t),d&1&&(e
<span class='flatpickr-weekday'>
`+Q.join("</span><span class='flatpickr-weekday'>")+`
</span>
`}}function le(){t.calendarContainer.classList.add("hasWeeks");var G=pt("div","flatpickr-weekwrapper");G.appendChild(pt("span","flatpickr-weekday",t.l10n.weekAbbreviation));var Q=pt("div","flatpickr-weeks");return G.appendChild(Q),{weekWrapper:G,weekNumbers:Q}}function ne(G,Q){Q===void 0&&(Q=!0);var ie=Q?G:G-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,kt("onYearChange"),F()),P(),kt("onMonthChange"),Me())}function me(G,Q){if(G===void 0&&(G=!0),Q===void 0&&(Q=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,Q===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var ie=Er(t.config),ue=ie.hours,Ce=ie.minutes,Ne=ie.seconds;m(ue,Ce,Ne)}t.redraw(),G&&kt("onChange")}function Pe(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),kt("onClose")}function ze(){t.config!==void 0&&kt("onDestroy");for(var G=t._handlers.length;G--;)t._handlers[G].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var Q=t.calendarContainer.parentNode;if(Q.lastChild&&Q.removeChild(Q.lastChild),Q.parentNode){for(;Q.firstChild;)Q.parentNode.insertBefore(Q.firstChild,Q);Q.parentNode.removeChild(Q)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(ie){try{delete t[ie]}catch{}})}function Qe(G){return t.calendarContainer.contains(G)}function et(G){if(t.isOpen&&!t.config.inline){var Q=vn(G),ie=Qe(Q),ue=Q===t.input||Q===t.altInput||t.element.contains(Q)||G.path&&G.path.indexOf&&(~G.path.indexOf(t.input)||~G.path.indexOf(t.altInput)),Ce=!ue&&!ie&&!Qe(G.relatedTarget),Ne=!t.config.ignoredFocusElements.some(function(Ze){return Ze.contains(Q)});Ce&&Ne&&(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 Dt(G){if(!(!G||t.config.minDate&&G<t.config.minDate.getFullYear()||t.config.maxDate&&G>t.config.maxDate.getFullYear())){var Q=G,ie=t.currentYear!==Q;t.currentYear=Q||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),ie&&(t.redraw(),kt("onYearChange"),F())}}function ut(G,Q){var ie;Q===void 0&&(Q=!0);var ue=t.parseDate(G,void 0,Q);if(t.config.minDate&&ue&&wn(ue,t.config.minDate,Q!==void 0?Q:!t.minDateHasTime)<0||t.config.maxDate&&ue&&wn(ue,t.config.maxDate,Q!==void 0?Q:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)ret
`),r=b("code"),r.textContent="multipart/form-data",a=J(`
requests, the following normalization rules are applied if the `),f=b("code"),f.textContent="json",u=J(` field
is a
`),c=b("strong"),c.textContent="plain string",d=J(`:
`),m=b("ul"),h=b("li"),h.innerHTML="&quot;true&quot; is converted to the json <code>true</code>",_=D(),g=b("li"),g.innerHTML="&quot;false&quot; is converted to the json <code>false</code>",v=D(),$=b("li"),$.innerHTML="&quot;null&quot; is converted to the json <code>null</code>",C=D(),T=b("li"),T.innerHTML="&quot;[1,2,3]&quot; is converted to the json <code>[1,2,3]</code>",O=D(),M=b("li"),A=J(E),N=J(" is converted to the json "),q=b("code"),q.textContent='{"a":1,"b":2}',R=D(),P=b("li"),P.textContent="numeric strings are converted to json number",F=D(),j=b("li"),j.textContent="double quoted strings are left as they are (aka. without normalizations)",U=D(),Y=b("li"),Y.textContent="any other string (empty string too) is double quoted",X=J(`
Alternatively, if you want to avoid the string value normalizations, you can wrap your
data inside an object, eg.`),W=b("code"),W.textContent='{"data": anything}',p(i,"class","content"),p(t,"class","alert alert-warning m-b-0 m-t-10"),p(e,"class","block")},m(ne,me){S(ne,e,me),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o),y(i,r),y(i,a),y(i,f),y(i,u),y(i,c),y(i,d),y(i,m),y(m,h),y(m,_),y(m,g),y(m,v),y(m,$),y(m,C),y(m,T),y(m,O),y(m,M),y(M,A),y(M,N),y(M,q),y(m,R),y(m,P),y(m,F),y(m,j),y(m,U),y(m,Y),y(i,X),y(i,W),le=!0},i(ne){le||(ne&&Je(()=>{le&&(K||(K=Re(e,tt,{duration:150},!0)),K.run(1))}),le=!0)},o(ne){ne&&(K||(K=Re(e,tt,{duration:150},!1)),K.run(0)),le=!1},d(ne){ne&&w(e),ne&&K&&K.end()}}}function aC(n){let e,t,i,l,s,o,r,a,f,u,c;e=new de({props:{class:"form-field required m-b-sm",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[sC,({uniqueId:g})=>({11:g}),({uniqueId:g})=>g?2048:0]},$$scope:{ctx:n}}});function d(g,v){return g[2]?rC:oC}let m=d(n),h=m(n),_=n[2]&&$d();return{c(){B(e.$$.fragment),t=D(),i=b("button"),l=b("strong"),l.textContent="String value normalizations",s=D(),h.c(),r=D(),_&&_.c(),a=ve(),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,v){z(e,g,v),S(g,t,v),S(g,i,v),y(i,l),y(i,s),h.m(i,null),S(g,r,v),_&&_.m(g,v),S(g,a,v),f=!0,u||(c=Z(i,"click",n[5]),u=!0)},p(g,v){const $={};v&2&&($.name="schema."+g[1]+".options.maxSize"),v&6145&&($.$$scope={dirty:v,ctx:g}),e.$set($),m!==(m=d(g))&&(h.d(1),h=m(g),h&&(h.c(),h.m(i,null))),(!f||v&4&&o!==(o="btn btn-sm "+(g[2]?"btn-secondary":"btn-hint btn-transparent")))&&p(i,"class",o),g[2]?_?v&4&&I(_,1):(_=$d(),_.c(),I(_,1),_.m(a.parentNode,a)):_&&(se(),L(_,1,1,()=>{_=null}),oe())},i(g){f||(I(e.$$.fragment,g),I(_),f=!0)},o(g){L(e.$$.fragment,g),L(_),f=!1},d(g){g&&(w(t),w(i),w(r),w(a)),V(e,g),h.d(),_&&_.d(g),u=!1,c()}}}function fC(n){let e,t,i;const l=[{key:n[1]},n[3]];function s(r){n[6](r)}let o={$$slots:{options:[aC]},$$scope:{ctx:n}};for(let r=0;r<l.length;r+=1)o=Ae(o,l[r]);return n[0]!==void 0&&(o.field=n[0]),e=new oi({props:o}),te.push(()=>ke(e,"field",s)),e.$on("rename",n[7]),e.$on("remove",n[8]),e.$on("duplicate",n[9]),{c(){B(e.$$.fragment)},m(r,a){z(e,r,a),i=!0},p(r,[a]){const f=a&10?mt(l,[a&2&&{key:r[1]},a&8&&Mt(r[3])]):{};a&4103&&(f.$$scope={dirty:a,ctx:r}),!t&&a&1&&(t=!0,f.field=r[0],ye(()=>t=!1)),e.$set(f)},i(r){i||(I(e.$$.fragment,r),i=!0)},o(r){L(e.$$.fragment,r),i=!1},d(r){V(e,r)}}}function uC(n,e,t){const i=["field","key"];let l=Xe(e,i),{field:s}=e,{key:o=""}=e,r=!1;function a(){t(0,s.options={maxSize:2e6},s)}function f(){s.options.maxSize=lt(this.value),t(0,s)}const u=()=>{t(2,r=!r)};function c(_){s=_,t(0,s)}function d(_){Oe.call(this,n,_)}function m(_){Oe.call(this,n,_)}function h(_){Oe.call(this,n,_)}return n.$$set=_=>{e=Ae(Ae({},e),Kt(_)),t(3,l=Xe(e,i)),"field"in _&&t(0,s=_.field),"key"in _&&t(1,o=_.key)},n.$$.update=()=>{n.$$.dirty&1&&H.isEmpty(s.options)&&a()},[s,o,r,l,f,u,c,d,m,h]}class cC extends be{constructor(e){super(),ge(this,e,uC,fC,he,{field:0,key:1})}}function dC(n){let e,t=(n[0].ext||"N/A")+"",i,l,s,o=n[0].mimeType+"",r;return{c(){e=b("span"),i=J(t),l=D(),s=b("small"),r=J(o),p(e,"class","txt"),p(s,"class","txt-hint")},m(a,f){S(a,e,f),y(e,i),S(a,l,f),S(a,s,f),y(s,r)},p(a,[f]){f&1&&t!==(t=(a[0].ext||"N/A")+"")&&re(i,t),f&1&&o!==(o=a[0].mimeType+"")&&re(r,o)},i:x,o:x,d(a){a&&(w(e),w(l),w(s))}}}function pC(n,e,t){let{item:i={}}=e;return n.$$set=l=>{"item"in l&&t(0,i=l.item)},[i]}class Td extends be{constructor(e){super(),ge(this,e,pC,dC,he,{item:0})}}const mC=[{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:"applic
Leave empty for no restriction.`,position:"top"})),$=!0)},p(M,E){(!v||E&8388608&&s!==(s=M[23]))&&p(e,"for",s);const A={};E&8388608&&(A.id=M[23]),E&8&&(A.items=M[3]),!a&&E&1&&(a=!0,A.keyOfSelected=M[0].options.mimeTypes,ye(()=>a=!1)),r.$set(A);const N={};E&33554433&&(N.$$scope={dirty:E,ctx:M}),g.$set(N)},i(M){v||(I(r.$$.fragment,M),I(g.$$.fragment,M),v=!0)},o(M){L(r.$$.fragment,M),L(g.$$.fragment,M),v=!1},d(M){M&&(w(e),w(o),w(f),w(u)),V(r,M),V(g),$=!1,C()}}}function kC(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){S(t,e,i)},p:x,d(t){t&&w(e)}}}function yC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T,O;function M(A){n[13](A)}let E={id:n[23],placeholder:"eg. 50x50, 480x720"};return n[0].options.thumbs!==void 0&&(E.value=n[0].options.thumbs),r=new Pl({props:E}),te.push(()=>ke(r,"value",M)),$=new Mn({props:{class:"dropdown dropdown-sm dropdown-center dropdown-nowrap p-r-10",$$slots:{default:[kC]},$$scope:{ctx:n}}}),{c(){e=b("label"),t=b("span"),t.textContent="Thumb sizes",i=D(),l=b("i"),o=D(),B(r.$$.fragment),f=D(),u=b("div"),c=b("span"),c.textContent="Use comma as separator.",d=D(),m=b("button"),h=b("span"),h.textContent="Supported formats",_=D(),g=b("i"),v=D(),B($.$$.fragment),p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[23]),p(c,"class","txt"),p(h,"class","txt link-primary"),p(g,"class","ri-arrow-drop-down-fill"),p(g,"aria-hidden","true"),p(m,"type","button"),p(m,"class","inline-flex flex-gap-0"),p(u,"class","help-block")},m(A,N){S(A,e,N),y(e,t),y(e,i),y(e,l),S(A,o,N),z(r,A,N),S(A,f,N),S(A,u,N),y(u,c),y(u,d),y(u,m),y(m,h),y(m,_),y(m,g),y(m,v),z($,m,null),C=!0,T||(O=$e(Fe.call(null,l,{text:"List of additional thumb sizes for image files, along with the default thumb size of 100x100. The thumbs are generated lazily on first access.",position:"top"})),T=!0)},p(A,N){(!C||N&8388608&&s!==(s=A[23]))&&p(e,"for",s);const q={};N&8388608&&(q.id=A[23]),!a&&N&1&&(a=!0,q.value=A[0].options.thumbs,ye(()=>a=!1)),r.$set(q);const R={};N&33554432&&(R.$$scope={dirty:N,ctx:A}),$.$set(R)},i(A){C||(I(r.$$.fragment,A),I($.$$.fragment,A),C=!0)},o(A){L(r.$$.fragment,A),L($.$$.fragment,A),C=!1},d(A){A&&(w(e),w(o),w(f),w(u)),V(r,A),V($),T=!1,O()}}}function vC(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("label"),t=J("Max file size"),l=D(),s=b("input"),r=D(),a=b("div"),a.textContent="Must be in bytes.",p(e,"for",i=n[23]),p(s,"type","number"),p(s,"id",o=n[23]),p(s,"step","1"),p(s,"min","0"),p(a,"class","help-block")},m(c,d){S(c,e,d),y(e,t),S(c,l,d),S(c,s,d),ae(s,n[0].options.maxSize),S(c,r,d),S(c,a,d),f||(u=Z(s,"input",n[14]),f=!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&1&&lt(s.value)!==c[0].options.maxSize&&ae(s,c[0].options.maxSize)},d(c){c&&(w(e),w(l),w(s),w(r),w(a)),f=!1,u()}}}function Cd(n){let e,t,i;return t=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSelect",$$slots:{default:[wC,({uniqueId:l})=>({23:l}),({uniqueId:l})=>l?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","col-sm-3")},m(l,s){S(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s&2&&(o.name="schema."+l[1]+".options.maxSelect"),s&41943041&&(o.$$scope={dirty:s,ctx:l}),t.$set(o)},i(l){i||(I(t.$$.fragment,l),i=!0)},o(l){L(t.$$.fragment,l),i=!1},d(l){l&&w(e),V(t)}}}function wC(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Max select"),l=D(),s=b("input"),p(e,"for",i=n[23]),p(s,"id",o=n[23]),p(s,"type","number"),p(s,"step","1"),p(s,"min","2"),s.required=!0},m(f,u){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[0].options.maxSelect),r||(a=Z(s,"input",n[15]),r=!0)},p(f,u){u&8388608&&i!==(i=f[23])&&p(e,"for",i),u&8388608&&o!==(o=f[23])&&p(s,"id",o),u&1&&lt(s.value)!==f[0].options.maxSelect&&ae(s,f[0].options.maxSelect)},d(f){f&&(w(e),w(l),w(s)),r=!1,a()}}}function SC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;i=new de({props:{class:"form-field",name:"schema."+n[1]+".options.mimeTypes",$$slots:{default:[bC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),o=new de({props:{class:"form-field",name:"schema."+n[1]+".options.thumbs",$$slots:{default:[yC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"schema."+n[1]+".options.maxSize",$$slots:{default:[vC,({uniqueId:_})=>({23:_}),({uniqueId:_})=>_?8388608:0]},$$scope:{ctx:n}}});let h=!n[2]&&Cd(n);return{c(){e=b("div"),t=b("div"),B(i.$$.fragment),l=D(),s=b("div"),B(o.$$.fragment),a=D(),f=b("div"),B(u.$$.fragment
`),position:"top"})),c=!0)},p(_,g){var $,C;s&&Ot(s.update)&&g&20&&s.update.call(null,{text:[`Whether on ${(($=_[4])==null?void 0:$.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 ${((C=_[4])==null?void 0:C.name)||"relation"} ids are removed from the corresponding record.`].filter(Boolean).join(`
`),position:"top"}),(!u||g&16777216&&o!==(o=_[24]))&&p(e,"for",o);const v={};g&16777216&&(v.id=_[24]),!f&&g&1&&(f=!0,v.keyOfSelected=_[0].options.cascadeDelete,ye(()=>f=!1)),a.$set(v)},i(_){u||(I(a.$$.fragment,_),u=!0)},o(_){L(a.$$.fragment,_),u=!1},d(_){_&&(w(e),w(r)),V(a,_),c=!1,d()}}}function FC(n){let e,t,i,l,s,o=!n[2]&&Od(n);return l=new de({props:{class:"form-field",name:"schema."+n[1]+".options.cascadeDelete",$$slots:{default:[PC,({uniqueId:r})=>({24:r}),({uniqueId:r})=>r?16777216:0]},$$scope:{ctx:n}}}),{c(){e=b("div"),o&&o.c(),t=D(),i=b("div"),B(l.$$.fragment),p(i,"class","col-sm-12"),p(e,"class","grid grid-sm")},m(r,a){S(r,e,a),o&&o.m(e,null),y(e,t),y(e,i),z(l,i,null),s=!0},p(r,a){r[2]?o&&(se(),L(o,1,1,()=>{o=null}),oe()):o?(o.p(r,a),a&4&&I(o,1)):(o=Od(r),o.c(),I(o,1),o.m(e,t));const f={};a&2&&(f.name="schema."+r[1]+".options.cascadeDelete"),a&83886101&&(f.$$scope={dirty:a,ctx:r}),l.$set(f)},i(r){s||(I(o),I(l.$$.fragment,r),s=!0)},o(r){L(o),L(l.$$.fragment,r),s=!1},d(r){r&&w(e),o&&o.d(),V(l)}}}function RC(n){let e,t,i,l,s;const o=[{key:n[1]},n[8]];function r(u){n[17](u)}let a={$$slots:{options:[FC],default:[AC,({interactive:u})=>({25:u}),({interactive:u})=>u?33554432:0]},$$scope:{ctx:n}};for(let u=0;u<o.length;u+=1)a=Ae(a,o[u]);n[0]!==void 0&&(a.field=n[0]),e=new oi({props:a}),te.push(()=>ke(e,"field",r)),e.$on("rename",n[18]),e.$on("remove",n[19]),e.$on("duplicate",n[20]);let f={};return l=new Ua({props:f}),n[21](l),l.$on("save",n[22]),{c(){B(e.$$.fragment),i=D(),B(l.$$.fragment)},m(u,c){z(e,u,c),S(u,i,c),z(l,u,c),s=!0},p(u,[c]){const d=c&258?mt(o,[c&2&&{key:u[1]},c&256&&Mt(u[8])]):{};c&100663359&&(d.$$scope={dirty:c,ctx:u}),!t&&c&1&&(t=!0,d.field=u[0],ye(()=>t=!1)),e.$set(d);const m={};l.$set(m)},i(u){s||(I(e.$$.fragment,u),I(l.$$.fragment,u),s=!0)},o(u){L(e.$$.fragment,u),L(l.$$.fragment,u),s=!1},d(u){u&&w(i),V(e,u),n[21](null),V(l,u)}}}function qC(n,e,t){var P;let i,l;const s=["field","key"];let o=Xe(e,s),r;We(n,qn,F=>t(10,r=F));let{field:a}=e,{key:f=""}=e;const u=[{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=lt(this.value),t(0,a),t(9,h),t(2,m)}function v(){a.options.maxSelect=lt(this.value),t(0,a),t(9,h),t(2,m)}function $(F){n.$$.not_equal(a.options.cascadeDelete,F)&&(a.options.cascadeDelete=F,t(0,a),t(9,h),t(2,m))}const C=()=>d==null?void 0:d.show();function T(F){n.$$.not_equal(a.options.collectionId,F)&&(a.options.collectionId=F,t(0,a),t(9,h),t(2,m))}function O(F){m=F,t(2,m)}function M(F){a=F,t(0,a),t(9,h),t(2,m)}function E(F){Oe.call(this,n,F)}function A(F){Oe.call(this,n,F)}function N(F){Oe.call(this,n,F)}function q(F){te[F?"unshift":"push"](()=>{d=F,t(3,d)})}const R=F=>{var j,U;(U=(j=F==null?void 0:F.detail)==null?void 0:j.collection)!=null&&U.id&&F.detail.collection.type!="view"&&t(0,a.options.collectionId=F.detail.collection.id,a)};return n.$$set=F=>{e=Ae(Ae({},e),Kt(F)),t(8,o=Xe(e,s)),"field"in F&&t(0,a=F.field),"key"in F&&t(1,f=F.key)},n.$$.update=()=>{n.$$.dirty&1024&&t(5,i=r.filter(F=>F.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&&H.isEmpty(a.options)&&_(),n.$$.dirty&1025&&t(4,l=r.find(F=>F.id==a.options.collectionId)||null)},[a,f,m,d,l,i,u,c,o,h,r,g,v,$,C,T,O,M,E,A,N,q,R]}class jC extends be{constructor(e){super(),ge(this,e,qC,RC,he,{field:0,key:1})}}const HC=n=>({dragging:n&4,dragover:n&8}),Md=n=>({dragging:n[2],dragover:n[3]});function zC(n){let e,t,i,l,s;const o=n[10].default,r=St(o,n,n[9],Md);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,f){S(a,e,f),r&&r.m(e,null),i=!0,l||(s=[Z(e,"dragover",Ue(n[11])),Z(e,"dragleave",Ue(n[12])),Z(e,"dragend",n[13]),Z(e,"dragstart",n[14]),Z(e,"drop",n[15])],l=!0)},p(a,[f]){r&&r.p&&(!i||f&524)&&Tt(r,o
`),t=b("code"),t.textContent="username",i=J(` ,
`),l=b("code"),l.textContent="email",s=J(` ,
`),o=b("code"),o.textContent="emailVisibility",r=J(` ,
`),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(f,u){S(f,e,u),S(f,t,u),S(f,i,u),S(f,l,u),S(f,s,u),S(f,o,u),S(f,r,u),S(f,a,u)},d(f){f&&(w(e),w(t),w(i),w(l),w(s),w(o),w(r),w(a))}}}function BC(n){let e,t,i,l;function s(u){n[7](u,n[19],n[20],n[21])}function o(){return n[8](n[21])}function r(){return n[9](n[21])}var a=n[1][n[19].type];function f(u,c){let d={key:u[5](u[19])};return u[19]!==void 0&&(d.field=u[19]),{props:d}}return a&&(e=Et(a,f(n)),te.push(()=>ke(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10])),{c(){e&&B(e.$$.fragment),i=D()},m(u,c){e&&z(e,u,c),S(u,i,c),l=!0},p(u,c){if(n=u,c&1&&a!==(a=n[1][n[19].type])){if(e){se();const d=e;L(d.$$.fragment,1,0,()=>{V(d,1)}),oe()}a?(e=Et(a,f(n)),te.push(()=>ke(e,"field",s)),e.$on("remove",o),e.$on("duplicate",r),e.$on("rename",n[10]),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(a){const d={};c&1&&(d.key=n[5](n[19])),!t&&c&1&&(t=!0,d.field=n[19],ye(()=>t=!1)),e.$set(d)}},i(u){l||(e&&I(e.$$.fragment,u),l=!0)},o(u){e&&L(e.$$.fragment,u),l=!1},d(u){u&&w(i),e&&V(e,u)}}}function Id(n,e){let t,i,l,s;function o(a){e[11](a)}let r={index:e[21],disabled:e[19].toDelete||e[19].id&&e[19].system,dragHandleClass:"drag-handle-wrapper",$$slots:{default:[BC]},$$scope:{ctx:e}};return e[0].schema!==void 0&&(r.list=e[0].schema),i=new Ds({props:r}),te.push(()=>ke(i,"list",o)),i.$on("drag",e[12]),i.$on("sort",e[13]),{key:n,first:null,c(){t=ve(),B(i.$$.fragment),this.first=t},m(a,f){S(a,t,f),z(i,a,f),s=!0},p(a,f){e=a;const u={};f&1&&(u.index=e[21]),f&1&&(u.disabled=e[19].toDelete||e[19].id&&e[19].system),f&4194305&&(u.$$scope={dirty:f,ctx:e}),!l&&f&1&&(l=!0,u.list=e[0].schema,ye(()=>l=!1)),i.$set(u)},i(a){s||(I(i.$$.fragment,a),s=!0)},o(a){L(i.$$.fragment,a),s=!1},d(a){a&&w(t),V(i,a)}}}function UC(n){let e,t,i,l,s,o,r,a,f,u,c,d,m=[],h=new Map,_,g,v,$,C,T,O,M,E=n[0].type==="auth"&&Ed(),A=ce(n[0].schema);const N=P=>P[19];for(let P=0;P<A.length;P+=1){let F=Dd(n,A,P),j=N(F);h.set(j,m[P]=Id(j,F))}g=new O$({props:{class:"btn btn-block btn-outline"}}),g.$on("select",n[14]);function q(P){n[15](P)}let R={};return n[0]!==void 0&&(R.collection=n[0]),T=new S$({props:R}),te.push(()=>ke(T,"collection",q)),{c(){e=b("div"),t=b("p"),i=J(`System fields:
`),l=b("code"),l.textContent="id",s=J(` ,
`),o=b("code"),o.textContent="created",r=J(` ,
`),a=b("code"),a.textContent="updated",f=D(),E&&E.c(),u=J(`
.`),c=D(),d=b("div");for(let P=0;P<m.length;P+=1)m[P].c();_=D(),B(g.$$.fragment),v=D(),$=b("hr"),C=D(),B(T.$$.fragment),p(l,"class","txt-sm"),p(o,"class","txt-sm"),p(a,"class","txt-sm"),p(t,"class","txt-sm"),p(e,"class","block m-b-25"),p(d,"class","schema-fields")},m(P,F){S(P,e,F),y(e,t),y(t,i),y(t,l),y(t,s),y(t,o),y(t,r),y(t,a),y(t,f),E&&E.m(t,null),y(t,u),S(P,c,F),S(P,d,F);for(let j=0;j<m.length;j+=1)m[j]&&m[j].m(d,null);S(P,_,F),z(g,P,F),S(P,v,F),S(P,$,F),S(P,C,F),z(T,P,F),M=!0},p(P,[F]){P[0].type==="auth"?E||(E=Ed(),E.c(),E.m(t,u)):E&&(E.d(1),E=null),F&111&&(A=ce(P[0].schema),se(),m=ft(m,F,N,1,P,A,h,d,It,Id,null,Dd),oe());const j={};!O&&F&1&&(O=!0,j.collection=P[0],ye(()=>O=!1)),T.$set(j)},i(P){if(!M){for(let F=0;F<A.length;F+=1)I(m[F]);I(g.$$.fragment,P),I(T.$$.fragment,P),M=!0}},o(P){for(let F=0;F<m.length;F+=1)L(m[F]);L(g.$$.fragment,P),L(T.$$.fragment,P),M=!1},d(P){P&&(w(e),w(c),w(d),w(_),w(v),w($),w(C)),E&&E.d();for(let F=0;F<m.length;F+=1)m[F].d();V(g,P),V(T,P)}}}function WC(n,e,t){let i,{collection:l}=e;const s={text:Y$,number:eT,bool:iT,email:Bb,url:pT,editor:bT,date:NT,select:lC,json:cC,file:MC,relation:jC};function o(M){l.schema[M]&&(l.schema.splice(M,1),t(0,l))}function r(M){const E=l.schema[M];if(!E)return;E.onMountSelect=!1;const A=structuredClone(E);A.id="",A.name=f(A.name+"_copy"),A.onMountSelect=!0,l.schema.splice(M+1,0,A),t(0,l)}function a(M="text"){const E=H.initSchemaField({name:f(),type:M});E.onMountSelect=!0,l.schema.push(E),t(0,l)}function f(M="field"){var R;let E=M,A=2,N=((R=M.match(/\d+$/))==null?void 0:R[0])||"",q=N?M.substring(0,M.length-N.length):M;for(;u(E);)E=q+((N<<0)+A),A++;return E}function u(M){var E;return!!((E=l==null?void 0:l.schema)!=null&&E.find(A=>A.name===M))}function c(M){return i.findIndex(E=>E===M)}function d(M,E){var A,N;!((A=l==null?void 0:l.schema)!=null&&A.length)||M===E||!E||(N=l==null?void 0:l.schema)!=null&&N.find(q=>q.name==M&&!q.toDelete)||t(0,l.indexes=l.indexes.map(q=>H.replaceIndexColumn(q,M,E)),l)}function m(M,E,A,N){A[N]=M,t(0,l)}const h=M=>o(M),_=M=>r(M),g=M=>d(M.detail.oldName,M.detail.newName);function v(M){n.$$.not_equal(l.schema,M)&&(l.schema=M,t(0,l))}const $=M=>{if(!M.detail)return;const E=M.detail.target;E.style.opacity=0,setTimeout(()=>{var A;(A=E==null?void 0:E.style)==null||A.removeProperty("opacity")},0),M.detail.dataTransfer.setDragImage(E,0,0)},C=()=>{Gt({})},T=M=>a(M.detail);function O(M){l=M,t(0,l)}return n.$$set=M=>{"collection"in M&&t(0,l=M.collection)},n.$$.update=()=>{n.$$.dirty&1&&typeof l.schema>"u"&&t(0,l.schema=[],l),n.$$.dirty&1&&(i=l.schema.filter(M=>!M.toDelete)||[])},[l,s,o,r,a,c,d,m,h,_,g,v,$,C,T,O]}class YC extends be{constructor(e){super(),ge(this,e,WC,UC,he,{collection:0})}}const KC=n=>({isAdminOnly:n&512}),Ad=n=>({isAdminOnly:n[9]}),JC=n=>({isAdminOnly:n&512}),Ld=n=>({isAdminOnly:n[9]}),ZC=n=>({isAdminOnly:n&512}),Nd=n=>({isAdminOnly:n[9]});function GC(n){let e,t;return e=new de({props:{class:"form-field rule-field "+(n[4]?"requied":"")+" "+(n[9]?"disabled":""),name:n[3],$$slots:{default:[QC,({uniqueId:i})=>({18:i}),({uniqueId:i})=>i?262144:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&528&&(s.class="form-field rule-field "+(i[4]?"requied":"")+" "+(i[9]?"disabled":"")),l&8&&(s.name=i[3]),l&295655&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function XC(n){let e;return{c(){e=b("div"),e.innerHTML='<span class="loader"></span>',p(e,"class","txt-center")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function Pd(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){S(l,e,s),t||(i=Z(e,"click",n[11]),t=!0)},p:x,d(l){l&&w(e),t=!1,i()}}}function Fd(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-1akua
2024-04-13 20:44:20 +08:00
<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(u,"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($,"class","inline-flex flex-gap-5"),p(T,"class","m-t-10 m-b-5"),p(i,"class","content"),p(t,"class","alert alert-warning m-0")},m(R,P){S(R,e,P),y(e,t),y(t,i),y(i,l),y(i,s),y(i,o);for(let F=0;F<q.length;F+=1)q[F]&&q[F].m(o,null);y(i,r),y(i,a),y(i,f),y(i,u),y(i,c),y(i,d),y(i,m),y(i,h),y(i,_),y(i,g),y(i,v),y(i,$),y(i,C),y(i,T),y(i,O),y(i,M),A=!0},p(R,P){if(P&4){N=ce(R[2]);let F;for(F=0;F<N.length;F+=1){const j=qd(R,N,F);q[F]?q[F].p(j,P):(q[F]=Hd(j),q[F].c(),q[F].m(o,null))}for(;F<q.length;F+=1)q[F].d(1);q.length=N.length}},i(R){A||(R&&Je(()=>{A&&(E||(E=Re(e,tt,{duration:150},!0)),E.run(1))}),A=!0)},o(R){R&&(E||(E=Re(e,tt,{duration:150},!1)),E.run(0)),A=!1},d(R){R&&w(e),rt(q,R),R&&E&&E.end()}}}function Hd(n){let e,t=n[11]+"",i;return{c(){e=b("code"),i=J(t)},m(l,s){S(l,e,s),y(e,i)},p(l,s){s&4&&t!==(t=l[11]+"")&&re(i,t)},d(l){l&&w(e)}}}function zd(n){let e,t,i,l,s,o,r,a,f;function u(g){n[6](g)}let c={label:"Create rule",formKey:"createRule",collection:n[0],$$slots:{afterLabel:[t5,({isAdminOnly:g})=>({10:g}),({isAdminOnly:g})=>g?1024:0]},$$scope:{ctx:n}};n[0].createRule!==void 0&&(c.rule=n[0].createRule),e=new Tl({props:c}),te.push(()=>ke(e,"rule",u));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 Tl({props:m}),te.push(()=>ke(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 Tl({props:_}),te.push(()=>ke(r,"rule",h)),{c(){B(e.$$.fragment),i=D(),B(l.$$.fragment),o=D(),B(r.$$.fragment)},m(g,v){z(e,g,v),S(g,i,v),z(l,g,v),S(g,o,v),z(r,g,v),f=!0},p(g,v){const $={};v&1&&($.collection=g[0]),v&17408&&($.$$scope={dirty:v,ctx:g}),!t&&v&1&&(t=!0,$.rule=g[0].createRule,ye(()=>t=!1)),e.$set($);const C={};v&1&&(C.collection=g[0]),!s&&v&1&&(s=!0,C.rule=g[0].updateRule,ye(()=>s=!1)),l.$set(C);const T={};v&1&&(T.collection=g[0]),!a&&v&1&&(a=!0,T.rule=g[0].deleteRule,ye(()=>a=!1)),r.$set(T)},i(g){f||(I(e.$$.fragment,g),I(l.$$.fragment,g),I(r.$$.fragment,g),f=!0)},o(g){L(e.$$.fragment,g),L(l.$$.fragment,g),L(r.$$.fragment,g),f=!1},d(g){g&&(w(i),w(o)),V(e,g),V(l,g),V(r,g)}}}function Vd(n){let e,t,i;return{c(){e=b("i"),p(e,"class","ri-information-line link-hint")},m(l,s){S(l,e,s),t||(i=$e(Fe.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&&w(e),t=!1,i()}}}function t5(n){let e,t=!n[10]&&Vd();return{c(){t&&t.c(),e=ve()},m(i,l){t&&t.m(i,l),S(i,e,l)},p(i,l){i[10]?t&&(t.d(1),t=null):t||(t=Vd(),t.c(),t.m(e.parentNode,e))},d(i){i&&w(e),t&&t.d(i)}}}function Bd(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:[n5]},$$scope:{ctx:n}};return n[0].options.manageRule!==void 0&&(s.rule=n[0].options.manageRule),e=new Tl({props:s}),te.push(()=>ke(e,"rule",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r&1&&(a.required=o[0].options.manageRule!==null),r&1&&(a.collection=o[0]),r&16384&&(a.$$scope={dirty:r,ctx:o}),!t&&r&1&&(t=!0,a.rule=o[0].options.manageRule,ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function n5(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=D(),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){S(l,e,s),S(l,t,s),S(l,i,s)},p:x,d(l){l&&(w(e),w(t),w(i))}}}function i5(n){var P,F;let e,t,i,l,s,o=n[1]?"Hide available fields":"Show available fields",r,a,f,u,c,d,m,h,_,g,v,$,C,T,O=n[1]&&jd(n);function M(j){n[4](j)}let E={label:"List/Search rule",formKey:"listRule",collection:n[0]};n[0].listRule!==void 0&&(E.rule=n[0].listRule),u=new Tl({props:E}),te.push(()=>ke(u,"rule",M));function A(j){n[5](j)}let N={label:"View rule",formKey:"viewRule",collection:n[0]};n[0].viewRule!==void 0&&(N.rule=n[0].viewRule),m=new Tl({props:N}),te.push(()=>ke(m,"rule",A));let q=((P=n[0])==null?void 0:P.type)!=="view"&&zd(n),R=((F=n[0])==null?void 0:F.type)==="auth"&&Bd(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=D(),s=b("button"),r=J(o),a=D(),O&&O.c(),f=D(),B(u.$$.fragment),d=D(),B(m.$$.fragment),_=D(),q&&q.c(),g=D(),R&&R.c(),v=ve(),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(j,U){S(j,e,U),y(e,t),y(t,i),y(t,l),y(t,s),y(s,r),y(e,a),O&&O.m(e,null),S(j,f,U),z(u,j,U),S(j,d,U),z(m,j,U),S(j,_,U),q&&q.m(j,U),S(j,g,U),R&&R.m(j,U),S(j,v,U),$=!0,C||(T=Z(s,"click",n[3]),C=!0)},p(j,[U]){var W,K;(!$||U&2)&&o!==(o=j[1]?"Hide available fields":"Show available fields")&&re(r,o),j[1]?O?(O.p(j,U),U&2&&I(O,1)):(O=jd(j),O.c(),I(O,1),O.m(e,null)):O&&(se(),L(O,1,1,()=>{O=null}),oe());const Y={};U&1&&(Y.collection=j[0]),!c&&U&1&&(c=!0,Y.rule=j[0].listRule,ye(()=>c=!1)),u.$set(Y);const X={};U&1&&(X.collection=j[0]),!h&&U&1&&(h=!0,X.rule=j[0].viewRule,ye(()=>h=!1)),m.$set(X),((W=j[0])==null?void 0:W.type)!=="view"?q?(q.p(j,U),U&1&&I(q,1)):(q=zd(j),q.c(),I(q,1),q.m(g.parentNode,g)):q&&(se(),L(q,1,1,()=>{q=null}),oe()),((K=j[0])==null?void 0:K.type)==="auth"?R?(R.p(j,U),U&1&&I(R,1)):(R=Bd(j),R.c(),I(R,1),R.m(v.parentNode,v)):R&&(se(),L(R,1,1,()=>{R=null}),oe())},i(j){$||(I(O),I(u.$$.fragment,j),I(m.$$.fragment,j),I(q),I(R),$=!0)},o(j){L(O),L(u.$$.fragment,j),L(m.$$.fragment,j),L(q),L(R),$=!1},d(j){j&&(w(e),w(f),w(d),w(_),w(g),w(v)),O&&O.d(),V(u,j),V(m,j),q&&q.d(j),R&&R.d(j),C=!1,T()}}}function l5(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 f(m){n.$$.not_equal(l.createRule,m)&&(l.createRule=m,t(0,l))}function u(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=H.getAllCollectionIdentifiers(l))},[l,s,i,o,r,a,f,u,c,d]}class s5 extends be{constructor(e){super(),ge(this,e,l5,i5,he,{collection:0})}}function Ud(n,e,t){const i=n.slice();return i[9]=e[t],i}function o5(n){let e,t,i,l;function s(a){n[5](a)}var o=n[1];function r(a,f){let u={id:a[8],placeholder:"eg. SELECT id, name from posts",language:"sql-select",minHeight:"150"};return a[0].options.query!==void 0&&(u.value=a[0].options.query),{props:u}}return o&&(e=Et(o,r(n)),te.push(()=>ke(e,"value",s)),e.$on("change",n[6])),{c(){e&&B(e.$$.fragment),i=ve()},m(a,f){e&&z(e,a,f),S(a,i,f),l=!0},p(a,f){if(f&2&&o!==(o=a[1])){if(e){se();const u=e;L(u.$$.fragment,1,0,()=>{V(u,1)}),oe()}o?(e=Et(o,r(a)),te.push(()=>ke(e,"value",s)),e.$on("change",a[6]),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f&256&&(u.id=a[8]),!t&&f&1&&(t=!0,u.value=a[0].options.query,ye(()=>t=!1)),e.$set(u)}},i(a){l||(e&&I(e.$$.fragment,a),l=!0)},o(a){e&&L(e.$$.fragment,a),l=!1},d(a){a&&w(i),e&&V(e,a)}}}function r5(n){let e;return{c(){e=b("textarea"),e.disabled=!0,p(e,"rows","7"),p(e,"placeholder","Loading...")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function Wd(n){let e,t,i=ce(n[3]),l=[];for(let s=0;s<i.length;s+=1)l[s]=Yd(Ud(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){S(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=ce(s[3]);let r;for(r=0;r<i.length;r+=1){const a=Ud(s,i,r);l[r]?l[r].p(a,o):(l[r]=Yd(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&&w(e),rt(l,s)}}}function Yd(n){let e,t=n[9]+"",i;return{c(){e=b("p"),i=J(t)},m(l,s){S(l,e,s),y(e,i)},p(l,s){s&8&&t!==(t=l[9]+"")&&re(i,t)},d(l){l&&w(e)}}}function a5(n){let e,t,i,l,s,o,r,a,f,u,c;const d=[r5,o5],m=[];function h(g,v){return g[2]?0:1}s=h(n),o=m[s]=d[s](n);let _=n[3].length&&Wd(n);return{c(){e=b("label"),t=b("span"),t.textContent="Select query",l=D(),o.c(),r=D(),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>`,f=D(),_&&_.c(),u=ve(),p(t,"class","txt"),p(e,"for",i=n[8]),p(a,"class","help-block")},m(g,v){S(g,e,v),y(e,t),S(g,l,v),m[s].m(g,v),S(g,r,v),S(g,a,v),S(g,f,v),_&&_.m(g,v),S(g,u,v),c=!0},p(g,v){(!c||v&256&&i!==(i=g[8]))&&p(e,"for",i);let $=s;s=h(g),s===$?m[s].p(g,v):(se(),L(m[$],1,1,()=>{m[$]=null}),oe(),o=m[s],o?o.p(g,v):(o=m[s]=d[s](g),o.c()),I(o,1),o.m(r.parentNode,r)),g[3].length?_?_.p(g,v):(_=Wd(g),_.c(),_.m(u.parentNode,u)):_&&(_.d(1),_=null)},i(g){c||(I(o),c=!0)},o(g){L(o),c=!1},d(g){g&&(w(e),w(l),w(r),w(a),w(f),w(u)),m[s].d(g),_&&_.d(g)}}}function f5(n){let e,t;return e=new de({props:{class:"form-field required "+(n[3].length?"error":""),name:"options.query",$$slots:{default:[a5,({uniqueId:i})=>({8:i}),({uniqueId:i})=>i?256:0]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,[l]){const s={};l&8&&(s.class="form-field required "+(i[3].length?"error":"")),l&4367&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function u5(n,e,t){let i;We(n,hi,c=>t(4,i=c));let{collection:l}=e,s,o=!1,r=[];function a(c){var h;t(3,r=[]);const d=H.getNestedVal(c,"schema",null);if(H.isEmpty(d))return;if(d!=null&&d.message){r.push(d==null?void 0:d.message);return}const m=H.extractColumnsFromQuery((h=l==null?void 0:l.options)==null?void 0:h.query);H.removeByValue(m,"id"),H.removeByValue(m,"created"),H.removeByValue(m,"updated");for(let _ in d)for(let g in d[_]){const v=d[_][g].message,$=m[_]||_;r.push(H.sentenize($+": "+v))}}zt(async()=>{t(2,o=!0);try{t(1,s=(await nt(()=>import("./CodeEditor-dWSAtOWY.js"),__vite__mapDeps([2,1]),import.meta.url)).default)}catch(c){console.warn(c)}t(2,o=!1)});function f(c){n.$$.not_equal(l.options.query,c)&&(l.options.query=c,t(0,l))}const u=()=>{r.length&&si("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,f,u]}class c5 extends be{constructor(e){super(),ge(this,e,u5,f5,he,{collection:0})}}const d5=n=>({active:n&1}),Kd=n=>({active:n[0]});function Jd(n){let e,t,i;const l=n[15].default,s=St(l,n,n[14],null);return{c(){e=b("div"),s&&s.c(),p(e,"class","accordion-content")},m(o,r){S(o,e,r),s&&s.m(e,null),i=!0},p(o,r){s&&s.p&&(!i||r&16384)&&Tt(s,l,o,o[14],i?$t(l,o[14],r,null):Ct(o[14]),null)},i(o){i||(I(s,o),o&&Je(()=>{i&&(t||(t=Re(e,tt,{duration:150},!0)),t.run(1))}),i=!0)},o(o){L(s,o),o&&(t||(t=Re(e,tt,{duration:150},!1)),t.run(0)),i=!1},d(o){o&&w(e),s&&s.d(o),o&&t&&t.end()}}}function p5(n){let e,t,i,l,s,o,r;const a=n[15].header,f=St(a,n,n[14],Kd);let u=n[0]&&Jd(n);return{c(){e=b("div"),t=b("button"),f&&f.c(),i=D(),u&&u.c(),p(t,"type","button"),p(t,"class","accordion-header"),p(t,"draggable",n[2]),p(t,"aria-expanded",n[0]),ee(t,"interactive",n[3]),p(e,"class",l="accordion "+(n[7]?"drag-over":"")+" "+n[1]),ee(e,"active",n[0])},m(c,d){S(c,e,d),y(e,t),f&&f.m(t,null),y(e,i),u&&u.m(e,null),n[22](e),s=!0,o||(r=[Z(t,"click",Ue(n[17])),Z(t,"drop",Ue(n[18])),Z(t,"dragstart",n[19]),Z(t,"dragenter",n[20]),Z(t,"dragleave",n[21]),Z(t,"dragover",Ue(n[16]))],o=!0)},p(c,[d]){f&&f.p&&(!s||d&16385)&&Tt(f,a,c,c[14],s?$t(a,c[14],d,d5):Ct(c[14]),Kd),(!s||d&4)&&p(t,"draggable",c[2]),(!s||d&1)&&p(t,"aria-expanded",c[0]),(!s||d&8)&&ee(t,"interactive",c[3]),c[0]?u?(u.p(c,d),d&1&&I(u,1)):(u=Jd(c),u.c(),I(u,1),u.m(e,null)):u&&(se(),L(u,1,1,()=>{u=null}),oe()),(!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||(I(f,c),I(u),s=!0)},o(c){L(f,c),L(u),s=!1},d(c){c&&w(e),f&&f.d(c),u&&u.d(),n[22](null),o=!1,Te(r)}}}function m5(n,e,t){let{$$slots:i={},$$scope:l}=e;const s=st();let o,r,{class:a=""}=e,{draggable:f=!1}=e,{active:u=!1}=e,{interactive:c=!0}=e,{single:d=!1}=e,m=!1;function h(){return!!u}function _(){$(),t(0,u=!0),s("expand")}function g(){t(0,u=!1),clearTimeout(r),s("collapse")}function v(){s("toggle"),u?g():_()}function $(){if(d&&o.closest(".accordions")){const q=o.closest(".accordions").querySelectorAll(".accordion.active .accordion-header.inter
2024-04-13 20:44:20 +08:00
This field is disabled if "Only domains" is set.`,position:"top"})),d=!0)},p(g,v){(!c||v&8192&&s!==(s=g[13]))&&p(e,"for",s);const $={};v&8192&&($.id=g[13]),v&1&&($.disabled=!H.isEmpty(g[0].options.onlyEmailDomains)),!a&&v&1&&(a=!0,$.value=g[0].options.exceptEmailDomains,ye(()=>a=!1)),r.$set($)},i(g){c||(I(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&(w(e),w(o),w(f),w(u)),V(r,g),d=!1,m()}}}function w5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m;function h(g){n[8](g)}let _={id:n[13],disabled:!H.isEmpty(n[0].options.exceptEmailDomains)};return n[0].options.onlyEmailDomains!==void 0&&(_.value=n[0].options.onlyEmailDomains),r=new Pl({props:_}),te.push(()=>ke(r,"value",h)),{c(){e=b("label"),t=b("span"),t.textContent="Only domains",i=D(),l=b("i"),o=D(),B(r.$$.fragment),f=D(),u=b("div"),u.textContent="Use comma as separator.",p(t,"class","txt"),p(l,"class","ri-information-line link-hint"),p(e,"for",s=n[13]),p(u,"class","help-block")},m(g,v){S(g,e,v),y(e,t),y(e,i),y(e,l),S(g,o,v),z(r,g,v),S(g,f,v),S(g,u,v),c=!0,d||(m=$e(Fe.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,v){(!c||v&8192&&s!==(s=g[13]))&&p(e,"for",s);const $={};v&8192&&($.id=g[13]),v&1&&($.disabled=!H.isEmpty(g[0].options.exceptEmailDomains)),!a&&v&1&&(a=!0,$.value=g[0].options.onlyEmailDomains,ye(()=>a=!1)),r.$set($)},i(g){c||(I(r.$$.fragment,g),c=!0)},o(g){L(r.$$.fragment,g),c=!1},d(g){g&&(w(e),w(o),w(f),w(u)),V(r,g),d=!1,m()}}}function S5(n){let e,t,i,l;e=new de({props:{class:"form-field form-field-toggle m-0",name:"options.allowEmailAuth",$$slots:{default:[y5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowEmailAuth&&Gd(n);return{c(){B(e.$$.fragment),t=D(),s&&s.c(),i=ve()},m(o,r){z(e,o,r),S(o,t,r),s&&s.m(o,r),S(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&&I(s,1)):(s=Gd(o),s.c(),I(s,1),s.m(i.parentNode,i)):s&&(se(),L(s,1,1,()=>{s=null}),oe())},i(o){l||(I(e.$$.fragment,o),I(s),l=!0)},o(o){L(e.$$.fragment,o),L(s),l=!1},d(o){o&&(w(t),w(i)),V(e,o),s&&s.d(o)}}}function $5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function T5(n){let e;return{c(){e=b("span"),e.textContent="Enabled",p(e,"class","label label-success")},m(t,i){S(t,e,i)},d(t){t&&w(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){S(o,e,r),i=!0,l||(s=$e(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Je(()=>{i&&(t||(t=Re(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Re(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),l=!1,s()}}}function C5(n){let e,t,i,l,s,o;function r(c,d){return c[0].options.allowEmailAuth?T5:$5}let a=r(n),f=a(n),u=n[2]&&Xd();return{c(){e=b("div"),e.innerHTML='<i class="ri-mail-star-line"></i> <span class="txt">Email/Password</span>',t=D(),i=b("div"),l=D(),f.c(),s=D(),u&&u.c(),o=ve(),p(e,"class","inline-flex"),p(i,"class","flex-fill")},m(c,d){S(c,e,d),S(c,t,d),S(c,i,d),S(c,l,d),f.m(c,d),S(c,s,d),u&&u.m(c,d),S(c,o,d)},p(c,d){a!==(a=r(c))&&(f.d(1),f=a(c),f&&(f.c(),f.m(s.parentNode,s))),c[2]?u?d&4&&I(u,1):(u=Xd(),u.c(),I(u,1),u.m(o.parentNode,o)):u&&(se(),L(u,1,1,()=>{u=null}),oe())},d(c){c&&(w(e),w(t),w(i),w(l),w(s),w(o)),f.d(c),u&&u.d(c)}}}function O5(n){let e,t,i,l,s,o,r,a;return{c(){e=b("input"),i=D(),l=b("label"),s=J("Enable"),p(e,"type","checkbox"),p(e,"id",t=n[13]),p(l,"for",o=n[13])},m(f,u){S(f,e,u),e.checked=n[0].options.allowOAuth2Auth,S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(e,"change",n[9]),r=!0)},p(f,u){u&8192&&t!==(t=f[13])&&p(e,"id",t),u&1&&(e.checked=f[0].options.allowOAuth2Auth),u&8192&&o!==(o=f[13])&&p(l,"for",o)},d(f){f&&(w(e),w(i),w(l)),r=!1,a()}}}function Qd(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){S(l,e,s),i=!0},i(l){i||(l&&Je(()=>{i&&(t||(t=Re(e,tt,{duration:150},!0)),t.run(1))}),i=!0)},o(l){l&&(t||(t=Re(e,tt,{duration:150},!1)),t.run(0)),i=!1},d(l){l&&w(e),l&&t&&t.end()}}}function M5(n){let e,t,i,l;e=new de({props:{class:"form-field form-field-toggle m-b-0",name:"options.allowOAuth2Auth",$$slots:{default:[O5,({uniqueId:o})=>({13:o}),({uniqueId:o})=>o?8192:0]},$$scope:{ctx:n}}});let s=n[0].options.allowOAuth2Auth&&Qd();return{c(){B(e.$$.fragment),t=D(),s&&s.c(),i=ve()},m(o,r){z(e,o,r),S(o,t,r),s&&s.m(o,r),S(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&&I(s,1):(s=Qd(),s.c(),I(s,1),s.m(i.parentNode,i)):s&&(se(),L(s,1,1,()=>{s=null}),oe())},i(o){l||(I(e.$$.fragment,o),I(s),l=!0)},o(o){L(e.$$.fragment,o),L(s),l=!1},d(o){o&&(w(t),w(i)),V(e,o),s&&s.d(o)}}}function D5(n){let e;return{c(){e=b("span"),e.textContent="Disabled",p(e,"class","label")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function E5(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"}))],f=!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&&(w(e),w(i),w(l)),f=!1,Te(u)}}}function N5(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("input"),i=D(),l=b("label"),s=b("span"),s.textContent="Forbid authentication for unverified users",o=D(),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){S(c,e,d),e.checked=n[0].options.onlyVerified,S(c,i,d),S(c,l,d),y(l,s),y(l,o),y(l,r),f||(u=[Z(e,"change",n[12]),$e(Fe.call(null,r,{text:["If enabled, it returns 403 for new unverified 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"}))],f=!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&&(w(e),w(i),w(l)),f=!1,Te(u)}}}function P5(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C;return l=new _o({props:{single:!0,$$slots:{header:[k5],default:[_5]},$$scope:{ctx:n}}}),o=new _o({props:{single:!0,$$slots:{header:[C5],default:[S5]},$$scope:{ctx:n}}}),a=new _o({props:{single:!0,$$slots:{header:[I5],default:[M5]},$$scope:{ctx:n}}}),h=new de({props:{class:"form-field required",name:"options.minPasswordLength",$$slots:{default:[A5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),g=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.requireEmail",$$slots:{default:[L5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),$=new de({props:{class:"form-field form-field-toggle m-b-sm",name:"options.onlyVerified",$$slots:{default:[N5,({uniqueId:T})=>({13:T}),({uniqueId:T})=>T?8192:0]},$$scope:{ctx:n}}}),{c(){e=b("h4"),e.textContent="Auth methods",t=D(),i=b("div"),B(l.$$.fragment),s=D(),B(o.$$.fragment),r=D(),B(a.$$.fragment),f=D(),u=b("hr"),c=D(),d=b("h4"),d.textContent="General",m=D(),B(h.$$.fragment),_=D(),B(g.$$.fragment),v=D(),B($.$$.fragment),p(e,"class","section-title"),p(i,"class","accordions"),p(d,"class","section-title")},m(T,O){S(T,e,O),S(T,t,O),S(T,i,O),z(l,i,null),y(i,s),z(o,i,null),y(i,r),z(a,i,null),S(T,f,O),S(T,u,O),S(T,c,O),S(T,d,O),S(T,m,O),z(h,T,O),S(T,_,O),z(g,T,O),S(T,v,O),z($,T,O),C=!0},p(T,[O]){const M={};O&16393&&(M.$$scope={dirty:O,ctx:T}),l.$set(M);const E={};O&16389&&(E.$$scope={dirty:O,ctx:T}),o.$set(E);const A={};O&16387&&(A.$$scope={dirty:O,ctx:T}),a.$set(A);const N={};O&24577&&(N.$$scope={dirty:O,ctx:T}),h.$set(N);const q={};O&24577&&(q.$$scope={dirty:O,ctx:T}),g.$set(q);const R={};O&24577&&(R.$$scope={dirty:O,ctx:T}),$.$set(R)},i(T){C||(I(l.$$.fragment,T),I(o.$$.fragment,T),I(a.$$.fragment,T),I(h.$$.fragment,T),I(g.$$.fragment,T),I($.$$.fragment,T),C=!0)},o(T){L(l.$$.fragment,T),L(o.$$.fragment,T),L(a.$$.fragment,T),L(h.$$.fragment,T),L(g.$$.fragment,T),L($.$$.fragment,T),C=!1},d(T){T&&(w(e),w(t),w(i),w(f),w(u),w(c),w(d),w(m),w(_),w(v)),V(l),V(o),V(a),V(h,T),V(g,T),V($,T)}}}function F5(n,e,t){let i,l,s,o;We(n,hi,g=>t(4,o=g));let{collection:r}=e;function a(){r.options.allowUsernameAuth=this.checked,t(0,r)}function f(){r.options.allowEmailAuth=this.checked,t(0,r)}function u(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=lt(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,v,$,C;n.$$.dirty&1&&r.type==="auth"&&H.isEmpty(r.options)&&t(0,r.options={allowEmailAuth:!0,allowUsernameAuth:!0,allowOAuth2Auth:!0,minPasswordLength:8},r),n.$$.dirty&16&&t(2,l=!H.isEmpty((g=o==null?void 0:o.options)==null?void 0:g.allowEmailAuth)||!H.isEmpty((v=o==null?void 0:o.options)==null?void 0:v.onlyEmailDomains)||!H.isEmpty(($=o==null?void 0:o.options)==null?void 0:$.exceptEmailDomains)),n.$$.dirty&16&&t(1,s=!H.isEmpty((C=o==null?void 0:o.options)==null?void 0:C.allowOAuth2Auth))},t(3,i=!1),[r,s,l,i,o,a,f,u,c,d,m,h,_]}class R5 extends be{constructor(e){super(),ge(this,e,F5,P5,he,{collection:0})}}function ep(n,e,t){const i=n.slice();return i[18]=e[t],i}function tp(n,e,t){const i=n.slice();return i[18]=e[t],i}function np(n,e,t){const i=n.slice();return i[18]=e[t],i}function ip(n){let e;return{c(){e=b("p"),e.textContent="All data associated with the removed fields will be permanently deleted!"},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function lp(n){let e,t,i,l,s=n[3]&&sp(n),o=!n[4]&&op(n);return{c(){e=b("h6"),e.textContent="Changes:",t=D(),i=b("ul"),s&&s.c(),l=D(),o&&o.c(),p(i,"class","changes-list svelte-xqpcsf")},m(r,
`),l=b("strong"),o=J(s),r=D(),a=b("i"),f=D(),u=b("strong"),d=J(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(_,g){S(_,e,g),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,f),y(t,u),y(u,d)},p(_,g){var v,$;g&2&&s!==(s=((v=_[1])==null?void 0:v.name)+"")&&re(o,s),g&4&&c!==(c=(($=_[2])==null?void 0:$.name)+"")&&re(d,c)},d(_){_&&w(e)}}}function op(n){let e,t,i,l=ce(n[6]),s=[];for(let u=0;u<l.length;u+=1)s[u]=rp(np(n,l,u));let o=ce(n[8]),r=[];for(let u=0;u<o.length;u+=1)r[u]=ap(tp(n,o,u));let a=ce(n[7]),f=[];for(let u=0;u<a.length;u+=1)f[u]=fp(ep(n,a,u));return{c(){for(let u=0;u<s.length;u+=1)s[u].c();e=D();for(let u=0;u<r.length;u+=1)r[u].c();t=D();for(let u=0;u<f.length;u+=1)f[u].c();i=ve()},m(u,c){for(let d=0;d<s.length;d+=1)s[d]&&s[d].m(u,c);S(u,e,c);for(let d=0;d<r.length;d+=1)r[d]&&r[d].m(u,c);S(u,t,c);for(let d=0;d<f.length;d+=1)f[d]&&f[d].m(u,c);S(u,i,c)},p(u,c){if(c&64){l=ce(u[6]);let d;for(d=0;d<l.length;d+=1){const m=np(u,l,d);s[d]?s[d].p(m,c):(s[d]=rp(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=ce(u[8]);let d;for(d=0;d<o.length;d+=1){const m=tp(u,o,d);r[d]?r[d].p(m,c):(r[d]=ap(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=ce(u[7]);let d;for(d=0;d<a.length;d+=1){const m=ep(u,a,d);f[d]?f[d].p(m,c):(f[d]=fp(m),f[d].c(),f[d].m(i.parentNode,i))}for(;d<f.length;d+=1)f[d].d(1);f.length=a.length}},d(u){u&&(w(e),w(t),w(i)),rt(s,u),rt(r,u),rt(f,u)}}}function rp(n){let e,t,i,l=n[18].name+"",s,o,r;return{c(){e=b("li"),t=J(`Multiple to single value conversion of field
`),i=b("strong"),s=J(l),o=D(),r=b("em"),r.textContent="(will keep only the last array item)",p(r,"class","txt-sm"),p(e,"class","svelte-xqpcsf")},m(a,f){S(a,e,f),y(e,t),y(e,i),y(i,s),y(e,o),y(e,r)},p(a,f){f&64&&l!==(l=a[18].name+"")&&re(s,l)},d(a){a&&w(e)}}}function ap(n){let e,t,i,l,s=n[18].originalName+"",o,r,a,f,u,c=n[18].name+"",d;return{c(){e=b("li"),t=b("div"),i=J(`Renamed field
`),l=b("strong"),o=J(s),r=D(),a=b("i"),f=D(),u=b("strong"),d=J(c),p(l,"class","txt-strikethrough txt-hint"),p(a,"class","ri-arrow-right-line txt-sm"),p(u,"class","txt"),p(t,"class","inline-flex"),p(e,"class","svelte-xqpcsf")},m(m,h){S(m,e,h),y(e,t),y(t,i),y(t,l),y(l,o),y(t,r),y(t,a),y(t,f),y(t,u),y(u,d)},p(m,h){h&256&&s!==(s=m[18].originalName+"")&&re(o,s),h&256&&c!==(c=m[18].name+"")&&re(d,c)},d(m){m&&w(e)}}}function fp(n){let e,t,i,l=n[18].name+"",s,o;return{c(){e=b("li"),t=J("Removed field "),i=b("span"),s=J(l),o=D(),p(i,"class","txt-bold"),p(e,"class","txt-danger svelte-xqpcsf")},m(r,a){S(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+"")&&re(s,l)},d(r){r&&w(e)}}}function q5(n){let e,t,i,l,s,o,r,a,f=n[7].length&&ip(),u=n[9]&&lp(n);return{c(){e=b("div"),t=b("div"),t.innerHTML='<i class="ri-error-warning-line"></i>',i=D(),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=D(),f&&f.c(),r=D(),u&&u.c(),a=ve(),p(t,"class","icon"),p(l,"class","content txt-bold"),p(e,"class","alert alert-warning")},m(c,d){S(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),y(l,o),f&&f.m(l,null),S(c,r,d),u&&u.m(c,d),S(c,a,d)},p(c,d){c[7].length?f||(f=ip(),f.c(),f.m(l,null)):f&&(f.d(1),f=null),c[9]?u?u.p(c,d):(u=lp(c),u.c(),u.m(a.parentNode,a)):u&&(u.d(1),u=null)},d(c){c&&(w(e),w(r),w(a)),f&&f.d(),u&&u.d(c)}}}function j5(n){let e;return{c(){e=b("h4"),e.textContent="Confirm collection changes"},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function H5(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),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){S(o,e,r),S(o,t,r),S(o,i,r),e.focus(),l||(s=[Z(e,"click",n[12]),Z(i,"click",n[13])],l=!0)},p:x,d(o){o&&(w(e),w(t),w(i)),l=!1,Te(s)}}}function z5(n){let e,t,i={class:"confirm-changes-panel",popup:!0,$$slots:{footer:[H5],header:[j5],default:[q5]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[14](e),e.$on("hide",n[15]),e.$on("show",n[16]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&33555422&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[14](null),V(e,l)}}}function V5(n,e,t){let i,l,s,o,r,a;const f=st();let u,c,d;async function m(O,M){t(1,c=O),t(2,d=M),await xt(),i||s.length||o.length||r.length?u==null||u.show():_()}function h(){u==null||u.hide()}function _(){h(),f("confirm")}const g=()=>h(),v=()=>_();function $(O){te[O?"unshift":"push"](()=>{u=O,t(5,u)})}function C(O){Oe.call(this,n,O)}function T(O){Oe.call(this,n,O)}return n.$$.update=()=>{var O,M,E;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=((O=d==null?void 0:d.schema)==null?void 0:O.filter(A=>A.id&&!A.toDelete&&A.originalName!=A.name))||[]),n.$$.dirty&4&&t(7,o=((M=d==null?void 0:d.schema)==null?void 0:M.filter(A=>A.id&&A.toDelete))||[]),n.$$.dirty&6&&t(6,r=((E=d==null?void 0:d.schema)==null?void 0:E.filter(A=>{var q,R,P;const N=(q=c==null?void 0:c.schema)==null?void 0:q.find(F=>F.id==A.id);return N?((R=N.options)==null?void 0:R.maxSelect)!=1&&((P=A.options)==null?void 0:P.maxSelect)==1:!1}))||[]),n.$$.dirty&24&&t(9,a=!l||i)},[h,c,d,i,l,u,r,o,s,a,_,m,g,v,$,C,T]}class B5 extends be{constructor(e){super(),ge(this,e,V5,z5,he,{show:11,hide:0})}get show(){return this.$$.ctx[11]}get hide(){return this.$$.ctx[0]}}function up(n,e,t){const i=n.slice();return i[50]=e[t][0],i[51]=e[t][1],i}function U5(n){let e,t,i;function l(o){n[36](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new YC({props:s}),te.push(()=>ke(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function W5(n){let e,t,i;function l(o){n[35](o)}let s={};return n[2]!==void 0&&(s.collection=n[2]),e=new c5({props:s}),te.push(()=>ke(e,"collection",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};!t&&r[0]&4&&(t=!0,a.collection=o[2],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function cp(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 s5({props:o}),te.push(()=>ke(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item active")},m(r,a){S(r,e,a),z(t,e,null),l=!0},p(r,a){const f={};!i&&a[0]&4&&(i=!0,f.collection=r[2],ye(()=>i=!1)),t.$set(f)},i(r){l||(I(t.$$.fragment,r),l=!0)},o(r){L(t.$$.fragment,r),l=!1},d(r){r&&w(e),V(t)}}}function dp(n){let e,t,i,l;function s(r){n[38](r)}let o={};return n[2]!==void 0&&(o.collection=n[2]),t=new R5({props:o}),te.push(()=>ke(t,"collection",s)),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","tab-item"),ee(e,"active",n[3]===El)},m(
2024-04-13 20:44:20 +08:00
`),position:"left"})),i=!0)},p(s,[o]){t&&Ot(t.update)&&o&1&&t.update.call(null,{text:s[0].join(`
`),position:"left"})},i:x,o:x,d(s){s&&w(e),i=!1,l()}}}const Hp="yyyy-MM-dd HH:mm:ss.SSS";function k6(n,e,t){let{model:i}=e,l=[];function s(){t(0,l=[]),i.created&&l.push("Created: "+H.formatToLocalDate(i.created,Hp)+" Local"),i.updated&&l.push("Updated: "+H.formatToLocalDate(i.updated,Hp)+" Local")}return n.$$set=o=>{"model"in o&&t(1,i=o.model)},n.$$.update=()=>{n.$$.dirty&2&&i&&s()},[l,i]}class Jb extends be{constructor(e){super(),ge(this,e,k6,b6,he,{model:1})}}function y6(n){let e,t,i,l,s,o,r,a,f,u;return s=new ol({props:{value:n[1]}}),{c(){e=b("div"),t=b("span"),i=J(n[1]),l=D(),B(s.$$.fragment),o=D(),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){S(c,e,d),y(e,t),y(t,i),n[6](t),y(e,l),z(s,e,null),y(e,o),y(e,r),a=!0,f||(u=[$e(Fe.call(null,r,"Refresh")),Z(r,"click",n[4])],f=!0)},p(c,d){(!a||d&2)&&re(i,c[1]);const m={};d&2&&(m.value=c[1]),s.$set(m)},i(c){a||(I(s.$$.fragment,c),a=!0)},o(c){L(s.$$.fragment,c),a=!1},d(c){c&&w(e),n[6](null),V(s),f=!1,Te(u)}}}function v6(n){let e,t,i,l,s,o,r,a,f,u;function c(m){n[7](m)}let d={class:"dropdown dropdown-upside dropdown-center dropdown-nowrap",$$slots:{default:[y6]},$$scope:{ctx:n}};return n[3]!==void 0&&(d.active=n[3]),l=new Mn({props:d}),te.push(()=>ke(l,"active",c)),l.$on("show",n[4]),{c(){e=b("button"),t=b("i"),i=D(),B(l.$$.fragment),p(t,"class","ri-sparkling-line"),p(t,"aria-hidden","true"),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){S(m,e,h),y(e,t),y(e,i),z(l,e,null),a=!0,f||(u=$e(r=Fe.call(null,e,n[3]?"":"Generate")),f=!0)},p(m,[h]){const _={};h&518&&(_.$$scope={dirty:h,ctx:m}),!s&&h&8&&(s=!0,_.active=m[3],ye(()=>s=!1)),l.$set(_),(!a||h&1&&o!==(o="btn btn-circle "+m[0]+" svelte-1md8247"))&&p(e,"class",o),r&&Ot(r.update)&&h&8&&r.update.call(null,m[3]?"":"Generate")},i(m){a||(I(l.$$.fragment,m),a=!0)},o(m){L(l.$$.fragment,m),a=!1},d(m){m&&w(e),V(l),f=!1,u()}}}function w6(n,e,t){const i=st();let{class:l="btn-sm btn-hint btn-transparent"}=e,{length:s=32}=e,o="",r,a=!1;async function f(){if(t(1,o=H.randomSecret(s)),i("generate",o),await xt(),r){let d=document.createRange();d.selectNode(r),window.getSelection().removeAllRanges(),window.getSelection().addRange(d)}}function u(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,f,s,u,c]}class Zb extends be{constructor(e){super(),ge(this,e,w6,v6,he,{class:0,length:5})}}function S6(n){let e,t,i,l,s,o,r,a,f,u,c,d;return{c(){e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="Username",o=D(),r=b("input"),p(t,"class",H.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",f=n[2]?"Leave empty to auto generate...":n[4]),p(r,"id",u=n[13])},m(m,h){S(m,e,h),y(e,t),y(e,i),y(e,l),S(m,o,h),S(m,r,h),ae(r,n[0].username),c||(d=Z(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&&f!==(f=m[2]?"Leave empty to auto generate...":m[4])&&p(r,"placeholder",f),h&8192&&u!==(u=m[13])&&p(r,"id",u),h&1&&r.value!==m[0].username&&ae(r,m[0].username)},d(m){m&&(w(e),w(o),w(r)),c=!1,d()}}}function $6(n){let e,t,i,l,s,o,r,a,f,u,c=n[0].emailVisibility?"On":"Off",d,m,h,_,g,v,$,C;return{c(){var T;e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="Email",o=D(),r=b("div"),a=b("button"),f=b("span"),u=J("Public: "),d=J(c),h=D(),_=b("input"),p(t,"class",H.getFieldTypeIcon("email")),p(l,"class","txt"),p(e,"for",s=n[13]),p(f,"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=v=(T=n[1].options)==null?void 0:T.requireEmail,p(_,"class","svelte-1751a4d")},m(T,O){S(T,e,O),y(e,t),y(e,i),y(e,l),S(T,o,O),S(T,
2024-04-13 20:44:20 +08:00
form-field form-field-list form-field-file
`+(n[4].required?"required":"")+`
`+(n[9]?"dragover":"")+`
`,name:n[4].name,$$slots:{default:[zO,({uniqueId:o})=>({28:o}),({uniqueId:o})=>[o?268435456:0]]},$$scope:{ctx:n}}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","block")},m(o,r){S(o,e,r),z(t,e,null),i=!0,l||(s=[Z(e,"dragover",Ue(n[25])),Z(e,"dragleave",n[26]),Z(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||(I(t.$$.fragment,o),i=!0)},o(o){L(t.$$.fragment,o),i=!1},d(o){o&&w(e),V(t),l=!1,Te(s)}}}function BO(n,e,t){let i,l,s,{record:o}=e,{field:r}=e,{value:a=""}=e,{uploadedFiles:f=[]}=e,{deletedFileNames:u=[]}=e,c,d,m=!1,h="";function _(U){H.removeByValue(u,U),t(2,u)}function g(U){H.pushUnique(u,U),t(2,u)}function v(U){H.isEmpty(f[U])||f.splice(U,1),t(1,f)}function $(){d==null||d.dispatchEvent(new CustomEvent("change",{detail:{value:a,uploadedFiles:f,deletedFileNames:u},bubbles:!0}))}function C(U){var X,W;U.preventDefault(),t(9,m=!1);const Y=((X=U.dataTransfer)==null?void 0:X.files)||[];if(!(s||!Y.length)){for(const K of Y){const le=l.length+f.length-u.length;if(((W=r.options)==null?void 0:W.maxSelect)<=le)break;f.push(K)}t(1,f)}}zt(async()=>{t(10,h=await fe.getAdminFileToken(o.collectionId))});const T=U=>_(U),O=U=>g(U);function M(U){a=U,t(0,a),t(6,i),t(4,r)}const E=U=>v(U);function A(U){f=U,t(1,f)}function N(U){te[U?"unshift":"push"](()=>{c=U,t(7,c)})}const q=()=>{for(let U of c.files)f.push(U);t(1,f),t(7,c.value=null,c)},R=()=>c==null?void 0:c.click();function P(U){te[U?"unshift":"push"](()=>{d=U,t(8,d)})}const F=()=>{t(9,m=!0)},j=()=>{t(9,m=!1)};return n.$$set=U=>{"record"in U&&t(3,o=U.record),"field"in U&&t(4,r=U.field),"value"in U&&t(0,a=U.value),"uploadedFiles"in U&&t(1,f=U.uploadedFiles),"deletedFileNames"in U&&t(2,u=U.deletedFileNames)},n.$$.update=()=>{var U,Y;n.$$.dirty[0]&2&&(Array.isArray(f)||t(1,f=H.toArray(f))),n.$$.dirty[0]&4&&(Array.isArray(u)||t(2,u=H.toArray(u))),n.$$.dirty[0]&16&&t(6,i=((U=r.options)==null?void 0:U.maxSelect)>1),n.$$.dirty[0]&65&&H.isEmpty(a)&&t(0,a=i?[]:""),n.$$.dirty[0]&1&&t(5,l=H.toArray(a)),n.$$.dirty[0]&54&&t(11,s=(l.length||f.length)&&((Y=r.options)==null?void 0:Y.maxSelect)<=l.length+f.length-u.length),n.$$.dirty[0]&6&&(f!==-1||u!==-1)&&$()},[a,f,u,o,r,l,i,c,d,m,h,s,_,g,v,C,T,O,M,E,A,N,q,R,P,F,j]}class UO extends be{constructor(e){super(),ge(this,e,BO,VO,he,{record:3,field:4,value:0,uploadedFiles:1,deletedFileNames:2},null,[-1,-1])}}function Qp(n){return typeof n=="function"?{threshold:100,callback:n}:n||{}}function WO(n,e){e=Qp(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=Qp(i)},destroy(){n.removeEventListener("scroll",t),n.removeEventListener("resize",t)}}}function xp(n,e,t){const i=n.slice();i[6]=e[t];const l=H.toArray(i[0][i[6]]).slice(0,5);return i[7]=l,i}function em(n,e,t){const i=n.slice();return i[10]=e[t],i}function tm(n){let e,t;return e=new Wa({props:{record:n[0],filename:n[10],size:"xs"}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l&1&&(s.record=i[0]),l&3&&(s.filename=i[10]),e.$set(s)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function nm(n){let e=!H.isEmpty(n[10]),t,i,l=e&&tm(n);return{c(){l&&l.c(),t=ve()},m(s,o){l&&l.m(s,o),S(s,t,o),i=!0},p(s,o){o&3&&(e=!H.isEmpty(s[10])),e?l?(l.p(s,o),o&3&&I(l,1)):(l=tm(s),l.c(),I(l,1),l.m(t.parentNode,t)):l&&(se(),L(l,1,1,()=>{l=null}),oe())},i(s){i||(I(l),i=!0)},o(s){L(l),i=!1},d(s){s&&w(t),l&&l.d(s)}}}function im(n){let e,t,i=ce(n[7]),l=[];for(let o=0;o<i.length;o+=1)l[o]=nm(em(n,i,o));const s=o=>L(l[o],1,1,()=>{l[o]=null});return{c(){for(let o=0;o<l.length;o+=1)l[o].c();e=ve()},m(o,r){for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(o,r);S(o,e,r),t=!0},p(o,r){if(r&3){i=ce(o[7]);let a;for(a=0;a<i.length;a+=1){const f=em(o,i,a);l[a]?(l[a].p(f,r),I(l[a],1)):(l[a]=nm(f),l[a].c(),I(l[a],1),l[a].m(e.parentNode,e))}for(se(),a=i.length;a<l.length;a+=1)s(a);oe()}},i(o){if(!t){for(let r=0;r<i.length;r+=1)I(l[r]);t=!0}},o(o){l=l.filter(Boolean);for(let r=0;r<l.length;r+=1)L(l[r]);t=!1},d(o){o&&w(e),rt(l,o)}}}function YO(n){let e,t,i,l,s,o,r=H.truncate(H.displayValue(n[0],n[2]),70)+"",a,f,u,c,d=ce(n[1]),m=[];for(let _=0;_<d.length;_+=1)m[_]=im(xp(n,d,_));const h=_=>L(m[_],1,1,()=
`),N&&N.c(),m=D(),_.c(),g=ve(),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(F,j){S(F,e,j),z(t,e,null),y(e,i),T&&T.m(e,null),S(F,l,j),S(F,s,j);for(let U=0;U<o.length;U+=1)o[U]&&o[U].m(s,null);E&&E.m(s,null),y(s,a),A&&A.m(s,null),S(F,u,j),S(F,c,j),y(c,d),N&&N.m(c,null),S(F,m,j),R[h].m(F,j),S(F,g,j),v=!0,$||(C=$e(f=WO.call(null,s,n[36])),$=!0)},p(F,j){const U={};j[0]&4&&(U.value=F[2]),j[0]&32&&(U.autocompleteCollection=F[5]),t.$set(U),F[11]?T&&(T.d(1),T=null):T?T.p(F,j):(T=om(F),T.c(),T.m(e,null)),j[0]&143252&&(O=ce(F[8]),se(),o=ft(o,j,M,1,F,O,r,s,It,cm,a,sm),oe(),!O.length&&E?E.p(F,j):O.length?E&&(E.d(1),E=null):(E=rm(F),E.c(),E.m(s,a))),F[13]?A||(A=dm(),A.c(),A.m(s,null)):A&&(A.d(1),A=null),f&&Ot(f.update)&&j[0]&4104&&f.update.call(null,F[36]),F[4]>1?N?N.p(F,j):(N=pm(F),N.c(),N.m(c,null)):N&&(N.d(1),N=null);let Y=h;h=P(F),h===Y?R[h].p(F,j):(se(),L(R[Y],1,1,()=>{R[Y]=null}),oe(),_=R[h],_?_.p(F,j):(_=R[h]=q[h](F),_.c()),I(_,1),_.m(g.parentNode,g))},i(F){if(!v){I(t.$$.fragment,F);for(let j=0;j<O.length;j+=1)I(o[j]);I(_),v=!0}},o(F){L(t.$$.fragment,F);for(let j=0;j<o.length;j+=1)L(o[j]);L(_),v=!1},d(F){F&&(w(e),w(l),w(s),w(u),w(c),w(m),w(g)),V(t),T&&T.d();for(let j=0;j<o.length;j+=1)o[j].d();E&&E.d(),A&&A.d(),N&&N.d(),R[h].d(F),$=!1,C()}}}function eM(n){var r;let e,t,i,l=(((r=n[5])==null?void 0:r.name)||"")+"",s,o;return{c(){e=b("h4"),t=J("Select "),i=b("strong"),s=J(l),o=J(" records")},m(a,f){S(a,e,f),y(e,t),y(e,i),y(i,s),y(e,o)},p(a,f){var u;f[0]&32&&l!==(l=(((u=a[5])==null?void 0:u.name)||"")+"")&&re(s,l)},d(a){a&&w(e)}}}function tM(n){let e,t,i,l,s;return{c(){e=b("button"),e.innerHTML='<span class="txt">Cancel</span>',t=D(),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){S(o,e,r),S(o,t,r),S(o,i,r),l||(s=[Z(e,"click",n[28]),Z(i,"click",n[29])],l=!0)},p:x,d(o){o&&(w(e),w(t),w(i)),l=!1,Te(s)}}}function nM(n){let e,t,i,l;const s=[{popup:!0},{class:"overlay-panel-xl"},n[19]];let o={$$slots:{footer:[tM],header:[eM],default:[xO]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Ae(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 Ka({props:r}),n[42](i),i.$on("save",n[43]),i.$on("delete",n[44]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(a,f){z(e,a,f),S(a,t,f),z(i,a,f),l=!0},p(a,f){const u=f[0]&524288?mt(s,[s[0],s[1],Mt(a[19])]):{};f[0]&16380|f[1]&33554432&&(u.$$scope={dirty:f,ctx:a}),e.$set(u);const c={};f[0]&32&&(c.collection=a[5]),i.$set(c)},i(a){l||(I(e.$$.fragment,a),I(i.$$.fragment,a),l=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),l=!1},d(a){a&&w(t),n[39](null),V(e,a),n[42](null),V(i,a)}}}const io=50;function iM(n,e,t){let i,l,s,o,r,a,f,u;const c=["value","field","show","hide"];let d=Xe(e,c),m;We(n,qn,Se=>t(26,m=Se));const h=st(),_="picker_"+H.randomString(5);let{value:g}=e,{field:v}=e,$,C,T="",O=[],M=[],E=1,A=0,N=!1,q=!1;function R(){return t(2,T=""),t(8,O=[]),t(6,M=[]),F(),j(!0),$==null?void 0:$.show()}function P(){return $==null?void 0:$.hide()}async function F(){const Se=H.toArray(g);if(!l||!Se.length)return;t(24,q=!0);let Ke=[];const Vt=Se.slice(),dn=[];for(;Vt.length>0;){const an=[];for(const jn of Vt.splice(0,io))an.push(`id="${jn}"`);dn.push(fe.collection(l).getFullList({batch:io,filter:an.join("||"),fields:"*:excerpt(200)",requestKey:null}))}try{await Promise.all(dn).then(an=>{Ke=Ke.concat(...an)}),t(6,M=[]);for(const an of Se){const jn=H.findByKey(Ke,"id",an);jn&&M.push(jn)}T.trim()||t(8,O=H.filterDuplicatesByKey(M.concat(O))),t(24,q=!1)}catch(an){an.isAbort||(fe.error(an),t(24,q=!1))}}async function j(Se=!1){if(l){t(3,N=!0),Se&&(T.trim()?t(8,O=[]):t(8,O=H.toArray(M).slice()));try{const Ke=Se?1:E+1,Vt=H.getAllCollectionIdentifiers(s),dn=await fe.collection(l).getList(Ke,io,{filter:H.normalizeSearchFilter(T,Vt),sort:o?"":"-created",fields:"*:excerpt(200)",skipTotal:1,requestKey:_+"loadList"});t(8,O=H.filterDuplicatesByKey(O.concat(dn.i
(record: `+n[44].id+")")),Z(e,"click",Ue(function(){Ot(n[20](n[44],n[48]))&&n[20](n[44],n[48]).apply(this,arguments)}))],s=!0)},p(u,c){n=u,a===(a=r(n,c))&&f?f.p(n,c):(f.d(1),f=a(n),f&&(f.c(),f.m(e,i))),l&&Ot(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(u){u&&w(e),f.d(),s=!1,Te(o)}}}function Dm(n,e){let t,i,l=ce(e[45]),s=[];for(let o=0;o<l.length;o+=1)s[o]=Mm($m(e,l,o));return{key:n,first:null,c(){t=ve();for(let o=0;o<s.length;o+=1)s[o].c();i=ve(),this.first=t},m(o,r){S(o,t,r);for(let a=0;a<s.length;a+=1)s[a]&&s[a].m(o,r);S(o,i,r)},p(o,r){if(e=o,r[0]&1638432){l=ce(e[45]);let a;for(a=0;a<l.length;a+=1){const f=$m(e,l,a);s[a]?s[a].p(f,r):(s[a]=Mm(f),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&&(w(t),w(i)),rt(s,o)}}}function Em(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){S(t,e,i)},d(t){t&&w(e)}}}function wM(n){let e,t;function i(r,a){if(r[15])return kM;if(!r[6])return bM}let l=i(n),s=l&&l(n),o=n[6]&&Em();return{c(){s&&s.c(),e=D(),o&&o.c(),t=ve()},m(r,a){s&&s.m(r,a),S(r,e,a),o&&o.m(r,a),S(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=Em(),o.c(),o.m(t.parentNode,t)):o&&(o.d(1),o=null)},d(r){r&&(w(e),w(t)),s&&s.d(r),o&&o.d(r)}}}function SM(n){let e,t,i,l;const s=[gM,_M],o=[];function r(a,f){return a[7].length?1:0}return e=r(n),t=o[e]=s[e](n),{c(){t.c(),i=ve()},m(a,f){o[e].m(a,f),S(a,i,f),l=!0},p(a,f){let u=e;e=r(a),e===u?o[e].p(a,f):(se(),L(o[u],1,1,()=>{o[u]=null}),oe(),t=o[e],t?t.p(a,f):(t=o[e]=s[e](a),t.c()),I(t,1),t.m(i.parentNode,i))},i(a){l||(I(t),l=!0)},o(a){L(t),l=!1},d(a){a&&w(i),o[e].d(a)}}}function $M(n){let e,t;return{c(){e=b("h4"),t=J(n[0])},m(i,l){S(i,e,l),y(e,t)},p(i,l){l[0]&1&&re(t,i[0])},d(i){i&&w(e)}}}function Im(n){let e,t;return e=new de({props:{class:"form-field file-picker-size-select",$$slots:{default:[TM,({uniqueId:i})=>({23:i}),({uniqueId:i})=>[i?8388608:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&8402944|l[1]&8388608&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function TM(n){let e,t,i;function l(o){n[28](o)}let s={upside:!0,id:n[23],items:n[11],disabled:!n[13],selectPlaceholder:"Select size"};return n[12]!==void 0&&(s.keyOfSelected=n[12]),e=new _i({props:s}),te.push(()=>ke(e,"keyOfSelected",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){const a={};r[0]&8388608&&(a.id=o[23]),r[0]&2048&&(a.items=o[11]),r[0]&8192&&(a.disabled=!o[13]),!t&&r[0]&4096&&(t=!0,a.keyOfSelected=o[12],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function CM(n){var h;let e,t,i,l=H.hasImageExtension((h=n[9])==null?void 0:h.name),s,o,r,a,f,u,c,d,m=l&&Im(n);return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),m&&m.c(),s=D(),o=b("button"),r=b("span"),a=J(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=f=!n[13]},m(_,g){S(_,e,g),y(e,t),S(_,i,g),m&&m.m(_,g),S(_,s,g),S(_,o,g),y(o,r),y(r,a),u=!0,c||(d=[Z(e,"click",n[2]),Z(o,"click",n[21])],c=!0)},p(_,g){var v;(!u||g[0]&64)&&(e.disabled=_[6]),g[0]&512&&(l=H.hasImageExtension((v=_[9])==null?void 0:v.name)),l?m?(m.p(_,g),g[0]&512&&I(m,1)):(m=Im(_),m.c(),I(m,1),m.m(s.parentNode,s)):m&&(se(),L(m,1,1,()=>{m=null}),oe()),(!u||g[0]&2)&&re(a,_[1]),(!u||g[0]&8192&&f!==(f=!_[13]))&&(o.disabled=f)},i(_){u||(I(m),u=!0)},o(_){L(m),u=!1},d(_){_&&(w(e),w(i),w(s),w(o)),m&&m.d(_),c=!1,Te(d)}}}function OM(n){let e,t,i,l;const s=[{popup:!0},{class:"file-picker-popup"},n[22]];let o={$$slots:{footer:[CM],header:[$M],default:[SM]},$$scope:{ctx:n}};for(let a=0;a<s.length;a+=1)o=Ae(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 Ka({props:r}),n[36](i),i.$on("save",n[37]),i.$on("delete",n[38]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(a,f){z(e,a,f),S(a,t,f),z(i,a,f),l=!0},p(a,f){const u=f[0]&4194304?mt(s,[s[0],s[1],Mt(a[22])]):{};f[0]&131059|f[1]&8388608&&(u.$$scope={dirty:f,ctx:a}),e.
...
-----END PRIVATE KEY-----`),p(a,"class","help-block")},m(c,d){S(c,e,d),y(e,t),S(c,l,d),S(c,s,d),ae(s,n[5]),S(c,r,d),S(c,a,d),f||(u=Z(s,"input",n[16]),f=!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&&ae(s,c[5])},d(c){c&&(w(e),w(l),w(s),w(r),w(a)),f=!1,u()}}}function l8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$;return l=new de({props:{class:"form-field required",name:"clientId",$$slots:{default:[xM,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),r=new de({props:{class:"form-field required",name:"teamId",$$slots:{default:[e8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),u=new de({props:{class:"form-field required",name:"keyId",$$slots:{default:[t8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),m=new de({props:{class:"form-field required",name:"duration",$$slots:{default:[n8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),_=new de({props:{class:"form-field required",name:"privateKey",$$slots:{default:[i8,({uniqueId:C})=>({23:C}),({uniqueId:C})=>C?8388608:0]},$$scope:{ctx:n}}}),{c(){e=b("form"),t=b("div"),i=b("div"),B(l.$$.fragment),s=D(),o=b("div"),B(r.$$.fragment),a=D(),f=b("div"),B(u.$$.fragment),c=D(),d=b("div"),B(m.$$.fragment),h=D(),B(_.$$.fragment),p(i,"class","col-lg-6"),p(o,"class","col-lg-6"),p(f,"class","col-lg-6"),p(d,"class","col-lg-6"),p(t,"class","grid"),p(e,"id",n[9]),p(e,"autocomplete","off")},m(C,T){S(C,e,T),y(e,t),y(t,i),z(l,i,null),y(t,s),y(t,o),z(r,o,null),y(t,a),y(t,f),z(u,f,null),y(t,c),y(t,d),z(m,d,null),y(t,h),z(_,t,null),g=!0,v||($=Z(e,"submit",Ue(n[17])),v=!0)},p(C,T){const O={};T&25165828&&(O.$$scope={dirty:T,ctx:C}),l.$set(O);const M={};T&25165832&&(M.$$scope={dirty:T,ctx:C}),r.$set(M);const E={};T&25165840&&(E.$$scope={dirty:T,ctx:C}),u.$set(E);const A={};T&25165888&&(A.$$scope={dirty:T,ctx:C}),m.$set(A);const N={};T&25165856&&(N.$$scope={dirty:T,ctx:C}),_.$set(N)},i(C){g||(I(l.$$.fragment,C),I(r.$$.fragment,C),I(u.$$.fragment,C),I(m.$$.fragment,C),I(_.$$.fragment,C),g=!0)},o(C){L(l.$$.fragment,C),L(r.$$.fragment,C),L(u.$$.fragment,C),L(m.$$.fragment,C),L(_.$$.fragment,C),g=!1},d(C){C&&w(e),V(l),V(r),V(u),V(m),V(_),v=!1,$()}}}function s8(n){let e;return{c(){e=b("h4"),e.textContent="Generate Apple client secret",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function o8(n){let e,t,i,l,s,o,r,a,f,u;return{c(){e=b("button"),t=J("Close"),i=D(),l=b("button"),s=b("i"),o=D(),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){S(c,e,d),y(e,t),S(c,i,d),S(c,l,d),y(l,s),y(l,o),y(l,r),f||(u=Z(e,"click",n[0]),f=!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&&(w(e),w(i),w(l)),f=!1,u()}}}function r8(n){let e,t,i={overlayClose:!n[7],escClose:!n[7],beforeHide:n[18],popup:!0,$$slots:{footer:[o8],header:[s8],default:[l8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[19](e),e.$on("show",n[20]),e.$on("hide",n[21]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&128&&(o.overlayClose=!l[7]),s&128&&(o.escClose=!l[7]),s&128&&(o.beforeHide=l[18]),s&16777724&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[19](null),V(e,l)}}}const go=15777e3;function a8(n,e,t){let i;const l=st(),s="apple_secret_"+H.randomString(5);let o,r,a,f,u,c,d=!1;function m(q={}){t(2,r=q.clientId||""),t(3,a=q.teamId||""),t(4,f=q.keyId||""),t(5,u=q.privateKey||""),t(6,c=q.duration||go),Gt({}),o==null||o.show()}function h(){return o==null?void 0:o.hide()}async function _(){t(7,d=!0);try{const q=await fe.settings.generateAppleClientSecret(r,a,f,u.trim(),c);t(7,d=!1),Nt("Successfully generated client secret."),l("submit",q),o==null||o.hide()}catch(q){fe.error(q)}t(7,d=!1)}function g(){r
`),r=b("button"),r.textContent="Restore draft",a=D(),f=b("button"),f.innerHTML='<i class="ri-close-line"></i>',u=D(),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(f,"type","button"),p(f,"class","close"),p(f,"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,v){S(g,e,v),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(t,a),y(t,f),y(e,u),y(e,c),m=!0,h||(_=[Z(r,"click",n[39]),$e(Fe.call(null,f,"Discard draft")),Z(f,"click",Ue(n[40]))],h=!0)},p:x,i(g){m||(d&&d.end(1),m=!0)},o(g){g&&(d=da(e,tt,{duration:150})),m=!1},d(g){g&&w(e),g&&d&&d.end(),h=!1,Te(_)}}}function Rm(n){let e,t,i;return t=new Jb({props:{model:n[3]}}),{c(){e=b("div"),B(t.$$.fragment),p(e,"class","form-field-addon")},m(l,s){S(l,e,s),z(t,e,null),i=!0},p(l,s){const o={};s[0]&8&&(o.model=l[3]),t.$set(o)},i(l){i||(I(t.$$.fragment,l),i=!0)},o(l){L(t.$$.fragment,l),i=!1},d(l){l&&w(e),V(t)}}}function k8(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v=!n[6]&&Rm(n);return{c(){e=b("label"),t=b("i"),i=D(),l=b("span"),l.textContent="id",s=D(),o=b("span"),a=D(),v&&v.c(),f=D(),u=b("input"),p(t,"class",Yn(H.getFieldTypeIcon("primary"))+" svelte-qc5ngu"),p(l,"class","txt"),p(o,"class","flex-fill"),p(e,"for",r=n[74]),p(u,"type","text"),p(u,"id",c=n[74]),p(u,"placeholder",d=n[7]?"":"Leave empty to auto generate..."),p(u,"minlength","15"),u.readOnly=m=!n[6]},m($,C){S($,e,C),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),S($,a,C),v&&v.m($,C),S($,f,C),S($,u,C),ae(u,n[3].id),h=!0,_||(g=Z(u,"input",n[41]),_=!0)},p($,C){(!h||C[2]&4096&&r!==(r=$[74]))&&p(e,"for",r),$[6]?v&&(se(),L(v,1,1,()=>{v=null}),oe()):v?(v.p($,C),C[0]&64&&I(v,1)):(v=Rm($),v.c(),I(v,1),v.m(f.parentNode,f)),(!h||C[2]&4096&&c!==(c=$[74]))&&p(u,"id",c),(!h||C[0]&128&&d!==(d=$[7]?"":"Leave empty to auto generate..."))&&p(u,"placeholder",d),(!h||C[0]&64&&m!==(m=!$[6]))&&(u.readOnly=m),C[0]&8&&u.value!==$[3].id&&ae(u,$[3].id)},i($){h||(I(v),h=!0)},o($){L(v),h=!1},d($){$&&(w(e),w(a),w(f),w(u)),v&&v.d($),_=!1,g()}}}function qm(n){var f,u;let e,t,i,l,s;function o(c){n[42](c)}let r={isNew:n[6],collection:n[0]};n[3]!==void 0&&(r.record=n[3]),e=new I6({props:r}),te.push(()=>ke(e,"record",o));let a=((u=(f=n[0])==null?void 0:f.schema)==null?void 0:u.length)&&jm();return{c(){B(e.$$.fragment),i=D(),a&&a.c(),l=ve()},m(c,d){z(e,c,d),S(c,i,d),a&&a.m(c,d),S(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],ye(()=>t=!1)),e.$set(m),(_=(h=c[0])==null?void 0:h.schema)!=null&&_.length?a||(a=jm(),a.c(),a.m(l.parentNode,l)):a&&(a.d(1),a=null)},i(c){s||(I(e.$$.fragment,c),s=!0)},o(c){L(e.$$.fragment,c),s=!1},d(c){c&&(w(i),w(l)),V(e,c),a&&a.d(c)}}}function jm(n){let e;return{c(){e=b("hr")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function y8(n){let e,t,i;function l(o){n[55](o,n[71])}let s={field:n[71]};return n[3][n[71].name]!==void 0&&(s.value=n[3][n[71].name]),e=new fM({props:s}),te.push(()=>ke(e,"value",l)),{c(){B(e.$$.fragment)},m(o,r){z(e,o,r),i=!0},p(o,r){n=o;const a={};r[0]&1&&(a.field=n[71]),!t&&r[0]&9&&(t=!0,a.value=n[3][n[71].name],ye(()=>t=!1)),e.$set(a)},i(o){i||(I(e.$$.fragment,o),i=!0)},o(o){L(e.$$.fragment,o),i=!1},d(o){V(e,o)}}}function v8(n){let e,t,i,l,s;function o(u){n[52](u,n[71])}function r(u){n[53](u,n[71])}function a(u){n[54](u,n[71])}let f={field:n[71],record:n[3]};return n[3][n[71].name]!==void 0&&(f.value=n[3][n[71].name]),n[4][n[71].name]!==void 0&&(f.uploadedFiles=n[4][n[71].name]),n[5][n[71].name]!==void 0&&(f.deletedFileNames=n[5][n[71].name]),e=new UO({props:f}),te.push(()=>ke(e,"value",o)),te.push(()=>ke(e,"uploadedFiles",r)),te.push(()=>ke(e,"deletedFileNames",a)),{c(){B(e.$$.fragment)},m(u,c){z(e,u,c),s=!0},p(u,c){n=u;const d={};c[0]&1&&(d.field=n[71]),c[0]&8&&(d.record=n[3]),!t&&c[0]&9&&(t=!0,d.value=n[3][n[71].name],ye(()=>t=!1)),!i&&c[0]&17&&(i=!0,d.uploadedFiles=n[4][n[71].name],ye(()=>i=!1)),!l&&c[0]&33&&(l=!0,d.deletedFileNames=n[5][n[71].name],ye(()=>l=!1)),e.$set(d)},i(u){s||(I(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[56],$$slots:{footer:[F8],header:[P8],default:[I8]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[57](e),e.$on("hide",n[58]),e.$on("show",n[59]),{c(){B(e.$$.fragment)},m(l,s){z(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[56]),s[0]&60925|s[2]&8192&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[57](null),V(e,l)}}}const Xi="form",gs="providers";function q8(n,e,t){let i,l,s,o,r;const a=st(),f="record_"+H.randomString(5);let{collection:u}=e,c,d={},m={},h=null,_=!1,g=!1,v={},$={},C=JSON.stringify(d),T=C,O=Xi,M=!0,E=!0,A=u;function N(_e){return j(_e),t(12,g=!0),t(13,O=Xi),c==null?void 0:c.show()}function q(){return c==null?void 0:c.hide()}function R(){t(12,g=!1),q()}function P(){t(30,A=u),c!=null&&c.isActive()&&(W(JSON.stringify(m)),R())}async function F(_e){if(_e&&typeof _e=="string"){try{return await fe.collection(u.id).getOne(_e)}catch(Me){Me.isAbort||(R(),console.warn("resolveModel:",Me),li(`Unable to load record with id "${_e}"`))}return null}return _e}async function j(_e){t(7,E=!0),Gt({}),t(4,v={}),t(5,$={}),t(2,d=typeof _e=="string"?{id:_e,collectionId:u==null?void 0:u.id,collectionName:u==null?void 0:u.name}:_e||{}),t(3,m=structuredClone(d)),t(2,d=await F(_e)||{}),t(3,m=structuredClone(d)),await xt(),t(10,h=X()),!h||le(m,h)?t(10,h=null):(delete h.password,delete h.passwordConfirm),t(28,C=JSON.stringify(m)),t(7,E=!1)}async function U(_e){var _t,Jt;Gt({}),t(2,d=_e||{}),t(4,v={}),t(5,$={});const Me=((Jt=(_t=u==null?void 0:u.schema)==null?void 0:_t.filter(ct=>ct.type!="file"))==null?void 0:Jt.map(ct=>ct.name))||[];for(let ct in _e)Me.includes(ct)||t(3,m[ct]=_e[ct],m);await xt(),t(28,C=JSON.stringify(m)),ne()}function Y(){return"record_draft_"+((u==null?void 0:u.id)||"")+"_"+((d==null?void 0:d.id)||"")}function X(_e){try{const Me=window.localStorage.getItem(Y());if(Me)return JSON.parse(Me)}catch{}return _e}function W(_e){try{window.localStorage.setItem(Y(),_e)}catch(Me){console.warn("updateDraft failure:",Me),window.localStorage.removeItem(Y())}}function K(){h&&(t(3,m=h),t(10,h=null))}function le(_e,Me){var G;const _t=structuredClone(_e||{}),Jt=structuredClone(Me||{}),ct=(G=u==null?void 0:u.schema)==null?void 0:G.filter(Q=>Q.type==="file");for(let Q of ct)delete _t[Q.name],delete Jt[Q.name];const ri=["expand","password","passwordConfirm"];for(let Q of ri)delete _t[Q],delete Jt[Q];return JSON.stringify(_t)==JSON.stringify(Jt)}function ne(){t(10,h=null),window.localStorage.removeItem(Y())}async function me(_e=!0){if(!(_||!r||!(u!=null&&u.id))){t(11,_=!0);try{const Me=ze();let _t;M?_t=await fe.collection(u.id).create(Me):_t=await fe.collection(u.id).update(m.id,Me),Nt(M?"Successfully created record.":"Successfully updated record."),ne(),_e?R():U(_t),a("save",{isNew:M,record:_t})}catch(Me){fe.error(Me)}t(11,_=!1)}}function Pe(){d!=null&&d.id&&un("Do you really want to delete the selected record?",()=>fe.collection(d.collectionId).delete(d.id).then(()=>{q(),Nt("Successfully deleted record."),a("delete",d)}).catch(_e=>{fe.error(_e)}))}function ze(){const _e=structuredClone(m||{}),Me=new FormData,_t={id:_e.id},Jt={};for(const ct of(u==null?void 0:u.schema)||[])_t[ct.name]=!0,ct.type=="json"&&(Jt[ct.name]=!0);i&&(_t.username=!0,_t.email=!0,_t.emailVisibility=!0,_t.password=!0,_t.passwordConfirm=!0,_t.verified=!0);for(const ct in _e)if(_t[ct]){if(typeof _e[ct]>"u"&&(_e[ct]=null),Jt[ct]&&_e[ct]!=="")try{JSON.parse(_e[ct])}catch(ri){const G={};throw G[ct]={code:"invalid_json",message:ri.toString()},new bn({status:400,response:{data:G}})}H.addValueToFormData(Me,ct,_e[ct])}for(const ct in v){const ri=H.toArray(v[ct]);for(const G of ri)Me.append(ct,G)}for(const ct in $){const ri=H.toArray($[ct]);for(const G of ri)Me.append(ct+"."+G,"")}return Me}function Qe(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent verification email to ${d.email}?`,()=>fe.collection(u.id).requestVerification(d.email).then(()=>{Nt(`Successfully sent verification email to ${d.email}.`)}).catch(_e=>{fe.error(_e)}))}function et(){!(u!=null&&u.id)||!(d!=null&&d.email)||un(`Do you really want to sent password reset email to ${d.email}?`,()=>fe.collection(u.id).requestPasswordR
`),u=b("button"),u.textContent="{APP_NAME} ",c=J(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=J("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"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,v){S(g,e,v),y(e,t),S(g,l,v),S(g,s,v),ae(s,n[0].subject),S(g,r,v),S(g,a,v),y(a,f),y(a,u),y(a,c),y(a,d),y(a,m),h||(_=[Z(s,"input",n[13]),Z(u,"click",n[14]),Z(d,"click",n[15])],h=!0)},p(g,v){v[1]&1&&i!==(i=g[31])&&p(e,"for",i),v[1]&1&&o!==(o=g[31])&&p(s,"id",o),v[0]&1&&s.value!==g[0].subject&&ae(s,g[0].subject)},d(g){g&&(w(e),w(l),w(s),w(r),w(a)),h=!1,Te(_)}}}function QE(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v;return{c(){e=b("label"),t=J("Action URL"),l=D(),s=b("input"),r=D(),a=b("div"),f=J(`Available placeholder parameters:
`),u=b("button"),u.textContent="{APP_NAME} ",c=J(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=J(`,
`),h=b("button"),h.textContent="{TOKEN} ",_=J("."),p(e,"for",i=n[31]),p(s,"type","text"),p(s,"id",o=n[31]),p(s,"spellcheck","false"),s.required=!0,p(u,"type","button"),p(u,"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($,C){S($,e,C),y(e,t),S($,l,C),S($,s,C),ae(s,n[0].actionUrl),S($,r,C),S($,a,C),y(a,f),y(a,u),y(a,c),y(a,d),y(a,m),y(a,h),y(a,_),g||(v=[Z(s,"input",n[16]),Z(u,"click",n[17]),Z(d,"click",n[18]),Z(h,"click",n[19])],g=!0)},p($,C){C[1]&1&&i!==(i=$[31])&&p(e,"for",i),C[1]&1&&o!==(o=$[31])&&p(s,"id",o),C[0]&1&&s.value!==$[0].actionUrl&&ae(s,$[0].actionUrl)},d($){$&&(w(e),w(l),w(s),w(r),w(a)),g=!1,Te(v)}}}function xE(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){S(s,e,o),ae(e,n[0].body),i||(l=Z(e,"input",n[21]),i=!0)},p(s,o){o[1]&1&&t!==(t=s[31])&&p(e,"id",t),o[0]&1&&ae(e,s[0].body)},i:x,o:x,d(s){s&&w(e),i=!1,l()}}}function eI(n){let e,t,i,l;function s(a){n[20](a)}var o=n[4];function r(a,f){let u={id:a[31],language:"html"};return a[0].body!==void 0&&(u.value=a[0].body),{props:u}}return o&&(e=Et(o,r(n)),te.push(()=>ke(e,"value",s))),{c(){e&&B(e.$$.fragment),i=ve()},m(a,f){e&&z(e,a,f),S(a,i,f),l=!0},p(a,f){if(f[0]&16&&o!==(o=a[4])){if(e){se();const u=e;L(u.$$.fragment,1,0,()=>{V(u,1)}),oe()}o?(e=Et(o,r(a)),te.push(()=>ke(e,"value",s)),B(e.$$.fragment),I(e.$$.fragment,1),z(e,i.parentNode,i)):e=null}else if(o){const u={};f[1]&1&&(u.id=a[31]),!t&&f[0]&1&&(t=!0,u.value=a[0].body,ye(()=>t=!1)),e.$set(u)}},i(a){l||(e&&I(e.$$.fragment,a),l=!0)},o(a){e&&L(e.$$.fragment,a),l=!1},d(a){a&&w(i),e&&V(e,a)}}}function tI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T;const O=[eI,xE],M=[];function E(A,N){return A[4]&&!A[5]?0:1}return s=E(n),o=M[s]=O[s](n),{c(){e=b("label"),t=J("Body (HTML)"),l=D(),o.c(),r=D(),a=b("div"),f=J(`Available placeholder parameters:
`),u=b("button"),u.textContent="{APP_NAME} ",c=J(`,
`),d=b("button"),d.textContent="{APP_URL} ",m=J(`,
`),h=b("button"),h.textContent="{TOKEN} ",_=J(`,
`),g=b("button"),g.textContent="{ACTION_URL} ",v=J("."),p(e,"for",i=n[31]),p(u,"type","button"),p(u,"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(A,N){S(A,e,N),y(e,t),S(A,l,N),M[s].m(A,N),S(A,r,N),S(A,a,N),y(a,f),y(a,u),y(a,c),y(a,d),y(a,m),y(a,h),y(a,_),y(a,g),y(a,v),$=!0,C||(T=[Z(u,"click",n[22]),Z(d,"click",n[23]),Z(h,"click",n[24]),Z(g,"click",n[25])],C=!0)},p(A,N){(!$||N[1]&1&&i!==(i=A[31]))&&p(e,"for",i);let q=s;s=E(A),s===q?M[s].p(A,N):(se(),L(M[q],1,1,()=>{M[q]=null}),oe(),o=M[s],o?o.p(A,N):(o=M[s]=O[s](A),o.c()),I(o,1),o.m(r.parentNode,r))},i(A){$||(I(o),$=!0)},o(A){L(o),$=!1},d(A){A&&(w(e),w(l),w(r),w(a)),M[s].d(A),C=!1,Te(T)}}}function nI(n){let e,t,i,l,s,o;return e=new de({props:{class:"form-field required",name:n[1]+".subject",$$slots:{default:[XE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),i=new de({props:{class:"form-field required",name:n[1]+".actionUrl",$$slots:{default:[QE,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),s=new de({props:{class:"form-field m-0 required",name:n[1]+".body",$$slots:{default:[tI,({uniqueId:r})=>({31:r}),({uniqueId:r})=>[0,r?1:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),l=D(),B(s.$$.fragment)},m(r,a){z(e,r,a),S(r,t,a),z(i,r,a),S(r,l,a),z(s,r,a),o=!0},p(r,a){const f={};a[0]&2&&(f.name=r[1]+".subject"),a[0]&1|a[1]&3&&(f.$$scope={dirty:a,ctx:r}),e.$set(f);const u={};a[0]&2&&(u.name=r[1]+".actionUrl"),a[0]&1|a[1]&3&&(u.$$scope={dirty:a,ctx:r}),i.$set(u);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||(I(e.$$.fragment,r),I(i.$$.fragment,r),I(s.$$.fragment,r),o=!0)},o(r){L(e.$$.fragment,r),L(i.$$.fragment,r),L(s.$$.fragment,r),o=!1},d(r){r&&(w(t),w(l)),V(e,r),V(i,r),V(s,r)}}}function Xh(n){let e,t,i,l,s;return{c(){e=b("i"),p(e,"class","ri-error-warning-fill txt-danger")},m(o,r){S(o,e,r),i=!0,l||(s=$e(Fe.call(null,e,{text:"Has errors",position:"left"})),l=!0)},i(o){i||(o&&Je(()=>{i&&(t||(t=Re(e,Yt,{duration:150,start:.7},!0)),t.run(1))}),i=!0)},o(o){o&&(t||(t=Re(e,Yt,{duration:150,start:.7},!1)),t.run(0)),i=!1},d(o){o&&w(e),o&&t&&t.end(),l=!1,s()}}}function iI(n){let e,t,i,l,s,o,r,a,f,u=n[6]&&Xh();return{c(){e=b("div"),t=b("i"),i=D(),l=b("span"),s=J(n[2]),o=D(),r=b("div"),a=D(),u&&u.c(),f=ve(),p(t,"class","ri-draft-line"),p(l,"class","txt"),p(e,"class","inline-flex"),p(r,"class","flex-fill")},m(c,d){S(c,e,d),y(e,t),y(e,i),y(e,l),y(l,s),S(c,o,d),S(c,r,d),S(c,a,d),u&&u.m(c,d),S(c,f,d)},p(c,d){d[0]&4&&re(s,c[2]),c[6]?u?d[0]&64&&I(u,1):(u=Xh(),u.c(),I(u,1),u.m(f.parentNode,f)):u&&(se(),L(u,1,1,()=>{u=null}),oe())},d(c){c&&(w(e),w(o),w(r),w(a),w(f)),u&&u.d(c)}}}function lI(n){let e,t;const i=[n[8]];let l={$$slots:{header:[iI],default:[nI]},$$scope:{ctx:n}};for(let s=0;s<i.length;s+=1)l=Ae(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(){B(e.$$.fragment)},m(s,o){z(e,s,o),t=!0},p(s,o){const r=o[0]&256?mt(i,[Mt(s[8])]):{};o[0]&119|o[1]&2&&(r.$$scope={dirty:o,ctx:s}),e.$set(r)},i(s){t||(I(e.$$.fragment,s),t=!0)},o(s){L(e.$$.fragment,s),t=!1},d(s){n[26](null),V(e,s)}}}let Qh;function sI(n,e,t){let i;const l=["key","title","config","expand","collapse","collapseSiblings"];let s=Xe(e,l),o;We(n,hi,K=>t(12,o=K));let{key:r}=e,{title:a}=e,{config:f={}}=e,u,c=Qh,d=!1;function m(){u==null||u.expand()}function h(){u==null||u.collapse()}function _(){u==null||u.collapseSiblings()}async function g(){c||d||(t(5,d=!0),t(4,c=(await nt(()=>import("./CodeEditor-dWSAtOWY.js"),__vite__mapDeps([2,1]),import.meta.url)).default),Qh=c,t(5,d=!1))}function v(K){H.copyToClipboard(K),To(`Copied ${K} to clipboard`,2e3)}g();function $(){f.subject=this.value,t(0,f)}const C=()=>v("{APP_NAME}"),T=()=>v("{APP_URL}");function O(){f.actionU
2024-04-13 20:44:20 +08:00
from the
`),r=b("strong"),f=J(a),u=J(`
to the
`),c=b("strong"),m=J(d),h=J(`.
`),_=b("br"),g=J(`
There are numerous command line tools that can help you, such as:
`),v=b("a"),v.textContent=`rclone
`,$=J(`,
`),C=b("a"),C.textContent=`s5cmd
`,T=J(", etc."),O=D(),M=b("div"),p(i,"class","icon"),p(v,"href","https://github.com/rclone/rclone"),p(v,"target","_blank"),p(v,"rel","noopener noreferrer"),p(v,"class","txt-bold"),p(C,"href","https://github.com/peak/s5cmd"),p(C,"target","_blank"),p(C,"rel","noopener noreferrer"),p(C,"class","txt-bold"),p(s,"class","content"),p(t,"class","alert alert-warning m-0"),p(M,"class","clearfix m-t-base")},m(q,R){S(q,e,R),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),y(s,r),y(r,f),y(s,u),y(s,c),y(c,m),y(s,h),y(s,_),y(s,g),y(s,v),y(s,$),y(s,C),y(s,T),y(e,O),y(e,M),A=!0},p(q,R){var P;(!A||R&1)&&a!==(a=(P=q[0].s3)!=null&&P.enabled?"S3 storage":"local file system")&&re(f,a),(!A||R&2)&&d!==(d=q[1].s3.enabled?"S3 storage":"local file system")&&re(m,d)},i(q){A||(q&&Je(()=>{A&&(E||(E=Re(e,tt,{duration:150},!0)),E.run(1))}),A=!0)},o(q){q&&(E||(E=Re(e,tt,{duration:150},!1)),E.run(0)),A=!1},d(q){q&&w(e),q&&E&&E.end()}}}function YI(n){var i;let e,t=((i=n[0].s3)==null?void 0:i.enabled)!=n[1].s3.enabled&&f_(n);return{c(){t&&t.c(),e=ve()},m(l,s){t&&t.m(l,s),S(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&&I(t,1)):(t=f_(l),t.c(),I(t,1),t.m(e.parentNode,e)):t&&(se(),L(t,1,1,()=>{t=null}),oe())},d(l){l&&w(e),t&&t.d(l)}}}function u_(n){let e;function t(s,o){return s[4]?ZI:s[5]?JI:KI}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},m(s,o){l.m(s,o),S(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&&w(e),l.d(s)}}}function KI(n){let e;return{c(){e=b("div"),e.innerHTML='<i class="ri-checkbox-circle-line txt-success"></i> <span class="txt">S3 connected successfully</span>',p(e,"class","label label-sm label-success entrance-right")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function JI(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;S(s,e,o),i||(l=$e(t=Fe.call(null,e,(r=n[5].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ot(t.update)&&o&32&&t.update.call(null,(r=s[5].data)==null?void 0:r.message)},d(s){s&&w(e),i=!1,l()}}}function ZI(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function c_(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){S(s,e,o),y(e,t),i||(l=Z(e,"click",n[14]),i=!0)},p(s,o){o&8&&(e.disabled=s[3])},d(s){s&&w(e),i=!1,l()}}}function GI(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;const v=[WI,UI],$=[];function C(T,O){return T[2]?0:1}return d=C(n),m=$[d]=v[d](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=D(),s=b("div"),o=J(n[7]),r=D(),a=b("div"),f=b("form"),u=b("div"),u.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=D(),m.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(u,"class","content txt-xl m-b-base"),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(T,O){S(T,e,O),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),S(T,r,O),S(T,a,O),y(a,f),y(f,u),y(f,c),$[d].m(f,null),h=!0,_||(g=Z(f,"submit",Ue(n[16])),_=!0)},p(T,O){(!h||O&128)&&re(o,T[7]);let M=d;d=C(T),d===M?$[d].p(T,O):(se(),L($[M],1,1,()=>{$[M]=null}),oe(),m=$[d],m?m.p(T,O):(m=$[d]=v[d](T),m.c()),I(m,1),m.m(f,null))},i(T){h||(I(m),h=!0)},o(T){L(m),h=!1},d(T){T&&(w(e),w(r),w(a)),$[d].d(),_=!1,g()}}}function XI(n){let e,t,i,l;return e=new gi({}),i=new kn({props:{$$slots:{default:[GI]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment)},m(s,o){z(e,s,o),S(s,t,o),z(i,s,o),l=!0},p(s,[o]){const r={};o&524543&&(r.$$scope={dirty:o,ctx:s}),i.$set(r)},i(s){l||(I(e.$$.fragment,s),I(i.$$.fragment,s),l=!0)},o(s){L(e.$$.fragment,s),L(i.$$.fragment,s),l=!1},d(s){s&&w(t),V(
another PocketBase environment.</p>`,t=D(),i=b("div"),l=b("div"),s=b("div"),B(o.$$.fragment),r=D();for(let U=0;U<a.length;U+=1)a[U].c();u=D(),c=b("div"),d=b("button"),m=b("span"),m.textContent="Copy",_=D(),g=b("pre"),v=D(),$=b("div"),C=b("div"),T=D(),O=b("button"),M=b("i"),E=D(),A=b("span"),A.textContent="Download as JSON",p(e,"class","content txt-xl m-b-base"),p(s,"class","list-item list-item-section"),p(l,"class","export-list"),p(m,"class","txt"),p(d,"type","button"),p(d,"class","btn btn-sm btn-transparent fade copy-schema"),d.disabled=h=!n[2],p(g,"class","code-wrapper"),p(c,"tabindex","0"),p(c,"class","export-preview"),p(i,"class","export-panel"),p(C,"class","flex-fill"),p(M,"class","ri-download-line"),p(A,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-expanded"),O.disabled=N=!n[2],p($,"class","flex m-t-base")},m(U,Y){S(U,e,Y),S(U,t,Y),S(U,i,Y),y(i,l),y(l,s),z(o,s,null),y(l,r);for(let X=0;X<a.length;X+=1)a[X]&&a[X].m(l,null);y(i,u),y(i,c),y(c,d),y(d,m),y(c,_),y(c,g),g.innerHTML=n[6],n[16](c),S(U,v,Y),S(U,$,Y),y($,C),y($,T),y($,O),y(O,M),y(O,E),y(O,A),q=!0,R||(P=[Z(d,"click",n[15]),Z(c,"keydown",n[17]),Z(O,"click",n[18])],R=!0)},p(U,Y){const X={};Y&33558561&&(X.$$scope={dirty:Y,ctx:U}),o.$set(X),Y&6147&&(F=ce(U[0]),se(),a=ft(a,Y,j,1,U,F,f,l,It,C_,null,T_),oe()),(!q||Y&4&&h!==(h=!U[2]))&&(d.disabled=h),(!q||Y&64)&&(g.innerHTML=U[6]),(!q||Y&4&&N!==(N=!U[2]))&&(O.disabled=N)},i(U){if(!q){I(o.$$.fragment,U);for(let Y=0;Y<F.length;Y+=1)I(a[Y]);q=!0}},o(U){L(o.$$.fragment,U);for(let Y=0;Y<a.length;Y+=1)L(a[Y]);q=!1},d(U){U&&(w(e),w(t),w(i),w(v),w($)),V(o);for(let Y=0;Y<a.length;Y+=1)a[Y].d();n[16](null),R=!1,Te(P)}}}function MA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function DA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=D(),s=b("label"),o=J("Select all"),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.disabled=i=!n[0].length,e.checked=n[5],p(s,"for",r=n[12])},m(u,c){S(u,e,c),S(u,l,c),S(u,s,c),y(s,o),a||(f=Z(e,"change",n[13]),a=!0)},p(u,c){c&4096&&t!==(t=u[12])&&p(e,"id",t),c&1&&i!==(i=!u[0].length)&&(e.disabled=i),c&32&&(e.checked=u[5]),c&4096&&r!==(r=u[12])&&p(s,"for",r)},d(u){u&&(w(e),w(l),w(s)),a=!1,f()}}}function EA(n){let e,t,i,l,s,o=n[22].name+"",r,a,f,u,c;function d(){return n[14](n[22])}return{c(){e=b("input"),l=D(),s=b("label"),r=J(o),p(e,"type","checkbox"),p(e,"id",t=n[12]),e.checked=i=n[1][n[22].id],p(s,"for",a=n[12]),p(s,"title",f=n[22].name)},m(m,h){S(m,e,h),S(m,l,h),S(m,s,h),y(s,r),u||(c=Z(e,"change",d),u=!0)},p(m,h){n=m,h&4096&&t!==(t=n[12])&&p(e,"id",t),h&3&&i!==(i=n[1][n[22].id])&&(e.checked=i),h&1&&o!==(o=n[22].name+"")&&re(r,o),h&4096&&a!==(a=n[12])&&p(s,"for",a),h&1&&f!==(f=n[22].name)&&p(s,"title",f)},d(m){m&&(w(e),w(l),w(s)),u=!1,c()}}}function C_(n,e){let t,i,l,s;return i=new de({props:{class:"form-field",$$slots:{default:[EA,({uniqueId:o})=>({12:o}),({uniqueId:o})=>o?4096:0]},$$scope:{ctx:e}}}),{key:n,first:null,c(){t=b("div"),B(i.$$.fragment),l=D(),p(t,"class","list-item list-item-collection"),this.first=t},m(o,r){S(o,t,r),z(i,t,null),y(t,l),s=!0},p(o,r){e=o;const a={};r&33558531&&(a.$$scope={dirty:r,ctx:e}),i.$set(a)},i(o){s||(I(i.$$.fragment,o),s=!0)},o(o){L(i.$$.fragment,o),s=!1},d(o){o&&w(t),V(i)}}}function IA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[MA,OA],h=[];function _(g,v){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=D(),s=b("div"),o=J(n[7]),r=D(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,v){S(g,e,v),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),S(g,r,v),S(g,a,v),y(a,f),h[u].m(f,null),d=!0},p(g,v){(!d||v&128)&&re(o,g[7]);let $=u;u=_(g),u===$?h[u].p(g,v):(se(),L(h[$],1,1,()=>{h[$]=null}),oe(),c=h[u],c?c.p(g,v):(c=h[u]=m[u](g),c.c()),I(c,1),c.m(f,null))},i(g){d||(I(c),d=!0)},o(g){L(c),d=!1},d(g){g&&(w(e),w(r),w(a)),h[u].d()}}}function AA(n){let e,t,i,l;return e=new gi({}),i=new kn({props:{$$slot
- ${T.join(`
- `)}`,()=>{h()}):h()}async function h(){if(!f){t(4,f=!0);try{await fe.collections.import(o,a),Nt("Successfully imported collections configuration."),i("submit")}catch(T){fe.error(T)}t(4,f=!1),c()}}const _=()=>m(),g=()=>!f;function v(T){te[T?"unshift":"push"](()=>{l=T,t(1,l)})}function $(T){Oe.call(this,n,T)}function C(T){Oe.call(this,n,T)}return n.$$.update=()=>{n.$$.dirty&384&&Array.isArray(s)&&Array.isArray(o)&&d()},[c,l,r,a,f,m,u,s,o,_,g,v,$,C]}class YA extends be{constructor(e){super(),ge(this,e,WA,UA,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function K_(n,e,t){const i=n.slice();return i[33]=e[t],i}function J_(n,e,t){const i=n.slice();return i[36]=e[t],i}function Z_(n,e,t){const i=n.slice();return i[33]=e[t],i}function KA(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T,O,M,E,A;a=new de({props:{class:"form-field "+(n[6]?"":"field-error"),name:"collections",$$slots:{default:[ZA,({uniqueId:U})=>({41:U}),({uniqueId:U})=>[0,U?1024:0]]},$$scope:{ctx:n}}});let N=n[1].length&&X_(n),q=!1,R=n[6]&&n[1].length&&!n[7]&&Q_(),P=n[6]&&n[1].length&&n[7]&&x_(n),F=n[13].length&&ug(n),j=!!n[0]&&cg(n);return{c(){e=b("input"),t=D(),i=b("div"),l=b("p"),s=J(`Paste below the collections configuration you want to import or
`),o=b("button"),o.innerHTML='<span class="txt">Load from JSON file</span>',r=D(),B(a.$$.fragment),f=D(),N&&N.c(),u=D(),c=D(),R&&R.c(),d=D(),P&&P.c(),m=D(),F&&F.c(),h=D(),_=b("div"),j&&j.c(),g=D(),v=b("div"),$=D(),C=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(v,"class","flex-fill"),p(T,"class","txt"),p(C,"type","button"),p(C,"class","btn btn-expanded btn-warning m-l-auto"),C.disabled=O=!n[14],p(_,"class","flex m-t-base")},m(U,Y){S(U,e,Y),n[21](e),S(U,t,Y),S(U,i,Y),y(i,l),y(l,s),y(l,o),S(U,r,Y),z(a,U,Y),S(U,f,Y),N&&N.m(U,Y),S(U,u,Y),S(U,c,Y),R&&R.m(U,Y),S(U,d,Y),P&&P.m(U,Y),S(U,m,Y),F&&F.m(U,Y),S(U,h,Y),S(U,_,Y),j&&j.m(_,null),y(_,g),y(_,v),y(_,$),y(_,C),y(C,T),M=!0,E||(A=[Z(e,"change",n[22]),Z(o,"click",n[23]),Z(C,"click",n[19])],E=!0)},p(U,Y){(!M||Y[0]&4096)&&ee(o,"btn-loading",U[12]);const X={};Y[0]&64&&(X.class="form-field "+(U[6]?"":"field-error")),Y[0]&65|Y[1]&3072&&(X.$$scope={dirty:Y,ctx:U}),a.$set(X),U[1].length?N?(N.p(U,Y),Y[0]&2&&I(N,1)):(N=X_(U),N.c(),I(N,1),N.m(u.parentNode,u)):N&&(se(),L(N,1,1,()=>{N=null}),oe()),U[6]&&U[1].length&&!U[7]?R||(R=Q_(),R.c(),R.m(d.parentNode,d)):R&&(R.d(1),R=null),U[6]&&U[1].length&&U[7]?P?P.p(U,Y):(P=x_(U),P.c(),P.m(m.parentNode,m)):P&&(P.d(1),P=null),U[13].length?F?F.p(U,Y):(F=ug(U),F.c(),F.m(h.parentNode,h)):F&&(F.d(1),F=null),U[0]?j?j.p(U,Y):(j=cg(U),j.c(),j.m(_,g)):j&&(j.d(1),j=null),(!M||Y[0]&16384&&O!==(O=!U[14]))&&(C.disabled=O)},i(U){M||(I(a.$$.fragment,U),I(N),I(q),M=!0)},o(U){L(a.$$.fragment,U),L(N),L(q),M=!1},d(U){U&&(w(e),w(t),w(i),w(r),w(f),w(u),w(c),w(d),w(m),w(h),w(_)),n[21](null),V(a,U),N&&N.d(U),R&&R.d(U),P&&P.d(U),F&&F.d(U),j&&j.d(),E=!1,Te(A)}}}function JA(n){let e;return{c(){e=b("div"),p(e,"class","loader")},m(t,i){S(t,e,i)},p:x,i:x,o:x,d(t){t&&w(e)}}}function G_(n){let e;return{c(){e=b("div"),e.textContent="Invalid collections configuration.",p(e,"class","help-block help-block-error")},m(t,i){S(t,e,i)},d(t){t&&w(e)}}}function ZA(n){let e,t,i,l,s,o,r,a,f,u,c=!!n[0]&&!n[6]&&G_();return{c(){e=b("label"),t=J("Collections"),l=D(),s=b("textarea"),r=D(),c&&c.c(),a=ve(),p(e,"for",i=n[41]),p(e,"class","p-b-10"),p(s,"id",o=n[41]),p(s,"class","code"),p(s,"spellcheck","false"),p(s,"rows","15"),s.required=!0},m(d,m){S(d,e,m),y(e,t),S(d,l,m),S(d,s,m),ae(s,n[0]),S(d,r,m),c&&c.m(d,m),S(d,a,m),f||(u=Z(s,"input",n[24]),f=!0)},p(d,m){m[1]&1024&&i!==(i=d[41])&&p(e,"for",i),m[1]&1024&&o!==(o=d[41])&&p(s,"id",o),m[0]&1&&ae(s,d[0]),d[0]&&!d[6]?c||(c=G_(),c.c(),c.m(a.parentNode,a)):c&&(c.d(1),c=null)},d(d){d&&(w(e),w(l),w(s),w(r),w(a)),c&&c.d(d),f=!1,u()}}}function X_(n){let e,t;return e=new de({props:{class:"form-field form-field-toggle",$$slots:{default:[GA,({uniqueId:i})=>({41:i}),({uniqueId:i})=>[0,i?1024:0]]},$$scope:{ctx:n}}}),{c(){B(e.$$.fragment)},m(i,l){z(e,i,l),t=!0},p(i,l){const s={};l[0]&96|l[1]&3072&&(s.$$scope={dirty:l,ctx:i}),e.$set(s)},i(i){t||(I(e.$$.fragment,i),t=!0)},o(i){L(e.$$.fragment,i),t=!1},d(i){V(e,i)}}}function GA(n){let e,t,i,l,s,o,r,a,f;return{c(){e=b("input"),l=D(),s=b("label"),o=J("Merge with the existing collections"),p(e,"type","checkbox"),p(e,"id",t=n[41]),e.disabled=i=!n[6],p(s,"for",r=n[41])},m(u,c){S(u,e,c),e.checked=n[5],S(u,l,c),S(u,s,c),y(s,o),a||(f=Z(e,"change",n[25]),a=!0)},p(u,c){c[1]&1024&&t!==(t=u[41])&&p(e,"id",t),c[0]&64&&i!==(i=!u[6])&&(e.disabled=i),c[0]&32&&(e.checked=u[5]),c[1]&1024&&r!==(r=u[41])&&p(s,"for",r)},d(u){u&&(w(e),w(l),w(s)),a=!1,f()}}}function Q_(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){S(t,e,i)},d(t){t&&w(e)}}}function x_(n){let e,t,i,l,s,o=n[9].length&&eg(n),r=n[3].length&&ig(n),a=n[8].length&&rg(n);return{c(){e=b("h5"),e.textContent="Detected changes",t=D(),i=b("div"),o&&o.c(),l=D(),r&&r.c(),s=D(),a&&a.c(),p(e,"class",
imported with different IDs. You can replace them in the import if you want
to.</string>`,s=D(),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(f,u){S(f,e,u),y(e,t),y(e,i),y(e,l),y(e,s),y(e,o),r||(a=Z(o,"click",n[27]),r=!0)},p:x,d(f){f&&w(e),r=!1,a()}}}function cg(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){S(l,e,s),t||(i=Z(e,"click",n[28]),t=!0)},p:x,d(l){l&&w(e),t=!1,i()}}}function XA(n){let e,t,i,l,s,o,r,a,f,u,c,d;const m=[JA,KA],h=[];function _(g,v){return g[4]?0:1}return u=_(n),c=h[u]=m[u](n),{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=D(),s=b("div"),o=J(n[15]),r=D(),a=b("div"),f=b("div"),c.c(),p(i,"class","breadcrumb-item"),p(s,"class","breadcrumb-item"),p(t,"class","breadcrumbs"),p(e,"class","page-header"),p(f,"class","panel"),p(a,"class","wrapper")},m(g,v){S(g,e,v),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),S(g,r,v),S(g,a,v),y(a,f),h[u].m(f,null),d=!0},p(g,v){(!d||v[0]&32768)&&re(o,g[15]);let $=u;u=_(g),u===$?h[u].p(g,v):(se(),L(h[$],1,1,()=>{h[$]=null}),oe(),c=h[u],c?c.p(g,v):(c=h[u]=m[u](g),c.c()),I(c,1),c.m(f,null))},i(g){d||(I(c),d=!0)},o(g){L(c),d=!1},d(g){g&&(w(e),w(r),w(a)),h[u].d()}}}function QA(n){let e,t,i,l,s,o;e=new gi({}),i=new kn({props:{$$slots:{default:[XA]},$$scope:{ctx:n}}});let r={};return s=new YA({props:r}),n[29](s),s.$on("submit",n[18]),{c(){B(e.$$.fragment),t=D(),B(i.$$.fragment),l=D(),B(s.$$.fragment)},m(a,f){z(e,a,f),S(a,t,f),z(i,a,f),S(a,l,f),z(s,a,f),o=!0},p(a,f){const u={};f[0]&63487|f[1]&2048&&(u.$$scope={dirty:f,ctx:a}),i.$set(u);const c={};s.$set(c)},i(a){o||(I(e.$$.fragment,a),I(i.$$.fragment,a),I(s.$$.fragment,a),o=!0)},o(a){L(e.$$.fragment,a),L(i.$$.fragment,a),L(s.$$.fragment,a),o=!1},d(a){a&&(w(t),w(l)),V(e,a),V(i,a),n[29](null),V(s,a)}}}function xA(n,e,t){let i,l,s,o,r,a,f;We(n,At,le=>t(15,f=le)),en(At,f="Import collections",f);let u,c,d="",m=!1,h=[],_=[],g=!0,v=[],$=!1,C=!1;T();async function T(){t(4,$=!0);try{t(20,_=await fe.collections.getFullList(200));for(let le of _)delete le.created,delete le.updated}catch(le){fe.error(le)}t(4,$=!1)}function O(){if(t(3,v=[]),!!i)for(let le of h){const ne=H.findByKey(_,"id",le.id);!(ne!=null&&ne.id)||!H.hasCollectionChanges(ne,le,g)||v.push({new:le,old:ne})}}function M(){t(1,h=[]);try{t(1,h=JSON.parse(d))}catch{}Array.isArray(h)?t(1,h=H.filterDuplicatesByKey(h)):t(1,h=[]);for(let le of h)delete le.created,delete le.updated,le.schema=H.filterDuplicatesByKey(le.schema)}function E(){var le,ne;for(let me of h){const Pe=H.findByKey(_,"name",me.name)||H.findByKey(_,"id",me.id);if(!Pe)continue;const ze=me.id,Qe=Pe.id;me.id=Qe;const et=Array.isArray(Pe.schema)?Pe.schema:[],Dt=Array.isArray(me.schema)?me.schema:[];for(const ut of Dt){const ht=H.findByKey(et,"name",ut.name);ht&&ht.id&&(ut.id=ht.id)}for(let ut of h)if(Array.isArray(ut.schema))for(let ht of ut.schema)(le=ht.options)!=null&&le.collectionId&&((ne=ht.options)==null?void 0:ne.collectionId)===ze&&(ht.options.collectionId=Qe)}t(0,d=JSON.stringify(h,null,4))}function A(le){t(12,m=!0);const ne=new FileReader;ne.onload=async me=>{t(12,m=!1),t(10,u.value="",u),t(0,d=me.target.result),await xt(),h.length||(li("Invalid collections configuration."),N())},ne.onerror=me=>{console.warn(me),li("Failed to load the imported JSON."),t(12,m=!1),t(10,u.value="",u)},ne.readAsText(le)}function N(){t(0,d=""),t(10,u.value="",u),Gt({})}function q(){const le=C?H.filterDuplicatesByKey(_.concat(h)):h;c==null||c.show(_,le,g)}function R(le){te[le?"unshift":"push"](()=>{u=le,t(10,u)})}const P=()=>{u.files.length&&A(u.files[0])},F=()=>{u.click()};function j(){d=this.value,t(0,d)}function U(){C=this.checked,t(5,C)}function Y(){g=this.checked,t(2,g)}const X=()=>E(),W=()=>N();function K(le){te[le?"unshift":"push"](()=>{c=le,t(11,c)})}return n.$$.update=()=>{n.$$.dirty[0]&33&&typeof d<"u"&&C!==null&&M(),n.$$.dirty[0]&3&&t(6,i=!!d&&h.length&&h.leng
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=D(),i=b("form"),B(l.$$.fragment),p(e,"class","alert alert-info"),p(i,"id",n[4]),p(i,"autocomplete","off")},m(a,f){S(a,e,f),S(a,t,f),S(a,i,f),z(l,i,null),s=!0,o||(r=Z(i,"submit",Ue(n[5])),o=!0)},p(a,f){const u={};f&98308&&(u.$$scope={dirty:f,ctx:a}),l.$set(u)},i(a){s||(I(l.$$.fragment,a),s=!0)},o(a){L(l.$$.fragment,a),s=!1},d(a){a&&(w(e),w(t),w(i)),V(l),o=!1,r()}}}function i7(n){let e;return{c(){e=b("h4"),e.textContent="Initialize new backup",p(e,"class","center txt-break")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function l7(n){let e,t,i,l,s,o,r;return{c(){e=b("button"),t=b("span"),t.textContent="Cancel",i=D(),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,f){S(a,e,f),y(e,t),S(a,i,f),S(a,l,f),y(l,s),o||(r=Z(e,"click",n[0]),o=!0)},p(a,f){f&8&&(e.disabled=a[3]),f&8&&(l.disabled=a[3]),f&8&&ee(l,"btn-loading",a[3])},d(a){a&&(w(e),w(i),w(l)),o=!1,r()}}}function s7(n){let e,t,i={class:"backup-create-panel",beforeOpen:n[8],beforeHide:n[9],popup:!0,$$slots:{footer:[l7],header:[i7],default:[n7]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[10](e),e.$on("show",n[11]),e.$on("hide",n[12]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&8&&(o.beforeOpen=l[8]),s&8&&(o.beforeHide=l[9]),s&65548&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[10](null),V(e,l)}}}function o7(n,e,t){const i=st(),l="backup_create_"+H.randomString(5);let s,o="",r=!1,a;function f($){Gt({}),t(3,r=!1),t(2,o=$||""),s==null||s.show()}function u(){return s==null?void 0:s.hide()}async function c(){if(!r){t(3,r=!0),clearTimeout(a),a=setTimeout(()=>{u()},1500);try{await fe.backups.create(o,{$cancelKey:l}),t(3,r=!1),u(),i("submit"),Nt("Successfully generated new backup.")}catch($){$.isAbort||fe.error($)}clearTimeout(a),t(3,r=!1)}}ys(()=>{clearTimeout(a)});function d(){o=this.value,t(2,o)}const m=()=>r?(To("A backup has already been started, please wait."),!1):!0,h=()=>(r&&To("The backup was started but may take a while to complete. You can come back later.",4500),!0);function _($){te[$?"unshift":"push"](()=>{s=$,t(1,s)})}function g($){Oe.call(this,n,$)}function v($){Oe.call(this,n,$)}return[u,s,o,r,l,c,f,d,m,h,_,g,v]}class r7 extends be{constructor(e){super(),ge(this,e,o7,s7,he,{show:6,hide:0})}get show(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[0]}}function a7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Backup name"),l=D(),s=b("input"),p(e,"for",i=n[15]),p(s,"type","text"),p(s,"id",o=n[15]),s.required=!0},m(f,u){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[2]),r||(a=Z(s,"input",n[9]),r=!0)},p(f,u){u&32768&&i!==(i=f[15])&&p(e,"for",i),u&32768&&o!==(o=f[15])&&p(s,"id",o),u&4&&s.value!==f[2]&&ae(s,f[2])},d(f){f&&(w(e),w(l),w(s)),r=!1,a()}}}function f7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g;return f=new ol({props:{value:n[1]}}),m=new de({props:{class:"form-field required m-0",name:"name",$$slots:{default:[a7,({uniqueId:v})=>({15:v}),({uniqueId:v})=>v?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 and use it only with trusted backups!</p> <p>Backup restore is experimental and works only on UNIX based systems.</p> <p>The restore operation will attempt to replace your existing <code>pb_data</code> with the one from
the backup and will restart the application process.</p> <p>This means that on success all of your data (including app settings, users, admins, etc.) will
be replaced with the ones from the backup.</p> <p>Nothing will happen if the backup is invalid or incompatible (ex. missing
<code>data.db</code> file).</p></div>`,t=D(),i=b("div"),l=J(`Type the backup name
`),s=b("div"),o=b("span"),r=J(n[1]),a=D(),B(f.$$.fragment),u=J(`
to confirm:`),c=D(),d=b("form"),B(m.$$.fragment),p(e,"class","alert alert-danger"),p(o,"class","txt"),p(s,"class","label"),p(i,"class","content m-b-xs"),p(d,"id",n[6]),p(d,"autocomplete","off")},m(v,$){S(v,e,$),S(v,t,$),S(v,i,$),y(i,l),y(i,s),y(s,o),y(o,r),y(s,a),z(f,s,null),y(i,u),S(v,c,$),S(v,d,$),z(m,d,null),h=!0,_||(g=Z(d,"submit",Ue(n[7])),_=!0)},p(v,$){(!h||$&2)&&re(r,v[1]);const C={};$&2&&(C.value=v[1]),f.$set(C);const T={};$&98308&&(T.$$scope={dirty:$,ctx:v}),m.$set(T)},i(v){h||(I(f.$$.fragment,v),I(m.$$.fragment,v),h=!0)},o(v){L(f.$$.fragment,v),L(m.$$.fragment,v),h=!1},d(v){v&&(w(e),w(t),w(i),w(c),w(d)),V(f),V(m),_=!1,g()}}}function u7(n){let e,t,i,l;return{c(){e=b("h4"),t=J("Restore "),i=b("strong"),l=J(n[1]),p(e,"class","popup-title txt-ellipsis svelte-1fcgldh")},m(s,o){S(s,e,o),y(e,t),y(e,i),y(i,l)},p(s,o){o&2&&re(l,s[1])},d(s){s&&w(e)}}}function c7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("button"),t=J("Cancel"),i=D(),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(f,u){S(f,e,u),y(e,t),S(f,i,u),S(f,l,u),y(l,s),r||(a=Z(e,"click",n[0]),r=!0)},p(f,u){u&16&&(e.disabled=f[4]),u&48&&o!==(o=!f[5]||f[4])&&(l.disabled=o),u&16&&ee(l,"btn-loading",f[4])},d(f){f&&(w(e),w(i),w(l)),r=!1,a()}}}function d7(n){let e,t,i={class:"backup-restore-panel",overlayClose:!n[4],escClose:!n[4],beforeHide:n[10],popup:!0,$$slots:{footer:[c7],header:[u7],default:[f7]},$$scope:{ctx:n}};return e=new Xt({props:i}),n[11](e),e.$on("show",n[12]),e.$on("hide",n[13]),{c(){B(e.$$.fragment)},m(l,s){z(e,l,s),t=!0},p(l,[s]){const o={};s&16&&(o.overlayClose=!l[4]),s&16&&(o.escClose=!l[4]),s&16&&(o.beforeHide=l[10]),s&65590&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){t||(I(e.$$.fragment,l),t=!0)},o(l){L(e.$$.fragment,l),t=!1},d(l){n[11](null),V(e,l)}}}function p7(n,e,t){let i;const l="backup_restore_"+H.randomString(5);let s,o="",r="",a=!1,f=null;function u($){Gt({}),t(2,r=""),t(1,o=$),t(4,a=!1),s==null||s.show()}function c(){return s==null?void 0:s.hide()}async function d(){var $;if(!(!i||a)){clearTimeout(f),t(4,a=!0);try{await fe.backups.restore(o),f=setTimeout(()=>{window.location.reload()},2e3)}catch(C){clearTimeout(f),C!=null&&C.isAbort||(t(4,a=!1),li((($=C.response)==null?void 0:$.message)||C.message))}}}ys(()=>{clearTimeout(f)});function m(){r=this.value,t(2,r)}const h=()=>!a;function _($){te[$?"unshift":"push"](()=>{s=$,t(3,s)})}function g($){Oe.call(this,n,$)}function v($){Oe.call(this,n,$)}return n.$$.update=()=>{n.$$.dirty&6&&t(5,i=r!=""&&o==r)},[c,o,r,s,a,i,l,d,u,m,h,_,g,v]}class m7 extends be{constructor(e){super(),ge(this,e,p7,d7,he,{show:8,hide:0})}get show(){return this.$$.ctx[8]}get hide(){return this.$$.ctx[0]}}function dg(n,e,t){const i=n.slice();return i[22]=e[t],i}function pg(n,e,t){const i=n.slice();return i[19]=e[t],i}function h7(n){let e=[],t=new Map,i,l,s=ce(n[3]);const o=a=>a[22].key;for(let a=0;a<s.length;a+=1){let f=dg(n,s,a),u=o(f);t.set(u,e[a]=hg(u,f))}let r=null;return s.length||(r=mg()),{c(){for(let a=0;a<e.length;a+=1)e[a].c();i=ve(),r&&r.c()},m(a,f){for(let u=0;u<e.length;u+=1)e[u]&&e[u].m(a,f);S(a,i,f),r&&r.m(a,f),l=!0},p(a,f){f&876&&(s=ce(a[3]),se(),e=ft(e,f,o,1,a,s,t,i.parentNode,It,hg,i,dg),oe(),!s.length&&r?r.p(a,f):s.length?r&&(r.d(1),r=null):(r=mg(),r.c(),r.m(i.parentNode,i)))},i(a){if(!l){for(let f=0;f<s.length;f+=1)I(e[f]);l=!0}},o(a){for(let f=0;f<e.length;f+=1)L(e[f]);l=!1},d(a){a&&w(i);for(let f=0;f<e.length;f+=1)e[f].d(a);r&&r.d(a)}}}function _7(n){let e,t=ce(Array(n[3].length||1)),i=[];for(let l=0;l<t.length;l+=1)i[l]=_g(pg(n,t,l));return{c(){for(let l=0;l<i.length;l+=1)i[l].c();e=ve()},m(l,s){for(let o=0;o<i.length;o+=1)i[o]&&i[o].m(l,s);S(l,e,s)},p(l,s){if(s&8){t=ce(Array(l[3].length||1));let o;for(o=0;o<t.length;o+=1){const r=pg(l,t,o);i[o]?i[o].p(r,s):(i[o]=_g(),i[o].c(),i[o].m(e.parentNode,e))}for(;o<i.length;o+=1)i[o].d(1);i.length=t.length}},i:x,o:x,d(l){l&&w(e),rt(i,l)}}
`),T=b("span"),T.textContent="macros",O=J(`.
`),M=b("br"),E=J(`
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=!((P=(R=n[0])==null?void 0:R.backups)!=null&&P.cron),p(c,"class","txt"),p(m,"class","ri-arrow-drop-down-fill"),p(u,"type","button"),p(u,"class","btn btn-sm btn-outline p-r-0"),p(f,"class","form-field-addon"),p(T,"class","link-primary"),p(v,"class","help-block")},m(R,P){var F,j;S(R,e,P),y(e,t),S(R,l,P),S(R,s,P),ae(s,n[1].backups.cron),S(R,a,P),S(R,f,P),y(f,u),y(u,c),y(u,d),y(u,m),y(u,h),z(_,u,null),S(R,g,P),S(R,v,P),y(v,$),y($,C),y($,T),y($,O),y($,M),y($,E),A=!0,(j=(F=n[0])==null?void 0:F.backups)!=null&&j.cron||s.focus(),N||(q=[Z(s,"input",n[18]),$e(Fe.call(null,T,`@yearly
@annually
@monthly
@weekly
@daily
@midnight
@hourly`))],N=!0)},p(R,P){var j,U;(!A||P[1]&1&&i!==(i=R[31]))&&p(e,"for",i),(!A||P[1]&1&&o!==(o=R[31]))&&p(s,"id",o),(!A||P[0]&1&&r!==(r=!((U=(j=R[0])==null?void 0:j.backups)!=null&&U.cron)))&&(s.autofocus=r),P[0]&2&&s.value!==R[1].backups.cron&&ae(s,R[1].backups.cron);const F={};P[0]&2|P[1]&2&&(F.$$scope={dirty:P,ctx:R}),_.$set(F)},i(R){A||(I(_.$$.fragment,R),A=!0)},o(R){L(_.$$.fragment,R),A=!1},d(R){R&&(w(e),w(l),w(s),w(a),w(f),w(g),w(v)),V(_),N=!1,Te(q)}}}function E7(n){let e,t,i,l,s,o,r,a;return{c(){e=b("label"),t=J("Max @auto backups to keep"),l=D(),s=b("input"),p(e,"for",i=n[31]),p(s,"type","number"),p(s,"id",o=n[31]),p(s,"min","1")},m(f,u){S(f,e,u),y(e,t),S(f,l,u),S(f,s,u),ae(s,n[1].backups.cronMaxKeep),r||(a=Z(s,"input",n[23]),r=!0)},p(f,u){u[1]&1&&i!==(i=f[31])&&p(e,"for",i),u[1]&1&&o!==(o=f[31])&&p(s,"id",o),u[0]&2&&lt(s.value)!==f[1].backups.cronMaxKeep&&ae(s,f[1].backups.cronMaxKeep)},d(f){f&&(w(e),w(l),w(s)),r=!1,a()}}}function yg(n){let e;function t(s,o){return s[7]?L7:s[8]?A7:I7}let i=t(n),l=i(n);return{c(){l.c(),e=ve()},m(s,o){l.m(s,o),S(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&&w(e),l.d(s)}}}function I7(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){S(t,e,i)},p:x,d(t){t&&w(e)}}}function A7(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;S(s,e,o),i||(l=$e(t=Fe.call(null,e,(r=n[8].data)==null?void 0:r.message)),i=!0)},p(s,o){var r;t&&Ot(t.update)&&o[0]&256&&t.update.call(null,(r=s[8].data)==null?void 0:r.message)},d(s){s&&w(e),i=!1,l()}}}function L7(n){let e;return{c(){e=b("span"),p(e,"class","loader loader-sm")},m(t,i){S(t,e,i)},p:x,d(t){t&&w(e)}}}function vg(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){S(o,e,r),y(e,t),l||(s=Z(e,"click",n[27]),l=!0)},p(o,r){r[0]&544&&i!==(i=!o[9]||o[5])&&(e.disabled=i)},d(o){o&&w(e),l=!1,s()}}}function N7(n){let e,t,i,l,s,o,r,a,f,u,c,d,m,h,_,g,v,$,C,T,O,M,E,A,N,q,R;m=new Go({props:{class:"btn-sm",tooltip:"Refresh"}}),m.$on("refresh",n[13]),_=new $7({props:{class:"btn-sm"}}),_.$on("success",n[13]);let P={};v=new v7({props:P}),n[15](v);function F(X,W){return X[6]?C7:T7}let j=F(n),U=j(n),Y=n[6]&&!n[4]&&bg(n);return{c(){e=b("header"),t=b("nav"),i=b("div"),i.textContent="Settings",l=D(),s=b("div"),o=J(n[10]),r=D(),a=b("div"),f=b("div"),u=b("div"),c=b("span"),c.textContent="Backup and restore your PocketBase data",d=D(),B(m.$$.fragment),h=D(),B(_.$$.fragment),g=D(),B(v.$$.fragment),$=D(),C=b("hr"),T=D(),O=b("button"),M=b("span"),M.textContent="Backups options",E=D(),U.c(),A=D(),Y&&Y.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(u,"class","flex m-b-sm flex-gap-10"),p(M,"class","txt"),p(O,"type","button"),p(O,"class","btn btn-secondary"),O.disabled=n[4],ee(O,"btn-loading",n[4]),p(f,"class","panel"),p(f,"autocomplete","off"),p(a,"class","wrapper")},m(X,W){S(X,e,W),y(e,t),y(t,i),y(t,l),y(t,s),y(s,o),S(X,r,W),S(X,a,W),y(a,f),y(f,u),y(u,c),y(u,d),z(m,u,null),y(u,h),z(_,u,null),y(f,g),z(v,f,null),y(f,$),y(f,C),y(f,T),y(f,O),y(O,M),y(O,E),U.m(O,null),y(f,A),Y&&Y.m(f,null),N=!0,q||(R=[Z(O,"click",n[16]),Z(f,"submit",Ue(n[11]))],q=!0)},p(X,W){(!N||W[0]&1024)&&re(o,X[10]);const K={};v.$set(K),j!==(j=F(X))&&(U.d(1),U=j(X),U&&(U.c(),U.m(O,null))),(!N||W[0]&16)&&(O.disabled=X[4]),(!N||W[0]&16)&&ee(O,"btn-loading",X[4]),X[6]&&!X[4]?Y?(Y.p(X,W),W[0]&80&&I(Y,1)):(Y=bg(X),Y.c(),I(Y,1),Y.m(f,null)):Y&&(se(),L(Y,1,1,()=>{Y=null}),oe())},i(X){N||(I(m.$$.fragment,X),I(_.$$.fragment,X),I(v.$$.fragment,X),I(Y),N=!0)},o(X){L(m.$$.fragment,X),L(_.$$.fragment,X),