Files
daywork/intern-log/dist/assets/index-DT_fURyb.js
T
2026-10-16 22:38:55 +08:00

27 lines
316 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function s(o){if(o.ep)return;o.ep=!0;const a=n(o);fetch(o.href,a)}})();/**
* @vue/shared v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Wa(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ft={},Ar=[],Tn=()=>{},Uu=()=>!1,li=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),ui=e=>e.startsWith("onUpdate:"),$t=Object.assign,za=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},sf=Object.prototype.hasOwnProperty,ut=(e,t)=>sf.call(e,t),Re=Array.isArray,sr=e=>qs(e)==="[object Map]",jr=e=>qs(e)==="[object Set]",Jl=e=>qs(e)==="[object Date]",We=e=>typeof e=="function",bt=e=>typeof e=="string",Pn=e=>typeof e=="symbol",ct=e=>e!==null&&typeof e=="object",qu=e=>(ct(e)||We(e))&&We(e.then)&&We(e.catch),Hu=Object.prototype.toString,qs=e=>Hu.call(e),of=e=>qs(e).slice(8,-1),Wu=e=>qs(e)==="[object Object]",Ga=e=>bt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ks=Wa(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),ci=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},af=/-\w/g,mn=ci(e=>e.replace(af,t=>t.slice(1).toUpperCase())),lf=/\B([A-Z])/g,dr=ci(e=>e.replace(lf,"-$1").toLowerCase()),zu=ci(e=>e.charAt(0).toUpperCase()+e.slice(1)),ra=ci(e=>e?`on${zu(e)}`:""),$n=(e,t)=>!Object.is(e,t),Po=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},Gu=(e,t,n,s=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:s,value:n})},di=e=>{const t=parseFloat(e);return isNaN(t)?e:t},uf=e=>{const t=bt(e)?Number(e):NaN;return isNaN(t)?e:t};let Xl;const fi=()=>Xl||(Xl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function or(e){if(Re(e)){const t={};for(let n=0;n<e.length;n++){const s=e[n],o=bt(s)?pf(s):or(s);if(o)for(const a in o)t[a]=o[a]}return t}else if(bt(e)||ct(e))return e}const cf=/;(?![^(]*\))/g,df=/:([^]+)/,ff=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function pf(e){const t={};return e.replace(ff,n=>n.startsWith("/*")?"":n).split(cf).forEach(n=>{if(n){const s=n.split(df);s.length>1&&(t[s[0].trim()]=s[1].trim())}}),t}function et(e){let t="";if(bt(e))t=e;else if(Re(e))for(let n=0;n<e.length;n++){const s=et(e[n]);s&&(t+=s+" ")}else if(ct(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const vf="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",hf=Wa(vf);function Yu(e){return!!e||e===""}function mf(e,t,n){if(e.length!==t.length)return!1;let s=!0;for(let o=0;s&&o<e.length;o++)s=ar(e[o],t[o],n);return s}function Ql(e,t,n){if(e.size!==t.size)return!1;const s=Array.from(t),o=new Uint8Array(s.length);for(const a of e){let c=-1;for(let f=0;f<s.length;f++)if(!o[f]&&ar(a,s[f],n)){c=f;break}if(c<0)return!1;o[c]=1}return!0}function yf(e,t,n){let s=sr(e),o=sr(t);if(s||o||(s=jr(e),o=jr(t),s||o))return s&&o?Ql(e,t,n):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const f in e){const v=e.hasOwnProperty(f),y=t.hasOwnProperty(f);if(v&&!y||!v&&y||!ar(e[f],t[f],n))return!1}return String(e)===String(t)}function Zl(e,t,n,s){n||(n=[new Map,new Map]);const[o,a]=n;if(o.has(e)||a.has(t))return o.get(e)===t&&a.get(t)===e;o.set(e,t),a.set(t,e);const c=s(e,t,n);return o.delete(e),a.delete(t),c}function ar(e,t,n){if(e===t)return!0;let s=Jl(e),o=Jl(t);return s||o?s&&o?e.getTime()===t.getTime():!1:(s=Pn(e),o=Pn(t),s||o?e===t:(s=Re(e),o=Re(t),s||o?s&&o?Zl(e,t,n,mf):!1:(s=ct(e),o=ct(t),s||o?!s||!o?!1:Zl(e,t,n,yf):String(e)===String(t))))}function gf(e,t){return e.findIndex(n=>ar(n,t))}const Ju=e=>!!(e&&e.__v_isRef===!0),ne=e=>bt(e)?e:e==null?"":Re(e)||ct(e)&&(e.toString===Hu||!We(e.toString))?Ju(e)?ne(e.value):JSON.stringify(e,Xu,2):String(e),Xu=(e,t)=>Ju(t)?Xu(e,t.value):sr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[s,o],a)=>(n[sa(s,a)+" =>"]=o,n),{})}:jr(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>sa(n))}:Pn(t)?sa(t):ct(t)&&!Re(t)&&!Wu(t)?String(t):t,sa=(e,t="")=>{var n;return Pn(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Dt;class bf{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&&Dt&&(Dt.active?(this.parent=Dt,this.index=(Dt.scopes||(Dt.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes){const s=this.scopes.slice();for(t=0,n=s.length;t<n;t++)s[t].pause()}for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes){const o=this.scopes.slice();for(t=0,n=o.length;t<n;t++)o[t].resume()}const s=this.effects.slice();for(t=0,n=s.length;t<n;t++)s[t].resume()}}run(t){if(this._active){const n=Dt;try{return Dt=this,t()}finally{Dt=n}}}on(){++this._on===1&&(this.prevScope=Dt,Dt=this)}off(){if(this._on>0&&--this._on===0){if(Dt===this)Dt=this.prevScope;else{let t=Dt;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 n,s;for(n=0,s=this.effects.length;n<s;n++)this.effects[n].stop();for(this.effects.length=0,n=0,s=this.cleanups.length;n<s;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){const o=this.scopes.slice();for(n=0,s=o.length;n<s;n++)o[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const o=this.parent.scopes.pop();o&&o!==this&&(this.parent.scopes[this.index]=o,o.index=this.index)}this.parent=void 0}}}function wf(){return Dt}let vt;const oa=new WeakSet;class Qu{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,Dt&&(Dt.active?Dt.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,oa.has(this)&&(oa.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||ec(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,eu(this),tc(this);const t=vt,n=yn;vt=this,yn=!0;try{return this.fn()}finally{nc(this),vt=t,yn=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Xa(t);this.deps=this.depsTail=void 0,eu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?oa.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ba(this)&&this.run()}get dirty(){return ba(this)}}let Zu=0,xs,Cs;function ec(e,t=!1){if(e.flags|=8,t){e.next=Cs,Cs=e;return}e.next=xs,xs=e}function Ya(){Zu++}function Ja(){if(--Zu>0)return;if(Cs){let t=Cs;for(Cs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;xs;){let t=xs;for(xs=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(s){e||(e=s)}t=n}}if(e)throw e}function tc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function nc(e){let t,n=e.depsTail,s=n;for(;s;){const o=s.prevDep;s.version===-1?(s===n&&(n=o),Xa(s),_f(s)):t=s,s.dep.activeLink=s.prevActiveLink,s.prevActiveLink=void 0,s=o}e.deps=t,e.depsTail=n}function ba(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(rc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function rc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Os)||(e.globalVersion=Os,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ba(e))))return;e.flags|=2;const t=e.dep,n=vt,s=yn;vt=e,yn=!0;try{tc(e);const o=e.fn(e._value);(t.version===0||$n(o,e._value))&&(e.flags|=128,e._value=o,t.version++)}catch(o){throw t.version++,o}finally{vt=n,yn=s,nc(e),e.flags&=-3}}function Xa(e,t=!1){const{dep:n,prevSub:s,nextSub:o}=e;if(s&&(s.nextSub=o,e.prevSub=void 0),o&&(o.prevSub=s,e.nextSub=void 0),n.subs===e&&(n.subs=s,!s&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)Xa(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function _f(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let yn=!0;const sc=[];function An(){sc.push(yn),yn=!1}function On(){const e=sc.pop();yn=e===void 0?!0:e}function eu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=vt;vt=void 0;try{t()}finally{vt=n}}}let Os=0;class kf{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Qa{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(!vt||!yn||vt===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==vt)n=this.activeLink=new kf(vt,this),vt.deps?(n.prevDep=vt.depsTail,vt.depsTail.nextDep=n,vt.depsTail=n):vt.deps=vt.depsTail=n,oc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const s=n.nextDep;s.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=s),n.prevDep=vt.depsTail,n.nextDep=void 0,vt.depsTail.nextDep=n,vt.depsTail=n,vt.deps===n&&(vt.deps=s)}return n}trigger(t){this.version++,Os++,this.notify(t)}notify(t){Ya();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Ja()}}}function oc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let s=t.deps;s;s=s.nextDep)oc(s)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const wa=new WeakMap,Mr=Symbol(""),_a=Symbol(""),Ms=Symbol("");function Bt(e,t,n){if(yn&&vt){let s=wa.get(e);s||wa.set(e,s=new Map);let o=s.get(n);o||(s.set(n,o=new Qa),o.map=s,o.key=n),o.track()}}function Kn(e,t,n,s,o,a){const c=wa.get(e);if(!c){Os++;return}const f=v=>{v&&v.trigger()};if(Ya(),t==="clear")c.forEach(f);else{const v=Re(e),y=v&&Ga(n);if(v&&n==="length"){const m=Number(s);c.forEach((_,S)=>{(S==="length"||S===Ms||!Pn(S)&&S>=m)&&f(_)})}else switch((n!==void 0||c.has(void 0))&&f(c.get(n)),y&&f(c.get(Ms)),t){case"add":v?y&&f(c.get("length")):(f(c.get(Mr)),sr(e)&&f(c.get(_a)));break;case"delete":v||(f(c.get(Mr)),sr(e)&&f(c.get(_a)));break;case"set":sr(e)&&f(c.get(Mr));break}}Ja()}function Wr(e){const t=lt(e);return t===e||(Bt(t,"iterate",Ms),cn(e))?t:Mn(e)?ir(e)?t.map(n=>lr(dn(n))):t.map(lr):t.map(dn)}function pi(e){return Bt(e=lt(e),"iterate",Ms),e}function Cn(e,t){return Mn(e)?lr(ir(e)?dn(t):t):dn(t)}const xf={__proto__:null,[Symbol.iterator](){return ia(this,Symbol.iterator,e=>Cn(this,e))},concat(...e){return Wr(this).concat(...e.map(t=>Re(t)?Wr(t):t))},entries(){return ia(this,"entries",e=>(e[1]=Cn(this,e[1]),e))},every(e,t){return Dn(this,"every",e,t,void 0,arguments)},filter(e,t){return Dn(this,"filter",e,t,n=>n.map(s=>Cn(this,s)),arguments)},find(e,t){return Dn(this,"find",e,t,n=>Cn(this,n),arguments)},findIndex(e,t){return Dn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Dn(this,"findLast",e,t,n=>Cn(this,n),arguments)},findLastIndex(e,t){return Dn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Dn(this,"forEach",e,t,void 0,arguments)},includes(...e){return aa(this,"includes",e)},indexOf(...e){return aa(this,"indexOf",e)},join(e){return Wr(this).join(e)},lastIndexOf(...e){return aa(this,"lastIndexOf",e)},map(e,t){return Dn(this,"map",e,t,void 0,arguments)},pop(){return ms(this,"pop")},push(...e){return ms(this,"push",e)},reduce(e,...t){return nu(this,"reduce",e,t)},reduceRight(e,...t){return nu(this,"reduceRight",e,t)},shift(){return ms(this,"shift")},some(e,t){return Dn(this,"some",e,t,void 0,arguments)},splice(...e){return ms(this,"splice",e)},toReversed(){return Wr(this).toReversed()},toSorted(e){return Wr(this).toSorted(e)},toSpliced(...e){return Wr(this).toSpliced(...e)},unshift(...e){return ms(this,"unshift",e)},values(){return ia(this,"values",e=>Cn(this,e))}};function ia(e,t,n){const s=pi(e),o=s[t],a=o.call(s);if(s!==e&&!cn(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>tu(a.next(),n),o!==ic[t]&&Object.defineProperties(c,{return:{get(){const f=a.return;return typeof f=="function"?f.bind(a):f}},throw:{get(){const f=a.throw;return typeof f=="function"?f.bind(a):f}}}),c}a._next=a.next,a.next=()=>tu(a._next(),n)}return a}function tu(e,t){return e.done||(e.value=t(e.value)),e}const ic=Array.prototype;function Dn(e,t,n,s,o,a){const c=pi(e),f=c!==e&&!cn(e),v=c[t];if(v!==ic[t]){const _=v.apply(e,a);return f?dn(_):_}let y=n;c!==e&&(f?y=function(_,S){return n.call(this,Cn(e,_),S,e)}:n.length>2&&(y=function(_,S){return n.call(this,_,S,e)}));const m=v.call(c,y,s);return f&&o?o(m):m}function nu(e,t,n,s){const o=pi(e),a=o!==e&&!cn(e);let c=n,f=!1;o!==e&&(a?(f=s.length===0,c=function(y,m,_){return f&&(f=!1,y=Cn(e,y)),n.call(this,y,Cn(e,m),_,e)}):n.length>3&&(c=function(y,m,_){return n.call(this,y,m,_,e)}));const v=o[t](c,...s);return f?Cn(e,v):v}function aa(e,t,n){const s=lt(e);Bt(s,"iterate",Ms);const o=s[t](...n);return(o===-1||o===!1)&&nl(n[0])?(n[0]=lt(n[0]),s[t](...n)):o}function ms(e,t,n=[]){An(),Ya();const s=lt(e)[t].apply(e,n);return Ja(),On(),s}const Cf=Wa("__proto__,__v_isRef,__isVue"),ac=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Pn));function Sf(e){Pn(e)||(e=String(e));const t=lt(this);return Bt(t,"has",e),t.hasOwnProperty(e)}class lc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,s){if(n==="__v_skip")return t.__v_skip;const o=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!o;if(n==="__v_isReadonly")return o;if(n==="__v_isShallow")return a;if(n==="__v_raw")return s===(o?a?Df:fc:a?dc:cc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(s)?t:void 0;const c=Re(t);if(!o){let v;if(c&&(v=xf[n]))return v;if(n==="hasOwnProperty")return Sf}const f=Reflect.get(t,n,Ht(t)?t:s);if((Pn(n)?ac.has(n):Cf(n))||(o||Bt(t,"get",n),a))return f;if(Ht(f)){const v=c&&Ga(n)?f:f.value;return o&&ct(v)?xa(v):v}return ct(f)?o?xa(f):el(f):f}}class uc extends lc{constructor(t=!1){super(!1,t)}set(t,n,s,o){let a=t[n];const c=Re(t)&&Ga(n);if(!this._isShallow){const y=Mn(a);if(!cn(s)&&!Mn(s)&&(a=lt(a),s=lt(s)),!c&&Ht(a)&&!Ht(s))return y||(a.value=s),!0}const f=c?Number(n)<t.length:ut(t,n),v=Reflect.set(t,n,s,Ht(t)?t:o);return t===lt(o)&&v&&(f?$n(s,a)&&Kn(t,"set",n,s):Kn(t,"add",n,s)),v}deleteProperty(t,n){const s=ut(t,n);t[n];const o=Reflect.deleteProperty(t,n);return o&&s&&Kn(t,"delete",n,void 0),o}has(t,n){const s=Reflect.has(t,n);return(!Pn(n)||!ac.has(n))&&Bt(t,"has",n),s}ownKeys(t){return Bt(t,"iterate",Re(t)?"length":Mr),Reflect.ownKeys(t)}}class Ef extends lc{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const $f=new uc,Tf=new Ef,Pf=new uc(!0);const ka=e=>e,ko=e=>Reflect.getPrototypeOf(e);function Af(e,t,n){return function(...s){const o=this.__v_raw,a=lt(o),c=sr(a),f=e==="entries"||e===Symbol.iterator&&c,v=e==="keys"&&c,y=o[e](...s),m=n?ka:t?lr:dn;return!t&&Bt(a,"iterate",v?_a:Mr),$t(Object.create(y),{next(){const{value:_,done:S}=y.next();return S?{value:_,done:S}:{value:f?[m(_[0]),m(_[1])]:m(_),done:S}}})}}function xo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Of(e,t){const n={get(o){const a=this.__v_raw,c=lt(a),f=lt(o);e||($n(o,f)&&Bt(c,"get",o),Bt(c,"get",f));const{has:v}=ko(c),y=t?ka:e?lr:dn;if(v.call(c,o))return y(a.get(o));if(v.call(c,f))return y(a.get(f));a!==c&&a.get(o)},get size(){const o=this.__v_raw;return!e&&Bt(lt(o),"iterate",Mr),o.size},has(o){const a=this.__v_raw,c=lt(a),f=lt(o);return e||($n(o,f)&&Bt(c,"has",o),Bt(c,"has",f)),o===f?a.has(o):a.has(o)||a.has(f)},forEach(o,a){const c=this,f=c.__v_raw,v=lt(f),y=t?ka:e?lr:dn;return!e&&Bt(v,"iterate",Mr),f.forEach((m,_)=>o.call(a,y(m),y(_),c))}};return $t(n,e?{add:xo("add"),set:xo("set"),delete:xo("delete"),clear:xo("clear")}:{add(o){const a=lt(this),c=ko(a),f=lt(o),v=!t&&!cn(o)&&!Mn(o)?f:o;return c.has.call(a,v)||$n(o,v)&&c.has.call(a,o)||$n(f,v)&&c.has.call(a,f)||(a.add(v),Kn(a,"add",v,v)),this},set(o,a){!t&&!cn(a)&&!Mn(a)&&(a=lt(a));const c=lt(this),{has:f,get:v}=ko(c);let y=f.call(c,o);y||(o=lt(o),y=f.call(c,o));const m=v.call(c,o);return c.set(o,a),y?$n(a,m)&&Kn(c,"set",o,a):Kn(c,"add",o,a),this},delete(o){const a=lt(this),{has:c,get:f}=ko(a);let v=c.call(a,o);v||(o=lt(o),v=c.call(a,o)),f&&f.call(a,o);const y=a.delete(o);return v&&Kn(a,"delete",o,void 0),y},clear(){const o=lt(this),a=o.size!==0,c=o.clear();return a&&Kn(o,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(o=>{n[o]=Af(o,e,t)}),n}function Za(e,t){const n=Of(e,t);return(s,o,a)=>o==="__v_isReactive"?!e:o==="__v_isReadonly"?e:o==="__v_isShallow"?t:o==="__v_raw"?s:Reflect.get(ut(n,o)&&o in s?n:s,o,a)}const Mf={get:Za(!1,!1)},If={get:Za(!1,!0)},jf={get:Za(!0,!1)};const cc=new WeakMap,dc=new WeakMap,fc=new WeakMap,Df=new WeakMap;function Lf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function el(e){return Mn(e)?e:tl(e,!1,$f,Mf,cc)}function Rf(e){return tl(e,!1,Pf,If,dc)}function xa(e){return tl(e,!0,Tf,jf,fc)}function tl(e,t,n,s,o){if(!ct(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=o.get(e);if(a)return a;const c=Lf(of(e));if(c===0)return e;const f=new Proxy(e,c===2?s:n);return o.set(e,f),f}function ir(e){return Mn(e)?ir(e.__v_raw):!!(e&&e.__v_isReactive)}function Mn(e){return!!(e&&e.__v_isReadonly)}function cn(e){return!!(e&&e.__v_isShallow)}function nl(e){return e?!!e.__v_raw:!1}function lt(e){const t=e&&e.__v_raw;return t?lt(t):e}function Kf(e){return!ut(e,"__v_skip")&&Object.isExtensible(e)&&Gu(e,"__v_skip",!0),e}const dn=e=>ct(e)?el(e):e,lr=e=>ct(e)?xa(e):e;function Ht(e){return e?e.__v_isRef===!0:!1}function L(e){return Ff(e,!1)}function Ff(e,t){return Ht(e)?e:new Nf(e,t)}class Nf{constructor(t,n){this.dep=new Qa,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:lt(t),this._value=n?t:dn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,s=this.__v_isShallow||cn(t)||Mn(t);t=s?t:lt(t),$n(t,n)&&(this._rawValue=t,this._value=s?t:dn(t),this.dep.trigger())}}function Ut(e){return Ht(e)?e.value:e}const Vf={get:(e,t,n)=>t==="__v_raw"?e:Ut(Reflect.get(e,t,n)),set:(e,t,n,s)=>{const o=e[t];return Ht(o)&&!Ht(n)?(o.value=n,!0):Reflect.set(e,t,n,s)}};function pc(e){return ir(e)?e:new Proxy(e,Vf)}class Bf{constructor(t,n,s){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Qa(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Os-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=s}notify(){if(this.flags|=16,!(this.flags&8)&&vt!==this)return ec(this,!0),!0}get value(){const t=this.dep.track();return rc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Uf(e,t,n=!1){let s,o;return We(e)?s=e:(s=e.get,o=e.set),new Bf(s,o,n)}const Co={},Fo=new WeakMap;let Er;function qf(e,t=!1,n=Er){if(n){let s=Fo.get(n);s||Fo.set(n,s=[]),s.push(e)}}function Hf(e,t,n=ft){const{immediate:s,deep:o,once:a,scheduler:c,augmentJob:f,call:v}=n,y=Z=>o?Z:cn(Z)||o===!1||o===0?Fn(Z,1):Fn(Z);let m,_,S,$,U=!1,re=!1;if(Ht(e)?(_=()=>e.value,U=cn(e)):ir(e)?(_=()=>y(e),U=!0):Re(e)?(re=!0,U=e.some(Z=>ir(Z)||cn(Z)),_=()=>e.map(Z=>{if(Ht(Z))return Z.value;if(ir(Z))return y(Z);if(We(Z))return v?v(Z,2):Z()})):We(e)?t?_=v?()=>v(e,2):e:_=()=>{if(S){An();try{S()}finally{On()}}const Z=Er;Er=m;try{return v?v(e,3,[$]):e($)}finally{Er=Z}}:_=Tn,t&&o){const Z=_,de=o===!0?1/0:o;_=()=>Fn(Z(),de)}const se=wf(),ie=()=>{m.stop(),se&&se.active&&za(se.effects,m)};if(a&&t){const Z=t;t=(...de)=>{try{return Z(...de)}finally{ie()}}}let T=re?new Array(e.length).fill(Co):Co;const I=Z=>{if(!(!(m.flags&1)||!m.dirty&&!Z))if(t){const de=m.run();if(Z||o||U||(re?de.some((ae,X)=>$n(ae,T[X])):$n(de,T))){const ae=Er;An();try{S&&S(),Er=m;const X=[de,T===Co?void 0:re&&T[0]===Co?[]:T,$];T=de,v?v(t,3,X):t(...X)}finally{Er=ae,On()}}}else m.run()};return f&&f(I),m=new Qu(_),m.scheduler=c?()=>c(I,!1):I,$=Z=>qf(Z,!1,m),S=m.onStop=()=>{const Z=Fo.get(m);if(Z){if(v)v(Z,4);else for(const de of Z)de();Fo.delete(m)}},t?s?I(!0):T=m.run():c?c(I.bind(null,!0),!0):m.run(),ie.pause=m.pause.bind(m),ie.resume=m.resume.bind(m),ie.stop=ie,ie}function Fn(e,t=1/0,n){if(t<=0||!ct(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ht(e))Fn(e.value,t,n);else if(Re(e))for(let s=0;s<e.length;s++)Fn(e[s],t,n);else if(jr(e)||sr(e))e.forEach(s=>{Fn(s,t,n)});else if(Wu(e)){for(const s in e)Fn(e[s],t,n);for(const s of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,s)&&Fn(e[s],t,n)}return e}/**
* @vue/runtime-core v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Hs(e,t,n,s){try{return s?e(...s):e()}catch(o){vi(o,t,n)}}function fn(e,t,n,s){if(We(e)){const o=Hs(e,t,n,s);return o&&qu(o)&&o.catch(a=>{vi(a,t,n)}),o}if(Re(e)){const o=[];for(let a=0;a<e.length;a++)o.push(fn(e[a],t,n,s));return o}}function vi(e,t,n,s=!0){const o=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:c}=t&&t.appContext.config||ft;if(t){let f=t.parent;const v=t.proxy,y=`https://vuejs.org/error-reference/#runtime-${n}`;for(;f;){const m=f.ec;if(m){for(let _=0;_<m.length;_++)if(m[_](e,v,y)===!1)return}f=f.parent}if(a){An(),Hs(a,null,10,[e,v,y]),On();return}}Wf(e,n,o,s,c)}function Wf(e,t,n,s=!0,o=!1){if(o)throw e;console.error(e)}const Xt=[];let hn=-1;const Sn=[];let nr=null,zr=0;const vc=Promise.resolve();let No=null;function ss(e){const t=No||vc;return e?t.then(this?e.bind(this):e):t}function zf(e){let t=hn+1,n=Xt.length;for(;t<n;){const s=t+n>>>1,o=Xt[s],a=Is(o);a<e||a===e&&o.flags&2?t=s+1:n=s}return t}function rl(e){if(!(e.flags&1)){const t=Is(e),n=Xt[Xt.length-1];!n||!(e.flags&2)&&t>=Is(n)?Xt.push(e):Xt.splice(zf(t),0,e),e.flags|=1,hc()}}function hc(){No||(No=vc.then(gc))}function Gf(e){if(!Re(e))nr&&e.id===-1?nr.splice(zr+1,0,e):e.flags&1||(Sn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)Sn.push(e[t]);hc()}function mc(e,t,n,s=hn+1){for(;s<Xt.length;s++){const o=Xt[s];if(o&&o.flags&2){if(e&&o.id!==e.uid||t!==void 0&&!(o.id>=t))continue;Xt.splice(s,1),s=e?s-1:hn,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function yc(e,t,n=0){if(Sn.length){let s=Sn,o=0;if(t){s=[];for(let c=0;c<Sn.length;c++){const f=Sn[c];(f.i!==void 0?!f.i||f.i.uid<n:t.has(f))?Sn[o++]=f:s.push(f)}}const a=[...new Set(s)].sort((c,f)=>Is(c)-Is(f));if(Sn.length=o,nr){for(let c=0;c<a.length;c++)nr.push(a[c]);return}for(nr=a,zr=0;zr<nr.length;zr++){const c=nr[zr];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}nr=null,zr=0}}let la=!1;function Yf(e,t){if(la){e();return}const n=t===void 0?void 0:new Set(Sn);e(),la=!0;try{mc(void 0,t),yc(void 0,n,t)}finally{la=!1}}const Is=e=>e.id==null?e.flags&2?-1:1/0:e.id;function gc(e){try{for(hn=0;hn<Xt.length;hn++){const t=Xt[hn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),Hs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;hn<Xt.length;hn++){const t=Xt[hn];t&&(t.flags&=-2)}hn=-1,Xt.length=0,yc(),No=null,(Xt.length||Sn.length)&&gc()}}let un=null,bc=null;function Vo(e){const t=un;return un=e,bc=e&&e.type.__scopeId||null,t}function fr(e,t=un,n){if(!t||e._n)return e;const s=(...o)=>{s._d&&Ho(-1);const a=Vo(t),c=Ir.length;let f;try{f=e(...o)}finally{for(let v=Ir.length;v>c;v--)zc();Vo(a),s._d&&Ho(1)}return f};return s._n=!0,s._c=!0,s._d=!0,s}function $e(e,t){if(un===null)return e;const n=wi(un),s=e.dirs||(e.dirs=[]);for(let o=0;o<t.length;o++){let[a,c,f,v=ft]=t[o];a&&(We(a)&&(a={mounted:a,updated:a}),a.deep&&Fn(c),s.push({dir:a,instance:n,value:c,oldValue:void 0,arg:f,modifiers:v}))}return e}function xr(e,t,n,s){const o=e.dirs,a=t&&t.dirs;for(let c=0;c<o.length;c++){const f=o[c];a&&(f.oldValue=a[c].value);let v=f.dir[s];v&&(An(),fn(v,n,8,[e.el,f,e,t]),On())}}function Jf(e,t){if(Qt){let n=Qt.provides;const s=Qt.parent&&Qt.parent.provides;s===n&&(n=Qt.provides=Object.create(s)),n[e]=t}}function Ao(e,t,n=!1){const s=ll();if(s||Jr){let o=Jr?Jr._context.provides:s?s.parent==null||s.ce?s.vnode.appContext&&s.vnode.appContext.provides:s.parent.provides:void 0;if(o&&e in o)return o[e];if(arguments.length>1)return n&&We(t)?t.call(s&&s.proxy):t}}const Xf=Symbol.for("v-scx"),Qf=()=>Ao(Xf);function ht(e,t,n){return wc(e,t,n)}function wc(e,t,n=ft){const{immediate:s,deep:o,flush:a,once:c}=n,f=$t({},n),v=t&&s||!t&&a!=="post";let y;if(Fs){if(a==="sync"){const $=Qf();y=$.__watcherHandles||($.__watcherHandles=[])}else if(!v){const $=()=>{};return $.stop=Tn,$.resume=Tn,$.pause=Tn,$}}const m=Qt;f.call=($,U,re)=>fn($,m,U,re);let _=!1;a==="post"?f.scheduler=$=>{$.i=m,Jt($,m&&m.suspense)}:a!=="sync"&&(_=!0,f.scheduler=($,U)=>{U?$():rl($)}),f.augmentJob=$=>{t&&($.flags|=4),_&&($.flags|=2,m&&($.id=m.uid,$.i=m))};const S=Hf(e,t,f);return Fs&&(y?y.push(S):v&&S()),S}function Zf(e,t,n){const s=this.proxy,o=bt(e)?e.includes(".")?_c(s,e):()=>s[e]:e.bind(s,s);let a;We(t)?a=t:(a=t.handler,n=t);const c=Ws(this),f=wc(o,a.bind(s),n);return c(),f}function _c(e,t){const n=t.split(".");return()=>{let s=e;for(let o=0;o<n.length&&s;o++)s=s[n[o]];return s}}const er=new WeakMap,kc=Symbol("_vte"),hi=e=>e.__isTeleport,$r=e=>e&&(e.disabled||e.disabled===""),ep=e=>e&&(e.defer||e.defer===""),ru=e=>typeof SVGElement<"u"&&e instanceof SVGElement,su=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Ca=(e,t)=>{const n=e&&e.to;return bt(n)?t?t(n):null:n},tp={name:"Teleport",__isTeleport:!0,process(e,t,n,s,o,a,c,f,v,y){const{mc:m,pc:_,pbc:S,o:{insert:$,querySelector:U,createText:re,createComment:se,parentNode:ie}}=y,T=$r(t.props);let{dynamicChildren:I}=t;const Z=(X,O,x)=>{X.shapeFlag&16&&m(X.children,O,x,o,a,c,f,v)},de=(X=t)=>{const O=$r(X.props),x=X.target=Ca(X.props,U),V=Sa(x,X,re,$);x&&(c!=="svg"&&ru(x)?c="svg":c!=="mathml"&&su(x)&&(c="mathml"),o&&o.isCE&&(o.ce._teleportTargets||(o.ce._teleportTargets=new Set)).add(x),O||(Z(X,x,V),bs(X,!1)))},ae=X=>{const O=()=>{if(er.get(X)===O){if(er.delete(X),$r(X.props)){const x=ie(X.el)||n;Z(X,x,X.anchor),bs(X,!0)}de(X)}};er.set(X,O),Jt(O,a)};if(e==null){const X=t.el=re(""),O=t.anchor=re("");if($(X,n,s),$(O,n,s),ep(t.props)||a&&a.pendingBranch){ae(t);return}T&&(Z(t,n,O),bs(t,!0)),de()}else{t.el=e.el;const X=t.anchor=e.anchor,O=er.get(e);if(O){O.flags|=8,er.delete(e),ae(t);return}t.targetStart=e.targetStart;const x=t.target=e.target,V=t.targetAnchor=e.targetAnchor,ue=$r(e.props),W=ue?n:x,ke=ue?X:V;if(c==="svg"||ru(x)?c="svg":(c==="mathml"||su(x))&&(c="mathml"),I?(S(e.dynamicChildren,I,W,o,a,c,f),al(e,t,!0)):v||_(e,t,W,ke,o,a,c,f,!1),T)ue?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):So(t,n,X,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Te=Ca(t.props,U);Te&&(t.target=Te,So(t,Te,null,y,0))}else ue&&So(t,x,V,y,1);bs(t,T)}},remove(e,t,n,{um:s,o:{remove:o}},a){const{shapeFlag:c,children:f,anchor:v,targetStart:y,targetAnchor:m,target:_,props:S}=e,$=$r(S),U=a||!$,re=er.get(e);if(re&&(re.flags|=8,er.delete(e)),_&&(o(y),o(m)),a&&o(v),!re&&($||_)&&c&16)for(let se=0;se<f.length;se++){const ie=f[se];s(ie,t,n,U,!!ie.dynamicChildren)}},move:So,hydrate:np};function So(e,t,n,{o:{insert:s},m:o},a=2){a===0&&(e.targetStart&&s(e.targetStart,t,n),s(e.targetAnchor,t,n),n=e.targetAnchor);const{el:c,anchor:f,shapeFlag:v,children:y,props:m}=e,_=a===2;if(_&&s(c,t,n),!er.has(e)&&(!_||$r(m))&&v&16)for(let S=0;S<y.length;S++)o(y[S],t,n,2);_&&s(f,t,n)}function np(e,t,n,s,o,a,{o:{nextSibling:c,parentNode:f,querySelector:v,insert:y,createText:m}},_){function S(se,ie){let T=ie;for(;T;){if(T&&T.nodeType===8){if(T.data==="teleport start anchor")t.targetStart=T;else if(T.data==="teleport anchor"){t.targetAnchor=T,se._lpa=t.targetAnchor&&c(t.targetAnchor);break}}T=c(T)}}function $(se,ie){ie.anchor=_(c(se),ie,f(se),n,s,o,a)}const U=t.target=Ca(t.props,v),re=$r(t.props);if(U){const se=U._lpa||U.firstChild;t.shapeFlag&16&&(re?($(e,t),S(U,se),t.targetAnchor||Sa(U,t,m,y,f(e)===U?e:null)):(t.anchor=c(e),S(U,se),t.targetAnchor||Sa(U,t,m,y),_(se&&c(se),t,U,n,s,o,a))),bs(t,re)}else re&&t.shapeFlag&16&&($(e,t),t.targetStart=e,t.targetAnchor=c(e));return t.anchor&&c(t.anchor)}const Dr=tp;function bs(e,t){const n=e.ctx;if(n&&n.ut){let s,o;for(t?(s=e.el,o=e.anchor):(s=e.targetStart,o=e.targetAnchor);s&&s!==o;)s.nodeType===1&&s.setAttribute("data-v-owner",n.uid),s=s.nextSibling;n.ut()}}function Sa(e,t,n,s,o=null){const a=t.targetStart=n(""),c=t.targetAnchor=n("");return a[kc]=c,e&&(s(a,e,o),s(c,e,o)),c}const ln=Symbol("_leaveCb"),ys=Symbol("_enterCb");function xc(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return pn(()=>{e.isMounted=!0}),Ac(()=>{e.isUnmounting=!0}),e}const an=[Function,Array],Cc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:an,onEnter:an,onAfterEnter:an,onEnterCancelled:an,onBeforeLeave:an,onLeave:an,onAfterLeave:an,onLeaveCancelled:an,onBeforeAppear:an,onAppear:an,onAfterAppear:an,onAppearCancelled:an},rp={name:"BaseTransition",props:Cc,setup(e,{slots:t}){const n=ll(),s=xc();return()=>{const o=t.default&&sl(t.default(),!0),a=o&&o.length?Sc(o):n.subTree?xe():void 0;if(!a)return;const c=lt(e),{mode:f}=c;if(s.isLeaving)return ua(a);const v=Bo(a);if(!v)return ua(a);let y=js(v,c,s,n,_=>y=_);v.type!==qt&&ur(v,y);let m=n.subTree&&Bo(n.subTree);if(m&&m.type!==qt&&!Tr(m,v)&&Ds(n.subTree)){let _=js(m,c,s,n);if(ur(m,_),f==="out-in"&&v.type!==qt)return s.isLeaving=!0,_.afterLeave=()=>{s.isLeaving=!1,n.job.flags&8||n.update(),delete _.afterLeave,m=void 0},ua(a);f==="in-out"&&v.type!==qt?_.delayLeave=(S,$,U)=>{const re=Ec(s,m);re[String(m.key)]=m,S[ln]=()=>{$(),S[ln]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{U(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return a}}};function Sc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==qt){t=n;break}}return t}const sp=rp;function Ec(e,t){const{leavingVNodes:n}=e;let s=n.get(t.type);return s||(s=Object.create(null),n.set(t.type,s)),s}function js(e,t,n,s,o){const{appear:a,mode:c,persisted:f=!1,onBeforeEnter:v,onEnter:y,onAfterEnter:m,onEnterCancelled:_,onBeforeLeave:S,onLeave:$,onAfterLeave:U,onLeaveCancelled:re,onBeforeAppear:se,onAppear:ie,onAfterAppear:T,onAppearCancelled:I}=t,Z=String(e.key),de=Ec(n,e),ae=(x,V)=>{x&&fn(x,s,9,V)},X=(x,V)=>{const ue=V[1];ae(x,V),Re(x)?x.every(W=>W.length<=1)&&ue():x.length<=1&&ue()},O={mode:c,persisted:f,beforeEnter(x){let V=v;if(!n.isMounted)if(a)V=se||v;else return;x[ln]&&x[ln](!0);const ue=de[Z];if(ue&&Tr(e,ue)){let W=ue.el[ln];if(!W){const ke=Ds(ue);W=ke&&ke.el[ln]}W&&W()}ae(V,[x])},enter(x){if(de[Z]===e)return;let V=y,ue=m,W=_;if(!n.isMounted)if(a)V=ie||y,ue=T||m,W=I||_;else return;let ke=!1;x[ys]=Je=>{ke||(ke=!0,Je?ae(W,[x]):ae(ue,[x]),O.delayedLeave&&O.delayedLeave(),x[ys]=void 0)};const Te=x[ys].bind(null,!1);V?X(V,[x,Te]):Te()},leave(x,V){const ue=String(e.key);if(x[ys]&&x[ys](!0),n.isUnmounting)return V();ae(S,[x]);let W=!1;x[ln]=Te=>{W||(W=!0,V(),Te?ae(re,[x]):ae(U,[x]),x[ln]=void 0,de[ue]===e&&delete de[ue])};const ke=x[ln].bind(null,!1);de[ue]=e,$?X($,[x,ke]):ke()},clone(x){const V=js(x,t,n,s,o);return o&&o(V),V}};return O}function ua(e){if(mi(e))return e=cr(e),e.children=null,e}function Bo(e){if(!mi(e))return hi(e.type)&&e.children?Sc(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&We(n.default))return n.default()}}function ur(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;ur(hi(n.type)&&Bo(n)||n,t)}else if(e.shapeFlag&128)e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback);else if(e.transition=t,e.type===je&&Re(e.children)){const n=Dc(e.children,!1);n&&ur(n,t)}}function sl(e,t=!1,n){let s=[],o=0;for(let a=0;a<e.length;a++){let c=e[a];const f=n==null?c.key:String(n)+String(c.key!=null?c.key:a);c.type===je?(c.patchFlag&128&&o++,s=s.concat(sl(c.children,t,f))):(t||c.type!==qt)&&s.push(f!=null?cr(c,{key:f}):c)}if(o>1)for(let a=0;a<s.length;a++)s[a].patchFlag=-2;return s}function Ds(e){if(e.component)return Ds(e.component.subTree);if(e.type===je){const t=Re(e.children)&&Dc(e.children,!1);return t?Ds(t):void 0}if(e.type!==qt)return e}function Rt(e,t){return We(e)?$t({name:e.name},t,{setup:e}):e}function $c(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function ou(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const Uo=new WeakMap;function Ss(e,t,n,s,o=!1){if(Re(e)){e.forEach((re,se)=>Ss(re,t&&(Re(t)?t[se]:t),n,s,o));return}if(Es(s)&&!o){s.shapeFlag&512&&s.type.__asyncResolved&&s.component.subTree.component&&Ss(e,t,n,s.component.subTree);return}const a=s.shapeFlag&4?wi(s.component):s.el,c=o?null:a,{i:f,r:v}=e,y=t&&t.r,m=f.refs===ft?f.refs={}:f.refs,_=f.setupState,S=lt(_),$=_===ft?Uu:re=>ou(m,re)?!1:ut(S,re),U=(re,se)=>!(se&&ou(m,se));if(y!=null&&y!==v){if(iu(t),bt(y))m[y]=null,$(y)&&(_[y]=null);else if(Ht(y)){const re=t;U(y,re.k)&&(y.value=null),re.k&&(m[re.k]=null)}}if(We(v))Hs(v,f,12,[c,m]);else{const re=bt(v),se=Ht(v);if(re||se){const ie=()=>{if(e.f){const T=re?$(v)?_[v]:m[v]:U()||!e.k?v.value:m[e.k];if(o)Re(T)&&za(T,a);else if(Re(T))T.includes(a)||T.push(a);else if(re)m[v]=[a],$(v)&&(_[v]=m[v]);else{const I=[a];U(v,e.k)&&(v.value=I),e.k&&(m[e.k]=I)}}else re?(m[v]=c,$(v)&&(_[v]=c)):se&&(U(v,e.k)&&(v.value=c),e.k&&(m[e.k]=c))};if(c){const T=()=>{ie(),Uo.delete(e)};T.id=-1,Uo.set(e,T),Jt(T,n)}else iu(e),ie()}}}function iu(e){const t=Uo.get(e);t&&(t.flags|=8,Uo.delete(e))}fi().requestIdleCallback;fi().cancelIdleCallback;const Es=e=>!!e.type.__asyncLoader,mi=e=>e.type.__isKeepAlive;function op(e,t){Tc(e,"a",t)}function ip(e,t){Tc(e,"da",t)}function Tc(e,t,n=Qt){const s=e.__wdc||(e.__wdc=()=>{let o=n;for(;o;){if(o.isDeactivated)return;o=o.parent}return e()});if(yi(t,s,n),n){let o=n.parent;for(;o&&o.parent;)mi(o.parent.vnode)&&ap(s,t,n,o),o=o.parent}}function ap(e,t,n,s){const o=yi(t,e,s,!0);pr(()=>{za(s[t],o)},n)}function yi(e,t,n=Qt,s=!1){if(n){const o=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...c)=>{An();const f=Ws(n),v=fn(t,n,e,c);return f(),On(),v});return s?o.unshift(a):o.push(a),a}}const Hn=e=>(t,n=Qt)=>{(!Fs||e==="sp")&&yi(e,(...s)=>t(...s),n)},lp=Hn("bm"),pn=Hn("m"),up=Hn("bu"),Pc=Hn("u"),Ac=Hn("bum"),pr=Hn("um"),cp=Hn("sp"),dp=Hn("rtg"),fp=Hn("rtc");function pp(e,t=Qt){yi("ec",e,t)}const vp=Symbol.for("v-ndc");function ot(e,t,n,s){let o;const a=n,c=Re(e);if(c||bt(e)){const f=c&&ir(e);let v=!1,y=!1;f&&(v=!cn(e),y=Mn(e),e=pi(e)),o=new Array(e.length);for(let m=0,_=e.length;m<_;m++)o[m]=t(v?y?lr(dn(e[m])):dn(e[m]):e[m],m,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)o=[];else{o=new Array(e);for(let f=0;f<e;f++)o[f]=t(f+1,f,void 0,a)}else if(ct(e))if(e[Symbol.iterator])o=Array.from(e,(f,v)=>t(f,v,void 0,a));else{const f=Object.keys(e);o=new Array(f.length);for(let v=0,y=f.length;v<y;v++){const m=f[v];o[v]=t(e[m],m,v,a)}}else o=[];return o}const Ea=e=>e?Xc(e)?wi(e):Ea(e.parent):null,$s=$t(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=>Ea(e.parent),$root:e=>Ea(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Mc(e),$forceUpdate:e=>e.f||(e.f=()=>{rl(e.update)}),$nextTick:e=>e.n||(e.n=ss.bind(e.proxy)),$watch:e=>Zf.bind(e)}),ca=(e,t)=>e!==ft&&!e.__isScriptSetup&&ut(e,t),hp={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:s,data:o,props:a,accessCache:c,type:f,appContext:v}=e;if(t[0]!=="$"){const S=c[t];if(S!==void 0)switch(S){case 1:return s[t];case 2:return o[t];case 4:return n[t];case 3:return a[t]}else{if(ca(s,t))return c[t]=1,s[t];if(o!==ft&&ut(o,t))return c[t]=2,o[t];if(ut(a,t))return c[t]=3,a[t];if(n!==ft&&ut(n,t))return c[t]=4,n[t];$a&&(c[t]=0)}}const y=$s[t];let m,_;if(y)return t==="$attrs"&&Bt(e.attrs,"get",""),y(e);if((m=f.__cssModules)&&(m=m[t]))return m;if(n!==ft&&ut(n,t))return c[t]=4,n[t];if(_=v.config.globalProperties,ut(_,t))return _[t]},set({_:e},t,n){const{data:s,setupState:o,ctx:a}=e;return ca(o,t)?(o[t]=n,!0):s!==ft&&ut(s,t)?(s[t]=n,!0):ut(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:s,appContext:o,props:a,type:c}},f){let v;return!!(n[f]||e!==ft&&f[0]!=="$"&&ut(e,f)||ca(t,f)||ut(a,f)||ut(s,f)||ut($s,f)||ut(o.config.globalProperties,f)||(v=c.__cssModules)&&v[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:ut(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function au(e){return Re(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let $a=!0;function mp(e){const t=Mc(e),n=e.proxy,s=e.ctx;$a=!1,t.beforeCreate&&lu(t.beforeCreate,e,"bc");const{data:o,computed:a,methods:c,watch:f,provide:v,inject:y,created:m,beforeMount:_,mounted:S,beforeUpdate:$,updated:U,activated:re,deactivated:se,beforeDestroy:ie,beforeUnmount:T,destroyed:I,unmounted:Z,render:de,renderTracked:ae,renderTriggered:X,errorCaptured:O,serverPrefetch:x,expose:V,inheritAttrs:ue,components:W,directives:ke,filters:Te}=t;if(y&&yp(y,s,null),c)for(const qe in c){const Ke=c[qe];We(Ke)&&(s[qe]=Ke.bind(n))}if(o){const qe=o.call(n,n);ct(qe)&&(e.data=el(qe))}if($a=!0,a)for(const qe in a){const Ke=a[qe],it=We(Ke)?Ke.bind(n,n):We(Ke.get)?Ke.get.bind(n,n):Tn,Ge=!We(Ke)&&We(Ke.set)?Ke.set.bind(n):Tn,Qe=st({get:it,set:Ge});Object.defineProperty(s,qe,{enumerable:!0,configurable:!0,get:()=>Qe.value,set:Ce=>Qe.value=Ce})}if(f)for(const qe in f)Oc(f[qe],s,n,qe);if(v){const qe=We(v)?v.call(n):v;Reflect.ownKeys(qe).forEach(Ke=>{Jf(Ke,qe[Ke])})}m&&lu(m,e,"c");function Le(qe,Ke){Re(Ke)?Ke.forEach(it=>qe(it.bind(n))):Ke&&qe(Ke.bind(n))}if(Le(lp,_),Le(pn,S),Le(up,$),Le(Pc,U),Le(op,re),Le(ip,se),Le(pp,O),Le(fp,ae),Le(dp,X),Le(Ac,T),Le(pr,Z),Le(cp,x),Re(V))if(V.length){const qe=e.exposed||(e.exposed={});V.forEach(Ke=>{Object.defineProperty(qe,Ke,{get:()=>n[Ke],set:it=>n[Ke]=it,enumerable:!0})})}else e.exposed||(e.exposed={});de&&e.render===Tn&&(e.render=de),ue!=null&&(e.inheritAttrs=ue),W&&(e.components=W),ke&&(e.directives=ke),x&&$c(e)}function yp(e,t,n=Tn){Re(e)&&(e=Ta(e));for(const s in e){const o=e[s];let a;ct(o)?"default"in o?a=Ao(o.from||s,o.default,!0):a=Ao(o.from||s):a=Ao(o),Ht(a)?Object.defineProperty(t,s,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[s]=a}}function lu(e,t,n){fn(Re(e)?e.map(s=>s.bind(t.proxy)):e.bind(t.proxy),t,n)}function Oc(e,t,n,s){let o=s.includes(".")?_c(n,s):()=>n[s];if(bt(e)){const a=t[e];We(a)&&ht(o,a)}else if(We(e))ht(o,e.bind(n));else if(ct(e))if(Re(e))e.forEach(a=>Oc(a,t,n,s));else{const a=We(e.handler)?e.handler.bind(n):t[e.handler];We(a)&&ht(o,a,e)}}function Mc(e){const t=e.type,{mixins:n,extends:s}=t,{mixins:o,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,f=a.get(t);let v;return f?v=f:!o.length&&!n&&!s?v=t:(v={},o.length&&o.forEach(y=>qo(v,y,c,!0)),qo(v,t,c)),ct(t)&&a.set(t,v),v}function qo(e,t,n,s=!1){const{mixins:o,extends:a}=t;a&&qo(e,a,n,!0),o&&o.forEach(c=>qo(e,c,n,!0));for(const c in t)if(!(s&&c==="expose")){const f=gp[c]||n&&n[c];e[c]=f?f(e[c],t[c]):t[c]}return e}const gp={data:uu,props:cu,emits:cu,methods:ws,computed:ws,beforeCreate:Yt,created:Yt,beforeMount:Yt,mounted:Yt,beforeUpdate:Yt,updated:Yt,beforeDestroy:Yt,beforeUnmount:Yt,destroyed:Yt,unmounted:Yt,activated:Yt,deactivated:Yt,errorCaptured:Yt,serverPrefetch:Yt,components:ws,directives:ws,watch:wp,provide:uu,inject:bp};function uu(e,t){return t?e?function(){return $t(We(e)?e.call(this,this):e,We(t)?t.call(this,this):t)}:t:e}function bp(e,t){return ws(Ta(e),Ta(t))}function Ta(e){if(Re(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Yt(e,t){return e?[...new Set([].concat(e,t))]:t}function ws(e,t){return e?$t(Object.create(null),e,t):t}function cu(e,t){return e?Re(e)&&Re(t)?[...new Set([...e,...t])]:$t(Object.create(null),au(e),au(t??{})):t}function wp(e,t){if(!e)return t;if(!t)return e;const n=$t(Object.create(null),e);for(const s in t)n[s]=Yt(e[s],t[s]);return n}function Ic(){return{app:null,config:{isNativeTag:Uu,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 _p=0;function kp(e,t){return function(s,o=null){We(s)||(s=$t({},s)),o!=null&&!ct(o)&&(o=null);const a=Ic(),c=new WeakSet,f=[];let v=!1;const y=a.app={_uid:_p++,_component:s,_props:o,_container:null,_context:a,_instance:null,version:ev,get config(){return a.config},set config(m){},use(m,..._){return c.has(m)||(m&&We(m.install)?(c.add(m),m.install(y,..._)):We(m)&&(c.add(m),m(y,..._))),y},mixin(m){return a.mixins.includes(m)||a.mixins.push(m),y},component(m,_){return _?(a.components[m]=_,y):a.components[m]},directive(m,_){return _?(a.directives[m]=_,y):a.directives[m]},mount(m,_,S){if(!v){const $=y._ceVNode||Ee(s,o);return $.appContext=a,S===!0?S="svg":S===!1&&(S=void 0),e($,m,S),v=!0,y._container=m,m.__vue_app__=y,wi($.component)}},onUnmount(m){f.push(m)},unmount(){v&&(fn(f,y._instance,16),e(null,y._container),delete y._container.__vue_app__)},provide(m,_){return a.provides[m]=_,y},runWithContext(m){const _=Jr;Jr=y;try{return m()}finally{Jr=_}}};return y}}let Jr=null;const xp=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${mn(t)}Modifiers`]||e[`${dr(t)}Modifiers`];function Cp(e,t,...n){if(e.isUnmounted)return;const s=e.vnode.props||ft;let o=n;const a=t.startsWith("update:"),c=a&&xp(s,t.slice(7));c&&(c.trim&&(o=n.map(m=>bt(m)?m.trim():m)),c.number&&(o=o.map(di)));let f,v=s[f=ra(t)]||s[f=ra(mn(t))];!v&&a&&(v=s[f=ra(dr(t))]),v&&fn(v,e,6,o);const y=s[f+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,fn(y,e,6,o)}}const Sp=new WeakMap;function jc(e,t,n=!1){const s=n?Sp:t.emitsCache,o=s.get(e);if(o!==void 0)return o;const a=e.emits;let c={},f=!1;if(!We(e)){const v=y=>{const m=jc(y,t,!0);m&&(f=!0,$t(c,m))};!n&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}return!a&&!f?(ct(e)&&s.set(e,null),null):(Re(a)?a.forEach(v=>c[v]=null):$t(c,a),ct(e)&&s.set(e,c),c)}function gi(e,t){return!e||!li(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ut(e,t[0].toLowerCase()+t.slice(1))||ut(e,dr(t))||ut(e,t))}function du(e){const{type:t,vnode:n,proxy:s,withProxy:o,propsOptions:[a],slots:c,attrs:f,emit:v,render:y,renderCache:m,props:_,data:S,setupState:$,ctx:U,inheritAttrs:re}=e,se=Vo(e);let ie,T;try{if(n.shapeFlag&4){const Z=o||s,de=Z;ie=En(y.call(de,Z,m,_,$,S,U)),T=f}else{const Z=t;ie=En(Z.length>1?Z(_,{attrs:f,slots:c,emit:v}):Z(_,null)),T=t.props?f:Ep(f)}}catch(Z){Ir.length=0,vi(Z,e,1),ie=Ee(qt)}let I=ie;if(T&&re!==!1){const Z=Object.keys(T),{shapeFlag:de}=I;Z.length&&de&7&&(a&&Z.some(ui)&&(T=$p(T,a)),I=cr(I,T,!1,!0))}if(n.dirs&&(I=cr(I,null,!1,!0),I.dirs=I.dirs?I.dirs.concat(n.dirs):n.dirs),n.transition){const Z=hi(I.type)&&Bo(I)||I;ur(Z,n.transition)}return ie=I,Vo(se),ie}function Dc(e,t=!0){let n;for(let s=0;s<e.length;s++){const o=e[s];if(Rs(o)){if(o.type!==qt||o.children==="v-if"){if(n)return;n=o}}else return}return n}const Ep=e=>{let t;for(const n in e)(n==="class"||n==="style"||li(n))&&((t||(t={}))[n]=e[n]);return t},$p=(e,t)=>{const n={};for(const s in e)(!ui(s)||!(s.slice(9)in t))&&(n[s]=e[s]);return n};function Tp(e,t,n){const{props:s,children:o,component:a}=e,{props:c,children:f,patchFlag:v}=t,y=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&v>=0){if(v&1024)return!0;if(v&16)return s?fu(s,c,y):!!c;if(v&8){const m=t.dynamicProps;for(let _=0;_<m.length;_++){const S=m[_];if(Lc(c,s,S)&&!gi(y,S))return!0}}}else return(o||f)&&(!f||!f.$stable)?!0:s===c?!1:s?c?fu(s,c,y):!0:!!c;return!1}function fu(e,t,n){const s=Object.keys(t);if(s.length!==Object.keys(e).length)return!0;for(let o=0;o<s.length;o++){const a=s[o];if(!ut(e,a)||Lc(t,e,a)&&!gi(n,a))return!0}return!1}function Lc(e,t,n){const s=e[n],o=t[n];return n==="style"&&ct(s)&&ct(o)?!ar(s,o):s!==o}function Pp({vnode:e,parent:t,suspense:n},s){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.suspense.vnode.el=o.el=s,e=o),o===e)(e=t.vnode).el=s,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=s)}const Rc={},Kc=()=>Object.create(Rc),Fc=e=>Object.getPrototypeOf(e)===Rc;function Ap(e,t,n,s=!1){const o={},a=Kc();e.propsDefaults=Object.create(null),Nc(e,t,o,a);for(const c in e.propsOptions[0])c in o||(o[c]=void 0);n?e.props=s?o:Rf(o):e.type.props?e.props=o:e.props=a,e.attrs=a}function Op(e,t,n,s){const{props:o,attrs:a,vnode:{patchFlag:c}}=e,f=lt(o),[v]=e.propsOptions;let y=!1;if((s||c>0)&&!(c&16)){if(c&8){const m=e.vnode.dynamicProps;for(let _=0;_<m.length;_++){let S=m[_];if(gi(e.emitsOptions,S))continue;const $=t[S];if(v)if(ut(a,S))$!==a[S]&&(a[S]=$,y=!0);else{const U=mn(S);o[U]=Pa(v,f,U,$,e,!1)}else $!==a[S]&&(a[S]=$,y=!0)}}}else{Nc(e,t,o,a)&&(y=!0);let m;for(const _ in f)(!t||!ut(t,_)&&((m=dr(_))===_||!ut(t,m)))&&(v?n&&(n[_]!==void 0||n[m]!==void 0)&&(o[_]=Pa(v,f,_,void 0,e,!0)):delete o[_]);if(a!==f)for(const _ in a)(!t||!ut(t,_))&&(delete a[_],y=!0)}y&&Kn(e.attrs,"set","")}function Nc(e,t,n,s){const[o,a]=e.propsOptions;let c=!1,f;if(t)for(let v in t){if(ks(v))continue;const y=t[v];let m;o&&ut(o,m=mn(v))?!a||!a.includes(m)?n[m]=y:(f||(f={}))[m]=y:gi(e.emitsOptions,v)||(!(v in s)||y!==s[v])&&(s[v]=y,c=!0)}if(a){const v=lt(n),y=f||ft;for(let m=0;m<a.length;m++){const _=a[m];n[_]=Pa(o,v,_,y[_],e,!ut(y,_))}}return c}function Pa(e,t,n,s,o,a){const c=e[n];if(c!=null){const f=ut(c,"default");if(f&&s===void 0){const v=c.default;if(c.type!==Function&&!c.skipFactory&&We(v)){const{propsDefaults:y}=o;if(n in y)s=y[n];else{const m=Ws(o);s=y[n]=v.call(null,t),m()}}else s=v;o.ce&&o.ce._setProp(n,s)}c[0]&&(a&&!f?s=!1:c[1]&&(s===""||s===dr(n))&&(s=!0))}return s}const Mp=new WeakMap;function Vc(e,t,n=!1){const s=n?Mp:t.propsCache,o=s.get(e);if(o)return o;const a=e.props,c={},f=[];let v=!1;if(!We(e)){const m=_=>{v=!0;const[S,$]=Vc(_,t,!0);$t(c,S),$&&f.push(...$)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!a&&!v)return ct(e)&&s.set(e,Ar),Ar;if(Re(a))for(let m=0;m<a.length;m++){const _=mn(a[m]);pu(_)&&(c[_]=ft)}else if(a)for(const m in a){const _=mn(m);if(pu(_)){const S=a[m],$=c[_]=Re(S)||We(S)?{type:S}:$t({},S),U=$.type;let re=!1,se=!0;if(Re(U))for(let ie=0;ie<U.length;++ie){const T=U[ie],I=We(T)&&T.name;if(I==="Boolean"){re=!0;break}else I==="String"&&(se=!1)}else re=We(U)&&U.name==="Boolean";$[0]=re,$[1]=se,(re||ut($,"default"))&&f.push(_)}}const y=[c,f];return ct(e)&&s.set(e,y),y}function pu(e){return e[0]!=="$"&&!ks(e)}const ol=e=>e==="_"||e==="_ctx"||e==="$stable",il=e=>Re(e)?e.map(En):[En(e)],Ip=(e,t,n)=>{if(t._n)return t;const s=fr((...o)=>il(t(...o)),n);return s._c=!1,s},Bc=(e,t,n)=>{const s=e._ctx;for(const o in e){if(ol(o))continue;const a=e[o];if(We(a))t[o]=Ip(o,a,s);else if(a!=null){const c=il(a);t[o]=()=>c}}},Uc=(e,t)=>{const n=il(t);e.slots.default=()=>n},qc=(e,t,n)=>{for(const s in t)(n||!ol(s))&&(e[s]=t[s])},jp=(e,t,n)=>{const s=e.slots=Kc();if(e.vnode.shapeFlag&32){const o=t._;o?(qc(s,t,n),n&&Gu(s,"_",o,!0)):Bc(t,s)}else t&&Uc(e,t)},Dp=(e,t,n)=>{const{vnode:s,slots:o}=e;let a=!0,c=ft;if(s.shapeFlag&32){const f=t._;f?n&&f===1?a=!1:qc(o,t,n):(a=!t.$stable,Bc(t,o)),c=t}else t&&(Uc(e,t),c={default:1});if(a)for(const f in o)!ol(f)&&c[f]==null&&delete o[f]},Jt=Np;function Lp(e){return Rp(e)}function Rp(e,t){const n=fi();n.__VUE__=!0;const{insert:s,remove:o,patchProp:a,createElement:c,createText:f,createComment:v,setText:y,setElementText:m,parentNode:_,nextSibling:S,setScopeId:$=Tn,insertStaticContent:U}=e,re=(b,g,C,Y=null,R=null,le=null,ge=void 0,me=null,ce=!!g.dynamicChildren)=>{if(b===g)return;b&&!Tr(b,g)&&(Y=dt(b),Ce(b,R,le,!0),b=null),g.patchFlag===-2&&(ce=!1,g.dynamicChildren=null),g.dynamicChildren&&b&&b.dynamicChildren&&b.dynamicChildren.hasOnce&&(g.dynamicChildren===Ar&&(g.dynamicChildren=[]),g.dynamicChildren.hasOnce=!0);const{type:z,ref:G,shapeFlag:Q}=g;switch(z){case bi:se(b,g,C,Y);break;case qt:ie(b,g,C,Y);break;case Oo:b==null&&T(g,C,Y,ge);break;case je:W(b,g,C,Y,R,le,ge,me,ce);break;default:Q&1?de(b,g,C,Y,R,le,ge,me,ce):Q&6?ke(b,g,C,Y,R,le,ge,me,ce):(Q&64||Q&128)&&z.process(b,g,C,Y,R,le,ge,me,ce,Ot)}G!=null&&R?Ss(G,b&&b.ref,le,g||b,!g):G==null&&b&&b.ref!=null&&Ss(b.ref,null,le,b,!0)},se=(b,g,C,Y)=>{if(b==null)s(g.el=f(g.children),C,Y);else{const R=g.el=b.el;g.children!==b.children&&y(R,g.children)}},ie=(b,g,C,Y)=>{b==null?s(g.el=v(g.children||""),C,Y):g.el=b.el},T=(b,g,C,Y)=>{[b.el,b.anchor]=U(b.children,g,C,Y,b.el,b.anchor)},I=({el:b,anchor:g},C,Y)=>{let R;for(;b&&b!==g;)R=S(b),s(b,C,Y),b=R;s(g,C,Y)},Z=({el:b,anchor:g})=>{let C;for(;b&&b!==g;)C=S(b),o(b),b=C;o(g)},de=(b,g,C,Y,R,le,ge,me,ce)=>{if(g.type==="svg"?ge="svg":g.type==="math"&&(ge="mathml"),b==null)ae(g,C,Y,R,le,ge,me,ce);else{const z=b.el&&b.el._isVueCE?b.el:null;try{z&&z._beginPatch(),x(b,g,R,le,ge,me,ce)}finally{z&&z._endPatch()}}},ae=(b,g,C,Y,R,le,ge,me)=>{let ce,z;const{props:G,shapeFlag:Q,transition:Pe,dirs:Ve}=b;if(ce=b.el=c(b.type,le,G&&G.is,G),Q&8?m(ce,b.children):Q&16&&O(b.children,ce,null,Y,R,da(b,le),ge,me),Ve&&xr(b,null,Y,"created"),X(ce,b,b.scopeId,ge,Y),G){for(const Ye in G)Ye!=="value"&&!ks(Ye)&&a(ce,Ye,null,G[Ye],le,Y);"value"in G&&a(ce,"value",null,G.value,le),(z=G.onVnodeBeforeMount)&&_n(z,Y,b)}Ve&&xr(b,null,Y,"beforeMount");const Ze=Kp(R,Pe);Ze&&Pe.beforeEnter(ce),s(ce,g,C),((z=G&&G.onVnodeMounted)||Ze||Ve)&&Jt(()=>{try{z&&_n(z,Y,b),Ze&&Pe.enter(ce),Ve&&xr(b,null,Y,"mounted")}finally{}},R)},X=(b,g,C,Y,R)=>{if(C&&$(b,C),Y)for(let le=0;le<Y.length;le++)$(b,Y[le]);if(R){let le=R.subTree;if(g===le||Wc(le.type)&&(le.ssContent===g||le.ssFallback===g)){const ge=R.vnode;X(b,ge,ge.scopeId,ge.slotScopeIds,R.parent)}}},O=(b,g,C,Y,R,le,ge,me,ce=0)=>{for(let z=ce;z<b.length;z++){const G=b[z]=me?Rn(b[z]):En(b[z]);re(null,G,g,C,Y,R,le,ge,me)}},x=(b,g,C,Y,R,le,ge)=>{const me=g.el=b.el;let{patchFlag:ce,dynamicChildren:z,dirs:G}=g;ce|=b.patchFlag&16;const Q=b.props||ft,Pe=g.props||ft;let Ve;if(C&&Cr(C,!1),(Ve=Pe.onVnodeBeforeUpdate)&&_n(Ve,C,g,b),G&&xr(g,b,C,"beforeUpdate"),C&&Cr(C,!0),z&&(!b.dynamicChildren||b.dynamicChildren.length!==z.length)&&(ce=0,ge=!1,z=null),(Q.innerHTML&&Pe.innerHTML==null||Q.textContent&&Pe.textContent==null)&&m(me,""),z?V(b.dynamicChildren,z,me,C,Y,da(g,R),le):ge||Ke(b,g,me,null,C,Y,da(g,R),le,!1),ce>0){if(ce&16)ue(me,Q,Pe,C,R);else if(ce&2&&Q.class!==Pe.class&&a(me,"class",null,Pe.class,R),ce&4&&a(me,"style",Q.style,Pe.style,R),ce&8){const Ze=g.dynamicProps;for(let Ye=0;Ye<Ze.length;Ye++){const tt=Ze[Ye],mt=Q[tt],kt=Pe[tt];(kt!==mt||tt==="value")&&a(me,tt,mt,kt,R,C)}}ce&1&&b.children!==g.children&&m(me,g.children)}else!ge&&z==null&&ue(me,Q,Pe,C,R);((Ve=Pe.onVnodeUpdated)||G)&&Jt(()=>{Ve&&_n(Ve,C,g,b),G&&xr(g,b,C,"updated")},Y)},V=(b,g,C,Y,R,le,ge)=>{for(let me=0;me<g.length;me++){const ce=b[me],z=g[me],G=ce.el||Aa(ce),Q=G&&(ce.type===je||!Tr(ce,z)||ce.shapeFlag&198)?_(G):C;re(ce,z,Q,null,Y,R,le,ge,!0)}},ue=(b,g,C,Y,R)=>{if(g!==C){if(g!==ft)for(const le in g)!ks(le)&&!(le in C)&&a(b,le,g[le],null,R,Y);for(const le in C){if(ks(le))continue;const ge=C[le],me=g[le];ge!==me&&le!=="value"&&a(b,le,me,ge,R,Y)}"value"in C&&a(b,"value",g.value,C.value,R)}},W=(b,g,C,Y,R,le,ge,me,ce)=>{const z=g.el=b?b.el:f(""),G=g.anchor=b?b.anchor:f("");let{patchFlag:Q,dynamicChildren:Pe,slotScopeIds:Ve}=g;Ve&&(me=me?me.concat(Ve):Ve),b==null?(s(z,C,Y),s(G,C,Y),O(g.children||[],C,G,R,le,ge,me,ce)):Q>0&&Q&64&&Pe&&b.dynamicChildren&&b.dynamicChildren.length===Pe.length?(V(b.dynamicChildren,Pe,C,R,le,ge,me),(g.key!=null||R&&g===R.subTree)&&al(b,g,!0)):Ke(b,g,C,G,R,le,ge,me,ce)},ke=(b,g,C,Y,R,le,ge,me,ce)=>{g.slotScopeIds=me,b==null?g.shapeFlag&512?R.ctx.activate(g,C,Y,ge,ce):Te(g,C,Y,R,le,ge,ce):Je(b,g,ce)},Te=(b,g,C,Y,R,le,ge)=>{const me=b.component=zp(b,Y,R);if(mi(b)&&(me.ctx.renderer=Ot),Gp(me,!1,ge),me.asyncDep){if(R&&R.registerDep(me,Le,ge,le),!b.el){const ce=me.subTree=Ee(qt);ie(null,ce,g,C),b.placeholder=ce.el}}else Le(me,b,g,C,R,le,ge)},Je=(b,g,C)=>{const Y=g.component=b.component;if(Tp(b,g,C))if(Y.asyncDep&&!Y.asyncResolved){g.el=b.el,g.placeholder=b.placeholder,qe(Y,g,C);return}else Y.next=g,Y.update();else g.el=b.el,g.placeholder=b.placeholder,Y.vnode=g},Le=(b,g,C,Y,R,le,ge)=>{const me=()=>{if(b.isMounted){let{next:Q,bu:Pe,u:Ve,parent:Ze,vnode:Ye}=b;{const zt=Hc(b);if(zt){Q&&(Q.el=Ye.el,qe(b,Q,ge)),zt.asyncDep.then(()=>{Jt(()=>{b.isUnmounted||z()},R)});return}}let tt=Q,mt;Cr(b,!1),Q?(Q.el=Ye.el,qe(b,Q,ge)):Q=Ye,Pe&&Po(Pe),(mt=Q.props&&Q.props.onVnodeBeforeUpdate)&&_n(mt,Ze,Q,Ye),Cr(b,!0);const kt=du(b),Zt=b.subTree;b.subTree=kt,re(Zt,kt,_(Zt.el),dt(Zt),b,R,le),Q.el=kt.el,tt===null&&Pp(b,kt.el),Ve&&Jt(Ve,R),(mt=Q.props&&Q.props.onVnodeUpdated)&&Jt(()=>_n(mt,Ze,Q,Ye),R)}else{let Q;const{el:Pe,props:Ve}=g,{bm:Ze,m:Ye,parent:tt,root:mt,type:kt}=b,Zt=Es(g);Cr(b,!1),Ze&&Po(Ze),!Zt&&(Q=Ve&&Ve.onVnodeBeforeMount)&&_n(Q,tt,g),Cr(b,!0);{mt.ce&&mt.ce._hasShadowRoot()&&mt.ce._injectChildStyle(kt,b.parent?b.parent.type:void 0);const zt=b.subTree=du(b);re(null,zt,C,Y,b,R,le),g.el=zt.el}if(Ye&&Jt(Ye,R),!Zt&&(Q=Ve&&Ve.onVnodeMounted)){const zt=g;Jt(()=>_n(Q,tt,zt),R)}(g.shapeFlag&256||tt&&Es(tt.vnode)&&tt.vnode.shapeFlag&256)&&b.a&&Jt(b.a,R),b.isMounted=!0,g=C=Y=null}};b.scope.on();const ce=b.effect=new Qu(me);b.scope.off();const z=b.update=ce.run.bind(ce),G=b.job=ce.runIfDirty.bind(ce);G.i=b,G.id=b.uid,ce.scheduler=()=>rl(G),Cr(b,!0),z()},qe=(b,g,C)=>{g.component=b;const Y=b.vnode.props;b.vnode=g,b.next=null,Op(b,g.props,Y,C),Dp(b,g.children,C),An(),mc(b),On()},Ke=(b,g,C,Y,R,le,ge,me,ce=!1)=>{const z=b&&b.children,G=b?b.shapeFlag:0,Q=g.children,{patchFlag:Pe,shapeFlag:Ve}=g;if(Pe>0){if(Pe&128){Ge(z,Q,C,Y,R,le,ge,me,ce);return}else if(Pe&256){it(z,Q,C,Y,R,le,ge,me,ce);return}}Ve&8?(G&16&&Fe(z,R,le),Q!==z&&m(C,Q)):G&16?Ve&16?Ge(z,Q,C,Y,R,le,ge,me,ce):Fe(z,R,le,!0):(G&8&&m(C,""),Ve&16&&O(Q,C,Y,R,le,ge,me,ce))},it=(b,g,C,Y,R,le,ge,me,ce)=>{b=b||Ar,g=g||Ar;const z=b.length,G=g.length,Q=Math.min(z,G);let Pe;for(Pe=0;Pe<Q;Pe++){const Ve=g[Pe]=ce?Rn(g[Pe]):En(g[Pe]);re(b[Pe],Ve,C,null,R,le,ge,me,ce)}z>G?Fe(b,R,le,!0,!1,Q):O(g,C,Y,R,le,ge,me,ce,Q)},Ge=(b,g,C,Y,R,le,ge,me,ce)=>{let z=0;const G=g.length;let Q=b.length-1,Pe=G-1;for(;z<=Q&&z<=Pe;){const Ve=b[z],Ze=g[z]=ce?Rn(g[z]):En(g[z]);if(Tr(Ve,Ze))re(Ve,Ze,C,null,R,le,ge,me,ce);else break;z++}for(;z<=Q&&z<=Pe;){const Ve=b[Q],Ze=g[Pe]=ce?Rn(g[Pe]):En(g[Pe]);if(Tr(Ve,Ze))re(Ve,Ze,C,null,R,le,ge,me,ce);else break;Q--,Pe--}if(z>Q){if(z<=Pe){const Ve=Pe+1,Ze=Ve<G?g[Ve].el:Y;for(;z<=Pe;)re(null,g[z]=ce?Rn(g[z]):En(g[z]),C,Ze,R,le,ge,me,ce),z++}}else if(z>Pe)for(;z<=Q;)Ce(b[z],R,le,!0),z++;else{const Ve=z,Ze=z,Ye=new Map;for(z=Ze;z<=Pe;z++){const jt=g[z]=ce?Rn(g[z]):En(g[z]);jt.key!=null&&Ye.set(jt.key,z)}let tt,mt=0;const kt=Pe-Ze+1;let Zt=!1,zt=0;const tn=new Array(kt);for(z=0;z<kt;z++)tn[z]=0;for(z=Ve;z<=Q;z++){const jt=b[z];if(mt>=kt){Ce(jt,R,le,!0);continue}let Tt;if(jt.key!=null)Tt=Ye.get(jt.key);else for(tt=Ze;tt<=Pe;tt++)if(tn[tt-Ze]===0&&Tr(jt,g[tt])){Tt=tt;break}Tt===void 0?Ce(jt,R,le,!0):(tn[Tt-Ze]=z+1,Tt>=zt?zt=Tt:Zt=!0,re(jt,g[Tt],C,null,R,le,ge,me,ce),mt++)}const hr=Zt?Fp(tn):Ar;for(tt=hr.length-1,z=kt-1;z>=0;z--){const jt=Ze+z,Tt=g[jt],De=g[jt+1],Wn=jt+1<G?De.el||Aa(De):Y;tn[z]===0?re(null,Tt,C,Wn,R,le,ge,me,ce):Zt&&(tt<0||z!==hr[tt]?Qe(Tt,C,Wn,2):tt--)}}},Qe=(b,g,C,Y,R=null)=>{const{el:le,type:ge,transition:me,children:ce,shapeFlag:z}=b;if(z&6){Qe(b.component.subTree,g,C,Y);return}if(z&128){b.suspense.move(g,C,Y);return}if(z&64){ge.move(b,g,C,Ot);return}if(ge===je){s(le,g,C);for(let Q=0;Q<ce.length;Q++)Qe(ce[Q],g,C,Y);s(b.anchor,g,C);return}if(ge===Oo){I(b,g,C);return}if(Y!==2&&z&1&&me)if(Y===0)me.persisted&&!le[ln]?s(le,g,C):(me.beforeEnter(le),s(le,g,C),Jt(()=>me.enter(le),R));else{const{leave:Q,delayLeave:Pe,afterLeave:Ve}=me,Ze=()=>{b.ctx.isUnmounted?o(le):s(le,g,C)},Ye=()=>{const tt=le._isLeaving||!!le[ln];le._isLeaving&&le[ln](!0),me.persisted&&!tt?Ze():Q(le,()=>{Ze(),Ve&&Ve()})};Pe?Pe(le,Ze,Ye):Ye()}else s(le,g,C)},Ce=(b,g,C,Y=!1,R=!1)=>{const{type:le,props:ge,ref:me,children:ce,dynamicChildren:z,shapeFlag:G,patchFlag:Q,dirs:Pe,cacheIndex:Ve,memo:Ze}=b;if((Q===-2||z&&z.hasOnce)&&(R=!1),me!=null&&(An(),Ss(me,null,C,b,!0),On()),Ve!=null&&(!b.ctx||b.ctx===g)&&(g.renderCache[Ve]=void 0),G&256){g.ctx.deactivate(b);return}const Ye=G&1&&Pe,tt=!Es(b);let mt;if(tt&&(mt=ge&&ge.onVnodeBeforeUnmount)&&_n(mt,g,b),G&6)we(b.component,C,Y);else{if(G&128){b.suspense.unmount(C,Y);return}Ye&&xr(b,null,g,"beforeUnmount"),G&64?b.type.remove(b,g,C,Ot,Y):z&&!z.hasOnce&&(le!==je||Q>0&&Q&64)?Fe(z,g,C,!1,!0):(le===je&&Q&384||!R&&G&16)&&Fe(ce,g,C),Y&&ee(b)}const kt=Ze!=null&&Ve==null;(tt&&(mt=ge&&ge.onVnodeUnmounted)||Ye||kt)&&Jt(()=>{mt&&_n(mt,g,b),Ye&&xr(b,null,g,"unmounted"),kt&&(b.el=null)},C)},ee=b=>{const{type:g,el:C,anchor:Y,transition:R}=b,le=g===je;if(le&&!R){te(C,Y);return}if(g===Oo){Z(b),R&&!R.persisted&&R.afterLeave&&R.afterLeave();return}const ge=le?Ds(b):b,me=()=>{le?_(C)&&te(C,Y):o(C),R&&!R.persisted&&R.afterLeave&&R.afterLeave()};if(ge&&ge.shapeFlag&1&&R&&!R.persisted){const{leave:ce,delayLeave:z}=R,G=ge.el,Q=()=>ce(G,me);z?z(G,me,Q):Q()}else me()},te=(b,g)=>{let C;for(;b!==g;)C=S(b),o(b),b=C;o(g)},we=(b,g,C)=>{const{bum:Y,scope:R,job:le,subTree:ge,um:me,m:ce,a:z}=b;vu(ce),vu(z),Y&&Po(Y),R.stop(),le?(le.flags|=8,Ce(ge,b,g,C)):b.vnode.el&&ge&&(ge.transition=b.vnode.transition,Ce(ge,b,g,C)),me&&Jt(me,g),Jt(()=>{b.isUnmounted=!0},g)},Fe=(b,g,C,Y=!1,R=!1,le=0)=>{for(let ge=le;ge<b.length;ge++)Ce(b[ge],g,C,Y,R)},dt=b=>{if(b.shapeFlag&6)return dt(b.component.subTree);if(b.shapeFlag&128)return b.suspense.next();const g=S(b.anchor||b.el),C=g&&g[kc];return C?S(C):g},Kt=(b,g,C)=>{const Y=b&&g._vnode?void 0:b&&b.component?b.component.uid:Wp();Yf(()=>{b==null?g._vnode&&Ce(g._vnode,null,null,!0):re(g._vnode||null,b,g,null,null,null,C),g._vnode=b},Y)},Ot={p:re,um:Ce,m:Qe,r:ee,mt:Te,mc:O,pc:Ke,pbc:V,n:dt,o:e};return{render:Kt,hydrate:void 0,createApp:kp(Kt)}}function da({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Cr({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Kp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function al(e,t,n=!1){const s=e.children,o=t.children;if(Re(s)&&Re(o))for(let a=0;a<s.length;a++){const c=s[a];let f=o[a];f.shapeFlag&1&&!f.dynamicChildren&&((f.patchFlag<=0||f.patchFlag===32)&&(f=o[a]=Rn(o[a]),f.el=c.el),!n&&f.patchFlag!==-2&&al(c,f)),f.type===bi&&(f.patchFlag===-1&&(f=o[a]=Rn(f)),f.el=c.el),f.type===qt&&!f.el&&(f.el=c.el)}}function Fp(e){const t=e.slice(),n=[0];let s,o,a,c,f;const v=e.length;for(s=0;s<v;s++){const y=e[s];if(y!==0){if(o=n[n.length-1],e[o]<y){t[s]=o,n.push(s);continue}for(a=0,c=n.length-1;a<c;)f=a+c>>1,e[n[f]]<y?a=f+1:c=f;y<e[n[a]]&&(a>0&&(t[s]=n[a-1]),n[a]=s)}}for(a=n.length,c=n[a-1];a-- >0;)n[a]=c,c=t[c];return n}function Hc(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:Hc(t)}function vu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function Aa(e){if(e.placeholder)return e.placeholder;const t=e.component;return t?Aa(t.subTree):null}const Wc=e=>e.__isSuspense;function Np(e,t){t&&t.pendingBranch?Re(e)?t.effects.push(...e):t.effects.push(e):Gf(e)}const je=Symbol.for("v-fgt"),bi=Symbol.for("v-txt"),qt=Symbol.for("v-cmt"),Oo=Symbol.for("v-stc"),Ir=[];let on=null;function E(e=!1){Ir.push(on=e?null:[])}function zc(){Ir.pop(),on=Ir[Ir.length-1]||null}let Ls=1;function Ho(e,t=!1){Ls+=e,e<0&&on&&t&&(on.hasOnce=!0)}function Gc(e){return e.dynamicChildren=Ls>0?on||Ar:null,zc(),Ls>0&&on&&on.push(e),e}function D(e,t,n,s,o,a){return Gc(l(e,t,n,s,o,a,!0))}function Pt(e,t,n,s,o){return Gc(Ee(e,t,n,s,o,!0))}function Rs(e){return e?e.__v_isVNode===!0:!1}function Tr(e,t){return e.type===t.type&&e.key===t.key}const Yc=({key:e})=>e??null,Mo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?bt(e)||Ht(e)||We(e)?{i:un,r:e,k:t,f:!!n}:e:null);function l(e,t=null,n=null,s=0,o=null,a=e===je?0:1,c=!1,f=!1){const v={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Yc(t),ref:t&&Mo(t),scopeId:bc,slotScopeIds:null,children:n,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:a,patchFlag:s,dynamicProps:o,dynamicChildren:null,appContext:null,ctx:un};return f?(Wo(v,n),a&128&&e.normalize(v)):n&&(v.shapeFlag|=bt(n)?8:16),Ls>0&&!c&&on&&(v.patchFlag>0||a&6)&&v.patchFlag!==32&&on.push(v),v}const Ee=Vp;function Vp(e,t=null,n=null,s=0,o=null,a=!1){if((!e||e===vp)&&(e=qt),Rs(e)){const f=cr(e,t,!0);return n&&Wo(f,n),Ls>0&&!a&&on&&(f.shapeFlag&6?on[on.indexOf(e)]=f:on.push(f)),f.patchFlag=-2,f}if(Qp(e)&&(e=e.__vccOpts),t){t=Bp(t);let{class:f,style:v}=t;f&&!bt(f)&&(t.class=et(f)),ct(v)&&(nl(v)&&!Re(v)&&(v=$t({},v)),t.style=or(v))}const c=bt(e)?1:Wc(e)?128:hi(e)?64:ct(e)?4:We(e)?2:0;return l(e,t,n,s,o,c,a,!0)}function Bp(e){return e?nl(e)||Fc(e)?$t({},e):e:null}function cr(e,t,n=!1,s=!1){const{props:o,ref:a,patchFlag:c,children:f,transition:v}=e,y=t?qp(o||{},t):o,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&Yc(y),ref:t&&t.ref?n&&a?Re(a)?a.concat(Mo(t)):[a,Mo(t)]:Mo(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:f,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==je?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:v,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&cr(e.ssContent),ssFallback:e.ssFallback&&cr(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return v&&s&&ur(m,v.clone(m)),m}function en(e=" ",t=0){return Ee(bi,null,e,t)}function Up(e,t){const n=Ee(Oo,null,e);return n.staticCount=t,n}function xe(e="",t=!1){return t?(E(),Pt(qt,null,e)):Ee(qt,null,e)}function En(e){return e==null||typeof e=="boolean"?Ee(qt):Re(e)?Ee(je,null,e.slice()):Rs(e)?Rn(e):Ee(bi,null,String(e))}function Rn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:cr(e)}function Wo(e,t){let n=0;const{shapeFlag:s}=e;if(t==null)t=null;else if(Re(t))n=16;else if(typeof t=="object")if(s&65){const o=t.default;o&&(o._c&&(o._d=!1),Wo(e,o()),o._c&&(o._d=!0));return}else{n=32;const o=t._;!o&&!Fc(t)?t._ctx=un:o===3&&un&&(un.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(We(t)){if(s&65){Wo(e,{default:t});return}t={default:t,_ctx:un},n=32}else t=String(t),s&64?(n=16,t=[en(t)]):n=8;e.children=t,e.shapeFlag|=n}function qp(...e){const t={};for(let n=0;n<e.length;n++){const s=e[n];for(const o in s)if(o==="class")t.class!==s.class&&(t.class=et([t.class,s.class]));else if(o==="style")t.style=or([t.style,s.style]);else if(li(o)){const a=t[o],c=s[o];c&&a!==c&&!(Re(a)&&a.includes(c))?t[o]=a?[].concat(a,c):c:c==null&&a==null&&!ui(o)&&(t[o]=c)}else o!==""&&(t[o]=s[o])}return t}function _n(e,t,n,s=null){fn(e,t,7,[n,s])}const Hp=Ic();let Jc=0;function Wp(){return Jc}function zp(e,t,n){const s=e.type,o=(t?t.appContext:e.appContext)||Hp,a={uid:Jc++,vnode:e,type:s,parent:t,appContext:o,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new bf(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(o.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Vc(s,o),emitsOptions:jc(s,o),emit:null,emitted:null,propsDefaults:ft,inheritAttrs:s.inheritAttrs,ctx:ft,data:ft,props:ft,attrs:ft,slots:ft,refs:ft,setupState:ft,setupContext:null,suspense:n,suspenseId:n?n.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 a.ctx={_:a},a.root=t?t.root:a,a.emit=Cp.bind(null,a),e.ce&&e.ce(a),a}let Qt=null;const ll=()=>Qt||un;let zo,Ks;{const e=fi(),t=(n,s)=>{let o;return(o=e[n])||(o=e[n]=[]),o.push(s),a=>{o.length>1?o.forEach(c=>c(a)):o[0](a)}};zo=t("__VUE_INSTANCE_SETTERS__",n=>Qt=n),Ks=t("__VUE_SSR_SETTERS__",n=>Fs=n)}const Ws=e=>{const t=Qt;return zo(e),e.scope.on(),()=>{e.scope.off(),zo(t)}},hu=()=>{Qt&&Qt.scope.off(),zo(null)};function Xc(e){return e.vnode.shapeFlag&4}let Fs=!1;function Gp(e,t=!1,n=!1){t&&Ks(t);const{props:s,children:o}=e.vnode,a=Xc(e);Ap(e,s,a,t),jp(e,o,n||t);const c=a?Yp(e,t):void 0;return t&&Ks(!1),c}function Yp(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,hp);const{setup:s}=n;if(s){An();const o=e.setupContext=s.length>1?Xp(e):null,a=Ws(e),c=Hs(s,e,0,[e.props,o]),f=qu(c);if(On(),a(),(f||e.sp)&&!Es(e)&&$c(e),f){if(c.then(hu,hu),t)return c.then(v=>{Ks(!0);try{mu(e,v,t)}finally{Ks(!1)}}).catch(v=>{vi(v,e,0)});e.asyncDep=c}else mu(e,c)}else Qc(e)}function mu(e,t,n){We(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ct(t)&&(e.setupState=pc(t)),Qc(e)}function Qc(e,t,n){const s=e.type;e.render||(e.render=s.render||Tn);{const o=Ws(e);An();try{mp(e)}finally{On(),o()}}}const Jp={get(e,t){return Bt(e,"get",""),e[t]}};function Xp(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Jp),slots:e.slots,emit:e.emit,expose:t}}function wi(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(pc(Kf(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $s)return $s[n](e)},has(t,n){return n in t||n in $s}})):e.proxy}function Qp(e){return We(e)&&"__vccOpts"in e}const st=(e,t)=>Uf(e,t,Fs);function Zp(e,t,n){try{Ho(-1);const s=arguments.length;return s===2?ct(t)&&!Re(t)?Rs(t)?Ee(e,null,[t]):Ee(e,t):Ee(e,null,t):(s>3?n=Array.prototype.slice.call(arguments,2):s===3&&Rs(n)&&(n=[n]),Ee(e,t,n))}finally{Ho(1)}}const ev="3.5.44";/**
* @vue/runtime-dom v3.5.44
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Oa;const yu=typeof window<"u"&&window.trustedTypes;if(yu)try{Oa=yu.createPolicy("vue",{createHTML:e=>e})}catch{}const Zc=Oa?e=>Oa.createHTML(e):e=>e,tv="http://www.w3.org/2000/svg",nv="http://www.w3.org/1998/Math/MathML",Ln=typeof document<"u"?document:null,gu=Ln&&Ln.createElement("template"),rv={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,s)=>{const o=t==="svg"?Ln.createElementNS(tv,e):t==="mathml"?Ln.createElementNS(nv,e):n?Ln.createElement(e,{is:n}):Ln.createElement(e);return e==="select"&&s&&s.multiple!=null&&o.setAttribute("multiple",s.multiple),o},createText:e=>Ln.createTextNode(e),createComment:e=>Ln.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Ln.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,s,o,a){const c=n?n.previousSibling:t.lastChild;if(o&&(o===a||o.nextSibling))for(;t.insertBefore(o.cloneNode(!0),n),!(o===a||!(o=o.nextSibling)););else{gu.innerHTML=Zc(s==="svg"?`<svg>${e}</svg>`:s==="mathml"?`<math>${e}</math>`:e);const f=gu.content;if(s==="svg"||s==="mathml"){const v=f.firstChild;for(;v.firstChild;)f.appendChild(v.firstChild);f.removeChild(v)}t.insertBefore(f,n)}return[c?c.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Zn="transition",gs="animation",es=Symbol("_vtc"),ed={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},td=$t({},Cc,ed),sv=e=>(e.displayName="Transition",e.props=td,e),os=sv((e,{slots:t})=>Zp(sp,nd(e),t)),Sr=(e,t=[])=>{Re(e)?e.forEach(n=>n(...t)):e&&e(...t)},bu=e=>e?Re(e)?e.some(t=>t.length>1):e.length>1:!1;function nd(e){const t={};for(const W in e)W in ed||(t[W]=e[W]);if(e.css===!1)return t;const{name:n="v",type:s,duration:o,enterFromClass:a=`${n}-enter-from`,enterActiveClass:c=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:v=a,appearActiveClass:y=c,appearToClass:m=f,leaveFromClass:_=`${n}-leave-from`,leaveActiveClass:S=`${n}-leave-active`,leaveToClass:$=`${n}-leave-to`}=e,U=ov(o),re=U&&U[0],se=U&&U[1],{onBeforeEnter:ie,onEnter:T,onEnterCancelled:I,onLeave:Z,onLeaveCancelled:de,onBeforeAppear:ae=ie,onAppear:X=T,onAppearCancelled:O=I}=t,x=(W,ke,Te,Je)=>{W._enterCancelled=Je,tr(W,ke?m:f),tr(W,ke?y:c),Te&&Te()},V=(W,ke)=>{W._isLeaving=!1,tr(W,_),tr(W,$),tr(W,S),ke&&ke()},ue=W=>(ke,Te)=>{const Je=W?X:T,Le=()=>x(ke,W,Te);Sr(Je,[ke,Le]),wu(()=>{tr(ke,W?v:a),kn(ke,W?m:f),bu(Je)||_u(ke,s,re,Le)})};return $t(t,{onBeforeEnter(W){Sr(ie,[W]),kn(W,a),kn(W,c)},onBeforeAppear(W){Sr(ae,[W]),kn(W,v),kn(W,y)},onEnter:ue(!1),onAppear:ue(!0),onLeave(W,ke){W._isLeaving=!0;const Te=()=>V(W,ke);kn(W,_),W._enterCancelled?(kn(W,S),Ma(W)):(Ma(W),kn(W,S)),wu(()=>{W._isLeaving&&(tr(W,_),kn(W,$),bu(Z)||_u(W,s,se,Te))}),Sr(Z,[W,Te])},onEnterCancelled(W){x(W,!1,void 0,!0),Sr(I,[W])},onAppearCancelled(W){x(W,!0,void 0,!0),Sr(O,[W])},onLeaveCancelled(W){V(W),Sr(de,[W])}})}function ov(e){if(e==null)return null;if(ct(e))return[fa(e.enter),fa(e.leave)];{const t=fa(e);return[t,t]}}function fa(e){return uf(e)}function kn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[es]||(e[es]=new Set)).add(t)}function tr(e,t){t.split(/\s+/).forEach(s=>s&&e.classList.remove(s));const n=e[es];n&&(n.delete(t),n.size||(e[es]=void 0))}function wu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let iv=0;function _u(e,t,n,s){const o=e._endId=++iv,a=()=>{o===e._endId&&s()};if(n!=null)return setTimeout(a,n);const{type:c,timeout:f,propCount:v}=rd(e,t);if(!c)return s();const y=c+"end";let m=0;const _=()=>{e.removeEventListener(y,S),a()},S=$=>{$.target===e&&++m>=v&&_()};setTimeout(()=>{m<v&&_()},f+1),e.addEventListener(y,S)}function rd(e,t){const n=window.getComputedStyle(e),s=U=>(n[U]||"").split(", "),o=s(`${Zn}Delay`),a=s(`${Zn}Duration`),c=ku(o,a),f=s(`${gs}Delay`),v=s(`${gs}Duration`),y=ku(f,v);let m=null,_=0,S=0;t===Zn?c>0&&(m=Zn,_=c,S=a.length):t===gs?y>0&&(m=gs,_=y,S=v.length):(_=Math.max(c,y),m=_>0?c>y?Zn:gs:null,S=m?m===Zn?a.length:v.length:0);const $=m===Zn&&/\b(?:transform|all)(?:,|$)/.test(s(`${Zn}Property`).toString());return{type:m,timeout:_,propCount:S,hasTransform:$}}function ku(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((n,s)=>xu(n)+xu(e[s])))}function xu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Ma(e){return(e?e.ownerDocument:document).body.offsetHeight}function av(e,t,n){const s=e[es];s&&(t=(t?[t,...s]:[...s]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Cu=Symbol("_vod"),sd=Symbol("_vsh"),lv=Symbol(""),uv=/(?:^|;)\s*display\s*:/;function cv(e,t,n){const s=e.style,o=bt(n);let a=!1;if(n&&!o){if(t)if(bt(t))for(const c of t.split(";")){const f=c.slice(0,c.indexOf(":")).trim();n[f]==null&&_s(s,f,"")}else for(const c in t)n[c]==null&&_s(s,c,"");for(const c in n){c==="display"&&(a=!0);const f=n[c];f!=null?fv(e,c,!bt(t)&&t?t[c]:void 0,f)||_s(s,c,f):_s(s,c,"")}}else if(o){if(t!==n){const c=s[lv];c&&(n+=";"+c),s.cssText=n,a=uv.test(n)}}else t&&e.removeAttribute("style");Cu in e&&((!o||t!==n)&&(e[Cu]=a?s.display:""),e[sd]&&(s.display="none"))}const Eo=/\s*!important$/;function _s(e,t,n){if(Re(n))n.forEach(s=>_s(e,t,s));else if(n==null&&(n=""),t.startsWith("--"))Eo.test(n)?e.setProperty(t,n.replace(Eo,""),"important"):e.setProperty(t,n);else{const s=dv(e,t);Eo.test(n)?e.setProperty(dr(s),n.replace(Eo,""),"important"):e[s]=n}}const Su=["Webkit","Moz","ms"],pa={};function dv(e,t){const n=pa[t];if(n)return n;let s=mn(t);if(s!=="filter"&&s in e)return pa[t]=s;s=zu(s);for(let o=0;o<Su.length;o++){const a=Su[o]+s;if(a in e)return pa[t]=a}return t}function fv(e,t,n,s){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&bt(s)&&n===s}const Eu="http://www.w3.org/1999/xlink";function $u(e,t,n,s,o,a=hf(t)){s&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Eu,t.slice(6,t.length)):e.setAttributeNS(Eu,t,n):n==null||a&&!Yu(n)?e.removeAttribute(t):e.setAttribute(t,a?"":Pn(n)?String(n):n)}function Tu(e,t,n,s,o){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?Zc(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const f=a==="OPTION"?e.getAttribute("value")||"":e.value,v=n==null?e.type==="checkbox"?"on":"":String(n);(f!==v||!("_value"in e))&&(e.value=v),n==null&&e.removeAttribute(t),e._value=n;return}let c=!1;if(n===""||n==null){const f=typeof e[t];f==="boolean"?n=Yu(n):n==null&&f==="string"?(n="",c=!0):f==="number"&&(n=0,c=!0)}try{e[t]=n}catch{}c&&e.removeAttribute(o||t)}function Pr(e,t,n,s){e.addEventListener(t,n,s)}function pv(e,t,n,s){e.removeEventListener(t,n,s)}const Pu=Symbol("_vei");function vv(e,t,n,s,o=null){const a=e[Pu]||(e[Pu]={}),c=a[t];if(s&&c)c.value=s;else{const[f,v]=yv(t);if(s){const y=a[t]=wv(s,o);Pr(e,f,y,v)}else c&&(pv(e,f,c,v),a[t]=void 0)}}const hv=/(Once|Passive|Capture)$/,mv=/^on:?(?:Once|Passive|Capture)$/;function yv(e){let t,n;for(;(n=e.match(hv))&&!mv.test(e);)t||(t={}),e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):dr(e.slice(2)),t]}let va=0;const gv=Promise.resolve(),bv=()=>va||(gv.then(()=>va=0),va=Date.now());function wv(e,t){const n=s=>{if(!s._vts)s._vts=Date.now();else if(s._vts<=n.attached)return;const o=n.value;if(Re(o)){const a=s.stopImmediatePropagation;s.stopImmediatePropagation=()=>{a.call(s),s._stopped=!0};const c=o.slice(),f=[s];for(let v=0;v<c.length&&!s._stopped;v++){const y=c[v];y&&fn(y,t,5,f)}}else fn(o,t,5,[s])};return n.value=e,n.attached=bv(),n}const Au=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,_v=(e,t,n,s,o,a)=>{const c=o==="svg";t==="class"?av(e,s,c):t==="style"?cv(e,n,s):li(t)?ui(t)||vv(e,t,n,s,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):kv(e,t,s,c))?(Tu(e,t,s),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&$u(e,t,s,c,a,t!=="value")):e._isVueCE&&(xv(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!bt(s)))?Tu(e,mn(t),s,a,t):(t==="true-value"?e._trueValue=s:t==="false-value"&&(e._falseValue=s),$u(e,t,s,c))};function kv(e,t,n,s){if(s)return!!(t==="innerHTML"||t==="textContent"||t in e&&Au(t)&&We(n));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 o=e.tagName;if(o==="IMG"||o==="VIDEO"||o==="CANVAS"||o==="SOURCE")return!1}return Au(t)&&bt(n)?!1:t in e}function xv(e,t){const n=e._def.props;if(!n)return!1;const s=mn(t);return Array.isArray(n)?n.some(o=>mn(o)===s):Object.keys(n).some(o=>mn(o)===s)}const od=new WeakMap,id=new WeakMap,Go=Symbol("_moveCb"),Ou=Symbol("_enterCb"),Ia=new WeakMap,Cv=e=>(delete e.props.mode,e),Sv=Cv({name:"TransitionGroup",props:$t({},td,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=ll(),s=xc();let o,a,c,f;const v=()=>(f===void 0&&(f=o.length>0&&Iv(o[0].el,n.vnode.el,Mu(e))),f);return Pc(()=>{if(Ia.delete(n),!v()){o=[],c=void 0;return}const y=Mu(e);o.forEach($v);const m=c&&Mv(c,n.vnode.el);c=void 0,o.forEach(S=>Tv(S,m));const _=o.filter(Pv);Ma(n.vnode.el),_.forEach(S=>{const $=S.el,U=$.style;kn($,y),U.transform=U.webkitTransform=U.transitionDuration="";const re=$[Go]=se=>{se&&se.target!==$||(!se||se.propertyName.endsWith("transform"))&&($.removeEventListener("transitionend",re),$[Go]=null,tr($,y))};$.addEventListener("transitionend",re)}),o=[]}),()=>{const y=lt(e),m=nd(y);let _=y.tag||je;if(o=[],f=void 0,a)for(let S=0;S<a.length;S++){const $=a[S];$.el&&$.el instanceof Element&&!$.el[sd]&&(o.push($),ur($,js($,m,s,n)),od.set($,_i($.el)))}a=t.default?sl(t.default()):[];for(let S=0;S<a.length;S++){const $=a[S];$.key!=null&&ur($,js($,m,s,n))}return o.length&&(c=Av(n),Ia.set(n,v)),Ee(_,null,a)}}}),Ev=Sv;function $v(e){const t=e.el;t[Go]&&t[Go](),t[Ou]&&t[Ou]()}function Mu(e){return e.moveClass||`${e.name||"v"}-move`}function Tv(e,t){id.set(e,_i(e.el,t))}function Pv(e){const t=od.get(e),n=id.get(e),s=t.left-n.left,o=t.top-n.top;if(s||o){const a=e.el,c=a.style,f=a.getBoundingClientRect();let v=1,y=1;return a.offsetWidth&&(v=f.width/a.offsetWidth),a.offsetHeight&&(y=f.height/a.offsetHeight),(!Number.isFinite(v)||v===0)&&(v=1),(!Number.isFinite(y)||y===0)&&(y=1),Math.abs(v-1)<.01&&(v=1),Math.abs(y-1)<.01&&(y=1),c.transform=c.webkitTransform=`translate(${s/v}px,${o/y}px)`,c.transitionDuration="0s",e}}function _i(e,t){const n=e.getBoundingClientRect();return{left:n.left-(t?t.left:0),top:n.top-(t?t.top:0)}}function Av(e){let t;for(let n=e.parent;n;n=n.parent){const s=Ia.get(n);if(s){const o=Ov(n.vnode.el,e.vnode.el);o&&(t||(t=[])).push($t(_i(o),{item:o,willMove:s}))}}return t}function Ov(e,t){const n=e.nodeType===1?e:e.parentNode;for(;t&&t.parentNode!==n;)t=t.parentNode;if(t&&t.nodeType===1)return t}function Mv(e,t){const n=e.find(s=>s.willMove()&&s.item.contains(t));return n&&_i(n.item,n)}function Iv(e,t,n){const s=e.cloneNode(),o=e[es];o&&o.forEach(f=>{f.split(/\s+/).forEach(v=>v&&s.classList.remove(v))}),n.split(/\s+/).forEach(f=>f&&s.classList.add(f)),s.style.display="none";const a=t.nodeType===1?t:t.parentNode;a.appendChild(s);const{hasTransform:c}=rd(s);return a.removeChild(s),c}const Yo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Re(t)?n=>Po(t,n):t};function jv(e){e.target.composing=!0}function Iu(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Or=Symbol("_assign"),$o=Symbol("_initialValue");function ha(e,t,n){return t&&(e=e.trim()),n&&(e=di(e)),e}const Me={created(e,{modifiers:{lazy:t,trim:n,number:s}},o){e.parentNode&&(e.type==="text"?e[$o]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[$o]=e.defaultValue.replace(/\r\n?/g,`
`))),e[Or]=Yo(o);const a=s||o.props&&o.props.type==="number";Pr(e,t?"change":"input",c=>{c.target.composing||e[Or](ha(e.value,n,a))}),(n||a)&&Pr(e,"change",()=>{e.value=ha(e.value,n,a)}),t||(Pr(e,"compositionstart",jv),Pr(e,"compositionend",Iu),Pr(e,"change",Iu))},mounted(e,{value:t,modifiers:{trim:n,number:s}}){const o=t??"",a=e[$o];delete e[$o],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Or](ha(e.value,n,s)):e.value=o},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:s,trim:o,number:a}},c){if(e[Or]=Yo(c),e.composing)return;const f=(a||e.type==="number")&&!/^0\d/.test(e.value)?di(e.value):e.value,v=t??"";if(f===v)return;const y=e.getRootNode();(y instanceof Document||y instanceof ShadowRoot)&&y.activeElement===e&&e.type!=="range"&&(s&&t===n||o&&e.value.trim()===v)||(e.value=v)}},Vn={deep:!0,created(e,{value:t,modifiers:{number:n}},s){e._modelValue=t,Pr(e,"change",()=>{const o=Array.prototype.filter.call(e.options,v=>v.selected).map(v=>n?di(Jo(v)):Jo(v)),a=e.multiple,c=a?jr(e._modelValue)?new Set(o):o:o[0],f=e._pendingValue=[a,a?Re(c)?o.slice():o:c];try{e[Or](c)}finally{ss(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[Or]=Yo(s)},mounted(e,{value:t}){ju(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Or]=Yo(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Dv(t,n[1],n[0]))&&ju(e,t)}};function Dv(e,t,n){if(!n||Re(e))return ar(e,t);if(jr(e)){if(e.size!==t.length)return!1;for(const s of t)if(!e.has(s))return!1;return!0}return!1}function ju(e,t){const n=e.multiple,s=Re(t);if(!(n&&!s&&!jr(t))){for(let o=0,a=e.options.length;o<a;o++){const c=e.options[o],f=Jo(c);if(n)if(s){const v=typeof f;v==="string"||v==="number"?c.selected=t.some(y=>String(y)===String(f)):c.selected=gf(t,f)>-1}else c.selected=t.has(f);else if(ar(Jo(c),t)){e.selectedIndex!==o&&(e.selectedIndex=o);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Jo(e){return"_value"in e?e._value:e.value}const Lv=["ctrl","shift","alt","meta"],Rv={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)=>Lv.some(n=>e[`${n}Key`]&&!t.includes(n))},sn=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),s=t.join(".");return n[s]||(n[s]=(o,...a)=>{for(let c=0;c<t.length;c++){const f=Rv[t[c]];if(f&&f(o,t))return}return e(o,...a)})},Kv={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},At=(e,t)=>{const n=e._withKeys||(e._withKeys={}),s=t.join(".");return n[s]||(n[s]=o=>{if(!("key"in o))return;const a=dr(o.key);if(t.some(c=>c===a||Kv[c]===a))return e(o)})},Fv=$t({patchProp:_v},rv);let Du;function Nv(){return Du||(Du=Lp(Fv))}const Vv=(...e)=>{const t=Nv().createApp(...e),{mount:n}=t;return t.mount=s=>{const o=Uv(s);if(!o)return;const a=t._component;!We(a)&&!a.render&&!a.template&&(a.template=o.innerHTML),o.nodeType===1&&(o.textContent="");const c=n(o,!1,Bv(o));return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),c},t};function Bv(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Uv(e){return bt(e)?document.querySelector(e):e}function Et(e){return'<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">'+e+"</svg>"}const qv={calendar:Et('<rect x="4" y="5.5" width="16" height="14" rx="2"/><path d="M8.5 3.5v3.5M15.5 3.5v3.5M4 10.5h16"/>'),clock:Et('<circle cx="12" cy="12" r="8.25"/><path d="M12 7.75V12l2.75 1.75"/>'),"check-circle":Et('<circle cx="12" cy="12" r="8.25"/><path d="M8.5 12.4l2.4 2.4 4.6-5.2"/>'),edit:Et('<path d="M4.5 19.5v-3.2L16 4.8a1.9 1.9 0 0 1 2.7 2.7L7.2 19l-2.7.5z"/>'),tag:Et('<path d="M4.5 5.5a1 1 0 0 1 1-1h5.6l8.4 8.4-6.6 6.6-8.4-8.4V5.5z"/><circle cx="8.8" cy="8.8" r="1.1"/>'),star:Et('<path d="M12 4l2.5 5.1 5.6.8-4 3.9.9 5.6-5-2.7-5 2.7.9-5.6-4-3.9 5.6-.8L12 4z"/>'),close:Et('<path d="M6.5 6.5l11 11M17.5 6.5l-11 11"/>'),flag:Et('<path d="M6.5 21V4"/><path d="M6.5 4.5h10.8l-2.6 3.7 2.6 3.7H6.5"/>'),chart:Et('<path d="M4.5 19.5h15"/><path d="M7.5 19.5V12M12 19.5V6.5M16.5 19.5V9.5"/>'),export:Et('<path d="M12 4.5V14M8.25 10.25L12 14l3.75-3.75"/><path d="M5 19.5h14"/>'),"chevron-left":Et('<path d="M14.5 6l-6 6 6 6"/>'),"chevron-right":Et('<path d="M9.5 6l6 6-6 6"/>'),"chevron-down":Et('<path d="M6 9.5l6 6 6-6"/>'),plus:Et('<path d="M12 5.5v13M5.5 12h13"/>'),search:Et('<circle cx="11" cy="11" r="6.5"/><path d="M15.8 15.8L20 20"/>'),settings:Et('<circle cx="12" cy="12" r="3"/><path d="M12 4.5v2.2M12 17.3v2.2M4.5 12h2.2M17.3 12h2.2M6.8 6.8l1.6 1.6M15.6 15.6l1.6 1.6M17.2 6.8l-1.6 1.6M8.4 15.6l-1.6 1.6"/>'),memo:Et('<path d="M6.5 3.5h7.5L18.5 8v11a1 1 0 0 1-1 1h-11a1 1 0 0 1-1-1v-15a1 1 0 0 1 1-1z"/><path d="M14 3.5V8h4.5M9.5 12h5M9.5 15.5h5"/>'),lock:Et('<rect x="5.5" y="10.5" width="13" height="9.5" rx="1.5"/><path d="M8.5 10.5V8a3.5 3.5 0 0 1 7 0v2.5"/>'),wallet:Et('<rect x="3.5" y="6" width="17" height="12.5" rx="2"/><path d="M3.5 10h17"/><circle cx="16.4" cy="14.2" r="1.1"/>'),more:Et('<circle cx="5.4" cy="12" r="1.7"/><circle cx="12" cy="12" r="1.7"/><circle cx="18.6" cy="12" r="1.7"/>'),shield:Et('<path d="M12 3.5l7.2 2.7v5.1c0 4.7-3.1 7.8-7.2 9.4-4.1-1.6-7.2-4.7-7.2-9.4V6.2z"/><path d="M9.3 12.2l1.9 1.9 3.6-4"/>')},Hv=["innerHTML"],Xe=Rt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=st(()=>qv[t.name]||"");return(s,o)=>(E(),D("span",{class:"icon",style:or({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,Hv))}}),Wv=["aria-label"],zv={class:"dialog-title"},Gv={class:"dialog-msg"},Yv={class:"dialog-btns"},Jv=Rt({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},message:{},confirmText:{default:"确认"},cancelText:{default:"取消"},danger:{type:Boolean,default:!1}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,s=t;function o(a){n.open&&a.key==="Escape"&&s("cancel")}return ht(()=>n.open,a=>{a?window.addEventListener("keydown",o):window.removeEventListener("keydown",o)}),pr(()=>window.removeEventListener("keydown",o)),(a,c)=>(E(),Pt(Dr,{to:"body"},[Ee(os,{name:"modal"},{default:fr(()=>[e.open?(E(),D("div",{key:0,class:"mask",onClick:c[2]||(c[2]=sn(f=>s("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",zv,ne(e.title),1),l("div",Gv,ne(e.message),1),l("div",Yv,[l("button",{class:"btn btn-sm",onClick:c[0]||(c[0]=f=>s("cancel"))},ne(e.cancelText),1),l("button",{class:et(["btn btn-sm",e.danger?"btn-danger-solid":"btn-primary"]),onClick:c[1]||(c[1]=f=>s("confirm"))},ne(e.confirmText),3)])],8,Wv)])):xe("",!0)]),_:1})]))}}),Wt=(e,t)=>{const n=e.__vccOpts||e;for(const[s,o]of t)n[s]=o;return n},qn=Wt(Jv,[["__scopeId","data-v-f27041d4"]]);var Lu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ad={exports:{}};(function(e,t){((n,s)=>{e.exports=s()})(Lu,function(){var n=function(r,i){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,d){u.__proto__=d}:function(u,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(u[p]=d[p])}))(r,i)},s=function(){return(s=Object.assign||function(r){for(var i,u=1,d=arguments.length;u<d;u++)for(var p in i=arguments[u])Object.prototype.hasOwnProperty.call(i,p)&&(r[p]=i[p]);return r}).apply(this,arguments)};function o(r,i,u){for(var d,p=0,h=i.length;p<h;p++)!d&&p in i||((d=d||Array.prototype.slice.call(i,0,p))[p]=i[p]);return r.concat(d||Array.prototype.slice.call(i))}var a=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Lu,c=Object.keys,f=Array.isArray;function v(r,i){return typeof i=="object"&&c(i).forEach(function(u){r[u]=i[u]}),r}typeof Promise>"u"||a.Promise||(a.Promise=Promise);var y=Object.getPrototypeOf,m={}.hasOwnProperty;function _(r,i){return m.call(r,i)}function S(r,i){typeof i=="function"&&(i=i(y(r))),(typeof Reflect>"u"?c:Reflect.ownKeys)(i).forEach(function(u){U(r,u,i[u])})}var $=Object.defineProperty;function U(r,i,u,d){$(r,i,v(u&&_(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},d))}function re(r){return{from:function(i){return r.prototype=Object.create(i.prototype),U(r.prototype,"constructor",r),{extend:S.bind(null,r.prototype)}}}}var se=Object.getOwnPropertyDescriptor,ie=[].slice;function T(r,i,u){return ie.call(r,i,u)}function I(r,i){return i(r)}function Z(r){if(!r)throw new Error("Assertion Failed")}function de(r){a.setImmediate?setImmediate(r):setTimeout(r,0)}function ae(r,i){if(typeof i=="string"&&_(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var u=[],d=0,p=i.length;d<p;++d){var h=ae(r,i[d]);u.push(h)}return u}var w,k=i.indexOf(".");return k===-1||(w=r[i.substr(0,k)])==null?void 0:ae(w,i.substr(k+1))}function X(r,i,u){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){Z(typeof u!="string"&&"length"in u);for(var d=0,p=i.length;d<p;++d)X(r,i[d],u[d])}else{var h=i.indexOf(".");if(h!==-1){var w=i.substr(0,h),h=i.substr(h+1);if(h==="")u===void 0?f(r)&&!isNaN(parseInt(w))?r.splice(w,1):delete r[w]:r[w]=u;else{var k=r[w];if(!k||!_(r,w)){if(u===void 0)return;k=r[w]={}}X(k,h,u)}}else u===void 0?f(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=u}}function O(r){var i,u={};for(i in r)_(r,i)&&(u[i]=r[i]);return u}var x=[].concat;function V(r){return x.apply([],r)}var Ce="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(V([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return a[r]}),ue=new Set(Ce.map(function(r){return a[r]})),W=null;function ke(r){return W=new WeakMap,r=function i(u){if(!u||typeof u!="object")return u;var d=W.get(u);if(d)return d;if(f(u)){d=[],W.set(u,d);for(var p=0,h=u.length;p<h;++p)d.push(i(u[p]))}else if(ue.has(u.constructor))d=u;else{var w,k=y(u);for(w in d=k===Object.prototype?{}:Object.create(k),W.set(u,d),u)_(u,w)&&(d[w]=i(u[w]))}return d}(r),W=null,r}var Te={}.toString;function Je(r){return Te.call(r).slice(8,-1)}var Le=typeof Symbol<"u"?Symbol.iterator:"@@iterator",qe=typeof Le=="symbol"?function(r){var i;return r!=null&&(i=r[Le])&&i.apply(r)}:function(){return null};function Ke(r,i){i=r.indexOf(i),0<=i&&r.splice(i,1)}var it={};function Ge(r){var i,u,d,p;if(arguments.length===1){if(f(r))return r.slice();if(this===it&&typeof r=="string")return[r];if(p=qe(r))for(u=[];!(d=p.next()).done;)u.push(d.value);else{if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(u=new Array(i);i--;)u[i]=r[i]}}else for(i=arguments.length,u=new Array(i);i--;)u[i]=arguments[i];return u}var Qe=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Ce=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Ye=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ce),ee={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function te(r,i){this.name=r,this.message=i}function we(r,i){return r+". Errors: "+Object.keys(i).map(function(u){return i[u].toString()}).filter(function(u,d,p){return p.indexOf(u)===d}).join(`
`)}function Fe(r,i,u,d){this.failures=i,this.failedKeys=d,this.successCount=u,this.message=we(r,i)}function dt(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(u){return i[u]}),this.failuresByPos=i,this.message=we(r,this.failures)}re(te).from(Error).extend({toString:function(){return this.name+": "+this.message}}),re(Fe).from(te),re(dt).from(te);var Kt=Ye.reduce(function(r,i){return r[i]=i+"Error",r},{}),Ot=te,Ie=Ye.reduce(function(r,i){var u=i+"Error";function d(p,h){this.name=u,p?typeof p=="string"?(this.message="".concat(p).concat(h?`
`+h:""),this.inner=h||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=ee[i]||u,this.inner=null)}return re(d).from(Ot),r[i]=d,r},{}),b=(Ie.Syntax=SyntaxError,Ie.Type=TypeError,Ie.Range=RangeError,Ce.reduce(function(r,i){return r[i+"Error"]=Ie[i],r},{}));Ce=Ye.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=Ie[i]),r},{});function g(){}function C(r){return r}function Y(r,i){return r==null||r===C?i:function(u){return i(r(u))}}function R(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function le(r,i){return r===g?i:function(){var u=r.apply(this,arguments),d=(u!==void 0&&(arguments[0]=u),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?R(d,this.onsuccess):d),p&&(this.onerror=this.onerror?R(p,this.onerror):p),h!==void 0?h:u}}function ge(r,i){return r===g?i:function(){r.apply(this,arguments);var u=this.onsuccess,d=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?R(u,this.onsuccess):u),d&&(this.onerror=this.onerror?R(d,this.onerror):d)}}function me(r,i){return r===g?i:function(){var u=r.apply(this,arguments),d=(v(arguments[0],u),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,i.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?R(d,this.onsuccess):d),p&&(this.onerror=this.onerror?R(p,this.onerror):p),u===void 0?h===void 0?void 0:h:v(u,h)}}function ce(r,i){return r===g?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function z(r,i){return r===g?i:function(){var u=r.apply(this,arguments);if(u&&typeof u.then=="function"){for(var d=this,p=arguments.length,h=new Array(p);p--;)h[p]=arguments[p];return u.then(function(){return i.apply(d,h)})}return i.apply(this,arguments)}}Ce.ModifyError=Fe,Ce.DexieError=te,Ce.BulkError=dt;var G=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Q(r){G=r}var Pe={},Ve=100,Ze=typeof Promise>"u"?[]:(Ye=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[Ze=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(Ze),Ye]:[Ye,y(Ye),Ye]),Ye=Ze[0],qr=Ze[1],qr=qr&&qr.then,tt=Ye&&Ye.constructor,mt=!!Ze[2],kt=function(r,i){Wn.push([r,i]),zt&&(queueMicrotask(jd),zt=!1)},Zt=!0,zt=!0,tn=[],hr=[],jt=C,Tt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:g,pgp:!1,env:{},finalize:g},De=Tt,Wn=[],mr=0,Js=[];function Se(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=De;if(typeof r!="function"){if(r!==Pe)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&$i(this,this._value)}else this._state=null,this._value=null,++i.ref,function u(d,p){try{p(function(h){if(d._state===null){if(h===d)throw new TypeError("A promise cannot be resolved with itself.");var w=d._lib&&Kr();h&&typeof h.then=="function"?u(d,function(k,A){h instanceof Se?h._then(k,A):h.then(k,A)}):(d._state=!0,d._value=h,gl(d)),w&&Fr()}},$i.bind(null,d))}catch(h){$i(d,h)}}(this,r)}var Ei={get:function(){var r=De,i=eo;function u(d,p){var h=this,w=!r.global&&(r!==De||i!==eo),k=w&&!Gn(),A=new Se(function(q,j){Ti(h,new yl(wl(d,r,w,k),wl(p,r,w,k),q,j,r))});return this._consoleTask&&(A._consoleTask=this._consoleTask),A}return u.prototype=Pe,u},set:function(r){U(this,"then",r&&r.prototype===Pe?Ei:{get:function(){return r},set:Ei.set})}};function yl(r,i,u,d,p){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=u,this.reject=d,this.psd=p}function $i(r,i){var u,d;hr.push(i),r._state===null&&(u=r._lib&&Kr(),i=jt(i),r._state=!1,r._value=i,d=r,tn.some(function(p){return p._value===d._value})||tn.push(d),gl(r),u)&&Fr()}function gl(r){var i=r._listeners;r._listeners=[];for(var u=0,d=i.length;u<d;++u)Ti(r,i[u]);var p=r._PSD;--p.ref||p.finalize(),mr===0&&(++mr,kt(function(){--mr==0&&Pi()},[]))}function Ti(r,i){if(r._state===null)r._listeners.push(i);else{var u=r._state?i.onFulfilled:i.onRejected;if(u===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++mr,kt(Id,[u,r,i])}}function Id(r,i,u){try{var d,p=i._value;!i._state&&hr.length&&(hr=[]),d=G&&i._consoleTask?i._consoleTask.run(function(){return r(p)}):r(p),i._state||hr.indexOf(p)!==-1||(h=>{for(var w=tn.length;w;)if(tn[--w]._value===h._value)return tn.splice(w,1)})(i),u.resolve(d)}catch(h){u.reject(h)}finally{--mr==0&&Pi(),--u.psd.ref||u.psd.finalize()}}function jd(){yr(Tt,function(){Kr()&&Fr()})}function Kr(){var r=Zt;return zt=Zt=!1,r}function Fr(){var r,i,u;do for(;0<Wn.length;)for(r=Wn,Wn=[],u=r.length,i=0;i<u;++i){var d=r[i];d[0].apply(null,d[1])}while(0<Wn.length);zt=Zt=!0}function Pi(){for(var r=tn,i=(tn=[],r.forEach(function(d){d._PSD.onunhandled.call(null,d._value,d)}),Js.slice(0)),u=i.length;u;)i[--u]()}function Xs(r){return new Se(Pe,!1,r)}function yt(r,i){var u=De;return function(){var d=Kr(),p=De;try{return Yn(u,!0),r.apply(this,arguments)}catch(h){i&&i(h)}finally{Yn(p,!1),d&&Fr()}}}S(Se.prototype,{then:Ei,_then:function(r,i){Ti(this,new yl(null,null,r,i,De))},catch:function(r){var i,u;return arguments.length===1?this.then(null,r):(i=r,u=arguments[1],typeof i=="function"?this.then(null,function(d){return(d instanceof i?u:Xs)(d)}):this.then(null,function(d){return(d&&d.name===i?u:Xs)(d)}))},finally:function(r){return this.then(function(i){return Se.resolve(r()).then(function(){return i})},function(i){return Se.resolve(r()).then(function(){return Xs(i)})})},timeout:function(r,i){var u=this;return r<1/0?new Se(function(d,p){var h=setTimeout(function(){return p(new Ie.Timeout(i))},r);u.then(d,p).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&U(Se.prototype,Symbol.toStringTag,"Dexie.Promise"),Tt.env=bl(),S(Se,{all:function(){var r=Ge.apply(null,arguments).map(to);return new Se(function(i,u){r.length===0&&i([]);var d=r.length;r.forEach(function(p,h){return Se.resolve(p).then(function(w){r[h]=w,--d||i(r)},u)})})},resolve:function(r){return r instanceof Se?r:r&&typeof r.then=="function"?new Se(function(i,u){r.then(i,u)}):new Se(Pe,!0,r)},reject:Xs,race:function(){var r=Ge.apply(null,arguments).map(to);return new Se(function(i,u){r.map(function(d){return Se.resolve(d).then(i,u)})})},PSD:{get:function(){return De},set:function(r){return De=r}},totalEchoes:{get:function(){return eo}},newPSD:zn,usePSD:yr,scheduler:{get:function(){return kt},set:function(r){kt=r}},rejectionMapper:{get:function(){return jt},set:function(r){jt=r}},follow:function(r,i){return new Se(function(u,d){return zn(function(p,h){var w=De;w.unhandleds=[],w.onunhandled=h,w.finalize=R(function(){var k,A=this;k=function(){A.unhandleds.length===0?p():h(A.unhandleds[0])},Js.push(function q(){k(),Js.splice(Js.indexOf(q),1)}),++mr,kt(function(){--mr==0&&Pi()},[])},w.finalize),r()},i,u,d)})}}),tt&&(tt.allSettled&&U(Se,"allSettled",function(){var r=Ge.apply(null,arguments).map(to);return new Se(function(i){r.length===0&&i([]);var u=r.length,d=new Array(u);r.forEach(function(p,h){return Se.resolve(p).then(function(w){return d[h]={status:"fulfilled",value:w}},function(w){return d[h]={status:"rejected",reason:w}}).then(function(){return--u||i(d)})})})}),tt.any&&typeof AggregateError<"u"&&U(Se,"any",function(){var r=Ge.apply(null,arguments).map(to);return new Se(function(i,u){r.length===0&&u(new AggregateError([]));var d=r.length,p=new Array(d);r.forEach(function(h,w){return Se.resolve(h).then(function(k){return i(k)},function(k){p[w]=k,--d||u(new AggregateError(p))})})})}),tt.withResolvers)&&(Se.withResolvers=tt.withResolvers);var Mt={awaits:0,echoes:0,id:0},Dd=0,Qs=[],Zs=0,eo=0,Ld=0;function zn(r,w,u,d){var p=De,h=Object.create(p),w=(h.parent=p,h.ref=0,h.global=!1,h.id=++Ld,Tt.env,h.env=mt?{Promise:Se,PromiseProp:{value:Se,configurable:!0,writable:!0},all:Se.all,race:Se.race,allSettled:Se.allSettled,any:Se.any,resolve:Se.resolve,reject:Se.reject}:{},w&&v(h,w),++p.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},yr(h,r,u,d));return h.ref===0&&h.finalize(),w}function Nr(){return Mt.id||(Mt.id=++Dd),++Mt.awaits,Mt.echoes+=Ve,Mt.id}function Gn(){return!!Mt.awaits&&(--Mt.awaits==0&&(Mt.id=0),Mt.echoes=Mt.awaits*Ve,!0)}function to(r){return Mt.echoes&&r&&r.constructor===tt?(Nr(),r.then(function(i){return Gn(),i},function(i){return Gn(),Ct(i)})):r}function Rd(){var r=Qs[Qs.length-1];Qs.pop(),Yn(r,!1)}function Yn(r,i){var u,d,p=De;(i?!Mt.echoes||Zs++&&r===De:!Zs||--Zs&&r===De)||queueMicrotask(i?(function(h){++eo,Mt.echoes&&--Mt.echoes!=0||(Mt.echoes=Mt.awaits=Mt.id=0),Qs.push(De),Yn(h,!0)}).bind(null,r):Rd),r!==De&&(De=r,p===Tt&&(Tt.env=bl()),mt)&&(u=Tt.env.Promise,d=r.env,p.global||r.global)&&(Object.defineProperty(a,"Promise",d.PromiseProp),u.all=d.all,u.race=d.race,u.resolve=d.resolve,u.reject=d.reject,d.allSettled&&(u.allSettled=d.allSettled),d.any)&&(u.any=d.any)}function bl(){var r=a.Promise;return mt?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(a,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function yr(r,i,u,d,p){var h=De;try{return Yn(r,!0),i(u,d,p)}finally{Yn(h,!1)}}function wl(r,i,u,d){return typeof r!="function"?r:function(){var p=De;u&&Nr(),Yn(i,!0);try{return r.apply(this,arguments)}finally{Yn(p,!1),d&&queueMicrotask(Gn)}}}function Ai(r){Promise===tt&&Mt.echoes===0?Zs===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+qr).indexOf("[native code]")===-1&&(Nr=Gn=g);var Ct=Se.reject,gr="￿",In="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",_l="String expected.",no="__dbnames",Oi="readonly",Mi="readwrite";function br(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var kl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ro(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=ke(i))[r],i}}function xl(){throw Ie.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function rt(r,i){try{var u=Cl(r),d=Cl(i);if(u!==d)return u==="Array"?1:d==="Array"?-1:u==="binary"?1:d==="binary"?-1:u==="string"?1:d==="string"?-1:u==="Date"?1:d!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":for(var p=Sl(r),h=Sl(i),w=p.length,k=h.length,A=w<k?w:k,q=0;q<A;++q)if(p[q]!==h[q])return p[q]<h[q]?-1:1;return w===k?0:w<k?-1:1;case"Array":for(var j=r,P=i,M=j.length,B=P.length,F=M<B?M:B,K=0;K<F;++K){var N=rt(j[K],P[K]);if(N!==0)return N}return M===B?0:M<B?-1:1}}catch{}return NaN}function Cl(r){var i=typeof r;return i=="object"&&(ArrayBuffer.isView(r)||(i=Je(r))==="ArrayBuffer")?"binary":i}function Sl(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}function so(r,i,u){var d=r.schema.yProps;return d?(i&&0<u.numFailures&&(i=i.filter(function(p,h){return!u.failures[h]})),Promise.all(d.map(function(p){return p=p.updatesTable,i?r.db.table(p).where("k").anyOf(i).delete():r.db.table(p).clear()})).then(function(){return u})):u}El.prototype.execute=function(r){var i=this["@@propmod"];if(i.add!==void 0){var u=i.add;if(f(u))return o(o([],f(r)?r:[],!0),u).sort();if(typeof u=="number")return(Number(r)||0)+u;if(typeof u=="bigint")try{return BigInt(r)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(i.remove!==void 0){var d=i.remove;if(f(d))return f(r)?r.filter(function(p){return!d.includes(p)}).sort():[];if(typeof d=="number")return Number(r)-d;if(typeof d=="bigint")try{return BigInt(r)-d}catch{return BigInt(0)-d}throw new TypeError("Invalid subtrahend ".concat(d))}return u=(u=i.replacePrefix)==null?void 0:u[0],u&&typeof r=="string"&&r.startsWith(u)?i.replacePrefix[1]+r.substring(u.length):r};var as=El;function El(r){this["@@propmod"]=r}function $l(r,i){for(var u=c(i),d=u.length,p=!1,h=0;h<d;++h){var w=u[h],k=i[w],A=ae(r,w);k instanceof as?(X(r,w,k.execute(A)),p=!0):A!==k&&(X(r,w,k),p=!0)}return p}pt.prototype._trans=function(r,i,u){var d=this._tx||De.trans,p=this.name,h=G&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function w(q,j,P){if(P.schema[p])return i(P.idbtrans,P);throw new Ie.NotFound("Table "+p+" not part of transaction")}var k=Kr();try{var A=d&&d.db._novip===this.db._novip?d===De.trans?d._promise(r,w,u):zn(function(){return d._promise(r,w,u)},{trans:d,transless:De.transless||De}):function q(j,P,M,B){if(j.idbdb&&(j._state.openComplete||De.letThrough||j._vip)){var F=j._createTransaction(P,M,j._dbSchema);try{F.create(),j._state.PR1398_maxLoop=3}catch(K){return K.name===Kt.InvalidState&&j.isOpen()&&0<--j._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),j.close({disableAutoOpen:!1}),j.open().then(function(){return q(j,P,M,B)})):Ct(K)}return F._promise(P,function(K,N){return zn(function(){return De.trans=F,B(K,N,F)})}).then(function(K){if(P==="readwrite")try{F.idbtrans.commit()}catch{}return P==="readonly"?K:F._completion.then(function(){return K})})}if(j._state.openComplete)return Ct(new Ie.DatabaseClosed(j._state.dbOpenError));if(!j._state.isBeingOpened){if(!j._state.autoOpen)return Ct(new Ie.DatabaseClosed);j.open().catch(g)}return j._state.dbReadyPromise.then(function(){return q(j,P,M,B)})}(this.db,r,[this.name],w);return h&&(A._consoleTask=h,A=A.catch(function(q){return console.trace(q),Ct(q)})),A}finally{k&&Fr()}},pt.prototype.get=function(r,i){var u=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Ct(new Ie.Type("Invalid argument to Table.get()")):this._trans("readonly",function(d){return u.core.get({trans:d,key:r}).then(function(p){return u.hook.reading.fire(p)})}).then(i)},pt.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(f(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=c(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(k){if(k.compound&&i.every(function(q){return 0<=k.keyPath.indexOf(q)})){for(var A=0;A<i.length;++A)if(i.indexOf(k.keyPath[A])===-1)return!1;return!0}return!1}).sort(function(k,A){return k.keyPath.length-A.keyPath.length})[0];if(u&&this.db._maxKey!==gr)return w=u.keyPath.slice(0,i.length),this.where(w).equals(w.map(function(k){return r[k]}));!u&&G&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var d=this.schema.idxByName;function p(k,A){return rt(k,A)===0}var w=i.reduce(function(j,A){var q=j[0],j=j[1],P=d[A],M=r[A];return[q||P,q||!P?br(j,P&&P.multi?function(B){return B=ae(B,A),f(B)&&B.some(function(F){return p(M,F)})}:function(B){return p(M,ae(B,A))}):j]},[null,null]),h=w[0],w=w[1];return h?this.where(h.name).equals(r[h.keyPath]).filter(w):u?this.filter(w):this.where(i).equals("")},pt.prototype.filter=function(r){return this.toCollection().and(r)},pt.prototype.count=function(r){return this.toCollection().count(r)},pt.prototype.offset=function(r){return this.toCollection().offset(r)},pt.prototype.limit=function(r){return this.toCollection().limit(r)},pt.prototype.each=function(r){return this.toCollection().each(r)},pt.prototype.toArray=function(r){return this.toCollection().toArray(r)},pt.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},pt.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,f(r)?"[".concat(r.join("+"),"]"):r))},pt.prototype.reverse=function(){return this.toCollection().reverse()},pt.prototype.mapToClass=function(r){for(var i=this.db,u=this.name,d=((this.schema.mappedClass=r).prototype instanceof xl&&(r=(w=>{var k=j,A=w;if(typeof A!="function"&&A!==null)throw new TypeError("Class extends value "+String(A)+" is not a constructor or null");function q(){this.constructor=k}function j(){return w!==null&&w.apply(this,arguments)||this}return n(k,A),k.prototype=A===null?Object.create(A):(q.prototype=A.prototype,new q),Object.defineProperty(j.prototype,"db",{get:function(){return i},enumerable:!1,configurable:!0}),j.prototype.table=function(){return u},j})(r)),new Set),p=r.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(w){return d.add(w)});function h(w){if(!w)return w;var k,A=Object.create(r.prototype);for(k in w)if(!d.has(k))try{A[k]=w[k]}catch{}return A}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),r},pt.prototype.defineClass=function(){return this.mapToClass(function(r){v(this,r)})},pt.prototype.add=function(r,i){var u=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,w=r;return h&&p&&(w=ro(h)(r)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"add",keys:i!=null?[i]:null,values:[w]})}).then(function(k){return k.numFailures?Se.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{X(r,h,k)}catch{}return k})},pt.prototype.upsert=function(r,i){var u=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return u.core.get({trans:p,key:r}).then(function(h){var w=h??{};return $l(w,i),d&&X(w,d,r),u.core.mutate({trans:p,type:"put",values:[w],keys:[r],upsert:!0,updates:{keys:[r],changeSpecs:[i]}}).then(function(k){return k.numFailures?Se.reject(k.failures[0]):!!h})})})},pt.prototype.update=function(r,i){return typeof r!="object"||f(r)?this.where(":id").equals(r).modify(i):(r=ae(r,this.schema.primKey.keyPath))===void 0?Ct(new Ie.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i)},pt.prototype.put=function(r,i){var u=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,w=r;return h&&p&&(w=ro(h)(r)),this._trans("readwrite",function(k){return u.core.mutate({trans:k,type:"put",values:[w],keys:i!=null?[i]:null})}).then(function(k){return k.numFailures?Se.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{X(r,h,k)}catch{}return k})},pt.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(u){return i.core.mutate({trans:u,type:"delete",keys:[r]}).then(function(d){return so(i,[r],d)}).then(function(d){return d.numFailures?Se.reject(d.failures[0]):void 0})})},pt.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:kl}).then(function(u){return so(r,null,u)})}).then(function(i){return i.numFailures?Se.reject(i.failures[0]):void 0})},pt.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(u){return i.core.getMany({keys:r,trans:u}).then(function(d){return d.map(function(p){return i.hook.reading.fire(p)})})})},pt.prototype.bulkAdd=function(r,i,u){var d=this,p=Array.isArray(i)?i:void 0,h=(u=u||(p?void 0:i))?u.allKeys:void 0;return this._trans("readwrite",function(w){var k=d.schema.primKey,q=k.auto,k=k.keyPath;if(k&&p)throw new Ie.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var A=r.length,q=k&&q?r.map(ro(k)):r;return d.core.mutate({trans:w,type:"add",keys:p,values:q,wantResults:h}).then(function(j){var P=j.numFailures,M=j.failures;if(P===0)return h?j.results:j.lastResult;throw new dt("".concat(d.name,".bulkAdd(): ").concat(P," of ").concat(A," operations failed"),M)})})},pt.prototype.bulkPut=function(r,i,u){var d=this,p=Array.isArray(i)?i:void 0,h=(u=u||(p?void 0:i))?u.allKeys:void 0;return this._trans("readwrite",function(w){var k=d.schema.primKey,q=k.auto,k=k.keyPath;if(k&&p)throw new Ie.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==r.length)throw new Ie.InvalidArgument("Arguments objects and keys must have the same length");var A=r.length,q=k&&q?r.map(ro(k)):r;return d.core.mutate({trans:w,type:"put",keys:p,values:q,wantResults:h}).then(function(j){var P=j.numFailures,M=j.failures;if(P===0)return h?j.results:j.lastResult;throw new dt("".concat(d.name,".bulkPut(): ").concat(P," of ").concat(A," operations failed"),M)})})},pt.prototype.bulkUpdate=function(r){var i=this,u=this.core,d=r.map(function(w){return w.key}),p=r.map(function(w){return w.changes}),h=[];return this._trans("readwrite",function(w){return u.getMany({trans:w,keys:d,cache:"clone"}).then(function(k){var A=[],q=[],j=(r.forEach(function(P,M){var B=P.key,F=P.changes,K=k[M];if(K){for(var N=0,J=Object.keys(F);N<J.length;N++){var H=J[N],oe=F[H];if(H===i.schema.primKey.keyPath){if(rt(oe,B)!==0)throw new Ie.Constraint("Cannot update primary key in bulkUpdate()")}else X(K,H,oe)}h.push(M),A.push(B),q.push(K)}}),A.length);return u.mutate({trans:w,type:"put",keys:A,values:q,updates:{keys:d,changeSpecs:p}}).then(function(P){var M=P.numFailures,B=P.failures;if(M===0)return j;for(var F=0,K=Object.keys(B);F<K.length;F++){var N,J=K[F],H=h[Number(J)];H!=null&&(N=B[J],delete B[J],B[H]=N)}throw new dt("".concat(i.name,".bulkUpdate(): ").concat(M," of ").concat(j," operations failed"),B)})})})},pt.prototype.bulkDelete=function(r){var i=this,u=r.length;return this._trans("readwrite",function(d){return i.core.mutate({trans:d,type:"delete",keys:r}).then(function(p){return so(i,r,p)})}).then(function(d){var p=d.numFailures,h=d.failures;if(p===0)return d.lastResult;throw new dt("".concat(i.name,".bulkDelete(): ").concat(p," of ").concat(u," operations failed"),h)})};var Tl=pt;function pt(){}function ls(r){function i(w,k){if(k){for(var A=arguments.length,q=new Array(A-1);--A;)q[A-1]=arguments[A];return u[w].subscribe.apply(null,q),r}if(typeof w=="string")return u[w]}var u={};i.addEventType=h;for(var d=1,p=arguments.length;d<p;++d)h(arguments[d]);return i;function h(w,k,A){var q,j;if(typeof w!="object")return k=k||ce,j={subscribers:[],fire:A=A||g,subscribe:function(P){j.subscribers.indexOf(P)===-1&&(j.subscribers.push(P),j.fire=k(j.fire,P))},unsubscribe:function(P){j.subscribers=j.subscribers.filter(function(M){return M!==P}),j.fire=j.subscribers.reduce(k,A)}},u[w]=i[w]=j;c(q=w).forEach(function(P){var M=q[P];if(f(M))h(P,q[P][0],q[P][1]);else{if(M!=="asap")throw new Ie.InvalidArgument("Invalid event config");var B=h(P,C,function(){for(var F=arguments.length,K=new Array(F);F--;)K[F]=arguments[F];B.subscribers.forEach(function(N){de(function(){N.apply(null,K)})})})}})}}function us(r,i){return re(i).from({prototype:r}),i}function Vr(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function Ii(r,i){r.filter=br(r.filter,i)}function ji(r,i,u){var d=r.replayFilter;r.replayFilter=d?function(){return br(d(),i())}:i,r.justLimit=u&&!d}function oo(r,i){if(r.isPrimKey)return i.primaryKey;var u=i.getIndexByKeyPath(r.index);if(u)return u;throw new Ie.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed")}function Pl(r,i,u){var d=oo(r,i.schema);return i.openCursor({trans:u,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:d,range:r.range}})}function io(r,i,u,d){var p,h,w=r.replayFilter?br(r.filter,r.replayFilter()):r.filter;return r.or?(p={},h=function(k,A,q){var j,P;w&&!w(A,q,function(M){return A.stop(M)},function(M){return A.fail(M)})||((P=""+(j=A.primaryKey))=="[object ArrayBuffer]"&&(P=""+new Uint8Array(j)),_(p,P))||(p[P]=!0,i(k,A,q))},Promise.all([r.or._iterate(h,u),Al(Pl(r,d,u),r.algorithm,h,!r.keysOnly&&r.valueMapper)])):Al(Pl(r,d,u),br(r.algorithm,w),i,!r.keysOnly&&r.valueMapper)}function Al(r,i,u,d){var p=yt(d?function(h,w,k){return u(d(h),w,k)}:u);return r.then(function(h){if(h)return h.start(function(){var w=function(){return h.continue()};i&&!i(h,function(k){return w=k},function(k){h.stop(k),w=g},function(k){h.fail(k),w=g})||p(h.value,h,function(k){return w=k}),w()})})}at.prototype._read=function(r,i){var u=this._ctx;return u.error?u.table._trans(null,Ct.bind(null,u.error)):u.table._trans("readonly",r).then(i)},at.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Ct.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},at.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=br(i.algorithm,r)},at.prototype._iterate=function(r,i){return io(this._ctx,r,i,this._ctx.table.core)},at.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return r&&v(u,r),i._ctx=u,i},at.prototype.raw=function(){return this._ctx.valueMapper=null,this},at.prototype.each=function(r){var i=this._ctx;return this._read(function(u){return io(i,r,u,i.table.core)})},at.prototype.count=function(r){var i=this;return this._read(function(u){var d,p=i._ctx,h=p.table.core;return Vr(p,!0)?h.count({trans:u,query:{index:oo(p,h.schema),range:p.range}}).then(function(w){return Math.min(w,p.limit)}):(d=0,io(p,function(){return++d,!1},u,h).then(function(){return d}))}).then(r)},at.prototype.sortBy=function(r,i){var u=r.split(".").reverse(),d=u[0],p=u.length-1;function h(A,q){return q?h(A[u[q]],q-1):A[d]}var w=this._ctx.dir==="next"?1:-1;function k(A,q){return rt(h(A,p),h(q,p))*w}return this.toArray(function(A){return A.slice().sort(k)}).then(i)},at.prototype.toArray=function(r){var i=this;return this._read(function(u){var d,p,h,w=i._ctx;return Vr(w,!0)&&0<w.limit?(d=w.valueMapper,p=oo(w,w.table.core.schema),w.table.core.query({trans:u,limit:w.limit,values:!0,direction:w.dir==="prev"?"prev":void 0,query:{index:p,range:w.range}}).then(function(k){return k=k.result,d?k.map(d):k})):(h=[],io(w,function(k){return h.push(k)},u,w.table.core).then(function(){return h}))},r)},at.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,Vr(i)?ji(i,function(){var u=r;return function(d,p){return u===0||(u===1?--u:p(function(){d.advance(u),u=0}),!1)}}):ji(i,function(){var u=r;return function(){return--u<0}})),this},at.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),ji(this._ctx,function(){var i=r;return function(u,d,p){return--i<=0&&d(p),0<=i}},!0),this},at.prototype.until=function(r,i){return Ii(this._ctx,function(u,d,p){return!r(u.value)||(d(p),i)}),this},at.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},at.prototype.last=function(r){return this.reverse().first(r)},at.prototype.filter=function(r){var i;return Ii(this._ctx,function(u){return r(u.value)}),(i=this._ctx).isMatch=br(i.isMatch,r),this},at.prototype.and=function(r){return this.filter(r)},at.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},at.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},at.prototype.desc=function(){return this.reverse()},at.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(u,d){r(d.key,d)})},at.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},at.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(u,d){r(d.primaryKey,d)})},at.prototype.keys=function(r){var i=this._ctx,u=(i.keysOnly=!i.isMatch,[]);return this.each(function(d,p){u.push(p.key)}).then(function(){return u}).then(r)},at.prototype.primaryKeys=function(r){var i=this._ctx;if(Vr(i,!0)&&0<i.limit)return this._read(function(d){var p=oo(i,i.table.core.schema);return i.table.core.query({trans:d,values:!1,limit:i.limit,direction:i.dir==="prev"?"prev":void 0,query:{index:p,range:i.range}})}).then(function(d){return d.result}).then(r);i.keysOnly=!i.isMatch;var u=[];return this.each(function(d,p){u.push(p.primaryKey)}).then(function(){return u}).then(r)},at.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},at.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},at.prototype.lastKey=function(r){return this.reverse().firstKey(r)},at.prototype.distinct=function(){var r,i=this._ctx,i=i.index&&i.table.schema.idxByName[i.index];return i&&i.multi&&(r={},Ii(this._ctx,function(d){var d=d.primaryKey.toString(),p=_(r,d);return r[d]=!0,!p})),this},at.prototype.modify=function(r){var i=this,u=this._ctx;return this._write(function(d){function p(K,N){var J=N.failures;M+=K-N.numFailures;for(var H=0,oe=c(J);H<oe.length;H++){var pe=oe[H];P.push(J[pe])}}var h=typeof r=="function"?r:function(K){return $l(K,r)},w=u.table.core,j=w.schema.primaryKey,k=j.outbound,A=j.extractKey,q=200,j=i.db._options.modifyChunkSize,P=(j&&(q=typeof j=="object"?j[w.name]||j["*"]||200:j),[]),M=0,B=[],F=r===Ol;return i.clone().primaryKeys().then(function(K){function N(H){var oe=Math.min(q,K.length-H),pe=K.slice(H,H+oe);return(F?Promise.resolve([]):w.getMany({trans:d,keys:pe,cache:"immutable"})).then(function(he){var _e=[],ye=[],Ae=k?[]:null,be=F?pe:[];if(!F)for(var Oe=0;Oe<oe;++Oe){var ve=he[Oe],Be={value:ke(ve),primKey:K[H+Oe]};h.call(Be,Be.value,Be)!==!1&&(Be.value==null?be.push(K[H+Oe]):k||rt(A(ve),A(Be.value))===0?(ye.push(Be.value),k&&Ae.push(K[H+Oe])):(be.push(K[H+Oe]),_e.push(Be.value)))}return Promise.resolve(0<_e.length&&w.mutate({trans:d,type:"add",values:_e}).then(function(Ue){for(var ze in Ue.failures)be.splice(parseInt(ze),1);p(_e.length,Ue)})).then(function(){return(0<ye.length||J&&typeof r=="object")&&w.mutate({trans:d,type:"put",keys:Ae,values:ye,criteria:J,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<H}).then(function(Ue){return p(ye.length,Ue)})}).then(function(){return(0<be.length||J&&F)&&w.mutate({trans:d,type:"delete",keys:be,criteria:J,isAdditionalChunk:0<H}).then(function(Ue){return so(u.table,be,Ue)}).then(function(Ue){return p(be.length,Ue)})}).then(function(){return K.length>H+oe&&N(H+q)})})}var J=Vr(u)&&u.limit===1/0&&(typeof r!="function"||F)&&{index:u.index,range:u.range};return N(0).then(function(){if(0<P.length)throw new Fe("Error modifying one or more objects",P,M,B);return K.length})})})},at.prototype.delete=function(){var r=this._ctx,i=r.range;return!Vr(r)||r.table.schema.yProps||!r.isPrimKey&&i.type!==3?this.modify(Ol):this._write(function(u){var d=r.table.core.schema.primaryKey,p=i;return r.table.core.count({trans:u,query:{index:d,range:p}}).then(function(h){return r.table.core.mutate({trans:u,type:"deleteRange",range:p}).then(function(A){var k=A.failures,A=A.numFailures;if(A)throw new Fe("Could not delete some values",Object.keys(k).map(function(q){return k[q]}),h-A);return h-A})})})};var Kd=at;function at(){}var Ol=function(r,i){return i.value=null};function Fd(r,i){return r<i?-1:r===i?0:1}function Nd(r,i){return i<r?-1:r===i?0:1}function nn(r,i,u){return r=r instanceof Il?new r.Collection(r):r,r._ctx.error=new(u||TypeError)(i),r}function Br(r){return new r.Collection(r,function(){return Ml("")}).limit(0)}function ao(B,i,u,d){var p,h,w,k,A,q,j,P=u.length;if(!u.every(function(K){return typeof K=="string"}))return nn(B,_l);function M(K){p=K==="next"?function(J){return J.toUpperCase()}:function(J){return J.toLowerCase()},h=K==="next"?function(J){return J.toLowerCase()}:function(J){return J.toUpperCase()},w=K==="next"?Fd:Nd;var N=u.map(function(J){return{lower:h(J),upper:p(J)}}).sort(function(J,H){return w(J.lower,H.lower)});k=N.map(function(J){return J.upper}),A=N.map(function(J){return J.lower}),j=(q=K)==="next"?"":d}M("next");var B=new B.Collection(B,function(){return Jn(k[0],A[P-1]+d)}),F=(B._ondirectionchange=function(K){M(K)},0);return B._addAlgorithm(function(K,N,J){var H=K.key;if(typeof H=="string"){var oe=h(H);if(i(oe,A,F))return!0;for(var pe=null,he=F;he<P;++he){var _e=((ye,Ae,be,Oe,ve,Be)=>{for(var Ue=Math.min(ye.length,Oe.length),ze=-1,nt=0;nt<Ue;++nt){var rn=Ae[nt];if(rn!==Oe[nt])return ve(ye[nt],be[nt])<0?ye.substr(0,nt)+be[nt]+be.substr(nt+1):ve(ye[nt],Oe[nt])<0?ye.substr(0,nt)+Oe[nt]+be.substr(nt+1):0<=ze?ye.substr(0,ze)+Ae[ze]+be.substr(ze+1):null;ve(ye[nt],rn)<0&&(ze=nt)}return Ue<Oe.length&&Be==="next"?ye+be.substr(ye.length):Ue<ye.length&&Be==="prev"?ye.substr(0,be.length):ze<0?null:ye.substr(0,ze)+Oe[ze]+be.substr(ze+1)})(H,oe,k[he],A[he],w,q);_e===null&&pe===null?F=he+1:(pe===null||0<w(pe,_e))&&(pe=_e)}N(pe!==null?function(){K.continue(pe+j)}:J)}return!1}),B}function Jn(r,i,u,d){return{type:2,lower:r,upper:i,lowerOpen:u,upperOpen:d}}function Ml(r){return{type:1,lower:r,upper:r}}Object.defineProperty(It.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),It.prototype.between=function(r,i,u,d){u=u!==!1,d=d===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(u||d)&&(!u||!d)?Br(this):new this.Collection(this,function(){return Jn(r,i,!u,!d)})}catch{return nn(this,In)}},It.prototype.equals=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Ml(r)})},It.prototype.above=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(r,void 0,!0)})},It.prototype.aboveOrEqual=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(r,void 0,!1)})},It.prototype.below=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(void 0,r,!1,!0)})},It.prototype.belowOrEqual=function(r){return r==null?nn(this,In):new this.Collection(this,function(){return Jn(void 0,r)})},It.prototype.startsWith=function(r){return typeof r!="string"?nn(this,_l):this.between(r,r+gr,!0,!0)},It.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):ao(this,function(i,u){return i.indexOf(u[0])===0},[r],gr)},It.prototype.equalsIgnoreCase=function(r){return ao(this,function(i,u){return i===u[0]},[r],"")},It.prototype.anyOfIgnoreCase=function(){var r=Ge.apply(it,arguments);return r.length===0?Br(this):ao(this,function(i,u){return u.indexOf(i)!==-1},r,"")},It.prototype.startsWithAnyOfIgnoreCase=function(){var r=Ge.apply(it,arguments);return r.length===0?Br(this):ao(this,function(i,u){return u.some(function(d){return i.indexOf(d)===0})},r,gr)},It.prototype.anyOf=function(){var r,i,u=this,d=Ge.apply(it,arguments),p=this._cmp;try{d.sort(p)}catch{return nn(this,In)}return d.length===0?Br(this):((r=new this.Collection(this,function(){return Jn(d[0],d[d.length-1])}))._ondirectionchange=function(h){p=h==="next"?u._ascending:u._descending,d.sort(p)},i=0,r._addAlgorithm(function(h,w,k){for(var A=h.key;0<p(A,d[i]);)if(++i===d.length)return w(k),!1;return p(A,d[i])===0||(w(function(){h.continue(d[i])}),!1)}),r)},It.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},It.prototype.noneOf=function(){var r=Ge.apply(it,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return nn(this,In)}var i=r.reduce(function(u,d){return u?u.concat([[u[u.length-1][1],d]]):[[-1/0,d]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},It.prototype.inAnyRange=function(r,J){var u=this,d=this._cmp,p=this._ascending,h=this._descending,w=this._min,k=this._max;if(r.length===0)return Br(this);if(!r.every(function(H){return H[0]!==void 0&&H[1]!==void 0&&p(H[0],H[1])<=0}))return nn(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ie.InvalidArgument);var A=!J||J.includeLowers!==!1,q=J&&J.includeUppers===!0,j,P=p;function M(H,oe){return P(H[0],oe[0])}try{(j=r.reduce(function(H,oe){for(var pe=0,he=H.length;pe<he;++pe){var _e=H[pe];if(d(oe[0],_e[1])<0&&0<d(oe[1],_e[0])){_e[0]=w(_e[0],oe[0]),_e[1]=k(_e[1],oe[1]);break}}return pe===he&&H.push(oe),H},[])).sort(M)}catch{return nn(this,In)}var B=0,F=q?function(H){return 0<p(H,j[B][1])}:function(H){return 0<=p(H,j[B][1])},K=A?function(H){return 0<h(H,j[B][0])}:function(H){return 0<=h(H,j[B][0])},N=F,J=new this.Collection(this,function(){return Jn(j[0][0],j[j.length-1][1],!A,!q)});return J._ondirectionchange=function(H){P=H==="next"?(N=F,p):(N=K,h),j.sort(M)},J._addAlgorithm(function(H,oe,pe){for(var he,_e=H.key;N(_e);)if(++B===j.length)return oe(pe),!1;return!F(he=_e)&&!K(he)||(u._cmp(_e,j[B][1])===0||u._cmp(_e,j[B][0])===0||oe(function(){P===p?H.continue(j[B][0]):H.continue(j[B][1])}),!1)}),J},It.prototype.startsWithAnyOf=function(){var r=Ge.apply(it,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Br(this):this.inAnyRange(r.map(function(i){return[i,i+gr]})):nn(this,"startsWithAnyOf() only works with strings")};var Il=It;function It(){}function vn(r){return yt(function(i){return cs(i),r(i.target.error),!1})}function cs(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var lo="storagemutated",Di="x-storagemutated-1",Xn=ls(null,lo),Vd=(wn.prototype._lock=function(){return Z(!De.global),++this._reculock,this._reculock!==1||De.global||(De.lockOwnerFor=this),this},wn.prototype._unlock=function(){if(Z(!De.global),--this._reculock==0)for(De.global||(De.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{yr(r[1],r[0])}catch{}}return this},wn.prototype._locked=function(){return this._reculock&&De.lockOwnerFor!==this},wn.prototype.create=function(r){var i=this;if(this.mode){var u=this.db.idbdb,d=this.db._state.dbOpenError;if(Z(!this.idbtrans),!r&&!u)switch(d&&d.name){case"DatabaseClosedError":throw new Ie.DatabaseClosed(d);case"MissingAPIError":throw new Ie.MissingAPI(d.message,d);default:throw new Ie.OpenFailed(d)}if(!this.active)throw new Ie.TransactionInactive;Z(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=yt(function(p){cs(p),i._reject(r.error)}),r.onabort=yt(function(p){cs(p),i.active&&i._reject(new Ie.Abort(r.error)),i.active=!1,i.on("abort").fire(p)}),r.oncomplete=yt(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Xn.storagemutated.fire(r.mutatedParts)})}return this},wn.prototype._promise=function(r,i,u){var d,p=this;return r==="readwrite"&&this.mode!=="readwrite"?Ct(new Ie.ReadOnly("Transaction is readonly")):this.active?this._locked()?new Se(function(h,w){p._blockedFuncs.push([function(){p._promise(r,i,u).then(h,w)},De])}):u?zn(function(){var h=new Se(function(w,k){p._lock();var A=i(w,k,p);A&&A.then&&A.then(w,k)});return h.finally(function(){return p._unlock()}),h._lib=!0,h}):((d=new Se(function(h,w){var k=i(h,w,p);k&&k.then&&k.then(h,w)}))._lib=!0,d):Ct(new Ie.TransactionInactive)},wn.prototype._root=function(){return this.parent?this.parent._root():this},wn.prototype.waitFor=function(r){var i,u=this._root(),d=Se.resolve(r),p=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return d}):(u._waitingFor=d,u._waitingQueue=[],i=u.idbtrans.objectStore(u.storeNames[0]),function h(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(i.get(-1/0).onsuccess=h)}()),u._waitingFor);return new Se(function(h,w){d.then(function(k){return u._waitingQueue.push(yt(h.bind(null,k)))},function(k){return u._waitingQueue.push(yt(w.bind(null,k)))}).finally(function(){u._waitingFor===p&&(u._waitingFor=null)})})},wn.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Ie.Abort))},wn.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(_(i,r))return i[r];var u=this.schema[r];if(u)return(u=new this.db.Table(r,u,this)).core=this.db.core.table(r),i[r]=u;throw new Ie.NotFound("Table "+r+" not part of transaction")},wn);function wn(){}function Li(r,i,u,d,p,h,w,k){return{name:r,keyPath:i,unique:u,multi:d,auto:p,compound:h,src:(u&&!w?"&":"")+(d?"*":"")+(p?"++":"")+jl(i),type:k}}function jl(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Ri(r,i,u){return{name:r,primKey:i,indexes:u,mappedClass:null,idxByName:(d=function(p){return[p.name,p]},u.reduce(function(p,h,w){return h=d(h,w),h&&(p[h[0]]=h[1]),p},{}))};var d}var ds=function(r){try{return r.only([[]]),ds=function(){return[[]]},[[]]}catch{return ds=function(){return gr},gr}};function Ki(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(u){return u[i]}:function(u){return ae(u,i)}:function(u){return ae(u,r)};var i}function Dl(r){return[].slice.call(r)}var Bd=0;function fs(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function Ud(r,i,w){function d(N){if(N.type===3)return null;if(N.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var B=N.lower,F=N.upper,K=N.lowerOpen,N=N.upperOpen;return B===void 0?F===void 0?null:i.upperBound(F,!!N):F===void 0?i.lowerBound(B,!!K):i.bound(B,F,!!K,!!N)}function p(M){var B,F,K=M.name;return{name:K,schema:M,mutate:function(N){var J=N.trans,H=N.type,oe=N.keys,pe=N.values,he=N.range;return new Promise(function(_e,ye){_e=yt(_e);var Ae=J.objectStore(K),be=Ae.keyPath==null,Oe=H==="put"||H==="add";if(!Oe&&H!=="delete"&&H!=="deleteRange")throw new Error("Invalid operation type: "+H);var ve,Be=(oe||pe||{length:1}).length;if(oe&&pe&&oe.length!==pe.length)throw new Error("Given keys array must have same length as given values array.");if(Be===0)return _e({numFailures:0,failures:{},results:[],lastResult:void 0});function Ue(Gt){++rn,cs(Gt)}var ze=[],nt=[],rn=0;if(H==="deleteRange"){if(he.type===4)return _e({numFailures:rn,failures:nt,results:[],lastResult:void 0});he.type===3?ze.push(ve=Ae.clear()):ze.push(ve=Ae.delete(d(he)))}else{var be=Oe?be?[pe,oe]:[pe,null]:[oe,null],He=be[0],Nt=be[1];if(Oe)for(var Vt=0;Vt<Be;++Vt)ze.push(ve=Nt&&Nt[Vt]!==void 0?Ae[H](He[Vt],Nt[Vt]):Ae[H](He[Vt])),ve.onerror=Ue;else for(Vt=0;Vt<Be;++Vt)ze.push(ve=Ae[H](He[Vt])),ve.onerror=Ue}function _o(Gt){Gt=Gt.target.result,ze.forEach(function(kr,na){return kr.error!=null&&(nt[na]=kr.error)}),_e({numFailures:rn,failures:nt,results:H==="delete"?oe:ze.map(function(kr){return kr.result}),lastResult:Gt})}ve.onerror=function(Gt){Ue(Gt),_o(Gt)},ve.onsuccess=_o})},getMany:function(N){var J=N.trans,H=N.keys;return new Promise(function(oe,pe){oe=yt(oe);for(var he,_e=J.objectStore(K),ye=H.length,Ae=new Array(ye),be=0,Oe=0,ve=function(ze){ze=ze.target,Ae[ze._pos]=ze.result,++Oe===be&&oe(Ae)},Be=vn(pe),Ue=0;Ue<ye;++Ue)H[Ue]!=null&&((he=_e.get(H[Ue]))._pos=Ue,he.onsuccess=ve,he.onerror=Be,++be);be===0&&oe(Ae)})},get:function(N){var J=N.trans,H=N.key;return new Promise(function(oe,pe){oe=yt(oe);var he=J.objectStore(K).get(H);he.onsuccess=function(_e){return oe(_e.target.result)},he.onerror=vn(pe)})},query:(B=A,F=q,function(N){return new Promise(function(J,H){J=yt(J);var oe,pe,he,_e,Be=N.trans,ye=N.values,Ae=N.limit,ve=N.query,be=(be=N.direction)!=null?be:"next",Oe=Ae===1/0?void 0:Ae,Ue=ve.index,ve=ve.range,Be=Be.objectStore(K),Be=Ue.isPrimaryKey?Be:Be.index(Ue.name),Ue=d(ve);if(Ae===0)return J({result:[]});F?(ve={query:Ue,count:Oe,direction:be},(oe=ye?Be.getAll(ve):Be.getAllKeys(ve)).onsuccess=function(ze){return J({result:ze.target.result})},oe.onerror=vn(H)):B&&be==="next"?((oe=ye?Be.getAll(Ue,Oe):Be.getAllKeys(Ue,Oe)).onsuccess=function(ze){return J({result:ze.target.result})},oe.onerror=vn(H)):(pe=0,he=!ye&&"openKeyCursor"in Be?Be.openKeyCursor(Ue,be):Be.openCursor(Ue,be),_e=[],he.onsuccess=function(){var ze=he.result;return!ze||(_e.push(ye?ze.value:ze.primaryKey),++pe===Ae)?J({result:_e}):void ze.continue()},he.onerror=vn(H))})}),openCursor:function(N){var J=N.trans,H=N.values,oe=N.query,pe=N.reverse,he=N.unique;return new Promise(function(_e,ye){_e=yt(_e);var Oe=oe.index,Ae=oe.range,be=J.objectStore(K),be=Oe.isPrimaryKey?be:be.index(Oe.name),Oe=pe?he?"prevunique":"prev":he?"nextunique":"next",ve=!H&&"openKeyCursor"in be?be.openKeyCursor(d(Ae),Oe):be.openCursor(d(Ae),Oe);ve.onerror=vn(ye),ve.onsuccess=yt(function(Be){var Ue,ze,nt,rn,He=ve.result;He?(He.___id=++Bd,He.done=!1,Ue=He.continue.bind(He),ze=(ze=He.continuePrimaryKey)&&ze.bind(He),nt=He.advance.bind(He),rn=function(){throw new Error("Cursor not stopped")},He.trans=J,He.stop=He.continue=He.continuePrimaryKey=He.advance=function(){throw new Error("Cursor not started")},He.fail=yt(ye),He.next=function(){var Nt=this,Vt=1;return this.start(function(){return Vt--?Nt.continue():Nt.stop()}).then(function(){return Nt})},He.start=function(Nt){function Vt(){if(ve.result)try{Nt()}catch(Gt){He.fail(Gt)}else He.done=!0,He.start=function(){throw new Error("Cursor behind last entry")},He.stop()}var _o=new Promise(function(Gt,kr){Gt=yt(Gt),ve.onerror=vn(kr),He.fail=kr,He.stop=function(na){He.stop=He.continue=He.continuePrimaryKey=He.advance=rn,Gt(na)}});return ve.onsuccess=yt(function(Gt){ve.onsuccess=Vt,Vt()}),He.continue=Ue,He.continuePrimaryKey=ze,He.advance=nt,Vt(),_o},_e(He)):_e(null)},ye)})},count:function(N){var J=N.query,H=N.trans,oe=J.index,pe=J.range;return new Promise(function(he,_e){var ye=H.objectStore(K),ye=oe.isPrimaryKey?ye:ye.index(oe.name),Ae=d(pe),Ae=Ae?ye.count(Ae):ye.count();Ae.onsuccess=yt(function(be){return he(be.target.result)}),Ae.onerror=vn(_e)})}}}h=w,k=Dl((w=r).objectStoreNames),j=0<k.length?h.objectStore(k[0]):{};var h,w={schema:{name:w.name,tables:k.map(function(M){return h.objectStore(M)}).map(function(M){var B=M.keyPath,F=M.autoIncrement,N=f(B),K={},N={name:M.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:B==null,compound:N,keyPath:B,autoIncrement:F,unique:!0,extractKey:Ki(B)},indexes:Dl(M.indexNames).map(function(J){return M.index(J)}).map(function(pe){var he=pe.name,H=pe.unique,oe=pe.multiEntry,pe=pe.keyPath,he={name:he,compound:f(pe),keyPath:pe,unique:H,multiEntry:oe,extractKey:Ki(pe)};return K[fs(pe)]=he}),getIndexByKeyPath:function(J){return K[fs(J)]}};return K[":id"]=N.primaryKey,B!=null&&(K[fs(B)]=N.primaryKey),N})},hasGetAll:0<k.length&&"getAll"in j&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:"getAllRecords"in j},k=w.schema,A=w.hasGetAll,q=w.hasIdb3Features,j=k.tables.map(p),P={};return j.forEach(function(M){return P[M.name]=M}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(M){if(P[M])return P[M];throw new Error("Table '".concat(M,"' not found"))},MIN_KEY:-1/0,MAX_KEY:ds(i),schema:k}}function qd(r,i,u,d){return u=u.IDBKeyRange,i=Ud(i,u,d),{dbcore:r.dbcore.reduce(function(p,h){return h=h.create,s(s({},p),h(p))},i)}}function uo(r,i){var u=i.db,u=qd(r._middlewares,u,r._deps,i);r.core=u.dbcore,r.tables.forEach(function(d){var p=d.name;r.core.schema.tables.some(function(h){return h.name===p})&&(d.core=r.core.table(p),r[p]instanceof r.Table)&&(r[p].core=d.core)})}function co(r,i,u,d){u.forEach(function(p){var h=d[p];i.forEach(function(w){var k=function A(q,j){return se(q,j)||(q=y(q))&&A(q,j)}(w,p);(!k||"value"in k&&k.value===void 0)&&(w===r.Transaction.prototype||w instanceof r.Transaction?U(w,p,{get:function(){return this.table(p)},set:function(A){$(this,p,{value:A,writable:!0,configurable:!0,enumerable:!0})}}):w[p]=new r.Table(p,h))})})}function Fi(r,i){i.forEach(function(u){for(var d in u)u[d]instanceof r.Table&&delete u[d]})}function Hd(r,i){return r._cfg.version-i._cfg.version}function Wd(r,i,u,d){var p=r._dbSchema,h=(u.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=Ri("$meta",Rl("")[0],[]),r._storeNames.push("$meta")),r._createTransaction("readwrite",r._storeNames,p)),w=(h.create(u),h._completion.catch(d),h._reject.bind(h)),k=De.transless||De;zn(function(){if(De.trans=h,De.transless=k,i!==0)return uo(r,u),q=i,((A=h).storeNames.includes("$meta")?A.table("$meta").get("version").then(function(j){return j??q}):Se.resolve(q)).then(function(N){var P=r,M=N,B=h,F=u,K=[],N=P._versions,J=P._dbSchema=po(0,P.idbdb,F);return(N=N.filter(function(H){return H._cfg.version>=M})).length===0?Se.resolve():(N.forEach(function(H){K.push(function(){var oe,pe,he,_e=J,ye=H._cfg.dbschema,Ae=(vo(P,_e,F),vo(P,ye,F),J=P._dbSchema=ye,Ni(_e,ye)),be=(Ae.add.forEach(function(Oe){Vi(F,Oe[0],Oe[1].primKey,Oe[1].indexes)}),Ae.change.forEach(function(Oe){if(Oe.recreate)throw new Ie.Upgrade("Not yet support for changing primary key");var ve=F.objectStore(Oe.name);Oe.add.forEach(function(Be){return fo(ve,Be)}),Oe.change.forEach(function(Be){ve.deleteIndex(Be.name),fo(ve,Be)}),Oe.del.forEach(function(Be){return ve.deleteIndex(Be)})}),H._cfg.contentUpgrade);if(be&&H._cfg.version>M)return uo(P,F),B._memoizedTables={},oe=O(ye),Ae.del.forEach(function(Oe){oe[Oe]=_e[Oe]}),Fi(P,[P.Transaction.prototype]),co(P,[P.Transaction.prototype],c(oe),oe),B.schema=oe,(pe=Qe(be))&&Nr(),ye=Se.follow(function(){var Oe;(he=be(B))&&pe&&(Oe=Gn.bind(null,null),he.then(Oe,Oe))}),he&&typeof he.then=="function"?Se.resolve(he):ye.then(function(){return he})}),K.push(function(oe){var pe,he,_e=H._cfg.dbschema;pe=_e,he=oe,[].slice.call(he.db.objectStoreNames).forEach(function(ye){return pe[ye]==null&&he.db.deleteObjectStore(ye)}),Fi(P,[P.Transaction.prototype]),co(P,[P.Transaction.prototype],P._storeNames,P._dbSchema),B.schema=P._dbSchema}),K.push(function(oe){P.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(P.idbdb.version/10)===H._cfg.version?(P.idbdb.deleteObjectStore("$meta"),delete P._dbSchema.$meta,P._storeNames=P._storeNames.filter(function(pe){return pe!=="$meta"})):oe.objectStore("$meta").put(H._cfg.version,"version"))})}),function H(){return K.length?Se.resolve(K.shift()(B.idbtrans)).then(H):Se.resolve()}().then(function(){Ll(J,F)}))}).catch(w);var A,q;c(p).forEach(function(j){Vi(u,j,p[j].primKey,p[j].indexes)}),uo(r,u),Se.follow(function(){return r.on.populate.fire(h)}).catch(w)})}function zd(r,i){Ll(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var u=po(0,r.idbdb,i);vo(r,r._dbSchema,i);for(var d=0,p=Ni(u,r._dbSchema).change;d<p.length;d++){var h=(w=>{if(w.change.length||w.recreate)return console.warn("Unable to patch indexes of table ".concat(w.name," because it has changes on the type of index or primary key.")),{value:void 0};var k=i.objectStore(w.name);w.add.forEach(function(A){G&&console.debug("Dexie upgrade patch: Creating missing index ".concat(w.name,".").concat(A.src)),fo(k,A)})})(p[d]);if(typeof h=="object")return h.value}}function Ni(r,i){var u,d={del:[],add:[],change:[]};for(u in r)i[u]||d.del.push(u);for(u in i){var p=r[u],h=i[u];if(p){var w={name:u,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||p.primKey.auto!==h.primKey.auto)w.recreate=!0,d.change.push(w);else{var k=p.idxByName,A=h.idxByName,q=void 0;for(q in k)A[q]||w.del.push(q);for(q in A){var j=k[q],P=A[q];j?j.src!==P.src&&w.change.push(P):w.add.push(P)}(0<w.del.length||0<w.add.length||0<w.change.length)&&d.change.push(w)}}else d.add.push([u,h])}return d}function Vi(r,i,u,d){var p=r.db.createObjectStore(i,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});d.forEach(function(h){return fo(p,h)})}function Ll(r,i){c(r).forEach(function(u){i.db.objectStoreNames.contains(u)||(G&&console.debug("Dexie: Creating missing table",u),Vi(i,u,r[u].primKey,r[u].indexes))})}function fo(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function po(r,i,u){var d={};return T(i.objectStoreNames,0).forEach(function(p){for(var h=u.objectStore(p),w=Li(jl(q=h.keyPath),q||"",!0,!1,!!h.autoIncrement,q&&typeof q!="string",!0),k=[],A=0;A<h.indexNames.length;++A){var j=h.index(h.indexNames[A]),q=j.keyPath,j=Li(j.name,q,!!j.unique,!!j.multiEntry,!1,q&&typeof q!="string",!1);k.push(j)}d[p]=Ri(p,w,k)}),d}function vo(r,i,u){for(var d=u.db.objectStoreNames,p=0;p<d.length;++p){var h=d[p],w=u.objectStore(h);r._hasGetAll="getAll"in w;for(var k=0;k<w.indexNames.length;++k){var A,q=w.indexNames[k],j=w.index(q).keyPath,j=typeof j=="string"?j:"["+T(j).join("+")+"]";i[h]&&(A=i[h].idxByName[j])&&(A.name=q,delete i[h].idxByName[j],i[h].idxByName[q]=A)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&a.WorkerGlobalScope&&a instanceof a.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function Rl(r){return r.split(",").map(function(i,u){var p=i.split(":"),d=(d=p[1])==null?void 0:d.trim(),p=(i=p[0].trim()).replace(/([&*]|\+\+)/g,""),h=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return Li(p,h||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),f(h),u===0,d)})}Ur.prototype._createTableSchema=Ri,Ur.prototype._parseIndexSyntax=Rl,Ur.prototype._parseStoresSpec=function(r,i){var u=this;c(r).forEach(function(d){if(r[d]!==null){var p=u._parseIndexSyntax(r[d]),h=p.shift();if(!h)throw new Ie.Schema("Invalid schema for table "+d+": "+r[d]);if(h.unique=!0,h.multi)throw new Ie.Schema("Primary key cannot be multiEntry*");p.forEach(function(w){if(w.auto)throw new Ie.Schema("Only primary key can be marked as autoIncrement (++)");if(!w.keyPath)throw new Ie.Schema("Index must have a name and cannot be an empty string")}),h=u._createTableSchema(d,h,p),i[d]=h}})},Ur.prototype.stores=function(u){var i=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?v(this._cfg.storesSource,u):u,i._versions),d={},p={};return u.forEach(function(h){v(d,h._cfg.storesSource),p=h._cfg.dbschema={},h._parseStoresSpec(d,p)}),i._dbSchema=p,Fi(i,[i._allTables,i,i.Transaction.prototype]),co(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],c(p),p),i._storeNames=c(p),this},Ur.prototype.upgrade=function(r){return this._cfg.contentUpgrade=z(this._cfg.contentUpgrade||g,r),this};var Gd=Ur;function Ur(){}var ps=(()=>{var r,i,u;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(r=new Set,i=new FinalizationRegistry(function(d){r.delete(d)}),{toArray:function(){return Array.from(r).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);r.add(p),i.register(d._novip,p,p),r.size>d._options.maxConnections&&(p=r.values().next().value,r.delete(p),i.unregister(p))},remove:function(d){if(d)for(var p=r.values(),h=p.next();!h.done;){var w=h.value;if(w.deref()===d._novip)return r.delete(w),void i.unregister(w);h=p.next()}}}):(u=[],{toArray:function(){return u},add:function(d){u.push(d._novip)},remove:function(d){d&&(d=u.indexOf(d._novip))!==-1&&u.splice(d,1)}})})();function Bi(r,i){var u=r._dbNamesDB;return u||(u=r._dbNamesDB=new jn(no,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function Ui(r){return r&&typeof r.databases=="function"}function qi(r){return zn(function(){return De.letThrough=!0,r()})}function Hi(r){return!("from"in r)}var Ft=function(r,i){var u;if(!this)return u=new Ft,r&&"d"in r&&v(u,r),u;v(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function vs(r,i,u){var d=rt(i,u);if(!isNaN(d)){if(0<d)throw RangeError();if(Hi(r))return v(r,{from:i,to:u,d:1});var d=r.l,p=r.r;if(rt(u,r.from)<0)return d?vs(d,i,u):r.l={from:i,to:u,d:1,l:null,r:null},Fl(r);if(0<rt(i,r.to))return p?vs(p,i,u):r.r={from:i,to:u,d:1,l:null,r:null},Fl(r);rt(i,r.from)<0&&(r.from=i,r.l=null,r.d=p?p.d+1:1),0<rt(u,r.to)&&(r.to=u,r.r=null,r.d=r.l?r.l.d+1:1),i=!r.r,d&&!r.l&&hs(r,d),p&&i&&hs(r,p)}}function hs(r,i){Hi(i)||function u(d,p){var h=p.from,w=p.l,k=p.r;vs(d,h,p.to),w&&u(d,w),k&&u(d,k)}(r,i)}function Kl(r,i){var u=ho(i),d=u.next();if(!d.done)for(var p=d.value,h=ho(r),w=h.next(p.from),k=w.value;!d.done&&!w.done;){if(rt(k.from,p.to)<=0&&0<=rt(k.to,p.from))return!0;rt(p.from,k.from)<0?p=(d=u.next(k.from)).value:k=(w=h.next(p.from)).value}return!1}function ho(r){var i=Hi(r)?null:{s:0,n:r};return{next:function(u){for(var d=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,d)for(;i.n.l&&rt(u,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!d||rt(u,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Fl(r){var i,u,d,p=(((p=r.r)==null?void 0:p.d)||0)-(((p=r.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(i=p=="r"?"l":"r",u=s({},r),d=r[p],r.from=d.from,r.to=d.to,r[p]=d[p],u[p]=d[i],(r[i]=u).d=Nl(u)),r.d=Nl(r)}function Nl(u){var i=u.r,u=u.l;return(i?u?Math.max(i.d,u.d):i.d:u?u.d:0)+1}function mo(r,i){return c(i).forEach(function(u){r[u]?hs(r[u],i[u]):r[u]=function d(p){var h,w,k={};for(h in p)_(p,h)&&(w=p[h],k[h]=!w||typeof w!="object"||ue.has(w.constructor)?w:d(w));return k}(i[u])}),r}function Wi(r,i){return r.all||i.all||Object.keys(r).some(function(u){return i[u]&&Kl(i[u],r[u])})}S(Ft.prototype,((Ye={add:function(r){return hs(this,r),this},addKey:function(r){return vs(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(u){return vs(i,u,u)}),this},hasKey:function(r){var i=ho(this).next(r).value;return i&&rt(i.from,r)<=0&&0<=rt(i.to,r)}})[Le]=function(){return ho(this)},Ye));var wr={},zi={},Gi=!1;function yo(r){mo(zi,r),Gi||(Gi=!0,setTimeout(function(){Gi=!1,Yi(zi,!(zi={}))},0))}function Yi(r,i){i===void 0&&(i=!1);var u=new Set;if(r.all)for(var d=0,p=Object.values(wr);d<p.length;d++)Vl(k=p[d],r,u,i);else for(var h in r){var w,k,h=/^idb\:\/\/(.*)\/(.*)\//.exec(h);h&&(w=h[1],h=h[2],k=wr["idb://".concat(w,"/").concat(h)])&&Vl(k,r,u,i)}u.forEach(function(A){return A()})}function Vl(r,i,u,d){for(var p=[],h=0,w=Object.entries(r.queries.query);h<w.length;h++){for(var k=w[h],A=k[0],q=[],j=0,P=k[1];j<P.length;j++){var M=P[j];Wi(i,M.obsSet)?M.subscribers.forEach(function(N){return u.add(N)}):d&&q.push(M)}d&&p.push([A,q])}if(d)for(var B=0,F=p;B<F.length;B++){var K=F[B],A=K[0],q=K[1];r.queries.query[A]=q}}function Yd(r){var i=r._state,u=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Ct(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var d=i.openCanceller,p=Math.round(10*r.verno),h=!1;function w(){if(i.openCanceller!==d)throw new Ie.DatabaseClosed("db.open() was cancelled")}function k(){return new Se(function(M,B){if(w(),!u)throw new Ie.MissingAPI;var F=r.name,K=i.autoSchema||!p?u.open(F):u.open(F,p);if(!K)throw new Ie.MissingAPI;K.onerror=vn(B),K.onblocked=yt(r._fireOnBlocked),K.onupgradeneeded=yt(function(N){var J;j=K.transaction,i.autoSchema&&!r._options.allowEmptyDB?(K.onerror=cs,j.abort(),K.result.close(),(J=u.deleteDatabase(F)).onsuccess=J.onerror=yt(function(){B(new Ie.NoSuchDatabase("Database ".concat(F," doesnt exist")))})):(j.onerror=vn(B),J=N.oldVersion>Math.pow(2,62)?0:N.oldVersion,P=J<1,r.idbdb=K.result,h&&zd(r,j),Wd(r,J/10,j,B))},B),K.onsuccess=yt(function(){j=null;var N,J,H,oe,pe,he,_e=r.idbdb=K.result,ye=T(_e.objectStoreNames);if(0<ye.length)try{var Ae=_e.transaction((pe=ye).length===1?pe[0]:pe,"readonly");if(i.autoSchema)he=_e,oe=Ae,(H=r).verno=he.version/10,oe=H._dbSchema=po(0,he,oe),H._storeNames=T(he.objectStoreNames,0),co(H,[H._allTables],c(oe),oe);else if(vo(r,r._dbSchema,Ae),J=Ae,((J=Ni(po(0,(N=r).idbdb,J),N._dbSchema)).add.length||J.change.some(function(be){return be.add.length||be.change.length}))&&!h)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),_e.close(),p=_e.version+1,h=!0,M(k());uo(r,Ae)}catch{}ps.add(r),_e.onversionchange=yt(function(be){i.vcFired=!0,r.on("versionchange").fire(be)}),_e.onclose=yt(function(){r.close({disableAutoOpen:!1})}),P&&(ye=r._deps,pe=F,Ui(he=ye.indexedDB)||pe===no||Bi(he,ye.IDBKeyRange).put({name:pe}).catch(g)),M()},B)}).catch(function(M){switch(M==null?void 0:M.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),k();break;case"VersionError":if(0<p)return p=0,k()}return Se.reject(M)})}var A,q=i.dbReadyResolve,j=null,P=!1;return Se.race([d,(typeof navigator>"u"?Se.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(M){function B(){return indexedDB.databases().finally(M)}A=setInterval(B,100),B()}).finally(function(){return clearInterval(A)}):Promise.resolve()).then(k)]).then(function(){return w(),i.onReadyBeingFired=[],Se.resolve(qi(function(){return r.on.ready.fire(r.vip)})).then(function M(){var B;if(0<i.onReadyBeingFired.length)return B=i.onReadyBeingFired.reduce(z,g),i.onReadyBeingFired=[],Se.resolve(qi(function(){return B(r.vip)})).then(M)})}).finally(function(){i.openCanceller===d&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(M){i.dbOpenError=M;try{j&&j.abort()}catch{}return d===i.openCanceller&&r._close(),Ct(M)}).finally(function(){i.openComplete=!0,q()}).then(function(){var M;return P&&(M={},r.tables.forEach(function(B){B.schema.indexes.forEach(function(F){F.name&&(M["idb://".concat(r.name,"/").concat(B.name,"/").concat(F.name)]=new Ft(-1/0,[[[]]]))}),M["idb://".concat(r.name,"/").concat(B.name,"/")]=M["idb://".concat(r.name,"/").concat(B.name,"/:dels")]=new Ft(-1/0,[[[]]])}),Xn(lo).fire(M),Yi(M,!0)),r})}function Ji(r){function i(h){return r.next(h)}var u=p(i),d=p(function(h){return r.throw(h)});function p(h){return function(k){var k=h(k),A=k.value;return k.done?A:A&&typeof A.then=="function"?A.then(u,d):f(A)?Promise.all(A).then(u,d):u(A)}}return p(i)()}function go(r,i,u){for(var d=f(r)?r.slice():[r],p=0;p<u;++p)d.push(i);return d}var Jd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return s(s({},r),{table:function(d){var u=r.table(d),d=u.schema,p=Object.create(null),h=[];function w(M,B,F){var H=fs(M),K=p[H]=p[H]||[],N=M==null?0:typeof M=="string"?1:M.length,J=0<B,H=s(s({},F),{name:J?"".concat(H,"(virtual-from:").concat(F.name,")"):F.name,lowLevelIndex:F,isVirtual:J,keyTail:B,keyLength:N,extractKey:Ki(M),unique:!J&&F.unique});return K.push(H),H.isPrimaryKey||h.push(H),1<N&&w(N===2?M[0]:M.slice(0,N-1),B+1,F),K.sort(function(oe,pe){return oe.keyTail-pe.keyTail}),H}var k=w(d.primaryKey.keyPath,0,d.primaryKey);p[":id"]=[k];for(var A=0,q=d.indexes;A<q.length;A++){var j=q[A];w(j.keyPath,0,j)}function P(M){var B,F=M.query.index;return F.isVirtual?s(s({},M),{query:{index:F.lowLevelIndex,range:(B=M.query.range,F=F.keyTail,{type:B.type===1?2:B.type,lower:go(B.lower,B.lowerOpen?r.MAX_KEY:r.MIN_KEY,F),lowerOpen:!0,upper:go(B.upper,B.upperOpen?r.MIN_KEY:r.MAX_KEY,F),upperOpen:!0})}}):M}return s(s({},u),{schema:s(s({},d),{primaryKey:k,indexes:h,getIndexByKeyPath:function(M){return(M=p[fs(M)])&&M[0]}}),count:function(M){return u.count(P(M))},query:function(M){return u.query(P(M))},openCursor:function(M){var B=M.query.index,F=B.keyTail,K=B.keyLength;return B.isVirtual?u.openCursor(P(M)).then(function(J){return J&&N(J)}):u.openCursor(M);function N(J){return Object.create(J,{continue:{value:function(H){H!=null?J.continue(go(H,M.reverse?r.MAX_KEY:r.MIN_KEY,F)):M.unique?J.continue(J.key.slice(0,K).concat(M.reverse?r.MIN_KEY:r.MAX_KEY,F)):J.continue()}},continuePrimaryKey:{value:function(H,oe){J.continuePrimaryKey(go(H,r.MAX_KEY,F),oe)}},primaryKey:{get:function(){return J.primaryKey}},key:{get:function(){var H=J.key;return K===1?H[0]:H.slice(0,K)}},value:{get:function(){return J.value}}})}}})}})}};function Xi(r,i,u,d){return u=u||{},d=d||"",c(r).forEach(function(p){var h,w,k;_(i,p)?(h=r[p],w=i[p],typeof h=="object"&&typeof w=="object"&&h&&w?(k=Je(h))!==Je(w)?u[d+p]=i[p]:k==="Object"?Xi(h,w,u,d+p+"."):h!==w&&(u[d+p]=i[p]):h!==w&&(u[d+p]=i[p])):u[d+p]=void 0}),c(i).forEach(function(p){_(r,p)||(u[d+p]=i[p])}),u}function Qi(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Xd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return s(s({},r),{table:function(i){var u=r.table(i),d=u.schema.primaryKey;return s(s({},u),{mutate:function(p){var h=De.trans,w=h.table(i).hook,k=w.deleting,A=w.creating,q=w.updating;switch(p.type){case"add":if(A.fire===g)break;return h._promise("readwrite",function(){return j(p)},!0);case"put":if(A.fire===g&&q.fire===g)break;return h._promise("readwrite",function(){return j(p)},!0);case"delete":if(k.fire===g)break;return h._promise("readwrite",function(){return j(p)},!0);case"deleteRange":if(k.fire===g)break;return h._promise("readwrite",function(){return function P(M,B,F){return u.query({trans:M,values:!1,query:{index:d,range:B},limit:F}).then(function(K){var N=K.result;return j({type:"delete",keys:N,trans:M}).then(function(J){return 0<J.numFailures?Promise.reject(J.failures[0]):N.length<F?{failures:[],numFailures:0,lastResult:void 0}:P(M,s(s({},B),{lower:N[N.length-1],lowerOpen:!0}),F)})})}(p.trans,p.range,1e4)},!0)}return u.mutate(p);function j(P){var M,B,F,K=De.trans,N=P.keys||Qi(d,P);if(N)return(P=P.type==="add"||P.type==="put"?s(s({},P),{keys:N}):s({},P)).type!=="delete"&&(P.values=o([],P.values)),P.keys&&(P.keys=o([],P.keys)),M=u,F=N,((B=P).type==="add"?Promise.resolve([]):M.getMany({trans:B.trans,keys:F,cache:"immutable"})).then(function(J){var H=N.map(function(oe,pe){var he,_e,ye,Ae=J[pe],be={onerror:null,onsuccess:null};return P.type==="delete"?k.fire.call(be,oe,Ae,K):P.type==="add"||Ae===void 0?(he=A.fire.call(be,oe,P.values[pe],K),oe==null&&he!=null&&(P.keys[pe]=oe=he,d.outbound||X(P.values[pe],d.keyPath,oe))):(he=Xi(Ae,P.values[pe]),(_e=q.fire.call(be,he,oe,Ae,K))&&(ye=P.values[pe],Object.keys(_e).forEach(function(Oe){_(ye,Oe)?ye[Oe]=_e[Oe]:X(ye,Oe,_e[Oe])}))),be});return u.mutate(P).then(function(oe){for(var pe=oe.failures,he=oe.results,_e=oe.numFailures,oe=oe.lastResult,ye=0;ye<N.length;++ye){var Ae=(he||N)[ye],be=H[ye];Ae==null?be.onerror&&be.onerror(pe[ye]):be.onsuccess&&be.onsuccess(P.type==="put"&&J[ye]?P.values[ye]:Ae)}return{failures:pe,results:he,numFailures:_e,lastResult:oe}}).catch(function(oe){return H.forEach(function(pe){return pe.onerror&&pe.onerror(oe)}),Promise.reject(oe)})});throw new Error("Keys missing")}}})}})}};function Bl(r,i,u){try{if(!i||i.keys.length<r.length)return null;for(var d=[],p=0,h=0;p<i.keys.length&&h<r.length;++p)rt(i.keys[p],r[h])===0&&(d.push(u?ke(i.values[p]):i.values[p]),++h);return d.length===r.length?d:null}catch{return null}}var Qd={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var u=r.table(i);return s(s({},u),{getMany:function(d){var p;return d.cache?(p=Bl(d.keys,d.trans._cache,d.cache==="clone"))?Se.resolve(p):u.getMany(d).then(function(h){return d.trans._cache={keys:d.keys,values:d.cache==="clone"?ke(h):h},h}):u.getMany(d)},mutate:function(d){return d.type!=="add"&&(d.trans._cache=null),u.mutate(d)}})}}}};function Ul(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function ql(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Zd={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,u=new Ft(r.MIN_KEY,r.MAX_KEY);return s(s({},r),{transaction:function(d,p,h){if(De.subscr&&p!=="readonly")throw new Ie.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(De.querier));return r.transaction(d,p,h)},table:function(d){function p(N){var K,N=N.query;return[K=N.index,new Ft((K=(N=N.range).lower)!=null?K:r.MIN_KEY,(K=N.upper)!=null?K:r.MAX_KEY)]}var h=r.table(d),w=h.schema,k=w.primaryKey,A=w.indexes,q=k.extractKey,j=k.outbound,P=k.autoIncrement&&A.filter(function(F){return F.compound&&F.keyPath.includes(k.keyPath)}),M=s(s({},h),{mutate:function(F){function K(ve){return ve="idb://".concat(i,"/").concat(d,"/").concat(ve),pe[ve]||(pe[ve]=new Ft)}var N,J,H,oe=F.trans,pe=F.mutatedParts||(F.mutatedParts={}),he=K(""),_e=K(":dels"),ye=F.type,be=F.type==="deleteRange"?[F.range]:F.type==="delete"?[F.keys]:F.values.length<50?[Qi(k,F).filter(function(ve){return ve}),F.values]:[],Ae=be[0],be=be[1],Oe=F.trans._cache;return f(Ae)?(he.addKeys(Ae),(ye=ye==="delete"||Ae.length===be.length?Bl(Ae,Oe):null)||_e.addKeys(Ae),(ye||be)&&(N=K,J=ye,H=be,w.indexes.forEach(function(ve){var Be=N(ve.name||"");function Ue(nt){return nt!=null?ve.extractKey(nt):null}function ze(nt){ve.multiEntry&&f(nt)?nt.forEach(function(rn){return Be.addKey(rn)}):Be.addKey(nt)}(J||H).forEach(function(nt,Nt){var He=J&&Ue(J[Nt]),Nt=H&&Ue(H[Nt]);rt(He,Nt)!==0&&(He!=null&&ze(He),Nt!=null)&&ze(Nt)})}))):Ae?(be={from:(Oe=Ae.lower)!=null?Oe:r.MIN_KEY,to:(ye=Ae.upper)!=null?ye:r.MAX_KEY},_e.add(be),he.add(be)):(he.add(u),_e.add(u),w.indexes.forEach(function(ve){return K(ve.name).add(u)})),h.mutate(F).then(function(ve){return!Ae||F.type!=="add"&&F.type!=="put"||(he.addKeys(ve.results),P&&P.forEach(function(Be){for(var Ue=F.values.map(function(He){return Be.extractKey(He)}),ze=Be.keyPath.findIndex(function(He){return He===k.keyPath}),nt=0,rn=ve.results.length;nt<rn;++nt)Ue[nt][ze]=ve.results[nt];K(Be.name).addKeys(Ue)})),oe.mutatedParts=mo(oe.mutatedParts||{},pe),ve})}}),B={get:function(F){return[k,new Ft(F.key)]},getMany:function(F){return[k,new Ft().addKeys(F.keys)]},count:p,query:p,openCursor:p};return c(B).forEach(function(F){M[F]=function(K){var N=De.subscr,J=!!N,H=Ul(De,h)&&ql(F,K)?K.obsSet={}:N;if(J){var oe,N=function(be){return be="idb://".concat(i,"/").concat(d,"/").concat(be),H[be]||(H[be]=new Ft)},pe=N(""),he=N(":dels"),J=B[F](K),_e=J[0],J=J[1];if((F==="query"&&_e.isPrimaryKey&&!K.values?he:N(_e.name||"")).add(J),!_e.isPrimaryKey){if(F!=="count")return oe=F==="query"&&j&&K.values&&h.query(s(s({},K),{values:!1})),h[F].apply(this,arguments).then(function(be){if(F==="query"){if(j&&K.values)return oe.then(function(Ue){return Ue=Ue.result,pe.addKeys(Ue),be});var Oe=K.values?be.result.map(q):be.result;(K.values?pe:he).addKeys(Oe)}else{var ve,Be;if(F==="openCursor")return Be=K.values,(ve=be)&&Object.create(ve,{key:{get:function(){return he.addKey(ve.primaryKey),ve.key}},primaryKey:{get:function(){var Ue=ve.primaryKey;return he.addKey(Ue),Ue}},value:{get:function(){return Be&&pe.addKey(ve.primaryKey),ve.value}}})}return be});he.add(u)}}return h[F].apply(this,arguments)}}),M}})}};function Hl(r,i,u){var d;return u.numFailures===0?i:i.type==="deleteRange"||(d=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1,u.numFailures===d)?null:(d=s({},i),f(d.keys)&&(d.keys=d.keys.filter(function(p,h){return!(h in u.failures)})),"values"in d&&f(d.values)&&(d.values=d.values.filter(function(p,h){return!(h in u.failures)})),d)}function Zi(r,i){return u=r,((d=i).lower===void 0||(d.lowerOpen?0<rt(u,d.lower):0<=rt(u,d.lower)))&&(u=r,(d=i).upper===void 0||(d.upperOpen?rt(u,d.upper)<0:rt(u,d.upper)<=0));var u,d}function Wl(r,i,u,d,p,h){var w,k,A,q,j,P,M;return!u||u.length===0||(w=i.query.index,k=w.multiEntry,A=i.query.range,q=d.schema.primaryKey.extractKey,j=w.extractKey,P=(w.lowLevelIndex||w).extractKey,(d=u.reduce(function(B,F){var K=B,N=[];if(F.type==="add"||F.type==="put")for(var J=new Ft,H=F.values.length-1;0<=H;--H){var oe,pe=F.values[H],he=q(pe);!J.hasKey(he)&&(oe=j(pe),k&&f(oe)?oe.some(function(Oe){return Zi(Oe,A)}):Zi(oe,A))&&(J.addKey(he),N.push(pe))}switch(F.type){case"add":var _e=new Ft().addKeys(i.values?B.map(function(ve){return q(ve)}):B),K=B.concat(i.values?N.filter(function(ve){return ve=q(ve),!_e.hasKey(ve)&&(_e.addKey(ve),!0)}):N.map(function(ve){return q(ve)}).filter(function(ve){return!_e.hasKey(ve)&&(_e.addKey(ve),!0)}));break;case"put":var ye=new Ft().addKeys(F.values.map(function(ve){return q(ve)}));K=B.filter(function(ve){return!ye.hasKey(i.values?q(ve):ve)}).concat(i.values?N:N.map(function(ve){return q(ve)}));break;case"delete":var Ae=new Ft().addKeys(F.keys);K=B.filter(function(ve){return!Ae.hasKey(i.values?q(ve):ve)});break;case"deleteRange":var be=F.range;K=B.filter(function(ve){return!Zi(q(ve),be)})}return K},r))===r)?r:(M=function(B,F){return rt(P(B),P(F))||rt(q(B),q(F))},d.sort(i.direction==="prev"||i.direction==="prevunique"?function(B,F){return M(F,B)}:M),i.limit&&i.limit<1/0&&(d.length>i.limit?d.length=i.limit:r.length===i.limit&&d.length<i.limit&&(p.dirty=!0)),h?Object.freeze(d):d)}function zl(r,i){return rt(r.lower,i.lower)===0&&rt(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function ef(r,i){return((u,d,p,h)=>{if(u===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((u=rt(u,d))===0){if(p&&h)return 0;if(p)return 1;if(h)return-1}return u})(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=((u,d,p,h)=>{if(u===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((u=rt(u,d))===0){if(p&&h)return 0;if(p)return-1;if(h)return 1}return u})(r.upper,i.upper,r.upperOpen,i.upperOpen)}function tf(r,i,u,d){r.subscribers.add(u),d.addEventListener("abort",function(){var p,h;r.subscribers.delete(u),r.subscribers.size===0&&(p=r,h=i,setTimeout(function(){p.subscribers.size===0&&Ke(h,p)},3e3))})}var nf={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return s(s({},r),{transaction:function(u,d,p){var h,w,k=r.transaction(u,d,p);return d==="readwrite"&&(p=(h=new AbortController).signal,k.addEventListener("abort",(w=function(A){return function(){if(h.abort(),d==="readwrite"){for(var q=new Set,j=0,P=u;j<P.length;j++){var M=P[j],B=wr["idb://".concat(i,"/").concat(M)];if(B){var F=r.table(M),K=B.optimisticOps.filter(function(ve){return ve.trans===k});if(k._explicit&&A&&k.mutatedParts)for(var N=0,J=Object.values(B.queries.query);N<J.length;N++)for(var H=0,oe=(_e=J[N]).slice();H<oe.length;H++)Wi((ye=oe[H]).obsSet,k.mutatedParts)&&(Ke(_e,ye),ye.subscribers.forEach(function(ve){return q.add(ve)}));else if(0<K.length){B.optimisticOps=B.optimisticOps.filter(function(ve){return ve.trans!==k});for(var pe=0,he=Object.values(B.queries.query);pe<he.length;pe++)for(var _e,ye,Ae,be=0,Oe=(_e=he[pe]).slice();be<Oe.length;be++)(ye=Oe[be]).res!=null&&k.mutatedParts&&(A&&!ye.dirty?(Ae=Object.isFrozen(ye.res),Ae=Wl(ye.res,ye.req,K,F,ye,Ae),ye.dirty?(Ke(_e,ye),ye.subscribers.forEach(function(ve){return q.add(ve)})):Ae!==ye.res&&(ye.res=Ae,ye.promise=Se.resolve({result:Ae}))):(ye.dirty&&Ke(_e,ye),ye.subscribers.forEach(function(ve){return q.add(ve)})))}}}q.forEach(function(ve){return ve()})}}})(!1),{signal:p}),k.addEventListener("error",w(!1),{signal:p}),k.addEventListener("complete",w(!0),{signal:p})),k},table:function(u){var d=r.table(u),p=d.schema.primaryKey;return s(s({},d),{mutate:function(h){var w,k=De.trans;return!p.outbound&&k.db._options.cache!=="disabled"&&!k.explicit&&k.idbtrans.mode==="readwrite"&&(w=wr["idb://".concat(i,"/").concat(u)])?(k=d.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||Qi(p,h).some(function(A){return A==null}))?(w.optimisticOps.push(h),h.mutatedParts&&yo(h.mutatedParts),k.then(function(A){0<A.numFailures&&(Ke(w.optimisticOps,h),(A=Hl(0,h,A))&&w.optimisticOps.push(A),h.mutatedParts)&&yo(h.mutatedParts)}),k.catch(function(){Ke(w.optimisticOps,h),h.mutatedParts&&yo(h.mutatedParts)})):k.then(function(A){var q=Hl(0,s(s({},h),{values:h.values.map(function(j,P){var M;return A.failures[P]?j:(X(M=(M=p.keyPath)!=null&&M.includes(".")?ke(j):s({},j),p.keyPath,A.results[P]),M)})}),A);w.optimisticOps.push(q),queueMicrotask(function(){return h.mutatedParts&&yo(h.mutatedParts)})}),k):d.mutate(h)},query:function(h){var w,k,A,q,j,P,M;return Ul(De,d)&&ql("query",h)?(w=((A=De.trans)==null?void 0:A.db._options.cache)==="immutable",k=(A=De).requery,A=A.signal,P=((B,F,K,N)=>{var J=wr["idb://".concat(B,"/").concat(F)];if(!J)return[];if(!(B=J.queries[K]))return[null,!1,J,null];var H=B[(N.query?N.query.index.name:null)||""];if(!H)return[null,!1,J,null];switch(K){case"query":var oe=(pe=N.direction)!=null?pe:"next",pe=H.find(function(he){var _e;return he.req.limit===N.limit&&he.req.values===N.values&&((_e=he.req.direction)!=null?_e:"next")===oe&&zl(he.req.query.range,N.query.range)});return pe?[pe,!0,J,H]:[H.find(function(he){var _e;return("limit"in he.req?he.req.limit:1/0)>=N.limit&&((_e=he.req.direction)!=null?_e:"next")===oe&&(!N.values||he.req.values)&&ef(he.req.query.range,N.query.range)}),!1,J,H];case"count":return pe=H.find(function(he){return zl(he.req.query.range,N.query.range)}),[pe,!!pe,J,H]}})(i,u,"query",h),M=P[0],q=P[2],j=P[3],M&&P[1]?M.obsSet=h.obsSet:(P=d.query(h).then(function(B){var F=B.result;if(M&&(M.res=F),w){for(var K=0,N=F.length;K<N;++K)Object.freeze(F[K]);Object.freeze(F)}return B}).catch(function(B){return j&&M&&Ke(j,M),Promise.reject(B)}),M={obsSet:h.obsSet,promise:P,subscribers:new Set,type:"query",req:h,dirty:!1},j?j.push(M):(j=[M],(q=q||(wr["idb://".concat(i,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=j)),tf(M,j,k,A),M.promise.then(function(B){return B=Wl(B.result,h,q==null?void 0:q.optimisticOps,d,M,w),{result:w?B:ke(B)}})):d.query(h)}})}})}};function bo(r,i){return new Proxy(r,{get:function(u,d,p){return d==="db"?i:Reflect.get(u,d,p)}})}St.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Ie.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Ie.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,u=i.filter(function(d){return d._cfg.version===r})[0];return u||(u=new this.Version(r),i.push(u),i.sort(Hd),u.stores({}),this._state.autoSchema=!1),u},St.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||De.letThrough||this._vip)?r():new Se(function(u,d){if(i._state.openComplete)return d(new Ie.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void d(new Ie.DatabaseClosed);i.open().catch(g)}i._state.dbReadyPromise.then(u,d)}).then(r)},St.prototype.use=function(p){var i=p.stack,u=p.create,d=p.level,p=p.name,h=(p&&this.unuse({stack:i,name:p}),this._middlewares[i]||(this._middlewares[i]=[]));return h.push({stack:i,create:u,level:d??10,name:p}),h.sort(function(w,k){return w.level-k.level}),this},St.prototype.unuse=function(r){var i=r.stack,u=r.name,d=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(p){return d?p.create!==d:!!u&&p.name!==u})),this},St.prototype.open=function(){var r=this;return yr(Tt,function(){return Yd(r)})},St.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var r=this._state;if(ps.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new Se(function(i){r.dbReadyResolve=i}),r.openCanceller=new Se(function(i,u){r.cancelOpen=u}))},St.prototype.close=function(i){var i=(i===void 0?{disableAutoOpen:!0}:i).disableAutoOpen,u=this._state;i?(u.isBeingOpened&&u.cancelOpen(new Ie.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new Ie.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},St.prototype.delete=function(r){var i=this,u=(r===void 0&&(r={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),d=this._state;return new Se(function(p,h){function w(){i.close(r);var k=i._deps.indexedDB.deleteDatabase(i.name);k.onsuccess=yt(function(){var A,q,j;A=i._deps,q=i.name,Ui(j=A.indexedDB)||q===no||Bi(j,A.IDBKeyRange).delete(q).catch(g),p()}),k.onerror=vn(h),k.onblocked=i._fireOnBlocked}if(u)throw new Ie.InvalidArgument("Invalid closeOptions argument to db.delete()");d.isBeingOpened?d.dbReadyPromise.then(w):w()})},St.prototype.backendDB=function(){return this.idbdb},St.prototype.isOpen=function(){return this.idbdb!==null},St.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},St.prototype.hasFailed=function(){return this._state.dbOpenError!==null},St.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(St.prototype,"tables",{get:function(){var r=this;return c(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),St.prototype.transaction=function(){var r=(function(i,u,d){var p=arguments.length;if(p<2)throw new Ie.InvalidArgument("Too few arguments");for(var h=new Array(p-1);--p;)h[p-1]=arguments[p];return d=h.pop(),[i,V(h),d]}).apply(this,arguments);return this._transaction.apply(this,r)},St.prototype._transaction=function(r,i,u){var d,p,h=this,w=De.trans,k=(w&&w.db===this&&r.indexOf("!")===-1||(w=null),r.indexOf("?")!==-1);r=r.replace("!","").replace("?","");try{if(p=i.map(function(q){if(q=q instanceof h.Table?q.name:q,typeof q!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return q}),r=="r"||r===Oi)d=Oi;else{if(r!="rw"&&r!=Mi)throw new Ie.InvalidArgument("Invalid transaction mode: "+r);d=Mi}if(w){if(w.mode===Oi&&d===Mi){if(!k)throw new Ie.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");w=null}w&&p.forEach(function(q){if(w&&w.storeNames.indexOf(q)===-1){if(!k)throw new Ie.SubTransaction("Table "+q+" not included in parent transaction.");w=null}}),k&&w&&!w.active&&(w=null)}}catch(q){return w?w._promise(null,function(j,P){P(q)}):Ct(q)}var A=(function q(j,P,M,B,F){return Se.resolve().then(function(){var H=De.transless||De,K=j._createTransaction(P,M,j._dbSchema,B),H=(K.explicit=!0,{trans:K,transless:H});if(B)K.idbtrans=B.idbtrans;else try{K.create(),K.idbtrans._explicit=!0,j._state.PR1398_maxLoop=3}catch(oe){return oe.name===Kt.InvalidState&&j.isOpen()&&0<--j._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),j.close({disableAutoOpen:!1}),j.open().then(function(){return q(j,P,M,null,F)})):Ct(oe)}var N,J=Qe(F),H=(J&&Nr(),Se.follow(function(){var oe;(N=F.call(K,K))&&(J?(oe=Gn.bind(null,null),N.then(oe,oe)):typeof N.next=="function"&&typeof N.throw=="function"&&(N=Ji(N)))},H));return(N&&typeof N.then=="function"?Se.resolve(N).then(function(oe){return K.active?oe:Ct(new Ie.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):H.then(function(){return N})).then(function(oe){return B&&K._resolve(),K._completion.then(function(){return oe})}).catch(function(oe){return K._reject(oe),Ct(oe)})})}).bind(null,this,d,p,w,u);return w?w._promise(d,A,"lock"):De.trans?yr(De.transless,function(){return h._whenReady(A)}):this._whenReady(A)},St.prototype.table=function(r){if(_(this._allTables,r))return this._allTables[r];throw new Ie.InvalidTable("Table ".concat(r," does not exist"))};var jn=St;function St(r,i){var u,d,p,h,w,k=this,A=(this._middlewares={},this.verno=0,St.dependencies),A=(this._options=i=s({addons:St.addons,autoOpen:!0,indexedDB:A.indexedDB,IDBKeyRange:A.IDBKeyRange,cache:"cloned",maxConnections:1e3},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},i.addons),q=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:g,dbReadyPromise:null,cancelOpen:g,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen}),j=(q.dbReadyPromise=new Se(function(P){q.dbReadyResolve=P}),q.openCanceller=new Se(function(P,M){q.cancelOpen=M}),this._state=q,this.name=r,this.on=ls(this,"populate","blocked","versionchange","close",{ready:[z,g]}),this.once=function(P,M){var B=function(){for(var F=[],K=0;K<arguments.length;K++)F[K]=arguments[K];k.on(P).unsubscribe(B),M.apply(k,F)};return k.on(P,B)},this.on.ready.subscribe=I(this.on.ready.subscribe,function(P){return function(M,B){St.vip(function(){var F,K=k._state;K.openComplete?(K.dbOpenError||Se.resolve().then(M),B&&P(M)):K.onReadyBeingFired?(K.onReadyBeingFired.push(M),B&&P(M)):(P(M),F=k,B||P(function N(){F.on.ready.unsubscribe(M),F.on.ready.unsubscribe(N)}))})}}),this.Collection=(u=this,us(Kd.prototype,function(N,K){this.db=u;var B=kl,F=null;if(K)try{B=K()}catch(H){F=H}var K=N._ctx,N=K.table,J=N.hook.reading.fire;this._ctx={table:N,index:K.index,isPrimKey:!K.index||N.schema.primKey.keyPath&&K.index===N.schema.primKey.name,range:B,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:F,or:K.or,valueMapper:J!==C?J:null}})),this.Table=(d=this,us(Tl.prototype,function(P,M,B){this.db=d,this._tx=B,this.name=P,this.schema=M,this.hook=d._allTables[P]?d._allTables[P].hook:ls(null,{creating:[le,g],reading:[Y,C],updating:[me,g],deleting:[ge,g]})})),this.Transaction=(p=this,us(Vd.prototype,function(P,M,B,F,K){var N=this;P!=="readonly"&&M.forEach(function(J){J=(J=B[J])==null?void 0:J.yProps,J&&(M=M.concat(J.map(function(H){return H.updatesTable})))}),this.db=p,this.mode=P,this.storeNames=M,this.schema=B,this.chromeTransactionDurability=F,this.idbtrans=null,this.on=ls(this,"complete","error","abort"),this.parent=K||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new Se(function(J,H){N._resolve=J,N._reject=H}),this._completion.then(function(){N.active=!1,N.on.complete.fire()},function(J){var H=N.active;return N.active=!1,N.on.error.fire(J),N.parent?N.parent._reject(J):H&&N.idbtrans&&N.idbtrans.abort(),Ct(J)})})),this.Version=(h=this,us(Gd.prototype,function(P){this.db=h,this._cfg={version:P,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(w=this,us(Il.prototype,function(P,M,B){if(this.db=w,this._ctx={table:P,index:M===":id"?null:M,or:B},this._cmp=this._ascending=rt,this._descending=function(F,K){return rt(K,F)},this._max=function(F,K){return 0<rt(F,K)?F:K},this._min=function(F,K){return rt(F,K)<0?F:K},this._IDBKeyRange=w._deps.IDBKeyRange,!this._IDBKeyRange)throw new Ie.MissingAPI})),this.on("versionchange",function(P){0<P.newVersion?console.warn("Another connection wants to upgrade database '".concat(k.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(k.name,"'. Closing db now to resume the delete request.")),k.close({disableAutoOpen:!1})}),this.on("blocked",function(P){!P.newVersion||P.newVersion<P.oldVersion?console.warn("Dexie.delete('".concat(k.name,"') was blocked")):console.warn("Upgrade '".concat(k.name,"' blocked by other connection holding version ").concat(P.oldVersion/10))}),this._maxKey=ds(i.IDBKeyRange),this._createTransaction=function(P,M,B,F){return new k.Transaction(P,M,B,k._options.chromeTransactionDurability,F)},this._fireOnBlocked=function(P){k.on("blocked").fire(P),ps.toArray().filter(function(M){return M.name===k.name&&M!==k&&!M._state.vcFired}).map(function(M){return M.on("versionchange").fire(P)})},this.use(Qd),this.use(nf),this.use(Zd),this.use(Jd),this.use(Xd),new Proxy(this,{get:function(P,M,B){var F;return M==="_vip"||(M==="table"?function(K){return bo(k.table(K),j)}:(F=Reflect.get(P,M,B))instanceof Tl?bo(F,j):M==="tables"?F.map(function(K){return bo(K,j)}):M==="_createTransaction"?function(){return bo(F.apply(this,arguments),j)}:F)}}));this.vip=j,A.forEach(function(P){return P(k)})}var wo,qr=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",rf=(ea.prototype.subscribe=function(r,i,u){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:u})},ea.prototype[qr]=function(){return this},ea);function ea(r){this._subscribe=r}try{wo={indexedDB:a.indexedDB||a.mozIndexedDB||a.webkitIndexedDB||a.msIndexedDB,IDBKeyRange:a.IDBKeyRange||a.webkitIDBKeyRange}}catch{wo={indexedDB:null,IDBKeyRange:null}}function Gl(r){var i,u=!1,d=new rf(function(p){var h=Qe(r),w,k=!1,A={},q={},j={get closed(){return k},unsubscribe:function(){k||(k=!0,w&&w.abort(),P&&Xn.storagemutated.unsubscribe(F))}},P=(p.start&&p.start(j),!1),M=function(){return Ai(K)};function B(){return Wi(q,A)}var F=function(N){mo(A,N),B()&&M()},K=function(){var N,J,H;!k&&wo.indexedDB&&(A={},N={},w&&w.abort(),w=new AbortController,H=(oe=>{var pe=Kr();try{h&&Nr();var he=zn(r,oe);return he=h?he.finally(Gn):he}finally{pe&&Fr()}})(J={subscr:N,signal:w.signal,requery:M,querier:r,trans:null}),P||(Xn.storagemutated.subscribe(F),P=!0),Promise.resolve(H).then(function(oe){u=!0,i=oe,k||J.signal.aborted||(B()||(q=N,B())?M():(A={},Ai(function(){return!k&&p.next&&p.next(oe)})))},function(oe){u=!1,["DatabaseClosedError","AbortError"].includes(oe==null?void 0:oe.name)||k||Ai(function(){k||p.error&&p.error(oe)})}))};return setTimeout(M,0),j});return d.hasValue=function(){return u},d.getValue=function(){return i},d}var _r=jn;function ta(r){var i=Qn;try{Qn=!0,Xn.storagemutated.fire(r),Yi(r,!0)}finally{Qn=i}}S(_r,s(s({},Ce),{delete:function(r){return new _r(r,{addons:[]}).delete()},exists:function(r){return new _r(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=_r.dependencies,u=i.indexedDB,i=i.IDBKeyRange,(Ui(u)?Promise.resolve(u.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==no})}):Bi(u,i).toCollection().primaryKeys()).then(r)}catch{return Ct(new Ie.MissingAPI)}var i,u},defineClass:function(){return function(r){v(this,r)}},ignoreTransaction:function(r){return De.trans?yr(De.transless||Tt,r):r()},vip:qi,async:function(r){return function(){try{var i=Ji(r.apply(this,arguments));return i&&typeof i.then=="function"?i:Se.resolve(i)}catch(u){return Ct(u)}}},spawn:function(r,i,u){try{var d=Ji(r.apply(u,i||[]));return d&&typeof d.then=="function"?d:Se.resolve(d)}catch(p){return Ct(p)}},currentTransaction:{get:function(){return De.trans||null}},waitFor:function(r,i){return r=Se.resolve(typeof r=="function"?_r.ignoreTransaction(r):r).timeout(i||6e4),De.trans?De.trans.waitFor(r):r},Promise:Se,debug:{get:function(){return G},set:function(r){Q(r)}},derive:re,extend:v,props:S,override:I,Events:ls,on:Xn,liveQuery:Gl,extendObservabilitySet:mo,getByKeyPath:ae,setByKeyPath:X,delByKeyPath:function(r,i){typeof i=="string"?X(r,i,void 0):"length"in i&&[].map.call(i,function(u){X(r,u,void 0)})},shallowClone:O,deepClone:ke,getObjectDiff:Xi,cmp:rt,asap:de,minKey:-1/0,addons:[],connections:{get:ps.toArray},errnames:Kt,dependencies:wo,cache:wr,semVer:"4.4.6",version:"4.4.6".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,u){return r+i/Math.pow(10,2*u)})})),_r.maxKey=ds(_r.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Xn(lo,function(r){Qn||(r=new CustomEvent(Di,{detail:r}),Qn=!0,dispatchEvent(r),Qn=!1)}),addEventListener(Di,function(r){r=r.detail,Qn||ta(r)}));var Hr,Qn=!1,Yl=function(){};return typeof BroadcastChannel<"u"&&((Yl=function(){(Hr=new BroadcastChannel(Di)).onmessage=function(r){return r.data&&ta(r.data)}})(),typeof Hr.unref=="function"&&Hr.unref(),Xn(lo,function(r){Qn||Hr.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!jn.disableBfCache&&r.persisted){G&&console.debug("Dexie: handling persisted pagehide"),Hr!=null&&Hr.close();for(var i=0,u=ps.toArray();i<u.length;i++)u[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!jn.disableBfCache&&r.persisted&&(G&&console.debug("Dexie: handling persisted pageshow"),Yl(),ta({all:new Ft(-1/0,[[]])}))})),Se.rejectionMapper=function(r,i){return!r||r instanceof te||r instanceof TypeError||r instanceof SyntaxError||!r.name||!b[r.name]?r:(i=new b[r.name](i||r.message,r),"stack"in r&&U(i,"stack",{get:function(){return this.inner.stack}}),i)},Q(G),s(jn,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:jn,Entity:xl,PropModification:as,RangeSet:Ft,add:function(r){return new as({add:r})},cmp:rt,default:jn,liveQuery:Gl,mergeRanges:hs,rangesOverlap:Kl,remove:function(r){return new as({remove:r})},replacePrefix:function(r,i){return new as({replacePrefix:[r,i]})}}),{default:jn}),jn})})(ad);var Qv=ad.exports;const ja=Xv(Qv),Ru=Symbol.for("Dexie"),Xo=globalThis[Ru]||(globalThis[Ru]=ja);if(ja.semVer!==Xo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${ja.semVer} and ${Xo.semVer}`);const{liveQuery:Zv,mergeRanges:ex,rangesOverlap:tx,RangeSet:nx,cmp:rx,Entity:sx,PropModification:ox,replacePrefix:ix,add:ax,remove:lx,DexieYProvider:ux}=Xo;class eh extends Xo{constructor(t="intern_worklog"){super(t),this.version(1).stores({project:"++id, &name, archived",work_log:"++id, &date",log_item:"++id, work_log_id, project_id, category",attendance:"++id, &date",weekly_note:"++id, &week_start",setting:"key"}),this.version(2).stores({memo:"++id, updated_at",credential:"++id, system, updated_at"}),this.version(3).stores({transaction:"++id, date, type, category"}),this.version(4).stores({sync_mirror:"++id, table, uuid",tombstone:"++id, table, uuid, deleted_at"})}}let fe;function th(e){fe=e}function ul(){fe&&fe.close(),fe=void 0}const nh=4,Gr=["餐饮","交通","住房","通讯","学习","娱乐","其他"],Qo=["工资","报销","其他"],Ku=["公司","客户现场","出差","居家办公"],zs=[{key:"dev",label:"开发"},{key:"bugfix",label:"BUG修复"},{key:"test",label:"测试"},{key:"learning",label:"学习成长"},{key:"meeting",label:"会议沟通"},{key:"doc",label:"文档输出"},{key:"other",label:"其他"}];function Zo(e){const t=zs.find(n=>n.key===e);return t?t.label:"其他"}const rh={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},sh={class:"dialog-head"},oh={key:0,class:"muted dialog-sub"},ih={class:"dialog-body"},ah={class:"form-grid"},lh={class:"field span2"},uh={key:0,class:"form-error"},ch={class:"field"},dh=["value"],fh={class:"field"},ph=["value"],vh={class:"field"},hh={class:"field"},mh={class:"field span2"},yh={class:"field"},gh={class:"field"},bh={class:"dialog-btns"},wh=Rt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=L(""),a=L(null),c=L("dev"),f=L(null),v=L(""),y=L(""),m=L(0),_=L(0),S=L(""),$=L(null),U=st(()=>{var I;const ie=n.projects.filter(Z=>Z.archived!==1),T=(I=n.item)==null?void 0:I.project_id;if(T&&!ie.some(Z=>Z.id===T)){const Z=n.projects.find(ae=>ae.id===T),de=ie.slice();return Z&&de.unshift({...Z,name:Z.name+"(已归档)"}),de}return ie});function re(ie){n.open&&ie.key==="Escape"&&s("cancel")}ht(()=>n.open,async ie=>{var T;if(ie){const I=n.item;o.value=(I==null?void 0:I.content)??"",a.value=(I==null?void 0:I.project_id)??null,c.value=(I==null?void 0:I.category)??"dev",f.value=(I==null?void 0:I.minutes)??null,v.value=(I==null?void 0:I.takeaway)??"",y.value=(I==null?void 0:I.remark)??"",m.value=(I==null?void 0:I.is_milestone)??0,_.value=(I==null?void 0:I.needs_followup)??0,S.value="",window.addEventListener("keydown",re),await ss(),(T=$.value)==null||T.focus()}else window.removeEventListener("keydown",re)}),pr(()=>window.removeEventListener("keydown",re)),ht(o,()=>{S.value&&(S.value="")});function se(){const ie=o.value.trim();if(!ie){S.value="请填写工作内容";return}if(!n.item||!n.item.id){s("cancel");return}s("save",{id:n.item.id,content:ie,project_id:a.value,category:c.value,minutes:f.value&&f.value>0?f.value:null,takeaway:v.value.trim()||null,remark:y.value.trim()||null,is_milestone:m.value?1:0,needs_followup:_.value?1:0})}return(ie,T)=>(E(),Pt(Dr,{to:"body"},[Ee(os,{name:"modal"},{default:fr(()=>[e.open?(E(),D("div",{key:0,class:"mask",onClick:T[10]||(T[10]=sn(I=>s("cancel"),["self"]))},[l("div",rh,[l("div",sh,[l("div",null,[T[11]||(T[11]=l("div",{class:"dialog-title"},"编辑工作记录",-1)),e.date?(E(),D("div",oh,ne(e.date),1)):xe("",!0)]),l("button",{class:"icon-btn",title:"关闭",onClick:T[0]||(T[0]=I=>s("cancel"))},[Ee(Xe,{name:"close",size:16})])]),l("div",ih,[l("div",ah,[l("div",lh,[T[12]||(T[12]=l("label",null,"工作内容(必填)",-1)),$e(l("input",{ref_key:"contentInput",ref:$,class:et(["input",{invalid:S.value}]),"onUpdate:modelValue":T[1]||(T[1]=I=>o.value=I),onKeydown:At(se,["enter"])},null,34),[[Me,o.value]]),S.value?(E(),D("div",uh,ne(S.value),1)):xe("",!0)]),l("div",ch,[T[14]||(T[14]=l("label",null,"所属项目",-1)),$e(l("select",{class:"select","onUpdate:modelValue":T[2]||(T[2]=I=>a.value=I)},[T[13]||(T[13]=l("option",{value:null},"无项目",-1)),(E(!0),D(je,null,ot(U.value,I=>(E(),D("option",{key:I.id,value:I.id},ne(I.name),9,dh))),128))],512),[[Vn,a.value]])]),l("div",fh,[T[15]||(T[15]=l("label",null,"工作分类",-1)),$e(l("select",{class:"select","onUpdate:modelValue":T[3]||(T[3]=I=>c.value=I)},[(E(!0),D(je,null,ot(Ut(zs),I=>(E(),D("option",{key:I.key,value:I.key},ne(I.label),9,ph))),128))],512),[[Vn,c.value]])]),l("div",vh,[T[16]||(T[16]=l("label",null,"耗时(分钟)",-1)),$e(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":T[4]||(T[4]=I=>f.value=I),placeholder:"选填"},null,512),[[Me,f.value,void 0,{number:!0}]])]),l("div",hh,[T[17]||(T[17]=l("label",null,"主要收获",-1)),$e(l("input",{class:"input","onUpdate:modelValue":T[5]||(T[5]=I=>v.value=I),placeholder:"一句话:学到了什么"},null,512),[[Me,v.value]])]),l("div",mh,[T[18]||(T[18]=l("label",null,"备注",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":T[6]||(T[6]=I=>y.value=I),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Me,y.value]])]),l("div",yh,[T[19]||(T[19]=l("label",null,"成果标记",-1)),l("button",{class:et(["toggle-btn",{on:m.value===1}]),onClick:T[7]||(T[7]=I=>m.value=m.value===1?0:1)},ne(m.value===1?"已标记为成果":"未标记"),3)]),l("div",gh,[T[20]||(T[20]=l("label",null,"待跟进",-1)),l("button",{class:et(["toggle-btn",{onwarn:_.value===1}]),onClick:T[8]||(T[8]=I=>_.value=_.value===1?0:1)},ne(_.value===1?"需要跟进":"无需跟进"),3)])])]),l("div",bh,[l("button",{class:"btn btn-sm",onClick:T[9]||(T[9]=I=>s("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:se},"保存修改")])])])):xe("",!0)]),_:1})]))}}),_h=Wt(wh,[["__scopeId","data-v-63bc0b48"]]);function Ts(e){return e<10?"0"+e:String(e)}function Bn(e){return e.getFullYear()+"-"+Ts(e.getMonth()+1)+"-"+Ts(e.getDate())}function xt(){return Bn(new Date)}function wt(){const e=new Date;return Bn(e)+"T"+Ts(e.getHours())+":"+Ts(e.getMinutes())+":"+Ts(e.getSeconds())}function Un(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function is(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Nn(e,t){const n=is(e);return n.setDate(n.getDate()+t),Bn(n)}function ei(e,t){const n=is(e),s=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const o=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(s,o)),Bn(n)}function Ps(e){const t=is(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),Bn(t)}function kh(e){const t=is(e).getDay();return t===0||t===6}function xh(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function ld(e){const t=is(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const Ch=15e4;function Da(e){const t=new Uint8Array(e);let n="";for(let s=0;s<t.length;s++)n+=String.fromCharCode(t[s]);return btoa(n)}function La(e){const t=atob(e),n=new Uint8Array(t.length);for(let s=0;s<t.length;s++)n[s]=t.charCodeAt(s);return n}function Sh(){return Da(crypto.getRandomValues(new Uint8Array(16)).buffer)}async function ti(e,t){const n=new TextEncoder,s=await crypto.subtle.importKey("raw",n.encode(e),"PBKDF2",!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:La(t),iterations:Ch,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function ni(e,t){const n=crypto.getRandomValues(new Uint8Array(12)),s=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return Da(n.buffer)+":"+Da(s)}async function ki(e,t){const n=t.split(":");if(n.length!==2)throw new Error("密文格式错误");const s=await crypto.subtle.decrypt({name:"AES-GCM",iv:La(n[0])},e,La(n[1]));return new TextDecoder().decode(s)}async function cl(){await _d()}const ud="intern-log-vault-verify",ts="enc:v1:";let Lr=null;function Eh(){return Lr!==null}function ri(){Lr=null}async function cd(){return await gt("pwd_salt","")!==""}async function $h(e){if(e.length<6)throw new Error("主密码至少 6 位");if(await cd())throw new Error("主密码已设置");const t=Sh(),n=await ti(e,t),s=await ni(n,ud);await Lt("pwd_salt",t),await Lt("pwd_verifier",s),Lr=n}async function Th(e){const t=await gt("pwd_salt","");if(!t)throw new Error("主密码尚未设置");const n=await ti(e,t),s=await gt("pwd_verifier","");try{await ki(n,s)}catch{throw new Error("主密码不正确")}Lr=n}async function dd(){if(!Lr)throw new Error("密码库未解锁");return Lr}async function Ph(e){const t=await dd();return ts+await ni(t,e)}async function Ah(e){if(!e)return"";if(!e.startsWith(ts))return e;const t=await dd();return ki(t,e.slice(ts.length))}async function Oh(){return fe.credential.orderBy("system").toArray()}async function Mh(e,t){const n=await Ph(e.password),s={system:e.system.trim(),account:e.account.trim(),password:n,remark:e.remark.trim()};t?await fe.credential.update(t,{...s,updated_at:wt()}):await fe.credential.add({...s,created_at:wt(),updated_at:wt()}),await cl()}async function Ih(e){await fe.credential.delete(e),await cl()}async function ma(e){const t=await fe.credential.get(e);if(!t)throw new Error("记录不存在");return Ah(t.password)}async function jh(e,t){if(!e)throw new Error("请输入旧主密码");if(t.length<6)throw new Error("新主密码至少 6 位");if(t===e)throw new Error("新主密码不能与旧主密码相同");const n=await gt("pwd_salt","");if(!n)throw new Error("密码库尚未初始化");const s=await ti(e,n),o=await gt("pwd_verifier","");try{await ki(s,o)}catch{throw new Error("旧主密码不正确")}const a=await ti(t,n),c=await fe.credential.toArray();let f=0;for(const v of c){if(v.id==null)continue;const y=await Dh(v.password,s),m=ts+await ni(a,y);await fe.credential.update(v.id,{password:m}),f++}return await Lt("pwd_verifier",await ni(a,ud)),Lr=a,await cl(),f}async function Dh(e,t){return e?e.startsWith(ts)?ki(t,e.slice(ts.length)):e:""}const fd="https://daywk.linyux.cn",Ra="dsh_sync_base",Ka="dsh_sync_token";function pd(e){try{return localStorage.getItem(e)||""}catch{return""}}function vd(e,t){try{localStorage.setItem(e,t)}catch{}}function hd(e){try{localStorage.removeItem(e)}catch{}}async function vr(){return pd(Ra)||fd}async function Lh(e){const t=(e||"").trim().replace(/\/+$/,"");t&&t!==fd?vd(Ra,t):hd(Ra)}function xi(){const e=pd(Ka);if(!e)return"";try{return e}catch{return""}}function Ns(e){e?vd(Ka,e):hd(Ka)}const Rh="intern_worklog",dl="dsh_session_user";function Vs(){try{const e=localStorage.getItem(dl);if(!e)return null;const t=JSON.parse(e);if(t&&t.userId&&t.username)return t}catch{}return null}function Kh(e){localStorage.setItem(dl,JSON.stringify(e))}function md(){localStorage.removeItem(dl)}const fl="dsh_cloud_creds";function yd(e,t){localStorage.setItem(fl,JSON.stringify({username:e,password:t}))}function gn(){try{const e=localStorage.getItem(fl);if(!e)return null;const t=JSON.parse(e);if(t&&t.username&&t.password)return t}catch{}return null}function Fh(){localStorage.removeItem(fl)}let si=null;function oi(e){si===e&&fe||(fe&&ul(),th(new eh(Rh+"_"+e)),si=e)}async function Nh(e,t,n){const s=await vr();let o;try{o=await fetch(s+"/api/auth/"+e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.trim(),password:n})})}catch{throw new Error("无法连接同步服务器:请检查网络后重试")}const a=await o.json().catch(()=>({}));if(!o.ok){const c=a&&a.error||"服务返回 "+o.status;throw e==="register"&&o.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(c))}if(!a.userId||!a.username)throw new Error("登录响应异常");return{userId:String(a.userId),username:String(a.username)}}async function pl(e,t,n){const s=await Nh(n,e,t);oi(s.userId);const o={userId:s.userId,username:s.username};return Kh(o),yd(s.username,t),o}async function Vh(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return pl(n,t,"login")}async function Bh(e,t,n){const s=(e||"").trim();if(s.length<2||s.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return pl(s,t,"register")}async function Uh(){const e=gn();if(!e)return null;try{return await pl(e.username,e.password,"login")}catch{return null}}async function qh(){ri(),ul(),si=null,md()}function Hh(){ri(),ul(),si=null,md(),Fh()}async function Wh(e,t){if(!Vs())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const s=gn();if(!s||s.password!==e)throw new Error("旧密码不正确");const o=await vr();let a;try{a=await fetch(o+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+gd()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!a.ok){const c=await a.json().catch(()=>({}));throw new Error(c&&c.error||"修改失败 "+a.status)}yd(s.username,t)}async function zh(){if(!Vs())throw new Error("未登录");const t=await vr();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+gd()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s&&s.error||"删除失败 "+n.status)}Hh()}function gd(){return xi()}const Fa=L(null),Na=L(null),Gs=L(0);function rr(){Gs.value++}const Xr=L(""),Bs=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","transaction"],Yr=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]),Gh=vr;function Io(e){return JSON.stringify(e)}async function Yh(e){return fe.table(e).toArray()}function jo(e,t){return e==="setting"?t.key:t.id}async function Jh(){for(const e of Bs){const t=fe.table(e),n=await t.toArray();for(const s of n){if(e==="setting"&&Yr.has(s.key))continue;const o={};s.uuid||(o.uuid=Xh()),!s.updated_at&&s.created_at&&(o.updated_at=s.created_at),Object.keys(o).length&&await t.update(jo(e,s),o)}}}function Xh(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Qh(){return gn()!=null}async function Zh(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function em(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function bd(e,t){const n=await fetch(e+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t.username.trim(),password:t.password})});if(!n.ok)throw new Error("云端账号或密码不正确");const s=await n.json();if(!s||!s.token)throw new Error("云端登录异常");return String(s.token)}async function tm(e,t){let n=xi();return n||(n=await bd(e,t),Ns(n),n)}async function wd(){const e=gn();if(!e)throw new Error("未登录");const t=await vr(),n=await fetch(t+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e.username,password:e.password})});if(!n.ok)throw new Error("云端账号校验失败:"+n.status)}async function Va(){const e=gn();if(!e)throw new Error("未登录,无法同步");return Cd({baseUrl:await vr(),username:e.username,password:e.password})}async function _d(){try{await Va()}catch(e){Xr.value=e instanceof Error?e.message:String(e);try{await Va()}catch{}throw e}}function kd(e,t,n){const s={};for(const o of Object.keys(t))o!=="id"&&(s[o]=t[o]);if(e==="log_item"){delete s.work_log_id,delete s.project_id;const o=t.work_log_id?n.workLog.get(t.work_log_id):null;o&&o.uuid&&(s.wuuid=o.uuid);const a=t.project_id?n.project.get(t.project_id):null;a&&a.uuid&&(s.puuid=a.uuid)}return s}async function xd(){const e=await fe.work_log.toArray(),t=await fe.project.toArray();return{workLog:new Map(e.map(n=>[n.id,n])),project:new Map(t.map(n=>[n.id,n]))}}let As=!1,Do=!1,Ba=!1,Qr=null,xn=null,Ua="",qa=!1,Lo=null;async function Zr(){if(As){Do=!0;return}try{if(!await Qh())return;await Cd(await nm()),Xr.value=""}catch(e){Xr.value=e instanceof Error?e.message:String(e)}}async function nm(){const e=gn();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await vr(),username:e.username,password:e.password}}function rm(){if(qa)return;qa=!0,Lo=Zv(async()=>{const t={};for(const n of Bs)t[n]=await fe.table(n).count();return t}).subscribe({next:()=>{Ba||As||(Qr&&globalThis.clearTimeout(Qr),Qr=globalThis.setTimeout(()=>{Zr()},3e3))},error:()=>{}})}function sm(){Lo&&(Lo.unsubscribe(),Lo=null),xn&&(xn.close(),xn=null,Ua=""),Qr&&(globalThis.clearTimeout(Qr),Qr=null),qa=!1}function om(e,t){const n=e+"|"+t;if(!(xn&&Ua===n)){xn&&(xn.close(),xn=null);try{xn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),Ua=n,xn.onmessage=()=>{Zr()}}catch{xn=null}}}async function Cd(e){if(As)return Do=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};As=!0,Ba=!0;try{const t=await im(e);return Do&&(Do=!1,globalThis.setTimeout(()=>{Zr()},800)),t}finally{As=!1,Ba=!1}}async function im(e){const t=e.baseUrl.trim().replace(/\/+$/,"");if(!t)throw new Error("请先配置同步服务地址");await Jh();const n=await xd(),s=await fe.sync_mirror.toArray(),o=new Map;for(const se of s)o.set(se.table+"|"+se.uuid,se);const a={},c=[];let f=0;for(const se of Bs){let ie=await Yh(se);se==="setting"&&(ie=ie.filter(I=>!Yr.has(I.key)));const T=new Map;for(const I of ie)T.set(I.uuid,I);for(const[I,Z]of T){const de=kd(se,Z,n),ae=Io(de),X=o.get(se+"|"+I);(!X||X.hash!==ae)&&(a[se]=a[se]||[],a[se].push(de),f++)}for(const[I,Z]of o)I.startsWith(se+"|")&&!T.has(Z.uuid)&&c.push({table:se,uuid:Z.uuid,deleted_at:wt()});a[se]=a[se]||[]}c.push(...dm());const v=await tm(t,e),y=se=>fetch(t+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+se},body:JSON.stringify({device:"client",tables:a,tombstones:c})});let m=await y(v);if(m.status===401){Ns("");const se=await bd(t,e);Ns(se),m=await y(se)}if(!m.ok)throw new Error("同步服务返回 "+m.status);const _=await m.json(),S=_.tables||{},$=_.tombstones||[],U=await um(S,$);om(t,xi()||v);const re=wt();return await em(re),(U.changed>0||U.removed>0||f>0)&&rr(),{pushed:f,pulled:U.changed,removed:U.removed,errors:0,at:re}}function Sd(){var t;return"dsh_idmap_"+(((t=gn())==null?void 0:t.username)||"anon")}function am(){try{const e=localStorage.getItem(Sd());if(e)return JSON.parse(e)}catch{}return{}}function lm(e){try{localStorage.setItem(Sd(),JSON.stringify(e))}catch{}}async function um(e,t){const n=am(),s=new Set(t.map(S=>S.table+"|"+S.uuid)),o=new Map;for(const S of await fe.sync_mirror.toArray())o.set(S.table+"|"+S.uuid,S);const a=new Set(Array.from(o.keys()).map(S=>S.split("|")[1]));let c=0,f=0;const v={},y={};for(const S of Bs){const $=fe.table(S),U=await $.toArray(),re=new Map(U.map(x=>[jo(S,x),x])),se=new Map(U.filter(x=>x.uuid).map(x=>[x.uuid,x])),ie=(e[S]||[]).filter(x=>!s.has(S+"|"+x.uuid)),T=ie.filter(x=>!(S==="setting"&&Yr.has(x.key))),I=ie.filter(x=>S==="setting"&&Yr.has(x.key));for(const x of I)cm(S,x.uuid);const Z=S==="setting"?[]:U.filter(x=>x.uuid&&!a.has(x.uuid)&&!s.has(S+"|"+x.uuid)),de={v:Math.max(0,...U.map(x=>Number(x.id)||0))};T.length;const ae=[];for(const x of T){const V={...x};if(S==="log_item"){const ke=V.wuuid?v[V.wuuid]:void 0;if(!ke)continue;V.work_log_id=ke,delete V.wuuid,V.project_id=V.puuid?y[V.puuid]??null:null,delete V.puuid}let ue=jo(S,x);if(S==="setting")ue=x.key;else{const ke=n[S]&&n[S][x.uuid],Te=se.get(x.uuid);Te&&Te.id!=null?ue=Te.id:typeof ke=="number"?ue=ke:ue=++de.v}const W={...V,id:ue};S==="setting"&&Yr.has(W.key)||(ae.push(W),S==="work_log"&&(v[x.uuid]=ue),S==="project"&&(y[x.uuid]=ue))}const X=ae.concat(Z);for(const x of X){const V=re.get(jo(S,x));(!V||Io(V)!==Io(x))&&c++}f+=U.filter(x=>x.uuid&&!ae.some(V=>V.uuid===x.uuid)&&!s.has(S+"|"+x.uuid)).length,await $.clear(),X.length&&await $.bulkPut(X);const O={};for(const x of X)x.uuid&&(O[x.uuid]=x.id);n[S]=O}lm(n);const m=await xd(),_=[];for(const S of Bs){const $=await fe.table(S).toArray();for(const U of $)S==="setting"&&Yr.has(U.key)||U.uuid&&_.push({table:S,uuid:U.uuid,hash:Io(kd(S,U,m))})}return await fe.sync_mirror.clear(),_.length&&await fe.sync_mirror.bulkAdd(_.map(S=>({...S}))),await fe.tombstone.clear(),{changed:c,removed:f+ii.length}}const ii=[];function cm(e,t){ii.some(n=>n.table===e&&n.uuid===t)||ii.push({table:e,uuid:t,deleted_at:wt()})}function dm(){return ii.splice(0)}const fm=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function _t(){await _d()}async function gt(e,t){const n=await fe.setting.get(e);return n?n.value:t}async function Lt(e,t){await fe.setting.put({key:e,value:t}),fm.has(e)||await _t()}async function Rr(){const e=await Promise.all([gt("work_start","09:00"),gt("work_end","18:00"),gt("grace_minutes","10"),gt("lunch_minutes","60"),gt("remind_weekly","friday")]);return{work_start:e[0],work_end:e[1],grace_minutes:Number(e[2])||0,lunch_minutes:Number(e[3])||0,remind_weekly:e[4]}}async function pm(){const e=await gt("last_project",""),t=await gt("last_category","dev");return{project_id:e?Number(e):null,category:t||"dev"}}async function vm(){return gt("last_location","")}async function hm(e,t){const n=t.trim();await Lt("last_location",n),n&&await ai(n);let s=!1;const o=await bn(e);o&&o.id?(o.location||"")!==n&&(await fe.attendance.update(o.id,{location:n||null}),s=!0):n&&(await fe.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:wt()}),s=!0),s&&await _t()}async function vl(){const e=await gt("location_presets","");if(!e)return Ku.slice();try{const t=JSON.parse(e);if(Array.isArray(t))return t.filter(n=>typeof n=="string"&&n.trim()).map(n=>n.trim())}catch{}return Ku.slice()}async function Ed(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await Lt("location_presets",JSON.stringify(t))}async function ai(e){const t=e.trim();if(!t)return;const n=await vl();n.includes(t)||await Ed([...n,t])}async function Us(e=!1){const t=await fe.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function mm(e){await fe.project.add({name:e.trim(),archived:0,created_at:wt()}),await _t()}async function ym(e,t){await fe.project.update(e,{name:t.trim()}),await _t()}async function gm(e,t){await fe.project.update(e,{archived:t?1:0}),await _t()}async function bn(e){return fe.attendance.where("date").equals(e).first()}async function $d(e,t){const n=((t===void 0?await gt("last_location",""):t)||"").trim();let s=!1;const o=await bn(e);if(o&&o.id){if(!o.clock_in_at){const a={clock_in_at:wt()};n&&(a.location=n),await fe.attendance.update(o.id,a),s=!0}n&&(await gt("last_location","")!==n&&await Lt("last_location",n),await ai(n)),s&&await _t();return}await fe.attendance.add({date:e,clock_in_at:wt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:wt()}),n&&(await Lt("last_location",n),await ai(n)),await _t()}async function bm(e){const t=await bn(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await fe.attendance.update(t.id,{clock_out_at:wt()}),await _t())}async function wm(){const e=new Date,t=Bn(e);let n="";if(e.getHours()<4){const s=await bn(Nn(t,-1));s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await fe.attendance.update(s.id,{clock_out_at:wt()}),n=s.date)}if(!n){const s=await bn(t);s&&s.id&&s.clock_in_at&&!s.clock_out_at&&(await fe.attendance.update(s.id,{clock_out_at:wt()}),n=s.date)}if(!n)throw new Error("没有进行中的打卡");return await _t(),n}async function _m(e,t,n,s,o){(o||"").trim()&&await ai(o);const a=await bn(e),c={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:s||null,location:(o||"").trim()||null,created_at:wt()};a&&a.id?await fe.attendance.update(a.id,c):await fe.attendance.add(c),await _t()}async function km(e,t,n){const s=(n||"").trim();if(!s)return;const o=await bn(e);o&&o.id&&(await fe.attendance.update(o.id,{[t]:e+"T"+s+":00"}),await _t())}async function Ci(e,t){return fe.attendance.where("date").between(e,t,!0,!0).toArray()}async function xm(e,t){const n=await bn(e);if(t){const s={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:wt()};n&&n.id?await fe.attendance.update(n.id,s):await fe.attendance.add({...s,note:null,location:null})}else n&&n.id&&await fe.attendance.update(n.id,{kind:"normal"});await _t()}async function Cm(e){const t=await fe.work_log.where("date").equals(e).first();return t||{id:await fe.work_log.add({date:e,created_at:wt()}),date:e,created_at:wt()}}async function Sm(e){return fe.work_log.where("date").equals(e).first()}async function Em(e){const t=await Sm(e);return!t||!t.id?[]:(await fe.log_item.where("work_log_id").equals(t.id).toArray()).sort((s,o)=>o.id-s.id)}async function $m(e,t){const n=await fe.work_log.where("date").equals(e).first();let s;n&&n.id?s=n:s=await Cm(e),await fe.table("log_item").add({work_log_id:s.id,content:t.content,project_id:t.project_id,category:t.category,minutes:t.minutes,is_milestone:0,needs_followup:0,takeaway:t.takeaway,remark:t.remark,sort_order:0,created_at:wt()});const o=t.project_id?String(t.project_id):"";await gt("last_project","")!==o&&await Lt("last_project",o),await gt("last_category","")!==t.category&&await Lt("last_category",t.category),await _t()}async function ya(e,t){await fe.table("log_item").update(e,t),await _t()}async function Tm(e){await fe.table("log_item").delete(e),await _t()}async function Si(e,t){const n=await fe.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const s=new Map(n.map(a=>[a.id,a.date]));return(await fe.table("log_item").where("work_log_id").anyOf(n.map(a=>a.id)).toArray()).map(a=>({...a,date:s.get(a.work_log_id)||""})).sort((a,c)=>a.date===c.date?a.id-c.id:a.date<c.date?-1:1)}async function hl(e){return fe.weekly_note.where("week_start").equals(e).first()}async function Pm(e,t){const n=await hl(e);n&&n.id?await fe.weekly_note.update(n.id,t):await fe.weekly_note.add({week_start:e,highlights:t.highlights??null,challenges:t.challenges??null,plan_next:t.plan_next??null,created_at:wt()}),await _t()}async function Am(e,t){return fe.weekly_note.where("week_start").between(e,t,!0,!0).toArray()}async function Om(){return(await fe.memo.toArray()).sort((t,n)=>t.updated_at<n.updated_at?1:-1)}async function Mm(e,t){const n=wt(),s=await fe.memo.add({title:e.trim(),content:t,created_at:n,updated_at:n});return await _t(),{id:s,title:e.trim(),content:t,created_at:n,updated_at:n}}async function Im(e,t,n){await fe.memo.update(e,{title:t.trim(),content:n,updated_at:wt()}),await _t()}async function jm(e){await fe.memo.delete(e),await _t()}async function Dm(e,t=8){const n=e.trim().toLowerCase();if(!n)return[];const s=await fe.work_log.toArray(),o=new Map(s.map(c=>[c.id,c.date]));return(await fe.table("log_item").toArray()).filter(c=>((c.content||"")+" "+(c.takeaway||"")+" "+(c.remark||"")).toLowerCase().includes(n)).sort((c,f)=>f.id-c.id).slice(0,t).map(c=>({...c,date:o.get(c.work_log_id)||""}))}async function Lm(e,t=4){const n=e.trim().toLowerCase();return n?(await fe.memo.toArray()).filter(o=>((o.title||"")+" "+(o.content||"")).toLowerCase().includes(n)).sort((o,a)=>o.updated_at<a.updated_at?1:-1).slice(0,t):[]}async function Rm(e,t){return fe.table("transaction").where("date").between(e,t,!0,!0).toArray()}async function Km(e){await fe.table("transaction").add({...e,created_at:wt()}),await _t()}async function Fm(e,t){await fe.table("transaction").update(e,{...t}),await _t()}async function Nm(e){await fe.table("transaction").delete(e),await _t()}async function Vm(e,t){await fe.table("transaction").update(e,{reimbursed:1}),await _t()}async function Bm(){const e=await Promise.all([fe.project.toArray(),fe.work_log.toArray(),fe.table("log_item").toArray(),fe.attendance.toArray(),fe.weekly_note.toArray(),fe.setting.toArray(),fe.memo.toArray(),fe.credential.toArray(),fe.table("transaction").toArray()]);return JSON.stringify({schema_version:nh,exported_at:wt(),data:{project:e[0],work_log:e[1],log_item:e[2],attendance:e[3],weekly_note:e[4],setting:e[5],memo:e[6],credential:e[7],transaction:e[8]}},null,2)}async function Um(e){let t=null;try{t=JSON.parse(e)}catch{throw new Error("不是有效的 JSON 文件")}if(!t||t.schema_version!==1&&t.schema_version!==2&&t.schema_version!==3||!t.data)throw new Error("文件格式或 schema 版本不匹配");const n=t.data,s=fe.table("log_item"),o=fe.table("transaction");await fe.transaction("rw",[fe.project,fe.work_log,s,fe.attendance,fe.weekly_note,fe.setting,fe.memo,fe.credential,o],async()=>{await Promise.all([fe.project.clear(),fe.work_log.clear(),s.clear(),fe.attendance.clear(),fe.weekly_note.clear(),fe.setting.clear(),fe.memo.clear(),fe.credential.clear(),o.clear()]),n.project&&n.project.length&&await fe.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await fe.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await s.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await fe.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await fe.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await fe.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await fe.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await fe.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await o.bulkAdd(n.transaction)}),await _t()}function To(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function Ys(e,t,n,s){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(kh(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return s?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const o=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:s?"进行中":"未完成",makeup:o,workedMinutes:null};const a=To(Un(e.clock_in_at)),c=To(Un(e.clock_out_at)),f=To(n.work_start),v=To(n.work_end);let y="normal";!o&&a>f+n.grace_minutes?y="late":!o&&c<v&&(y="early");const m=xh(e.clock_in_at,e.clock_out_at),_=Math.max(0,m-n.lunch_minutes);return{status:y,label:o?"补卡":y==="late"?"迟到":y==="early"?"早退":"正常",makeup:o,workedMinutes:_}}const Ro=L([]);let qm=0;function Ne(e){const t=++qm;Ro.value.push({id:t,text:e}),setTimeout(()=>{Ro.value=Ro.value.filter(n=>n.id!==t)},2e3)}function Hm(){return Ro}const Wm={class:"day-panel"},zm={class:"dp-head"},Gm={class:"dp-date"},Ym={class:"card sec"},Jm={class:"att-grid"},Xm={class:"att-cell"},Qm={key:0,class:"edit-row"},Zm={key:1,class:"att-val"},ey={class:"att-cell"},ty={key:0,class:"edit-row"},ny={key:1,class:"att-val"},ry={class:"att-cell"},sy=["list"],oy=["id"],iy=["value"],ay={class:"att-cell"},ly={class:"att-val status-val"},uy={key:0,class:"tag"},cy={key:1,class:"muted"},dy={key:0,class:"att-note muted"},fy={class:"att-actions"},py=["disabled"],vy=["disabled"],hy=["disabled"],my=["disabled"],yy={key:0,class:"card sec makeup"},gy={class:"form-grid"},by={class:"field"},wy={class:"field"},_y={class:"field span2"},ky=["list"],xy={class:"field span2"},Cy={key:0,class:"form-error"},Sy={class:"form-footer"},Ey={class:"card sec"},$y={class:"form-grid"},Ty={class:"field span2"},Py={key:0,class:"form-error"},Ay={class:"field"},Oy=["value"],My={class:"field"},Iy=["value"],jy={class:"field"},Dy={class:"field"},Ly={class:"field span2"},Ry={class:"form-footer"},Ky=["disabled"],Fy=["disabled"],Ny={class:"list-sec"},Vy={class:"sec-title"},By={key:0,class:"empty muted"},Uy={class:"item-main"},qy={class:"tag"},Hy=["onClick"],Wy={key:0,class:"muted item-meta"},zy={key:1,class:"muted num item-meta"},Gy=["onClick"],Yy=["onClick"],Jy=["onClick"],Xy=["onClick"],Qy={key:0,class:"item-sub"},Zy={key:0,class:"muted2"},eg={key:1,class:"muted"},tg={key:1,class:"dp-foot muted num"},ng=Rt({__name:"DayPanel",props:{date:{}},setup(e){const t=e,n=L(!0),s=L(null),o=L(void 0),a=L([]),c=L([]),f=L(""),v=L([]),y=st(()=>"loc-list-"+t.date),m=st(()=>t.date===xt());async function _(){n.value=!0,s.value=await Rr(),o.value=await bn(t.date),a.value=await Em(t.date),c.value=await Us(!0),v.value=await vl(),f.value=o.value&&o.value.location||await vm(),n.value=!1}pn(_),ht(()=>t.date,_),ht(Gs,()=>{_()});const S=st(()=>c.value.filter(z=>z.archived!==1));function $(z){if(!z)return"";const G=c.value.find(Q=>Q.id===z);return G?G.name:"已删除项目"}const U=st(()=>s.value?Ys(o.value,t.date,s.value,m.value):null),re=st(()=>a.value.reduce((z,G)=>z+(G.minutes||0),0)),se=L(!1);async function ie(){se.value||(se.value=!0,await $d(t.date,f.value),await _(),rr(),Ne("上班打卡成功"),se.value=!1)}async function T(){se.value||(se.value=!0,await bm(t.date),await _(),rr(),Ne("下班打卡成功"),se.value=!1)}async function I(){await hm(t.date,f.value),rr(),Ne("地点已更新")}const Z=L(!1),de=st(()=>{var z;return((z=o.value)==null?void 0:z.kind)==="leave"});function ae(){if(o.value&&o.value.clock_in_at){Z.value=!0;return}X(!0)}async function X(z){Z.value=!1,await xm(t.date,z),await _(),rr(),Ne(z?"已标记为休假":"已取消休假")}const O=L(null),x=L(""),V=L(null);ht(O,async z=>{var G;z&&(await ss(),(G=V.value)==null||G.focus())});function ue(z){var Q,Pe;const G=z==="in"?(Q=o.value)==null?void 0:Q.clock_in_at:(Pe=o.value)==null?void 0:Pe.clock_out_at;O.value=z,x.value=G?Un(G):z==="in"?"09:00":"18:00"}function W(){O.value=null}async function ke(){const z=O.value;z&&(O.value=null,x.value&&(await km(t.date,z==="in"?"clock_in_at":"clock_out_at",x.value),await _(),rr(),Ne("打卡时间已修改")))}const Te=L(!1),Je=L("09:00"),Le=L("18:00"),qe=L(""),Ke=L(""),it=L("");function Ge(){Ke.value=f.value,it.value="",Te.value=!Te.value}async function Qe(){if(!Je.value||!Le.value){it.value="请填写上班与下班时间";return}await _m(t.date,t.date+"T"+Je.value+":00",t.date+"T"+Le.value+":00",qe.value.trim(),Ke.value),Te.value=!1,qe.value="",it.value="",await _(),rr(),Ne("补卡已保存")}const Ce=L(""),ee=L("");ht(Ce,()=>{ee.value&&(ee.value="")});const te=L(null),we=L("dev"),Fe=L(null),dt=L(""),Kt=L(""),Ot=L(!1),Ie=st(()=>!!(Ce.value.trim()||Fe.value||dt.value.trim()||Kt.value.trim()));pn(async()=>{const z=await pm();te.value=z.project_id,we.value=z.category});function b(){Ce.value="",Fe.value=null,dt.value="",Kt.value="",ee.value=""}async function g(){const z=Ce.value.trim();if(!z){ee.value="请填写工作内容";return}Ot.value||(Ot.value=!0,await $m(t.date,{content:z,project_id:te.value,category:we.value,minutes:Fe.value&&Fe.value>0?Fe.value:null,takeaway:dt.value.trim()||null,remark:Kt.value.trim()||null}),b(),await _(),Ne("记录已添加"),Ot.value=!1)}const C=L(null);function Y(z){C.value=z}async function R(z){const G=z.id,Q={content:z.content,project_id:z.project_id,category:z.category,minutes:z.minutes,takeaway:z.takeaway,remark:z.remark,is_milestone:z.is_milestone,needs_followup:z.needs_followup};await ya(G,Q),C.value=null,await _(),Ne("修改已保存")}async function le(z){await ya(z.id,{is_milestone:z.is_milestone?0:1}),await _()}async function ge(z){await ya(z.id,{needs_followup:z.needs_followup?0:1}),await _()}const me=L(null);async function ce(){me.value&&me.value.id&&await Tm(me.value.id),me.value=null,await _(),Ne("记录已删除")}return(z,G)=>(E(),D("div",Wm,[l("div",zm,[l("div",Gm,ne(Ut(ld)(e.date)),1)]),l("div",Ym,[G[25]||(G[25]=l("div",{class:"sec-title"},"出勤信息",-1)),l("div",Jm,[l("div",Xm,[G[21]||(G[21]=l("label",null,"上班时间",-1)),O.value==="in"?(E(),D("div",Qm,[$e(l("input",{ref_key:"timeInput",ref:V,type:"time",class:"input time-input","onUpdate:modelValue":G[0]||(G[0]=Q=>x.value=Q),onKeydown:[At(ke,["enter"]),At(W,["esc"])]},null,544),[[Me,x.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:ke},"确认"),l("button",{class:"btn btn-sm",onClick:W},"取消")])):(E(),D("div",Zm,[l("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_in_at)}])},ne(o.value&&o.value.clock_in_at?Ut(Un)(o.value.clock_in_at):"未打卡"),3),o.value&&o.value.id?(E(),D("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:G[1]||(G[1]=Q=>ue("in"))},[Ee(Xe,{name:"edit",size:13})])):xe("",!0)]))]),l("div",ey,[G[22]||(G[22]=l("label",null,"下班时间",-1)),O.value==="out"?(E(),D("div",ty,[$e(l("input",{ref_key:"timeInput",ref:V,type:"time",class:"input time-input","onUpdate:modelValue":G[2]||(G[2]=Q=>x.value=Q),onKeydown:[At(ke,["enter"]),At(W,["esc"])]},null,544),[[Me,x.value]]),l("button",{class:"btn btn-primary btn-sm",onClick:ke},"确认"),l("button",{class:"btn btn-sm",onClick:W},"取消")])):(E(),D("div",ny,[l("span",{class:et(["num",{"val-empty":!(o.value&&o.value.clock_out_at)}])},ne(o.value&&o.value.clock_out_at?Ut(Un)(o.value.clock_out_at):"未打卡"),3),o.value&&o.value.id?(E(),D("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:G[3]||(G[3]=Q=>ue("out"))},[Ee(Xe,{name:"edit",size:13})])):xe("",!0)]))]),l("div",ry,[G[23]||(G[23]=l("label",null,"上班地点",-1)),$e(l("input",{class:"input","onUpdate:modelValue":G[4]||(G[4]=Q=>f.value=Q),list:y.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:I},null,40,sy),[[Me,f.value]]),l("datalist",{id:y.value},[(E(!0),D(je,null,ot(v.value,Q=>(E(),D("option",{key:Q,value:Q},null,8,iy))),128))],8,oy)]),l("div",ay,[G[24]||(G[24]=l("label",null,"考勤状态",-1)),l("div",ly,[U.value?(E(),D(je,{key:0},[l("span",{class:et(["dot",U.value.status])},null,2),l("span",null,ne(U.value.label),1),o.value&&o.value.kind==="makeup"?(E(),D("span",uy,"补卡")):xe("",!0)],64)):(E(),D("span",cy,"--"))])])]),o.value&&o.value.note?(E(),D("div",dy,"补卡说明:"+ne(o.value.note),1)):xe("",!0),l("div",fy,[m.value&&(!o.value||!o.value.clock_in_at)?(E(),D("button",{key:0,class:"btn btn-primary btn-sm",disabled:se.value,onClick:ie},"上班打卡",8,py)):m.value&&o.value&&o.value.clock_in_at&&!o.value.clock_out_at?(E(),D("button",{key:1,class:"btn btn-primary btn-sm",disabled:se.value,onClick:T},"下班打卡",8,vy)):xe("",!0),!m.value&&(!o.value||!o.value.clock_in_at)?(E(),D("button",{key:2,class:"btn btn-sm",onClick:Ge},"补卡")):xe("",!0),de.value?(E(),D("button",{key:4,class:"btn btn-sm",disabled:se.value,onClick:G[5]||(G[5]=Q=>X(!1))},"取消休假",8,my)):(E(),D("button",{key:3,class:"btn btn-sm",disabled:se.value,onClick:ae},"标记休假",8,hy))])]),Te.value?(E(),D("div",yy,[G[30]||(G[30]=l("div",{class:"sec-title"},"补卡登记",-1)),l("div",gy,[l("div",by,[G[26]||(G[26]=l("label",null,"上班时间",-1)),$e(l("input",{type:"time",class:"input","onUpdate:modelValue":G[6]||(G[6]=Q=>Je.value=Q)},null,512),[[Me,Je.value]])]),l("div",wy,[G[27]||(G[27]=l("label",null,"下班时间",-1)),$e(l("input",{type:"time",class:"input","onUpdate:modelValue":G[7]||(G[7]=Q=>Le.value=Q)},null,512),[[Me,Le.value]])]),l("div",_y,[G[28]||(G[28]=l("label",null,"上班地点",-1)),$e(l("input",{class:"input",list:y.value,"onUpdate:modelValue":G[8]||(G[8]=Q=>Ke.value=Q),placeholder:"可直接输入"},null,8,ky),[[Me,Ke.value]])]),l("div",xy,[G[29]||(G[29]=l("label",null,"补卡原因",-1)),$e(l("input",{class:"input","onUpdate:modelValue":G[9]||(G[9]=Q=>qe.value=Q),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Me,qe.value]])])]),it.value?(E(),D("div",Cy,ne(it.value),1)):xe("",!0),l("div",Sy,[l("button",{class:"btn btn-sm",onClick:G[10]||(G[10]=Q=>Te.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Qe},"保存补卡")])])):xe("",!0),l("div",Ey,[G[38]||(G[38]=l("div",{class:"sec-head"},[l("span",{class:"sec-title"},"新增工作记录"),l("span",{class:"muted form-hint"},"内容必填,其余选填")],-1)),l("div",$y,[l("div",Ty,[G[31]||(G[31]=l("label",null,"工作内容(必填)",-1)),$e(l("input",{class:et(["input",{invalid:ee.value}]),"onUpdate:modelValue":G[11]||(G[11]=Q=>Ce.value=Q),placeholder:"做了什么,一句话一条",onKeydown:At(g,["enter"])},null,34),[[Me,Ce.value]]),ee.value?(E(),D("div",Py,ne(ee.value),1)):xe("",!0)]),l("div",Ay,[G[33]||(G[33]=l("label",null,"所属项目",-1)),$e(l("select",{class:"select","onUpdate:modelValue":G[12]||(G[12]=Q=>te.value=Q)},[G[32]||(G[32]=l("option",{value:null},"无项目",-1)),(E(!0),D(je,null,ot(S.value,Q=>(E(),D("option",{key:Q.id,value:Q.id},ne(Q.name),9,Oy))),128))],512),[[Vn,te.value]])]),l("div",My,[G[34]||(G[34]=l("label",null,"工作分类",-1)),$e(l("select",{class:"select","onUpdate:modelValue":G[13]||(G[13]=Q=>we.value=Q)},[(E(!0),D(je,null,ot(Ut(zs),Q=>(E(),D("option",{key:Q.key,value:Q.key},ne(Q.label),9,Iy))),128))],512),[[Vn,we.value]])]),l("div",jy,[G[35]||(G[35]=l("label",null,"耗时(分钟)",-1)),$e(l("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":G[14]||(G[14]=Q=>Fe.value=Q),placeholder:"选填"},null,512),[[Me,Fe.value,void 0,{number:!0}]])]),l("div",Dy,[G[36]||(G[36]=l("label",null,"主要收获",-1)),$e(l("input",{class:"input","onUpdate:modelValue":G[15]||(G[15]=Q=>dt.value=Q),placeholder:"一句话:学到了什么"},null,512),[[Me,dt.value]])]),l("div",Ly,[G[37]||(G[37]=l("label",null,"备注",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":G[16]||(G[16]=Q=>Kt.value=Q),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Me,Kt.value]])])]),l("div",Ry,[l("button",{class:"btn btn-sm",disabled:!Ie.value,onClick:b},"重置",8,Ky),l("button",{class:"btn btn-primary btn-sm",disabled:Ot.value,onClick:g},"添加记录",8,Fy)])]),l("div",Ny,[l("div",Vy,"工作记录("+ne(a.value.length)+")",1),!a.value.length&&!n.value?(E(),D("div",By,"暂无记录")):xe("",!0),(E(!0),D(je,null,ot(a.value,Q=>(E(),D("div",{key:Q.id,class:"item"},[l("div",Uy,[l("span",qy,ne(Ut(Zo)(Q.category)),1),l("span",{class:"item-content",title:"点击编辑",onClick:Pe=>Y(Q)},ne(Q.content),9,Hy),Q.project_id?(E(),D("span",Wy,ne($(Q.project_id)),1)):xe("",!0),Q.minutes?(E(),D("span",zy,ne(Q.minutes)+" 分钟",1)):xe("",!0),G[39]||(G[39]=l("span",{class:"flex1"},null,-1)),l("button",{class:"icon-btn",title:"编辑完整信息",onClick:Pe=>Y(Q)},[Ee(Xe,{name:"edit",size:14})],8,Gy),l("button",{class:et(["icon-btn",{active:Q.is_milestone===1}]),title:"成果标记",onClick:Pe=>le(Q)},[Ee(Xe,{name:"star",size:14})],10,Yy),l("button",{class:et(["icon-btn",{"active-warn":Q.needs_followup===1}]),title:"待跟进",onClick:Pe=>ge(Q)},[Ee(Xe,{name:"flag",size:14})],10,Jy),l("button",{class:"icon-btn",title:"删除",onClick:Pe=>me.value=Q},[Ee(Xe,{name:"close",size:14})],8,Xy)]),Q.takeaway||Q.remark?(E(),D("div",Qy,[Q.takeaway?(E(),D("div",Zy,"收获:"+ne(Q.takeaway),1)):xe("",!0),Q.remark?(E(),D("div",eg,"备注:"+ne(Q.remark),1)):xe("",!0)])):xe("",!0)]))),128)),a.value.length?(E(),D("div",tg,[en(" 共 "+ne(a.value.length)+" 条事项 ",1),re.value?(E(),D(je,{key:0},[en(" · "+ne((re.value/60).toFixed(1))+" 小时",1)],64)):xe("",!0)])):xe("",!0)]),Ee(qn,{open:!!me.value,title:"删除确认",message:me.value?"将删除工作记录「"+me.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:G[17]||(G[17]=Q=>me.value=null),onConfirm:ce},null,8,["open","message"]),Ee(qn,{open:Z.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:G[18]||(G[18]=Q=>Z.value=!1),onConfirm:G[19]||(G[19]=Q=>X(!0))},null,8,["open"]),Ee(_h,{open:!!C.value,item:C.value,projects:c.value,date:e.date,onCancel:G[20]||(G[20]=Q=>C.value=null),onSave:R},null,8,["open","item","projects","date"])]))}}),Td=Wt(ng,[["__scopeId","data-v-2e90c9d8"]]),rg={class:"cal-page"},sg={class:"cal-toolbar"},og={class:"cal-title num"},ig={class:"cal-head"},ag={class:"cal-grid"},lg=["title","onClick"],ug={class:"cal-marks"},cg={key:0,class:"drawer"},dg={class:"drawer-head"},fg={class:"drawer-body"},pg=Rt({__name:"CalendarView",setup(e){const t=L(xt()),n=st(()=>Number(t.value.slice(0,4))),s=st(()=>Number(t.value.slice(5,7))-1),o=st(()=>n.value+" 年 "+(s.value+1)+" 月"),a=["一","二","三","四","五","六","日"],c=st(()=>{const Z=(new Date(n.value,s.value,1).getDay()+6)%7,de=new Date(n.value,s.value+1,0).getDate(),ae=[];for(let X=0;X<Z;X++)ae.push({date:"",inMonth:!1,weekend:!1});for(let X=1;X<=de;X++){const O=new Date(n.value,s.value,X),x=O.getDay();ae.push({date:Bn(O),inMonth:!0,weekend:x===0||x===6})}return ae}),f=L(new Map),v=xt();async function y(){var V;const I=Bn(new Date(n.value,s.value,1)),Z=Bn(new Date(n.value,s.value+1,0)),de=await Promise.all([Rr(),Ci(I,Z),Si(I,Z)]),ae=de[0],X=new Map(de[1].map(ue=>[ue.date,ue])),O=de[2],x=new Map;for(const ue of c.value){if(!ue.inMonth)continue;const W=Ys(X.get(ue.date),ue.date,ae,ue.date===v),ke=O.filter(Te=>Te.date===ue.date);x.set(ue.date,{status:W.status,label:W.label,location:((V=X.get(ue.date))==null?void 0:V.location)||"",hasLog:ke.length>0,hasMilestone:ke.some(Te=>Te.is_milestone===1)})}f.value=x}ht([n,s],y,{immediate:!0}),ht(Gs,()=>{y()});function m(I){var Z;return((Z=f.value.get(I))==null?void 0:Z.status)??""}function _(I){const Z=f.value.get(I);return Z?I+" · "+Z.label+(Z.location?" · "+Z.location:""):I}function S(I){var Z;return!!((Z=f.value.get(I))!=null&&Z.hasLog)}function $(I){var Z;return!!((Z=f.value.get(I))!=null&&Z.hasMilestone)}function U(){t.value=ei(t.value,-1)}function re(){t.value=ei(t.value,1)}function se(){t.value=xt()}const ie=L(null);function T(I,Z){Z&&(ie.value=I)}return ht(Fa,I=>{I&&(t.value=I,ie.value=I,Fa.value=null)},{immediate:!0}),(I,Z)=>(E(),D("div",rg,[l("div",sg,[l("button",{class:"icon-btn",onClick:U},[Ee(Xe,{name:"chevron-left",size:16})]),l("span",og,ne(o.value),1),l("button",{class:"icon-btn",onClick:re},[Ee(Xe,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:se},"回到今天")]),l("div",ig,[(E(),D(je,null,ot(a,de=>l("span",{key:de,class:"cal-week muted"},ne(de),1)),64))]),l("div",ag,[(E(!0),D(je,null,ot(c.value,(de,ae)=>(E(),D("button",{key:ae,class:et(["cal-cell",{blank:!de.inMonth,weekend:de.weekend,selected:ie.value===de.date}]),title:de.inMonth?_(de.date):void 0,onClick:X=>T(de.date,de.inMonth)},[de.inMonth?(E(),D(je,{key:0},[l("span",{class:et(["daynum num",{today:de.date===Ut(v)}])},ne(Number(de.date.slice(8,10))),3),l("span",ug,[m(de.date)?(E(),D("span",{key:0,class:et(["dot",m(de.date)])},null,2)):xe("",!0),S(de.date)?(E(),Pt(Xe,{key:1,name:"check-circle",size:12,class:"mark-log"})):xe("",!0),$(de.date)?(E(),Pt(Xe,{key:2,name:"star",size:12,class:"mark-star"})):xe("",!0)])],64)):xe("",!0)],10,lg))),128))]),Ee(os,{name:"drawer"},{default:fr(()=>[ie.value?(E(),D("aside",cg,[l("div",dg,[Z[1]||(Z[1]=l("span",{class:"drawer-title"},"当日详情",-1)),l("button",{class:"icon-btn",onClick:Z[0]||(Z[0]=de=>ie.value=null)},[Ee(Xe,{name:"close",size:16})])]),l("div",fg,[Ee(Td,{date:ie.value},null,8,["date"])])])):xe("",!0)]),_:1})]))}}),vg=Wt(pg,[["__scopeId","data-v-2404dfbe"]]),hg={class:"detail-page"},mg={class:"detail-toolbar"},yg=["value"],gg=["disabled"],bg=Rt({__name:"TodayView",setup(e){const t=L(xt()),n=st(()=>t.value===xt());function s(){t.value=Nn(t.value,-1)}function o(){t.value=Nn(t.value,1)}function a(){t.value=xt()}function c(f){const v=f.target.value;v&&(t.value=v)}return(f,v)=>(E(),D("div",hg,[l("div",mg,[l("button",{class:"icon-btn",title:"前一天",onClick:s},[Ee(Xe,{name:"chevron-left",size:16})]),l("span",{class:et(["date-title num",{"is-today":n.value}])},ne(Ut(ld)(t.value)),3),l("button",{class:"icon-btn",title:"后一天",onClick:o},[Ee(Xe,{name:"chevron-right",size:16})]),l("input",{type:"date",class:"input w-date",value:t.value,onChange:c},null,40,yg),l("button",{class:"btn btn-sm",disabled:n.value,onClick:a},"回到今天",8,gg)]),Ee(Td,{date:t.value},null,8,["date"])]))}}),wg=Wt(bg,[["__scopeId","data-v-76243d98"]]),_g={class:"stats"},kg={class:"cards"},xg={class:"card stat-card"},Cg={class:"stat-num num"},Sg={class:"card stat-card"},Eg={class:"stat-num num"},$g={class:"card stat-card"},Tg={class:"stat-num num"},Pg={class:"card stat-card"},Ag={class:"stat-num num"},Og={class:"card section"},Mg={class:"heat"},Ig=["title"],jg={class:"two-col"},Dg={class:"card section"},Lg={class:"bar-label"},Rg={class:"bar-track"},Kg={class:"muted num bar-num"},Fg={key:0,class:"muted"},Ng={class:"card section"},Vg={class:"bar-label"},Bg={class:"bar-track"},Ug={class:"muted num bar-num"},qg={key:0,class:"muted"},Hg={class:"card section"},Wg={class:"bar-label loc-label"},zg={class:"bar-track"},Gg={class:"muted num bar-num"},Yg={key:0,class:"muted"},Jg=Rt({__name:"StatsView",setup(e){const t=L({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=L([]),s=L([]),o=L([]),a=L([]);async function c(){const y=xt(),m="2000-01-01",_=await Promise.all([Rr(),Ci(m,y),Si(m,y),Us(!0)]),S=_[0],$=_[1],U=_[2],re=_[3],se=$.filter(W=>W.clock_in_at||W.kind==="makeup");let ie=0;for(const W of se){const ke=Ys(W,W.date,S,W.date===y);ie+=ke.workedMinutes??0}const T=new Set(U.map(W=>W.date));let I=0,Z=y;for(T.has(Z)||(Z=Nn(y,-1));T.has(Z);)I++,Z=Nn(Z,-1);t.value={attendDays:se.length,totalHours:(ie/60).toFixed(1),itemCount:U.length,streak:I};const de=new Map;for(const W of se){const ke=W.location||"未记录";de.set(ke,(de.get(ke)||0)+1)}a.value=Array.from(de.entries()).map(W=>({name:W[0],count:W[1],percent:Math.round(W[1]/(se.length||1)*100)})).sort((W,ke)=>ke.count-W.count);const ae=U.length||1;s.value=zs.map(W=>{const ke=U.filter(Te=>Te.category===W.key).length;return{key:W.key,label:W.label,count:ke,percent:Math.round(ke/ae*100)}}).filter(W=>W.count>0).sort((W,ke)=>ke.count-W.count);const X=new Map(re.map(W=>[W.id,W.name])),O=new Map;for(const W of U){const ke=W.project_id?X.get(W.project_id)||"已删除项目":"无项目";O.set(ke,(O.get(ke)||0)+1)}o.value=Array.from(O.entries()).map(W=>({name:W[0],count:W[1],percent:Math.round(W[1]/ae*100)})).sort((W,ke)=>ke.count-W.count);const x=new Map;for(const W of U)x.set(W.date,(x.get(W.date)||0)+1);const V=Ps(y),ue=[];for(let W=11;W>=0;W--){const ke=Nn(V,-7*W),Te=[];for(let Je=0;Je<7;Je++){const Le=Nn(ke,Je);Te.push({date:Le,count:x.get(Le)||0})}ue.push(Te)}n.value=ue}pn(async()=>{await c()}),ht(Gs,()=>{c()});function f(y){return y===0?0:y===1?1:y<=3?2:y<=5?3:4}function v(y,m){return y+" · "+(m?m+" 条":"无记录")}return(y,m)=>(E(),D("div",_g,[l("div",kg,[l("div",xg,[m[0]||(m[0]=l("div",{class:"muted"},"出勤天数",-1)),l("div",Cg,ne(t.value.attendDays),1)]),l("div",Sg,[m[1]||(m[1]=l("div",{class:"muted"},"累计工时(小时)",-1)),l("div",Eg,ne(t.value.totalHours),1)]),l("div",$g,[m[2]||(m[2]=l("div",{class:"muted"},"记录条数",-1)),l("div",Tg,ne(t.value.itemCount),1)]),l("div",Pg,[m[3]||(m[3]=l("div",{class:"muted"},"连续记录(天)",-1)),l("div",Ag,ne(t.value.streak),1)])]),l("div",Og,[m[4]||(m[4]=l("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),l("div",Mg,[(E(!0),D(je,null,ot(n.value,(_,S)=>(E(),D("div",{key:S,class:"heat-col"},[(E(!0),D(je,null,ot(_,$=>(E(),D("span",{key:$.date,class:et(["heat-cell","lv"+f($.count)]),title:v($.date,$.count)},null,10,Ig))),128))]))),128))]),m[5]||(m[5]=Up('<div class="heat-legend muted" data-v-73e5ba49><span data-v-73e5ba49>少</span><span class="heat-cell lv0" data-v-73e5ba49></span><span class="heat-cell lv1" data-v-73e5ba49></span><span class="heat-cell lv2" data-v-73e5ba49></span><span class="heat-cell lv3" data-v-73e5ba49></span><span class="heat-cell lv4" data-v-73e5ba49></span><span data-v-73e5ba49>多</span></div>',1))]),l("div",jg,[l("div",Dg,[m[6]||(m[6]=l("div",{class:"section-title"},"分类分布",-1)),(E(!0),D(je,null,ot(s.value,_=>(E(),D("div",{key:_.key,class:"bar-row"},[l("span",Lg,ne(_.label),1),l("span",Rg,[l("span",{class:"bar-fill",style:or({width:_.percent+"%"})},null,4)]),l("span",Kg,ne(_.count)+" 条 · "+ne(_.percent)+"%",1)]))),128)),s.value.length?xe("",!0):(E(),D("div",Fg,"暂无数据"))]),l("div",Ng,[m[7]||(m[7]=l("div",{class:"section-title"},"项目投入",-1)),(E(!0),D(je,null,ot(o.value,_=>(E(),D("div",{key:_.name,class:"bar-row"},[l("span",Vg,ne(_.name),1),l("span",Bg,[l("span",{class:"bar-fill",style:or({width:_.percent+"%"})},null,4)]),l("span",Ug,ne(_.count)+" 条 · "+ne(_.percent)+"%",1)]))),128)),o.value.length?xe("",!0):(E(),D("div",qg,"暂无数据"))])]),l("div",Hg,[m[8]||(m[8]=l("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(E(!0),D(je,null,ot(a.value,_=>(E(),D("div",{key:_.name,class:"bar-row"},[l("span",Wg,ne(_.name),1),l("span",zg,[l("span",{class:"bar-fill",style:or({width:_.percent+"%"})},null,4)]),l("span",Gg,ne(_.count)+" 天 · "+ne(_.percent)+"%",1)]))),128)),a.value.length?xe("",!0):(E(),D("div",Yg,"暂无数据"))])]))}}),Xg=Wt(Jg,[["__scopeId","data-v-73e5ba49"]]);async function Qg(e,t,n){const s=xt(),o=await Promise.all([Rr(),Ci(e,t),Si(e,t),Us(!0),Am(e,t)]),a=o[0],c=o[1],f=o[2],v=o[3],y=o[4];let m=0,_=0,S=0;for(const O of c){(O.clock_in_at||O.kind==="makeup")&&m++,O.kind==="makeup"&&S++;const x=Ys(O,O.date,a,O.date===s);_+=x.workedMinutes??0}const $=new Map;for(const O of c){if(!(O.clock_in_at||O.kind==="makeup"))continue;const x=O.location||"未记录";$.set(x,($.get(x)||0)+1)}const U=Array.from($.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,x)=>x.count-O.count),re=f.length||1,se=zs.map(O=>{const x=f.filter(V=>V.category===O.key).length;return{key:O.key,label:O.label,count:x,percent:Math.round(x/re*100)}}).filter(O=>O.count>0).sort((O,x)=>x.count-O.count),ie=new Map(v.map(O=>[O.id,O.name])),T=new Map;for(const O of f){const x=O.project_id?ie.get(O.project_id)||"已删除项目":"无项目";T.set(x,(T.get(x)||0)+1)}const I=Array.from(T.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,x)=>x.count-O.count),Z=f.filter(O=>O.is_milestone===1).map(O=>({date:O.date,content:O.content})),de=f.filter(O=>O.needs_followup===1).map(O=>({date:O.date,content:O.content,remark:O.remark||""})),ae=f.filter(O=>!!O.takeaway).map(O=>({date:O.date,text:O.takeaway})),X=y.map(O=>({weekStart:O.week_start,highlights:O.highlights||"",challenges:O.challenges||"",plan_next:O.plan_next||""}));return{range:{start:e,end:t,label:n},attendDays:m,totalHours:(_/60).toFixed(1),makeupCount:S,leaveCount:c.filter(O=>O.kind==="leave").length,itemCount:f.length,categoryStats:se,projectStats:I,locationStats:U,milestones:Z,followups:de,takeaways:ae,weekNotes:X}}function Zg(e){const t=[];t.push("# 实习工作总结("+e.range.start+" ~ "+e.range.end+")"),t.push(""),t.push("## 一、考勤概况"),t.push(""),t.push("出勤 "+e.attendDays+" 天,累计工时 "+e.totalHours+" 小时,补卡 "+e.makeupCount+" 次"+(e.leaveCount?",请假 "+e.leaveCount+" 天":""));const n=e.locationStats.filter(s=>s.name!=="未记录");n.length&&t.push("其中:"+n.map(s=>s.name+" "+s.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(s=>s.label+" "+s.percent+"%("+s.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(s=>s.name+" "+s.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((s,o)=>t.push(o+1+". 【成果】"+s.content+"("+s.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(s=>t.push("- 【待跟进】"+s.content+(s.remark?"("+s.date+" 备注:"+s.remark+")":"("+s.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(s=>t.push("- "+s.text+"("+s.date+")")):t.push("(无)");for(const s of e.weekNotes)t.push(""),t.push("### 周记("+s.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(s.highlights||"(无)")),t.push("- 踩的坑:"+(s.challenges||"(无)")),t.push("- 下周计划:"+(s.plan_next||"(无)"));return t.push(""),t.join(`
`)}const eb="modulepreload",tb=function(e,t){return new URL(e,t).href},Fu={},Pd=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){const c=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),v=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));o=Promise.allSettled(n.map(y=>{if(y=tb(y,s),y in Fu)return;Fu[y]=!0;const m=y.endsWith(".css"),_=m?'[rel="stylesheet"]':"";if(!!s)for(let U=c.length-1;U>=0;U--){const re=c[U];if(re.href===y&&(!m||re.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${_}`))return;const $=document.createElement("link");if($.rel=m?"stylesheet":eb,m||($.as="script"),$.crossOrigin="",$.href=y,v&&$.setAttribute("nonce",v),document.head.appendChild($),m)return new Promise((U,re)=>{$.addEventListener("load",U),$.addEventListener("error",()=>re(new Error(`Unable to preload CSS for ${y}`)))})}))}function a(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return o.then(c=>{for(const f of c||[])f.status==="rejected"&&a(f.reason);return t().catch(a)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const nb=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},s=(a,c)=>{n.platforms.set(a,c)},o=a=>{n.platforms.has(a)&&(n.currentPlatform=n.platforms.get(a))};return n.addPlatform=s,n.setPlatform=o,n},rb=e=>e.CapacitorPlatforms=nb(e),Ad=rb(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Ad.addPlatform;Ad.setPlatform;var ns;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(ns||(ns={}));class ga extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const sb=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},ob=e=>{var t,n,s,o,a;const c=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},v=f.Plugins=f.Plugins||{},y=e.CapacitorPlatforms,m=()=>c!==null?c.name:sb(e),_=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,S=()=>_()!=="web",$=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||S,U=X=>{const O=Z.get(X);return!!(O!=null&&O.platforms.has(_())||ie(X))},re=((s=y==null?void 0:y.currentPlatform)===null||s===void 0?void 0:s.isPluginAvailable)||U,se=X=>{var O;return(O=f.PluginHeaders)===null||O===void 0?void 0:O.find(x=>x.name===X)},ie=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.getPluginHeader)||se,T=X=>e.console.error(X),I=(X,O,x)=>Promise.reject(`${x} does not have an implementation of "${O}".`),Z=new Map,de=(X,O={})=>{const x=Z.get(X);if(x)return console.warn(`Capacitor plugin "${X}" already registered. Cannot register plugins twice.`),x.proxy;const V=_(),ue=ie(X);let W;const ke=async()=>(!W&&V in O?W=typeof O[V]=="function"?W=await O[V]():W=O[V]:c!==null&&!W&&"web"in O&&(W=typeof O.web=="function"?W=await O.web():W=O.web),W),Te=(Ge,Qe)=>{var Ce,ee;if(ue){const te=ue==null?void 0:ue.methods.find(we=>Qe===we.name);if(te)return te.rtype==="promise"?we=>f.nativePromise(X,Qe.toString(),we):(we,Fe)=>f.nativeCallback(X,Qe.toString(),we,Fe);if(Ge)return(Ce=Ge[Qe])===null||Ce===void 0?void 0:Ce.bind(Ge)}else{if(Ge)return(ee=Ge[Qe])===null||ee===void 0?void 0:ee.bind(Ge);throw new ga(`"${X}" plugin is not implemented on ${V}`,ns.Unimplemented)}},Je=Ge=>{let Qe;const Ce=(...ee)=>{const te=ke().then(we=>{const Fe=Te(we,Ge);if(Fe){const dt=Fe(...ee);return Qe=dt==null?void 0:dt.remove,dt}else throw new ga(`"${X}.${Ge}()" is not implemented on ${V}`,ns.Unimplemented)});return Ge==="addListener"&&(te.remove=async()=>Qe()),te};return Ce.toString=()=>`${Ge.toString()}() { [capacitor code] }`,Object.defineProperty(Ce,"name",{value:Ge,writable:!1,configurable:!1}),Ce},Le=Je("addListener"),qe=Je("removeListener"),Ke=(Ge,Qe)=>{const Ce=Le({eventName:Ge},Qe),ee=async()=>{const we=await Ce;qe({eventName:Ge,callbackId:we},Qe)},te=new Promise(we=>Ce.then(()=>we({remove:ee})));return te.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await ee()},te},it=new Proxy({},{get(Ge,Qe){switch(Qe){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return ue?Ke:Le;case"removeListener":return qe;default:return Je(Qe)}}});return v[X]=it,Z.set(X,{name:X,proxy:it,platforms:new Set([...Object.keys(O),...ue?[V]:[]])}),it},ae=((a=y==null?void 0:y.currentPlatform)===null||a===void 0?void 0:a.registerPlugin)||de;return f.convertFileSrc||(f.convertFileSrc=X=>X),f.getPlatform=_,f.handleError=T,f.isNativePlatform=$,f.isPluginAvailable=re,f.pluginMethodNoop=I,f.registerPlugin=ae,f.Exception=ga,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},ib=e=>e.Capacitor=ob(e),rs=ib(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Od=rs.registerPlugin;rs.Plugins;class Md{constructor(t){this.listeners={},this.retainedEventArguments={},this.windowListeners={},t&&(console.warn(`Capacitor WebPlugin "${t.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=t)}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const c=async()=>this.removeListener(t,n);return Promise.resolve({remove:c})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const o=this.listeners[t];if(!o){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}o.forEach(a=>a(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new rs.Exception(t,ns.Unimplemented)}unavailable(t="not available"){return new rs.Exception(t,ns.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const o=s.indexOf(n);this.listeners[t].splice(o,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const Nu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),Vu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class ab extends Md{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[o,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");o=Vu(o).trim(),a=Vu(a).trim(),n[o]=a}),n}async setCookie(t){try{const n=Nu(t.key),s=Nu(t.value),o=`; expires=${(t.expires||"").replace("expires=","")}`,a=(t.path||"/").replace("path=",""),c=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${o}; path=${a}; ${c};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}Od("CapacitorCookies",{web:()=>new ab});const lb=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const o=s.result;t(o.indexOf(",")>=0?o.split(",")[1]:o)},s.onerror=o=>n(o),s.readAsDataURL(e)}),ub=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(o=>o.toLocaleLowerCase()).reduce((o,a,c)=>(o[a]=e[t[c]],o),{})},cb=(e,t=!0)=>e?Object.entries(e).reduce((s,o)=>{const[a,c]=o;let f,v;return Array.isArray(c)?(v="",c.forEach(y=>{f=t?encodeURIComponent(y):y,v+=`${a}=${f}&`}),v.slice(0,-1)):(f=t?encodeURIComponent(c):c,v=`${a}=${f}`),`${s}&${v}`},"").substr(1):null,db=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),o=ub(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(o.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[c,f]of Object.entries(e.data||{}))a.set(c,f);n.body=a.toString()}else if(o.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((f,v)=>{a.append(v,f)});else for(const f of Object.keys(e.data))a.append(f,e.data[f]);n.body=a;const c=new Headers(n.headers);c.delete("content-type"),n.headers=c}else(o.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class fb extends Md{async request(t){const n=db(t,t.webFetchExtra),s=cb(t.params,t.shouldEncodeUrlParams),o=s?`${t.url}?${s}`:t.url,a=await fetch(o,n),c=a.headers.get("content-type")||"";let{responseType:f="text"}=a.ok?t:{};c.includes("application/json")&&(f="json");let v,y;switch(f){case"arraybuffer":case"blob":y=await a.blob(),v=await lb(y);break;case"json":v=await a.json();break;case"document":case"text":default:v=await a.text()}const m={};return a.headers.forEach((_,S)=>{m[S]=_}),{data:v,headers:m,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}Od("CapacitorHttp",{web:()=>new fb});async function ml(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const c=await n.electronAPI.saveFile(e,t);return c&&c.saved?c.path:""}if(rs.isNativePlatform()){const{Filesystem:c,Directory:f,Encoding:v}=await Pd(async()=>{const{Filesystem:y,Directory:m,Encoding:_}=await import("./index-DPampPaO.js");return{Filesystem:y,Directory:m,Encoding:_}},[],import.meta.url);try{return(await c.writeFile({path:e,data:t,directory:f.Documents,encoding:v.UTF8,recursive:!0})).uri}catch{return(await c.writeFile({path:e,data:t,directory:f.Cache,encoding:v.UTF8,recursive:!0})).uri}}const s=new Blob([t],{type:"text/plain;charset=utf-8"}),o=URL.createObjectURL(s),a=document.createElement("a");return a.href=o,a.download=e,a.click(),window.setTimeout(()=>URL.revokeObjectURL(o),1e4),""}const pb=Object.freeze(Object.defineProperty({__proto__:null,downloadText:ml},Symbol.toStringTag,{value:"Module"}));async function Ha(e){try{await navigator.clipboard.writeText(e)}catch{const t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select(),document.execCommand("copy"),document.body.removeChild(t)}}async function vb(e){const t=await Promise.all([gt("ai_base_url",""),gt("ai_api_key",""),gt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),s=t[1].trim(),o=t[2].trim();if(!n||!o)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const a=n+"/chat/completions",c={"Content-Type":"application/json"};s&&(c.Authorization="Bearer "+s);const v=JSON.stringify({model:o,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(a,{method:"POST",headers:c,body:v})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let S="接口返回 "+y.status;try{const $=await y.json();$&&$.error&&$.error.message&&(S+=":"+$.error.message)}catch{}throw new Error(S)}const m=await y.json(),_=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!_)throw new Error("接口未返回内容");return String(_)}const hb={class:"report"},mb={class:"report-toolbar"},yb={class:"seg"},gb=["onClick"],bb=["disabled"],wb=["disabled"],_b={key:0,class:"ai-error"},kb={class:"report-grid"},xb={class:"report-left"},Cb={class:"card section"},Sb={class:"section-title"},Eb={class:"muted note-saved"},$b={class:"card section"},Tb={class:"report-right"},Pb={key:0,class:"card section"},Ab={class:"sum-row"},Ob={class:"num"},Mb={class:"sum-row"},Ib={class:"num"},jb={class:"sum-row"},Db={class:"num"},Lb={class:"sum-row"},Rb={class:"num"},Kb={class:"sum-row"},Fb={class:"num"},Nb={class:"muted"},Vb={class:"num"},Bb={key:0,class:"muted sum-empty"},Ub={class:"muted"},qb={key:1,class:"muted sum-empty"},Hb={class:"muted"},Wb={key:2,class:"muted sum-empty"},zb={class:"muted"},Gb={key:3,class:"muted sum-empty"},Yb=Rt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=L("week"),s=L(Ps(xt())),o=L(xt()),a=L(null),c=L(""),f=L(!1),v=L(!1),y=L(null),m=L(""),_=L(Ps(xt())),S=L(""),$=L(""),U=L(""),re=L(!1);async function se(){const O=await hl(_.value);S.value=(O==null?void 0:O.highlights)||"",$.value=(O==null?void 0:O.challenges)||"",U.value=(O==null?void 0:O.plan_next)||"",re.value=!1}async function ie(){await Pm(_.value,{highlights:S.value.trim()||null,challenges:$.value.trim()||null,plan_next:U.value.trim()||null}),re.value=!0,await I()}function T(O){const x=xt();if(O==="week"){const V=Ps(x);return{start:V,end:Nn(V,6),label:"本周"}}if(O==="month"){const V=x.slice(0,7);return{start:V+"-01",end:x,label:V+" 本月"}}return O==="all"?{start:"2000-01-01",end:x,label:"全部实习期"}:{start:s.value,end:o.value,label:s.value+" ~ "+o.value}}async function I(){f.value=!0;const O=T(n.value),x=await Qg(O.start,O.end,O.label);a.value=x,c.value=Zg(x),f.value=!1}ht(n,I),ht([s,o],()=>{n.value==="custom"&&I()}),pn(async()=>{await se(),await I()});async function Z(){const O=xt().replace(/-/g,""),x=await ml("实习工作总结_"+O+".md",c.value);Ne(x?"总结已导出到:"+x:"总结已导出到系统下载目录")}async function de(){await Ha(c.value),Ne("总结已复制到剪贴板")}async function ae(){if(v.value)return;m.value="";const O=c.value.trim();if(!O){m.value="当前草稿为空,无法润色";return}v.value=!0;try{y.value=c.value,c.value=await vb(O),Ne("AI 润色完成")}catch(x){y.value=null,m.value=x instanceof Error?x.message:"润色失败"}v.value=!1}function X(){y.value!==null&&(c.value=y.value),y.value=null}return(O,x)=>(E(),D("div",hb,[l("div",mb,[l("div",yb,[(E(),D(je,null,ot(t,V=>l("button",{key:V.key,class:et(["seg-btn",{active:n.value===V.key}]),onClick:ue=>n.value=V.key},ne(V.label),11,gb)),64))]),n.value==="custom"?(E(),D(je,{key:0},[$e(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[0]||(x[0]=V=>s.value=V)},null,512),[[Me,s.value]]),x[6]||(x[6]=l("span",{class:"muted"},"至",-1)),$e(l("input",{type:"date",class:"input w-date","onUpdate:modelValue":x[1]||(x[1]=V=>o.value=V)},null,512),[[Me,o.value]])],64)):xe("",!0),x[10]||(x[10]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",disabled:v.value,onClick:ae},[Ee(Xe,{name:"edit",size:14}),x[7]||(x[7]=en("AI 润色 ",-1))],8,bb),y.value!==null?(E(),D("button",{key:1,class:"btn btn-sm",onClick:X},"还原润色前")):xe("",!0),l("button",{class:"btn btn-sm",disabled:f.value,onClick:I},[Ee(Xe,{name:"edit",size:14}),x[8]||(x[8]=en("重新生成 ",-1))],8,wb),l("button",{class:"btn btn-sm",onClick:de},"复制"),l("button",{class:"btn btn-primary btn-sm",onClick:Z},[Ee(Xe,{name:"export",size:14}),x[9]||(x[9]=en("导出 Markdown ",-1))])]),m.value?(E(),D("div",_b,ne(m.value),1)):xe("",!0),l("div",kb,[l("div",xb,[l("div",Cb,[l("div",Sb,"本周周记("+ne(_.value)+" 起)",1),x[11]||(x[11]=l("label",{class:"note-label muted"},"本周亮点",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":x[2]||(x[2]=V=>S.value=V),placeholder:"本周最有价值的一件事",onBlur:ie},null,544),[[Me,S.value]]),x[12]||(x[12]=l("label",{class:"note-label muted"},"踩的坑",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":x[3]||(x[3]=V=>$.value=V),placeholder:"遇到的问题与教训",onBlur:ie},null,544),[[Me,$.value]]),x[13]||(x[13]=l("label",{class:"note-label muted"},"下周计划",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":x[4]||(x[4]=V=>U.value=V),placeholder:"下周准备做什么",onBlur:ie},null,544),[[Me,U.value]]),l("div",Eb,ne(re.value?"已保存":"失焦自动保存"),1)]),l("div",$b,[x[14]||(x[14]=l("div",{class:"section-title"},"总结草稿(可编辑)",-1)),$e(l("textarea",{class:"textarea md-editor","onUpdate:modelValue":x[5]||(x[5]=V=>c.value=V),spellcheck:"false"},null,512),[[Me,c.value]])])]),l("div",Tb,[a.value?(E(),D("div",Pb,[x[20]||(x[20]=l("div",{class:"section-title"},"数据摘要",-1)),l("div",Ab,[x[15]||(x[15]=l("span",{class:"muted"},"出勤",-1)),l("span",Ob,ne(a.value.attendDays)+" 天",1)]),l("div",Mb,[x[16]||(x[16]=l("span",{class:"muted"},"工时",-1)),l("span",Ib,ne(a.value.totalHours)+" 小时",1)]),l("div",jb,[x[17]||(x[17]=l("span",{class:"muted"},"补卡",-1)),l("span",Db,ne(a.value.makeupCount)+" 次",1)]),l("div",Lb,[x[18]||(x[18]=l("span",{class:"muted"},"请假",-1)),l("span",Rb,ne(a.value.leaveCount)+" 天",1)]),l("div",Kb,[x[19]||(x[19]=l("span",{class:"muted"},"记录",-1)),l("span",Fb,ne(a.value.itemCount)+" 条",1)]),x[21]||(x[21]=l("div",{class:"section-sub"},"分类分布",-1)),(E(!0),D(je,null,ot(a.value.categoryStats,V=>(E(),D("div",{key:V.key,class:"sum-row"},[l("span",Nb,ne(V.label),1),l("span",Vb,ne(V.count)+" 条 · "+ne(V.percent)+"%",1)]))),128)),a.value.categoryStats.length?xe("",!0):(E(),D("div",Bb,"(无)")),x[22]||(x[22]=l("div",{class:"section-sub"},"主要成果",-1)),(E(!0),D(je,null,ot(a.value.milestones,(V,ue)=>(E(),D("div",{key:"m"+ue,class:"sum-item"},[en(ne(V.content),1),l("span",Ub,"("+ne(V.date)+")",1)]))),128)),a.value.milestones.length?xe("",!0):(E(),D("div",qb,"(无)")),x[23]||(x[23]=l("div",{class:"section-sub"},"待跟进",-1)),(E(!0),D(je,null,ot(a.value.followups,(V,ue)=>(E(),D("div",{key:"f"+ue,class:"sum-item"},[en(ne(V.content),1),l("span",Hb,"("+ne(V.date)+")",1)]))),128)),a.value.followups.length?xe("",!0):(E(),D("div",Wb,"(无)")),x[24]||(x[24]=l("div",{class:"section-sub"},"学习与成长",-1)),(E(!0),D(je,null,ot(a.value.takeaways,(V,ue)=>(E(),D("div",{key:"t"+ue,class:"sum-item"},[en(ne(V.text),1),l("span",zb,"("+ne(V.date)+")",1)]))),128)),a.value.takeaways.length?xe("",!0):(E(),D("div",Gb,"(无)"))])):xe("",!0)])])]))}}),Jb=Wt(Yb,[["__scopeId","data-v-43f9c59b"]]),Xb=["aria-label"],Qb={class:"dialog-head"},Zb={class:"dialog-title"},ew={class:"dialog-body"},tw={class:"form-grid"},nw={class:"field span2"},rw={class:"seg"},sw={class:"field"},ow={class:"field"},iw={class:"field"},aw=["value"],lw={key:0,class:"field"},uw={class:"seg"},cw={class:"field span2"},dw={key:0,class:"form-error"},fw={class:"dialog-btns"},pw=Rt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=L("expense"),a=L("餐饮"),c=L(""),f=L(""),v=L(""),y=L(!1),m=L(!1),_=L(""),S=L(null);function $(ie){n.open&&ie.key==="Escape"&&s("cancel")}ht(()=>n.open,async ie=>{var T;ie?(o.value=n.initial.type==="income"?"income":"expense",a.value=n.initial.category,c.value=n.initial.amountYuan,f.value=n.initial.date,v.value=n.initial.note,y.value=n.initial.reimbursable===1,m.value=n.initial.reimbursed===1,_.value="",window.addEventListener("keydown",$),await ss(),(T=S.value)==null||T.focus()):window.removeEventListener("keydown",$)}),pr(()=>window.removeEventListener("keydown",$)),ht(o,ie=>{a.value=ie==="expense"?Gr[0]:Qo[0]});const U=st(()=>o.value==="expense"?Gr:Qo);function re(){return a.value&&U.value.includes(a.value)?a.value:U.value[0]}function se(){const ie=String(c.value??"").trim(),T=Number(ie);if(!ie||!isFinite(T)||T<=0){_.value="请填写大于 0 的金额";return}if(!f.value){_.value="请选择日期";return}const I=o.value==="expense"&&y.value?1:0;s("save",{type:o.value,category:re(),amount:Math.round(T*100),date:f.value,note:String(v.value??"").trim(),reimbursable:I,reimbursed:I&&m.value?1:0})}return(ie,T)=>(E(),Pt(Dr,{to:"body"},[Ee(os,{name:"modal"},{default:fr(()=>[e.open?(E(),D("div",{key:0,class:"mask",onClick:T[11]||(T[11]=sn(I=>s("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",Qb,[l("span",Zb,ne(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:T[0]||(T[0]=I=>s("cancel"))},[Ee(Xe,{name:"close",size:16})])]),l("div",ew,[l("div",tw,[l("div",nw,[T[12]||(T[12]=l("label",null,"类型",-1)),l("div",rw,[l("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:T[1]||(T[1]=I=>o.value="expense")},"支出",2),l("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:T[2]||(T[2]=I=>o.value="income")},"收入",2)])]),l("div",sw,[T[13]||(T[13]=l("label",null,"金额(元,必填)",-1)),$e(l("input",{ref_key:"amountInput",ref:S,class:et(["input",{invalid:_.value}]),"onUpdate:modelValue":T[3]||(T[3]=I=>c.value=I),type:"number",min:"0",step:"0.01",placeholder:"0.00"},null,2),[[Me,c.value]])]),l("div",ow,[T[14]||(T[14]=l("label",null,"日期(必填)",-1)),$e(l("input",{class:"input",type:"date","onUpdate:modelValue":T[4]||(T[4]=I=>f.value=I)},null,512),[[Me,f.value]])]),l("div",iw,[T[15]||(T[15]=l("label",null,"分类",-1)),$e(l("select",{class:"select","onUpdate:modelValue":T[5]||(T[5]=I=>a.value=I)},[(E(!0),D(je,null,ot(U.value,I=>(E(),D("option",{key:I,value:I},ne(I),9,aw))),128))],512),[[Vn,a.value]])]),o.value==="expense"?(E(),D("div",lw,[T[16]||(T[16]=l("label",null,"报销状态",-1)),l("div",uw,[l("button",{class:et(["seg-btn",{active:!y.value}]),onClick:T[6]||(T[6]=I=>{y.value=!1,m.value=!1})},"无需报销",2),l("button",{class:et(["seg-btn",{active:y.value&&!m.value}]),onClick:T[7]||(T[7]=I=>{y.value=!0,m.value=!1})},"待报销",2),l("button",{class:et(["seg-btn",{active:y.value&&m.value}]),onClick:T[8]||(T[8]=I=>{y.value=!0,m.value=!0})},"已报销",2)])])):xe("",!0),l("div",cw,[T[17]||(T[17]=l("label",null,"备注",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":T[9]||(T[9]=I=>v.value=I),placeholder:"选填"},null,512),[[Me,v.value]])])]),_.value?(E(),D("div",dw,ne(_.value),1)):xe("",!0)]),l("div",fw,[l("button",{class:"btn btn-sm",onClick:T[10]||(T[10]=I=>s("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:se},"保存")])],8,Xb)])):xe("",!0)]),_:1})]))}}),vw=Wt(pw,[["__scopeId","data-v-edca3327"]]),hw={class:"ledger-page"},mw={class:"ledger-toolbar"},yw={class:"month-title num"},gw={class:"cards"},bw={class:"card stat-card"},ww={class:"stat-num num amt-income"},_w={class:"card stat-card"},kw={class:"stat-num num"},xw={class:"card stat-card"},Cw={class:"card stat-card"},Sw={class:"stat-num num amt-warn"},Ew={class:"card sec"},$w={class:"form-grid"},Tw={class:"field span2"},Pw={class:"seg"},Aw={class:"field"},Ow={class:"field"},Mw={class:"field"},Iw=["value"],jw={key:0,class:"field"},Dw={class:"field span2"},Lw={key:0,class:"form-error"},Rw={class:"form-footer"},Kw=["disabled"],Fw=["disabled"],Nw={key:0,class:"card sec"},Vw={class:"bar-label"},Bw={class:"bar-track"},Uw={class:"muted num bar-num"},qw={key:1,class:"card section"},Hw={class:"form-error"},Ww={class:"card table-card"},zw={class:"tx-table"},Gw={class:"num","data-label":"日期"},Yw={"data-label":"分类"},Jw={class:"tag"},Xw={class:"td-note","data-label":"备注"},Qw={"data-label":"报销"},Zw={key:0,class:"muted"},e_={key:1,class:"tx-done"},t_={key:2,class:"tx-pending"},n_={class:"ops-cell"},r_={class:"ops"},s_=["onClick"],o_=["onClick"],i_=["onClick"],a_={key:0},l_={class:"muted vault-note num"},u_=Rt({__name:"LedgerView",setup(e){const t=L(xt()),n=L([]),s=L(!0),o=L("expense"),a=L(""),c=L(Gr[0]),f=L(xt()),v=L(""),y=L(!1),m=L(""),_=L(""),S=L(!1),$=L(!1),U=L(null),re=L({type:"expense",category:Gr[0],amountYuan:"",date:xt(),note:"",reimbursable:0,reimbursed:0}),se=L(null),ie=st(()=>t.value.slice(0,7)+"-01"),T=st(()=>{const ee=Number(t.value.slice(0,4)),te=Number(t.value.slice(5,7))-1,we=new Date(ee,te+1,0).getDate();return t.value.slice(0,7)+"-"+(we<10?"0"+we:String(we))}),I=st(()=>Number(t.value.slice(0,4))+" 年 "+Number(t.value.slice(5,7))+" 月");async function Z(){s.value=!0;try{n.value=await Rm(ie.value,T.value),_.value=""}catch(ee){_.value="账目加载失败:"+(ee instanceof Error?ee.stack||ee.message:String(ee)),Ne("账目加载失败")}s.value=!1}pn(Z),ht(t,Z),ht(o,ee=>{c.value=ee==="expense"?Gr[0]:Qo[0]});const de=st(()=>n.value.slice().sort((ee,te)=>ee.date===te.date?te.id-ee.id:ee.date<te.date?1:-1)),ae=st(()=>{let ee=0,te=0,we=0;for(const Fe of n.value)Fe.type==="income"?ee+=Fe.amount:(te+=Fe.amount,Fe.reimbursable===1&&Fe.reimbursed!==1&&(we+=Fe.amount));return{income:ee,expense:te,pending:we,balance:ee-te}}),X=L("all"),O=L("all"),x=st(()=>de.value.filter(ee=>!(X.value!=="all"&&ee.type!==X.value||O.value==="pending"&&!(ee.type==="expense"&&ee.reimbursable===1&&ee.reimbursed!==1)||O.value==="done"&&!(ee.reimbursable===1&&ee.reimbursed===1)))),V=st(()=>{const ee=new Map;let te=0;for(const Fe of n.value)Fe.type==="expense"&&(ee.set(Fe.category,(ee.get(Fe.category)||0)+Fe.amount),te+=Fe.amount);const we=te||1;return Array.from(ee.entries()).map(Fe=>({name:Fe[0],amount:Fe[1],percent:Math.round(Fe[1]/we*100)})).sort((Fe,dt)=>dt.amount-Fe.amount)});function ue(ee){return(ee/100).toFixed(2)}function W(ee){return(ee.type==="income"?"+":"-")+ue(ee.amount)}function ke(){t.value=ei(t.value,-1)}function Te(){t.value=ei(t.value,1)}function Je(){t.value=xt()}ht(a,()=>{m.value&&(m.value="")});async function Le(){const ee=String(a.value??"").trim(),te=Number(ee);if(!ee||!isFinite(te)||te<=0){m.value="请填写大于 0 的金额";return}if(!f.value){m.value="请选择日期";return}if(!S.value){S.value=!0;try{await Km({type:o.value,category:c.value,amount:Math.round(te*100),date:f.value,note:String(v.value??"").trim(),reimbursable:o.value==="expense"&&y.value?1:0,reimbursed:0})}catch(we){Ne("添加失败:"+(we instanceof Error?we.message:String(we))),S.value=!1;return}a.value="",v.value="",y.value=!1,m.value="",await Z(),Ne("记账已添加"),S.value=!1}}const qe=st(()=>String(a.value??"").trim()!==""||String(v.value??"").trim()!=="");function Ke(){a.value="",v.value="",y.value=!1,m.value=""}async function it(ee){await Vm(ee.id),await Z(),Ne("已标记为已报销")}function Ge(ee){U.value=ee.id,re.value={type:ee.type,category:ee.category,amountYuan:ue(ee.amount),date:ee.date,note:ee.note||"",reimbursable:ee.reimbursable,reimbursed:ee.reimbursed},$.value=!0}async function Qe(ee){const te=U.value;await Fm(te,ee),$.value=!1,await Z(),Ne("账目已更新")}async function Ce(){se.value&&se.value.id&&await Nm(se.value.id),se.value=null,await Z(),Ne("账目已删除")}return(ee,te)=>(E(),D("div",hw,[l("div",mw,[l("button",{class:"icon-btn",onClick:ke},[Ee(Xe,{name:"chevron-left",size:16})]),l("span",yw,ne(I.value),1),l("button",{class:"icon-btn",onClick:Te},[Ee(Xe,{name:"chevron-right",size:16})]),l("button",{class:"btn btn-sm",onClick:Je},"回到本月"),te[13]||(te[13]=l("span",{class:"flex1"},null,-1)),$e(l("select",{class:"select w-filter","onUpdate:modelValue":te[0]||(te[0]=we=>X.value=we)},[...te[11]||(te[11]=[l("option",{value:"all"},"全部类型",-1),l("option",{value:"expense"},"仅支出",-1),l("option",{value:"income"},"仅收入",-1)])],512),[[Vn,X.value]]),$e(l("select",{class:"select w-filter","onUpdate:modelValue":te[1]||(te[1]=we=>O.value=we)},[...te[12]||(te[12]=[l("option",{value:"all"},"全部报销",-1),l("option",{value:"pending"},"待报销",-1),l("option",{value:"done"},"已报销",-1)])],512),[[Vn,O.value]])]),l("div",gw,[l("div",bw,[te[14]||(te[14]=l("div",{class:"muted"},"本月收入(元)",-1)),l("div",ww,ne(ue(ae.value.income)),1)]),l("div",_w,[te[15]||(te[15]=l("div",{class:"muted"},"本月支出(元)",-1)),l("div",kw,ne(ue(ae.value.expense)),1)]),l("div",xw,[te[16]||(te[16]=l("div",{class:"muted"},"本月结余(元)",-1)),l("div",{class:et(["stat-num num",{"amt-income":ae.value.balance>=0,"amt-expense":ae.value.balance<0}])},ne(ue(ae.value.balance)),3)]),l("div",Cw,[te[17]||(te[17]=l("div",{class:"muted"},"待报销(元)",-1)),l("div",Sw,ne(ue(ae.value.pending)),1)])]),l("div",Ew,[te[24]||(te[24]=l("div",{class:"sec-head"},[l("span",{class:"sec-title"},"新增一笔"),l("span",{class:"muted form-hint"},"金额必填,回车快速添加")],-1)),l("div",$w,[l("div",Tw,[te[18]||(te[18]=l("label",null,"类型",-1)),l("div",Pw,[l("button",{class:et(["seg-btn",{active:o.value==="expense"}]),onClick:te[2]||(te[2]=we=>o.value="expense")},"支出",2),l("button",{class:et(["seg-btn",{active:o.value==="income"}]),onClick:te[3]||(te[3]=we=>o.value="income")},"收入",2)])]),l("div",Aw,[te[19]||(te[19]=l("label",null,"金额(元,必填)",-1)),$e(l("input",{class:et(["input",{invalid:m.value}]),"onUpdate:modelValue":te[4]||(te[4]=we=>a.value=we),type:"number",min:"0",step:"0.01",placeholder:"0.00",onKeydown:At(Le,["enter"])},null,34),[[Me,a.value]])]),l("div",Ow,[te[20]||(te[20]=l("label",null,"日期",-1)),$e(l("input",{class:"input",type:"date","onUpdate:modelValue":te[5]||(te[5]=we=>f.value=we)},null,512),[[Me,f.value]])]),l("div",Mw,[te[21]||(te[21]=l("label",null,"分类",-1)),$e(l("select",{class:"select","onUpdate:modelValue":te[6]||(te[6]=we=>c.value=we)},[(E(!0),D(je,null,ot(o.value==="expense"?Ut(Gr):Ut(Qo),we=>(E(),D("option",{key:we,value:we},ne(we),9,Iw))),128))],512),[[Vn,c.value]])]),o.value==="expense"?(E(),D("div",jw,[te[22]||(te[22]=l("label",null,"报销",-1)),l("button",{class:et(["toggle-btn",{on:y.value}]),onClick:te[7]||(te[7]=we=>y.value=!y.value)},ne(y.value?"需要报销":"无需报销"),3)])):xe("",!0),l("div",Dw,[te[23]||(te[23]=l("label",null,"备注",-1)),$e(l("input",{class:"input","onUpdate:modelValue":te[8]||(te[8]=we=>v.value=we),placeholder:"选填,如:客户现场午餐",onKeydown:At(Le,["enter"])},null,544),[[Me,v.value]])])]),m.value?(E(),D("div",Lw,ne(m.value),1)):xe("",!0),l("div",Rw,[l("button",{class:"btn btn-sm",disabled:!qe.value,onClick:Ke},"重置",8,Kw),l("button",{class:"btn btn-primary btn-sm",disabled:S.value,onClick:Le},"添加记录",8,Fw)])]),V.value.length?(E(),D("div",Nw,[te[25]||(te[25]=l("div",{class:"sec-title"},"本月支出分类",-1)),(E(!0),D(je,null,ot(V.value,we=>(E(),D("div",{key:we.name,class:"bar-row"},[l("span",Vw,ne(we.name),1),l("span",Bw,[l("span",{class:"bar-fill",style:or({width:we.percent+"%"})},null,4)]),l("span",Uw,ne(ue(we.amount))+" 元 · "+ne(we.percent)+"%",1)]))),128))])):xe("",!0),_.value?(E(),D("div",qw,[l("div",Hw,ne(_.value),1),te[26]||(te[26]=l("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):xe("",!0),l("div",Ww,[l("table",zw,[te[28]||(te[28]=l("thead",null,[l("tr",null,[l("th",null,"日期"),l("th",null,"分类"),l("th",null,"金额(元)"),l("th",null,"备注"),l("th",null,"报销"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[(E(!0),D(je,null,ot(x.value,we=>(E(),D("tr",{key:we.id},[l("td",Gw,ne(we.date),1),l("td",Yw,[l("span",Jw,ne(we.category),1)]),l("td",{class:et(["num",we.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},ne(W(we)),3),l("td",Xw,ne(we.note||"--"),1),l("td",Qw,[we.type!=="expense"||we.reimbursable!==1?(E(),D("span",Zw,"--")):we.reimbursed===1?(E(),D("span",e_,"已报销")):(E(),D("span",t_,"待报销"))]),l("td",n_,[l("div",r_,[we.type==="expense"&&we.reimbursable===1&&we.reimbursed!==1?(E(),D("button",{key:0,class:"btn btn-xs",onClick:Fe=>it(we)},"标记已报销",8,s_)):xe("",!0),l("button",{class:"btn btn-xs",onClick:Fe=>Ge(we)},"编辑",8,o_),l("button",{class:"btn btn-xs",onClick:Fe=>se.value=we},"删除",8,i_)])])]))),128)),!x.value.length&&!s.value?(E(),D("tr",a_,[...te[27]||(te[27]=[l("td",{colspan:"6",class:"empty muted"},"本月暂无账目",-1)])])):xe("",!0)])])]),l("div",l_,"筛选结果 "+ne(x.value.length)+" 条 / 本月共 "+ne(n.value.length)+" 条",1),Ee(vw,{open:$.value,title:(U.value,"编辑账目"),initial:re.value,onCancel:te[9]||(te[9]=we=>$.value=!1),onSave:Qe},null,8,["open","title","initial"]),Ee(qn,{open:!!se.value,title:"删除确认",message:se.value?"将删除 "+se.value.date+" 的账目("+se.value.category+" "+ue(se.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:te[10]||(te[10]=we=>se.value=null),onConfirm:Ce},null,8,["open","message"])]))}}),c_=Wt(u_,[["__scopeId","data-v-0533e5f8"]]),d_={class:"memo-page"},f_={class:"card memo-list"},p_={class:"pane-head"},v_={class:"pane-title"},h_={class:"memo-scroll"},m_=["onClick"],y_={class:"memo-item-title"},g_={class:"muted memo-item-sub"},b_={class:"muted num memo-item-time"},w_={key:0,class:"muted empty"},__={class:"card memo-editor"},k_={class:"editor-foot"},x_={class:"muted foot-info"},C_=["disabled"],S_=["disabled"],E_={key:1,class:"empty muted editor-empty"},$_=Rt({__name:"MemoView",setup(e){const t=L([]),n=L(null),s=L(!1),o=L(""),a=L(""),c=L(null),f=L(null);async function v(){if(t.value=await Om(),n.value&&n.value.id){const ae=t.value.find(X=>X.id===n.value.id);ae&&(n.value=ae)}}pn(async()=>{await v(),t.value.length&&_(t.value[0]),window.addEventListener("keydown",y)}),pr(()=>window.removeEventListener("keydown",y)),ht(Na,async ae=>{if(!ae)return;t.value.length||await v();const X=t.value.find(O=>O.id===ae);Na.value=null,X&&S(X)},{immediate:!0});function y(ae){(ae.ctrlKey||ae.metaKey)&&ae.key.toLowerCase()==="s"&&s.value&&m.value&&(ae.preventDefault(),se())}const m=st(()=>{if(!s.value)return!1;const ae=n.value?n.value.title:"",X=n.value?n.value.content:"";return o.value!==ae||a.value!==X});function _(ae){n.value=ae,s.value=!0,o.value=ae.title,a.value=ae.content}function S(ae){if(!(s.value&&n.value&&n.value.id===ae.id)){if(m.value){f.value={type:"select",memo:ae};return}_(ae)}}function $(){if(m.value){f.value={type:"new"};return}U()}function U(){n.value=null,s.value=!0,o.value="",a.value=""}function re(){n.value?_(n.value):U()}async function se(){if(!o.value.trim()&&!a.value.trim()){Ne("标题与内容不能都为空");return}if(n.value&&n.value.id)await Im(n.value.id,o.value,a.value),Ne("备忘已保存");else{const ae=await Mm(o.value,a.value);n.value=ae,o.value=ae.title,a.value=ae.content,Ne("备忘已创建")}await v()}function ie(){n.value&&n.value.id&&(c.value=n.value)}async function T(){c.value&&c.value.id&&(await jm(c.value.id),Ne("备忘已删除")),c.value=null,await v(),U()}function I(){const ae=f.value;f.value=null,ae&&(ae.type==="select"?_(ae.memo):U())}function Z(ae){return(ae.content||"").replace(/\s+/g," ").slice(0,30)}function de(ae){return ae.replace("T"," ").slice(0,16)}return(ae,X)=>(E(),D("div",d_,[l("aside",f_,[l("div",p_,[l("span",v_,"备忘录("+ne(t.value.length)+")",1),l("button",{class:"btn btn-primary btn-sm",onClick:$},"新建")]),l("div",h_,[(E(!0),D(je,null,ot(t.value,O=>(E(),D("div",{key:O.id,class:et(["memo-item",{active:s.value&&n.value&&n.value.id===O.id}]),onClick:x=>S(O)},[l("div",y_,ne(O.title||"无标题"),1),l("div",g_,ne(Z(O)||"空"),1),l("div",b_,ne(de(O.updated_at)),1)],10,m_))),128)),t.value.length?xe("",!0):(E(),D("div",w_,"暂无备忘"))])]),l("section",__,[s.value?(E(),D(je,{key:0},[$e(l("input",{class:"input title-input","onUpdate:modelValue":X[0]||(X[0]=O=>o.value=O),placeholder:"标题"},null,512),[[Me,o.value]]),$e(l("textarea",{class:"textarea content-textarea","onUpdate:modelValue":X[1]||(X[1]=O=>a.value=O),placeholder:"内容"},null,512),[[Me,a.value]]),l("div",k_,[l("span",x_,[m.value?(E(),D(je,{key:0},[en("有未保存修改")],64)):n.value&&n.value.id?(E(),D(je,{key:1},[en("更新于 "+ne(de(n.value.updated_at)),1)],64)):(E(),D(je,{key:2},[en("新备忘")],64))]),X[4]||(X[4]=l("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(E(),D("button",{key:0,class:"btn btn-sm",onClick:ie},"删除")):xe("",!0),l("button",{class:"btn btn-sm",disabled:!m.value,onClick:re},"放弃修改",8,C_),l("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:se},"保存",8,S_)])],64)):(E(),D("div",E_,"选择左侧备忘,或点击右上角新建"))]),Ee(qn,{open:!!c.value,title:"删除确认",message:c.value?"将删除备忘「"+(c.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:X[2]||(X[2]=O=>c.value=null),onConfirm:T},null,8,["open","message"]),Ee(qn,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:X[3]||(X[3]=O=>f.value=null),onConfirm:I},null,8,["open"])]))}}),T_=Wt($_,[["__scopeId","data-v-74d60dba"]]),P_=["aria-label"],A_={class:"dialog-head"},O_={class:"dialog-title"},M_={class:"dialog-body"},I_={class:"form-grid"},j_={class:"field span2"},D_={class:"field span2"},L_={class:"field span2"},R_={class:"pwd-row"},K_={class:"field span2"},F_={key:0,class:"form-error"},N_={class:"dialog-btns"},V_=Rt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,s=t,o=L(""),a=L(""),c=L(""),f=L(""),v=L(""),y=L(null);function m($){n.open&&$.key==="Escape"&&s("cancel")}ht(()=>n.open,async $=>{var U;$?(o.value=n.initial.system,a.value=n.initial.account,c.value=n.initial.password,f.value=n.initial.remark,v.value="",window.addEventListener("keydown",m),await ss(),(U=y.value)==null||U.focus()):window.removeEventListener("keydown",m)}),pr(()=>window.removeEventListener("keydown",m));function _(){const $="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",U="!@#$%^&*",re=crypto.getRandomValues(new Uint8Array(14));let se="";for(let ie=0;ie<re.length;ie++)se+=$[re[ie]%$.length];se+=U[crypto.getRandomValues(new Uint8Array(1))[0]%U.length],c.value=se,v.value=""}function S(){if(!o.value.trim()||!a.value.trim()||!c.value){v.value="系统名称、账号、密码为必填项";return}s("save",{system:o.value.trim(),account:a.value.trim(),password:c.value,remark:f.value.trim()})}return($,U)=>(E(),Pt(Dr,{to:"body"},[Ee(os,{name:"modal"},{default:fr(()=>[e.open?(E(),D("div",{key:0,class:"mask",onClick:U[6]||(U[6]=sn(re=>s("cancel"),["self"]))},[l("div",{class:"dialog",role:"dialog","aria-label":e.title},[l("div",A_,[l("span",O_,ne(e.title),1),l("button",{class:"icon-btn",title:"关闭",onClick:U[0]||(U[0]=re=>s("cancel"))},[Ee(Xe,{name:"close",size:16})])]),l("div",M_,[l("div",I_,[l("div",j_,[U[7]||(U[7]=l("label",null,"系统名称(必填)",-1)),$e(l("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":U[1]||(U[1]=re=>o.value=re),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Me,o.value]])]),l("div",D_,[U[8]||(U[8]=l("label",null,"账号(必填)",-1)),$e(l("input",{class:"input","onUpdate:modelValue":U[2]||(U[2]=re=>a.value=re),placeholder:"用户名、工号或邮箱"},null,512),[[Me,a.value]])]),l("div",L_,[U[9]||(U[9]=l("label",null,"密码(必填)",-1)),l("div",R_,[$e(l("input",{class:"input","onUpdate:modelValue":U[3]||(U[3]=re=>c.value=re),placeholder:"输入或点击生成"},null,512),[[Me,c.value]]),l("button",{class:"btn btn-sm",onClick:_},"生成")])]),l("div",K_,[U[10]||(U[10]=l("label",null,"备注",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":U[4]||(U[4]=re=>f.value=re),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Me,f.value]])])]),v.value?(E(),D("div",F_,ne(v.value),1)):xe("",!0)]),l("div",N_,[l("button",{class:"btn btn-sm",onClick:U[5]||(U[5]=re=>s("cancel"))},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:S},"保存")])],8,P_)])):xe("",!0)]),_:1})]))}}),B_=Wt(V_,[["__scopeId","data-v-f383b0a6"]]),U_={class:"vault-page"},q_={key:0,class:"empty muted"},H_={key:1,class:"card lock-card"},W_={class:"lock-badge"},z_={key:0,class:"form-error"},G_=["disabled"],Y_={key:0,class:"form-error"},J_=["disabled"],X_={class:"vault-toolbar"},Q_={class:"search-wrap"},Z_={class:"card table-card"},e1={class:"cred-table"},t1={class:"td-system"},n1=["onClick"],r1={class:"pwd-cell"},s1={class:"num pwd-text"},o1=["onClick"],i1=["onClick"],a1={class:"td-remark"},l1={class:"td-ops"},u1={class:"ops"},c1=["onClick"],d1=["onClick"],f1={key:0},p1={class:"muted vault-note num"},v1={class:"dialog pwd-dialog"},h1={class:"dialog-head"},m1={class:"dialog-body"},y1={class:"vp-field"},g1={class:"vp-field"},b1={class:"vp-field"},w1={key:0,class:"form-error"},_1={class:"dialog-btns"},k1=5*60*1e3,x1=Rt({__name:"VaultView",setup(e){const t=L(null),n=L(Eh()),s=L(!1),o=L(""),a=L(""),c=L(""),f=L(""),v=L(""),y=L([]),m=L(""),_=L({}),S=L(!1),$=L(null),U=L({system:"",account:"",password:"",remark:""}),re=L(null),se=L(!1),ie=L(""),T=L(""),I=L(""),Z=L("");async function de(){y.value=await Oh(),_.value={}}let ae=null;function X(){ae!==null&&window.clearTimeout(ae),ae=window.setTimeout(()=>{n.value&&(ri(),n.value=!1,y.value=[],_.value={},Ne("长时间未操作,密码库已自动锁定"))},k1)}function O(){n.value&&X()}pn(async()=>{t.value=await cd(),window.addEventListener("click",O),window.addEventListener("keydown",O),n.value&&X()}),pr(()=>{window.removeEventListener("click",O),window.removeEventListener("keydown",O),ae!==null&&window.clearTimeout(ae)});const x=st(()=>{const Ce=m.value.trim().toLowerCase();return Ce?y.value.filter(ee=>(ee.system+" "+ee.account+" "+(ee.remark||"")).toLowerCase().includes(Ce)):y.value});async function V(){if(!s.value){if(c.value="",!o.value){c.value="请输入主密码";return}if(o.value.length<6){c.value="主密码至少 6 位";return}if(o.value!==a.value){c.value="两次输入的主密码不一致";return}s.value=!0;try{await $h(o.value),o.value="",a.value="",n.value=!0,X(),await de(),Ne("主密码已设置,密码库已解锁")}catch(Ce){c.value=Ce instanceof Error?Ce.message:"设置失败"}s.value=!1}}async function ue(){if(!s.value){if(v.value="",!f.value){v.value="请输入主密码";return}s.value=!0;try{await Th(f.value),f.value="",n.value=!0,X(),await de()}catch(Ce){v.value=Ce instanceof Error?Ce.message:"解锁失败"}s.value=!1}}function W(){ri(),n.value=!1,y.value=[],_.value={},ae!==null&&window.clearTimeout(ae),Ne("密码库已锁定")}async function ke(Ce){const ee=Ce.id;if(_.value[ee]){_.value[ee]=!1;return}try{Ce.passwordPlain=await ma(ee),_.value[ee]=!0}catch(te){Ne(te instanceof Error?te.message:"解密失败")}}async function Te(Ce){try{const ee=await ma(Ce.id);await Ha(ee),Ne("密码已复制")}catch(ee){Ne(ee instanceof Error?ee.message:"复制失败")}}async function Je(Ce){await Ha(Ce.account),Ne("账号已复制")}function Le(){$.value=null,U.value={system:"",account:"",password:"",remark:""},S.value=!0}async function qe(Ce){try{const ee=await ma(Ce.id);$.value=Ce.id,U.value={system:Ce.system,account:Ce.account,password:ee,remark:Ce.remark||""},S.value=!0}catch(ee){Ne(ee instanceof Error?ee.message:"解密失败")}}async function Ke(Ce){const ee=$.value??void 0;await Mh(Ce,ee),S.value=!1,await de(),Ne(ee?"账号已更新":"账号已添加")}async function it(){re.value&&re.value.id&&(await Ih(re.value.id),Ne("账号已删除")),re.value=null,await de()}function Ge(){ie.value="",T.value="",I.value="",Z.value="",se.value=!0}async function Qe(){Z.value="";try{const Ce=await jh(ie.value,T.value);se.value=!1,ie.value="",T.value="",I.value="",Ne("主密码已修改,"+Ce+" 条账号密码已重新加密")}catch(Ce){Z.value=Ce instanceof Error?Ce.message:"修改失败"}}return(Ce,ee)=>(E(),D("div",U_,[t.value===null?(E(),D("div",q_,"加载中")):n.value?(E(),D(je,{key:2},[l("div",X_,[l("div",Q_,[Ee(Xe,{name:"search",size:14,class:"search-icon"}),$e(l("input",{class:"input","onUpdate:modelValue":ee[3]||(ee[3]=te=>m.value=te),placeholder:"搜索系统名称、账号或备注"},null,512),[[Me,m.value]])]),ee[16]||(ee[16]=l("span",{class:"flex1"},null,-1)),l("button",{class:"btn btn-sm",onClick:Ge},"修改主密码"),l("button",{class:"btn btn-sm",onClick:W},"锁定"),l("button",{class:"btn btn-primary btn-sm",onClick:Le},"新增账号")]),l("div",Z_,[l("table",e1,[ee[18]||(ee[18]=l("thead",null,[l("tr",null,[l("th",null,"系统名称"),l("th",null,"账号"),l("th",null,"密码"),l("th",null,"备注"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[(E(!0),D(je,null,ot(x.value,te=>(E(),D("tr",{key:te.id},[l("td",t1,ne(te.system),1),l("td",null,[l("span",{class:"copyable",title:"点击复制账号",onClick:we=>Je(te)},ne(te.account),9,n1)]),l("td",null,[l("div",r1,[l("span",s1,ne(_.value[te.id]?te.passwordPlain:"........"),1),l("button",{class:"btn btn-xs",onClick:we=>ke(te)},ne(_.value[te.id]?"隐藏":"显示"),9,o1),l("button",{class:"btn btn-xs",onClick:we=>Te(te)},"复制",8,i1)])]),l("td",a1,ne(te.remark||"--"),1),l("td",l1,[l("div",u1,[l("button",{class:"btn btn-xs",onClick:we=>qe(te)},"编辑",8,c1),l("button",{class:"btn btn-xs",onClick:we=>re.value=te},"删除",8,d1)])])]))),128)),x.value.length?xe("",!0):(E(),D("tr",f1,[...ee[17]||(ee[17]=[l("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),l("div",p1,"共 "+ne(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):(E(),D("div",H_,[l("div",W_,[Ee(Xe,{name:"lock",size:26})]),t.value===!1?(E(),D(je,{key:0},[ee[12]||(ee[12]=l("div",{class:"lock-title"},"设置主密码",-1)),ee[13]||(ee[13]=l("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":ee[0]||(ee[0]=te=>o.value=te),placeholder:"设置主密码(至少 6 位)",onKeydown:At(V,["enter"])},null,544),[[Me,o.value]]),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":ee[1]||(ee[1]=te=>a.value=te),placeholder:"再次输入主密码",onKeydown:At(V,["enter"])},null,544),[[Me,a.value]]),c.value?(E(),D("div",z_,ne(c.value),1)):xe("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:V},"完成设置并解锁",8,G_)],64)):(E(),D(je,{key:1},[ee[14]||(ee[14]=l("div",{class:"lock-title"},"密码库已锁定",-1)),ee[15]||(ee[15]=l("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":ee[2]||(ee[2]=te=>f.value=te),placeholder:"主密码",onKeydown:At(ue,["enter"])},null,544),[[Me,f.value]]),v.value?(E(),D("div",Y_,ne(v.value),1)):xe("",!0),l("button",{class:"btn btn-primary lock-btn",disabled:s.value,onClick:ue},"解锁",8,J_)],64))])),Ee(B_,{open:S.value,title:$.value?"编辑账号":"新增账号",initial:U.value,onCancel:ee[4]||(ee[4]=te=>S.value=!1),onSave:Ke},null,8,["open","title","initial"]),Ee(qn,{open:!!re.value,title:"删除确认",message:re.value?"将删除系统「"+re.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:ee[5]||(ee[5]=te=>re.value=null),onConfirm:it},null,8,["open","message"]),(E(),Pt(Dr,{to:"body"},[Ee(os,{name:"modal"},{default:fr(()=>[se.value?(E(),D("div",{key:0,class:"mask",onClick:ee[11]||(ee[11]=sn(te=>se.value=!1,["self"]))},[l("div",v1,[l("div",h1,[ee[19]||(ee[19]=l("span",{class:"dialog-title"},"修改主密码",-1)),l("button",{class:"icon-btn",title:"关闭",onClick:ee[6]||(ee[6]=te=>se.value=!1)},[Ee(Xe,{name:"close",size:16})])]),l("div",m1,[l("div",y1,[ee[20]||(ee[20]=l("label",null,"旧主密码",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":ee[7]||(ee[7]=te=>ie.value=te)},null,512),[[Me,ie.value]])]),l("div",g1,[ee[21]||(ee[21]=l("label",null,"新主密码(至少 6 位)",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":ee[8]||(ee[8]=te=>T.value=te)},null,512),[[Me,T.value]])]),l("div",b1,[ee[22]||(ee[22]=l("label",null,"确认新主密码",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":ee[9]||(ee[9]=te=>I.value=te)},null,512),[[Me,I.value]])]),Z.value?(E(),D("div",w1,ne(Z.value),1)):xe("",!0),ee[23]||(ee[23]=l("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),l("div",_1,[l("button",{class:"btn btn-sm",onClick:ee[10]||(ee[10]=te=>se.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",onClick:Qe},"确认修改")])])])):xe("",!0)]),_:1})]))]))}}),C1=Wt(x1,[["__scopeId","data-v-c2db283d"]]);function S1(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Bu(e,t){const s="\uFEFF"+t.map(f=>f.map(S1).join(",")).join(`\r
`);if(rs.isNativePlatform()){const{downloadText:f}=await Pd(async()=>{const{downloadText:v}=await Promise.resolve().then(()=>pb);return{downloadText:v}},void 0,import.meta.url);return f(e,s)}const o=new Blob([s],{type:"text/csv;charset=utf-8"}),a=URL.createObjectURL(o),c=document.createElement("a");return c.href=a,c.download=e,c.click(),window.setTimeout(()=>URL.revokeObjectURL(a),1e4),""}const E1={class:"settings"},$1={class:"card section"},T1={class:"muted acc-line"},P1={class:"ai-grid"},A1={class:"rule-item"},O1={class:"rule-item"},M1={class:"rule-item"},I1={key:0,class:"form-error"},j1={class:"rule-save"},D1={class:"card section"},L1={class:"rule-grid"},R1={class:"rule-item"},K1={class:"rule-item"},F1={class:"rule-item"},N1={class:"rule-item"},V1={class:"rule-item"},B1={class:"card section"},U1={class:"proj-add"},q1={key:0,class:"muted proj-tip"},H1=["onKeydown"],W1=["onClick"],z1=["onClick"],G1=["onClick"],Y1={key:1,class:"muted"},J1={class:"card section"},X1={class:"card section"},Q1={class:"muted acc-line"},Z1={class:"rule-item"},e0={class:"rule-save"},t0=["disabled"],n0={key:0,class:"muted acc-line"},r0={key:1,class:"form-error"},s0={key:2,class:"form-error"},o0={class:"card section"},i0={class:"ai-grid"},a0={class:"rule-item"},l0={class:"rule-item"},u0={class:"rule-item"},c0={class:"card section"},d0={class:"backup-row"},f0={key:0,class:"import-error"},p0=Rt({__name:"SettingsView",setup(e){var b;const t=L({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=L([]),s=L(""),o=L(""),a=L(""),c=L(""),f=L(""),v=L(""),y=L(null),m=L(""),_=L(null),S=L(null),$=L(""),U=L(((b=Vs())==null?void 0:b.username)||""),re=L(""),se=L(""),ie=L(""),T=L(""),I=L(!1),Z="0.3.0",de=L(""),ae=L(""),X=L(""),O=L(""),x=L(""),V=L(!1),ue=L("");async function W(){var g;de.value=await Gh(),ae.value=((g=gn())==null?void 0:g.username)||"",ue.value=await Zh(),x.value=Xr.value}ht(Xr,g=>{x.value=g});async function ke(){await Lh(de.value.trim()),Ne("同步地址已保存")}async function Te(){O.value="";try{await wd(),Ne("云端绑定已重建")}catch(g){O.value=g instanceof Error?g.message:"绑定失败"}}async function Je(){if(!V.value){O.value="",x.value=Xr.value,V.value=!0;try{await ke();const g=await Va();ue.value=g.at,X.value="推送 "+g.pushed+" 条 · 拉取 "+g.pulled+" 条 · 删除 "+g.removed+" 条",x.value="",Ne("同步完成")}catch(g){O.value=g instanceof Error?g.message:"同步失败"}V.value=!1}}async function Le(){if(T.value="",se.value!==ie.value){T.value="两次输入的新密码不一致";return}try{await Wh(re.value,se.value),re.value="",se.value="",ie.value="",Ne("登录密码已修改")}catch(g){T.value=g instanceof Error?g.message:"修改失败"}}async function qe(){await zh(),window.location.reload()}async function Ke(){t.value=await Rr(),n.value=await Us(!0),a.value=(await vl()).join(`
`),c.value=await gt("ai_base_url",""),f.value=await gt("ai_api_key",""),v.value=await gt("ai_model",""),await W()}async function it(){await Lt("ai_base_url",c.value.trim()),await Lt("ai_api_key",f.value.trim()),await Lt("ai_model",v.value.trim()),Ne("AI 配置已保存")}async function Ge(){const g=xt(),C=await Promise.all([Si("2000-01-01",g),Us(!0)]),Y=C[0],R=C[1],le=new Map(R.map(ce=>[ce.id,ce.name])),ge=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const ce of Y)ge.push([ce.date,Zo(ce.category),ce.project_id&&le.get(ce.project_id)||"",ce.content,ce.minutes==null?"":ce.minutes,ce.is_milestone?"是":"",ce.needs_followup?"是":"",ce.takeaway||"",ce.remark||""]);const me=await Bu("工作记录_"+g.replace(/-/g,"")+".csv",ge);Ne(me?"CSV 已导出到:"+me:"CSV 已导出到系统下载目录")}async function Qe(){const g=xt(),C=await Promise.all([Rr(),Ci("2000-01-01",g)]),Y=C[0],R=C[1],le=["周日","周一","周二","周三","周四","周五","周六"],ge=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const ce of R){const z=Ys(ce,ce.date,Y,ce.date===g);ge.push([ce.date,le[is(ce.date).getDay()],z.label,ce.clock_in_at?Un(ce.clock_in_at):"",ce.clock_out_at?Un(ce.clock_out_at):"",ce.location||"",ce.kind==="makeup"?"补卡":ce.kind==="leave"?"休假":"正常",ce.note||""])}const me=await Bu("考勤记录_"+g.replace(/-/g,"")+".csv",ge);Ne(me?"CSV 已导出到:"+me:"CSV 已导出到系统下载目录")}pn(Ke);async function Ce(){await Lt("work_start",t.value.work_start),await Lt("work_end",t.value.work_end),await Lt("grace_minutes",String(t.value.grace_minutes)),await Lt("lunch_minutes",String(t.value.lunch_minutes)),await Lt("remind_weekly",t.value.remind_weekly),Ne("打卡规则已保存")}async function ee(){await Ed(a.value.split(`
`)),Ne("常用地点已保存")}async function te(){const g=s.value.trim();if(g){try{await mm(g),o.value="",s.value=""}catch{o.value="项目名已存在"}await Ke()}}function we(g){y.value=g.id,m.value=g.name}async function Fe(g){const C=m.value.trim();if(C)try{await ym(g.id,C),o.value=""}catch{o.value="项目名已存在"}y.value=null,await Ke()}async function dt(g){await gm(g.id,g.archived!==1),await Ke()}async function Kt(){try{const g=await Bm(),C=await ml("实习日志备份_"+xt().replace(/-/g,"")+".json",g);Ne(C?"备份已导出到:"+C:"备份已导出到系统下载目录")}catch(g){Ne("导出失败:"+(g instanceof Error?g.message:String(g)))}}function Ot(g){const C=g.target,Y=C.files&&C.files[0];if($.value="",!Y)return;const R=Y.name;Y.text().then(le=>{S.value={name:R,text:le}}),C.value=""}async function Ie(){if(S.value)try{await Um(S.value.text),S.value=null,$.value="",await Ke(),Ne("数据导入完成")}catch(g){S.value=null,$.value=g instanceof Error?g.message:"导入失败"}}return(g,C)=>(E(),D("div",E1,[l("div",$1,[C[23]||(C[23]=l("div",{class:"section-title"},"账号与隐私",-1)),l("div",T1,"版本 v"+ne(Ut(Z))+" · 当前用户:"+ne(U.value)+" · 每位用户独立数据库隔离存储于本机 · 登录密码仅保存 PBKDF2 哈希",1),l("div",P1,[l("div",A1,[C[20]||(C[20]=l("label",null,"旧登录密码",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":C[0]||(C[0]=Y=>re.value=Y)},null,512),[[Me,re.value]])]),l("div",O1,[C[21]||(C[21]=l("label",null,"新登录密码(至少 6 位)",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":C[1]||(C[1]=Y=>se.value=Y)},null,512),[[Me,se.value]])]),l("div",M1,[C[22]||(C[22]=l("label",null,"确认新登录密码",-1)),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":C[2]||(C[2]=Y=>ie.value=Y)},null,512),[[Me,ie.value]])])]),T.value?(E(),D("div",I1,ne(T.value),1)):xe("",!0),l("div",j1,[l("button",{class:"btn btn-primary btn-sm",onClick:Le},"修改登录密码"),l("button",{class:"btn btn-sm btn-danger",onClick:C[3]||(C[3]=Y=>I.value=!0)},"删除此用户及全部数据")])]),l("div",D1,[C[30]||(C[30]=l("div",{class:"section-title"},"打卡规则",-1)),l("div",L1,[l("div",R1,[C[24]||(C[24]=l("label",null,"上班时间",-1)),$e(l("input",{type:"time",class:"input","onUpdate:modelValue":C[4]||(C[4]=Y=>t.value.work_start=Y)},null,512),[[Me,t.value.work_start]])]),l("div",K1,[C[25]||(C[25]=l("label",null,"下班时间",-1)),$e(l("input",{type:"time",class:"input","onUpdate:modelValue":C[5]||(C[5]=Y=>t.value.work_end=Y)},null,512),[[Me,t.value.work_end]])]),l("div",F1,[C[26]||(C[26]=l("label",null,"迟到宽限(分钟)",-1)),$e(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":C[6]||(C[6]=Y=>t.value.grace_minutes=Y)},null,512),[[Me,t.value.grace_minutes,void 0,{number:!0}]])]),l("div",N1,[C[27]||(C[27]=l("label",null,"午休扣除(分钟)",-1)),$e(l("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":C[7]||(C[7]=Y=>t.value.lunch_minutes=Y)},null,512),[[Me,t.value.lunch_minutes,void 0,{number:!0}]])]),l("div",V1,[C[29]||(C[29]=l("label",null,"周记提醒",-1)),$e(l("select",{class:"select","onUpdate:modelValue":C[8]||(C[8]=Y=>t.value.remind_weekly=Y)},[...C[28]||(C[28]=[l("option",{value:"friday"},"每周五提醒",-1),l("option",{value:"off"},"关闭",-1)])],512),[[Vn,t.value.remind_weekly]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:Ce},"保存规则")])]),l("div",B1,[C[31]||(C[31]=l("div",{class:"section-title"},"项目管理",-1)),l("div",U1,[$e(l("input",{class:"input","onUpdate:modelValue":C[9]||(C[9]=Y=>s.value=Y),placeholder:"新项目名称",onKeydown:At(te,["enter"])},null,544),[[Me,s.value]]),l("button",{class:"btn btn-sm",onClick:te},"添加")]),o.value?(E(),D("div",q1,ne(o.value),1)):xe("",!0),(E(!0),D(je,null,ot(n.value,Y=>(E(),D("div",{key:Y.id,class:"proj-row"},[y.value===Y.id?(E(),D(je,{key:0},[$e(l("input",{class:"input","onUpdate:modelValue":C[10]||(C[10]=R=>m.value=R),onKeydown:At(R=>Fe(Y),["enter"])},null,40,H1),[[Me,m.value]]),l("button",{class:"btn btn-sm",onClick:R=>Fe(Y)},"保存",8,W1),l("button",{class:"btn btn-sm",onClick:C[11]||(C[11]=R=>y.value=null)},"取消")],64)):(E(),D(je,{key:1},[l("span",{class:et(["proj-name",{archived:Y.archived===1}])},ne(Y.name),3),l("button",{class:"icon-btn",title:"重命名",onClick:R=>we(Y)},[Ee(Xe,{name:"edit",size:14})],8,z1),l("button",{class:"btn btn-sm",onClick:R=>dt(Y)},ne(Y.archived===1?"恢复":"归档"),9,G1)],64))]))),128)),n.value.length?xe("",!0):(E(),D("div",Y1,"暂无项目,先添加一个"))]),l("div",J1,[C[33]||(C[33]=l("div",{class:"section-title"},"常用地点",-1)),$e(l("textarea",{class:"textarea","onUpdate:modelValue":C[12]||(C[12]=Y=>a.value=Y),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Me,a.value]]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:ee},"保存地点"),C[32]||(C[32]=l("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),l("div",X1,[C[35]||(C[35]=l("div",{class:"section-title"},"多端数据同步",-1)),l("div",Q1,"云端账号:"+ne(ae.value||"未绑定")+" · 数据仅保存在服务器,本机只是实时缓存(变更 ~3 秒推上云端 + 其他端秒级自动刷新);密码库同步密文,主密码永不出本机",1),l("div",Z1,[C[34]||(C[34]=l("label",null,"同步服务地址(默认即可)",-1)),$e(l("input",{class:"input","onUpdate:modelValue":C[13]||(C[13]=Y=>de.value=Y),placeholder:"https://daywk.linyux.cn"},null,512),[[Me,de.value]])]),l("div",e0,[l("button",{class:"btn btn-sm",onClick:ke},"保存地址"),l("button",{class:"btn btn-primary btn-sm",disabled:V.value,onClick:Je},ne(V.value?"同步中":"立即同步"),9,t0),l("button",{class:"btn btn-sm",onClick:Te},"重建云端绑定")]),X.value?(E(),D("div",n0,"上次同步:"+ne(ue.value||"--")+" · "+ne(X.value),1)):xe("",!0),O.value?(E(),D("div",r0,ne(O.value),1)):xe("",!0),x.value?(E(),D("div",s0,"最近自动同步失败:"+ne(x.value)+"(可点「立即同步」重试)",1)):xe("",!0)]),l("div",o0,[C[40]||(C[40]=l("div",{class:"section-title"},"AI 润色配置(可选)",-1)),l("div",i0,[l("div",a0,[C[36]||(C[36]=l("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),$e(l("input",{class:"input","onUpdate:modelValue":C[14]||(C[14]=Y=>c.value=Y),placeholder:"https://api.example.com/v1"},null,512),[[Me,c.value]])]),l("div",l0,[C[37]||(C[37]=l("label",null,"API Key",-1)),$e(l("input",{class:"input","onUpdate:modelValue":C[15]||(C[15]=Y=>f.value=Y),placeholder:"sk-..."},null,512),[[Me,f.value]])]),l("div",u0,[C[38]||(C[38]=l("label",null,"模型名称",-1)),$e(l("input",{class:"input","onUpdate:modelValue":C[16]||(C[16]=Y=>v.value=Y),placeholder:"如:deepseek-chat"},null,512),[[Me,v.value]])])]),l("div",{class:"rule-save"},[l("button",{class:"btn btn-primary btn-sm",onClick:it},"保存 AI 配置"),C[39]||(C[39]=l("span",{class:"muted loc-note"},"配置仅保存在本机浏览器;总结页可用 AI 润色草稿,需服务端允许浏览器跨域",-1))])]),l("div",c0,[C[41]||(C[41]=l("div",{class:"section-title"},"数据备份",-1)),l("div",d0,[l("button",{class:"btn btn-sm",onClick:Kt},"导出 JSON 备份"),l("button",{class:"btn btn-sm",onClick:C[17]||(C[17]=Y=>{var R;return(R=_.value)==null?void 0:R.click()})},"导入 JSON 备份"),l("button",{class:"btn btn-sm",onClick:Ge},"导出工作记录 CSV"),l("button",{class:"btn btn-sm",onClick:Qe},"导出考勤 CSV"),l("input",{ref_key:"fileInput",ref:_,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Ot},null,544)]),$.value?(E(),D("div",f0,ne($.value),1)):xe("",!0),C[42]||(C[42]=l("div",{class:"muted backup-note"},"数据保存在浏览器 IndexedDB 中,建议定期导出 JSON 备份。",-1))]),Ee(qn,{open:!!S.value,title:"导入确认",message:S.value?"将从文件「"+S.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:C[18]||(C[18]=Y=>S.value=null),onConfirm:Ie},null,8,["open","message"]),Ee(qn,{open:I.value,title:"删除用户确认",message:"将永久删除云端账号「"+U.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:C[19]||(C[19]=Y=>I.value=!1),onConfirm:qe},null,8,["open","message"])]))}}),v0=Wt(p0,[["__scopeId","data-v-cea34561"]]),h0={class:"admin-page"},m0={class:"card sec"},y0={class:"toolbar"},g0={key:0,class:"form-error"},b0={class:"card table-card admin-table-card"},w0={class:"admin-table"},_0={class:"td-name","data-label":"用户名"},k0={"data-label":"角色"},x0={key:0,class:"role-badge"},C0={key:1,class:"muted"},S0={class:"muted num","data-label":"创建时间"},E0={class:"muted num","data-label":"数据量"},$0={class:"td-ops"},T0={class:"ops"},P0=["onClick"],A0=["disabled","onClick"],O0={key:0},M0={key:0,class:"muted load-line"},I0={class:"dialog create-dialog",role:"dialog","aria-label":"新增用户"},j0={class:"dialog-head"},D0={class:"dialog-body"},L0={class:"form-row"},R0={class:"form-row"},K0={class:"form-row"},F0={key:0,class:"form-error"},N0={class:"dialog-btns"},V0=["disabled"],B0={class:"dialog create-dialog",role:"dialog","aria-label":"重置密码"},U0={class:"dialog-head"},q0={class:"dialog-title"},H0={class:"dialog-body"},W0={class:"form-row"},z0={key:0,class:"form-error"},G0={class:"dialog-btns"},Y0=["disabled"],J0=Rt({__name:"UserAdminView",setup(e){const t=L([]),n=L(""),s=L(!0),o=L("");async function a(x,V){const ue=await vr();let W=xi();if(!W){const Te=gn(),Je=await fetch(ue+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Te==null?void 0:Te.username,password:Te==null?void 0:Te.password})});if(Je.ok){const Le=await Je.json();W=String(Le.token||""),Ns(W)}}const ke=await fetch(ue+x,{method:V?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+W},body:V?JSON.stringify(V):void 0});if(ke.status===401&&gn()){const Te=gn(),Je=await fetch(ue+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Te==null?void 0:Te.username,password:Te==null?void 0:Te.password})});if(Je.ok){const Le=await Je.json();W=String(Le.token||""),Ns(W);const qe=await fetch(ue+x,{method:V?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+W},body:V?JSON.stringify(V):void 0});return{ok:qe.ok,status:qe.status,data:await qe.json().catch(()=>({}))}}}return{ok:ke.ok,status:ke.status,data:await ke.json().catch(()=>({}))}}async function c(){s.value=!0,o.value="";const x=await a("/api/admin/users");if(!x.ok){s.value=!1,o.value=x.data&&x.data.error||"加载失败 "+x.status;return}t.value=x.data.users||[],n.value=x.data.me||"",s.value=!1}function f(x){return x<=0?"--":x<1024?x+" B":x<1024*1024?(x/1024).toFixed(1)+" KB":(x/1024/1024).toFixed(2)+" MB"}function v(x){return(x||"").slice(0,10)}const y=L(!1),m=L(""),_=L(""),S=L(""),$=L(""),U=L(!1);function re(){y.value=!0,$.value="",m.value="",_.value="",S.value=""}async function se(){const x=m.value.trim();if(_.value!==S.value){$.value="两次输入的密码不一致";return}if(_.value.length<6){$.value="密码至少 6 位";return}U.value=!0;const V=await a("/api/admin/users/create",{username:x,password:_.value});if(U.value=!1,!V.ok){$.value=V.data&&V.data.error||"创建失败 "+V.status;return}Ne("用户「"+x+"」已创建"),y.value=!1,await c()}const ie=L(null),T=L(""),I=L(""),Z=L(!1);function de(x){ie.value=x,T.value="",I.value=""}async function ae(){if(!ie.value)return;if(T.value.length<6){I.value="密码至少 6 位";return}Z.value=!0;const x=await a("/api/admin/users/password",{userId:ie.value.id,newPassword:T.value});if(Z.value=!1,!x.ok){I.value=x.data&&x.data.error||"重置失败 "+x.status;return}Ne("已重置「"+ie.value.username+"」的登录密码"),ie.value=null}const X=L(null);async function O(){if(!X.value)return;const x=await a("/api/admin/users/delete",{userId:X.value.id});if(!x.ok){X.value=null,Ne(x.data&&x.data.error||"删除失败");return}Ne("已删除账号「"+X.value.username+"」及其全部云端数据"),X.value=null,await c()}return pn(c),(x,V)=>(E(),D("div",h0,[l("div",m0,[l("div",y0,[V[12]||(V[12]=l("div",{class:"head-wrap"},[l("div",{class:"sec-title"},"用户管理"),l("div",{class:"muted head-sub"},"云端账号统一管理 · 管理员:xionglin")],-1)),l("button",{class:"btn btn-primary btn-sm",onClick:re},[Ee(Xe,{name:"plus",size:14}),V[11]||(V[11]=en(" 新增用户 ",-1))])]),o.value?(E(),D("div",g0,ne(o.value),1)):xe("",!0)]),l("div",b0,[l("table",w0,[V[14]||(V[14]=l("thead",null,[l("tr",null,[l("th",null,"用户名"),l("th",null,"角色"),l("th",null,"创建时间"),l("th",null,"数据量"),l("th",{class:"th-ops"},"操作")])],-1)),l("tbody",null,[(E(!0),D(je,null,ot(t.value,ue=>(E(),D("tr",{key:ue.id},[l("td",_0,ne(ue.username),1),l("td",k0,[ue.role==="admin"?(E(),D("span",x0,"管理员")):(E(),D("span",C0,"普通用户"))]),l("td",S0,ne(v(ue.created_at)),1),l("td",E0,ne(f(ue.data_bytes)),1),l("td",$0,[l("div",T0,[l("button",{class:"btn btn-xs",onClick:W=>de(ue)},"重置密码",8,P0),l("button",{class:"btn btn-xs btn-danger",disabled:ue.id===n.value,onClick:W=>X.value=ue},"删除",8,A0)])])]))),128)),!s.value&&!t.value.length?(E(),D("tr",O0,[...V[13]||(V[13]=[l("td",{colspan:"5",class:"empty muted"},"加载结果为空",-1)])])):xe("",!0)])]),s.value?(E(),D("div",M0,"加载中")):xe("",!0)]),V[20]||(V[20]=l("div",{class:"muted admin-note"},"重置密码立即生效;删除账号将移除其全部云端数据,不可恢复。自己的账号不能删除。",-1)),(E(),Pt(Dr,{to:"body"},[y.value?(E(),D("div",{key:0,class:"fixed-mask",onClick:V[5]||(V[5]=sn(ue=>y.value=!1,["self"]))},[l("div",I0,[l("div",j0,[V[15]||(V[15]=l("span",{class:"dialog-title"},"新增用户",-1)),l("button",{class:"icon-btn",onClick:V[0]||(V[0]=ue=>y.value=!1)},[Ee(Xe,{name:"close",size:16})])]),l("div",D0,[l("div",L0,[V[16]||(V[16]=l("label",null,"用户名(2 到 20 个字符)",-1)),$e(l("input",{class:"input","onUpdate:modelValue":V[1]||(V[1]=ue=>m.value=ue),placeholder:"如:xiaowang"},null,512),[[Me,m.value]])]),l("div",R0,[V[17]||(V[17]=l("label",null,"初始登录密码(至少 6 位)",-1)),$e(l("input",{class:"input",type:"password","onUpdate:modelValue":V[2]||(V[2]=ue=>_.value=ue),placeholder:"转发给使用者,登录后可自行修改"},null,512),[[Me,_.value]])]),l("div",K0,[V[18]||(V[18]=l("label",null,"确认密码",-1)),$e(l("input",{class:"input",type:"password","onUpdate:modelValue":V[3]||(V[3]=ue=>S.value=ue),onKeydown:At(se,["enter"])},null,544),[[Me,S.value]])]),$.value?(E(),D("div",F0,ne($.value),1)):xe("",!0)]),l("div",N0,[l("button",{class:"btn btn-sm",onClick:V[4]||(V[4]=ue=>y.value=!1)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:U.value||!m.value.trim(),onClick:se},ne(U.value?"创建中":"创建"),9,V0)])])])):xe("",!0)])),(E(),Pt(Dr,{to:"body"},[ie.value?(E(),D("div",{key:0,class:"fixed-mask",onClick:V[9]||(V[9]=sn(ue=>ie.value=null,["self"]))},[l("div",B0,[l("div",U0,[l("span",q0,"重置「"+ne(ie.value.username)+"」的登录密码",1),l("button",{class:"icon-btn",onClick:V[6]||(V[6]=ue=>ie.value=null)},[Ee(Xe,{name:"close",size:16})])]),l("div",H0,[l("div",W0,[V[19]||(V[19]=l("label",null,"新登录密码(至少 6 位)",-1)),$e(l("input",{class:"input",type:"password","onUpdate:modelValue":V[7]||(V[7]=ue=>T.value=ue),onKeydown:At(ae,["enter"])},null,544),[[Me,T.value]])]),I.value?(E(),D("div",z0,ne(I.value),1)):xe("",!0)]),l("div",G0,[l("button",{class:"btn btn-sm",onClick:V[8]||(V[8]=ue=>ie.value=null)},"取消"),l("button",{class:"btn btn-primary btn-sm",disabled:Z.value,onClick:ae},ne(Z.value?"提交中":"重置"),9,Y0)])])])):xe("",!0)])),Ee(qn,{open:!!X.value,title:"删除用户确认",message:X.value?"将永久删除云端账号「"+X.value.username+"」及其服务器上的全部数据,不可恢复。请确认。":"","confirm-text":"永久删除",danger:"",onCancel:V[10]||(V[10]=ue=>X.value=null),onConfirm:O},null,8,["open","message"])]))}}),X0=Wt(J0,[["__scopeId","data-v-06be07ff"]]),Q0={class:"login-page"},Z0={class:"card login-card"},ek={class:"login-brand"},tk={class:"brand-icon"},nk={class:"seg"},rk=["placeholder"],sk={key:1,class:"form-error"},ok=["disabled"],ik=Rt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,s=L("login"),o=L(""),a=L(""),c=L(""),f=L(""),v=L(!1);function y(_){s.value=_,f.value="",c.value=""}async function m(){if(!v.value){f.value="",v.value=!0;try{let _;if(s.value==="login")_=await Vh(o.value,a.value);else{if(a.value.length<6){f.value="登录密码至少 6 位",v.value=!1;return}if(a.value!==c.value){f.value="两次输入的密码不一致",v.value=!1;return}_=await Bh(o.value,a.value)}n("login",_)}catch(_){f.value=_ instanceof Error?_.message:"操作失败"}v.value=!1}}return(_,S)=>(E(),D("div",Q0,[l("div",Z0,[l("div",ek,[l("div",tk,[Ee(Xe,{name:"calendar",size:22})]),S[5]||(S[5]=l("div",{class:"login-title"},"实习工作日志",-1)),S[6]||(S[6]=l("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),S[7]||(S[7]=l("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),l("div",nk,[l("button",{class:et(["seg-btn",{active:s.value==="login"}]),onClick:S[0]||(S[0]=$=>y("login"))},"登录",2),l("button",{class:et(["seg-btn",{active:s.value==="create"}]),onClick:S[1]||(S[1]=$=>y("create"))},"创建用户",2)]),$e(l("input",{class:"input","onUpdate:modelValue":S[2]||(S[2]=$=>o.value=$),placeholder:"用户名(2 到 20 个字符)",onKeydown:At(m,["enter"])},null,544),[[Me,o.value]]),$e(l("input",{type:"password",class:"input","onUpdate:modelValue":S[3]||(S[3]=$=>a.value=$),placeholder:s.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:At(m,["enter"])},null,40,rk),[[Me,a.value]]),s.value==="create"?$e((E(),D("input",{key:0,type:"password",class:"input","onUpdate:modelValue":S[4]||(S[4]=$=>c.value=$),placeholder:"再次输入密码",onKeydown:At(m,["enter"])},null,544)),[[Me,c.value]]):xe("",!0),f.value?(E(),D("div",sk,ne(f.value),1)):xe("",!0),l("button",{class:"btn btn-primary login-btn",disabled:v.value,onClick:m},ne(s.value==="login"?"登录":"创建并进入"),9,ok),S[8]||(S[8]=l("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),ak=Wt(ik,[["__scopeId","data-v-bf714afa"]]),lk={key:1,class:"app"},uk={class:"side"},ck=["data-tip","onClick"],dk={class:"main"},fk={class:"topbar"},pk={class:"title"},vk={class:"gsearch"},hk={key:0,class:"gs-panel"},mk={key:0,class:"gs-group muted"},yk=["onMousedown"],gk={class:"tag"},bk={class:"gs-text"},wk={class:"muted num gs-date"},_k={key:1,class:"gs-group muted"},kk=["onMousedown"],xk={class:"gs-text"},Ck={class:"muted gs-sub"},Sk={key:1,class:"gs-empty muted"},Ek={class:"topbar-actions"},$k={class:"user-chip num mobile-hide"},Tk=["disabled"],Pk={class:"num"},Ak={class:"content"},Ok={class:"content-inner"},Mk={class:"tabbar"},Ik=["onClick"],jk={class:"sheet-user num"},Dk=["onClick"],Lk={class:"sheet-name"},Rk={class:"msw"},Kk={class:"msw-bar"},Fk={class:"msw-results"},Nk={key:0,class:"gs-group muted"},Vk=["onMousedown"],Bk={class:"tag"},Uk={class:"gs-text"},qk={class:"muted num gs-date"},Hk={key:1,class:"gs-group muted"},Wk=["onMousedown"],zk={class:"gs-text"},Gk={class:"muted gs-sub"},Yk={key:1,class:"gs-empty muted"},Jk={class:"toast-wrap"},Xk=Rt({__name:"App",setup(e){const t=Hm(),n=L(Vs());async function s(b){n.value=b,oi(b.userId),location.hash="#/calendar",de.value="calendar",await te(),await Ie(),c();try{await wd(),await Zr()}catch{}Ne("欢迎,"+b.username);const g=sessionStorage.getItem("dsh_migrate_toast");g&&(sessionStorage.removeItem("dsh_migrate_toast"),Ne("已迁移原有数据 "+g+" 条"))}async function o(){Le.value=!1,Te.value=!1,sm(),a!==null&&(window.clearInterval(a),a=null),await qh(),n.value=null,de.value="calendar",location.hash="#/calendar",Ne("已退出登录")}let a=null;function c(){rm(),a!==null&&window.clearInterval(a),a=window.setInterval(()=>{Zr()},60*1e3),Zr()}const f=L(null),v=L(""),y=L(!1),m=L({logs:[],memos:[]});let _=null;const S=st(()=>!!(m.value.logs.length||m.value.memos.length));function $(){_&&window.clearTimeout(_);const b=v.value;_=window.setTimeout(async()=>{const g=b.trim();if(!g){m.value={logs:[],memos:[]};return}const C=await Promise.all([Dm(g,8),Lm(g,4)]);m.value={logs:C[0],memos:C[1]}},200)}function U(){v.value="",m.value={logs:[],memos:[]},y.value=!1}function re(b){Fa.value=b.date,ae("calendar"),U()}function se(b){Na.value=b.id,ae("memo"),U()}function ie(){window.setTimeout(()=>{y.value=!1},150)}function T(b){var g;(b.ctrlKey||b.metaKey)&&b.key.toLowerCase()==="k"&&(b.preventDefault(),(g=f.value)==null||g.focus())}const I=[{key:"calendar",name:"日历",icon:"calendar"},{key:"today",name:"详情",icon:"edit"},{key:"stats",name:"统计",icon:"chart"},{key:"report",name:"总结",icon:"export"},{key:"ledger",name:"记账",icon:"wallet"},{key:"memo",name:"备忘录",icon:"memo"},{key:"vault",name:"密码库",icon:"lock"},{key:"settings",name:"设置",icon:"settings"},{key:"admin",name:"用户管理",icon:"shield"}];function Z(){var g;const b=(location.hash||"").replace("#/","");return!I.some(C=>C.key===b)||b==="admin"&&(((g=Vs())==null?void 0:g.username)||"")!=="xionglin"?"calendar":b}const de=L(Z());window.addEventListener("hashchange",()=>{de.value=Z()});function ae(b){location.hash="#/"+b}const X=st(()=>I.find(b=>b.key===de.value)||I[0]),O=st(()=>{var b;return(((b=n.value)==null?void 0:b.username)||"")==="xionglin"}),x=st(()=>O.value?I:I.filter(b=>b.key!=="admin")),V=st(()=>{const b=I.filter(g=>!W.includes(g.key));return O.value?b:b.filter(g=>g.key!=="admin")}),ue=st(()=>V.value.some(b=>b.key===de.value));ht([O,de],()=>{de.value==="admin"&&!O.value&&ae("calendar")},{immediate:!0});const W=["calendar","today","ledger","memo"],ke=I.filter(b=>W.includes(b.key)),Te=L(!1);function Je(b){Te.value=!1,ae(b)}const Le=L(!1),qe=L(null);function Ke(){Le.value=!0,window.setTimeout(()=>{var b;return(b=qe.value)==null?void 0:b.focus()},60)}function it(b){re(b),Le.value=!1}function Ge(b){se(b),Le.value=!1}const Qe=L(xt()),Ce=L(void 0),ee=L(!1);async function te(){if(Ce.value=await bn(Qe.value),ee.value=!1,new Date().getHours()<4){const g=await bn(Nn(Qe.value,-1));ee.value=!!(g&&g.clock_in_at&&!g.clock_out_at)}}const we=st(()=>{const b=Ce.value;return b&&b.clock_in_at&&!b.clock_out_at?!0:ee.value&&!(b&&b.clock_in_at)}),Fe=st(()=>{const b=Ce.value;return!!(b&&b.clock_in_at&&b.clock_out_at)}),dt=st(()=>{const b=Ce.value;return we.value?"下班打卡":Fe.value?"已打卡 "+Un(b==null?void 0:b.clock_in_at)+" - "+Un(b==null?void 0:b.clock_out_at):"上班打卡"});async function Kt(){if(we.value)try{await wm()}catch{}else await $d(Qe.value);await te(),rr()}ht(Gs,()=>{n.value&&te()});const Ot=L(!1);async function Ie(){if((await Rr()).remind_weekly==="off"){Ot.value=!1;return}const g=new Date().getDay();if(g===5||g===6||g===0){const C=await hl(Ps(Qe.value));Ot.value=!C||!C.highlights&&!C.challenges&&!C.plan_next}else Ot.value=!1}return pn(async()=>{window.addEventListener("keydown",T),n.value&&(oi(n.value.userId),await te(),await Ie(),c())}),(b,g)=>{var C,Y;return n.value?(E(),D("div",lk,[l("nav",uk,[(E(!0),D(je,null,ot(x.value,R=>(E(),D("button",{key:R.key,class:et(["nav-btn",{active:de.value===R.key}]),"data-tip":R.name,onClick:le=>ae(R.key)},[Ee(Xe,{name:R.icon,size:18},null,8,["name"])],10,ck))),128))]),l("div",dk,[l("header",fk,[l("span",pk,ne(X.value.name),1),l("button",{class:"mob-search-btn",title:"搜索",onClick:Ke},[Ee(Xe,{name:"search",size:16})]),l("div",vk,[Ee(Xe,{name:"search",size:14,class:"gs-icon"}),$e(l("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":g[0]||(g[0]=R=>v.value=R),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:$,onFocus:g[1]||(g[1]=R=>y.value=!0),onBlur:ie,onKeydown:At(U,["esc"])},null,544),[[Me,v.value]]),y.value&&v.value.trim()?(E(),D("div",hk,[S.value?(E(),D(je,{key:0},[m.value.logs.length?(E(),D("div",mk,"工作记录")):xe("",!0),(E(!0),D(je,null,ot(m.value.logs,R=>(E(),D("div",{key:"l"+R.id,class:"gs-item",onMousedown:sn(le=>re(R),["prevent"])},[l("span",gk,ne(Ut(Zo)(R.category)),1),l("span",bk,ne(R.content),1),l("span",wk,ne(R.date),1)],40,yk))),128)),m.value.memos.length?(E(),D("div",_k,"备忘录")):xe("",!0),(E(!0),D(je,null,ot(m.value.memos,R=>(E(),D("div",{key:"m"+R.id,class:"gs-item",onMousedown:sn(le=>se(R),["prevent"])},[l("span",xk,ne(R.title||"无标题"),1),l("span",Ck,ne(R.content),1)],40,kk))),128))],64)):(E(),D("div",Sk,"无匹配结果"))])):xe("",!0)]),g[12]||(g[12]=l("span",{class:"flex1"},null,-1)),l("div",Ek,[Ot.value?(E(),D("button",{key:0,class:"week-tip",onClick:g[2]||(g[2]=R=>ae("report"))},[...g[11]||(g[11]=[l("span",{class:"dot",style:{background:"var(--warn)"}},null,-1),en(" 填写本周周记 ",-1)])])):xe("",!0),l("span",$k,ne((C=n.value)==null?void 0:C.username),1),l("button",{class:"btn btn-sm mobile-hide",onClick:o},"退出"),l("button",{class:"btn btn-primary btn-sm",disabled:Fe.value,onClick:Kt},[Ee(Xe,{name:Fe.value?"check-circle":"clock",size:14},null,8,["name"]),l("span",Pk,ne(dt.value),1)],8,Tk)])]),l("main",Ak,[l("div",Ok,[de.value==="calendar"?(E(),Pt(vg,{key:0})):de.value==="today"?(E(),Pt(wg,{key:1})):de.value==="stats"?(E(),Pt(Xg,{key:2})):de.value==="report"?(E(),Pt(Jb,{key:3})):de.value==="ledger"?(E(),Pt(c_,{key:4})):de.value==="memo"?(E(),Pt(T_,{key:5})):de.value==="vault"?(E(),Pt(C1,{key:6})):de.value==="admin"?(E(),Pt(X0,{key:7})):(E(),Pt(v0,{key:8}))])]),l("nav",Mk,[(E(!0),D(je,null,ot(Ut(ke),R=>(E(),D("button",{key:R.key,class:et(["tab-btn",{active:de.value===R.key}]),onClick:le=>ae(R.key)},[Ee(Xe,{name:R.icon,size:20},null,8,["name"]),l("span",null,ne(R.name),1)],10,Ik))),128)),l("button",{class:et(["tab-btn",{active:ue.value}]),onClick:g[3]||(g[3]=R=>Te.value=!0)},[Ee(Xe,{name:"more",size:20}),g[13]||(g[13]=l("span",null,"更多",-1))],2)]),Te.value?(E(),D("div",{key:0,class:"sheet-mask",onClick:g[6]||(g[6]=R=>Te.value=!1)},[l("div",{class:"more-sheet",onClick:g[5]||(g[5]=sn(()=>{},["stop"]))},[l("div",jk,ne((Y=n.value)==null?void 0:Y.username),1),(E(!0),D(je,null,ot(V.value,R=>(E(),D("button",{key:R.key,class:"sheet-row",onClick:le=>Je(R.key)},[Ee(Xe,{name:R.icon,size:18},null,8,["name"]),l("span",Lk,ne(R.name),1),Ee(Xe,{name:"chevron-right",size:14,class:"sheet-go"})],8,Dk))),128)),g[15]||(g[15]=l("div",{class:"sheet-divider"},null,-1)),l("button",{class:"sheet-row sheet-danger",onClick:g[4]||(g[4]=R=>{Te.value=!1,o()})},[Ee(Xe,{name:"close",size:18}),g[14]||(g[14]=l("span",{class:"sheet-name"},"退出登录",-1))])])])):xe("",!0),Le.value?(E(),D("div",{key:1,class:"msw-mask",onClick:g[10]||(g[10]=sn(R=>Le.value=!1,["self"]))},[l("div",Rk,[l("div",Kk,[Ee(Xe,{name:"search",size:16,class:"msw-icon"}),$e(l("input",{ref_key:"msInput",ref:qe,class:"msw-input","onUpdate:modelValue":g[7]||(g[7]=R=>v.value=R),placeholder:"搜索工作记录与备忘录",onInput:$,onKeydown:g[8]||(g[8]=At(R=>Le.value=!1,["esc"]))},null,544),[[Me,v.value]]),l("button",{class:"icon-btn",onClick:g[9]||(g[9]=R=>{U(),Le.value=!1})},[Ee(Xe,{name:"close",size:16})])]),l("div",Fk,[S.value?(E(),D(je,{key:0},[m.value.logs.length?(E(),D("div",Nk,"工作记录")):xe("",!0),(E(!0),D(je,null,ot(m.value.logs,R=>(E(),D("div",{key:"l"+R.id,class:"msw-item",onMousedown:sn(le=>it(R),["prevent"])},[l("span",Bk,ne(Ut(Zo)(R.category)),1),l("span",Uk,ne(R.content),1),l("span",qk,ne(R.date),1)],40,Vk))),128)),m.value.memos.length?(E(),D("div",Hk,"备忘录")):xe("",!0),(E(!0),D(je,null,ot(m.value.memos,R=>(E(),D("div",{key:"m"+R.id,class:"msw-item",onMousedown:sn(le=>Ge(R),["prevent"])},[l("span",zk,ne(R.title||"无标题"),1),l("span",Gk,ne(R.content),1)],40,Wk))),128))],64)):v.value.trim()?(E(),D("div",Yk,"无匹配结果")):xe("",!0)])])])):xe("",!0)]),l("div",Jk,[Ee(Ev,{name:"toast"},{default:fr(()=>[(E(!0),D(je,null,ot(Ut(t),R=>(E(),D("div",{key:R.id,class:"toast"},ne(R.text),1))),128))]),_:1})])])):(E(),Pt(ak,{key:0,onLogin:s}))}}}),Qk=Wt(Xk,[["__scopeId","data-v-214bbb7a"]]);function Ko(e,t){try{let n=document.getElementById("fatal-overlay");n||(n=document.createElement("div"),n.id="fatal-overlay",n.style.cssText="position:fixed;inset:0;z-index:99999;background:#FFFFFF;color:#1D2129;padding:20px;overflow:auto;font:13px/1.7 -apple-system,PingFang SC,Microsoft YaHei,sans-serif;",n.addEventListener("click",o=>{o.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const s=document.createElement("div");s.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",s.textContent=e+`
`+t,n.appendChild(s)}catch{}}async function Zk(){const e=await Uh();e&&oi(e.userId);const t=Vv(Qk);t.config.errorHandler=(n,s,o)=>{const a=n;Ko("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",a&&(a.stack||a.message)||String(n)+`
触发位置: `+o)},window.addEventListener("unhandledrejection",n=>{const s=n.reason;Ko("未处理的异步错误(点击空白处关闭)",s&&(s.stack||s.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Ko("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}Zk().catch(e=>{Ko("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{Md as W,Pd as _,db as b,Od as r};