13 lines
777 KiB
JavaScript
13 lines
777 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./editor-CF0xxeFK.js","./index-Vcq4gwWv.js"])))=>i.map(i=>d[i]);
|
||
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const l of r)if(l.type==="childList")for(const o of l.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function a(r){const l={};return r.integrity&&(l.integrity=r.integrity),r.referrerPolicy&&(l.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?l.credentials="include":r.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function n(r){if(r.ep)return;r.ep=!0;const l=a(r);fetch(r.href,l)}})();function tf(e){const t=Object.create(null);for(const a of e.split(","))t[a]=1;return a=>a in t}const Ct={},Bl=[],fn=()=>{},ny=()=>!1,nu=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ru=e=>e.startsWith("onUpdate:"),zt=Object.assign,af=(e,t)=>{const a=e.indexOf(t);a>-1&&e.splice(a,1)},q_=Object.prototype.hasOwnProperty,xt=(e,t)=>q_.call(e,t),Ze=Array.isArray,Fl=e=>ks(e)==="[object Map]",lu=e=>ks(e)==="[object Set]",Gp=e=>ks(e)==="[object Date]",rt=e=>typeof e=="function",Tt=e=>typeof e=="string",Ca=e=>typeof e=="symbol",bt=e=>e!==null&&typeof e=="object",ry=e=>(bt(e)||rt(e))&&rt(e.then)&&rt(e.catch),ly=Object.prototype.toString,ks=e=>ly.call(e),L_=e=>ks(e).slice(8,-1),oy=e=>ks(e)==="[object Object]",ou=e=>Tt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,zo=tf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),su=e=>{const t=Object.create(null);return(a=>t[a]||(t[a]=e(a)))},N_=/-\w/g,Xt=su(e=>e.replace(N_,t=>t.slice(1).toUpperCase())),B_=/\B([A-Z])/g,Pr=su(e=>e.replace(B_,"-$1").toLowerCase()),iu=su(e=>e.charAt(0).toUpperCase()+e.slice(1)),jo=su(e=>e?`on${iu(e)}`:""),on=(e,t)=>!Object.is(e,t),pi=(e,...t)=>{for(let a=0;a<e.length;a++)e[a](...t)},sy=(e,t,a,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:a})},nf=e=>{const t=parseFloat(e);return isNaN(t)?e:t},F_=e=>{const t=Tt(e)?Number(e):NaN;return isNaN(t)?e:t};let Yp;const uu=()=>Yp||(Yp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ua(e){if(Ze(e)){const t={};for(let a=0;a<e.length;a++){const n=e[a],r=Tt(n)?U_(n):ua(n);if(r)for(const l in r)t[l]=r[l]}return t}else if(Tt(e)||bt(e))return e}const V_=/;(?![^(]*\))/g,z_=/:([^]+)/,j_=/\/\*[^]*?\*\//g;function U_(e){const t={};return e.replace(j_,"").split(V_).forEach(a=>{if(a){const n=a.split(z_);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function me(e){let t="";if(Tt(e))t=e;else if(Ze(e))for(let a=0;a<e.length;a++){const n=me(e[a]);n&&(t+=n+" ")}else if(bt(e))for(const a in e)e[a]&&(t+=a+" ");return t.trim()}function it(e){if(!e)return null;let{class:t,style:a}=e;return t&&!Tt(t)&&(e.class=me(t)),a&&(e.style=ua(a)),e}const H_="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",K_=tf(H_);function iy(e){return!!e||e===""}function W_(e,t){if(e.length!==t.length)return!1;let a=!0;for(let n=0;a&&n<e.length;n++)a=ws(e[n],t[n]);return a}function ws(e,t){if(e===t)return!0;let a=Gp(e),n=Gp(t);if(a||n)return a&&n?e.getTime()===t.getTime():!1;if(a=Ca(e),n=Ca(t),a||n)return e===t;if(a=Ze(e),n=Ze(t),a||n)return a&&n?W_(e,t):!1;if(a=bt(e),n=bt(t),a||n){if(!a||!n)return!1;const r=Object.keys(e).length,l=Object.keys(t).length;if(r!==l)return!1;for(const o in e){const i=e.hasOwnProperty(o),u=t.hasOwnProperty(o);if(i&&!u||!i&&u||!ws(e[o],t[o]))return!1}}return String(e)===String(t)}function uy(e,t){return e.findIndex(a=>ws(a,t))}const cy=e=>!!(e&&e.__v_isRef===!0),w=e=>Tt(e)?e:e==null?"":Ze(e)||bt(e)&&(e.toString===ly||!rt(e.toString))?cy(e)?w(e.value):JSON.stringify(e,dy,2):String(e),dy=(e,t)=>cy(t)?dy(e,t.value):Fl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((a,[n,r],l)=>(a[ac(n,l)+" =>"]=r,a),{})}:lu(t)?{[`Set(${t.size})`]:[...t.values()].map(a=>ac(a))}:Ca(t)?ac(t):bt(t)&&!Ze(t)&&!oy(t)?String(t):t,ac=(e,t="")=>{var a;return Ca(e)?`Symbol(${(a=e.description)!=null?a:t})`:e};let Ut;class fy{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&Ut&&(Ut.active?(this.parent=Ut,this.index=(Ut.scopes||(Ut.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,a;if(this.scopes)for(t=0,a=this.scopes.length;t<a;t++)this.scopes[t].pause();for(t=0,a=this.effects.length;t<a;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,a;if(this.scopes)for(t=0,a=this.scopes.length;t<a;t++)this.scopes[t].resume();for(t=0,a=this.effects.length;t<a;t++)this.effects[t].resume()}}run(t){if(this._active){const a=Ut;try{return Ut=this,t()}finally{Ut=a}}}on(){++this._on===1&&(this.prevScope=Ut,Ut=this)}off(){if(this._on>0&&--this._on===0){if(Ut===this)Ut=this.prevScope;else{let t=Ut;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let a,n;for(a=0,n=this.effects.length;a<n;a++)this.effects[a].stop();for(this.effects.length=0,a=0,n=this.cleanups.length;a<n;a++)this.cleanups[a]();if(this.cleanups.length=0,this.scopes){for(a=0,n=this.scopes.length;a<n;a++)this.scopes[a].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function py(e){return new fy(e)}function rf(){return Ut}function my(e,t=!1){Ut&&Ut.cleanups.push(e)}let Et;const nc=new WeakSet;class vy{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ut&&(Ut.active?Ut.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,nc.has(this)&&(nc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||yy(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Jp(this),gy(this);const t=Et,a=za;Et=this,za=!0;try{return this.fn()}finally{by(this),Et=t,za=a,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)sf(t);this.deps=this.depsTail=void 0,Jp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?nc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ld(this)&&this.run()}get dirty(){return ld(this)}}let hy=0,Uo,Ho;function yy(e,t=!1){if(e.flags|=8,t){e.next=Ho,Ho=e;return}e.next=Uo,Uo=e}function lf(){hy++}function of(){if(--hy>0)return;if(Ho){let t=Ho;for(Ho=void 0;t;){const a=t.next;t.next=void 0,t.flags&=-9,t=a}}let e;for(;Uo;){let t=Uo;for(Uo=void 0;t;){const a=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=a}}if(e)throw e}function gy(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function by(e){let t,a=e.depsTail,n=a;for(;n;){const r=n.prevDep;n.version===-1?(n===a&&(a=r),sf(n),G_(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=r}e.deps=t,e.depsTail=a}function ld(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_y(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _y(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===as)||(e.globalVersion=as,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ld(e))))return;e.flags|=2;const t=e.dep,a=Et,n=za;Et=e,za=!0;try{gy(e);const r=e.fn(e._value);(t.version===0||on(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Et=a,za=n,by(e),e.flags&=-3}}function sf(e,t=!1){const{dep:a,prevSub:n,nextSub:r}=e;if(n&&(n.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=n,e.nextSub=void 0),a.subs===e&&(a.subs=n,!n&&a.computed)){a.computed.flags&=-5;for(let l=a.computed.deps;l;l=l.nextDep)sf(l,!0)}!t&&!--a.sc&&a.map&&a.map.delete(a.key)}function G_(e){const{prevDep:t,nextDep:a}=e;t&&(t.nextDep=a,e.prevDep=void 0),a&&(a.prevDep=t,e.nextDep=void 0)}let za=!0;const xy=[];function Bn(){xy.push(za),za=!1}function Fn(){const e=xy.pop();za=e===void 0?!0:e}function Jp(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const a=Et;Et=void 0;try{t()}finally{Et=a}}}let as=0,Y_=class{constructor(t,a){this.sub=t,this.dep=a,this.version=a.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}};class cu{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Et||!za||Et===this.computed)return;let a=this.activeLink;if(a===void 0||a.sub!==Et)a=this.activeLink=new Y_(Et,this),Et.deps?(a.prevDep=Et.depsTail,Et.depsTail.nextDep=a,Et.depsTail=a):Et.deps=Et.depsTail=a,ky(a);else if(a.version===-1&&(a.version=this.version,a.nextDep)){const n=a.nextDep;n.prevDep=a.prevDep,a.prevDep&&(a.prevDep.nextDep=n),a.prevDep=Et.depsTail,a.nextDep=void 0,Et.depsTail.nextDep=a,Et.depsTail=a,Et.deps===a&&(Et.deps=n)}return a}trigger(t){this.version++,as++,this.notify(t)}notify(t){lf();try{for(let a=this.subs;a;a=a.prevSub)a.sub.notify()&&a.sub.dep.notify()}finally{of()}}}function ky(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)ky(n)}const a=e.dep.subs;a!==e&&(e.prevSub=a,a&&(a.nextSub=e)),e.dep.subs=e}}const ki=new WeakMap,rl=Symbol(""),od=Symbol(""),ns=Symbol("");function aa(e,t,a){if(za&&Et){let n=ki.get(e);n||ki.set(e,n=new Map);let r=n.get(a);r||(n.set(a,r=new cu),r.map=n,r.key=a),r.track()}}function Tn(e,t,a,n,r,l){const o=ki.get(e);if(!o){as++;return}const i=u=>{u&&u.trigger()};if(lf(),t==="clear")o.forEach(i);else{const u=Ze(e),d=u&&ou(a);if(u&&a==="length"){const c=Number(n);o.forEach((f,v)=>{(v==="length"||v===ns||!Ca(v)&&v>=c)&&i(f)})}else switch((a!==void 0||o.has(void 0))&&i(o.get(a)),d&&i(o.get(ns)),t){case"add":u?d&&i(o.get("length")):(i(o.get(rl)),Fl(e)&&i(o.get(od)));break;case"delete":u||(i(o.get(rl)),Fl(e)&&i(o.get(od)));break;case"set":Fl(e)&&i(o.get(rl));break}}of()}function J_(e,t){const a=ki.get(e);return a&&a.get(t)}function kl(e){const t=vt(e);return t===e?t:(aa(t,"iterate",ns),Sa(e)?t:t.map(Ha))}function du(e){return aa(e=vt(e),"iterate",ns),e}function rn(e,t){return Vn(e)?Zl(ll(e)?Ha(t):t):Ha(t)}const Z_={__proto__:null,[Symbol.iterator](){return rc(this,Symbol.iterator,e=>rn(this,e))},concat(...e){return kl(this).concat(...e.map(t=>Ze(t)?kl(t):t))},entries(){return rc(this,"entries",e=>(e[1]=rn(this,e[1]),e))},every(e,t){return Sn(this,"every",e,t,void 0,arguments)},filter(e,t){return Sn(this,"filter",e,t,a=>a.map(n=>rn(this,n)),arguments)},find(e,t){return Sn(this,"find",e,t,a=>rn(this,a),arguments)},findIndex(e,t){return Sn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Sn(this,"findLast",e,t,a=>rn(this,a),arguments)},findLastIndex(e,t){return Sn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Sn(this,"forEach",e,t,void 0,arguments)},includes(...e){return lc(this,"includes",e)},indexOf(...e){return lc(this,"indexOf",e)},join(e){return kl(this).join(e)},lastIndexOf(...e){return lc(this,"lastIndexOf",e)},map(e,t){return Sn(this,"map",e,t,void 0,arguments)},pop(){return _o(this,"pop")},push(...e){return _o(this,"push",e)},reduce(e,...t){return Zp(this,"reduce",e,t)},reduceRight(e,...t){return Zp(this,"reduceRight",e,t)},shift(){return _o(this,"shift")},some(e,t){return Sn(this,"some",e,t,void 0,arguments)},splice(...e){return _o(this,"splice",e)},toReversed(){return kl(this).toReversed()},toSorted(e){return kl(this).toSorted(e)},toSpliced(...e){return kl(this).toSpliced(...e)},unshift(...e){return _o(this,"unshift",e)},values(){return rc(this,"values",e=>rn(this,e))}};function rc(e,t,a){const n=du(e),r=n[t]();return n!==e&&!Sa(e)&&(r._next=r.next,r.next=()=>{const l=r._next();return l.done||(l.value=a(l.value)),l}),r}const X_=Array.prototype;function Sn(e,t,a,n,r,l){const o=du(e),i=o!==e&&!Sa(e),u=o[t];if(u!==X_[t]){const f=u.apply(e,l);return i?Ha(f):f}let d=a;o!==e&&(i?d=function(f,v){return a.call(this,rn(e,f),v,e)}:a.length>2&&(d=function(f,v){return a.call(this,f,v,e)}));const c=u.call(o,d,n);return i&&r?r(c):c}function Zp(e,t,a,n){const r=du(e),l=r!==e&&!Sa(e);let o=a,i=!1;r!==e&&(l?(i=n.length===0,o=function(d,c,f){return i&&(i=!1,d=rn(e,d)),a.call(this,d,rn(e,c),f,e)}):a.length>3&&(o=function(d,c,f){return a.call(this,d,c,f,e)}));const u=r[t](o,...n);return i?rn(e,u):u}function lc(e,t,a){const n=vt(e);aa(n,"iterate",ns);const r=n[t](...a);return(r===-1||r===!1)&&mu(a[0])?(a[0]=vt(a[0]),n[t](...a)):r}function _o(e,t,a=[]){Bn(),lf();const n=vt(e)[t].apply(e,a);return of(),Fn(),n}const Q_=tf("__proto__,__v_isRef,__isVue"),wy=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ca));function ex(e){Ca(e)||(e=String(e));const t=vt(this);return aa(t,"has",e),t.hasOwnProperty(e)}class $y{constructor(t=!1,a=!1){this._isReadonly=t,this._isShallow=a}get(t,a,n){if(a==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(a==="__v_isReactive")return!r;if(a==="__v_isReadonly")return r;if(a==="__v_isShallow")return l;if(a==="__v_raw")return n===(r?l?Oy:Ty:l?Ay:Ey).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const o=Ze(t);if(!r){let u;if(o&&(u=Z_[a]))return u;if(a==="hasOwnProperty")return ex}const i=Reflect.get(t,a,wt(t)?t:n);if((Ca(a)?wy.has(a):Q_(a))||(r||aa(t,"get",a),l))return i;if(wt(i)){const u=o&&ou(a)?i:i.value;return r&&bt(u)?At(u):u}return bt(i)?r?At(i):Ua(i):i}}class Sy extends $y{constructor(t=!1){super(!1,t)}set(t,a,n,r){let l=t[a];const o=Ze(t)&&ou(a);if(!this._isShallow){const d=Vn(l);if(!Sa(n)&&!Vn(n)&&(l=vt(l),n=vt(n)),!o&&wt(l)&&!wt(n))return d||(l.value=n),!0}const i=o?Number(a)<t.length:xt(t,a),u=Reflect.set(t,a,n,wt(t)?t:r);return t===vt(r)&&(i?on(n,l)&&Tn(t,"set",a,n):Tn(t,"add",a,n)),u}deleteProperty(t,a){const n=xt(t,a);t[a];const r=Reflect.deleteProperty(t,a);return r&&n&&Tn(t,"delete",a,void 0),r}has(t,a){const n=Reflect.has(t,a);return(!Ca(a)||!wy.has(a))&&aa(t,"has",a),n}ownKeys(t){return aa(t,"iterate",Ze(t)?"length":rl),Reflect.ownKeys(t)}}class Cy extends $y{constructor(t=!1){super(!0,t)}set(t,a){return!0}deleteProperty(t,a){return!0}}const tx=new Sy,ax=new Cy,nx=new Sy(!0),rx=new Cy(!0),sd=e=>e,zs=e=>Reflect.getPrototypeOf(e);function lx(e,t,a){return function(...n){const r=this.__v_raw,l=vt(r),o=Fl(l),i=e==="entries"||e===Symbol.iterator&&o,u=e==="keys"&&o,d=r[e](...n),c=a?sd:t?Zl:Ha;return!t&&aa(l,"iterate",u?od:rl),zt(Object.create(d),{next(){const{value:f,done:v}=d.next();return v?{value:f,done:v}:{value:i?[c(f[0]),c(f[1])]:c(f),done:v}}})}}function js(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ox(e,t){const a={get(r){const l=this.__v_raw,o=vt(l),i=vt(r);e||(on(r,i)&&aa(o,"get",r),aa(o,"get",i));const{has:u}=zs(o),d=t?sd:e?Zl:Ha;if(u.call(o,r))return d(l.get(r));if(u.call(o,i))return d(l.get(i));l!==o&&l.get(r)},get size(){const r=this.__v_raw;return!e&&aa(vt(r),"iterate",rl),r.size},has(r){const l=this.__v_raw,o=vt(l),i=vt(r);return e||(on(r,i)&&aa(o,"has",r),aa(o,"has",i)),r===i?l.has(r):l.has(r)||l.has(i)},forEach(r,l){const o=this,i=o.__v_raw,u=vt(i),d=t?sd:e?Zl:Ha;return!e&&aa(u,"iterate",rl),i.forEach((c,f)=>r.call(l,d(c),d(f),o))}};return zt(a,e?{add:js("add"),set:js("set"),delete:js("delete"),clear:js("clear")}:{add(r){const l=vt(this),o=zs(l),i=vt(r),u=!t&&!Sa(r)&&!Vn(r)?i:r;return o.has.call(l,u)||on(r,u)&&o.has.call(l,r)||on(i,u)&&o.has.call(l,i)||(l.add(u),Tn(l,"add",u,u)),this},set(r,l){!t&&!Sa(l)&&!Vn(l)&&(l=vt(l));const o=vt(this),{has:i,get:u}=zs(o);let d=i.call(o,r);d||(r=vt(r),d=i.call(o,r));const c=u.call(o,r);return o.set(r,l),d?on(l,c)&&Tn(o,"set",r,l):Tn(o,"add",r,l),this},delete(r){const l=vt(this),{has:o,get:i}=zs(l);let u=o.call(l,r);u||(r=vt(r),u=o.call(l,r)),i&&i.call(l,r);const d=l.delete(r);return u&&Tn(l,"delete",r,void 0),d},clear(){const r=vt(this),l=r.size!==0,o=r.clear();return l&&Tn(r,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(r=>{a[r]=lx(r,e,t)}),a}function fu(e,t){const a=ox(e,t);return(n,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_raw"?n:Reflect.get(xt(a,r)&&r in n?a:n,r,l)}const sx={get:fu(!1,!1)},ix={get:fu(!1,!0)},ux={get:fu(!0,!1)},cx={get:fu(!0,!0)},Ey=new WeakMap,Ay=new WeakMap,Ty=new WeakMap,Oy=new WeakMap;function dx(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Ua(e){return Vn(e)?e:pu(e,!1,tx,sx,Ey)}function Dy(e){return pu(e,!1,nx,ix,Ay)}function At(e){return pu(e,!0,ax,ux,Ty)}function wl(e){return pu(e,!0,rx,cx,Oy)}function pu(e,t,a,n,r){if(!bt(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const l=r.get(e);if(l)return l;const o=dx(L_(e));if(o===0)return e;const i=new Proxy(e,o===2?n:a);return r.set(e,i),i}function ll(e){return Vn(e)?ll(e.__v_raw):!!(e&&e.__v_isReactive)}function Vn(e){return!!(e&&e.__v_isReadonly)}function Sa(e){return!!(e&&e.__v_isShallow)}function mu(e){return e?!!e.__v_raw:!1}function vt(e){const t=e&&e.__v_raw;return t?vt(t):e}function wi(e){return!xt(e,"__v_skip")&&Object.isExtensible(e)&&sy(e,"__v_skip",!0),e}const Ha=e=>bt(e)?Ua(e):e,Zl=e=>bt(e)?At(e):e;function wt(e){return e?e.__v_isRef===!0:!1}function A(e){return My(e,!1)}function cl(e){return My(e,!0)}function My(e,t){return wt(e)?e:new fx(e,t)}class fx{constructor(t,a){this.dep=new cu,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=a?t:vt(t),this._value=a?t:Ha(t),this.__v_isShallow=a}get value(){return this.dep.track(),this._value}set value(t){const a=this._rawValue,n=this.__v_isShallow||Sa(t)||Vn(t);t=n?t:vt(t),on(t,a)&&(this._rawValue=t,this._value=n?t:Ha(t),this.dep.trigger())}}function px(e){e.dep&&e.dep.trigger()}function s(e){return wt(e)?e.value:e}function ca(e){return rt(e)?e():s(e)}const mx={get:(e,t,a)=>t==="__v_raw"?e:s(Reflect.get(e,t,a)),set:(e,t,a,n)=>{const r=e[t];return wt(r)&&!wt(a)?(r.value=a,!0):Reflect.set(e,t,a,n)}};function Py(e){return ll(e)?e:new Proxy(e,mx)}class vx{constructor(t){this.__v_isRef=!0,this._value=void 0;const a=this.dep=new cu,{get:n,set:r}=t(a.track.bind(a),a.trigger.bind(a));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(t){this._set(t)}}function hx(e){return new vx(e)}function Kt(e){const t=Ze(e)?new Array(e.length):{};for(const a in e)t[a]=Ry(e,a);return t}class yx{constructor(t,a,n){this._object=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=Ca(a)?a:String(a),this._raw=vt(t);let r=!0,l=t;if(!Ze(t)||Ca(this._key)||!ou(this._key))do r=!mu(l)||Sa(l);while(r&&(l=l.__v_raw));this._shallow=r}get value(){let t=this._object[this._key];return this._shallow&&(t=s(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&wt(this._raw[this._key])){const a=this._object[this._key];if(wt(a)){a.value=t;return}}this._object[this._key]=t}get dep(){return J_(this._raw,this._key)}}class gx{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function bx(e,t,a){return wt(e)?e:rt(e)?new gx(e):bt(e)&&arguments.length>1?Ry(e,t,a):A(e)}function Ry(e,t,a){return new yx(e,t,a)}class _x{constructor(t,a,n){this.fn=t,this.setter=a,this._value=void 0,this.dep=new cu(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=as-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!a,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Et!==this)return yy(this,!0),!0}get value(){const t=this.dep.track();return _y(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function xx(e,t,a=!1){let n,r;return rt(e)?n=e:(n=e.get,r=e.set),new _x(n,r,a)}const Us={},$i=new WeakMap;let Jr;function kx(e,t=!1,a=Jr){if(a){let n=$i.get(a);n||$i.set(a,n=[]),n.push(e)}}function wx(e,t,a=Ct){const{immediate:n,deep:r,once:l,scheduler:o,augmentJob:i,call:u}=a,d=D=>r?D:Sa(D)||r===!1||r===0?On(D,1):On(D);let c,f,v,m,y=!1,x=!1;if(wt(e)?(f=()=>e.value,y=Sa(e)):ll(e)?(f=()=>d(e),y=!0):Ze(e)?(x=!0,y=e.some(D=>ll(D)||Sa(D)),f=()=>e.map(D=>{if(wt(D))return D.value;if(ll(D))return d(D);if(rt(D))return u?u(D,2):D()})):rt(e)?t?f=u?()=>u(e,2):e:f=()=>{if(v){Bn();try{v()}finally{Fn()}}const D=Jr;Jr=c;try{return u?u(e,3,[m]):e(m)}finally{Jr=D}}:f=fn,t&&r){const D=f,T=r===!0?1/0:r;f=()=>On(D(),T)}const S=rf(),k=()=>{c.stop(),S&&S.active&&af(S.effects,c)};if(l&&t){const D=t;t=(...T)=>{D(...T),k()}}let C=x?new Array(e.length).fill(Us):Us;const L=D=>{if(!(!(c.flags&1)||!c.dirty&&!D))if(t){const T=c.run();if(r||y||(x?T.some((I,q)=>on(I,C[q])):on(T,C))){v&&v();const I=Jr;Jr=c;try{const q=[T,C===Us?void 0:x&&C[0]===Us?[]:C,m];C=T,u?u(t,3,q):t(...q)}finally{Jr=I}}}else c.run()};return i&&i(L),c=new vy(f),c.scheduler=o?()=>o(L,!1):L,m=D=>kx(D,!1,c),v=c.onStop=()=>{const D=$i.get(c);if(D){if(u)u(D,4);else for(const T of D)T();$i.delete(c)}},t?n?L(!0):C=c.run():o?o(L.bind(null,!0),!0):c.run(),k.pause=c.pause.bind(c),k.resume=c.resume.bind(c),k.stop=k,k}function On(e,t=1/0,a){if(t<=0||!bt(e)||e.__v_skip||(a=a||new Map,(a.get(e)||0)>=t))return e;if(a.set(e,t),t--,wt(e))On(e.value,t,a);else if(Ze(e))for(let n=0;n<e.length;n++)On(e[n],t,a);else if(lu(e)||Fl(e))e.forEach(n=>{On(n,t,a)});else if(oy(e)){for(const n in e)On(e[n],t,a);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&On(e[n],t,a)}return e}function $s(e,t,a,n){try{return n?e(...n):e()}catch(r){vu(r,t,a)}}function Ia(e,t,a,n){if(rt(e)){const r=$s(e,t,a,n);return r&&ry(r)&&r.catch(l=>{vu(l,t,a)}),r}if(Ze(e)){const r=[];for(let l=0;l<e.length;l++)r.push(Ia(e[l],t,a,n));return r}}function vu(e,t,a,n=!0){const r=t?t.vnode:null,{errorHandler:l,throwUnhandledErrorInProduction:o}=t&&t.appContext.config||Ct;if(t){let i=t.parent;const u=t.proxy,d=`https://vuejs.org/error-reference/#runtime-${a}`;for(;i;){const c=i.ec;if(c){for(let f=0;f<c.length;f++)if(c[f](e,u,d)===!1)return}i=i.parent}if(l){Bn(),$s(l,null,10,[e,u,d]),Fn();return}}$x(e,a,r,n,o)}function $x(e,t,a,n=!0,r=!1){if(r)throw e;console.error(e)}const ia=[];let an=-1;const Vl=[];let pr=null,Ol=0;const Iy=Promise.resolve();let Si=null;function Ue(e){const t=Si||Iy;return e?t.then(this?e.bind(this):e):t}function Sx(e){let t=an+1,a=ia.length;for(;t<a;){const n=t+a>>>1,r=ia[n],l=rs(r);l<e||l===e&&r.flags&2?t=n+1:a=n}return t}function uf(e){if(!(e.flags&1)){const t=rs(e),a=ia[ia.length-1];!a||!(e.flags&2)&&t>=rs(a)?ia.push(e):ia.splice(Sx(t),0,e),e.flags|=1,qy()}}function qy(){Si||(Si=Iy.then(Ny))}function Cx(e){Ze(e)?Vl.push(...e):pr&&e.id===-1?pr.splice(Ol+1,0,e):e.flags&1||(Vl.push(e),e.flags|=1),qy()}function Xp(e,t,a=an+1){for(;a<ia.length;a++){const n=ia[a];if(n&&n.flags&2){if(e&&n.id!==e.uid)continue;ia.splice(a,1),a--,n.flags&4&&(n.flags&=-2),n(),n.flags&4||(n.flags&=-2)}}}function Ly(e){if(Vl.length){const t=[...new Set(Vl)].sort((a,n)=>rs(a)-rs(n));if(Vl.length=0,pr){pr.push(...t);return}for(pr=t,Ol=0;Ol<pr.length;Ol++){const a=pr[Ol];a.flags&4&&(a.flags&=-2),a.flags&8||a(),a.flags&=-2}pr=null,Ol=0}}const rs=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Ny(e){try{for(an=0;an<ia.length;an++){const t=ia[an];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),$s(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;an<ia.length;an++){const t=ia[an];t&&(t.flags&=-2)}an=-1,ia.length=0,Ly(),Si=null,(ia.length||Vl.length)&&Ny()}}let Zt=null,By=null;function Ci(e){const t=Zt;return Zt=e,By=e&&e.type.__scopeId||null,t}function B(e,t=Zt,a){if(!t||e._n)return e;const n=(...r)=>{n._d&&Ti(-1);const l=Ci(t);let o;try{o=e(...r)}finally{Ci(l),n._d&&Ti(1)}return o};return n._n=!0,n._c=!0,n._d=!0,n}function ha(e,t){if(Zt===null)return e;const a=_u(Zt),n=e.dirs||(e.dirs=[]);for(let r=0;r<t.length;r++){let[l,o,i,u=Ct]=t[r];l&&(rt(l)&&(l={mounted:l,updated:l}),l.deep&&On(o),n.push({dir:l,instance:a,value:o,oldValue:void 0,arg:i,modifiers:u}))}return e}function Ur(e,t,a,n){const r=e.dirs,l=t&&t.dirs;for(let o=0;o<r.length;o++){const i=r[o];l&&(i.oldValue=l[o].value);let u=i.dir[n];u&&(Bn(),Ia(u,a,8,[e.el,i,e,t]),Fn())}}function ht(e,t){if(na){let a=na.provides;const n=na.parent&&na.parent.provides;n===a&&(a=na.provides=Object.create(n)),a[e]=t}}function ct(e,t,a=!1){const n=bn();if(n||jl){let r=jl?jl._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(r&&e in r)return r[e];if(arguments.length>1)return a&&rt(t)?t.call(n&&n.proxy):t}}const Ex=Symbol.for("v-scx"),Ax=()=>ct(Ex);function Ea(e,t){return hu(e,null,t)}function Fy(e,t){return hu(e,null,{flush:"post"})}function Be(e,t,a){return hu(e,t,a)}function hu(e,t,a=Ct){const{immediate:n,deep:r,flush:l,once:o}=a,i=zt({},a),u=t&&n||!t&&l!=="post";let d;if(is){if(l==="sync"){const m=Ax();d=m.__watcherHandles||(m.__watcherHandles=[])}else if(!u){const m=()=>{};return m.stop=fn,m.resume=fn,m.pause=fn,m}}const c=na;i.call=(m,y,x)=>Ia(m,c,y,x);let f=!1;l==="post"?i.scheduler=m=>{sa(m,c&&c.suspense)}:l!=="sync"&&(f=!0,i.scheduler=(m,y)=>{y?m():uf(m)}),i.augmentJob=m=>{t&&(m.flags|=4),f&&(m.flags|=2,c&&(m.id=c.uid,m.i=c))};const v=wx(e,t,i);return is&&(d?d.push(v):u&&v()),v}function Tx(e,t,a){const n=this.proxy,r=Tt(e)?e.includes(".")?Vy(n,e):()=>n[e]:e.bind(n,n);let l;rt(t)?l=t:(l=t.handler,a=t);const o=Ss(this),i=hu(r,l.bind(n),a);return o(),i}function Vy(e,t){const a=t.split(".");return()=>{let n=e;for(let r=0;r<a.length&&n;r++)n=n[a[r]];return n}}const cr=new WeakMap,zy=Symbol("_vte"),Ox=e=>e.__isTeleport,Qr=e=>e&&(e.disabled||e.disabled===""),Dx=e=>e&&(e.defer||e.defer===""),Qp=e=>typeof SVGElement<"u"&&e instanceof SVGElement,em=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,id=(e,t)=>{const a=e&&e.to;return Tt(a)?t?t(a):null:a},Mx={name:"Teleport",__isTeleport:!0,process(e,t,a,n,r,l,o,i,u,d){const{mc:c,pc:f,pbc:v,o:{insert:m,querySelector:y,createText:x,createComment:S,parentNode:k}}=d,C=Qr(t.props);let{dynamicChildren:L}=t;const D=(q,H,E)=>{q.shapeFlag&16&&c(q.children,H,E,r,l,o,i,u)},T=(q=t)=>{const H=Qr(q.props),E=q.target=id(q.props,y),P=ud(E,q,x,m);E&&(o!=="svg"&&Qp(E)?o="svg":o!=="mathml"&&em(E)&&(o="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(E),H||(D(q,E,P),qo(q,!1)))},I=q=>{const H=()=>{if(cr.get(q)===H){if(cr.delete(q),Qr(q.props)){const E=k(q.el)||a;D(q,E,q.anchor),qo(q,!0)}T(q)}};cr.set(q,H),sa(H,l)};if(e==null){const q=t.el=x(""),H=t.anchor=x("");if(m(q,a,n),m(H,a,n),Dx(t.props)||l&&l.pendingBranch){I(t);return}C&&(D(t,a,H),qo(t,!0)),T()}else{t.el=e.el;const q=t.anchor=e.anchor,H=cr.get(e);if(H){H.flags|=8,cr.delete(e),I(t);return}t.targetStart=e.targetStart;const E=t.target=e.target,P=t.targetAnchor=e.targetAnchor,j=Qr(e.props),O=j?a:E,N=j?q:P;if(o==="svg"||Qp(E)?o="svg":(o==="mathml"||em(E))&&(o="mathml"),L?(v(e.dynamicChildren,L,O,r,l,o,i),mf(e,t,!0)):u||f(e,t,O,N,r,l,o,i,!1),C)j?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Hs(t,a,q,d,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Z=t.target=id(t.props,y);Z&&Hs(t,Z,null,d,0)}else j&&Hs(t,E,P,d,1);qo(t,C)}},remove(e,t,a,{um:n,o:{remove:r}},l){const{shapeFlag:o,children:i,anchor:u,targetStart:d,targetAnchor:c,target:f,props:v}=e,m=l||!Qr(v),y=cr.get(e);if(y&&(y.flags|=8,cr.delete(e)),f&&(r(d),r(c)),l&&r(u),!y&&o&16)for(let x=0;x<i.length;x++){const S=i[x];n(S,t,a,m,!!S.dynamicChildren)}},move:Hs,hydrate:Px};function Hs(e,t,a,{o:{insert:n},m:r},l=2){l===0&&n(e.targetAnchor,t,a);const{el:o,anchor:i,shapeFlag:u,children:d,props:c}=e,f=l===2;if(f&&n(o,t,a),!cr.has(e)&&(!f||Qr(c))&&u&16)for(let v=0;v<d.length;v++)r(d[v],t,a,2);f&&n(i,t,a)}function Px(e,t,a,n,r,l,{o:{nextSibling:o,parentNode:i,querySelector:u,insert:d,createText:c}},f){function v(S,k){let C=k;for(;C;){if(C&&C.nodeType===8){if(C.data==="teleport start anchor")t.targetStart=C;else if(C.data==="teleport anchor"){t.targetAnchor=C,S._lpa=t.targetAnchor&&o(t.targetAnchor);break}}C=o(C)}}function m(S,k){k.anchor=f(o(S),k,i(S),a,n,r,l)}const y=t.target=id(t.props,u),x=Qr(t.props);if(y){const S=y._lpa||y.firstChild;t.shapeFlag&16&&(x?(m(e,t),v(y,S),t.targetAnchor||ud(y,t,c,d,i(e)===y?e:null)):(t.anchor=o(e),v(y,S),t.targetAnchor||ud(y,t,c,d),f(S&&o(S),t,y,a,n,r,l))),qo(t,x)}else x&&t.shapeFlag&16&&(m(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}const Rx=Mx;function qo(e,t){const a=e.ctx;if(a&&a.ut){let n,r;for(t?(n=e.el,r=e.anchor):(n=e.targetStart,r=e.targetAnchor);n&&n!==r;)n.nodeType===1&&n.setAttribute("data-v-owner",a.uid),n=n.nextSibling;a.ut()}}function ud(e,t,a,n,r=null){const l=t.targetStart=a(""),o=t.targetAnchor=a("");return l[zy]=o,e&&(n(l,e,r),n(o,e,r)),o}const nn=Symbol("_leaveCb"),xo=Symbol("_enterCb");function Ix(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return $t(()=>{e.isMounted=!0}),Ot(()=>{e.isUnmounting=!0}),e}const Ta=[Function,Array],qx={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Ta,onEnter:Ta,onAfterEnter:Ta,onEnterCancelled:Ta,onBeforeLeave:Ta,onLeave:Ta,onAfterLeave:Ta,onLeaveCancelled:Ta,onBeforeAppear:Ta,onAppear:Ta,onAfterAppear:Ta,onAppearCancelled:Ta};function Lx(e,t){const{leavingVNodes:a}=e;let n=a.get(t.type);return n||(n=Object.create(null),a.set(t.type,n)),n}function cd(e,t,a,n,r){const{appear:l,mode:o,persisted:i=!1,onBeforeEnter:u,onEnter:d,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:v,onLeave:m,onAfterLeave:y,onLeaveCancelled:x,onBeforeAppear:S,onAppear:k,onAfterAppear:C,onAppearCancelled:L}=t,D=String(e.key),T=Lx(a,e),I=(E,P)=>{E&&Ia(E,n,9,P)},q=(E,P)=>{const j=P[1];I(E,P),Ze(E)?E.every(O=>O.length<=1)&&j():E.length<=1&&j()},H={mode:o,persisted:i,beforeEnter(E){let P=u;if(!a.isMounted)if(l)P=S||u;else return;E[nn]&&E[nn](!0);const j=T[D];j&&Dl(e,j)&&j.el[nn]&&j.el[nn](),I(P,[E])},enter(E){if(T[D]===e)return;let P=d,j=c,O=f;if(!a.isMounted)if(l)P=k||d,j=C||c,O=L||f;else return;let N=!1;E[xo]=W=>{N||(N=!0,W?I(O,[E]):I(j,[E]),H.delayedLeave&&H.delayedLeave(),E[xo]=void 0)};const Z=E[xo].bind(null,!1);P?q(P,[E,Z]):Z()},leave(E,P){const j=String(e.key);if(E[xo]&&E[xo](!0),a.isUnmounting)return P();I(v,[E]);let O=!1;E[nn]=Z=>{O||(O=!0,P(),Z?I(x,[E]):I(y,[E]),E[nn]=void 0,T[j]===e&&delete T[j])};const N=E[nn].bind(null,!1);T[j]=e,m?q(m,[E,N]):N()},clone(E){return cd(E,t,a,n)}};return H}function ls(e,t){e.shapeFlag&6&&e.component?(e.transition=t,ls(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function jy(e,t=!1,a){let n=[],r=0;for(let l=0;l<e.length;l++){let o=e[l];const i=a==null?o.key:String(a)+String(o.key!=null?o.key:l);o.type===pe?(o.patchFlag&128&&r++,n=n.concat(jy(o.children,t,i))):(t||o.type!==Ka)&&n.push(i!=null?xr(o,{key:i}):o)}if(r>1)for(let l=0;l<n.length;l++)n[l].patchFlag=-2;return n}function ne(e,t){return rt(e)?zt({name:e.name},t,{setup:e}):e}function cf(){const e=bn();return e?(e.appContext.config.idPrefix||"v")+"-"+e.ids[0]+e.ids[1]++:""}function Uy(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function tm(e,t){let a;return!!((a=Object.getOwnPropertyDescriptor(e,t))&&!a.configurable)}const Ei=new WeakMap;function Ko(e,t,a,n,r=!1){if(Ze(e)){e.forEach((x,S)=>Ko(x,t&&(Ze(t)?t[S]:t),a,n,r));return}if(zl(n)&&!r){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Ko(e,t,a,n.component.subTree);return}const l=n.shapeFlag&4?_u(n.component):n.el,o=r?null:l,{i,r:u}=e,d=t&&t.r,c=i.refs===Ct?i.refs={}:i.refs,f=i.setupState,v=vt(f),m=f===Ct?ny:x=>tm(c,x)?!1:xt(v,x),y=(x,S)=>!(S&&tm(c,S));if(d!=null&&d!==u){if(am(t),Tt(d))c[d]=null,m(d)&&(f[d]=null);else if(wt(d)){const x=t;y(d,x.k)&&(d.value=null),x.k&&(c[x.k]=null)}}if(rt(u))$s(u,i,12,[o,c]);else{const x=Tt(u),S=wt(u);if(x||S){const k=()=>{if(e.f){const C=x?m(u)?f[u]:c[u]:y()||!e.k?u.value:c[e.k];if(r)Ze(C)&&af(C,l);else if(Ze(C))C.includes(l)||C.push(l);else if(x)c[u]=[l],m(u)&&(f[u]=c[u]);else{const L=[l];y(u,e.k)&&(u.value=L),e.k&&(c[e.k]=L)}}else x?(c[u]=o,m(u)&&(f[u]=o)):S&&(y(u,e.k)&&(u.value=o),e.k&&(c[e.k]=o))};if(o){const C=()=>{k(),Ei.delete(e)};C.id=-1,Ei.set(e,C),sa(C,a)}else am(e),k()}}}function am(e){const t=Ei.get(e);t&&(t.flags|=8,Ei.delete(e))}uu().requestIdleCallback;uu().cancelIdleCallback;const zl=e=>!!e.type.__asyncLoader,Hy=e=>e.type.__isKeepAlive;function Ky(e,t){Gy(e,"a",t)}function Wy(e,t){Gy(e,"da",t)}function Gy(e,t,a=na){const n=e.__wdc||(e.__wdc=()=>{let r=a;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(yu(t,n,a),a){let r=a.parent;for(;r&&r.parent;)Hy(r.parent.vnode)&&Nx(n,t,a,r),r=r.parent}}function Nx(e,t,a,n){const r=yu(t,e,n,!0);Wn(()=>{af(n[t],r)},a)}function yu(e,t,a=na,n=!1){if(a){const r=a[e]||(a[e]=[]),l=t.__weh||(t.__weh=(...o)=>{Bn();const i=Ss(a),u=Ia(t,a,e,o);return i(),Fn(),u});return n?r.unshift(l):r.push(l),l}}const Kn=e=>(t,a=na)=>{(!is||e==="sp")&&yu(e,(...n)=>t(...n),a)},Yy=Kn("bm"),$t=Kn("m"),Bx=Kn("bu"),df=Kn("u"),Ot=Kn("bum"),Wn=Kn("um"),Fx=Kn("sp"),Vx=Kn("rtg"),zx=Kn("rtc");function jx(e,t=na){yu("ec",e,t)}const Jy="components";function Ux(e,t){return Xy(Jy,e,!0,t)||e}const Zy=Symbol.for("v-ndc");function Wt(e){return Tt(e)?Xy(Jy,e,!1)||e:e||Zy}function Xy(e,t,a=!0,n=!1){const r=Zt||na;if(r){const l=r.type;{const i=Ek(l,!1);if(i&&(i===t||i===Xt(t)||i===iu(Xt(t))))return l}const o=nm(r[e]||l[e],t)||nm(r.appContext[e],t);return!o&&n?l:o}}function nm(e,t){return e&&(e[t]||e[Xt(t)]||e[iu(Xt(t))])}function De(e,t,a,n){let r;const l=a,o=Ze(e);if(o||Tt(e)){const i=o&&ll(e);let u=!1,d=!1;i&&(u=!Sa(e),d=Vn(e),e=du(e)),r=new Array(e.length);for(let c=0,f=e.length;c<f;c++)r[c]=t(u?d?Zl(Ha(e[c])):Ha(e[c]):e[c],c,void 0,l)}else if(typeof e=="number"){r=new Array(e);for(let i=0;i<e;i++)r[i]=t(i+1,i,void 0,l)}else if(bt(e))if(e[Symbol.iterator])r=Array.from(e,(i,u)=>t(i,u,void 0,l));else{const i=Object.keys(e);r=new Array(i.length);for(let u=0,d=i.length;u<d;u++){const c=i[u];r[u]=t(e[c],c,u,l)}}else r=[];return r}function Se(e,t,a={},n,r){if(Zt.ce||Zt.parent&&zl(Zt.parent)&&Zt.parent.ce){const d=Object.keys(a).length>0;return t!=="default"&&(a.name=t),p(),U(pe,null,[R("slot",a,n&&n())],d?-2:64)}let l=e[t];l&&l._c&&(l._d=!1),p();const o=l&&Qy(l(a)),i=a.key||o&&o.key,u=U(pe,{key:(i&&!Ca(i)?i:`_${t}`)+(!o&&n?"_fb":"")},o||(n?n():[]),o&&e._===1?64:-2);return u.scopeId&&(u.slotScopeIds=[u.scopeId+"-s"]),l&&l._c&&(l._d=!0),u}function Qy(e){return e.some(t=>ss(t)?!(t.type===Ka||t.type===pe&&!Qy(t.children)):!0)?e:null}function eg(e,t){const a={};for(const n in e)a[jo(n)]=e[n];return a}const dd=e=>e?_g(e)?_u(e):dd(e.parent):null,Wo=zt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>dd(e.parent),$root:e=>dd(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>ng(e),$forceUpdate:e=>e.f||(e.f=()=>{uf(e.update)}),$nextTick:e=>e.n||(e.n=Ue.bind(e.proxy)),$watch:e=>Tx.bind(e)}),oc=(e,t)=>e!==Ct&&!e.__isScriptSetup&&xt(e,t),Hx={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:a,setupState:n,data:r,props:l,accessCache:o,type:i,appContext:u}=e;if(t[0]!=="$"){const v=o[t];if(v!==void 0)switch(v){case 1:return n[t];case 2:return r[t];case 4:return a[t];case 3:return l[t]}else{if(oc(n,t))return o[t]=1,n[t];if(r!==Ct&&xt(r,t))return o[t]=2,r[t];if(xt(l,t))return o[t]=3,l[t];if(a!==Ct&&xt(a,t))return o[t]=4,a[t];pd&&(o[t]=0)}}const d=Wo[t];let c,f;if(d)return t==="$attrs"&&aa(e.attrs,"get",""),d(e);if((c=i.__cssModules)&&(c=c[t]))return c;if(a!==Ct&&xt(a,t))return o[t]=4,a[t];if(f=u.config.globalProperties,xt(f,t))return f[t]},set({_:e},t,a){const{data:n,setupState:r,ctx:l}=e;return oc(r,t)?(r[t]=a,!0):n!==Ct&&xt(n,t)?(n[t]=a,!0):xt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=a,!0)},has({_:{data:e,setupState:t,accessCache:a,ctx:n,appContext:r,props:l,type:o}},i){let u;return!!(a[i]||e!==Ct&&i[0]!=="$"&&xt(e,i)||oc(t,i)||xt(l,i)||xt(n,i)||xt(Wo,i)||xt(r.config.globalProperties,i)||(u=o.__cssModules)&&u[i])},defineProperty(e,t,a){return a.get!=null?e._.accessCache[t]=0:xt(a,"value")&&this.set(e,t,a.value,null),Reflect.defineProperty(e,t,a)}};function fd(e){return Ze(e)?e.reduce((t,a)=>(t[a]=null,t),{}):e}function tg(e,t){const a=fd(e);for(const n in t){if(n.startsWith("__skip"))continue;let r=a[n];r?Ze(r)||rt(r)?r=a[n]={type:r,default:t[n]}:r.default=t[n]:r===null&&(r=a[n]={default:t[n]}),r&&t[`__skip_${n}`]&&(r.skipFactory=!0)}return a}let pd=!0;function Kx(e){const t=ng(e),a=e.proxy,n=e.ctx;pd=!1,t.beforeCreate&&rm(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:o,watch:i,provide:u,inject:d,created:c,beforeMount:f,mounted:v,beforeUpdate:m,updated:y,activated:x,deactivated:S,beforeDestroy:k,beforeUnmount:C,destroyed:L,unmounted:D,render:T,renderTracked:I,renderTriggered:q,errorCaptured:H,serverPrefetch:E,expose:P,inheritAttrs:j,components:O,directives:N,filters:Z}=t;if(d&&Wx(d,n,null),o)for(const te in o){const oe=o[te];rt(oe)&&(n[te]=oe.bind(a))}if(r){const te=r.call(a,a);bt(te)&&(e.data=Ua(te))}if(pd=!0,l)for(const te in l){const oe=l[te],ye=rt(oe)?oe.bind(a,a):rt(oe.get)?oe.get.bind(a,a):fn,be=!rt(oe)&&rt(oe.set)?oe.set.bind(a):fn,ge=_({get:ye,set:be});Object.defineProperty(n,te,{enumerable:!0,configurable:!0,get:()=>ge.value,set:le=>ge.value=le})}if(i)for(const te in i)ag(i[te],n,a,te);if(u){const te=rt(u)?u.call(a):u;Reflect.ownKeys(te).forEach(oe=>{ht(oe,te[oe])})}c&&rm(c,e,"c");function K(te,oe){Ze(oe)?oe.forEach(ye=>te(ye.bind(a))):oe&&te(oe.bind(a))}if(K(Yy,f),K($t,v),K(Bx,m),K(df,y),K(Ky,x),K(Wy,S),K(jx,H),K(zx,I),K(Vx,q),K(Ot,C),K(Wn,D),K(Fx,E),Ze(P))if(P.length){const te=e.exposed||(e.exposed={});P.forEach(oe=>{Object.defineProperty(te,oe,{get:()=>a[oe],set:ye=>a[oe]=ye,enumerable:!0})})}else e.exposed||(e.exposed={});T&&e.render===fn&&(e.render=T),j!=null&&(e.inheritAttrs=j),O&&(e.components=O),N&&(e.directives=N),E&&Uy(e)}function Wx(e,t,a=fn){Ze(e)&&(e=md(e));for(const n in e){const r=e[n];let l;bt(r)?"default"in r?l=ct(r.from||n,r.default,!0):l=ct(r.from||n):l=ct(r),wt(l)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>l.value,set:o=>l.value=o}):t[n]=l}}function rm(e,t,a){Ia(Ze(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,a)}function ag(e,t,a,n){let r=n.includes(".")?Vy(a,n):()=>a[n];if(Tt(e)){const l=t[e];rt(l)&&Be(r,l)}else if(rt(e))Be(r,e.bind(a));else if(bt(e))if(Ze(e))e.forEach(l=>ag(l,t,a,n));else{const l=rt(e.handler)?e.handler.bind(a):t[e.handler];rt(l)&&Be(r,l,e)}}function ng(e){const t=e.type,{mixins:a,extends:n}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:o}}=e.appContext,i=l.get(t);let u;return i?u=i:!r.length&&!a&&!n?u=t:(u={},r.length&&r.forEach(d=>Ai(u,d,o,!0)),Ai(u,t,o)),bt(t)&&l.set(t,u),u}function Ai(e,t,a,n=!1){const{mixins:r,extends:l}=t;l&&Ai(e,l,a,!0),r&&r.forEach(o=>Ai(e,o,a,!0));for(const o in t)if(!(n&&o==="expose")){const i=Gx[o]||a&&a[o];e[o]=i?i(e[o],t[o]):t[o]}return e}const Gx={data:lm,props:om,emits:om,methods:Lo,computed:Lo,beforeCreate:oa,created:oa,beforeMount:oa,mounted:oa,beforeUpdate:oa,updated:oa,beforeDestroy:oa,beforeUnmount:oa,destroyed:oa,unmounted:oa,activated:oa,deactivated:oa,errorCaptured:oa,serverPrefetch:oa,components:Lo,directives:Lo,watch:Jx,provide:lm,inject:Yx};function lm(e,t){return t?e?function(){return zt(rt(e)?e.call(this,this):e,rt(t)?t.call(this,this):t)}:t:e}function Yx(e,t){return Lo(md(e),md(t))}function md(e){if(Ze(e)){const t={};for(let a=0;a<e.length;a++)t[e[a]]=e[a];return t}return e}function oa(e,t){return e?[...new Set([].concat(e,t))]:t}function Lo(e,t){return e?zt(Object.create(null),e,t):t}function om(e,t){return e?Ze(e)&&Ze(t)?[...new Set([...e,...t])]:zt(Object.create(null),fd(e),fd(t??{})):t}function Jx(e,t){if(!e)return t;if(!t)return e;const a=zt(Object.create(null),e);for(const n in t)a[n]=oa(e[n],t[n]);return a}function rg(){return{app:null,config:{isNativeTag:ny,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let Zx=0;function Xx(e,t){return function(n,r=null){rt(n)||(n=zt({},n)),r!=null&&!bt(r)&&(r=null);const l=rg(),o=new WeakSet,i=[];let u=!1;const d=l.app={_uid:Zx++,_component:n,_props:r,_container:null,_context:l,_instance:null,version:Tk,get config(){return l.config},set config(c){},use(c,...f){return o.has(c)||(c&&rt(c.install)?(o.add(c),c.install(d,...f)):rt(c)&&(o.add(c),c(d,...f))),d},mixin(c){return l.mixins.includes(c)||l.mixins.push(c),d},component(c,f){return f?(l.components[c]=f,d):l.components[c]},directive(c,f){return f?(l.directives[c]=f,d):l.directives[c]},mount(c,f,v){if(!u){const m=d._ceVNode||R(n,r);return m.appContext=l,v===!0?v="svg":v===!1&&(v=void 0),e(m,c,v),u=!0,d._container=c,c.__vue_app__=d,_u(m.component)}},onUnmount(c){i.push(c)},unmount(){u&&(Ia(i,d._instance,16),e(null,d._container),delete d._container.__vue_app__)},provide(c,f){return l.provides[c]=f,d},runWithContext(c){const f=jl;jl=d;try{return c()}finally{jl=f}}};return d}}let jl=null;const Qx=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Xt(t)}Modifiers`]||e[`${Pr(t)}Modifiers`];function ek(e,t,...a){if(e.isUnmounted)return;const n=e.vnode.props||Ct;let r=a;const l=t.startsWith("update:"),o=l&&Qx(n,t.slice(7));o&&(o.trim&&(r=a.map(c=>Tt(c)?c.trim():c)),o.number&&(r=a.map(nf)));let i,u=n[i=jo(t)]||n[i=jo(Xt(t))];!u&&l&&(u=n[i=jo(Pr(t))]),u&&Ia(u,e,6,r);const d=n[i+"Once"];if(d){if(!e.emitted)e.emitted={};else if(e.emitted[i])return;e.emitted[i]=!0,Ia(d,e,6,r)}}const tk=new WeakMap;function lg(e,t,a=!1){const n=a?tk:t.emitsCache,r=n.get(e);if(r!==void 0)return r;const l=e.emits;let o={},i=!1;if(!rt(e)){const u=d=>{const c=lg(d,t,!0);c&&(i=!0,zt(o,c))};!a&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}return!l&&!i?(bt(e)&&n.set(e,null),null):(Ze(l)?l.forEach(u=>o[u]=null):zt(o,l),bt(e)&&n.set(e,o),o)}function gu(e,t){return!e||!nu(t)?!1:(t=t.slice(2).replace(/Once$/,""),xt(e,t[0].toLowerCase()+t.slice(1))||xt(e,Pr(t))||xt(e,t))}function sm(e){const{type:t,vnode:a,proxy:n,withProxy:r,propsOptions:[l],slots:o,attrs:i,emit:u,render:d,renderCache:c,props:f,data:v,setupState:m,ctx:y,inheritAttrs:x}=e,S=Ci(e);let k,C;try{if(a.shapeFlag&4){const D=r||n,T=D;k=ln(d.call(T,D,c,f,m,v,y)),C=i}else{const D=t;k=ln(D.length>1?D(f,{attrs:i,slots:o,emit:u}):D(f,null)),C=t.props?i:ak(i)}}catch(D){Go.length=0,vu(D,e,1),k=R(Ka)}let L=k;if(C&&x!==!1){const D=Object.keys(C),{shapeFlag:T}=L;D.length&&T&7&&(l&&D.some(ru)&&(C=nk(C,l)),L=xr(L,C,!1,!0))}return a.dirs&&(L=xr(L,null,!1,!0),L.dirs=L.dirs?L.dirs.concat(a.dirs):a.dirs),a.transition&&ls(L,a.transition),k=L,Ci(S),k}const ak=e=>{let t;for(const a in e)(a==="class"||a==="style"||nu(a))&&((t||(t={}))[a]=e[a]);return t},nk=(e,t)=>{const a={};for(const n in e)(!ru(n)||!(n.slice(9)in t))&&(a[n]=e[n]);return a};function rk(e,t,a){const{props:n,children:r,component:l}=e,{props:o,children:i,patchFlag:u}=t,d=l.emitsOptions;if(t.dirs||t.transition)return!0;if(a&&u>=0){if(u&1024)return!0;if(u&16)return n?im(n,o,d):!!o;if(u&8){const c=t.dynamicProps;for(let f=0;f<c.length;f++){const v=c[f];if(og(o,n,v)&&!gu(d,v))return!0}}}else return(r||i)&&(!i||!i.$stable)?!0:n===o?!1:n?o?im(n,o,d):!0:!!o;return!1}function im(e,t,a){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let r=0;r<n.length;r++){const l=n[r];if(og(t,e,l)&&!gu(a,l))return!0}return!1}function og(e,t,a){const n=e[a],r=t[a];return a==="style"&&bt(n)&&bt(r)?!ws(n,r):n!==r}function lk({vnode:e,parent:t,suspense:a},n){for(;t;){const r=t.subTree;if(r.suspense&&r.suspense.activeBranch===e&&(r.suspense.vnode.el=r.el=n,e=r),r===e)(e=t.vnode).el=n,t=t.parent;else break}a&&a.activeBranch===e&&(a.vnode.el=n)}const sg={},ig=()=>Object.create(sg),ug=e=>Object.getPrototypeOf(e)===sg;function ok(e,t,a,n=!1){const r={},l=ig();e.propsDefaults=Object.create(null),cg(e,t,r,l);for(const o in e.propsOptions[0])o in r||(r[o]=void 0);a?e.props=n?r:Dy(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function sk(e,t,a,n){const{props:r,attrs:l,vnode:{patchFlag:o}}=e,i=vt(r),[u]=e.propsOptions;let d=!1;if((n||o>0)&&!(o&16)){if(o&8){const c=e.vnode.dynamicProps;for(let f=0;f<c.length;f++){let v=c[f];if(gu(e.emitsOptions,v))continue;const m=t[v];if(u)if(xt(l,v))m!==l[v]&&(l[v]=m,d=!0);else{const y=Xt(v);r[y]=vd(u,i,y,m,e,!1)}else m!==l[v]&&(l[v]=m,d=!0)}}}else{cg(e,t,r,l)&&(d=!0);let c;for(const f in i)(!t||!xt(t,f)&&((c=Pr(f))===f||!xt(t,c)))&&(u?a&&(a[f]!==void 0||a[c]!==void 0)&&(r[f]=vd(u,i,f,void 0,e,!0)):delete r[f]);if(l!==i)for(const f in l)(!t||!xt(t,f))&&(delete l[f],d=!0)}d&&Tn(e.attrs,"set","")}function cg(e,t,a,n){const[r,l]=e.propsOptions;let o=!1,i;if(t)for(let u in t){if(zo(u))continue;const d=t[u];let c;r&&xt(r,c=Xt(u))?!l||!l.includes(c)?a[c]=d:(i||(i={}))[c]=d:gu(e.emitsOptions,u)||(!(u in n)||d!==n[u])&&(n[u]=d,o=!0)}if(l){const u=vt(a),d=i||Ct;for(let c=0;c<l.length;c++){const f=l[c];a[f]=vd(r,u,f,d[f],e,!xt(d,f))}}return o}function vd(e,t,a,n,r,l){const o=e[a];if(o!=null){const i=xt(o,"default");if(i&&n===void 0){const u=o.default;if(o.type!==Function&&!o.skipFactory&&rt(u)){const{propsDefaults:d}=r;if(a in d)n=d[a];else{const c=Ss(r);n=d[a]=u.call(null,t),c()}}else n=u;r.ce&&r.ce._setProp(a,n)}o[0]&&(l&&!i?n=!1:o[1]&&(n===""||n===Pr(a))&&(n=!0))}return n}const ik=new WeakMap;function dg(e,t,a=!1){const n=a?ik:t.propsCache,r=n.get(e);if(r)return r;const l=e.props,o={},i=[];let u=!1;if(!rt(e)){const c=f=>{u=!0;const[v,m]=dg(f,t,!0);zt(o,v),m&&i.push(...m)};!a&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!l&&!u)return bt(e)&&n.set(e,Bl),Bl;if(Ze(l))for(let c=0;c<l.length;c++){const f=Xt(l[c]);um(f)&&(o[f]=Ct)}else if(l)for(const c in l){const f=Xt(c);if(um(f)){const v=l[c],m=o[f]=Ze(v)||rt(v)?{type:v}:zt({},v),y=m.type;let x=!1,S=!0;if(Ze(y))for(let k=0;k<y.length;++k){const C=y[k],L=rt(C)&&C.name;if(L==="Boolean"){x=!0;break}else L==="String"&&(S=!1)}else x=rt(y)&&y.name==="Boolean";m[0]=x,m[1]=S,(x||xt(m,"default"))&&i.push(f)}}const d=[o,i];return bt(e)&&n.set(e,d),d}function um(e){return e[0]!=="$"&&!zo(e)}const ff=e=>e==="_"||e==="_ctx"||e==="$stable",pf=e=>Ze(e)?e.map(ln):[ln(e)],uk=(e,t,a)=>{if(t._n)return t;const n=B((...r)=>pf(t(...r)),a);return n._c=!1,n},fg=(e,t,a)=>{const n=e._ctx;for(const r in e){if(ff(r))continue;const l=e[r];if(rt(l))t[r]=uk(r,l,n);else if(l!=null){const o=pf(l);t[r]=()=>o}}},pg=(e,t)=>{const a=pf(t);e.slots.default=()=>a},mg=(e,t,a)=>{for(const n in t)(a||!ff(n))&&(e[n]=t[n])},ck=(e,t,a)=>{const n=e.slots=ig();if(e.vnode.shapeFlag&32){const r=t._;r?(mg(n,t,a),a&&sy(n,"_",r,!0)):fg(t,n)}else t&&pg(e,t)},dk=(e,t,a)=>{const{vnode:n,slots:r}=e;let l=!0,o=Ct;if(n.shapeFlag&32){const i=t._;i?a&&i===1?l=!1:mg(r,t,a):(l=!t.$stable,fg(t,r)),o=t}else t&&(pg(e,t),o={default:1});if(l)for(const i in r)!ff(i)&&o[i]==null&&delete r[i]},sa=hk;function fk(e){return pk(e)}function pk(e,t){const a=uu();a.__VUE__=!0;const{insert:n,remove:r,patchProp:l,createElement:o,createText:i,createComment:u,setText:d,setElementText:c,parentNode:f,nextSibling:v,setScopeId:m=fn,insertStaticContent:y}=e,x=($,M,z,de=null,X=null,se=null,xe=void 0,$e=null,Ce=!!M.dynamicChildren)=>{if($===M)return;$&&!Dl($,M)&&(de=J($),le($,X,se,!0),$=null),M.patchFlag===-2&&(Ce=!1,M.dynamicChildren=null);const{type:ie,ref:Ee,shapeFlag:we}=M;switch(ie){case bu:S($,M,z,de);break;case Ka:k($,M,z,de);break;case mi:$==null&&C(M,z,de,xe);break;case pe:O($,M,z,de,X,se,xe,$e,Ce);break;default:we&1?T($,M,z,de,X,se,xe,$e,Ce):we&6?N($,M,z,de,X,se,xe,$e,Ce):(we&64||we&128)&&ie.process($,M,z,de,X,se,xe,$e,Ce,ee)}Ee!=null&&X?Ko(Ee,$&&$.ref,se,M||$,!M):Ee==null&&$&&$.ref!=null&&Ko($.ref,null,se,$,!0)},S=($,M,z,de)=>{if($==null)n(M.el=i(M.children),z,de);else{const X=M.el=$.el;M.children!==$.children&&d(X,M.children)}},k=($,M,z,de)=>{$==null?n(M.el=u(M.children||""),z,de):M.el=$.el},C=($,M,z,de)=>{[$.el,$.anchor]=y($.children,M,z,de,$.el,$.anchor)},L=({el:$,anchor:M},z,de)=>{let X;for(;$&&$!==M;)X=v($),n($,z,de),$=X;n(M,z,de)},D=({el:$,anchor:M})=>{let z;for(;$&&$!==M;)z=v($),r($),$=z;r(M)},T=($,M,z,de,X,se,xe,$e,Ce)=>{if(M.type==="svg"?xe="svg":M.type==="math"&&(xe="mathml"),$==null)I(M,z,de,X,se,xe,$e,Ce);else{const ie=$.el&&$.el._isVueCE?$.el:null;try{ie&&ie._beginPatch(),E($,M,X,se,xe,$e,Ce)}finally{ie&&ie._endPatch()}}},I=($,M,z,de,X,se,xe,$e)=>{let Ce,ie;const{props:Ee,shapeFlag:we,transition:Le,dirs:Ve}=$;if(Ce=$.el=o($.type,se,Ee&&Ee.is,Ee),we&8?c(Ce,$.children):we&16&&H($.children,Ce,null,de,X,sc($,se),xe,$e),Ve&&Ur($,null,de,"created"),q(Ce,$,$.scopeId,xe,de),Ee){for(const tt in Ee)tt!=="value"&&!zo(tt)&&l(Ce,tt,null,Ee[tt],se,de);"value"in Ee&&l(Ce,"value",null,Ee.value,se),(ie=Ee.onVnodeBeforeMount)&&Qa(ie,de,$)}Ve&&Ur($,null,de,"beforeMount");const We=mk(X,Le);We&&Le.beforeEnter(Ce),n(Ce,M,z),((ie=Ee&&Ee.onVnodeMounted)||We||Ve)&&sa(()=>{ie&&Qa(ie,de,$),We&&Le.enter(Ce),Ve&&Ur($,null,de,"mounted")},X)},q=($,M,z,de,X)=>{if(z&&m($,z),de)for(let se=0;se<de.length;se++)m($,de[se]);if(X){let se=X.subTree;if(M===se||yg(se.type)&&(se.ssContent===M||se.ssFallback===M)){const xe=X.vnode;q($,xe,xe.scopeId,xe.slotScopeIds,X.parent)}}},H=($,M,z,de,X,se,xe,$e,Ce=0)=>{for(let ie=Ce;ie<$.length;ie++){const Ee=$[ie]=$e?An($[ie]):ln($[ie]);x(null,Ee,M,z,de,X,se,xe,$e)}},E=($,M,z,de,X,se,xe)=>{const $e=M.el=$.el;let{patchFlag:Ce,dynamicChildren:ie,dirs:Ee}=M;Ce|=$.patchFlag&16;const we=$.props||Ct,Le=M.props||Ct;let Ve;if(z&&Hr(z,!1),(Ve=Le.onVnodeBeforeUpdate)&&Qa(Ve,z,M,$),Ee&&Ur(M,$,z,"beforeUpdate"),z&&Hr(z,!0),(we.innerHTML&&Le.innerHTML==null||we.textContent&&Le.textContent==null)&&c($e,""),ie?P($.dynamicChildren,ie,$e,z,de,sc(M,X),se):xe||oe($,M,$e,null,z,de,sc(M,X),se,!1),Ce>0){if(Ce&16)j($e,we,Le,z,X);else if(Ce&2&&we.class!==Le.class&&l($e,"class",null,Le.class,X),Ce&4&&l($e,"style",we.style,Le.style,X),Ce&8){const We=M.dynamicProps;for(let tt=0;tt<We.length;tt++){const at=We[tt],st=we[at],Ie=Le[at];(Ie!==st||at==="value")&&l($e,at,st,Ie,X,z)}}Ce&1&&$.children!==M.children&&c($e,M.children)}else!xe&&ie==null&&j($e,we,Le,z,X);((Ve=Le.onVnodeUpdated)||Ee)&&sa(()=>{Ve&&Qa(Ve,z,M,$),Ee&&Ur(M,$,z,"updated")},de)},P=($,M,z,de,X,se,xe)=>{for(let $e=0;$e<M.length;$e++){const Ce=$[$e],ie=M[$e],Ee=Ce.el&&(Ce.type===pe||!Dl(Ce,ie)||Ce.shapeFlag&198)?f(Ce.el):z;x(Ce,ie,Ee,null,de,X,se,xe,!0)}},j=($,M,z,de,X)=>{if(M!==z){if(M!==Ct)for(const se in M)!zo(se)&&!(se in z)&&l($,se,M[se],null,X,de);for(const se in z){if(zo(se))continue;const xe=z[se],$e=M[se];xe!==$e&&se!=="value"&&l($,se,$e,xe,X,de)}"value"in z&&l($,"value",M.value,z.value,X)}},O=($,M,z,de,X,se,xe,$e,Ce)=>{const ie=M.el=$?$.el:i(""),Ee=M.anchor=$?$.anchor:i("");let{patchFlag:we,dynamicChildren:Le,slotScopeIds:Ve}=M;Ve&&($e=$e?$e.concat(Ve):Ve),$==null?(n(ie,z,de),n(Ee,z,de),H(M.children||[],z,Ee,X,se,xe,$e,Ce)):we>0&&we&64&&Le&&$.dynamicChildren&&$.dynamicChildren.length===Le.length?(P($.dynamicChildren,Le,z,X,se,xe,$e),(M.key!=null||X&&M===X.subTree)&&mf($,M,!0)):oe($,M,z,Ee,X,se,xe,$e,Ce)},N=($,M,z,de,X,se,xe,$e,Ce)=>{M.slotScopeIds=$e,$==null?M.shapeFlag&512?X.ctx.activate(M,z,de,xe,Ce):Z(M,z,de,X,se,xe,Ce):W($,M,Ce)},Z=($,M,z,de,X,se,xe)=>{const $e=$.component=kk($,de,X);if(Hy($)&&($e.ctx.renderer=ee),wk($e,!1,xe),$e.asyncDep){if(X&&X.registerDep($e,K,xe),!$.el){const Ce=$e.subTree=R(Ka);k(null,Ce,M,z),$.placeholder=Ce.el}}else K($e,$,M,z,X,se,xe)},W=($,M,z)=>{const de=M.component=$.component;if(rk($,M,z))if(de.asyncDep&&!de.asyncResolved){te(de,M,z);return}else de.next=M,de.update();else M.el=$.el,de.vnode=M},K=($,M,z,de,X,se,xe)=>{const $e=()=>{if($.isMounted){let{next:we,bu:Le,u:Ve,parent:We,vnode:tt}=$;{const ot=vg($);if(ot){we&&(we.el=tt.el,te($,we,xe)),ot.asyncDep.then(()=>{sa(()=>{$.isUnmounted||ie()},X)});return}}let at=we,st;Hr($,!1),we?(we.el=tt.el,te($,we,xe)):we=tt,Le&&pi(Le),(st=we.props&&we.props.onVnodeBeforeUpdate)&&Qa(st,We,we,tt),Hr($,!0);const Ie=sm($),Qe=$.subTree;$.subTree=Ie,x(Qe,Ie,f(Qe.el),J(Qe),$,X,se),we.el=Ie.el,at===null&&lk($,Ie.el),Ve&&sa(Ve,X),(st=we.props&&we.props.onVnodeUpdated)&&sa(()=>Qa(st,We,we,tt),X)}else{let we;const{el:Le,props:Ve}=M,{bm:We,m:tt,parent:at,root:st,type:Ie}=$,Qe=zl(M);Hr($,!1),We&&pi(We),!Qe&&(we=Ve&&Ve.onVnodeBeforeMount)&&Qa(we,at,M),Hr($,!0);{st.ce&&st.ce._hasShadowRoot()&&st.ce._injectChildStyle(Ie,$.parent?$.parent.type:void 0);const ot=$.subTree=sm($);x(null,ot,z,de,$,X,se),M.el=ot.el}if(tt&&sa(tt,X),!Qe&&(we=Ve&&Ve.onVnodeMounted)){const ot=M;sa(()=>Qa(we,at,ot),X)}(M.shapeFlag&256||at&&zl(at.vnode)&&at.vnode.shapeFlag&256)&&$.a&&sa($.a,X),$.isMounted=!0,M=z=de=null}};$.scope.on();const Ce=$.effect=new vy($e);$.scope.off();const ie=$.update=Ce.run.bind(Ce),Ee=$.job=Ce.runIfDirty.bind(Ce);Ee.i=$,Ee.id=$.uid,Ce.scheduler=()=>uf(Ee),Hr($,!0),ie()},te=($,M,z)=>{M.component=$;const de=$.vnode.props;$.vnode=M,$.next=null,sk($,M.props,de,z),dk($,M.children,z),Bn(),Xp($),Fn()},oe=($,M,z,de,X,se,xe,$e,Ce=!1)=>{const ie=$&&$.children,Ee=$?$.shapeFlag:0,we=M.children,{patchFlag:Le,shapeFlag:Ve}=M;if(Le>0){if(Le&128){be(ie,we,z,de,X,se,xe,$e,Ce);return}else if(Le&256){ye(ie,we,z,de,X,se,xe,$e,Ce);return}}Ve&8?(Ee&16&&ve(ie,X,se),we!==ie&&c(z,we)):Ee&16?Ve&16?be(ie,we,z,de,X,se,xe,$e,Ce):ve(ie,X,se,!0):(Ee&8&&c(z,""),Ve&16&&H(we,z,de,X,se,xe,$e,Ce))},ye=($,M,z,de,X,se,xe,$e,Ce)=>{$=$||Bl,M=M||Bl;const ie=$.length,Ee=M.length,we=Math.min(ie,Ee);let Le;for(Le=0;Le<we;Le++){const Ve=M[Le]=Ce?An(M[Le]):ln(M[Le]);x($[Le],Ve,z,null,X,se,xe,$e,Ce)}ie>Ee?ve($,X,se,!0,!1,we):H(M,z,de,X,se,xe,$e,Ce,we)},be=($,M,z,de,X,se,xe,$e,Ce)=>{let ie=0;const Ee=M.length;let we=$.length-1,Le=Ee-1;for(;ie<=we&&ie<=Le;){const Ve=$[ie],We=M[ie]=Ce?An(M[ie]):ln(M[ie]);if(Dl(Ve,We))x(Ve,We,z,null,X,se,xe,$e,Ce);else break;ie++}for(;ie<=we&&ie<=Le;){const Ve=$[we],We=M[Le]=Ce?An(M[Le]):ln(M[Le]);if(Dl(Ve,We))x(Ve,We,z,null,X,se,xe,$e,Ce);else break;we--,Le--}if(ie>we){if(ie<=Le){const Ve=Le+1,We=Ve<Ee?M[Ve].el:de;for(;ie<=Le;)x(null,M[ie]=Ce?An(M[ie]):ln(M[ie]),z,We,X,se,xe,$e,Ce),ie++}}else if(ie>Le)for(;ie<=we;)le($[ie],X,se,!0),ie++;else{const Ve=ie,We=ie,tt=new Map;for(ie=We;ie<=Le;ie++){const ze=M[ie]=Ce?An(M[ie]):ln(M[ie]);ze.key!=null&&tt.set(ze.key,ie)}let at,st=0;const Ie=Le-We+1;let Qe=!1,ot=0;const Mt=new Array(Ie);for(ie=0;ie<Ie;ie++)Mt[ie]=0;for(ie=Ve;ie<=we;ie++){const ze=$[ie];if(st>=Ie){le(ze,X,se,!0);continue}let Ge;if(ze.key!=null)Ge=tt.get(ze.key);else for(at=We;at<=Le;at++)if(Mt[at-We]===0&&Dl(ze,M[at])){Ge=at;break}Ge===void 0?le(ze,X,se,!0):(Mt[Ge-We]=ie+1,Ge>=ot?ot=Ge:Qe=!0,x(ze,M[Ge],z,null,X,se,xe,$e,Ce),st++)}const je=Qe?vk(Mt):Bl;for(at=je.length-1,ie=Ie-1;ie>=0;ie--){const ze=We+ie,Ge=M[ze],Bt=M[ze+1],ra=ze+1<Ee?Bt.el||hg(Bt):de;Mt[ie]===0?x(null,Ge,z,ra,X,se,xe,$e,Ce):Qe&&(at<0||ie!==je[at]?ge(Ge,z,ra,2):at--)}}},ge=($,M,z,de,X=null)=>{const{el:se,type:xe,transition:$e,children:Ce,shapeFlag:ie}=$;if(ie&6){ge($.component.subTree,M,z,de);return}if(ie&128){$.suspense.move(M,z,de);return}if(ie&64){xe.move($,M,z,ee);return}if(xe===pe){n(se,M,z);for(let we=0;we<Ce.length;we++)ge(Ce[we],M,z,de);n($.anchor,M,z);return}if(xe===mi){L($,M,z);return}if(de!==2&&ie&1&&$e)if(de===0)$e.persisted&&!se[nn]?n(se,M,z):($e.beforeEnter(se),n(se,M,z),sa(()=>$e.enter(se),X));else{const{leave:we,delayLeave:Le,afterLeave:Ve}=$e,We=()=>{$.ctx.isUnmounted?r(se):n(se,M,z)},tt=()=>{const at=se._isLeaving||!!se[nn];se._isLeaving&&se[nn](!0),$e.persisted&&!at?We():we(se,()=>{We(),Ve&&Ve()})};Le?Le(se,We,tt):tt()}else n(se,M,z)},le=($,M,z,de=!1,X=!1)=>{const{type:se,props:xe,ref:$e,children:Ce,dynamicChildren:ie,shapeFlag:Ee,patchFlag:we,dirs:Le,cacheIndex:Ve,memo:We}=$;if(we===-2&&(X=!1),$e!=null&&(Bn(),Ko($e,null,z,$,!0),Fn()),Ve!=null&&(M.renderCache[Ve]=void 0),Ee&256){M.ctx.deactivate($);return}const tt=Ee&1&&Le,at=!zl($);let st;if(at&&(st=xe&&xe.onVnodeBeforeUnmount)&&Qa(st,M,$),Ee&6)fe($.component,z,de);else{if(Ee&128){$.suspense.unmount(z,de);return}tt&&Ur($,null,M,"beforeUnmount"),Ee&64?$.type.remove($,M,z,ee,de):ie&&!ie.hasOnce&&(se!==pe||we>0&&we&64)?ve(ie,M,z,!1,!0):(se===pe&&we&384||!X&&Ee&16)&&ve(Ce,M,z),de&&ce($)}const Ie=We!=null&&Ve==null;(at&&(st=xe&&xe.onVnodeUnmounted)||tt||Ie)&&sa(()=>{st&&Qa(st,M,$),tt&&Ur($,null,M,"unmounted"),Ie&&($.el=null)},z)},ce=$=>{const{type:M,el:z,anchor:de,transition:X}=$;if(M===pe){F(z,de);return}if(M===mi){D($);return}const se=()=>{r(z),X&&!X.persisted&&X.afterLeave&&X.afterLeave()};if($.shapeFlag&1&&X&&!X.persisted){const{leave:xe,delayLeave:$e}=X,Ce=()=>xe(z,se);$e?$e($.el,se,Ce):Ce()}else se()},F=($,M)=>{let z;for(;$!==M;)z=v($),r($),$=z;r(M)},fe=($,M,z)=>{const{bum:de,scope:X,job:se,subTree:xe,um:$e,m:Ce,a:ie}=$;cm(Ce),cm(ie),de&&pi(de),X.stop(),se&&(se.flags|=8,le(xe,$,M,z)),$e&&sa($e,M),sa(()=>{$.isUnmounted=!0},M)},ve=($,M,z,de=!1,X=!1,se=0)=>{for(let xe=se;xe<$.length;xe++)le($[xe],M,z,de,X)},J=$=>{if($.shapeFlag&6)return J($.component.subTree);if($.shapeFlag&128)return $.suspense.next();const M=v($.anchor||$.el),z=M&&M[zy];return z?v(z):M};let he=!1;const G=($,M,z)=>{let de;$==null?M._vnode&&(le(M._vnode,null,null,!0),de=M._vnode.component):x(M._vnode||null,$,M,null,null,null,z),M._vnode=$,he||(he=!0,Xp(de),Ly(),he=!1)},ee={p:x,um:le,m:ge,r:ce,mt:Z,mc:H,pc:oe,pbc:P,n:J,o:e};return{render:G,hydrate:void 0,createApp:Xx(G)}}function sc({type:e,props:t},a){return a==="svg"&&e==="foreignObject"||a==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:a}function Hr({effect:e,job:t},a){a?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function mk(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function mf(e,t,a=!1){const n=e.children,r=t.children;if(Ze(n)&&Ze(r))for(let l=0;l<n.length;l++){const o=n[l];let i=r[l];i.shapeFlag&1&&!i.dynamicChildren&&((i.patchFlag<=0||i.patchFlag===32)&&(i=r[l]=An(r[l]),i.el=o.el),!a&&i.patchFlag!==-2&&mf(o,i)),i.type===bu&&(i.patchFlag===-1&&(i=r[l]=An(i)),i.el=o.el),i.type===Ka&&!i.el&&(i.el=o.el)}}function vk(e){const t=e.slice(),a=[0];let n,r,l,o,i;const u=e.length;for(n=0;n<u;n++){const d=e[n];if(d!==0){if(r=a[a.length-1],e[r]<d){t[n]=r,a.push(n);continue}for(l=0,o=a.length-1;l<o;)i=l+o>>1,e[a[i]]<d?l=i+1:o=i;d<e[a[l]]&&(l>0&&(t[n]=a[l-1]),a[l]=n)}}for(l=a.length,o=a[l-1];l-- >0;)a[l]=o,o=t[o];return a}function vg(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:vg(t)}function cm(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function hg(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?hg(t.subTree):null}const yg=e=>e.__isSuspense;function hk(e,t){t&&t.pendingBranch?Ze(e)?t.effects.push(...e):t.effects.push(e):Cx(e)}const pe=Symbol.for("v-fgt"),bu=Symbol.for("v-txt"),Ka=Symbol.for("v-cmt"),mi=Symbol.for("v-stc"),Go=[];let ka=null;function p(e=!1){Go.push(ka=e?null:[])}function yk(){Go.pop(),ka=Go[Go.length-1]||null}let os=1;function Ti(e,t=!1){os+=e,e<0&&ka&&t&&(ka.hasOnce=!0)}function gg(e){return e.dynamicChildren=os>0?ka||Bl:null,yk(),os>0&&ka&&ka.push(e),e}function b(e,t,a,n,r,l){return gg(g(e,t,a,n,r,l,!0))}function U(e,t,a,n,r){return gg(R(e,t,a,n,r,!0))}function ss(e){return e?e.__v_isVNode===!0:!1}function Dl(e,t){return e.type===t.type&&e.key===t.key}const bg=({key:e})=>e??null,vi=({ref:e,ref_key:t,ref_for:a})=>(typeof e=="number"&&(e=""+e),e!=null?Tt(e)||wt(e)||rt(e)?{i:Zt,r:e,k:t,f:!!a}:e:null);function g(e,t=null,a=null,n=0,r=null,l=e===pe?0:1,o=!1,i=!1){const u={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&bg(t),ref:t&&vi(t),scopeId:By,slotScopeIds:null,children:a,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:l,patchFlag:n,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:Zt};return i?(vf(u,a),l&128&&e.normalize(u)):a&&(u.shapeFlag|=Tt(a)?8:16),os>0&&!o&&ka&&(u.patchFlag>0||l&6)&&u.patchFlag!==32&&ka.push(u),u}const R=gk;function gk(e,t=null,a=null,n=0,r=null,l=!1){if((!e||e===Zy)&&(e=Ka),ss(e)){const i=xr(e,t,!0);return a&&vf(i,a),os>0&&!l&&ka&&(i.shapeFlag&6?ka[ka.indexOf(e)]=i:ka.push(i)),i.patchFlag=-2,i}if(Ak(e)&&(e=e.__vccOpts),t){t=dt(t);let{class:i,style:u}=t;i&&!Tt(i)&&(t.class=me(i)),bt(u)&&(mu(u)&&!Ze(u)&&(u=zt({},u)),t.style=ua(u))}const o=Tt(e)?1:yg(e)?128:Ox(e)?64:bt(e)?4:rt(e)?2:0;return g(e,t,a,n,r,o,l,!0)}function dt(e){return e?mu(e)||ug(e)?zt({},e):e:null}function xr(e,t,a=!1,n=!1){const{props:r,ref:l,patchFlag:o,children:i,transition:u}=e,d=t?He(r||{},t):r,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:d,key:d&&bg(d),ref:t&&t.ref?a&&l?Ze(l)?l.concat(vi(t)):[l,vi(t)]:vi(t):l,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:i,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==pe?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:u,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&xr(e.ssContent),ssFallback:e.ssFallback&&xr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return u&&n&&ls(c,u.clone(c)),c}function _e(e=" ",t=0){return R(bu,null,e,t)}function bk(e,t){const a=R(mi,null,e);return a.staticCount=t,a}function Y(e="",t=!1){return t?(p(),U(Ka,null,e)):R(Ka,null,e)}function ln(e){return e==null||typeof e=="boolean"?R(Ka):Ze(e)?R(pe,null,e.slice()):ss(e)?An(e):R(bu,null,String(e))}function An(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:xr(e)}function vf(e,t){let a=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Ze(t))a=16;else if(typeof t=="object")if(n&65){const r=t.default;r&&(r._c&&(r._d=!1),vf(e,r()),r._c&&(r._d=!0));return}else{a=32;const r=t._;!r&&!ug(t)?t._ctx=Zt:r===3&&Zt&&(Zt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else rt(t)?(t={default:t,_ctx:Zt},a=32):(t=String(t),n&64?(a=16,t=[_e(t)]):a=8);e.children=t,e.shapeFlag|=a}function He(...e){const t={};for(let a=0;a<e.length;a++){const n=e[a];for(const r in n)if(r==="class")t.class!==n.class&&(t.class=me([t.class,n.class]));else if(r==="style")t.style=ua([t.style,n.style]);else if(nu(r)){const l=t[r],o=n[r];o&&l!==o&&!(Ze(l)&&l.includes(o))?t[r]=l?[].concat(l,o):o:o==null&&l==null&&!ru(r)&&(t[r]=o)}else r!==""&&(t[r]=n[r])}return t}function Qa(e,t,a,n=null){Ia(e,t,7,[a,n])}const _k=rg();let xk=0;function kk(e,t,a){const n=e.type,r=(t?t.appContext:e.appContext)||_k,l={uid:xk++,vnode:e,type:n,parent:t,appContext:r,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new fy(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(r.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:dg(n,r),emitsOptions:lg(n,r),emit:null,emitted:null,propsDefaults:Ct,inheritAttrs:n.inheritAttrs,ctx:Ct,data:Ct,props:Ct,attrs:Ct,slots:Ct,refs:Ct,setupState:Ct,setupContext:null,suspense:a,suspenseId:a?a.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=ek.bind(null,l),e.ce&&e.ce(l),l}let na=null;const bn=()=>na||Zt;let Oi,hd;{const e=uu(),t=(a,n)=>{let r;return(r=e[a])||(r=e[a]=[]),r.push(n),l=>{r.length>1?r.forEach(o=>o(l)):r[0](l)}};Oi=t("__VUE_INSTANCE_SETTERS__",a=>na=a),hd=t("__VUE_SSR_SETTERS__",a=>is=a)}const Ss=e=>{const t=na;return Oi(e),e.scope.on(),()=>{e.scope.off(),Oi(t)}},dm=()=>{na&&na.scope.off(),Oi(null)};function _g(e){return e.vnode.shapeFlag&4}let is=!1;function wk(e,t=!1,a=!1){t&&hd(t);const{props:n,children:r}=e.vnode,l=_g(e);ok(e,n,l,t),ck(e,r,a||t);const o=l?$k(e,t):void 0;return t&&hd(!1),o}function $k(e,t){const a=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Hx);const{setup:n}=a;if(n){Bn();const r=e.setupContext=n.length>1?Ck(e):null,l=Ss(e),o=$s(n,e,0,[e.props,r]),i=ry(o);if(Fn(),l(),(i||e.sp)&&!zl(e)&&Uy(e),i){if(o.then(dm,dm),t)return o.then(u=>{fm(e,u)}).catch(u=>{vu(u,e,0)});e.asyncDep=o}else fm(e,o)}else xg(e)}function fm(e,t,a){rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:bt(t)&&(e.setupState=Py(t)),xg(e)}function xg(e,t,a){const n=e.type;e.render||(e.render=n.render||fn);{const r=Ss(e);Bn();try{Kx(e)}finally{Fn(),r()}}}const Sk={get(e,t){return aa(e,"get",""),e[t]}};function Ck(e){const t=a=>{e.exposed=a||{}};return{attrs:new Proxy(e.attrs,Sk),slots:e.slots,emit:e.emit,expose:t}}function _u(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Py(wi(e.exposed)),{get(t,a){if(a in t)return t[a];if(a in Wo)return Wo[a](e)},has(t,a){return a in t||a in Wo}})):e.proxy}function Ek(e,t=!0){return rt(e)?e.displayName||e.name:e.name||t&&e.__name}function Ak(e){return rt(e)&&"__vccOpts"in e}const _=(e,t)=>xx(e,t,is);function Ra(e,t,a){try{Ti(-1);const n=arguments.length;return n===2?bt(t)&&!Ze(t)?ss(t)?R(e,null,[t]):R(e,t):R(e,null,t):(n>3?a=Array.prototype.slice.call(arguments,2):n===3&&ss(a)&&(a=[a]),R(e,t,a))}finally{Ti(1)}}const Tk="3.5.35";let yd;const pm=typeof window<"u"&&window.trustedTypes;if(pm)try{yd=pm.createPolicy("vue",{createHTML:e=>e})}catch{}const kg=yd?e=>yd.createHTML(e):e=>e,Ok="http://www.w3.org/2000/svg",Dk="http://www.w3.org/1998/Math/MathML",Cn=typeof document<"u"?document:null,mm=Cn&&Cn.createElement("template"),Mk={insert:(e,t,a)=>{t.insertBefore(e,a||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,a,n)=>{const r=t==="svg"?Cn.createElementNS(Ok,e):t==="mathml"?Cn.createElementNS(Dk,e):a?Cn.createElement(e,{is:a}):Cn.createElement(e);return e==="select"&&n&&n.multiple!=null&&r.setAttribute("multiple",n.multiple),r},createText:e=>Cn.createTextNode(e),createComment:e=>Cn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Cn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,a,n,r,l){const o=a?a.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),a),!(r===l||!(r=r.nextSibling)););else{mm.innerHTML=kg(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const i=mm.content;if(n==="svg"||n==="mathml"){const u=i.firstChild;for(;u.firstChild;)i.appendChild(u.firstChild);i.removeChild(u)}t.insertBefore(i,a)}return[o?o.nextSibling:t.firstChild,a?a.previousSibling:t.lastChild]}},lr="transition",ko="animation",Xl=Symbol("_vtc"),wg={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Pk=zt({},qx,wg),Kr=(e,t=[])=>{Ze(e)?e.forEach(a=>a(...t)):e&&e(...t)},vm=e=>e?Ze(e)?e.some(t=>t.length>1):e.length>1:!1;function Rk(e){const t={};for(const O in e)O in wg||(t[O]=e[O]);if(e.css===!1)return t;const{name:a="v",type:n,duration:r,enterFromClass:l=`${a}-enter-from`,enterActiveClass:o=`${a}-enter-active`,enterToClass:i=`${a}-enter-to`,appearFromClass:u=l,appearActiveClass:d=o,appearToClass:c=i,leaveFromClass:f=`${a}-leave-from`,leaveActiveClass:v=`${a}-leave-active`,leaveToClass:m=`${a}-leave-to`}=e,y=Ik(r),x=y&&y[0],S=y&&y[1],{onBeforeEnter:k,onEnter:C,onEnterCancelled:L,onLeave:D,onLeaveCancelled:T,onBeforeAppear:I=k,onAppear:q=C,onAppearCancelled:H=L}=t,E=(O,N,Z,W)=>{O._enterCancelled=W,dr(O,N?c:i),dr(O,N?d:o),Z&&Z()},P=(O,N)=>{O._isLeaving=!1,dr(O,f),dr(O,m),dr(O,v),N&&N()},j=O=>(N,Z)=>{const W=O?q:C,K=()=>E(N,O,Z);Kr(W,[N,K]),hm(()=>{dr(N,O?u:l),en(N,O?c:i),vm(W)||ym(N,n,x,K)})};return zt(t,{onBeforeEnter(O){Kr(k,[O]),en(O,l),en(O,o)},onBeforeAppear(O){Kr(I,[O]),en(O,u),en(O,d)},onEnter:j(!1),onAppear:j(!0),onLeave(O,N){O._isLeaving=!0;const Z=()=>P(O,N);en(O,f),O._enterCancelled?(en(O,v),gd(O)):(gd(O),en(O,v)),hm(()=>{O._isLeaving&&(dr(O,f),en(O,m),vm(D)||ym(O,n,S,Z))}),Kr(D,[O,Z])},onEnterCancelled(O){E(O,!1,void 0,!0),Kr(L,[O])},onAppearCancelled(O){E(O,!0,void 0,!0),Kr(H,[O])},onLeaveCancelled(O){P(O),Kr(T,[O])}})}function Ik(e){if(e==null)return null;if(bt(e))return[ic(e.enter),ic(e.leave)];{const t=ic(e);return[t,t]}}function ic(e){return F_(e)}function en(e,t){t.split(/\s+/).forEach(a=>a&&e.classList.add(a)),(e[Xl]||(e[Xl]=new Set)).add(t)}function dr(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.remove(n));const a=e[Xl];a&&(a.delete(t),a.size||(e[Xl]=void 0))}function hm(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let qk=0;function ym(e,t,a,n){const r=e._endId=++qk,l=()=>{r===e._endId&&n()};if(a!=null)return setTimeout(l,a);const{type:o,timeout:i,propCount:u}=$g(e,t);if(!o)return n();const d=o+"end";let c=0;const f=()=>{e.removeEventListener(d,v),l()},v=m=>{m.target===e&&++c>=u&&f()};setTimeout(()=>{c<u&&f()},i+1),e.addEventListener(d,v)}function $g(e,t){const a=window.getComputedStyle(e),n=y=>(a[y]||"").split(", "),r=n(`${lr}Delay`),l=n(`${lr}Duration`),o=gm(r,l),i=n(`${ko}Delay`),u=n(`${ko}Duration`),d=gm(i,u);let c=null,f=0,v=0;t===lr?o>0&&(c=lr,f=o,v=l.length):t===ko?d>0&&(c=ko,f=d,v=u.length):(f=Math.max(o,d),c=f>0?o>d?lr:ko:null,v=c?c===lr?l.length:u.length:0);const m=c===lr&&/\b(?:transform|all)(?:,|$)/.test(n(`${lr}Property`).toString());return{type:c,timeout:f,propCount:v,hasTransform:m}}function gm(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((a,n)=>bm(a)+bm(e[n])))}function bm(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function gd(e){return(e?e.ownerDocument:document).body.offsetHeight}function Lk(e,t,a){const n=e[Xl];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):a?e.setAttribute("class",t):e.className=t}const Di=Symbol("_vod"),Sg=Symbol("_vsh"),us={name:"show",beforeMount(e,{value:t},{transition:a}){e[Di]=e.style.display==="none"?"":e.style.display,a&&t?a.beforeEnter(e):wo(e,t)},mounted(e,{value:t},{transition:a}){a&&t&&a.enter(e)},updated(e,{value:t,oldValue:a},{transition:n}){!t!=!a&&(n?t?(n.beforeEnter(e),wo(e,!0),n.enter(e)):n.leave(e,()=>{wo(e,!1)}):wo(e,t))},beforeUnmount(e,{value:t}){wo(e,t)}};function wo(e,t){e.style.display=t?e[Di]:"none",e[Sg]=!t}const Nk=Symbol(""),Bk=/(?:^|;)\s*display\s*:/;function Fk(e,t,a){const n=e.style,r=Tt(a);let l=!1;if(a&&!r){if(t)if(Tt(t))for(const o of t.split(";")){const i=o.slice(0,o.indexOf(":")).trim();a[i]==null&&No(n,i,"")}else for(const o in t)a[o]==null&&No(n,o,"");for(const o in a){o==="display"&&(l=!0);const i=a[o];i!=null?zk(e,o,!Tt(t)&&t?t[o]:void 0,i)||No(n,o,i):No(n,o,"")}}else if(r){if(t!==a){const o=n[Nk];o&&(a+=";"+o),n.cssText=a,l=Bk.test(a)}}else t&&e.removeAttribute("style");Di in e&&(e[Di]=l?n.display:"",e[Sg]&&(n.display="none"))}const _m=/\s*!important$/;function No(e,t,a){if(Ze(a))a.forEach(n=>No(e,t,n));else if(a==null&&(a=""),t.startsWith("--"))e.setProperty(t,a);else{const n=Vk(e,t);_m.test(a)?e.setProperty(Pr(n),a.replace(_m,""),"important"):e[n]=a}}const xm=["Webkit","Moz","ms"],uc={};function Vk(e,t){const a=uc[t];if(a)return a;let n=Xt(t);if(n!=="filter"&&n in e)return uc[t]=n;n=iu(n);for(let r=0;r<xm.length;r++){const l=xm[r]+n;if(l in e)return uc[t]=l}return t}function zk(e,t,a,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Tt(n)&&a===n}const km="http://www.w3.org/1999/xlink";function wm(e,t,a,n,r,l=K_(t)){n&&t.startsWith("xlink:")?a==null?e.removeAttributeNS(km,t.slice(6,t.length)):e.setAttributeNS(km,t,a):a==null||l&&!iy(a)?e.removeAttribute(t):e.setAttribute(t,l?"":Ca(a)?String(a):a)}function $m(e,t,a,n,r){if(t==="innerHTML"||t==="textContent"){a!=null&&(e[t]=t==="innerHTML"?kg(a):a);return}const l=e.tagName;if(t==="value"&&l!=="PROGRESS"&&!l.includes("-")){const i=l==="OPTION"?e.getAttribute("value")||"":e.value,u=a==null?e.type==="checkbox"?"on":"":String(a);(i!==u||!("_value"in e))&&(e.value=u),a==null&&e.removeAttribute(t),e._value=a;return}let o=!1;if(a===""||a==null){const i=typeof e[t];i==="boolean"?a=iy(a):a==null&&i==="string"?(a="",o=!0):i==="number"&&(a=0,o=!0)}try{e[t]=a}catch{}o&&e.removeAttribute(r||t)}function el(e,t,a,n){e.addEventListener(t,a,n)}function jk(e,t,a,n){e.removeEventListener(t,a,n)}const Sm=Symbol("_vei");function Uk(e,t,a,n,r=null){const l=e[Sm]||(e[Sm]={}),o=l[t];if(n&&o)o.value=n;else{const[i,u]=Hk(t);if(n){const d=l[t]=Gk(n,r);el(e,i,d,u)}else o&&(jk(e,i,o,u),l[t]=void 0)}}const Cm=/(?:Once|Passive|Capture)$/;function Hk(e){let t;if(Cm.test(e)){t={};let n;for(;n=e.match(Cm);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Pr(e.slice(2)),t]}let cc=0;const Kk=Promise.resolve(),Wk=()=>cc||(Kk.then(()=>cc=0),cc=Date.now());function Gk(e,t){const a=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=a.attached)return;const r=a.value;if(Ze(r)){const l=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{l.call(n),n._stopped=!0};const o=r.slice(),i=[n];for(let u=0;u<o.length&&!n._stopped;u++){const d=o[u];d&&Ia(d,t,5,i)}}else Ia(r,t,5,[n])};return a.value=e,a.attached=Wk(),a}const Em=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Yk=(e,t,a,n,r,l)=>{const o=r==="svg";t==="class"?Lk(e,n,o):t==="style"?Fk(e,a,n):nu(t)?ru(t)||Uk(e,t,a,n,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Jk(e,t,n,o))?($m(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&wm(e,t,n,o,l,t!=="value")):e._isVueCE&&(Zk(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Tt(n)))?$m(e,Xt(t),n,l,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),wm(e,t,n,o))};function Jk(e,t,a,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&Em(t)&&rt(a));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Em(t)&&Tt(a)?!1:t in e}function Zk(e,t){const a=e._def.props;if(!a)return!1;const n=Xt(t);return Array.isArray(a)?a.some(r=>Xt(r)===n):Object.keys(a).some(r=>Xt(r)===n)}const Cg=new WeakMap,Eg=new WeakMap,Mi=Symbol("_moveCb"),Am=Symbol("_enterCb"),Xk=e=>(delete e.props.mode,e),Qk=Xk({name:"TransitionGroup",props:zt({},Pk,{tag:String,moveClass:String}),setup(e,{slots:t}){const a=bn(),n=Ix();let r,l;return df(()=>{if(!r.length)return;const o=e.moveClass||`${e.name||"v"}-move`;if(!rw(r[0].el,a.vnode.el,o)){r=[];return}r.forEach(tw),r.forEach(aw);const i=r.filter(nw);gd(a.vnode.el),i.forEach(u=>{const d=u.el,c=d.style;en(d,o),c.transform=c.webkitTransform=c.transitionDuration="";const f=d[Mi]=v=>{v&&v.target!==d||(!v||v.propertyName.endsWith("transform"))&&(d.removeEventListener("transitionend",f),d[Mi]=null,dr(d,o))};d.addEventListener("transitionend",f)}),r=[]}),()=>{const o=vt(e),i=Rk(o);let u=o.tag||pe;if(r=[],l)for(let d=0;d<l.length;d++){const c=l[d];c.el&&c.el instanceof Element&&(r.push(c),ls(c,cd(c,i,n,a)),Cg.set(c,Ag(c.el)))}l=t.default?jy(t.default()):[];for(let d=0;d<l.length;d++){const c=l[d];c.key!=null&&ls(c,cd(c,i,n,a))}return R(u,null,l)}}}),ew=Qk;function tw(e){const t=e.el;t[Mi]&&t[Mi](),t[Am]&&t[Am]()}function aw(e){Eg.set(e,Ag(e.el))}function nw(e){const t=Cg.get(e),a=Eg.get(e),n=t.left-a.left,r=t.top-a.top;if(n||r){const l=e.el,o=l.style,i=l.getBoundingClientRect();let u=1,d=1;return l.offsetWidth&&(u=i.width/l.offsetWidth),l.offsetHeight&&(d=i.height/l.offsetHeight),(!Number.isFinite(u)||u===0)&&(u=1),(!Number.isFinite(d)||d===0)&&(d=1),Math.abs(u-1)<.01&&(u=1),Math.abs(d-1)<.01&&(d=1),o.transform=o.webkitTransform=`translate(${n/u}px,${r/d}px)`,o.transitionDuration="0s",e}}function Ag(e){const t=e.getBoundingClientRect();return{left:t.left,top:t.top}}function rw(e,t,a){const n=e.cloneNode(),r=e[Xl];r&&r.forEach(i=>{i.split(/\s+/).forEach(u=>u&&n.classList.remove(u))}),a.split(/\s+/).forEach(i=>i&&n.classList.add(i)),n.style.display="none";const l=t.nodeType===1?t:t.parentNode;l.appendChild(n);const{hasTransform:o}=$g(n);return l.removeChild(n),o}const Pi=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ze(t)?a=>pi(t,a):t};function lw(e){e.target.composing=!0}function Tm(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ul=Symbol("_assign");function Om(e,t,a){return t&&(e=e.trim()),a&&(e=nf(e)),e}const kr={created(e,{modifiers:{lazy:t,trim:a,number:n}},r){e[Ul]=Pi(r);const l=n||r.props&&r.props.type==="number";el(e,t?"change":"input",o=>{o.target.composing||e[Ul](Om(e.value,a,l))}),(a||l)&&el(e,"change",()=>{e.value=Om(e.value,a,l)}),t||(el(e,"compositionstart",lw),el(e,"compositionend",Tm),el(e,"change",Tm))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:a,modifiers:{lazy:n,trim:r,number:l}},o){if(e[Ul]=Pi(o),e.composing)return;const i=(l||e.type==="number")&&!/^0\d/.test(e.value)?nf(e.value):e.value,u=t??"";if(i===u)return;const d=e.getRootNode();(d instanceof Document||d instanceof ShadowRoot)&&d.activeElement===e&&e.type!=="range"&&(n&&t===a||r&&e.value.trim()===u)||(e.value=u)}},ow={deep:!0,created(e,t,a){e[Ul]=Pi(a),el(e,"change",()=>{const n=e._modelValue,r=sw(e),l=e.checked,o=e[Ul];if(Ze(n)){const i=uy(n,r),u=i!==-1;if(l&&!u)o(n.concat(r));else if(!l&&u){const d=[...n];d.splice(i,1),o(d)}}else if(lu(n)){const i=new Set(n);l?i.add(r):i.delete(r),o(i)}else o(Tg(e,l))})},mounted:Dm,beforeUpdate(e,t,a){e[Ul]=Pi(a),Dm(e,t,a)}};function Dm(e,{value:t,oldValue:a},n){e._modelValue=t;let r;if(Ze(t))r=uy(t,n.props.value)>-1;else if(lu(t))r=t.has(n.props.value);else{if(t===a)return;r=ws(t,Tg(e,!0))}e.checked!==r&&(e.checked=r)}function sw(e){return"_value"in e?e._value:e.value}function Tg(e,t){const a=t?"_trueValue":"_falseValue";return a in e?e[a]:t}const iw=["ctrl","shift","alt","meta"],uw={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>iw.some(a=>e[`${a}Key`]&&!t.includes(a))},yt=(e,t)=>{if(!e)return e;const a=e._withMods||(e._withMods={}),n=t.join(".");return a[n]||(a[n]=((r,...l)=>{for(let o=0;o<t.length;o++){const i=uw[t[o]];if(i&&i(r,t))return}return e(r,...l)}))},cw={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},mn=(e,t)=>{const a=e._withKeys||(e._withKeys={}),n=t.join(".");return a[n]||(a[n]=(r=>{if(!("key"in r))return;const l=Pr(r.key);if(t.some(o=>o===l||cw[o]===l))return e(r)}))},dw=zt({patchProp:Yk},Mk);let Mm;function fw(){return Mm||(Mm=fk(dw))}const pw=((...e)=>{const t=fw().createApp(...e),{mount:a}=t;return t.mount=n=>{const r=vw(n);if(!r)return;const l=t._component;!rt(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const o=a(r,!1,mw(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),o},t});function mw(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function vw(e){return Tt(e)?document.querySelector(e):e}const Ml=typeof document<"u";function Og(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function hw(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&Og(e.default)}const _t=Object.assign;function dc(e,t){const a={};for(const n in t){const r=t[n];a[n]=Wa(r)?r.map(e):e(r)}return a}const Yo=()=>{},Wa=Array.isArray;function Pm(e,t){const a={};for(const n in e)a[n]=n in t?t[n]:e[n];return a}const Dg=Symbol("");function Ql(e,t){return _t(new Error,{type:e,[Dg]:!0},t)}function tn(e,t){return e instanceof Error&&Dg in e&&(t==null||!!(e.type&t))}const hf=Symbol(""),Rm=Symbol(""),xu=Symbol(""),yf=Symbol(""),bd=Symbol("");function _n(){return ct(xu)}function ya(e){return ct(yf)}const Mg=/#/g,yw=/&/g,gw=/\//g,bw=/=/g,_w=/\?/g,Pg=/\+/g,xw=/%5B/g,kw=/%5D/g,Rg=/%5E/g,ww=/%60/g,Ig=/%7B/g,$w=/%7C/g,qg=/%7D/g,Sw=/%20/g;function gf(e){return e==null?"":encodeURI(""+e).replace($w,"|").replace(xw,"[").replace(kw,"]")}function Cw(e){return gf(e).replace(Ig,"{").replace(qg,"}").replace(Rg,"^")}function _d(e){return gf(e).replace(Pg,"%2B").replace(Sw,"+").replace(Mg,"%23").replace(yw,"%26").replace(ww,"`").replace(Ig,"{").replace(qg,"}").replace(Rg,"^")}function Ew(e){return _d(e).replace(bw,"%3D")}function Aw(e){return gf(e).replace(Mg,"%23").replace(_w,"%3F")}function Tw(e){return Aw(e).replace(gw,"%2F")}function Ri(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Ow=/\/$/,Dw=e=>e.replace(Ow,"");function fc(e,t,a="/"){let n,r={},l="",o="";const i=t.indexOf("#");let u=t.indexOf("?");return u=i>=0&&u>i?-1:u,u>=0&&(n=t.slice(0,u),l=t.slice(u,i>0?i:t.length),r=e(l.slice(1))),i>=0&&(n=n||t.slice(0,i),o=t.slice(i,t.length)),n=Iw(n??t,a),{fullPath:n+l+o,path:n,query:r,hash:Ri(o)}}function Mw(e,t){const a=t.query?e(t.query):"";return t.path+(a&&"?")+a+(t.hash||"")}function Im(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function Pw(e,t,a){const n=t.matched.length-1,r=a.matched.length-1;return n>-1&&n===r&&eo(t.matched[n],a.matched[r])&&Lg(t.params,a.params)&&e(t.query)===e(a.query)&&t.hash===a.hash}function eo(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Lg(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var a in e)if(!Rw(e[a],t[a]))return!1;return!0}function Rw(e,t){return Wa(e)?qm(e,t):Wa(t)?qm(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function qm(e,t){return Wa(t)?e.length===t.length&&e.every((a,n)=>a===t[n]):e.length===1&&e[0]===t}function Iw(e,t){if(e.startsWith("/"))return e;if(!e)return t;const a=t.split("/"),n=e.split("/"),r=n[n.length-1];(r===".."||r===".")&&n.push("");let l=a.length-1,o,i;for(o=0;o<n.length;o++)if(i=n[o],i!==".")if(i==="..")l>1&&l--;else break;return a.slice(0,l).join("/")+"/"+n.slice(o).join("/")}const or={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function qw(e){if(!e)if(Ml){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Dw(e)}const Lw=/^[^#]+#/;function Nw(e,t){return e.replace(Lw,"#")+t}function Bw(e,t){const a=document.documentElement.getBoundingClientRect(),n=e.getBoundingClientRect();return{behavior:t.behavior,left:n.left-a.left-(t.left||0),top:n.top-a.top-(t.top||0)}}const ku=()=>({left:window.scrollX,top:window.scrollY});function Fw(e){let t;if("el"in e){const a=e.el,n=typeof a=="string"&&a.startsWith("#"),r=typeof a=="string"?n?document.getElementById(a.slice(1)):document.querySelector(a):a;if(!r)return;t=Bw(r,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Lm(e,t){return(history.state?history.state.position-t:-1)+e}const xd=new Map;function Vw(e,t){xd.set(e,t)}function zw(e){const t=xd.get(e);return xd.delete(e),t}function jw(e){return typeof e=="string"||e&&typeof e=="object"}function Ng(e){return typeof e=="string"||typeof e=="symbol"}function Uw(e){const t={};if(e===""||e==="?")return t;const a=(e[0]==="?"?e.slice(1):e).split("&");for(let n=0;n<a.length;++n){const r=a[n].replace(Pg," "),l=r.indexOf("="),o=Ri(l<0?r:r.slice(0,l)),i=l<0?null:Ri(r.slice(l+1));if(o in t){let u=t[o];Wa(u)||(u=t[o]=[u]),u.push(i)}else t[o]=i}return t}function Nm(e){let t="";for(let a in e){const n=e[a];if(a=Ew(a),n==null){n!==void 0&&(t+=(t.length?"&":"")+a);continue}(Wa(n)?n.map(r=>r&&_d(r)):[n&&_d(n)]).forEach(r=>{r!==void 0&&(t+=(t.length?"&":"")+a,r!=null&&(t+="="+r))})}return t}function Hw(e){const t={};for(const a in e){const n=e[a];n!==void 0&&(t[a]=Wa(n)?n.map(r=>r==null?null:""+r):n==null?n:""+n)}return t}function $o(){let e=[];function t(n){return e.push(n),()=>{const r=e.indexOf(n);r>-1&&e.splice(r,1)}}function a(){e=[]}return{add:t,list:()=>e.slice(),reset:a}}function Bg(e,t,a){const n=e.value;if(!n)return;let r=n;const l=()=>{r[t].delete(a)};Wn(l),Wy(l),Ky(()=>{const o=e.value;o&&(r=o),r[t].add(a)}),r[t].add(a)}function Fg(e){Bg(ct(hf,{}),"leaveGuards",e)}function Kw(e){Bg(ct(hf,{}),"updateGuards",e)}function mr(e,t,a,n,r,l=o=>o()){const o=n&&(n.enterCallbacks[r]=n.enterCallbacks[r]||[]);return()=>new Promise((i,u)=>{const d=v=>{v===!1?u(Ql(4,{from:a,to:t})):v instanceof Error?u(v):jw(v)?u(Ql(2,{from:t,to:v})):(o&&n.enterCallbacks[r]===o&&typeof v=="function"&&o.push(v),i())},c=l(()=>e.call(n&&n.instances[r],t,a,d));let f=Promise.resolve(c);e.length<3&&(f=f.then(d)),f.catch(v=>u(v))})}function pc(e,t,a,n,r=l=>l()){const l=[];for(const o of e)for(const i in o.components){let u=o.components[i];if(!(t!=="beforeRouteEnter"&&!o.instances[i]))if(Og(u)){const d=(u.__vccOpts||u)[t];d&&l.push(mr(d,a,n,o,i,r))}else{let d=u();l.push(()=>d.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${i}" at "${o.path}"`);const f=hw(c)?c.default:c;o.mods[i]=c,o.components[i]=f;const v=(f.__vccOpts||f)[t];return v&&mr(v,a,n,o,i,r)()}))}}return l}function Ww(e,t){const a=[],n=[],r=[],l=Math.max(t.matched.length,e.matched.length);for(let o=0;o<l;o++){const i=t.matched[o];i&&(e.matched.find(d=>eo(d,i))?n.push(i):a.push(i));const u=e.matched[o];u&&(t.matched.find(d=>eo(d,u))||r.push(u))}return[a,n,r]}let Gw=()=>location.protocol+"//"+location.host;function Vg(e,t){const{pathname:a,search:n,hash:r}=t,l=e.indexOf("#");if(l>-1){let o=r.includes(e.slice(l))?e.slice(l).length:1,i=r.slice(o);return i[0]!=="/"&&(i="/"+i),Im(i,"")}return Im(a,e)+n+r}function Yw(e,t,a,n){let r=[],l=[],o=null;const i=({state:v})=>{const m=Vg(e,location),y=a.value,x=t.value;let S=0;if(v){if(a.value=m,t.value=v,o&&o===y){o=null;return}S=x?v.position-x.position:0}else n(m);r.forEach(k=>{k(a.value,y,{delta:S,type:"pop",direction:S?S>0?"forward":"back":""})})};function u(){o=a.value}function d(v){r.push(v);const m=()=>{const y=r.indexOf(v);y>-1&&r.splice(y,1)};return l.push(m),m}function c(){if(document.visibilityState==="hidden"){const{history:v}=window;if(!v.state)return;v.replaceState(_t({},v.state,{scroll:ku()}),"")}}function f(){for(const v of l)v();l=[],window.removeEventListener("popstate",i),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",i),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:u,listen:d,destroy:f}}function Bm(e,t,a,n=!1,r=!1){return{back:e,current:t,forward:a,replaced:n,position:window.history.length,scroll:r?ku():null}}function Jw(e){const{history:t,location:a}=window,n={value:Vg(e,a)},r={value:t.state};r.value||l(n.value,{back:null,current:n.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function l(u,d,c){const f=e.indexOf("#"),v=f>-1?(a.host&&document.querySelector("base")?e:e.slice(f))+u:Gw()+e+u;try{t[c?"replaceState":"pushState"](d,"",v),r.value=d}catch(m){console.error(m),a[c?"replace":"assign"](v)}}function o(u,d){l(u,_t({},t.state,Bm(r.value.back,u,r.value.forward,!0),d,{position:r.value.position}),!0),n.value=u}function i(u,d){const c=_t({},r.value,t.state,{forward:u,scroll:ku()});l(c.current,c,!0),l(u,_t({},Bm(n.value,u,null),{position:c.position+1},d),!1),n.value=u}return{location:n,state:r,push:i,replace:o}}function Zw(e){e=qw(e);const t=Jw(e),a=Yw(e,t.state,t.location,t.replace);function n(l,o=!0){o||a.pauseListeners(),history.go(l)}const r=_t({location:"",base:e,go:n,createHref:Nw.bind(null,e)},t,a);return Object.defineProperty(r,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(r,"state",{enumerable:!0,get:()=>t.state.value}),r}const Xw={type:0,value:""},Qw=/[a-zA-Z0-9_]/;function e2(e){if(!e)return[[]];if(e==="/")return[[Xw]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${a})/"${d}": ${m}`)}let a=0,n=a;const r=[];let l;function o(){l&&r.push(l),l=[]}let i=0,u,d="",c="";function f(){d&&(a===0?l.push({type:0,value:d}):a===1||a===2||a===3?(l.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${d}) must be alone in its segment. eg: '/:ids+.`),l.push({type:1,value:d,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),d="")}function v(){d+=u}for(;i<e.length;)switch(u=e[i++],a){case 0:u==="\\"?(n=a,a=4):u==="/"?(d&&f(),o()):u===":"?(f(),a=1):v();break;case 4:v(),a=n;break;case 1:u==="("?a=2:Qw.test(u)?v():(f(),a=0,u!=="*"&&u!=="?"&&u!=="+"&&i--);break;case 2:u===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+u:a=3:c+=u;break;case 3:f(),a=0,u!=="*"&&u!=="?"&&u!=="+"&&i--,c="";break;default:t("Unknown state");break}return a===2&&t(`Unfinished custom RegExp for param "${d}"`),f(),o(),r}const Fm="[^/]+?",t2={sensitive:!1,strict:!1,start:!0,end:!0},a2=/[.+*?^${}()[\]/\\]/g;function n2(e,t){const a=_t({},t2,t),n=[];let r=a.start?"^":"";const l=[];for(const d of e){const c=d.length?[]:[90];a.strict&&!d.length&&(r+="/");for(let f=0;f<d.length;f++){const v=d[f];let m=40+(a.sensitive?.25:0);if(v.type===0)f||(r+="/"),r+=v.value.replace(a2,"\\$&"),m+=40;else if(v.type===1){const{value:y,repeatable:x,optional:S,regexp:k}=v;l.push({name:y,repeatable:x,optional:S});const C=k||Fm;if(C!==Fm){m+=10;try{new RegExp(`(${C})`)}catch(D){throw new Error(`Invalid custom RegExp for param "${y}" (${C}): `+D.message)}}let L=x?`((?:${C})(?:/(?:${C}))*)`:`(${C})`;f||(L=S&&d.length<2?`(?:/${L})`:"/"+L),S&&(L+="?"),r+=L,m+=20,S&&(m+=-8),x&&(m+=-20),C===".*"&&(m+=-50)}c.push(m)}n.push(c)}if(a.strict&&a.end){const d=n.length-1;n[d][n[d].length-1]+=.7000000000000001}a.strict||(r+="/?"),a.end?r+="$":a.strict&&!r.endsWith("/")&&(r+="(?:/|$)");const o=new RegExp(r,a.sensitive?"":"i");function i(d){const c=d.match(o),f={};if(!c)return null;for(let v=1;v<c.length;v++){const m=c[v]||"",y=l[v-1];f[y.name]=m&&y.repeatable?m.split("/"):m}return f}function u(d){let c="",f=!1;for(const v of e){(!f||!c.endsWith("/"))&&(c+="/"),f=!1;for(const m of v)if(m.type===0)c+=m.value;else if(m.type===1){const{value:y,repeatable:x,optional:S}=m,k=y in d?d[y]:"";if(Wa(k)&&!x)throw new Error(`Provided param "${y}" is an array but it is not repeatable (* or + modifiers)`);const C=Wa(k)?k.join("/"):k;if(!C)if(S)v.length<2&&(c.endsWith("/")?c=c.slice(0,-1):f=!0);else throw new Error(`Missing required param "${y}"`);c+=C}}return c||"/"}return{re:o,score:n,keys:l,parse:i,stringify:u}}function r2(e,t){let a=0;for(;a<e.length&&a<t.length;){const n=t[a]-e[a];if(n)return n;a++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function zg(e,t){let a=0;const n=e.score,r=t.score;for(;a<n.length&&a<r.length;){const l=r2(n[a],r[a]);if(l)return l;a++}if(Math.abs(r.length-n.length)===1){if(Vm(n))return 1;if(Vm(r))return-1}return r.length-n.length}function Vm(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const l2={strict:!1,end:!0,sensitive:!1};function o2(e,t,a){const n=n2(e2(e.path),a),r=_t(n,{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function s2(e,t){const a=[],n=new Map;t=Pm(l2,t);function r(f){return n.get(f)}function l(f,v,m){const y=!m,x=jm(f);x.aliasOf=m&&m.record;const S=Pm(t,f),k=[x];if("alias"in f){const D=typeof f.alias=="string"?[f.alias]:f.alias;for(const T of D)k.push(jm(_t({},x,{components:m?m.record.components:x.components,path:T,aliasOf:m?m.record:x})))}let C,L;for(const D of k){const{path:T}=D;if(v&&T[0]!=="/"){const I=v.record.path,q=I[I.length-1]==="/"?"":"/";D.path=v.record.path+(T&&q+T)}if(C=o2(D,v,S),m?m.alias.push(C):(L=L||C,L!==C&&L.alias.push(C),y&&f.name&&!Um(C)&&o(f.name)),jg(C)&&u(C),x.children){const I=x.children;for(let q=0;q<I.length;q++)l(I[q],C,m&&m.children[q])}m=m||C}return L?()=>{o(L)}:Yo}function o(f){if(Ng(f)){const v=n.get(f);v&&(n.delete(f),a.splice(a.indexOf(v),1),v.children.forEach(o),v.alias.forEach(o))}else{const v=a.indexOf(f);v>-1&&(a.splice(v,1),f.record.name&&n.delete(f.record.name),f.children.forEach(o),f.alias.forEach(o))}}function i(){return a}function u(f){const v=c2(f,a);a.splice(v,0,f),f.record.name&&!Um(f)&&n.set(f.record.name,f)}function d(f,v){let m,y={},x,S;if("name"in f&&f.name){if(m=n.get(f.name),!m)throw Ql(1,{location:f});S=m.record.name,y=_t(zm(v.params,m.keys.filter(L=>!L.optional).concat(m.parent?m.parent.keys.filter(L=>L.optional):[]).map(L=>L.name)),f.params&&zm(f.params,m.keys.map(L=>L.name))),x=m.stringify(y)}else if(f.path!=null)x=f.path,m=a.find(L=>L.re.test(x)),m&&(y=m.parse(x),S=m.record.name,m.keys.forEach(L=>{L.optional&&!y[L.name]&&delete y[L.name]}));else{if(m=v.name?n.get(v.name):a.find(L=>L.re.test(v.path)),!m)throw Ql(1,{location:f,currentLocation:v});S=m.record.name,y=_t({},v.params,f.params),x=m.stringify(y)}const k=[];let C=m;for(;C;)k.unshift(C.record),C=C.parent;return{name:S,path:x,params:y,matched:k,meta:u2(k)}}e.forEach(f=>l(f));function c(){a.length=0,n.clear()}return{addRoute:l,resolve:d,removeRoute:o,clearRoutes:c,getRoutes:i,getRecordMatcher:r}}function zm(e,t){const a={};for(const n of t)n in e&&(a[n]=e[n]);return a}function jm(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:i2(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function i2(e){const t={},a=e.props||!1;if("component"in e)t.default=a;else for(const n in e.components)t[n]=typeof a=="object"?a[n]:a;return t}function Um(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function u2(e){return e.reduce((t,a)=>_t(t,a.meta),{})}function c2(e,t){let a=0,n=t.length;for(;a!==n;){const l=a+n>>1;zg(e,t[l])<0?n=l:a=l+1}const r=d2(e);return r&&(n=t.lastIndexOf(r,n-1)),n}function d2(e){let t=e;for(;t=t.parent;)if(jg(t)&&zg(e,t)===0)return t}function jg({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Hm(e){const t=ct(xu),a=ct(yf),n=_(()=>{const u=s(e.to);return t.resolve(u)}),r=_(()=>{const{matched:u}=n.value,{length:d}=u,c=u[d-1],f=a.matched;if(!c||!f.length)return-1;const v=f.findIndex(eo.bind(null,c));if(v>-1)return v;const m=Km(u[d-2]);return d>1&&Km(c)===m&&f[f.length-1].path!==m?f.findIndex(eo.bind(null,u[d-2])):v}),l=_(()=>r.value>-1&&m2(a.params,n.value.params)),o=_(()=>r.value>-1&&r.value===a.matched.length-1&&Lg(a.params,n.value.params));function i(u={}){if(p2(u)){const d=t[s(e.replace)?"replace":"push"](s(e.to)).catch(Yo);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>d),d}return Promise.resolve()}return{route:n,href:_(()=>n.value.href),isActive:l,isExactActive:o,navigate:i}}function f2(e){return e.length===1?e[0]:e}const qa=ne({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:Hm,setup(e,{slots:t}){const a=Ua(Hm(e)),{options:n}=ct(xu),r=_(()=>({[Wm(e.activeClass,n.linkActiveClass,"router-link-active")]:a.isActive,[Wm(e.exactActiveClass,n.linkExactActiveClass,"router-link-exact-active")]:a.isExactActive}));return()=>{const l=t.default&&f2(t.default(a));return e.custom?l:Ra("a",{"aria-current":a.isExactActive?e.ariaCurrentValue:null,href:a.href,onClick:a.navigate,class:r.value},l)}}});function p2(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function m2(e,t){for(const a in t){const n=t[a],r=e[a];if(typeof n=="string"){if(n!==r)return!1}else if(!Wa(r)||r.length!==n.length||n.some((l,o)=>l.valueOf()!==r[o].valueOf()))return!1}return!0}function Km(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Wm=(e,t,a)=>e??t??a,v2=ne({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:a}){const n=ct(bd),r=_(()=>e.route||n.value),l=ct(Rm,0),o=_(()=>{let d=s(l);const{matched:c}=r.value;let f;for(;(f=c[d])&&!f.components;)d++;return d}),i=_(()=>r.value.matched[o.value]);ht(Rm,_(()=>o.value+1)),ht(hf,i),ht(bd,r);const u=A();return Be(()=>[u.value,i.value,e.name],([d,c,f],[v,m,y])=>{c&&(c.instances[f]=d,m&&m!==c&&d&&d===v&&(c.leaveGuards.size||(c.leaveGuards=m.leaveGuards),c.updateGuards.size||(c.updateGuards=m.updateGuards))),d&&c&&(!m||!eo(c,m)||!v)&&(c.enterCallbacks[f]||[]).forEach(x=>x(d))},{flush:"post"}),()=>{const d=r.value,c=e.name,f=i.value,v=f&&f.components[c];if(!v)return Gm(a.default,{Component:v,route:d});const m=f.props[c],y=m?m===!0?d.params:typeof m=="function"?m(d):m:null,S=Ra(v,_t({},y,t,{onVnodeUnmounted:k=>{k.component.isUnmounted&&(f.instances[c]=null)},ref:u}));return Gm(a.default,{Component:S,route:d})||S}}});function Gm(e,t){if(!e)return null;const a=e(t);return a.length===1?a[0]:a}const kd=v2;function h2(e){const t=s2(e.routes,e),a=e.parseQuery||Uw,n=e.stringifyQuery||Nm,r=e.history,l=$o(),o=$o(),i=$o(),u=cl(or);let d=or;Ml&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=dc.bind(null,J=>""+J),f=dc.bind(null,Tw),v=dc.bind(null,Ri);function m(J,he){let G,ee;return Ng(J)?(G=t.getRecordMatcher(J),ee=he):ee=J,t.addRoute(ee,G)}function y(J){const he=t.getRecordMatcher(J);he&&t.removeRoute(he)}function x(){return t.getRoutes().map(J=>J.record)}function S(J){return!!t.getRecordMatcher(J)}function k(J,he){if(he=_t({},he||u.value),typeof J=="string"){const z=fc(a,J,he.path),de=t.resolve({path:z.path},he),X=r.createHref(z.fullPath);return _t(z,de,{params:v(de.params),redirectedFrom:void 0,href:X})}let G;if(J.path!=null)G=_t({},J,{path:fc(a,J.path,he.path).path});else{const z=_t({},J.params);for(const de in z)z[de]==null&&delete z[de];G=_t({},J,{params:f(z)}),he.params=f(he.params)}const ee=t.resolve(G,he),ae=J.hash||"";ee.params=c(v(ee.params));const $=Mw(n,_t({},J,{hash:Cw(ae),path:ee.path})),M=r.createHref($);return _t({fullPath:$,hash:ae,query:n===Nm?Hw(J.query):J.query||{}},ee,{redirectedFrom:void 0,href:M})}function C(J){return typeof J=="string"?fc(a,J,u.value.path):_t({},J)}function L(J,he){if(d!==J)return Ql(8,{from:he,to:J})}function D(J){return q(J)}function T(J){return D(_t(C(J),{replace:!0}))}function I(J,he){const G=J.matched[J.matched.length-1];if(G&&G.redirect){const{redirect:ee}=G;let ae=typeof ee=="function"?ee(J,he):ee;return typeof ae=="string"&&(ae=ae.includes("?")||ae.includes("#")?ae=C(ae):{path:ae},ae.params={}),_t({query:J.query,hash:J.hash,params:ae.path!=null?{}:J.params},ae)}}function q(J,he){const G=d=k(J),ee=u.value,ae=J.state,$=J.force,M=J.replace===!0,z=I(G,ee);if(z)return q(_t(C(z),{state:typeof z=="object"?_t({},ae,z.state):ae,force:$,replace:M}),he||G);const de=G;de.redirectedFrom=he;let X;return!$&&Pw(n,ee,G)&&(X=Ql(16,{to:de,from:ee}),ge(ee,ee,!0,!1)),(X?Promise.resolve(X):P(de,ee)).catch(se=>tn(se)?tn(se,2)?se:be(se):oe(se,de,ee)).then(se=>{if(se){if(tn(se,2))return q(_t({replace:M},C(se.to),{state:typeof se.to=="object"?_t({},ae,se.to.state):ae,force:$}),he||de)}else se=O(de,ee,!0,M,ae);return j(de,ee,se),se})}function H(J,he){const G=L(J,he);return G?Promise.reject(G):Promise.resolve()}function E(J){const he=F.values().next().value;return he&&typeof he.runWithContext=="function"?he.runWithContext(J):J()}function P(J,he){let G;const[ee,ae,$]=Ww(J,he);G=pc(ee.reverse(),"beforeRouteLeave",J,he);for(const z of ee)z.leaveGuards.forEach(de=>{G.push(mr(de,J,he))});const M=H.bind(null,J,he);return G.push(M),ve(G).then(()=>{G=[];for(const z of l.list())G.push(mr(z,J,he));return G.push(M),ve(G)}).then(()=>{G=pc(ae,"beforeRouteUpdate",J,he);for(const z of ae)z.updateGuards.forEach(de=>{G.push(mr(de,J,he))});return G.push(M),ve(G)}).then(()=>{G=[];for(const z of $)if(z.beforeEnter)if(Wa(z.beforeEnter))for(const de of z.beforeEnter)G.push(mr(de,J,he));else G.push(mr(z.beforeEnter,J,he));return G.push(M),ve(G)}).then(()=>(J.matched.forEach(z=>z.enterCallbacks={}),G=pc($,"beforeRouteEnter",J,he,E),G.push(M),ve(G))).then(()=>{G=[];for(const z of o.list())G.push(mr(z,J,he));return G.push(M),ve(G)}).catch(z=>tn(z,8)?z:Promise.reject(z))}function j(J,he,G){i.list().forEach(ee=>E(()=>ee(J,he,G)))}function O(J,he,G,ee,ae){const $=L(J,he);if($)return $;const M=he===or,z=Ml?history.state:{};G&&(ee||M?r.replace(J.fullPath,_t({scroll:M&&z&&z.scroll},ae)):r.push(J.fullPath,ae)),u.value=J,ge(J,he,G,M),be()}let N;function Z(){N||(N=r.listen((J,he,G)=>{if(!fe.listening)return;const ee=k(J),ae=I(ee,fe.currentRoute.value);if(ae){q(_t(ae,{replace:!0,force:!0}),ee).catch(Yo);return}d=ee;const $=u.value;Ml&&Vw(Lm($.fullPath,G.delta),ku()),P(ee,$).catch(M=>tn(M,12)?M:tn(M,2)?(q(_t(C(M.to),{force:!0}),ee).then(z=>{tn(z,20)&&!G.delta&&G.type==="pop"&&r.go(-1,!1)}).catch(Yo),Promise.reject()):(G.delta&&r.go(-G.delta,!1),oe(M,ee,$))).then(M=>{M=M||O(ee,$,!1),M&&(G.delta&&!tn(M,8)?r.go(-G.delta,!1):G.type==="pop"&&tn(M,20)&&r.go(-1,!1)),j(ee,$,M)}).catch(Yo)}))}let W=$o(),K=$o(),te;function oe(J,he,G){be(J);const ee=K.list();return ee.length?ee.forEach(ae=>ae(J,he,G)):console.error(J),Promise.reject(J)}function ye(){return te&&u.value!==or?Promise.resolve():new Promise((J,he)=>{W.add([J,he])})}function be(J){return te||(te=!J,Z(),W.list().forEach(([he,G])=>J?G(J):he()),W.reset()),J}function ge(J,he,G,ee){const{scrollBehavior:ae}=e;if(!Ml||!ae)return Promise.resolve();const $=!G&&zw(Lm(J.fullPath,0))||(ee||!G)&&history.state&&history.state.scroll||null;return Ue().then(()=>ae(J,he,$)).then(M=>M&&Fw(M)).catch(M=>oe(M,J,he))}const le=J=>r.go(J);let ce;const F=new Set,fe={currentRoute:u,listening:!0,addRoute:m,removeRoute:y,clearRoutes:t.clearRoutes,hasRoute:S,getRoutes:x,resolve:k,options:e,push:D,replace:T,go:le,back:()=>le(-1),forward:()=>le(1),beforeEach:l.add,beforeResolve:o.add,afterEach:i.add,onError:K.add,isReady:ye,install(J){J.component("RouterLink",qa),J.component("RouterView",kd),J.config.globalProperties.$router=fe,Object.defineProperty(J.config.globalProperties,"$route",{enumerable:!0,get:()=>s(u)}),Ml&&!ce&&u.value===or&&(ce=!0,D(r.location).catch(ee=>{}));const he={};for(const ee in or)Object.defineProperty(he,ee,{get:()=>u.value[ee],enumerable:!0});J.provide(xu,fe),J.provide(yf,Dy(he)),J.provide(bd,u);const G=J.unmount;F.add(J),J.unmount=function(){F.delete(J),F.size<1&&(d=or,N&&N(),N=null,u.value=or,ce=!1,te=!1),G()}}};function ve(J){return J.reduce((he,G)=>he.then(()=>E(G)),Promise.resolve())}return fe}const y2=/^[A-Za-z0-9_-]+$/;function wu(e){const t=e.split(".");if(t.length!==3||!t.every(l=>y2.test(l)))return null;const[a,n,r]=t;return{vendor:a,plugin:n,controller:r}}function Ga(e){const t=wu(e);return t?`/${t.vendor}/${t.plugin}/${t.controller}`:null}function Cs(e){return`${e.vendor}.${e.plugin}.${e.controller}`}function lo(e){const t=e.replace(/^\/+|\/+$/g,"").split("/");if(t.length<3)return null;const a=t.slice(0,3).join(".");return wu(a)?a:null}function Ym(e){const t=wu(e);return t?`${t.vendor}.${t.plugin}`:null}const g2=/\{[^{}]+\}/g,b2=()=>typeof process=="object"&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function _2(){return Math.random().toString(36).slice(2,11)}function x2(e){let{baseUrl:t="",Request:a=globalThis.Request,fetch:n=globalThis.fetch,querySerializer:r,bodySerializer:l,pathSerializer:o,headers:i,requestInitExt:u=void 0,...d}={...e};u=b2()?u:void 0,t=Xm(t);const c=[];async function f(v,m){const{baseUrl:y,fetch:x=n,Request:S=a,headers:k,params:C={},parseAs:L="json",querySerializer:D,bodySerializer:T=l??w2,pathSerializer:I,body:q,middleware:H=[],...E}=m||{};let P=t;y&&(P=Xm(y)??t);let j=typeof r=="function"?r:Jm(r);D&&(j=typeof D=="function"?D:Jm({...typeof r=="object"?r:{},...D}));const O=I||o||k2,N=q===void 0?void 0:T(q,Zm(i,k,C.header)),Z=Zm(N===void 0||N instanceof FormData?{}:{"Content-Type":"application/json"},i,k,C.header),W=[...c,...H],K={redirect:"follow",...d,...E,body:N,headers:Z};let te,oe,ye=new S($2(v,{baseUrl:P,params:C,querySerializer:j,pathSerializer:O}),K),be;for(const ce in E)ce in ye||(ye[ce]=E[ce]);if(W.length){te=_2(),oe=Object.freeze({baseUrl:P,fetch:x,parseAs:L,querySerializer:j,bodySerializer:T,pathSerializer:O});for(const ce of W)if(ce&&typeof ce=="object"&&typeof ce.onRequest=="function"){const F=await ce.onRequest({request:ye,schemaPath:v,params:C,options:oe,id:te});if(F)if(F instanceof S)ye=F;else if(F instanceof Response){be=F;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!be){try{be=await x(ye,u)}catch(ce){let F=ce;if(W.length)for(let fe=W.length-1;fe>=0;fe--){const ve=W[fe];if(ve&&typeof ve=="object"&&typeof ve.onError=="function"){const J=await ve.onError({request:ye,error:F,schemaPath:v,params:C,options:oe,id:te});if(J){if(J instanceof Response){F=void 0,be=J;break}if(J instanceof Error){F=J;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(F)throw F}if(W.length)for(let ce=W.length-1;ce>=0;ce--){const F=W[ce];if(F&&typeof F=="object"&&typeof F.onResponse=="function"){const fe=await F.onResponse({request:ye,response:be,schemaPath:v,params:C,options:oe,id:te});if(fe){if(!(fe instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");be=fe}}}}const ge=be.headers.get("Content-Length");if(be.status===204||ye.method==="HEAD"||ge==="0"&&!be.headers.get("Transfer-Encoding")?.includes("chunked"))return be.ok?{data:void 0,response:be}:{error:void 0,response:be};if(be.ok)return{data:await(async()=>{if(L==="stream")return be.body;if(L==="json"&&!ge){const F=await be.text();return F?JSON.parse(F):void 0}return await be[L]()})(),response:be};let le=await be.text();try{le=JSON.parse(le)}catch{}return{error:le,response:be}}return{request(v,m,y){return f(m,{...y,method:v.toUpperCase()})},GET(v,m){return f(v,{...m,method:"GET"})},PUT(v,m){return f(v,{...m,method:"PUT"})},POST(v,m){return f(v,{...m,method:"POST"})},DELETE(v,m){return f(v,{...m,method:"DELETE"})},OPTIONS(v,m){return f(v,{...m,method:"OPTIONS"})},HEAD(v,m){return f(v,{...m,method:"HEAD"})},PATCH(v,m){return f(v,{...m,method:"PATCH"})},TRACE(v,m){return f(v,{...m,method:"TRACE"})},use(...v){for(const m of v)if(m){if(typeof m!="object"||!("onRequest"in m||"onResponse"in m||"onError"in m))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");c.push(m)}},eject(...v){for(const m of v){const y=c.indexOf(m);y!==-1&&c.splice(y,1)}}}}function $u(e,t,a){if(t==null)return"";if(typeof t=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${a?.allowReserved===!0?t:encodeURIComponent(t)}`}function Ug(e,t,a){if(!t||typeof t!="object")return"";const n=[],r={simple:",",label:".",matrix:";"}[a.style]||"&";if(a.style!=="deepObject"&&a.explode===!1){for(const i in t)n.push(i,a.allowReserved===!0?t[i]:encodeURIComponent(t[i]));const o=n.join(",");switch(a.style){case"form":return`${e}=${o}`;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return o}}for(const o in t){const i=a.style==="deepObject"?`${e}[${o}]`:o;n.push($u(i,t[o],a))}const l=n.join(r);return a.style==="label"||a.style==="matrix"?`${r}${l}`:l}function Hg(e,t,a){if(!Array.isArray(t))return"";if(a.explode===!1){const l={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[a.style]||",",o=(a.allowReserved===!0?t:t.map(i=>encodeURIComponent(i))).join(l);switch(a.style){case"simple":return o;case"label":return`.${o}`;case"matrix":return`;${e}=${o}`;default:return`${e}=${o}`}}const n={simple:",",label:".",matrix:";"}[a.style]||"&",r=[];for(const l of t)a.style==="simple"||a.style==="label"?r.push(a.allowReserved===!0?l:encodeURIComponent(l)):r.push($u(e,l,a));return a.style==="label"||a.style==="matrix"?`${n}${r.join(n)}`:r.join(n)}function Jm(e){return function(a){const n=[];if(a&&typeof a=="object")for(const r in a){const l=a[r];if(l!=null){if(Array.isArray(l)){if(l.length===0)continue;n.push(Hg(r,l,{style:"form",explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof l=="object"){n.push(Ug(r,l,{style:"deepObject",explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push($u(r,l,e))}}return n.join("&")}}function k2(e,t){let a=e;for(const n of e.match(g2)??[]){let r=n.substring(1,n.length-1),l=!1,o="simple";if(r.endsWith("*")&&(l=!0,r=r.substring(0,r.length-1)),r.startsWith(".")?(o="label",r=r.substring(1)):r.startsWith(";")&&(o="matrix",r=r.substring(1)),!t||t[r]===void 0||t[r]===null)continue;const i=t[r];if(Array.isArray(i)){a=a.replace(n,Hg(r,i,{style:o,explode:l}));continue}if(typeof i=="object"){a=a.replace(n,Ug(r,i,{style:o,explode:l}));continue}if(o==="matrix"){a=a.replace(n,`;${$u(r,i)}`);continue}a=a.replace(n,o==="label"?`.${encodeURIComponent(i)}`:encodeURIComponent(i))}return a}function w2(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get("Content-Type")??t.get("content-type"):t["Content-Type"]??t["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(e).toString():JSON.stringify(e)}function $2(e,t){let a=`${t.baseUrl}${e}`;t.params?.path&&(a=t.pathSerializer(a,t.params.path));let n=t.querySerializer(t.params.query??{});return n.startsWith("?")&&(n=n.substring(1)),n&&(a+=`?${n}`),a}function Zm(...e){const t=new Headers;for(const a of e){if(!a||typeof a!="object")continue;const n=a instanceof Headers?a.entries():Object.entries(a);for(const[r,l]of n)if(l===null)t.delete(r);else if(Array.isArray(l))for(const o of l)t.append(r,o);else l!==void 0&&t.set(r,l)}return t}function Xm(e){return e.endsWith("/")?e.substring(0,e.length-1):e}const Qm="/backend",S2="__SUMMER_ADMIN_BASE__",C2="__SUMMER_ADMIN_BUILD__",E2=/^[0-9a-f]{6,64}$/;function A2(e=document){const t=e.querySelector('meta[name="summer-admin-base"]')?.content.trim()??"";if(t===""||t===S2||!t.startsWith("/"))return Qm;const a=t.replace(/\/+$/,"");return a===""?Qm:a}function T2(e=document){const t=e.querySelector('meta[name="summer-admin-build"]')?.content.trim()??"";return t===C2||!E2.test(t)?"":t}const ev=A2(),dl={base:ev,api:`${ev}/api/v1`,build:T2()},Kg="XMLHttpRequest";let Ii=null,Wg=null,So=null;const mc=new WeakMap;function O2(e){Ii=e}function D2(){Ii?.()}function M2(e){Wg=e}function P2(e){return new URL(e.url,"http://local").pathname}function tv(e){const t=P2(e);return t.endsWith("/auth/login")||t.endsWith("/auth/refresh")}function bf(){return So||(So=(async()=>{try{const{data:e,response:t}=await qe.POST("/auth/refresh");if(!t.ok||!e)return!1;const a=e.data.expires_in;return Wg?.(typeof a=="number"?a:null),!0}catch{return!1}finally{So=null}})(),So)}const R2={onRequest({request:e}){return e.headers.set("X-Requested-With",Kg),tv(e)||mc.set(e,e.clone()),e},async onResponse({request:e,response:t}){if(t.status!==401||tv(e))return t;const a=mc.get(e);if(mc.delete(e),!a||!await bf())return Ii?.(),t;const n=await globalThis.fetch(a);return n.status===401&&Ii?.(),n}},qe=x2({baseUrl:dl.api,credentials:"same-origin",fetch:e=>globalThis.fetch(e)});qe.use(R2);const _f=A({}),xf=A(typeof document>"u"?"pl":document.documentElement.lang||"pl"),La=At(xf),Gg=A([]),I2=At(Gg);function q2(e,t){_f.value=e,t&&(xf.value=t,typeof document<"u"&&(document.documentElement.lang=t))}async function Yg(e){const{data:t,response:a}=await qe.GET("/lang",e?{params:{query:{locale:e}}}:{});!a.ok||!t||(Gg.value=Array.isArray(t.meta.locales)?[...t.meta.locales]:[],q2(t.data,t.meta.locale))}function av(e){const t=e.codePointAt(0);if(t===void 0)return e;const a=String.fromCodePoint(t);return a.toUpperCase()+e.slice(a.length)}function qi(e,t={}){if(e==="")return e;const a=[];for(const[r,l]of Object.entries(t)){const o=r.replace(/^:/,"");if(o==="")continue;const i=String(l);a.push([`:${av(o)}`,av(i)]),a.push([`:${o.toUpperCase()}`,i.toUpperCase()]),a.push([`:${o}`,i])}a.sort((r,l)=>l[0].length-r[0].length);let n=e;for(const[r,l]of a)n=n.split(r).join(l);return n}const nv=new Map;function L2(e,t=xf.value){let a=nv.get(t);if(a===void 0){try{a=new Intl.PluralRules(t)}catch{a=null}nv.set(t,a)}return a?a.select(e):"other"}function Xe(e,t,a={}){if(!e)return"";if(t===void 0)return qi(e.other??"",a);const n=e[L2(t)]??e.other??"";return qi(n,{count:t,...a})}function h(e,t={}){const a=_f.value[e]?.other;return a===void 0?e:qi(a,t)}function wa(e,t,a={}){const n=_f.value[e];return n?Xe(n,t,a):e}const kf=A(""),Bo=At(kf);function wf(e){kf.value=e}function $f(){kf.value=""}const Li=A([]);async function Jg(){const{data:e,response:t}=await qe.GET("/navigation");return Li.value=t.ok&&e?e.data:[],Li.value}function N2(e){Li.value=e}const Ni=_(()=>Li.value.filter(e=>e.sideMenu.length>0).map((e,t)=>({entry:e,index:t})).sort((e,t)=>e.entry.order-t.entry.order||e.index-t.index).map(({entry:e})=>e));function Sf(e){for(const t of e.sideMenu){const a=Ga(t.controller);if(a)return a}return Ga(e.controller)}function Es(e,t){const a=`${e}.${t}`;return Ni.value.find(n=>Ym(n.controller)===a||n.sideMenu.some(r=>Ym(r.controller)===a))??null}function B2(){for(const e of Ni.value){const t=Sf(e);if(t)return t}return null}const wr=A([]),F2=_(()=>wr.value.length>0);async function Zg(){const{data:e,response:t}=await qe.GET("/settings");return wr.value=t.ok&&e?e.data:[],wr.value}function V2(e){wr.value=e}function cs(e){return wr.value.find(t=>t.code===e)??null}function Cf(e){return e.path?e.path:e.controller?Ga(e.controller)??"/settings":`/settings/${encodeURIComponent(e.code)}`}function Su(e){return e?wr.value.find(t=>t.controller!==""&&t.controller===e)??null:null}function Xg(e){return wr.value.find(t=>!!t.path&&t.path===e)??null}const wd=_(()=>{const e=wr.value.map((a,n)=>({entry:a,index:n})).sort((a,n)=>a.entry.order-n.entry.order||a.index-n.index).map(({entry:a})=>a),t=[];for(const a of e){let n=t.find(r=>r.category===a.category);n||(n={category:a.category,entries:[]},t.push(n)),n.entries.push(a)}return t});function vc(e){if(!e)return null;const t=wd.value.find(a=>a.category===e.category);return!t||t.entries.length<2?null:{category:t.category,current:e,entries:t.entries}}const rv="SummerCMS";function z2(e){if(e.name==="login")return h("backend::lang.auth.title");if(e.name==="settings")return h("backend::lang.settings.title");if(e.name==="account")return h("backend::lang.myaccount.menu_label");if(e.name==="plugins")return h("backend::lang.plugins.title");if(e.name==="connect")return h("backend::lang.mcp_connect.page_title");if(e.name==="settings-form")return cs(String(e.params.code??""))?.label??String(e.params.code??"");if(e.name==="home")return h("backend::lang.nav.empty");if(e.name==="not-found")return h("backend::lang.page.not_found");const t=Es(String(e.params.vendor??""),String(e.params.plugin??"")),a=lo(e.path),r=t?.sideMenu.find(l=>l.controller===a)?.label??t?.label??Su(a)?.label??"";return(e.name==="create"||e.name==="record"||e.name==="preview")&&Bo.value||r}function j2(e){const t=z2(e).trim();return t===""?rv:`${t} | ${rv}`}const lv=e=>e==="";const U2=(...e)=>e.filter((t,a,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===a).join(" ").trim();const ov=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();const H2=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,a,n)=>n?n.toUpperCase():a.toLowerCase());const K2=e=>{const t=H2(e);return t.charAt(0).toUpperCase()+t.slice(1)};var $l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const W2=Symbol("lucide-icons");function G2(){return ct(W2,{})}const Y2=({name:e,iconNode:t,absoluteStrokeWidth:a,"absolute-stroke-width":n,strokeWidth:r,"stroke-width":l,size:o,color:i,...u},{slots:d})=>{const{size:c,color:f,strokeWidth:v=2,absoluteStrokeWidth:m=!1,class:y=""}=G2(),x=_(()=>{const S=lv(a)||lv(n)||a===!0||n===!0||m===!0,k=r||l||v||$l["stroke-width"];return S?Number(k)*24/Number(o??c??$l.width):k});return Ra("svg",{...$l,...u,width:o??c??$l.width,height:o??c??$l.height,stroke:i??f??$l.stroke,"stroke-width":x.value,class:U2("lucide",y,...e?[`lucide-${ov(K2(e))}-icon`,`lucide-${ov(e)}`]:["lucide-icon"])},[...t.map(S=>Ra(...S)),...d.default?[d.default()]:[]])};const ke=(e,t)=>(a,{slots:n,attrs:r})=>Ra(Y2,{...r,...a,iconNode:t,name:e},n.default?{default:n.default}:void 0);const J2=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Z2=ke("archive",J2);const X2=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Qg=ke("arrow-down",X2);const Q2=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],oo=ke("arrow-left",Q2);const e$=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],t$=ke("arrow-right",e$);const a$=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],eb=ke("arrow-up-down",a$);const n$=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],tb=ke("arrow-up-right",n$);const r$=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],ab=ke("arrow-up",r$);const l$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],nb=ke("ban",l$);const o$=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],s$=ke("bell",o$);const i$=[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]],u$=ke("bold",i$);const c$=[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}]],d$=ke("book",c$);const f$=[["path",{d:"M17 3a2 2 0 0 1 2 2v15a1 1 0 0 1-1.496.868l-4.512-2.578a2 2 0 0 0-1.984 0l-4.512 2.578A1 1 0 0 1 5 20V5a2 2 0 0 1 2-2z",key:"oz39mx"}]],p$=ke("bookmark",f$);const m$=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],sv=ke("bot",m$);const v$=[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]],h$=ke("box",v$);const y$=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],g$=ke("briefcase",y$);const b$=[["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M9 22v-3a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v3",key:"cabbwy"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]],_$=ke("building",b$);const x$=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],rb=ke("calendar",x$);const k$=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],w$=ke("camera",k$);const $$=[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["circle",{cx:"8",cy:"10",r:"2",key:"1xl4ub"}],["path",{d:"M8 12h8",key:"1wcyev"}],["circle",{cx:"16",cy:"10",r:"2",key:"r14t7q"}],["path",{d:"m6 20 .7-2.9A1.4 1.4 0 0 1 8.1 16h7.8a1.4 1.4 0 0 1 1.4 1l.7 3",key:"l01ucn"}]],S$=ke("cassette-tape",$$);const C$=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M7 16h8",key:"srdodz"}],["path",{d:"M7 11h12",key:"127s9w"}],["path",{d:"M7 6h3",key:"w9rmul"}]],E$=ke("chart-bar",C$);const A$=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Na=ke("check",A$);const T$=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],zn=ke("chevron-down",T$);const O$=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Cu=ke("chevron-left",O$);const D$=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],so=ke("chevron-right",D$);const M$=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],lb=ke("chevron-up",M$);const P$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],gt=ke("circle-alert",P$);const R$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]],I$=ke("circle-arrow-up",R$);const q$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],L$=ke("circle-check",q$);const N$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],B$=ke("circle-question-mark",N$);const F$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],V$=ke("circle",F$);const z$=[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]],j$=ke("clipboard-list",z$);const U$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Bi=ke("clock",U$);const H$=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],K$=ke("cloud",H$);const W$=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],ob=ke("code",W$);const G$=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Fi=ke("copy",G$);const Y$=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],J$=ke("credit-card",Y$);const Z$=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],X$=ke("database",Z$);const Q$=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],eS=ke("disc-3",Q$);const tS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],aS=ke("disc",tS);const nS=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],$d=ke("download",nS);const rS=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],sb=ke("external-link",rS);const lS=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],oS=ke("eye-off",lS);const sS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],iS=ke("eye",sS);const uS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Ll=ke("file-text",uS);const cS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]],dS=ke("file",cS);const fS=[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]],pS=ke("files",fS);const mS=[["path",{d:"M4 22V4a1 1 0 0 1 .4-.8A6 6 0 0 1 8 2c3 0 5 2 7.333 2q2 0 3.067-.8A1 1 0 0 1 20 4v10a1 1 0 0 1-.4.8A6 6 0 0 1 16 16c-3 0-5-2-8-2a6 6 0 0 0-4 1.528",key:"1jaruq"}]],vS=ke("flag",mS);const hS=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],yS=ke("folder",hS);const gS=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],bS=ke("funnel",gS);const _S=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],xS=ke("gauge",_S);const kS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],wS=ke("globe",kS);const $S=[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]],SS=ke("graduation-cap",$S);const CS=[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]],Vi=ke("grip-vertical",CS);const ES=[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]],AS=ke("heading-3",ES);const TS=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],OS=ke("heart",TS);const DS=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],MS=ke("house",DS);const PS=[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]],iv=ke("image-off",PS);const RS=[["path",{d:"M16 5h6",key:"1vod17"}],["path",{d:"M19 2v6",key:"4bpg5p"}],["path",{d:"M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5",key:"1ue2ih"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],ib=ke("image-plus",RS);const IS=[["path",{d:"M10.3 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10l-3.1-3.1a2 2 0 0 0-2.814.014L6 21",key:"9csbqa"}],["path",{d:"m14 19.5 3-3 3 3",key:"9vmjn0"}],["path",{d:"M17 22v-5.5",key:"1aa6fl"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}]],qS=ke("image-up",IS);const LS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ub=ke("image",LS);const NS=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],BS=ke("inbox",NS);const FS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],Rr=ke("info",FS);const VS=[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]],zS=ke("italic",VS);const jS=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],US=ke("key-round",jS);const HS=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],KS=ke("key",HS);const WS=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],GS=ke("languages",WS);const YS=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],JS=ke("layout-grid",YS);const ZS=[["path",{d:"M11 20A7 7 0 0 1 9.8 6.1C15.5 5 17 4.48 19 2c1 2 2 4.18 2 8 0 5.5-4.78 10-10 10Z",key:"nnexq3"}],["path",{d:"M2 21c0-3 1.85-5.36 5.08-6C9.5 14.52 12 13 13 12",key:"mt58a7"}]],XS=ke("leaf",ZS);const QS=[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]],eC=ke("library",QS);const tC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],aC=ke("life-buoy",tC);const nC=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],cb=ke("link",nC);const rC=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m7 8-4 4 4 4",key:"o5hrat"}]],lC=ke("list-indent-decrease",rC);const oC=[["path",{d:"M21 5H11",key:"us1j55"}],["path",{d:"M21 12H11",key:"wd7e0v"}],["path",{d:"M21 19H11",key:"saa85w"}],["path",{d:"m3 8 4 4-4 4",key:"1a3j6y"}]],sC=ke("list-indent-increase",oC);const iC=[["path",{d:"M11 5h10",key:"1cz7ny"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 19h10",key:"11t30w"}],["path",{d:"M4 4h1v5",key:"10yrso"}],["path",{d:"M4 9h2",key:"r1h2o0"}],["path",{d:"M6.5 20H3.4c0-1 2.6-1.925 2.6-3.5a1.5 1.5 0 0 0-2.6-1.02",key:"xtkcd5"}]],db=ke("list-ordered",iC);const uC=[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]],fb=ke("list",uC);const cC=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],In=ke("loader-circle",cC);const dC=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],sn=ke("lock",dC);const fC=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],pb=ke("log-out",fC);const pC=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],mC=ke("mail",pC);const vC=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],hC=ke("map-pin",vC);const yC=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],gC=ke("message-circle",yC);const bC=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],_C=ke("mic-vocal",bC);const xC=[["path",{d:"M5 12h14",key:"1ays0h"}]],mb=ke("minus",xC);const kC=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],wC=ke("moon",kC);const $C=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],SC=ke("network",$C);const CC=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],EC=ke("palette",CC);const AC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]],Ef=ke("panel-left-close",AC);const TC=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]],vb=ke("panel-left-open",TC);const OC=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],DC=ke("paperclip",OC);const MC=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],PC=ke("pause",MC);const RC=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Jo=ke("pencil",RC);const IC=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],qC=ke("phone",IC);const LC=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],NC=ke("play",LC);const BC=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],As=ke("plus",BC);const FC=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],hb=ke("puzzle",FC);const VC=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],zC=ke("quote",VC);const jC=[["path",{d:"m15 14 5-5-5-5",key:"12vg1m"}],["path",{d:"M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",key:"6uklza"}]],UC=ke("redo-2",jC);const HC=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],KC=ke("refresh-cw",HC);const WC=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],hi=ke("rotate-ccw",WC);const GC=[["path",{d:"m13.5 8.5-5 5",key:"1cs55j"}],["path",{d:"m8.5 8.5 5 5",key:"a8mexj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],yb=ke("search-x",GC);const YC=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],fl=ke("search",YC);const JC=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],ZC=ke("send",JC);const XC=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],gb=ke("settings",XC);const QC=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],e3=ke("shield-check",QC);const t3=[["circle",{cx:"8",cy:"21",r:"1",key:"jimo8o"}],["circle",{cx:"19",cy:"21",r:"1",key:"13723u"}],["path",{d:"M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12",key:"9zh506"}]],a3=ke("shopping-cart",t3);const n3=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],bb=ke("sliders-horizontal",n3);const r3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],_b=ke("star",r3);const l3=[["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M14.837 16.385a6 6 0 1 1-7.223-7.222c.624-.147.97.66.715 1.248a4 4 0 0 0 5.26 5.259c.589-.255 1.396.09 1.248.715",key:"xlf6rm"}],["path",{d:"M16 12a4 4 0 0 0-4-4",key:"6vsxu"}],["path",{d:"m19 5-1.256 1.256",key:"1yg6a6"}],["path",{d:"M20 12h2",key:"1q8mjw"}]],o3=ke("sun-moon",l3);const s3=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ts=ke("sun",s3);const i3=[["path",{d:"M12 3v18",key:"108xh3"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}]],u3=ke("table",i3);const c3=[["path",{d:"M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z",key:"16rjxf"}],["path",{d:"M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193",key:"178nd4"}],["circle",{cx:"10.5",cy:"6.5",r:".5",fill:"currentColor",key:"12ikhr"}]],d3=ke("tags",c3);const f3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Ir=ke("trash-2",f3);const p3=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],zi=ke("triangle-alert",p3);const m3=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],v3=ke("trophy",m3);const h3=[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]],y3=ke("underline",h3);const g3=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],xb=ke("undo-2",g3);const b3=[["path",{d:"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",key:"yqzxt4"}],["path",{d:"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",key:"4qinb0"}],["line",{x1:"8",x2:"8",y1:"2",y2:"5",key:"1041cp"}],["line",{x1:"2",x2:"5",y1:"8",y2:"8",key:"14m1p5"}],["line",{x1:"16",x2:"16",y1:"19",y2:"22",key:"rzdirn"}],["line",{x1:"19",x2:"22",y1:"16",y2:"16",key:"ox905f"}]],_3=ke("unlink",b3);const x3=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],Zo=ke("upload",x3);const k3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],kb=ke("user-minus",k3);const w3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]],wb=ke("user-plus",w3);const $3=[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]],S3=ke("user-round",$3);const C3=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],E3=ke("user",C3);const A3=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],T3=ke("users-round",A3);const O3=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],D3=ke("users",O3);const M3=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],P3=ke("wand-sparkles",M3);const R3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],I3=ke("wrench",R3);const q3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Vt=ke("x",q3),uv={archive:Z2,"arrow-down":Qg,"arrow-left":oo,"arrow-right":t$,"arrow-up":ab,"arrow-up-right":tb,bell:s$,book:d$,bookmark:p$,box:h$,briefcase:g$,building:_$,calendar:rb,camera:w$,"cassette-tape":S$,"chart-bar":E$,check:Na,"chevron-down":zn,"chevron-left":Cu,"chevron-right":so,circle:V$,"circle-alert":gt,"circle-check":L$,"circle-question-mark":B$,"clipboard-list":j$,clock:Bi,cloud:K$,code:ob,copy:Fi,"credit-card":J$,database:X$,disc:aS,"disc-3":eS,download:$d,"external-link":sb,file:dS,"file-text":Ll,files:pS,flag:vS,folder:yS,funnel:bS,gauge:xS,globe:wS,"graduation-cap":SS,heart:OS,house:MS,image:ub,inbox:BS,info:Rr,key:KS,languages:GS,"layout-grid":JS,leaf:XS,library:eC,"life-buoy":aC,link:cb,list:fb,"list-ordered":db,lock:sn,"log-out":pb,mail:mC,"map-pin":hC,"message-circle":gC,"mic-vocal":_C,minus:mb,network:SC,palette:EC,"panel-left-close":Ef,"panel-left-open":vb,paperclip:DC,pause:PC,pencil:Jo,phone:qC,play:NC,plus:As,puzzle:hb,"refresh-cw":KC,search:fl,"search-x":yb,settings:gb,"shield-check":e3,"shopping-cart":a3,star:_b,sun:Ts,table:u3,tags:d3,"trash-2":Ir,"triangle-alert":zi,trophy:v3,upload:Zo,user:E3,"user-minus":kb,"user-plus":wb,users:D3,"users-round":T3,"wand-sparkles":P3,wrench:I3,x:Vt},L3={"icon-archive":"archive","icon-bar-chart":"chart-bar","icon-bell":"bell","icon-book":"book","icon-bookmark":"bookmark","icon-briefcase":"briefcase","icon-building":"building","icon-calendar":"calendar","icon-camera":"camera","icon-check":"check","icon-check-circle":"circle-check","icon-circle":"circle","icon-clock":"clock","icon-clock-o":"clock","icon-cloud":"cloud","icon-code":"code","icon-cog":"settings","icon-cogs":"settings","icon-comment":"message-circle","icon-comments":"message-circle","icon-comments-o":"message-circle","icon-copy":"copy","icon-credit-card":"credit-card","icon-cube":"box","icon-dashboard":"gauge","icon-database":"database","icon-download":"download","icon-edit":"pencil","icon-envelope":"mail","icon-envelope-o":"mail","icon-exclamation-triangle":"triangle-alert","icon-external-link":"external-link","icon-file":"file","icon-file-o":"file","icon-file-text":"file-text","icon-file-text-o":"file-text","icon-files-o":"files","icon-filter":"funnel","icon-flag":"flag","icon-folder":"folder","icon-folder-o":"folder","icon-globe":"globe","icon-graduation-cap":"graduation-cap","icon-group":"users","icon-heart":"heart","icon-home":"house","icon-inbox":"inbox","icon-info-circle":"info","icon-key":"key","icon-language":"languages","icon-leaf":"leaf","icon-life-ring":"life-buoy","icon-link":"link","icon-list":"list","icon-list-alt":"clipboard-list","icon-list-ol":"list-ordered","icon-list-ul":"list","icon-lock":"lock","icon-magic":"wand-sparkles","icon-map-marker":"map-pin","icon-minus":"minus","icon-paperclip":"paperclip","icon-pause":"pause","icon-pencil":"pencil","icon-phone":"phone","icon-photo":"image","icon-picture-o":"image","icon-play":"play","icon-plus":"plus","icon-question":"circle-question-mark","icon-question-circle":"circle-question-mark","icon-refresh":"refresh-cw","icon-search":"search","icon-shopping-cart":"shopping-cart","icon-sign-out":"log-out","icon-sitemap":"network","icon-star":"star","icon-table":"table","icon-tachometer":"gauge","icon-tags":"tags","icon-th":"layout-grid","icon-th-large":"layout-grid","icon-times":"x","icon-trash":"trash-2","icon-trash-o":"trash-2","icon-trophy":"trophy","icon-upload":"upload","icon-user":"user","icon-users":"users","icon-warning":"triangle-alert","icon-wrench":"wrench"},cv=Ts;function hc(e,t){return Object.hasOwn(e,t)?e[t]:void 0}function Os(e){if(!e)return cv;const t=e.trim();return hc(uv,t)??hc(uv,hc(L3,t)??"")??cv}const N3="(prefers-color-scheme: dark)",yi=["system","light","dark"];function $b(e){return typeof e=="string"&&yi.includes(e)}function B3(e=window,t="system"){const a=e.document.documentElement;if(t!=="system")return a.classList.toggle("dark",t==="dark"),()=>{};if(typeof e.matchMedia!="function")return a.classList.remove("dark"),()=>{};const n=e.matchMedia(N3),r=o=>{a.classList.toggle("dark",o)};r(n.matches);const l=o=>r(o.matches);return n.addEventListener("change",l),()=>n.removeEventListener("change",l)}const F3=4e3,ds=A([]),Sd=new Map;let V3=1;const z3=At(ds);function Pe(e,t="success"){const a=V3++;return ds.value=[{id:a,text:e,tone:t},...ds.value],Sd.set(a,setTimeout(()=>Sb(a),F3)),a}function Sb(e){const t=Sd.get(e);t!==void 0&&(clearTimeout(t),Sd.delete(e)),ds.value=ds.value.filter(a=>a.id!==e)}const Cb="summer-admin.theme",Af="summer-admin.locale",j3=/^[A-Za-z]{2,8}(?:[-_][A-Za-z0-9]{1,8})?$/,to=A("system");let dv=()=>{};const fv=At(to),ji=A(""),U3=At(ji);function Ui(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function Tf(e,t){try{t===null?Ui()?.removeItem(e):Ui()?.setItem(e,t)}catch{}}function Cd(e){Tf(Cb,e==="system"?null:e)}function H3(){try{const e=Ui()?.getItem(Cb);return $b(e)?e:"system"}catch{return"system"}}function K3(){try{const e=Ui()?.getItem(Af)??"";return e.length<=16&&j3.test(e)?e:""}catch{return""}}const Eb={reload(){window.location.reload()}};function Hi(e){dv(),to.value=e,dv=typeof window>"u"?()=>{}:B3(window,e)}function W3(e){const t=yi.indexOf(e);return yi[(t+1)%yi.length]??"system"}async function G3(e){const t=to.value;Hi(e),Cd(e);let a=!1;try{const{response:n}=await qe.PUT("/account/preferences",{body:{theme:e}});a=n.ok}catch{a=!1}a||(to.value===e&&(Hi(t),Cd(t)),Pe(h("backend::lang.myaccount.preferences_failed"),"danger"))}function pv(){return G3(W3(to.value))}async function Y3(e){const t=e?.preferences;t&&($b(t.theme)&&(t.theme!==to.value&&Hi(t.theme),Cd(t.theme)),typeof t.locale=="string"&&(ji.value=t.locale,t.locale!==""&&t.locale!==La.value&&await Yg(t.locale).catch(()=>{}),Tf(Af,t.locale===""?null:t.locale)))}async function J3(e){if(e===ji.value)return;let t=!1;try{const{response:a}=await qe.PUT("/account/preferences",{body:{locale:e}});t=a.ok}catch{t=!1}if(!t){Pe(h("backend::lang.myaccount.preferences_failed"),"danger");return}ji.value=e,Tf(Af,e===""?null:e),Eb.reload()}const Ab="summer-admin.sidebar",Z3="(max-width: 1099px)",Eu=A(!1),Xo=A(!1),X3=_(()=>Xo.value||Eu.value);function Tb(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function Q3(){try{return Tb()?.getItem(Ab)==="true"}catch{return!1}}function Of(e){Eu.value=e;try{Tb()?.setItem(Ab,e?"true":"false")}catch{}}function eE(){if(Eu.value=Q3(),typeof window>"u"||typeof window.matchMedia!="function")return Xo.value=!1,()=>{};const e=window.matchMedia(Z3);Xo.value=e.matches;const t=a=>{Xo.value=a.matches};return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function Ob(){return{collapsed:X3,narrow:At(Xo),manual:At(Eu),setCollapsed:Of,watchViewport:eE}}const tE=["id","aria-label"],aE={class:"px-2.5 pt-1 pb-2 text-[14px] font-bold","aria-hidden":"true"},nE=ne({__name:"SectionFlyout",props:{entry:{},id:{}},emits:["escape","leave","navigate"],setup(e,{expose:t,emit:a}){const n=e,r=a,l=ya(),o=A(null),i=_(()=>lo(l.path)),u=_(()=>n.entry.sideMenu.flatMap(m=>{const y=Ga(m.controller);return y?[{item:m,to:y,icon:Os(m.icon),current:i.value===m.controller}]:[]}));function d(){return[...o.value?.querySelectorAll('[role="menuitem"]')??[]]}async function c(){await Ue(),d()[0]?.focus()}function f(m){return!!m&&!!o.value?.contains(m)}function v(m){const y=d(),x=y.indexOf(document.activeElement);switch(m.key){case"ArrowDown":m.preventDefault(),y[(x+1)%y.length]?.focus();break;case"ArrowUp":m.preventDefault(),y[(x-1+y.length)%y.length]?.focus();break;case"Home":m.preventDefault(),y[0]?.focus();break;case"End":m.preventDefault(),y[y.length-1]?.focus();break;case"Escape":m.preventDefault(),r("escape");break;case"Tab":r("leave");break}}return t({focusFirst:c,contains:f}),(m,y)=>(p(),b("div",{id:e.id,ref_key:"root",ref:o,role:"menu","data-section-flyout":"","aria-label":e.entry.label,class:"fixed top-3 left-[calc(var(--spacing-rail)+8px)] z-40 flex w-[230px] flex-col gap-0.5 rounded-[14px] border border-border bg-surface p-2 text-text shadow-pop",onKeydown:v},[g("span",aE,w(e.entry.label),1),(p(!0),b(pe,null,De(u.value,x=>(p(),U(s(qa),{key:x.item.code,to:x.to,role:"menuitem",tabindex:"-1","aria-current":x.current?"page":void 0,class:me([x.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-[38px] items-center gap-3 rounded-tab px-2.5 no-underline transition-colors duration-150 ease-out"]),onClick:y[0]||(y[0]=S=>r("navigate"))},{default:B(()=>[(p(),U(Wt(x.icon),{size:18,"aria-hidden":"true"})),g("span",null,w(x.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],40,tE))}}),rE=["aria-label"],lE=["aria-label","title"],oE={class:"max-w-full [overflow-wrap:anywhere]"},sE=["aria-label","title"],iE={class:"max-w-full [overflow-wrap:anywhere]"},uE=200,cE=ne({__name:"PluginRail",setup(e){const t=ya(),{collapsed:a,narrow:n,setCollapsed:r}=Ob(),l={system:{icon:o3,key:"backend::lang.nav.theme_system"},light:{icon:Ts,key:"backend::lang.nav.theme_light"},dark:{icon:wC,key:"backend::lang.nav.theme_dark"}},o=_(()=>l[fv.value].icon),i=_(()=>h("backend::lang.nav.theme",{mode:h(l[fv.value].key)})),u=_(()=>Es(String(t.params.vendor??""),String(t.params.plugin??""))),d=_(()=>t.path==="/settings"||t.path.startsWith("/settings/")||Xg(t.path)!==null||u.value===null&&Su(lo(t.path))!==null),c=_(()=>Ni.value.map(j=>({entry:j,to:Sf(j)??"/",icon:Os(j.icon),current:u.value?.code===j.code}))),f=A(null),v=A(null),m=_(()=>Ni.value.find(j=>j.code===f.value)??null),y=new Map;let x=null,S=!1;function k(j){return`section-flyout-${j}`}function C(j,O){const N=O?.$el;N instanceof HTMLElement?y.set(j,N):y.delete(j)}function L(){x!==null&&(clearTimeout(x),x=null)}function D(){L(),f.value=null}function T(){L(),x=setTimeout(()=>{x=null;const j=document.activeElement,O=f.value;O!==null&&(y.get(O)===j||v.value?.contains(j))||(f.value=null)},uE)}function I(j){a.value&&(L(),f.value=j)}function q(j){S||I(j)}async function H(j,O){a.value&&(j.key==="Enter"||j.key==="ArrowDown"?(j.preventDefault(),I(O),await Ue(),await v.value?.focusFirst()):j.key==="Escape"&&f.value!==null&&(j.preventDefault(),D()))}function E(){const j=f.value;D(),j!==null&&(S=!0,y.get(j)?.focus(),S=!1)}function P(){r(!1),Ue(()=>document.querySelector("[data-sidebar-collapse]")?.focus())}return Be(a,j=>{j||D()}),Ot(L),(j,O)=>(p(),b("nav",{"aria-label":s(h)("backend::lang.nav.plugins"),class:"sticky top-0 flex h-screen w-rail shrink-0 flex-col items-center gap-1.5 self-start overflow-y-auto border-r border-side-border bg-side pt-3.5 pb-3"},[g("button",{type:"button","data-theme-toggle":"","aria-label":i.value,title:i.value,class:"mb-3.5 flex size-10 shrink-0 items-center justify-center rounded-inner bg-accent-soft transition-colors duration-150 ease-out hover:bg-side-hover",onClick:O[0]||(O[0]=(...N)=>s(pv)&&s(pv)(...N))},[(p(),U(Wt(o.value),{size:22,class:"text-accent","aria-hidden":"true"}))],8,lE),(p(!0),b(pe,null,De(c.value,N=>(p(),U(s(qa),{key:N.entry.code,ref_for:!0,ref:Z=>C(N.entry.code,Z),to:N.to,"data-rail-item":N.entry.code,"aria-current":N.current?"page":void 0,"aria-haspopup":s(a)?"menu":void 0,"aria-expanded":s(a)?f.value===N.entry.code?"true":"false":void 0,"aria-controls":s(a)&&f.value===N.entry.code?k(N.entry.code):void 0,class:me([N.current?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"]),onMouseenter:Z=>I(N.entry.code),onMouseleave:T,onFocus:Z=>q(N.entry.code),onBlur:T,onKeydown:Z=>H(Z,N.entry.code)},{default:B(()=>[(p(),U(Wt(N.icon),{size:20,"aria-hidden":"true"})),g("span",oE,w(N.entry.label),1)]),_:2},1032,["to","data-rail-item","aria-current","aria-haspopup","aria-expanded","aria-controls","class","onMouseenter","onFocus","onKeydown"]))),128)),s(a)&&m.value?(p(),U(nE,{key:0,id:k(m.value.code),ref_key:"flyout",ref:v,entry:m.value,onMouseenter:L,onMouseleave:T,onFocusin:L,onFocusout:T,onEscape:E,onLeave:T,onNavigate:D},null,8,["id","entry"])):Y("",!0),O[1]||(O[1]=g("span",{class:"flex-1","aria-hidden":"true"},null,-1)),s(a)&&!s(n)?(p(),b("button",{key:1,type:"button","data-sidebar-expand":"","aria-label":s(h)("backend::lang.nav.expand"),title:s(h)("backend::lang.nav.expand"),class:"mb-1 flex size-10 items-center justify-center rounded-inner text-side-text transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:P},[R(s(vb),{size:20,"aria-hidden":"true"})],8,sE)):Y("",!0),s(F2)?(p(),U(s(qa),{key:2,to:"/settings","data-rail-settings":"","aria-current":d.value?"page":void 0,class:me([d.value?"bg-accent-soft font-bold text-accent":"text-side-text hover:bg-side-hover hover:text-white","flex w-[92px] flex-col items-center gap-1 rounded-inner px-1 py-2 text-center text-[11px] leading-[1.2] tracking-[-0.01em] no-underline transition-colors duration-150 ease-out"])},{default:B(()=>[R(s(gb),{size:20,"aria-hidden":"true"}),g("span",iE,w(s(h)("backend::lang.nav.settings")),1)]),_:1},8,["aria-current","class"])):Y("",!0)],8,rE))}}),dE=["aria-label"],fE={class:"mb-3.5 flex h-10 items-center justify-between gap-2 pl-2"},pE={class:"truncate text-[16px] font-bold"},mE=["aria-label","title"],vE=ne({__name:"SectionPanel",props:{entry:{}},setup(e){const t=e,a=ya(),n=_(()=>lo(a.path)),r=_(()=>t.entry.sideMenu.flatMap(o=>{const i=Ga(o.controller);return i?[{item:o,to:i,icon:Os(o.icon),current:n.value===o.controller}]:[]}));function l(){Of(!0),Ue(()=>document.querySelector("[data-sidebar-expand]")?.focus())}return(o,i)=>(p(),b("aside",{"aria-label":s(h)("backend::lang.nav.sections"),class:"sticky top-0 flex h-screen w-panel shrink-0 flex-col gap-0.5 self-start overflow-y-auto border-r border-border bg-surface px-3 py-3.5"},[g("div",fE,[g("span",pE,w(e.entry.label),1),g("button",{type:"button","data-sidebar-collapse":"","aria-label":s(h)("backend::lang.nav.collapse"),title:s(h)("backend::lang.nav.collapse"),class:"flex size-[30px] shrink-0 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:l},[R(s(Ef),{size:18,"aria-hidden":"true"})],8,mE)]),(p(!0),b(pe,null,De(r.value,u=>(p(),U(s(qa),{key:u.item.code,to:u.to,"aria-current":u.current?"page":void 0,class:me([u.current?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline transition-colors duration-150 ease-out"])},{default:B(()=>[(p(),U(Wt(u.icon),{size:18,"aria-hidden":"true"})),g("span",null,w(u.item.label),1)]),_:2},1032,["to","aria-current","class"]))),128))],8,dE))}}),hE=["aria-label"],yE={class:"mb-3.5 flex h-10 items-center justify-between gap-2 pl-2"},gE={class:"truncate text-[16px] font-bold"},bE=["aria-label","title"],_E=ne({__name:"SettingsPanel",props:{section:{}},setup(e){function t(){Of(!0),Ue(()=>document.querySelector("[data-sidebar-expand]")?.focus())}return(a,n)=>(p(),b("aside",{"data-settings-panel":"","aria-label":s(h)("backend::lang.nav.sections"),class:"sticky top-0 flex h-screen w-panel shrink-0 flex-col gap-0.5 self-start overflow-y-auto border-r border-border bg-surface px-3 py-3.5"},[g("div",yE,[g("span",gE,w(e.section.category||s(h)("backend::lang.nav.settings")),1),g("button",{type:"button","data-sidebar-collapse":"","aria-label":s(h)("backend::lang.nav.collapse"),title:s(h)("backend::lang.nav.collapse"),class:"flex size-[30px] shrink-0 items-center justify-center rounded-tab text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:t},[R(s(Ef),{size:18,"aria-hidden":"true"})],8,bE)]),(p(!0),b(pe,null,De(e.section.entries,r=>(p(),U(s(qa),{key:r.code,to:s(Cf)(r),"data-settings-panel-item":r.code,"aria-current":r.code===e.section.current.code?"page":void 0,class:me([r.code===e.section.current.code?"bg-sel font-semibold text-text":"font-medium text-muted hover:bg-hover hover:text-text","flex h-nav items-center gap-3 rounded-control px-3 no-underline transition-colors duration-150 ease-out"])},{default:B(()=>[(p(),U(Wt(s(Os)(r.icon)),{size:18,"aria-hidden":"true"})),g("span",null,w(r.label),1)]),_:2},1032,["to","data-settings-panel-item","aria-current","class"]))),128))],8,hE))}}),xE=["aria-label"],kE={class:"flex min-w-0 items-center gap-2"},wE=["aria-current"],$E=ne({__name:"Breadcrumbs",setup(e){const t=ya(),a=_(()=>{if(t.name==="account")return[{label:h("backend::lang.myaccount.menu_label")}];if(t.name==="plugins")return[{label:h("backend::lang.nav.settings"),to:"/settings"},{label:h("backend::lang.plugins.title")}];if(t.name==="settings"||t.name==="settings-form"){const i=[{label:h("backend::lang.nav.settings"),to:"/settings"}],u=t.name==="settings-form"?cs(String(t.params.code??"")):null;return u&&i.push({label:u.label}),i}const n=Es(String(t.params.vendor??""),String(t.params.plugin??"")),r=lo(t.path);if(!n){const i=Su(r);if(!i)return[];const u=[{label:h("backend::lang.nav.settings"),to:"/settings"},{label:i.label,to:Cf(i)}];return(t.name==="record"||t.name==="create")&&Bo.value!==""&&u.push({label:Bo.value}),u}const l=[{label:n.label,to:Sf(n)??void 0}],o=n.sideMenu.find(i=>i.controller===r)??null;return o&&l.push({label:o.label,to:Ga(o.controller)??void 0}),(t.name==="record"||t.name==="create")&&Bo.value!==""&&l.push({label:Bo.value}),l});return(n,r)=>(p(),b("nav",{"aria-label":s(h)("backend::lang.nav.breadcrumbs"),class:"min-w-0"},[g("ol",kE,[(p(!0),b(pe,null,De(a.value,(l,o)=>(p(),b("li",{key:o,"data-crumb":"",class:"flex min-w-0 items-center gap-2"},[o>0?(p(),U(s(so),{key:0,size:14,class:"shrink-0 text-muted","aria-hidden":"true"})):Y("",!0),o===a.value.length-1||!l.to?(p(),b("span",{key:1,"aria-current":o===a.value.length-1?"page":void 0,class:me([o===a.value.length-1?"font-semibold text-text":"text-muted","truncate"])},w(l.label),11,wE)):(p(),U(s(qa),{key:2,to:l.to,class:"truncate text-muted no-underline transition-colors duration-150 ease-out hover:text-text"},{default:B(()=>[_e(w(l.label),1)]),_:2},1032,["to"]))]))),128))])],8,xE))}});function mv(e){return typeof e=="string"?`'${e}'`:new CE().serialize(e)}const SE=" _-,;:!?.'\"()[]{}@*/\\&#%`^+<=>|~$0123456789abcdefghijklmnopqrstuvwxyz",Ks=(function(){const e=new Uint8Array(128);for(let t=0;t<69;t++)e[SE.charCodeAt(t)]=t+1;for(let t=65;t<=90;t++)e[t]=e[t+32];return e})();function yc(e,t){if(e===t)return 0;const a=Math.min(e.length,t.length);let n=0;for(let r=0;r<a;r++){const l=e.charCodeAt(r),o=t.charCodeAt(r);if(l===o)continue;const i=l<128&&Ks[l]?Ks[l]:l+128,u=o<128&&Ks[o]?Ks[o]:o+128;if(i!==u)return i<u?-1:1;n===0&&(n=l>o?-1:1)}return e.length!==t.length?e.length<t.length?-1:1:n}const CE=(function(){class e{#e=new Map;compare(a,n){const r=typeof a,l=typeof n;return r==="string"&&l==="string"?yc(a,n):r==="number"&&l==="number"?a-n:yc(this.serialize(a,!0),this.serialize(n,!0))}serialize(a,n){if(a===null)return"null";switch(typeof a){case"string":return n?a:`'${a}'`;case"bigint":return`${a}n`;case"object":return this.$object(a);case"function":return this.$function(a)}return String(a)}serializeObject(a){const n=Object.prototype.toString.call(a);if(n!=="[object Object]")return this.serializeBuiltInType(n.length<10?`unknown:${n}`:n.slice(8,-1),a);const r=a.constructor,l=r===Object||r===void 0?"":r.name;if(l!==""&&globalThis[l]===r)return this.serializeBuiltInType(l,a);if("toJSON"in a&&typeof a.toJSON=="function"){const u=a.toJSON();return l+(u!==null&&typeof u=="object"?this.$object(u):`(${this.serialize(u)})`)}const o=Object.keys(a).sort(yc);let i=`${l}{`;for(let u=0;u<o.length;u++){const d=o[u];i+=`${d}:${this.serialize(a[d])}`,u<o.length-1&&(i+=",")}return i+"}"}serializeBuiltInType(a,n){const r=this["$"+a];if(r)return r.call(this,n);if(typeof n.entries=="function")return this.serializeObjectEntries(a,n.entries());throw new Error(`Cannot serialize ${a}`)}serializeObjectEntries(a,n){const r=Array.from(n).sort((o,i)=>this.compare(o[0],i[0]));let l=`${a}{`;for(let o=0;o<r.length;o++){const[i,u]=r[o];l+=`${this.serialize(i,!0)}:${this.serialize(u)}`,o<r.length-1&&(l+=",")}return l+"}"}$object(a){let n=this.#e.get(a);return n===void 0&&(this.#e.set(a,`#${this.#e.size}`),n=this.serializeObject(a),this.#e.set(a,n)),n}$function(a){const n=Function.prototype.toString.call(a);return n.slice(-15)==="[native code] }"?`${a.name||""}()[native]`:`${a.name}(${a.length})${n.replace(/\s*\n\s*/g,"")}`}$Array(a){let n="[";for(let r=0;r<a.length;r++)n+=this.serialize(a[r]),r<a.length-1&&(n+=",");return n+"]"}$Date(a){try{return`Date(${a.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(a){return`ArrayBuffer[${new Uint8Array(a).join(",")}]`}$Set(a){return`Set${this.$Array(Array.from(a).sort((n,r)=>this.compare(n,r)))}`}$Map(a){return this.serializeObjectEntries("Map",a.entries())}}for(const t of["Error","RegExp","URL"])e.prototype["$"+t]=function(a){return`${t}(${a})`};for(const t of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])e.prototype["$"+t]=function(a){return`${t}[${a.join(",")}]`};for(const t of["BigInt64Array","BigUint64Array"])e.prototype["$"+t]=function(a){return`${t}[${a.join("n,")}${a.length>0?"n":""}]`};return e})();function fs(e,t){return e===t||mv(e)===mv(t)}function Ws(e,t){let a=e;const n=t.toString(),r=n.indexOf("."),l=r>=0?n.length-r:0;if(l>0){const o=10**l;a=Math.round(a*o)/o}return a}function gc(e,t,a,n){t=Number(t),a=Number(a);const r=(e-(Number.isNaN(t)?0:t))%n;let l=Ws(Math.abs(r)*2>=n?e+Math.sign(r)*(n-Math.abs(r)):e-r,n);return Number.isNaN(t)?!Number.isNaN(a)&&l>a&&(l=Math.floor(Ws(a/n,n))*n):l<t?l=t:!Number.isNaN(a)&&l>a&&(l=t+Math.floor(Ws((a-t)/n,n))*n),l=Ws(l,n),l}function Dt(e,t){const a=typeof e=="string"&&!t?`${e}Context`:t,n=Symbol(a);return[o=>{const i=ct(n,o);if(i||i===null)return i;throw new Error(`Injection \`${n.toString()}\` not found. Component must be used within ${Array.isArray(e)?`one of the following components: ${e.join(", ")}`:`\`${e}\``}`)},o=>(ht(n,o),o)]}function Yt(){let e=document.activeElement;if(e==null)return null;for(;e!=null&&e.shadowRoot!=null&&e.shadowRoot.activeElement!=null;)e=e.shadowRoot.activeElement;return e}function Df(e,t,a){const n=a.originalEvent.target,r=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});t&&n.addEventListener(e,t,{once:!0}),n.dispatchEvent(r)}function $a(e){return e==null}function vv(e,t){return $a(e)?!1:Array.isArray(e)?e.some(a=>fs(a,t)):fs(e,t)}function EE(e,t){var a;const n=cl();return Ea(()=>{n.value=e()},{...t,flush:(a=t?.flush)!==null&&a!==void 0?a:"sync"}),At(n)}function Db(e,t){return rf()?(my(e,t),!0):!1}function AE(e){let t=!1,a;const n=py(!0);return((...r)=>(t||(a=n.run(()=>e(...r)),t=!0),a))}const Gn=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const TE=e=>typeof e<"u",OE=Object.prototype.toString,DE=e=>OE.call(e)==="[object Object]",hv=ME();function ME(){var e,t,a;return Gn&&!!(!((e=window)===null||e===void 0||(e=e.navigator)===null||e===void 0)&&e.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window)===null||t===void 0||(t=t.navigator)===null||t===void 0?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test((a=window)===null||a===void 0?void 0:a.navigator.userAgent))}function bc(e){return Array.isArray(e)?e:[e]}function PE(e){return bn()}function Mb(e){if(!Gn)return e;let t=0,a,n;const r=()=>{t-=1,n&&t<=0&&(n.stop(),a=void 0,n=void 0)};return((...l)=>(t+=1,n||(n=py(!0),a=n.run(()=>e(...l))),Db(r),a))}function RE(e){return Ua(wt(e)?new Proxy({},{get(t,a,n){return s(Reflect.get(e.value,a,n))},set(t,a,n){return wt(e.value[a])&&!wt(n)?e.value[a].value=n:e.value[a]=n,!0},deleteProperty(t,a){return Reflect.deleteProperty(e.value,a)},has(t,a){return Reflect.has(e.value,a)},ownKeys(){return Object.keys(e.value)},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}):e)}function IE(e){return RE(_(e))}function Mf(e,...t){const a=t.flat(),n=a[0];return IE(()=>Object.fromEntries(typeof n=="function"?Object.entries(Kt(e)).filter(([r,l])=>!n(ca(l),r)):Object.entries(Kt(e)).filter(r=>!a.includes(r[0]))))}function qE(e,t=1e4){return hx((a,n)=>{let r=ca(e),l;const o=()=>setTimeout(()=>{r=ca(e),n()},ca(t));return Db(()=>{clearTimeout(l)}),{get(){return a(),r},set(i){r=i,n(),clearTimeout(l),l=o()}}})}function LE(e,t){PE()&&Ot(e,t)}function NE(e,t,a){return Be(e,t,{...a,immediate:!0})}const Pf=Gn?window:void 0;function pl(e){var t;const a=ca(e);return(t=a?.$el)!==null&&t!==void 0?t:a}function ao(...e){const t=(n,r,l,o)=>(n.addEventListener(r,l,o),()=>n.removeEventListener(r,l,o)),a=_(()=>{const n=bc(ca(e[0])).filter(r=>r!=null);return n.every(r=>typeof r!="string")?n:void 0});return NE(()=>{var n,r;return[(n=(r=a.value)===null||r===void 0?void 0:r.map(l=>pl(l)))!==null&&n!==void 0?n:[Pf].filter(l=>l!=null),bc(ca(a.value?e[1]:e[0])),bc(s(a.value?e[2]:e[1])),ca(a.value?e[3]:e[2])]},([n,r,l,o],i,u)=>{if(!n?.length||!r?.length||!l?.length)return;const d=DE(o)?{...o}:o,c=n.flatMap(f=>r.flatMap(v=>l.map(m=>t(f,v,m,d))));u(()=>{c.forEach(f=>f())})},{flush:"post"})}function BE(){const e=cl(!1),t=bn();return t&&$t(()=>{e.value=!0},t),e}function FE(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function VE(...e){let t,a,n={};e.length===3?(t=e[0],a=e[1],n=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,a=e[0],n=e[1]):(t=e[0],a=e[1]):(t=!0,a=e[0]);const{target:r=Pf,eventName:l="keydown",passive:o=!1,dedupe:i=!1}=n,u=FE(t);return ao(r,l,c=>{c.repeat&&ca(i)||u(c)&&a(c)},o)}function zE(e){return JSON.parse(JSON.stringify(e))}function Nt(e,t,a,n={}){var r,l;const{clone:o=!1,passive:i=!1,eventName:u,deep:d=!1,defaultValue:c,shouldEmit:f}=n,v=bn(),m=a||v?.emit||(v==null||(r=v.$emit)===null||r===void 0?void 0:r.bind(v))||(v==null||(l=v.proxy)===null||l===void 0||(l=l.$emit)===null||l===void 0?void 0:l.bind(v?.proxy));let y=u;t||(t="modelValue"),y=y||`update:${t.toString()}`;const x=C=>o?typeof o=="function"?o(C):zE(C):C,S=()=>TE(e[t])?x(e[t]):c,k=C=>{f?f(C)&&m(y,C):m(y,C)};if(i){const C=A(S());let L=!1;return Be(()=>e[t],D=>{L||(L=!0,C.value=x(D),Ue(()=>L=!1))}),Be(C,D=>{!L&&(D!==e[t]||d)&&k(D)},{deep:d}),C}else return _({get(){return S()},set(C){k(C)}})}function Rf(e){return e?e.flatMap(t=>t.type===pe?Rf(t.children):[t]):[]}const jE=["INPUT","TEXTAREA"];function yv(e,t,a,n={}){if(!t||n.enableIgnoredElement&&jE.includes(t.nodeName))return null;const{arrowKeyOptions:r="both",attributeName:l="[data-reka-collection-item]",itemsArray:o=[],loop:i=!0,dir:u="ltr",preventScroll:d=!0,focus:c=!1}=n,[f,v,m,y,x,S]=[e.key==="ArrowRight",e.key==="ArrowLeft",e.key==="ArrowUp",e.key==="ArrowDown",e.key==="Home",e.key==="End"],k=m||y,C=f||v;if(!x&&!S&&(!k&&!C||r==="vertical"&&C||r==="horizontal"&&k))return null;const L=a?Array.from(a.querySelectorAll(l)):o;if(!L.length)return null;d&&e.preventDefault();let D=null;return C||k?D=Pb(L,t,{goForward:k?y:u==="ltr"?f:v,loop:i}):x?D=L.at(0)||null:S&&(D=L.at(-1)||null),c&&D?.focus(),D}function Pb(e,t,a,n=e.includes(t)?e.length:e.length+1){if(--n===0)return null;const r=e.indexOf(t);let l;if(r===-1?l=a.goForward?0:e.length-1:l=a.goForward?r+1:r-1,!a.loop&&(l<0||l>=e.length))return null;const o=(l+e.length)%e.length,i=e[o];return i?i.hasAttribute("disabled")&&i.getAttribute("disabled")!=="false"?Pb(e,i,a,n):i:null}const[Au]=Dt("ConfigProvider");function _c(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)==="[object Module]":!0}function Ed(e,t,a=".",n){if(!_c(t))return Ed(e,{},a,n);const r={...t};for(const l of Object.keys(e)){if(l==="__proto__"||l==="constructor")continue;const o=e[l];o!=null&&(n&&n(r,l,o,a)||(Array.isArray(o)&&Array.isArray(r[l])?r[l]=[...o,...r[l]]:_c(o)&&_c(r[l])?r[l]=Ed(o,r[l],(a?`${a}.`:"")+l.toString(),n):r[l]=o))}return r}function UE(e){return(...t)=>t.reduce((a,n)=>Ed(a,n,"",e),{})}const Rb=UE(),HE=Mb(()=>{const e=A(new Map),t=A(),a=_(()=>{for(const o of e.value.values())if(o)return!0;return!1}),n=Au({scrollBody:A(!0)});let r=null;const l=()=>{document.body.style.paddingRight="",document.body.style.marginRight="",document.body.style.pointerEvents="",document.documentElement.style.removeProperty("--scrollbar-width"),document.body.style.overflow=t.value??"",hv&&r?.(),t.value=void 0};return Be(a,(o,i)=>{if(!Gn)return;if(!o){i&&l();return}t.value===void 0&&(t.value=document.body.style.overflow);const u=window.innerWidth-document.documentElement.clientWidth,d={padding:u,margin:0},c=n.scrollBody?.value?typeof n.scrollBody.value=="object"?Rb({padding:n.scrollBody.value.padding===!0?u:n.scrollBody.value.padding,margin:n.scrollBody.value.margin===!0?u:n.scrollBody.value.margin},d):d:{padding:0,margin:0};u>0&&(document.body.style.paddingRight=typeof c.padding=="number"?`${c.padding}px`:String(c.padding),document.body.style.marginRight=typeof c.margin=="number"?`${c.margin}px`:String(c.margin),document.documentElement.style.setProperty("--scrollbar-width",`${u}px`),document.body.style.overflow="hidden"),hv&&(r=ao(document,"touchmove",f=>KE(f),{passive:!1})),Ue(()=>{a.value&&(document.body.style.pointerEvents="none",document.body.style.overflow="hidden")})},{immediate:!0,flush:"sync"}),e});function If(e){const t=Math.random().toString(36).substring(2,7),a=HE();a.value.set(t,e??!1);const n=_({get:()=>a.value.get(t)??!1,set:r=>a.value.set(t,r)});return LE(()=>{a.value.delete(t)}),n}function Ib(e){const t=window.getComputedStyle(e);if(t.overflowX==="scroll"||t.overflowY==="scroll"||t.overflowX==="auto"&&e.clientWidth<e.scrollWidth||t.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const a=e.parentNode;return!(a instanceof Element)||a.tagName==="BODY"?!1:Ib(a)}}function KE(e){const t=e||window.event,a=t.target;return a instanceof Element&&Ib(a)?!1:t.touches.length>1?!0:(t.preventDefault&&t.cancelable&&t.preventDefault(),!1)}function Hl(e,t){return e-t*Math.floor(e/t)}const qb=1721426;function al(e,t,a,n){t=Ds(e,t);let r=t-1,l=-2;return a<=2?l=0:hr(t)&&(l=-1),qb-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*a-362)/12+l+n)}function hr(e){return e%4===0&&(e%100!==0||e%400===0)}function Ds(e,t){return e==="BC"?1-t:t}function Tu(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const WE={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class Ya{fromJulianDay(t){let a=t,n=a-qb,r=Math.floor(n/146097),l=Hl(n,146097),o=Math.floor(l/36524),i=Hl(l,36524),u=Math.floor(i/1461),d=Hl(i,1461),c=Math.floor(d/365),f=r*400+o*100+u*4+c+(o!==4&&c!==4?1:0),[v,m]=Tu(f),y=a-al(v,m,1,1),x=2;a<al(v,m,3,1)?x=0:hr(m)&&(x=1);let S=Math.floor(((y+x)*12+373)/367),k=a-al(v,m,S,1)+1;return new kt(v,m,S,k)}toJulianDay(t){return al(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return WE[hr(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return hr(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const GE={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function $r(e,t){return t=pa(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function qf(e,t){return t=pa(t,e.calendar),e=Ad(e),t=Ad(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Kl(e,t){return Lf(e.calendar,t.calendar)&&$r(e,t)}function gv(e,t){return Lf(e.calendar,t.calendar)&&qf(e,t)}function Lf(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function YE(e,t){return $r(e,Ms(t))}const JE={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function Ou(e,t,a){let n=e.calendar.toJulianDay(e),r=a?JE[a]:eA(t),l=Math.ceil(n+1-r)%7;return l<0&&(l+=7),l}function ZE(e){return Mn(Date.now(),e)}function Ms(e){return nA(ZE(e))}function Lb(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function Nb(e,t){return bv(e)-bv(t)}function bv(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let xc=null,XE=!1;function Ja(){return xc==null&&(xc=new Intl.DateTimeFormat().resolvedOptions().timeZone),xc}function Bb(){return XE}function Ad(e){return e.subtract({days:e.day-1})}function _v(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}const xv=new Map,kc=new Map;function QE(e){if(Intl.Locale){let a=xv.get(e);return a||(a=new Intl.Locale(e).maximize().region,a&&xv.set(e,a)),a}let t=e.split("-")[1];return t==="u"?void 0:t}function eA(e){let t=kc.get(e);if(!t){if(Intl.Locale){let n=new Intl.Locale(e);if("getWeekInfo"in n&&(t=n.getWeekInfo(),t))return kc.set(e,t),t.firstDay}let a=QE(e);if(e.includes("-fw-")){let n=e.split("-fw-")[1].split("-")[0];n==="mon"?t={firstDay:1}:n==="tue"?t={firstDay:2}:n==="wed"?t={firstDay:3}:n==="thu"?t={firstDay:4}:n==="fri"?t={firstDay:5}:n==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:a&&GE[a]||0};kc.set(e,t)}return t.firstDay}function no(e){e=pa(e,new Ya);let t=Ds(e.era,e.year);return Fb(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Fb(e,t,a,n,r,l,o){let i=new Date;return i.setUTCHours(n,r,l,o),i.setUTCFullYear(e,t-1,a),i.getTime()}function Td(e,t){if(t==="UTC")return 0;if(e>0&&t===Ja()&&!Bb())return new Date(e).getTimezoneOffset()*-6e4;let{year:a,month:n,day:r,hour:l,minute:o,second:i}=Vb(e,t);return Fb(a,n,r,l,o,i,0)-Math.floor(e/1e3)*1e3}const kv=new Map;function Vb(e,t){let a=kv.get(t);a||(a=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),kv.set(t,a));let n=a.formatToParts(new Date(e)),r={};for(let l of n)l.type!=="literal"&&(r[l.type]=l.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const wv=864e5;function tA(e,t,a,n){return(a===n?[a]:[a,n]).filter(l=>aA(e,t,l))}function aA(e,t,a){let n=Vb(a,t);return e.year===n.year&&e.month===n.month&&e.day===n.day&&e.hour===n.hour&&e.minute===n.minute&&e.second===n.second}function Dn(e,t,a="compatible"){let n=vn(e);if(t==="UTC")return no(n);if(t===Ja()&&a==="compatible"&&!Bb()){n=pa(n,new Ya);let u=new Date,d=Ds(n.era,n.year);return u.setFullYear(d,n.month-1,n.day),u.setHours(n.hour,n.minute,n.second,n.millisecond),u.getTime()}let r=no(n),l=Td(r-wv,t),o=Td(r+wv,t),i=tA(n,t,r-l,r-o);if(i.length===1)return i[0];if(i.length>1)switch(a){case"compatible":case"earlier":return i[0];case"later":return i[i.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(a){case"earlier":return Math.min(r-l,r-o);case"compatible":case"later":return Math.max(r-l,r-o);case"reject":throw new RangeError("No such absolute time found")}}function zb(e,t,a="compatible"){return new Date(Dn(e,t,a))}function Mn(e,t){let a=Td(e,t),n=new Date(e+a),r=n.getUTCFullYear(),l=n.getUTCMonth()+1,o=n.getUTCDate(),i=n.getUTCHours(),u=n.getUTCMinutes(),d=n.getUTCSeconds(),c=n.getUTCMilliseconds();return new jn(r<1?"BC":"AD",r<1?-r+1:r,l,o,t,a,i,u,d,c)}function nA(e){return new kt(e.calendar,e.era,e.year,e.month,e.day)}function vn(e,t){let a=0,n=0,r=0,l=0;if("timeZone"in e)({hour:a,minute:n,second:r,millisecond:l}=e);else if("hour"in e&&!t)return e;return t&&({hour:a,minute:n,second:r,millisecond:l}=t),new Sr(e.calendar,e.era,e.year,e.month,e.day,a,n,r,l)}function pa(e,t){if(Lf(e.calendar,t))return e;let a=t.fromJulianDay(e.calendar.toJulianDay(e)),n=e.copy();return n.calendar=t,n.era=a.era,n.year=a.year,n.month=a.month,n.day=a.day,ol(n),n}function Nf(e,t,a){if(e instanceof jn)return e.timeZone===t?e:Du(e,t);let n=Dn(e,t,a);return Mn(n,t)}function rA(e){let t=no(e)-e.offset;return new Date(t)}function Du(e,t){let a=no(e)-e.offset;return pa(Mn(a,t),e.calendar)}const Co=36e5;function Mu(e,t){let a=e.copy(),n="hour"in a?Kb(a,t):0;Od(a,t.years||0),a.calendar.balanceYearMonth&&a.calendar.balanceYearMonth(a,e),a.month+=t.months||0,Dd(a),jb(a),a.day+=(t.weeks||0)*7,a.day+=t.days||0,a.day+=n,lA(a),a.calendar.balanceDate&&a.calendar.balanceDate(a),a.year<1&&(a.year=1,a.month=1,a.day=1);let r=a.calendar.getYearsInEra(a);if(a.year>r){let o=a.calendar.isInverseEra?.(a);a.year=r,a.month=o?1:a.calendar.getMonthsInYear(a),a.day=o?1:a.calendar.getDaysInMonth(a)}a.month<1&&(a.month=1,a.day=1);let l=a.calendar.getMonthsInYear(a);return a.month>l&&(a.month=l,a.day=a.calendar.getDaysInMonth(a)),a.day=Math.max(1,Math.min(a.calendar.getDaysInMonth(a),a.day)),a}function Od(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Dd(e){for(;e.month<1;)Od(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,Od(e,1)}function lA(e){for(;e.day<1;)e.month--,Dd(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Dd(e)}function jb(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function ol(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),jb(e)}function Bf(e){let t={};for(let a in e)typeof e[a]=="number"&&(t[a]=-e[a]);return t}function Ub(e,t){return Mu(e,Bf(t))}function Ff(e,t){let a=e.copy();return t.era!=null&&(a.era=t.era),t.year!=null&&(a.year=t.year),t.month!=null&&(a.month=t.month),t.day!=null&&(a.day=t.day),ol(a),a}function ps(e,t){let a=e.copy();return t.hour!=null&&(a.hour=t.hour),t.minute!=null&&(a.minute=t.minute),t.second!=null&&(a.second=t.second),t.millisecond!=null&&(a.millisecond=t.millisecond),Hb(a),a}function oA(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Gs(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Gs(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Gs(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Gs(e.hour,24),t}function Hb(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Gs(e,t){let a=e%t;return a<0&&(a+=t),a}function Kb(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,oA(e)}function Wb(e,t){let a=e.copy();return Kb(a,t),a}function sA(e,t){return Wb(e,Bf(t))}function Vf(e,t,a,n){let r=e.copy();switch(t){case"era":{let l=e.calendar.getEras(),o=l.indexOf(e.era);if(o<0)throw new Error("Invalid era: "+e.era);o=Pn(o,a,0,l.length-1,n?.round),r.era=l[o],ol(r);break}case"year":r.calendar.isInverseEra?.(r)&&(a=-a),r.year=Pn(e.year,a,-1/0,9999,n?.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e);break;case"month":r.month=Pn(e.month,a,1,e.calendar.getMonthsInYear(e),n?.round);break;case"day":r.day=Pn(e.day,a,1,e.calendar.getDaysInMonth(e),n?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(r),ol(r),r}function zf(e,t,a,n){let r=e.copy();switch(t){case"hour":{let l=e.hour,o=0,i=23;if(n?.hourCycle===12){let u=l>=12;o=u?12:0,i=u?23:11}r.hour=Pn(l,a,o,i,n?.round);break}case"minute":r.minute=Pn(e.minute,a,0,59,n?.round);break;case"second":r.second=Pn(e.second,a,0,59,n?.round);break;case"millisecond":r.millisecond=Pn(e.millisecond,a,0,999,n?.round);break;default:throw new Error("Unsupported field "+t)}return r}function Pn(e,t,a,n,r=!1){if(r){e+=Math.sign(t),e<a&&(e=n);let l=Math.abs(t);t>0?e=Math.ceil(e/l)*l:e=Math.floor(e/l)*l,e>n&&(e=a)}else e+=t,e<a?e=n-(a-e-1):e>n&&(e=a+(e-n-1));return e}function Gb(e,t){let a;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=Mu(vn(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});a=Dn(r,e.timeZone)}else a=no(e)-e.offset;a+=t.milliseconds||0,a+=(t.seconds||0)*1e3,a+=(t.minutes||0)*6e4,a+=(t.hours||0)*36e5;let n=Mn(a,e.timeZone);return pa(n,e.calendar)}function iA(e,t){return Gb(e,Bf(t))}function uA(e,t,a,n){switch(t){case"hour":{let r=0,l=23;if(n?.hourCycle===12){let y=e.hour>=12;r=y?12:0,l=y?23:11}let o=vn(e),i=pa(ps(o,{hour:r}),new Ya),u=[Dn(i,e.timeZone,"earlier"),Dn(i,e.timeZone,"later")].filter(y=>Mn(y,e.timeZone).day===i.day)[0],d=pa(ps(o,{hour:l}),new Ya),c=[Dn(d,e.timeZone,"earlier"),Dn(d,e.timeZone,"later")].filter(y=>Mn(y,e.timeZone).day===d.day).pop(),f=no(e)-e.offset,v=Math.floor(f/Co),m=f%Co;return f=Pn(v,a,Math.floor(u/Co),Math.floor(c/Co),n?.round)*Co+m,pa(Mn(f,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return zf(e,t,a,n);case"era":case"year":case"month":case"day":{let r=Vf(vn(e),t,a,n),l=Dn(r,e.timeZone);return pa(Mn(l,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function cA(e,t,a){let n=vn(e),r=ps(Ff(n,t),t);if(r.compare(n)===0)return e;let l=Dn(r,e.timeZone,a);return pa(Mn(l,e.timeZone),e.calendar)}const dA=/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?$/,fA=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,Yb=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function pA(e){let t=e.match(dA);if(!t)throw new Error("Invalid ISO 8601 time string: "+e);return new un(ea(t[1],0,23),t[2]?ea(t[2],0,59):0,t[3]?ea(t[3],0,59):0,t[4]?ea(t[4],0,1/0)*1e3:0)}function Jb(e){let t=e.match(fA);if(!t)throw Yb.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let a=new kt(ea(t[1],0,9999),ea(t[2],1,12),1);return a.day=ea(t[3],1,a.calendar.getDaysInMonth(a)),a}function $v(e,t){let a=e.match(Yb);if(!a)throw new Error("Invalid ISO 8601 date time string: "+e);let n=ea(a[1],-9999,9999),r=n<1?"BC":"AD",l=new jn(r,n<1?-n+1:n,ea(a[2],1,12),1,t,0,a[4]?ea(a[4],0,23):0,a[5]?ea(a[5],0,59):0,a[6]?ea(a[6],0,59):0,a[7]?ea(a[7],0,1/0)*1e3:0);return l.day=ea(a[3],0,l.calendar.getDaysInMonth(l)),a[8]&&(l.offset=ea(a[8],-23,23)*36e5+ea(a[9]??"0",0,59)*6e4),Du(l,t)}function ea(e,t,a){let n=Number(e);if(n<t||n>a)throw new RangeError(`Value out of range: ${t} <= ${n} <= ${a}`);return n}function Zb(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Xb(e){let t=pa(e,new Ya),a;return t.era==="BC"?a=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):a=String(t.year).padStart(4,"0"),`${a}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Qb(e){return`${Xb(e)}T${Zb(e)}`}function mA(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let a=Math.floor(e/36e5),n=Math.floor(e%36e5/6e4),r=Math.floor(e%36e5%6e4/1e3),l=`${t}${String(a).padStart(2,"0")}:${String(n).padStart(2,"0")}`;return r!==0&&(l+=`:${String(r).padStart(2,"0")}`),l}function vA(e){return`${Qb(e)}${mA(e.offset)}[${e.timeZone}]`}function jf(e){let t=typeof e[0]=="object"?e.shift():new Ya,a;if(typeof e[0]=="string")a=e.shift();else{let o=t.getEras();a=o[o.length-1]}let n=e.shift(),r=e.shift(),l=e.shift();return[t,a,n,r,l]}class kt{#e;constructor(...t){let[a,n,r,l,o]=jf(t);this.calendar=a,this.era=n,this.year=r,this.month=l,this.day=o,ol(this)}copy(){return this.era?new kt(this.calendar,this.era,this.year,this.month,this.day):new kt(this.calendar,this.year,this.month,this.day)}add(t){return Mu(this,t)}subtract(t){return Ub(this,t)}set(t){return Ff(this,t)}cycle(t,a,n){return Vf(this,t,a,n)}toDate(t){return zb(this,t)}toString(){return Xb(this)}compare(t){return Lb(this,t)}}class un{#e;constructor(t=0,a=0,n=0,r=0){this.hour=t,this.minute=a,this.second=n,this.millisecond=r,Hb(this)}copy(){return new un(this.hour,this.minute,this.second,this.millisecond)}add(t){return Wb(this,t)}subtract(t){return sA(this,t)}set(t){return ps(this,t)}cycle(t,a,n){return zf(this,t,a,n)}toString(){return Zb(this)}compare(t){return Nb(this,t)}}class Sr{#e;constructor(...t){let[a,n,r,l,o]=jf(t);this.calendar=a,this.era=n,this.year=r,this.month=l,this.day=o,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ol(this)}copy(){return this.era?new Sr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new Sr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Mu(this,t)}subtract(t){return Ub(this,t)}set(t){return Ff(ps(this,t),t)}cycle(t,a,n){switch(t){case"era":case"year":case"month":case"day":return Vf(this,t,a,n);default:return zf(this,t,a,n)}}toDate(t,a){return zb(this,t,a)}toString(){return Qb(this)}compare(t){let a=Lb(this,t);return a===0?Nb(this,vn(t)):a}}class jn{#e;constructor(...t){let[a,n,r,l,o]=jf(t),i=t.shift(),u=t.shift();this.calendar=a,this.era=n,this.year=r,this.month=l,this.day=o,this.timeZone=i,this.offset=u,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,ol(this)}copy(){return this.era?new jn(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new jn(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Gb(this,t)}subtract(t){return iA(this,t)}set(t,a){return cA(this,t,a)}cycle(t,a,n){return uA(this,t,a,n)}toDate(){return rA(this)}toString(){return vA(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Nf(t,this.timeZone).toDate().getTime()}}const Wl=[[1868,9,8],[1912,7,30],[1926,12,25],[1989,1,8],[2019,5,1]],hA=[[1912,7,29],[1926,12,24],[1989,1,7],[2019,4,30]],gi=[1867,1911,1925,1988,2018],vr=["meiji","taisho","showa","heisei","reiwa"];function Sv(e){const t=Wl.findIndex(([a,n,r])=>e.year<a||e.year===a&&e.month<n||e.year===a&&e.month===n&&e.day<r);return t===-1?Wl.length-1:t===0?0:t-1}function wc(e){let t=gi[vr.indexOf(e.era)];if(!t)throw new Error("Unknown era: "+e.era);return new kt(e.year+t,e.month,e.day)}class yA extends Ya{fromJulianDay(t){let a=super.fromJulianDay(t),n=Sv(a);return new kt(this,vr[n],a.year-gi[n],a.month,a.day)}toJulianDay(t){return super.toJulianDay(wc(t))}balanceDate(t){let a=wc(t),n=Sv(a);vr[n]!==t.era&&(t.era=vr[n],t.year=a.year-gi[n]),this.constrainDate(t)}constrainDate(t){let a=vr.indexOf(t.era),n=hA[a];if(n!=null){let[r,l,o]=n,i=r-gi[a];t.year=Math.max(1,Math.min(i,t.year)),t.year===i&&(t.month=Math.min(l,t.month),t.month===l&&(t.day=Math.min(o,t.day)))}if(t.year===1&&a>=0){let[,r,l]=Wl[a];t.month=Math.max(r,t.month),t.month===r&&(t.day=Math.max(l,t.day))}}getEras(){return vr}getYearsInEra(t){let a=vr.indexOf(t.era),n=Wl[a],r=Wl[a+1];if(r==null)return 9999-n[0]+1;let l=r[0]-n[0];return(t.month<r[1]||t.month===r[1]&&t.day<r[2])&&l++,l}getDaysInMonth(t){return super.getDaysInMonth(wc(t))}getMinimumMonthInYear(t){let a=Cv(t);return a?a[1]:1}getMinimumDayInMonth(t){let a=Cv(t);return a&&t.month===a[1]?a[2]:1}constructor(...t){super(...t),this.identifier="japanese"}}function Cv(e){if(e.year===1){let t=vr.indexOf(e.era);return Wl[t]}}const e1=-543;class gA extends Ya{fromJulianDay(t){let a=super.fromJulianDay(t),n=Ds(a.era,a.year);return new kt(this,n-e1,a.month,a.day)}toJulianDay(t){return super.toJulianDay(Ev(t))}getEras(){return["BE"]}getDaysInMonth(t){return super.getDaysInMonth(Ev(t))}balanceDate(){}constructor(...t){super(...t),this.identifier="buddhist"}}function Ev(e){let[t,a]=Tu(e.year+e1);return new kt(t,a,e.month,e.day)}const Ki=1911;function t1(e){return e.era==="minguo"?e.year+Ki:1-e.year+Ki}function Av(e){let t=e-Ki;return t>0?["minguo",t]:["before_minguo",1-t]}class bA extends Ya{fromJulianDay(t){let a=super.fromJulianDay(t),n=Ds(a.era,a.year),[r,l]=Av(n);return new kt(this,r,l,a.month,a.day)}toJulianDay(t){return super.toJulianDay(Tv(t))}getEras(){return["before_minguo","minguo"]}balanceDate(t){let[a,n]=Av(t1(t));t.era=a,t.year=n}isInverseEra(t){return t.era==="before_minguo"}getDaysInMonth(t){return super.getDaysInMonth(Tv(t))}getYearsInEra(t){return t.era==="before_minguo"?9999:9999-Ki}constructor(...t){super(...t),this.identifier="roc"}}function Tv(e){let[t,a]=Tu(t1(e));return new kt(t,a,e.month,e.day)}const Ov=1948320,Dv=[0,31,62,93,124,155,186,216,246,276,306,336];class _A{fromJulianDay(t){let a=t-Ov,n=1+Math.floor((33*a+3)/12053),r=365*(n-1)+Math.floor((8*n+21)/33),l=a-r,o=l<216?Math.floor(l/31):Math.floor((l-6)/30),i=l-Dv[o]+1;return new kt(this,n,o+1,i)}toJulianDay(t){let a=Ov-1+365*(t.year-1)+Math.floor((8*t.year+21)/33);return a+=Dv[t.month-1],a+=t.day,a}getMonthsInYear(){return 12}getDaysInMonth(t){return t.month<=6?31:t.month<=11||Hl(25*t.year+11,33)<8?30:29}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getEras(){return["AP"]}getYearsInEra(){return 9377}constructor(){this.identifier="persian"}}const $c=78,Mv=80;class xA extends Ya{fromJulianDay(t){let a=super.fromJulianDay(t),n=a.year-$c,r=t-al(a.era,a.year,1,1),l;r<Mv?(n--,l=hr(a.year-1)?31:30,r+=l+155+90+10):(l=hr(a.year)?31:30,r-=Mv);let o,i;if(r<l)o=1,i=r+1;else{let u=r-l;u<155?(o=Math.floor(u/31)+2,i=u%31+1):(u-=155,o=Math.floor(u/30)+7,i=u%30+1)}return new kt(this,n,o,i)}toJulianDay(t){let a=t.year+$c,[n,r]=Tu(a),l,o;return hr(r)?(l=31,o=al(n,r,3,21)):(l=30,o=al(n,r,3,22)),t.month===1?o+t.day-1:(o+=l+Math.min(t.month-2,5)*31,t.month>=8&&(o+=(t.month-7)*30),o+=t.day-1,o)}getDaysInMonth(t){return t.month===1&&hr(t.year+$c)||t.month>=2&&t.month<=6?31:30}getYearsInEra(){return 9919}getEras(){return["saka"]}balanceDate(){}constructor(...t){super(...t),this.identifier="indian"}}const Wi=1948440,Pv=1948439,Da=1300,Sl=1600,kA=460322;function Gi(e,t,a,n){return n+Math.ceil(29.5*(a-1))+(t-1)*354+Math.floor((3+11*t)/30)+e-1}function a1(e,t,a){let n=Math.floor((30*(a-t)+10646)/10631),r=Math.min(12,Math.ceil((a-(29+Gi(t,n,1,1)))/29.5)+1),l=a-Gi(t,n,r,1)+1;return new kt(e,n,r,l)}function Rv(e){return(14+11*e)%30<11}class Uf{fromJulianDay(t){return a1(this,Wi,t)}toJulianDay(t){return Gi(Wi,t.year,t.month,t.day)}getDaysInMonth(t){let a=29+t.month%2;return t.month===12&&Rv(t.year)&&a++,a}getMonthsInYear(){return 12}getDaysInYear(t){return Rv(t.year)?355:354}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9665}getEras(){return["AH"]}constructor(){this.identifier="islamic-civil"}}class wA extends Uf{fromJulianDay(t){return a1(this,Pv,t)}toJulianDay(t){return Gi(Pv,t.year,t.month,t.day)}constructor(...t){super(...t),this.identifier="islamic-tbla"}}const $A="qgpUDckO1AbqBmwDrQpVBakGkgepC9QF2gpcBS0NlQZKB1QLagutBa4ETwoXBYsGpQbVCtYCWwmdBE0KJg2VDawFtgm6AlsKKwWVCsoG6Qr0AnYJtgJWCcoKpAvSC9kF3AJtCU0FpQpSC6ULtAW2CVcFlwJLBaMGUgdlC2oFqworBZUMSg2lDcoF1gpXCasESwmlClILagt1BXYCtwhbBFUFqQW0BdoJ3QRuAjYJqgpUDbIN1QXaAlsJqwRVCkkLZAtxC7QFtQpVCiUNkg7JDtQG6QprCasEkwpJDaQNsg25CroEWworBZUKKgtVC1wFvQQ9Ah0JlQpKC1oLbQW2AjsJmwRVBqkGVAdqC2wFrQpVBSkLkgupC9QF2gpaBasKlQVJB2QHqgu1BbYCVgpNDiULUgtqC60FrgIvCZcESwalBqwG1gpdBZ0ETQoWDZUNqgW1BdoCWwmtBJUFygbkBuoK9QS2AlYJqgpUC9IL2QXqAm0JrQSVCkoLpQuyBbUJ1gSXCkcFkwZJB1ULagVrCisFiwpGDaMNygXWCtsEawJLCaUKUgtpC3UFdgG3CFsCKwVlBbQF2gntBG0BtgimClINqQ3UBdoKWwmrBFMGKQdiB6kLsgW1ClUFJQuSDckO0gbpCmsFqwRVCikNVA2qDbUJugQ7CpsETQqqCtUK2gJdCV4ELgqaDFUNsga5BroEXQotBZUKUguoC7QLuQXaAloJSgukDdEO6AZqC20FNQWVBkoNqA3UDdoGWwWdAisGFQtKC5ULqgWuCi4JjwwnBZUGqgbWCl0FnQI=";let Md,Gl;function bi(e){return kA+Gl[e-Da]}function Fo(e,t){let a=e-Da,n=1<<11-(t-1);return(Md[a]&n)===0?29:30}function Iv(e,t){let a=bi(e);for(let n=1;n<t;n++)a+=Fo(e,n);return a}function qv(e){return Gl[e+1-Da]-Gl[e-Da]}class SA extends Uf{constructor(){if(super(),this.identifier="islamic-umalqura",Md||(Md=new Uint16Array(Uint8Array.from(atob($A),t=>t.charCodeAt(0)).buffer)),!Gl){Gl=new Uint32Array(Sl-Da+1);let t=0;for(let a=Da;a<=Sl;a++){Gl[a-Da]=t;for(let n=1;n<=12;n++)t+=Fo(a,n)}}}fromJulianDay(t){let a=t-Wi,n=bi(Da),r=bi(Sl);if(a<n||a>r)return super.fromJulianDay(t);{let l=Da-1,o=1,i=1;for(;i>0;){l++,i=a-bi(l)+1;let u=qv(l);if(i===u){o=12;break}else if(i<u){let d=Fo(l,o);for(o=1;i>d;)i-=d,o++,d=Fo(l,o);break}}return new kt(this,l,o,a-Iv(l,o)+1)}}toJulianDay(t){return t.year<Da||t.year>Sl?super.toJulianDay(t):Wi+Iv(t.year,t.month)+(t.day-1)}getDaysInMonth(t){return t.year<Da||t.year>Sl?super.getDaysInMonth(t):Fo(t.year,t.month)}getDaysInYear(t){return t.year<Da||t.year>Sl?super.getDaysInYear(t):qv(t.year)}}const Lv=347997,n1=1080,r1=24*n1,CA=29,EA=12*n1+793,AA=CA*r1+EA;function tl(e){return Hl(e*7+1,19)<7}function _i(e){let t=Math.floor((235*e-234)/19),a=12084+13753*t,n=t*29+Math.floor(a/25920);return Hl(3*(n+1),7)<3&&(n+=1),n}function TA(e){let t=_i(e-1),a=_i(e);return _i(e+1)-a===356?2:a-t===382?1:0}function Qo(e){return _i(e)+TA(e)}function l1(e){return Qo(e+1)-Qo(e)}function OA(e){let t=l1(e);switch(t>380&&(t-=30),t){case 353:return 0;case 354:return 1;case 355:return 2}}function Ys(e,t){if(t>=6&&!tl(e)&&t++,t===4||t===7||t===9||t===11||t===13)return 29;let a=OA(e);return t===2?a===2?30:29:t===3?a===0?29:30:t===6?tl(e)?30:0:30}class DA{fromJulianDay(t){let a=t-Lv,n=a*r1/AA,r=Math.floor((19*n+234)/235)+1,l=Qo(r),o=Math.floor(a-l);for(;o<1;)r--,l=Qo(r),o=Math.floor(a-l);let i=1,u=0;for(;u<o;)u+=Ys(r,i),i++;i--,u-=Ys(r,i);let d=o-u;return new kt(this,r,i,d)}toJulianDay(t){let a=Qo(t.year);for(let n=1;n<t.month;n++)a+=Ys(t.year,n);return a+t.day+Lv}getDaysInMonth(t){return Ys(t.year,t.month)}getMonthsInYear(t){return tl(t.year)?13:12}getDaysInYear(t){return l1(t.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(){return 9999}getEras(){return["AM"]}balanceYearMonth(t,a){a.year!==t.year&&(tl(a.year)&&!tl(t.year)&&a.month>6?t.month--:!tl(a.year)&&tl(t.year)&&a.month>6&&t.month++)}constructor(){this.identifier="hebrew"}}const Pd=1723856,Nv=1824665,Rd=5500;function es(e,t,a,n){return e+365*t+Math.floor(t/4)+30*(a-1)+n-1}function Hf(e,t){let a=Math.floor(4*(t-e)/1461);t>=es(e,a+1,1,1)&&a++;let n=1+Math.floor((t-es(e,a,1,1))/30),r=t+1-es(e,a,n,1);return[a,n,r]}function o1(e){return Math.floor(e%4/3)}function s1(e,t){return t%13!==0?30:o1(e)+5}class Kf{fromJulianDay(t){let[a,n,r]=Hf(Pd,t),l="AM";return a<=0&&(l="AA",a+=Rd),new kt(this,l,a,n,r)}toJulianDay(t){let a=t.year;return t.era==="AA"&&(a-=Rd),es(Pd,a,t.month,t.day)}getDaysInMonth(t){return s1(t.year,t.month)}getMonthsInYear(){return 13}getDaysInYear(t){return 365+o1(t.year)}getMaximumMonthsInYear(){return 13}getMaximumDaysInMonth(){return 30}getYearsInEra(t){return t.era==="AA"?9999:9991}getEras(){return["AA","AM"]}constructor(){this.identifier="ethiopic"}}class MA extends Kf{fromJulianDay(t){let[a,n,r]=Hf(Pd,t);return a+=Rd,new kt(this,"AA",a,n,r)}getEras(){return["AA"]}getYearsInEra(){return 9999}constructor(...t){super(...t),this.identifier="ethioaa"}}class PA extends Kf{fromJulianDay(t){let[a,n,r]=Hf(Nv,t),l="CE";return a<=0&&(l="BCE",a=1-a),new kt(this,l,a,n,r)}toJulianDay(t){let a=t.year;return t.era==="BCE"&&(a=1-a),es(Nv,a,t.month,t.day)}getDaysInMonth(t){let a=t.year;return t.era==="BCE"&&(a=1-a),s1(a,t.month)}isInverseEra(t){return t.era==="BCE"}balanceDate(t){t.year<=0&&(t.era=t.era==="BCE"?"CE":"BCE",t.year=1-t.year)}getEras(){return["BCE","CE"]}getYearsInEra(t){return t.era==="BCE"?9999:9715}constructor(...t){super(...t),this.identifier="coptic"}}function RA(e){switch(e){case"buddhist":return new gA;case"ethiopic":return new Kf;case"ethioaa":return new MA;case"coptic":return new PA;case"hebrew":return new DA;case"indian":return new xA;case"islamic-civil":return new Uf;case"islamic-tbla":return new wA;case"islamic-umalqura":return new SA;case"japanese":return new yA;case"persian":return new _A;case"roc":return new bA;default:return new Ya}}let Sc=new Map;class Va{constructor(t,a={}){this.formatter=i1(t,a),this.options=a}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,a){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,a);if(a<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(a)}`}formatRangeToParts(t,a){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,a);if(a<t)throw new RangeError("End date must be >= start date");let n=this.formatter.formatToParts(t),r=this.formatter.formatToParts(a);return[...n.map(l=>({...l,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(l=>({...l,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return LA()&&(this.resolvedHourCycle||(this.resolvedHourCycle=NA(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const IA={true:{ja:"h11"},false:{}};function i1(e,t={}){if(typeof t.hour12=="boolean"&&qA()){t={...t};let r=IA[String(t.hour12)][e.split("-")[0]],l=t.hour12?"h12":"h23";t.hourCycle=r??l,delete t.hour12}let a=e+(t?Object.entries(t).sort((r,l)=>r[0]<l[0]?-1:1).join():"");if(Sc.has(a))return Sc.get(a);let n=new Intl.DateTimeFormat(e,t);return Sc.set(a,n),n}let Cc=null;function qA(){return Cc==null&&(Cc=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),Cc}let Ec=null;function LA(){return Ec==null&&(Ec=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),Ec}function NA(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let a=i1(e,{...t,timeZone:void 0}),n=parseInt(a.formatToParts(new Date(2020,2,3,0)).find(l=>l.type==="hour").value,10),r=parseInt(a.formatToParts(new Date(2020,2,3,23)).find(l=>l.type==="hour").value,10);if(n===0&&r===23)return"h23";if(n===24&&r===23)return"h24";if(n===0&&r===11)return"h11";if(n===12&&r===11)return"h12";throw new Error("Unexpected hour cycle result")}function Ma(e,t=Ja()){return ms(e)?e.toDate():e.toDate(t)}function BA(e){return e instanceof Sr}function ms(e){return e instanceof jn}function Id(e){return BA(e)||ms(e)}function _r(e){if(e instanceof Date){const t=e.getFullYear(),a=e.getMonth()+1;return new Date(t,a,0).getDate()}else return e.set({day:100}).day}function yr(e,t){return e.compare(t)<0}function Ac(e,t){return e.compare(t)>0}function FA(e,t,a){const n=Ou(e,a,"sun");return t>n?e.subtract({days:n+7-t}):t===n?e:e.subtract({days:n-t})}function VA(e,t,a){const n=Ou(e,a,"sun"),r=t===0?6:t-1;return n===r?e:n>r?e.add({days:7-n+r}):e.add({days:r-n})}function Wf(e){const{defaultValue:t,defaultPlaceholder:a,granularity:n="day",locale:r="en"}=e;if(Array.isArray(t)&&t.length)return t.at(-1).copy();if(t&&!Array.isArray(t))return t.copy();if(a)return a.copy();const l=new Date,o=l.getFullYear(),i=l.getMonth()+1,u=l.getDate(),d=["hour","minute","second"],c=new Va(r),f=RA(c.resolvedOptions().calendar);return d.includes(n??"day")?pa(new Sr(o,i,u,0,0,0),f):pa(new kt(o,i,u),f)}function zA(e){const{defaultValue:t,defaultPlaceholder:a}=e;return t?t.copy():a?a.copy():new un(0,0,0)}function jA(e,t){const a=[];for(let n=0;n<e.length;n+=t)a.push(e.slice(n,n+t));return a}function UA(e,t,a=!1){const n={year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:"short",hourCycle:vs(t),hour12:HA(t)};return a&&(delete n.year,delete n.month,delete n.day),e==="day"&&(delete n.second,delete n.hour,delete n.minute,delete n.timeZoneName),e==="hour"&&(delete n.minute,delete n.second),e==="minute"&&delete n.second,n}function u1(e){return Rb(e?.step,{year:1,month:1,day:1,hour:1,minute:1,second:1,millisecond:1})}function c1(e){const t=e.querySelector("[data-selected]");if(t)return t.focus();const a=e.querySelector("[data-today]");if(a)return a.focus();const n=e.querySelector("[data-reka-calendar-day]");if(n)return n.focus()}function vs(e){if(e===24)return"h23";if(e===12)return"h11"}function HA(e){if(e===24)return!1;if(e===12)return!0}function d1(e){return e==="day"?"date":"datetime-local"}function Tc(e,t){if(!e)return"";const a=d1(t),n=String(e.year).padStart(4,"0"),r=String(e.month).padStart(2,"0"),l=String(e.day).padStart(2,"0");if(a==="date")return`${n}-${r}-${l}`;const o=String("hour"in e?e.hour:0).padStart(2,"0"),i=String("minute"in e?e.minute:0).padStart(2,"0");if(t==="second"){const u=String("second"in e?e.second:0).padStart(2,"0");return`${n}-${r}-${l}T${o}:${i}:${u}`}return`${n}-${r}-${l}T${o}:${i}`}function Bv(e,t){const a=[];let n=e.add({days:1});const r=t;for(;n.compare(r)<0;)a.push(n),n=n.add({days:1});return a}function Oc(e){const{dateObj:t,weekStartsOn:a,fixedWeeks:n,locale:r}=e,l=_r(t),o=Array.from({length:l},(S,k)=>t.set({day:k+1})),i=Ad(t),u=_v(t),d=FA(i,a,r),c=VA(u,a,r),f=Bv(d.subtract({days:1}),i),v=Bv(u,c.add({days:1})),m=f.length+o.length+v.length;if(n&&m<42){const S=42-m;let k=v.at(-1);k||(k=_v(t));const C=Array.from({length:S},(L,D)=>{const T=D+1;return k.add({days:T})});v.push(...C)}const y=f.concat(o,v),x=jA(y,7);return{value:t,cells:y,rows:x}}function Wr(e){const{numberOfMonths:t,dateObj:a,...n}=e,r=[];if(!t||t===1)return r.push(Oc({...n,dateObj:a})),r;r.push(Oc({...n,dateObj:a}));for(let l=1;l<t;l++){const o=a.add({months:l});r.push(Oc({...n,dateObj:o}))}return r}function f1(e){const t=new kt(2025,1,6);return(1-Ou(t,e)+7)%7}function Gf(e,t={}){const a=A(e);function n(){return a.value}function r(S){a.value=S}function l(S,k){return new Va(a.value,{...t,...k}).format(S)}function o(S,k=!0){return Id(S)&&k?l(Ma(S),{dateStyle:"long",timeStyle:"long"}):l(Ma(S),{dateStyle:"long"})}function i(S,k={}){return new Va(a.value,{...t,month:"long",year:"numeric",...k}).format(S)}function u(S,k={}){return new Va(a.value,{...t,month:"long",...k}).format(S)}function d(){const S=Ms(Ja());return[1,2,3,4,5,6,7,8,9,10,11,12].map(C=>({label:u(Ma(S.set({month:C}))),value:C}))}function c(S,k={}){return new Va(a.value,{...t,year:"numeric",...k}).format(S)}function f(S,k){return ms(S)?new Va(a.value,{...t,...k,timeZone:S.timeZone}).formatToParts(Ma(S)):new Va(a.value,{...t,...k}).formatToParts(Ma(S))}function v(S,k="narrow"){return new Va(a.value,{...t,weekday:k}).format(S)}function m(S){const C=new Va(a.value,{...t,hour:"numeric",minute:"numeric"}).formatToParts(S).find(L=>L.type==="dayPeriod")?.value;return C==="PM"||C==="pm"||C==="p.m."?"PM":"AM"}const y={year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"};function x(S,k,C={}){const L={...y,...C},T=f(S,L).find(I=>I.type===k);return T?T.value:""}return{setLocale:r,getLocale:n,fullMonth:u,fullYear:c,fullMonthAndYear:i,toParts:f,custom:l,part:x,dayPeriod:m,selectedDate:o,dayOfWeek:v,getMonths:d}}function xn(e){const t=Au({dir:A("ltr")});return _(()=>e?.value||t.dir?.value||"ltr")}function ml(e){const t=bn(),a=t?.type.emits,n={};return a?.length||console.warn(`No emitted event found. Please check component: ${t?.type.__name}`),a?.forEach(r=>{n[jo(Xt(r))]=(...l)=>e(r,...l)}),n}let Dc=0;function p1(){Ea(e=>{if(!Gn)return;const t=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",t[0]??Fv()),document.body.insertAdjacentElement("beforeend",t[1]??Fv()),Dc++,e(()=>{Dc===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(a=>a.remove()),Dc--})})}function Fv(){const e=document.createElement("span");return e.setAttribute("data-reka-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function Yf(e){return _(()=>ca(e)?!!pl(e)?.closest("form"):!0)}function et(){const e=bn(),t=A(),a=_(()=>n());df(()=>{a.value!==n()&&px(t)});function n(){return t.value&&"$el"in t.value&&["#text","#comment"].includes(t.value.$el.nodeName)?t.value.$el.nextElementSibling:pl(t)}const r=Object.assign({},e.exposed),l={};for(const i in e.props)Object.defineProperty(l,i,{enumerable:!0,configurable:!0,get:()=>e.props[i]});if(Object.keys(r).length>0)for(const i in r)Object.defineProperty(l,i,{enumerable:!0,configurable:!0,get:()=>r[i]});Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>e.vnode.el}),e.exposed=l;function o(i){if(t.value=i,!!i&&(Object.defineProperty(l,"$el",{enumerable:!0,configurable:!0,get:()=>i instanceof Element?i:i.$el}),!(i instanceof Element)&&!Object.hasOwn(i,"$el"))){const u=i.$.exposed,d=Object.assign({},l);for(const c in u)Object.defineProperty(d,c,{enumerable:!0,configurable:!0,get:()=>u[c]});e.exposed=d}}return{forwardRef:o,currentRef:t,currentElement:a}}function Pu(e){const t=bn(),a=Object.keys(t?.type.props??{}).reduce((r,l)=>{const o=(t?.type.props[l]).default;return o!==void 0&&(r[l]=o),r},{}),n=bx(e);return _(()=>{const r={},l=t?.vnode.props??{};return Object.keys(l).forEach(o=>{r[Xt(o)]=l[o]}),Object.keys({...a,...r}).reduce((o,i)=>(n.value[i]!==void 0&&(o[i]=n.value[i]),o),{})})}function kn(e,t){const a=Pu(e),n=t?ml(t):{};return _(()=>({...a.value,...n}))}var KA=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Cl=new WeakMap,Js=new WeakMap,Zs={},Mc=0,m1=function(e){return e&&(e.host||m1(e.parentNode))},WA=function(e,t){return t.map(function(a){if(e.contains(a))return a;var n=m1(a);return n&&e.contains(n)?n:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},GA=function(e,t,a,n){var r=WA(t,Array.isArray(e)?e:[e]);Zs[a]||(Zs[a]=new WeakMap);var l=Zs[a],o=[],i=new Set,u=new Set(r),d=function(f){!f||i.has(f)||(i.add(f),d(f.parentNode))};r.forEach(d);var c=function(f){!f||u.has(f)||Array.prototype.forEach.call(f.children,function(v){if(i.has(v))c(v);else try{var m=v.getAttribute(n),y=m!==null&&m!=="false",x=(Cl.get(v)||0)+1,S=(l.get(v)||0)+1;Cl.set(v,x),l.set(v,S),o.push(v),x===1&&y&&Js.set(v,!0),S===1&&v.setAttribute(a,"true"),y||v.setAttribute(n,"true")}catch(k){console.error("aria-hidden: cannot operate on ",v,k)}})};return c(t),i.clear(),Mc++,function(){o.forEach(function(f){var v=Cl.get(f)-1,m=l.get(f)-1;Cl.set(f,v),l.set(f,m),v||(Js.has(f)||f.removeAttribute(n),Js.delete(f)),m||f.removeAttribute(a)}),Mc--,Mc||(Cl=new WeakMap,Cl=new WeakMap,Js=new WeakMap,Zs={})}},YA=function(e,t,a){a===void 0&&(a="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),r=KA(e);return r?(n.push.apply(n,Array.from(r.querySelectorAll("[aria-live], script"))),GA(n,r,a,"aria-hidden")):function(){return null}};function Jf(e){let t;Be(()=>pl(e),a=>{let n=!1;try{n=!!a?.closest("[popover]:not(:popover-open)")}catch{}a&&!n?t=YA(a):t&&t()}),Wn(()=>{t&&t()})}function Un(e,t="reka"){let a;const n=Au({useId:void 0});return n.useId?a=n.useId():a=cf?.(),t?`${t}-${a}`:a}function io(){return{ALT:"Alt",ARROW_DOWN:"ArrowDown",ARROW_LEFT:"ArrowLeft",ARROW_RIGHT:"ArrowRight",ARROW_UP:"ArrowUp",BACKSPACE:"Backspace",CAPS_LOCK:"CapsLock",CONTROL:"Control",DELETE:"Delete",END:"End",ENTER:"Enter",ESCAPE:"Escape",F1:"F1",F10:"F10",F11:"F11",F12:"F12",F2:"F2",F3:"F3",F4:"F4",F5:"F5",F6:"F6",F7:"F7",F8:"F8",F9:"F9",HOME:"Home",META:"Meta",PAGE_DOWN:"PageDown",PAGE_UP:"PageUp",SHIFT:"Shift",SPACE:" ",TAB:"Tab",CTRL:"Control",ASTERISK:"*",SPACE_CODE:"Space"}}function Ru(e){const t=Au({locale:A("en")});return _(()=>e?.value||t.locale?.value||"en")}function JA(e){const t=A(),a=_(()=>t.value?.width??0),n=_(()=>t.value?.height??0);return $t(()=>{const r=pl(e);if(r){t.value={width:r.offsetWidth,height:r.offsetHeight};const l=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let u,d;if("borderBoxSize"in i){const c=i.borderBoxSize,f=Array.isArray(c)?c[0]:c;u=f.inlineSize,d=f.blockSize}else u=r.offsetWidth,d=r.offsetHeight;t.value={width:u,height:d}});return l.observe(r,{box:"border-box"}),()=>l.unobserve(r)}else t.value=void 0}),{width:a,height:n}}function ZA(e,t){const a=A(e);function n(l){return t[a.value][l]??a.value}return{state:a,dispatch:l=>{a.value=n(l)}}}function XA(e){const t=qE("",1e3);return{search:t,handleTypeaheadSearch:(r,l)=>{t.value=t.value+r;{const o=Yt(),i=l.map(v=>({...v,textValue:v.value?.textValue??v.ref.textContent?.trim()??""})),u=i.find(v=>v.ref===o),d=i.map(v=>v.textValue),c=e4(d,t.value,u?.textValue),f=i.find(v=>v.textValue===c);return f&&f.ref.focus(),f?.ref}},resetTypeahead:()=>{t.value=""}}}function QA(e,t){return e.map((a,n)=>e[(t+n)%e.length])}function e4(e,t,a){const r=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,l=a?e.indexOf(a):-1;let o=QA(e,Math.max(l,0));r.length===1&&(o=o.filter(d=>d!==a));const u=o.find(d=>d.toLowerCase().startsWith(r.toLowerCase()));return u!==a?u:void 0}function t4(e,t){const a=A({}),n=A("none"),r=A(e),l=e.value?"mounted":"unmounted";let o;const i=t.value?.ownerDocument.defaultView??Pf,{state:u,dispatch:d}=ZA(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}}),c=S=>{if(Gn){const k=new CustomEvent(S,{bubbles:!1,cancelable:!1});t.value?.dispatchEvent(k)}};Be(e,async(S,k)=>{const C=k!==S;if(await Ue(),C){const L=n.value,D=Xs(t.value);S?(d("MOUNT"),c("enter"),D==="none"&&c("after-enter")):D==="none"||D==="undefined"||a.value?.display==="none"?(d("UNMOUNT"),c("leave"),c("after-leave")):k&&L!==D?(d("ANIMATION_OUT"),c("leave")):(d("UNMOUNT"),c("after-leave"))}},{immediate:!0});const f=S=>{const k=Xs(t.value),C=k.includes(CSS.escape(S.animationName)),L=u.value==="mounted"?"enter":"leave";if(S.target===t.value&&C&&(c(`after-${L}`),d("ANIMATION_END"),!r.value)){const D=t.value.style.animationFillMode;t.value.style.animationFillMode="forwards",o=i?.setTimeout(()=>{t.value?.style.animationFillMode==="forwards"&&(t.value.style.animationFillMode=D)})}S.target===t.value&&k==="none"&&d("ANIMATION_END")},v=S=>{S.target===t.value&&(n.value=Xs(t.value))},m=Be(t,(S,k)=>{S?(a.value=getComputedStyle(S),S.addEventListener("animationstart",v),S.addEventListener("animationcancel",f),S.addEventListener("animationend",f)):(d("ANIMATION_END"),o!==void 0&&i?.clearTimeout(o),k?.removeEventListener("animationstart",v),k?.removeEventListener("animationcancel",f),k?.removeEventListener("animationend",f))},{immediate:!0}),y=Be(u,()=>{const S=Xs(t.value);n.value=u.value==="mounted"?S:"none"});return Wn(()=>{m(),y()}),{isPresent:_(()=>["mounted","unmountSuspended"].includes(u.value))}}function Xs(e){return e&&getComputedStyle(e).animationName||"none"}var vl=ne({name:"Presence",props:{present:{type:Boolean,required:!0},forceMount:{type:Boolean}},slots:{},setup(e,{slots:t,expose:a}){const{present:n,forceMount:r}=Kt(e),l=A(),{isPresent:o}=t4(n,l);a({present:o});let i=t.default({present:o.value});i=Rf(i||[]);const u=bn();if(i&&i?.length>1){const d=u?.parent?.type.name?`<${u.parent.type.name} />`:"component";throw new Error([`Detected an invalid children for \`${d}\` for \`Presence\` component.`,"","Note: Presence works similarly to `v-if` directly, but it waits for animation/transition to finished before unmounting. So it expect only one direct child of valid VNode type.","You can apply a few solutions:",["Provide a single child element so that `presence` directive attach correctly.","Ensure the first child is an actual element instead of a raw text node or comment node."].map(c=>` - ${c}`).join(`
|
||
`)].join(`
|
||
`))}return()=>r.value||n.value||o.value?Ra(t.default({present:o.value})[0],{ref:d=>{const c=pl(d);return typeof c?.hasAttribute>"u"||(c?.hasAttribute("data-reka-popper-content-wrapper")?l.value=c.firstElementChild:l.value=c),c}}):null}});const qd=ne({name:"PrimitiveSlot",inheritAttrs:!1,setup(e,{attrs:t,slots:a}){return()=>{if(!a.default)return null;const n=Rf(a.default()),r=n.findIndex(u=>u.type!==Ka);if(r===-1)return n;const l=n[r];delete l.props?.ref;const o=l.props?He(t,l.props):t,i=xr({...l,props:{}},o);return n.length===1?i:(n[r]=i,n)}}}),a4=["area","img","input"],nt=ne({name:"Primitive",inheritAttrs:!1,props:{asChild:{type:Boolean,default:!1},as:{type:[String,Object],default:"div"}},setup(e,{attrs:t,slots:a}){const n=e.asChild?"template":e.as;return typeof n=="string"&&a4.includes(n)?()=>Ra(n,t):n!=="template"?()=>Ra(e.as,t,{default:a.default}):()=>Ra(qd,t,{default:a.default})}});function sl(){const e=A(),t=_(()=>["#text","#comment"].includes(e.value?.$el.nodeName)?e.value?.$el.nextElementSibling:pl(e));return{primitiveElement:e,currentElement:t}}const[Yn,n4]=Dt("DialogRoot");var r4=ne({inheritAttrs:!1,__name:"DialogRoot",props:{open:{type:Boolean,required:!1,default:void 0},defaultOpen:{type:Boolean,required:!1,default:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const a=e,r=Nt(a,"open",t,{defaultValue:a.defaultOpen,passive:a.open===void 0}),l=A(),o=A(),{modal:i}=Kt(a);return n4({open:r,modal:i,openModal:()=>{r.value=!0},onOpenChange:u=>{r.value=u},onOpenToggle:()=>{r.value=!r.value},contentId:"",titleId:"",descriptionId:"",triggerElement:l,contentElement:o}),(u,d)=>Se(u.$slots,"default",{open:s(r),close:()=>r.value=!1})}}),Jn=r4,l4=ne({__name:"DialogClose",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e;et();const a=Yn();return(n,r)=>(p(),U(s(nt),He(t,{type:n.as==="button"?"button":void 0,onClick:r[0]||(r[0]=l=>s(a).onOpenChange(!1))}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["type"]))}}),Cr=l4;const o4="dismissableLayer.pointerDownOutside",s4="dismissableLayer.focusOutside";function v1(e,t){if(!(t instanceof Element))return!1;const a=t.closest("[data-dismissable-layer]"),n=e.dataset.dismissableLayer===""?e:e.querySelector("[data-dismissable-layer]"),r=Array.from(e.ownerDocument.querySelectorAll("[data-dismissable-layer]"));return!!(a&&(n===a||r.indexOf(n)<r.indexOf(a)))}function i4(e,t,a=!0){const n=t?.value?.ownerDocument??globalThis?.document,r=A(!1),l=A(()=>{});return Ea(o=>{if(!Gn||!ca(a))return;const i=async d=>{const c=d.target;if(!(!t?.value||!c)){if(v1(t.value,c)){r.value=!1;return}if(d.target&&!r.value){let v=function(){Df(o4,e,f)};const f={originalEvent:d};d.pointerType==="touch"?(n.removeEventListener("click",l.value),l.value=v,n.addEventListener("click",l.value,{once:!0})):v()}else n.removeEventListener("click",l.value);r.value=!1}},u=window.setTimeout(()=>{n.addEventListener("pointerdown",i)},0);o(()=>{window.clearTimeout(u),n.removeEventListener("pointerdown",i),n.removeEventListener("click",l.value)})}),{onPointerDownCapture:()=>{ca(a)&&(r.value=!0)}}}function u4(e,t,a=!0){const n=t?.value?.ownerDocument??globalThis?.document,r=A(!1);return Ea(l=>{if(!Gn||!ca(a))return;const o=async i=>{if(!t?.value)return;await Ue(),await Ue();const u=i.target;!t.value||!u||v1(t.value,u)||i.target&&!r.value&&Df(s4,e,{originalEvent:i})};n.addEventListener("focusin",o),l(()=>n.removeEventListener("focusin",o))}),{onFocusCapture:()=>{ca(a)&&(r.value=!0)},onBlurCapture:()=>{ca(a)&&(r.value=!1)}}}const ba=Ua({layersRoot:new Set,layersWithOutsidePointerEventsDisabled:new Set,originalBodyPointerEvents:void 0,branches:new Set});var c4=ne({__name:"DismissableLayer",props:{disableOutsidePointerEvents:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","dismiss"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:r,currentElement:l}=et(),o=_(()=>l.value?.ownerDocument??globalThis.document),i=_(()=>ba.layersRoot),u=_(()=>l.value?Array.from(i.value).indexOf(l.value):-1),d=_(()=>ba.layersWithOutsidePointerEventsDisabled.size>0),c=_(()=>{const m=Array.from(i.value),[y]=[...ba.layersWithOutsidePointerEventsDisabled].slice(-1),x=m.indexOf(y);return u.value>=x}),f=i4(async m=>{const y=[...ba.branches].some(x=>x?.contains(m.target));!c.value||y||(n("pointerDownOutside",m),n("interactOutside",m),await Ue(),m.defaultPrevented||n("dismiss"))},l),v=u4(m=>{[...ba.branches].some(x=>x?.contains(m.target))||(n("focusOutside",m),n("interactOutside",m),m.defaultPrevented||n("dismiss"))},l);return VE("Escape",m=>{u.value===i.value.size-1&&(n("escapeKeyDown",m),m.defaultPrevented||n("dismiss"))}),Be([l,()=>a.disableOutsidePointerEvents],([m,y],x,S)=>{m&&(y&&(ba.layersWithOutsidePointerEventsDisabled.size===0&&(ba.originalBodyPointerEvents=o.value.body.style.pointerEvents,o.value.body.style.pointerEvents="none"),ba.layersWithOutsidePointerEventsDisabled.add(m),S(()=>{ba.layersWithOutsidePointerEventsDisabled.delete(m),ba.layersWithOutsidePointerEventsDisabled.size===0&&!$a(ba.originalBodyPointerEvents)&&(o.value.body.style.pointerEvents=ba.originalBodyPointerEvents)})),i.value.add(m))},{immediate:!0}),Ea(m=>{m(()=>{l.value&&(i.value.delete(l.value),ba.layersWithOutsidePointerEventsDisabled.delete(l.value))})}),(m,y)=>(p(),U(s(nt),{ref:s(r),"as-child":m.asChild,as:m.as,"data-dismissable-layer":"",style:ua({pointerEvents:d.value?c.value?"auto":"none":void 0}),onFocusCapture:s(v).onFocusCapture,onBlurCapture:s(v).onBlurCapture,onPointerdownCapture:s(f).onPointerDownCapture},{default:B(()=>[Se(m.$slots,"default")]),_:3},8,["as-child","as","style","onFocusCapture","onBlurCapture","onPointerdownCapture"]))}}),Zf=c4;const d4=AE(()=>A([]));function f4(){const e=d4();return{add(t){const a=e.value[0];t!==a&&a?.pause(),e.value=Vv(e.value,t),e.value.unshift(t)},remove(t){e.value=Vv(e.value,t),e.value[0]?.resume()}}}function Vv(e,t){const a=[...e],n=a.indexOf(t);return n!==-1&&a.splice(n,1),a}const Pc="focusScope.autoFocusOnMount",Rc="focusScope.autoFocusOnUnmount",zv={bubbles:!1,cancelable:!0};function p4(e,{select:t=!1}={}){const a=Yt();for(const n of e)if(fr(n,{select:t}),Yt()!==a)return!0}function m4(e){const t=h1(e),a=jv(t,e),n=jv(t.reverse(),e);return[a,n]}function h1(e){const t=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const r=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||r?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)t.push(a.currentNode);return t}function jv(e,t){for(const a of e)if(!v4(a,{upTo:t}))return a}function v4(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function h4(e){return e instanceof HTMLInputElement&&"select"in e}function fr(e,{select:t=!1}={}){if(e&&e.focus){const a=Yt();e.focus({preventScroll:!0}),e!==a&&h4(e)&&t&&e.select()}}var y4=ne({__name:"FocusScope",props:{loop:{type:Boolean,required:!1,default:!1},trapped:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["mountAutoFocus","unmountAutoFocus"],setup(e,{emit:t}){const a=e,n=t,{currentRef:r,currentElement:l}=et(),o=A(null),i=f4(),u=Ua({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}});Ea(c=>{if(!Gn)return;const f=l.value;if(!a.trapped)return;function v(S){if(u.paused||!f)return;const k=S.target;f.contains(k)?o.value=k:fr(o.value,{select:!0})}function m(S){if(u.paused||!f)return;const k=S.relatedTarget;k!==null&&(f.contains(k)||fr(o.value,{select:!0}))}function y(S){const k=o.value;if(k===null||!S.some(D=>D.removedNodes.length>0))return;f.contains(k)||fr(f)}document.addEventListener("focusin",v),document.addEventListener("focusout",m);const x=new MutationObserver(y);f&&x.observe(f,{childList:!0,subtree:!0}),c(()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",m),x.disconnect()})}),Ea(async c=>{const f=l.value;if(await Ue(),!f)return;i.add(u);const v=Yt();if(!f.contains(v)){const y=new CustomEvent(Pc,zv);f.addEventListener(Pc,x=>n("mountAutoFocus",x)),f.dispatchEvent(y),y.defaultPrevented||(p4(h1(f),{select:!0}),Yt()===v&&fr(f))}c(()=>{f.removeEventListener(Pc,S=>n("mountAutoFocus",S));const y=new CustomEvent(Rc,zv),x=S=>{n("unmountAutoFocus",S)};f.addEventListener(Rc,x),f.dispatchEvent(y),f.setAttribute("data-focus-scope-unmounting",""),setTimeout(()=>{y.defaultPrevented||fr(v??document.body,{select:!0}),f.removeEventListener(Rc,x),i.remove(u),f.removeAttribute("data-focus-scope-unmounting")},0)})});function d(c){if(!a.loop&&!a.trapped||u.paused)return;const f=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,v=Yt();if(f&&v){const m=c.currentTarget,[y,x]=m4(m);y&&x?!c.shiftKey&&v===x?(c.preventDefault(),a.loop&&fr(y,{select:!0})):c.shiftKey&&v===y&&(c.preventDefault(),a.loop&&fr(x,{select:!0})):v===m&&c.preventDefault()}}return(c,f)=>(p(),U(s(nt),{ref_key:"currentRef",ref:r,tabindex:"-1","as-child":c.asChild,as:c.as,onKeydown:d},{default:B(()=>[Se(c.$slots,"default")]),_:3},8,["as-child","as"]))}}),Xf=y4;const g4="menu.itemSelect",Ld=["Enter"," "],b4=["ArrowDown","PageUp","Home"],y1=["ArrowUp","PageDown","End"],_4=[...b4,...y1];[...Ld],[...Ld];function g1(e){return e?"open":"closed"}function b1(e){return e==="indeterminate"}function _1(e){return b1(e)?"indeterminate":e?"checked":"unchecked"}function x4(e){const t=Yt();for(const a of e)if(a===t||(a.focus(),Yt()!==t))return}function k4(e,t){const{x:a,y:n}=e;let r=!1;for(let l=0,o=t.length-1;l<t.length;o=l++){const i=t[l].x,u=t[l].y,d=t[o].x,c=t[o].y;u>n!=c>n&&a<(d-i)*(n-u)/(c-u)+i&&(r=!r)}return r}function w4(e,t){if(!t)return!1;const a={x:e.clientX,y:e.clientY};return k4(a,t)}function Yi(e){return e.pointerType==="mouse"}var $4=ne({__name:"DialogContentImpl",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=Yn(),{forwardRef:l,currentElement:o}=et();return r.titleId||=Un(void 0,"reka-dialog-title"),r.descriptionId||=Un(void 0,"reka-dialog-description"),$t(()=>{r.contentElement=o,Yt()!==document.body&&(r.triggerElement.value=Yt())}),(i,u)=>(p(),U(s(Xf),{"as-child":"",loop:"",trapped:a.trapFocus,onMountAutoFocus:u[5]||(u[5]=d=>n("openAutoFocus",d)),onUnmountAutoFocus:u[6]||(u[6]=d=>n("closeAutoFocus",d))},{default:B(()=>[R(s(Zf),He({id:s(r).contentId,ref:s(l),as:i.as,"as-child":i.asChild,"disable-outside-pointer-events":i.disableOutsidePointerEvents,role:"dialog","aria-describedby":s(r).descriptionId,"aria-labelledby":s(r).titleId,"data-state":s(g1)(s(r).open.value)},i.$attrs,{onDismiss:u[0]||(u[0]=d=>s(r).onOpenChange(!1)),onEscapeKeyDown:u[1]||(u[1]=d=>n("escapeKeyDown",d)),onFocusOutside:u[2]||(u[2]=d=>n("focusOutside",d)),onInteractOutside:u[3]||(u[3]=d=>n("interactOutside",d)),onPointerDownOutside:u[4]||(u[4]=d=>n("pointerDownOutside",d))}),{default:B(()=>[Se(i.$slots,"default")]),_:3},16,["id","as","as-child","disable-outside-pointer-events","aria-describedby","aria-labelledby","data-state"])]),_:3},8,["trapped"]))}}),x1=$4,S4=ne({__name:"DialogContentModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=Yn(),l=ml(n),{forwardRef:o,currentElement:i}=et();return Jf(i),(u,d)=>(p(),U(x1,He({...a,...s(l)},{ref:s(o),"trap-focus":s(r).open.value,"disable-outside-pointer-events":a.disableOutsidePointerEvents,onCloseAutoFocus:d[0]||(d[0]=c=>{c.defaultPrevented||(c.preventDefault(),s(r).triggerElement.value?.focus())}),onPointerDownOutside:d[1]||(d[1]=c=>{const f=c.detail.originalEvent,v=f.button===0&&f.ctrlKey===!0;(f.button===2||v)&&c.preventDefault()}),onFocusOutside:d[2]||(d[2]=c=>{c.preventDefault()})}),{default:B(()=>[Se(u.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),C4=S4,E4=ne({__name:"DialogContentNonModal",props:{forceMount:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,r=ml(t);et();const l=Yn(),o=A(!1),i=A(!1);return(u,d)=>(p(),U(x1,He({...a,...s(r)},{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{c.defaultPrevented||(o.value||s(l).triggerElement.value?.focus(),c.preventDefault()),o.value=!1,i.value=!1}),onInteractOutside:d[1]||(d[1]=c=>{c.defaultPrevented||(o.value=!0,c.detail.originalEvent.type==="pointerdown"&&(i.value=!0));const f=c.target;s(l).triggerElement.value?.contains(f)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&i.value&&c.preventDefault()})}),{default:B(()=>[Se(u.$slots,"default")]),_:3},16))}}),A4=E4,T4=ne({__name:"DialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=Yn(),l=ml(n),{forwardRef:o}=et();return(i,u)=>(p(),U(s(vl),{present:i.forceMount||s(r).open.value},{default:B(()=>[s(r).modal.value?(p(),U(C4,He({key:0,ref:s(o)},{...a,...s(l),...i.$attrs}),{default:B(()=>[Se(i.$slots,"default")]),_:3},16)):(p(),U(A4,He({key:1,ref:s(o)},{...a,...s(l),...i.$attrs}),{default:B(()=>[Se(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),Zn=T4,O4=ne({__name:"DialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(e){const t=e;et();const a=Yn();return(n,r)=>(p(),U(s(nt),He(t,{id:s(a).descriptionId}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["id"]))}}),pn=O4,D4=ne({__name:"DialogOverlayImpl",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=Yn();return If(!0),et(),(a,n)=>(p(),U(s(nt),{as:a.as,"as-child":a.asChild,"data-state":s(t).open.value?"open":"closed",style:{"pointer-events":"auto"},onPointerdown:n[0]||(n[0]=yt(()=>{},["left","self","prevent"]))},{default:B(()=>[Se(a.$slots,"default")]),_:3},8,["as","as-child","data-state"]))}}),M4=D4,P4=ne({__name:"DialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=Yn(),{forwardRef:a}=et();return(n,r)=>s(t)?.modal.value?(p(),U(s(vl),{key:0,present:n.forceMount||s(t).open.value},{default:B(()=>[R(M4,He(n.$attrs,{ref:s(a),as:n.as,"as-child":n.asChild}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["as","as-child"])]),_:3},8,["present"])):Y("v-if",!0)}}),Xn=P4,R4=ne({__name:"Teleport",props:{to:{type:null,required:!1,default:"body"},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=BE();return(a,n)=>s(t)||a.forceMount?(p(),U(Rx,{key:0,to:a.to,disabled:a.disabled,defer:a.defer},[Se(a.$slots,"default")],8,["to","disabled","defer"])):Y("v-if",!0)}}),Iu=R4,I4=ne({__name:"DialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Iu),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),qr=I4,q4=ne({__name:"DialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const t=e,a=Yn();return et(),(n,r)=>(p(),U(s(nt),He(t,{id:s(a).titleId}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["id"]))}}),hn=q4;const[L4,N4]=Dt("AlertDialogContent");var B4=ne({__name:"AlertDialogContent",props:{forceMount:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,r=ml(t);et();const l=A();return N4({onCancelElementChange:o=>{l.value=o}}),(o,i)=>(p(),U(s(Zn),He({...a,...s(r)},{role:"alertdialog",onPointerDownOutside:i[0]||(i[0]=yt(()=>{},["prevent"])),onInteractOutside:i[1]||(i[1]=yt(()=>{},["prevent"])),onOpenAutoFocus:i[2]||(i[2]=()=>{Ue(()=>{l.value?.focus({preventScroll:!0})})})}),{default:B(()=>[Se(o.$slots,"default")]),_:3},16))}}),F4=B4,V4=ne({__name:"AlertDialogCancel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=L4(),{forwardRef:n,currentElement:r}=et();return $t(()=>{a.onCancelElementChange(r.value)}),(l,o)=>(p(),U(s(Cr),He(t,{ref:s(n)}),{default:B(()=>[Se(l.$slots,"default")]),_:3},16))}}),z4=V4,j4=ne({__name:"AlertDialogDescription",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"p"}},setup(e){const t=e;return et(),(a,n)=>(p(),U(s(pn),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),U4=j4,H4=ne({__name:"AlertDialogOverlay",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return et(),(a,n)=>(p(),U(s(Xn),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),K4=H4,W4=ne({__name:"AlertDialogPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Iu),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),G4=W4,Y4=ne({__name:"AlertDialogRoot",props:{open:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1}},emits:["update:open"],setup(e,{emit:t}){const r=kn(e,t);return et(),(l,o)=>(p(),U(s(Jn),He(s(r),{modal:!0}),{default:B(i=>[Se(l.$slots,"default",it(dt(i)))]),_:3},16))}}),J4=Y4,Z4=ne({__name:"AlertDialogTitle",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"h2"}},setup(e){const t=e;return et(),(a,n)=>(p(),U(s(hn),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),X4=Z4;const Uv="data-reka-collection-item";function Qf(e={}){const{key:t="",isProvider:a=!1}=e,n=`${t}CollectionProvider`;let r;a?(r={collectionRef:A(),itemMap:A(new Map)},ht(n,r)):r=ct(n);const l=(c=!1)=>{const f=r.collectionRef.value;if(!f)return[];const v=Array.from(f.querySelectorAll(`[${Uv}]`)),y=Array.from(r.itemMap.value.values()).sort((x,S)=>v.indexOf(x.ref)-v.indexOf(S.ref));return c?y:y.filter(x=>x.ref.dataset.disabled!=="")},o=ne({name:"CollectionSlot",inheritAttrs:!1,setup(c,{slots:f,attrs:v}){const{primitiveElement:m,currentElement:y}=sl();return Be(y,()=>{r.collectionRef.value=y.value}),()=>Ra(qd,{ref:m,...v},f)}}),i=ne({name:"CollectionItem",inheritAttrs:!1,props:{value:{validator:()=>!0}},setup(c,{slots:f,attrs:v}){const{primitiveElement:m,currentElement:y}=sl();return Ea(x=>{if(y.value){const S=wi(y.value);r.itemMap.value.set(S,{ref:y.value,value:c.value}),x(()=>r.itemMap.value.delete(S))}}),()=>Ra(qd,{...v,[Uv]:"",ref:m},f)}}),u=_(()=>Array.from(r.itemMap.value.values())),d=_(()=>r.itemMap.value.size);return{getItems:l,reactiveItems:u,itemMapSize:d,CollectionSlot:o,CollectionItem:i}}var Q4=ne({__name:"VisuallyHidden",props:{feature:{type:String,required:!1,default:"focusable"},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){return(t,a)=>(p(),U(s(nt),{as:t.as,"as-child":t.asChild,"aria-hidden":t.feature==="focusable"?"true":void 0,"data-hidden":t.feature==="fully-hidden"?"":void 0,tabindex:t.feature==="fully-hidden"?"-1":void 0,style:{position:"absolute",border:0,width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",whiteSpace:"nowrap",wordWrap:"normal",top:"-1px",left:"-1px"}},{default:B(()=>[Se(t.$slots,"default")]),_:3},8,["as","as-child","aria-hidden","data-hidden","tabindex"]))}}),ep=Q4,eT=ne({inheritAttrs:!1,__name:"VisuallyHiddenInputBubble",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,{primitiveElement:a,currentElement:n}=sl(),r=_(()=>t.checked??t.value);return Be(r,(l,o)=>{if(!n.value)return;const i=n.value,u=window.HTMLInputElement.prototype,c=Object.getOwnPropertyDescriptor(u,"value").set;if(c&&l!==o){const f=new Event("input",{bubbles:!0}),v=new Event("change",{bubbles:!0});c.call(i,l),i.dispatchEvent(f),i.dispatchEvent(v)}}),(l,o)=>(p(),U(ep,He({ref_key:"primitiveElement",ref:a},{...t,...l.$attrs},{as:"input"}),null,16))}}),Hv=eT,tT=ne({inheritAttrs:!1,__name:"VisuallyHiddenInput",props:{name:{type:String,required:!0},value:{type:null,required:!0},checked:{type:Boolean,required:!1,default:void 0},required:{type:Boolean,required:!1},disabled:{type:Boolean,required:!1},feature:{type:String,required:!1,default:"fully-hidden"}},setup(e){const t=e,a=_(()=>typeof t.value=="object"&&Array.isArray(t.value)&&t.value.length===0&&t.required),n=_(()=>typeof t.value=="string"||typeof t.value=="number"||typeof t.value=="boolean"||t.value===null||t.value===void 0?[{name:t.name,value:t.value}]:typeof t.value=="object"&&Array.isArray(t.value)?t.value.flatMap((r,l)=>typeof r=="object"?Object.entries(r).map(([o,i])=>({name:`${t.name}[${l}][${o}]`,value:i})):{name:`${t.name}[${l}]`,value:r}):t.value!==null&&typeof t.value=="object"&&!Array.isArray(t.value)?Object.entries(t.value).map(([r,l])=>({name:`${t.name}[${r}]`,value:l})):[]);return(r,l)=>(p(),b(pe,null,[Y(" We render single input if it's required "),a.value?(p(),U(Hv,He({key:r.name},{...t,...r.$attrs},{name:r.name,value:r.value}),null,16,["name","value"])):(p(!0),b(pe,{key:1},De(n.value,o=>(p(),U(Hv,He({key:o.name},{ref_for:!0},{...t,...r.$attrs},{name:o.name,value:o.value}),null,16,["name","value"]))),128))],2112))}}),tp=tT;const aT="rovingFocusGroup.onEntryFocus",nT={bubbles:!1,cancelable:!0},rT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lT(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function oT(e,t,a){const n=lT(e.key,a);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(n))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(n)))return rT[n]}function k1(e,t=!1){const a=Yt();for(const n of e)if(n===a||(n.focus({preventScroll:t}),Yt()!==a))return}function sT(e,t){return e.map((a,n)=>e[(t+n)%e.length])}const[w1,iT]=Dt("PopperRoot");var uT=ne({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=A();return iT({anchor:t,onAnchorChange:a=>t.value=a}),(a,n)=>Se(a.$slots,"default")}}),$1=uT,cT=ne({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:a,currentElement:n}=et(),r=w1();return Fy(()=>{r.onAnchorChange(t.reference??n.value)}),(l,o)=>(p(),U(s(nt),{ref:s(a),as:l.as,"as-child":l.asChild},{default:B(()=>[Se(l.$slots,"default")]),_:3},8,["as","as-child"]))}}),ap=cT;function dT(e){return e!==null}function fT(e){return{name:"transformOrigin",options:e,fn(t){const{placement:a,rects:n,middlewareData:r}=t,o=r.arrow?.centerOffset!==0,i=o?0:e.arrowWidth,u=o?0:e.arrowHeight,[d,c]=Nd(a),f={start:"0%",center:"50%",end:"100%"}[c],v=(r.arrow?.x??0)+i/2,m=(r.arrow?.y??0)+u/2;let y="",x="";return d==="bottom"?(y=o?f:`${v}px`,x=`${-u}px`):d==="top"?(y=o?f:`${v}px`,x=`${n.floating.height+u}px`):d==="right"?(y=`${-u}px`,x=o?f:`${m}px`):d==="left"&&(y=`${n.floating.width+u}px`,x=o?f:`${m}px`),{data:{x:y,y:x}}}}}function Nd(e){const[t,a="center"]=e.split("-");return[t,a]}const pT=["top","right","bottom","left"],Er=Math.min,qn=Math.max,Ji=Math.round,Qs=Math.floor,Ln=e=>({x:e,y:e}),mT={left:"right",right:"left",bottom:"top",top:"bottom"};function S1(e,t,a){return qn(e,Er(t,a))}function Hn(e,t){return typeof e=="function"?e(t):e}function Ar(e){return e.split("-")[0]}function uo(e){return e.split("-")[1]}function np(e){return e==="x"?"y":"x"}function rp(e){return e==="y"?"height":"width"}function cn(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function lp(e){return np(cn(e))}function vT(e,t,a){a===void 0&&(a=!1);const n=uo(e),r=lp(e),l=rp(r);let o=r==="x"?n===(a?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(o=Zi(o)),[o,Zi(o)]}function hT(e){const t=Zi(e);return[Bd(e),t,Bd(t)]}function Bd(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Kv=["left","right"],Wv=["right","left"],yT=["top","bottom"],gT=["bottom","top"];function bT(e,t,a){switch(e){case"top":case"bottom":return a?t?Wv:Kv:t?Kv:Wv;case"left":case"right":return t?yT:gT;default:return[]}}function _T(e,t,a,n){const r=uo(e);let l=bT(Ar(e),a==="start",n);return r&&(l=l.map(o=>o+"-"+r),t&&(l=l.concat(l.map(Bd)))),l}function Zi(e){const t=Ar(e);return mT[t]+e.slice(t.length)}function xT(e){var t,a,n,r;return{top:(t=e.top)!=null?t:0,right:(a=e.right)!=null?a:0,bottom:(n=e.bottom)!=null?n:0,left:(r=e.left)!=null?r:0}}function C1(e){return typeof e!="number"?xT(e):{top:e,right:e,bottom:e,left:e}}function Xi(e){const{x:t,y:a,width:n,height:r}=e;return{width:n,height:r,top:a,left:t,right:t+n,bottom:a+r,x:t,y:a}}function Gv(e,t,a){let{reference:n,floating:r}=e;const l=cn(t),o=lp(t),i=rp(o),u=Ar(t),d=l==="y",c=n.x+n.width/2-r.width/2,f=n.y+n.height/2-r.height/2,v=n[i]/2-r[i]/2;let m;switch(u){case"top":m={x:c,y:n.y-r.height};break;case"bottom":m={x:c,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:f};break;case"left":m={x:n.x-r.width,y:f};break;default:m={x:n.x,y:n.y}}const y=uo(t);return y&&(m[o]+=v*(y==="end"?1:-1)*(a&&d?-1:1)),m}async function kT(e,t){var a;t===void 0&&(t={});const{x:n,y:r,platform:l,rects:o,elements:i,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:v=!1,padding:m=0}=Hn(t,e),y=C1(m),S=i[v?f==="floating"?"reference":"floating":f],k=Xi(await l.getClippingRect({element:(a=await(l.isElement==null?void 0:l.isElement(S)))==null||a?S:S.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(i.floating)),boundary:d,rootBoundary:c,strategy:u})),C=f==="floating"?{x:n,y:r,width:o.floating.width,height:o.floating.height}:o.reference,L=await(l.getOffsetParent==null?void 0:l.getOffsetParent(i.floating)),D=await(l.isElement==null?void 0:l.isElement(L))&&await(l.getScale==null?void 0:l.getScale(L))||{x:1,y:1},T=Xi(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:C,offsetParent:L,strategy:u}):C);return{top:(k.top-T.top+y.top)/D.y,bottom:(T.bottom-k.bottom+y.bottom)/D.y,left:(k.left-T.left+y.left)/D.x,right:(T.right-k.right+y.right)/D.x}}const wT=50,$T=async(e,t,a)=>{const{placement:n="bottom",strategy:r="absolute",middleware:l=[],platform:o}=a,i=o.detectOverflow?o:{...o,detectOverflow:kT},u=await(o.isRTL==null?void 0:o.isRTL(t));let d=await o.getElementRects({reference:e,floating:t,strategy:r}),{x:c,y:f}=Gv(d,n,u),v=n,m=0;const y={};for(let x=0;x<l.length;x++){const S=l[x];if(!S)continue;const{name:k,fn:C}=S,{x:L,y:D,data:T,reset:I}=await C({x:c,y:f,initialPlacement:n,placement:v,strategy:r,middlewareData:y,rects:d,platform:i,elements:{reference:e,floating:t}});c=L??c,f=D??f,y[k]={...y[k],...T},I&&m<wT&&(m++,typeof I=="object"&&(I.placement&&(v=I.placement),I.rects&&(d=I.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:r}):I.rects),{x:c,y:f}=Gv(d,v,u)),x=-1)}return{x:c,y:f,placement:v,strategy:r,middlewareData:y}},ST=e=>({name:"arrow",options:e,async fn(t){const{x:a,y:n,placement:r,rects:l,platform:o,elements:i,middlewareData:u}=t,{element:d,padding:c=0}=Hn(e,t)||{};if(d==null)return{};const f=C1(c),v={x:a,y:n},m=lp(r),y=rp(m),x=await o.getDimensions(d),S=m==="y",k=S?"top":"left",C=S?"bottom":"right",L=S?"clientHeight":"clientWidth",D=l.reference[y]+l.reference[m]-v[m]-l.floating[y],T=v[m]-l.reference[m],I=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let q=I?I[L]:0;(!q||!await(o.isElement==null?void 0:o.isElement(I)))&&(q=i.floating[L]||l.floating[y]);const H=D/2-T/2,E=q/2-x[y]/2-1,P=Er(f[k],E),j=Er(f[C],E),O=q-x[y]-j,N=q/2-x[y]/2+H,Z=S1(P,N,O),W=!u.arrow&&uo(r)!=null&&N!==Z&&l.reference[y]/2-(N<P?P:j)-x[y]/2<0,K=W?N<P?N-P:N-O:0;return{[m]:v[m]+K,data:{[m]:Z,centerOffset:N-Z-K,...W&&{alignmentOffset:K}},reset:W}}}),CT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var a,n;const{placement:r,middlewareData:l,rects:o,initialPlacement:i,platform:u,elements:d}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:v,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:x=!0,...S}=Hn(e,t);if((a=l.arrow)!=null&&a.alignmentOffset)return{};const k=Ar(r),C=cn(i),L=Ar(i)===i,D=await(u.isRTL==null?void 0:u.isRTL(d.floating)),T=v||(L||!x?[Zi(i)]:hT(i)),I=y!=="none";!v&&I&&T.push(..._T(i,x,y,D));const q=[i,...T],H=await u.detectOverflow(t,S),E=[];let P=((n=l.flip)==null?void 0:n.overflows)||[];if(c&&E.push(H[k]),f){const Z=vT(r,o,D);E.push(H[Z[0]],H[Z[1]])}if(P=[...P,{placement:r,overflows:E}],!E.every(Z=>Z<=0)){var j,O;const Z=(((j=l.flip)==null?void 0:j.index)||0)+1,W=q[Z];if(W&&(!(f==="alignment"?C!==cn(W):!1)||P.every(oe=>cn(oe.placement)===C?oe.overflows[0]>0:!0)))return{data:{index:Z,overflows:P},reset:{placement:W}};let K=(O=P.filter(te=>te.overflows[0]<=0).sort((te,oe)=>te.overflows[1]-oe.overflows[1])[0])==null?void 0:O.placement;if(!K)switch(m){case"bestFit":{var N;const te=(N=P.filter(oe=>{if(I){const ye=cn(oe.placement);return ye===C||ye==="y"}return!0}).map(oe=>[oe.placement,oe.overflows.filter(ye=>ye>0).reduce((ye,be)=>ye+be,0)]).sort((oe,ye)=>oe[1]-ye[1])[0])==null?void 0:N[0];te&&(K=te);break}case"initialPlacement":K=i;break}if(r!==K)return{reset:{placement:K}}}return{}}}};function Yv(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jv(e){return pT.some(t=>e[t]>=0)}const ET=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:a,platform:n}=t,{strategy:r="referenceHidden",...l}=Hn(e,t);switch(r){case"referenceHidden":{const o=await n.detectOverflow(t,{...l,elementContext:"reference"}),i=Yv(o,a.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:Jv(i)}}}case"escaped":{const o=await n.detectOverflow(t,{...l,altBoundary:!0}),i=Yv(o,a.floating);return{data:{escapedOffsets:i,escaped:Jv(i)}}}default:return{}}}}},E1=new Set(["left","top"]);async function AT(e,t){const{placement:a,platform:n,elements:r}=e,l=await(n.isRTL==null?void 0:n.isRTL(r.floating)),o=Ar(a),i=uo(a),u=cn(a)==="y",d=E1.has(o)?-1:1,c=l&&u?-1:1,f=Hn(t,e);let{mainAxis:v,crossAxis:m,alignmentAxis:y}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return i&&typeof y=="number"&&(m=i==="end"?y*-1:y),u?{x:m*c,y:v*d}:{x:v*d,y:m*c}}const TT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var a,n;const{x:r,y:l,placement:o,middlewareData:i}=t,u=await AT(t,e);return o===((a=i.offset)==null?void 0:a.placement)&&(n=i.arrow)!=null&&n.alignmentOffset?{}:{x:r+u.x,y:l+u.y,data:{...u,placement:o}}}}},OT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:a,y:n,placement:r,platform:l}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:u={fn:C=>{let{x:L,y:D}=C;return{x:L,y:D}}},...d}=Hn(e,t),c={x:a,y:n},f=await l.detectOverflow(t,d),v=cn(r),m=np(v);let y=c[m],x=c[v];const S=(C,L)=>S1(L+f[C==="y"?"top":"left"],L,L-f[C==="y"?"bottom":"right"]);o&&(y=S(m,y)),i&&(x=S(v,x));const k=u.fn({...t,[m]:y,[v]:x});return{...k,data:{x:k.x-a,y:k.y-n,enabled:{[m]:o,[v]:i}}}}}},DT=function(e){return e===void 0&&(e={}),{options:e,fn(t){var a,n;const{x:r,y:l,placement:o,rects:i,middlewareData:u}=t,{offset:d=0,mainAxis:c=!0,crossAxis:f=!0}=Hn(e,t),v={x:r,y:l},m=cn(o),y=np(m);let x=v[y],S=v[m];const k=Hn(d,t),C=typeof k=="number"?{mainAxis:k,crossAxis:0}:{mainAxis:(a=k.mainAxis)!=null?a:0,crossAxis:(n=k.crossAxis)!=null?n:0};if(c){const T=y==="y"?"height":"width",I=i.reference[y]-i.floating[T]+C.mainAxis,q=i.reference[y]+i.reference[T]-C.mainAxis;x<I?x=I:x>q&&(x=q)}if(f){var L,D;const T=y==="y"?"width":"height",I=E1.has(Ar(o)),q=i.reference[m]-i.floating[T]+(I&&((L=u.offset)==null?void 0:L[m])||0)+(I?0:C.crossAxis),H=i.reference[m]+i.reference[T]+(I?0:((D=u.offset)==null?void 0:D[m])||0)-(I?C.crossAxis:0);S<q?S=q:S>H&&(S=H)}return{[y]:x,[m]:S}}}},MT=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:a,rects:n,platform:r,elements:l}=t,{apply:o=()=>{},...i}=Hn(e,t),u=await r.detectOverflow(t,i),d=Ar(a),c=uo(a),f=cn(a)==="y",{width:v,height:m}=n.floating;let y,x;d==="top"||d==="bottom"?(y=d,x=c===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(x=d,y=c==="end"?"top":"bottom");const S=m-u.top-u.bottom,k=v-u.left-u.right,C=Er(m-u[y],S),L=Er(v-u[x],k),D=t.middlewareData.shift,T=!D;let I=C,q=L;D!=null&&D.enabled.x&&(q=k),D!=null&&D.enabled.y&&(I=S),T&&!c&&(f?q=v-2*qn(u.left,u.right):I=m-2*qn(u.top,u.bottom)),await o({...t,availableWidth:q,availableHeight:I});const H=await r.getDimensions(l.floating);return v!==H.width||m!==H.height?{reset:{rects:!0}}:{}}}};function qu(){return typeof window<"u"}function hl(e){return op(e)?(e.nodeName||"").toLowerCase():"#document"}function va(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Qn(e){var t;return(t=(op(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function op(e){return qu()?e instanceof Node||e instanceof va(e).Node:!1}function yn(e){return qu()?e instanceof Element||e instanceof va(e).Element:!1}function Lr(e){return qu()?e instanceof HTMLElement||e instanceof va(e).HTMLElement:!1}function Zv(e){return!qu()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof va(e).ShadowRoot}function Lu(e){const{overflow:t,overflowX:a,overflowY:n,display:r}=gn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+a)&&r!=="inline"&&r!=="contents"}function PT(e){return/^(table|td|th)$/.test(hl(e))}function Nu(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const RT=/transform|translate|scale|rotate|perspective|filter/,IT=/paint|layout|strict|content/,Gr=e=>!!e&&e!=="none";let Ic;function sp(e){const t=yn(e)?gn(e):e;return Gr(t.transform)||Gr(t.translate)||Gr(t.scale)||Gr(t.rotate)||Gr(t.perspective)||!ip()&&(Gr(t.backdropFilter)||Gr(t.filter))||RT.test(t.willChange||"")||IT.test(t.contain||"")}function qT(e){let t=il(e);for(;Lr(t)&&!hs(t);){if(sp(t))return t;if(Nu(t))return null;t=il(t)}return null}function ip(){return Ic==null&&(Ic=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Ic}function hs(e){return/^(html|body|#document)$/.test(hl(e))}function gn(e){return va(e).getComputedStyle(e)}function Bu(e){return yn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function il(e){if(hl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zv(e)&&e.host||Qn(e);return Zv(t)?t.host:t}function A1(e){const t=il(e);return hs(t)?(e.ownerDocument||e).body:Lr(t)&&Lu(t)?t:A1(t)}function ys(e,t,a){var n;t===void 0&&(t=[]),a===void 0&&(a=!0);const r=A1(e),l=r===((n=e.ownerDocument)==null?void 0:n.body),o=va(r);if(l){const i=Fd(o);return t.concat(o,o.visualViewport||[],Lu(r)?r:[],i&&a?ys(i):[])}else return t.concat(r,ys(r,[],a))}function Fd(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function T1(e){const t=gn(e);let a=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const r=Lr(e),l=r?e.offsetWidth:a,o=r?e.offsetHeight:n,i=Ji(a)!==l||Ji(n)!==o;return i&&(a=l,n=o),{width:a,height:n,$:i}}function up(e){return yn(e)?e:e.contextElement}function Yl(e){const t=up(e);if(!Lr(t))return Ln(1);const a=t.getBoundingClientRect(),{width:n,height:r,$:l}=T1(t);let o=(l?Ji(a.width):a.width)/n,i=(l?Ji(a.height):a.height)/r;return(!o||!Number.isFinite(o))&&(o=1),(!i||!Number.isFinite(i))&&(i=1),{x:o,y:i}}const LT=Ln(0);function O1(e){const t=va(e);return!ip()||!t.visualViewport?LT:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NT(e,t,a){return t===void 0&&(t=!1),!!a&&t&&a===va(e)}function ul(e,t,a,n){t===void 0&&(t=!1),a===void 0&&(a=!1);const r=e.getBoundingClientRect(),l=up(e);let o=Ln(1);t&&(n?yn(n)&&(o=Yl(n)):o=Yl(e));const i=NT(l,a,n)?O1(l):Ln(0);let u=(r.left+i.x)/o.x,d=(r.top+i.y)/o.y,c=r.width/o.x,f=r.height/o.y;if(l&&n){const v=va(l),m=yn(n)?va(n):n;let y=v,x=Fd(y);for(;x&&m!==y;){const S=Yl(x),k=x.getBoundingClientRect(),C=gn(x),L=k.left+(x.clientLeft+parseFloat(C.paddingLeft))*S.x,D=k.top+(x.clientTop+parseFloat(C.paddingTop))*S.y;u*=S.x,d*=S.y,c*=S.x,f*=S.y,u+=L,d+=D,y=va(x),x=Fd(y)}}return Xi({width:c,height:f,x:u,y:d})}function Fu(e,t){const a=Bu(e).scrollLeft;return t?t.left+a:ul(Qn(e)).left+a}function D1(e,t){const a=e.getBoundingClientRect(),n=a.left+t.scrollLeft-Fu(e,a),r=a.top+t.scrollTop;return{x:n,y:r}}function BT(e){let{elements:t,rect:a,offsetParent:n,strategy:r}=e;const l=r==="fixed",o=Qn(n),i=t?Nu(t.floating):!1;if(n===o||i&&l)return a;let u={scrollLeft:0,scrollTop:0},d=Ln(1);const c=Ln(0),f=Lr(n);if((f||!l)&&((hl(n)!=="body"||Lu(o))&&(u=Bu(n)),f)){const m=ul(n);d=Yl(n),c.x=m.x+n.clientLeft,c.y=m.y+n.clientTop}const v=o&&!f&&!l?D1(o,u):Ln(0);return{width:a.width*d.x,height:a.height*d.y,x:a.x*d.x-u.scrollLeft*d.x+c.x+v.x,y:a.y*d.y-u.scrollTop*d.y+c.y+v.y}}function FT(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function VT(e){const t=Bu(e),a=e.ownerDocument.body,n=qn(e.scrollWidth,e.clientWidth,a.scrollWidth,a.clientWidth),r=qn(e.scrollHeight,e.clientHeight,a.scrollHeight,a.clientHeight);let l=-t.scrollLeft+Fu(e);const o=-t.scrollTop;return gn(a).direction==="rtl"&&(l+=qn(e.clientWidth,a.clientWidth)-n),{width:n,height:r,x:l,y:o}}const zT=25;function jT(e,t,a){a===void 0&&(a="viewport");const n=a==="layoutViewport",r=va(e),l=Qn(e),o=r.visualViewport;let i=l.clientWidth,u=l.clientHeight,d=0,c=0;if(o){const v=!ip()||t==="fixed";n?v||(d=-o.offsetLeft,c=-o.offsetTop):(i=o.width,u=o.height,v&&(d=o.offsetLeft,c=o.offsetTop))}if(Fu(l)<=0){const v=l.ownerDocument,m=v.body,y=getComputedStyle(m),x=v.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,S=Math.abs(l.clientWidth-m.clientWidth-x),k=getComputedStyle(l).scrollbarGutter==="stable both-edges"?S/2:S;k<=zT&&(i-=k)}return{width:i,height:u,x:d,y:c}}function UT(e,t){const a=ul(e,!0,t==="fixed"),n=a.top+e.clientTop,r=a.left+e.clientLeft,l=Yl(e),o=e.clientWidth*l.x,i=e.clientHeight*l.y,u=r*l.x,d=n*l.y;return{width:o,height:i,x:u,y:d}}function Xv(e,t,a){let n;if(t==="viewport"||t==="layoutViewport")n=jT(e,a,t);else if(t==="document")n=VT(Qn(e));else if(yn(t))n=UT(t,a);else{const r=O1(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Xi(n)}function HT(e,t){const a=t.get(e);if(a)return a;let n=ys(e,[],!1).filter(i=>yn(i)&&hl(i)!=="body"),r=null;const l=gn(e).position==="fixed";let o=l?il(e):e;for(;yn(o)&&!hs(o);){const i=gn(o),u=sp(o),d=r?r.position:l?"fixed":"";!u&&(d==="fixed"||d==="absolute"&&i.position==="static")?n=n.filter(f=>f!==o):r=i,o=il(o)}return t.set(e,n),n}function KT(e){let{element:t,boundary:a,rootBoundary:n,strategy:r}=e;const o=[...a==="clippingAncestors"?Nu(t)?[]:HT(t,this._c):[].concat(a),n],i=Xv(t,o[0],r);let u=i.top,d=i.right,c=i.bottom,f=i.left;for(let v=1;v<o.length;v++){const m=Xv(t,o[v],r);u=qn(m.top,u),d=Er(m.right,d),c=Er(m.bottom,c),f=qn(m.left,f)}return{width:d-f,height:c-u,x:f,y:u}}function WT(e){const{width:t,height:a}=T1(e);return{width:t,height:a}}function GT(e,t,a){const n=Lr(t),r=Qn(t),l=a==="fixed",o=ul(e,!0,l,t);let i={scrollLeft:0,scrollTop:0};const u=Ln(0);if((n||!l)&&((hl(t)!=="body"||Lu(r))&&(i=Bu(t)),n)){const v=ul(t,!0,l,t);u.x=v.x+t.clientLeft,u.y=v.y+t.clientTop}!n&&r&&(u.x=Fu(r));const d=r&&!n&&!l?D1(r,i):Ln(0),c=o.left+i.scrollLeft-u.x-d.x,f=o.top+i.scrollTop-u.y-d.y;return{x:c,y:f,width:o.width,height:o.height}}function qc(e){return gn(e).position==="static"}function Qv(e,t){if(!Lr(e)||gn(e).position==="fixed")return null;if(t)return t(e);let a=e.offsetParent;return Qn(e)===a&&(a=a.ownerDocument.body),a}function M1(e,t){const a=va(e);if(Nu(e))return a;if(!Lr(e)){let r=il(e);for(;r&&!hs(r);){if(yn(r)&&!qc(r))return r;r=il(r)}return a}let n=Qv(e,t);for(;n&&PT(n)&&qc(n);)n=Qv(n,t);return n&&hs(n)&&qc(n)&&!sp(n)?a:n||qT(e)||a}const YT=async function(e){const t=this.getOffsetParent||M1,a=this.getDimensions,n=await a(e.floating);return{reference:GT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function JT(e){return gn(e).direction==="rtl"}const ZT={convertOffsetParentRelativeRectToViewportRelativeRect:BT,getDocumentElement:Qn,getClippingRect:KT,getOffsetParent:M1,getElementRects:YT,getClientRects:FT,getDimensions:WT,getScale:Yl,isElement:yn,isRTL:JT};function P1(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function XT(e,t,a){let n=null,r;const l=Qn(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),o();const v=e.getBoundingClientRect(),{left:m,top:y,width:x,height:S}=v;if(c||t(),!x||!S)return;const k=Qs(y),C=Qs(l.clientWidth-(m+x)),L=Qs(l.clientHeight-(y+S)),D=Qs(m),I={rootMargin:-k+"px "+-C+"px "+-L+"px "+-D+"px",threshold:qn(0,Er(1,f))||1};let q=!0;function H(E){const P=E[0].intersectionRatio;if(!P1(v,e.getBoundingClientRect()))return i();if(P!==f){if(!q)return i();P?i(!1,P):r=setTimeout(()=>{i(!1,1e-7)},1e3)}q=!1}try{n=new IntersectionObserver(H,{...I,root:l.ownerDocument})}catch{n=new IntersectionObserver(H,I)}n.observe(e)}const u=va(e),d=()=>i(a);return u.addEventListener("resize",d),i(!0),()=>{u.removeEventListener("resize",d),o()}}function QT(e,t,a,n){n===void 0&&(n={});const{ancestorScroll:r=!0,ancestorResize:l=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:u=!1}=n,d=up(e),c=r||l?[...d?ys(d):[],...t?ys(t):[]]:[];c.forEach(k=>{r&&k.addEventListener("scroll",a),l&&k.addEventListener("resize",a)});const f=d&&i?XT(d,a,l):null;let v=-1,m=null;o&&(m=new ResizeObserver(k=>{let[C]=k;C&&C.target===d&&m&&t&&(m.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var L;(L=m)==null||L.observe(t)})),a()}),d&&!u&&m.observe(d),t&&m.observe(t));let y,x=u?ul(e):null;u&&S();function S(){const k=ul(e);x&&!P1(x,k)&&a(),x=k,y=requestAnimationFrame(S)}return a(),()=>{var k;c.forEach(C=>{r&&C.removeEventListener("scroll",a),l&&C.removeEventListener("resize",a)}),f?.(),(k=m)==null||k.disconnect(),m=null,u&&cancelAnimationFrame(y)}}const e5=TT,t5=OT,eh=CT,a5=MT,n5=ET,r5=ST,l5=DT,o5=(e,t,a)=>{const n=new Map,r=a??{},l={...ZT,...r.platform,_c:n};return $T(e,t,{...r,platform:l})};function s5(e){return e!=null&&typeof e=="object"&&"$el"in e}function Vd(e){if(s5(e)){const t=e.$el;return op(t)&&hl(t)==="#comment"?null:t}return e}function Pl(e){return typeof e=="function"?e():s(e)}function i5(e){return{name:"arrow",options:e,fn(t){const a=Vd(Pl(e.element));return a==null?{}:r5({element:a,padding:e.padding}).fn(t)}}}function R1(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function th(e,t){const a=R1(e);return Math.round(t*a)/a}function u5(e,t,a){a===void 0&&(a={});const n=a.whileElementsMounted,r=_(()=>{var q;return(q=Pl(a.open))!=null?q:!0}),l=_(()=>Pl(a.middleware)),o=_(()=>{var q;return(q=Pl(a.placement))!=null?q:"bottom"}),i=_(()=>{var q;return(q=Pl(a.strategy))!=null?q:"absolute"}),u=_(()=>{var q;return(q=Pl(a.transform))!=null?q:!0}),d=_(()=>Vd(e.value)),c=_(()=>Vd(t.value)),f=A(0),v=A(0),m=A(i.value),y=A(o.value),x=cl({}),S=A(!1),k=_(()=>{const q={position:m.value,left:"0",top:"0"};if(!c.value)return q;const H=th(c.value,f.value),E=th(c.value,v.value);return u.value?{...q,transform:"translate("+H+"px, "+E+"px)",...R1(c.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:H+"px",top:E+"px"}});let C;function L(){if(d.value==null||c.value==null)return;const q=r.value;o5(d.value,c.value,{middleware:l.value,placement:o.value,strategy:i.value}).then(H=>{f.value=H.x,v.value=H.y,m.value=H.strategy,y.value=H.placement,x.value=H.middlewareData,S.value=q!==!1})}function D(){typeof C=="function"&&(C(),C=void 0)}function T(){if(D(),n===void 0){L();return}if(d.value!=null&&c.value!=null){C=n(d.value,c.value,L);return}}function I(){r.value||(S.value=!1)}return Be([l,o,i,r],L,{flush:"sync"}),Be([d,c],T,{flush:"sync"}),Be(r,I,{flush:"sync"}),rf()&&my(D),{x:wl(f),y:wl(v),strategy:wl(m),placement:wl(y),middlewareData:wl(x),isPositioned:wl(S),floatingStyles:k,update:L}}const I1={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,hideShiftedArrow:!0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[vG,c5]=Dt("PopperContent");var d5=ne({inheritAttrs:!1,__name:"PopperContent",props:tg({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...I1}),emits:["placed"],setup(e,{emit:t}){const a=e,n=t,r=w1(),{forwardRef:l,currentElement:o}=et(),i=A(),u=A(),{width:d,height:c}=JA(u),f=_(()=>a.side+(a.align!=="center"?`-${a.align}`:"")),v=_(()=>typeof a.collisionPadding=="number"?a.collisionPadding:{top:0,right:0,bottom:0,left:0,...a.collisionPadding}),m=_(()=>Array.isArray(a.collisionBoundary)?a.collisionBoundary:[a.collisionBoundary]),y=_(()=>({padding:v.value,boundary:m.value.filter(dT),altBoundary:m.value.length>0})),x=_(()=>({mainAxis:a.sideFlip,crossAxis:a.alignFlip})),S=EE(()=>[e5({mainAxis:a.sideOffset+c.value,alignmentAxis:a.alignOffset}),a.prioritizePosition&&a.avoidCollisions&&eh({...y.value,...x.value}),a.avoidCollisions&&t5({mainAxis:!0,crossAxis:!!a.prioritizePosition,limiter:a.sticky==="partial"?l5():void 0,...y.value}),!a.prioritizePosition&&a.avoidCollisions&&eh({...y.value,...x.value}),a5({...y.value,apply:({elements:O,rects:N,availableWidth:Z,availableHeight:W})=>{const{width:K,height:te}=N.reference,oe=O.floating.style;oe.setProperty("--reka-popper-available-width",`${Z}px`),oe.setProperty("--reka-popper-available-height",`${W}px`),oe.setProperty("--reka-popper-anchor-width",`${K}px`),oe.setProperty("--reka-popper-anchor-height",`${te}px`)}}),u.value&&i5({element:u.value,padding:a.arrowPadding}),fT({arrowWidth:d.value,arrowHeight:c.value}),a.hideWhenDetached&&n5({strategy:"referenceHidden",...y.value})]),k=_(()=>a.reference??r.anchor.value),{floatingStyles:C,placement:L,isPositioned:D,middlewareData:T}=u5(k,i,{strategy:a.positionStrategy,placement:f,whileElementsMounted:(...O)=>QT(...O,{layoutShift:!a.disableUpdateOnLayoutShift,animationFrame:a.updatePositionStrategy==="always"}),middleware:S}),I=_(()=>Nd(L.value)[0]),q=_(()=>Nd(L.value)[1]);Fy(()=>{D.value&&n("placed")});const H=_(()=>{const O=T.value.arrow?.centerOffset!==0;return a.hideShiftedArrow&&O}),E=A("");Ea(()=>{o.value&&(E.value=window.getComputedStyle(o.value).zIndex)});const P=_(()=>T.value.arrow?.x??0),j=_(()=>T.value.arrow?.y??0);return c5({placedSide:I,onArrowChange:O=>u.value=O,arrowX:P,arrowY:j,shouldHideArrow:H}),(O,N)=>(p(),b("div",{ref_key:"floatingRef",ref:i,"data-reka-popper-content-wrapper":"",style:ua({...s(C),transform:s(D)?s(C).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:E.value,"--reka-popper-transform-origin":[s(T).transformOrigin?.x,s(T).transformOrigin?.y].join(" "),...s(T).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[R(s(nt),He({ref:s(l)},O.$attrs,{"as-child":a.asChild,as:O.as,"data-side":I.value,"data-align":q.value,style:{animation:s(D)?void 0:"none"}}),{default:B(()=>[Se(O.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),q1=d5;const cp=["day","month","year"],dp=["hour","minute","second","dayPeriod"],L1=[...cp,...dp];function f5(e){return cp.includes(e)}function N1(e){return L1.includes(e)}const p5=["ach","af","am","an","ar","ast","az","be","bg","bn","br","bs","ca","cak","ckb","cs","cy","da","de","dsb","el","en","eo","es","et","eu","fa","ff","fi","fr","fy","ga","gd","gl","he","hr","hsb","hu","ia","id","it","ja","ka","kk","kn","ko","lb","lo","lt","lv","meh","ml","ms","nl","nn","no","oc","pl","pt","rm","ro","ru","sc","scn","sk","sl","sr","sv","szl","tg","th","tr","uk","zh-CN","zh-TW"],m5=["year","month","day"],Lc={ach:{year:"mwaka",month:"dwe",day:"nino"},af:{year:"jjjj",month:"mm",day:"dd"},am:{year:"ዓዓዓዓ",month:"ሚሜ",day:"ቀቀ"},an:{year:"aaaa",month:"mm",day:"dd"},ar:{year:"سنة",month:"شهر",day:"يوم"},ast:{year:"aaaa",month:"mm",day:"dd"},az:{year:"iiii",month:"aa",day:"gg"},be:{year:"гггг",month:"мм",day:"дд"},bg:{year:"гггг",month:"мм",day:"дд"},bn:{year:"yyyy",month:"মিমি",day:"dd"},br:{year:"bbbb",month:"mm",day:"dd"},bs:{year:"gggg",month:"mm",day:"dd"},ca:{year:"aaaa",month:"mm",day:"dd"},cak:{year:"jjjj",month:"ii",day:"q'q'"},ckb:{year:"ساڵ",month:"مانگ",day:"ڕۆژ"},cs:{year:"rrrr",month:"mm",day:"dd"},cy:{year:"bbbb",month:"mm",day:"dd"},da:{year:"åååå",month:"mm",day:"dd"},de:{year:"jjjj",month:"mm",day:"tt"},dsb:{year:"llll",month:"mm",day:"źź"},el:{year:"εεεε",month:"μμ",day:"ηη"},en:{year:"yyyy",month:"mm",day:"dd"},eo:{year:"jjjj",month:"mm",day:"tt"},es:{year:"aaaa",month:"mm",day:"dd"},et:{year:"aaaa",month:"kk",day:"pp"},eu:{year:"uuuu",month:"hh",day:"ee"},fa:{year:"سال",month:"ماه",day:"روز"},ff:{year:"hhhh",month:"ll",day:"ññ"},fi:{year:"vvvv",month:"kk",day:"pp"},fr:{year:"aaaa",month:"mm",day:"jj"},fy:{year:"jjjj",month:"mm",day:"dd"},ga:{year:"bbbb",month:"mm",day:"ll"},gd:{year:"bbbb",month:"mm",day:"ll"},gl:{year:"aaaa",month:"mm",day:"dd"},he:{year:"שנה",month:"חודש",day:"יום"},hr:{year:"gggg",month:"mm",day:"dd"},hsb:{year:"llll",month:"mm",day:"dd"},hu:{year:"éééé",month:"hh",day:"nn"},ia:{year:"aaaa",month:"mm",day:"dd"},id:{year:"tttt",month:"bb",day:"hh"},it:{year:"aaaa",month:"mm",day:"gg"},ja:{year:" 年 ",month:"月",day:"日"},ka:{year:"წწწწ",month:"თთ",day:"რრ"},kk:{year:"жжжж",month:"аа",day:"кк"},kn:{year:"ವವವವ",month:"ಮಿಮೀ",day:"ದಿದಿ"},ko:{year:"연도",month:"월",day:"일"},lb:{year:"jjjj",month:"mm",day:"dd"},lo:{year:"ປປປປ",month:"ດດ",day:"ວວ"},lt:{year:"mmmm",month:"mm",day:"dd"},lv:{year:"gggg",month:"mm",day:"dd"},meh:{year:"aaaa",month:"mm",day:"dd"},ml:{year:"വർഷം",month:"മാസം",day:"തീയതി"},ms:{year:"tttt",month:"mm",day:"hh"},nl:{year:"jjjj",month:"mm",day:"dd"},nn:{year:"åååå",month:"mm",day:"dd"},no:{year:"åååå",month:"mm",day:"dd"},oc:{year:"aaaa",month:"mm",day:"jj"},pl:{year:"rrrr",month:"mm",day:"dd"},pt:{year:"aaaa",month:"mm",day:"dd"},rm:{year:"oooo",month:"mm",day:"dd"},ro:{year:"aaaa",month:"ll",day:"zz"},ru:{year:"гггг",month:"мм",day:"дд"},sc:{year:"aaaa",month:"mm",day:"dd"},scn:{year:"aaaa",month:"mm",day:"jj"},sk:{year:"rrrr",month:"mm",day:"dd"},sl:{year:"llll",month:"mm",day:"dd"},sr:{year:"гггг",month:"мм",day:"дд"},sv:{year:"åååå",month:"mm",day:"dd"},szl:{year:"rrrr",month:"mm",day:"dd"},tg:{year:"сссс",month:"мм",day:"рр"},th:{year:"ปปปป",month:"ดด",day:"วว"},tr:{year:"yyyy",month:"aa",day:"gg"},uk:{year:"рррр",month:"мм",day:"дд"},"zh-CN":{year:"年",month:"月",day:"日"},"zh-TW":{year:"年",month:"月",day:"日"}};function v5(e){if(ah(e))return Lc[e];{const t=b5(e);return ah(t)?Lc[t]:Lc.en}}function Nc(e,t,a){return h5(e)?v5(a)[e]:g5(e)?t:y5(e)?"––":""}function ah(e){return p5.includes(e)}function h5(e){return m5.includes(e)}function y5(e){return e==="hour"||e==="minute"||e==="second"}function g5(e){return e==="era"||e==="dayPeriod"}function b5(e){return Intl.Locale?new Intl.Locale(e).language:e.split("-")[0]}const _5=["hour","minute","second"];function zd(e){return Object.fromEntries(dp.map(t=>t==="dayPeriod"?[t,e.formatter.dayPeriod(Ma(e.value))]:[t,e.value[t]]))}function nh(e){const{formatter:t}=e,a=cp.map(n=>[n,e.value[n]]);if("hour"in e.value){const n=zd({value:e.value,formatter:t});return{...Object.fromEntries(a),...n}}return Object.fromEntries(a)}function x5(e){return Object.fromEntries(dp.map(t=>t==="dayPeriod"?[t,"AM"]:[t,null]).filter(([t])=>!(t==="literal"||t===null||e==="minute"&&t==="second"||e==="hour"&&(t==="second"||t==="minute"))))}function k5(e){const t=L1.map(a=>a==="dayPeriod"?[a,"AM"]:[a,null]).filter(([a])=>a==="literal"||a===null||e==="minute"&&a==="second"||e==="hour"&&(a==="second"||a==="minute")?!1:e==="day"?!_5.includes(a)&&a!=="dayPeriod":!0);return Object.fromEntries(t)}function w5(e){const{segmentValues:t,formatter:a,locale:n}=e;function r(o){if("hour"in t){const i=t[o];return i!==null?o==="day"?a.part(e.dateRef.set({[o]:i,month:t.month??1}),o,{hourCycle:vs(e.hourCycle)}):a.part(e.dateRef.set({[o]:i}),o,{hourCycle:vs(e.hourCycle)}):Nc(o,"",n.value)}else{if(f5(o)){const i=t[o];return i!==null?o==="day"?a.part(e.dateRef.set({[o]:i,month:t.month??1}),o):a.part(e.dateRef.set({[o]:i}),o):Nc(o,"",n.value)}return""}}return Object.keys(t).reduce((o,i)=>{if(!N1(i))return o;if("hour"in t&&i==="dayPeriod"){const u=t[i];u!==null?o[i]=u:o[i]=Nc(i,"AM",n.value)}else o[i]=r(i);return o},{})}function $5(e){const{granularity:t,formatter:a,contentObj:n,hideTimeZone:r,hourCycle:l,isTimeValue:o}=e;return a.toParts(e.dateRef,UA(t,l,o)).map(d=>["literal","timeZoneName",null].includes(d.type)||!N1(d.type)?{part:d.type,value:d.value}:{part:d.type,value:n[d.type]}).filter(d=>!(d.part===null||d.value===null||d.part==="timeZoneName"&&(!ms(e.dateRef)||r)||(!ms(e.dateRef)||r)&&d.part==="literal"&&["[","]"].includes(d.value.trim())))}function B1(e){const t=w5(e),a=$5({contentObj:t,...e});return{obj:t,arr:a}}function En(e){const t=io();return e===t.ARROW_RIGHT||e===t.ARROW_LEFT}function Zr(e){return!Number.isNaN(Number.parseInt(e))}function sr(e){const t=io();return!!([t.ENTER,t.ARROW_UP,t.ARROW_DOWN,t.ARROW_LEFT,t.ARROW_RIGHT,t.BACKSPACE,t.SPACE,"a","A","p","P"].includes(e)||Zr(e))}function rh(e){return Array.from(e.querySelectorAll("[data-reka-date-field-segment]")).filter(t=>t.getAttribute("data-reka-date-field-segment")!=="literal")}function lh(e){return Array.from(e.querySelectorAll("[data-reka-time-field-segment]")).filter(t=>t.getAttribute("data-reka-time-field-segment")!=="literal")}const S5=/^\d$/;function Nr(e){return{role:"spinbutton",contenteditable:!0,tabindex:e.disabled?void 0:0,spellcheck:!1,inputmode:"numeric",autocorrect:"off",enterkeyhint:"next",style:"caret-color: transparent;"}}function C5(e){const{segmentValues:t,placeholder:a}=e,n=t.day===null,r={};t.day&&(r.day=t.day),t.month&&(r.month=t.month);const l=Object.keys(r).length>0?a.set(r):a,o=l.day,i=1,u=_r(l),d=n?"Empty":`${o}`;return{...Nr(e),"aria-label":"day,","aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":o,"aria-valuetext":d,"data-placeholder":n?"":void 0}}function E5(e){const{segmentValues:t,placeholder:a,formatter:n}=e,r=t.month===null,l=t.month?a.set({month:t.month}):a,o=l.month,i=1,u=12,d=r?"Empty":`${o} - ${n.fullMonth(Ma(l))}`;return{...Nr(e),"aria-label":"month, ",contenteditable:!0,"aria-valuemin":i,"aria-valuemax":u,"aria-valuenow":o,"aria-valuetext":d,"data-placeholder":r?"":void 0}}function A5(e){const{segmentValues:t,placeholder:a}=e,n=t.year===null,r=t.year?a.set({year:t.year}):a,l=1,o=9999,i=r.year,u=n?"Empty":`${i}`;return{...Nr(e),"aria-label":"year, ","aria-valuemin":l,"aria-valuemax":o,"aria-valuenow":i,"aria-valuetext":u,"data-placeholder":n?"":void 0}}function T5(e){const{segmentValues:t,hourCycle:a,placeholder:n}=e;if(!("hour"in t)||!("hour"in n))return{};const r=t.hour===null,l=t.hour?n.set({hour:t.hour}):n,o=a===12?1:0,i=a===12?12:23,u=l.hour,d=r?"Empty":`${u} ${t.dayPeriod??""}`;return{...Nr(e),"aria-label":"hour, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":u,"aria-valuetext":d,"data-placeholder":r?"":void 0}}function O5(e){const{segmentValues:t,placeholder:a}=e;if(!("minute"in t)||!("minute"in a))return{};const n=t.minute===null,l=(t.minute?a.set({minute:t.minute}):a).minute,o=0,i=59,u=n?"Empty":`${l}`;return{...Nr(e),"aria-label":"minute, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":l,"aria-valuetext":u,"data-placeholder":n?"":void 0}}function D5(e){const{segmentValues:t,placeholder:a}=e;if(!("second"in t)||!("second"in a))return{};const n=t.second===null,l=(t.second?a.set({second:t.second}):a).second,o=0,i=59,u=n?"Empty":`${l}`;return{...Nr(e),"aria-label":"second, ","aria-valuemin":o,"aria-valuemax":i,"aria-valuenow":l,"aria-valuetext":u,"data-placeholder":n?"":void 0}}function M5(e){const{segmentValues:t}=e;if(!("dayPeriod"in t))return{};const a=0,n=12,r=t.hour?t.hour>12?t.hour-12:t.hour:0,l=t.dayPeriod??"AM";return{...Nr(e),inputmode:"text","aria-label":"AM/PM","aria-valuemin":a,"aria-valuemax":n,"aria-valuenow":r,"aria-valuetext":l}}function P5(e){return{"aria-hidden":!0,"data-segment":"literal"}}function R5(e){return{role:"textbox","aria-label":"timezone, ","data-readonly":!0,"data-segment":"timeZoneName",tabindex:e.disabled?void 0:0,style:"caret-color: transparent;"}}function I5(e){const{segmentValues:t,placeholder:a}=e,n=0,r=0,l=0,o="era"in t?t.era:a.era;return{...Nr(e),"aria-label":"era","aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":l,"aria-valuetext":o}}const q5={day:{attrs:C5},month:{attrs:E5},year:{attrs:A5},hour:{attrs:T5},minute:{attrs:O5},second:{attrs:D5},dayPeriod:{attrs:M5},literal:{attrs:P5},timeZoneName:{attrs:R5},era:{attrs:I5}};function F1(e){const t=io();function a({e:E,part:P,dateRef:j,prevValue:O}){const N=e.step.value[P]??1,Z=E.key===t.ARROW_UP?N:-N,W=0,K=59;if(O===null)return Z>0?W:K;const te=[P,Z];return j.set({[P]:O}).cycle(...te)[P]}function n(E){if(e.hasLeftFocus.value=!1,E===null)return E;const P=E.toString();return P.length===1?(e.modelValue.value=void 0,null):Number.parseInt(P.slice(0,-1))}function r({e:E,part:P,dateRef:j,prevValue:O}){const N=e.step.value[P]??1,Z=E.key===t.ARROW_UP?N:-N;if(O===null)return j[P];if(P==="hour"&&"hour"in j){const K=[P,Z];return j.set({[P]:O}).cycle(...K)[P]}const W=[P,Z];return P==="day"?j.set({[P]:O,month:e.segmentValues.value.month??1}).cycle(...W)[P]:j.set({[P]:O}).cycle(...W)[P]}function l(E,P,j){let O=!1;const N=Math.floor(E/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,j=null),j===null)return P===0?(e.lastKeyZero.value=!0,{value:null,moveToNext:O}):((e.lastKeyZero.value||P>N)&&(O=!0),e.lastKeyZero.value=!1,{value:P,moveToNext:O});const Z=j.toString().length,W=Number.parseInt(j.toString()+P.toString());return Z===2||W>E?((P>N||W>E)&&(O=!0),{value:P,moveToNext:O}):(O=!0,{value:W,moveToNext:O})}function o(E,P){let O=!1;const N=Math.floor(59/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,P=null),P===null)return E===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:O}):((e.lastKeyZero.value||E>N)&&(O=!0),e.lastKeyZero.value=!1,{value:E,moveToNext:O});const Z=P.toString().length,W=Number.parseInt(P.toString()+E.toString());return Z===2||W>59?(E>N&&(O=!0),{value:E,moveToNext:O}):(O=!0,{value:W,moveToNext:O})}function i(E,P,j){let O=!1;const N=Math.floor(E/10);if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,e.lastKeyZero.value=!1,j=null),j===null)return P===0?(e.lastKeyZero.value=!0,{value:0,moveToNext:O}):((e.lastKeyZero.value||P>N)&&(O=!0),e.lastKeyZero.value=!1,{value:P,moveToNext:O});const Z=j.toString().length,W=Number.parseInt(j.toString()+P.toString());return Z===2||W>E?(P>N&&(O=!0),{value:P,moveToNext:O}):(O=!0,{value:W,moveToNext:O})}function u(E,P){let j=!1;if(e.hasLeftFocus.value&&(e.hasLeftFocus.value=!1,P=null),P===null)return{value:E===0?1:E,moveToNext:j};const O=P.toString()+E.toString();return O.length>4?{value:E===0?1:E,moveToNext:j}:(O.length===4&&(j=!0),{value:Number.parseInt(O),moveToNext:j})}const d=_(()=>q5[e.part]?.attrs({disabled:e.disabled.value,placeholder:e.placeholder.value,hourCycle:e.hourCycle,segmentValues:e.segmentValues.value,formatter:e.formatter})??{});function c(E){if(!sr(E.key)||En(E.key))return;const P=e.segmentValues.value.day;if(E.key===t.ARROW_DOWN||E.key===t.ARROW_UP){e.segmentValues.value.day=r({e:E,part:"day",dateRef:e.placeholder.value,prevValue:P});return}if(Zr(E.key)){const j=Number.parseInt(E.key),O=e.segmentValues.value.month,N=O?_r(e.placeholder.value.set({month:O})):31,{value:Z,moveToNext:W}=l(N,j,P);e.segmentValues.value.day=Z,W&&e.focusNext()}E.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.day=n(P))}function f(E){if(!sr(E.key)||En(E.key))return;const P=e.segmentValues.value.month;if(E.key===t.ARROW_DOWN||E.key===t.ARROW_UP){e.segmentValues.value.month=r({e:E,part:"month",dateRef:e.placeholder.value,prevValue:P});return}if(Zr(E.key)){const j=Number.parseInt(E.key),{value:O,moveToNext:N}=l(12,j,P);e.segmentValues.value.month=O,N&&e.focusNext()}E.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.month=n(P))}function v(E){if(!sr(E.key)||En(E.key))return;const P=e.segmentValues.value.year;if(E.key===t.ARROW_DOWN||E.key===t.ARROW_UP){e.segmentValues.value.year=r({e:E,part:"year",dateRef:e.placeholder.value,prevValue:P});return}if(Zr(E.key)){const j=Number.parseInt(E.key),{value:O,moveToNext:N}=u(j,P);e.segmentValues.value.year=O,N&&e.focusNext()}E.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.year=n(P))}function m(E){const P=new Va(E,{hour:"numeric"}).resolvedOptions().hourCycle;return P==="h11"||P==="h12"}function y(E){const P=e.placeholder.value;if(!sr(E.key)||En(E.key)||!("hour"in P)||!("hour"in e.segmentValues.value))return;const j=e.segmentValues.value.hour;if(E.key===t.ARROW_UP||E.key===t.ARROW_DOWN){const O=r({e:E,part:"hour",dateRef:e.placeholder.value,prevValue:j});e.segmentValues.value.hour=O,"dayPeriod"in e.segmentValues.value&&O!==null&&(e.segmentValues.value.dayPeriod=O>=12?"PM":"AM");return}if(Zr(E.key)){const O=Number.parseInt(E.key),N=e.hourCycle!==void 0?e.hourCycle===12:m(e.formatter.getLocale()),Z=N?12:24;let W=j;N&&j!==null&&(W=j%12===0?0:j>12?j-12:j);const{value:K,moveToNext:te}=i(Z,O,W);let oe=K;if(N&&K!==null){const ye=e.segmentValues.value.dayPeriod||"AM";K===12?oe=ye==="AM"?0:12:oe=ye==="PM"?K+12:K}e.segmentValues.value.hour=oe,te&&e.focusNext()}E.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.hour=n(j))}function x(E){const P=e.placeholder.value;if(!sr(E.key)||En(E.key)||!("minute"in P)||!("minute"in e.segmentValues.value))return;const j=e.segmentValues.value.minute;if((E.key===t.ARROW_UP||E.key===t.ARROW_DOWN)&&(e.segmentValues.value.minute=a({e:E,part:"minute",dateRef:e.placeholder.value,prevValue:j})),Zr(E.key)){const O=Number.parseInt(E.key),{value:N,moveToNext:Z}=o(O,j);e.segmentValues.value.minute=N,Z&&e.focusNext()}E.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.minute=n(j))}function S(E){const P=e.placeholder.value;if(!sr(E.key)||En(E.key)||!("second"in P)||!("second"in e.segmentValues.value))return;const j=e.segmentValues.value.second;if((E.key===t.ARROW_UP||E.key===t.ARROW_DOWN)&&(e.segmentValues.value.second=a({e:E,part:"second",dateRef:e.placeholder.value,prevValue:j})),Zr(E.key)){const O=Number.parseInt(E.key),{value:N,moveToNext:Z}=o(O,j);e.segmentValues.value.second=N,Z&&e.focusNext()}E.key===t.BACKSPACE&&(e.hasLeftFocus.value=!1,e.segmentValues.value.second=n(j))}function k(E){if(!((!sr(E.key)||En(E.key))&&E.key!=="a"&&E.key!=="p"||!("hour"in e.placeholder.value)||!("dayPeriod"in e.segmentValues.value))){if(E.key===t.ARROW_UP||E.key===t.ARROW_DOWN){if(e.segmentValues.value.dayPeriod==="AM"){e.segmentValues.value.dayPeriod="PM",e.segmentValues.value.hour=e.segmentValues.value.hour+12;return}e.segmentValues.value.dayPeriod="AM",e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}if(["a","A"].includes(E.key)&&e.segmentValues.value.dayPeriod!=="AM"){e.segmentValues.value.dayPeriod="AM",e.segmentValues.value.hour=e.segmentValues.value.hour-12;return}["p","P"].includes(E.key)&&e.segmentValues.value.dayPeriod!=="PM"&&(e.segmentValues.value.dayPeriod="PM",e.segmentValues.value.hour=e.segmentValues.value.hour+12)}}function C(E){e.disabled.value&&E.preventDefault()}function L(E){if(E.isComposing||E.key==="Process")return;const P=e.disabled.value,j=e.readonly.value;if(P||j)return;if(E.key!==t.TAB&&E.preventDefault(),{day:c,month:f,year:v,hour:y,minute:x,second:S,dayPeriod:k,timeZoneName:()=>{}}[e.part](E),![t.ARROW_LEFT,t.ARROW_RIGHT].includes(E.key)&&E.key!==t.TAB&&E.key!==t.SHIFT&&sr(E.key)&&Object.values(e.segmentValues.value).every(N=>N!==null)){const N={...e.segmentValues.value},Z=e.placeholder.value.set(N);e.modelValue.value=Z.copy()}}function D(){if(e.stepSnapping?.value&&(e.part==="hour"&&"hour"in e.segmentValues.value&&e.segmentValues.value.hour!==null&&e.step.value.hour&&e.step.value.hour>1?(e.segmentValues.value.hour=gc(e.segmentValues.value.hour,0,23,e.step.value.hour),"dayPeriod"in e.segmentValues.value&&(e.segmentValues.value.hour<12?e.segmentValues.value.dayPeriod="AM":e.segmentValues.value.hour&&(e.segmentValues.value.dayPeriod="PM"))):e.part==="minute"&&"minute"in e.segmentValues.value&&e.segmentValues.value.minute!==null&&e.step.value.minute&&e.step.value.minute>1?e.segmentValues.value.minute=gc(e.segmentValues.value.minute,0,59,e.step.value.minute):e.part==="second"&&"second"in e.segmentValues.value&&e.segmentValues.value.second!==null&&e.step.value.second&&e.step.value.second>1&&(e.segmentValues.value.second=gc(e.segmentValues.value.second,0,59,e.step.value.second)),Object.values(e.segmentValues.value).every(E=>E!==null))){const E=e.placeholder.value.set({...e.segmentValues.value});e.modelValue.value=E.copy()}}let T=null;function I(E){E.isComposing||E.preventDefault()}function q(E){const P=E.target;T=Array.from(P.childNodes,j=>({node:j,value:j.nodeValue}))}function H(E){const P=E.target,j=T;if(T=null,j){for(const{node:N,value:Z}of j)N.nodeValue=Z;P.replaceChildren(...j.map(N=>N.node))}const O=E.data;if(O)for(const N of O){if(!S5.test(N))continue;const Z=Yt();if(!(Z instanceof HTMLElement))break;Z.dispatchEvent(new KeyboardEvent("keydown",{key:N,bubbles:!0,cancelable:!0}))}}return{handleSegmentClick:C,handleSegmentKeydown:L,handleSegmentBeforeInput:I,handleSegmentCompositionStart:q,handleSegmentCompositionEnd:H,handleSegmentFocusOut:D,attributes:d}}function L5(e){function t(l){return Array.isArray(e.date.value)?e.date.value.some(o=>$r(o,l)):e.date.value?$r(e.date.value,l):!1}const a=_(()=>{if(Array.isArray(e.date.value)){if(!e.date.value.length)return!1;for(const l of e.date.value)if(e.isDateDisabled?.(l)||e.isDateUnavailable?.(l))return!0}else{if(!e.date.value)return!1;if(e.isDateDisabled?.(e.date.value)||e.isDateUnavailable?.(e.date.value))return!0}return!1}),n=_(()=>Array.isArray(e.date.value)?e.date.value.length>0:!!e.date.value),r=_(()=>Array.isArray(e.date.value)?e.date.value.length?e.date.value.some(l=>e.isDateDisabled?.(l)):!1:e.date.value?!!e.isDateDisabled?.(e.date.value):!1);return{isDateSelected:t,isInvalid:a,hasSelectedDate:n,isSelectedDateDisabled:r}}function N5(e,t){const a=t(e),n=a.compare(e),r={};return n>=7&&(r.day=1),n>=_r(e)&&(r.month=1),a.set({...r})}function B5(e,t){const a=t(e),n=e.compare(a),r={};return n>=7&&(r.day=35),n>=_r(e)&&(r.month=13),a.set({...r})}function F5(e,t){return t(e)}function V5(e,t){return t(e)}function z5(e){const t=Gf(e.locale.value),a=_(()=>{const k={calendar:e.placeholder.value.calendar.identifier};return e.placeholder.value.calendar.identifier==="gregory"&&e.placeholder.value.era==="BC"&&(k.era="short"),k}),n=A(Wr({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})),r=_(()=>n.value.map(k=>k.value));function l(k){return!r.value.some(C=>gv(k,C))}const o=k=>{if(!e.maxValue.value||!n.value.length)return!1;if(e.disabled.value)return!0;const C=n.value.at(-1).value;if(!k&&!e.nextPage.value){const D=C.add({months:1}).set({day:1});return Ac(D,e.maxValue.value)}const L=N5(C,k||e.nextPage.value);return Ac(L,e.maxValue.value)},i=k=>{if(!e.minValue.value||!n.value.length)return!1;if(e.disabled.value)return!0;const C=n.value[0].value;if(!k&&!e.prevPage.value){const D=C.subtract({months:1}).set({day:35});return yr(D,e.minValue.value)}const L=B5(C,k||e.prevPage.value);return yr(L,e.minValue.value)};function u(k){return!!(e.isDateDisabled?.(k)||e.disabled.value||e.maxValue.value&&Ac(k,e.maxValue.value)||e.minValue.value&&yr(k,e.minValue.value))}const d=k=>!!e.isDateUnavailable?.(k),c=_(()=>n.value.length?n.value[0].rows[0].map(k=>t.dayOfWeek(Ma(k),e.weekdayFormat.value)):[]),f=k=>{const C=n.value[0].value;if(!k&&!e.nextPage.value){const I=C.add({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),q=Wr({dateObj:I,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=q,e.placeholder.value=q[0].value.set({day:1});return}const L=F5(C,k||e.nextPage.value),D=Wr({dateObj:L,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=D;const T={};if(!k){const I=D[0].value.compare(C);I>=_r(C)&&(T.day=1),I>=365&&(T.month=1)}e.placeholder.value=D[0].value.set({...T})},v=k=>{const C=n.value[0].value;if(!k&&!e.prevPage.value){const I=C.subtract({months:e.pagedNavigation.value?e.numberOfMonths.value:1}),q=Wr({dateObj:I,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=q,e.placeholder.value=q[0].value.set({day:1});return}const L=V5(C,k||e.prevPage.value),D=Wr({dateObj:L,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value});n.value=D;const T={};if(!k){const I=C.compare(D[0].value);I>=_r(C)&&(T.day=1),I>=365&&(T.month=1)}e.placeholder.value=D[0].value.set({...T})};Be(e.placeholder,k=>{r.value.some(C=>gv(C,k))||(n.value=Wr({dateObj:k,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value}))}),Be([e.locale,e.weekStartsOn,e.fixedWeeks,e.numberOfMonths],()=>{n.value=Wr({dateObj:e.placeholder.value,weekStartsOn:e.weekStartsOn.value,locale:e.locale.value,fixedWeeks:e.fixedWeeks.value,numberOfMonths:e.numberOfMonths.value})});const m=_(()=>{if(!n.value.length)return"";if(e.locale.value!==t.getLocale()&&t.setLocale(e.locale.value),n.value.length===1){const H=n.value[0].value;return`${t.fullMonthAndYear(Ma(H),a.value)}`}const k=Ma(n.value[0].value),C=Ma(n.value.at(-1).value),L=t.fullMonth(k,a.value),D=t.fullMonth(C,a.value),T=t.fullYear(k,a.value),I=t.fullYear(C,a.value);return T===I?`${L} - ${D} ${I}`:`${L} ${T} - ${D} ${I}`}),y=_(()=>`${e.calendarLabel.value??"Event Date"}, ${m.value}`),x=_(()=>!(u(e.placeholder.value)||d(e.placeholder.value)||l(e.placeholder.value))),S=_(()=>{for(const k of n.value){if(e.minValue.value&&yr(k.value,e.minValue.value))continue;const C=_r(k.value),L=e.minValue.value&&qf(e.minValue.value,k.value)?e.minValue.value.day:1;for(let D=L;D<=C;D++){const T=k.value.set({day:D});if(!(u(T)||d(T)))return T}}});return{isDateDisabled:u,isDateUnavailable:d,isNextButtonDisabled:o,isPrevButtonDisabled:i,grid:n,weekdays:c,visibleView:r,isOutsideVisibleView:l,formatter:t,nextPage:f,prevPage:v,headingValue:m,fullCalendarLabel:y,isPlaceholderFocusable:x,firstFocusableDate:S}}const j5={style:{border:"0px",clip:"rect(0px, 0px, 0px, 0px)","clip-path":"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute","white-space":"nowrap",width:"1px"}},U5={role:"heading","aria-level":"2"},[co,H5]=Dt("CalendarRoot");var K5=ne({__name:"CalendarRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},preventDeselect:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:"narrow"},calendarLabel:{type:String,required:!1},fixedWeeks:{type:Boolean,required:!1,default:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},numberOfMonths:{type:Number,required:!1,default:1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},initialFocus:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},isDateUnavailable:{type:Function,required:!1,default:void 0},dir:{type:String,required:!1},nextPage:{type:Function,required:!1},prevPage:{type:Function,required:!1},modelValue:{type:null,required:!1},multiple:{type:Boolean,required:!1,default:!1},disableDaysOutsideCurrentView:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},emits:["update:modelValue","update:placeholder"],setup(e,{emit:t}){const a=e,n=t,{disabled:r,readonly:l,initialFocus:o,pagedNavigation:i,weekdayFormat:u,fixedWeeks:d,multiple:c,minValue:f,maxValue:v,numberOfMonths:m,preventDeselect:y,isDateDisabled:x,isDateUnavailable:S,calendarLabel:k,defaultValue:C,nextPage:L,prevPage:D,dir:T,locale:I,disableDaysOutsideCurrentView:q}=Kt(a),{primitiveElement:H,currentElement:E}=sl(),P=Ru(I),j=xn(T),O=_(()=>a.weekStartsOn??f1(P.value)),N=Nt(a,"modelValue",n,{defaultValue:C.value,passive:a.modelValue===void 0}),Z=Wf({defaultPlaceholder:a.placeholder,defaultValue:N.value,locale:a.locale}),W=Nt(a,"placeholder",n,{defaultValue:a.defaultPlaceholder??Z.copy(),passive:a.placeholder===void 0});function K(X){W.value=X.copy()}const{fullCalendarLabel:te,headingValue:oe,isDateDisabled:ye,isDateUnavailable:be,isNextButtonDisabled:ge,isPrevButtonDisabled:le,weekdays:ce,isOutsideVisibleView:F,nextPage:fe,prevPage:ve,formatter:J,grid:he,isPlaceholderFocusable:G,firstFocusableDate:ee}=z5({locale:P,placeholder:W,weekStartsOn:O,fixedWeeks:d,numberOfMonths:m,minValue:f,maxValue:v,disabled:r,weekdayFormat:u,pagedNavigation:i,isDateDisabled:x.value,isDateUnavailable:S.value,calendarLabel:k,nextPage:L,prevPage:D}),{isInvalid:ae,isDateSelected:$,hasSelectedDate:M,isSelectedDateDisabled:z}=L5({date:N,isDateDisabled:ye,isDateUnavailable:be});Be(N,X=>{if(Array.isArray(X)&&X.length){const se=X.at(-1);se&&!Kl(W.value,se)&&K(se)}else!Array.isArray(X)&&X&&!Kl(W.value,X)&&K(X)});function de(X){if(c.value){if(!N.value)N.value=[X.copy()];else if(Array.isArray(N.value)){if(N.value.findIndex(xe=>$r(xe,X))===-1)N.value=[...N.value,X];else if(!y.value){const xe=N.value.filter($e=>!$r($e,X));if(!xe.length){W.value=X.copy(),N.value=void 0;return}N.value=xe.map($e=>$e.copy())}}}else{if(!N.value){N.value=X.copy();return}!y.value&&Kl(N.value,X)?(W.value=X.copy(),N.value=void 0):N.value=X.copy()}}return $t(()=>{o.value&&c1(E.value)}),H5({isDateUnavailable:be,dir:j,isDateDisabled:ye,locale:P,formatter:J,modelValue:N,placeholder:W,disabled:r,initialFocus:o,pagedNavigation:i,grid:he,weekDays:ce,weekStartsOn:O,weekdayFormat:u,fixedWeeks:d,multiple:c,numberOfMonths:m,readonly:l,preventDeselect:y,fullCalendarLabel:te,headingValue:oe,isInvalid:ae,isDateSelected:$,isNextButtonDisabled:ge,isPrevButtonDisabled:le,isOutsideVisibleView:F,nextPage:fe,prevPage:ve,parentElement:E,onPlaceholderChange:K,onDateChange:de,disableDaysOutsideCurrentView:q,minValue:f,maxValue:v,isPlaceholderFocusable:G,firstFocusableDate:ee,hasSelectedDate:M,isSelectedDateDisabled:z}),(X,se)=>(p(),U(s(nt),{ref_key:"primitiveElement",ref:H,as:X.as,"as-child":X.asChild,"aria-label":s(te),"data-readonly":s(l)?"":void 0,"data-disabled":s(r)?"":void 0,"data-invalid":s(ae)?"":void 0,dir:s(j)},{default:B(()=>[Se(X.$slots,"default",{date:s(W),grid:s(he),weekDays:s(ce),weekStartsOn:O.value,locale:s(P),fixedWeeks:s(d),modelValue:s(N)}),g("div",j5,[g("div",U5,w(s(te)),1)])]),_:3},8,["as","as-child","aria-label","data-readonly","data-disabled","data-invalid","dir"]))}}),W5=K5,G5=ne({__name:"CalendarCell",props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"td"}},setup(e){const t=co();return(a,n)=>(p(),U(s(nt),{as:a.as,"as-child":a.asChild,role:"gridcell","aria-selected":s(t).isDateSelected(a.date)?!0:void 0,"aria-disabled":s(t).isDateDisabled(a.date)||s(t).isDateUnavailable?.(a.date)||s(t).disableDaysOutsideCurrentView.value,"data-disabled":s(t).isDateDisabled(a.date)||s(t).disableDaysOutsideCurrentView.value?"":void 0},{default:B(()=>[Se(a.$slots,"default")]),_:3},8,["as","as-child","aria-selected","aria-disabled","data-disabled"]))}}),Y5=G5,J5=ne({__name:"CalendarCellTrigger",props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,a=io(),n=co(),{primitiveElement:r}=sl(),l=_(()=>t.day.day.toLocaleString(n.locale.value)),o=_(()=>n.formatter.custom(Ma(t.day),{weekday:"long",month:"long",day:"numeric",year:"numeric"})),i=_(()=>n.isDateUnavailable?.(t.day)??!1),u=_(()=>YE(t.day,Ja())),d=_(()=>!qf(t.day,t.month)),c=_(()=>n.isOutsideVisibleView(t.day)),f=_(()=>n.isDateDisabled(t.day)||n.disableDaysOutsideCurrentView.value&&d.value),v=_(()=>d.value||f.value?!1:!n.disabled.value&&n.isPlaceholderFocusable.value&&$r(t.day,n.placeholder.value)?!0:(!n.hasSelectedDate.value||n.isSelectedDateDisabled.value)&&!n.isPlaceholderFocusable.value?n.firstFocusableDate.value&&$r(t.day,n.firstFocusableDate.value):!1),m=_(()=>n.isDateSelected(t.day));function y(k){n.readonly.value||n.isDateDisabled(k)||n.isDateUnavailable?.(k)||n.onDateChange(k)}function x(){f.value||y(t.day)}function S(k){if(f.value)return;k.preventDefault(),k.stopPropagation();const C=n.parentElement.value,L=7,D=n.dir.value==="rtl"?-1:1;switch(k.code){case a.ARROW_RIGHT:T(t.day,D);break;case a.ARROW_LEFT:T(t.day,-D);break;case a.ARROW_UP:T(t.day,-L);break;case a.ARROW_DOWN:T(t.day,L);break;case a.ENTER:case a.SPACE_CODE:y(t.day)}function T(I,q){const H=I.add({days:q});if(n.minValue.value&&H.compare(n.minValue.value)<0||n.maxValue.value&&H.compare(n.maxValue.value)>0)return;const E=C.querySelector(`[data-value='${H.toString()}']:not([data-outside-view])`);if(!E){if(q>0){if(n.isNextButtonDisabled())return;n.nextPage()}else{if(n.isPrevButtonDisabled())return;n.prevPage()}Ue(()=>{T(I,q)});return}if(E&&E.hasAttribute("data-disabled"))return T(H,q);n.onPlaceholderChange(H),E?.focus()}}return(k,C)=>(p(),U(s(nt),{ref_key:"primitiveElement",ref:r,as:t.as,"as-child":t.asChild,role:"button","aria-label":o.value,"data-reka-calendar-cell-trigger":"","aria-disabled":f.value||i.value?!0:void 0,"data-selected":m.value?!0:void 0,"data-value":k.day.toString(),"data-disabled":f.value?"":void 0,"data-unavailable":i.value?"":void 0,"data-today":u.value?"":void 0,"data-outside-view":d.value?"":void 0,"data-outside-visible-view":c.value?"":void 0,"data-focused":v.value?"":void 0,tabindex:v.value?0:d.value||f.value?void 0:-1,onClick:x,onKeydown:[mn(S,["up","down","left","right","space","enter"]),C[0]||(C[0]=mn(yt(()=>{},["prevent"]),["enter"]))]},{default:B(()=>[Se(k.$slots,"default",{dayValue:l.value,disabled:f.value,today:u.value,selected:m.value,outsideView:d.value,outsideVisibleView:c.value,unavailable:i.value},()=>[_e(w(l.value),1)])]),_:3},8,["as","as-child","aria-label","aria-disabled","data-selected","data-value","data-disabled","data-unavailable","data-today","data-outside-view","data-outside-visible-view","data-focused","tabindex"]))}}),Z5=J5,X5=ne({__name:"CalendarGrid",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"table"}},setup(e){const t=e,a=co(),n=_(()=>a.disabled.value?!0:void 0),r=_(()=>a.readonly.value?!0:void 0);return(l,o)=>(p(),U(s(nt),He(t,{tabindex:"-1",role:"application","aria-readonly":r.value,"aria-disabled":n.value,"data-readonly":r.value&&"","data-disabled":n.value&&""}),{default:B(()=>[Se(l.$slots,"default")]),_:3},16,["aria-readonly","aria-disabled","data-readonly","data-disabled"]))}}),Q5=X5,eO=ne({__name:"CalendarGridBody",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"tbody"}},setup(e){const t=e;return(a,n)=>(p(),U(s(nt),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),tO=eO,aO=ne({__name:"CalendarGridHead",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"thead"}},setup(e){const t=e;return(a,n)=>(p(),U(s(nt),He(t,{"aria-hidden":"true"}),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),nO=aO,rO=ne({__name:"CalendarGridRow",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"tr"}},setup(e){const t=e;return(a,n)=>(p(),U(s(nt),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),lO=rO,oO=ne({__name:"CalendarHeadCell",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"th"}},setup(e){const t=e;return(a,n)=>(p(),U(s(nt),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),sO=oO,iO=ne({__name:"CalendarHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e;return(a,n)=>(p(),U(s(nt),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),uO=iO,cO=ne({__name:"CalendarHeading",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,a=co();return(n,r)=>(p(),U(s(nt),He(t,{"data-disabled":s(a).disabled.value?"":void 0}),{default:B(()=>[Se(n.$slots,"default",{headingValue:s(a).headingValue.value},()=>[_e(w(s(a).headingValue.value),1)])]),_:3},16,["data-disabled"]))}}),dO=cO,fO=ne({__name:"CalendarNext",props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=_(()=>n.disabled.value||n.isNextButtonDisabled(t.nextPage)),n=co();function r(){a.value||n.nextPage(t.nextPage)}return(l,o)=>(p(),U(s(nt),{as:t.as,"as-child":t.asChild,"aria-label":"Next page",type:t.as==="button"?"button":void 0,"aria-disabled":a.value||void 0,"data-disabled":a.value||void 0,disabled:a.value,onClick:r},{default:B(()=>[Se(l.$slots,"default",{disabled:a.value},()=>[o[0]||(o[0]=_e(" Next page "))])]),_:3},8,["as","as-child","type","aria-disabled","data-disabled","disabled"]))}}),pO=fO,mO=ne({__name:"CalendarPrev",props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=_(()=>n.disabled.value||n.isPrevButtonDisabled(t.prevPage)),n=co();function r(){a.value||n.prevPage(t.prevPage)}return(l,o)=>(p(),U(s(nt),{"aria-label":"Previous page",as:t.as,"as-child":t.asChild,type:t.as==="button"?"button":void 0,"aria-disabled":a.value||void 0,"data-disabled":a.value||void 0,disabled:a.value,onClick:r},{default:B(()=>[Se(l.$slots,"default",{disabled:a.value},()=>[o[0]||(o[0]=_e(" Prev page "))])]),_:3},8,["as","as-child","type","aria-disabled","data-disabled","disabled"]))}}),vO=mO;const[hO,yO]=Dt("RovingFocusGroup");var gO=ne({__name:"RovingFocusGroup",props:{orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!1},currentTabStopId:{type:[String,null],required:!1},defaultCurrentTabStopId:{type:String,required:!1},preventScrollOnEntryFocus:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["entryFocus","update:currentTabStopId"],setup(e,{expose:t,emit:a}){const n=e,r=a,{loop:l,orientation:o,dir:i}=Kt(n),u=xn(i),d=Nt(n,"currentTabStopId",r,{defaultValue:n.defaultCurrentTabStopId,passive:n.currentTabStopId===void 0}),c=A(!1),f=A(!1),v=A(0),{getItems:m,CollectionSlot:y}=Qf({isProvider:!0});function x(k){const C=!f.value;if(k.currentTarget&&k.target===k.currentTarget&&C&&!c.value){const L=new CustomEvent(aT,nT);if(k.currentTarget.dispatchEvent(L),r("entryFocus",L),!L.defaultPrevented){const D=m().map(E=>E.ref).filter(E=>E.dataset.disabled!==""),T=D.find(E=>E.getAttribute("data-active")===""),I=D.find(E=>E.getAttribute("data-highlighted")===""),q=D.find(E=>E.id===d.value),H=[T,I,q,...D].filter(Boolean);k1(H,n.preventScrollOnEntryFocus)}}f.value=!1}function S(){setTimeout(()=>{f.value=!1},1)}return t({getItems:m}),yO({loop:l,dir:u,orientation:o,currentTabStopId:d,onItemFocus:k=>{d.value=k},onItemShiftTab:()=>{c.value=!0},onFocusableItemAdd:()=>{v.value++},onFocusableItemRemove:()=>{v.value--}}),(k,C)=>(p(),U(s(y),null,{default:B(()=>[R(s(nt),{tabindex:c.value||v.value===0?-1:0,"data-orientation":s(o),as:k.as,"as-child":k.asChild,dir:s(u),style:{outline:"none"},onMousedown:C[0]||(C[0]=L=>f.value=!0),onMouseup:S,onFocus:x,onBlur:C[1]||(C[1]=L=>c.value=!1)},{default:B(()=>[Se(k.$slots,"default")]),_:3},8,["tabindex","data-orientation","as","as-child","dir"])]),_:3}))}}),Vu=gO,bO=ne({__name:"RovingFocusItem",props:{tabStopId:{type:String,required:!1},focusable:{type:Boolean,required:!1,default:!0},active:{type:Boolean,required:!1},allowShiftKey:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=e,a=hO(),n=Un(),r=_(()=>t.tabStopId||n),l=_(()=>a.currentTabStopId.value===r.value),{getItems:o,CollectionItem:i}=Qf();$t(()=>{t.focusable&&a.onFocusableItemAdd()}),Wn(()=>{t.focusable&&a.onFocusableItemRemove()});function u(d){if(d.key==="Tab"&&d.shiftKey){a.onItemShiftTab();return}if(d.target!==d.currentTarget)return;const c=oT(d,a.orientation.value,a.dir.value);if(c!==void 0){if(d.metaKey||d.ctrlKey||d.altKey||!t.allowShiftKey&&d.shiftKey)return;d.preventDefault();let f=[...o().map(v=>v.ref).filter(v=>v.dataset.disabled!=="")];if(c==="last")f.reverse();else if(c==="prev"||c==="next"){c==="prev"&&f.reverse();const v=f.indexOf(d.currentTarget);f=a.loop.value?sT(f,v+1):f.slice(v+1)}Ue(()=>k1(f))}}return(d,c)=>(p(),U(s(i),null,{default:B(()=>[R(s(nt),{tabindex:l.value?0:-1,"data-orientation":s(a).orientation.value,"data-active":d.active?"":void 0,"data-disabled":d.focusable?void 0:"",as:d.as,"as-child":d.asChild,onMousedown:c[0]||(c[0]=f=>{d.focusable?s(a).onItemFocus(r.value):f.preventDefault()}),onFocus:c[1]||(c[1]=f=>s(a).onItemFocus(r.value)),onKeydown:u},{default:B(()=>[Se(d.$slots,"default")]),_:3},8,["tabindex","data-orientation","data-active","data-disabled","as","as-child"])]),_:3}))}}),zu=bO;const[_O]=Dt("CheckboxGroupRoot");function fp(e){return e==="indeterminate"}function V1(e){return fp(e)?"indeterminate":e?"checked":"unchecked"}const[xO,kO]=Dt("CheckboxRoot");var wO=ne({inheritAttrs:!1,__name:"CheckboxRoot",props:{defaultValue:{type:null,required:!1},modelValue:{type:null,required:!1,default:void 0},disabled:{type:Boolean,required:!1},value:{type:null,required:!1,default:"on"},id:{type:String,required:!1},trueValue:{type:null,required:!1,default:()=>!0},falseValue:{type:null,required:!1,default:()=>!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:r,currentElement:l}=et(),o=_O(null),i=Nt(a,"modelValue",n,{defaultValue:a.defaultValue??a.falseValue,passive:a.modelValue===void 0}),u=_(()=>o?.disabled.value||a.disabled),d=_(()=>fs(i.value,a.trueValue)),c=_(()=>$a(o?.modelValue.value)?i.value==="indeterminate"?"indeterminate":d.value:vv(o.modelValue.value,a.value));function f(){if($a(o?.modelValue.value))i.value==="indeterminate"?i.value=a.trueValue:i.value=d.value?a.falseValue:a.trueValue;else{const y=[...o.modelValue.value||[]];if(vv(y,a.value)){const x=y.findIndex(S=>fs(S,a.value));y.splice(x,1)}else y.push(a.value);o.modelValue.value=y}}const v=Yf(l),m=_(()=>a.id&&l.value?document.querySelector(`[for="${a.id}"]`)?.innerText:void 0);return kO({disabled:u,state:c}),(y,x)=>(p(),U(Wt(s(o)?.rovingFocus.value?s(zu):s(nt)),He(y.$attrs,{id:y.id,ref:s(r),role:"checkbox","as-child":y.asChild,as:y.as,type:y.as==="button"?"button":void 0,"aria-checked":s(fp)(c.value)?"mixed":c.value,"aria-required":y.required,"aria-label":y.$attrs["aria-label"]||m.value,"data-state":s(V1)(c.value),"data-disabled":u.value?"":void 0,disabled:u.value,focusable:s(o)?.rovingFocus.value?!u.value:void 0,onKeydown:mn(yt(()=>{},["prevent"]),["enter"]),onClick:f}),{default:B(()=>[Se(y.$slots,"default",{modelValue:s(i),state:c.value}),s(v)&&y.name&&!s(o)?(p(),U(s(tp),{key:0,type:"checkbox",checked:!!c.value,name:y.name,value:y.value,disabled:u.value,required:y.required},null,8,["checked","name","value","disabled","required"])):Y("v-if",!0)]),_:3},16,["id","as-child","as","type","aria-checked","aria-required","aria-label","data-state","data-disabled","disabled","focusable","onKeydown"]))}}),$O=wO,SO=ne({__name:"CheckboxIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const{forwardRef:t}=et(),a=xO();return(n,r)=>(p(),U(s(vl),{present:n.forceMount||s(fp)(s(a).state.value)||s(a).state.value===!0},{default:B(()=>[R(s(nt),He({ref:s(t),"data-state":s(V1)(s(a).state.value),"data-disabled":s(a).disabled.value?"":void 0,style:{pointerEvents:"none"},"as-child":n.asChild,as:n.as},n.$attrs),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["data-state","data-disabled","as-child","as"])]),_:3},8,["present"]))}}),CO=SO,EO=ne({__name:"MenuAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(ap),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),AO=EO;function TO(){const e=A(!1);return $t(()=>{ao("keydown",()=>{e.value=!0},{capture:!0,passive:!0}),ao(["pointerdown","pointermove"],()=>{e.value=!1},{capture:!0,passive:!0})}),e}const OO=Mb(TO),[ju,DO]=Dt(["MenuRoot","MenuSub"],"MenuContext"),[pp,MO]=Dt("MenuRoot");var PO=ne({__name:"MenuRoot",props:{open:{type:Boolean,required:!1,default:!1},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const a=e,n=t,{modal:r,dir:l}=Kt(a),o=xn(l),i=Nt(a,"open",n),u=A(),d=OO();return DO({open:i,onOpenChange:c=>{i.value=c},content:u,onContentChange:c=>{u.value=c}}),MO({onClose:()=>{i.value=!1},isUsingKeyboardRef:d,dir:o,modal:r}),(c,f)=>(p(),U(s($1),null,{default:B(()=>[Se(c.$slots,"default")]),_:3}))}}),RO=PO;const[z1,IO]=Dt("MenuContent");var qO=ne({__name:"MenuContentImpl",props:tg({loop:{type:Boolean,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1},disableOutsideScroll:{type:Boolean,required:!1},trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...I1}),emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus","dismiss"],setup(e,{emit:t}){const a=e,n=t,r=ju(),l=pp(),{trapFocus:o,disableOutsidePointerEvents:i,loop:u}=Kt(a);p1(),If(i.value);const d=A(""),c=A(0),f=A(0),v=A(null),m=A("right"),y=A(0),x=A(null),S=A(),{forwardRef:k,currentElement:C}=et(),{handleTypeaheadSearch:L}=XA(),D=A();function T(W){const K=yv(W,D.value||Yt(),C.value,{loop:u.value,arrowKeyOptions:"vertical",dir:l?.dir.value,focus:!1,attributeName:"[data-reka-collection-item]:not([data-disabled])"});K&&(D.value=K,K.scrollIntoView({block:"nearest"}))}function I(){D.value&&D.value.click()}const q=A(),H=A();Be(D,W=>{H.value&&(W===void 0||W!==H.value.trigger.value)&&(H.value.onOpenChange(!1),H.value=void 0)}),Be(C,W=>{r.onContentChange(W)}),Wn(()=>{window.clearTimeout(c.value)});function E(W){return m.value===v.value?.side&&w4(W,v.value?.area)}async function P(W){n("openAutoFocus",W),!W.defaultPrevented&&(W.preventDefault(),C.value?.focus({preventScroll:!0}))}function j(W){if(W.defaultPrevented)return;const K=W.target,te=K.closest("[data-reka-menu-content]")===W.currentTarget,oe=["input","textarea"].includes(K.tagName.toLowerCase()),ye=W.ctrlKey||W.altKey||W.metaKey,be=W.key.length===1,ge=yv(W,Yt(),C.value,{loop:u.value,arrowKeyOptions:"vertical",dir:l?.dir.value,focus:!0,attributeName:"[data-reka-collection-item]:not([data-disabled])"});if(ge)return ge?.focus();if(W.code==="Space")return;const le=S.value?.getItems()??[];if(te&&(W.key==="Tab"&&W.preventDefault(),!ye&&be&&!oe&&L(W.key,le)),W.target!==C.value||!_4.includes(W.key))return;W.preventDefault();const ce=[...le.map(F=>F.ref)];y1.includes(W.key)&&ce.reverse(),x4(ce)}function O(W){W?.currentTarget?.contains?.(W.target)||(window.clearTimeout(c.value),d.value="")}function N(W){if(!Yi(W))return;const K=W.target,te=y.value!==W.clientX;if(W?.currentTarget?.contains(K)&&te){const oe=W.clientX>y.value?"right":"left";m.value=oe,y.value=W.clientX}}function Z(W){Yi(W)&&q.value&&q.value.focus()}return IO({onItemEnter:W=>!!E(W),onItemLeave:W=>E(W)?!0:(["INPUT","TEXTAREA"].includes(Yt()?.tagName||"")||C.value?.focus(),x.value=null,!1),onTriggerLeave:W=>!!E(W),searchRef:d,highlightedElement:D,onKeydownNavigation:T,onKeydownEnter:I,filterElement:q,onFilterElementChange:W=>{q.value=W},activeSubmenuContext:H,pointerGraceTimerRef:f,onPointerGraceIntentChange:W=>{v.value=W}}),(W,K)=>(p(),U(s(Xf),{"as-child":"",trapped:s(o),onMountAutoFocus:P,onUnmountAutoFocus:K[7]||(K[7]=te=>n("closeAutoFocus",te))},{default:B(()=>[R(s(Zf),{"as-child":"","disable-outside-pointer-events":s(i),onEscapeKeyDown:K[2]||(K[2]=te=>n("escapeKeyDown",te)),onPointerDownOutside:K[3]||(K[3]=te=>n("pointerDownOutside",te)),onFocusOutside:K[4]||(K[4]=te=>n("focusOutside",te)),onInteractOutside:K[5]||(K[5]=te=>n("interactOutside",te)),onDismiss:K[6]||(K[6]=te=>n("dismiss"))},{default:B(()=>[R(s(Vu),{ref_key:"rovingFocusGroupRef",ref:S,"current-tab-stop-id":x.value,"onUpdate:currentTabStopId":K[0]||(K[0]=te=>x.value=te),"as-child":"",orientation:"vertical",dir:s(l).dir.value,loop:s(u),onEntryFocus:K[1]||(K[1]=te=>{n("entryFocus",te),s(l).isUsingKeyboardRef.value||te.preventDefault()})},{default:B(()=>[R(s(q1),{ref:s(k),role:"menu",as:W.as,"as-child":W.asChild,"aria-orientation":"vertical","data-reka-menu-content":"","data-state":s(g1)(s(r).open.value),dir:s(l).dir.value,side:W.side,"side-offset":W.sideOffset,align:W.align,"align-offset":W.alignOffset,"avoid-collisions":W.avoidCollisions,"collision-boundary":W.collisionBoundary,"collision-padding":W.collisionPadding,"arrow-padding":W.arrowPadding,"prioritize-position":W.prioritizePosition,"position-strategy":W.positionStrategy,"update-position-strategy":W.updatePositionStrategy,sticky:W.sticky,"hide-when-detached":W.hideWhenDetached,reference:W.reference,onKeydown:j,onBlur:O,onPointermove:N,onPointerenter:Z},{default:B(()=>[Se(W.$slots,"default")]),_:3},8,["as","as-child","data-state","dir","side","side-offset","align","align-offset","avoid-collisions","collision-boundary","collision-padding","arrow-padding","prioritize-position","position-strategy","update-position-strategy","sticky","hide-when-detached","reference"])]),_:3},8,["current-tab-stop-id","dir","loop"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),j1=qO,LO=ne({inheritAttrs:!1,__name:"MenuItemImpl",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=z1(),{forwardRef:n,currentElement:r}=et(),{CollectionItem:l}=Qf(),o=A(!1),i=_(()=>o.value||r.value!=null&&a.highlightedElement.value===r.value);async function u(c){if(!(c.defaultPrevented||!Yi(c))){if(t.disabled)a.onItemLeave(c);else if(!a.onItemEnter(c)){const v=c.currentTarget;a.highlightedElement.value=v,["INPUT","TEXTAREA"].includes(Yt()?.tagName||"")||v.focus({preventScroll:!0})}}}async function d(c){if(await Ue(),c.defaultPrevented||!Yi(c)||a.highlightedElement.value!==r.value)return;!a.onItemLeave(c)&&a.highlightedElement.value===r.value&&(a.highlightedElement.value=void 0)}return(c,f)=>(p(),U(s(l),{value:{textValue:c.textValue}},{default:B(()=>[R(s(nt),He({ref:s(n),role:"menuitem",tabindex:"-1"},c.$attrs,{as:c.as,"as-child":c.asChild,"aria-disabled":c.disabled||void 0,"data-disabled":c.disabled?"":void 0,"data-highlighted":i.value?"":void 0,onPointermove:u,onPointerleave:d,onFocus:f[0]||(f[0]=async v=>{await Ue(),!(v.defaultPrevented||c.disabled)&&(o.value=!0,s(a).highlightedElement.value=v.currentTarget)}),onBlur:f[1]||(f[1]=async v=>{await Ue(),!v.defaultPrevented&&(o.value=!1)})}),{default:B(()=>[Se(c.$slots,"default")]),_:3},16,["as","as-child","aria-disabled","data-disabled","data-highlighted"])]),_:3},8,["value"]))}}),NO=LO,BO=ne({__name:"MenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:r,currentElement:l}=et(),o=pp(),i=z1(),u=A(!1);async function d(){const c=l.value;if(!a.disabled&&c){const f=new CustomEvent(g4,{bubbles:!0,cancelable:!0});n("select",f),await Ue(),f.defaultPrevented?u.value=!1:o.onClose()}}return(c,f)=>(p(),U(NO,He(a,{ref:s(r),onClick:d,onPointerdown:f[0]||(f[0]=()=>{u.value=!0}),onPointerup:f[1]||(f[1]=async v=>{await Ue(),!v.defaultPrevented&&(u.value||v.currentTarget?.click())}),onKeydown:f[2]||(f[2]=async v=>{const m=s(i).searchRef.value!=="";c.disabled||m&&v.key===" "||s(Ld).includes(v.key)&&(v.currentTarget?.click(),v.preventDefault())})}),{default:B(()=>[Se(c.$slots,"default")]),_:3},16))}}),U1=BO;const[FO,VO]=Dt(["MenuCheckboxItem","MenuRadioItem"],"MenuItemIndicatorContext");var zO=ne({__name:"MenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"span"}},setup(e){const t=FO({modelValue:A(!1)});return(a,n)=>(p(),U(s(vl),{present:a.forceMount||s(b1)(s(t).modelValue.value)||s(t).modelValue.value===!0},{default:B(()=>[R(s(nt),{as:a.as,"as-child":a.asChild,"data-state":s(_1)(s(t).modelValue.value)},{default:B(()=>[Se(a.$slots,"default")]),_:3},8,["as","as-child","data-state"])]),_:3},8,["present"]))}}),jO=zO,UO=ne({__name:"MenuRootContentModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=kn(a,n),l=ju(),{forwardRef:o,currentElement:i}=et();return Jf(i),(u,d)=>(p(),U(j1,He(s(r),{ref:s(o),"trap-focus":s(l).open.value,"disable-outside-pointer-events":s(l).open.value,"disable-outside-scroll":!0,onDismiss:d[0]||(d[0]=c=>s(l).onOpenChange(!1)),onFocusOutside:d[1]||(d[1]=yt(c=>n("focusOutside",c),["prevent"]))}),{default:B(()=>[Se(u.$slots,"default")]),_:3},16,["trap-focus","disable-outside-pointer-events"]))}}),HO=UO,KO=ne({__name:"MenuRootContentNonModal",props:{loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const r=kn(e,t),l=ju();return(o,i)=>(p(),U(j1,He(s(r),{"trap-focus":!1,"disable-outside-pointer-events":!1,"disable-outside-scroll":!1,onDismiss:i[0]||(i[0]=u=>s(l).onOpenChange(!1))}),{default:B(()=>[Se(o.$slots,"default")]),_:3},16))}}),WO=KO,GO=ne({__name:"MenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","entryFocus","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const r=kn(e,t),l=ju(),o=pp();return(i,u)=>(p(),U(s(vl),{present:i.forceMount||s(l).open.value},{default:B(()=>[s(o).modal.value?(p(),U(HO,it(He({key:0},{...i.$attrs,...s(r)})),{default:B(()=>[Se(i.$slots,"default")]),_:3},16)):(p(),U(WO,it(He({key:1},{...i.$attrs,...s(r)})),{default:B(()=>[Se(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),YO=GO;const[JO,ZO]=Dt("MenuGroup");var XO=ne({__name:"MenuGroup",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=Un(void 0,"reka-menu-group");return ZO({id:a}),(n,r)=>(p(),U(s(nt),He({role:"group"},t,{"aria-labelledby":s(a)}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["aria-labelledby"]))}}),QO=XO,e8=ne({__name:"MenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"div"}},setup(e){const t=e,a=JO({id:""});return(n,r)=>(p(),U(s(nt),He(t,{id:s(a).id||void 0}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["id"]))}}),t8=e8,a8=ne({__name:"MenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Iu),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),n8=a8;const[r8,l8]=Dt("MenuRadioGroup");var o8=ne({__name:"MenuRadioGroup",props:{modelValue:{type:null,required:!1,default:""},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=Mf(a,["modelValue"]),l=Pu(r),o=Nt(a,"modelValue",n);return l8({modelValue:o,onValueChange:i=>{o.value=i}}),(i,u)=>(p(),U(QO,it(dt(s(l))),{default:B(()=>[Se(i.$slots,"default",{modelValue:s(o)})]),_:3},16))}}),s8=o8,i8=ne({__name:"MenuRadioItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,n=t,r=Mf(a,["value"]),l=Pu(r),{value:o}=Kt(a),i=r8(),u=_(()=>i.modelValue.value===o?.value);return VO({modelValue:u}),(d,c)=>(p(),U(U1,He({role:"menuitemradio"},s(l),{"aria-checked":u.value,"data-state":s(_1)(u.value),onSelect:c[0]||(c[0]=async f=>{n("select",f),s(i).onValueChange(s(o))})}),{default:B(()=>[Se(d.$slots,"default")]),_:3},16,["aria-checked","data-state"]))}}),u8=i8,c8=ne({__name:"MenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(nt),He(t,{role:"separator","aria-orientation":"horizontal"}),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),d8=c8;const[f8,p8]=Dt("DateFieldRoot");var m8=ne({inheritAttrs:!1,__name:"DateFieldRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},modelValue:{type:null,required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},isDateUnavailable:{type:Function,required:!1,default:void 0},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:a}){const n=e,r=a,{disabled:l,readonly:o,isDateUnavailable:i,granularity:u,defaultValue:d,dir:c,locale:f}=Kt(n),v=Ru(f),m=xn(c),y=Gf(v.value,{hourCycle:vs(n.hourCycle)}),{primitiveElement:x,currentElement:S}=sl(),k=A(new Set);$t(()=>{rh(S.value).forEach(F=>k.value.add(F))});const C=Nt(n,"modelValue",r,{defaultValue:d.value,passive:n.modelValue===void 0}),L=Wf({defaultPlaceholder:n.placeholder,granularity:u.value,defaultValue:C.value,locale:n.locale}),D=Nt(n,"placeholder",r,{defaultValue:n.defaultPlaceholder??L.copy(),passive:n.placeholder===void 0}),T=_(()=>u1(n)),I=_(()=>n.granularity?Id(D.value)?n.granularity:"day":Id(D.value)?"minute":"day"),q=_(()=>C.value?!!(i.value?.(C.value)||n.minValue&&yr(C.value,n.minValue)||n.maxValue&&yr(n.maxValue,C.value)):!1),H=k5(I.value),E=A(C.value?{...nh({value:C.value,formatter:y})}:{...H}),P=_(()=>B1({granularity:I.value,dateRef:D.value,formatter:y,hideTimeZone:n.hideTimeZone,hourCycle:n.hourCycle,segmentValues:E.value,locale:v})),j=_(()=>P.value.arr),O=_(()=>j.value.filter(({part:F})=>F!=="literal"));Be(v,F=>{y.getLocale()!==F&&(y.setLocale(F),Ue(()=>{k.value.clear(),rh(S.value).forEach(fe=>k.value.add(fe))}))}),Be(C,F=>{!$a(F)&&D.value.compare(F)!==0&&(D.value=F.copy())}),Be([C,v],([F])=>{$a(F)?Object.values(E.value).every(fe=>fe!==null)&&$a(F)&&(E.value={...H}):E.value={...nh({value:F,formatter:y})}});const N=A(null),Z=_(()=>Array.from(k.value).findIndex(F=>F.getAttribute("data-reka-date-field-segment")===N.value?.getAttribute("data-reka-date-field-segment"))),W=_(()=>{const F=m.value==="rtl"?-1:1;return(F<0?Z.value<0:Z.value>k.value.size-1)?null:Array.from(k.value)[Z.value+F]}),K=_(()=>{const F=m.value==="rtl"?-1:1;return(F>0?Z.value<0:Z.value>k.value.size-1)?null:Array.from(k.value)[Z.value-F]}),te=_(()=>d1(I.value)),oe=_(()=>Tc(C.value,I.value)),ye=_(()=>n.maxValue?Tc(n.maxValue,I.value):void 0),be=_(()=>n.minValue?Tc(n.minValue,I.value):void 0),ge=io();function le(F){F.isComposing||En(F.key)&&(F.key===ge.ARROW_LEFT&&K.value?.focus(),F.key===ge.ARROW_RIGHT&&W.value?.focus())}function ce(F){N.value=F}return p8({isDateUnavailable:i.value,locale:v,modelValue:C,placeholder:D,disabled:l,formatter:y,hourCycle:n.hourCycle,step:T,readonly:o,segmentValues:E,isInvalid:q,segmentContents:O,elements:k,setFocusedElement:ce,focusNext(){W.value?.focus()}}),t({setFocusedElement:ce}),(F,fe)=>(p(),U(s(nt),He(F.$attrs,{ref_key:"primitiveElement",ref:x,role:"group","aria-disabled":s(l)?!0:void 0,"data-disabled":s(l)?"":void 0,"data-readonly":s(o)?"":void 0,"data-invalid":q.value?"":void 0,dir:s(m),onKeydown:mn(le,["left","right"])}),{default:B(()=>[Se(F.$slots,"default",{modelValue:s(C),segments:j.value,isInvalid:q.value}),R(s(ep),{id:F.id,as:"input",type:te.value,feature:"focusable",tabindex:"-1",value:oe.value,name:F.name,disabled:s(l),required:F.required,max:ye.value,min:be.value,onFocus:fe[0]||(fe[0]=ve=>Array.from(k.value)?.[0]?.focus())},null,8,["id","type","value","name","disabled","required","max","min"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),v8=m8,h8=ne({__name:"DateFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=f8(),n=A(!0),r=A(!1),{handleSegmentClick:l,handleSegmentKeydown:o,handleSegmentBeforeInput:i,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:d,attributes:c}=F1({hasLeftFocus:n,lastKeyZero:r,placeholder:a.placeholder,hourCycle:a.hourCycle,step:a.step,segmentValues:a.segmentValues,formatter:a.formatter,part:t.part,disabled:a.disabled,readonly:a.readonly,focusNext:a.focusNext,modelValue:a.modelValue}),f=_(()=>a.disabled.value),v=_(()=>a.readonly.value),m=_(()=>a.isInvalid.value);return(y,x)=>(p(),U(s(nt),He({as:y.as,"as-child":y.asChild},s(c),{contenteditable:f.value||v.value?!1:y.part!=="literal","data-reka-date-field-segment":y.part,"aria-disabled":f.value?!0:void 0,"aria-readonly":v.value?!0:void 0,"data-disabled":f.value?"":void 0,"data-invalid":m.value?"":void 0,"aria-invalid":m.value?!0:void 0},eg(y.part!=="literal"?{mousedown:s(l),keydown:s(o),beforeinput:s(i),compositionstart:s(u),compositionend:s(d),focusout:()=>{n.value=!0},focusin:S=>{s(a).setFocusedElement(S.target)}}:{})),{default:B(()=>[Se(y.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-date-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),y8=h8;const[fo,g8]=Dt("PopoverRoot");var b8=ne({__name:"PopoverRoot",props:{defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1}},emits:["update:open"],setup(e,{emit:t}){const a=e,n=t,{modal:r}=Kt(a),l=Nt(a,"open",n,{defaultValue:a.defaultOpen,passive:a.open===void 0});return g8({contentId:"",triggerId:"",modal:r,open:l,onOpenChange:u=>{l.value=u},onOpenToggle:()=>{l.value=!l.value},triggerElement:A(),hasCustomAnchor:A(!1)}),(u,d)=>(p(),U(s($1),null,{default:B(()=>[Se(u.$slots,"default",{open:s(l),close:()=>l.value=!1})]),_:3}))}}),H1=b8,_8=ne({__name:"PopoverAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;et();const a=fo();return Yy(()=>{a.hasCustomAnchor.value=!0}),Wn(()=>{a.hasCustomAnchor.value=!1}),(n,r)=>(p(),U(s(ap),it(dt(t)),{default:B(()=>[Se(n.$slots,"default")]),_:3},16))}}),x8=_8;const[mp,k8]=Dt("DatePickerRoot");var w8=ne({inheritAttrs:!1,__name:"DatePickerRoot",props:{defaultValue:{type:null,required:!1,default:void 0},defaultPlaceholder:{type:null,required:!1},placeholder:{type:null,required:!1,default:void 0},modelValue:{type:null,required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:null,required:!1},minValue:{type:null,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},isDateUnavailable:{type:Function,required:!1,default:void 0},id:{type:String,required:!1},dir:{type:String,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1},defaultOpen:{type:Boolean,required:!1,default:!1},open:{type:Boolean,required:!1,default:void 0},modal:{type:Boolean,required:!1,default:!1},isDateDisabled:{type:Function,required:!1,default:void 0},pagedNavigation:{type:Boolean,required:!1,default:!1},weekStartsOn:{type:Number,required:!1},weekdayFormat:{type:String,required:!1,default:"narrow"},fixedWeeks:{type:Boolean,required:!1,default:!1},numberOfMonths:{type:Number,required:!1,default:1},preventDeselect:{type:Boolean,required:!1,default:!1},closeOnSelect:{type:Boolean,required:!1,default:!1}},emits:["update:open","update:modelValue","update:placeholder"],setup(e,{emit:t}){const a=e,n=t,{locale:r,disabled:l,readonly:o,pagedNavigation:i,weekdayFormat:u,fixedWeeks:d,numberOfMonths:c,preventDeselect:f,isDateDisabled:v,isDateUnavailable:m,defaultOpen:y,modal:x,id:S,name:k,required:C,minValue:L,maxValue:D,granularity:T,hideTimeZone:I,hourCycle:q,defaultValue:H,dir:E,step:P,closeOnSelect:j}=Kt(a),O=xn(E),N=Ru(r),Z=_(()=>a.weekStartsOn??f1(N.value)),W=Nt(a,"modelValue",n,{defaultValue:H.value,passive:a.modelValue===void 0}),K=_(()=>Wf({defaultPlaceholder:a.placeholder,granularity:a.granularity,defaultValue:W.value,locale:N.value})),te=Nt(a,"placeholder",n,{defaultValue:a.defaultPlaceholder??K.value.copy(),passive:a.placeholder===void 0}),oe=Nt(a,"open",n,{defaultValue:y.value,passive:a.open===void 0}),ye=A();function be(ge){return"hour"in ge?ge.set({hour:0,minute:0,second:0,millisecond:0}):ge}return Be(W,ge=>{ge&&ge.compare(te.value)!==0?te.value=ge.copy():!ge&&"hour"in te.value&&(te.value=be(te.value)),j.value&&(oe.value=!1)}),k8({isDateUnavailable:m.value,isDateDisabled:v.value,locale:N,disabled:l,pagedNavigation:i,weekStartsOn:Z,weekdayFormat:u,fixedWeeks:d,numberOfMonths:c,readonly:o,preventDeselect:f,modelValue:W,placeholder:te,defaultOpen:y,modal:x,open:oe,id:S,name:k,required:C,minValue:L,maxValue:D,granularity:T,hideTimeZone:I,hourCycle:q,dateFieldRef:ye,dir:O,step:P,onDateChange(ge){ge?W.value&&!f.value&&ge&&W.value.compare(ge)===0?W.value=void 0:W.value=ge.copy():W.value=void 0},onPlaceholderChange(ge){te.value=ge.copy()},closeOnSelect:j}),(ge,le)=>(p(),U(s(H1),{open:s(oe),"onUpdate:open":le[0]||(le[0]=ce=>wt(oe)?oe.value=ce:null),"default-open":s(y),modal:s(x)},{default:B(()=>[Se(ge.$slots,"default")]),_:3},8,["open","default-open","modal"]))}}),$8=w8,S8=ne({__name:"DatePickerCalendar",setup(e){const t=mp();return(a,n)=>(p(),U(s(W5),He({isDateDisabled:s(t).isDateDisabled,isDateUnavailable:s(t).isDateUnavailable,minValue:s(t).minValue.value,maxValue:s(t).maxValue.value,locale:s(t).locale.value,disabled:s(t).disabled.value,pagedNavigation:s(t).pagedNavigation.value,weekStartsOn:s(t).weekStartsOn.value,weekdayFormat:s(t).weekdayFormat.value,fixedWeeks:s(t).fixedWeeks.value,numberOfMonths:s(t).numberOfMonths.value,readonly:s(t).readonly.value,preventDeselect:s(t).preventDeselect.value,dir:s(t).dir.value},{"model-value":s(t).modelValue.value,placeholder:s(t).placeholder.value,multiple:!1,"onUpdate:modelValue":n[0]||(n[0]=r=>{r&&s(t).modelValue.value&&s(Kl)(r,s(t).modelValue.value)||s(t).onDateChange(r)}),"onUpdate:placeholder":n[1]||(n[1]=r=>{s(Kl)(r,s(t).placeholder.value)||s(t).onPlaceholderChange(r)})}),{default:B(({weekDays:r,grid:l,date:o,weekStartsOn:i,locale:u,fixedWeeks:d})=>[Se(a.$slots,"default",{date:o,grid:l,weekDays:r,weekStartsOn:i,locale:u,fixedWeeks:d})]),_:3},16,["model-value","placeholder"]))}}),C8=S8,E8=ne({__name:"DatePickerCell",props:{date:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Y5),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),A8=E8,T8=ne({__name:"DatePickerCellTrigger",props:{day:{type:null,required:!0},month:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Z5),it(dt(t)),{default:B(r=>[Se(a.$slots,"default",it(dt(r)))]),_:3},16))}}),O8=T8,D8=ne({__name:"PopoverContentImpl",props:{trapFocus:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=Pu(Mf(a,"trapFocus","disableOutsidePointerEvents")),{forwardRef:l}=et(),o=fo();return p1(),(i,u)=>(p(),U(s(Xf),{"as-child":"",loop:"",trapped:i.trapFocus,onMountAutoFocus:u[5]||(u[5]=d=>n("openAutoFocus",d)),onUnmountAutoFocus:u[6]||(u[6]=d=>n("closeAutoFocus",d))},{default:B(()=>[R(s(Zf),{"as-child":"","disable-outside-pointer-events":i.disableOutsidePointerEvents,onPointerDownOutside:u[0]||(u[0]=d=>n("pointerDownOutside",d)),onInteractOutside:u[1]||(u[1]=d=>n("interactOutside",d)),onEscapeKeyDown:u[2]||(u[2]=d=>n("escapeKeyDown",d)),onFocusOutside:u[3]||(u[3]=d=>n("focusOutside",d)),onDismiss:u[4]||(u[4]=d=>s(o).onOpenChange(!1))},{default:B(()=>[R(s(q1),He(s(r),{id:s(o).contentId,ref:s(l),"data-state":s(o).open.value?"open":"closed","aria-labelledby":s(o).triggerId,style:{"--reka-popover-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-popover-content-available-width":"var(--reka-popper-available-width)","--reka-popover-content-available-height":"var(--reka-popper-available-height)","--reka-popover-trigger-width":"var(--reka-popper-anchor-width)","--reka-popover-trigger-height":"var(--reka-popper-anchor-height)"},role:"dialog"}),{default:B(()=>[Se(i.$slots,"default")]),_:3},16,["id","data-state","aria-labelledby"])]),_:3},8,["disable-outside-pointer-events"])]),_:3},8,["trapped"]))}}),K1=D8,M8=ne({__name:"PopoverContentModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=fo(),l=A(!1);If(!0);const o=kn(a,n),{forwardRef:i,currentElement:u}=et();return Jf(u),(d,c)=>(p(),U(K1,He(s(o),{ref:s(i),"trap-focus":s(r).open.value,"disable-outside-pointer-events":"",onCloseAutoFocus:c[0]||(c[0]=yt(f=>{n("closeAutoFocus",f),l.value||s(r).triggerElement.value?.focus()},["prevent"])),onPointerDownOutside:c[1]||(c[1]=f=>{n("pointerDownOutside",f);const v=f.detail.originalEvent,m=v.button===0&&v.ctrlKey===!0,y=v.button===2||m;l.value=y}),onFocusOutside:c[2]||(c[2]=yt(()=>{},["prevent"]))}),{default:B(()=>[Se(d.$slots,"default")]),_:3},16,["trap-focus"]))}}),P8=M8,R8=ne({__name:"PopoverContentNonModal",props:{side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=fo(),l=A(!1),o=A(!1),i=kn(a,n);return(u,d)=>(p(),U(K1,He(s(i),{"trap-focus":!1,"disable-outside-pointer-events":!1,onCloseAutoFocus:d[0]||(d[0]=c=>{n("closeAutoFocus",c),c.defaultPrevented||(l.value||s(r).triggerElement.value?.focus(),c.preventDefault()),l.value=!1,o.value=!1}),onInteractOutside:d[1]||(d[1]=async c=>{n("interactOutside",c),c.defaultPrevented||(l.value=!0,c.detail.originalEvent.type==="pointerdown"&&(o.value=!0));const f=c.target;s(r).triggerElement.value?.contains(f)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&o.value&&c.preventDefault()})}),{default:B(()=>[Se(u.$slots,"default")]),_:3},16))}}),I8=R8,q8=ne({__name:"PopoverContent",props:{forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=fo(),l=kn(a,n),{forwardRef:o}=et();return r.contentId||=Un(void 0,"reka-popover-content"),(i,u)=>(p(),U(s(vl),{present:i.forceMount||s(r).open.value},{default:B(()=>[s(r).modal.value?(p(),U(P8,He({key:0},s(l),{ref:s(o)}),{default:B(()=>[Se(i.$slots,"default")]),_:3},16)):(p(),U(I8,He({key:1},s(l),{ref:s(o)}),{default:B(()=>[Se(i.$slots,"default")]),_:3},16))]),_:3},8,["present"]))}}),W1=q8,L8=ne({__name:"PopoverPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Iu),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),G1=L8,N8=ne({__name:"DatePickerContent",props:{portal:{type:Object,required:!1},forceMount:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},disableOutsidePointerEvents:{type:Boolean,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","openAutoFocus","closeAutoFocus"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>({...a,portal:void 0})),l=kn(r,n);return(o,i)=>(p(),U(s(G1),it(dt(o.portal)),{default:B(()=>[R(s(W1),He({...s(l),...o.$attrs},{onOpenAutoFocus:i[0]||(i[0]=u=>{n("openAutoFocus",u),!u.defaultPrevented&&u.target&&(s(c1)(u.target),u.preventDefault())})}),{default:B(()=>[Se(o.$slots,"default")]),_:3},16)]),_:3},16))}}),B8=N8,F8=ne({__name:"DatePickerField",setup(e){const t=mp();return(a,n)=>(p(),U(s(v8),He({ref:s(t).dateFieldRef,"model-value":s(t).modelValue.value,placeholder:s(t).placeholder.value},{id:s(t).id.value,name:s(t).name.value,disabled:s(t).disabled.value,minValue:s(t).minValue.value,maxValue:s(t).maxValue.value,readonly:s(t).readonly.value,hourCycle:s(t).hourCycle.value,granularity:s(t).granularity.value,hideTimeZone:s(t).hideTimeZone.value,locale:s(t).locale.value,isDateUnavailable:s(t).isDateUnavailable,required:s(t).required.value,dir:s(t).dir.value,step:s(t).step.value},{"onUpdate:modelValue":n[0]||(n[0]=r=>{r&&s(t).modelValue.value&&r.compare(s(t).modelValue.value)===0||s(t).onDateChange(r)}),"onUpdate:placeholder":n[1]||(n[1]=r=>{r.compare(s(t).placeholder.value)!==0&&s(t).onPlaceholderChange(r)})}),{default:B(({segments:r,modelValue:l})=>[Se(a.$slots,"default",{segments:r,modelValue:l})]),_:3},16,["model-value","placeholder"]))}}),V8=F8,z8=ne({__name:"DatePickerGrid",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(Q5),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),j8=z8,U8=ne({__name:"DatePickerGridBody",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(tO),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),H8=U8,K8=ne({__name:"DatePickerGridHead",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(nO),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),W8=K8,G8=ne({__name:"DatePickerGridRow",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(lO),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),oh=G8,Y8=ne({__name:"DatePickerHeadCell",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(sO),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),J8=Y8,Z8=ne({__name:"DatePickerHeader",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(uO),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),X8=Z8,Q8=ne({__name:"DatePickerHeading",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(dO),it(dt(t)),{default:B(({headingValue:r})=>[Se(a.$slots,"default",{headingValue:r},()=>[_e(w(r),1)])]),_:3},16))}}),e6=Q8,t6=ne({__name:"DatePickerInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(y8),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),a6=t6,n6=ne({__name:"DatePickerNext",props:{nextPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(pO),it(dt(t)),{default:B(r=>[Se(a.$slots,"default",it(dt(r)))]),_:3},16))}}),r6=n6,l6=ne({__name:"DatePickerPrev",props:{prevPage:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(vO),it(dt(t)),{default:B(r=>[Se(a.$slots,"default",it(dt(r)))]),_:3},16))}}),o6=l6,s6=ne({__name:"PopoverTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=fo(),{forwardRef:n,currentElement:r}=et();return a.triggerId||=Un(void 0,"reka-popover-trigger"),$t(()=>{a.triggerElement.value=r.value}),(l,o)=>(p(),U(Wt(s(a).hasCustomAnchor.value?s(nt):s(ap)),{"as-child":""},{default:B(()=>[R(s(nt),{id:s(a).triggerId,ref:s(n),type:l.as==="button"?"button":void 0,"aria-haspopup":"dialog","aria-expanded":s(a).open.value,"aria-controls":s(a).contentId,"data-state":s(a).open.value?"open":"closed",as:l.as,"as-child":t.asChild,onClick:s(a).onOpenToggle},{default:B(()=>[Se(l.$slots,"default")]),_:3},8,["id","type","aria-expanded","aria-controls","data-state","as","as-child","onClick"])]),_:3}))}}),i6=s6,u6=ne({__name:"DatePickerTrigger",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=mp();return(n,r)=>(p(),U(s(i6),He({"data-reka-date-field-segment":"trigger"},t,{disabled:s(a).disabled.value,onFocusin:r[0]||(r[0]=l=>{s(a).dateFieldRef.value?.setFocusedElement(l.target)})}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["disabled"]))}}),c6=u6;const[Y1,d6]=Dt("DropdownMenuRoot");var f6=ne({__name:"DropdownMenuRoot",props:{defaultOpen:{type:Boolean,required:!1},open:{type:Boolean,required:!1,default:void 0},dir:{type:String,required:!1},modal:{type:Boolean,required:!1,default:!0}},emits:["update:open"],setup(e,{emit:t}){const a=e,n=t;et();const r=Nt(a,"open",n,{defaultValue:a.defaultOpen,passive:a.open===void 0}),l=A(),{modal:o,dir:i}=Kt(a),u=xn(i);return d6({open:r,onOpenChange:d=>{r.value=d},onOpenToggle:()=>{r.value=!r.value},triggerId:"",triggerElement:l,contentId:"",modal:o,dir:u}),(d,c)=>(p(),U(s(RO),{open:s(r),"onUpdate:open":c[0]||(c[0]=f=>wt(r)?r.value=f:null),dir:s(u),modal:s(o)},{default:B(()=>[Se(d.$slots,"default",{open:s(r)})]),_:3},8,["open","dir","modal"]))}}),J1=f6,p6=ne({__name:"DropdownMenuContent",props:{forceMount:{type:Boolean,required:!1},loop:{type:Boolean,required:!1},side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},hideShiftedArrow:{type:Boolean,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["escapeKeyDown","pointerDownOutside","focusOutside","interactOutside","closeAutoFocus"],setup(e,{emit:t}){const r=kn(e,t);et();const l=Y1(),o=A(!1);function i(u){u.defaultPrevented||(o.value||setTimeout(()=>{l.triggerElement.value?.focus()},0),o.value=!1,u.preventDefault())}return l.contentId||=Un(void 0,"reka-dropdown-menu-content"),(u,d)=>(p(),U(s(YO),He(s(r),{id:s(l).contentId,"aria-labelledby":s(l)?.triggerId,style:{"--reka-dropdown-menu-content-transform-origin":"var(--reka-popper-transform-origin)","--reka-dropdown-menu-content-available-width":"var(--reka-popper-available-width)","--reka-dropdown-menu-content-available-height":"var(--reka-popper-available-height)","--reka-dropdown-menu-trigger-width":"var(--reka-popper-anchor-width)","--reka-dropdown-menu-trigger-height":"var(--reka-popper-anchor-height)"},onCloseAutoFocus:i,onInteractOutside:d[0]||(d[0]=c=>{if(c.defaultPrevented)return;const f=c.detail.originalEvent,v=f.button===0&&f.ctrlKey===!0,m=f.button===2||v;(!s(l).modal.value||m)&&(o.value=!0),s(l).triggerElement.value?.contains(c.target)&&c.preventDefault()})}),{default:B(()=>[Se(u.$slots,"default")]),_:3},16,["id","aria-labelledby"]))}}),Z1=p6,m6=ne({__name:"DropdownMenuItem",props:{disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,r=ml(t);return et(),(l,o)=>(p(),U(s(U1),it(dt({...a,...s(r)})),{default:B(()=>[Se(l.$slots,"default")]),_:3},16))}}),jd=m6,v6=ne({__name:"DropdownMenuItemIndicator",props:{forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return et(),(a,n)=>(p(),U(s(jO),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),h6=v6,y6=ne({__name:"DropdownMenuLabel",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return et(),(a,n)=>(p(),U(s(t8),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),g6=y6,b6=ne({__name:"DropdownMenuPortal",props:{to:{type:null,required:!1},disabled:{type:Boolean,required:!1},defer:{type:Boolean,required:!1},forceMount:{type:Boolean,required:!1}},setup(e){const t=e;return(a,n)=>(p(),U(s(n8),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),X1=b6,_6=ne({__name:"DropdownMenuRadioGroup",props:{modelValue:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,r=ml(t);return et(),(l,o)=>(p(),U(s(s8),it(dt({...a,...s(r)})),{default:B(()=>[Se(l.$slots,"default")]),_:3},16))}}),x6=_6,k6=ne({__name:"DropdownMenuRadioItem",props:{value:{type:null,required:!0},disabled:{type:Boolean,required:!1},textValue:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["select"],setup(e,{emit:t}){const r=kn(e,t);return et(),(l,o)=>(p(),U(s(u8),it(dt(s(r))),{default:B(()=>[Se(l.$slots,"default")]),_:3},16))}}),w6=k6,$6=ne({__name:"DropdownMenuSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e;return et(),(a,n)=>(p(),U(s(d8),it(dt(t)),{default:B(()=>[Se(a.$slots,"default")]),_:3},16))}}),sh=$6,S6=ne({__name:"DropdownMenuTrigger",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,a=Y1(),{forwardRef:n,currentElement:r}=et();return $t(()=>{a.triggerElement=r}),a.triggerId||=Un(void 0,"reka-dropdown-menu-trigger"),(l,o)=>(p(),U(s(AO),{"as-child":""},{default:B(()=>[R(s(nt),{id:s(a).triggerId,ref:s(n),type:l.as==="button"?"button":void 0,"as-child":t.asChild,as:l.as,"aria-haspopup":"menu","aria-expanded":s(a).open.value,"aria-controls":s(a).open.value?s(a).contentId:void 0,"data-disabled":l.disabled?"":void 0,disabled:l.disabled,"data-state":s(a).open.value?"open":"closed",onClick:o[0]||(o[0]=async i=>{!l.disabled&&i.button===0&&i.ctrlKey===!1&&(s(a)?.onOpenToggle(),await Ue(),s(a).open.value&&i.preventDefault())}),onKeydown:o[1]||(o[1]=mn(i=>{l.disabled||(["Enter"," "].includes(i.key)&&s(a).onOpenToggle(),i.key==="ArrowDown"&&s(a).onOpenChange(!0),["Enter"," ","ArrowDown"].includes(i.key)&&i.preventDefault())},["enter","space","arrow-down"]))},{default:B(()=>[Se(l.$slots,"default")]),_:3},8,["id","type","as-child","as","aria-expanded","aria-controls","data-disabled","disabled","data-state"])]),_:3}))}}),Q1=S6;const gs=100,[C6,E6]=Dt("ProgressRoot"),Qi=e=>typeof e=="number";function A6(e,t){return $a(e)||Qi(e)&&!Number.isNaN(e)&&e<=t&&e>=0?e:(console.error(`Invalid prop \`value\` of value \`${e}\` supplied to \`ProgressRoot\`. The \`value\` prop must be:
|
||
- a positive number
|
||
- less than the value passed to \`max\` (or ${gs} if no \`max\` prop is set)
|
||
- \`null\` or \`undefined\` if the progress is indeterminate.
|
||
|
||
Defaulting to \`null\`.`),null)}function T6(e){return Qi(e)&&!Number.isNaN(e)&&e>0?e:(console.error(`Invalid prop \`max\` of value \`${e}\` supplied to \`ProgressRoot\`. Only numbers greater than 0 are valid max values. Defaulting to \`${gs}\`.`),gs)}var O6=ne({__name:"ProgressRoot",props:{modelValue:{type:[Number,null],required:!1},max:{type:Number,required:!1,default:gs},getValueLabel:{type:Function,required:!1,default:(e,t)=>Qi(e)?`${Math.round(e/t*gs)}%`:void 0},getValueText:{type:Function,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue","update:max"],setup(e,{emit:t}){const a=e,n=t;et();const r=Nt(a,"modelValue",n,{passive:a.modelValue===void 0}),l=Nt(a,"max",n,{passive:a.max===void 0});Be(()=>r.value,async i=>{const u=A6(i,a.max);u!==i&&(await Ue(),r.value=u)},{immediate:!0}),Be(()=>a.max,i=>{const u=T6(a.max);u!==i&&(l.value=u)},{immediate:!0});const o=_(()=>$a(r.value)?"indeterminate":r.value===l.value?"complete":"loading");return E6({modelValue:r,max:l,progressState:o}),(i,u)=>(p(),U(s(nt),{"as-child":i.asChild,as:i.as,"aria-valuemax":s(l),"aria-valuemin":0,"aria-valuenow":Qi(s(r))?s(r):void 0,"aria-valuetext":i.getValueText?.(s(r),s(l)),"aria-label":i.getValueLabel(s(r),s(l)),role:"progressbar","data-state":o.value,"data-value":s(r)??void 0,"data-max":s(l)},{default:B(()=>[Se(i.$slots,"default",{modelValue:s(r)})]),_:3},8,["as-child","as","aria-valuemax","aria-valuenow","aria-valuetext","aria-label","data-state","data-value","data-max"]))}}),Bc=O6,D6=ne({__name:"ProgressIndicator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=C6();return et(),(n,r)=>(p(),U(s(nt),He(t,{"data-state":s(a).progressState.value,"data-value":s(a).modelValue?.value??void 0,"data-max":s(a).max.value}),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["data-state","data-value","data-max"]))}}),Fc=D6;const M6="radio.select";function P6(e,t,a){Df(M6,a,{originalEvent:e,value:t})}var R6=ne({__name:"Radio",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},checked:{type:Boolean,required:!1,default:void 0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:checked","select"],setup(e,{emit:t}){const a=e,n=t,r=Nt(a,"checked",n,{passive:a.checked===void 0}),{value:l}=Kt(a),{forwardRef:o,currentElement:i}=et(),u=Yf(i),d=_(()=>a.id&&i.value?document.querySelector(`[for="${a.id}"]`)?.innerText??a.value:void 0);function c(f){a.disabled||P6(f,a.value,v=>{n("select",v),!v?.defaultPrevented&&(r.value=!0,u.value&&v.stopPropagation())})}return(f,v)=>(p(),U(s(nt),He(f.$attrs,{id:f.id,ref:s(o),role:"radio",type:f.as==="button"?"button":void 0,as:f.as,"aria-checked":s(r),"aria-label":d.value,"as-child":f.asChild,disabled:f.disabled?"":void 0,"data-state":s(r)?"checked":"unchecked","data-disabled":f.disabled?"":void 0,value:s(l),required:f.required,name:f.name,onClick:yt(c,["stop"])}),{default:B(()=>[Se(f.$slots,"default",{checked:s(r)}),s(u)&&f.name?(p(),U(s(tp),{key:0,type:"radio",tabindex:"-1",value:s(l),checked:!!s(r),name:f.name,disabled:f.disabled,required:f.required},null,8,["value","checked","name","disabled","required"])):Y("v-if",!0)]),_:3},16,["id","type","as","aria-checked","aria-label","as-child","disabled","data-state","data-disabled","value","required","name"]))}}),I6=R6;const[q6,L6]=Dt("RadioGroupRoot");var N6=ne({__name:"RadioGroupRoot",props:{modelValue:{type:null,required:!1},defaultValue:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},orientation:{type:String,required:!1,default:void 0},dir:{type:String,required:!1},loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1,default:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:r,currentElement:l}=et(),o=Nt(a,"modelValue",n,{defaultValue:a.defaultValue,passive:a.modelValue===void 0}),{disabled:i,loop:u,orientation:d,name:c,required:f,dir:v}=Kt(a),m=xn(v),y=Yf(l);return L6({modelValue:o,changeModelValue:x=>{o.value=x},disabled:i,loop:u,orientation:d,name:c?.value,required:f}),(x,S)=>(p(),U(s(Vu),{"as-child":"",orientation:s(d),dir:s(m),loop:s(u)},{default:B(()=>[R(s(nt),{ref:s(r),role:"radiogroup","data-disabled":s(i)?"":void 0,"as-child":x.asChild,as:x.as,"aria-orientation":s(d),"aria-required":s(f),dir:s(m)},{default:B(()=>[Se(x.$slots,"default",{modelValue:s(o)}),s(y)&&s(c)?(p(),U(s(tp),{key:0,required:s(f),disabled:s(i),value:s(o),name:s(c)},null,8,["required","disabled","value","name"])):Y("v-if",!0)]),_:3},8,["data-disabled","as-child","as","aria-orientation","aria-required","dir"])]),_:3},8,["orientation","dir","loop"]))}}),vp=N6;const[hG,B6]=Dt("RadioGroupItem");var F6=ne({inheritAttrs:!1,__name:"RadioGroupItem",props:{id:{type:String,required:!1},value:{type:null,required:!1},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["select"],setup(e,{emit:t}){const a=e,n=t,{forwardRef:r,currentElement:l}=et(),o=q6(),i=_(()=>o.disabled.value||a.disabled),u=_(()=>o.required.value||a.required),d=_(()=>fs(o.modelValue?.value,a.value));B6({disabled:i,checked:d});const c=A(!1),f=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"];ao("keydown",m=>{f.includes(m.key)&&(c.value=!0)}),ao("keyup",()=>{c.value=!1});function v(){setTimeout(()=>{c.value&&l.value?.click()},0)}return(m,y)=>(p(),U(s(zu),{checked:d.value,disabled:i.value,"as-child":"",focusable:!i.value,active:d.value},{default:B(()=>[R(I6,He({...m.$attrs,...a},{ref:s(r),checked:d.value,required:u.value,disabled:i.value,"onUpdate:checked":y[0]||(y[0]=x=>s(o).changeModelValue(m.value)),onSelect:y[1]||(y[1]=x=>n("select",x)),onKeydown:y[2]||(y[2]=mn(yt(()=>{},["prevent"]),["enter"])),onFocus:v}),{default:B(()=>[Se(m.$slots,"default",{checked:d.value,required:u.value,disabled:i.value})]),_:3},16,["checked","required","disabled"])]),_:3},8,["checked","disabled","focusable","active"]))}}),hp=F6,V6=ne({__name:"BaseSeparator",props:{orientation:{type:String,required:!1,default:"horizontal"},decorative:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=["horizontal","vertical"];function n(i){return a.includes(i)}const r=_(()=>n(t.orientation)?t.orientation:"horizontal"),l=_(()=>r.value==="vertical"?t.orientation:void 0),o=_(()=>t.decorative?{role:"none"}:{"aria-orientation":l.value,role:"separator"});return(i,u)=>(p(),U(s(nt),He({as:i.as,"as-child":i.asChild,"data-orientation":r.value},o.value),{default:B(()=>[Se(i.$slots,"default")]),_:3},16,["as","as-child","data-orientation"]))}}),z6=V6;const[yp,j6]=Dt("TabsRoot");var U6=ne({__name:"TabsRoot",props:{defaultValue:{type:null,required:!1},orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},activationMode:{type:String,required:!1,default:"automatic"},modelValue:{type:null,required:!1},unmountOnHide:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,{orientation:r,unmountOnHide:l,dir:o}=Kt(a),i=xn(o);et();const u=Nt(a,"modelValue",n,{defaultValue:a.defaultValue,passive:a.modelValue===void 0}),d=A(),c=cl(new Set);return j6({modelValue:u,changeModelValue:f=>{u.value=f},orientation:r,dir:i,unmountOnHide:l,activationMode:a.activationMode,baseId:Un(void 0,"reka-tabs"),tabsList:d,contentIds:c,registerContent:f=>{c.value=new Set([...c.value,f])},unregisterContent:f=>{const v=new Set(c.value);v.delete(f),c.value=v}}),(f,v)=>(p(),U(s(nt),{dir:s(i),"data-orientation":s(r),"as-child":f.asChild,as:f.as},{default:B(()=>[Se(f.$slots,"default",{modelValue:s(u)})]),_:3},8,["dir","data-orientation","as-child","as"]))}}),H6=U6;function e0(e,t){return`${e}-trigger-${t}`}function t0(e,t){return`${e}-content-${t}`}var K6=ne({__name:"TabsContent",props:{value:{type:[String,Number],required:!0},forceMount:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:a}=et(),n=yp(),r=_(()=>e0(n.baseId,t.value)),l=_(()=>t0(n.baseId,t.value)),o=_(()=>t.value===n.modelValue.value),i=A(o.value);return $t(()=>{n.registerContent(t.value),requestAnimationFrame(()=>{i.value=!1})}),Ot(()=>{n.unregisterContent(t.value)}),(u,d)=>(p(),U(s(vl),{present:u.forceMount||o.value,"force-mount":""},{default:B(({present:c})=>[R(s(nt),{id:l.value,ref:s(a),"as-child":u.asChild,as:u.as,role:"tabpanel","data-state":o.value?"active":"inactive","data-orientation":s(n).orientation.value,"aria-labelledby":r.value,hidden:!c,tabindex:"0",style:ua({animationDuration:i.value?"0s":void 0})},{default:B(()=>[!s(n).unmountOnHide.value||c?Se(u.$slots,"default",{key:0}):Y("v-if",!0)]),_:2},1032,["id","as-child","as","data-state","data-orientation","aria-labelledby","hidden","style"])]),_:3},8,["present"]))}}),ih=K6,W6=ne({__name:"TabsList",props:{loop:{type:Boolean,required:!1,default:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{loop:a}=Kt(t),{forwardRef:n,currentElement:r}=et(),l=yp();return l.tabsList=r,(o,i)=>(p(),U(s(Vu),{"as-child":"",orientation:s(l).orientation.value,dir:s(l).dir.value,loop:s(a)},{default:B(()=>[R(s(nt),{ref:s(n),role:"tablist","as-child":o.asChild,as:o.as,"aria-orientation":s(l).orientation.value},{default:B(()=>[Se(o.$slots,"default")]),_:3},8,["as-child","as","aria-orientation"])]),_:3},8,["orientation","dir","loop"]))}}),G6=W6,Y6=ne({__name:"TabsTrigger",props:{value:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!1,default:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:a}=et(),n=yp(),r=_(()=>e0(n.baseId,t.value)),l=_(()=>n.contentIds.value.has(t.value)?t0(n.baseId,t.value):void 0),o=_(()=>t.value===n.modelValue.value);return(i,u)=>(p(),U(s(zu),{"as-child":"",focusable:!i.disabled,active:o.value},{default:B(()=>[R(s(nt),{id:r.value,ref:s(a),role:"tab",type:i.as==="button"?"button":void 0,as:i.as,"as-child":i.asChild,"aria-selected":o.value?"true":"false","aria-controls":l.value,"data-state":o.value?"active":"inactive",disabled:i.disabled,"data-disabled":i.disabled?"":void 0,"data-orientation":s(n).orientation.value,onMousedown:u[0]||(u[0]=yt(d=>{!i.disabled&&d.ctrlKey===!1?s(n).changeModelValue(i.value):d.preventDefault()},["left"])),onKeydown:u[1]||(u[1]=mn(d=>s(n).changeModelValue(i.value),["enter","space"])),onFocus:u[2]||(u[2]=()=>{const d=s(n).activationMode!=="manual";!o.value&&!i.disabled&&d&&s(n).changeModelValue(i.value)})},{default:B(()=>[Se(i.$slots,"default")]),_:3},8,["id","type","as","as-child","aria-selected","aria-controls","data-state","disabled","data-disabled","data-orientation"])]),_:3},8,["focusable","active"]))}}),uh=Y6;const[J6,Z6]=Dt("TimeFieldRoot");function ei(e,t=Ms(Ja())){return e&&"day"in e?e:vn(t,e)}var X6=ne({inheritAttrs:!1,__name:"TimeFieldRoot",props:{defaultValue:{type:Object,required:!1,default:void 0},defaultPlaceholder:{type:Object,required:!1},placeholder:{type:Object,required:!1,default:void 0},modelValue:{type:[Object,null],required:!1},hourCycle:{type:null,required:!1},step:{type:Object,required:!1},stepSnapping:{type:Boolean,required:!1,default:!1},granularity:{type:String,required:!1},hideTimeZone:{type:Boolean,required:!1},maxValue:{type:Object,required:!1},minValue:{type:Object,required:!1},locale:{type:String,required:!1},disabled:{type:Boolean,required:!1,default:!1},readonly:{type:Boolean,required:!1,default:!1},id:{type:String,required:!1},dir:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1},name:{type:String,required:!1},required:{type:Boolean,required:!1}},emits:["update:modelValue","update:placeholder"],setup(e,{expose:t,emit:a}){const n=e,r=a,{disabled:l,readonly:o,granularity:i,defaultValue:u,minValue:d,maxValue:c,stepSnapping:f,dir:v,locale:m}=Kt(n),y=Ru(m),x=xn(v),S=Gf(y.value,{hourCycle:vs(n.hourCycle)}),{primitiveElement:k,currentElement:C}=sl(),L=A(new Set),D=_(()=>u1(n)),T=_(()=>d.value?ei(d.value):void 0),I=_(()=>c.value?ei(c.value):void 0);$t(()=>{lh(C.value).forEach(ve=>L.value.add(ve))});const q=Nt(n,"modelValue",r,{defaultValue:u.value,passive:n.modelValue===void 0}),H=_({get(){return $a(q.value)?q.value:ei(q.value)},set(ve){return ve?q.value=q.value&&"day"in q.value?ve:new un(ve.hour,ve.minute,ve.second,q.value?.millisecond):q.value=ve,ve}}),E=zA({defaultPlaceholder:n.placeholder,defaultValue:q.value}),P=Nt(n,"placeholder",r,{defaultValue:n.defaultPlaceholder??E.copy(),passive:n.placeholder===void 0}),j=_({get(){return ei(P.value)},set(ve){return ve&&(P.value="day"in P.value?ve.copy():new un(ve.hour,ve.minute,ve.second,P.value?.millisecond)),ve}}),O=_(()=>i.value?i.value:"minute"),N=_(()=>q.value?!!(T.value&&yr(H.value,T.value)||I.value&&yr(I.value,H.value)):!1),Z=x5(O.value),W=A(q.value?{...zd({value:H.value,formatter:S})}:{...Z}),K=_(()=>B1({granularity:O.value,dateRef:j.value,formatter:S,hideTimeZone:n.hideTimeZone,hourCycle:n.hourCycle,segmentValues:W.value,locale:y,isTimeValue:!0})),te=_(()=>{const ve=K.value.arr;return n.hourCycle===12?ve.map(J=>{if(J.part==="hour"&&"hour"in W.value){const he=W.value.hour;if(he!==null){const G=he===0?12:he>12?he-12:he;return{...J,value:G.toString()}}}return J}):ve}),oe=_(()=>te.value.filter(({part:ve})=>ve!=="literal"));Be(y,ve=>{S.getLocale()!==ve&&(S.setLocale(ve),Ue(()=>{L.value.clear(),lh(C.value).forEach(J=>L.value.add(J))}))}),Be(H,ve=>{!$a(ve)&&(!Kl(j.value,ve)||j.value.compare(ve)!==0)&&(P.value=ve.copy())}),Be([H,y],([ve])=>{$a(ve)?Object.values(W.value).every(J=>J!==null)&&$a(ve)&&(W.value={...Z}):W.value={...zd({value:ve,formatter:S})}});const ye=A(null),be=_(()=>Array.from(L.value).findIndex(ve=>ve.getAttribute("data-reka-time-field-segment")===ye.value?.getAttribute("data-reka-time-field-segment"))),ge=_(()=>{const ve=x.value==="rtl"?-1:1;return(ve<0?be.value<0:be.value>L.value.size-1)?null:Array.from(L.value)[be.value+ve]}),le=_(()=>{const ve=x.value==="rtl"?-1:1;return(ve>0?be.value<0:be.value>L.value.size-1)?null:Array.from(L.value)[be.value-ve]}),ce=io();function F(ve){ve.isComposing||En(ve.key)&&(ve.key===ce.ARROW_LEFT&&le.value?.focus(),ve.key===ce.ARROW_RIGHT&&ge.value?.focus())}function fe(ve){ye.value=ve}return Z6({locale:y,modelValue:H,placeholder:j,disabled:l,formatter:S,hourCycle:n.hourCycle,step:D,stepSnapping:f,readonly:o,segmentValues:W,isInvalid:N,segmentContents:oe,elements:L,setFocusedElement:fe,focusNext(){ge.value?.focus()}}),t({setFocusedElement:fe}),(ve,J)=>(p(),U(s(nt),He(ve.$attrs,{ref_key:"primitiveElement",ref:k,role:"group","aria-disabled":s(l)?!0:void 0,"data-disabled":s(l)?"":void 0,"data-readonly":s(o)?"":void 0,"data-invalid":N.value?"":void 0,dir:s(x),onKeydown:mn(F,["left","right"])}),{default:B(()=>[Se(ve.$slots,"default",{modelValue:s(q),segments:te.value,isInvalid:N.value}),R(s(ep),{id:ve.id,as:"input",feature:"focusable",tabindex:"-1",value:s(q)?s(q).toString():"",name:ve.name,disabled:s(l),required:ve.required,onFocus:J[0]||(J[0]=he=>Array.from(L.value)?.[0]?.focus())},null,8,["id","value","name","disabled","required"])]),_:3},16,["aria-disabled","data-disabled","data-readonly","data-invalid","dir"]))}}),ch=X6,Q6=ne({__name:"TimeFieldInput",props:{part:{type:null,required:!0},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=J6(),n=A(!0),r=A(!1),{handleSegmentClick:l,handleSegmentKeydown:o,handleSegmentBeforeInput:i,handleSegmentCompositionStart:u,handleSegmentCompositionEnd:d,handleSegmentFocusOut:c,attributes:f}=F1({hasLeftFocus:n,lastKeyZero:r,placeholder:a.placeholder,hourCycle:a.hourCycle,step:a.step,stepSnapping:a.stepSnapping,segmentValues:a.segmentValues,formatter:a.formatter,part:t.part,disabled:a.disabled,readonly:a.readonly,focusNext:a.focusNext,modelValue:a.modelValue}),v=_(()=>a.disabled.value),m=_(()=>a.readonly.value),y=_(()=>a.isInvalid.value);return(x,S)=>(p(),U(s(nt),He({as:x.as,"as-child":x.asChild},s(f),{contenteditable:v.value||m.value?!1:x.part!=="literal","data-reka-time-field-segment":x.part,"aria-disabled":v.value?!0:void 0,"aria-readonly":m.value?!0:void 0,"data-disabled":v.value?"":void 0,"data-invalid":y.value?"":void 0,"aria-invalid":y.value?!0:void 0},eg(x.part!=="literal"?{mousedown:s(l),keydown:s(o),beforeinput:s(i),compositionstart:s(u),compositionend:s(d),focusout:()=>{n.value=!0,s(c)()},focusin:k=>{s(a).setFocusedElement(k.target)}}:{})),{default:B(()=>[Se(x.$slots,"default")]),_:3},16,["as","as-child","contenteditable","data-reka-time-field-segment","aria-disabled","aria-readonly","data-disabled","data-invalid","aria-invalid"]))}}),dh=Q6,eD=ne({__name:"ToolbarButton",props:{disabled:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1,default:"button"}},setup(e){const t=e,{forwardRef:a}=et();return(n,r)=>(p(),U(s(zu),{"as-child":"",focusable:!n.disabled},{default:B(()=>[R(s(nt),He({ref:s(a),type:n.as==="button"?"button":void 0},t),{default:B(()=>[Se(n.$slots,"default")]),_:3},16,["type"])]),_:3},8,["focusable"]))}}),Eo=eD;const[tD,aD]=Dt("ToolbarRoot");var nD=ne({__name:"ToolbarRoot",props:{orientation:{type:String,required:!1,default:"horizontal"},dir:{type:String,required:!1},loop:{type:Boolean,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{orientation:a,dir:n}=Kt(t),r=xn(n),{forwardRef:l}=et();return aD({orientation:a,dir:r}),(o,i)=>(p(),U(s(Vu),{"as-child":"",orientation:s(a),dir:s(r),loop:o.loop},{default:B(()=>[R(s(nt),{ref:s(l),role:"toolbar","aria-orientation":s(a),"as-child":o.asChild,as:o.as},{default:B(()=>[Se(o.$slots,"default")]),_:3},8,["aria-orientation","as-child","as"])]),_:3},8,["orientation","dir","loop"]))}}),rD=nD,lD=ne({__name:"ToolbarSeparator",props:{asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,a=tD();return et(),(n,r)=>(p(),U(z6,{orientation:s(a).orientation.value,"as-child":t.asChild,as:n.as},{default:B(()=>[Se(n.$slots,"default")]),_:3},8,["orientation","as-child","as"]))}}),Vc=lD;const oD=/^filter\[(.+)\]$/,sD=/^[1-9]\d*$/;function El(e){const t=Array.isArray(e)?e[e.length-1]:e;return typeof t=="string"?t:""}function fh(e){return sD.test(e)?Number(e):void 0}function a0(e){const t={},a=El(e.search).trim();a!==""&&(t.search=a);const n=El(e.sort).trim();if(n!==""){t.sort=n;const i=El(e.dir);t.dir=i==="desc"?"desc":"asc"}const r=fh(El(e.page));r!==void 0&&(t.page=r);const l=fh(El(e.per_page));l!==void 0&&(t.per_page=l);const o={};for(const i of Object.keys(e).sort()){const u=oD.exec(i)?.[1],d=El(e[i]);u&&d!==""&&(o[u]=d)}return Object.keys(o).length>0&&(t.filter=o),t}function eu(e){const t={};e.search&&(t.search=e.search),e.sort&&(t.sort=e.sort,t.dir=e.dir==="desc"?"desc":"asc"),e.page!==void 0&&e.page>1&&(t.page=String(e.page)),e.per_page!==void 0&&(t.per_page=String(e.per_page));for(const a of Object.keys(e.filter??{}).sort()){const n=e.filter?.[a];n!==void 0&&n!==""&&(t[`filter[${a}]`]=n)}return t}function Nl(e){return JSON.stringify(eu(e))}const n0="summer-admin.list:",iD=Nl({});let Ud=null;function Uu(){try{return typeof window>"u"?null:window.localStorage}catch{return null}}function r0(e){return`${n0}${e}:`}function l0(e){return Ud===null?null:r0(Ud)+e}function Hd(e){try{Uu()?.removeItem(e)}catch{}}function ph(e){const t=Uu();if(t)try{const a=[];for(let n=0;n<t.length;n++){const r=t.key(n);r!==null&&r.startsWith(n0)&&e(r)&&a.push(r)}for(const n of a)t.removeItem(n)}catch{}}function gp(e){const t=e===null||String(e)===""?null:String(e);if(Ud=t,t===null){ph(()=>!0);return}const a=r0(t);ph(n=>!n.startsWith(a))}function uD(e){const t=l0(e);if(t===null)return{};let a=null;try{a=Uu()?.getItem(t)??null}catch{return{}}if(a===null)return{};let n;try{n=JSON.parse(a)}catch{return Hd(t),{}}return typeof n!="object"||n===null||Array.isArray(n)||Object.getPrototypeOf(n)!==Object.prototype||!Object.values(n).every(r=>typeof r=="string")?(Hd(t),{}):a0(n)}function ti(e,t){const a=l0(e);if(a!==null){if(Nl(t)===iD){Hd(a);return}try{Uu()?.setItem(a,JSON.stringify(eu(t)))}catch{}}}const nl=A(null),o0=A(null);let ts=null;function s0(e){i0(),o0.value=e,!(e===null||e<=0)&&(ts=setTimeout(()=>{ts=null,bf()},e*800))}function i0(){ts!==null&&(clearTimeout(ts),ts=null)}M2(s0);const ta=At(nl);async function cD(e,t){const{data:a,response:n}=await qe.POST("/auth/login",{body:{login:e,password:t}});return!n.ok||!a?!1:(s0(typeof a.data.expires_in=="number"?a.data.expires_in:null),!0)}async function u0(){const{data:e,response:t}=await qe.GET("/auth/me");return nl.value=t.ok&&e?e.data:null,gp(nl.value?.id??null),await Y3(nl.value),nl.value}function c0(e){if(!e)return"";const t=[e.first_name,e.last_name].map(a=>a.trim()).filter(Boolean);return t.length>0?t.slice(0,2).map(a=>a.charAt(0).toUpperCase()).join(""):e.login.slice(0,2).toUpperCase()}function zc(e){nl.value=e,gp(e.id)}function d0(){i0(),nl.value=null,o0.value=null,gp(null)}function Kd(e){d0();const t=e.currentRoute.value;t.name!=="login"&&e.push({name:"login",query:{redirect:t.fullPath}}).catch(()=>{})}async function f0(e){try{await qe.POST("/auth/logout")}catch{}finally{d0(),N2([]),V2([])}e&&await e.replace({name:"login"}).catch(()=>{})}const dD=["src"],fD={key:1,class:"flex size-[34px] shrink-0 items-center justify-center rounded-full bg-accent text-[13px] font-bold text-on-accent","aria-hidden":"true","data-user-initials":""},pD={class:"flex flex-col leading-tight max-[1099px]:hidden","data-user-identity":""},mD={class:"font-semibold"},vD={key:0,class:"text-[12px] text-muted","data-user-role":""},hD={class:"flex items-center gap-3 px-2 py-2"},yD=["src"],gD={key:1,class:"flex size-10 shrink-0 items-center justify-center rounded-full bg-accent text-[14px] font-bold text-on-accent","aria-hidden":"true"},bD={class:"flex min-w-0 flex-col leading-tight"},_D={class:"truncate font-bold"},xD={class:"truncate text-[13px] text-muted"},kD={class:"flex size-[18px] items-center justify-center"},wD=ne({__name:"UserMenu",setup(e){const t=_n(),a=_(()=>{const v=ta.value;if(!v)return"";const m=`${v.first_name} ${v.last_name}`.trim();return m===""?v.login:m}),n=_(()=>c0(ta.value)),r=_(()=>ta.value?.avatar?.thumb_url||ta.value?.avatar?.url||""),l=_(()=>ta.value?.role?.name??""),o=_(()=>U3.value||La.value);function i(v){try{const m=new Intl.DisplayNames([v],{type:"language"}).of(v);if(m&&m!==v)return m.charAt(0).toLocaleUpperCase(v)+m.slice(1)}catch{}return v.toUpperCase()}const u=_(()=>I2.value.map(v=>({code:v,name:i(v)})));function d(v){typeof v=="string"&&v!==""&&J3(v)}async function c(){await t.push({name:"account"}).catch(()=>{})}async function f(){await f0(t)}return(v,m)=>(p(),U(s(J1),{modal:!1},{default:B(()=>[R(s(Q1),{"data-user-menu":"",disabled:!s(ta),"aria-label":`${s(h)("backend::lang.nav.user_menu")}: ${a.value}`,class:"flex h-input items-center gap-2.5 rounded-inner px-2 text-left transition-colors duration-150 ease-out hover:bg-hover"},{default:B(()=>[r.value?(p(),b("img",{key:0,src:r.value,alt:"","data-user-avatar":"",class:"size-[34px] shrink-0 rounded-full object-cover"},null,8,dD)):(p(),b("span",fD,w(n.value),1)),g("span",pD,[g("span",mD,w(a.value),1),l.value?(p(),b("span",vD,w(l.value),1)):Y("",!0)]),R(s(zn),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled","aria-label"]),R(s(X1),null,{default:B(()=>[R(s(Z1),{"data-user-menu-content":"",align:"end","side-offset":8,class:"z-50 flex w-[280px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:B(()=>[g("div",hD,[r.value?(p(),b("img",{key:0,src:r.value,alt:"","data-user-avatar":"",class:"size-10 shrink-0 rounded-full object-cover"},null,8,yD)):(p(),b("span",gD,w(n.value),1)),g("span",bD,[g("span",_D,w(a.value),1),g("span",xD,w(s(ta)?.email),1)])]),R(s(jd),{"data-action":"account",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:c},{default:B(()=>[R(s(S3),{size:18,"aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.myaccount.menu_label")),1)]),_:1}),u.value.length>1?(p(),b(pe,{key:0},[R(s(sh),{class:"my-1 h-px bg-border"}),R(s(g6),{class:"px-3 pt-1 pb-1 text-[12px] font-semibold text-muted","data-language-label":""},{default:B(()=>[_e(w(s(h)("backend::lang.nav.language")),1)]),_:1}),R(s(x6),{"model-value":o.value,"onUpdate:modelValue":d},{default:B(()=>[(p(!0),b(pe,null,De(u.value,y=>(p(),U(s(w6),{key:y.code,value:y.code,"data-locale-option":y.code,lang:y.code,class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover"},{default:B(()=>[g("span",kD,[R(s(h6),null,{default:B(()=>[R(s(Na),{size:18,"aria-hidden":"true"})]),_:1})]),g("span",null,w(y.name),1)]),_:2},1032,["value","data-locale-option","lang"]))),128))]),_:1},8,["model-value"])],64)):Y("",!0),R(s(sh),{class:"my-1 h-px bg-border"}),R(s(jd),{"data-action":"logout",class:"flex h-10 cursor-pointer items-center gap-2.5 rounded-control px-3 font-medium outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:f},{default:B(()=>[R(s(pb),{size:18,"aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.auth.logout")),1)]),_:1})]),_:1})]),_:1})]),_:1}))}}),$D=["role","data-tone"],SD={class:"font-medium"},CD=["aria-label","onClick"],ED=ne({__name:"Toast",setup(e){return(t,a)=>(p(),U(ew,{tag:"div",name:"toast",class:"pointer-events-none fixed inset-x-0 bottom-[88px] z-50 flex flex-col items-center gap-2 px-4"},{default:B(()=>[(p(!0),b(pe,null,De(s(z3),n=>(p(),b("div",{key:n.id,role:n.tone==="danger"?"alert":"status","data-tone":n.tone,class:"pointer-events-auto flex max-w-[560px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},[g("span",{class:me([n.tone==="danger"?"bg-[#f58a8a] text-[#1d2740]":"bg-accent text-on-accent","flex size-[26px] shrink-0 items-center justify-center rounded-full"]),"aria-hidden":"true"},[n.tone==="danger"?(p(),U(s(gt),{key:0,size:16})):(p(),U(s(Na),{key:1,size:16}))],2),g("span",SD,w(n.text),1),g("button",{type:"button","aria-label":s(h)("backend::lang.form.close"),class:"flex size-8 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:r=>s(Sb)(n.id)},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,CD)],8,$D))),128))]),_:1}))}}),AD=[{combo:"mod+s",labelKey:"backend::lang.form.save"},{combo:"mod+enter",labelKey:"backend::lang.form.save_and_close"},{combo:"mod+shift+s",labelKey:"backend::lang.form.create_and_new"},{combo:"escape",labelKey:"backend::lang.shortcuts.leave"},{combo:"/",labelKey:"backend::lang.shortcuts.search"},{combo:"?",labelKey:"backend::lang.shortcuts.help"}],TD=new Set(["mod+s","mod+enter","mod+shift+s"]);function bp(e){const t=typeof navigator>"u"?"":navigator.platform||"";return/mac|iphone|ipad|ipod/i.test(t)}function OD(e){if(/^[a-z]$/i.test(e.key))return e.key.toLowerCase();const t=/^Key([A-Z])$/.exec(e.code??"");return t?t[1].toLowerCase():""}function p0(e){if(e.isComposing)return null;if(e.ctrlKey||e.metaKey)return e.altKey?null:e.key==="Enter"?e.shiftKey?null:"mod+enter":OD(e)==="s"?e.shiftKey?"mod+shift+s":"mod+s":null;if(e.altKey)return null;switch(e.key){case"Escape":return"escape";case"/":return"/";case"?":return"?";default:return null}}function DD(e){if(!e||typeof e.closest!="function")return!1;const t=e;return t.closest('input, textarea, select, [contenteditable]:not([contenteditable="false"])')!==null?!0:t.tagName.includes("-")&&t.closest('form, [role="form"]')!==null}function MD(e){return(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target}function m0(e,t=bp()){switch(e){case"mod+s":return t?["⌘","S"]:["Ctrl","S"];case"mod+enter":return t?["⌘","↩"]:["Ctrl","Enter"];case"mod+shift+s":return t?["⇧","⌘","S"]:["Ctrl","Shift","S"];case"escape":return["Esc"];default:return[e]}}function PD(e,t=bp()){return m0(e,t).join(t?"":"+")}function ja(e,t,a=bp()){return h("backend::lang.shortcuts.hint",{label:e,keys:PD(t,a)})}const mh={"mod+s":"Control+S Meta+S","mod+enter":"Control+Enter Meta+Enter","mod+shift+s":"Control+Shift+S Meta+Shift+S",escape:"Escape","/":"/","?":"?"};function Hu(e){return e.split(/\s+/).filter(t=>t in mh).map(t=>mh[t]).join(" ")}function v0(e=document){return Array.from(e.querySelectorAll('[role="dialog"][aria-modal="true"], [role="alertdialog"]')).filter(a=>a.getAttribute("data-state")!=="closed").at(-1)??e}function _p(e,t){return t.querySelector(`[data-hotkey~="${e}"]`)}function RD(e=document){const t=v0(e);return AD.filter(a=>a.combo==="?"||_p(a.combo,t)!==null)}const xp=A(null),vh=At(xp);function ID(){xp.value=RD()}function h0(){xp.value=null}function y0(e){return e.disabled===!0||e.getAttribute("aria-disabled")==="true"}function hh(e){const t=p0(e);if(!t||!TD.has(t))return;t==="mod+s"&&e.preventDefault();const a=e.target?.ownerDocument??document,n=_p(t,v0(a));if(!n||(e.preventDefault(),e.stopPropagation(),e.repeat||y0(n)))return;const r=yh(a),l=r instanceof HTMLElement&&r!==n&&r!==a.body?r:null;l&&(n.focus({preventScroll:!0}),yh(a)===l&&l.blur()),n.click();const o=a.activeElement;l?.isConnected&&(o===n||o===a.body||o===null)&&l.focus({preventScroll:!0})}function yh(e=document){let t=e.activeElement;for(;t?.shadowRoot?.activeElement;)t=t.shadowRoot.activeElement;return t}function gh(e){const t=p0(e);if(t!=="escape"&&t!=="/"&&t!=="?"||e.defaultPrevented||DD(MD(e)))return;const a=e.target?.ownerDocument??document;if(a.querySelector("[data-dismissable-layer]"))return;if(t==="?"){e.preventDefault(),ID();return}const n=_p(t,a);!n||y0(n)||(e.preventDefault(),n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?(n.focus(),n.select()):n.click())}let ai=0;function qD(){ai===0&&(window.addEventListener("keydown",hh,!0),window.addEventListener("keydown",gh)),ai++;let e=!1;return()=>{e||(e=!0,ai--,ai===0&&(window.removeEventListener("keydown",hh,!0),window.removeEventListener("keydown",gh)))}}const LD={class:"flex items-start gap-3"},ND={class:"flex min-w-0 flex-1 flex-col gap-1"},BD={class:"flex flex-col gap-2.5"},FD=["data-shortcut"],VD={class:"flex shrink-0 items-center gap-1"},zD={class:"text-right text-muted"},jD=ne({__name:"ShortcutHelpDialog",setup(e){function t(a){a||h0()}return(a,n)=>(p(),U(s(Jn),{open:s(vh)!==null,"onUpdate:open":t},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-shortcut-help":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop"},{default:B(()=>[g("div",LD,[g("div",ND,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(s(h)("backend::lang.shortcuts.title")),1)]),_:1}),R(s(pn),{class:"text-muted"},{default:B(()=>[_e(w(s(h)("backend::lang.shortcuts.description")),1)]),_:1})]),R(s(Cr),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:B(()=>[R(s(Vt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),g("dl",BD,[(p(!0),b(pe,null,De(s(vh)??[],r=>(p(),b("div",{key:r.combo,"data-shortcut":r.combo,class:"flex items-center justify-between gap-4"},[g("dt",VD,[(p(!0),b(pe,null,De(s(m0)(r.combo),l=>(p(),b("kbd",{key:l,class:"inline-flex min-w-6 items-center justify-center rounded-pager border border-border bg-subtle px-1.5 font-mono text-[13px]"},w(l),1))),128))]),g("dd",zD,w(s(h)(r.labelKey)),1)],8,FD))),128))])]),_:1})]),_:1})]),_:1},8,["open"]))}}),UD={class:"flex min-w-0 flex-1 flex-col"},HD={class:"flex h-header shrink-0 items-center justify-between gap-4 border-b border-border bg-surface pr-6 pl-8"},KD={class:"flex shrink-0 items-center gap-1"},WD=["title","aria-label"],GD={class:"min-w-0 flex-1 px-8 py-7"},YD=ne({__name:"AppShell",setup(e){const t=ya(),{collapsed:a,watchViewport:n}=Ob(),r=n();Ot(r);const l=qD();Ot(()=>{l(),h0()});const o=`${window.location.origin}/`,i=_(()=>Es(String(t.params.vendor??""),String(t.params.plugin??""))),u=_(()=>i.value?null:t.name==="settings-form"?vc(cs(String(t.params.code??""))):t.name==="plugins"?vc(Xg(t.path)):vc(Su(lo(t.path)))),d=_(()=>(i.value||u.value)&&!a.value?"calc(var(--spacing-rail) + var(--spacing-panel))":"var(--spacing-rail)");return(c,f)=>(p(),b("div",{class:"flex min-h-screen bg-bg text-text",style:ua({"--shell-offset":d.value})},[R(cE),i.value&&!s(a)?(p(),U(vE,{key:0,entry:i.value},null,8,["entry"])):u.value&&!s(a)?(p(),U(_E,{key:1,section:u.value},null,8,["section"])):Y("",!0),g("div",UD,[g("header",HD,[R($E),g("div",KD,[g("a",{"data-view-site":"",href:o,target:"_blank",rel:"noopener noreferrer",title:s(h)("backend::lang.nav.view_site"),"aria-label":s(h)("backend::lang.nav.view_site"),class:"flex size-input items-center justify-center rounded-inner text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text"},[R(s(sb),{class:"size-[18px]","aria-hidden":"true"})],8,WD),R(wD)])]),g("main",GD,[Se(c.$slots,"default")])]),R(ED),R(jD)],4))}}),JD=300*1e3,ZD=30*1e3;function XD(e,t){return e!==""&&t!==""&&e!==t}async function QD(){try{const e=await globalThis.fetch(`${dl.base}/build.json`,{cache:"no-store",credentials:"same-origin"});if(!e.ok)return"";const t=await e.json();if(typeof t!="object"||t===null)return"";const a=t.build;return typeof a=="string"?a:""}catch{return""}}const kp=A(!1);let g0="",b0="";const eM=At(kp);function tM(e,t=dl.build){XD(t,e)&&e!==b0&&(g0=e,kp.value=!0)}function aM(){b0=g0,kp.value=!1}function nM(e={}){const t=e.booted??dl.build;if(t==="")return()=>{};const a=e.check??QD,n=e.interval??JD,r=e.minGap??ZD,l=e.win??window,o=e.doc??document,i=e.now??Date.now;let u=!1,d=Number.NEGATIVE_INFINITY;const c=async()=>{if(!(o.visibilityState==="hidden"||u||i()-d<r)){d=i(),u=!0;try{tM(await a(),t)}finally{u=!1}}},f=()=>{c().catch(()=>{})};o.addEventListener("visibilitychange",f),l.addEventListener("focus",f);const v=l.setInterval(f,n);return()=>{o.removeEventListener("visibilitychange",f),l.removeEventListener("focus",f),l.clearInterval(v)}}const rM={key:0,"data-update-banner":"",role:"status","aria-live":"polite",class:"fixed right-4 bottom-[88px] z-50 flex max-w-[420px] items-center gap-3 rounded-[14px] bg-[#1d2740] py-3 pr-2.5 pl-3.5 text-white shadow-toast"},lM={class:"font-medium"},oM=["aria-label"],sM=ne({__name:"UpdateBanner",setup(e){return(t,a)=>s(eM)?(p(),b("div",rM,[g("span",lM,w(s(h)("backend::lang.version.available")),1),g("button",{type:"button","data-update-reload":"",class:"shrink-0 rounded-pager bg-accent px-3 py-1.5 font-medium text-on-accent transition-opacity duration-150 ease-out hover:opacity-90",onClick:a[0]||(a[0]=n=>s(Eb).reload())},w(s(h)("backend::lang.version.reload")),1),g("button",{type:"button","data-update-close":"","aria-label":s(h)("backend::lang.form.close"),class:"flex size-8 shrink-0 items-center justify-center rounded-pager text-[#c3cbda] transition-colors duration-150 ease-out hover:bg-side-hover hover:text-white",onClick:a[1]||(a[1]=n=>s(aM)())},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,oM)])):Y("",!0)}}),_0=A(0),iM=At(_0);function uM(){_0.value++}const cM=ne({__name:"App",setup(e){const t=ya(),a=_(()=>t.meta.shell===!0);return Ea(()=>{document.title=j2(t)}),(n,r)=>(p(),b(pe,null,[a.value?(p(),U(YD,{key:0},{default:B(()=>[R(s(kd),null,{default:B(({Component:l,route:o})=>[(p(),U(Wt(l),{key:`${o.path}#${s(iM)}`}))]),_:1})]),_:1})):(p(),U(s(kd),{key:1})),R(sM)],64))}}),dM="data-summer-controller",x0="*",jc=new Map,Wd=new Map;let k0="";function w0(){return`${dl.base}/assets/`}function $0(e){if(!e.startsWith(w0())||e.includes("\\"))return!1;for(const a of e){const n=a.codePointAt(0)??0;if(n<=32||n===127)return!1}return!(e.split(/[?#]/,1)[0]??"").split("/").some(a=>{const n=a.toLowerCase().replaceAll("%2e",".");return n==="."||n===".."})}function S0(e){if(!$0(e))return Promise.reject(new Error(`plugin script outside ${w0()}: ${e}`));const t=jc.get(e);if(t)return t;const a=new Promise((n,r)=>{const l=document.createElement("script");l.type="module",l.addEventListener("load",()=>n(),{once:!0}),l.addEventListener("error",()=>{jc.delete(e),l.remove(),r(new Error(`plugin script failed to load: ${e}`))},{once:!0}),l.src=e,document.head.appendChild(l)});return jc.set(e,a),a}function C0(e,t){for(const a of t){const n=`${e}
|
||
${a}`;if(!$0(a)||Wd.has(n))continue;const r=document.createElement("link");r.rel="stylesheet",r.setAttribute(dM,e),r.disabled=!E0(e),r.href=a,Wd.set(n,{owner:e,link:r}),document.head.appendChild(r)}}function fM(e){k0=e;for(const{owner:t,link:a}of Wd.values())a.disabled=!E0(t)}function E0(e){return e===x0||e===k0}function pM(e){C0(x0,e)}async function wp(e,t){C0(e,t?.styles??[]);const a=t?.scripts??[],n=await Promise.allSettled(a.map(r=>S0(r)));return a.filter((r,l)=>n[l]?.status==="rejected")}const A0=new Map;async function T0(){let e=[];try{const{data:t,response:a}=await qe.GET("/field-types");e=a.ok&&t?t.data:[]}catch{return[]}for(const t of e){pM(t.styles??[]);const a=t.scripts??[];A0.set(t.element,Promise.allSettled(a.map(n=>S0(n))).then(n=>a.filter((r,l)=>n[l]?.status==="rejected")))}return e}function mM(e){return A0.get(e)??Promise.resolve([])}const vM={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},hM={class:"flex w-full max-w-[400px] flex-col gap-6"},yM={class:"flex items-center justify-center gap-3"},gM={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},bM={class:"text-[22px] font-bold tracking-[-0.02em]"},_M={key:0,"data-login-hint":"",class:"text-[13px] text-[#566175]"},xM={class:"flex flex-col gap-1.5"},kM={class:"font-semibold"},wM={class:"flex flex-col gap-1.5"},$M={class:"font-semibold"},SM=["aria-invalid"],CM={key:1,role:"alert",class:"flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]"},EM=["disabled"],AM=ne({__name:"LoginView",setup(e){const t=ya(),a=_n(),n=A(""),r=A(""),l=A(!1),o=A(!1),i=_(()=>{const d=ef(t.query.redirect);return d!==null&&new URL(d,"http://admin.invalid").pathname==="/connect"});async function u(){if(!o.value){o.value=!0,l.value=!1;try{if(!await cD(n.value.trim(),r.value)||!await u0()){l.value=!0;return}r.value="",await Promise.all([Jg(),Zg().catch(()=>[]),T0()]),await a.replace(ef(t.query.redirect)??"/")}finally{o.value=!1}}}return(d,c)=>(p(),b("main",vM,[g("div",hM,[g("div",yM,[g("span",gM,[R(s(Ts),{size:20,class:"text-accent","aria-hidden":"true"})]),c[2]||(c[2]=g("span",{class:"text-[18px] font-bold text-white"},[_e("Summer"),g("span",{class:"text-accent"},"CMS")],-1))]),g("form",{class:"flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",novalidate:"",onSubmit:yt(u,["prevent"])},[g("h1",bM,w(s(h)("backend::lang.auth.title")),1),i.value?(p(),b("p",_M,w(s(h)("backend::lang.mcp_connect.login_hint")),1)):Y("",!0),g("label",xM,[g("span",kM,w(s(h)("backend::lang.auth.login")),1),ha(g("input",{"onUpdate:modelValue":c[0]||(c[0]=f=>n.value=f),name:"login",type:"text",autocomplete:"username",required:"",class:"h-input rounded-control border border-[#d2d8e2] bg-white px-3.5"},null,512),[[kr,n.value]])]),g("label",wM,[g("span",$M,w(s(h)("backend::lang.auth.password")),1),ha(g("input",{"onUpdate:modelValue":c[1]||(c[1]=f=>r.value=f),name:"password",type:"password",autocomplete:"current-password",required:"","aria-invalid":l.value?"true":void 0,class:me([l.value?"border-[#c62828]":"border-[#d2d8e2]","h-input rounded-control border bg-white px-3.5"])},null,10,SM),[[kr,r.value]])]),l.value?(p(),b("div",CM,[R(s(gt),{size:18,"aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.auth.invalid")),1)])):Y("",!0),g("button",{type:"submit",disabled:o.value,class:"h-input rounded-control bg-[#22304d] font-semibold text-white disabled:opacity-60"},w(s(h)("backend::lang.auth.submit")),9,EM)],32)])]))}}),bh=/^\d+$/;function O0(e,t,a){const n=wu(t),r=Ga(t);if(!n||!r)return"/";const o=((e??"").trim().split(/[?#]/,1)[0]??"").split("/").filter(c=>c!==""),i=[n.vendor,n.plugin,n.controller];if(!i.every((c,f)=>o[f]?.toLowerCase()===c.toLowerCase()))return r;const d=o.slice(i.length);if(d.length===0)return r;if(d.length===1&&d[0]==="create")return`${r}/create`;if(d.length===2&&d[0]==="update"){const c=d[1]===":id"?String(a??""):d[1]??"";return bh.test(c)?`${r}/${c}`:r}if(d.length===2&&d[0]==="preview"){const c=d[1]===":id"?String(a??""):d[1]??"";return bh.test(c)?`${r}/${c}/preview`:r}return r}const _h=/^[0-9]+$/;function TM(e,t){const a=e.replace(/[\s ]/g,"");if(a==="")return{value:null,error:null};let n=a,r=!1;n.startsWith("-")&&(r=!0,n=n.slice(1));const l=n.match(/[.,]/g)??[];if(l.length>1)return{value:null,error:"invalid"};const[o,i=""]=n.split(/[.,]/);if(!_h.test(o??"")||l.length===1&&!_h.test(i))return{value:null,error:"invalid"};if(i.replace(/0+$/,"").length>t)return{value:null,error:"too_precise"};const u=i===""?o:`${o}.${i}`;return{value:`${r?"-":""}${u}`,error:null}}function OM(e){const[t,a]=e.split(".");if(a===void 0||a.length<=2)return e;let n=a.length;for(;n>2&&a.charAt(n-1)==="0";)n-=1;return`${t}.${a.slice(0,n)}`}function DM(e){return new Intl.NumberFormat(e).formatToParts(1.1).find(a=>a.type==="decimal")?.value??"."}function D0(e,t,a,n=4){const r={minimumFractionDigits:2,maximumFractionDigits:Math.max(2,n)},l=t===""?{style:"decimal",...r}:{style:"currency",currency:t,currencyDisplay:"code",...r};let o;try{o=new Intl.NumberFormat(a,l)}catch{return`${new Intl.NumberFormat(a,{style:"decimal",...r}).format(e)} ${t}`.trim()}return o.format(e)}const MM={key:0,"data-switch":"true",class:"inline-flex h-6 items-center gap-1 rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},PM={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},RM={key:1,class:"text-muted","data-empty":""},IM={key:2,class:"text-[13px] text-muted tabular-nums"},qM={key:3,"data-money":"",class:"tabular-nums whitespace-nowrap"},Al=ne({__name:"CellValue",props:{column:{},value:{},row:{}},setup(e){const t=e;function a(m){return m==null||m===""}function n(m){return a(m)?"":Array.isArray(m)?m.map(n).filter(y=>y!=="").join(", "):typeof m=="boolean"?h(m?"backend::lang.list.column_switch_true":"backend::lang.list.column_switch_false"):typeof m=="object"?"":String(m)}function r(m){return String(m).padStart(2,"0")}function l(m){if(typeof m!="string"&&typeof m!="number")return"";const y=new Date(m);return Number.isNaN(y.getTime())?String(m):`${y.getFullYear()}-${r(y.getMonth()+1)}-${r(y.getDate())} ${r(y.getHours())}:${r(y.getMinutes())}`}function o(m){if(typeof m!="string")return"";const y=/^\d{4}-\d{2}-\d{2}/.exec(m.trim());return y?y[0]:m.trim()}function i(m){if(typeof m!="string")return"";const y=/(\d{2}):(\d{2})/.exec(m);return y?`${y[1]}:${y[2]}`:m.trim()}function u(m){return typeof m=="string"?m!==""&&m!=="0"&&m.toLowerCase()!=="false":!!m}function d(){if(t.column.currencyFrom){const m=t.row?.[t.column.currencyFrom];return typeof m=="string"?m.trim():""}return t.column.currency??""}function c(m){return typeof m!="string"||m.trim()===""?"":D0(m.trim(),d(),La.value,4)}const f=_(()=>t.column.type==="switch"?"switch":t.column.type==="money"?"money":t.column.type==="datetime"?"datetime":t.column.type==="date"?"date":t.column.type==="time"?"time":"text"),v=_(()=>{switch(f.value){case"datetime":return l(t.value);case"date":return o(t.value);case"time":return i(t.value);case"money":return c(t.value);default:return n(t.value)}});return(m,y)=>f.value==="switch"&&!a(e.value)?(p(),b(pe,{key:0},[u(e.value)?(p(),b("span",MM,[R(s(tb),{size:14,"aria-hidden":"true"}),_e(w(s(h)("backend::lang.list.column_switch_true")),1)])):(p(),b("span",PM,w(s(h)("backend::lang.list.column_switch_false")),1))],64)):v.value===""?(p(),b("span",RM,"—")):f.value==="datetime"||f.value==="date"||f.value==="time"?(p(),b("span",IM,w(v.value),1)):f.value==="money"?(p(),b("span",qM,w(v.value),1)):(p(),b(pe,{key:4},[_e(w(v.value),1)],64))}}),LM={key:0,class:"flex shrink-0 gap-2"},NM=["data-row-state"],BM=ne({__name:"RowStateBadges",props:{states:{},labels:{}},setup(e){const t=e,a={deleted:"border border-border-strong text-muted",negative:"bg-danger-soft text-danger",disabled:"bg-subtle text-muted",customized:"border border-border-strong text-text",outdated:"bg-sel text-text"},n=["deleted","negative","disabled","customized","outdated"],r=_(()=>n.filter(l=>t.states.includes(l)));return(l,o)=>r.value.length>0?(p(),b("span",LM,[(p(!0),b(pe,null,De(r.value,i=>(p(),b("span",{key:i,"data-row-state":i,class:me([a[i],"inline-flex h-6 shrink-0 items-center rounded-pill px-2.5 text-[12px] font-semibold whitespace-nowrap"])},w(e.labels[i]??i),11,NM))),128))])):Y("",!0)}}),FM={class:"overflow-x-auto"},VM={class:"sticky top-0 z-10"},zM={class:"h-row-head border-y border-border bg-subtle"},jM={key:0,scope:"col","data-select":"",class:"w-[52px] pl-5"},UM=["aria-checked","aria-label","disabled"],HM=["aria-sort"],KM=["data-sort","onClick"],WM={key:1,class:"w-[56px] pr-5"},GM=["aria-busy"],YM={key:0,class:"pl-5"},JM={key:1,class:"pr-5"},ZM={key:1},XM=["colspan"],QM={class:"text-muted"},eP=["aria-selected","data-row-states","onClick"],tP={key:0,"data-select":"",class:"pl-5"},aP=["aria-checked","aria-label","onClick"],nP={key:0,class:"flex items-center gap-3"},rP={"data-avatar":"",class:"flex size-[30px] shrink-0 items-center justify-center rounded-full bg-subtle text-[12px] font-bold text-text","aria-hidden":"true"},lP=["onClick"],oP={key:1,class:"flex items-center gap-2"},sP={key:1,"data-trailing":"",class:"w-[56px] pr-5"},M0=ne({__name:"DataTable",props:{columns:{},rows:{},loading:{type:Boolean,default:!1},rowLink:{type:Function,default:void 0},selectable:{type:Boolean,default:!1},selected:{default:()=>[]},sortable:{type:Boolean,default:!1},sort:{default:null},variant:{default:"list"},openable:{type:Boolean,default:!1},trailing:{type:Boolean,default:!1},rowStates:{default:()=>({})},stateLabels:{default:()=>({})}},emits:["update:selected","sort","open"],setup(e,{emit:t}){const a=e,n=t,r=_n();function l(Z){const W=Z.id;return typeof W=="number"||typeof W=="string"?W:null}function o(Z,W){const K=l(Z);return K===null?`row-${W}`:String(K)}function i(Z){return a.rowLink?a.rowLink(Z):null}function u(Z,W){if(Z.target?.closest("a, button, input, label, select"))return;if(a.openable){const oe=Z.currentTarget?.querySelector("[data-row-open]")??null;n("open",W,oe);return}const te=i(W);te&&r.push(te)}const d=_(()=>a.rows.map(l).filter(Z=>Z!==null)),c=_(()=>new Set(a.selected.map(String))),f=_(()=>{const Z=d.value,W=Z.filter(K=>c.value.has(String(K))).length;return W===0?"false":W===Z.length?"true":"mixed"});function v(Z){const W=l(Z);return W!==null&&c.value.has(String(W))}function m(){n("update:selected",f.value==="true"?[]:[...d.value])}function y(Z){const W=l(Z);W!==null&&(c.value.has(String(W))?n("update:selected",a.selected.filter(K=>String(K)!==String(W))):n("update:selected",[...a.selected,W]))}function x(Z){if(a.sort?.column===Z.key)return a.sort.dir==="desc"?"descending":"ascending"}function S(Z){return a.sortable&&Z.sortable}const k=_(()=>a.variant==="relation"),C=_(()=>k.value?"h-[56px]":"h-row"),L=_(()=>k.value?3:8);function D(Z){return(typeof Z=="string"||typeof Z=="number"?String(Z):"").split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(K=>K.charAt(0).toUpperCase()).join("")}const T=["deleted","negative","disabled","customized","outdated"];function I(Z){const W=l(Z),K=W===null?void 0:a.rowStates[String(W)];return Array.isArray(K)?T.filter(te=>K.includes(te)):[]}function q(Z,W,K=[]){const te=K.includes("deleted")||K.includes("disabled"),oe=H(Z);return W===0?[te?"font-semibold text-muted":"font-semibold",oe].filter(Boolean).join(" "):[te||k.value||Z.relation?"text-muted":"",oe].filter(Boolean).join(" ")}function H(Z){return Z.type==="money"?"text-right":""}function E(Z){return["min-w-0 truncate",Z.includes("deleted")?"line-through":"no-underline",Z.includes("negative")?"text-danger":Z.includes("deleted")||Z.includes("disabled")?"text-muted":"text-text"]}const P=_(()=>a.columns.filter(Z=>!Z.invisible)),j=_(()=>Math.max(P.value.length+(a.selectable?1:0)+(a.trailing?1:0),1));function O(Z,W){n("open",W,Z.currentTarget)}const N=["w-3/5","w-2/5","w-1/2","w-3/4","w-1/3","w-2/3","w-1/2","w-2/5"];return(Z,W)=>(p(),b("div",FM,[g("table",{class:me([k.value?"min-w-[480px]":"min-w-[640px]","w-full border-collapse text-left"])},[g("thead",VM,[g("tr",zM,[e.selectable?(p(),b("th",jM,[g("button",{type:"button",role:"checkbox","aria-checked":f.value,"aria-label":s(h)("backend::lang.list.select_all"),disabled:e.loading||d.value.length===0,class:me([f.value==="false"?"border-border-strong bg-surface":"border-primary bg-primary text-on-primary","flex size-[18px] items-center justify-center rounded-checkbox border disabled:opacity-60"]),onClick:m},[f.value==="mixed"?(p(),U(s(mb),{key:0,size:14,"aria-hidden":"true"})):f.value==="true"?(p(),U(s(Na),{key:1,size:14,"aria-hidden":"true"})):Y("",!0)],10,UM)])):Y("",!0),(p(!0),b(pe,null,De(P.value,K=>(p(),b("th",{key:K.key,scope:"col","aria-sort":S(K)?x(K)??"none":void 0,class:me([[x(K)?"text-text":"text-muted",H(K)],"px-3.5 text-[12px] font-semibold first:pl-5 last:pr-5"])},[S(K)?(p(),b("button",{key:0,type:"button","data-sort":K.key,class:"inline-flex items-center gap-1 font-semibold",onClick:te=>n("sort",K.key)},[_e(w(K.label)+" ",1),x(K)==="ascending"?(p(),U(s(ab),{key:0,size:14,"aria-hidden":"true"})):x(K)==="descending"?(p(),U(s(Qg),{key:1,size:14,"aria-hidden":"true"})):Y("",!0)],8,KM)):(p(),b(pe,{key:1},[_e(w(K.label),1)],64))],10,HM))),128)),e.trailing?(p(),b("td",WM)):Y("",!0)])]),g("tbody",{"aria-busy":e.loading?"true":void 0},[e.loading?(p(!0),b(pe,{key:0},De(L.value,K=>(p(),b("tr",{key:`skeleton-${K}`,"data-skeleton":"",class:me([C.value,"border-b border-border"])},[e.selectable?(p(),b("td",YM,[...W[0]||(W[0]=[g("span",{class:"block size-[18px] rounded-checkbox bg-skel"},null,-1)])])):Y("",!0),(p(!0),b(pe,null,De(P.value,te=>(p(),b("td",{key:te.key,class:"px-3.5 first:pl-5 last:pr-5"},[g("span",{class:me([N[(K-1)%N.length],"block h-3 rounded-[6px] bg-skel"])},null,2)]))),128)),e.trailing?(p(),b("td",JM)):Y("",!0)],2))),128)):e.rows.length===0?(p(),b("tr",ZM,[g("td",{colspan:j.value,class:"px-5 py-20 text-center"},[Se(Z.$slots,"empty",{},()=>[g("span",QM,w(s(h)("backend::lang.list.no_records")),1)])],8,XM)])):(p(!0),b(pe,{key:2},De(e.rows,(K,te)=>(p(),b("tr",{key:o(K,te),class:me([[C.value,v(K)?"bg-sel":i(K)||e.openable?"hover:bg-hover":"",i(K)||e.openable?"cursor-pointer":""],"border-b border-border transition-colors duration-150 ease-out"]),"aria-selected":e.selectable?v(K)?"true":"false":void 0,"data-row-states":I(K).length>0?I(K).join(" "):void 0,onClick:oe=>u(oe,K)},[e.selectable?(p(),b("td",tP,[g("button",{type:"button",role:"checkbox","aria-checked":v(K)?"true":"false","aria-label":s(h)("backend::lang.list.select_row"),class:me([v(K)?"border-primary bg-primary text-on-primary":"border-border-strong bg-surface","flex size-[18px] items-center justify-center rounded-checkbox border"]),onClick:oe=>y(K)},[v(K)?(p(),U(s(Na),{key:0,size:14,"aria-hidden":"true"})):Y("",!0)],10,aP)])):Y("",!0),(p(!0),b(pe,null,De(P.value,(oe,ye)=>(p(),b("td",{key:oe.key,class:me([q(oe,ye,I(K)),"px-3.5 first:pl-5 last:pr-5"])},[k.value&&ye===0?(p(),b("span",nP,[g("span",rP,w(D(K[oe.key])),1),e.openable?(p(),b("button",{key:0,type:"button","data-row-open":"",class:"min-w-0 truncate text-left font-semibold text-text",onClick:be=>O(be,K)},[R(Al,{column:oe,value:K[oe.key],row:K},null,8,["column","value","row"])],8,lP)):(p(),U(Al,{key:1,column:oe,value:K[oe.key],row:K},null,8,["column","value","row"]))])):ye===0&&I(K).length>0?(p(),b("span",oP,[i(K)?(p(),U(s(qa),{key:0,to:i(K),class:me(E(I(K)))},{default:B(()=>[R(Al,{column:oe,value:K[oe.key],row:K},null,8,["column","value","row"])]),_:2},1032,["to","class"])):(p(),b("span",{key:1,class:me(E(I(K)))},[R(Al,{column:oe,value:K[oe.key],row:K},null,8,["column","value","row"])],2)),R(BM,{states:I(K),labels:e.stateLabels},null,8,["states","labels"])])):ye===0&&i(K)?(p(),U(s(qa),{key:2,to:i(K),class:"text-text no-underline"},{default:B(()=>[R(Al,{column:oe,value:K[oe.key],row:K},null,8,["column","value","row"])]),_:2},1032,["to"])):(p(),U(Al,{key:3,column:oe,value:K[oe.key],row:K},null,8,["column","value","row"]))],2))),128)),e.trailing?(p(),b("td",sP,[Se(Z.$slots,"trailing",{row:K})])):Y("",!0)],10,eP))),128))],8,GM)],2)]))}}),iP=["aria-label"],uP={key:0,class:"flex flex-col gap-1 text-[13px]"},cP={class:"font-semibold text-muted"},dP=["data-filter","value","onChange"],fP=["value"],pP={key:1,class:"flex flex-col gap-1 text-[13px]"},mP={class:"mb-1 font-semibold text-muted"},vP={class:"flex items-center gap-2"},hP=["data-filter","aria-label","value","onChange"],yP=["data-filter","aria-label","value","onChange"],gP={key:2,class:"flex flex-col gap-1 text-[13px]"},bP={class:"font-semibold text-muted"},_P=["data-filter","value","onChange"],xP=["value"],Ao="",ni="h-button rounded-control border border-border-strong bg-surface px-3 text-text",kP=ne({__name:"FilterBar",props:{filters:{},values:{},source:{}},emits:["update"],setup(e,{emit:t}){const a=e,n=t;function r(f){if(f.options&&f.options.length>0)return f.options.map(m=>({value:JSON.stringify(m.value),label:m.label}));const v=[];return f.trueValue!==void 0&&v.push({value:JSON.stringify(f.trueValue),label:h("backend::lang.list.column_switch_true")}),f.falseValue!==void 0&&v.push({value:JSON.stringify(f.falseValue),label:h("backend::lang.list.column_switch_false")}),v}const l=A({});async function o(f){const{data:v}=await qe.GET("/{vendor}/{plugin}/{controller}/filters/{scope}/options",{params:{path:{...a.source,scope:f.name}}});l.value={...l.value,[f.name]:v?.data??[]}}$t(()=>{for(const f of a.filters)f.type==="scope"&&o(f)});const i=Ua({});function u(){for(const f of a.filters){if(f.type!=="daterange")continue;const[v="",m=""]=(a.values[f.name]??"").split(".."),y=i[f.name];(!y||a.values[f.name]!==void 0||y.from!==""&&y.to!=="")&&(i[f.name]={from:v,to:m})}}Be(()=>a.values,u,{immediate:!0,deep:!0});function d(f,v,m){const y={...i[f.name]??{from:"",to:""},[v]:m};i[f.name]=y,y.from!==""&&y.to!==""?n("update",f.name,`${y.from}..${y.to}`):(y.from===""&&y.to===""||a.values[f.name]!==void 0)&&n("update",f.name,null)}function c(f,v){n("update",f.name,v===Ao?null:v)}return(f,v)=>(p(),b("div",{role:"group","aria-label":s(h)("backend::lang.list.filters"),"data-filter-bar":"",class:"flex flex-wrap items-end gap-4 border-t border-border px-5 py-3.5"},[(p(!0),b(pe,null,De(e.filters,m=>(p(),b(pe,{key:m.name},[m.type==="switch"?(p(),b("label",uP,[g("span",cP,w(m.label||m.name),1),g("select",{"data-filter":m.name,value:e.values[m.name]??Ao,class:me(ni),onChange:y=>c(m,y.target.value)},[g("option",{value:Ao},w(s(h)("backend::lang.list.filter_all")),1),(p(!0),b(pe,null,De(r(m),y=>(p(),b("option",{key:y.value,value:y.value},w(y.label),9,fP))),128))],40,dP)])):m.type==="daterange"?(p(),b("fieldset",pP,[g("legend",mP,w(m.label||m.name),1),g("div",vP,[g("input",{type:"date","data-filter":`${m.name}-from`,"aria-label":s(h)("backend::lang.list.filter_from"),value:i[m.name]?.from??"",class:me(ni),onChange:y=>d(m,"from",y.target.value)},null,40,hP),v[0]||(v[0]=g("span",{"aria-hidden":"true"},"–",-1)),g("input",{type:"date","data-filter":`${m.name}-to`,"aria-label":s(h)("backend::lang.list.filter_to"),value:i[m.name]?.to??"",class:me(ni),onChange:y=>d(m,"to",y.target.value)},null,40,yP)])])):m.type==="scope"?(p(),b("label",gP,[g("span",bP,w(m.label||m.name),1),(p(),b("select",{key:`${m.name}-${l.value[m.name]?.length??-1}`,"data-filter":m.name,value:e.values[m.name]??Ao,class:me(ni),onChange:y=>c(m,y.target.value)},[g("option",{value:Ao},w(s(h)("backend::lang.list.filter_all")),1),(p(!0),b(pe,null,De(l.value[m.name]??[],y=>(p(),b("option",{key:y.value,value:y.value},w(y.label),9,xP))),128))],40,_P))])):Y("",!0)],64))),128))],8,iP))}}),wP=["type","disabled","data-hotkey","aria-keyshortcuts"],Ke=ne({__name:"Button",props:{variant:{default:"outline"},size:{default:"md"},type:{default:"button"},disabled:{type:Boolean,default:!1},icon:{default:void 0},to:{default:void 0},hotkey:{default:void 0}},setup(e){const t=e,a={primary:"bg-primary text-on-primary hover:opacity-90",outline:"border border-border-strong bg-surface text-text hover:bg-hover",ghost:"text-muted hover:bg-hover hover:text-text",danger:"border border-danger bg-surface text-danger hover:bg-danger-soft"},n=_(()=>t.hotkey?Hu(t.hotkey):void 0),r=_(()=>["inline-flex shrink-0 items-center justify-center gap-2 rounded-control px-4 font-semibold whitespace-nowrap no-underline transition-colors duration-150 ease-out disabled:cursor-not-allowed disabled:opacity-60",t.size==="sm"?"h-[38px]":"h-button",a[t.variant]]);return(l,o)=>e.to!==void 0?(p(),U(s(qa),{key:0,to:e.to,class:me(r.value),"data-hotkey":e.hotkey,"aria-keyshortcuts":n.value},{default:B(()=>[e.icon?(p(),U(Wt(e.icon),{key:0,size:16,"aria-hidden":"true"})):Y("",!0),Se(l.$slots,"default")]),_:3},8,["to","class","data-hotkey","aria-keyshortcuts"])):(p(),b("button",{key:1,type:e.type,disabled:e.disabled,class:me(r.value),"data-hotkey":e.hotkey,"aria-keyshortcuts":n.value},[e.icon?(p(),U(Wt(e.icon),{key:0,size:16,"aria-hidden":"true"})):Y("",!0),Se(l.$slots,"default")],10,wP))}}),$P=ne({__name:"BulkActionsMenu",props:{actions:{},disabled:{type:Boolean}},emits:["select"],setup(e,{expose:t,emit:a}){const n=a,r=A(null);function l(){const o=r.value?.$el;o instanceof HTMLElement&&o.focus()}return t({focus:l}),(o,i)=>(p(),U(s(J1),{modal:!1},{default:B(()=>[R(s(Q1),{"as-child":"",disabled:e.disabled},{default:B(()=>[R(Ke,{ref_key:"trigger",ref:r,variant:"outline",size:"md","data-action":"bulk-actions",disabled:e.disabled},{default:B(()=>[_e(w(s(h)("backend::lang.list.bulk_actions"))+" ",1),R(s(zn),{size:16,class:"text-muted","aria-hidden":"true"})]),_:1},8,["disabled"])]),_:1},8,["disabled"]),R(s(X1),null,{default:B(()=>[R(s(Z1),{"data-bulk-menu":"",align:"end","side-offset":8,class:"z-50 flex w-[240px] max-w-[320px] flex-col rounded-[14px] border border-border bg-surface p-2 text-text shadow-menu"},{default:B(()=>[(p(!0),b(pe,null,De(e.actions,u=>(p(),U(s(jd),{key:u.name,"data-bulk-action":u.name,class:"flex min-h-10 cursor-pointer items-center rounded-control px-3 py-2 outline-none transition-colors duration-150 ease-out data-[highlighted]:bg-hover",onSelect:d=>n("select",u.name)},{default:B(()=>[_e(w(u.label),1)]),_:2},1032,["data-bulk-action","onSelect"]))),128))]),_:1})]),_:1})]),_:1}))}}),SP={class:"flex flex-wrap items-center justify-between gap-3 px-5 py-4"},CP={key:0,class:"relative block w-[320px] max-w-full"},EP={class:"sr-only"},AP=["value","placeholder"],TP={key:1},OP={class:"flex flex-wrap items-center justify-end gap-2.5"},DP={key:0,"data-selected-pill":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pill bg-sel px-3 text-[13px] font-semibold"},MP=ne({__name:"ListToolbar",props:{showSearch:{type:Boolean},search:{},searchPrompt:{},buttons:{},selectedCount:{},selectedLabel:{},deleteLabel:{},actions:{default:()=>[]},busyAction:{default:null},bulkActions:{default:()=>[]},bulkBusy:{type:Boolean,default:!1}},emits:["update:search","delete","action","bulk"],setup(e,{expose:t,emit:a}){const n=e,r=a,l=_(()=>new Map(n.actions.map(u=>[u.name,u.label]))),o=A(null);function i(){o.value?.focus()}return t({focusBulk:i}),(u,d)=>(p(),b("div",SP,[e.showSearch?(p(),b("label",CP,[g("span",EP,w(s(h)("backend::lang.list.search")),1),R(s(fl),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search","data-list-search":"","data-hotkey":"/","aria-keyshortcuts":"/",value:e.search,placeholder:e.searchPrompt,class:"h-button w-full rounded-control border border-transparent bg-subtle pr-3.5 pl-10",onInput:d[0]||(d[0]=c=>r("update:search",c.target.value))},null,40,AP)])):(p(),b("span",TP)),g("div",OP,[e.selectedCount>0?(p(),b("span",DP,[R(s(Na),{size:14,"aria-hidden":"true"}),_e(w(e.selectedLabel),1)])):Y("",!0),e.bulkActions.length>0?(p(),U($P,{key:1,ref_key:"bulkMenu",ref:o,actions:e.bulkActions,disabled:e.selectedCount===0||e.bulkBusy,onSelect:d[1]||(d[1]=c=>r("bulk",c))},null,8,["actions","disabled"])):Y("",!0),(p(!0),b(pe,null,De(e.buttons,c=>(p(),b(pe,{key:c},[c==="delete"?(p(),U(Ke,{key:0,"data-action":"delete",variant:e.selectedCount>0?"danger":"outline",icon:s(Ir),disabled:e.selectedCount===0,onClick:d[2]||(d[2]=f=>r("delete"))},{default:B(()=>[_e(w(e.deleteLabel),1)]),_:1},8,["variant","icon","disabled"])):l.value.has(c)?(p(),U(Ke,{key:1,variant:"outline",size:"md","data-action":c,disabled:e.busyAction===c,"aria-busy":e.busyAction===c?"true":void 0,onClick:f=>r("action",c)},{default:B(()=>[_e(w(l.value.get(c)),1)]),_:2},1032,["data-action","disabled","aria-busy","onClick"])):Y("",!0)],64))),128))])]))}}),PP={class:"flex flex-wrap items-center gap-x-6 gap-y-3 border-t border-border px-5 py-3.5 text-[13px] text-muted"},RP={"data-range":""},IP={key:0,class:"flex items-center gap-2"},qP=["value"],LP=["value"],NP=["aria-label"],BP=["disabled"],FP={key:0,"aria-hidden":"true",class:"px-1"},VP=["data-page","aria-current","onClick"],zP=["disabled"],Uc="inline-flex h-pager min-w-pager items-center justify-center gap-1 rounded-pager border border-border px-2.5 text-[13px] text-text disabled:cursor-not-allowed disabled:opacity-60 hover:bg-hover",P0=ne({__name:"Pagination",props:{meta:{},loading:{type:Boolean},perPageOptions:{},perPage:{}},emits:["page","perPage"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>a.meta?.total??0),l=_(()=>a.meta?.page??1),o=_(()=>Math.max(a.meta?.last_page??1,1)),i=_(()=>{const c=a.meta;if(!c||c.total===0)return wa("backend::lang.list.results",0);const f=(c.page-1)*c.per_page+1,v=Math.min(c.page*c.per_page,c.total);return h("backend::lang.list.pagination_range",{from:f,to:v,total:c.total})}),u=_(()=>{const c=o.value,f=l.value,v=new Set([1,c,f-1,f,f+1].filter(x=>x>=1&&x<=c));f<=3&&[2,3].forEach(x=>x<=c&&v.add(x)),f>=c-2&&[c-1,c-2].forEach(x=>x>=1&&v.add(x));const m=[...v].sort((x,S)=>x-S),y=[];return m.forEach((x,S)=>{const k=m[S-1];k!==void 0&&x-k>1&&y.push(null),y.push(x)}),y});function d(c){const f=Number(c.target.value);Number.isFinite(f)&&f>0&&n("perPage",f)}return(c,f)=>(p(),b("footer",PP,[g("span",RP,w(e.loading?s(h)("backend::lang.list.loading"):i.value),1),e.perPageOptions.length>1?(p(),b("label",IP,[g("span",null,w(s(h)("backend::lang.list.records_per_page")),1),g("select",{"data-per-page":"",value:String(e.perPage),class:"h-pager rounded-pager border border-border-strong bg-surface px-2 text-text",onChange:d},[(p(!0),b(pe,null,De(e.perPageOptions,v=>(p(),b("option",{key:v,value:String(v)},w(v),9,LP))),128))],40,qP)])):Y("",!0),!e.loading&&r.value>0?(p(),b("nav",{key:1,"aria-label":s(h)("backend::lang.list.pagination"),class:"ml-auto flex items-center gap-1.5"},[g("button",{type:"button","data-page":"prev",class:me(Uc),disabled:l.value<=1,onClick:f[0]||(f[0]=v=>n("page",l.value-1))},[R(s(Cu),{size:14,"aria-hidden":"true"}),_e(w(s(h)("backend::lang.list.prev_page")),1)],8,BP),(p(!0),b(pe,null,De(u.value,(v,m)=>(p(),b(pe,{key:v??`gap-${m}`},[v===null?(p(),b("span",FP,"…")):(p(),b("button",{key:1,type:"button","data-page":v,"aria-current":v===l.value?"page":void 0,class:me([Uc,v===l.value?"border-transparent bg-sel font-bold":""]),onClick:y=>v!==l.value&&n("page",v)},w(v),11,VP))],64))),128)),g("button",{type:"button","data-page":"next",class:me(Uc),disabled:l.value>=o.value,onClick:f[1]||(f[1]=v=>n("page",l.value+1))},[_e(w(s(h)("backend::lang.list.next_page")),1),R(s(so),{size:14,"aria-hidden":"true"})],8,zP)],8,NP)):Y("",!0)]))}}),jP={role:"alert","data-extension-failure":"",class:"flex min-h-input items-center rounded-control border-[1.5px] border-dashed border-border-strong bg-subtle px-3.5 py-2.5 text-[13px] text-muted"},UP={class:"flex min-w-0 items-start gap-2.5"},HP={class:"min-w-0 [overflow-wrap:anywhere]"},Ku=ne({__name:"ExtensionFailure",props:{text:{}},setup(e){return(t,a)=>(p(),b("div",jP,[g("span",UP,[R(s(gt),{size:16,class:"mt-0.5 shrink-0 text-danger","aria-hidden":"true"}),g("span",HP,w(e.text),1)])]))}}),KP=new Set(["div","span","p","strong","em","b","i","u","s","small","mark","code","pre","br","hr","ul","ol","li","dl","dt","dd","h2","h3","h4","h5","h6","table","thead","tbody","tfoot","tr","th","td","caption","section","header","footer","figure","figcaption","blockquote","q","abbr","time","data","meter","progress","sup","sub","a","img"]),WP=new Set(["script","style","template","iframe","object","embed","noscript","textarea","title","xmp","svg","math","form","input","button","select","link","meta","base"]),GP=32,YP=2e3,JP=new Set(["class","title","lang","dir","role"]),ZP={a:new Set(["href"]),img:new Set(["src","alt","width","height"]),td:new Set(["colspan","rowspan","scope"]),th:new Set(["colspan","rowspan","scope"]),time:new Set(["datetime"]),data:new Set(["value"]),meter:new Set(["value","min","max","low","high","optimum"]),progress:new Set(["value","max"])},XP=/^(aria|data)-[a-z0-9_-]+$/;function QP(e,t){if(e==="")return!1;for(const a of e){const n=a.codePointAt(0)??0;if(n<=32||n===127)return!1}return e.startsWith("#")?t:e.startsWith("/")?e.length===1||e[1]!=="/"&&e[1]!=="\\":!1}function eR(e,t,a){return JP.has(t)||ZP[e]?.has(t)===!0||XP.test(t)?e==="a"&&t==="href"||e==="img"&&t==="src"?QP(a,e==="a"):!0:!1}function tR(e,t){const a={};for(const[n,r]of Object.entries(t??{})){const l=n.toLowerCase();typeof r=="string"&&eR(e,l,r)&&(a[l]=r)}return a}function Gd(e,t,a){const n=[];for(const r of e??[]){if(a.left<=0)break;if(r.tag===void 0||r.tag===""){typeof r.text=="string"&&r.text!==""&&(a.left-=1,n.push(r.text));continue}const l=r.tag.toLowerCase();if(WP.has(l))continue;if(!KP.has(l)){n.push(...Gd(r.children,t,a));continue}if(t+1>GP)continue;a.left-=1;const o=Gd(r.children,t+1,a);n.push(Ra(l,tR(l,r.attrs),o.length>0?o:void 0))}return n}function aR(e){return Gd(e,0,{left:YP})}const nR={key:1,"data-partial-loading":"","aria-busy":"true"},rR=["data-partial","aria-busy"],$p=ne({__name:"PartialHost",props:{source:{},name:{},recordId:{default:null},variant:{},reloadKey:{default:0},hint:{type:Boolean,default:!1}},setup(e){const t=e,a=A(null),n=A(!1),r=A(!1);let l=0;const o=u=>aR(u.nodes);o.props=["nodes"];async function i(){const u=++l;r.value=!0;let d=null;try{d=(await qe.GET("/{vendor}/{plugin}/{controller}/partials/{name}",{params:{path:{...t.source,name:t.name},query:t.recordId!=null?{id:t.recordId}:void 0}})).data?.data.nodes??null}catch{d=null}u===l&&(r.value=!1,n.value=d===null,a.value=d)}return Be(()=>t.reloadKey,()=>{i()}),i(),(u,d)=>n.value?(p(),U(Ku,{key:0,"data-partial-failed":"",text:s(h)("backend::lang.extension.partial_failed")},null,8,["text"])):a.value===null?(p(),b("div",nR,[g("div",{"data-partial-skeleton":"",class:me([e.hint?"h-[68px] w-full rounded-inner":e.variant==="header"?"h-[80px] w-full rounded-card":"h-[44px] w-full rounded-control","bg-skel"]),"aria-hidden":"true"},null,2)])):a.value.length>0?(p(),b("div",{key:2,class:"summer-partial","data-partial":e.variant,"aria-busy":r.value?"true":void 0},[R(o,{nodes:a.value},null,8,["nodes"])],8,rR)):Y("",!0)}}),lR={key:0,class:"flex flex-col gap-1.5","data-confirm-prompt":""},oR=["for"],sR=["id","maxlength","placeholder","aria-describedby","disabled","value","onKeydown"],iR=["id"],uR={class:"flex gap-2.5"},cR=["disabled","aria-busy"],Br=ne({__name:"ConfirmDialog",props:{open:{type:Boolean},message:{},title:{default:void 0},confirmLabel:{default:void 0},cancelLabel:{default:void 0},danger:{type:Boolean,default:!1},busy:{type:Boolean,default:!1},prompt:{default:null},value:{default:""}},emits:["update:open","update:value","confirm","cancel"],setup(e,{emit:t}){const a=e,n=t,r=`confirm-${cf()}`,l=A(null),o=_(()=>!!a.prompt&&a.value.trim()==="");function i(c){!c&&a.busy||(n("update:open",c),c||n("cancel"))}function u(){a.busy||o.value||(n("confirm"),n("update:open",!1))}function d(c){n("update:value",c.target.value)}return Be(()=>a.open&&!!a.prompt,async c=>{c&&(await Ue(),l.value?.focus())}),(c,f)=>(p(),U(s(J4),{open:e.open,"onUpdate:open":i},{default:B(()=>[R(s(G4),null,{default:B(()=>[R(s(K4),{class:"pointer-events-auto fixed inset-0 z-[80] bg-overlay"}),R(s(F4),{"data-confirm-dialog":"",class:"pointer-events-auto fixed top-1/2 left-1/2 z-[90] flex w-[calc(100%-32px)] max-w-[440px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop"},{default:B(()=>[R(s(X4),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(e.title??s(h)("backend::lang.form.confirm")),1)]),_:1}),R(s(U4),{class:"text-muted [overflow-wrap:anywhere]"},{default:B(()=>[_e(w(e.message),1)]),_:1}),e.prompt?(p(),b("div",lR,[g("label",{for:`${r}-value`,class:"text-[13px] font-semibold"},w(e.prompt.label),9,oR),g("input",{id:`${r}-value`,ref_key:"promptInput",ref:l,type:"text",autocomplete:"off",maxlength:e.prompt.maxLength,placeholder:e.prompt.placeholder,"aria-describedby":e.prompt.comment?`${r}-comment`:void 0,disabled:e.busy,value:e.value,class:"h-control w-full rounded-control border border-border-strong bg-surface px-3 text-text outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-60",onInput:d,onKeydown:mn(yt(u,["prevent"]),["enter"])},null,40,sR),e.prompt.comment?(p(),b("p",{key:0,id:`${r}-comment`,class:"text-[13px] text-muted"},w(e.prompt.comment),9,iR)):Y("",!0)])):Y("",!0),g("div",uR,[R(s(z4),{"data-action":"cancel",disabled:e.busy,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60"},{default:B(()=>[_e(w(e.cancelLabel??s(h)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),g("button",{type:"button","data-action":"confirm",disabled:e.busy||o.value,"aria-busy":e.busy?"true":void 0,class:me([e.danger?"bg-danger text-white":"bg-primary text-on-primary","inline-flex h-button flex-1 items-center justify-center gap-2 rounded-control font-semibold hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"]),onClick:yt(u,["prevent"])},[e.busy?(p(),U(s(In),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),_e(" "+w(e.confirmLabel??s(h)("backend::lang.form.confirm")),1)],10,cR)])]),_:1})]),_:1})]),_:1},8,["open"]))}});function Fr(){const e=A(null),t=A(!1),a=A("");let n=null,r=null;function l(c){const f=n;n=null,r=null,e.value=null,f?.(c)}function o(c,f){return l(!1),a.value="",e.value=c,r=f??null,new Promise(v=>{n=v})}async function i(){if(t.value||e.value?.prompt&&a.value.trim()==="")return;const c=r;if(c){t.value=!0;try{await c()}finally{t.value=!1}}l(!0)}function u(){t.value||l(!1)}function d(c){a.value=c}return{request:e,busy:t,value:a,ask:o,confirm:i,cancel:u,setValue:d}}const dR={class:"flex flex-col gap-5"},fR={class:"flex flex-wrap items-end justify-between gap-4"},pR={class:"flex flex-col"},mR={class:"text-[26px] font-bold tracking-[-0.02em]"},vR={key:0,"data-record-count":"",class:"text-muted"},hR={key:0,class:"flex items-center gap-2.5"},yR={class:"overflow-hidden rounded-card border border-border bg-surface shadow-card"},gR={key:2,"data-list-failed":"",class:"flex flex-wrap items-center justify-between gap-3 border-t border-border px-5 py-4"},bR={role:"alert",class:"text-danger"},_R={key:0,"data-empty-search":"",class:"flex flex-col items-center gap-3"},xR={class:"flex size-14 items-center justify-center rounded-full bg-subtle text-muted"},kR={class:"text-[17px] font-bold"},wR={class:"max-w-[420px] text-muted"},$R={key:1,"data-empty-list":"",class:"text-muted"},SR=300,CR=ne({__name:"ListView",setup(e){const t=ya(),a=_n(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},r=Cs(n),l=Ga(r)??"/",o=A(null),i=A([]),u=A(null),d=A(!0),c=A(!1),f=A(!1),v=_(()=>c.value||f.value),m=A([]),y=A(!1),x=A(0),S=Fr(),k=_(()=>a0(t.query)),C=A(k.value.search??""),L=_(()=>o.value?.messages),D=_(()=>o.value?.title?o.value.title:Es(n.vendor,n.plugin)?.sideMenu.find(Ee=>Ee.controller===r)?.label??r),T=_(()=>u.value?Xe(L.value?.recordCount,u.value.total):""),I=_(()=>o.value?.toolbarButtons??[]),q=_(()=>I.value.filter(ie=>ie==="create")),H=_(()=>{const ie=o.value?.reorder;if(!ie)return null;const Ee=ie.partition?.column,we=Ee?o.value?.filters.find(Ve=>Ve.column===Ee||Ve.name===Ee):void 0,Le=we?k.value.filter?.[we.name]:void 0;return{path:`${l}/reorder`,query:Le!==void 0&&Le!==""?{partition:String(Le)}:{}}}),E=_(()=>o.value?.toolbarActions??[]),P=_(()=>I.value.filter(ie=>ie==="delete"||E.value.some(Ee=>Ee.name===ie))),j=A(null),O=_(()=>u.value?.row_states??{}),N=_(()=>({deleted:Xe(L.value?.rowStateDeleted),negative:Xe(L.value?.rowStateNegative),disabled:Xe(L.value?.rowStateDisabled),customized:Xe(L.value?.rowStateCustomized),outdated:Xe(L.value?.rowStateOutdated)})),Z=_(()=>(o.value?.bulkActions??[]).filter(ie=>ie.name!=="delete")),W=A(!1),K=A(null),te=_(()=>{const ie=o.value?.perPageOptions??[];return ie.length>0?ie:[o.value?.recordsPerPage||20]}),oe=_(()=>k.value.per_page??u.value?.per_page??o.value?.recordsPerPage??20),ye=_(()=>k.value.sort?{column:k.value.sort,dir:k.value.dir==="desc"?"desc":"asc"}:null);function be(ie){const Ee=o.value?.recordUrl,we=ie.id;return!Ee||typeof we!="number"&&typeof we!="string"?null:O0(Ee,r,we)}function ge(ie){ti(r,ie),a.replace({path:t.path,query:eu(ie)})}const le=Nl({}),ce=_(()=>Nl(k.value)!==le);let F=0,fe=null;function ve(){ge({})}async function J(ie=!1){const Ee=++F;d.value=!0,f.value=!1;let we=null;try{we=await G()}catch{we=null}if(Ee!==F)return;if(!we?.data&&ie){ti(r,{}),a.replace({path:t.path,query:{}});return}if(!we?.data&&we?.response?.status===404&&await he(Ee))return;if(i.value=we?.data?.data??[],u.value=we?.data?.meta??null,f.value=!we?.data,d.value=!1,we?.response?.status===422){ti(r,{});return}const Le=u.value?.last_page??0;Le>=1&&(u.value?.page??0)>Le&&ge({...k.value,page:Le})}async function he(ie){try{const{data:Ee}=await qe.GET("/{vendor}/{plugin}/{controller}/singleton",{params:{path:n}});return ie!==F?!0:Ee?(await a.replace(`${l}/${Ee.data.id}`),!0):!1}catch{return!1}}function G(){return qe.GET("/{vendor}/{plugin}/{controller}",{params:{path:n,query:k.value}})}async function ee(){const ie=await qe.GET("/{vendor}/{plugin}/{controller}/schema/list",{params:{path:n}});o.value=ie.data?.data??null,c.value=!o.value,o.value&&wp(r,o.value.assets)}ee(),Be(()=>Nl(k.value),ie=>{if(ie===le){const we=uD(r),Le=Nl(we);if(Le!==le){fe=Le,a.replace({path:t.path,query:eu(we)});return}}const Ee=fe!==null&&fe===ie;fe=null,ti(r,k.value),m.value=[],C.value=k.value.search??"",J(Ee)},{immediate:!0});let ae=null;function $(ie){C.value=ie,ae!==null&&clearTimeout(ae),ae=setTimeout(()=>{ae=null;const Ee=ie.trim();ge({...k.value,search:Ee===""?void 0:Ee,page:void 0})},SR)}Ot(()=>{ae!==null&&clearTimeout(ae)});function M(){C.value="",ge({...k.value,search:void 0,page:void 0})}function z(ie){const Ee=ye.value;Ee?.column!==ie?ge({...k.value,sort:ie,dir:"asc",page:void 0}):Ee.dir==="asc"?ge({...k.value,sort:ie,dir:"desc",page:void 0}):ge({...k.value,sort:void 0,dir:void 0,page:void 0})}function de(ie){ge({...k.value,page:ie})}function X(ie){ge({...k.value,per_page:ie,page:void 0})}function se(ie,Ee){const we={...k.value.filter??{}};Ee===null?delete we[ie]:we[ie]=Ee,ge({...k.value,filter:we,page:void 0})}async function xe(){const ie=m.value.map(Number).filter(we=>Number.isInteger(we)&&we>0);if(!(ie.length===0||y.value||!await S.ask({message:Xe(L.value?.deleteConfirm,ie.length),confirmLabel:h("backend::lang.form.delete"),danger:!0}))){y.value=!0;try{const we=await qe.POST("/{vendor}/{plugin}/{controller}/bulk-delete",{params:{path:n},body:{ids:ie}});if(we.data){Pe(Xe(L.value?.deleted,we.data.data.deleted)),m.value=[],await J(),x.value+=1;return}Pe(we.error?.error.message||h("backend::lang.list.delete_failed"),"danger")}catch{Pe(h("backend::lang.list.delete_failed"),"danger")}finally{y.value=!1}}}async function $e(ie){const Ee=Z.value.find(Ie=>Ie.name===ie),we=m.value.map(Number).filter(Ie=>Number.isInteger(Ie)&&Ie>0);if(!Ee||we.length===0||W.value)return;const Le=Ee.label??ie;let Ve=0,We=null,tt="";const at=await S.ask({message:Ee.confirm||wa("backend::lang.list.bulk_confirm",we.length,{action:Le}),confirmLabel:Le,danger:!1},async()=>{W.value=!0;try{const Ie=await qe.POST("/{vendor}/{plugin}/{controller}/bulk/{action}",{params:{path:{...n,action:ie}},body:{ids:we}});Ve=Ie.response.status,We=Ie.data?.data??null,tt=Ie.error?.error.message??""}catch{Ve=0}finally{W.value=!1}});if(await new Promise(Ie=>setTimeout(Ie,0)),K.value?.focusBulk(),!at)return;const st=We;if(st){Pe(st.message||wa("backend::lang.list.bulk_done",st.affected)),m.value=[],await J(),x.value+=1;return}if(Ve===409){Pe(h("backend::lang.list.bulk_stale"),"danger"),m.value=[],await J();return}if(Ve===403){Pe(tt||h("backend::lang.list.action_forbidden"),"danger");return}Pe(tt||h("backend::lang.extension.action_failed"),"danger")}async function Ce(ie){if(j.value===null){j.value=ie;try{const Ee=await qe.POST("/{vendor}/{plugin}/{controller}/toolbar/{action}",{params:{path:{...n,action:ie}},body:{}});if(Ee.data){Ee.data.data.message&&Pe(Ee.data.data.message),await J(),x.value+=1;return}Pe(Ee.error?.error.message||h("backend::lang.extension.action_failed"),"danger")}catch{Pe(h("backend::lang.extension.action_failed"),"danger")}finally{j.value=null}}}return(ie,Ee)=>(p(),b("section",dR,[g("header",fR,[g("div",pR,[g("h1",mR,w(D.value),1),T.value?(p(),b("p",vR,w(T.value),1)):Y("",!0)]),q.value.length>0||H.value?(p(),b("div",hR,[H.value?(p(),U(Ke,{key:0,"data-action":"reorder",variant:"outline",icon:s(eb),to:H.value},{default:B(()=>[_e(w(s(h)("backend::lang.messages.list.reorder")),1)]),_:1},8,["icon","to"])):Y("",!0),(p(!0),b(pe,null,De(q.value,we=>(p(),U(Ke,{key:we,"data-action":"create",variant:"primary",icon:s(As),to:`${s(l)}/create`},{default:B(()=>[_e(w(s(Xe)(L.value?.create)),1)]),_:1},8,["icon","to"]))),128))])):Y("",!0)]),o.value?.headerPartial?(p(),U($p,{key:0,variant:"header",source:n,name:o.value.headerPartial,"reload-key":x.value},null,8,["name","reload-key"])):Y("",!0),g("div",yR,[o.value?(p(),U(MP,{key:0,ref_key:"toolbar",ref:K,"show-search":o.value.showSearch,search:C.value,"search-prompt":s(Xe)(L.value?.searchPrompt),buttons:P.value,"selected-count":m.value.length,"selected-label":s(Xe)(L.value?.selected,m.value.length),"delete-label":s(Xe)(L.value?.deleteSelected,m.value.length),actions:E.value,"busy-action":j.value,"bulk-actions":Z.value,"bulk-busy":W.value,"onUpdate:search":$,onDelete:xe,onAction:Ce,onBulk:$e},null,8,["show-search","search","search-prompt","buttons","selected-count","selected-label","delete-label","actions","busy-action","bulk-actions","bulk-busy"])):Y("",!0),o.value&&o.value.filters.length>0?(p(),U(kP,{key:1,filters:o.value.filters,values:k.value.filter??{},source:n,onUpdate:se},null,8,["filters","values"])):Y("",!0),v.value&&!d.value?(p(),b("div",gR,[g("p",bR,w(s(h)("backend::lang.list.load_failed")),1),f.value&&ce.value?(p(),U(Ke,{key:0,"data-action":"reset-list",onClick:ve},{default:B(()=>[_e(w(s(h)("backend::lang.list.reset_list")),1)]),_:1})):Y("",!0)])):(p(),U(M0,{key:3,columns:o.value?.columns??[],rows:i.value,loading:d.value||!o.value,"row-link":be,selectable:o.value?.showCheckboxes??!1,selected:m.value,sortable:o.value?.showSorting??!1,sort:ye.value,"row-states":O.value,"state-labels":N.value,"onUpdate:selected":Ee[0]||(Ee[0]=we=>m.value=we),onSort:z},{empty:B(()=>[k.value.search?(p(),b("div",_R,[g("span",xR,[R(s(yb),{size:24,"aria-hidden":"true"})]),g("p",kR,w(s(Xe)(L.value?.emptySearch,void 0,{term:k.value.search})),1),g("p",wR,w(s(Xe)(L.value?.emptySearchHint,void 0,{term:k.value.search})),1),R(Ke,{"data-action":"clear-search",onClick:M},{default:B(()=>[_e(w(s(h)("backend::lang.list.clear_search")),1)]),_:1})])):(p(),b("p",$R,w(s(Xe)(L.value?.empty)||o.value?.noRecordsMessage||s(h)("backend::lang.list.no_records")),1))]),_:1},8,["columns","rows","loading","selectable","selected","sortable","sort","row-states","state-labels"])),R(P0,{meta:u.value,loading:d.value||!o.value,"per-page-options":te.value,"per-page":oe.value,onPage:de,onPerPage:X},null,8,["meta","loading","per-page-options","per-page"])]),R(Br,{open:s(S).request.value!==null,message:s(S).request.value?.message??"","confirm-label":s(S).request.value?.confirmLabel,danger:s(S).request.value?.danger,busy:s(S).busy.value,onConfirm:s(S).confirm,onCancel:s(S).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"])]))}}),Tr="X-Session-Key",R0="X-Child-Session-Key",ER=32;function bs(){const e=new Uint8Array(ER);globalThis.crypto.getRandomValues(e);let t="";for(const a of e)t+=String.fromCharCode(a);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const AR="X-Upload-Id";async function gr(e){try{const t=await e();return{data:t.data?t.data.data:null,status:t.response.status,error:t.error?.error??null}}catch{return{data:null,status:0,error:null}}}async function tu(e){try{const t=await e();return t.response.ok&&t.data instanceof Blob?t.data:null}catch{return null}}function Rn(e){return encodeURIComponent(String(e))}function I0(e){return`${dl.api}/${Rn(e.vendor)}/${Rn(e.plugin)}/${Rn(e.controller)}`}function TR(e){try{return e===""?null:JSON.parse(e)}catch{return null}}function Sp(e){if(!e)return"";for(const t of Object.values(e.details??{})){const a=Array.isArray(t)?t.find(n=>typeof n=="string"&&n!==""):t;if(typeof a=="string"&&a!=="")return a}return e.message??""}function OR(e,t){const a=t;if((e===200||e===201)&&a?.data)return{ok:!0,item:a.data};const n=Sp(a?.error);return e===413?{ok:!1,reason:"too_large",status:e,message:n}:e===422?{ok:!1,reason:"invalid",status:e,message:n}:e===0?{ok:!1,reason:"network",status:e,message:n}:{ok:!1,reason:"failed",status:e,message:n}}function q0(e,t,a,n,r){let l=null,o=!1;const i=()=>new Promise(d=>{const c=new XMLHttpRequest;l=c,c.open("POST",e),c.setRequestHeader("X-Requested-With",Kg),c.setRequestHeader("Accept","application/json");for(const[v,m]of Object.entries(a))c.setRequestHeader(v,m);r&&c.setRequestHeader(AR,r),c.upload.onprogress=v=>{v.lengthComputable&&n?.(v.loaded,v.total)},c.onload=()=>d({status:c.status,body:TR(c.responseText)}),c.onerror=()=>d("network"),c.ontimeout=()=>d("network"),c.onabort=()=>d("aborted");const f=new FormData;f.append("file_data",t,t.name),c.send(f)});return{promise:(async()=>{let d=await i();return typeof d=="object"&&d.status===401&&!o&&(await bf()&&(d=o?"aborted":await i()),typeof d=="object"&&d.status===401&&D2()),d==="aborted"||o?{ok:!1,reason:"aborted",status:0,message:""}:d==="network"?{ok:!1,reason:"network",status:0,message:""}:OR(d.status,d.body)})(),abort(){o=!0,l?.abort()}}}function L0(e,t,a,n){const r={...e,id:t,field:a},l={[Tr]:n},o=`${I0(e)}/${Rn(t)}/files/${Rn(a)}`;return{list:()=>gr(()=>qe.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}",{params:{path:r,header:l}})),upload:(i,u,d)=>q0(o,i,{...l},u,d),update:(i,u)=>gr(()=>qe.PUT("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...r,file:i},header:l},body:u})),remove:i=>gr(()=>qe.DELETE("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}",{params:{path:{...r,file:i},header:l}})),reorder:i=>gr(()=>qe.POST("/{vendor}/{plugin}/{controller}/{id}/files/{field}/reorder",{params:{path:r,header:l},body:{ids:i}})),download:i=>tu(()=>qe.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/download",{params:{path:{...r,file:i},header:l},parseAs:"blob"})),thumb:i=>tu(()=>qe.GET("/{vendor}/{plugin}/{controller}/{id}/files/{field}/{file}/thumb",{params:{path:{...r,file:i},header:l},parseAs:"blob"}))}}function DR(e,t,a,n,r,l,o){const i={...e,id:t,name:a,child:n,field:r},u={[Tr]:l,[R0]:o},d=`${I0(e)}/${Rn(t)}/relations/${Rn(a)}/records/${Rn(n)}/files/${Rn(r)}`;return{list:()=>gr(()=>qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}",{params:{path:i,header:u}})),upload:(c,f,v)=>q0(d,c,{...u},f,v),update:(c,f)=>gr(()=>qe.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...i,file:c},header:u},body:f})),remove:c=>gr(()=>qe.DELETE("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}",{params:{path:{...i,file:c},header:u}})),reorder:c=>gr(()=>qe.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/reorder",{params:{path:i,header:u},body:{ids:c}})),download:c=>tu(()=>qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/download",{params:{path:{...i,file:c},header:u},parseAs:"blob"})),thumb:c=>tu(()=>qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}/files/{field}/{file}/thumb",{params:{path:{...i,file:c},header:u},parseAs:"blob"}))}}const MR=new Set(["readonly","placeholder","maxlength","minlength","min","max","step","autocomplete","spellcheck","pattern"]);function Vr(e){const t={};for(const[a,n]of Object.entries(e.attributes??{})){const r=a.toLowerCase();!MR.has(r)||n===null||n===!1||(t[r]=n)}return t}function It(e){return["w-full rounded-control border bg-surface px-3.5 text-text transition-colors duration-150 ease-out",e?"border-danger":"border-border-strong"].join(" ")}function Wu(e){return typeof e=="string"?e!==""&&e!=="0"&&e.toLowerCase()!=="false":!!e}function N0(e,t){return typeof e=="number"?t?1:0:t}function B0(e,t,a){const n={};if(t===null||typeof t!="object"||Array.isArray(t))return n;const r=t;for(const l of e.permissionOptions??[]){if(a?.has(l.code))continue;const o=Number(r[l.code]);(o===1||e.mode==="radio"&&o===-1)&&(n[l.code]=o)}return n}const PR=new Set(["mltext","mltextarea","mlmarkdown"]);function RR(e){return e!==void 0&&PR.has(e)}function Or(e){return e?RR(e.type)||!!e.element&&e.translatable===!0:!1}const _s="summer:ml-locale";function IR(e){typeof window>"u"||e===""||window.dispatchEvent(new CustomEvent(_s,{detail:e}))}function dn(e){const t={};if(e===null||typeof e!="object"||Array.isArray(e))return t;for(const[a,n]of Object.entries(e))typeof n=="string"&&(t[a]=n);return t}const qR={class:"flex min-w-0 flex-col"},LR=["for"],NR={key:0,class:"text-danger","aria-hidden":"true"},BR=["id"],FR=["id","name","checked","aria-invalid","aria-describedby"],VR=ne({__name:"CheckboxField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>Wu(a.modelValue));function l(o){n("update:modelValue",N0(a.modelValue,o.target.checked))}return(o,i)=>(p(),b("div",{class:me([e.invalid?"border-danger":"border-border","flex items-center justify-between gap-4 rounded-inner border px-4 py-3.5"]),"data-toggle-card":""},[g("div",qR,[g("label",{for:e.controlId,class:"font-semibold"},[_e(w(e.field.label||e.field.name),1),e.field.required?(p(),b("span",NR," *")):Y("",!0)],8,LR),e.field.comment?(p(),b("p",{key:0,id:`${e.controlId}-comment`,class:"text-[13px] text-muted"},w(e.field.comment),9,BR)):Y("",!0)]),g("input",{id:e.controlId,type:"checkbox",name:e.field.name,checked:r.value,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"size-5 shrink-0 rounded-[6px] accent-primary",onChange:l},null,40,FR)],2))}});function zR(e){return e==="date"||e==="time"?e:"datetime"}function fa(e,t=2){return String(e).padStart(t,"0")}const jR=/(Z|[+-]\d{2}:?\d{2})$/i;function UR(e,t,a=!1){if(typeof t!="string"||t.trim()==="")return null;const n=t.trim();try{if(e==="date")return Jb(n.slice(0,10));if(e==="time"){const l=/(\d{2}:\d{2}(:\d{2})?)/.exec(n.includes("T")?n.slice(n.indexOf("T")):n);return l?pA(l[1]):null}const r=jR.test(n)?n.replace(" ","T"):`${n.replace(" ","T")}Z`;return a?vn($v(r,"UTC")):$v(r,Ja())}catch{return null}}function Hc(e){return`${fa(e.year,4)}-${fa(e.month)}-${fa(e.day)}`}function Kc(e){return`${fa(e.hour)}:${fa(e.minute)}:${fa(e.second)}`}function xh(e,t,a=!1){if(!t)return null;if(e==="time")return"hour"in t?Kc(t):null;if(!("year"in t))return null;if(e==="date")return Hc(t);if(a){const l=t instanceof jn?vn(t):t,o="hour"in l?Kc(l):"00:00:00";return`${Hc(l)}T${o}Z`}const n=t instanceof jn?t:Nf(t instanceof kt?vn(t):t,Ja()),r=Du(n,"UTC");return`${Hc(r)}T${Kc(r)}Z`}const HR={date:"YYYY-MM-DD",datetime:"YYYY-MM-DD HH:mm",time:"HH:mm"},KR=/\[([^\]]*)\]|YYYY|YY|MMMM|MMM|MM|M|dddd|ddd|DD|D|HH|H|hh|h|mm|ss|A|a/g;function WR(e){return"year"in e?new kt(e.year,e.month,e.day):null}function Wc(e,t,a,n){return new Va(e,{...a,timeZone:"UTC"}).formatToParts(t.toDate("UTC")).find(l=>l.type===n)?.value??""}function GR(e,t,a,n){if(!e)return"";const r=a||HR[t],l=WR(e),o="hour"in e?e:null,i=/D/.test(r.replace(/\[[^\]]*\]/g,""));return r.replace(KR,(u,d)=>{if(d!==void 0)return d;switch(u){case"YYYY":return l?fa(l.year,4):"";case"YY":return l?fa(l.year%100):"";case"MMMM":case"MMM":{if(!l)return"";const c=u==="MMMM"?"long":"short";return i?Wc(n,l,{day:"numeric",month:c},"month"):Wc(n,l,{month:c},"month")}case"MM":return l?fa(l.month):"";case"M":return l?String(l.month):"";case"dddd":case"ddd":return l?Wc(n,l,{weekday:u==="dddd"?"long":"short"},"weekday"):"";case"DD":return l?fa(l.day):"";case"D":return l?String(l.day):"";case"HH":return o?fa(o.hour):"";case"H":return o?String(o.hour):"";case"hh":return o?fa(o.hour%12||12):"";case"h":return o?String(o.hour%12||12):"";case"mm":return o?fa(o.minute):"";case"ss":return o?fa(o.second):"";case"A":return o?o.hour<12?"AM":"PM":"";case"a":return o?o.hour<12?"am":"pm":"";default:return u}})}const YR=new kt(2026,10,4);function JR(e,t){if(typeof t=="number"&&Number.isInteger(t)&&t>=0&&t<=6)return t;try{return(7-Ou(YR,e))%7}catch{return 1}}function kh(e){if(e)try{return Jb(e.slice(0,10))}catch{return}}function ZR(e,t=Ms(Ja())){const a=kh(e.minDate),n=kh(e.maxDate);if(a||n)return{min:a,max:n};const r=e.yearRange??[];return r.length===1&&typeof r[0]=="number"?{min:new kt(t.year-r[0],1,1),max:new kt(t.year+r[0],12,31)}:r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"?{min:new kt(r[0],1,1),max:new kt(r[1],12,31)}:{}}function Yd(e,t,a,n){if(!e||t==="time")return;if(t==="date")return e;const r=new Sr(e.year,e.month,e.day,n?23:0,n?59:0,n?59:0);return a?r:Du(Nf(r,"UTC"),Ja())}function XR(e,t){const a=Ms(Ja());return Yd(a,e==="time"?"datetime":e,t,!1)??a}const QR=["id","aria-describedby"],eI={key:0},tI={key:1,class:"text-muted","data-empty":""},aI=["aria-label"],nI={class:"flex size-8 shrink-0 items-center justify-center text-muted","aria-hidden":"true"},rI=["data-mode"],lI=["aria-label"],oI={key:0,"data-datepicker-time":"",class:"mt-3 flex items-center gap-2 border-t border-border pt-3"},To="flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",sI=ne({__name:"DatepickerField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>zR(a.field.mode)),l=_(()=>r.value==="datetime"&&!!a.field.ignoreTimezone),o=_(()=>La.value||"pl"),i=_(()=>{const le=a.field.attributes?.readonly;return!!a.field.readOnly||le!=null&&le!==!1}),u=_(()=>UR(r.value,a.modelValue,l.value)),d=_(()=>r.value==="time"?null:u.value),c=_(()=>r.value==="time"?u.value:null),f=_(()=>ZR(a.field)),v=_(()=>Yd(f.value.min,r.value,l.value,!1)),m=_(()=>Yd(f.value.max,r.value,l.value,!0)),y=XR(r.value,l.value),x=_(()=>JR(o.value,a.field.firstDay)),S=_(()=>a.field.twelveHour?12:24),k=_(()=>r.value==="date"?"day":"minute"),C=_(()=>GR(u.value,r.value,a.field.displayFormat,o.value)),L=_(()=>!a.field.required&&u.value!==null&&!i.value),D=_(()=>{const le=d.value;return le?!!v.value&&le.compare(v.value)<0||!!m.value&&le.compare(m.value)>0:!1}),T=new Set(["day","month","year","hour","minute","second"]),I=A(null),q=A(!1);function H(){const le=I.value;if(!le){q.value=!1;return}const ce=Array.from(le.querySelectorAll("[data-reka-date-field-segment], [data-reka-time-field-segment]")).filter(fe=>T.has(fe.dataset.rekaDateFieldSegment??fe.dataset.rekaTimeFieldSegment??"")),F=ce.filter(fe=>!fe.hasAttribute("data-placeholder")).length;q.value=F>0&&F<ce.length}function E(){Ue(H)}Be(u,E);const P=_(()=>!!a.invalid||D.value||q.value),j=_(()=>xh(r.value,u.value,l.value));function O(le){const ce=xh(r.value,le??null,l.value);E(),!(ce===j.value&&(ce!==null||a.modelValue===null))&&n("update:modelValue",ce)}function N(le){if(!le||r.value!=="datetime"){O(le);return}const ce=d.value,F=K.value,fe=!ce||ce.year!==le.year||ce.month!==le.month||ce.day!==le.day,ve=!("hour"in le)||le.hour!==F.hour||le.minute!==F.minute;fe&&ve&&(le=te(le,F)),W.value=le,O(le)}function Z(){n("update:modelValue",null),E()}const W=A(null);Be(d,le=>{W.value=le},{immediate:!0});const K=_(()=>{const le=W.value??d.value;return le&&"hour"in le?new un(le.hour,le.minute):new un(0,0)});function te(le,ce){return"hour"in le?le.set({hour:ce.hour,minute:ce.minute,second:0,millisecond:0}):new Sr(le.year,le.month,le.day,ce.hour,ce.minute)}function oe(le){if(!le)return;const ce=le instanceof un?le:new un(le.hour,le.minute),F=W.value??d.value??y,fe=te(F,ce);W.value=fe,O(fe)}function ye(le){return le.charAt(0).toLocaleUpperCase(o.value)+le.slice(1)}const be=_(()=>[It(P.value),"h-input flex min-w-0 items-center gap-1 pl-3.5 pr-1.5","focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]","has-[[data-invalid]]:border-danger"]);function ge(le){return le==="literal"?"text-muted":le==="timeZoneName"?"ml-2 min-w-0 truncate text-[13px] text-muted":"rounded-[4px] px-0.5 tabular-nums outline-none focus:bg-sel focus:text-text focus-visible:outline-none data-[placeholder]:text-placeholder focus:data-[placeholder]:text-text"}return(le,ce)=>i.value?(p(),b("p",{key:0,id:e.controlId,"data-datepicker-readonly":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 tabular-nums"},[C.value!==""?(p(),b("span",eI,w(C.value),1)):(p(),b("span",tI,"—"))],8,QR)):r.value==="time"?(p(),b("div",{key:1,ref_key:"container",ref:I,"data-datepicker":"","data-mode":"time",class:me(be.value),onKeyup:E,onFocusout:E},[R(s(ch),{id:e.controlId,"model-value":c.value,locale:o.value,"hour-cycle":S.value,granularity:"minute",name:e.field.name,required:e.field.required||void 0,"aria-invalid":P.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center","onUpdate:modelValue":O},{default:B(({segments:F})=>[(p(!0),b(pe,null,De(F,fe=>(p(),U(s(dh),{key:fe.part,part:fe.part,class:me(ge(fe.part))},{default:B(()=>[_e(w(fe.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["id","model-value","locale","hour-cycle","name","required","aria-invalid","aria-describedby"]),L.value?(p(),b("button",{key:0,type:"button","data-action":"clear","aria-label":s(h)("backend::lang.datepicker.clear"),class:me(To),onClick:Z},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,aI)):Y("",!0),g("span",nI,[R(s(Bi),{size:16})])],34)):(p(),U(s($8),{key:2,id:e.controlId,"model-value":d.value,"default-placeholder":d.value??s(y),locale:o.value,granularity:k.value,"hour-cycle":S.value,"hide-time-zone":r.value!=="datetime"||l.value,"min-value":v.value,"max-value":m.value,"week-starts-on":x.value,name:e.field.name,required:e.field.required||void 0,"close-on-select":r.value==="date","prevent-deselect":"","onUpdate:modelValue":N},{default:B(()=>[g("div",{ref_key:"container",ref:I,"data-datepicker":"","data-mode":r.value,class:me(be.value),onKeyup:E,onFocusout:E},[R(s(V8),{"aria-invalid":P.value?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"flex min-w-0 flex-1 items-center overflow-hidden"},{default:B(({segments:F})=>[(p(!0),b(pe,null,De(F,fe=>(p(),U(s(a6),{key:fe.part,part:fe.part,class:me(ge(fe.part))},{default:B(()=>[_e(w(fe.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["aria-invalid","aria-describedby"]),L.value?(p(),b("button",{key:0,type:"button","data-action":"clear","aria-label":s(h)("backend::lang.datepicker.clear"),class:me(To),onClick:Z},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,lI)):Y("",!0),R(s(c6),{"data-action":"open-calendar","aria-label":s(h)("backend::lang.datepicker.open_calendar"),class:me(To)},{default:B(()=>[R(s(rb),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])],42,rI),R(s(B8),{"data-datepicker-calendar":"","side-offset":4,align:"end",class:"z-50 w-[284px] rounded-inner border border-border bg-surface p-4 text-text shadow-menu"},{default:B(()=>[R(s(C8),null,{default:B(({weekDays:F,grid:fe})=>[R(s(X8),{class:"flex h-9 items-center justify-between"},{default:B(()=>[R(s(o6),{"aria-label":s(h)("backend::lang.datepicker.prev_month"),class:me(To)},{default:B(()=>[R(s(Cu),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"]),R(s(e6),{class:"font-semibold"},{default:B(({headingValue:ve})=>[_e(w(ye(ve)),1)]),_:1}),R(s(r6),{"aria-label":s(h)("backend::lang.datepicker.next_month"),class:me(To)},{default:B(()=>[R(s(so),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),_:1}),(p(!0),b(pe,null,De(fe,ve=>(p(),U(s(j8),{key:ve.value.toString(),class:"mt-2 w-full border-collapse select-none"},{default:B(()=>[R(s(W8),null,{default:B(()=>[R(s(oh),{class:"flex"},{default:B(()=>[(p(!0),b(pe,null,De(F,J=>(p(),U(s(J8),{key:J,class:"flex h-9 w-9 items-center justify-center text-[13px] font-normal text-muted"},{default:B(()=>[_e(w(J),1)]),_:2},1024))),128))]),_:2},1024)]),_:2},1024),R(s(H8),null,{default:B(()=>[(p(!0),b(pe,null,De(ve.rows,(J,he)=>(p(),U(s(oh),{key:`week-${he}`,class:"flex"},{default:B(()=>[(p(!0),b(pe,null,De(J,G=>(p(),U(s(A8),{key:G.toString(),date:G,class:"p-0"},{default:B(()=>[R(s(O8),{day:G,month:ve.value,class:"flex size-9 items-center justify-center rounded-pager tabular-nums text-text transition-colors duration-150 ease-out hover:bg-hover data-[outside-view]:text-placeholder data-[today]:font-semibold data-[today]:shadow-[inset_0_0_0_1px_var(--c-border-strong)] data-[selected]:bg-primary data-[selected]:font-semibold data-[selected]:text-on-primary data-[disabled]:cursor-not-allowed data-[disabled]:text-placeholder data-[disabled]:opacity-40 data-[disabled]:hover:bg-transparent data-[unavailable]:cursor-not-allowed data-[unavailable]:opacity-40"},null,8,["day","month"])]),_:2},1032,["date"]))),128))]),_:2},1024))),128))]),_:2},1024)]),_:2},1024))),128))]),_:1}),r.value==="datetime"?(p(),b("div",oI,[R(s(Bi),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),R(s(ch),{"model-value":K.value,locale:o.value,"hour-cycle":S.value,granularity:"minute","hide-time-zone":"",class:"flex min-w-0 items-center","onUpdate:modelValue":oe},{default:B(({segments:F})=>[(p(!0),b(pe,null,De(F,fe=>(p(),U(s(dh),{key:fe.part,part:fe.part,class:me(ge(fe.part))},{default:B(()=>[_e(w(fe.value),1)]),_:2},1032,["part","class"]))),128))]),_:1},8,["model-value","locale","hour-cycle"])])):Y("",!0)]),_:1})]),_:1},8,["id","model-value","default-placeholder","locale","granularity","hour-cycle","hide-time-zone","min-value","max-value","week-starts-on","name","required","close-on-select"]))}}),Ps=Symbol("summer.form.values"),Cp=Symbol("summer.form.patch"),Gu=Symbol("summer.form.locale"),F0=Symbol("summer.form.partialReload"),au=Symbol("summer.form.enabledLocales"),V0=Symbol("summer.form.assets");function Ep(){const e=A(0);return{activeUploads:e,beginUpload(){e.value++;let t=!1;return()=>{t||(t=!0,e.value>0&&e.value--)}}}}const po=Symbol("summer.form.session"),z0=Symbol("summer.settings.secrets"),Ap=Symbol("summer.form.permissionLocks"),Tp=Symbol("summer.form.triggerNotes"),wh="summer-action",iI="summer-result",$h="summer-change",Sh="summer-upload",uI="summer-upload-result",j0=5e3,Op=Symbol("summer.form.feedback"),Rs=Symbol("summer.form.fieldScope"),Dp=Symbol("summer.form.rememberLabel"),U0=Symbol("summer.form.dependentCache"),cI=["data-dependent"],dI={class:"relative"},fI=["id","name","value","disabled","required","aria-required","aria-invalid","aria-busy","aria-describedby"],pI={key:0,value:"state",class:"text-muted"},mI=["value"],vI=["id"],hI={key:1,class:"flex flex-wrap items-center gap-2"},yI=["id"],ri="empty",li="placeholder",gI=ne({__name:"DropdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=" ".repeat(4),l=ct(Rs,null),o=ct(Op,null),i=ct(U0,null)??new Map,u=_(()=>a.field.dependsOn??""),d=_(()=>u.value!==""),c=A("waiting"),f=A([]),v=_(()=>{const K=l?.values.value[u.value];return K==null||K===""||typeof K=="object"?null:String(K)}),m=_(()=>l?.fields.value.find(K=>K.name===u.value)),y=_(()=>m.value?.label||u.value),x=_(()=>(m.value?.options??[]).find(te=>k(te.value,v.value))?.label??v.value??""),S=_(()=>d.value?f.value:a.field.options??[]);function k(K,te){return K==null||te===null||te===void 0?K===te||K==null&&te==null:String(K)===String(te)}function C(){return a.modelValue!==null&&a.modelValue!==void 0&&a.modelValue!==""}function L(){C()&&(n("update:modelValue",null),o?.announce(h("backend::lang.form.dependent_cleared",{field:a.field.label||a.field.name})))}function D(K,te){if(!K.applies){f.value=[],c.value="unused",te&&L();return}f.value=K.options.map(oe=>({value:oe.value,label:r.repeat(Math.max(0,oe.depth))+oe.label})),c.value=f.value.length>0?"ready":"empty",te&&C()&&!f.value.some(oe=>k(oe.value,a.modelValue))&&L()}let T=0,I=!1;async function q(K){const te=++T,oe=v.value;if(oe===null){f.value=[],c.value="waiting",K&&L();return}const ye=l?.path(a.field.name)??a.field.name,be=`${ye}\0${oe}`,ge=i.get(be);if(ge){D(ge,K);return}if(!a.source){I=K,c.value="failed";return}c.value="loading";try{const{data:le}=await qe.GET("/{vendor}/{plugin}/{controller}/fields/{field}/dependent-options",{params:{path:{...a.source,field:ye},query:{[`values[${u.value}]`]:oe}}});if(te!==T)return;if(!le){I=K,c.value="failed";return}i.set(be,le.data),D(le.data,K)}catch{te===T&&(I=K,c.value="failed")}}function H(){q(I)}Be(v,(K,te)=>{d.value&&K!==te&&q(!0)}),$t(()=>{d.value&&q(!1)}),Ot(()=>{T++});const E=_(()=>{const K=S.value.findIndex(te=>k(te.value,a.modelValue));return K>=0?String(K):a.field.emptyOption!==void 0&&!C()?ri:li}),P=_(()=>{switch(c.value){case"waiting":return h("backend::lang.form.dependent_waiting",{field:y.value});case"loading":return h("backend::lang.form.loading_options");case"unused":return h("backend::lang.form.dependent_not_used");case"empty":return h("backend::lang.form.dependent_empty",{type:x.value});case"failed":return h("backend::lang.form.dependent_failed");default:return""}}),j=_(()=>d.value&&c.value!=="ready"),O=_(()=>j.value||E.value===ri||E.value===li),N=_(()=>`${a.controlId}-dependent`),Z=_(()=>[a.describedBy??"",d.value&&(c.value==="empty"||c.value==="failed")?N.value:""].filter(Boolean).join(" "));function W(K){const te=K.target.value;if(te===ri){n("update:modelValue",null);return}const oe=S.value[Number(te)];oe&&n("update:modelValue",oe.value)}return(K,te)=>(p(),b("div",{class:"flex flex-col gap-1.5","data-dependent":d.value?c.value:void 0},[g("div",dI,[g("select",{id:e.controlId,name:e.field.name,value:j.value?"state":E.value,disabled:j.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-busy":d.value&&c.value==="loading"?"true":void 0,"aria-describedby":Z.value||void 0,class:me([[s(It)(e.invalid),O.value?"text-muted":""],"h-input appearance-none pr-10 disabled:cursor-not-allowed"]),onChange:W},[j.value?(p(),b("option",pI,w(P.value),1)):(p(),b(pe,{key:1},[e.field.emptyOption!==void 0?(p(),b("option",{key:0,value:ri,class:"text-muted"},w(e.field.emptyOption),1)):Y("",!0),E.value===li?(p(),b("option",{key:1,value:li,disabled:""},w(s(h)("backend::lang.form.select_placeholder")),1)):Y("",!0),(p(!0),b(pe,null,De(S.value,(oe,ye)=>(p(),b("option",{key:ye,value:String(ye),class:"text-text"},w(oe.label),9,mI))),128))],64))],42,fI),R(s(zn),{size:16,class:"pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"})]),d.value&&c.value==="empty"?(p(),b("p",{key:0,id:N.value,"data-dependent-hint":"",class:"text-[13px] text-muted"},w(P.value),9,vI)):d.value&&c.value==="failed"?(p(),b("div",hI,[g("p",{id:N.value,role:"alert",class:"flex items-center gap-1.5 text-[13px] text-danger"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.form.dependent_failed")),1)],8,yI),R(Ke,{variant:"ghost",size:"sm",icon:s(hi),"data-action":"dependent-retry",onClick:H},{default:B(()=>[_e(w(s(h)("backend::lang.form.dependent_retry")),1)]),_:1},8,["icon"])])):Y("",!0)],8,cI))}}),bI={class:"flex items-start gap-3"},_I={class:"flex min-w-0 flex-1 flex-col gap-1"},xI={key:0,class:"flex items-center gap-4"},kI=["src"],wI={key:1,class:"flex size-16 shrink-0 items-center justify-center rounded-inner bg-subtle","aria-hidden":"true"},$I=["title"],SI={class:"flex flex-col gap-1.5"},CI=["for"],EI=["id","disabled","aria-invalid","aria-describedby"],AI=["id"],TI={class:"flex flex-col gap-1.5"},OI=["for"],DI=["id","disabled","aria-invalid","aria-describedby"],MI=["id"],PI={class:"flex gap-2.5"},RI=["disabled"],II=["aria-keyshortcuts","title","disabled"],qI=ne({__name:"FileCaptionModal",props:{open:{type:Boolean},file:{},routes:{},preview:{},idPrefix:{}},emits:["update:open","saved","closed"],setup(e,{emit:t}){const a=e,n=t,r=A(""),l=A(""),o=A({}),i=A(!1),u=Fr();function d(S){const k={};for(const[C,L]of Object.entries(S??{})){const D=(Array.isArray(L)?L:[L]).filter(T=>typeof T=="string"&&T!=="");D.length>0&&(k[C]=D)}return k}const c=_(()=>`${a.idPrefix}-caption-title`),f=_(()=>`${a.idPrefix}-caption-description`),v=_(()=>!!a.file&&(r.value!==a.file.title||l.value!==a.file.description));Be(()=>a.open,S=>{S&&a.file&&(r.value=a.file.title??"",l.value=a.file.description??"",o.value={},i.value=!1)},{immediate:!0});async function m(S){if(S){n("update:open",!0);return}i.value||v.value&&!await u.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||n("update:open",!1)}async function y(){if(!(i.value||!a.file||!a.routes)){i.value=!0;try{const S=await a.routes.update(a.file.id,{title:r.value,description:l.value});if(S.data){o.value={},n("saved",S.data),n("update:open",!1),Pe(h("backend::lang.fileupload.details_saved"));return}if(S.status===422){o.value=d(S.error?.details),Object.keys(o.value).length===0&&(o.value={title:[Sp(S.error)||h("backend::lang.form.error_generic")]});return}Pe(S.error?.message||h("backend::lang.form.error_generic"),"danger")}finally{i.value=!1}}}function x(S){S.preventDefault(),n("closed")}return(S,k)=>(p(),b(pe,null,[R(s(Jn),{open:e.open,"onUpdate:open":m},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-caption-modal":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop",onCloseAutoFocus:x},{default:B(()=>[g("div",bI,[g("div",_I,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.attachment")),1)]),_:1}),R(s(pn),{class:"text-muted"},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.help")),1)]),_:1})]),R(s(Cr),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),disabled:i.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:B(()=>[R(s(Vt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),e.file?(p(),b("div",xI,[e.preview?(p(),b("img",{key:0,src:e.preview,alt:"",class:"size-16 shrink-0 rounded-inner object-cover"},null,8,kI)):(p(),b("span",wI,[R(s(Ll),{size:16,class:"text-muted"})])),g("span",{class:"min-w-0 truncate text-[13px] text-muted",title:e.file.file_name},w(e.file.file_name),9,$I)])):Y("",!0),g("form",{class:"flex flex-col gap-4",novalidate:"",onSubmit:yt(y,["prevent"])},[g("div",SI,[g("label",{for:c.value,class:"font-semibold"},w(s(h)("backend::lang.fileupload.title_label")),9,CI),ha(g("input",{id:c.value,"onUpdate:modelValue":k[0]||(k[0]=C=>r.value=C),type:"text","data-caption-title":"",disabled:i.value,"aria-invalid":o.value.title?"true":void 0,"aria-describedby":o.value.title?`${c.value}-error`:void 0,class:me([s(It)(!!o.value.title),"h-input"])},null,10,EI),[[kr,r.value]]),o.value.title?(p(),b("p",{key:0,id:`${c.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(o.value.title.join(" ")),1)],8,AI)):Y("",!0)]),g("div",TI,[g("label",{for:f.value,class:"font-semibold"},w(s(h)("backend::lang.fileupload.description_label")),9,OI),ha(g("textarea",{id:f.value,"onUpdate:modelValue":k[1]||(k[1]=C=>l.value=C),rows:"3","data-caption-description":"",disabled:i.value,"aria-invalid":o.value.description?"true":void 0,"aria-describedby":o.value.description?`${f.value}-error`:void 0,class:me([s(It)(!!o.value.description),"min-h-input resize-y py-2.5"])},null,10,DI),[[kr,l.value]]),o.value.description?(p(),b("p",{key:0,id:`${f.value}-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(o.value.description.join(" ")),1)],8,MI)):Y("",!0)]),g("div",PI,[g("button",{type:"button","data-action":"cancel",disabled:i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:k[2]||(k[2]=C=>m(!1))},w(s(h)("backend::lang.form.cancel")),9,RI),g("button",{type:"submit","data-action":"save-caption","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Hu)("mod+s mod+enter"),title:s(ja)(s(h)("backend::lang.fileupload.details_submit"),"mod+s"),disabled:i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60"},w(i.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.fileupload.details_submit")),9,II)])],32)]),_:1})]),_:1})]),_:1},8,["open"]),R(Br,{open:s(u).request.value!==null,message:s(u).request.value?.message??"","confirm-label":s(u).request.value?.confirmLabel,danger:s(u).request.value?.danger,onConfirm:s(u).confirm,onCancel:s(u).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),LI=["id","data-field-name","aria-labelledby","aria-describedby","aria-busy"],NI={key:0,"data-fileupload-loading":"",class:"h-[112px] rounded-control bg-skel","aria-hidden":"true"},BI={key:1,role:"alert","data-fileupload-failed":"",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},FI={key:0,"data-fileupload-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},VI={key:1,"data-fileupload-grid":"",class:"grid grid-cols-[repeat(auto-fill,minmax(160px,1fr))] gap-4"},zI=["data-file-item","data-state","onDragover","onDrop"],jI={class:"relative flex aspect-square items-center justify-center bg-subtle"},UI=["href","aria-label"],HI=["src","alt","onError"],KI=["aria-label","onClick"],WI=["src","alt"],GI={key:2,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},YI=["data-handle","aria-label","onKeydown","onDragstart"],JI={key:5,class:"absolute top-2 right-2 flex gap-1"},ZI=["data-caption","aria-label","onClick"],XI=["aria-label","onClick"],QI=["aria-label","onClick"],eq={class:"flex flex-col gap-1 p-2"},tq=["title"],aq={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},nq={key:0},rq={key:1},lq={key:2},oq={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},sq={key:1,"data-file-error":"",class:"text-[13px] text-danger"},iq={class:"sr-only"},uq={key:2,"data-fileupload-single":"",class:"flex flex-col gap-2"},cq=["data-file-item","data-state"],dq=["src","alt","onError"],fq={key:3,"data-preview-unavailable":"",class:"flex flex-col items-center gap-2 text-[13px] text-muted"},pq={class:"flex min-w-0 flex-1 flex-col gap-1"},mq=["title"],vq={class:"flex items-center gap-2 text-[13px] text-muted tabular-nums"},hq={key:0},yq={key:1},gq={key:2},bq={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},_q={key:1,"data-file-error":"",class:"text-[13px] text-danger"},xq={class:"sr-only"},kq={key:2,class:"mt-1 flex flex-wrap gap-2"},wq={key:3,"data-fileupload-rows":"",class:"flex flex-col gap-2"},$q=["data-file-item","data-state","onDragover","onDrop"],Sq={class:"flex items-center gap-3"},Cq=["data-handle","aria-label","onKeydown","onDragstart"],Eq={class:"flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-pager bg-subtle"},Aq=["src","onError"],Tq={class:"flex min-w-0 flex-1 flex-col leading-tight"},Oq=["title"],Dq=["title"],Mq=["title"],Pq={class:"flex shrink-0 items-center gap-2 text-[13px] text-muted tabular-nums"},Rq={key:0},Iq={key:1},qq={key:2},Lq={key:3,"data-unsaved-chip":"",class:"inline-flex h-6 items-center rounded-pill bg-sel px-2 text-[13px] font-semibold text-text"},Nq={class:"flex shrink-0 items-center gap-1"},Bq=["href","aria-label"],Fq=["aria-label","onClick"],Vq=["data-caption","aria-label","onClick"],zq=["aria-label","onClick"],jq=["aria-label","onClick"],Uq={key:1,"data-file-error":"",class:"text-[13px] text-danger"},Hq={class:"sr-only"},Kq=["aria-describedby"],Wq={class:"flex size-10 items-center justify-center rounded-full bg-surface","aria-hidden":"true"},Gq={class:"text-text"},Yq={key:0,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},Jq={key:5,"data-fileupload-limits":"",class:"text-[13px] text-muted tabular-nums"},Zq={key:6,role:"alert","data-fileupload-too-many":"",class:"flex items-center gap-1.5 text-[13px] text-danger"},Xq=["accept","multiple"],Qq={class:"sr-only","aria-live":"polite","data-fileupload-live":""},eL=1<<20,tL=400,Gc="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:text-text",aL="inline-flex size-8 items-center justify-center rounded-pager border border-border bg-surface text-muted hover:bg-danger-soft hover:text-danger",Tl="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted hover:bg-hover hover:text-text",nL=ne({__name:"FileuploadField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(po,null),n=["jpg","jpeg","png","gif","webp"],r=["image/jpeg","image/png","image/gif","image/webp"];let l=1;const o=A([]),i=A("loading"),u=A(!1),d=A(0),c=A(""),f=A(null),v=A(null),m=A(null),y=A(null),x=A(null),S=A(!1),k=A({}),C=A(new Set),L=A(new Set),D=new Set,T=[],I=a?a.routes(t.field.name):null;let q=null,H=null,E=!1,P=null,j=0,O=!1;const N=_(()=>{const Q=t.field.attributes?.readonly;return!!t.field.readOnly||Q!=null&&Q!==!1}),Z=_(()=>t.field.multiple===!0),W=_(()=>t.field.mode==="image"),K=_(()=>Z.value?t.field.maxFiles:1),te=_(()=>(a?.recordId??0)!==0),oe=_(()=>o.value.filter(Q=>Q.state!=="failed")),ye=_(()=>{if(Z.value)return o.value;const Q=oe.value,Oe=Q[Q.length-1];return o.value.filter(re=>re.state==="failed"||re===Oe)}),be=_(()=>ye.value.filter(Q=>Q.state!=="failed").length),ge=_(()=>N.value||i.value!=="ready"?!1:Z.value?K.value===void 0||K.value===null||oe.value.length<K.value:be.value===0),le=_(()=>Z.value&&!N.value&&typeof K.value=="number"&&oe.value.length>=K.value),ce=_(()=>t.field.fileTypes?.length?t.field.fileTypes.map(Q=>Q.toLowerCase()):W.value&&!t.field.mimeTypes?.length?n:null),F=_(()=>(t.field.fileTypes?.length?t.field.fileTypes:t.field.mimeTypes??[]).join(", ")),fe=_(()=>{const Q=[];for(const Oe of t.field.fileTypes??[])Q.push(`.${Oe.toLowerCase()}`);for(const Oe of t.field.mimeTypes??[])Q.push(Oe.includes("/")?Oe:`.${Oe.toLowerCase()}`);return Q.length===0&&W.value&&Q.push(...r),Q.length>0?Q.join(","):void 0}),ve=_(()=>t.field.prompt||h(Z.value?"backend::lang.fileupload.default_prompt_many":"backend::lang.fileupload.default_prompt"));function J(Q,Oe){return new Intl.NumberFormat(La.value,{minimumFractionDigits:Oe,maximumFractionDigits:Oe}).format(Q)}function he(Q){const Oe=["B","kB","MB","GB"];let re=Q,Ne=0;for(;re>=1e3&&Ne<Oe.length-1;)re/=1e3,Ne++;return`${J(re,Ne===0?0:1)} ${Oe[Ne]}`}const G=_(()=>{const Q=t.field.maxFilesize;return typeof Q=="number"?`${new Intl.NumberFormat(La.value).format(Q)} MB`:""}),ee=_(()=>{const Q=[];return F.value!==""&&Q.push(h("backend::lang.fileupload.limits_types",{types:F.value})),G.value!==""&&Q.push(h("backend::lang.fileupload.limits_size",{size:G.value})),Z.value&&typeof K.value=="number"&&Q.push(h("backend::lang.fileupload.limits_count",{current:oe.value.length,max:K.value})),Q.join(" · ")});function ae(Q){const Oe=Q.lastIndexOf(".");return Oe<0?"":Q.slice(Oe+1).toLowerCase()}function $(Q){const Oe=t.field.mimeTypes??[];if(Oe.length===0||Q.type==="")return!0;const re=Q.type.toLowerCase(),Ne=ae(Q.name);return Oe.some(lt=>{const qt=lt.toLowerCase();return qt.includes("/")?qt.endsWith("/*")?re.startsWith(qt.slice(0,-1)):re===qt:qt===Ne})}function M(Q){const Oe=ce.value;if(Oe&&!Oe.includes(ae(Q.name)))return h("backend::lang.fileupload.wrong_type",{name:Q.name,types:Oe.join(", ")});if(!$(Q))return h("backend::lang.fileupload.wrong_type",{name:Q.name,types:F.value});const re=t.field.maxFilesize;return typeof re=="number"&&Q.size>Math.ceil(re*eL)?h("backend::lang.fileupload.too_large",{name:Q.name,size:G.value}):""}function z(Q){return Ua({uid:l++,name:Q.file_name,size:Q.file_size,state:"done",progress:100,error:"",retryable:!1,file:Q,source:null,handle:null,uploadId:""})}function de(){return globalThis.crypto?.randomUUID?.()??`u${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}function X(Q,Oe){return Ua({uid:l++,name:Q.name,size:Q.size,state:Oe===""?"queued":"failed",progress:0,error:Oe,retryable:!1,file:null,source:wi(Q),handle:null,uploadId:de()})}function se(Q){return o.value.find(Oe=>Oe.uid===Q)}async function xe(Q){if(!I){i.value="failed";return}Q&&(i.value="loading");const Oe=await I.list();if(O)return;if(!Oe.data){Q&&(i.value="failed");return}const re=o.value.filter(Ne=>Ne.state!=="done");for(const Ne of o.value)Ne.state==="done"&&$n(Ne.uid);o.value=[...Oe.data.map(z),...re],i.value="ready"}function $e(){N.value||f.value?.click()}function Ce(Q){if(Q.length===0||N.value)return;if(d.value=0,!Z.value)for(const lt of[...o.value])lt.state!=="failed"&&(lt.state!=="done"||lt.file?.pending)&&st(lt);let Oe=Z.value?typeof K.value=="number"?Math.max(K.value-oe.value.length,0):Number.POSITIVE_INFINITY:1,re=0;const Ne=[];for(const lt of Q.slice(0,Z.value?Q.length:1)){const qt=M(lt);if(qt===""&&Oe<=0){re++;continue}qt===""&&Oe--,Ne.push(X(lt,qt))}o.value=[...o.value,...Ne],d.value=re,Ve()}function ie(Q){const Oe=Q.target;Ce(Array.from(Oe.files??[])),Oe.value=""}function Ee(Q){return m.value===null&&Array.from(Q.dataTransfer?.types??[]).includes("Files")}function we(Q){Ee(Q)&&(Q.preventDefault(),u.value=!0)}function Le(Q){Ee(Q)&&(Q.preventDefault(),u.value=!1,Ce(Array.from(Q.dataTransfer?.files??[])))}function Ve(){if(!I||o.value.some(Oe=>Oe.state==="uploading"))return;const Q=o.value.find(Oe=>Oe.state==="queued");Q&&We(Q)}async function We(Q){if(!I||!Q.source)return;Q.state="uploading",Q.progress=0,Q.error="",Q.retryable=!1;const Oe=new Set(o.value.filter(Ne=>Ne.file).map(Ne=>Ne.file.id)),re=a?.beginUpload();try{const Ne=I.upload(Q.source,(Za,nr)=>{Q.progress=nr>0?Math.min(100,Math.round(Za/nr*100)):0},Q.uploadId||void 0);Q.handle=wi(Ne);const lt=await Ne.promise;Q.handle=null;const qt=!!se(Q.uid);if(lt.ok)!qt||O?I.remove(lt.item.id):(Q.state="done",Q.progress=100,Q.file=lt.item,Q.name=lt.item.file_name,Q.size=lt.item.file_size,a?.markDirty());else if(lt.reason==="aborted"||lt.reason==="network"){const Za=await tt(Oe);if(lt.reason==="aborted"){for(const nr of Za)I.remove(nr.id);o.value=o.value.filter(nr=>nr.uid!==Q.uid),$n(Q.uid)}else qt&&Za[0]&&Za.length===1?(Q.state="done",Q.progress=100,Q.file=Za[0],Q.name=Za[0].file_name,Q.size=Za[0].file_size,a?.markDirty()):(Q.state="failed",Q.error=h("backend::lang.fileupload.upload_failed"),Q.retryable=!0)}else if(qt)switch(Q.state="failed",lt.reason){case"too_large":Q.error=G.value?h("backend::lang.fileupload.too_large",{name:Q.name,size:G.value}):lt.message||h("backend::lang.fileupload.upload_failed");break;case"invalid":Q.error=lt.message||h("backend::lang.fileupload.upload_failed");break;default:Q.error=lt.message||h("backend::lang.fileupload.upload_failed"),Q.retryable=lt.status>=500}}finally{re?.(),O||Ve()}}async function tt(Q){if(!I)return[];const Oe=await I.list();return Oe.data?Oe.data.filter(re=>re.pending&&!Q.has(re.id)):[]}function at(Q){Q.state!=="failed"||!Q.source||(Q.state="queued",Q.error="",Q.retryable=!1,Ve())}async function st(Q){const Oe=o.value.findIndex(Ne=>Ne.uid===Q.uid);if(Oe<0)return;switch(o.value=o.value.filter(Ne=>Ne.uid!==Q.uid),$n(Q.uid),Q.state){case"uploading":Q.handle?.abort(),a?.markDirty(),Ve();return;case"queued":case"failed":return}if(!I||!Q.file)return;a?.markDirty();const re=await I.remove(Q.file.id);if(!re.data&&!O){const Ne=[...o.value];Ne.splice(Math.min(Oe,Ne.length),0,Q),o.value=Ne,Pe(re.error?.message||h("backend::lang.form.error_generic"),"danger")}}function Ie(){return o.value.map(Q=>Q.uid)}function Qe(Q){const Oe=new Map(o.value.map(lt=>[lt.uid,lt])),re=Q.map(lt=>Oe.get(lt)).filter(lt=>!!lt),Ne=o.value.filter(lt=>!Q.includes(lt.uid));o.value=[...re,...Ne]}function ot(){q!==null&&clearTimeout(q),q=setTimeout(()=>{q=null,je()},tL)}function Mt(){return o.value.filter(Q=>Q.state==="done"&&Q.file).map(Q=>Q.file.id)}async function je(){if(!I)return;const Q=Mt();if(E){P=Q;return}const Oe=H;H=null;const re=++j;E=!0;try{const Ne=await I.reorder(Q);if(P)return;!Ne.data&&!O&&re===j&&(Oe&&Qe(Oe),Pe(h("backend::lang.fileupload.reorder_failed"),"danger"))}finally{E=!1,P&&(P=null,je())}}function ze(Q,Oe){const re=o.value.findIndex(qt=>qt.uid===Q);if(re<0||Oe<0||Oe>=o.value.length||Oe===re)return!1;H===null&&(H=Ie());const Ne=[...o.value],[lt]=Ne.splice(re,1);return Ne.splice(Oe,0,lt),o.value=Ne,c.value=h("backend::lang.fileupload.moved",{name:lt.name,position:Oe+1,total:Ne.length}),ot(),!0}async function Ge(Q,Oe){const re=o.value.findIndex(lt=>lt.uid===Oe.uid);let Ne;switch(Q.key){case"ArrowUp":case"ArrowLeft":Ne=re-1;break;case"ArrowDown":case"ArrowRight":Ne=re+1;break;default:return}Q.preventDefault(),ze(Oe.uid,Ne)&&(await Ue(),v.value?.querySelector(`[data-handle="${Oe.uid}"]`)?.focus())}function Bt(Q,Oe){m.value=Oe.uid,Q.dataTransfer&&(Q.dataTransfer.effectAllowed="move",Q.dataTransfer.setData("text/plain",Oe.name))}function ra(Q,Oe){m.value!==null&&(Q.preventDefault(),y.value=Oe.uid)}function er(Q,Oe){m.value!==null&&(Q.preventDefault(),ze(m.value,o.value.findIndex(re=>re.uid===Oe.uid)),wn())}function wn(){m.value=null,y.value=null}function Ba(Q){const Oe=Q.file?.content_type??Q.source?.type??"";return r.includes(Oe.toLowerCase())}function Gt(Q){return!Q.file||!Ba(Q)||C.value.has(Q.uid)?null:!t.field.protected&&!L.value.has(Q.uid)?Q.file.thumb_url||Q.file.url||null:k.value[Q.uid]??null}function tr(){return typeof URL.revokeObjectURL=="function"}function $n(Q){const Oe=k.value[Q];if(Oe!==void 0){tr()&&URL.revokeObjectURL(Oe);const re={...k.value};delete re[Q],k.value=re}if(D.delete(Q),L.value.has(Q)){const re=new Set(L.value);re.delete(Q),L.value=re}}async function ar(Q){if(!I||!Q.file||D.has(Q.uid)||typeof URL.createObjectURL!="function")return;D.add(Q.uid);const Oe=await I.thumb(Q.file.id);if(!(O||!se(Q.uid)||!D.has(Q.uid))){if(!Oe){C.value=new Set([...C.value,Q.uid]);return}k.value={...k.value,[Q.uid]:URL.createObjectURL(Oe)}}}Be(()=>o.value.map(Q=>`${Q.uid}:${Q.state}`).join(","),()=>{if(t.field.protected)for(const Q of o.value)Q.state==="done"&&Ba(Q)&&ar(Q)});function Ae(Q){if(!t.field.protected&&!L.value.has(Q.uid)&&(L.value=new Set([...L.value,Q.uid]),I&&typeof URL.createObjectURL=="function")){ar(Q);return}C.value=new Set([...C.value,Q.uid])}async function Fe(Q,Oe){if(!I||!Q.file||typeof URL.createObjectURL!="function")return;const re=await I.download(Q.file.id);if(!re){Pe(h("backend::lang.form.error_generic"),"danger");return}const Ne=URL.createObjectURL(re);T.push(Ne);const lt=document.createElement("a");lt.href=Ne,lt.rel="noopener",Oe?lt.download=Q.file.file_name:lt.target="_blank",lt.click()}function Ye(Q){return t.field.useCaption&&Q.file?.title?Q.file.title:Q.name}function ut(Q){return te.value&&!!Q.file?.pending}const St=_(()=>x.value===null?void 0:se(x.value));function Pt(Q){x.value=Q.uid,S.value=!0}function zr(Q){const Oe=St.value;Oe&&(Oe.file=Q)}function yo(){const Q=x.value;x.value=null,Q!==null&&v.value?.querySelector(`[data-caption="${Q}"]`)?.focus()}const go=_(()=>{const Q=t.field.thumbOptions?.mode;return Q==="fit"||Q==="auto"?"object-contain":"object-cover"});return $t(()=>{xe(!0)}),a&&Be(a.revision,()=>{xe(!1)}),Ot(()=>{O=!0,q!==null&&(clearTimeout(q),q=null);for(const Q of o.value)Q.handle?.abort();if(tr()){for(const Q of Object.values(k.value))URL.revokeObjectURL(Q);for(const Q of T)URL.revokeObjectURL(Q)}}),(Q,Oe)=>(p(),b("div",{id:e.controlId,ref_key:"root",ref:v,role:"group","data-fileupload":"","data-field-name":e.field.name,"aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":i.value==="loading"?"true":void 0,class:"flex min-w-0 flex-col gap-4"},[i.value==="loading"?(p(),b("span",NI)):i.value==="failed"?(p(),b("p",BI,w(s(h)("backend::lang.fileupload.load_failed")),1)):(p(),b(pe,{key:2},[N.value&&ye.value.length===0?(p(),b("p",FI,w(s(h)("backend::lang.fileupload.empty")),1)):W.value&&Z.value&&ye.value.length>0?(p(),b("ul",VI,[(p(!0),b(pe,null,De(ye.value,re=>(p(),b("li",{key:re.uid,"data-file-item":re.uid,"data-state":re.state,class:me([[re.state==="failed"?"border-danger":"border-border",m.value===re.uid?"opacity-50":"",y.value===re.uid&&m.value!==re.uid?"border-2 border-dashed border-primary bg-sel":""],"relative overflow-hidden rounded-inner border bg-surface"]),onDragover:Ne=>ra(Ne,re),onDrop:Ne=>er(Ne,re)},[g("div",jI,[re.state==="uploading"?(p(),U(s(In),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):re.state==="failed"?(p(),U(s(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):re.state==="done"?(p(),b(pe,{key:2},[Gt(re)&&!e.field.protected&&re.file?.url?(p(),b("a",{key:0,href:re.file.url,target:"_blank",rel:"noopener",class:"block size-full","aria-label":s(h)("backend::lang.fileupload.open_preview",{name:re.name})},[g("img",{src:Gt(re)??void 0,alt:Ye(re),class:me([go.value,"size-full"]),onError:Ne=>Ae(re)},null,42,HI)],8,UI)):Gt(re)?(p(),b("button",{key:1,type:"button",class:"block size-full","aria-label":s(h)("backend::lang.fileupload.open_preview",{name:re.name}),onClick:Ne=>Fe(re,!1)},[g("img",{src:Gt(re)??void 0,alt:Ye(re),class:me([go.value,"size-full"])},null,10,WI)],8,KI)):C.value.has(re.uid)?(p(),b("span",GI,[R(s(iv),{size:20,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.fileupload.preview_unavailable")),1)])):(p(),U(s(Ll),{key:3,size:20,class:"text-muted","aria-hidden":"true"}))],64)):(p(),U(s(Ll),{key:3,size:20,class:"text-muted","aria-hidden":"true"})),!N.value&&re.state==="done"?(p(),b("button",{key:4,type:"button",draggable:"true","data-handle":re.uid,"aria-label":s(h)("backend::lang.fileupload.move",{name:re.name}),class:me([Gc,"absolute top-2 left-2 cursor-grab"]),onKeydown:Ne=>Ge(Ne,re),onDragstart:Ne=>Bt(Ne,re),onDragend:wn},[R(s(Vi),{size:16,"aria-hidden":"true"})],40,YI)):Y("",!0),N.value?Y("",!0):(p(),b("div",JI,[e.field.useCaption&&re.state==="done"?(p(),b("button",{key:0,type:"button","data-caption":re.uid,"aria-label":s(h)("backend::lang.fileupload.edit_details",{name:re.name}),class:me(Gc),onClick:Ne=>Pt(re)},[R(s(Jo),{size:16,"aria-hidden":"true"})],8,ZI)):Y("",!0),re.state==="failed"&&re.retryable?(p(),b("button",{key:1,type:"button","data-action":"retry","aria-label":s(h)("backend::lang.fileupload.retry"),class:me(Gc),onClick:Ne=>at(re)},[R(s(hi),{size:16,"aria-hidden":"true"})],8,XI)):Y("",!0),g("button",{type:"button","data-action":"remove-file","aria-label":re.state==="uploading"||re.state==="queued"?s(h)("backend::lang.fileupload.cancel_upload",{name:re.name}):s(h)("backend::lang.form.remove_item",{name:re.name}),class:me(aL),onClick:Ne=>st(re)},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,QI)]))]),g("div",eq,[g("span",{class:"truncate text-[13px]",title:Ye(re)},w(Ye(re)),9,tq),g("span",aq,[re.state==="queued"?(p(),b("span",nq,w(s(h)("backend::lang.fileupload.queued")),1)):re.state==="uploading"?(p(),b("span",rq,w(s(h)("backend::lang.fileupload.uploading",{percent:re.progress})),1)):(p(),b("span",lq,w(he(re.size)),1)),ut(re)?(p(),b("span",oq,w(s(h)("backend::lang.fileupload.unsaved")),1)):Y("",!0)]),re.state==="uploading"?(p(),U(s(Bc),{key:0,"model-value":re.progress,max:100,"aria-label":s(h)("backend::lang.fileupload.uploading",{percent:re.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:B(()=>[R(s(Fc),{class:"h-full bg-primary",style:ua({width:`${re.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Y("",!0),re.state==="failed"?(p(),b("p",sq,[g("span",iq,w(s(h)("backend::lang.fileupload.upload_error"))+": ",1),_e(w(re.error),1)])):Y("",!0)])],42,zI))),128))])):W.value&&!Z.value&&ye.value.length>0?(p(),b("div",uq,[(p(!0),b(pe,null,De(ye.value,re=>(p(),b("div",{key:re.uid,"data-file-item":re.uid,"data-state":re.state,class:"flex items-start gap-4"},[g("div",{class:me([re.state==="failed"?"border-danger":"border-border","flex size-40 shrink-0 items-center justify-center overflow-hidden rounded-inner border bg-subtle"])},[re.state==="uploading"?(p(),U(s(In),{key:0,size:20,class:"animate-spin text-muted","aria-hidden":"true"})):re.state==="failed"?(p(),U(s(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Gt(re)?(p(),b("img",{key:2,src:Gt(re)??void 0,alt:Ye(re),class:me([go.value,"size-full"]),onError:Ne=>Ae(re)},null,42,dq)):C.value.has(re.uid)?(p(),b("span",fq,[R(s(iv),{size:20,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.fileupload.preview_unavailable")),1)])):(p(),U(s(Ll),{key:4,size:20,class:"text-muted","aria-hidden":"true"}))],2),g("div",pq,[g("span",{class:"truncate font-semibold",title:Ye(re)},w(Ye(re)),9,mq),g("span",vq,[re.state==="queued"?(p(),b("span",hq,w(s(h)("backend::lang.fileupload.queued")),1)):re.state==="uploading"?(p(),b("span",yq,w(s(h)("backend::lang.fileupload.uploading",{percent:re.progress})),1)):(p(),b("span",gq,w(he(re.size)),1)),ut(re)?(p(),b("span",bq,w(s(h)("backend::lang.fileupload.unsaved")),1)):Y("",!0)]),re.state==="uploading"?(p(),U(s(Bc),{key:0,"model-value":re.progress,max:100,"aria-label":s(h)("backend::lang.fileupload.uploading",{percent:re.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:B(()=>[R(s(Fc),{class:"h-full bg-primary",style:ua({width:`${re.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Y("",!0),re.state==="failed"?(p(),b("p",_q,[g("span",xq,w(s(h)("backend::lang.fileupload.upload_error"))+": ",1),_e(w(re.error),1)])):Y("",!0),N.value?Y("",!0):(p(),b("div",kq,[re.state!=="failed"?(p(),U(Ke,{key:0,size:"sm",variant:"outline","data-action":"replace-file",icon:s(Zo),onClick:$e},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):Y("",!0),re.state==="failed"&&re.retryable?(p(),U(Ke,{key:1,size:"sm",variant:"outline","data-action":"retry",icon:s(hi),onClick:Ne=>at(re)},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.retry")),1)]),_:1},8,["icon","onClick"])):Y("",!0),e.field.useCaption&&re.state==="done"?(p(),U(Ke,{key:2,size:"sm",variant:"outline","data-caption":re.uid,icon:s(Jo),onClick:Ne=>Pt(re)},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.details_submit")),1)]),_:1},8,["data-caption","icon","onClick"])):Y("",!0),R(Ke,{size:"sm",variant:"danger","data-action":"remove-file",icon:s(Vt),onClick:Ne=>st(re)},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.remove_file")),1)]),_:1},8,["icon","onClick"])]))])],8,cq))),128))])):ye.value.length>0?(p(),b("ul",wq,[(p(!0),b(pe,null,De(ye.value,re=>(p(),b("li",{key:re.uid,"data-file-item":re.uid,"data-state":re.state,class:me([[re.state==="failed"?"border-danger":"border-border",m.value===re.uid?"opacity-50":"",y.value===re.uid&&m.value!==re.uid?"border-2 border-dashed border-primary bg-sel":""],"flex min-h-14 flex-col justify-center gap-1 rounded-inner border bg-surface px-3 py-2"]),onDragover:Ne=>ra(Ne,re),onDrop:Ne=>er(Ne,re)},[g("div",Sq,[Z.value&&!N.value&&re.state==="done"?(p(),b("button",{key:0,type:"button",draggable:"true","data-handle":re.uid,"aria-label":s(h)("backend::lang.fileupload.move",{name:re.name}),class:me([Tl,"cursor-grab"]),onKeydown:Ne=>Ge(Ne,re),onDragstart:Ne=>Bt(Ne,re),onDragend:wn},[R(s(Vi),{size:16,"aria-hidden":"true"})],40,Cq)):Y("",!0),g("span",Eq,[re.state==="uploading"?(p(),U(s(In),{key:0,size:16,class:"animate-spin text-muted","aria-hidden":"true"})):re.state==="failed"?(p(),U(s(gt),{key:1,size:16,class:"text-danger","aria-hidden":"true"})):Gt(re)?(p(),b("img",{key:2,src:Gt(re)??void 0,alt:"",class:"size-8 object-cover",onError:Ne=>Ae(re)},null,40,Aq)):(p(),U(s(Ll),{key:3,size:16,class:"text-muted","aria-hidden":"true"}))]),g("span",Tq,[e.field.useCaption&&re.file?.title?(p(),b(pe,{key:0},[g("span",{class:"truncate font-semibold",title:re.file.title},w(re.file.title),9,Oq),g("span",{class:"truncate text-[13px] text-muted",title:re.name},w(re.name),9,Dq)],64)):(p(),b("span",{key:1,class:"truncate",title:re.name},w(re.name),9,Mq))]),g("span",Pq,[re.state==="queued"?(p(),b("span",Rq,w(s(h)("backend::lang.fileupload.queued")),1)):re.state==="uploading"?(p(),b("span",Iq,w(s(h)("backend::lang.fileupload.uploading",{percent:re.progress})),1)):(p(),b("span",qq,w(he(re.size)),1)),ut(re)?(p(),b("span",Lq,w(s(h)("backend::lang.fileupload.unsaved")),1)):Y("",!0)]),!Z.value&&!N.value&&re.state!=="failed"?(p(),U(Ke,{key:1,size:"sm",variant:"outline","data-action":"replace-file",icon:s(Zo),onClick:$e},{default:B(()=>[_e(w(s(h)("backend::lang.fileupload.replace_file")),1)]),_:1},8,["icon"])):Y("",!0),g("span",Nq,[re.state==="done"&&re.file?(p(),b(pe,{key:0},[!e.field.protected&&re.file.url?(p(),b("a",{key:0,href:re.file.url,download:"",target:"_blank",rel:"noopener","aria-label":s(h)("backend::lang.fileupload.download",{name:re.name}),class:me(Tl)},[R(s($d),{size:16,"aria-hidden":"true"})],8,Bq)):e.field.protected?(p(),b("button",{key:1,type:"button","data-action":"download","aria-label":s(h)("backend::lang.fileupload.download",{name:re.name}),class:me(Tl),onClick:Ne=>Fe(re,!0)},[R(s($d),{size:16,"aria-hidden":"true"})],8,Fq)):Y("",!0),e.field.useCaption&&!N.value?(p(),b("button",{key:2,type:"button","data-caption":re.uid,"aria-label":s(h)("backend::lang.fileupload.edit_details",{name:re.name}),class:me(Tl),onClick:Ne=>Pt(re)},[R(s(Jo),{size:16,"aria-hidden":"true"})],8,Vq)):Y("",!0)],64)):Y("",!0),re.state==="failed"&&re.retryable?(p(),b("button",{key:1,type:"button","data-action":"retry","aria-label":s(h)("backend::lang.fileupload.retry"),class:me(Tl),onClick:Ne=>at(re)},[R(s(hi),{size:16,"aria-hidden":"true"})],8,zq)):Y("",!0),N.value?Y("",!0):(p(),b("button",{key:2,type:"button","data-action":"remove-file","aria-label":re.state==="uploading"||re.state==="queued"?s(h)("backend::lang.fileupload.cancel_upload",{name:re.name}):s(h)("backend::lang.form.remove_item",{name:re.name}),class:me([Tl,"hover:bg-danger-soft hover:text-danger"]),onClick:Ne=>st(re)},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,jq))])]),re.state==="uploading"?(p(),U(s(Bc),{key:0,"model-value":re.progress,max:100,"aria-label":s(h)("backend::lang.fileupload.uploading",{percent:re.progress}),class:"h-1 w-full overflow-hidden rounded-pill bg-subtle"},{default:B(()=>[R(s(Fc),{class:"h-full bg-primary",style:ua({width:`${re.progress}%`})},null,8,["style"])]),_:2},1032,["model-value","aria-label"])):Y("",!0),re.state==="failed"?(p(),b("p",Uq,[g("span",Hq,w(s(h)("backend::lang.fileupload.upload_error"))+": ",1),_e(w(re.error),1)])):Y("",!0)],42,$q))),128))])):Y("",!0),ge.value?(p(),b("button",{key:4,type:"button","data-fileupload-dropzone":"","aria-describedby":e.describedBy||void 0,class:me([[u.value?"border-solid border-primary bg-sel":e.invalid?"border-dashed border-danger bg-subtle":"border-dashed border-border-strong bg-subtle"],"flex min-h-[112px] w-full flex-col items-center justify-center gap-2 rounded-control border-[1.5px] px-4 py-6 text-center transition-colors duration-150 ease-out hover:bg-hover"]),onClick:$e,onDragover:we,onDragleave:Oe[0]||(Oe[0]=re=>u.value=!1),onDrop:Le},[g("span",Wq,[R(s(Zo),{size:20,class:"text-muted"})]),g("span",Gq,w(ve.value),1),ee.value!==""?(p(),b("span",Yq,w(ee.value),1)):Y("",!0)],42,Kq)):le.value&&ee.value!==""?(p(),b("p",Jq,w(ee.value),1)):Y("",!0),d.value>0?(p(),b("p",Zq,[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(wa)("backend::lang.fileupload.too_many",d.value,{max:K.value??0})),1)])):Y("",!0)],64)),g("input",{ref_key:"input",ref:f,type:"file",hidden:"",tabindex:"-1","data-fileupload-input":"",accept:fe.value,multiple:Z.value||void 0,onChange:ie},null,40,Xq),g("p",Qq,w(c.value),1),e.field.useCaption?(p(),U(qI,{key:3,open:S.value,"onUpdate:open":Oe[1]||(Oe[1]=re=>S.value=re),file:St.value?.file??null,routes:s(I),preview:St.value?Gt(St.value):null,"id-prefix":e.controlId,onSaved:zr,onClosed:yo},null,8,["open","file","routes","preview","id-prefix"])):Y("",!0)],8,LI))}}),rL=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],lL=ne({__name:"NumberField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),l=_(()=>Vr(a.field));function o(i){const u=i.target.value.trim();if(u===""){n("update:modelValue",null);return}const d=Number(u);n("update:modelValue",Number.isFinite(d)?d:null)}return(i,u)=>(p(),b("input",He({id:e.controlId},l.value,{name:e.field.name,type:"number",inputmode:"decimal",value:r.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(It)(e.invalid),"h-input tabular-nums"],onInput:o}),null,16,rL))}}),oL=["id","aria-labelledby","aria-describedby"],sL=ne({__name:"PartialField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(F0,A(0));return(n,r)=>(p(),b("div",{id:e.controlId,role:"group","data-partial-field":"","aria-labelledby":t.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0},[e.source?(p(),U($p,{key:0,variant:"field",source:e.source,name:t.field.path||t.field.name,"record-id":e.recordId??null,"reload-key":s(a)},null,8,["source","name","record-id","reload-key"])):(p(),U(Ku,{key:1,"data-partial-failed":"",text:s(h)("backend::lang.extension.partial_failed")},null,8,["text"]))],8,oL))}}),iL={class:"flex min-w-0 flex-col gap-1.5"},uL={class:"relative"},cL=["id","name","type","value","placeholder","disabled","required","aria-required","aria-invalid","aria-describedby"],dL=["aria-pressed","aria-label","disabled"],fL=["id","data-secret-state","role"],pL={key:3},mL=ne({__name:"PasswordField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=A(!1),l=_(()=>typeof a.modelValue=="string"?a.modelValue:""),o=_(()=>Vr(a.field)),i=ct(po,null);i&&Be(i.revision,()=>{r.value=!1});const u=ct(z0,null),d=_(()=>u?.value[a.field.name]??""),c=_(()=>d.value!==""),f=_(()=>d.value==="stored"&&a.modelValue===null),v=_(()=>`${a.controlId}-secret`),m=_(()=>[a.describedBy??"",c.value?v.value:""].filter(Boolean).join(" ")),y=_(()=>{if(d.value==="stored"&&!f.value)return h("backend::lang.secret.placeholder_stored");const k=o.value.placeholder;return typeof k=="string"?k:void 0});function x(){r.value=!1,n("update:modelValue",null)}function S(){n("update:modelValue","")}return(k,C)=>(p(),b("div",iL,[g("div",uL,[g("input",He({id:e.controlId,autocomplete:"new-password",spellcheck:"false"},o.value,{name:e.field.name,type:r.value?"text":"password",value:f.value?"":l.value,placeholder:y.value,disabled:f.value||void 0,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":m.value||void 0,class:[s(It)(e.invalid),"h-input pr-12"],onInput:C[0]||(C[0]=L=>n("update:modelValue",L.target.value))}),null,16,cL),g("button",{type:"button","data-password-toggle":"","aria-pressed":r.value?"true":"false","aria-label":s(h)(r.value?"backend::lang.form.hide_password":"backend::lang.form.show_password"),disabled:f.value||void 0,class:"absolute top-1/2 right-1.5 flex size-8 -translate-y-1/2 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:opacity-60",onClick:C[1]||(C[1]=L=>r.value=!r.value)},[(p(),U(Wt(r.value?s(oS):s(iS)),{size:16,"aria-hidden":"true"}))],8,dL)]),c.value?(p(),b("p",{key:0,id:v.value,"data-secret-state":f.value?"clearing":d.value,role:f.value?"status":void 0,class:me([f.value?"text-danger":"text-muted","flex flex-wrap items-center gap-2 text-[13px]"])},[f.value?(p(),b(pe,{key:0},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.secret.clear_pending")),1),R(Ke,{variant:"ghost",size:"sm",icon:s(xb),"data-action":"secret-undo",onClick:S},{default:B(()=>[_e(w(s(h)("backend::lang.secret.undo")),1)]),_:1},8,["icon"])],64)):d.value==="stored"?(p(),b(pe,{key:1},[R(s(sn),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.secret.stored")),1),R(Ke,{variant:"ghost",size:"sm",icon:s(Ir),"data-action":"secret-clear",onClick:x},{default:B(()=>[_e(w(s(h)("backend::lang.secret.clear")),1)]),_:1},8,["icon"])],64)):d.value==="env"?(p(),b(pe,{key:2},[R(s(Rr),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.secret.env")),1)],64)):(p(),b("span",pL,w(s(h)("backend::lang.secret.empty")),1))],10,fL)):Y("",!0)]))}}),vL=["aria-labelledby","data-ml-field"],hL={class:"flex flex-wrap items-center gap-2"},yL=["value","aria-label"],gL=["value"],Yu=ne({__name:"MLField",props:{inner:{},innerType:{},mlType:{},contentLocale:{type:Boolean},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>dn(a.modelValue)),l=ct(au,null),o=_(()=>{const k=l?.value;return k&&k.length>0?[...k]:[]}),i=A(o.value[0]??"en"),u=_(()=>`${a.controlId}-label`),d=_(()=>`${a.controlId}-editor`),c=_(()=>r.value[i.value]??""),f=_(()=>({...a.field,type:a.innerType})),v=_(()=>a.contentLocale?{contentLocale:i.value}:{});function m(k){k&&(i.value=k)}function y(k){const C=k.target.value;m(C),IR(C)}function x(k){n("update:modelValue",{...r.value,[i.value]:k})}function S(k){const C=k.detail;typeof C=="string"&&C!==""&&m(C)}return $t(()=>{window.addEventListener(_s,S)}),Wn(()=>{window.removeEventListener(_s,S)}),(k,C)=>(p(),b("div",{class:"flex flex-col gap-1.5",role:"group","aria-labelledby":u.value,"data-ml-field":e.mlType},[g("div",hL,[g("select",{"data-ml-locale":"",class:"rounded-control border border-border-strong bg-surface px-2 py-1 text-[13px]",value:i.value,"aria-label":`Locale for ${e.field.label||e.field.name}`,onChange:y},[(p(!0),b(pe,null,De(o.value,L=>(p(),b("option",{key:L,value:L},w(L),9,gL))),128))],40,yL)]),(p(),U(Wt(e.inner),He({field:f.value,"model-value":c.value,"control-id":d.value,invalid:e.invalid,"described-by":e.describedBy,source:e.source,"record-id":e.recordId},v.value,{"onUpdate:modelValue":x}),null,16,["field","model-value","control-id","invalid","described-by","source","record-id"]))],8,vL))}}),bL=["id","aria-labelledby","aria-describedby","aria-busy"],_L={key:0,"data-plugin-field-skeleton":"",class:"h-[42px] w-full rounded-control bg-skel","aria-hidden":"true"},H0=ne({__name:"PluginField",props:{contentLocale:{},field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=ct(Gu,null),l=A("loading"),o=A(null);let i=null,u=!1;const d=_(()=>r?.value||La.value),c=_(()=>JSON.stringify(a.field.typeOptions??{})),f=_(()=>a.field.readOnly===!0);function v(T,I){if(Object.is(T,I))return!0;if(T===null||I===null||typeof T!="object"||typeof I!="object")return!1;try{return JSON.stringify(T)===JSON.stringify(I)}catch{return!1}}function m(T,I){v(T.value,I)||(T.value=I)}function y(T,I,q){q?T.setAttribute(I,""):T.removeAttribute(I)}function x(T){T.setAttribute("field-name",a.field.name),T.setAttribute("record-id",a.recordId==null?"":String(a.recordId)),T.setAttribute("locale",a.contentLocale??""),T.setAttribute("ui-locale",d.value),T.setAttribute("options",c.value),y(T,"disabled",f.value),y(T,"invalid",a.invalid===!0)}function S(T){let I;return{promise:new Promise((H,E)=>{I=setTimeout(()=>E(new Error("field type element was not defined in time")),T)}),cancel:()=>clearTimeout(I)}}async function k(T){const I=await mM(T);if(customElements.get(T))return;if(I.length>0)throw new Error(`plugin script failed: ${I.join(", ")}`);const q=S(j0);try{await Promise.race([customElements.whenDefined(T),q.promise])}finally{q.cancel()}}async function C(T){const I=i,q=T.detail;if(!I||q===null||typeof q!="object")return;const{id:H,file:E}=q,P=Z=>{!u&&i===I&&I.dispatchEvent(new CustomEvent(uI,{detail:{id:H,...Z}}))},j=()=>h("backend::lang.fileupload.upload_failed"),O=a.source;if(!(E instanceof Blob)||!O){P({error:j()});return}const N=E instanceof File&&E.name!==""?E.name:"upload";try{const Z=await qe.POST("/{vendor}/{plugin}/{controller}/{id}/fields/{field}/upload",{params:{path:{...O,id:a.recordId??0,field:a.field.name}},body:{file:""},bodySerializer:()=>{const K=new FormData;return K.append("file",E,N),K}});if(Z.data){P({url:Z.data.data.url});return}const W=Z.response.status===422?Sp(Z.error?.error):"";P({error:W||j()})}catch{P({error:j()})}}function L(T){C(T)}function D(T){const I=T.detail;I!==null&&typeof I=="object"&&Object.hasOwn(I,"value")&&n("update:modelValue",I.value)}return $t(async()=>{const T=a.field.element??"";try{if(T==="")throw new Error("plugin field without an element");if(await k(T),u||!o.value)return;const I=document.createElement(T);x(I),m(I,a.modelValue),I.addEventListener($h,D),I.addEventListener(Sh,L),o.value.append(I),i=I,l.value="ready"}catch{u||(l.value="failed")}}),Be(()=>[a.recordId,a.invalid,a.contentLocale,f.value,d.value,c.value],()=>{i&&x(i)}),Be(()=>a.modelValue,T=>{i&&m(i,T)},{deep:!0}),Ot(()=>{u=!0,i?.removeEventListener($h,D),i?.removeEventListener(Sh,L),i=null}),(T,I)=>l.value==="failed"?(p(),U(Ku,{key:0,id:e.controlId,"data-plugin-field-failed":"","aria-describedby":e.describedBy||void 0,text:s(h)("backend::lang.extension.widget_failed")},null,8,["id","aria-describedby","text"])):(p(),b("div",{key:1,id:e.controlId,role:"group","data-plugin-field":"","aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":l.value==="loading"?"true":void 0,class:"flex min-h-input min-w-0 flex-col"},[l.value==="loading"?(p(),b("span",_L)):Y("",!0),g("div",{ref_key:"mountPoint",ref:o,class:"contents"},null,512)],8,bL))}}),xL=ne({__name:"MLPluginField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(r,l)=>(p(),U(Yu,He(a,{inner:H0,"inner-type":e.field.type,"ml-type":e.field.type,"content-locale":"","onUpdate:modelValue":l[0]||(l[0]=o=>n("update:modelValue",o))}),null,16,["inner-type","ml-type"]))}}),kL=["id"],wL=["id","aria-labelledby","aria-label","aria-describedby","data-mode"],$L=["aria-labelledby"],SL=["id"],CL={class:"min-w-0 [overflow-wrap:anywhere]"},EL={key:0,class:"shrink-0 text-[12px] font-semibold text-muted","aria-hidden":"true"},AL=["data-permission","data-locked","data-locked-by"],TL={class:"flex min-w-0 flex-col"},OL=["id"],DL=["id"],ML=ne({__name:"PermissionEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=ct(Ap,null),l=_(()=>{const D=new Map;for(const T of r?.value[a.field.name]??[])D.set(T.code,T);return D}),o=_(()=>a.field.permissionOptions??[]),i=_(()=>a.field.mode==="radio"),u=_(()=>!!a.field.readOnly||!!Vr(a.field).readonly),d=_(()=>B0(a.field,a.modelValue)),c=_(()=>{const D=[],T=[];for(const I of o.value){if(!I.tab){T.push(I);continue}let q=D.find(H=>H.label===I.tab);q||(q={key:`tab:${I.tab}`,label:I.tab,options:[]},D.push(q)),q.options.push(I)}return T.length>0&&D.push({key:"other",label:h("backend::lang.permissioneditor.other"),options:T}),D}),f=[{value:"1",label:"backend::lang.permissioneditor.allow",checked:"data-[state=checked]:bg-ok-bg data-[state=checked]:text-ok-text"},{value:"0",label:"backend::lang.permissioneditor.inherit",checked:"data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab"},{value:"-1",label:"backend::lang.permissioneditor.deny",checked:"data-[state=checked]:bg-danger-soft data-[state=checked]:text-danger"}],v=_(()=>`${a.controlId}-label`);function m(D,T){return`${a.controlId}-${D}-${T}`}function y(D){return l.value.get(D.code)}function x(D){return u.value||!!D.locked||y(D)!==void 0}function S(D){return(!!D.locked||y(D)!==void 0)&&!u.value}function k(D){return y(D)?.note||h("backend::lang.permissioneditor.locked")}function C(D){const T=y(D);return T?T.value===1||i.value&&T.value===-1?T.value:0:d.value[D.code]??0}function L(D,T){if(x(D))return;const I={...d.value};T===1||i.value&&T===-1?I[D.code]=T:delete I[D.code],n("update:modelValue",I)}return(D,T)=>o.value.length===0?(p(),b("div",{key:0,id:e.controlId,"data-permission-empty":"",class:"flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 text-muted"},w(s(h)("backend::lang.permissioneditor.empty")),9,kL)):(p(),b("div",{key:1,id:e.controlId,role:"group","aria-labelledby":e.field.label?v.value:void 0,"aria-label":e.field.label?void 0:e.field.name,"aria-describedby":e.describedBy||void 0,class:me([e.invalid?"border-danger":"border-border","overflow-hidden rounded-inner border"]),"data-permission-editor":"","data-mode":i.value?"radio":"checkbox"},[(p(!0),b(pe,null,De(c.value,(I,q)=>(p(),b("div",{key:I.key,role:"group","aria-labelledby":`${e.controlId}-section-${q}`,"data-permission-section":""},[g("h3",{id:`${e.controlId}-section-${q}`,class:me([q>0?"border-t border-border":"","flex h-row-head items-center justify-between gap-4 bg-subtle px-4 font-semibold"])},[g("span",CL,w(I.label),1),i.value?Y("",!0):(p(),b("span",EL,w(s(h)("backend::lang.permissioneditor.allow")),1))],10,SL),(p(!0),b(pe,null,De(I.options,(H,E)=>(p(),b("div",{key:H.code,"data-permission":H.code,"data-locked":S(H)?"":void 0,"data-locked-by":S(H)&&y(H)?"record":void 0,class:"flex min-h-[56px] items-center justify-between gap-x-4 gap-y-2 border-t border-border px-4 py-3 max-sm:flex-col max-sm:items-start"},[g("div",TL,[(p(),U(Wt(i.value?"span":"label"),{id:`${m(q,E)}-label`,for:i.value?void 0:m(q,E),class:"[overflow-wrap:anywhere]"},{default:B(()=>[_e(w(H.label||H.code)+" ",1),S(H)?(p(),U(s(sn),{key:0,size:14,class:"ml-1 inline-block align-[-2px] text-muted","aria-hidden":"true"})):Y("",!0)]),_:2},1032,["id","for"])),S(H)?(p(),b("p",{key:0,id:`${m(q,E)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]","data-permission-locked":""},w(k(H)),9,OL)):H.comment?(p(),b("p",{key:1,id:`${m(q,E)}-note`,class:"text-[13px] text-muted [overflow-wrap:anywhere]"},w(H.comment),9,DL)):Y("",!0)]),i.value?(p(),U(s(vp),{key:0,orientation:"horizontal","model-value":String(C(H)),disabled:x(H),"aria-disabled":x(H)?"true":void 0,"aria-labelledby":`${m(q,E)}-label`,"aria-describedby":S(H)||H.comment?`${m(q,E)}-note`:void 0,class:"inline-flex shrink-0 gap-1 rounded-inner border border-border bg-subtle p-1","onUpdate:modelValue":P=>L(H,Number(P))},{default:B(()=>[(p(),b(pe,null,De(f,P=>R(s(hp),{key:P.value,value:P.value,"data-segment":P.value,class:me([P.checked,"inline-flex h-pager items-center rounded-tab px-4 text-[13px] whitespace-nowrap text-muted transition-colors duration-150 ease-out hover:text-text disabled:cursor-not-allowed disabled:hover:text-muted data-[state=checked]:text-[14px] data-[state=checked]:font-semibold"])},{default:B(()=>[_e(w(s(h)(P.label)),1)]),_:2},1032,["value","data-segment","class"])),64))]),_:1},8,["model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"])):(p(),U(s($O),{key:1,id:m(q,E),"model-value":C(H)===1,disabled:x(H),"aria-disabled":x(H)?"true":void 0,"aria-labelledby":`${m(q,E)}-label`,"aria-describedby":S(H)||H.comment?`${m(q,E)}-note`:void 0,class:"flex size-[18px] shrink-0 items-center justify-center rounded-checkbox border border-border-strong bg-surface disabled:cursor-not-allowed disabled:opacity-60 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-on-primary","onUpdate:modelValue":P=>L(H,P===!0?1:0)},{default:B(()=>[R(s(CO),null,{default:B(()=>[R(s(Na),{size:14,"aria-hidden":"true"})]),_:1})]),_:1},8,["id","model-value","disabled","aria-disabled","aria-labelledby","aria-describedby","onUpdate:modelValue"]))],8,AL))),128))],8,$L))),128))],10,wL))}}),PL=ne({__name:"FieldRenderer",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>u_(a.field));return(l,o)=>(p(),U(Wt(r.value),{field:e.field,"model-value":e.modelValue,"control-id":e.controlId,invalid:e.invalid,"described-by":e.describedBy,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":o[0]||(o[0]=i=>n("update:modelValue",i))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]))}}),RL=["data-field"],IL=["id"],qL={key:0,class:"text-danger","aria-hidden":"true"},LL=["id","for"],NL={key:0,class:"text-danger","aria-hidden":"true"},BL=["id"],FL=["id"],VL=["id"],zL=["id"],jL=ne({__name:"FormField",props:{field:{},modelValue:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>`${a.idPrefix??"field"}-${a.field.name}`),l=_(()=>r.value),o=_(()=>`${r.value}-comment`),i=_(()=>`${r.value}-error`),u=_(()=>`${r.value}-notice`),d=_(()=>`${r.value}-trigger`),c=ct(Rs,null),f=ct(Tp,null),v=_(()=>f?.value[c?c.path(a.field.name):a.field.name]??""),m=_(()=>(a.errors?.length??0)>0),y=_(()=>(a.notices?.length??0)>0),x=_(()=>b7(a.field.type)),S=_(()=>_7(a.field.type)||Zu(a.field)),k=_(()=>!x.value&&!!a.field.comment),C=_(()=>[v.value!==""?d.value:"",k.value||x.value&&a.field.comment?o.value:"",m.value?i.value:"",y.value?u.value:""].filter(Boolean).join(" "));return(L,D)=>(p(),b("div",{class:"flex min-w-0 flex-col gap-1.5","data-field":e.field.name},[S.value&&e.field.label?(p(),b("span",{key:0,id:`${l.value}-label`,class:"font-semibold"},[_e(w(e.field.label),1),e.field.required?(p(),b("span",qL," *")):Y("",!0)],8,IL)):!x.value&&!S.value?(p(),b("label",{key:1,id:`${l.value}-label`,for:l.value,class:"font-semibold"},[_e(w(e.field.label||e.field.name),1),e.field.required?(p(),b("span",NL," *")):Y("",!0)],8,LL)):Y("",!0),v.value!==""?(p(),b("p",{key:2,id:d.value,"data-trigger-note":"",class:"flex items-center gap-2 text-[13px] text-muted"},[R(s(Rr),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(v.value),1)],8,BL)):Y("",!0),R(PL,{field:e.field,"model-value":e.modelValue,"control-id":l.value,invalid:m.value,"described-by":C.value,labels:e.labels,source:e.source,"record-id":e.recordId,"onUpdate:modelValue":D[0]||(D[0]=T=>n("update:modelValue",T))},null,8,["field","model-value","control-id","invalid","described-by","labels","source","record-id"]),k.value?(p(),b("p",{key:3,id:o.value,class:"text-[13px] text-muted"},w(e.field.comment),9,FL)):Y("",!0),y.value?(p(),b("div",{key:4,id:u.value,role:"status","data-field-notice":"",class:"summer-callout summer-callout--warning text-[13px]!"},[(p(!0),b(pe,null,De(e.notices,(T,I)=>(p(),b("p",{key:I,class:"summer-callout__text"},w(T),1))),128))],8,VL)):Y("",!0),m.value?(p(),b("div",{key:5,id:i.value,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(p(!0),b(pe,null,De(e.errors,(T,I)=>(p(),b("p",{key:I,class:"flex items-center gap-1.5"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(T),1)]))),128))],8,zL)):Y("",!0)],8,RL))}}),UL={class:"grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},mo=ne({__name:"FormGrid",props:{fields:{},values:{},errors:{},notices:{},labels:{},source:{},recordId:{},idPrefix:{},scopePath:{}},emits:["update"],setup(e,{emit:t}){const a=e,n=t;ht(Rs,{fields:_(()=>a.fields),values:_(()=>a.values),path:l=>a.scopePath?`${a.scopePath}.${l}`:l});function r(l){if(l.type===yl)return"col-span-full";switch(l.span){case"left":return"min-[600px]:col-start-1";case"right":return"min-[600px]:col-start-2";case"auto":case"row":return"";default:return"col-span-full"}}return(l,o)=>(p(),b("div",UL,[(p(!0),b(pe,null,De(e.fields,i=>(p(),U(jL,{key:i.name,class:me(r(i)),field:i,"model-value":e.values[i.name],errors:e.errors[i.name],notices:e.notices?.[i.name],labels:e.labels?.[i.name],source:e.source,"record-id":e.recordId,"id-prefix":e.idPrefix,"onUpdate:modelValue":u=>n("update",i.name,u)},null,8,["class","field","model-value","errors","notices","labels","source","record-id","id-prefix","onUpdate:modelValue"]))),128))]))}}),HL=["data-preview-field"],KL=["id"],WL={class:"m-0 min-w-0"},GL={key:0,"data-switch":"true",class:"inline-flex h-6 items-center rounded-pill bg-ok-bg px-2.5 text-[12px] font-semibold text-ok-text"},YL={key:1,"data-switch":"false",class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[12px] font-semibold text-muted"},JL={class:"flex size-[22px] shrink-0 items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary","aria-hidden":"true"},ZL={class:"font-semibold"},XL={key:0,class:"px-2 text-muted","data-empty":""},QL={key:0},e9={key:1,class:"text-muted","data-empty":""},t9={key:0},a9={key:1,class:"text-muted","data-empty":""},Yc="flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5 [overflow-wrap:anywhere]",K0=ne({__name:"PreviewField",props:{field:{},value:{},labels:{},source:{},recordId:{},idPrefix:{}},setup(e){const t=e,a=new Set(["datepicker","fileupload","partial","permissioneditor","richeditor","repeater","money","taglist"]),n=_(()=>`${t.idPrefix??"preview"}-${t.field.name}`),r=_(()=>`${n.value}-label`),l=_(()=>{const m=t.field.type;return a.has(m)||Zu(t.field)?"control":m==="checkbox"||m==="switch"?"toggle":m==="relation"?t.field.multiple?"chips":"relation":m==="textarea"?"textarea":"text"}),o=_(()=>({...t.field,readOnly:!0})),i=_(()=>u_(t.field));function u(m){return m==null||m===""}const d=_(()=>{const m=t.value;if(u(m)||typeof m=="object")return"";if(t.field.type==="dropdown"){const y=(t.field.options??[]).find(x=>String(x.value)===String(m));return y?y.label:String(m)}return String(m)}),c=_(()=>t.labels?.[0]?.label??""),f=_(()=>Array.isArray(t.value)?t.labels??[]:[]);function v(m){return m.trim().split(/\s+/).filter(Boolean).slice(0,2).map(x=>x.charAt(0).toUpperCase()).join("")}return(m,y)=>(p(),b("div",{class:"flex min-w-0 flex-col gap-1.5","data-preview-field":e.field.name},[g("dt",{id:r.value,class:"font-semibold"},w(e.field.label||e.field.name),9,KL),g("dd",WL,[l.value==="control"?(p(),U(Wt(i.value),{key:0,field:o.value,"model-value":e.value,"control-id":n.value,labels:e.labels,source:e.source,"record-id":e.recordId},null,8,["field","model-value","control-id","labels","source","record-id"])):l.value==="toggle"?(p(),b(pe,{key:1},[s(Wu)(e.value)?(p(),b("span",GL,w(s(h)("backend::lang.list.column_switch_true")),1)):(p(),b("span",YL,w(s(h)("backend::lang.list.column_switch_false")),1))],64)):l.value==="chips"?(p(),b("div",{key:2,"data-preview-value":"",class:me([Yc,"flex-wrap gap-1.5 p-1.5"])},[(p(!0),b(pe,null,De(f.value,x=>(p(),b("span",{key:String(x.value),"data-chip":"",class:"inline-flex min-h-[30px] items-center gap-1.5 rounded-pill bg-surface pr-3 pl-1"},[g("span",JL,w(v(x.label)),1),g("span",ZL,w(x.label),1)]))),128)),f.value.length===0?(p(),b("span",XL,w(s(h)("backend::lang.list.empty_value")),1)):Y("",!0)])):l.value==="relation"?(p(),b("div",{key:3,"data-preview-value":"",class:me(Yc)},[c.value!==""?(p(),b("span",QL,w(c.value),1)):(p(),b("span",e9,w(e.field.emptyOption||s(h)("backend::lang.list.empty_value")),1))])):(p(),b("div",{key:4,"data-preview-value":"",class:me([Yc,l.value==="textarea"?"items-start! py-3 whitespace-pre-wrap":""])},[d.value!==""?(p(),b("span",t9,w(d.value),1)):(p(),b("span",a9,w(s(h)("backend::lang.list.empty_value")),1))],2))])],8,HL))}}),W0=new Set(["p","br","strong","b","em","i","u","s","h3","ul","ol","li","blockquote","a","div","span"]);function G0(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function n9(e){if(e==="")return[];const t=new Set;for(const a of Array.from(G0(e).querySelectorAll("*")))t.add(a.localName.toLowerCase());return[...t]}function Ch(e){return n9(e).some(t=>!W0.has(t))}const r9=["aria-labelledby","aria-describedby","data-repeater"],l9={key:0,"data-repeater-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},o9={class:"font-semibold"},s9={key:0,class:"max-w-[420px] text-[13px] text-muted"},i9={key:0,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel"},u9=["data-repeater-row","data-repeater-key","onDragover"],c9=["data-repeater-handle","aria-label","onKeydown","onDragstart"],d9={class:"text-[13px] text-muted tabular-nums"},f9=["title"],p9={key:1,"data-repeater-errors":"",class:"inline-flex h-6 items-center rounded-pill bg-danger-soft px-2.5 text-[13px] font-semibold text-danger"},m9={key:2,class:"flex gap-1"},v9=["aria-label","disabled","onClick"],h9=["aria-label","disabled","onClick"],y9=["aria-label","aria-expanded","aria-controls","onClick"],g9=["aria-label","disabled","onClick"],b9=["id"],_9={key:0,class:"m-0 grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},x9={key:2,class:"flex flex-wrap items-center gap-4"},k9={key:0,"data-repeater-count":"",class:"text-[13px] text-muted tabular-nums"},Oo="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",w9=ne({__name:"RepeaterField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=ct(Op,null),l=_(()=>a.field.form?.fields??[]),o=_(()=>!!a.field.readOnly),i=_(()=>Array.isArray(a.modelValue)?a.modelValue.map(G=>G!==null&&typeof G=="object"&&!Array.isArray(G)?G:{}):[]),u=_(()=>typeof a.field.maxItems=="number"?a.field.maxItems:null),d=_(()=>typeof a.field.minItems=="number"?a.field.minItems:0),c=_(()=>a.field.prompt||h("backend::lang.repeater.add")),f=_(()=>`${a.controlId}-label`);let v=0;const m=A([]),y=A(new Set);let x;function S(){return v+=1,`r${v}`}Be(()=>a.modelValue,G=>{G===x&&m.value.length===i.value.length||m.value.length!==i.value.length&&(m.value=i.value.map(()=>S()),y.value=new Set)},{immediate:!0});function k(G,ee){m.value=ee,x=G,n("update:modelValue",G)}function C(G){return G==null||G===""||G===!1||Array.isArray(G)&&G.length===0}function L(){const G={};for(const ee of l.value)ee.default!==void 0?G[ee.name]=ee.default:ee.type==="checkbox"||ee.type==="switch"?G[ee.name]=!1:G[ee.name]=null;return G}function D(G){return l.value.some(ee=>{const ae=G[ee.name];return C(ae)?!1:ee.default===void 0||String(ee.default)!==String(ae)})}function T(G){return(G0(G).textContent??"").replace(/\s+/g," ").trim()}function I(G){const ee=i.value[G]??{},ae=l.value.find(z=>z.name===a.field.titleFrom),$=ae?ee[ae.name]:void 0;let M="";return ae&&!C($)&&typeof $!="object"&&(ae.type==="dropdown"?M=(ae.options??[]).find(z=>String(z.value)===String($))?.label??String($):ae.type==="richeditor"?M=T(String($)):M=String($).trim()),M!==""?M:h("backend::lang.repeater.untitled",{n:G+1})}function q(G,ee){const ae=`${a.field.name}.${ee}.`,$={};for(const[M,z]of Object.entries(G??{}))M.startsWith(ae)&&M.length>ae.length&&($[M.slice(ae.length)]=z);return $}const H=_(()=>i.value.map((G,ee)=>q(r?.errors.value,ee))),E=_(()=>i.value.map((G,ee)=>q(r?.notices.value,ee))),P=G=>Object.keys(H.value[G]??{}).length;Be(H,G=>{const ee=G.flatMap((ae,$)=>Object.keys(ae).length>0?[m.value[$]]:[]);if(ee.length>0){const ae=new Set(y.value);for(const $ of ee)ae.delete($);y.value=ae}});function j(G){return o.value||!y.value.has(G)}function O(G,ee){const ae=new Set(y.value);ee?ae.delete(G):ae.add(G),y.value=ae}const N=_(()=>m.value.some(G=>!y.value.has(G)));function Z(){y.value=N.value?new Set(m.value):new Set}const W=A(null),K=A(null);function te(G){return W.value?.querySelector(`[data-repeater-handle="${G}"]`)??null}function oe(G,ee,ae){const $=i.value.map((M,z)=>z===G?{...M,[ee]:ae}:M);k($,[...m.value]),r?.clearError(`${a.field.name}.${G}.${ee}`)}async function ye(){if(o.value||u.value!==null&&i.value.length>=u.value)return;const G=S();k([...i.value,L()],[...m.value,G]),await Ue(),W.value?.querySelector(`[data-repeater-key="${G}"]`)?.querySelector('[data-repeater-body] input, [data-repeater-body] select, [data-repeater-body] textarea, [data-repeater-body] [contenteditable="true"]')?.focus()}async function be(G){const ee=i.value[G];if(!ee||o.value||i.value.length<=d.value)return;if(D(ee)&&r){const z=I(G);if(!await r.confirm({message:h("backend::lang.repeater.remove_confirm",{title:z}),confirmLabel:h("backend::lang.repeater.remove"),danger:!0}))return}const ae=m.value.filter((z,de)=>de!==G);k(i.value.filter((z,de)=>de!==G),ae),await Ue();const $=ae[G]??ae[G-1],M=$?te($):null;M?M.focus():K.value?.$el.focus()}async function ge(G,ee){const ae=i.value.length;if(o.value||G===ee||G<0||ee<0||G>=ae||ee>=ae)return;const $=[...i.value],M=[...m.value],[z]=$.splice(G,1),[de]=M.splice(G,1);$.splice(ee,0,z),M.splice(ee,0,de),k($,M),await Ue(),te(de)?.focus(),r?.announce(h("backend::lang.repeater.moved",{title:I(ee),position:ee+1,total:ae}))}function le(G,ee){(G.key==="ArrowUp"||G.key==="ArrowDown")&&(G.preventDefault(),ge(ee,G.key==="ArrowUp"?ee-1:ee+1))}const ce=A(null),F=A(null);function fe(G,ee){ce.value=ee,F.value=null,G.dataTransfer?.setData("text/plain",m.value[ee]??""),G.dataTransfer&&(G.dataTransfer.effectAllowed="move")}function ve(G,ee){if(ce.value===null)return;G.preventDefault();const $=G.currentTarget.getBoundingClientRect();F.value=G.clientY>$.top+$.height/2?ee+1:ee}function J(G){if(ce.value===null||F.value===null)return;G.preventDefault();const ee=ce.value,ae=F.value>ee?F.value-1:F.value;he(),ge(ee,ae)}function he(){ce.value=null,F.value=null}return(G,ee)=>(p(),b("div",{ref_key:"root",ref:W,role:"group","aria-labelledby":f.value,"aria-describedby":e.describedBy||void 0,"data-repeater":e.field.name,class:"flex flex-col gap-4"},[i.value.length===0?(p(),b("div",l9,[g("p",o9,w(s(h)("backend::lang.repeater.empty")),1),o.value?Y("",!0):(p(),b("p",s9,w(s(h)("backend::lang.repeater.empty_hint",{prompt:c.value})),1))])):Y("",!0),(p(!0),b(pe,null,De(i.value,(ae,$)=>(p(),b(pe,{key:m.value[$]},[ce.value!==null&&F.value===$&&F.value!==ce.value&&F.value!==ce.value+1?(p(),b("div",i9)):Y("",!0),g("div",{"data-repeater-row":$,"data-repeater-key":m.value[$],class:me([[P($)>0?"border-danger":"border-border",ce.value===$?"opacity-50":""],"rounded-inner border bg-surface"]),onDragover:M=>ve(M,$),onDrop:J},[g("div",{class:me([j(m.value[$])?"rounded-t-inner border-b border-border":"rounded-inner","flex min-h-12 items-center gap-2 bg-subtle px-2"])},[o.value?Y("",!0):(p(),b("button",{key:0,type:"button",draggable:"true","data-repeater-handle":m.value[$],"aria-label":s(h)("backend::lang.repeater.move",{title:I($)}),class:me([Oo,"cursor-grab"]),onKeydown:M=>le(M,$),onDragstart:M=>fe(M,$),onDragend:he},[R(s(Vi),{size:16,"aria-hidden":"true"})],40,c9)),g("span",d9,w($+1)+".",1),g("span",{"data-repeater-title":"",class:"min-w-0 flex-1 truncate font-semibold",title:I($)},w(I($)),9,f9),P($)>0?(p(),b("span",p9,w(s(wa)("backend::lang.form.tab_errors",P($))),1)):Y("",!0),o.value?Y("",!0):(p(),b("div",m9,[g("button",{type:"button","data-action":"repeater-up","aria-label":s(h)("backend::lang.repeater.move_up",{title:I($)}),disabled:$===0,class:me(Oo),onClick:M=>ge($,$-1)},[R(s(lb),{size:16,"aria-hidden":"true"})],8,v9),g("button",{type:"button","data-action":"repeater-down","aria-label":s(h)("backend::lang.repeater.move_down",{title:I($)}),disabled:$===i.value.length-1,class:me(Oo),onClick:M=>ge($,$+1)},[R(s(zn),{size:16,"aria-hidden":"true"})],8,h9),g("button",{type:"button","data-action":"repeater-toggle","aria-label":s(h)(j(m.value[$])?"backend::lang.repeater.collapse":"backend::lang.repeater.expand",{title:I($)}),"aria-expanded":j(m.value[$])?"true":"false","aria-controls":`${e.controlId}-${m.value[$]}-body`,class:me(Oo),onClick:M=>O(m.value[$],!j(m.value[$]))},[R(s(zn),{size:16,class:me([j(m.value[$])?"rotate-180":"","transition-transform duration-150"]),"aria-hidden":"true"},null,8,["class"])],8,y9),g("button",{type:"button","data-action":"repeater-remove","aria-label":s(h)("backend::lang.repeater.remove_named",{title:I($)}),disabled:i.value.length<=d.value,class:me([Oo,"hover:bg-danger-soft hover:text-danger"]),onClick:M=>be($)},[R(s(Ir),{size:16,"aria-hidden":"true"})],8,g9)]))],2),j(m.value[$])?(p(),b("div",{key:0,id:`${e.controlId}-${m.value[$]}-body`,"data-repeater-body":"",class:"p-4"},[o.value?(p(),b("dl",_9,[(p(!0),b(pe,null,De(l.value,M=>(p(),U(K0,{key:M.name,class:me(M.span==="left"?"min-[600px]:col-start-1":M.span==="right"?"min-[600px]:col-start-2":"col-span-full"),field:{...M,readOnly:!0},value:ae[M.name],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${m.value[$]}`},null,8,["class","field","value","source","record-id","id-prefix"]))),128))])):(p(),U(mo,{key:1,fields:l.value,values:ae,errors:H.value[$]??{},notices:E.value[$],source:e.source,"record-id":e.recordId,"id-prefix":`${e.controlId}-${m.value[$]}`,"scope-path":e.field.name,onUpdate:(M,z)=>oe($,M,z)},null,8,["fields","values","errors","notices","source","record-id","id-prefix","scope-path","onUpdate"]))],8,b9)):Y("",!0)],42,u9)],64))),128)),ce.value!==null&&F.value===i.value.length&&F.value!==ce.value+1?(p(),b("div",{key:1,"data-repeater-slot":"",class:"h-12 rounded-inner border-2 border-dashed border-primary bg-sel",onDragover:ee[0]||(ee[0]=yt(()=>{},["prevent"])),onDrop:J},null,32)):Y("",!0),o.value?Y("",!0):(p(),b("div",x9,[R(Ke,{ref_key:"addButton",ref:K,variant:"outline",size:"sm",icon:s(As),"data-action":"repeater-add",disabled:u.value!==null&&i.value.length>=u.value,onClick:ye},{default:B(()=>[_e(w(c.value),1)]),_:1},8,["icon","disabled"]),u.value!==null?(p(),b("span",k9,w(s(h)("backend::lang.repeater.count",{current:i.value.length,max:u.value})),1)):Y("",!0),i.value.length>1?(p(),U(Ke,{key:1,variant:"ghost",size:"sm",class:"ml-auto","data-action":"repeater-toggle-all",onClick:Z},{default:B(()=>[_e(w(s(h)(N.value?"backend::lang.repeater.collapse_all":"backend::lang.repeater.expand_all")),1)]),_:1})):Y("",!0)]))],8,r9))}}),$9="modulepreload",S9=function(e,t){return new URL(e,t).href},Eh={},Y0=function(t,a,n){let r=Promise.resolve();if(a&&a.length>0){let d=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const o=document.getElementsByTagName("link"),i=document.querySelector("meta[property=csp-nonce]"),u=i?.nonce||i?.getAttribute("nonce");r=d(a.map(c=>{if(c=S9(c,n),c in Eh)return;Eh[c]=!0;const f=c.endsWith(".css"),v=f?'[rel="stylesheet"]':"";if(n)for(let y=o.length-1;y>=0;y--){const x=o[y];if(x.href===c&&(!f||x.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${v}`))return;const m=document.createElement("link");if(m.rel=f?"stylesheet":$9,f||(m.as="script"),m.crossOrigin="",m.href=c,u&&m.setAttribute("nonce",u),document.head.appendChild(m),f)return new Promise((y,x)=>{m.addEventListener("load",y),m.addEventListener("error",()=>x(new Error(`Unable to preload CSS for ${c}`)))})}))}function l(o){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=o,window.dispatchEvent(i),!i.defaultPrevented)throw o}return r.then(o=>{for(const i of o||[])i.status==="rejected"&&l(i.reason);return t().catch(l)})};function Ah(e,t){(t==null||t>e.length)&&(t=e.length);for(var a=0,n=Array(t);a<t;a++)n[a]=e[a];return n}function C9(e){if(Array.isArray(e))return e}function E9(e,t){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var n,r,l,o,i=[],u=!0,d=!1;try{if(l=(a=a.call(e)).next,t!==0)for(;!(u=(n=l.call(a)).done)&&(i.push(n.value),i.length!==t);u=!0);}catch(c){d=!0,r=c}finally{try{if(!u&&a.return!=null&&(o=a.return(),Object(o)!==o))return}finally{if(d)throw r}}return i}}function A9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function T9(e,t){return C9(e)||E9(e,t)||O9(e,t)||A9()}function O9(e,t){if(e){if(typeof e=="string")return Ah(e,t);var a={}.toString.call(e).slice(8,-1);return a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set"?Array.from(e):a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Ah(e,t):void 0}}const J0=Object.entries,Th=Object.setPrototypeOf,D9=Object.isFrozen,M9=Object.getPrototypeOf,P9=Object.getOwnPropertyDescriptor;let Ht=Object.freeze,Jt=Object.seal,Rl=Object.create,Z0=typeof Reflect<"u"&&Reflect,Jd=Z0.apply,Zd=Z0.construct;Ht||(Ht=function(t){return t});Jt||(Jt=function(t){return t});Jd||(Jd=function(t,a){for(var n=arguments.length,r=new Array(n>2?n-2:0),l=2;l<n;l++)r[l-2]=arguments[l];return t.apply(a,r)});Zd||(Zd=function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r<a;r++)n[r-1]=arguments[r];return new t(...n)});const Xr=jt(Array.prototype.forEach),R9=jt(Array.prototype.lastIndexOf),Oh=jt(Array.prototype.pop),Do=jt(Array.prototype.push),I9=jt(Array.prototype.splice),Jl=Array.isArray,Vo=jt(String.prototype.toLowerCase),Jc=jt(String.prototype.toString),Dh=jt(String.prototype.match),Mo=jt(String.prototype.replace),Mh=jt(String.prototype.indexOf),q9=jt(String.prototype.trim),L9=jt(Number.prototype.toString),N9=jt(Boolean.prototype.toString),Ph=typeof BigInt>"u"?null:jt(BigInt.prototype.toString),Rh=typeof Symbol>"u"?null:jt(Symbol.prototype.toString),da=jt(Object.prototype.hasOwnProperty),Po=jt(Object.prototype.toString),Qt=jt(RegExp.prototype.test),ir=B9(TypeError);function jt(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r<a;r++)n[r-1]=arguments[r];return Jd(e,t,n)}}function B9(e){return function(){for(var t=arguments.length,a=new Array(t),n=0;n<t;n++)a[n]=arguments[n];return Zd(e,a)}}function mt(e,t){let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Vo;if(Th&&Th(e,null),!Jl(t))return e;let n=t.length;for(;n--;){let r=t[n];if(typeof r=="string"){const l=a(r);l!==r&&(D9(t)||(t[n]=l),r=l)}e[r]=!0}return e}function F9(e){for(let t=0;t<e.length;t++)da(e,t)||(e[t]=null);return e}function xa(e){const t=Rl(null);for(const n of J0(e)){var a=T9(n,2);const r=a[0],l=a[1];da(e,r)&&(Jl(l)?t[r]=F9(l):l&&typeof l=="object"&&l.constructor===Object?t[r]=xa(l):t[r]=l)}return t}function V9(e){switch(typeof e){case"string":return e;case"number":return L9(e);case"boolean":return N9(e);case"bigint":return Ph?Ph(e):"0";case"symbol":return Rh?Rh(e):"Symbol()";case"undefined":return Po(e);case"function":case"object":{if(e===null)return Po(e);const t=e,a=Oa(t,"toString");if(typeof a=="function"){const n=a(t);return typeof n=="string"?n:Po(n)}return Po(e)}default:return Po(e)}}function Oa(e,t){for(;e!==null;){const n=P9(e,t);if(n){if(n.get)return jt(n.get);if(typeof n.value=="function")return jt(n.value)}e=M9(e)}function a(){return null}return a}function z9(e){try{return Qt(e,""),!0}catch{return!1}}const Ih=Ht(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Zc=Ht(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xc=Ht(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),j9=Ht(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Qc=Ht(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),U9=Ht(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),qh=Ht(["#text"]),Lh=Ht(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ed=Ht(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Nh=Ht(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),oi=Ht(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),H9=Jt(/{{[\w\W]*|^[\w\W]*}}/g),K9=Jt(/<%[\w\W]*|^[\w\W]*%>/g),W9=Jt(/\${[\w\W]*/g),G9=Jt(/^data-[\-\w.\u00B7-\uFFFF]+$/),Y9=Jt(/^aria-[\-\w]+$/),Bh=Jt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),J9=Jt(/^(?:\w+script|data):/i),Z9=Jt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X9=Jt(/^html$/i),Q9=Jt(/^[a-z][.\w]*(-[.\w]+)+$/i),Fh=Jt(/<[/\w!]/g),Vh=Jt(/<[/\w]/g),eN=Jt(/<\/no(script|embed|frames)/i),tN=Jt(/\/>/i),_a={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},X0=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],aN=Ht(mt({},X0)),nN=(function(){const e={};return Xr(X0,t=>{e[t]=Jt(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ht(e)})(),rN=function(){return typeof window>"u"?null:window},lN=function(t,a){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let n=null;const r="data-tt-policy-suffix";a&&a.hasAttribute(r)&&(n=a.getAttribute(r));const l="dompurify"+(n?"#"+n:"");try{return t.createPolicy(l,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},zh=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ur=function(t,a,n,r){return da(t,a)&&Jl(t[a])?mt(r.base?xa(r.base):{},t[a],r.transform):n},td=function(t,a,n){const r=da(t,a)?t[a]:void 0;return r&&typeof r=="object"?xa(r):n()};function Q0(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:rN();const t=Me=>Q0(Me);if(t.version="3.4.16",t.removed=[],!e||!e.document||e.document.nodeType!==_a.document||!e.Element)return t.isSupported=!1,t;let a=e.document;const n=a,r=n.currentScript;e.DocumentFragment;const l=e.HTMLTemplateElement,o=e.Node,i=e.Element,u=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;const d=e.DOMParser,c=e.trustedTypes,f=i.prototype,v=Oa(f,"cloneNode"),m=Oa(f,"remove"),y=Oa(f,"removeAttributeNode"),x=Oa(f,"nextSibling"),S=Oa(f,"childNodes"),k=Oa(f,"parentNode"),C=Oa(f,"shadowRoot"),L=Oa(f,"attributes"),D=o&&o.prototype?Oa(o.prototype,"nodeType"):null,T=o&&o.prototype?Oa(o.prototype,"nodeName"):null,I=o&&o.prototype?Oa(o.prototype,"ownerDocument"):null,q=function(V){return D?D(V):V.nodeType},H=function(V){return T?T(V):V.nodeName};if(typeof l=="function"){const Me=a.createElement("template");Me.content&&Me.content.ownerDocument&&(a=Me.content.ownerDocument)}let E,P="",j,O=!1,N=0;const Z=function(){if(N>0)throw ir('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},W=function(V){Z(),N++;try{return E.createHTML(V)}finally{N--}},K=function(V){Z(),N++;try{return E.createScriptURL(V)}finally{N--}},te=function(){return O||(j=lN(c,r),O=!0),j},oe=a,ye=oe.implementation,be=oe.createNodeIterator,ge=oe.createDocumentFragment,le=oe.getElementsByTagName,ce=n.importNode;let F=zh();t.isSupported=typeof J0=="function"&&typeof k=="function"&&ye&&ye.createHTMLDocument!==void 0;const fe=H9,ve=K9,J=W9,he=G9,G=Y9,ee=J9,ae=Z9,$=Q9;let M=Bh,z=null;const de=mt({},[...Ih,...Zc,...Xc,...Qc,...qh]);let X=null;const se=mt({},[...Lh,...ed,...Nh,...oi]);let xe=Object.seal(Rl(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$e=null,Ce=null;const ie=Object.seal(Rl(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Ee=!0,we=!0,Le=!1,Ve=!0,We=!1,tt=!0,at=!1,st=!1,Ie=null,Qe=null,ot=!1,Mt=!1,je=!1,ze=!1,Ge=!0,Bt=!1;const ra="user-content-";let er=!0,wn=!1,Ba={},Gt=null;const tr=mt({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let $n=null;const ar=mt({},["audio","video","img","source","image","track"]);let Ae=null;const Fe=mt({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ye="http://www.w3.org/1998/Math/MathML",ut="http://www.w3.org/2000/svg",St="http://www.w3.org/1999/xhtml";let Pt=St,zr=!1,yo=null;const go=mt({},[Ye,ut,St],Jc),Q=Ht(["mi","mo","mn","ms","mtext"]);let Oe=mt({},Q);const re=Ht(["annotation-xml"]);let Ne=mt({},re);const lt=mt({},["title","style","font","a","script"]);let qt=null;const Za=["application/xhtml+xml","text/html"],nr="text/html";let Lt=null,gl=null;const $_=a.createElement("form"),Ip=function(V){return V instanceof RegExp||V instanceof Function},Xu=function(){let V=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(gl&&gl===V)return;(!V||typeof V!="object")&&(V={}),V=xa(V),qt=Za.indexOf(V.PARSER_MEDIA_TYPE)===-1?nr:V.PARSER_MEDIA_TYPE,Lt=qt==="application/xhtml+xml"?Jc:Vo,z=ur(V,"ALLOWED_TAGS",de,{transform:Lt}),X=ur(V,"ALLOWED_ATTR",se,{transform:Lt}),yo=ur(V,"ALLOWED_NAMESPACES",go,{transform:Jc}),Ae=ur(V,"ADD_URI_SAFE_ATTR",Fe,{transform:Lt,base:Fe}),$n=ur(V,"ADD_DATA_URI_TAGS",ar,{transform:Lt,base:ar}),Gt=ur(V,"FORBID_CONTENTS",tr,{transform:Lt}),$e=ur(V,"FORBID_TAGS",xa({}),{transform:Lt}),Ce=ur(V,"FORBID_ATTR",xa({}),{transform:Lt}),Ba=da(V,"USE_PROFILES")?V.USE_PROFILES&&typeof V.USE_PROFILES=="object"?xa(V.USE_PROFILES):V.USE_PROFILES:!1,Ee=V.ALLOW_ARIA_ATTR!==!1,we=V.ALLOW_DATA_ATTR!==!1,Le=V.ALLOW_UNKNOWN_PROTOCOLS||!1,Ve=V.ALLOW_SELF_CLOSE_IN_ATTR!==!1,We=V.SAFE_FOR_TEMPLATES||!1,tt=V.SAFE_FOR_XML!==!1,at=V.WHOLE_DOCUMENT||!1,Mt=V.RETURN_DOM||!1,je=V.RETURN_DOM_FRAGMENT||!1,ze=V.RETURN_TRUSTED_TYPE||!1,ot=V.FORCE_BODY||!1,Ge=V.SANITIZE_DOM!==!1,Bt=V.SANITIZE_NAMED_PROPS||!1,er=V.KEEP_CONTENT!==!1,wn=V.IN_PLACE||!1,M=z9(V.ALLOWED_URI_REGEXP)?V.ALLOWED_URI_REGEXP:Bh,Pt=typeof V.NAMESPACE=="string"?V.NAMESPACE:St,Oe=td(V,"MATHML_TEXT_INTEGRATION_POINTS",()=>mt({},Q)),Ne=td(V,"HTML_INTEGRATION_POINTS",()=>mt({},re));const ue=td(V,"CUSTOM_ELEMENT_HANDLING",()=>Rl(null));if(xe=Rl(null),da(ue,"tagNameCheck")&&Ip(ue.tagNameCheck)&&(xe.tagNameCheck=ue.tagNameCheck),da(ue,"attributeNameCheck")&&Ip(ue.attributeNameCheck)&&(xe.attributeNameCheck=ue.attributeNameCheck),da(ue,"allowCustomizedBuiltInElements")&&typeof ue.allowCustomizedBuiltInElements=="boolean"&&(xe.allowCustomizedBuiltInElements=ue.allowCustomizedBuiltInElements),Jt(xe),We&&(we=!1),je&&(Mt=!0),Ba&&(z=mt({},qh),X=Rl(null),Ba.html===!0&&(mt(z,Ih),mt(X,Lh)),Ba.svg===!0&&(mt(z,Zc),mt(X,ed),mt(X,oi)),Ba.svgFilters===!0&&(mt(z,Xc),mt(X,ed),mt(X,oi)),Ba.mathMl===!0&&(mt(z,Qc),mt(X,Nh),mt(X,oi))),ie.tagCheck=null,ie.attributeCheck=null,da(V,"ADD_TAGS")&&(typeof V.ADD_TAGS=="function"?ie.tagCheck=V.ADD_TAGS:Jl(V.ADD_TAGS)&&(z===de&&(z=xa(z)),mt(z,V.ADD_TAGS,Lt))),da(V,"ADD_ATTR")&&(typeof V.ADD_ATTR=="function"?ie.attributeCheck=V.ADD_ATTR:Jl(V.ADD_ATTR)&&(X===se&&(X=xa(X)),mt(X,V.ADD_ATTR,Lt))),da(V,"ADD_FORBID_CONTENTS")&&Jl(V.ADD_FORBID_CONTENTS)&&(Gt===tr&&(Gt=xa(Gt)),mt(Gt,V.ADD_FORBID_CONTENTS,Lt)),er&&(z["#text"]=!0),at&&mt(z,["html","head","body"]),z.table&&(mt(z,["tbody"]),delete $e.tbody),V.TRUSTED_TYPES_POLICY){if(typeof V.TRUSTED_TYPES_POLICY.createHTML!="function")throw ir('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof V.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ir('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const Te=E;E=V.TRUSTED_TYPES_POLICY;try{P=W("")}catch(Re){throw E=Te,Re}}else V.TRUSTED_TYPES_POLICY===null?(E=void 0,P=""):(E===void 0&&(E=te()),E&&typeof P=="string"&&(P=W("")));Ht&&Ht(V),gl=V},qp=mt({},[...Zc,...Xc,...j9]),Lp=mt({},[...Qc,...U9]),S_=function(V,ue,Te){return ue.namespaceURI===St?V==="svg":ue.namespaceURI===Ye?V==="svg"&&(Te==="annotation-xml"||Oe[Te]):!!qp[V]},C_=function(V,ue,Te){return ue.namespaceURI===St?V==="math":ue.namespaceURI===ut?V==="math"&&Ne[Te]:!!Lp[V]},E_=function(V,ue,Te){return ue.namespaceURI===ut&&!Ne[Te]||ue.namespaceURI===Ye&&!Oe[Te]?!1:!Lp[V]&&(lt[V]||!qp[V])},A_=function(V){let ue=k(V);(!ue||!ue.tagName)&&(ue={namespaceURI:Pt,tagName:"template"});const Te=Vo(V.tagName),Re=Vo(ue.tagName);return yo[V.namespaceURI]?V.namespaceURI===ut?S_(Te,ue,Re):V.namespaceURI===Ye?C_(Te,ue,Re):V.namespaceURI===St?E_(Te,ue,Re):!!(qt==="application/xhtml+xml"&&yo[V.namespaceURI]):!1},rr=function(V){Do(t.removed,{element:V});try{k(V).removeChild(V)}catch{if(m(V),!k(V))throw ir("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Np=function(V,ue,Te){try{y(V,ue)}catch{try{V.removeAttribute(Te)}catch{}}},qs=function(V){Ls(V);const ue=S(V);if(ue){const Re=[];Xr(ue,Je=>{Do(Re,Je)}),Xr(Re,Je=>{try{m(Je)}catch{}})}const Te=L(V);if(Te)for(let Re=Te.length-1;Re>=0;--Re){const Je=Te[Re],ft=Je&&Je.name;typeof ft=="string"&&Np(V,Je,ft)}},jr=function(V,ue,Te){if(!Te)try{Te=ue.getAttributeNode(V)}catch{Te=null}Do(t.removed,{attribute:Te||null,from:ue});try{Te?y(ue,Te):ue.removeAttribute(V)}catch{try{ue.removeAttribute(V)}catch{}}if(V==="is")if(Mt||je)try{rr(ue)}catch{}else try{ue.setAttribute(V,"")}catch{}},T_=function(V){const ue=L(V);if(ue)for(let Te=ue.length-1;Te>=0;--Te){const Re=ue[Te],Je=Re&&Re.name;typeof Je!="string"||X[Lt(Je)]||Np(V,Re,Je)}},Ls=function(V){const ue=[V];for(;ue.length>0;){const Te=ue.pop();q(Te)===_a.element&&T_(Te);const Re=S(Te);if(Re)for(let Je=Re.length-1;Je>=0;--Je)ue.push(Re[Je])}},Bp=function(V,ue){return tt?V==="patchsrc"?!0:V==="for"&&ue!=="label"&&ue!=="output":!1},O_=function(V){if(!tt)return;const ue=[V];for(;ue.length>0;){const Te=ue.pop(),Re=q(Te);if(Re===_a.processingInstruction||Re===_a.comment&&Qt(Vh,Te.data)){try{m(Te)}catch{}continue}if(Re===_a.element){const ft=Te,pt=Lt(H(Te));try{ft.hasAttribute&&ft.hasAttribute("patchsrc")&&ft.removeAttribute("patchsrc"),ft.hasAttribute&&ft.hasAttribute("for")&&Bp("for",pt)&&ft.removeAttribute("for")}catch{}}const Je=S(Te);if(Je)for(let ft=Je.length-1;ft>=0;--ft)ue.push(Je[ft])}},Fp=function(V){let ue=null,Te=null;if(ot)V="<remove></remove>"+V;else{const ft=Dh(V,/^[\r\n\t ]+/);Te=ft&&ft[0]}qt==="application/xhtml+xml"&&Pt===St&&(V='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+V+"</body></html>");const Re=E?W(V):V;if(Pt===St)try{ue=new d().parseFromString(Re,qt)}catch{}if(!ue||!ue.documentElement){ue=ye.createDocument(Pt,"template",null);try{ue.documentElement.innerHTML=zr?P:Re}catch{}}const Je=ue.body||ue.documentElement;return V&&Te&&Je.insertBefore(a.createTextNode(Te),Je.childNodes[0]||null),Pt===St?le.call(ue,at?"html":"body")[0]:at?ue.documentElement:Je},Vp=function(V){const ue=I?I(V):V.ownerDocument;return be.call(ue||V,V,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Ns=function(V){return V=Mo(V,fe," "),V=Mo(V,ve," "),V=Mo(V,J," "),V},Qu=function(V){var ue;V.normalize();const Te=I?I(V):V.ownerDocument,Re=be.call(Te||V,V,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let Je=Re.nextNode();for(;Je;)Je.data=Ns(Je.data),Je=Re.nextNode();const ft=(ue=V.querySelectorAll)===null||ue===void 0?void 0:ue.call(V,"template");ft&&Xr(ft,pt=>{bl(pt.content)&&Qu(pt.content)})},Bs=function(V){const ue=T?T(V):null;return typeof ue!="string"||Lt(ue)!=="form"?!1:typeof V.nodeName!="string"||typeof V.textContent!="string"||typeof V.removeChild!="function"||V.attributes!==L(V)||typeof V.removeAttribute!="function"||typeof V.removeAttributeNode!="function"||typeof V.getAttributeNode!="function"||typeof V.setAttribute!="function"||typeof V.namespaceURI!="string"||typeof V.insertBefore!="function"||typeof V.hasChildNodes!="function"||V.nodeType!==D(V)||V.childNodes!==S(V)},bl=function(V){if(!D||typeof V!="object"||V===null)return!1;try{return D(V)===_a.documentFragment}catch{return!1}},bo=function(V){if(!D||typeof V!="object"||V===null)return!1;try{return typeof D(V)=="number"}catch{return!1}};function Xa(Me,V,ue){Me.length!==0&&Xr(Me,Te=>{Te.call(t,V,ue,gl)})}const D_=function(V,ue){return!!(tt&&V.hasChildNodes()&&!bo(V.firstElementChild)&&Qt(Fh,V.textContent)&&Qt(Fh,V.innerHTML)||tt&&V.namespaceURI===St&&aN[ue]&&(bo(V.firstElementChild)||typeof V.textContent=="string"&&Qt(nN[ue],V.textContent))||V.nodeType===_a.processingInstruction||tt&&V.nodeType===_a.comment&&Qt(Vh,V.data))},Fs=function(V,ue){if(V instanceof RegExp)return Qt(V,ue);if(V instanceof Function){for(var Te=arguments.length,Re=new Array(Te>2?Te-2:0),Je=2;Je<Te;Je++)Re[Je-2]=arguments[Je];return!!V(ue,...Re)}return!1},M_=function(V,ue,Te){if(!$e[ue]&&Hp(ue)&&Fs(xe.tagNameCheck,ue))return!1;if(er&&!Gt[ue]){const Re=k(V),Je=S(V);if(Je&&Re){const ft=Je.length;for(let pt=ft-1;pt>=0;--pt){const Rt=V===Te?v(Je[pt],!0):Je[pt];Re.insertBefore(Rt,x(V))}}}return rr(V),!0},zp=function(V,ue,Te,Re){return V.length===0?ue:ue===Te||ue===Re?xa(ue):ue},_l=function(V,ue){return V===ue||k(V)!==null?!1:(wn&&Ls(V),!0)},jp=function(V,ue){if(Xa(F.beforeSanitizeElements,V,null),_l(V,ue))return!0;if(Bs(V))return rr(V),!0;const Te=Lt(H(V));if(z=zp(F.uponSanitizeElement,z,de,Ie),Xa(F.uponSanitizeElement,V,{tagName:Te,allowedTags:z}),_l(V,ue))return!0;if(D_(V,Te))return rr(V),!0;if($e[Te]||!(ie.tagCheck instanceof Function&&ie.tagCheck(Te))&&!z[Te]){const Re=M_(V,Te,ue);return Re===!1&&(Xa(F.afterSanitizeElements,V,null),_l(V,ue))?!0:Re}if(q(V)===_a.element&&!A_(V)||(Te==="noscript"||Te==="noembed"||Te==="noframes")&&Qt(eN,V.innerHTML))return rr(V),!0;if(We&&V.nodeType===_a.text){const Re=Ns(V.textContent);V.textContent!==Re&&(Do(t.removed,{element:V.cloneNode()}),V.textContent=Re)}return Xa(F.afterSanitizeElements,V,null),_l(V,ue)},Up=function(V,ue,Te){if(Ce[ue]||Bp(ue,V)||Ge&&(ue==="id"||ue==="name")&&(Te in a||Te in $_))return!1;const Re=X[ue]||ie.attributeCheck instanceof Function&&ie.attributeCheck(ue,V);return we&&Qt(he,ue)||Ee&&Qt(G,ue)?!0:Re?Ae[ue]||Qt(M,Mo(Te,ae,""))||(ue==="src"||ue==="xlink:href"||ue==="href")&&V!=="script"&&Mh(Te,"data:")===0&&$n[V]||Le&&!Qt(ee,Mo(Te,ae,""))?!0:!Te:Hp(V)&&Fs(xe.tagNameCheck,V)&&Fs(xe.attributeNameCheck,ue,V)||ue==="is"&&xe.allowCustomizedBuiltInElements&&Fs(xe.tagNameCheck,Te)},P_=mt({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Hp=function(V){return!P_[Vo(V)]&&Qt($,V)},R_=function(V,ue,Te,Re){if(E&&typeof c=="object"&&typeof c.getAttributeType=="function"&&!Te)switch(c.getAttributeType(V,ue)){case"TrustedHTML":return W(Re);case"TrustedScriptURL":return K(Re)}return Re},I_=function(V,ue,Te,Re){try{return Te?V.setAttributeNS(Te,ue,Re):V.setAttribute(ue,Re),Bs(V)?(rr(V),!1):!0}catch{return jr(ue,V),!1}},Kp=function(V,ue){if(Xa(F.beforeSanitizeAttributes,V,null),_l(V,ue))return;const Te=V.attributes;if(!Te||Bs(V))return;X=zp(F.uponSanitizeAttribute,X,se,Qe);const Re={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:X,forceKeepAttr:void 0};let Je=Te.length;const ft=Lt(V.nodeName);for(;Je--;){const pt=Te[Je],Rt=pt.name,Aa=pt.namespaceURI,ga=pt.value,xl=Lt(Rt),tc=ga;let la=Rt==="value"?tc:q9(tc),Wp=!1;if(Re.attrName=xl,Re.attrValue=la,Re.keepAttr=!0,Re.forceKeepAttr=void 0,Xa(F.uponSanitizeAttribute,V,Re),la=Re.attrValue,Bt&&(xl==="id"||xl==="name")&&Mh(la,ra)!==0&&(jr(Rt,V,pt),la=ra+la,Wp=!0),tt&&Qt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,la)){jr(Rt,V,pt);continue}if(xl==="attributename"&&Dh(la,"href")){jr(Rt,V,pt);continue}if(!Re.forceKeepAttr){if(!Re.keepAttr){jr(Rt,V,pt);continue}if(!Ve&&Qt(tN,la)){jr(Rt,V,pt);continue}if(We&&(la=Ns(la)),!Up(ft,xl,la)){jr(Rt,V,pt);continue}la=R_(ft,xl,Aa,la),la!==tc&&I_(V,Rt,Aa,la)&&Wp&&Oh(t.removed)}}Xa(F.afterSanitizeAttributes,V,null),_l(V,ue)},Vs=function(V){let ue=null;const Te=Vp(V);for(Xa(F.beforeSanitizeShadowDOM,V,null);ue=Te.nextNode();)if(Xa(F.uponSanitizeShadowNode,ue,null),jp(ue,V),Kp(ue,V),bl(ue.content)&&Vs(ue.content),q(ue)===_a.element){const Re=C(ue);bl(Re)&&(ec(Re),Vs(Re))}Xa(F.afterSanitizeShadowDOM,V,null)},ec=function(V){const ue=[{node:V,shadow:null}];for(;ue.length>0;){const Te=ue.pop();if(Te.shadow){Vs(Te.shadow);continue}const Re=Te.node,Je=q(Re)===_a.element,ft=S(Re);if(ft)for(let pt=ft.length-1;pt>=0;--pt)ue.push({node:ft[pt],shadow:null});if(Je){const pt=T?T(Re):null;if(typeof pt=="string"&&Lt(pt)==="template"){const Rt=Re.content;bl(Rt)&&ue.push({node:Rt,shadow:null})}}if(Je){const pt=C(Re);bl(pt)&&ue.push({node:null,shadow:pt},{node:pt,shadow:null})}}};return t.sanitize=function(Me){let V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=null,Te=null,Re=null,Je=null;if(zr=!Me,zr&&(Me="<!-->"),typeof Me!="string"&&!bo(Me)&&(Me=V9(Me),typeof Me!="string"))throw ir("dirty is not a string, aborting");if(!t.isSupported)return Me;st?(z=Ie,X=Qe):Xu(V),(F.uponSanitizeElement.length>0||F.uponSanitizeAttribute.length>0)&&(z=xa(z)),F.uponSanitizeAttribute.length>0&&(X=xa(X)),t.removed=[];const ft=wn&&typeof Me!="string"&&bo(Me);if(ft){O_(Me);const Aa=H(Me);if(typeof Aa=="string"){const ga=Lt(Aa);if(!z[ga]||$e[ga])throw qs(Me),ir("root node is forbidden and cannot be sanitized in-place")}if(Bs(Me))throw qs(Me),ir("root node is clobbered and cannot be sanitized in-place");try{ec(Me)}catch(ga){throw qs(Me),ga}}else if(bo(Me))ue=Fp("<!---->"),Te=ue.ownerDocument.importNode(Me,!0),Te.nodeType===_a.element&&Te.nodeName==="BODY"||Te.nodeName==="HTML"?ue=Te:ue.appendChild(Te),ec(ue);else{if(!Mt&&!We&&!at&&Me.indexOf("<")===-1)return E&&ze?W(Me):Me;if(ue=Fp(Me),!ue)return Mt?null:ze?P:""}ue&&ot&&rr(ue.firstChild);const pt=ft?Me:ue;try{const Aa=Vp(pt);for(;Re=Aa.nextNode();)jp(Re,pt),Kp(Re,pt),bl(Re.content)&&Vs(Re.content)}catch(Aa){throw ft&&(qs(Me),Xr(t.removed,ga=>{ga.element&&Ls(ga.element)})),Aa}if(ft){let Aa=!1;if(Xr(t.removed,ga=>{ga.element&&(ga.element===Me&&(Aa=!0),Ls(ga.element))}),Aa)throw ir("a node selected for removal could not be safely returned; refusing to sanitize in place");return We&&Qu(Me),Me}if(Mt){if(We&&Qu(ue),je)for(Je=ge.call(ue.ownerDocument);ue.firstChild;)Je.appendChild(ue.firstChild);else Je=ue;return(X.shadowroot||X.shadowrootmode)&&(Je=ce.call(n,Je,!0)),Je}let Rt=at?ue.outerHTML:ue.innerHTML;return at&&z["!doctype"]&&ue.ownerDocument&&ue.ownerDocument.doctype&&ue.ownerDocument.doctype.name&&Qt(X9,ue.ownerDocument.doctype.name)&&(Rt="<!DOCTYPE "+ue.ownerDocument.doctype.name+`>
|
||
`+Rt),We&&(Rt=Ns(Rt)),E&&ze?W(Rt):Rt},t.setConfig=function(){let Me=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Xu(Me),st=!0,Ie=z,Qe=X},t.clearConfig=function(){gl=null,st=!1,Ie=null,Qe=null,E=j,P=""},t.isValidAttribute=function(Me,V,ue){gl||Xu({});const Te=Lt(Me),Re=Lt(V);return Up(Te,Re,ue)},t.addHook=function(Me,V){typeof V=="function"&&da(F,Me)&&Do(F[Me],V)},t.removeHook=function(Me,V){if(da(F,Me)){if(V!==void 0){const ue=R9(F[Me],V);return ue===-1?void 0:I9(F[Me],ue,1)[0]}return Oh(F[Me])}},t.removeHooks=function(Me){da(F,Me)&&(F[Me]=[])},t.removeAllHooks=function(){F=zh()},t}var oN=Q0();const sN=["http","https","mailto","tel"],iN=/[\x00-\x20\x7f]+/g,uN=/^([a-z][a-z0-9+.-]*):/i;function e_(e){if(e==null)return!1;const t=e.replace(iN,"");if(t==="")return!1;const a=uN.exec(t);if(a)return sN.includes(a[1].toLowerCase());try{return new URL(t,"https://admin.invalid/"),!0}catch{return!1}}const cN=["script","style","template","noscript","iframe","frame","frameset","object","embed","applet","svg","math","title","head","meta","link","base"],t_=Object.freeze({ALLOWED_TAGS:[...W0],ALLOWED_ATTR:["href"],ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1,ADD_FORBID_CONTENTS:[...cN],KEEP_CONTENT:!0,RETURN_TRUSTED_TYPE:!1}),dN='<p onclick="x"><b>a</b><script>b<\/script><a href="javascript:c">d</a></p>',fN="<p><b>a</b><a>d</a></p>";let si=null,ad=null;function a_(){return si===null&&typeof window<"u"&&(si=oN(window),si.addHook("uponSanitizeAttribute",(e,t)=>{t.attrName==="href"&&(e.nodeName!=="A"||!e_(t.attrValue))&&(t.keepAttr=!1)})),si}function pN(){if(ad===null){const e=a_();ad=e!==null&&e.isSupported&&e.sanitize(dN,t_)===fN}return ad}function mN(e){return e===""||!pN()?"":a_().sanitize(e,t_)}const vN=["for"],hN=["id","aria-invalid","aria-describedby"],yN=["id"],gN={class:"flex justify-end gap-2"},bN=ne({__name:"LinkPopover",props:{open:{type:Boolean},href:{},inLink:{type:Boolean},idPrefix:{}},emits:["apply","remove","update:open","closed"],setup(e,{emit:t}){const a=e,n=t,r=A(""),l=A(!1),o=A(null);let i=!1;Be(()=>a.open,async m=>{m&&(r.value=a.href,l.value=!1,i=!1,await Ue(),o.value?.focus(),o.value?.select())});function u(){const m=r.value.trim();if(!e_(m)){l.value=!0,o.value?.focus();return}i=!0,n("apply",m)}function d(){i=!0,n("remove")}function c(m){m.key==="Enter"&&(m.preventDefault(),u())}function f(m){n("update:open",m)}function v(m){m.preventDefault(),n("closed",i)}return(m,y)=>(p(),U(s(H1),{open:e.open,"onUpdate:open":f},{default:B(()=>[R(s(x8),{"as-child":""},{default:B(()=>[Se(m.$slots,"default")]),_:3}),R(s(G1),null,{default:B(()=>[R(s(W1),{"data-richeditor-link":"",align:"start","side-offset":8,class:"z-50 flex w-[320px] flex-col gap-2 rounded-inner border border-border bg-surface p-4 text-text shadow-menu",onCloseAutoFocus:v},{default:B(()=>[g("label",{for:`${e.idPrefix}-link-url`,class:"font-semibold"},w(s(h)("backend::lang.richeditor.link_url")),9,vN),ha(g("input",{id:`${e.idPrefix}-link-url`,ref_key:"input",ref:o,"onUpdate:modelValue":y[0]||(y[0]=x=>r.value=x),type:"url",autocomplete:"off",spellcheck:"false",class:me([s(It)(l.value),"h-input"]),"aria-invalid":l.value?"true":void 0,"aria-describedby":l.value?`${e.idPrefix}-link-error`:void 0,onInput:y[1]||(y[1]=x=>l.value=!1),onKeydown:c},null,42,hN),[[kr,r.value]]),l.value?(p(),b("p",{key:0,id:`${e.idPrefix}-link-error`,class:"flex items-center gap-1.5 text-[13px] text-danger"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.richeditor.link_invalid")),1)],8,yN)):Y("",!0),g("div",gN,[e.inLink?(p(),U(Ke,{key:0,variant:"ghost",size:"sm","data-action":"richeditor-unlink",onClick:d},{default:B(()=>[_e(w(s(h)("backend::lang.richeditor.unlink")),1)]),_:1})):Y("",!0),R(Ke,{variant:"primary",size:"sm","data-action":"richeditor-link-apply",onClick:u},{default:B(()=>[_e(w(s(h)("backend::lang.richeditor.link_apply")),1)]),_:1})])]),_:1})]),_:1})]),_:3},8,["open"]))}}),_N=["id"],xN=["innerHTML"],kN={key:1,class:"text-muted"},wN={key:1,"data-richeditor-loading":"","aria-busy":"true",class:"h-[200px] rounded-control bg-skel"},$N={key:2,class:"flex flex-col gap-1.5"},SN={key:0,"data-richeditor-load-failed":"",class:"text-[13px] text-muted"},CN=["data-richeditor"],EN={key:1,role:"note","data-richeditor-lossy":"",class:"flex items-start gap-2 border-b border-border bg-surface px-3.5 py-2.5 text-[13px] text-muted"},AN=["id","name","value","aria-invalid","aria-describedby"],ii="inline-flex size-8 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text aria-pressed:bg-sel aria-pressed:text-text disabled:cursor-not-allowed disabled:opacity-40",TN=ne({__name:"RichEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>!!a.field.readOnly),l=_(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),o=_(()=>r.value?mN(l.value):""),i=A("loading"),u=A(!1),d=A(""),c=A(Ch(l.value)),f=A(null),v=A(null),m=cl(null),y=A(0),x=A(!1),S=A("");let k=null,C=!1,L=null,D="";const T=_(()=>`${a.controlId}-label`),I=_(()=>[It(a.invalid).replace(" px-3.5",""),"overflow-hidden focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]"]);function q(){const F={class:"summer-markdown min-h-[160px] max-h-[480px] overflow-y-auto px-3.5 py-2.5 outline-none",role:"textbox","aria-multiline":"true","aria-labelledby":T.value,"data-richeditor-area":""};return u.value||(F.id=a.controlId),a.describedBy&&(F["aria-describedby"]=a.describedBy),a.invalid&&(F["aria-invalid"]="true"),F}function H(F){L=F,n("update:modelValue",F)}function E(){m.value&&k&&H(k.editorValue(m.value))}$t(async()=>{if(!r.value){try{k=await Y0(()=>import("./editor-CF0xxeFK.js"),__vite__mapDeps([0,1]),import.meta.url)}catch{if(C)return;i.value="failed",d.value=l.value,D=l.value,u.value=!0;return}C||(i.value="ready",await Ue(),!(C||!f.value)&&(m.value=k.createRichEditor({element:f.value,content:l.value,attributes:q(),onChange:E,onTransaction:()=>{y.value++}})))}}),Ot(()=>{C=!0,m.value?.destroy(),m.value=null}),Be(l,F=>{F!==L&&(L=null,c.value=Ch(F),u.value&&(d.value=F,D=F),m.value&&k&&k.loadContent(m.value,F))}),Be([()=>a.invalid,()=>a.describedBy,u],()=>{m.value?.setOptions({editorProps:{attributes:q()}})});const P=[[{key:"bold",icon:u$,label:"backend::lang.richeditor.bold",run:F=>F.chain().focus().toggleBold().run(),active:F=>F.isActive("bold")},{key:"italic",icon:zS,label:"backend::lang.richeditor.italic",run:F=>F.chain().focus().toggleItalic().run(),active:F=>F.isActive("italic")},{key:"underline",icon:y3,label:"backend::lang.richeditor.underline",run:F=>F.chain().focus().toggleUnderline().run(),active:F=>F.isActive("underline")}],[{key:"heading",icon:AS,label:"backend::lang.richeditor.heading",run:F=>F.chain().focus().toggleHeading({level:3}).run(),active:F=>F.isActive("heading",{level:3})},{key:"bullet_list",icon:fb,label:"backend::lang.richeditor.bullet_list",run:F=>F.chain().focus().toggleBulletList().run(),active:F=>F.isActive("bulletList")},{key:"ordered_list",icon:db,label:"backend::lang.richeditor.ordered_list",run:F=>F.chain().focus().toggleOrderedList().run(),active:F=>F.isActive("orderedList")},{key:"quote",icon:zC,label:"backend::lang.richeditor.quote",run:F=>F.chain().focus().toggleBlockquote().run(),active:F=>F.isActive("blockquote")}]],j=[{key:"undo",icon:xb,label:"backend::lang.richeditor.undo",run:F=>F.chain().focus().undo().run(),enabled:F=>F.can().undo()},{key:"redo",icon:UC,label:"backend::lang.richeditor.redo",run:F=>F.chain().focus().redo().run(),enabled:F=>F.can().redo()}],O=_(()=>{y.value;const F=m.value;return!F||u.value?null:{editor:F,inLink:F.isActive("link"),hasSelection:!F.state.selection.empty}});function N(F){if(F.active)return O.value&&F.active(O.value.editor)?"true":"false"}function Z(F){const fe=O.value;return!fe||F.enabled!==void 0&&!F.enabled(fe.editor)}function W(F){O.value&&!Z(F)&&F.run(O.value.editor)}const K=_(()=>!!O.value&&(O.value.hasSelection||O.value.inLink));function te(){if(!O.value||!K.value)return;const F=O.value.editor.getAttributes("link").href;S.value=typeof F=="string"?F:"",x.value=!0}function oe(F){m.value?.chain().focus().extendMarkRange("link").setLink({href:F}).run(),x.value=!1}function ye(){m.value?.chain().focus().extendMarkRange("link").unsetLink().run(),x.value=!1}function be(F){if(x.value=!1,F){m.value?.commands.focus();return}v.value?.$el?.focus()}function ge(){if(!u.value){x.value=!1,d.value=l.value,D=l.value,u.value=!0;return}m.value&&k&&d.value!==D&&k.loadContent(m.value,d.value),u.value=!1}function le(F){d.value=F.target.value,H(d.value)}function ce(F){(F.ctrlKey||F.metaKey)&&!F.altKey&&F.key.toLowerCase()==="k"&&O.value&&(F.preventDefault(),te())}return(F,fe)=>r.value?(p(),b("div",{key:0,id:e.controlId,"data-richeditor-readonly":"",class:"rounded-control border border-border bg-subtle px-3.5 py-2.5"},[o.value!==""?(p(),b("div",{key:0,class:"summer-markdown",innerHTML:o.value},null,8,xN)):(p(),b("span",kN,w(s(h)("backend::lang.list.empty_value")),1))],8,_N)):i.value==="loading"?(p(),b("div",wN)):(p(),b("div",$N,[i.value==="failed"?(p(),b("p",SN,w(s(h)("backend::lang.richeditor.load_failed")),1)):Y("",!0),g("div",{"data-richeditor":e.field.name,class:me(I.value),onKeydown:ce},[i.value==="ready"?(p(),U(s(rD),{key:0,"aria-label":s(h)("backend::lang.richeditor.toolbar"),"aria-controls":e.controlId,class:"flex flex-wrap items-center gap-1 border-b border-border bg-subtle p-1"},{default:B(()=>[(p(),b(pe,null,De(P,(ve,J)=>(p(),b(pe,{key:J},[J>0?(p(),U(s(Vc),{key:0,class:"mx-1 h-5 w-px bg-border"})):Y("",!0),(p(!0),b(pe,null,De(ve,he=>(p(),U(s(Eo),{key:he.key,"data-tool":he.key,"aria-label":s(h)(he.label),title:s(h)(he.label),"aria-pressed":N(he),disabled:Z(he),class:me(ii),onMousedown:fe[0]||(fe[0]=yt(()=>{},["prevent"])),onClick:G=>W(he)},{default:B(()=>[(p(),U(Wt(he.icon),{size:16,"aria-hidden":"true"}))]),_:2},1032,["data-tool","aria-label","title","aria-pressed","disabled","onClick"]))),128))],64))),64)),R(s(Vc),{class:"mx-1 h-5 w-px bg-border"}),R(bN,{open:x.value,href:S.value,"in-link":!!O.value?.inLink,"id-prefix":e.controlId,"onUpdate:open":fe[2]||(fe[2]=ve=>{ve||(x.value=!1)}),onApply:oe,onRemove:ye,onClosed:be},{default:B(()=>[R(s(Eo),{ref_key:"linkButton",ref:v,"data-tool":"link","aria-label":s(h)("backend::lang.richeditor.link"),title:s(h)("backend::lang.richeditor.link"),"aria-pressed":O.value?.inLink?"true":"false","aria-haspopup":"dialog","aria-expanded":x.value?"true":"false",disabled:!K.value,class:me(ii),onMousedown:fe[1]||(fe[1]=yt(()=>{},["prevent"])),onClick:te},{default:B(()=>[R(s(cb),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","title","aria-pressed","aria-expanded","disabled"])]),_:1},8,["open","href","in-link","id-prefix"]),R(s(Eo),{"data-tool":"unlink","aria-label":s(h)("backend::lang.richeditor.unlink"),title:s(h)("backend::lang.richeditor.unlink"),disabled:!O.value?.inLink,class:me(ii),onMousedown:fe[3]||(fe[3]=yt(()=>{},["prevent"])),onClick:ye},{default:B(()=>[R(s(_3),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","title","disabled"]),R(s(Vc),{class:"mx-1 h-5 w-px bg-border"}),(p(),b(pe,null,De(j,ve=>R(s(Eo),{key:ve.key,"data-tool":ve.key,"aria-label":s(h)(ve.label),title:s(h)(ve.label),disabled:Z(ve),class:me(ii),onMousedown:fe[4]||(fe[4]=yt(()=>{},["prevent"])),onClick:J=>W(ve)},{default:B(()=>[(p(),U(Wt(ve.icon),{size:16,"aria-hidden":"true"}))]),_:2},1032,["data-tool","aria-label","title","disabled","onClick"])),64)),R(s(Eo),{"data-tool":"source","aria-pressed":u.value?"true":"false",class:"ml-auto inline-flex h-8 items-center gap-1.5 rounded-pager px-2 text-[13px] text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text aria-pressed:bg-sel aria-pressed:text-text",onMousedown:fe[5]||(fe[5]=yt(()=>{},["prevent"])),onClick:ge},{default:B(()=>[R(s(ob),{size:16,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.richeditor.source")),1)]),_:1},8,["aria-pressed"])]),_:1},8,["aria-label","aria-controls"])):Y("",!0),c.value&&i.value==="ready"?(p(),b("p",EN,[R(s(Rr),{size:14,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.richeditor.lossy_note")),1)])):Y("",!0),ha(g("div",{ref_key:"mount",ref:f},null,512),[[us,!u.value]]),u.value?(p(),b("textarea",{key:2,id:e.controlId,"data-richeditor-source":"",name:e.field.name,value:d.value,spellcheck:"false","aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"block min-h-[160px] w-full resize-y bg-surface px-3.5 py-2.5 font-mono text-[13px] text-text outline-none",onInput:le},null,40,AN)):Y("",!0)],42,CN)]))}}),ON={role:"tablist",class:"inline-flex gap-1 rounded-inner border border-border bg-subtle p-1"},DN=["id","data-tab","aria-selected","aria-controls","tabindex","onClick","onKeydown"],MN=["aria-label"],Ju=ne({__name:"FormTabs",props:{tabs:{},modelValue:{},idPrefix:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;function r(l,o){const i=l.key==="ArrowRight"?1:l.key==="ArrowLeft"?-1:0;if(i===0)return;l.preventDefault();const u=(o+i+a.tabs.length)%a.tabs.length,d=a.tabs[u];d&&(n("update:modelValue",d.key),document.getElementById(ro(a.idPrefix,u))?.focus())}return(l,o)=>(p(),b("div",ON,[(p(!0),b(pe,null,De(e.tabs,(i,u)=>(p(),b("button",{id:s(ro)(e.idPrefix,u),key:i.key,type:"button",role:"tab","data-tab":i.key,"aria-selected":i.key===e.modelValue?"true":"false","aria-controls":s(Is)(e.idPrefix,u),tabindex:i.key===e.modelValue?0:-1,class:me([i.key===e.modelValue?"bg-surface text-text shadow-tab":"text-muted hover:text-text","inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold transition-colors duration-150 ease-out"]),onClick:d=>n("update:modelValue",i.key),onKeydown:d=>r(d,u)},[_e(w(i.label)+" ",1),i.errors>0?(p(),b("span",{key:0,"data-tab-errors":"","aria-label":s(wa)("backend::lang.form.tab_errors",i.errors),class:"inline-flex h-5 min-w-5 items-center justify-center rounded-pill bg-danger px-1.5 text-[11px] font-bold text-white"},w(i.errors),9,MN)):Y("",!0)],42,DN))),128))]))}}),PN={class:"flex items-start gap-3 p-6 pb-4"},RN={key:0,"data-child-loading":"","aria-hidden":"true",class:"grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},IN={key:1,role:"alert","data-child-load-failed":"",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},qN=["id","role","aria-labelledby"],LN=["disabled"],NN={class:"flex items-center gap-2.5 border-t border-border px-6 py-4"},BN={class:"ml-auto flex gap-2.5"},FN=ne({__name:"RelationChildModal",props:{open:{type:Boolean},source:{},ownerId:{},relation:{},schema:{},mode:{},childId:{},sessionKey:{},canDelete:{type:Boolean}},emits:["update:open","changed","gone","closed"],setup(e,{emit:t}){const a=e,n=t,r=A({}),l=A({}),o=A({}),i=A(!1),u=A(!1),d=A(!1),c=A(""),f=A(Ft),v=A(bs()),m=A(0),y=A(0),{activeUploads:x,beginUpload:S}=Ep(),k=A(null),C=Fr();let L=0;const D=_(()=>`child-${a.relation}`),T=_(()=>a.mode==="preview"),I=_(()=>a.mode==="create"?"create":"update"),q=_(()=>{const $=((T.value?a.schema.viewForm:a.schema.manageForm)??[]).filter(M=>xs(M,I.value));return T.value?$.map(M=>({...M,readOnly:!0,attributes:{...M.attributes??{},readonly:!0}})):$}),H=_(()=>q.value.map(ae=>ae.name)),E=_(()=>{if(!q.value.some($=>$.tab))return[];const ae=[];for(const $ of q.value){const M=ma($);let z=ae.find(de=>de.key===M);z||(z={key:M,label:$.tab||h("backend::lang.form.tab_default"),errors:0},M===Ft?ae.unshift(z):ae.push(z)),o.value[$.name]&&(z.errors+=1)}return ae}),P=_(()=>Math.max(E.value.findIndex(ae=>ae.key===f.value),0)),j=_(()=>{if(E.value.length===0)return q.value;const ae=E.value[P.value]?.key??Ft;return q.value.filter($=>ma($)===ae)}),O=_(()=>{const ae=a.schema.messages;return a.mode==="create"?Xe(ae.createTitle):Xe(T.value?ae.previewTitle:ae.updateTitle)}),N=_(()=>Xe(a.mode==="create"?a.schema.messages.createSubmit:a.schema.messages.updateSubmit)),Z=_(()=>!T.value&&!i.value&&!u.value&&(m.value>0||x.value>0||br(Pa(q.value,r.value))!==c.value));function W(){return{[Tr]:a.sessionKey,[R0]:v.value}}function K(){return{...a.source,id:a.ownerId,name:a.relation}}ht(po,{get key(){return a.sessionKey},get childKey(){return v.value},get recordId(){return a.childId??0},routes:ae=>DR(a.source,a.ownerId,a.relation,a.childId??0,ae,a.sessionKey,v.value),markDirty:()=>{m.value++},pendingChanges:At(m),revision:At(y),beginUpload:S,activeUploads:At(x)}),ht(Ps,_(()=>r.value)),ht(Cp,be);const oe=ct(au,_(()=>[]));ht(au,oe),ht(Tp,At(A({})));function ye(ae,$){const M=l.value[ae]??[],z=M.findIndex(X=>X.value===$.value),de=[...M];z>=0?de[z]=$:de.push($),l.value={...l.value,[ae]:de}}ht(Dp,ye);function be(ae,$){if(r.value={...r.value,[ae]:$},o.value[ae]){const M={...o.value};delete M[ae],o.value=M}}function ge(ae,$){const M=oe.value,z={...ae};for(const de of q.value)de.type==="password"?z[de.name]="":Or(de)&&(z[de.name]=f_(ae[de.name],M));r.value=z,l.value=$?.labels??{},c.value=br(Pa(q.value,r.value))}async function le(){await Ue(),k.value?.querySelector('input:not([type="hidden"]):not([tabindex="-1"]), select, textarea, button, [contenteditable="true"], [tabindex="0"]')?.focus()}function ce(){n("update:open",!1),Pe(h("backend::lang.relation.child_gone"),"danger"),n("gone")}async function F(){const ae=++L;if(o.value={},u.value=!1,d.value=!1,m.value=0,v.value=bs(),f.value=Ft,a.mode==="create"||a.childId===null){i.value=!1,ge(Pp(q.value,oe.value)),f.value=E.value[0]?.key??Ft,await le();return}i.value=!0;try{const $=await qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}",{params:{path:{...K(),child:a.childId},header:W()}});if(ae!==L)return;if($.data)ge($.data.data,$.data.meta),f.value=E.value[0]?.key??Ft;else if($.response.status===404){ce();return}else u.value=!0}catch{ae===L&&(u.value=!0)}finally{ae===L&&(i.value=!1)}ae===L&&await le()}Be(()=>a.open,ae=>{ae?F():L++},{immediate:!0});async function fe(ae){if(ae){n("update:open",!0);return}d.value||Z.value&&!await C.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||n("update:open",!1)}async function ve(ae){o.value=Dr(ae);const $=q.value.filter(z=>o.value[z.name]),M=$.find(z=>ma(z)===f.value)??$[0];M&&(E.value.length>0&&(f.value=ma(M)),await Ue(),Nn(D.value,M.name))}async function J(){if(!(d.value||T.value||i.value||u.value||x.value>0)){d.value=!0;try{const ae=Pa(q.value,r.value),$=a.mode==="create"||a.childId===null?await qe.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records",{params:{path:K(),header:W()},body:ae}):await qe.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/records/{child}",{params:{path:{...K(),child:a.childId},header:W()},body:ae});if($.data){const z=a.mode==="create"?"created":"updated";o.value={},m.value=0,n("update:open",!1),Pe(Xe(z==="created"?a.schema.messages.created:a.schema.messages.updated)),n("changed",z);return}const M=$.response.status;M===422?await ve($.error?.error.details):M===404?ce():Pe($.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{d.value=!1}}}async function he(){if(d.value||a.childId===null)return;const ae=a.childId;if(await C.ask({message:Xe(a.schema.messages.deleteOneConfirm),confirmLabel:h("backend::lang.form.delete"),danger:!0})){d.value=!0;try{const M=await qe.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/delete",{params:{path:K(),header:{[Tr]:a.sessionKey}},body:{ids:[ae]}});if(M.data){m.value=0,n("update:open",!1),Pe(Xe(a.schema.messages.deleted,M.data.data.deleted||1)),n("changed","deleted");return}if(M.response.status===404){ce();return}Pe(M.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{d.value=!1}}}function G(ae){ae.preventDefault()}function ee(ae){ae.preventDefault(),n("closed")}return(ae,$)=>(p(),b(pe,null,[R(s(Jn),{open:e.open,"onUpdate:open":fe},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-relation-child-modal":"","data-dialog-content":"","data-mode":e.mode,"aria-modal":"true","aria-describedby":void 0,class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[720px] -translate-x-1/2 -translate-y-1/2 flex-col rounded-modal bg-surface text-text shadow-pop",onOpenAutoFocus:G,onCloseAutoFocus:ee},{default:B(()=>[g("div",PN,[R(s(hn),{class:"min-w-0 flex-1 text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(O.value),1)]),_:1}),R(s(Cr),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),disabled:d.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:B(()=>[R(s(Vt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),g("div",{ref_key:"body",ref:k,"data-child-body":"",class:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-6 pb-6"},[i.value?(p(),b("div",RN,[(p(),b(pe,null,De(6,M=>g("div",{key:M,class:"flex flex-col gap-1.5"},[...$[3]||($[3]=[g("span",{class:"block h-3 w-24 rounded-[6px] bg-skel"},null,-1),g("span",{class:"block h-input rounded-control bg-skel"},null,-1)])])),64))])):u.value?(p(),b("p",IN,w(s(h)("backend::lang.relation.child_load_failed")),1)):(p(),b(pe,{key:2},[R(vo,{errors:o.value,"field-names":H.value},null,8,["errors","field-names"]),E.value.length>0?(p(),U(Ju,{key:0,modelValue:f.value,"onUpdate:modelValue":$[0]||($[0]=M=>f.value=M),tabs:E.value,"id-prefix":D.value,class:"self-start"},null,8,["modelValue","tabs","id-prefix"])):Y("",!0),g("form",{id:E.value.length>0?s(Is)(D.value,P.value):void 0,role:E.value.length>0?"tabpanel":void 0,"aria-labelledby":E.value.length>0?s(ro)(D.value,P.value):void 0,novalidate:"",onSubmit:yt(J,["prevent"])},[g("fieldset",{disabled:d.value||T.value,class:"m-0 min-w-0 border-0 p-0"},[R(mo,{fields:j.value,values:r.value,errors:o.value,labels:l.value,source:e.source,"record-id":e.childId,"id-prefix":D.value,onUpdate:be},null,8,["fields","values","errors","labels","source","record-id","id-prefix"])],8,LN)],40,qN)],64))],512),g("div",NN,[e.mode==="update"&&e.canDelete&&!i.value&&!u.value?(p(),U(Ke,{key:0,variant:"danger","data-action":"delete-child",icon:s(Ir),disabled:d.value,onClick:he},{default:B(()=>[_e(w(s(h)("backend::lang.form.delete")),1)]),_:1},8,["icon","disabled"])):Y("",!0),g("div",BN,[T.value?(p(),U(Ke,{key:0,variant:"outline","data-action":"cancel",onClick:$[1]||($[1]=M=>fe(!1))},{default:B(()=>[_e(w(s(h)("backend::lang.form.close")),1)]),_:1})):(p(),b(pe,{key:1},[R(Ke,{variant:"ghost","data-action":"cancel",disabled:d.value,onClick:$[2]||($[2]=M=>fe(!1))},{default:B(()=>[_e(w(s(h)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),u.value?Y("",!0):(p(),U(Ke,{key:0,variant:"primary","data-action":"save-child",hotkey:"mod+s mod+enter",title:s(ja)(N.value,"mod+s"),disabled:d.value||i.value||s(x)>0,onClick:J},{default:B(()=>[_e(w(d.value?s(h)("backend::lang.form.saving"):N.value),1)]),_:1},8,["title","disabled"]))],64))])])]),_:1},8,["data-mode"])]),_:1})]),_:1},8,["open"]),R(Br,{open:s(C).request.value!==null,message:s(C).request.value?.message??"","confirm-label":s(C).request.value?.confirmLabel,danger:s(C).request.value?.danger,onConfirm:s(C).confirm,onCancel:s(C).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),VN={class:"flex items-start gap-3"},zN={class:"flex min-w-0 flex-1 flex-col gap-1"},jN=["title"],UN={key:0,class:"truncate text-[13px] text-muted"},HN=["disabled"],KN={class:"relative block"},WN={class:"sr-only"},GN=["value","placeholder"],YN=["aria-multiselectable","aria-label","aria-busy"],JN=["data-candidate","aria-selected","onClick","onKeydown"],ZN={class:"flex size-8 shrink-0 items-center justify-center rounded-full bg-subtle text-[12px] font-bold","aria-hidden":"true"},XN={class:"flex min-w-0 flex-1 flex-col leading-tight"},QN={class:"truncate font-semibold"},eB={key:0,class:"truncate text-[13px] text-muted"},tB={key:0,class:"block size-2.5 rounded-full bg-primary"},aB={key:0,role:"presentation",class:"px-1 py-3 text-[13px] text-muted"},nB={key:1,role:"presentation","data-candidates-empty":"",class:"px-1 py-3 text-[13px] text-muted"},rB=["aria-label"],lB={"data-candidates-range":"",class:"flex-1"},oB=["aria-label","disabled"],sB=["aria-label","disabled"],iB={class:"flex gap-2.5"},uB=["disabled"],cB=["disabled"],dB=["aria-keyshortcuts","title","disabled","aria-busy"],fB=5,pB=300,jh="inline-flex size-[34px] items-center justify-center rounded-tab border border-border text-text hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",mB=ne({__name:"RelationPickerModal",props:{open:{type:Boolean},source:{},recordId:{},relation:{},schema:{},sessionKey:{}},emits:["update:open","linked","closed"],setup(e,{emit:t}){const a=e,n=t,r=A(""),l=A(1),o=A([]),i=A(null),u=A(!1),d=A(!1),c=A(new Set),f=A(null),v=A(1),m=A(null),y=A({}),x=A({}),S=A(null);let k=0,C=null;const L=_(()=>a.schema.manage.list.columns),D=_(()=>L.value[0]?.key??""),T=_(()=>L.value[1]?.key??""),I=_(()=>c.value.size),q=`relation-${a.relation}-candidates`,H=_(()=>a.schema.pivotForm??[]),E=_(()=>H.value.map($=>$.name)),P=_(()=>H.value.length>0),j=_(()=>`link-${a.relation}`);function O(){return a.sessionKey?{[Tr]:a.sessionKey}:void 0}const N=_(()=>{const $=i.value;if(!$||$.total===0)return"";const M=($.page-1)*$.per_page+1,z=Math.min($.page*$.per_page,$.total);return h("backend::lang.relation.candidates_range",{from:M,to:z,total:$.total})}),Z=_(()=>Math.max(i.value?.last_page??1,1));function W($){const M=$.id;return typeof M=="number"&&Number.isInteger(M)?M:typeof M=="string"&&/^\d+$/.test(M)?Number(M):null}function K($,M){const z=M===""?void 0:$[M];return typeof z=="string"||typeof z=="number"?String(z):""}function te($){return $.split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(M=>M.charAt(0).toUpperCase()).join("")}async function oe(){const $=++k;u.value=!0;try{const M=r.value.trim(),{data:z}=await qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/candidates",{params:{path:{...a.source,id:a.recordId,name:a.relation},query:{search:M===""?void 0:M,page:l.value,per_page:fB},header:O()}});if($!==k)return;o.value=z?.data??[],i.value=z?.meta??null}catch{$===k&&(o.value=[],i.value=null)}finally{$===k&&(u.value=!1)}}function ye(){C!==null&&(clearTimeout(C),C=null),k++,r.value="",l.value=1,o.value=[],i.value=null,u.value=!1,c.value=new Set,v.value=1,m.value=null,y.value={},x.value={}}Be(()=>a.open,$=>{$?(ye(),oe()):ye()},{immediate:!0});function be($){r.value=$.target.value,C!==null&&clearTimeout(C),C=setTimeout(()=>{C=null,l.value=1,oe()},pB)}function ge($){$<1||$>Z.value||$===l.value||(l.value=$,oe())}function le($){const M=W($);return M!==null&&c.value.has(M)}function ce($){const M=W($);if(M===null)return;if(P.value){c.value=new Set([M]),m.value=$;return}const z=new Set(c.value);z.has(M)?z.delete(M):z.add(M),c.value=z}async function F(){!P.value||c.value.size===0||!m.value||(v.value=2,y.value=Pp(H.value,[]),x.value={},await Ue(),S.value?.querySelector('input, select, textarea, button, [contenteditable="true"]')?.focus())}async function fe(){if(d.value)return;v.value=1,x.value={},await Ue(),(document.querySelector(`#${q} [aria-selected="true"]`)??f.value)?.focus()}function ve($,M){if(y.value={...y.value,[$]:M},x.value[$]){const z={...x.value};delete z[$],x.value=z}}function J($,M,z){switch($.key){case" ":$.preventDefault(),ce(M);break;case"Enter":$.preventDefault(),ce(M),P.value&&F();break;case"ArrowDown":case"ArrowUp":{$.preventDefault();const de=$.currentTarget.parentElement?.querySelectorAll('[role="option"]'),X=$.key==="ArrowDown"?1:-1;de?.[Math.min(Math.max(z+X,0),de.length-1)]?.focus();break}}}function he($){n("update:open",$)}async function G(){const $=[...c.value];if(d.value||$.length===0)return;const M=P.value;d.value=!0;try{const z=await qe.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/link",{params:{path:{...a.source,id:a.recordId,name:a.relation},header:O()},body:M?{ids:$.slice(0,1),pivot:Pa(H.value,y.value)}:{ids:$}});if(z.data){he(!1),n("linked",z.data.data.linked??$.length);return}const de=z.response.status;if(M&&de===422){x.value=Dr(z.error?.error.details);const X=H.value.find(se=>x.value[se.name]);X&&(await Ue(),Nn(j.value,X.name));return}if(M&&de===404){Pe(h("backend::lang.relation.child_gone"),"danger"),c.value=new Set,m.value=null,v.value=1,oe();return}if(M){Pe(h("backend::lang.form.error_generic"),"danger");return}Pe(z.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{d.value=!1}}function ee($){$.preventDefault(),f.value?.focus()}function ae($){$.preventDefault(),n("closed")}return Ot(()=>{C!==null&&clearTimeout(C)}),($,M)=>(p(),U(s(Jn),{open:e.open,"onUpdate:open":he},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-relation-picker":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop",onOpenAutoFocus:ee,onCloseAutoFocus:ae},{default:B(()=>[g("div",VN,[g("div",zN,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(v.value===2?s(Xe)(e.schema.messages.pivotTitle):s(Xe)(e.schema.messages.link)),1)]),_:1}),v.value===1?(p(),U(s(pn),{key:0,class:"text-muted"},{default:B(()=>[_e(w(s(Xe)(e.schema.messages.linkHint)),1)]),_:1})):(p(),U(s(pn),{key:1,class:"flex min-w-0 flex-col","data-chosen-record":""},{default:B(()=>[g("span",{class:"truncate font-semibold text-text",title:K(m.value??{},D.value)},w(K(m.value??{},D.value)),9,jN),T.value?(p(),b("span",UN,w(K(m.value??{},T.value)),1)):Y("",!0)]),_:1}))]),R(s(Cr),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:B(()=>[R(s(Vt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),v.value===2?(p(),b("div",{key:0,ref_key:"stepTwo",ref:S,"data-pivot-step":"",class:"flex min-h-0 flex-col gap-4 overflow-y-auto"},[R(vo,{errors:x.value,"field-names":E.value},null,8,["errors","field-names"]),g("form",{novalidate:"",onSubmit:yt(G,["prevent"])},[g("fieldset",{disabled:d.value,class:"m-0 min-w-0 border-0 p-0"},[R(mo,{fields:H.value,values:y.value,errors:x.value,source:e.source,"record-id":null,"id-prefix":j.value,onUpdate:ve},null,8,["fields","values","errors","source","id-prefix"])],8,HN)],32)],512)):Y("",!0),ha(g("label",KN,[g("span",WN,w(s(h)("backend::lang.list.search")),1),R(s(fl),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{ref_key:"searchInput",ref:f,type:"search","data-candidate-search":"",value:r.value,placeholder:s(Xe)(e.schema.messages.candidateSearch),"aria-controls":q,class:"h-input w-full rounded-control border border-border-strong bg-surface pr-3.5 pl-10",onInput:be},null,40,GN)],512),[[us,v.value===1]]),ha(g("ul",{id:q,role:"listbox","aria-multiselectable":P.value?"false":"true","aria-label":s(Xe)(e.schema.messages.link),"aria-busy":u.value?"true":void 0,class:"flex min-h-0 flex-col gap-2 overflow-y-auto"},[(p(!0),b(pe,null,De(o.value,(z,de)=>(p(),b("li",{key:W(z)??`row-${de}`,role:"option",tabindex:"0","data-candidate":W(z)??void 0,"aria-selected":le(z)?"true":"false",class:me([le(z)?"border-[#e0b020] bg-sel":"border-border hover:bg-hover","flex h-[54px] cursor-pointer items-center gap-3 rounded-inner border px-3 transition-colors duration-150 ease-out"]),onClick:X=>ce(z),onKeydown:X=>J(X,z,de)},[g("span",ZN,w(te(K(z,D.value))),1),g("span",XN,[g("span",QN,w(K(z,D.value)),1),T.value?(p(),b("span",eB,w(K(z,T.value)),1)):Y("",!0)]),P.value?(p(),b("span",{key:0,"data-radio":"",class:me([le(z)?"border-primary":"border-border-strong bg-surface","flex size-[18px] shrink-0 items-center justify-center rounded-full border"]),"aria-hidden":"true"},[le(z)?(p(),b("span",tB)):Y("",!0)],2)):(p(),b("span",{key:1,class:me([le(z)?"border-primary bg-primary text-on-primary":"border-border-strong bg-surface","flex size-[18px] shrink-0 items-center justify-center rounded-checkbox border"]),"aria-hidden":"true"},[le(z)?(p(),U(s(Na),{key:0,size:14})):Y("",!0)],2))],42,JN))),128)),u.value&&o.value.length===0?(p(),b("li",aB,w(s(h)("backend::lang.list.loading")),1)):!u.value&&o.value.length===0?(p(),b("li",nB,w(s(h)("backend::lang.relation.no_candidates")),1)):Y("",!0)],8,YN),[[us,v.value===1]]),v.value===1&&i.value&&i.value.total>0?(p(),b("nav",{key:1,"aria-label":s(h)("backend::lang.list.pagination"),class:"flex items-center gap-2 text-[13px] text-muted"},[g("span",lB,w(N.value),1),g("button",{type:"button","data-page":"prev","aria-label":s(h)("backend::lang.list.prev_page"),class:me(jh),disabled:u.value||l.value<=1,onClick:M[0]||(M[0]=z=>ge(l.value-1))},[R(s(Cu),{size:16,"aria-hidden":"true"})],8,oB),g("button",{type:"button","data-page":"next","aria-label":s(h)("backend::lang.list.next_page"),class:me(jh),disabled:u.value||l.value>=Z.value,onClick:M[1]||(M[1]=z=>ge(l.value+1))},[R(s(so),{size:16,"aria-hidden":"true"})],8,sB)],8,rB)):Y("",!0),g("div",iB,[v.value===2?(p(),b("button",{key:0,type:"button","data-action":"back",disabled:d.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:fe},w(s(h)("backend::lang.relation.back")),9,uB)):(p(),U(s(Cr),{key:1,"data-action":"cancel",class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover"},{default:B(()=>[_e(w(s(h)("backend::lang.form.cancel")),1)]),_:1})),P.value&&v.value===1?(p(),b("button",{key:2,type:"button","data-action":"next",disabled:I.value===0,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",onClick:F},w(s(h)("backend::lang.relation.next")),9,cB)):(p(),b("button",{key:3,type:"button","data-action":"confirm-link","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Hu)("mod+s mod+enter"),title:s(ja)(P.value?s(Xe)(e.schema.messages.linkSubmit):s(h)("backend::lang.relation.add_count",{count:I.value}),"mod+s"),disabled:d.value||I.value===0,"aria-busy":d.value?"true":void 0,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",onClick:G},[P.value?(p(),b(pe,{key:0},[_e(w(d.value?s(h)("backend::lang.form.saving"):s(Xe)(e.schema.messages.linkSubmit)),1)],64)):(p(),b(pe,{key:1},[_e(w(s(h)("backend::lang.relation.add_count",{count:I.value})),1)],64))],8,dB))])]),_:1})]),_:1})]),_:1},8,["open"]))}}),vB={class:"flex items-start gap-3"},hB={class:"flex min-w-0 flex-1 flex-col gap-1"},yB={key:0,"data-pivot-loading":"","aria-hidden":"true",class:"flex flex-col gap-1.5"},gB={key:1,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},bB=["disabled"],_B={class:"flex gap-2.5"},xB=["disabled"],kB=["aria-keyshortcuts","title","disabled"],wB=ne({__name:"RelationPivotModal",props:{open:{type:Boolean},source:{},ownerId:{},relation:{},schema:{},childId:{},childName:{},sessionKey:{}},emits:["update:open","saved","gone","closed"],setup(e,{emit:t}){const a=e,n=t,r=A({}),l=A({}),o=A(!1),i=A(!1),u=A(!1),d=A(""),c=Fr();let f=0;const v=_(()=>`pivot-${a.relation}`),m=_(()=>a.schema.pivotForm??[]),y=_(()=>m.value.map(H=>H.name)),x=_(()=>!o.value&&!i.value&&br(Pa(m.value,r.value))!==d.value);function S(){return{[Tr]:a.sessionKey}}function k(H){return{...a.source,id:a.ownerId,name:a.relation,child:H}}function C(H,E){if(r.value={...r.value,[H]:E},l.value[H]){const P={...l.value};delete P[H],l.value=P}}function L(){n("update:open",!1),Pe(h("backend::lang.relation.child_gone"),"danger"),n("gone")}async function D(){const H=++f;if(l.value={},i.value=!1,u.value=!1,r.value={},d.value=br({}),a.childId!==null){o.value=!0;try{const E=await qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/pivot/{child}",{params:{path:k(a.childId),header:S()}});if(H!==f)return;E.data?(r.value={...E.data.data},d.value=br(Pa(m.value,r.value))):E.response.status===404?L():i.value=!0}catch{H===f&&(i.value=!0)}finally{H===f&&(o.value=!1)}}}Be(()=>a.open,H=>{H?D():f++},{immediate:!0});async function T(H){if(H){n("update:open",!0);return}u.value||x.value&&!await c.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||n("update:open",!1)}async function I(){if(!(u.value||o.value||i.value||a.childId===null)){u.value=!0;try{const H=await qe.PUT("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/pivot/{child}",{params:{path:k(a.childId),header:S()},body:Pa(m.value,r.value)});if(H.data){l.value={},d.value=br(Pa(m.value,r.value)),n("update:open",!1),Pe(Xe(a.schema.messages.pivotSaved)),n("saved");return}const E=H.response.status;if(E===422){l.value=Dr(H.error?.error.details);const P=m.value.find(j=>l.value[j.name]);P&&(await Ue(),Nn(v.value,P.name))}else E===404?L():Pe(h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{u.value=!1}}}function q(H){H.preventDefault(),n("closed")}return(H,E)=>(p(),b(pe,null,[R(s(Jn),{open:e.open,"onUpdate:open":T},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-relation-pivot-modal":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 overflow-y-auto rounded-modal bg-surface p-6 text-text shadow-pop",onCloseAutoFocus:q},{default:B(()=>[g("div",vB,[g("div",hB,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(s(Xe)(e.schema.messages.pivotTitle)),1)]),_:1}),R(s(pn),{class:"truncate text-muted",title:e.childName},{default:B(()=>[_e(w(e.childName),1)]),_:1},8,["title"])]),R(s(Cr),{"data-action":"close","aria-label":s(h)("backend::lang.form.close"),disabled:u.value,class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text"},{default:B(()=>[R(s(Vt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label","disabled"])]),o.value?(p(),b("div",yB,[...E[1]||(E[1]=[g("span",{class:"block h-3 w-24 rounded-[6px] bg-skel"},null,-1),g("span",{class:"block h-input rounded-control bg-skel"},null,-1)])])):i.value?(p(),b("p",gB,w(s(h)("backend::lang.relation.child_load_failed")),1)):(p(),b("form",{key:2,class:"flex flex-col gap-4",novalidate:"",onSubmit:yt(I,["prevent"])},[R(vo,{errors:l.value,"field-names":y.value},null,8,["errors","field-names"]),g("fieldset",{disabled:u.value,class:"m-0 min-w-0 border-0 p-0"},[R(mo,{fields:m.value,values:r.value,errors:l.value,source:e.source,"record-id":null,"id-prefix":v.value,onUpdate:C},null,8,["fields","values","errors","source","id-prefix"])],8,bB)],32)),g("div",_B,[g("button",{type:"button","data-action":"cancel",disabled:u.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control border border-border-strong bg-surface font-semibold hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:E[0]||(E[0]=P=>T(!1))},w(s(h)("backend::lang.form.cancel")),9,xB),g("button",{type:"button","data-action":"save-pivot","data-hotkey":"mod+s mod+enter","aria-keyshortcuts":s(Hu)("mod+s mod+enter"),title:s(ja)(s(Xe)(e.schema.messages.pivotSubmit),"mod+s"),disabled:u.value||o.value||i.value,class:"inline-flex h-button flex-1 items-center justify-center rounded-control bg-primary font-semibold text-on-primary hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60",onClick:I},w(u.value?s(h)("backend::lang.form.saving"):s(Xe)(e.schema.messages.pivotSubmit)),9,kB)])]),_:1})]),_:1})]),_:1},8,["open"]),R(Br,{open:s(c).request.value!==null,message:s(c).request.value?.message??"","confirm-label":s(c).request.value?.confirmLabel,danger:s(c).request.value?.danger,onConfirm:s(c).confirm,onCancel:s(c).cancel},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])],64))}}),$B=["id","data-relation-name","data-deferred","aria-labelledby","aria-describedby"],SB={class:"flex flex-col gap-2"},CB={class:"flex flex-wrap items-center gap-3"},EB={class:"flex min-w-0 flex-1 flex-col"},AB=["id"],TB=["id"],OB={key:0,class:"relative block w-[220px] max-w-full"},DB={class:"sr-only"},MB=["value","placeholder"],PB={key:0,"data-relation-pending":"",class:"flex items-center gap-2 text-[13px] text-muted"},RB={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},IB={key:1,class:"overflow-hidden rounded-inner border border-border"},qB={"data-relation-empty":"",class:"text-muted"},LB=["aria-label","onClick"],NB=300,BB=ne({__name:"RelationManager",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(po,null),n=_(()=>t.field.relation||t.field.name),r=_(()=>typeof t.recordId=="number"?t.recordId:a&&a.recordId===0&&t.field.deferrable?0:null),l=_(()=>r.value===0),o=_(()=>t.source!=null&&r.value!==null),i=a?.key??bs(),u=A(null),d=A([]),c=A(null),f=A(!0),v=A(!1),m=A(""),y=A(1),x=A(null),S=A([]),k=A(!1),C=A(!1),L=A(!1),D=A("create"),T=A(null),I=A(!1),q=A(null),H=A("");let E=null,P=null,j=null;const O=Fr();let N=0,Z=null;const W=_(()=>u.value?.view.list.columns??[]),K=_(()=>u.value?.view.toolbarButtons??[]),te=_(()=>u.value?.messages),oe=_(()=>`${t.controlId}-heading`),ye=_(()=>`${t.controlId}-comment`),be=_(()=>K.value.includes("create")&&(u.value?.manageForm?.length??0)>0),ge=_(()=>K.value.includes("update")&&(u.value?.manageForm?.length??0)>0),le=_(()=>u.value?.kind==="belongsToMany"&&(u.value?.pivotForm?.length??0)>0&&(K.value.includes("link")||K.value.includes("update"))),ce=_(()=>(u.value?.viewForm?.length??0)>0),F=_(()=>ge.value?"update":le.value?"pivot":ce.value?"preview":null),fe=_(()=>ge.value&&le.value),ve=_(()=>K.value.includes("unlink")||K.value.includes("delete"));function J(){return l.value?{[Tr]:i}:void 0}function he(){return{...t.source,id:r.value,name:n.value}}function G(){l.value&&a?.markDirty()}async function ee(){const{data:je}=await qe.GET("/{vendor}/{plugin}/{controller}/schema/relation/{name}",{params:{path:{...t.source,name:n.value}}});u.value=je?.data??null}async function ae(){const je=++N;f.value=!0,v.value=!1;try{const ze=m.value.trim(),Ge={page:y.value};ze!==""&&(Ge.search=ze),x.value&&(Ge.sort=x.value.column,Ge.dir=x.value.dir);const{data:Bt}=await qe.GET("/{vendor}/{plugin}/{controller}/{id}/relations/{name}",{params:{path:he(),query:Ge,header:J()}});if(je!==N)return;d.value=Bt?.data??[],c.value=Bt?.meta??null,v.value=!Bt}catch{je===N&&(d.value=[],c.value=null,v.value=!0)}finally{je===N&&(f.value=!1)}}async function $(){if(o.value){try{await ee()}catch{u.value=null}if(!u.value){f.value=!1,v.value=!0;return}await ae()}}function M(je){m.value=je.target.value,Z!==null&&clearTimeout(Z),Z=setTimeout(()=>{Z=null,y.value=1,S.value=[],ae()},NB)}function z(je){y.value=je,S.value=[],ae()}function de(je){const ze=x.value;ze?.column!==je?x.value={column:je,dir:"asc"}:ze.dir==="asc"?x.value={column:je,dir:"desc"}:x.value=null,y.value=1,S.value=[],ae()}function X(){return S.value.map(Number).filter(je=>Number.isInteger(je)&&je>0)}function se(je){const ze=je.id;return typeof ze=="number"&&Number.isInteger(ze)?ze:typeof ze=="string"&&/^\d+$/.test(ze)?Number(ze):null}function xe(je){const ze=W.value[0]?.key,Ge=ze?je[ze]:void 0;return typeof Ge=="string"||typeof Ge=="number"?String(Ge):""}async function $e(){const je=X();if(!(k.value||je.length===0||!u.value||!await O.ask({message:Xe(te.value?.unlinkConfirm,je.length),confirmLabel:Xe(te.value?.unlinkSelected),danger:!0}))){k.value=!0;try{const Ge=await qe.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/unlink",{params:{path:he(),header:J()},body:{ids:je}});if(Ge.data){S.value=[],G(),Pe(Xe(te.value?.unlinked,Ge.data.data.removed??je.length)),await ae();return}Pe(Ge.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{k.value=!1}}}async function Ce(je){k.value=!0;try{const ze=await qe.POST("/{vendor}/{plugin}/{controller}/{id}/relations/{name}/delete",{params:{path:he(),header:J()},body:{ids:je}});if(ze.data){S.value=[],G(),Pe(Xe(te.value?.deleted,ze.data.data.deleted||je.length)),await ae();return}Pe(ze.error?.error.message||h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{k.value=!1}}async function ie(){const je=X();k.value||je.length===0||!u.value||await O.ask({message:Xe(te.value?.deleteConfirm,je.length),confirmLabel:Xe(te.value?.deleteSelected),danger:!0},()=>Ce(je))}async function Ee(je){G(),Pe(Xe(te.value?.linked,je)),S.value=[],await ae()}function we(je){E=je.currentTarget??j,D.value="create",T.value=null,L.value=!0}function Le(je,ze){const Ge=se(je);Ge!==null&&(E=ze,q.value=Ge,H.value=xe(je),I.value=!0)}function Ve(je,ze){const Ge=F.value,Bt=se(je);if(!(Ge===null||Bt===null)){if(Ge==="pivot"){Le(je,ze);return}E=ze,D.value=Ge,T.value=Bt,L.value=!0}}async function We(){G(),S.value=[],await ae()}async function tt(){G(),await ae()}async function at(){S.value=[],await ae()}function st(){const je=E&&E.isConnected?E:null;E=null,je?.focus()}function Ie(){P?.focus()}function Qe(je){const ze=je?.$el;return ze instanceof HTMLElement?ze:null}function ot(je){P=Qe(je)}function Mt(je){j=Qe(je)}return Ot(()=>{Z!==null&&clearTimeout(Z)}),$(),(je,ze)=>o.value?(p(),b("section",{key:0,id:e.controlId,"data-relation-manager":"","data-relation-name":n.value,"data-deferred":l.value?"true":void 0,"aria-labelledby":oe.value,"aria-describedby":e.field.comment?ye.value:void 0,tabindex:"-1",class:"flex flex-col gap-4"},[g("div",SB,[g("header",CB,[g("div",EB,[g("h2",{id:oe.value,class:"text-[17px] font-bold tracking-[-0.01em]"},w(u.value?.label||e.field.label||n.value),9,AB),e.field.comment?(p(),b("p",{key:0,id:ye.value,class:"text-[13px] text-muted"},w(e.field.comment),9,TB)):Y("",!0)]),u.value?.view.showSearch?(p(),b("label",OB,[g("span",DB,w(s(h)("backend::lang.list.search")),1),R(s(fl),{size:16,class:"pointer-events-none absolute top-1/2 left-3 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search","data-relation-search":"",value:m.value,placeholder:s(h)("backend::lang.list.search_prompt"),class:"h-[38px] w-full rounded-control border border-transparent bg-subtle pr-3 pl-9",onInput:M,onKeydown:ze[0]||(ze[0]=mn(yt(()=>{},["prevent"]),["enter"]))},null,40,MB)])):Y("",!0),(p(!0),b(pe,null,De(K.value,Ge=>(p(),b(pe,{key:Ge},[Ge==="create"&&be.value?(p(),U(Ke,{key:0,ref_for:!0,ref:Mt,"data-action":"create",size:"sm",variant:"primary",icon:s(As),disabled:k.value||!u.value,"aria-haspopup":"dialog",onClick:we},{default:B(()=>[_e(w(s(Xe)(te.value?.create)),1)]),_:1},8,["icon","disabled"])):Ge==="link"?(p(),U(Ke,{key:1,ref_for:!0,ref:ot,"data-action":"link",size:"sm",variant:be.value?"outline":"primary",icon:s(wb),disabled:k.value||!u.value,"aria-haspopup":"dialog",onClick:ze[1]||(ze[1]=Bt=>C.value=!0)},{default:B(()=>[_e(w(s(Xe)(te.value?.link)),1)]),_:1},8,["variant","icon","disabled"])):Ge==="delete"?(p(),U(Ke,{key:2,"data-action":"delete",size:"sm",variant:"danger",icon:s(Ir),disabled:k.value||S.value.length===0,onClick:ie},{default:B(()=>[_e(w(s(Xe)(te.value?.deleteSelected)),1)]),_:1},8,["icon","disabled"])):Ge==="unlink"?(p(),U(Ke,{key:3,"data-action":"unlink",size:"sm",variant:"danger",icon:s(kb),disabled:k.value||S.value.length===0,onClick:$e},{default:B(()=>[_e(w(s(Xe)(te.value?.unlinkSelected)),1)]),_:1},8,["icon","disabled"])):Y("",!0)],64))),128))]),l.value?(p(),b("p",PB,[R(s(Rr),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.relation.pending_note")),1)])):Y("",!0)]),v.value&&!f.value?(p(),b("p",RB,w(s(h)("backend::lang.relation.load_failed")),1)):(p(),b("div",IB,[R(M0,{selected:S.value,"onUpdate:selected":ze[2]||(ze[2]=Ge=>S.value=Ge),variant:"relation",columns:W.value,rows:d.value,loading:f.value,selectable:ve.value,sortable:!0,sort:x.value,openable:F.value!==null,trailing:fe.value,onSort:de,onOpen:Ve},{empty:B(()=>[g("span",qB,w(s(Xe)(te.value?.empty)),1)]),trailing:B(({row:Ge})=>[g("button",{type:"button","data-action":"edit-pivot","aria-label":s(Xe)(te.value?.editPivot,void 0,{name:xe(Ge)}),class:"flex size-8 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:Bt=>Le(Ge,Bt.currentTarget)},[R(s(bb),{size:16,"aria-hidden":"true"})],8,LB)]),_:1},8,["selected","columns","rows","loading","selectable","sort","openable","trailing"]),c.value&&c.value.last_page>1?(p(),U(P0,{key:0,meta:c.value,loading:f.value,"per-page-options":[],"per-page":c.value.per_page,onPage:z},null,8,["meta","loading","per-page"])):Y("",!0)])),u.value&&K.value.includes("link")?(p(),U(mB,{key:2,open:C.value,"onUpdate:open":ze[3]||(ze[3]=Ge=>C.value=Ge),source:e.source,"record-id":r.value,relation:n.value,schema:u.value,"session-key":l.value?s(i):null,onLinked:Ee,onClosed:Ie},null,8,["open","source","record-id","relation","schema","session-key"])):Y("",!0),u.value&&(be.value||F.value==="update"||F.value==="preview")?(p(),U(FN,{key:3,open:L.value,"onUpdate:open":ze[4]||(ze[4]=Ge=>L.value=Ge),source:e.source,"owner-id":r.value,relation:n.value,schema:u.value,mode:D.value,"child-id":T.value,"session-key":s(i),"can-delete":K.value.includes("delete"),onChanged:We,onGone:at,onClosed:st},null,8,["open","source","owner-id","relation","schema","mode","child-id","session-key","can-delete"])):Y("",!0),u.value&&le.value?(p(),U(wB,{key:4,open:I.value,"onUpdate:open":ze[5]||(ze[5]=Ge=>I.value=Ge),source:e.source,"owner-id":r.value,relation:n.value,schema:u.value,"child-id":q.value,"child-name":H.value,"session-key":s(i),onSaved:tt,onGone:at,onClosed:st},null,8,["open","source","owner-id","relation","schema","child-id","child-name","session-key"])):Y("",!0),R(Br,{open:s(O).request.value!==null,message:s(O).request.value?.message??"","confirm-label":s(O).request.value?.confirmLabel,danger:s(O).request.value?.danger,busy:s(O).busy.value,onConfirm:s(O).confirm,onCancel:s(O).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"])],8,$B)):Y("",!0)}}),FB=["id","aria-describedby"],VB=["id","aria-describedby"],zB={class:"min-w-0 [overflow-wrap:anywhere]"},jB=["id"],UB=["data-relation"],HB={class:"flex size-[22px] items-center justify-center rounded-full bg-primary text-[10px] font-bold text-on-primary","aria-hidden":"true"},KB={class:"font-semibold"},WB={key:0,"data-chip-locked":"",class:"flex size-6 items-center justify-center text-muted"},GB={class:"sr-only"},YB=["aria-label","onClick"],JB=["id","aria-expanded","aria-controls","aria-activedescendant","aria-required","aria-invalid","aria-describedby","value","placeholder"],ZB={key:1,class:"relative"},XB=["id","aria-expanded","aria-controls","aria-activedescendant","aria-required","aria-invalid","aria-describedby","value","placeholder"],QB=["id"],eF=["id","data-value","aria-selected","aria-disabled","onMousedown"],tF={class:"min-w-0 truncate"},aF={key:0,role:"presentation",class:"px-3 py-2 text-[13px] text-muted"},nF={key:1,role:"presentation",class:"px-3 py-2 text-[13px] text-muted"},rF={key:2,role:"presentation",class:"p-1"},lF=["id"],oF=20,sF=300,iF=ne({__name:"RelationField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=ct(Dp,void 0),l=_(()=>a.field.readOnly?"readonly":a.field.multiple?"multiple":"single"),o=_(()=>`${a.controlId}-listbox`),i=A({}),u=A(new Set);function d(J){const he={...i.value};let G=null;for(const ee of J)he[ee.value]=ee.label,ee.locked&&!u.value.has(ee.value)&&(G??=new Set(u.value),G.add(ee.value));i.value=he,G&&(u.value=G)}Be(()=>a.labels,J=>d(J??[]),{immediate:!0});function c(J){return J!==null&&u.value.has(J)}const f=_(()=>`${a.controlId}-locked-note`),v=_(()=>u.value.size>0),m=_(()=>[a.describedBy,v.value?f.value:""].filter(Boolean).join(" "));function y(J){return typeof J=="number"&&Number.isInteger(J)?J:typeof J=="string"&&/^\d+$/.test(J)?Number(J):null}const x=_(()=>y(a.modelValue)),S=_(()=>Array.isArray(a.modelValue)?a.modelValue.map(y).filter(J=>J!==null):[]);function k(J){return i.value[J]??String(J)}function C(J){return J.split(/[\s@._-]+/).filter(Boolean).slice(0,2).map(he=>he.charAt(0).toUpperCase()).join("")}const L=_(()=>{const J=a.labels?.[0]?.label;return J||(a.field.emptyOption??"—")}),D=A(!1),T=A(""),I=A([]),q=A(0),H=A(0),E=A(!1),P=A(-1);let j=0,O=null;const N=_(()=>q.value<H.value);async function Z(J,he){const G=a.source;if(!G){I.value=[];return}const ee=++j;E.value=!0;try{const ae=T.value.trim(),{data:$}=await qe.GET("/{vendor}/{plugin}/{controller}/fields/{field}/options",{params:{path:{...G,field:a.field.name},query:{search:ae===""?void 0:ae,page:J,per_page:oF}}});if(ee!==j)return;const M=$?.data??[];d(M),I.value=he?[...I.value,...M]:M,q.value=$?.meta.page??J,H.value=$?.meta.last_page??J}catch{ee===j&&!he&&(I.value=[])}finally{ee===j&&(E.value=!1)}}const W=_(()=>{const J=[];l.value==="single"&&a.field.emptyOption!==void 0&&J.push({key:"empty",label:a.field.emptyOption,value:null,muted:!0,locked:!1});const he=new Set(S.value);for(const G of I.value)l.value==="multiple"&&he.has(G.value)||J.push({key:`option-${G.value}`,label:G.label,value:G.value,muted:!1,locked:!!G.locked||c(G.value)});return J});function K(J){return`${o.value}-${J}`}function te(){D.value||(D.value=!0,P.value=-1,Z(1,!1))}function oe(){D.value=!1,T.value="",P.value=-1,O!==null&&(clearTimeout(O),O=null)}function ye(J){T.value=J.target.value,D.value=!0,P.value=-1,O!==null&&clearTimeout(O),O=setTimeout(()=>{O=null,Z(1,!1)},sF)}function be(){N.value&&!E.value&&Z(q.value+1,!0)}function ge(J){const he=J.target;he.scrollTop+he.clientHeight>=he.scrollHeight-24&&be()}function le(J){J.locked||(J.value!==null&&r?.(a.field.name,{value:J.value,label:J.label,locked:J.locked||void 0}),l.value==="multiple"?J.value!==null&&!S.value.includes(J.value)&&n("update:modelValue",[...S.value,J.value]):n("update:modelValue",J.value),oe())}function ce(J){c(J)||n("update:modelValue",S.value.filter(he=>he!==J))}function F(J,he){for(let G=J+he;G>=0&&G<W.value.length;G+=he)if(!W.value[G].locked)return G;return J}function fe(J){switch(J.key){case"ArrowDown":J.preventDefault(),D.value?P.value=F(P.value,1):te();break;case"ArrowUp":J.preventDefault(),P.value=F(P.value<0?W.value.length:P.value,-1);break;case"Enter":if(D.value){J.preventDefault();const he=W.value[P.value];he&&le(he)}break;case"Escape":D.value&&(J.preventDefault(),oe());break;case"Backspace":if(l.value==="multiple"&&T.value===""){const he=[...S.value].reverse().find(G=>!c(G));he!==void 0&&ce(he)}break}}const ve=_(()=>x.value!==null?k(x.value):a.field.emptyOption??"");return Ot(()=>{O!==null&&clearTimeout(O)}),(J,he)=>l.value==="readonly"?(p(),b("div",{key:0,id:e.controlId,"data-relation-readonly":"","aria-describedby":e.describedBy||void 0,class:me([e.labels?.[0]?.label?"text-text":"text-muted","flex min-h-input items-center rounded-control border border-border bg-subtle px-3.5"])},w(L.value),11,FB)):l.value==="single"&&c(x.value)?(p(),b(pe,{key:1},[g("div",{id:e.controlId,"data-relation-locked":"","aria-describedby":m.value||void 0,class:"flex min-h-input items-center justify-between gap-2 rounded-control border border-border bg-subtle px-3.5"},[g("span",zB,w(ve.value),1),R(s(sn),{size:14,class:"shrink-0 text-muted","aria-hidden":"true"})],8,VB),g("p",{id:f.value,"data-locked-note":"",class:"mt-1.5 flex items-center gap-2 text-[13px] text-muted"},[R(s(sn),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.form.locked_note")),1)],8,jB)],64)):(p(),b("div",{key:2,class:"relative","data-relation":l.value},[l.value==="multiple"?(p(),b("div",{key:0,class:me([e.invalid?"border-danger":"border-border-strong","flex min-h-input flex-wrap items-center gap-1.5 rounded-control border bg-surface p-1.5"])},[(p(!0),b(pe,null,De(S.value,G=>(p(),b("span",{key:G,"data-chip":"",class:"inline-flex h-[30px] items-center gap-1.5 rounded-pill bg-subtle pr-1 pl-1"},[g("span",HB,w(C(k(G))),1),g("span",KB,w(k(G)),1),c(G)?(p(),b("span",WB,[R(s(sn),{size:14,"aria-hidden":"true"}),g("span",GB,w(s(h)("backend::lang.form.locked_item",{name:k(G)})),1)])):(p(),b("button",{key:1,type:"button","aria-label":s(h)("backend::lang.form.remove_item",{name:k(G)}),class:"flex size-6 items-center justify-center rounded-full text-muted hover:bg-hover hover:text-text",onClick:ee=>ce(G)},[R(s(Vt),{size:14,"aria-hidden":"true"})],8,YB))]))),128)),g("input",{id:e.controlId,type:"text",role:"combobox",autocomplete:"off","aria-expanded":D.value?"true":"false","aria-controls":o.value,"aria-autocomplete":"list","aria-activedescendant":D.value&&P.value>=0?K(P.value):void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":m.value||void 0,value:T.value,placeholder:s(h)("backend::lang.form.add_item"),class:"h-[30px] min-w-[120px] flex-1 border-0 bg-transparent px-2 focus-visible:shadow-none",onClick:te,onInput:ye,onKeydown:fe,onBlur:oe},null,40,JB)],2)):(p(),b("div",ZB,[g("input",{id:e.controlId,type:"text",role:"combobox",autocomplete:"off","aria-expanded":D.value?"true":"false","aria-controls":o.value,"aria-autocomplete":"list","aria-activedescendant":D.value&&P.value>=0?K(P.value):void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":m.value||void 0,value:D.value?T.value:ve.value,placeholder:D.value&&ve.value||s(h)("backend::lang.form.select_placeholder"),class:me([[e.invalid?"border-danger":"border-border-strong",!D.value&&x.value===null?"text-muted":"text-text"],"h-input w-full rounded-control border bg-surface pr-10 pl-3.5"]),onClick:te,onInput:ye,onKeydown:fe,onBlur:oe},null,42,XB),R(s(zn),{size:16,class:"pointer-events-none absolute top-1/2 right-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"})])),ha(g("ul",{id:o.value,role:"listbox",class:"absolute inset-x-0 top-full z-20 mt-1 max-h-64 overflow-y-auto rounded-inner border border-border bg-surface p-1 shadow-menu",onScroll:ge},[(p(!0),b(pe,null,De(W.value,(G,ee)=>(p(),b("li",{id:K(ee),key:G.key,role:"option","data-value":G.value??"empty","aria-selected":l.value==="single"&&G.value===x.value?"true":"false","aria-disabled":G.locked?"true":void 0,class:me([[G.muted||G.locked?"text-muted":"text-text",G.locked?"cursor-not-allowed":"cursor-pointer hover:bg-hover",ee===P.value&&!G.locked?"bg-hover":""],"flex h-10 items-center justify-between gap-2 rounded-control px-3"]),onMousedown:yt(ae=>le(G),["prevent"])},[g("span",tF,w(G.label),1),G.locked?(p(),U(s(sn),{key:0,size:14,class:"shrink-0","aria-hidden":"true"})):Y("",!0)],42,eF))),128)),E.value?(p(),b("li",aF,w(s(h)("backend::lang.form.loading_options")),1)):W.value.filter(G=>G.value!==null).length===0?(p(),b("li",nF,w(s(h)("backend::lang.form.no_options")),1)):Y("",!0),N.value&&!E.value?(p(),b("li",rF,[g("button",{type:"button","data-action":"more-options",class:"h-8 w-full rounded-control text-[13px] font-semibold text-muted hover:bg-hover hover:text-text",onMousedown:yt(be,["prevent"])},w(s(h)("backend::lang.form.more_options")),33)])):Y("",!0)],40,QB),[[us,D.value]]),v.value?(p(),b("p",{key:2,id:f.value,"data-locked-note":"",class:"mt-1.5 flex items-center gap-2 text-[13px] text-muted"},[R(s(sn),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.form.locked_note")),1)],8,lF)):Y("",!0)],8,UB))}}),uF={class:"flex min-w-0 flex-col"},cF=["for"],dF={key:0,class:"text-danger","aria-hidden":"true"},fF=["id"],pF=["id","aria-checked","aria-invalid","aria-describedby"],mF=ne({__name:"SwitchField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>Wu(a.modelValue));function l(){n("update:modelValue",N0(a.modelValue,!r.value))}return(o,i)=>(p(),b("div",{class:me([e.invalid?"border-danger":"border-border","flex items-center justify-between gap-4 rounded-inner border px-4 py-3.5"]),"data-toggle-card":""},[g("div",uF,[g("label",{for:e.controlId,class:"font-semibold"},[_e(w(e.field.label||e.field.name),1),e.field.required?(p(),b("span",dF," *")):Y("",!0)],8,cF),e.field.comment?(p(),b("p",{key:0,id:`${e.controlId}-comment`,class:"text-[13px] text-muted"},w(e.field.comment),9,fF)):Y("",!0)]),g("button",{id:e.controlId,type:"button",role:"switch","aria-checked":r.value?"true":"false","aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:me([r.value?"bg-primary":"bg-border-strong","relative h-[26px] w-[44px] shrink-0 rounded-pill transition-colors duration-150 ease-out"]),onClick:l},[g("span",{class:me([r.value?"translate-x-[18px] bg-on-primary":"translate-x-0 bg-white","absolute top-[3px] left-[3px] size-[20px] rounded-full shadow-tab transition-transform duration-150 ease-out"]),"aria-hidden":"true"},null,2)],10,pF)],2))}}),vF=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],n_=ne({__name:"TextField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),l=_(()=>Vr(a.field));return(o,i)=>(p(),b("input",He({id:e.controlId},l.value,{name:e.field.name,type:"text",value:r.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(It)(e.invalid),"h-input"],onInput:i[0]||(i[0]=u=>n("update:modelValue",u.target.value))}),null,16,vF))}}),hF=["id","name","rows","value","required","aria-required","aria-invalid","aria-describedby"],r_=ne({__name:"TextareaField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r={tiny:2,small:4,large:8,huge:12,giant:18},l=_(()=>r[a.field.size??""]??5),o=_(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),i=_(()=>Vr(a.field));return(u,d)=>(p(),b("textarea",He({id:e.controlId},i.value,{name:e.field.name,rows:l.value,value:o.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(It)(e.invalid),"min-h-input resize-y py-2.5"],onInput:d[0]||(d[0]=c=>n("update:modelValue",c.target.value))}),null,16,hF))}}),yF={class:"flex items-start justify-between gap-3"},gF={class:"relative block"},bF={class:"sr-only"},_F=["value","placeholder"],xF={key:0,class:"flex flex-col gap-1.5"},kF={key:0,role:"alert","data-mail-image-upload-error":"",class:"text-[13px] text-danger"},wF=["aria-label"],$F={key:1,role:"alert","data-mail-image-load-failed":"",class:"col-span-4 text-[13px] text-danger"},SF={key:2,class:"col-span-4 flex flex-col items-center gap-1 px-2 py-6 text-center"},CF={class:"text-[14px] font-semibold"},EF={class:"text-[13px] text-muted"},AF={key:3,"data-mail-image-no-results":"",class:"col-span-4 px-2 py-6 text-center text-[13px] text-muted"},TF=["aria-checked","data-mail-image-id","onClick"],OF={class:"relative block aspect-square w-full overflow-hidden rounded-pager bg-subtle"},DF=["src","alt"],MF={key:0,class:"absolute top-1 right-1 flex size-5 items-center justify-center rounded-full bg-primary text-on-primary","aria-hidden":"true"},PF={class:"truncate text-[13px] text-muted"},RF={key:1,class:"flex flex-col gap-1.5"},IF={class:"text-[13px] font-semibold",for:"mail-image-alt"},qF={class:"text-[13px] text-muted"},LF={class:"flex justify-end gap-2.5"},NF=300,Mp=ne({__name:"MailImagePicker",props:{open:{type:Boolean},mode:{}},emits:["update:open","insert","choose"],setup(e,{emit:t}){const a=e,n=t,r=A(""),l=A([]),o=A(null),i=A(!1),u=A(!1),d=A(""),c=A(!1),f=A(""),v=A(null),m=A(""),y=A(null),x=A(null);let S=null,k=0;const C=_(()=>a.mode==="insert"?h("backend::lang.mail.picker.insert_title"):h("backend::lang.mail.picker.choose_title")),L=_(()=>a.mode==="insert"?h("backend::lang.mail.picker.insert"):h("backend::lang.mail.picker.use")),D=_(()=>o.value?.canUpload===!0),T=_(()=>!i.value&&!u.value&&l.value.length===0&&r.value.trim()===""),I=_(()=>!i.value&&!u.value&&l.value.length===0&&r.value.trim()!==""),q=_(()=>o.value?l.value.length<o.value.total:!1);function H(te){n("update:open",te)}function E(){r.value="",l.value=[],o.value=null,i.value=!1,u.value=!1,d.value="",c.value=!1,f.value="",v.value=null,m.value="",k++}async function P(te,oe){const ye=++k;i.value=!0,u.value=!1,d.value="";try{const{data:be,error:ge,response:le}=await qe.GET("/mail/images",{params:{query:{q:r.value.trim()||void 0,page:te}}});if(ye!==k)return;if(!be){u.value=!0;const ce=ge?.error?.message??h("backend::lang.mail.picker.load_failed");d.value=le.status===409?ce:h("backend::lang.mail.picker.load_failed"),oe||(l.value=[],o.value=null);return}l.value=oe?[...l.value,...be.data]:be.data,o.value=be.meta}catch{if(ye!==k)return;u.value=!0,d.value=h("backend::lang.mail.picker.load_failed")}finally{ye===k&&(i.value=!1)}}function j(te){r.value=te.target.value,S!==null&&clearTimeout(S),S=setTimeout(()=>{S=null,P(1,!1)},NF)}function O(te){v.value=te,a.mode==="insert"&&(m.value=te.title||"")}function N(te){if(!v.value||l.value.length===0)return;const oe=l.value.findIndex(be=>be.id===v.value.id);if(oe<0)return;let ye=oe;if(te.key==="ArrowRight"||te.key==="ArrowDown")ye=Math.min(oe+1,l.value.length-1);else if(te.key==="ArrowLeft"||te.key==="ArrowUp")ye=Math.max(oe-1,0);else return;te.preventDefault(),O(l.value[ye])}function Z(te){const oe=te.target;!q.value||i.value||oe.scrollTop+oe.clientHeight>=oe.scrollHeight-48&&P((o.value?.page??1)+1,!0)}async function W(te){const oe=te.target,ye=oe.files?.[0];if(oe.value="",!!ye){c.value=!0,f.value="";try{const be=new FormData;be.append("file",ye);const{data:ge,error:le}=await qe.POST("/mail/images",{body:be});if(!ge){const ce=le?.error;f.value=ce?.details?.message||ce?.message||h("backend::lang.mail.picker.load_failed");return}l.value=[ge.data,...l.value.filter(ce=>ce.id!==ge.data.id)],o.value&&(o.value={...o.value,total:o.value.total+1,canUpload:o.value.canUpload}),O(ge.data)}catch{f.value=h("backend::lang.mail.picker.load_failed")}finally{c.value=!1}}}function K(){v.value&&(a.mode==="insert"?n("insert",{url:v.value.url,alt:m.value}):n("choose",v.value.id),H(!1))}return Be(()=>a.open,te=>{te?(E(),P(1,!1),Ue(()=>x.value?.focus())):S!==null&&(clearTimeout(S),S=null)}),Ot(()=>{S!==null&&clearTimeout(S),k++}),(te,oe)=>(p(),U(s(Jn),{open:e.open,"onUpdate:open":H},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-mail-image-picker":"",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col gap-4 rounded-modal bg-surface p-6 text-text shadow-pop"},{default:B(()=>[g("div",yF,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(C.value),1)]),_:1}),R(s(Cr),{type:"button",class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text","aria-label":s(h)("backend::lang.form.cancel")},{default:B(()=>[R(s(Vt),{size:16,"aria-hidden":"true"})]),_:1},8,["aria-label"])]),g("label",gF,[g("span",bF,w(s(h)("backend::lang.mail.picker.search")),1),R(s(fl),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search","data-mail-image-search":"",value:r.value,placeholder:s(h)("backend::lang.mail.picker.search"),class:"h-input w-full rounded-control border border-border-strong bg-surface pr-3.5 pl-10",onInput:j},null,40,_F)]),D.value?(p(),b("div",xF,[g("input",{ref_key:"fileInput",ref:y,type:"file",class:"sr-only",accept:"image/jpeg,image/png,image/gif,image/webp",onChange:W},null,544),R(Ke,{variant:"outline",size:"sm","data-mail-image-upload":"",disabled:c.value,icon:s(Zo),onClick:oe[0]||(oe[0]=ye=>y.value?.click())},{default:B(()=>[_e(w(c.value?s(h)("backend::lang.mail.picker.uploading"):s(h)("backend::lang.mail.picker.upload")),1)]),_:1},8,["disabled","icon"]),f.value?(p(),b("p",kF,w(f.value),1)):Y("",!0)])):Y("",!0),g("div",{ref_key:"grid",ref:x,role:"radiogroup","aria-label":C.value,tabindex:"0","data-mail-image-grid":"",class:"grid min-h-0 grid-cols-4 gap-2 overflow-y-auto",onKeydown:N,onScroll:Z},[i.value&&l.value.length===0?(p(),b(pe,{key:0},De(12,ye=>g("div",{key:ye,class:"aspect-square rounded-inner bg-skel","aria-hidden":"true"})),64)):u.value?(p(),b("p",$F,w(d.value),1)):T.value?(p(),b("div",SF,[g("p",CF,w(s(h)("backend::lang.mail.picker.empty_title")),1),g("p",EF,w(D.value?s(h)("backend::lang.mail.picker.empty_upload"):s(h)("backend::lang.mail.picker.empty_pick_only")),1)])):I.value?(p(),b("p",AF,w(s(h)("backend::lang.mail.picker.no_results",{query:r.value.trim()})),1)):Y("",!0),(p(!0),b(pe,null,De(l.value,ye=>(p(),b("button",{key:ye.id,type:"button",role:"radio","aria-checked":v.value?.id===ye.id?"true":"false","data-mail-image-id":ye.id,class:me([v.value?.id===ye.id?"border-[#e0b020] bg-sel":"border-border hover:bg-hover","relative flex flex-col gap-1 rounded-inner border p-1 text-left transition-colors duration-150 ease-out"]),onClick:be=>O(ye)},[g("span",OF,[g("img",{src:ye.thumbUrl||ye.url,alt:ye.title||ye.fileName,class:"size-full object-cover"},null,8,DF),v.value?.id===ye.id?(p(),b("span",MF,[R(s(Na),{size:14})])):Y("",!0)]),g("span",PF,w(ye.fileName),1)],10,TF))),128))],40,wF),e.mode==="insert"&&v.value?(p(),b("div",RF,[g("label",IF,w(s(h)("backend::lang.mail.picker.alt")),1),g("p",qF,w(s(h)("backend::lang.mail.picker.alt_comment")),1),ha(g("input",{id:"mail-image-alt","onUpdate:modelValue":oe[1]||(oe[1]=ye=>m.value=ye),type:"text","data-mail-image-alt":"",class:"h-input w-full rounded-control border border-border-strong bg-surface px-3.5"},null,512),[[kr,m.value]])])):Y("",!0),g("div",LF,[R(Ke,{variant:"ghost","data-mail-image-cancel":"",onClick:oe[2]||(oe[2]=ye=>H(!1))},{default:B(()=>[_e(w(s(h)("backend::lang.form.cancel")),1)]),_:1}),R(Ke,{variant:"primary","data-mail-image-confirm":"",disabled:!v.value,onClick:K},{default:B(()=>[_e(w(L.value),1)]),_:1},8,["disabled"])])]),_:1})]),_:1})]),_:1},8,["open"]))}});function BF(e){return e.replace(/\\/g,"\\\\").replace(/\[/g,"\\[").replace(/\]/g,"\\]")}function FF(e){return e.replace(/[ ()]/g,t=>t===" "?"%20":t==="("?"%28":"%29")}function Uh(e){return e.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function l_(e,t,a){switch(e){case"markdown":return`})`;case"html":return`<img src="${Uh(t)}" alt="${Uh(a)}">`;case"css":return`url("${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}")`;case"text":return t}}const VF={class:"flex flex-col gap-1.5"},zF={class:"flex items-center gap-2"},jF=["aria-pressed"],UF={key:0,class:"flex flex-col gap-1.5"},HF={key:0,"data-markdown-preview-error":"",role:"status",class:"text-[13px] text-danger"},KF=["aria-busy","innerHTML"],WF=["id","name","rows","value","required","aria-required","aria-invalid","aria-describedby"],Hh="Preview unavailable.",GF=300,o_=ne({__name:"MarkdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r={tiny:2,small:4,large:8,huge:12,giant:18},l=_(()=>r[a.field.size??""]??8),o=_(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),i=_(()=>Vr(a.field)),u=_(()=>!!a.field.mailImages),d=A(!1),c=A(""),f=A(""),v=A(!1),m=A(!1),y=A(null);let x=0,S=null;function k(){S!==null&&(clearTimeout(S),S=null)}function C(I){const H=I?.error?.details?.markdown;return Array.isArray(H)&&typeof H[0]=="string"&&H[0]!==""?H[0]:Hh}async function L(){const I=++x;if(o.value.trim()===""){c.value="",f.value="",v.value=!1;return}v.value=!0;try{const{data:q,error:H}=await qe.POST("/markdown/preview",{body:{markdown:o.value}});if(I!==x)return;q?(c.value=q.data.html,f.value=""):(c.value="",f.value=C(H))}catch{if(I!==x)return;c.value="",f.value=Hh}finally{I===x&&(v.value=!1)}}function D(){d.value=!d.value,k(),d.value?L():(x++,v.value=!1)}function T(I){const q=l_("markdown",I.url,I.alt),H=y.value,E=o.value,P=H?.selectionStart??E.length,j=H?.selectionEnd??P,O=E.slice(0,P)+q+E.slice(j);n("update:modelValue",O),Ue(()=>{if(!H)return;H.focus();const N=P+q.length;H.setSelectionRange(N,N)})}return Be(o,()=>{d.value&&(k(),S=setTimeout(()=>{S=null,L()},GF))}),Ot(()=>{k(),x++}),(I,q)=>(p(),b("div",VF,[g("div",zF,[u.value?(p(),b("button",{key:0,type:"button","data-markdown-insert-image":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pager px-2 text-[13px] text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:q[0]||(q[0]=H=>m.value=!0)},[R(s(ib),{size:16,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.mail.picker.insert_button")),1)])):(p(),b("button",{key:1,type:"button","data-markdown-preview":"",class:"self-start rounded-pager px-2 py-1 text-[13px] text-muted hover:bg-hover hover:text-text","aria-pressed":d.value?"true":"false",onClick:D}," Preview ",8,jF))]),d.value&&!u.value?(p(),b("div",UF,[f.value?(p(),b("p",HF,w(f.value),1)):Y("",!0),g("div",{"data-markdown-preview-pane":"",class:me([s(It)(e.invalid),"summer-markdown min-h-input overflow-auto px-3.5 py-2.5"]),"aria-busy":v.value?"true":"false",innerHTML:c.value},null,10,KF)])):(p(),b("textarea",He({key:1,id:e.controlId,ref_key:"area",ref:y},i.value,{name:e.field.name,rows:l.value,value:o.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:[s(It)(e.invalid),"min-h-input resize-y py-2.5"],onInput:q[1]||(q[1]=H=>n("update:modelValue",H.target.value))}),null,16,WF)),u.value?(p(),U(Mp,{key:2,open:m.value,"onUpdate:open":q[2]||(q[2]=H=>m.value=H),mode:"insert",onInsert:T},null,8,["open"])):Y("",!0)]))}}),YF={class:"overflow-hidden rounded-inner border border-border"},JF={class:"flex flex-wrap items-center gap-2 border-b border-border bg-subtle p-1"},ZF={role:"tablist",class:"inline-flex gap-1 rounded-inner border border-border bg-subtle p-1"},XF=["aria-selected"],QF=["aria-selected"],eV={role:"status",class:"ml-auto px-2 text-[13px] text-muted","data-mail-preview-status":""},tV={key:0,role:"alert","data-mail-preview-error":"",class:"border-b border-border px-4 py-2 text-[13px] text-danger"},aV={key:1,class:"flex gap-2 border-b border-border px-4 py-3","data-mail-preview-subject":""},nV={class:"font-semibold"},rV={class:"min-w-0 break-words"},lV={key:2,class:"px-4 py-3 text-center text-[13px] text-muted","data-mail-preview-empty":""},oV=["srcdoc","title"],sV={key:4,class:"m-0 max-h-[640px] overflow-auto bg-surface px-4 py-3 font-mono text-[13px] whitespace-pre-wrap","data-mail-preview-text":""},iV={class:"text-[13px] text-muted","data-mail-preview-note":""},uV={key:0,class:"text-[13px] text-muted","data-mail-preview-comment":""},cV={key:1,class:"flex flex-wrap items-center gap-2","data-mail-preview-test":""},dV={class:"text-[13px] text-muted","data-mail-preview-test-hint":""},fV={key:0,role:"alert",class:"basis-full text-[13px] text-danger","data-mail-preview-test-error":""},pV=500,mV=ne({__name:"MailPreviewField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,n=ct(Ps,A({})),r=_(()=>{const be=t.field.mode;return typeof be=="string"&&be!==""?be:"template"}),l=_(()=>r.value==="branding"),o=_(()=>ta.value?.email??""),i=A("html"),u=A(""),d=A(""),c=A(""),f=A(!1),v=A(!1),m=A(""),y=A(""),x=A(!1),S=A(0),k=A(Date.now());let C=0,L=null,D=null,T=null;const I=_(()=>{switch(r.value){case"layout":case"partial":return"content_html";case"branding":return"";default:return"body"}}),q=_(()=>{const be=I.value;if(be==="")return!1;const ge=n.value[be];return ge==null||String(ge).trim()===""}),H=_(()=>x.value||S.value>k.value),E=_(()=>r.value==="template"?h("backend::lang.mail.preview.sample_note"):h("backend::lang.mail.preview.sample_content_note"));function P(){L!==null&&(clearTimeout(L),L=null)}function j(be){const le=be?.error?.details?.message;if(typeof le=="string"&&le!=="")return le;const ce=be?.error?.message;return typeof ce=="string"&&ce!==""?ce:""}const O=A(null),N=A(!0);let Z=null;function W(){if(!N.value){P();return}P(),L=setTimeout(()=>{L=null,K()},pV)}async function K(){if(!N.value)return;if(q.value){C++,v.value=!1,m.value="";return}const be=++C;v.value=!0;try{const{data:ge,error:le,response:ce}=await qe.POST("/mail/preview",{body:{mode:r.value,id:t.recordId??0,values:{...n.value}}});if(be!==C)return;if(ge){u.value=ge.data.subject,d.value=ge.data.html,c.value=ge.data.text,f.value=!0,m.value="";return}if(ce.status===422){const F=j(le);m.value=f.value?h("backend::lang.mail.preview.failed",{message:F}):h("backend::lang.mail.preview.failed_first",{message:F});return}m.value=h("backend::lang.mail.preview.unavailable")}catch{if(be!==C)return;m.value=h("backend::lang.mail.preview.unavailable")}finally{be===C&&(v.value=!1)}}function te(be){const ge=be.headers.get("Retry-After"),le=ge?Number.parseInt(ge,10):NaN;return Number.isFinite(le)&&le>0?le:60}function oe(be){S.value=Date.now()+be*1e3,k.value=Date.now(),D!==null&&clearTimeout(D),D=setTimeout(()=>{D=null,S.value=0,k.value=Date.now()},be*1e3),T===null&&(T=setInterval(()=>{k.value=Date.now(),S.value<=k.value&&T!==null&&(clearInterval(T),T=null)},250))}async function ye(){if(!(l.value||H.value||q.value)){x.value=!0,y.value="";try{const{data:be,error:ge,response:le}=await qe.POST("/mail/test-send",{body:{mode:r.value,id:t.recordId??0,values:{...n.value}}});if(be){Pe(h("backend::lang.mail.preview.test_sent",{email:be.data.email}));return}const ce=le.status;if(ce===429){const F=te(le);oe(F),y.value=h("backend::lang.mail.preview.test_limited",{seconds:F});return}if(ce===422){y.value=h("backend::lang.mail.preview.test_invalid",{message:j(ge)});return}if(ce===403){Pe(ge?.error.message||h("backend::lang.form.forbidden"),"danger");return}if(ce>=500){Pe(h("backend::lang.mail.preview.test_failed"),"danger");return}Pe(ge?.error.message||h("backend::lang.mail.preview.test_failed"),"danger")}catch{Pe(h("backend::lang.mail.preview.test_failed"),"danger")}finally{x.value=!1}}}return Be(()=>n.value,()=>{if(q.value){P(),C++,v.value=!1,m.value="";return}W()},{deep:!0}),$t(()=>{typeof IntersectionObserver<"u"&&O.value&&(Z=new IntersectionObserver(be=>{const ge=be.some(le=>le.isIntersecting);ge!==N.value&&(N.value=ge,ge?K():(P(),C++))},{threshold:0}),Z.observe(O.value)),K()}),Ot(()=>{P(),C++,Z?.disconnect(),Z=null,D!==null&&clearTimeout(D),T!==null&&clearInterval(T)}),(be,ge)=>(p(),b("div",{ref_key:"rootEl",ref:O,class:"flex flex-col gap-2","data-mail-preview":""},[g("div",YF,[g("div",JF,[g("div",ZF,[g("button",{type:"button",role:"tab","data-mail-preview-format":"html","aria-selected":i.value==="html"?"true":"false",class:me([i.value==="html"?"bg-surface text-text shadow-tab":"text-muted hover:text-text","inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold transition-colors duration-150 ease-out"]),onClick:ge[0]||(ge[0]=le=>i.value="html")},w(s(h)("backend::lang.mail.preview.html")),11,XF),g("button",{type:"button",role:"tab","data-mail-preview-format":"text","aria-selected":i.value==="text"?"true":"false",class:me([i.value==="text"?"bg-surface text-text shadow-tab":"text-muted hover:text-text","inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold transition-colors duration-150 ease-out"]),onClick:ge[1]||(ge[1]=le=>i.value="text")},w(s(h)("backend::lang.mail.preview.text")),11,QF)]),g("p",eV,w(v.value?s(h)("backend::lang.mail.preview.rendering"):""),1)]),m.value?(p(),b("p",tV,w(m.value),1)):Y("",!0),!l.value&&(f.value||!q.value)?(p(),b("div",aV,[g("span",nV,w(s(h)("backend::lang.mail.preview.subject")),1),g("span",rV,w(u.value),1)])):Y("",!0),q.value?(p(),b("div",lV,w(s(h)("backend::lang.mail.preview.empty")),1)):i.value==="html"?(p(),b("iframe",{key:3,sandbox:"",referrerpolicy:"no-referrer",srcdoc:d.value,title:s(h)("backend::lang.mail.preview.frame_title"),class:"block h-[640px] w-full border-0 bg-white","data-mail-preview-frame":""},null,8,oV)):(p(),b("pre",sV,w(c.value),1))]),g("p",iV,w(E.value),1),e.field.comment?(p(),b("p",uV,w(e.field.comment),1)):Y("",!0),l.value?Y("",!0):(p(),b("div",cV,[R(Ke,{variant:"outline",size:"sm",icon:s(ZC),disabled:H.value||q.value,"data-mail-preview-test-send":"",onClick:ye},{default:B(()=>[_e(w(x.value?s(h)("backend::lang.mail.preview.test_sending"):s(h)("backend::lang.mail.preview.test_send")),1)]),_:1},8,["icon","disabled"]),g("p",dV,w(s(h)("backend::lang.mail.preview.test_hint",{email:o.value})),1),y.value?(p(),b("p",fV,w(y.value),1)):Y("",!0)]))],512))}}),vV=["id"],hV={key:2,class:"flex flex-col gap-1.5"},yV={"data-codeeditor-load-failed":"",class:"flex items-center gap-2 text-[13px] text-muted"},gV=["id","value","aria-labelledby","aria-describedby","aria-invalid"],bV=["data-codeeditor"],_V=["aria-label","aria-controls"],xV=ne({__name:"CodeEditorField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{expose:t,emit:a}){const n=e,r=a,l={tiny:128,small:192,large:320,huge:480,giant:640},o=_(()=>!!n.field.readOnly),i=_(()=>n.modelValue===null||n.modelValue===void 0?"":String(n.modelValue)),u=_(()=>{const O=n.field.language;return O==="html"||O==="css"||O==="text"?O:"html"}),d=_(()=>l[n.field.size??""]??320),c=_(()=>!!n.field.mailImages),f=_(()=>`${n.controlId}-label`),v=A("loading"),m=A(""),y=A(null),x=cl(null),S=A(!1);let k=null,C=!1,L=null,D=!1;const T=_(()=>["rounded-control border bg-surface overflow-hidden","focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]",n.invalid?"border-danger":"border-border-strong"]);function I(){const O={id:n.controlId,"aria-labelledby":f.value,"aria-multiline":"true"};return n.describedBy&&(O["aria-describedby"]=n.describedBy),n.invalid&&(O["aria-invalid"]="true"),O}function q(O){L=O,r("update:modelValue",O)}function H(O){D||q(O)}$t(async()=>{if(!o.value)try{if(k=await(await Y0(async()=>{const{importCodeEditor:O}=await import("./load-CToaxecl.js");return{importCodeEditor:O}},[],import.meta.url)).importCodeEditor(),C||(v.value="ready",await Ue(),C||!y.value||!k))return;x.value=k.createCodeEditor({parent:y.value,doc:i.value,language:u.value,height:d.value,attributes:I(),onChange:H})}catch{if(C)return;x.value?.destroy(),x.value=null,v.value="failed",m.value=i.value}}),Ot(()=>{C=!0,x.value?.destroy(),x.value=null}),Be(i,O=>{if(O!==L){if(L=null,v.value==="failed"){m.value=O;return}x.value&&(D=!0,x.value.setDoc(O),D=!1)}});function E(O){const N=O.target.value;m.value=N,q(N)}function P(O){if(x.value){x.value.insert(O);return}if(v.value==="failed"){const N=document.getElementById(n.controlId);if(!N){m.value=m.value+O,q(m.value);return}const Z=N.selectionStart??m.value.length,W=N.selectionEnd??Z,K=m.value.slice(0,Z)+O+m.value.slice(W);m.value=K,q(K),Ue(()=>{N.focus();const te=Z+O.length;N.setSelectionRange(te,te)})}}function j(O){P(l_(u.value,O.url,O.alt))}return t({insert:P}),(O,N)=>o.value?(p(),b("pre",{key:0,id:e.controlId,"data-codeeditor-readonly":"",class:"max-h-[480px] overflow-auto rounded-control border border-border bg-subtle px-3.5 py-2.5 font-mono text-[13px] whitespace-pre-wrap"},w(i.value!==""?i.value:s(h)("backend::lang.list.empty_value")),9,vV)):v.value==="loading"?(p(),b("div",{key:1,"data-codeeditor-loading":"","aria-busy":"true",class:"rounded-control bg-skel",style:ua({height:`${d.value}px`})},null,4)):v.value==="failed"?(p(),b("div",hV,[g("p",yV,[R(s(Rr),{size:14,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.codeeditor.load_failed")),1)]),g("textarea",{id:e.controlId,"data-codeeditor-fallback":"",value:m.value,"aria-labelledby":f.value,"aria-describedby":e.describedBy,"aria-invalid":e.invalid?"true":void 0,spellcheck:"false",class:me([s(It)(e.invalid),"font-mono text-[13px] resize-y px-3.5 py-2.5"]),style:ua({height:`${d.value}px`}),onInput:E},null,46,gV)])):(p(),b("div",{key:3,"data-codeeditor":e.field.name,class:me(T.value)},[c.value?(p(),b("div",{key:0,role:"toolbar","aria-label":s(h)("backend::lang.codeeditor.toolbar"),"aria-controls":e.controlId,class:"flex flex-wrap items-center gap-1 border-b border-border bg-subtle p-1","data-codeeditor-toolbar":""},[g("button",{type:"button","data-codeeditor-insert-image":"",class:"inline-flex h-8 items-center gap-1.5 rounded-pager px-2 text-[13px] text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text",onClick:N[0]||(N[0]=Z=>S.value=!0)},[R(s(ib),{size:16,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.mail.picker.insert_button")),1)])],8,_V)):Y("",!0),g("div",{ref_key:"mountEl",ref:y,"data-codeeditor-mount":""},null,512),c.value?(p(),U(Mp,{key:1,open:S.value,"onUpdate:open":N[1]||(N[1]=Z=>S.value=Z),mode:"insert",onInsert:j},null,8,["open"])):Y("",!0)],10,bV))}}),kV={class:"flex items-center gap-2","data-colorpicker":""},wV=["value","aria-label"],$V=["id","value","placeholder","aria-describedby","aria-invalid"],SV=ne({__name:"ColorPickerField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=/^#[0-9a-fA-F]{6}$/,l=_(()=>a.modelValue===null||a.modelValue===void 0?"":String(a.modelValue)),o=A(r.test(l.value)?l.value.toLowerCase():"#ffffff");Be(l,c=>{r.test(c)&&(o.value=c.toLowerCase())});const i=_(()=>r.test(l.value)?l.value.toLowerCase():o.value);function u(c){const f=c.target.value;o.value=f.toLowerCase(),n("update:modelValue",f)}function d(c){const f=c.target.value;r.test(f)&&(o.value=f.toLowerCase()),n("update:modelValue",f)}return(c,f)=>(p(),b("div",kV,[g("input",{type:"color","data-colorpicker-swatch":"",value:i.value,"aria-label":s(h)("backend::lang.colorpicker.pick",{field:e.field.label??e.field.name}),class:"size-input shrink-0 cursor-pointer rounded-control border border-border-strong bg-surface p-1",onInput:u},null,40,wV),g("input",{id:e.controlId,type:"text","data-colorpicker-text":"",value:l.value,maxlength:"7",spellcheck:"false",placeholder:s(h)("backend::lang.colorpicker.not_set"),"aria-describedby":e.describedBy||void 0,"aria-invalid":e.invalid?"true":void 0,class:me([s(It)(e.invalid),"h-input font-mono text-[13px]"]),onInput:d},null,42,$V)]))}}),CV={class:"flex items-center gap-4","data-mailimage":""},EV={class:"flex size-[96px] shrink-0 items-center justify-center overflow-hidden rounded-inner border border-border bg-subtle"},AV=["src","alt"],TV={class:"flex flex-col gap-2"},OV={key:0,class:"text-[14px]"},DV={key:1,class:"text-[13px] text-muted"},MV={class:"flex gap-2"},PV={key:2,"data-mailimage-missing":"",class:"text-[13px] text-danger"},RV=ne({__name:"MailImageField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=A(!1),l=A(null),o=A(!1),i=A(!1),u=_(()=>{const v=a.modelValue;if(v==null||v==="")return null;const m=Number(v);return Number.isInteger(m)&&m>0?m:null});async function d(){const v=u.value;if(v===null){l.value=null,o.value=!1;return}i.value=!0,o.value=!1;try{const{data:m,response:y}=await qe.GET("/mail/images/{id}",{params:{path:{id:v}}});m?(l.value=m.data,o.value=!1):(l.value=null,o.value=y.status===404)}catch{l.value=null,o.value=!0}finally{i.value=!1}}Be(u,()=>{d()},{immediate:!0});function c(v){n("update:modelValue",v)}function f(){n("update:modelValue",null)}return(v,m)=>(p(),b("div",CV,[g("div",EV,[l.value?(p(),b("img",{key:0,src:l.value.thumbUrl||l.value.url,alt:l.value.title||l.value.fileName,class:"size-full object-contain"},null,8,AV)):(p(),U(s(ub),{key:1,size:24,class:"text-muted","aria-hidden":"true"}))]),g("div",TV,[l.value?(p(),b("p",OV,w(l.value.fileName),1)):(p(),b("p",DV,w(s(h)("backend::lang.mailimage.empty")),1)),g("div",MV,[R(Ke,{variant:"outline",size:"sm","data-mailimage-choose":"",onClick:m[0]||(m[0]=y=>r.value=!0)},{default:B(()=>[_e(w(l.value?s(h)("backend::lang.mailimage.change"):s(h)("backend::lang.mailimage.choose")),1)]),_:1}),l.value||u.value!==null?(p(),U(Ke,{key:0,variant:"ghost",size:"sm","data-mailimage-remove":"",onClick:f},{default:B(()=>[_e(w(s(h)("backend::lang.mailimage.remove")),1)]),_:1})):Y("",!0)]),o.value?(p(),b("p",PV,w(s(h)("backend::lang.mailimage.missing")),1)):Y("",!0)]),R(Mp,{open:r.value,"onUpdate:open":m[1]||(m[1]=y=>r.value=y),mode:"choose",onChoose:c},null,8,["open"])]))}}),IV=["id","aria-describedby"],qV={key:0},LV={key:1,class:"text-muted","data-empty":""},NV={key:1,class:"flex min-w-0 flex-col gap-1.5"},BV={class:"relative"},FV=["id","name","value","required","aria-required","aria-invalid","aria-describedby"],VV={key:0,"data-money-currency":"","aria-hidden":"true",class:"absolute inset-y-px right-px flex min-w-[52px] items-center justify-center rounded-r-control border-l border-border bg-subtle px-3 text-muted"},zV=["id"],jV=["id"],UV=ne({__name:"MoneyField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=ct(Rs,null),l=_(()=>a.field.scale??4),o=_(()=>{if(a.field.currencyFrom){const E=r?.values.value[a.field.currencyFrom];return typeof E=="string"?E.trim():""}return a.field.currency??""}),i=_(()=>{const E=a.field.attributes?.readonly;return!!a.field.readOnly||E!=null&&E!==!1}),u=_(()=>Vr(a.field)),d=_(()=>La.value),c=_(()=>DM(d.value)),f=_(()=>`${a.controlId}-currency`),v=_(()=>`${a.controlId}-money-error`);function m(E){return typeof E!="string"||E===""?"":OM(E).replace(".",c.value)}const y=A(m(a.modelValue)),x=A(null),S=A(!1);let k;Be(()=>a.modelValue,E=>{E!==k&&(y.value=m(E),x.value=null,S.value=!1)});function C(E){const P=TM(E,l.value);return P.error===null?P:{value:E.replace(/[\s ]/g,""),error:P.error}}function L(E){y.value=E.target.value;const P=C(y.value);S.value&&(x.value=P.error),k=P.value,n("update:modelValue",P.value)}function D(){S.value=!0,x.value=C(y.value).error}const T=_(()=>!!a.invalid||x.value!==null),I=_(()=>x.value==="too_precise"?h("backend::lang.money.too_precise",{scale:l.value}):h("backend::lang.money.invalid")),q=_(()=>typeof a.modelValue=="string"&&a.modelValue!==""?D0(a.modelValue,o.value,d.value,l.value):""),H=_(()=>[a.describedBy??"",o.value!==""?f.value:"",x.value!==null?v.value:""].filter(Boolean).join(" "));return(E,P)=>i.value?(p(),b("div",{key:0,id:e.controlId,"data-money-readonly":"","aria-describedby":H.value||void 0,class:"flex h-input items-center justify-end rounded-control border border-border bg-subtle px-3.5 tabular-nums whitespace-nowrap"},[q.value!==""?(p(),b("span",qV,w(q.value),1)):(p(),b("span",LV,"—"))],8,IV)):(p(),b("div",NV,[g("div",BV,[g("input",He({id:e.controlId},u.value,{name:e.field.name,type:"text",inputmode:"decimal",autocomplete:"off",spellcheck:"false",value:y.value,required:e.field.required||void 0,"aria-required":e.field.required?"true":void 0,"aria-invalid":T.value?"true":void 0,"aria-describedby":H.value||void 0,class:[[s(It)(T.value),o.value!==""?"pr-16":"pr-3.5"],"h-input text-right tabular-nums"],onInput:L,onBlur:D}),null,16,FV),o.value!==""?(p(),b("span",VV,w(o.value),1)):Y("",!0),o.value!==""?(p(),b("span",{key:1,id:f.value,class:"sr-only"},w(s(h)("backend::lang.money.currency",{code:o.value})),9,zV)):Y("",!0)]),x.value!==null?(p(),b("p",{key:0,id:v.value,"data-money-error":"",class:"flex items-center gap-1.5 text-[13px] text-danger"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(I.value),1)],8,jV)):Y("",!0)]))}}),HV=["id","aria-describedby"],KV={key:0,class:"sr-only"},WV={"data-taglist-chip":"",class:"inline-flex items-center rounded-full bg-surface px-2.5 py-0.5 text-[13px] text-text"},GV={key:1,class:"text-muted","data-empty":""},YV=["aria-label","onClick"],JV=["id","name","list","placeholder","value","aria-required","aria-invalid","aria-describedby"],ZV=["id"],XV=["value"],QV=ne({__name:"TaglistField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t,r=_(()=>{const T=a.field.attributes?.readonly;return!!a.field.readOnly||T!=null&&T!==!1}),l=_(()=>Vr(a.field)),o=_(()=>`${a.controlId}-options`),i=_(()=>(a.field.options??[]).map(T=>T.label)),u=_(()=>a.field.mode==="array"),d=_(()=>!u.value&&a.field.separator==="space"),c=_(()=>d.value?" ":","),f=_(()=>a.field.customTags===!1);function v(T){let I=[];Array.isArray(T)?I=T:typeof T=="string"&&!u.value&&(I=d.value?T.split(/\s+/):T.split(","));const q=[];for(const H of I){const E=typeof H=="string"?H.trim():"";E!==""&&!q.includes(E)&&q.push(E)}return q}const m=A(v(a.modelValue)),y=A("");let x;Be(()=>a.modelValue,T=>{T!==x&&(m.value=v(T))});function S(T){m.value=T;const I=u.value?[...T]:T.join(d.value?" ":",");x=I,n("update:modelValue",I)}function k(){const T=y.value.trim();y.value="",!(T===""||m.value.includes(T)||f.value&&!i.value.includes(T))&&S([...m.value,T])}function C(T){S(m.value.filter((I,q)=>q!==T))}function L(T){const I=T.target.value;if(!I.includes(c.value)){y.value=I;return}const q=I.split(c.value),H=q.pop()??"";for(const E of q)y.value=E,k();y.value=H}function D(T){T.key==="Enter"?(T.preventDefault(),k()):T.key==="Backspace"&&y.value===""&&m.value.length>0&&C(m.value.length-1)}return(T,I)=>r.value?(p(),b("div",{key:0,id:e.controlId,"data-taglist-readonly":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input flex-wrap items-center gap-1.5 rounded-control border border-border bg-subtle px-3.5 py-2"},[m.value.length>0?(p(!0),b(pe,{key:0},De(m.value,(q,H)=>(p(),b(pe,{key:q},[H>0?(p(),b("span",KV,", ")):Y("",!0),g("span",WV,w(q),1)],64))),128)):(p(),b("span",GV,"—"))],8,HV)):(p(),b("div",{key:1,class:me([s(It)(e.invalid),"flex min-h-input flex-wrap items-center gap-1.5 py-1.5 focus-within:border-primary focus-within:shadow-[0_0_0_3px_var(--c-ring)]"]),"data-taglist":""},[(p(!0),b(pe,null,De(m.value,(q,H)=>(p(),b("span",{key:q,"data-taglist-chip":"",class:"inline-flex items-center gap-1 rounded-full bg-subtle py-0.5 pr-1 pl-2.5 text-[13px] text-text"},[g("span",null,w(q),1),g("button",{type:"button","data-taglist-remove":"","aria-label":s(h)("backend::lang.taglist.remove",{tag:q}),class:"inline-flex size-5 items-center justify-center rounded-full text-muted hover:bg-border hover:text-text",onClick:E=>C(H)},[R(s(Vt),{size:12,"aria-hidden":"true"})],8,YV)]))),128)),g("input",He({id:e.controlId},l.value,{name:e.field.name,type:"text",autocomplete:"off",list:i.value.length>0?o.value:void 0,placeholder:s(h)("backend::lang.taglist.add"),value:y.value,"aria-required":e.field.required?"true":void 0,"aria-invalid":e.invalid?"true":void 0,"aria-describedby":e.describedBy||void 0,class:"min-w-[8rem] flex-1 bg-transparent py-1 outline-none focus-visible:shadow-none",onInput:L,onKeydown:D,onBlur:k}),null,16,JV),i.value.length>0?(p(),b("datalist",{key:0,id:o.value},[(p(!0),b(pe,null,De(i.value,q=>(p(),b("option",{key:q,value:q},null,8,XV))),128))],8,ZV)):Y("",!0)],2))}}),e7=ne({__name:"MLTextField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(r,l)=>(p(),U(Yu,He(a,{inner:n_,"inner-type":"text","ml-type":"mltext","onUpdate:modelValue":l[0]||(l[0]=o=>n("update:modelValue",o))}),null,16))}}),t7=ne({__name:"MLTextareaField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(r,l)=>(p(),U(Yu,He(a,{inner:r_,"inner-type":"textarea","ml-type":"mltextarea","onUpdate:modelValue":l[0]||(l[0]=o=>n("update:modelValue",o))}),null,16))}}),a7=ne({__name:"MLMarkdownField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},emits:["update:modelValue"],setup(e,{emit:t}){const a=e,n=t;return(r,l)=>(p(),U(Yu,He(a,{inner:o_,"inner-type":"markdown","ml-type":"mlmarkdown","onUpdate:modelValue":l[0]||(l[0]=o=>n("update:modelValue",o))}),null,16))}}),n7=["id","aria-describedby"],r7={key:0},l7={class:"font-mono text-text"},o7={key:1},s7={class:"font-mono text-text"},ui="\0",i7=ne({__name:"UnsupportedField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=_(()=>{const[r="",l=""]=h("backend::lang.form.unsupported_field",{type:ui}).split(ui);return{before:r,after:l}}),n=_(()=>h("backend::lang.form.unsupported_field",{type:ui}).includes(ui));return(r,l)=>(p(),b("div",{id:e.controlId,"data-unsupported-field":"","aria-describedby":e.describedBy||void 0,class:"flex min-h-input items-center gap-2.5 rounded-control border-[1.5px] border-dashed border-border-strong bg-subtle px-3.5 text-[13px] text-muted"},[R(s(hb),{size:16,"aria-hidden":"true"}),n.value?(p(),b("span",r7,[_e(w(a.value.before),1),g("code",l7,w(t.field.type),1),_e(w(a.value.after),1)])):(p(),b("span",o7,[_e(w(s(h)("backend::lang.form.unsupported_field"))+" ",1),g("code",s7,w(t.field.type),1)]))],8,n7))}}),u7=["id","aria-labelledby","aria-describedby","aria-busy"],c7={key:0,"data-widget-skeleton":"",class:"h-[42px] w-[160px] rounded-control bg-skel","aria-hidden":"true"},d7=ne({__name:"WidgetField",props:{field:{},modelValue:{},controlId:{},invalid:{type:Boolean},describedBy:{},labels:{},source:{},recordId:{}},setup(e){const t=e,a=ct(Ps,null),n=ct(Cp,()=>{}),r=ct(Gu,null),l=ct(V0,()=>Promise.resolve([])),o=A("loading"),i=A(null);let u=null,d=!1,c=!1;function f(){const D=a?.value??{},T={};for(const I of t.field.fill??[])D[I]!==void 0&&(T[I]=D[I]);return T}const v=_(()=>JSON.stringify(f())),m=_(()=>r?.value||La.value);function y(D){let T;return{promise:new Promise((q,H)=>{T=setTimeout(()=>H(new Error("widget element was not defined in time")),D)}),cancel:()=>clearTimeout(T)}}async function x(D){const T=await l();if(customElements.get(D))return;if(T.length>0)throw new Error(`plugin script failed: ${T.join(", ")}`);const I=y(j0);try{await Promise.race([customElements.whenDefined(D),I.promise])}finally{I.cancel()}}function S(D){Pe(D||h("backend::lang.extension.action_failed"),"danger"),u?.setAttribute("state","error")}async function k(D){const T=t.source,I=u;if(!(!I||d||!T)){d=!0,I.setAttribute("busy",""),I.removeAttribute("state");try{const q=await qe.POST("/{vendor}/{plugin}/{controller}/widgets/{field}",{params:{path:{...T,field:t.field.name}},body:{record_id:t.recordId??void 0,values:f(),...D===void 0?{}:{payload:D}}});if(q.data){const H=q.data.data,E=H.fill??{};for(const P of t.field.fill??[])Object.hasOwn(E,P)&&n(P,E[P]);c||(Object.hasOwn(H,"data")?I.setAttribute("data",JSON.stringify(H.data)):I.removeAttribute("data"),I.dispatchEvent(new CustomEvent(iI,{detail:{data:H.data,fill:E,message:H.message}}))),H.message&&Pe(H.message)}else S(q.error?.error.message)}catch{S()}finally{d=!1,u?.removeAttribute("busy")}}}function C(D){const T=D.detail;if(T!==null&&typeof T=="object"&&Object.hasOwn(T,"payload"))return T.payload}function L(D){k(C(D))}return $t(async()=>{const D=t.field.widget??"";try{if(D===""||!t.source)throw new Error("widget field without a tag or controller");if(await x(D),c||!i.value)return;const T=document.createElement(D);T.setAttribute("record-id",t.recordId==null?"":String(t.recordId)),T.setAttribute("field-name",t.field.name),T.setAttribute("locale",m.value),T.setAttribute("fill-values",v.value),T.setAttribute("label",t.field.actionLabel||t.field.label||t.field.name),T.setAttribute("busy-label",h("backend::lang.extension.busy")),T.addEventListener(wh,L),u=T,i.value.append(T),o.value="ready"}catch{c||(o.value="failed")}}),Be(v,D=>u?.setAttribute("fill-values",D)),Be(m,D=>u?.setAttribute("locale",D)),Ot(()=>{c=!0,u?.removeEventListener(wh,L),u=null}),(D,T)=>o.value==="failed"?(p(),U(Ku,{key:0,id:e.controlId,"data-widget-failed":"","aria-describedby":e.describedBy||void 0,text:s(h)("backend::lang.extension.widget_failed")},null,8,["id","aria-describedby","text"])):(p(),b("div",{key:1,id:e.controlId,role:"group","data-widget-host":"","aria-labelledby":e.field.label?`${e.controlId}-label`:void 0,"aria-describedby":e.describedBy||void 0,"aria-busy":o.value==="loading"?"true":void 0,class:"flex min-h-input items-center"},[o.value==="loading"?(p(),b("span",c7)):Y("",!0),g("div",{ref_key:"mountPoint",ref:i,class:"contents"},null,512)],8,u7))}}),yl="relation-manager",s_=new Map([[yl,()=>BB]]),i_=new Map([["text",n_],["textarea",r_],["number",lL],["dropdown",gI],["switch",mF],["checkbox",VR],["relation",iF],["widget",d7],["partial",sL],["fileupload",nL],["datepicker",sI],["password",mL],["permissioneditor",ML],["markdown",o_],["mltext",e7],["mltextarea",t7],["mlmarkdown",a7],["richeditor",TN],["repeater",w9],["money",UV],["taglist",QV],["mailpreview",mV],["codeeditor",xV],["colorpicker",SV],["mailimage",RV]]),f7=new Set(["switch","checkbox",yl]),p7=new Set([yl]),m7=new Set([yl,"widget","partial","fileupload","mailpreview"]),v7=new Set(["widget","partial","fileupload","permissioneditor","mltext","mltextarea","mlmarkdown","repeater","mailpreview","mailimage"]);function h7(e){return i_.get(e)??s_.get(e)?.()??i7}function y7(e){return(i_.has(e)||s_.has(e))&&!m7.has(e)}function Zu(e){return typeof e.element=="string"&&e.element!==""}function u_(e){return Zu(e)?e.translatable?xL:H0:h7(e.type)}function c_(e){return Zu(e)||y7(e.type)}function g7(e){return p7.has(e)}function b7(e){return f7.has(e)}function _7(e){return v7.has(e)}const Ft="default";function ma(e){return e.tab?`tab:${e.tab}`:Ft}function ro(e,t){return`${e}-tab-${t}`}function Is(e,t){return`${e}-panel-${t}`}function xs(e,t){const a=e.context;if(a==null)return!0;const n=Array.isArray(a)?a:[a];return n.length===0||n.includes(t)}function Pa(e,t,a="create",n){const r={};for(const l of e){if(l.readOnly||!c_(l))continue;const o=t[l.name];if(!(l.type==="password"&&a==="update"&&(o===""||o===null))){if(l.type==="permissioneditor"){const i=n?.[l.name];r[l.name]=B0(l,o,i?new Set(i.map(u=>u.code)):void 0);continue}if(Or(l)){r[l.name]=dn(o);continue}o!==void 0&&(r[l.name]=o)}}return r}function nd(e,t){const a=typeof t=="string"||typeof t=="number"?String(t):"";return e!=="slug"?a:a.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function d_(e,t){const a=dn(e),n=dn(t),r=[];for(const l of new Set([...Object.keys(a),...Object.keys(n)]))(a[l]??"")!==(n[l]??"")&&r.push(l);return r}function x7(e,t,a,n,r,l,o){const i={},u=Or(e.find(d=>d.name===t));for(const d of e){const c=d.preset;if(!c||c.field!==t||d.type!=="text"&&d.type!=="mltext")continue;if(d.type==="text"){if(o(d.name))continue;i[d.name]=nd(c.type,u?dn(n)[l]??"":n);continue}if(!u){if(o(d.name,l))continue;i[d.name]={...dn(r[d.name]),[l]:nd(c.type,n)};continue}const f=dn(n),v={...dn(r[d.name])};let m=!1;for(const y of d_(a,n))o(d.name,y)||(v[y]=nd(c.type,f[y]??""),m=!0);m&&(i[d.name]=v)}return i}function Pp(e,t=[]){const a={};for(const n of e)if(n.default!==void 0)a[n.name]=n.default;else if(n.type==="switch"||n.type==="checkbox")a[n.name]=!1;else if(n.type==="relation"&&n.multiple)a[n.name]=[];else if(Or(n)){const r={};for(const l of t)r[l]="";a[n.name]=r}return a}function Il(e){return e?.enabledLocales??[]}function f_(e,t){const a={};for(const n of t)a[n]="";if(typeof e=="string"){const n=t[0];return n&&(a[n]=e),a}return{...a,...dn(e)}}function p_(e,t,a){const n=e?.find(i=>i.type==="text"||Or(i)),r=n?t[n.name]:void 0;if(typeof r=="string"||typeof r=="number")return String(r).trim();if(!n||!Or(n))return"";const l=dn(r),o=a[0]!==void 0?(l[a[0]]??"").trim():"";if(o!=="")return o;for(const i of Object.values(l))if(i.trim()!=="")return i.trim();return""}function m_(e){const t={};for(const a of e??[]){if(!a||typeof a.message!="string"||a.message===""||typeof a.field!="string")continue;const n=a.locale?`${a.locale.toUpperCase()}: ${a.message}`:a.message;(t[a.field]??=[]).push(n)}return t}function Dr(e){const t={};for(const[a,n]of Object.entries(e??{})){const r=Array.isArray(n)?n.filter(l=>typeof l=="string"&&l!==""):typeof n=="string"&&n!==""?[n]:[];r.length>0&&(t[a]=r)}return t}function br(e){return JSON.stringify(Object.keys(e).sort().map(t=>[t,e[t]]))}function Nn(e,t){const a=document.getElementById(`${e}-${t}`);return a?(a.matches("input, select, textarea, button, [tabindex]")||a.setAttribute("tabindex","-1"),a.focus(),!0):!1}function k7(e){const t=e.indexOf(".");return t<0?e:e.slice(0,t)}function Xd(e,t){return Object.keys(e).some(a=>a===t||a.startsWith(`${t}.`))}function w7(e,t){return e[t]?t:Object.keys(e).find(a=>a.startsWith(`${t}.`))}const Kh=/^[A-Za-z0-9_-]+$/;function Wh(e,t){const a=t.split(".");if(a.length<3)return Nn(e,a[0]??t);const[n,r,l]=a;if(!Kh.test(n)||!/^\d+$/.test(r)||!Kh.test(l))return Nn(e,n);const o=document.querySelector(`[data-repeater="${n}"] [data-repeater-row="${r}"] [data-field="${l}"]`),i=o?.querySelector("label[for]")?.getAttribute("for"),u=(i?document.getElementById(i):null)??o?.querySelector('input, select, textarea, [contenteditable="true"], button');return u?(u.matches('input, select, textarea, button, [tabindex], [contenteditable="true"]')||u.setAttribute("tabindex","-1"),u.focus(),!0):Nn(e,n)}const $7={key:0,role:"alert","data-forbidden-banner":"",class:"flex items-start gap-3 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},S7={class:"flex min-w-0 flex-col gap-1"},C7={class:"[overflow-wrap:anywhere]"},E7={key:1,role:"alert","data-error-banner":"",class:"flex items-start gap-3 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},A7={class:"flex flex-col gap-1"},vo=ne({__name:"FormErrorBanner",props:{errors:{},fieldNames:{},forbidden:{default:null}},setup(e){const t=e,a=_(()=>Object.keys(t.errors).length),n=_(()=>Object.entries(t.errors).filter(([r])=>!t.fieldNames.includes(r)&&!t.fieldNames.includes(k7(r))).flatMap(([,r])=>r));return(r,l)=>e.forbidden?(p(),b("div",$7,[R(s(gt),{size:20,class:"mt-px shrink-0","aria-hidden":"true"}),g("div",S7,[g("p",C7,w(e.forbidden),1),(p(!0),b(pe,null,De(n.value,(o,i)=>(p(),b("p",{key:i,class:"text-[13px] [overflow-wrap:anywhere]"},w(o),1))),128))])])):a.value>0?(p(),b("div",E7,[R(s(gt),{size:20,class:"mt-px shrink-0","aria-hidden":"true"}),g("div",A7,[g("p",null,[g("strong",null,w(s(h)("backend::lang.form.error_title")),1),_e(" "+w(s(wa)("backend::lang.form.error_fields",a.value)),1)]),(p(!0),b(pe,null,De(n.value,(o,i)=>(p(),b("p",{key:i,class:"text-[13px]"},w(o),1))),128))])])):Y("",!0)}}),T7={class:"flex flex-wrap items-center gap-2"},O7=["for"],D7=["id","value"],M7=["value","data-locale"],P7=ne({__name:"LocaleVariantSwitcher",props:{variants:{},controlId:{}},setup(e){const t=e,a=ya(),n=_n(),r=_(()=>t.variants.find(d=>d.current)?.id??t.variants[0]?.id??0),l=A(r.value);Be(r,d=>{l.value=d});const o=_(()=>t.controlId??"locale-variant");function i(d){const c=d.states??[];return c.length>0?`${d.label} — ${c.join(", ")}`:d.label}async function u(d){const c=d.target,f=Number(c.value);if(!Number.isFinite(f)||f===r.value)return;l.value=f;let v=!1;try{const m=await n.push({name:a.name??void 0,params:{...a.params,id:String(f)},query:a.query});v=tn(m)}catch{v=!0}v&&(l.value=r.value,c.value=String(r.value))}return(d,c)=>(p(),b("div",T7,[g("label",{for:o.value,class:"text-[13px] text-muted"},w(s(h)("backend::lang.form.locale_variant")),9,O7),g("select",{id:o.value,"data-locale-variant":"",class:"rounded-control border border-border-strong bg-surface px-2 py-1 text-[13px]",value:String(l.value),onChange:u},[(p(!0),b(pe,null,De(e.variants,f=>(p(),b("option",{key:f.id,value:String(f.id),"data-locale":f.locale},w(i(f)),9,M7))),128))],40,D7)]))}}),v_=ne({__name:"RecordActions",props:{source:{},recordId:{},actions:{},disabled:{type:Boolean,default:!1}},emits:["busy","done","stale","gone"],setup(e,{emit:t}){const a=e,n=t,r=Fr(),l=A(!1);function o(u){const c=u?.error?.details?.payload;return Array.isArray(c)&&typeof c[0]=="string"?c[0]:""}async function i(u){if(l.value||a.disabled)return;let d=0,c=!1,f="",v="";if(await r.ask({message:u.confirm||h("backend::lang.form.action_confirm",{action:u.label}),confirmLabel:u.label,danger:u.danger,prompt:u.prompt?{label:u.prompt.label,placeholder:u.prompt.placeholder,comment:u.prompt.comment,maxLength:u.prompt.max_length}:void 0},async()=>{l.value=!0,n("busy",!0);try{const y={path:{...a.source,id:a.recordId,action:u.name}},x=u.prompt?await qe.POST("/{vendor}/{plugin}/{controller}/{id}/actions/{action}",{params:y,body:{payload:r.value.value.trim()}}):await qe.POST("/{vendor}/{plugin}/{controller}/{id}/actions/{action}",{params:y,body:{}});d=x.response.status,c=!!x.data,f=x.data?.data.message??x.error?.error.message??"",v=o(x.error)}catch{d=0}finally{l.value=!1,n("busy",!1)}})){if(c){n("done",f||h("backend::lang.form.action_done"));return}if(d===409){Pe(h("backend::lang.form.action_stale"),"danger"),n("stale");return}if(d===404){n("gone");return}if(d===403){Pe(f||h("backend::lang.list.action_forbidden"),"danger");return}if(d===422&&v){Pe(v,"danger");return}Pe(f||h("backend::lang.extension.action_failed"),"danger")}}return(u,d)=>e.actions.length>0?(p(),b(pe,{key:0},[(p(!0),b(pe,null,De(e.actions,c=>(p(),U(Ke,{key:c.name,variant:"outline",size:"md","data-record-action":c.name,disabled:e.disabled||l.value,onClick:f=>i(c)},{default:B(()=>[_e(w(c.label),1)]),_:2},1032,["data-record-action","disabled","onClick"]))),128)),R(Br,{open:s(r).request.value!==null,message:s(r).request.value?.message??"","confirm-label":s(r).request.value?.confirmLabel,danger:s(r).request.value?.danger,busy:s(r).busy.value,prompt:s(r).request.value?.prompt??null,value:s(r).value.value,"onUpdate:value":s(r).setValue,onConfirm:s(r).confirm,onCancel:s(r).cancel},null,8,["open","message","confirm-label","danger","busy","prompt","value","onUpdate:value","onConfirm","onCancel"])],64)):Y("",!0)}});function R7(e,t,a){const n=e.trigger;if(!n)return"inactive";const r=a.has(n.field)&&Wu(t[n.field]);return(n.condition==="checked"?r:!r)?"active":"inactive"}function h_(e,t,a){const n=new Set(e.map(o=>o.name)),r=[],l={};for(const o of e){if(!o.trigger||R7(o,t,n)==="inactive"){r.push(o);continue}if(o.trigger.action==="hide")continue;r.push({...o,readOnly:!0});const i=o.trigger.condition==="checked"?"backend::lang.form.trigger_disabled_on":"backend::lang.form.trigger_disabled_off";l[o.name]=h(i,{field:a(o.trigger.field)})}return{fields:r,notes:l}}const I7={class:"flex w-full flex-col gap-5 pb-24"},q7={class:"flex flex-wrap items-center gap-4"},L7={class:"flex min-w-0 flex-1 flex-col"},N7={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},B7={key:0,class:"text-muted"},F7={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},V7=["id","role","aria-labelledby"],z7={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex flex-wrap items-center gap-2.5 border-t border-border bg-surface px-8 py-3.5"},j7={class:"flex flex-wrap items-center gap-2.5"},U7={class:"ml-auto flex flex-wrap items-center gap-2.5"},H7={class:"sr-only","aria-live":"polite","data-form-live":""},Yr="field",Gh="/settings",Yh=ne({__name:"FormView",setup(e){const t=ya(),a=_n(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},r=Cs(n),l=Ga(r)??"/",o=t.name==="create"?"create":"update",i=o==="update"?Number(t.params.id):null,u=A(null),d=A({}),c=A({}),f=A({}),v=A(""),m=A([]),y=A(!0),x=A([]),S=A(!1),k=A(0),C=A({}),L=A(null),D=A({}),T=A(!0),I=A(!1),q=A(!1),H=A(""),E=A(Ft),P=Fr();let j=!1,O=Promise.resolve([]);const N=bs(),Z={[Tr]:N},W=A(0),K=A(0),{activeUploads:te,beginUpload:oe}=Ep(),ye=_(()=>(u.value?.fields??[]).filter(Ae=>xs(Ae,o)&&(o==="update"||!g7(Ae.type)||Ae.type===yl&&!!Ae.deferrable)));function be(Ae){return u.value?.fields.find(Ye=>Ye.name===Ae)?.label||Ae}const ge=_(()=>h_(ye.value,d.value,be)),le=_(()=>ge.value.fields),ce=_(()=>le.value.map(Ae=>Ae.name)),F=_(()=>{if(!le.value.some(Fe=>Fe.tab))return[];const Ae=[];for(const Fe of le.value){const Ye=ma(Fe);let ut=Ae.find(St=>St.key===Ye);ut||(ut={key:Ye,label:Fe.tab||h("backend::lang.form.tab_default"),errors:0},Ye===Ft?Ae.unshift(ut):Ae.push(ut)),Xd(C.value,Fe.name)&&(ut.errors+=1)}return Ae}),fe=_(()=>Math.max(F.value.findIndex(Ae=>Ae.key===E.value),0)),ve=_(()=>{if(F.value.length===0)return le.value;const Ae=F.value[fe.value]?.key??Ft;return le.value.filter(Fe=>ma(Fe)===Ae)}),J=_(()=>v.value||p_(u.value?.fields,d.value,Il(u.value?.meta))),he=_(()=>{if(o==="update"&&J.value!=="")return J.value;const Ae=o==="create"?u.value?.messages.create:u.value?.messages.update;return Xe(Ae,void 0,{name:J.value})}),G=_(()=>o==="update"&&!!u.value?.singleton),ee=_(()=>o==="update"&&!G.value?Xe(u.value?.messages.update,void 0,{name:J.value}):""),ae=_(()=>o==="update"&&!G.value&&!!u.value?.preview),$=_(()=>G.value?Gh:ae.value?`${l}/${i}/preview`:l),M=_(()=>G.value?h("backend::lang.settings.back"):h(ae.value?"backend::lang.form.return_to_preview":"backend::lang.form.return_to_list")),z=_(()=>!T.value&&(W.value>0||te.value>0||br(Pa(le.value,d.value,o,f.value))!==H.value));function de(Ae){if(Ae){const Fe=Il(u.value?.meta),Ye={...Ae.data};for(const ut of ye.value)ut.type==="password"?Ye[ut.name]="":Or(ut)&&(Ye[ut.name]=f_(Ae.data[ut.name],Fe));d.value=Ye,c.value=Ae.meta.labels??{},f.value=Ae.meta.permissionLocks??{},v.value=Ae.meta.title??"",m.value=Ae.meta.actions??[],y.value=Ae.meta.deletable!==!1,Ae.meta.localeVariants&&(x.value=Ae.meta.localeVariants)}H.value=br(Pa(le.value,d.value,o,f.value))}function X(Ae,Fe){const Ye=c.value[Ae]??[],ut=Ye.findIndex(Pt=>Pt.value===Fe.value),St=[...Ye];ut>=0?St[ut]=Fe:St.push(Fe),c.value={...c.value,[Ae]:St}}async function se(){T.value=!0,I.value=!1;const Ae={path:n},[Fe,Ye]=await Promise.all([qe.GET("/{vendor}/{plugin}/{controller}/schema/form",{params:Ae}),i!==null?qe.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}}):Promise.resolve(null)]);u.value=Fe.data?.data??null,I.value=!Fe.data||Ye!==null&&!Ye.data,u.value&&(O=wp(r,u.value.assets)),u.value&&o==="create"&&(d.value=Pp(ye.value,Il(u.value.meta))),de(Ye?.data),Ce.value=ie(),E.value=F.value[0]?.key??Ft,T.value=!1}const xe=new Set,$e=new Map,Ce=A("en");function ie(){return Il(u.value?.meta)[0]??"en"}function Ee(Ae){const Fe=Ae.detail;typeof Fe=="string"&&Fe!==""&&(Ce.value=Fe)}Be(E,()=>{Ce.value=ie()});function we(Ae,Fe){return Fe===void 0?xe.has(Ae):$e.get(Ae)?.has(Fe)??!1}function Le(Ae,Fe){const Ye=d.value[Ae],ut={...d.value,[Ae]:Fe};if(xe.add(Ae),Or(ye.value.find(Pt=>Pt.name===Ae))){let Pt=$e.get(Ae);Pt||(Pt=new Set,$e.set(Ae,Pt));for(const zr of d_(Ye,Fe))Pt.add(zr)}o==="create"&&Object.assign(ut,x7(ye.value,Ae,Ye,Fe,d.value,Ce.value,we));const St=ge.value.notes;if(d.value=ut,at(St),C.value[Ae]){const Pt={...C.value};delete Pt[Ae],C.value=Pt}}ht(Ps,_(()=>d.value)),ht(Cp,Le),ht(Dp,X),ht(Gu,_(()=>u.value?.meta.locale||La.value)),ht(au,_(()=>Il(u.value?.meta))),ht(V0,()=>O),ht(Ap,_(()=>f.value)),ht(Tp,_(()=>ge.value.notes)),ht(F0,k);const Ve=A("");let We=null;function tt(Ae){Ve.value="",We!==null&&clearTimeout(We),We=setTimeout(()=>{We=null,Ve.value=Ae},50)}function at(Ae){const Fe=ge.value.notes,Ye=Object.keys(Fe).filter(ut=>!(ut in Ae)).map(ut=>`${be(ut)}: ${Fe[ut]}`);Ye.length>0&&tt(Ye.join(" "))}Be(()=>F.value.map(Ae=>Ae.key),Ae=>{Ae.length>0&&!Ae.includes(E.value)&&(E.value=Ae[0]??Ft)}),ht(Op,{errors:_(()=>C.value),notices:_(()=>D.value),clearError:Ae=>{if(C.value[Ae]){const Fe={...C.value};delete Fe[Ae],C.value=Fe}},announce:tt,confirm:Ae=>P.ask(Ae)}),ht(U0,new Map),ht(po,{key:N,recordId:i??0,routes:Ae=>L0(n,i??0,Ae,N),markDirty:()=>{W.value++},pendingChanges:At(W),revision:At(K),beginUpload:oe,activeUploads:At(te)});async function st(Ae){C.value=Dr(Ae?.details);const Fe=le.value.filter(St=>Xd(C.value,St.name)),Ye=Fe.find(St=>ma(St)===E.value)??Fe[0];if(!Ye)return;F.value.length>0&&(E.value=ma(Ye)),await Ue();const ut=w7(C.value,Ye.name)??Ye.name;Wh(Yr,ut)||(await Ue(),Wh(Yr,ut))}function Ie(Ae,Fe){const Ye=u.value?.redirects,ut=(Ye?.[o]?.[Ae]||Ye?.default)??"";return O0(ut,r,typeof Fe=="number"||typeof Fe=="string"?Fe:null)}async function Qe(){if(q.value||!u.value||te.value>0)return null;q.value=!0,L.value=null,D.value={};try{const Ae=Pa(le.value,d.value,o,f.value),Fe=i===null?await qe.POST("/{vendor}/{plugin}/{controller}",{params:{path:n,header:Z},body:Ae}):await qe.PUT("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i},header:Z},body:Ae});if(Fe.data){C.value={},de(Fe.data),D.value=m_(Fe.data.meta.notices),W.value=0,K.value++,k.value++;const Ye=Xe(u.value.messages.saved,void 0,{name:J.value}),ut=Object.values(D.value).flat().join(" ");return Pe(ut===""?Ye:`${Ye} ${ut}`),Fe.data}return Fe.response.status===422?await st(Fe.error?.error):Fe.response.status===403?(L.value=Fe.error?.error.message||h("backend::lang.form.forbidden"),await st(Fe.error?.error)):Pe(Fe.error?.error.message||h("backend::lang.form.error_generic"),"danger"),null}catch{return Pe(h("backend::lang.form.error_generic"),"danger"),null}finally{q.value=!1}}async function ot(Ae){j=!0;try{await a.push(Ae)}finally{j=!1}}async function Mt(){const Ae=await Qe();Ae&&o==="create"&&await ot(Ie("redirect",Ae.data.id))}async function je(){const Ae=await Qe();Ae&&await ot(G.value?Gh:Ie("redirectClose",Ae.data.id))}async function ze(){await Qe()&&uM()}const Ge=_(()=>o==="update"&&!G.value&&!ae.value&&m.value.length>0),Bt=_(()=>o==="update"&&!G.value&&y.value),ra=_(()=>q.value||S.value);async function er(Ae){if(Pe(Ae),i===null)return;const Fe=await qe.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}});Fe.data?(de(Fe.data),k.value++):Fe.response.status===404&&(I.value=!0)}async function wn(){if(i===null)return;const Ae=await qe.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}});Ae.data&&(de(Ae.data),k.value++)}function Ba(){I.value=!0}async function Gt(){if(!(i===null||q.value||!u.value||!await P.ask({message:Xe(u.value.messages.deleteConfirm,void 0,{name:J.value}),confirmLabel:h("backend::lang.form.delete"),danger:!0}))){q.value=!0;try{const Fe=await qe.DELETE("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:i}}});if(Fe.data){Pe(Xe(u.value.messages.deleted,void 0,{name:J.value})),await ot(l);return}const Ye=Fe.response.status===403?"backend::lang.list.action_forbidden":"backend::lang.form.error_generic";Pe(Fe.error?.error.message||h(Ye),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{q.value=!1}}}async function tr(){return j||!z.value?!0:P.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})}async function $n(){z.value&&!await P.ask({message:h("backend::lang.form.unsaved_confirm"),confirmLabel:h("backend::lang.form.discard"),danger:!0})||await ot($.value)}Fg(tr),Kw(tr);function ar(Ae){z.value&&(Ae.preventDefault(),Ae.returnValue="")}return $t(()=>{window.addEventListener("beforeunload",ar),window.addEventListener(_s,Ee)}),Ot(()=>{window.removeEventListener("beforeunload",ar),window.removeEventListener(_s,Ee),We!==null&&clearTimeout(We)}),Ea(()=>wf(T.value?"":he.value)),Ot($f),se(),(Ae,Fe)=>(p(),b("section",I7,[g("header",q7,[R(Ke,{variant:"outline","data-action":"back","aria-label":M.value,class:"size-10! px-0!",onClick:$n},{default:B(()=>[R(s(oo),{size:18,"aria-hidden":"true"})]),_:1},8,["aria-label"]),g("div",L7,[g("h1",N7,w(T.value?"":he.value),1),ee.value?(p(),b("p",B7,w(ee.value),1)):Y("",!0),!T.value&&x.value.length>1?(p(),U(P7,{key:1,class:"mt-1.5",variants:x.value,"control-id":`${Yr}-locale-variant`},null,8,["variants","control-id"])):Y("",!0)]),F.value.length>0?(p(),U(Ju,{key:0,modelValue:E.value,"onUpdate:modelValue":Fe[0]||(Fe[0]=Ye=>E.value=Ye),tabs:F.value,"id-prefix":Yr},null,8,["modelValue","tabs"])):Y("",!0)]),I.value&&!T.value?(p(),b("p",F7,w(s(h)("backend::lang.form.load_failed")),1)):u.value?(p(),b(pe,{key:1},[R(vo,{errors:C.value,"field-names":ce.value,forbidden:L.value},null,8,["errors","field-names","forbidden"]),g("form",{id:F.value.length>0?s(Is)(Yr,fe.value):void 0,role:F.value.length>0?"tabpanel":void 0,"aria-labelledby":F.value.length>0?s(ro)(Yr,fe.value):void 0,class:"rounded-card border border-border bg-surface p-7 shadow-card",novalidate:"",onSubmit:yt(Mt,["prevent"])},[R(mo,{fields:ve.value,values:d.value,errors:C.value,notices:D.value,labels:c.value,source:n,"record-id":s(i),"id-prefix":Yr,onUpdate:Le},null,8,["fields","values","errors","notices","labels","record-id"])],40,V7)],64)):Y("",!0),g("footer",z7,[g("div",j7,[Bt.value?(p(),U(Ke,{key:0,variant:"danger","data-action":"delete",icon:s(Ir),disabled:ra.value||T.value||!u.value,onClick:Gt},{default:B(()=>[_e(w(s(h)("backend::lang.form.delete")),1)]),_:1},8,["icon","disabled"])):Y("",!0),Ge.value&&s(i)!==null?(p(),U(v_,{key:1,source:n,"record-id":s(i),actions:m.value,disabled:ra.value||T.value||!u.value,onBusy:Fe[1]||(Fe[1]=Ye=>S.value=Ye),onDone:er,onStale:wn,onGone:Ba},null,8,["record-id","actions","disabled"])):Y("",!0)]),g("div",U7,[R(Ke,{variant:"ghost","data-action":"cancel",hotkey:"escape",disabled:ra.value,onClick:$n},{default:B(()=>[_e(w(s(h)("backend::lang.form.cancel")),1)]),_:1},8,["disabled"]),s(o)==="create"?(p(),U(Ke,{key:0,variant:"outline","data-action":"save-new",hotkey:"mod+shift+s",title:s(ja)(s(h)("backend::lang.form.create_and_new"),"mod+shift+s"),disabled:ra.value||T.value||!u.value||s(te)>0,onClick:ze},{default:B(()=>[_e(w(s(h)("backend::lang.form.create_and_new")),1)]),_:1},8,["title","disabled"])):Y("",!0),R(Ke,{variant:"outline","data-action":"save-close",hotkey:"mod+enter",title:s(ja)(s(h)("backend::lang.form.save_and_close"),"mod+enter"),disabled:ra.value||T.value||!u.value||s(te)>0,onClick:je},{default:B(()=>[_e(w(s(h)("backend::lang.form.save_and_close")),1)]),_:1},8,["title","disabled"]),R(Ke,{variant:"primary","data-action":"save",hotkey:"mod+s",title:s(ja)(s(h)("backend::lang.form.save"),"mod+s"),disabled:ra.value||T.value||!u.value||s(te)>0,onClick:Mt},{default:B(()=>[_e(w(q.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.form.save")),1)]),_:1},8,["title","disabled"])])]),g("p",H7,w(Ve.value),1),R(Br,{open:s(P).request.value!==null,message:s(P).request.value?.message??"","confirm-label":s(P).request.value?.confirmLabel,danger:s(P).request.value?.danger,onConfirm:s(P).confirm,onCancel:s(P).cancel,"onUpdate:open":Fe[2]||(Fe[2]=Ye=>{Ye||s(P).cancel()})},null,8,["open","message","confirm-label","danger","onConfirm","onCancel"])]))}}),K7={class:"flex w-full flex-col gap-5 pb-24","data-preview":""},W7={class:"flex flex-wrap items-center gap-4"},G7={class:"flex min-w-0 flex-1 flex-col"},Y7={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},J7={key:0,class:"text-muted"},Z7={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},X7=["id","role","aria-labelledby"],Q7={class:"m-0 grid grid-cols-1 gap-x-6 gap-y-[22px] min-[600px]:grid-cols-2"},ez={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex flex-wrap items-center gap-2.5 border-t border-border bg-surface px-8 py-3.5"},tz={class:"ml-auto flex flex-wrap items-center gap-2.5"},ci="preview",az=ne({__name:"PreviewView",setup(e){const t=ya(),a=_n(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},r=Cs(n),l=Ga(r)??"/",o=Number(t.params.id),i=`${l}/${o}`,u=A(null),d=A({}),c=A({}),f=A({}),v=A(""),m=A([]),y=A(!0),x=A(!1),S=A(!1),k=A(Ft),C=A(0),L=new Set(["password","widget",yl]),D=_(()=>h_((u.value?.fields??[]).filter(le=>xs(le,"preview")&&!L.has(le.type)),d.value,le=>le).fields),T=_(()=>(u.value?.fields??[]).some(le=>c_(le)&&xs(le,"update"))),I=_(()=>{if(!D.value.some(ce=>ce.tab))return[];const le=[];for(const ce of D.value){const F=ma(ce);if(le.some(ve=>ve.key===F))continue;const fe={key:F,label:ce.tab||h("backend::lang.form.tab_default"),errors:0};F===Ft?le.unshift(fe):le.push(fe)}return le}),q=_(()=>Math.max(I.value.findIndex(le=>le.key===k.value),0)),H=_(()=>{if(I.value.length===0)return D.value;const le=I.value[q.value]?.key??Ft;return D.value.filter(ce=>ma(ce)===le)}),E=_(()=>v.value||p_(u.value?.fields,d.value,Il(u.value?.meta))),P=_(()=>Xe(u.value?.messages.preview,void 0,{name:E.value})),j=_(()=>u.value?.preview?.headerPartial??""),O=_(()=>!y.value&&!x.value&&u.value!==null);function N(le){switch(le.span){case"left":return"min-[600px]:col-start-1";case"right":return"min-[600px]:col-start-2";case"auto":case"row":return"";default:return"col-span-full"}}async function Z(){try{const le=await qe.GET("/{vendor}/{plugin}/{controller}/{id}",{params:{path:{...n,id:o}}});return le.data?(d.value={...le.data.data},c.value=le.data.meta.labels??{},f.value=le.data.meta.permissionLocks??{},v.value=le.data.meta.title??"",m.value=le.data.meta.actions??[],!0):!1}catch{return!1}}async function W(){y.value=!0,x.value=!1;const[le,ce]=await Promise.all([qe.GET("/{vendor}/{plugin}/{controller}/schema/form",{params:{path:n}}).catch(()=>null),Z()]),F=le?.data?.data??null;if(F&&!F.preview){await a.replace(i);return}u.value=F,x.value=!F||!ce,F&&wp(r,F.assets),k.value=I.value[0]?.key??Ft,y.value=!1}async function K(){C.value++,await Z()||(x.value=!0)}async function te(le){Pe(le),await K()}function oe(){x.value=!0}const{activeUploads:ye,beginUpload:be}=Ep(),ge=bs();return ht(Rs,{fields:_(()=>D.value),values:_(()=>d.value),path:le=>le}),ht(Ap,_(()=>f.value)),ht(po,{key:ge,recordId:o,routes:le=>L0(n,o,le,ge),markDirty:()=>{},pendingChanges:At(A(0)),revision:At(A(0)),beginUpload:be,activeUploads:At(ye)}),Ea(()=>wf(y.value?"":E.value)),Ot($f),W(),(le,ce)=>(p(),b("section",K7,[g("header",W7,[R(Ke,{variant:"outline","data-action":"back",to:s(l),"aria-label":s(h)("backend::lang.form.return_to_list"),class:"size-10! px-0!"},{default:B(()=>[R(s(oo),{size:18,"aria-hidden":"true"})]),_:1},8,["to","aria-label"]),g("div",G7,[g("h1",Y7,w(y.value?"":E.value),1),O.value&&P.value?(p(),b("p",J7,w(P.value),1)):Y("",!0)]),O.value&&I.value.length>0?(p(),U(Ju,{key:0,modelValue:k.value,"onUpdate:modelValue":ce[0]||(ce[0]=F=>k.value=F),tabs:I.value,"id-prefix":ci},null,8,["modelValue","tabs"])):Y("",!0)]),x.value&&!y.value?(p(),b("p",Z7,w(s(h)("backend::lang.form.load_failed")),1)):O.value?(p(),b(pe,{key:1},[j.value!==""?(p(),U($p,{key:0,variant:"header",hint:"",source:n,name:j.value,"record-id":s(o),"reload-key":C.value},null,8,["name","record-id","reload-key"])):Y("",!0),g("div",{id:I.value.length>0?s(Is)(ci,q.value):void 0,role:I.value.length>0?"tabpanel":void 0,"aria-labelledby":I.value.length>0?s(ro)(ci,q.value):void 0,class:"rounded-card border border-border bg-surface p-7 shadow-card"},[g("dl",Q7,[(p(!0),b(pe,null,De(H.value,F=>(p(),U(K0,{key:F.name,class:me(N(F)),field:F,value:d.value[F.name],labels:c.value?.[F.name],source:n,"record-id":s(o),"id-prefix":ci},null,8,["class","field","value","labels","record-id"]))),128))])],8,X7)],64)):Y("",!0),g("footer",ez,[g("div",tz,[O.value?(p(),U(v_,{key:0,source:n,"record-id":s(o),actions:m.value,disabled:S.value,onBusy:ce[1]||(ce[1]=F=>S.value=F),onDone:te,onStale:K,onGone:oe},null,8,["record-id","actions","disabled"])):Y("",!0),!x.value&&T.value?(p(),U(Ke,{key:1,variant:"primary","data-action":"edit",icon:s(Jo),disabled:y.value||S.value,onClick:ce[2]||(ce[2]=F=>s(a).push(i))},{default:B(()=>[_e(w(s(Xe)(u.value?.messages.edit)),1)]),_:1},8,["icon","disabled"])):Y("",!0)])])]))}}),y_=Symbol("summer.reorder.page");function nz(e){const t=new Map;for(const o of e)t.set(o.id,{id:o.id,name:o.name??"",children:[]});const a=[...e].sort((o,i)=>o.sort_order-i.sort_order||o.id-i.id),n=[];for(const o of a){const i=t.get(o.id),u=o.parent_id??null,d=u!==null?t.get(u):void 0;d&&d!==i?d.children.push(i):n.push(i)}const r=new Set,l=o=>{for(const i of o)r.add(i.id),l(i.children)};l(n);for(const o of a)if(!r.has(o.id)){const i=t.get(o.id);for(const u of t.values())u.children=u.children.filter(d=>d.id!==i.id);n.push(i),l([i])}return n}function rz(e,t=!1){const a=[],n=(r,l)=>{for(const o of r)a.push({id:o.id,parent_id:t?null:l,sort_order:a.length+1}),n(o.children,o.id)};return n(e,null),a}function ql(e){return e.map(t=>({id:t.id,name:t.name,children:ql(t.children)}))}function Mr(e,t,a=null,n=0){for(let r=0;r<e.length;r++){const l=e[r];if(l.id===t)return{node:l,list:e,index:r,parent:a,depth:n};const o=Mr(l.children,t,l,n+1);if(o)return o}return null}function g_(e,t){return e.id===t||e.children.some(a=>g_(a,t))}function b_(e,t,a){const n=Mr(e,t);if(!n)return!1;switch(a){case"up":case"indent":return n.index>0;case"down":return n.index<n.list.length-1;case"outdent":return n.parent!==null}}function lz(e,t,a){if(!b_(e,t,a))return!1;const n=Mr(e,t);switch(a){case"up":return n.list.splice(n.index,1),n.list.splice(n.index-1,0,n.node),!0;case"down":return n.list.splice(n.index,1),n.list.splice(n.index+1,0,n.node),!0;case"indent":{const r=n.list[n.index-1];return n.list.splice(n.index,1),r.children.push(n.node),!0}case"outdent":{const r=Mr(e,n.parent.id);return n.list.splice(n.index,1),r.list.splice(r.index+1,0,n.node),!0}}}function oz(e,t){return t&&e==="inside"?"after":e}function xi(e,t){return!t||e==="up"||e==="down"}function __(e,t,a){const n=Mr(e,t);return!!n&&!g_(n.node,a)}function sz(e,t,a,n){if(!__(e,t,a))return!1;const r=Mr(e,t);r.list.splice(r.index,1);const l=Mr(e,a);return n==="inside"?l.node.children.push(r.node):l.list.splice(n==="before"?l.index:l.index+1,0,r.node),!0}const iz={role:"list",class:"m-0 list-none p-0"},uz=["data-reorder-node","onDragover","onDragleave"],cz=["data-reorder-handle","aria-label","onKeydown","onDragstart"],dz={class:"flex gap-1"},fz=["data-action","aria-label","disabled","onClick"],Jh="inline-flex size-8 shrink-0 items-center justify-center rounded-pager text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",pz=ne({__name:"ReorderBranch",props:{nodes:{},depth:{},flat:{type:Boolean,default:!1}},setup(e){const t=e,a=ct(y_),n=[{move:"up",icon:lb,label:"backend::lang.reorder.move_up",action:"reorder-up"},{move:"down",icon:zn,label:"backend::lang.reorder.move_down",action:"reorder-down"},{move:"outdent",icon:lC,label:"backend::lang.reorder.outdent",action:"reorder-outdent"},{move:"indent",icon:sC,label:"backend::lang.reorder.indent",action:"reorder-indent"}],r=_(()=>n.filter(l=>xi(l.move,t.flat)));return(l,o)=>{const i=Ux("ReorderBranch",!0);return p(),b("ul",iz,[(p(!0),b(pe,null,De(e.nodes,(u,d)=>(p(),b("li",{key:u.id},[g("div",{"data-reorder-node":u.id,class:me([[e.depth===0&&d===0?"":"border-t border-border",s(a).dropTarget.value?.id===u.id&&s(a).dropTarget.value.zone==="inside"?"bg-sel outline-2 -outline-offset-2 outline-primary outline-dashed":"hover:bg-hover",s(a).dragging.value===u.id?"opacity-50":"",s(a).blocked.value===u.id?"cursor-not-allowed":""],"relative flex min-h-row items-center gap-2 pr-4"]),style:ua({paddingInlineStart:`calc(16px + ${e.depth} * 24px)`}),onDragover:c=>s(a).onDragOver(c,u.id),onDragleave:c=>s(a).onDragLeave(u.id),onDrop:o[1]||(o[1]=c=>s(a).onDrop(c))},[s(a).dropTarget.value?.id===u.id&&s(a).dropTarget.value.zone!=="inside"?(p(),b("span",{key:0,"data-reorder-line":"",class:me([s(a).dropTarget.value.zone==="before"?"top-0":"bottom-0","pointer-events-none absolute right-0 h-0.5 bg-primary"]),style:ua({left:`calc(16px + ${e.depth} * 24px)`})},null,6)):Y("",!0),g("button",{type:"button",draggable:"true","data-reorder-handle":u.id,"aria-label":s(h)("backend::lang.reorder.move",{name:s(a).nameOf(u)}),class:me([Jh,"cursor-grab"]),onKeydown:c=>s(a).onHandleKeydown(c,u.id),onDragstart:c=>s(a).onDragStart(c,u.id),onDragend:o[0]||(o[0]=(...c)=>s(a).onDragEnd&&s(a).onDragEnd(...c))},[R(s(Vi),{size:16,"aria-hidden":"true"})],40,cz),g("span",{class:me(["min-w-0 flex-1 [overflow-wrap:anywhere]",u.name===""?"text-muted":""])},w(s(a).nameOf(u)),3),g("div",dz,[(p(!0),b(pe,null,De(r.value,c=>(p(),b("button",{key:c.move,type:"button","data-action":c.action,"aria-label":s(h)(c.label,{name:s(a).nameOf(u)}),disabled:!s(a).canMove(u.id,c.move),class:me(Jh),onClick:f=>s(a).move(u.id,c.move)},[(p(),U(Wt(c.icon),{size:16,"aria-hidden":"true"}))],8,fz))),128))])],46,uz),u.children.length>0?(p(),U(i,{key:0,nodes:u.children,depth:e.depth+1,flat:e.flat},null,8,["nodes","depth","flat"])):Y("",!0)]))),128))])}}}),mz={class:"flex w-full flex-col gap-5"},vz={class:"flex flex-wrap items-center gap-4"},hz={class:"flex min-w-0 flex-1 flex-col"},yz={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},gz={class:"flex items-center gap-4"},bz={"data-reorder-status":"","aria-live":"polite",class:"flex items-center gap-1.5 text-[13px] text-muted"},_z={key:0,class:"flex items-center gap-2 font-semibold"},xz=["value"],kz=["value"],wz={key:0,role:"alert",class:"flex items-center gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},$z={key:1,role:"alert",class:"flex items-center gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},Sz=["aria-busy"],Cz={key:1,"data-reorder-empty":"",class:"flex flex-col items-center gap-2 px-6 py-8 text-center"},Ez={class:"flex size-10 items-center justify-center rounded-full bg-subtle text-muted"},Az={class:"font-semibold"},Tz={class:"max-w-[420px] text-[13px] text-muted"},Oz={class:"sr-only","aria-live":"polite","data-reorder-live":""},Dz=400,Mz=2e3,Pz=ne({__name:"ReorderView",setup(e){const t=ya(),a=_n(),n={vendor:String(t.params.vendor??""),plugin:String(t.params.plugin??""),controller:String(t.params.controller??"")},r=Cs(n),l=Ga(r)??"/",o=A("loading"),i=A(""),u=A(null),d=A(!1),c=A([]);let f=[];const v=A(0),m=A(!1),y=A("");let x=null,S=!1,k=null,C=null,L=null,D=0;const T=_(()=>{const ee=t.query.partition,ae=Number(Array.isArray(ee)?ee[0]:ee);return Number.isInteger(ae)&&ae>0?ae:void 0});async function I(){const ee=++D;o.value="loading";try{const ae=T.value!==void 0?{partition:T.value}:void 0,{data:$,response:M}=await qe.GET("/{vendor}/{plugin}/{controller}/reorder",{params:{path:n,query:ae}});if(ee!==D)return;if(!$){o.value=M.status===403?"forbidden":"failed";return}i.value=$.data.title,u.value=$.data.partition??null,d.value=$.data.flat===!0,c.value=nz($.data.nodes??[]),f=ql(c.value),o.value="ready"}catch{ee===D&&(o.value="failed")}}function q(){m.value=!0,C!==null&&clearTimeout(C),C=setTimeout(()=>{C=null,m.value=!1},Mz)}function H(){x=null;const ee={sent:ql(c.value),partition:u.value?.value??null,generation:D};if(S){k=ee;return}j(ee)}function E(ee){return x!==null||k!==null&&k.generation===ee.generation}function P(ee){if(ee.generation===D){if(E(ee))return;c.value=ql(f)}Pe(h("backend::lang.reorder.failed"),"danger")}async function j(ee){S=!0;const ae={nodes:rz(ee.sent,d.value),partition:ee.partition};m.value=!1,v.value++;try{const{data:$,response:M}=await qe.POST("/{vendor}/{plugin}/{controller}/reorder",{params:{path:n},body:ae}),z=ee.generation===D;if($){z&&(f=ee.sent,E(ee)||q());return}if(M.status===409){z&&(k!==null&&k.generation===ee.generation&&(k=null),Pe(h("backend::lang.reorder.stale"),"danger"),await I());return}P(ee)}catch{P(ee)}finally{v.value--,S=!1;const $=k;k=null,$&&j($)}}function O(){x!==null&&clearTimeout(x),x=setTimeout(H,Dz)}function N(){x!==null&&(clearTimeout(x),H())}function Z(ee){y.value="",L!==null&&clearTimeout(L),L=setTimeout(()=>{L=null,y.value=ee},50)}function W(ee){return ee.name!==""?ee.name:h("backend::lang.reorder.untitled",{id:ee.id})}async function K(ee,ae){O();const $=Mr(c.value,ee);if(!$)return;const M=W($.node);ae==="nested"&&$.parent?Z(h("backend::lang.reorder.nested",{name:M,parent:W($.parent)})):Z(ae==="unnested"?h("backend::lang.reorder.unnested",{name:M,level:$.depth+1}):h("backend::lang.reorder.moved",{name:M,position:$.index+1,total:$.list.length})),await Ue(),document.querySelector(`[data-reorder-handle="${ee}"]`)?.focus()}function te(ee,ae){if(!xi(ae,d.value))return;const $=ql(c.value);lz($,ee,ae)&&(c.value=$,K(ee,ae==="indent"?"nested":ae==="outdent"?"unnested":"moved"))}const oe={ArrowUp:"up",ArrowDown:"down",ArrowRight:"indent",ArrowLeft:"outdent"};function ye(ee,ae){const $=oe[ee.key];$&&xi($,d.value)&&(ee.preventDefault(),te(ae,$))}const be=A(null),ge=A(null),le=A(null);function ce(ee,ae){be.value=ae,ge.value=null,ee.dataTransfer?.setData("text/plain",String(ae)),ee.dataTransfer&&(ee.dataTransfer.effectAllowed="move")}function F(ee,ae){if(be.value===null)return;if(!__(c.value,be.value,ae)){le.value=ae,ge.value=null,ee.dataTransfer&&(ee.dataTransfer.dropEffect="none");return}ee.preventDefault(),le.value=null;const $=ee.currentTarget.getBoundingClientRect(),M=ee.clientY-$.top,z=M<$.height/3?"before":M>$.height*2/3?"after":"inside";ge.value={id:ae,zone:oz(z,d.value)}}function fe(ee){le.value===ee&&(le.value=null)}function ve(ee){const ae=be.value,$=ge.value;if(J(),ae===null||!$)return;ee.preventDefault();const M=ql(c.value);sz(M,ae,$.id,$.zone)&&(c.value=M,K(ae,$.zone==="inside"?"nested":"moved"))}function J(){be.value=null,ge.value=null,le.value=null}ht(y_,{dragging:be,dropTarget:ge,blocked:le,nameOf:W,canMove:(ee,ae)=>xi(ae,d.value)&&b_(c.value,ee,ae),move:te,onHandleKeydown:ye,onDragStart:ce,onDragOver:F,onDragLeave:fe,onDrop:ve,onDragEnd:J});function he(ee){const ae=ee.target.value;N(),a.replace({path:t.path,query:{...t.query,partition:ae}})}Be(T,(ee,ae)=>{ee!==ae&&I()});function G(){a.push(l)}return Fg(()=>(N(),!0)),Ot(()=>{N();for(const ee of[C,L])ee!==null&&clearTimeout(ee);$f()}),Ea(()=>wf(o.value==="ready"?i.value:"")),I(),(ee,ae)=>(p(),b("section",mz,[g("header",vz,[R(Ke,{variant:"outline","data-action":"back","aria-label":s(h)("backend::lang.form.return_to_list"),class:"size-10! px-0!",onClick:G},{default:B(()=>[R(s(oo),{size:18,"aria-hidden":"true"})]),_:1},8,["aria-label"]),g("div",hz,[g("h1",yz,w(i.value),1)]),g("div",gz,[g("p",bz,[v.value>0?(p(),b(pe,{key:0},[R(s(In),{size:14,class:"animate-spin","aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.form.saving")),1)],64)):m.value?(p(),b(pe,{key:1},[_e(w(s(h)("backend::lang.reorder.saved")),1)],64)):Y("",!0)]),u.value?(p(),b("label",_z,[_e(w(u.value.label)+" ",1),g("select",{"data-reorder-partition":"",value:String(u.value.value),class:"h-input w-[240px] appearance-none rounded-control border border-border-strong bg-surface px-3.5 font-normal text-text",onChange:he},[(p(!0),b(pe,null,De(u.value.options,$=>(p(),b("option",{key:$.value,value:String($.value)},w($.label),9,kz))),128))],40,xz)])):Y("",!0)])]),o.value==="failed"?(p(),b("p",wz,[R(s(gt),{size:16,class:"shrink-0","aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.reorder.load_failed")),1)])):o.value==="forbidden"?(p(),b("p",$z,[R(s(gt),{size:16,class:"shrink-0","aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.form.forbidden")),1)])):(p(),b("div",{key:2,"data-reorder-card":"",class:"overflow-hidden rounded-card border border-border bg-surface shadow-card","aria-busy":o.value==="loading"?"true":void 0},[o.value==="loading"?(p(),b(pe,{key:0},De(5,$=>g("div",{key:$,"data-reorder-skeleton":"",class:"flex min-h-row items-center gap-3 border-t border-border px-4 first:border-t-0"},[...ae[0]||(ae[0]=[g("span",{class:"size-5 rounded-[6px] bg-skel"},null,-1),g("span",{class:"h-3 w-48 rounded-[6px] bg-skel"},null,-1)])])),64)):c.value.length===0?(p(),b("div",Cz,[g("span",Ez,[R(s(eb),{size:20,"aria-hidden":"true"})]),g("p",Az,w(s(h)("backend::lang.reorder.empty")),1),g("p",Tz,w(s(h)("backend::lang.reorder.empty_hint")),1)])):(p(),U(pz,{key:2,nodes:c.value,depth:0,flat:d.value,"aria-label":s(h)("backend::lang.reorder.tree"),"data-reorder-tree":""},null,8,["nodes","flat","aria-label"]))],8,Sz)),g("p",Oz,w(y.value),1)]))}}),Rz={class:"flex w-full flex-col gap-5 pb-24"},Iz={class:"flex items-center gap-4"},qz={class:"flex min-w-0 flex-1 flex-col"},Lz={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},Nz={key:0,class:"text-muted"},Bz={key:0,role:"alert",class:"rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},Fz=["id","role","aria-labelledby"],Vz={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex items-center justify-end gap-2.5 border-t border-border bg-surface px-8 py-3.5"},Ro="setting",zz=ne({__name:"SettingsFormView",setup(e){const t=ya(),a=_n(),n=String(t.params.code??""),r=A(null),l=A({}),o=A({}),i=A({}),u=A({}),d=A(!0),c=A(!1),f=A(!1),v=A(Ft);ht(z0,_(()=>u.value)),ht(Ps,_(()=>l.value)),ht(Gu,_(()=>r.value?.meta.locale||La.value));const m=_(()=>(r.value?.fields??[]).filter(P=>xs(P,"update"))),y=_(()=>m.value.map(P=>P.name)),x=_(()=>cs(n)?.label||r.value?.name||n),S=_(()=>cs(n)?.description??""),k=_(()=>{if(!m.value.some(j=>j.tab))return[];const P=[];for(const j of m.value){const O=ma(j);let N=P.find(Z=>Z.key===O);N||(N={key:O,label:j.tab||h("backend::lang.form.tab_default"),errors:0},O===Ft?P.unshift(N):P.push(N)),Xd(o.value,j.name)&&(N.errors+=1)}return P}),C=_(()=>Math.max(k.value.findIndex(P=>P.key===v.value),0)),L=_(()=>{if(k.value.length===0)return m.value;const P=k.value[C.value]?.key??Ft;return m.value.filter(j=>ma(j)===P)});async function D(){const P={path:{code:n}},[j,O]=await Promise.all([qe.GET("/settings/{code}/schema",{params:P}),qe.GET("/settings/{code}",{params:P})]);r.value=j.data?.data??null,l.value={...O.data?.data.data??{}},u.value={...O.data?.data.meta?.secrets??{}},c.value=!j.data||!O.data,d.value=!1,v.value=k.value[0]?.key??Ft}function T(P,j){if(l.value={...l.value,[P]:j},o.value[P]){const O={...o.value};delete O[P],o.value=O}}function I(P,j){const O=Pa(P,j);for(const N of P){if(N.type!=="password")continue;const Z=j[N.name];Z===null?O[N.name]=null:(typeof Z!="string"||Z==="")&&delete O[N.name]}return O}async function q(){if(f.value||!r.value)return!1;f.value=!0;try{const P=await qe.PUT("/settings/{code}",{params:{path:{code:n}},body:I(m.value,l.value)});if(P.data)return o.value={},l.value={...P.data.data.data},u.value={...P.data.data.meta?.secrets??{}},i.value=m_(P.data.data.meta?.notices),Pe(h("backend::lang.settings.saved")),!0;if(P.response.status===422){o.value=Dr(P.error?.error.details);const j=m.value.filter(N=>o.value[N.name]),O=j.find(N=>ma(N)===v.value)??j[0];return O&&k.value.length>0&&(v.value=ma(O)),await Ue(),O&&Nn(Ro,O.name),!1}return Pe(P.error?.error.message||h("backend::lang.form.error_generic"),"danger"),!1}catch{return Pe(h("backend::lang.form.error_generic"),"danger"),!1}finally{f.value=!1}}async function H(){await q()}async function E(){await q()&&await a.push("/settings")}return D(),(P,j)=>(p(),b("section",Rz,[g("header",Iz,[R(Ke,{variant:"outline","data-action":"back",to:"/settings","aria-label":s(h)("backend::lang.settings.back"),class:"size-10! px-0!"},{default:B(()=>[R(s(oo),{size:18,"aria-hidden":"true"})]),_:1},8,["aria-label"]),g("div",qz,[g("h1",Lz,w(x.value),1),S.value?(p(),b("p",Nz,w(S.value),1)):Y("",!0)]),k.value.length>0?(p(),U(Ju,{key:0,modelValue:v.value,"onUpdate:modelValue":j[0]||(j[0]=O=>v.value=O),tabs:k.value,"id-prefix":Ro},null,8,["modelValue","tabs"])):Y("",!0)]),c.value&&!d.value?(p(),b("p",Bz,w(s(h)("backend::lang.form.load_failed")),1)):r.value?(p(),b(pe,{key:1},[R(vo,{errors:o.value,"field-names":y.value},null,8,["errors","field-names"]),g("form",{id:k.value.length>0?s(Is)(Ro,C.value):void 0,role:k.value.length>0?"tabpanel":void 0,"aria-labelledby":k.value.length>0?s(ro)(Ro,C.value):void 0,class:"rounded-card border border-border bg-surface p-7 shadow-card",novalidate:"",onSubmit:yt(H,["prevent"])},[R(mo,{fields:L.value,values:l.value,errors:o.value,notices:i.value,source:null,"id-prefix":Ro,onUpdate:T},null,8,["fields","values","errors","notices"])],40,Fz)],64)):Y("",!0),g("footer",Vz,[R(Ke,{variant:"ghost",to:"/settings"},{default:B(()=>[_e(w(s(h)("backend::lang.form.cancel")),1)]),_:1}),R(Ke,{variant:"outline","data-action":"save-close",hotkey:"mod+enter",title:s(ja)(s(h)("backend::lang.form.save_and_close"),"mod+enter"),disabled:f.value||d.value||!r.value,onClick:E},{default:B(()=>[_e(w(s(h)("backend::lang.form.save_and_close")),1)]),_:1},8,["title","disabled"]),R(Ke,{variant:"primary","data-action":"save",hotkey:"mod+s",title:s(ja)(s(h)("backend::lang.form.save"),"mod+s"),disabled:f.value||d.value||!r.value,onClick:H},{default:B(()=>[_e(w(f.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.form.save")),1)]),_:1},8,["title","disabled"])])]))}}),jz={class:"flex flex-col gap-5"},Uz={class:"text-[26px] font-bold tracking-[-0.02em]"},Hz={key:0,class:"text-muted"},Kz={key:0,class:"text-[13px] font-semibold tracking-[0.02em] text-muted uppercase"},Wz={class:"grid grid-cols-1 gap-3 min-[900px]:grid-cols-2"},Gz=["href","data-settings","onClick"],Yz={class:"flex size-10 shrink-0 items-center justify-center rounded-inner bg-subtle text-muted"},Jz={class:"flex min-w-0 flex-col"},Zz={class:"font-semibold"},Xz={key:0,class:"text-[13px] text-muted"},Qz=ne({__name:"SettingsIndexView",setup(e){return(t,a)=>(p(),b("section",jz,[g("header",null,[g("h1",Uz,w(s(h)("backend::lang.settings.title")),1)]),s(wd).length===0?(p(),b("p",Hz,w(s(h)("backend::lang.settings.empty")),1)):Y("",!0),(p(!0),b(pe,null,De(s(wd),n=>(p(),b("section",{key:n.category,"data-settings-group":"",class:"flex flex-col gap-3"},[n.category?(p(),b("h2",Kz,w(n.category),1)):Y("",!0),g("div",Wz,[(p(!0),b(pe,null,De(n.entries,r=>(p(),U(s(qa),{key:r.code,to:s(Cf)(r),custom:""},{default:B(({href:l,navigate:o})=>[g("a",{href:l,"data-settings":r.code,class:"flex items-start gap-3.5 rounded-card border border-border bg-surface p-5 text-text no-underline shadow-card hover:bg-hover",onClick:o},[g("span",Yz,[(p(),U(Wt(s(Os)(r.icon)),{size:20,"aria-hidden":"true"}))]),g("span",Jz,[g("span",Zz,w(r.label),1),r.description?(p(),b("span",Xz,w(r.description),1)):Y("",!0)])],8,Gz)]),_:2},1032,["to"]))),128))])]))),128))]))}}),ej=["data-account-contribution"],tj={class:"flex flex-col gap-1"},aj={tabindex:"-1",class:"text-[18px] font-bold"},nj={key:0,class:"max-w-[640px] text-[13px] text-muted"},rj={key:0,"data-account-contribution-status":"",class:"font-medium"},lj={key:1,"data-account-contribution-error":"",class:"text-[13px] text-muted"},oj={key:0,role:"list","data-account-items":"",class:"flex flex-col overflow-hidden rounded-inner border border-border"},sj=["data-account-item"],ij={class:"flex min-w-0 flex-1 flex-col gap-1"},uj={class:"font-semibold [overflow-wrap:anywhere]"},cj={key:0,class:"text-[13px] text-muted [overflow-wrap:anywhere]"},dj={key:1,class:"text-[13px] text-muted tabular-nums [overflow-wrap:anywhere]"},fj={key:0,class:"flex flex-wrap gap-2 max-sm:self-start"},pj={key:1,"data-account-items-empty":"",class:"rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},mj={class:"text-[13px] text-muted"},vj=["href"],hj={key:4,class:"flex flex-wrap gap-2.5"},yj=ne({__name:"AccountContributions",props:{confirm:{}},setup(e){const t=e,a=A([]),n=A(""),r=A({});function l(m){if(/[\u0000-\u001f\u007f]/.test(m))return"";if(/^https?:\/\//i.test(m))try{return new URL(m).host!==""?m:""}catch{return""}return m.startsWith("/")&&!m.startsWith("//")&&!m.startsWith("/\\")?m:""}async function o(){try{const m=await qe.GET("/account/contributions");if(m.data){a.value=m.data.data??[];return}Pe(h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}}async function i(m,y){n.value=`${m.name}/${y.name}`;try{const x=await qe.POST("/account/contributions/{name}/actions/{action}",{params:{path:{name:m.name,action:y.name}}});if(x.data){const k=x.data.data;Pe(k.message||h("backend::lang.form.action_done"));const C=l(k.url??"");C&&(r.value={...r.value,[m.name]:C},window.open(C,"_blank","noopener")),await o();return}const S=x.response.status;if(S===409){Pe(h("backend::lang.myaccount.action_stale"),"danger"),await o();return}if(S===403){Pe(x.error?.error.message||h("backend::lang.list.action_forbidden"),"danger");return}Pe(x.error?.error.message||h("backend::lang.extension.action_failed"),"danger")}catch{Pe(h("backend::lang.extension.action_failed"),"danger")}finally{n.value=""}}function u(m){return Array.isArray(m.items)?m.items:null}async function d(m){await Ue(),document.querySelector(`[data-account-contribution="${CSS.escape(m)}"]`)?.querySelector("h2")?.focus()}async function c(m,y,x){n.value=`${m.name}/${y.id}/${x.name}`;try{const S=await qe.POST("/account/contribution-items/{name}/{item}/actions/{action}",{params:{path:{name:m.name,item:y.id,action:x.name}}});if(S.data){const C=S.data.data;Pe(C.message||h("backend::lang.form.action_done"));const L=l(C.url??"");L&&(r.value={...r.value,[m.name]:L},window.open(L,"_blank","noopener")),await o(),await d(m.name);return}const k=S.response.status;if(k===404){Pe(h("backend::lang.myaccount.item_gone"),"danger"),await o(),await d(m.name);return}if(k===409){Pe(h("backend::lang.myaccount.action_stale"),"danger"),await o(),await d(m.name);return}if(k===403){Pe(S.error?.error.message||h("backend::lang.list.action_forbidden"),"danger");return}Pe(S.error?.error.message||h("backend::lang.extension.action_failed"),"danger")}catch{Pe(h("backend::lang.extension.action_failed"),"danger")}finally{n.value=""}}async function f(m,y,x){if(!n.value){if(!x.confirm&&!x.danger){await c(m,y,x);return}await t.confirm.ask({message:x.confirm?qi(x.confirm,{title:y.title}):h("backend::lang.myaccount.action_confirm",{action:x.label}),confirmLabel:x.label,danger:x.danger},()=>c(m,y,x))}}async function v(m,y){if(!n.value){if(!y.confirm&&!y.danger){await i(m,y);return}await t.confirm.ask({message:y.confirm||h("backend::lang.myaccount.action_confirm",{action:y.label}),confirmLabel:y.label,danger:y.danger},()=>i(m,y))}}return $t(()=>{o()}),(m,y)=>(p(!0),b(pe,null,De(a.value,x=>(p(),b("div",{key:x.name,"data-account-contribution":x.name,class:"flex flex-col gap-4 rounded-card border border-border bg-surface p-7 shadow-card"},[g("div",tj,[g("h2",aj,w(x.label),1),x.description?(p(),b("p",nj,w(x.description),1)):Y("",!0)]),x.status?(p(),b("p",rj,w(x.status),1)):Y("",!0),x.error?(p(),b("p",lj,w(s(h)("backend::lang.myaccount.section_error")),1)):u(x)!==null?(p(),b(pe,{key:2},[u(x).length>0?(p(),b("div",oj,[(p(!0),b(pe,null,De(u(x),S=>(p(),b("div",{key:S.id,role:"listitem","data-account-item":S.id,class:"flex items-start justify-between gap-4 border-t border-border px-4 py-3.5 first:border-t-0 max-sm:flex-col"},[g("div",ij,[g("span",uj,w(S.title),1),S.subtitle?(p(),b("span",cj,w(S.subtitle),1)):Y("",!0),(S.meta??[]).length>0?(p(),b("span",dj,w((S.meta??[]).join(" · ")),1)):Y("",!0)]),(x.item_actions??[]).length>0?(p(),b("div",fj,[(p(!0),b(pe,null,De(x.item_actions??[],k=>(p(),U(Ke,{key:k.name,variant:k.danger?"danger":"outline",size:"sm",icon:k.danger?s(nb):void 0,"data-account-item-action":k.name,"aria-label":s(h)("backend::lang.myaccount.item_action_named",{action:k.label,title:S.title}),disabled:n.value!=="",onClick:C=>f(x,S,k)},{default:B(()=>[_e(w(k.label),1)]),_:2},1032,["variant","icon","data-account-item-action","aria-label","disabled","onClick"]))),128))])):Y("",!0)],8,sj))),128))])):(p(),b("div",pj,[g("p",mj,w(x.items_empty||s(h)("backend::lang.myaccount.items_empty")),1)]))],64)):Y("",!0),l(r.value[x.name]??"")?(p(),b("a",{key:3,"data-account-contribution-url":"",href:l(r.value[x.name]??""),target:"_blank",rel:"noopener noreferrer",class:"text-primary underline [overflow-wrap:anywhere]"},w(r.value[x.name]),9,vj)):Y("",!0),x.actions.length>0?(p(),b("div",hj,[(p(!0),b(pe,null,De(x.actions,S=>(p(),U(Ke,{key:S.name,variant:"outline",size:"md","data-account-contribution-action":S.name,disabled:n.value!=="",onClick:k=>v(x,S)},{default:B(()=>[_e(w(S.label),1)]),_:2},1032,["data-account-contribution-action","disabled","onClick"]))),128))])):Y("",!0)],8,ej))),128))}});function ho(e){let t=null,a=null;const n=[];for(const r of e)r.name==="*"?t??=r:r.name==="admin:read"?a??=r:n.push(r);return{fullScope:t,adminReadScope:a,pluginScopes:n}}function gj(e,t,a){const n=new Map;for(const l of e){const o=`${l.plugin_id}\0${l.group}`;let i=n.get(o);if(!i){const u=l.group.trim()||l.plugin_id.trim()||a;i={key:o,pluginId:l.plugin_id,label:u,scopes:[]},n.set(o,i)}i.scopes.push(l)}let r;try{r=new Intl.Collator(t||void 0,{sensitivity:"base"})}catch{r=new Intl.Collator(void 0,{sensitivity:"base"})}return[...n.values()].sort((l,o)=>{const i=r.compare(l.label,o.label);if(i!==0)return i;const u=l.pluginId.localeCompare(o.pluginId);return u!==0?u:l.key.localeCompare(o.key)})}function bj(e,t,a){const n=a.trim().toLowerCase();return n===""?!0:e.name.toLowerCase().includes(n)||e.label.toLowerCase().includes(n)||e.description.toLowerCase().includes(n)||e.plugin_id.toLowerCase().includes(n)||t.toLowerCase().includes(n)}function Qd(e,t){return t.scopes.has(e.name)||t.adminRead&&e.read_only}function _j(e,t,a,n){if(e.length<=3||t<=12)return new Set(e.map(l=>l.key));const r=new Set;for(const l of e)l.scopes.some(o=>Qd(o,a))&&r.add(l.key);return r}function Rp(e,t,a=6){const{adminReadScope:n,pluginScopes:r}=ho(e),l=t.adminRead&&n!==null,o=[];l&&o.push({key:"admin:read",name:"admin:read",label:"admin:read",kind:"admin_read"});const i=[],u=[];for(const y of r)t.scopes.has(y.name)&&(y.read_only?l||u.push(y):i.push(y));for(const y of i)o.push({key:y.name,name:y.name,label:y.label,kind:"write"});for(const y of u)o.push({key:y.name,name:y.name,label:y.label,kind:"read_only"});const d=l?i:[...i,...u],c=new Set;for(const y of d)c.add(y.plugin_id||y.group||y.name);const f=Math.max(0,a),v=o.slice(0,f),m=Math.max(0,o.length-f);return{chips:o,visible:v,overflowCount:m,selectedWriteCount:i.length,selectedPluginCount:d.length,distinctPluginCount:c.size}}function xj(e,t,a){const{fullScope:n,adminReadScope:r,pluginScopes:l}=ho(t);return e==="full"?n?["*"]:[]:e==="read_only"?r?["admin:read"]:[]:a.adminRead&&r?["admin:read",...l.filter(o=>!o.read_only&&a.scopes.has(o.name)).map(o=>o.name)]:l.filter(o=>a.scopes.has(o.name)).map(o=>o.name)}function Zh(e,t){const{fullScope:a,adminReadScope:n,pluginScopes:r}=ho(e);return t==="connect"?n!==null?{tier:"read_only",custom:{adminRead:!1,scopes:new Set}}:r.length>0?{tier:"custom",custom:{adminRead:!1,scopes:new Set(r.map(l=>l.name))}}:a!==null?{tier:"full",custom:{adminRead:!1,scopes:new Set}}:{tier:"read_only",custom:{adminRead:!1,scopes:new Set}}:n!==null?{tier:"read_only",custom:{adminRead:!1,scopes:new Set}}:a!==null?{tier:"full",custom:{adminRead:!1,scopes:new Set}}:{tier:"custom",custom:{adminRead:!1,scopes:new Set}}}const kj=["id"],wj=["aria-labelledby","aria-invalid"],$j={class:"flex flex-wrap items-center gap-1"},Sj={class:"font-semibold text-text"},Cj={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},Ej={"data-scope-all-note":"",class:"flex items-center gap-2 text-[13px] text-muted"},Aj={class:"flex flex-wrap items-center gap-1"},Tj={class:"font-semibold text-text"},Oj={class:"inline-flex h-6 items-center rounded-pill border border-border bg-surface px-2.5 text-[13px] font-semibold whitespace-nowrap text-muted"},Dj={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},Mj={class:"flex flex-wrap items-center justify-between gap-2"},Pj={"data-scope-summary-count":"",class:"text-[13px] text-muted tabular-nums [overflow-wrap:anywhere]"},Rj=["disabled"],Ij={key:0,"data-scope-summary-chips":"",class:"flex flex-wrap gap-2"},qj=["title"],Lj=["data-summary-chip","title"],Nj={class:"truncate"},Bj=["data-summary-chip","title"],Fj={class:"truncate"},Vj=["disabled"],x_=ne({__name:"ScopeAccessControl",props:{catalog:{},availableTiers:{},tier:{},custom:{},disabled:{type:Boolean},invalid:{type:Boolean},idPrefix:{}},emits:["update:tier","customize"],setup(e,{expose:t,emit:a}){const n=e,r=a,l={full:"backend::lang.api_tokens.tier_full",read_only:"backend::lang.api_tokens.tier_read_only",custom:"backend::lang.api_tokens.tier_custom"},o=A(null),i=A(null),u=_(()=>ho(n.catalog)),d=_(()=>u.value.fullScope),c=_(()=>u.value.adminReadScope),f=_(()=>Rp(n.catalog,n.custom)),v=_(()=>n.custom.adminRead&&c.value!==null),m=_(()=>!v.value&&f.value.selectedPluginCount===0?h("backend::lang.api_tokens.scope_summary_empty"):v.value&&f.value.selectedWriteCount===0?h("backend::lang.api_tokens.scope_summary_admin_read_only"):v.value?h("backend::lang.api_tokens.scope_summary_admin_read_plus",{scopes:wa("backend::lang.api_tokens.scope_write_count",f.value.selectedWriteCount),plugins:wa("backend::lang.api_tokens.scope_plugin_count",f.value.distinctPluginCount)}):h("backend::lang.api_tokens.scope_summary_line",{scopes:wa("backend::lang.api_tokens.scope_count",f.value.selectedPluginCount),plugins:wa("backend::lang.api_tokens.scope_plugin_count",f.value.distinctPluginCount)}));function y(S){(S==="full"||S==="read_only"||S==="custom")&&r("update:tier",S)}function x(){if(i.value){i.value.focus();return}const S=o.value?.querySelector('[data-access-tier][data-state="checked"]');if(S){S.focus();return}o.value?.querySelector("[data-access-tier]")?.focus()}return t({focusPrimaryControl:x}),(S,k)=>(p(),b("div",{ref_key:"rootEl",ref:o,class:"flex min-w-0 flex-col gap-1.5"},[g("span",{id:`${e.idPrefix}-access-label`,class:"font-semibold text-text"},w(s(h)("backend::lang.api_tokens.access_level")),9,kj),e.availableTiers.length>1?(p(),U(s(vp),{key:0,"model-value":e.tier,orientation:"horizontal",disabled:e.disabled,"aria-labelledby":`${e.idPrefix}-access-label`,"data-access-tiers":"",class:me([e.availableTiers.length===3?"grid-cols-3":"grid-cols-2","grid gap-1 rounded-inner border border-border bg-subtle p-1"]),"onUpdate:modelValue":y},{default:B(()=>[(p(!0),b(pe,null,De(e.availableTiers,C=>(p(),U(s(hp),{key:C,value:C,"data-access-tier":C,class:"inline-flex min-h-[38px] items-center justify-center rounded-tab px-2 py-2 text-center text-[13px] text-muted transition-colors duration-150 ease-out hover:text-text data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab data-[state=checked]:font-semibold disabled:cursor-not-allowed disabled:opacity-60"},{default:B(()=>[_e(w(s(h)(l[C])),1)]),_:2},1032,["value","data-access-tier"]))),128))]),_:1},8,["model-value","disabled","aria-labelledby","class"])):Y("",!0),g("div",{"data-scope-summary":"",role:"region","aria-labelledby":`${e.idPrefix}-access-label`,"aria-invalid":e.invalid?"true":void 0,class:me([e.invalid?"border-danger":"border-border","flex flex-col gap-2 rounded-inner border bg-subtle p-4"])},[e.tier==="full"&&d.value?(p(),b(pe,{key:0},[g("div",$j,[g("span",Sj,w(d.value.label),1),k[2]||(k[2]=g("span",{class:"font-mono text-[13px] text-muted"},"*",-1))]),g("p",Cj,w(d.value.description),1),g("p",Ej,[R(s(Rr),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.scope_all_includes")),1)])],64)):e.tier==="read_only"&&c.value?(p(),b(pe,{key:1},[g("div",Aj,[g("span",Tj,w(c.value.label),1),k[3]||(k[3]=g("span",{class:"font-mono text-[13px] text-muted"},"admin:read",-1)),g("span",Oj,w(s(h)("backend::lang.api_tokens.read_only")),1)]),g("p",Dj,w(c.value.description),1)],64)):e.tier==="custom"?(p(),b(pe,{key:2},[g("div",Mj,[g("p",Pj,w(m.value),1),g("button",{ref_key:"customizeButton",ref:i,type:"button","data-action":"customize-scopes",disabled:e.disabled,class:"inline-flex h-[38px] shrink-0 items-center justify-center gap-2 rounded-control border border-border-strong bg-surface px-4 text-[14px] font-semibold whitespace-nowrap text-text transition-colors duration-150 ease-out hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:k[0]||(k[0]=C=>r("customize"))},[R(s(bb),{size:16,"aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.scope_customize")),1)],8,Rj)]),f.value.visible.length>0?(p(),b("div",Ij,[(p(!0),b(pe,null,De(f.value.visible,C=>(p(),b(pe,{key:C.key},[C.kind==="admin_read"?(p(),b("span",{key:0,"data-summary-chip":"admin:read",title:c.value?.label,class:"inline-flex h-6 items-center gap-1 rounded-pill border border-border-strong bg-surface px-2 font-mono text-[13px] font-semibold whitespace-nowrap text-text"},[R(s(sn),{size:14,class:"shrink-0 text-muted","aria-hidden":"true"}),k[4]||(k[4]=g("span",null,"admin:read",-1))],8,qj)):C.kind==="write"?(p(),b("span",{key:1,"data-summary-chip":C.name,title:C.name,class:"inline-flex h-6 max-w-full items-center rounded-pill border border-border-strong bg-surface px-2 text-[13px] font-semibold text-text"},[g("span",Nj,w(C.label),1)],8,Lj)):(p(),b("span",{key:2,"data-summary-chip":C.name,title:C.name,class:"inline-flex h-6 max-w-full items-center rounded-pill border border-border bg-surface px-2 text-[13px] font-normal text-muted"},[g("span",Fj,w(C.label),1)],8,Bj))],64))),128)),f.value.overflowCount>0?(p(),b("button",{key:0,type:"button","data-action":"customize-scopes-more",disabled:e.disabled,class:"inline-flex h-6 items-center rounded-pill border border-dashed border-border-strong bg-surface px-2 text-[13px] font-semibold tabular-nums whitespace-nowrap text-text hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60",onClick:k[1]||(k[1]=C=>r("customize"))},w(s(h)("backend::lang.api_tokens.scope_more",{count:f.value.overflowCount})),9,Vj)):Y("",!0)])):Y("",!0)],64)):Y("",!0)],10,wj)],512))}}),zj={"data-scope-picker":"",class:"flex min-h-0 flex-1 flex-col"},jj={class:"flex shrink-0 flex-col gap-2 border-b border-border bg-surface p-4"},Uj={class:"relative flex items-center"},Hj=["aria-label","placeholder"],Kj=["aria-label"],Wj=["aria-label"],Gj=["data-scope-filter","aria-pressed","onClick"],Yj={key:0,"data-admin-read-toggle":"",class:"rounded-inner border border-border bg-subtle px-4 py-2"},Jj={class:"flex min-h-[44px] cursor-pointer items-start gap-3 py-2"},Zj=["checked","disabled"],Xj={class:"flex min-w-0 flex-col"},Qj={class:"flex flex-wrap items-center gap-1"},eU={class:"font-semibold text-text"},tU={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},aU={class:"min-h-0 flex-1 overflow-y-auto p-4"},nU={key:0,"data-scope-picker-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},rU={class:"font-semibold text-text"},lU={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},oU={key:1,class:"flex flex-col gap-2"},sU={class:"flex flex-wrap items-center justify-between gap-2 bg-subtle px-4 py-2"},iU=["aria-expanded","aria-controls","onClick"],uU={class:"font-semibold text-text [overflow-wrap:anywhere]"},cU={class:"flex shrink-0 items-center gap-1"},dU=["disabled","aria-label","onClick"],fU=["disabled","aria-label","onClick"],pU=["disabled","aria-label","onClick"],mU=["id","aria-label"],vU=["data-scope"],hU=["checked","disabled","onChange"],yU={class:"flex min-w-0 flex-1 flex-col"},gU={class:"flex flex-wrap items-center gap-1"},bU={class:"font-semibold text-text [overflow-wrap:anywhere]"},_U={class:"font-mono text-[13px] text-muted [overflow-wrap:anywhere]"},xU={key:0,"data-via-admin-read":"",class:"inline-flex h-6 items-center gap-1 rounded-pill border border-border-strong bg-surface px-2 text-[13px] font-semibold whitespace-nowrap text-muted"},kU={key:1,class:"inline-flex h-6 items-center rounded-pill bg-subtle px-2.5 text-[13px] font-semibold whitespace-nowrap text-muted"},wU={class:"text-[13px] text-muted [overflow-wrap:anywhere]"},$U={class:"flex shrink-0 flex-wrap items-center justify-between gap-2 border-t border-border bg-surface p-4"},SU={"data-scope-picker-summary":"",class:"text-[13px] text-muted tabular-nums","aria-live":"polite"},CU={class:"flex items-center gap-2 max-sm:w-full"},EU=["disabled"],AU=["disabled"],k_=ne({__name:"ScopePicker",props:{catalog:{},draftAdminRead:{type:Boolean},draftScopes:{},cancelLabel:{},disabled:{type:Boolean}},emits:["update:draftAdminRead","update:draftScopes","apply","cancel"],setup(e,{expose:t,emit:a}){const n=e,r=a,l=cf(),o=A(""),i=A("all"),u=A(new Set),d=A(new Set);let c=!1;const f=A(null),v=_(()=>ho(n.catalog)),m=_(()=>v.value.adminReadScope!==null),y=_(()=>v.value.pluginScopes),x=_(()=>n.draftAdminRead&&m.value),S=_(()=>({adminRead:x.value,scopes:n.draftScopes})),k=_(()=>gj(y.value,La.value,h("backend::lang.permissioneditor.other"))),C=_(()=>o.value.trim()!==""),L=_(()=>y.value.length),D=_(()=>y.value.filter(ce=>Qd(ce,S.value)).length),T=_(()=>y.value.filter(ce=>ce.read_only).length),I=_(()=>[{id:"all",label:h("backend::lang.api_tokens.scope_filter_all",{count:L.value})},{id:"selected",label:h("backend::lang.api_tokens.scope_filter_selected",{count:D.value})},{id:"read_only",label:h("backend::lang.api_tokens.scope_filter_read_only",{count:T.value})}]);function q(ce){return x.value&&ce.read_only}function H(ce){return Qd(ce,S.value)}const E=_(()=>{const ce=[];return k.value.forEach((F,fe)=>{const ve=F.scopes.filter($=>!(i.value==="selected"&&!H($)||i.value==="read_only"&&!$.read_only||C.value&&!bj($,F.label,o.value)));if(ve.length===0)return;const J=F.scopes.filter($=>$.read_only),he=J.every($=>n.draftScopes.has($.name)),G=F.scopes.filter($=>!q($)),ee=G.every($=>n.draftScopes.has($.name)),ae=G.filter($=>n.draftScopes.has($.name));ce.push({key:F.key,panelId:`${l}-group-${fe}`,label:F.label,allScopes:F.scopes,visibleScopes:ve,selectedCount:F.scopes.filter($=>H($)).length,canRead:!n.disabled&&!x.value&&J.length>0&&!he,canAll:!n.disabled&&G.length>0&&!ee,canClear:!n.disabled&&ae.length>0})}),ce}),P=_(()=>Rp(n.catalog,S.value)),j=_(()=>x.value||P.value.selectedPluginCount>0),O=_(()=>j.value?x.value&&P.value.selectedWriteCount===0?h("backend::lang.api_tokens.scope_summary_admin_read_only"):x.value?h("backend::lang.api_tokens.scope_picker_selected_admin_read",{scopes:wa("backend::lang.api_tokens.scope_write_count",P.value.selectedWriteCount)}):h("backend::lang.api_tokens.scope_picker_selected",{scopes:wa("backend::lang.api_tokens.scope_count",P.value.selectedPluginCount)}):h("backend::lang.api_tokens.scope_picker_none_selected")),N=_(()=>C.value?{kind:"search",title:h("backend::lang.api_tokens.scope_empty_search_title"),body:h("backend::lang.api_tokens.scope_empty_search_body",{query:o.value.trim()}),actionLabel:h("backend::lang.api_tokens.scope_search_clear")}:i.value==="selected"?{kind:"filter",title:h("backend::lang.api_tokens.scope_empty_selected_title"),body:h("backend::lang.api_tokens.scope_empty_selected_body"),actionLabel:h("backend::lang.api_tokens.scope_filter_reset")}:{kind:"filter",title:h("backend::lang.api_tokens.scope_empty_readonly_title"),body:h("backend::lang.api_tokens.scope_empty_readonly_body"),actionLabel:h("backend::lang.api_tokens.scope_filter_reset")});function Z(ce){return C.value?!d.value.has(ce):u.value.has(ce)}function W(ce){if(C.value){const fe=new Set(d.value);fe.has(ce)?fe.delete(ce):fe.add(ce),d.value=fe;return}const F=new Set(u.value);F.has(ce)?F.delete(ce):F.add(ce),u.value=F}function K(ce,F){const fe=new Set(n.draftScopes);F?fe.add(ce):fe.delete(ce),r("update:draftScopes",fe)}function te(ce){if(!ce.canRead)return;const F=new Set(n.draftScopes);for(const fe of ce.allScopes)fe.read_only&&F.add(fe.name);r("update:draftScopes",F)}function oe(ce){if(!ce.canAll)return;const F=new Set(n.draftScopes);for(const fe of ce.allScopes)q(fe)||F.add(fe.name);r("update:draftScopes",F)}function ye(ce){if(!ce.canClear)return;const F=new Set(n.draftScopes);for(const fe of ce.allScopes)q(fe)||F.delete(fe.name);r("update:draftScopes",F)}function be(){o.value="",Ue(()=>{f.value?.focus()})}function ge(){i.value="all"}function le(){f.value?.focus()}return Be(o,()=>{d.value.size>0&&(d.value=new Set)}),Be(()=>k.value.length,ce=>{!c&&ce>0&&(c=!0,u.value=_j(k.value,y.value.length,S.value))},{immediate:!0}),t({focusSearch:le}),(ce,F)=>(p(),b("div",zj,[g("div",jj,[g("div",Uj,[R(s(fl),{size:16,class:"pointer-events-none absolute left-3 text-muted","aria-hidden":"true"}),ha(g("input",{ref_key:"searchInput",ref:f,"onUpdate:modelValue":F[0]||(F[0]=fe=>o.value=fe),type:"search","data-scope-search":"",autocomplete:"off","aria-label":s(h)("backend::lang.api_tokens.scope_search_label"),placeholder:s(h)("backend::lang.api_tokens.scope_search_placeholder"),class:me([s(It)(!1),"h-input pl-10 pr-10"])},null,10,Hj),[[kr,o.value]]),o.value!==""?(p(),b("button",{key:0,type:"button","data-action":"clear-scope-search","aria-label":s(h)("backend::lang.api_tokens.scope_search_clear"),class:"absolute right-2 flex size-8 items-center justify-center rounded-tab text-muted hover:bg-hover hover:text-text",onClick:be},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,Kj)):Y("",!0)]),g("div",{role:"group","aria-label":s(h)("backend::lang.api_tokens.scope_filter_label"),class:"inline-flex flex-wrap gap-1 self-start rounded-inner border border-border bg-subtle p-1"},[(p(!0),b(pe,null,De(I.value,fe=>(p(),b("button",{key:fe.id,type:"button","data-scope-filter":fe.id,"aria-pressed":i.value===fe.id,class:me([i.value===fe.id?"bg-surface font-semibold text-text shadow-tab":"text-muted hover:text-text","inline-flex h-8 items-center rounded-tab px-4 text-[13px] tabular-nums whitespace-nowrap transition-colors duration-150 ease-out"]),onClick:ve=>i.value=fe.id},w(fe.label),11,Gj))),128))],8,Wj),m.value?(p(),b("div",Yj,[g("label",Jj,[g("input",{type:"checkbox","data-admin-read-checkbox":"",class:"mt-0.5 size-5 shrink-0 rounded-[6px] accent-primary",checked:e.draftAdminRead,disabled:e.disabled,onChange:F[1]||(F[1]=fe=>r("update:draftAdminRead",fe.target.checked))},null,40,Zj),g("span",Xj,[g("span",Qj,[g("span",eU,w(s(h)("backend::lang.api_tokens.scope_also_admin_read")),1),F[4]||(F[4]=g("span",{class:"font-mono text-[13px] text-muted"},"admin:read",-1))]),g("span",tU,w(s(h)("backend::lang.api_tokens.scope_also_admin_read_hint")),1)])])])):Y("",!0)]),g("div",aU,[E.value.length===0?(p(),b("div",nU,[g("p",rU,w(N.value.title),1),g("p",lU,w(N.value.body),1),N.value.kind==="search"?(p(),b("button",{key:0,type:"button","data-action":"reset-scope-search",class:"mt-2 inline-flex h-[38px] items-center justify-center rounded-control border border-border-strong bg-surface px-4 font-semibold text-text transition-colors duration-150 ease-out hover:bg-hover",onClick:be},w(N.value.actionLabel),1)):(p(),b("button",{key:1,type:"button","data-action":"reset-scope-filter",class:"mt-2 inline-flex h-[38px] items-center justify-center rounded-control border border-border-strong bg-surface px-4 font-semibold text-text transition-colors duration-150 ease-out hover:bg-hover",onClick:ge},w(N.value.actionLabel),1))])):(p(),b("div",oU,[(p(!0),b(pe,null,De(E.value,fe=>(p(),b("section",{key:fe.key,"data-scope-group":"",class:"overflow-hidden rounded-inner border border-border bg-surface"},[g("div",sU,[g("button",{type:"button","data-scope-group-toggle":"","aria-expanded":Z(fe.key),"aria-controls":fe.panelId,class:"flex min-h-[38px] min-w-0 flex-1 items-center gap-2 text-left",onClick:ve=>W(fe.key)},[Z(fe.key)?(p(),U(s(zn),{key:0,size:16,class:"shrink-0 text-muted","aria-hidden":"true"})):(p(),U(s(so),{key:1,size:16,class:"shrink-0 text-muted","aria-hidden":"true"})),g("span",uU,w(fe.label),1),g("span",{"data-scope-group-count":"",class:me([fe.selectedCount>0?"border-border-strong text-text":"border-border text-muted","inline-flex h-6 shrink-0 items-center rounded-pill border bg-surface px-2 text-[13px] font-semibold tabular-nums"])},w(fe.selectedCount)+"/"+w(fe.allScopes.length),3)],8,iU),g("div",cU,[g("button",{type:"button","data-group-action":"read",disabled:!fe.canRead,"aria-label":s(h)("backend::lang.api_tokens.group_select_read_named",{group:fe.label}),class:"inline-flex h-8 items-center rounded-tab px-2 text-[13px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",onClick:ve=>te(fe)},w(s(h)("backend::lang.api_tokens.group_select_read")),9,dU),g("button",{type:"button","data-group-action":"all",disabled:!fe.canAll,"aria-label":s(h)("backend::lang.api_tokens.group_select_all_named",{group:fe.label}),class:"inline-flex h-8 items-center rounded-tab px-2 text-[13px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",onClick:ve=>oe(fe)},w(s(h)("backend::lang.api_tokens.group_select_all")),9,fU),g("button",{type:"button","data-group-action":"clear",disabled:!fe.canClear,"aria-label":s(h)("backend::lang.api_tokens.group_clear_named",{group:fe.label}),class:"inline-flex h-8 items-center rounded-tab px-2 text-[13px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-40",onClick:ve=>ye(fe)},w(s(h)("backend::lang.api_tokens.group_clear")),9,pU)])]),ha(g("div",{id:fe.panelId,role:"group","aria-label":fe.label},[(p(!0),b(pe,null,De(fe.visibleScopes,ve=>(p(),b("label",{key:ve.name,"data-scope":ve.name,class:me([q(ve)?"cursor-not-allowed bg-subtle":"cursor-pointer hover:bg-hover","flex min-h-[56px] items-start gap-3 border-t border-border px-4 py-3"])},[g("input",{type:"checkbox",class:"mt-0.5 size-5 shrink-0 rounded-[6px] accent-primary",checked:H(ve),disabled:e.disabled||q(ve),onChange:J=>K(ve.name,J.target.checked)},null,40,hU),g("span",yU,[g("span",gU,[g("span",bU,w(ve.label),1),g("span",_U,w(ve.name),1),ve.read_only&&x.value?(p(),b("span",xU,[R(s(sn),{size:14,"aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.via_admin_read")),1)])):ve.read_only?(p(),b("span",kU,w(s(h)("backend::lang.api_tokens.read_only")),1)):Y("",!0)]),g("span",wU,w(ve.description),1)])],10,vU))),128))],8,mU),[[us,Z(fe.key)]])]))),128))]))]),g("div",$U,[g("p",SU,w(O.value),1),g("div",CU,[g("button",{type:"button","data-action":"scope-picker-discard",disabled:e.disabled,class:"inline-flex h-button items-center justify-center gap-2 rounded-control border border-border-strong bg-surface px-4 font-semibold whitespace-nowrap text-text transition-colors duration-150 ease-out hover:bg-hover disabled:cursor-not-allowed disabled:opacity-60 max-sm:flex-1",onClick:F[2]||(F[2]=fe=>r("cancel"))},w(e.cancelLabel),9,EU),g("button",{type:"button","data-action":"scope-picker-apply",disabled:e.disabled||!j.value,class:"inline-flex h-button items-center justify-center gap-2 rounded-control bg-primary px-4 font-semibold whitespace-nowrap text-on-primary transition-colors duration-150 ease-out hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-60 max-sm:flex-1",onClick:F[3]||(F[3]=fe=>r("apply"))},w(s(h)("backend::lang.api_tokens.scope_picker_apply")),9,AU)])])]))}});function w_(e,t){const a=Zh(e.value,t),n=A(a.tier),r=A(a.custom),l=A(!1),o=A(!1),i=A(new Set);let u=null;const d=_(()=>ho(e.value)),c=_(()=>{const L=[];return d.value.fullScope!==null&&L.push("full"),d.value.adminReadScope!==null&&L.push("read_only"),d.value.pluginScopes.length>0&&L.push("custom"),L}),f=_(()=>xj(n.value,e.value,r.value)),v=_(()=>Rp(e.value,r.value)),m=_(()=>f.value.length>0);function y(L){const D=Zh(L??e.value,t);n.value=D.tier,r.value=D.custom,l.value=!1,o.value=!1,i.value=new Set,u=null}function x(){o.value=r.value.adminRead,i.value=new Set(r.value.scopes),l.value=!0}function S(L){if(L===n.value||!c.value.includes(L))return;const D=n.value;n.value=L,L==="custom"&&!r.value.adminRead&&r.value.scopes.size===0&&(u=D,x())}function k(){r.value={adminRead:o.value,scopes:new Set(i.value)},n.value="custom",u=null,l.value=!1}function C(){o.value=r.value.adminRead,i.value=new Set(r.value.scopes),l.value=!1,u!==null&&(n.value=u,u=null)}return{availableTiers:c,tier:n,custom:r,pickerOpen:l,draftAdminRead:o,draftScopes:i,submittedScopes:f,summary:v,canSubmitScopes:m,reset:y,selectTier:S,openPicker:x,applyPicker:k,discardPicker:C}}const TU={class:"flex shrink-0 items-start gap-4 border-b border-border bg-surface p-4"},OU={class:"flex min-w-0 flex-1 flex-col gap-1"},DU=["disabled"],MU=["disabled","aria-label"],PU={key:1,class:"flex min-h-0 flex-1 flex-col gap-4 p-6"},RU={class:"flex items-start gap-3"},IU={class:"flex min-w-0 flex-1 flex-col gap-1"},qU=["disabled","aria-label"],LU=["disabled"],NU={class:"flex min-w-0 flex-col gap-1.5","data-field":"name"},BU=["for"],FU=["id","placeholder","aria-invalid","aria-describedby"],VU=["id"],zU=["id"],jU={class:"flex min-w-0 flex-col gap-1.5","data-field":"expires"},UU={id:"api-token-expires-label",class:"font-semibold"},HU={class:"text-[13px] text-muted tabular-nums"},KU={class:"flex min-w-0 flex-col gap-1.5","data-field":"scopes"},WU={id:"api-token-scopes-label",class:"font-semibold"},GU={id:"api-token-scopes-label",class:"font-semibold"},YU={role:"alert",class:"flex items-start gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},JU=["id"],ZU={class:"flex gap-2.5"},XU={key:1,class:"flex min-h-0 flex-col gap-4"},QU={class:"flex min-w-0 flex-col gap-2"},eH=["for"],tH=["id","value"],aH={class:"flex flex-wrap items-center gap-2"},nH={key:0,role:"alert",class:"flex items-center gap-1.5 text-[13px] text-danger"},rH={class:"sr-only","aria-live":"polite"},lH={class:"flex justify-end"},Fa="api-token",oH=ne({__name:"ApiTokenCreateDialog",props:{open:{type:Boolean},confirm:{}},emits:["update:open","created","closed"],setup(e,{emit:t}){const a=e,n=t,r=[{value:"30d",label:"backend::lang.api_tokens.expires_30"},{value:"90d",label:"backend::lang.api_tokens.expires_90"},{value:"365d",label:"backend::lang.api_tokens.expires_365"},{value:"never",label:"backend::lang.api_tokens.expires_never"}],l=A(1),o=A(""),i=A("90d"),u=A([]),d=A(!1),c=A(!1),f=A(!1),v=A({}),m=A(""),y=A(!1),x=A(!1),S=A(!1),k=A("");let C=null,L=0;const D=A(null),T=A(null),I=A(null),q=A(null),H=A(null),{availableTiers:E,tier:P,custom:j,pickerOpen:O,draftAdminRead:N,draftScopes:Z,submittedScopes:W,canSubmitScopes:K,reset:te,selectTier:oe,openPicker:ye,applyPicker:be,discardPicker:ge}=w_(u,"token"),le=_(()=>!d.value&&!c.value&&u.value.length>0&&K.value&&!f.value);function ce(Ie){return String(Ie).padStart(2,"0")}function F(Ie){const Qe=new Date;return Qe.setDate(Qe.getDate()+Ie),`${Qe.getFullYear()}-${ce(Qe.getMonth()+1)}-${ce(Qe.getDate())}`}const fe=_(()=>{if(i.value==="never")return h("backend::lang.api_tokens.expires_never_note");const Ie=i.value==="30d"?30:i.value==="365d"?365:90;return h("backend::lang.api_tokens.expires_on",{date:F(Ie)})});function ve(){m.value="",y.value=!1,x.value=!1,S.value=!1,k.value="",C!==null&&(clearTimeout(C),C=null)}function J(){l.value=1,o.value="",i.value="90d",te([]),v.value={},f.value=!1,c.value=!1,ve()}function he(Ie){n("update:open",Ie)}async function G(){const Ie=++L;d.value=!0,c.value=!1,u.value=[],te([]);try{const Qe=await qe.GET("/account/tokens/scopes");if(Ie!==L||!a.open)return;if(Qe.data){const ot=Qe.data.data??[];u.value=ot,te(ot),c.value=ot.length===0;return}c.value=!0}catch{if(Ie!==L||!a.open)return;c.value=!0}finally{Ie===L&&(d.value=!1)}}Be(()=>a.open,Ie=>{Ie?(J(),G()):(L+=1,d.value=!1,c.value=!1,u.value=[],ve(),te([]),l.value=1)});function ee(){if(v.value.scopes){const Ie={...v.value};delete Ie.scopes,v.value=Ie}}async function ae(Ie){if(f.value)return;const Qe=O.value;oe(Ie),ee(),!Qe&&O.value&&(await Ue(),H.value?.focusSearch())}async function $(){f.value||(ye(),await Ue(),H.value?.focusSearch())}async function M(){be(),ee(),await Ue(),q.value?.focusPrimaryControl()}async function z(){ge(),await Ue(),q.value?.focusPrimaryControl()}function de(){const Ie=[`${Fa}-name-comment`,v.value.name?`${Fa}-name-error`:""].filter(Boolean);return Ie.length?Ie.join(" "):void 0}async function X(){if(await Ue(),v.value.name){Nn(Fa,"name");return}if(v.value.scopes){q.value?.focusPrimaryControl();return}v.value.expires&&document.querySelector("[data-expiry-segment]")?.focus()}async function se(){if(f.value||!le.value||l.value!==1||O.value)return;f.value=!0,v.value={};let Ie=!1;try{const Qe=await qe.POST("/account/tokens",{body:{name:o.value,expires:i.value,scopes:W.value}});if(Qe.data){m.value=Qe.data.data.token,l.value=2,n("created"),await Ue(),I.value?.querySelector("button")?.focus()??I.value?.focus();return}Qe.response.status===422?(v.value=Dr(Qe.error?.error.details),Ie=!0):Pe(h("backend::lang.api_tokens.create_failed"),"danger")}catch{Pe(h("backend::lang.api_tokens.create_failed"),"danger")}finally{f.value=!1}Ie&&await X()}function xe(){y.value=!0,x.value=!1,S.value=!0,k.value=h("backend::lang.api_tokens.copied_announce"),C!==null&&clearTimeout(C),C=setTimeout(()=>{S.value=!1,C=null},2e3)}async function $e(){const Ie=m.value;if(Ie)try{if(!navigator.clipboard?.writeText)throw new Error("clipboard unavailable");await navigator.clipboard.writeText(Ie),xe()}catch{x.value=!0,await Ue(),T.value?.focus(),T.value?.select()}}function Ce(){xe()}function ie(Ie){Ie.target.select()}async function Ee(){ve(),te([]),he(!1)}async function we(){f.value||l.value===2&&m.value&&!y.value&&!await a.confirm.ask({message:h("backend::lang.api_tokens.close_uncopied_confirm"),confirmLabel:h("backend::lang.api_tokens.close_uncopied_submit"),danger:!0})||await Ee()}function Le(Ie){if(!Ie){we();return}he(!0)}function Ve(Ie){if(Ie.preventDefault(),l.value===2){I.value?.querySelector("button")?.focus()??I.value?.focus();return}if(O.value){H.value?.focusSearch();return}D.value?.focus()}function We(Ie){Ie.preventDefault(),n("closed")}function tt(Ie){(l.value===2||f.value)&&Ie.preventDefault()}function at(Ie){if(f.value){Ie.preventDefault();return}if(l.value===1&&O.value){Ie.preventDefault(),z();return}l.value===2&&(Ie.preventDefault(),we())}function st(){Ee()}return Ot(()=>{L+=1,ve()}),(Ie,Qe)=>(p(),U(s(Jn),{open:e.open,"onUpdate:open":Le},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-token-dialog":"","data-dialog-content":"","aria-modal":"true",class:"fixed top-1/2 left-1/2 z-50 flex max-h-[calc(100vh-32px)] w-[calc(100%-32px)] max-w-[560px] -translate-x-1/2 -translate-y-1/2 flex-col overflow-hidden rounded-modal bg-surface text-text shadow-pop",onOpenAutoFocus:Ve,onCloseAutoFocus:We,onPointerDownOutside:tt,onInteractOutside:tt,onEscapeKeyDown:at},{default:B(()=>[l.value===1&&s(O)?(p(),b(pe,{key:0},[g("div",TU,[g("div",OU,[g("button",{type:"button","data-action":"scope-picker-back",disabled:f.value,class:"inline-flex h-[34px] self-start items-center gap-1 rounded-tab px-2 text-[14px] font-semibold text-muted transition-colors duration-150 ease-out hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-60",onClick:z},[R(s(oo),{size:16,"aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.scope_picker_back")),1)],8,DU),R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.scope_picker_title")),1)]),_:1}),R(s(pn),{class:"text-[13px] text-muted"},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.scope_picker_description")),1)]),_:1})]),g("button",{type:"button","data-action":"close",disabled:f.value,"aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-60",onClick:we},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,MU)]),R(k_,{ref_key:"scopePickerRef",ref:H,catalog:u.value,"draft-admin-read":s(N),"onUpdate:draftAdminRead":Qe[0]||(Qe[0]=ot=>wt(N)?N.value=ot:null),"draft-scopes":s(Z),"onUpdate:draftScopes":Qe[1]||(Qe[1]=ot=>wt(Z)?Z.value=ot:null),"cancel-label":s(h)("backend::lang.api_tokens.scope_picker_back"),disabled:f.value,onApply:M,onCancel:z},null,8,["catalog","draft-admin-read","draft-scopes","cancel-label","disabled"])],64)):(p(),b("div",PU,[g("div",RU,[g("div",IU,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em]"},{default:B(()=>[_e(w(l.value===1?s(h)("backend::lang.api_tokens.create_title"):s(h)("backend::lang.api_tokens.created_title")),1)]),_:1}),l.value===1?(p(),U(s(pn),{key:0,class:"text-muted"},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.create_description")),1)]),_:1})):(p(),U(s(pn),{key:1,"data-token-notice":"",role:"note",class:"flex items-start gap-2 rounded-inner bg-sel px-4 py-3.5 text-text"},{default:B(()=>[R(s(zi),{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.created_notice")),1)]),_:1}))]),g("button",{type:"button","data-action":"close",disabled:f.value,"aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text disabled:cursor-not-allowed disabled:opacity-60",onClick:we},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,qU)]),l.value===1?(p(),b("form",{key:0,novalidate:"",class:"flex min-h-0 flex-col gap-4",onSubmit:yt(se,["prevent"])},[g("fieldset",{disabled:f.value,class:"flex min-h-0 flex-col gap-[18px] overflow-y-auto"},[g("div",NU,[g("label",{for:`${Fa}-name`,class:"font-semibold"},w(s(h)("backend::lang.api_tokens.name")),9,BU),ha(g("input",{id:`${Fa}-name`,ref_key:"nameInput",ref:D,"onUpdate:modelValue":Qe[2]||(Qe[2]=ot=>o.value=ot),name:"name",type:"text",maxlength:"100",autocomplete:"off",placeholder:s(h)("backend::lang.api_tokens.name_placeholder"),"aria-invalid":v.value.name?"true":void 0,"aria-describedby":de(),class:me([s(It)(!!v.value.name),"h-input"])},null,10,FU),[[kr,o.value]]),g("p",{id:`${Fa}-name-comment`,class:"text-[13px] text-muted"},w(s(h)("backend::lang.api_tokens.name_comment")),9,VU),v.value.name?(p(),b("div",{key:0,id:`${Fa}-name-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(p(!0),b(pe,null,De(v.value.name,(ot,Mt)=>(p(),b("p",{key:Mt,class:"flex items-center gap-1.5"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(ot),1)]))),128))],8,zU)):Y("",!0)]),g("div",jU,[g("span",UU,w(s(h)("backend::lang.api_tokens.expires")),1),R(s(vp),{modelValue:i.value,"onUpdate:modelValue":Qe[3]||(Qe[3]=ot=>i.value=ot),orientation:"horizontal","aria-labelledby":"api-token-expires-label",class:"inline-flex flex-wrap gap-1 rounded-inner border border-border bg-subtle p-1"},{default:B(()=>[(p(),b(pe,null,De(r,ot=>R(s(hp),{key:ot.value,value:ot.value,"data-expiry-segment":"",class:"inline-flex h-pager items-center rounded-tab px-4 text-[13px] whitespace-nowrap text-muted transition-colors duration-150 ease-out hover:text-text data-[state=checked]:bg-surface data-[state=checked]:text-text data-[state=checked]:shadow-tab data-[state=checked]:text-[14px] data-[state=checked]:font-semibold"},{default:B(()=>[_e(w(s(h)(ot.label)),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"]),g("p",HU,w(fe.value),1)]),g("div",KU,[d.value?(p(),b(pe,{key:0},[g("span",WU,w(s(h)("backend::lang.api_tokens.access_level")),1),Qe[4]||(Qe[4]=g("div",{role:"group","aria-labelledby":"api-token-scopes-label","data-scope-loading":"",class:"flex flex-col gap-2","aria-hidden":"true"},[g("span",{class:"h-10 rounded-inner bg-skel"}),g("div",{class:"flex flex-col gap-2 rounded-inner border border-border bg-subtle p-4"},[g("span",{class:"h-3 w-48 rounded-[6px] bg-skel"}),g("span",{class:"h-3 w-32 rounded-[6px] bg-skel"})])],-1))],64)):c.value?(p(),b(pe,{key:1},[g("span",GU,w(s(h)("backend::lang.api_tokens.access_level")),1),g("div",YU,[R(s(gt),{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.scopes_failed")),1)])],64)):(p(),U(x_,{key:2,ref_key:"scopeAccessRef",ref:q,"id-prefix":Fa,catalog:u.value,"available-tiers":s(E),tier:s(P),custom:s(j),disabled:f.value,invalid:!!v.value.scopes,"onUpdate:tier":ae,onCustomize:$},null,8,["catalog","available-tiers","tier","custom","disabled","invalid"])),v.value.scopes?(p(),b("div",{key:3,id:`${Fa}-scopes-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(p(!0),b(pe,null,De(v.value.scopes,(ot,Mt)=>(p(),b("p",{key:Mt,class:"flex items-center gap-1.5"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(ot),1)]))),128))],8,JU)):Y("",!0)])],8,LU),g("div",ZU,[R(Ke,{variant:"outline",class:"flex-1","data-action":"create-token-cancel",disabled:f.value,onClick:we},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.create_cancel")),1)]),_:1},8,["disabled"]),R(Ke,{variant:"primary",type:"submit",class:"flex-1","data-action":"create-token-submit",hotkey:"mod+s mod+enter",title:s(ja)(s(h)("backend::lang.api_tokens.create_submit"),"mod+s"),disabled:!le.value},{default:B(()=>[f.value?(p(),U(s(In),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),_e(" "+w(f.value?s(h)("backend::lang.api_tokens.creating"):s(h)("backend::lang.api_tokens.create_submit")),1)]),_:1},8,["title","disabled"])])],32)):(p(),b("div",XU,[g("div",QU,[g("label",{for:`${Fa}-plaintext`,class:"sr-only"},w(s(h)("backend::lang.api_tokens.token_label")),9,eH),g("input",{id:`${Fa}-plaintext`,ref_key:"plaintextInput",ref:T,value:m.value,type:"text",readonly:"",autocomplete:"off",spellcheck:"false","data-token-plaintext":"",class:me([s(It)(!1),"h-input bg-subtle font-mono text-[14px]"]),onFocus:ie,onClick:ie,onCopy:Ce},null,42,tH),g("div",aH,[g("span",{ref_key:"copyButton",ref:I},[R(Ke,{variant:"outline",size:"sm",icon:S.value?s(Na):s(Fi),"data-action":"copy-token",onClick:$e},{default:B(()=>[_e(w(S.value?s(h)("backend::lang.api_tokens.copied"):s(h)("backend::lang.api_tokens.copy")),1)]),_:1},8,["icon"])],512),x.value?(p(),b("p",nH,[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.copy_failed")),1)])):Y("",!0),g("span",rH,w(k.value),1)])]),g("div",lH,[R(Ke,{variant:"primary","data-action":"hide-token",onClick:st},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.done")),1)]),_:1})])]))]))]),_:1})]),_:1})]),_:1},8,["open"]))}}),sH={"data-api-tokens":"",class:"flex flex-col gap-4 rounded-card border border-border bg-surface p-7 shadow-card"},iH={class:"flex flex-wrap items-start justify-between gap-4"},uH={class:"flex min-w-0 flex-col gap-1"},cH={class:"text-[18px] font-bold"},dH={class:"max-w-[640px] text-[13px] text-muted"},fH={key:0,class:"flex items-center gap-2"},pH=["checked"],mH={key:1,role:"list","data-token-list":"","aria-busy":"true",class:"flex flex-col overflow-hidden rounded-inner border border-border"},vH={key:2,role:"alert","data-tokens-error":"",class:"flex items-start gap-2 rounded-inner bg-danger-soft px-[18px] py-3.5 text-danger"},hH={key:3,"data-tokens-empty":"",class:"flex flex-col items-center gap-2 rounded-inner border border-dashed border-border-strong px-6 py-8 text-center"},yH={class:"flex size-10 items-center justify-center rounded-full bg-subtle text-muted"},gH={class:"font-semibold"},bH={class:"max-w-[420px] text-[13px] text-muted"},_H={key:4,role:"list","data-token-list":"",class:"flex flex-col overflow-hidden rounded-inner border border-border"},xH=["data-token-row"],kH={class:"flex min-w-0 flex-1 flex-col gap-2"},wH={class:"flex flex-wrap items-center gap-2"},$H=["aria-label"],SH={key:0,class:"inline-flex h-6 items-center rounded-pill bg-danger-soft px-2.5 text-[13px] font-semibold whitespace-nowrap text-danger"},CH={key:1,class:"inline-flex h-6 items-center rounded-pill border border-border-strong px-2.5 text-[13px] font-semibold whitespace-nowrap text-muted"},EH={"data-token-scopes":"",class:"flex flex-wrap gap-2"},AH=["title"],TH=ne({__name:"ApiTokensPanel",props:{confirm:{}},setup(e){const t=e,a=A([]),n=A(!0),r=A(!0),l=A(!1),o=A(!1),i=A(!1),u=A(null);function d(T){return String(T).padStart(2,"0")}function c(T){return typeof T=="string"&&T!==""}function f(T){const I=new Date(T);return Number.isNaN(I.getTime())?T:`${I.getFullYear()}-${d(I.getMonth()+1)}-${d(I.getDate())}`}function v(T){const I=new Date(T);return Number.isNaN(I.getTime())?T:`${f(T)} ${d(I.getHours())}:${d(I.getMinutes())}`}function m(T){const I=[h("backend::lang.api_tokens.created_at",{date:f(T.created_at)})];return c(T.last_used_at)?I.push(h("backend::lang.api_tokens.last_used",{date:v(T.last_used_at)})):I.push(h("backend::lang.api_tokens.never_used")),T.expired&&c(T.expires_at)?I.push(h("backend::lang.api_tokens.expired_at",{date:f(T.expires_at)})):c(T.expires_at)?I.push(h("backend::lang.api_tokens.expires_at",{date:f(T.expires_at)})):I.push(h("backend::lang.api_tokens.no_expiry")),c(T.revoked_at)&&I.push(h("backend::lang.api_tokens.revoked_at",{date:v(T.revoked_at)})),I.join(" · ")}function y(T){return c(T.revoked_at)}async function x(){n.value=!0,l.value=!1;try{const T=await qe.GET("/account/tokens",{params:{query:o.value?{revoked:"1"}:{}}});if(T.data){a.value=T.data.data??[];return}l.value=!0,a.value=[]}catch{l.value=!0,a.value=[]}finally{n.value=!1,r.value=!1}}function S(T){o.value=T.target.checked,x()}function k(){i.value=!0}async function C(){await Ue(),u.value?.querySelector("button")?.focus()??u.value?.focus()}async function L(){await x()}async function D(T){await t.confirm.ask({message:h("backend::lang.api_tokens.revoke_confirm",{name:T.name}),confirmLabel:h("backend::lang.api_tokens.revoke_submit"),danger:!0},async()=>{const I=await qe.DELETE("/account/tokens/{id}",{params:{path:{id:T.id}}});if(I.data){await x(),Pe(h("backend::lang.api_tokens.revoked")),await Ue(),u.value?.querySelector("button")?.focus()??u.value?.focus();return}if(I.response.status===404){Pe(h("backend::lang.api_tokens.gone"),"danger"),await x();return}Pe(h("backend::lang.api_tokens.revoke_failed"),"danger")})}return $t(()=>{x()}),(T,I)=>(p(),b("div",sH,[g("div",iH,[g("div",uH,[g("h2",cH,w(s(h)("backend::lang.api_tokens.section")),1),g("p",dH,w(s(h)("backend::lang.api_tokens.section_comment")),1)]),g("span",{ref_key:"createButton",ref:u},[R(Ke,{variant:"outline",size:"sm",icon:s(As),"data-action":"create-token",disabled:r.value&&n.value,onClick:k},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.create")),1)]),_:1},8,["icon","disabled"])],512)]),!l.value&&!r.value?(p(),b("label",fH,[g("input",{type:"checkbox","data-show-revoked":"",class:"size-5 shrink-0 rounded-[6px] accent-primary",checked:o.value,onChange:S},null,40,pH),g("span",null,w(s(h)("backend::lang.api_tokens.show_revoked")),1)])):Y("",!0),n.value?(p(),b("div",mH,[(p(),b(pe,null,De(3,q=>g("div",{key:q,role:"listitem",class:"flex flex-col gap-2 border-t border-border px-4 py-3.5 first:border-t-0","aria-hidden":"true"},[...I[1]||(I[1]=[g("span",{class:"h-3 w-40 rounded-[6px] bg-skel"},null,-1),g("span",{class:"h-3 w-64 rounded-[6px] bg-skel"},null,-1)])])),64))])):l.value?(p(),b("div",vH,[R(s(gt),{size:16,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.load_failed")),1)])):a.value.length===0?(p(),b("div",hH,[g("span",yH,[R(s(US),{size:20,"aria-hidden":"true"})]),g("p",gH,w(s(h)("backend::lang.api_tokens.empty_title")),1),g("p",bH,w(s(h)("backend::lang.api_tokens.empty_body")),1)])):(p(),b("div",_H,[(p(!0),b(pe,null,De(a.value,q=>(p(),b("div",{key:q.id,role:"listitem","data-token-row":q.id,class:"flex items-start justify-between gap-4 border-t border-border px-4 py-3.5 first:border-t-0 max-sm:flex-col"},[g("div",kH,[g("div",wH,[g("span",{class:me([y(q)?"text-muted":"text-text","font-semibold [overflow-wrap:anywhere]"])},w(q.name),3),g("span",{class:"font-mono text-[13px] text-muted","aria-label":s(h)("backend::lang.api_tokens.hint",{last4:q.hint})},"g15_…"+w(q.hint),9,$H),q.expired&&!y(q)?(p(),b("span",SH,w(s(h)("backend::lang.api_tokens.state_expired")),1)):Y("",!0),y(q)?(p(),b("span",CH,w(s(h)("backend::lang.api_tokens.state_revoked")),1)):Y("",!0)]),g("div",EH,[(p(!0),b(pe,null,De(q.scopes,H=>(p(),b("span",{key:H.name,title:H.known?H.name:s(h)("backend::lang.api_tokens.unknown_scope_hint"),class:me([H.known?"bg-subtle text-text":"border border-dashed border-border-strong font-mono text-muted","inline-flex h-6 items-center rounded-pill px-2.5 text-[13px] font-semibold whitespace-nowrap"])},w(H.known?H.name==="*"?s(h)("backend::lang.api_tokens.scope_all"):H.label:s(h)("backend::lang.api_tokens.unknown_scope",{name:H.name})),11,AH))),128))]),g("p",{class:me([(y(q),"text-muted"),"text-[13px] tabular-nums"])},w(m(q)),3)]),y(q)?Y("",!0):(p(),U(Ke,{key:0,variant:"danger",size:"sm",icon:s(nb),"data-action":"revoke-token",class:"max-sm:self-start","aria-label":s(h)("backend::lang.api_tokens.revoke_named",{name:q.name}),onClick:H=>D(q)},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.revoke")),1)]),_:1},8,["icon","aria-label","onClick"]))],8,xH))),128))])),R(oH,{open:i.value,"onUpdate:open":I[0]||(I[0]=q=>i.value=q),confirm:e.confirm,onCreated:L,onClosed:C},null,8,["open","confirm"])]))}}),OH={class:"flex w-full flex-col gap-5 pb-24","data-account":""},DH={class:"flex min-w-0 flex-col"},MH={class:"truncate text-[24px] font-bold tracking-[-0.02em]"},PH={class:"text-muted"},RH={class:"flex flex-col gap-3 rounded-card border border-border bg-surface p-7 shadow-card","data-account-avatar":""},IH={class:"text-[18px] font-bold"},qH={class:"flex flex-wrap items-center gap-5"},LH=["src"],NH={key:1,"aria-hidden":"true","data-account-avatar-initials":"",class:"flex size-20 shrink-0 items-center justify-center rounded-full bg-accent text-[26px] font-bold text-on-accent"},BH={class:"flex flex-col gap-2"},FH={class:"flex flex-wrap gap-2.5"},VH={class:"text-[13px] text-muted"},zH={key:0,role:"alert","data-avatar-error":"",class:"flex flex-col gap-0.5 text-[13px] text-danger"},jH={class:"flex flex-col gap-[18px]"},UH={class:"mb-[18px] text-[18px] font-bold"},HH={class:"flex min-w-0 flex-col gap-1.5"},KH=["for"],WH=["id","value"],GH={class:"grid grid-cols-1 gap-[18px] md:grid-cols-2"},YH=["data-field"],JH=["for"],ZH=["id","name","type","autocomplete","value","aria-invalid","aria-describedby","onInput"],XH=["id"],QH=["id"],eK={class:"flex flex-col gap-[18px]"},tK={class:"mb-1.5 text-[18px] font-bold"},aK={class:"text-[13px] text-muted"},nK={class:"grid grid-cols-1 gap-[18px] md:grid-cols-3"},rK=["data-field"],lK=["for"],oK=["id","name","autocomplete","value","aria-invalid","aria-describedby","onInput"],sK=["id"],iK={class:"fixed right-0 bottom-0 left-[var(--shell-offset,0px)] z-30 flex items-center justify-end gap-2.5 border-t border-border bg-surface px-8 py-3.5"},Xh="account",uK="image/jpeg,image/png,image/gif,image/webp",cK=ne({__name:"AccountView",setup(e){const t=[{name:"first_name",label:"backend::lang.myaccount.first_name",type:"text",autocomplete:"given-name"},{name:"last_name",label:"backend::lang.myaccount.last_name",type:"text",autocomplete:"family-name"},{name:"email",label:"backend::lang.myaccount.email",type:"email",autocomplete:"email"},{name:"subtitle",label:"backend::lang.myaccount.subtitle",type:"text",autocomplete:"organization-title",comment:"backend::lang.myaccount.subtitle_comment"}],a=[{name:"current_password",label:"backend::lang.myaccount.current_password",type:"password",autocomplete:"current-password"},{name:"password",label:"backend::lang.myaccount.password",type:"password",autocomplete:"new-password"},{name:"password_confirmation",label:"backend::lang.myaccount.password_confirmation",type:"password",autocomplete:"new-password"}],n=[...t,...a].map(P=>P.name);function r(){const P=ta.value;return{first_name:P?.first_name??"",last_name:P?.last_name??"",email:P?.email??"",subtitle:P?.subtitle??""}}const l=A(r()),o=A({current_password:"",password:"",password_confirmation:""}),i=A({}),u=A(!1),d=_(()=>ta.value?.login??""),c=A(null),f=A(!1),v=A([]),m=_(()=>ta.value?.avatar?.thumb_url||ta.value?.avatar?.url||""),y=_(()=>c0(ta.value)),x=Fr();function S(){c.value?.click()}async function k(P){const j=P.target,O=j.files?.[0];if(j.value="",!(!O||f.value)){f.value=!0,v.value=[];try{const N=await qe.POST("/account/avatar",{body:{file_data:""},bodySerializer:()=>{const Z=new FormData;return Z.append("file_data",O,O.name),Z}});if(N.data){zc(N.data.data),Pe(h("backend::lang.myaccount.avatar_saved"));return}if(N.response.status===422){const Z=Dr(N.error?.error.details);v.value=Z.avatar??Object.values(Z).flat();return}if(N.response.status===413){v.value=[h("backend::lang.myaccount.avatar_hint")];return}Pe(h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{f.value=!1}}}async function C(){if(!(f.value||!await x.ask({message:h("backend::lang.myaccount.avatar_remove_confirm"),confirmLabel:h("backend::lang.myaccount.avatar_remove"),danger:!0}))){f.value=!0,v.value=[];try{const j=await qe.DELETE("/account/avatar");if(j.data){zc(j.data.data),Pe(h("backend::lang.myaccount.avatar_removed"));return}Pe(h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{f.value=!1}}}function L(P){return`${Xh}-${P}`}function D(P){const O=[P.comment?`${L(P.name)}-comment`:"",i.value[P.name]?`${L(P.name)}-error`:""].filter(Boolean).join(" ");return O===""?void 0:O}function T(P){if(i.value[P]){const j={...i.value};delete j[P],i.value=j}}function I(P,j){l.value={...l.value,[P]:j},T(P)}function q(P,j){o.value={...o.value,[P]:j},T(P)}function H(){const P={first_name:l.value.first_name,last_name:l.value.last_name,email:l.value.email,subtitle:l.value.subtitle};return o.value.password!==""&&(P.current_password=o.value.current_password,P.password=o.value.password,P.password_confirmation=o.value.password_confirmation),P}async function E(){if(!u.value){u.value=!0;try{const P=await qe.PUT("/account",{body:H()});if(P.data){i.value={},zc(P.data.data),l.value=r(),o.value={current_password:"",password:"",password_confirmation:""},Pe(h("backend::lang.myaccount.saved"));return}if(P.response.status===422){i.value=Dr(P.error?.error.details);const j=n.find(O=>i.value[O]);await Ue(),j&&Nn(Xh,j);return}Pe(h("backend::lang.form.error_generic"),"danger")}catch{Pe(h("backend::lang.form.error_generic"),"danger")}finally{u.value=!1}}}return(P,j)=>(p(),b("section",OH,[g("header",DH,[g("h1",MH,w(s(h)("backend::lang.myaccount.menu_label")),1),g("p",PH,w(s(h)("backend::lang.myaccount.menu_description")),1)]),R(vo,{errors:i.value,"field-names":s(n)},null,8,["errors","field-names"]),g("div",RH,[g("h2",IH,w(s(h)("backend::lang.myaccount.avatar")),1),g("div",qH,[m.value?(p(),b("img",{key:0,src:m.value,alt:"","data-account-avatar-image":"",class:"size-20 shrink-0 rounded-full object-cover"},null,8,LH)):(p(),b("span",NH,w(y.value),1)),g("div",BH,[g("div",FH,[R(Ke,{variant:"outline",size:"sm",icon:s(qS),"data-action":"avatar-upload",disabled:f.value,onClick:S},{default:B(()=>[_e(w(s(h)("backend::lang.myaccount.avatar_upload")),1)]),_:1},8,["icon","disabled"]),s(ta)?.avatar?(p(),U(Ke,{key:0,variant:"danger",size:"sm",icon:s(Ir),"data-action":"avatar-remove",disabled:f.value,onClick:C},{default:B(()=>[_e(w(s(h)("backend::lang.myaccount.avatar_remove")),1)]),_:1},8,["icon","disabled"])):Y("",!0)]),g("p",VH,w(s(h)("backend::lang.myaccount.avatar_hint")),1)]),g("input",{ref_key:"avatarInput",ref:c,type:"file",name:"file_data",accept:uK,class:"hidden","data-account-avatar-input":"",onChange:k},null,544)]),v.value.length>0?(p(),b("div",zH,[(p(!0),b(pe,null,De(v.value,(O,N)=>(p(),b("p",{key:N,class:"flex items-center gap-1.5"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(O),1)]))),128))])):Y("",!0)]),g("form",{class:"flex flex-col gap-7 rounded-card border border-border bg-surface p-7 shadow-card",novalidate:"",onSubmit:yt(E,["prevent"])},[g("fieldset",jH,[g("legend",UH,w(s(h)("backend::lang.myaccount.profile")),1),g("div",HH,[g("label",{for:L("login"),class:"font-semibold"},w(s(h)("backend::lang.myaccount.login")),9,KH),g("input",{id:L("login"),name:"login",type:"text",value:d.value,readonly:"","data-account-login":"",class:me([s(It)(!1),"h-input bg-hover text-muted"])},null,10,WH)]),g("div",GH,[(p(),b(pe,null,De(t,O=>g("div",{key:O.name,class:"flex min-w-0 flex-col gap-1.5","data-field":O.name},[g("label",{for:L(O.name),class:"font-semibold"},w(s(h)(O.label)),9,JH),g("input",{id:L(O.name),name:O.name,type:O.type,autocomplete:O.autocomplete,value:l.value[O.name],"aria-invalid":i.value[O.name]?"true":void 0,"aria-describedby":D(O),class:me([s(It)(!!i.value[O.name]),"h-input"]),onInput:N=>I(O.name,N.target.value)},null,42,ZH),O.comment?(p(),b("p",{key:0,id:`${L(O.name)}-comment`,class:"text-[13px] text-muted"},w(s(h)(O.comment)),9,XH)):Y("",!0),i.value[O.name]?(p(),b("div",{key:1,id:`${L(O.name)}-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(p(!0),b(pe,null,De(i.value[O.name],(N,Z)=>(p(),b("p",{key:Z,class:"flex items-center gap-1.5"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(N),1)]))),128))],8,QH)):Y("",!0)],8,YH)),64))])]),g("fieldset",eK,[g("legend",tK,w(s(h)("backend::lang.myaccount.password_section")),1),g("p",aK,w(s(h)("backend::lang.myaccount.password_comment")),1),g("div",nK,[(p(),b(pe,null,De(a,O=>g("div",{key:O.name,class:"flex min-w-0 flex-col gap-1.5","data-field":O.name},[g("label",{for:L(O.name),class:"font-semibold"},w(s(h)(O.label)),9,lK),g("input",{id:L(O.name),name:O.name,type:"password",autocomplete:O.autocomplete,value:o.value[O.name],"aria-invalid":i.value[O.name]?"true":void 0,"aria-describedby":D(O),class:me([s(It)(!!i.value[O.name]),"h-input"]),onInput:N=>q(O.name,N.target.value)},null,42,oK),i.value[O.name]?(p(),b("div",{key:0,id:`${L(O.name)}-error`,class:"flex flex-col gap-0.5 text-[13px] text-danger"},[(p(!0),b(pe,null,De(i.value[O.name],(N,Z)=>(p(),b("p",{key:Z,class:"flex items-center gap-1.5"},[R(s(gt),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(N),1)]))),128))],8,sK)):Y("",!0)],8,rK)),64))])])],32),R(TH,{confirm:s(x)},null,8,["confirm"]),R(yj,{confirm:s(x)},null,8,["confirm"]),R(Br,{open:s(x).request.value!==null,message:s(x).request.value?.message??"","confirm-label":s(x).request.value?.confirmLabel,danger:s(x).request.value?.danger,busy:s(x).busy.value,onConfirm:s(x).confirm,onCancel:s(x).cancel},null,8,["open","message","confirm-label","danger","busy","onConfirm","onCancel"]),g("footer",iK,[R(Ke,{variant:"primary","data-action":"save",hotkey:"mod+s",title:s(ja)(s(h)("backend::lang.form.save"),"mod+s"),disabled:u.value,onClick:E},{default:B(()=>[_e(w(u.value?s(h)("backend::lang.form.saving"):s(h)("backend::lang.form.save")),1)]),_:1},8,["title","disabled"])])]))}}),dK={class:"flex min-h-screen items-center justify-center px-4",style:{background:"radial-gradient(ellipse at 50% 35%, #2b3a5c 0%, #1d2740 60%)"}},fK={class:"flex w-full max-w-[480px] flex-col gap-6"},pK={class:"flex items-center justify-center gap-3"},mK={class:"flex size-[34px] items-center justify-center rounded-full bg-accent-soft"},vK={class:"flex size-12 items-center justify-center rounded-full bg-[#f3f5f8]"},hK={class:"flex flex-col gap-2"},yK={class:"text-[#566175]"},gK=["src"],bK={key:1,class:"flex size-12 items-center justify-center rounded-full bg-[#f3f5f8]"},_K=["href"],xK=["src"],kK={key:1,class:"flex size-12 items-center justify-center rounded-full bg-[#f3f5f8]"},wK={class:"flex flex-col gap-2"},$K={class:"text-[#566175]"},SK={key:0,"data-previously-allowed":"",class:"flex items-center gap-2 text-[13px] text-[#566175] [overflow-wrap:anywhere]"},CK={class:"flex flex-col gap-3 rounded-inner bg-[#f3f5f8] px-4 py-3"},EK={class:"flex flex-col gap-1"},AK={class:"font-semibold"},TK={class:"flex flex-col items-start gap-1"},OK={"data-connect-admin":"",class:"[overflow-wrap:anywhere]"},DK=["disabled"],MK={class:"flex flex-col gap-1"},PK={class:"font-semibold"},RK={"data-connect-host":"",class:"font-mono text-[13px] [overflow-wrap:anywhere]"},IK=["disabled"],qK={class:"flex min-w-0 flex-col gap-1.5"},LK={key:0,class:"overflow-hidden rounded-inner border border-[#e6e9ef]"},NK={"data-connect-offline":"",class:"flex min-h-[56px] cursor-pointer items-start gap-3 px-4 py-3"},BK={class:"flex min-w-0 flex-col"},FK={class:"font-semibold"},VK={class:"text-[13px] text-[#566175] [overflow-wrap:anywhere]"},zK={class:"flex gap-2.5"},jK=["disabled"],UK=["disabled"],HK={class:"flex shrink-0 items-start gap-4 border-b border-border bg-surface p-4"},KK={class:"flex min-w-0 flex-1 flex-col gap-1"},WK=["aria-label"],Io="connect-light-surface flex flex-col gap-[18px] rounded-card bg-white p-8 text-[#141b2d] shadow-login",di="text-[22px] font-bold tracking-[-0.02em] [overflow-wrap:anywhere]",fi="flex items-center gap-2.5 rounded-control bg-[#fdf0f0] px-3.5 py-3 text-[#c62828]",rd="inline-flex h-input items-center justify-center gap-2 rounded-control border border-[#d2d8e2] bg-white font-semibold text-[#141b2d] hover:bg-[#f1f3f7] disabled:opacity-60",GK=ne({__name:"ConnectView",setup(e){const t=ya(),a=_n(),n=A("loading"),r=A(null),l=A(!0),o=A(null),i=A(!1),u=A(null),d=A(""),c=A(null),f=A(null),v=A(null),m=A(null);let y=0,x=!1;const S=_(()=>{const X=t.query.request;return typeof X=="string"?X.trim():""}),k=_(()=>r.value?.scopes??[]),C=_(()=>k.value.length>0),{availableTiers:L,tier:D,custom:T,pickerOpen:I,draftAdminRead:q,draftScopes:H,submittedScopes:E,canSubmitScopes:P,reset:j,selectTier:O,openPicker:N,applyPicker:Z,discardPicker:W}=w_(k,"connect"),K=_(()=>o.value!==null||i.value),te=_(()=>!K.value&&C.value&&P.value),oe=_(()=>r.value?.client.name||r.value?.client.id||""),ye=_(()=>r.value?.client.redirect_host??""),be=_(()=>{const X=r.value?.client.logo_url?.trim()??"";if(X==="")return"";if(X.startsWith("/")&&!X.startsWith("//")&&!X.startsWith("/\\"))return X;try{return new URL(X).protocol==="https:"?X:""}catch{return""}}),ge=_(()=>{const X=r.value?.admin;let se=X?.name?.trim()??"",xe=X?.email?.trim()??"",$e=X?.login?.trim()??"";if(!X||se===""&&xe===""&&$e===""){const Ce=ta.value;se=Ce?`${Ce.first_name??""} ${Ce.last_name??""}`.trim():"",xe=Ce?.email?.trim()??"",$e=Ce?.login??""}return se!==""&&xe!==""?h("backend::lang.mcp_connect.admin_with_email",{name:se,email:xe}):se!==""?se:$e}),le=_(()=>{try{return new URL(d.value).host||ye.value}catch{return ye.value}}),ce=_(()=>{try{const X=new URL(d.value).protocol;return X==="http:"||X==="https:"?d.value:""}catch{return""}});async function F(){const X=++y;n.value="loading",u.value=null,r.value=null,j([]),d.value="";const se=S.value;if(se===""){n.value="expired";return}let xe;try{xe=await qe.GET("/mcp/consent/{request}",{params:{path:{request:se}}})}catch{X===y&&(n.value="load_error");return}if(X!==y)return;if(xe.data){const Ce=xe.data.data;r.value=Ce,j(Ce.scopes),l.value=!0,n.value="ready";return}const $e=xe.response.status;if($e===401){Kd(a);return}n.value=$e===404?"expired":"load_error"}function fe(X){K.value||(O(X),u.value==="scopes_required"&&(u.value=null))}function ve(){K.value||N()}function J(){Z(),u.value==="scopes_required"&&(u.value=null)}function he(X){X||W()}function G(X){if(X.preventDefault(),m.value){m.value.focusSearch();return}Ue(()=>{m.value?.focusSearch()})}function ee(X){if(X.preventDefault(),v.value){v.value.focusPrimaryControl();return}Ue(()=>{v.value?.focusPrimaryControl()})}const ae=new Set(["javascript:","data:","vbscript:","blob:","file:","about:","filesystem:"]);function $(X,se){if(se==="")return!1;try{if(X.host!=="")return new URL(`${X.protocol}//${se}`).host===X.host;const xe=new URL(se),$e=new URL(X.href);for(const Ce of[xe,$e])Ce.search="",Ce.hash="";return xe.href===$e.href}catch{return!1}}function M(X){let se;try{se=new URL(X)}catch{return null}return ae.has(se.protocol)||!$(se,ye.value)?null:X}async function z(X){if(!(K.value||r.value===null||n.value!=="ready")&&!(X==="allow"&&!te.value)){o.value=X,u.value=null;try{let se;try{se=await qe.POST("/mcp/consent/{request}",{params:{path:{request:S.value}},body:X==="allow"?{decision:X,scopes:E.value,offline_access:r.value.offline_access?l.value:!1}:{decision:X,scopes:[],offline_access:!1}})}catch{u.value="decide_failed";return}if(se.data){const $e=M(se.data.data.redirect_uri);if($e===null){u.value="decide_failed";return}d.value=$e,n.value="returning",window.location.assign($e);return}const xe=se.response.status;xe===401?Kd(a):xe===404?n.value="expired":xe===422&&X==="allow"?u.value="scopes_required":u.value="decide_failed"}finally{o.value=null}}}async function de(){if(K.value)return;i.value=!0,u.value=null;const X=t.fullPath;try{await f0(),await a.replace({name:"login",query:{redirect:X}})}catch{u.value="decide_failed"}finally{i.value=!1}}return Be(n,async X=>{if(!x){x=X!=="loading";return}await Ue(),c.value?.focus()},{flush:"post"}),Be(u,async X=>{X!==null&&(await Ue(),f.value?.focus())},{flush:"post"}),$t(()=>{F()}),Be(S,()=>{F()}),(X,se)=>(p(),b("main",dK,[g("div",fK,[g("div",pK,[g("span",mK,[R(s(Ts),{size:20,class:"text-accent","aria-hidden":"true"})]),se[6]||(se[6]=g("span",{class:"text-[18px] font-bold text-white"},[_e("Summer"),g("span",{class:"text-accent"},"CMS")],-1))]),n.value==="loading"?(p(),b("div",{key:0,"data-connect-state":"loading","aria-busy":"true",class:me(Io)},[g("h1",{ref_key:"heading",ref:c,tabindex:"-1",class:"sr-only"},w(s(h)("backend::lang.mcp_connect.page_title")),513),se[7]||(se[7]=bk('<span class="size-12 rounded-full bg-[#eceff4]" aria-hidden="true"></span><div class="flex flex-col gap-2" aria-hidden="true"><span class="h-3 w-56 rounded-[6px] bg-[#eceff4]"></span><span class="h-3 w-40 rounded-[6px] bg-[#eceff4]"></span></div><div class="flex flex-col gap-2" aria-hidden="true"><span class="h-10 rounded-inner bg-[#eceff4]"></span><div class="flex flex-col gap-2 rounded-inner border border-[#e6e9ef] bg-[#f3f5f8] p-4"><span class="h-3 w-48 rounded-[6px] bg-[#eceff4]"></span><span class="h-3 w-32 rounded-[6px] bg-[#eceff4]"></span></div></div>',3))])):n.value==="expired"?(p(),b("div",{key:1,"data-connect-state":"expired",class:me(Io)},[g("span",vK,[R(s(Bi),{size:24,class:"text-[#566175]","aria-hidden":"true"})]),g("div",hK,[g("h1",{ref_key:"heading",ref:c,tabindex:"-1",class:me(di)},w(s(h)("backend::lang.mcp_connect.expired_heading")),513),g("p",yK,w(s(h)("backend::lang.mcp_connect.expired_body")),1)]),R(s(qa),{to:"/","data-action":"open-admin",class:me([rd,"w-full"])},{default:B(()=>[_e(w(s(h)("backend::lang.mcp_connect.open_admin")),1)]),_:1})])):n.value==="load_error"?(p(),b("div",{key:2,"data-connect-state":"load-error",class:me(Io)},[g("h1",{ref_key:"heading",ref:c,tabindex:"-1",class:me(di)},w(s(h)("backend::lang.mcp_connect.page_title")),513),g("div",{role:"alert",class:me(fi)},[R(s(gt),{size:18,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.mcp_connect.load_failed")),1)]),g("button",{type:"button","data-action":"retry",class:me([rd,"w-full"]),onClick:F},w(s(h)("backend::lang.mcp_connect.retry")),1)])):n.value==="returning"?(p(),b("div",{key:3,"data-connect-state":"returning",class:me(Io)},[be.value?(p(),b("img",{key:0,src:be.value,alt:"",class:"size-12 rounded-inner object-contain"},null,8,gK)):(p(),b("span",bK,[R(s(sv),{size:24,class:"text-[#566175]","aria-hidden":"true"})])),g("h1",{ref_key:"heading",ref:c,tabindex:"-1",class:me([di,"flex items-center gap-2"])},[g("span",null,w(s(h)("backend::lang.mcp_connect.returning",{host:le.value})),1),R(s(In),{size:16,class:"shrink-0 animate-spin","aria-hidden":"true"})],512),ce.value?(p(),b("a",{key:2,href:ce.value,"data-connect-continue":"",class:"text-[13px] text-[#141b2d] underline [overflow-wrap:anywhere]"},w(s(h)("backend::lang.mcp_connect.continue",{host:le.value})),9,_K)):Y("",!0)])):r.value?(p(),b("form",{key:4,"data-connect-state":"ready",class:me(Io),novalidate:"",onSubmit:se[2]||(se[2]=yt(xe=>z("allow"),["prevent"]))},[be.value?(p(),b("img",{key:0,src:be.value,alt:"",class:"size-12 rounded-inner object-contain"},null,8,xK)):(p(),b("span",kK,[R(s(sv),{size:24,class:"text-[#566175]","aria-hidden":"true"})])),g("div",wK,[g("h1",{ref_key:"heading",ref:c,tabindex:"-1",class:me(di)},w(s(h)("backend::lang.mcp_connect.heading",{client:oe.value})),513),g("p",$K,w(s(h)("backend::lang.mcp_connect.subline")),1),r.value.consent_required===!1?(p(),b("p",SK,[R(s(Rr),{size:14,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.mcp_connect.previously_allowed",{client:oe.value})),1)])):Y("",!0)]),g("dl",CK,[g("div",EK,[g("dt",AK,w(s(h)("backend::lang.mcp_connect.signed_in_as")),1),g("dd",TK,[g("span",OK,w(ge.value),1),g("button",{type:"button","data-action":"switch-account",disabled:K.value,class:"font-semibold text-[#141b2d] underline-offset-2 hover:underline disabled:opacity-60",onClick:de},w(s(h)("backend::lang.mcp_connect.switch_account")),9,DK)])]),g("div",MK,[g("dt",PK,w(s(h)("backend::lang.mcp_connect.returns_to")),1),g("dd",RK,w(ye.value),1)])]),C.value?(p(),b("fieldset",{key:3,disabled:K.value,class:"flex min-w-0 flex-col gap-[18px]"},[g("div",qK,[R(x_,{ref_key:"scopeAccessRef",ref:v,"id-prefix":"connect",catalog:k.value,"available-tiers":s(L),tier:s(D),custom:s(T),disabled:K.value,invalid:u.value==="scopes_required","onUpdate:tier":fe,onCustomize:ve},null,8,["catalog","available-tiers","tier","custom","disabled","invalid"]),u.value==="scopes_required"?(p(),b("div",{key:0,ref_key:"alertBlock",ref:f,role:"alert",tabindex:"-1","data-connect-error":"scopes_required",class:me(fi)},[R(s(gt),{size:18,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.api_tokens.scopes_required")),1)],512)):Y("",!0)]),r.value.offline_access?(p(),b("div",LK,[g("label",NK,[ha(g("input",{"onUpdate:modelValue":se[0]||(se[0]=xe=>l.value=xe),type:"checkbox",class:"mt-0.5 size-5 shrink-0 rounded-[6px] accent-[#22304d]"},null,512),[[ow,l.value]]),g("span",BK,[g("span",FK,w(s(h)("backend::lang.mcp_connect.offline")),1),g("span",VK,w(s(h)("backend::lang.mcp_connect.offline_description")),1)])])])):Y("",!0)],8,IK)):(p(),b("div",{key:2,role:"alert","data-connect-none-grantable":"",class:me([fi,"items-start"])},[R(s(gt),{size:18,class:"mt-0.5 shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.mcp_connect.none_grantable")),1)])),u.value==="decide_failed"?(p(),b("div",{key:4,ref_key:"alertBlock",ref:f,role:"alert",tabindex:"-1","data-connect-error":"decide_failed",class:me(fi)},[R(s(gt),{size:18,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.mcp_connect.decide_failed")),1)],512)):Y("",!0),g("div",zK,[g("button",{type:"button","data-action":"deny",disabled:K.value,class:me([rd,"flex-1"]),onClick:se[1]||(se[1]=xe=>z("deny"))},[o.value==="deny"?(p(),U(s(In),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),_e(" "+w(s(h)("backend::lang.mcp_connect.deny")),1)],8,jK),C.value?(p(),b("button",{key:0,type:"submit","data-action":"allow",disabled:!te.value,class:"inline-flex h-input flex-1 items-center justify-center gap-2 rounded-control bg-[#22304d] font-semibold text-white hover:opacity-90 disabled:opacity-60"},[o.value==="allow"?(p(),U(s(In),{key:0,size:16,class:"animate-spin","aria-hidden":"true"})):Y("",!0),_e(" "+w(o.value==="allow"?s(h)("backend::lang.mcp_connect.allowing"):s(h)("backend::lang.mcp_connect.allow")),1)],8,UK)):Y("",!0)])],32)):Y("",!0)]),R(s(Jn),{open:s(I),"onUpdate:open":he},{default:B(()=>[R(s(qr),null,{default:B(()=>[R(s(Xn),{"data-dialog-overlay":"",class:"connect-light-surface fixed inset-0 z-40 bg-overlay"}),R(s(Zn),{"data-scope-picker-dialog":"","data-dialog-content":"","aria-modal":"true",class:"connect-light-surface fixed inset-0 z-50 flex h-[100dvh] w-full flex-col overflow-hidden bg-surface text-text sm:inset-auto sm:top-1/2 sm:left-1/2 sm:h-auto sm:max-h-[85dvh] sm:w-[calc(100%-32px)] sm:max-w-[640px] sm:-translate-x-1/2 sm:-translate-y-1/2 sm:rounded-modal sm:shadow-pop",onOpenAutoFocus:G,onCloseAutoFocus:ee},{default:B(()=>[g("div",HK,[g("div",KK,[R(s(hn),{class:"text-[20px] font-bold tracking-[-0.01em] text-text"},{default:B(()=>[_e(w(s(h)("backend::lang.api_tokens.scope_picker_title")),1)]),_:1}),R(s(pn),{class:"text-[13px] text-muted [overflow-wrap:anywhere]"},{default:B(()=>[_e(w(s(h)("backend::lang.mcp_connect.scope_picker_description",{client:oe.value})),1)]),_:1})]),g("button",{type:"button","data-action":"close-scope-picker","aria-label":s(h)("backend::lang.form.close"),class:"flex size-[34px] shrink-0 items-center justify-center rounded-tab bg-subtle text-muted hover:bg-hover hover:text-text",onClick:se[3]||(se[3]=(...xe)=>s(W)&&s(W)(...xe))},[R(s(Vt),{size:16,"aria-hidden":"true"})],8,WK)]),R(k_,{ref_key:"scopePickerRef",ref:m,catalog:k.value,"draft-admin-read":s(q),"onUpdate:draftAdminRead":se[4]||(se[4]=xe=>wt(q)?q.value=xe:null),"draft-scopes":s(H),"onUpdate:draftScopes":se[5]||(se[5]=xe=>wt(H)?H.value=xe:null),"cancel-label":s(h)("backend::lang.api_tokens.scope_picker_discard"),disabled:K.value,onApply:J,onCancel:s(W)},null,8,["catalog","draft-admin-read","draft-scopes","cancel-label","disabled","onCancel"])]),_:1})]),_:1})]),_:1},8,["open"])]))}}),YK={class:"flex flex-col gap-5","data-plugins-screen":""},JK={class:"flex flex-col gap-1"},ZK={class:"text-[26px] font-bold tracking-[-0.02em]"},XK={key:0,class:"text-[13px] text-muted","data-plugins-framework":""},QK={key:0,role:"alert",class:"flex items-center gap-2 text-danger","data-plugins-failed":""},eW={key:0,role:"status",class:"flex items-center gap-2 rounded-card border border-border bg-subtle px-4 py-3 text-[13px]","data-registry-unavailable":""},tW={key:0,class:"text-muted"},aW={key:1,class:"overflow-x-auto rounded-card border border-border bg-surface shadow-card"},nW={class:"w-full border-collapse text-left"},rW={class:"border-b border-border text-[13px] text-muted"},lW={scope:"col",class:"px-5 py-3 font-semibold"},oW={scope:"col",class:"px-5 py-3 font-semibold"},sW={scope:"col",class:"px-5 py-3 font-semibold"},iW=["data-plugin"],uW={class:"px-5 py-3"},cW={class:"flex min-w-0 flex-col gap-0.5"},dW={class:"font-semibold","data-plugin-name":""},fW={key:0,class:"font-mono text-[12px] text-muted"},pW={key:1,class:"text-[13px] text-muted","data-plugin-description":""},mW={key:2,class:"mt-2 flex max-w-[560px] flex-col gap-1.5","data-plugin-update":""},vW={class:"inline-flex items-center gap-1.5 self-start rounded-pill bg-sel px-2.5 py-0.5 text-[12px] font-semibold","data-update-badge":""},hW={class:"flex items-center gap-2"},yW=["for"],gW=["id","data-command","value"],bW={key:0,role:"alert",class:"text-[13px] text-danger","data-copy-failed":""},_W={key:3,class:"text-[12px] text-muted","data-plugin-needs-framework":""},xW={class:"px-5 py-3 whitespace-nowrap"},kW={key:0,class:"font-mono text-[13px]","data-plugin-version":""},wW={key:1,class:"text-[13px] text-muted","data-plugin-version":""},$W={class:"px-5 py-3 text-[13px] whitespace-nowrap","data-plugin-source":""},SW={class:"flex flex-wrap items-end gap-3"},CW={class:"relative block w-[360px] max-w-full"},EW={class:"sr-only"},AW=["value","placeholder"],TW={class:"flex flex-col gap-1 text-[13px]"},OW={class:"font-semibold text-muted"},DW=["value"],MW={value:""},PW=["value"],RW={class:"text-[13px] text-muted"},IW={key:0,role:"status",class:"flex items-center gap-2 text-[13px]","data-market-unavailable":""},qW={key:1,class:"text-muted","data-market-empty":""},LW={key:2,class:"grid grid-cols-1 gap-3 min-[1100px]:grid-cols-2"},NW=["data-market-plugin"],BW={class:"flex items-start gap-3.5"},FW=["src"],VW={class:"flex min-w-0 flex-1 flex-col gap-0.5"},zW={class:"flex flex-wrap items-center gap-2"},jW={class:"font-semibold","data-market-name":""},UW={key:0,class:"font-mono text-[12px] text-muted","data-market-version":""},HW={class:"font-mono text-[12px] text-muted"},KW={key:0,class:"text-[13px] text-muted","data-market-description":""},WW={key:1,class:"shrink-0 rounded-pill bg-subtle px-2.5 py-0.5 text-[12px] font-semibold","data-market-marker":"installed"},GW={key:2,class:"shrink-0 rounded-pill bg-subtle px-2.5 py-0.5 text-[12px] font-semibold text-muted","data-market-marker":"needs-framework"},YW={class:"flex items-center gap-2"},JW=["for"],ZW=["id","data-command","value"],XW={key:0,role:"alert",class:"text-[13px] text-danger","data-copy-failed":""},QW={class:"sr-only","aria-live":"polite"},eG={key:2,class:"text-muted","aria-busy":"true"},tG=300,Qh="inline-flex h-[34px] items-center gap-2 rounded-tab px-4 font-semibold text-muted transition-colors duration-150 ease-out hover:text-text data-[state=active]:bg-surface data-[state=active]:text-text data-[state=active]:shadow-tab",ey="h-[38px] min-w-0 flex-1 rounded-control border border-border bg-subtle px-3 font-mono text-[13px] text-text",aG="h-button rounded-control border border-border-strong bg-surface px-3 text-text",nG=ne({__name:"PluginsView",setup(e){const t=A(null),a=A(!1),n=A(!0),r=A("installed"),l={module:"backend::lang.plugins.source_module",submodule:"backend::lang.plugins.source_submodule",local:"backend::lang.plugins.source_local"};function o(j){const O=l[j.source];return O?h(O):j.source}async function i(){n.value=!0,a.value=!1;try{const{data:j,response:O}=await qe.GET("/plugins");O.ok&&j?t.value=j.data:a.value=!0}catch{a.value=!0}finally{n.value=!1}}const u=A(""),d=A(""),c=A(null),f=A(!1),v=A(!1),m=A([]);let y=null,x=0;async function S(){const j=++x;f.value=!0,v.value=!1;const O={};u.value.trim()!==""&&(O.q=u.value.trim()),d.value!==""&&(O.category=d.value);try{const{data:N,response:Z}=await qe.GET("/plugins/marketplace",{params:{query:O}});if(j!==x)return;Z.ok&&N?(c.value=N,N.meta.categories.length>0&&(m.value=[...N.meta.categories])):v.value=!0}catch{j===x&&(v.value=!0)}finally{j===x&&(f.value=!1)}}function k(){y!==null&&(clearTimeout(y),y=null)}function C(j){u.value=j,k(),y=setTimeout(()=>{y=null,S()},tG)}function L(j){d.value=j,k(),S()}Be(r,j=>{j==="marketplace"&&c.value===null&&!f.value&&S()});const D=A(""),T=A(""),I=A("");let q=null;function H(j){const O=document.querySelector(`[data-command="${CSS.escape(j)}"]`);O?.focus(),O?.select()}async function E(j,O){try{if(!navigator.clipboard?.writeText)throw new Error("clipboard unavailable");await navigator.clipboard.writeText(O),T.value="",D.value=j,I.value=h("backend::lang.plugins.copied_announce"),q!==null&&clearTimeout(q),q=setTimeout(()=>{D.value="",q=null},2e3)}catch{D.value="",T.value=j,H(j)}}function P(j){j.target.select()}return $t(i),Ot(()=>{k(),q!==null&&clearTimeout(q)}),(j,O)=>(p(),b("section",YK,[g("header",JK,[g("h1",ZK,w(s(h)("backend::lang.plugins.title")),1),t.value?.framework?(p(),b("p",XK,w(s(h)("backend::lang.plugins.framework",{version:t.value.framework})),1)):Y("",!0)]),a.value?(p(),b("p",QK,[R(s(gt),{size:16,class:"shrink-0","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.plugins.load_failed")),1)])):t.value?(p(),b(pe,{key:1},[t.value.registry.status==="unavailable"?(p(),b("p",eW,[R(s(zi),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.plugins.registry_unavailable")),1)])):Y("",!0),R(s(H6),{modelValue:r.value,"onUpdate:modelValue":O[2]||(O[2]=N=>r.value=N),class:"flex flex-col gap-4"},{default:B(()=>[R(s(G6),{"aria-label":s(h)("backend::lang.plugins.tabs_label"),class:"inline-flex gap-1 self-start rounded-inner border border-border bg-subtle p-1"},{default:B(()=>[R(s(uh),{value:"installed","data-tab":"installed",class:me(Qh)},{default:B(()=>[_e(w(s(h)("backend::lang.plugins.tab_installed")),1)]),_:1}),t.value.registry.enabled?(p(),U(s(uh),{key:0,value:"marketplace","data-tab":"marketplace",class:me(Qh)},{default:B(()=>[_e(w(s(h)("backend::lang.plugins.tab_marketplace")),1)]),_:1})):Y("",!0)]),_:1},8,["aria-label"]),R(s(ih),{value:"installed",class:"flex flex-col gap-3"},{default:B(()=>[t.value.plugins.length===0?(p(),b("p",tW,w(s(h)("backend::lang.plugins.empty")),1)):(p(),b("div",aW,[g("table",nW,[g("thead",null,[g("tr",rW,[g("th",lW,w(s(h)("backend::lang.plugins.column_plugin")),1),g("th",oW,w(s(h)("backend::lang.plugins.column_version")),1),g("th",sW,w(s(h)("backend::lang.plugins.column_source")),1)])]),g("tbody",null,[(p(!0),b(pe,null,De(t.value.plugins,N=>(p(),b("tr",{key:N.id,"data-plugin":N.id,class:"border-b border-border align-top last:border-b-0"},[g("td",uW,[g("div",cW,[g("span",dW,w(N.name||N.id),1),N.name?(p(),b("span",fW,w(N.id),1)):Y("",!0),N.description?(p(),b("span",pW,w(N.description),1)):Y("",!0),t.value.registry.enabled&&N.updateAvailable?(p(),b("div",mW,[g("span",vW,[R(s(I$),{size:14,"aria-hidden":"true"}),_e(" "+w(s(h)("backend::lang.plugins.update_available",{version:N.latest})),1)]),g("div",hW,[g("label",{for:`plugin-command-update-${N.id}`,class:"sr-only"},w(s(h)("backend::lang.plugins.command_label")),9,yW),g("input",{id:`plugin-command-update-${N.id}`,"data-command":`update:${N.id}`,value:N.updateCommand,type:"text",readonly:"",spellcheck:"false",class:me(ey),onFocus:P},null,40,gW),R(Ke,{variant:"outline",size:"sm",icon:D.value===`update:${N.id}`?s(Na):s(Fi),"data-action":"copy-command",onClick:Z=>E(`update:${N.id}`,N.updateCommand)},{default:B(()=>[_e(w(D.value===`update:${N.id}`?s(h)("backend::lang.plugins.copied"):s(h)("backend::lang.plugins.copy")),1)]),_:2},1032,["icon","onClick"])]),T.value===`update:${N.id}`?(p(),b("p",bW,w(s(h)("backend::lang.plugins.copy_failed")),1)):Y("",!0)])):Y("",!0),t.value.registry.enabled&&N.latestFramework?(p(),b("span",_W,w(s(h)("backend::lang.plugins.needs_framework",{version:N.latestFramework})),1)):Y("",!0)])]),g("td",xW,[N.version?(p(),b("span",kW,w(N.version),1)):(p(),b("span",wW,w(s(h)("backend::lang.plugins.no_version")),1))]),g("td",$W,w(N.source?o(N):""),1)],8,iW))),128))])])]))]),_:1}),t.value.registry.enabled?(p(),U(s(ih),{key:0,value:"marketplace",class:"flex flex-col gap-4"},{default:B(()=>[g("div",SW,[g("label",CW,[g("span",EW,w(s(h)("backend::lang.plugins.search_label")),1),R(s(fl),{size:18,class:"pointer-events-none absolute top-1/2 left-3.5 -translate-y-1/2 text-muted","aria-hidden":"true"}),g("input",{type:"search",maxlength:"100","data-market-search":"",value:u.value,placeholder:s(h)("backend::lang.plugins.search_placeholder"),class:"h-button w-full rounded-control border border-transparent bg-subtle pr-3.5 pl-10",onInput:O[0]||(O[0]=N=>C(N.target.value))},null,40,AW)]),g("label",TW,[g("span",OW,w(s(h)("backend::lang.plugins.category_label")),1),g("select",{"data-market-category":"",value:d.value,class:me(aG),onChange:O[1]||(O[1]=N=>L(N.target.value))},[g("option",MW,w(s(h)("backend::lang.plugins.category_all")),1),(p(!0),b(pe,null,De(m.value,N=>(p(),b("option",{key:N,value:N},w(N),9,PW))),128))],40,DW)])]),g("p",RW,w(s(h)("backend::lang.plugins.install_hint")),1),v.value||c.value?.meta.registry.status==="unavailable"?(p(),b("p",IW,[R(s(zi),{size:16,class:"shrink-0 text-muted","aria-hidden":"true"}),g("span",null,w(s(h)("backend::lang.plugins.registry_unavailable")),1)])):c.value&&c.value.data.length===0?(p(),b("p",qW,w(s(h)("backend::lang.plugins.marketplace_empty")),1)):Y("",!0),c.value&&c.value.data.length>0?(p(),b("div",LW,[(p(!0),b(pe,null,De(c.value.data,N=>(p(),b("article",{key:N.id,"data-market-plugin":N.id,class:"flex flex-col gap-3 rounded-card border border-border bg-surface p-5 shadow-card"},[g("div",BW,[N.iconUrl?(p(),b("img",{key:0,src:N.iconUrl,alt:"",loading:"lazy",referrerpolicy:"no-referrer",class:"size-10 shrink-0 rounded-inner object-cover"},null,8,FW)):Y("",!0),g("div",VW,[g("div",zW,[g("span",jW,w(N.name||N.id),1),N.latestVersion?(p(),b("span",UW,w(N.latestVersion),1)):Y("",!0),N.featured?(p(),U(s(_b),{key:1,size:14,class:"text-muted","aria-label":s(h)("backend::lang.plugins.featured")},null,8,["aria-label"])):Y("",!0)]),g("span",HW,w(N.id),1),N.description?(p(),b("span",KW,w(N.description),1)):Y("",!0)]),N.installed?(p(),b("span",WW,w(s(h)("backend::lang.plugins.marker_installed")),1)):N.compatible?Y("",!0):(p(),b("span",GW,w(s(h)("backend::lang.plugins.marker_needs_framework",{version:N.latestFramework})),1))]),g("div",YW,[g("label",{for:`plugin-command-install-${N.id}`,class:"sr-only"},w(s(h)("backend::lang.plugins.command_label")),9,JW),g("input",{id:`plugin-command-install-${N.id}`,"data-command":`install:${N.id}`,value:N.installCommand,type:"text",readonly:"",spellcheck:"false",class:me(ey),onFocus:P},null,40,ZW),R(Ke,{variant:"outline",size:"sm",icon:D.value===`install:${N.id}`?s(Na):s(Fi),"data-action":"copy-command",onClick:Z=>E(`install:${N.id}`,N.installCommand)},{default:B(()=>[_e(w(D.value===`install:${N.id}`?s(h)("backend::lang.plugins.copied"):s(h)("backend::lang.plugins.copy")),1)]),_:2},1032,["icon","onClick"])]),T.value===`install:${N.id}`?(p(),b("p",XW,w(s(h)("backend::lang.plugins.copy_failed")),1)):Y("",!0)],8,NW))),128))])):Y("",!0)]),_:1})):Y("",!0)]),_:1},8,["modelValue"]),g("span",QW,w(I.value),1)],64)):n.value?(p(),b("p",eG,"…")):Y("",!0)]))}}),rG={class:"flex flex-col items-center gap-2 py-20 text-center"},lG={class:"text-[17px] font-bold"},ty=ne({__name:"NotFoundView",props:{home:{type:Boolean}},setup(e){return(t,a)=>(p(),b("section",rG,[g("h1",lG,w(e.home?s(h)("backend::lang.nav.empty"):s(h)("backend::lang.page.not_found")),1)]))}});function ef(e){return typeof e!="string"||e.length===0||!e.startsWith("/")||e.startsWith("//")||e.startsWith("/\\")?null:e}const oG=new Set(["list","create","record","preview","reorder"]);function sG(e){if(typeof e.name!="string"||!oG.has(e.name))return"";const{vendor:t,plugin:a,controller:n}=e.params;return typeof t!="string"||typeof a!="string"||typeof n!="string"?"":Cs({vendor:t,plugin:a,controller:n})}function iG(e=Zw(dl.base)){const t=h2({history:e,routes:[{path:"/login",name:"login",component:AM,meta:{public:!0}},{path:"/",name:"home",component:ty,props:{home:!0},meta:{shell:!0},beforeEnter:()=>B2()??!0},{path:"/settings",name:"settings",component:Qz,meta:{shell:!0}},{path:"/settings/:code",name:"settings-form",component:zz,meta:{shell:!0}},{path:"/account",name:"account",component:cK,meta:{shell:!0}},{path:"/system/plugins",name:"plugins",component:nG,meta:{shell:!0}},{path:"/connect",name:"connect",component:GK},{path:"/:vendor/:plugin/:controller",name:"list",component:CR,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/create",name:"create",component:Yh,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/reorder",name:"reorder",component:Pz,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/:id(\\d+)",name:"record",component:Yh,meta:{shell:!0}},{path:"/:vendor/:plugin/:controller/:id(\\d+)/preview",name:"preview",component:az,meta:{shell:!0}},{path:"/:pathMatch(.*)*",name:"not-found",component:ty,meta:{shell:!0}}]});return t.beforeEach(a=>{const n=ta.value!==null;return a.meta.public?n&&a.name==="login"?ef(a.query.redirect)??"/":!0:n?!0:{name:"login",query:{redirect:a.fullPath}}}),t.afterEach((a,n,r)=>{r||fM(sG(a))}),t}const ay="summer-admin.chunk-reload",uG=6e4;function cG(e,t){if(e===null)return!1;try{const a=Number.parseInt(e.getItem(ay)??"",10);return Number.isFinite(a)&&t-a>=0&&t-a<uG?!1:(e.setItem(ay,String(t)),!0)}catch{return!1}}function dG(){try{return window.sessionStorage}catch{return null}}function fG(e={}){const t=e.target??window,a=e.storage??dG,n=e.reload??(()=>window.location.reload()),r=e.now??Date.now,l=()=>{cG(a(),r())&&n()};return t.addEventListener("vite:preloadError",l),()=>t.removeEventListener("vite:preloadError",l)}async function pG(){fG(),Hi(H3()),await Yg(K3()||void 0).catch(()=>{}),await u0().catch(()=>null)&&await Promise.all([Jg().catch(()=>[]),Zg().catch(()=>[]),T0()]);const t=iG();O2(()=>Kd(t));const a=pw(cM);a.use(t),await t.isReady(),a.mount("#app"),nM()}pG();export{sN as L,Y0 as _,e_ as i};
|