diff --git a/docs/release-notes-v0.8.1.md b/docs/release-notes-v0.8.1.md new file mode 100644 index 0000000..ec761ce --- /dev/null +++ b/docs/release-notes-v0.8.1.md @@ -0,0 +1,9 @@ +# v0.8.1 修复启动竞态崩溃 + +## 修复 +- 修复「Cannot read properties of undefined (reading 'attendance')」启动崩溃:当本机存有登录会话但静默登录失败时(典型场景:服务器重启/重建容器的窗口期打开应用),旧版会按已登录渲染但本地缓存库未绑定,视图挂载即崩溃。 +- 现在会话恢复会校验本地缓存库已绑定;未绑定则回到登录页,重新登录即可(服务器恢复后一次点击进入)。 +- 退出登录改为先卸载视图再解绑缓存库,消除微任务间隙的同类崩溃窗口。 + +## 说明 +- 该问题为潜伏缺陷,服务器重建窗口期触发;v0.8.0 功能本身不受影响。 diff --git a/intern-log/dist/assets/index-CwfY7_G6.css b/intern-log/dist/assets/index-BWain5t9.css similarity index 89% rename from intern-log/dist/assets/index-CwfY7_G6.css rename to intern-log/dist/assets/index-BWain5t9.css index e25bfae..27ff8fd 100644 --- a/intern-log/dist/assets/index-CwfY7_G6.css +++ b/intern-log/dist/assets/index-BWain5t9.css @@ -1 +1 @@ -.confirm-dialog[data-v-1f3675f2]{width:400px;padding:22px 22px 18px}.confirm-body[data-v-1f3675f2]{display:flex;gap:14px;align-items:flex-start}.confirm-badge[data-v-1f3675f2]{width:40px;height:40px;flex:none;border-radius:50%;background:#fdeeee;color:var(--danger);display:flex;align-items:center;justify-content:center}.confirm-text[data-v-1f3675f2]{flex:1;min-width:0}.confirm-title[data-v-1f3675f2]{font-size:15px;font-weight:600;color:var(--text-1);line-height:1.4}.confirm-title.is-danger[data-v-1f3675f2]{color:var(--danger)}.confirm-msg[data-v-1f3675f2]{margin-top:6px;color:var(--text-2);font-size:13px;line-height:1.7;word-break:break-all}.confirm-btns[data-v-1f3675f2]{margin-top:18px;display:flex;justify-content:flex-end;gap:8px}.modal-enter-active[data-v-1f3675f2],.modal-leave-active[data-v-1f3675f2]{transition:opacity .15s ease}.modal-enter-from[data-v-1f3675f2],.modal-leave-to[data-v-1f3675f2]{opacity:0}@media (max-width: 720px){.confirm-dialog[data-v-1f3675f2]{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}.confirm-btns .btn[data-v-1f3675f2]{flex:1;height:40px}.confirm-btns[data-v-1f3675f2]{margin-top:16px}}.dialog[data-v-91c30038]{width:560px}.min-chips[data-v-91c30038]{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}.min-chip[data-v-91c30038]{border:1px solid var(--border-strong);background:var(--bg-page);border-radius:999px;height:24px;padding:0 10px;font-size:12px;color:var(--text-2);cursor:pointer;transition:all .12s}.min-chip[data-v-91c30038]:hover{background:var(--bg-hover)}.min-chip.on[data-v-91c30038]{background:var(--accent-bg);border-color:var(--accent);color:var(--accent)}.dp-head[data-v-81276f4c]{margin-bottom:12px}.dp-date[data-v-81276f4c]{font-size:14px;font-weight:600}.att-grid[data-v-81276f4c]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}.att-cell label[data-v-81276f4c]{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.att-val[data-v-81276f4c]{display:flex;align-items:center;gap:6px;min-height:32px;font-size:13px}.att-val>.num[data-v-81276f4c]{font-size:14px;font-weight:600;letter-spacing:.2px}.val-empty[data-v-81276f4c]{color:var(--text-3)}.edit-row[data-v-81276f4c]{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.time-input[data-v-81276f4c]{width:104px}.att-note[data-v-81276f4c]{margin-top:10px;font-size:12px}.att-actions[data-v-81276f4c]{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.form-footer[data-v-81276f4c]{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}.list-sec[data-v-81276f4c]{margin-bottom:4px}.sec-head[data-v-81276f4c]{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:10px}.sec-head .sec-title[data-v-81276f4c]{margin-bottom:0}.item[data-v-81276f4c]{border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 12px;margin-bottom:6px;background:var(--bg-subtle);transition:border-color .12s,background .12s}.item[data-v-81276f4c]:hover{border-color:var(--border-strong);background:var(--bg-page)}.item-main[data-v-81276f4c]{display:flex;align-items:center;gap:8px;min-height:26px;flex-wrap:wrap}.item-content[data-v-81276f4c]{cursor:text;word-break:break-all;font-weight:500}.item-meta[data-v-81276f4c]{font-size:12px}.item-sub[data-v-81276f4c]{margin-top:6px;padding-top:6px;border-top:1px dashed var(--border);font-size:12px;display:flex;flex-direction:column;gap:2px}.dp-foot[data-v-81276f4c]{margin-top:10px;font-size:12px;text-align:right}@media (max-width: 720px){.dp-head[data-v-81276f4c]{margin-bottom:10px}.att-grid[data-v-81276f4c]{grid-template-columns:1fr 1fr;gap:10px 12px}.att-cell label[data-v-81276f4c]{margin-bottom:3px}.att-actions[data-v-81276f4c]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.att-actions .btn[data-v-81276f4c]{width:100%}.edit-row[data-v-81276f4c]{flex-wrap:wrap}.edit-row .time-input[data-v-81276f4c]{width:100%;flex:1 1 100%}.edit-row .btn[data-v-81276f4c]{flex:1}.item-main[data-v-81276f4c]{gap:6px}}.cal-toolbar[data-v-abd71a5b]{display:flex;align-items:center;gap:10px;margin-bottom:12px}.cal-title[data-v-abd71a5b]{font-size:14px;font-weight:600;min-width:96px;text-align:center}.cal-card[data-v-abd71a5b]{padding:0;overflow:hidden}.cal-head[data-v-abd71a5b],.cal-grid[data-v-abd71a5b]{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border)}.cal-week[data-v-abd71a5b]{background:var(--bg-subtle);text-align:center;padding:7px 0;font-size:12px;font-weight:500;color:var(--text-3)}.cal-cell[data-v-abd71a5b]{min-height:92px;padding:6px 8px;text-align:left;background:var(--bg-page);border:none;cursor:pointer;display:block;font-size:13px;transition:background .12s}.cal-cell[data-v-abd71a5b]:hover{background:var(--bg-subtle)}.cal-cell.blank[data-v-abd71a5b]{cursor:default;background:var(--bg-subtle)}.cal-cell.is-today[data-v-abd71a5b]{background:#f5f9ff}.cal-cell.selected[data-v-abd71a5b]{background:var(--accent-bg);box-shadow:inset 0 0 0 2px var(--accent)}.daynum.today[data-v-abd71a5b]{color:var(--accent);font-weight:600}.cal-cell.weekend .daynum[data-v-abd71a5b]{color:var(--text-3)}.cal-marks[data-v-abd71a5b]{display:flex;align-items:center;gap:4px;margin-top:8px;height:14px}.mark-log[data-v-abd71a5b]{color:var(--text-3)}.mark-star[data-v-abd71a5b]{color:var(--accent)}.drawer[data-v-abd71a5b]{position:fixed;top:0;right:0;bottom:0;width:min(440px,100%);background:var(--bg-page);border-left:1px solid var(--border);box-shadow:var(--shadow-float);z-index:20;display:flex;flex-direction:column}.drawer-head[data-v-abd71a5b]{height:48px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--border)}.drawer-title[data-v-abd71a5b]{font-weight:600}.drawer-body[data-v-abd71a5b]{flex:1;overflow:auto;padding:16px}.drawer-enter-active[data-v-abd71a5b],.drawer-leave-active[data-v-abd71a5b]{transition:opacity .15s ease}.drawer-enter-from[data-v-abd71a5b],.drawer-leave-to[data-v-abd71a5b]{opacity:0}@media (max-width: 720px){.cal-title[data-v-abd71a5b]{min-width:76px;font-size:13px}.drawer[data-v-abd71a5b]{width:100%}}.detail-page[data-v-2bb84c76]{display:flex;flex-direction:column}.toolbar[data-v-2bb84c76]{padding:10px 16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:12px}.nav-row[data-v-2bb84c76]{display:flex;align-items:center;gap:6px}.date-title[data-v-2bb84c76]{font-size:14px;font-weight:600;min-width:170px;text-align:center}.date-title.is-today[data-v-2bb84c76]{color:var(--accent)}.w-date[data-v-2bb84c76]{width:150px;flex:none}.tool-sep[data-v-2bb84c76]{width:1px;align-self:stretch;background:var(--border)}.exp-row[data-v-2bb84c76]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.exp-label[data-v-2bb84c76]{font-size:12px}.w-exp[data-v-2bb84c76]{width:140px;flex:none}@media (max-width: 720px){.tool-sep[data-v-2bb84c76]{display:none}.toolbar[data-v-2bb84c76]{padding:10px 12px;gap:10px}.nav-row[data-v-2bb84c76]{flex:1 1 100%}.date-title[data-v-2bb84c76]{min-width:0;flex:1;text-align:left}.w-date[data-v-2bb84c76]{flex:1;min-width:120px;width:auto}.exp-row[data-v-2bb84c76]{width:100%}.exp-row .seg[data-v-2bb84c76]{flex:1;display:flex}.exp-row .seg-btn[data-v-2bb84c76]{flex:1;padding:0 6px}.w-exp[data-v-2bb84c76]{flex:1;min-width:0;width:auto}}.plan-page[data-v-ffd19b28]{display:flex;flex-direction:column}.blk-head[data-v-ffd19b28]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:4px 2px 10px}.blk-head-text[data-v-ffd19b28]{min-width:0}.blk-title[data-v-ffd19b28]{font-size:14px;font-weight:600}.blk-sub[data-v-ffd19b28]{font-size:12px;margin-top:1px}.day-head[data-v-ffd19b28]{margin-top:18px}.day-ops[data-v-ffd19b28]{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.date-chip[data-v-ffd19b28]{min-width:74px;text-align:center;font-weight:600;font-size:13px}.date-chip.today[data-v-ffd19b28]{color:var(--accent)}.timer-live[data-v-ffd19b28]{color:var(--accent);font-weight:600}.goal-card[data-v-ffd19b28]{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;margin-bottom:10px}.goal-main[data-v-ffd19b28]{flex:1;min-width:0}.goal-line[data-v-ffd19b28]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.goal-name[data-v-ffd19b28]{font-size:14px;font-weight:500;word-break:break-all}.goal-range[data-v-ffd19b28]{font-size:12px}.goal-bar[data-v-ffd19b28]{height:6px;border-radius:3px;background:var(--bg-subtle);overflow:hidden;margin-top:10px}.goal-bar-fill[data-v-ffd19b28]{display:block;height:100%;background:var(--accent);border-radius:3px}.goal-meta[data-v-ffd19b28]{font-size:12px;margin-top:6px}.goal-ops[data-v-ffd19b28]{display:flex;gap:4px}.list-card[data-v-ffd19b28]{overflow:hidden}.plan-item[data-v-ffd19b28]{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border)}.plan-item[data-v-ffd19b28]:last-child{border-bottom:none}.plan-item.done[data-v-ffd19b28]{opacity:.6}.plan-item.skip[data-v-ffd19b28]{opacity:.48}.plan-item.running[data-v-ffd19b28]{box-shadow:inset 3px 0 0 var(--accent)}.pi-time[data-v-ffd19b28]{font-size:13px;font-weight:600;min-width:92px;padding-top:2px}.pi-main[data-v-ffd19b28]{flex:1;min-width:0}.pi-title[data-v-ffd19b28]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pi-text[data-v-ffd19b28]{font-size:14px;font-weight:500;word-break:break-all}.pi-text.strike[data-v-ffd19b28]{text-decoration:line-through}.state-done[data-v-ffd19b28]{color:var(--ok);font-size:12px}.state-skip[data-v-ffd19b28]{color:var(--text-3);font-size:12px}.pi-note[data-v-ffd19b28],.pi-meta[data-v-ffd19b28]{font-size:12px;margin-top:3px}.pi-ops[data-v-ffd19b28]{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.timer-on[data-v-ffd19b28]{color:var(--accent);border-color:var(--accent)}.empty[data-v-ffd19b28]{padding:28px 16px}.dialog[data-v-ffd19b28]{width:420px}.form-row[data-v-ffd19b28]{display:flex;flex-direction:column;gap:5px;margin-top:10px}.form-row.two[data-v-ffd19b28]{flex-direction:row;gap:10px}.form-row.two>div[data-v-ffd19b28]{flex:1;display:flex;flex-direction:column;gap:5px}.goal-hint[data-v-ffd19b28]{font-size:12px;margin-top:8px}@media (max-width: 720px){.blk-head[data-v-ffd19b28]{margin:0 0 10px}.day-head[data-v-ffd19b28]{margin-top:16px}.day-ops[data-v-ffd19b28]{width:100%}.day-ops .btn[data-v-ffd19b28]{flex:1;min-width:0}.day-ops .btn-primary[data-v-ffd19b28]{flex:1.5}.date-chip[data-v-ffd19b28]{min-width:64px}.plan-item[data-v-ffd19b28]{flex-wrap:wrap;padding:12px;gap:10px}.pi-time[data-v-ffd19b28]{min-width:0;padding-top:0}.pi-ops[data-v-ffd19b28]{width:100%;justify-content:flex-start;gap:8px}.pi-ops .btn-xs[data-v-ffd19b28]{flex:1;min-height:32px}.goal-card[data-v-ffd19b28]{position:relative;flex-direction:column;gap:8px}.goal-main[data-v-ffd19b28]{padding-right:0}.goal-line[data-v-ffd19b28]{padding-right:72px}.goal-ops[data-v-ffd19b28]{position:absolute;top:10px;right:8px}}.cards[data-v-5469ae68]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.section[data-v-5469ae68]{margin-top:12px}.heat[data-v-5469ae68]{display:flex;gap:3px;overflow-x:auto;padding-bottom:4px}.heat-col[data-v-5469ae68]{display:flex;flex-direction:column;gap:3px}.heat-cell[data-v-5469ae68]{width:12px;height:12px;border-radius:3px;display:inline-block}.lv0[data-v-5469ae68]{background:var(--bg-subtle);border:1px solid var(--border)}.lv1[data-v-5469ae68]{background:#e4eeff}.lv2[data-v-5469ae68]{background:#bfd6ff}.lv3[data-v-5469ae68]{background:#7fa8f5}.lv4[data-v-5469ae68]{background:var(--accent)}.heat-legend[data-v-5469ae68]{display:flex;align-items:center;gap:3px;margin-top:10px;font-size:12px}.two-col[data-v-5469ae68]{display:grid;grid-template-columns:1fr 1fr;gap:12px}.two-col .section[data-v-5469ae68]{margin-top:0}.bar-label[data-v-5469ae68]{width:72px}.bar-num[data-v-5469ae68]{width:92px}.loc-label[data-v-5469ae68]{width:110px;text-align:left}@media (max-width: 720px){.cards[data-v-5469ae68]{grid-template-columns:repeat(2,1fr)}.two-col[data-v-5469ae68]{grid-template-columns:1fr}.two-col .section[data-v-5469ae68]{margin-top:12px}}.report-toolbar[data-v-7e1b08ed]{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}.ai-error[data-v-7e1b08ed]{color:var(--danger);font-size:12px;margin:0 0 8px}.w-date[data-v-7e1b08ed]{width:140px;flex:none}.report-grid[data-v-7e1b08ed]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:12px;align-items:start}.section-title[data-v-7e1b08ed]{margin-bottom:10px}.section+.section[data-v-7e1b08ed]{margin-top:12px}.note-label[data-v-7e1b08ed]{display:block;font-size:12px;margin:8px 0 4px}.note-saved[data-v-7e1b08ed]{font-size:12px;margin-top:6px}.md-editor[data-v-7e1b08ed]{min-height:420px;line-height:1.7}.sum-row[data-v-7e1b08ed]{display:flex;justify-content:space-between;padding:3px 0;font-size:12px}.sum-row span[data-v-7e1b08ed]:last-child{font-weight:500}.section-sub[data-v-7e1b08ed]{font-weight:600;margin:12px 0 4px;font-size:12px;color:var(--text-2)}.sum-item[data-v-7e1b08ed]{font-size:12px;padding:2px 0;word-break:break-all}.sum-empty[data-v-7e1b08ed]{font-size:12px}@media (max-width: 960px){.report-grid[data-v-7e1b08ed]{grid-template-columns:1fr}}@media (max-width: 720px){.report-toolbar[data-v-7e1b08ed]{gap:8px}.report-toolbar .seg[data-v-7e1b08ed]{flex:1 1 100%;display:flex}.report-toolbar .seg-btn[data-v-7e1b08ed]{flex:1}.w-date[data-v-7e1b08ed]{flex:1;min-width:0;width:auto}.md-editor[data-v-7e1b08ed]{min-height:300px}}.dialog[data-v-e9a4e878]{width:480px}.add-cat[data-v-e9a4e878]{display:flex;gap:6px;margin-top:6px}.amt-input[data-v-e9a4e878]{height:38px;font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}@media (max-width: 720px){.dialog-btns .btn[data-v-e9a4e878]{flex:1;height:40px}}.add-cat-input[data-v-e9a4e878]{flex:1;height:28px;font-size:12px}@media (max-width: 720px){.add-cat-input[data-v-e9a4e878],.add-cat .btn[data-v-e9a4e878]{height:34px}}.period-dialog[data-v-6269639e]{width:400px}.seg-row[data-v-6269639e]{display:flex;width:100%}.seg-row .seg-btn[data-v-6269639e]{flex:1}.pane[data-v-6269639e]{margin-top:12px;max-height:46vh;overflow-y:auto;display:flex;flex-direction:column;gap:4px}.opt[data-v-6269639e]{display:flex;align-items:center;justify-content:space-between;gap:8px;border:none;background:transparent;cursor:pointer;padding:8px 10px;border-radius:var(--radius-sm);font-size:13px;color:var(--text-1);text-align:left;transition:background .12s}.opt[data-v-6269639e]:hover{background:var(--bg-hover)}.opt.active[data-v-6269639e]{background:#3370ff14;color:var(--accent);font-weight:600}.opt.active .muted[data-v-6269639e]{color:var(--accent);opacity:.75}.anchor-row[data-v-6269639e]{display:flex;align-items:center;gap:8px}.anchor-label[data-v-6269639e]{font-size:12px;color:var(--text-2);flex:none}.anchor-row .input[data-v-6269639e]{flex:1;min-width:0}.hint[data-v-6269639e]{font-size:12px;color:var(--text-3);padding:4px 2px}.custom-grid[data-v-6269639e]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.apply-btn[data-v-6269639e]{width:100%;margin-top:6px}.modal-enter-active[data-v-6269639e],.modal-leave-active[data-v-6269639e]{transition:opacity .15s ease}.modal-enter-from[data-v-6269639e],.modal-leave-to[data-v-6269639e]{opacity:0}@media (max-width: 720px){.period-dialog[data-v-6269639e]{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}.dialog-btns .btn[data-v-6269639e]{flex:1;height:40px}.pane[data-v-6269639e]{max-height:48vh}}.ledger-toolbar[data-v-f021b1ed]{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}.period-title[data-v-f021b1ed]{display:inline-flex;align-items:center;justify-content:center;gap:5px;border:none;background:transparent;cursor:pointer;font-size:14px;font-weight:600;color:var(--text-1);padding:5px 10px;border-radius:var(--radius-sm);transition:background .12s}.period-title[data-v-f021b1ed]:hover{background:var(--bg-hover)}.w-filter[data-v-f021b1ed]{width:110px;flex:none}.icon-btn[data-v-f021b1ed]:disabled{opacity:.35;cursor:default}.cards[data-v-f021b1ed]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.stat-card[data-v-f021b1ed]{border-left:3px solid var(--border)}.stat-income[data-v-f021b1ed]{border-left-color:var(--ok)}.stat-expense[data-v-f021b1ed]{border-left-color:var(--text-3)}.stat-balance[data-v-f021b1ed]{border-left-color:var(--accent)}.stat-pending[data-v-f021b1ed]{border-left-color:var(--warn)}.card.sec[data-v-f021b1ed],.card.section[data-v-f021b1ed]{margin-top:12px}.sec-head[data-v-f021b1ed]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.sec-head .sec-title[data-v-f021b1ed]{margin-bottom:0}.legend[data-v-f021b1ed]{display:inline-flex;align-items:center;gap:5px;font-size:12px}.legend .lg[data-v-f021b1ed]{width:8px;height:8px;border-radius:2px;display:inline-block;margin-left:8px}.legend .lg[data-v-f021b1ed]:first-child{margin-left:0}.chart-wrap[data-v-f021b1ed]{min-width:0}.chart[data-v-f021b1ed]{display:flex;align-items:stretch;gap:3px;height:110px}.chart-col[data-v-f021b1ed]{flex:1;min-width:0;display:flex}.chart-bars[data-v-f021b1ed]{flex:1;display:flex;align-items:flex-end;justify-content:center;gap:2px}.cbar[data-v-f021b1ed]{width:6px;max-width:12px;border-radius:2px 2px 0 0;min-height:0}.cbar-income[data-v-f021b1ed]{background:var(--ok);opacity:.85}.cbar-expense[data-v-f021b1ed]{background:var(--text-3);opacity:.8}.chart-axis[data-v-f021b1ed]{display:flex;gap:3px;border-top:1px solid var(--border);margin-top:0}.chart-label[data-v-f021b1ed]{flex:1;min-width:0;text-align:center;font-size:10px;color:var(--text-3);line-height:18px;height:18px;overflow:hidden;white-space:nowrap}.chart-hint[data-v-f021b1ed]{font-size:12px;margin-bottom:6px}.chart-col:hover .cbar-income[data-v-f021b1ed],.chart-col:hover .cbar-expense[data-v-f021b1ed]{opacity:1}.chip-row[data-v-f021b1ed]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.chip[data-v-f021b1ed]{height:24px;padding:0 10px;border:1px solid var(--border-strong);border-radius:999px;background:var(--bg-page);color:var(--text-2);font-size:12px;cursor:pointer;white-space:nowrap;transition:all .12s}.chip[data-v-f021b1ed]:hover{background:var(--bg-hover)}.chip.active[data-v-f021b1ed]{background:var(--accent-bg);border-color:var(--accent);color:var(--accent);font-weight:500}.sel-strip[data-v-f021b1ed]{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;background:var(--accent-bg);border-radius:var(--radius-sm);padding:7px 10px;font-size:12px;color:var(--accent);margin-bottom:10px}.bar-row[data-v-f021b1ed]{display:flex;align-items:center;gap:8px;margin:8px 0;transition:opacity .12s}.bar-row.dim[data-v-f021b1ed]{opacity:.4}.cat-dot[data-v-f021b1ed]{width:8px;height:8px;border-radius:2px;flex:none}.bar-label[data-v-f021b1ed]{flex:none;width:72px;color:var(--text-2);font-size:12px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-track[data-v-f021b1ed]{flex:1;height:8px;border-radius:4px;background:var(--bg-subtle);overflow:hidden}.bar-amt[data-v-f021b1ed]{flex:none;width:88px;text-align:right;font-size:12px}.bar-pct[data-v-f021b1ed]{flex:none;width:38px;text-align:right;font-size:12px}.td-note[data-v-f021b1ed]{color:var(--text-2)}.tx-pending[data-v-f021b1ed]{color:var(--warn);font-size:12px}.tx-done[data-v-f021b1ed]{color:var(--ok);font-size:12px}.th-ops[data-v-f021b1ed]{width:220px}.ops[data-v-f021b1ed]{display:flex;gap:4px;flex-wrap:wrap}.table-card[data-v-f021b1ed]{overflow-x:auto}.table-note[data-v-f021b1ed]{margin-top:10px;font-size:12px;text-align:right}@media (max-width: 720px){.ledger-toolbar[data-v-f021b1ed]{gap:8px}.ledger-toolbar .flex1[data-v-f021b1ed]{display:none}.period-title[data-v-f021b1ed]{flex:1;justify-content:flex-start;padding-left:0}.w-filter[data-v-f021b1ed]{flex:1 1 calc(50% - 4px);min-width:0;width:auto}.ledger-toolbar .btn-primary[data-v-f021b1ed]{flex:1 1 100%;order:9}.chart[data-v-f021b1ed]{overflow-x:auto}.chart-col[data-v-f021b1ed]{min-width:11px}.cbar[data-v-f021b1ed]{width:4px}.bar-label[data-v-f021b1ed]{width:60px}.bar-amt[data-v-f021b1ed]{width:78px}}.memo-page[data-v-a0931fc7]{display:grid;grid-template-columns:280px minmax(0,1fr);gap:12px;align-items:stretch}.memo-list[data-v-a0931fc7]{display:flex;flex-direction:column;max-height:calc(100vh - 150px)}.pane-head[data-v-a0931fc7]{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px;border-bottom:1px solid var(--border);flex:none}.pane-title[data-v-a0931fc7]{font-size:13px;font-weight:600}.memo-scroll[data-v-a0931fc7]{overflow:auto;padding:6px}.memo-item[data-v-a0931fc7]{padding:8px 10px;border-radius:var(--radius-sm);cursor:pointer;margin-bottom:2px}.memo-item[data-v-a0931fc7]:hover{background:var(--bg-hover)}.memo-item.active[data-v-a0931fc7]{background:var(--accent-bg)}.memo-item.active .memo-item-title[data-v-a0931fc7]{color:var(--accent)}.memo-item-title[data-v-a0931fc7]{font-size:13px;font-weight:500;word-break:break-all}.memo-item-sub[data-v-a0931fc7]{font-size:12px;margin-top:2px;word-break:break-all}.memo-item-time[data-v-a0931fc7]{font-size:11px;margin-top:2px}.memo-editor[data-v-a0931fc7]{padding:16px 18px;min-height:420px;display:flex;flex-direction:column}.title-input[data-v-a0931fc7]{font-size:15px;font-weight:600;margin-bottom:10px}.content-textarea[data-v-a0931fc7]{flex:1;min-height:340px;line-height:1.8}.editor-foot[data-v-a0931fc7]{display:flex;align-items:center;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--border)}.foot-info[data-v-a0931fc7]{font-size:12px}.editor-empty[data-v-a0931fc7]{display:flex;align-items:center;justify-content:center;flex:1;padding:60px 0}@media (max-width: 800px){.memo-page[data-v-a0931fc7]{grid-template-columns:1fr;gap:10px}.memo-list[data-v-a0931fc7]{max-height:210px}.content-textarea[data-v-a0931fc7]{min-height:260px}.title-input[data-v-a0931fc7]{height:38px}.editor-foot[data-v-a0931fc7]{flex-wrap:wrap}.editor-foot .btn[data-v-a0931fc7]{flex:1;min-height:34px}}.dialog[data-v-2eafe20e]{width:480px}.pwd-row[data-v-2eafe20e]{display:flex;gap:8px}.pwd-row .input[data-v-2eafe20e]{flex:1}.lock-card[data-v-6d2745bc]{max-width:380px;margin:60px auto 0;padding:28px 24px;text-align:center;display:flex;flex-direction:column;gap:10px}.lock-badge[data-v-6d2745bc]{width:52px;height:52px;margin:0 auto;border-radius:50%;background:var(--accent-bg);color:var(--accent);display:flex;align-items:center;justify-content:center}.lock-title[data-v-6d2745bc]{font-size:15px;font-weight:600}.lock-tip[data-v-6d2745bc]{font-size:12px;line-height:1.7}.lock-btn[data-v-6d2745bc]{margin-top:4px}.vault-toolbar[data-v-6d2745bc]{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}.search-wrap[data-v-6d2745bc]{position:relative;width:280px;max-width:100%}.search-wrap .input[data-v-6d2745bc]{padding-left:30px}.search-icon[data-v-6d2745bc]{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--text-3)}.table-card[data-v-6d2745bc]{overflow-x:auto}.td-system[data-v-6d2745bc]{font-weight:500}.th-ops[data-v-6d2745bc]{width:150px}.pwd-cell[data-v-6d2745bc]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.pwd-text[data-v-6d2745bc]{letter-spacing:1px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.copyable[data-v-6d2745bc]{cursor:pointer}.copyable[data-v-6d2745bc]:hover{color:var(--accent)}.ops[data-v-6d2745bc]{display:flex;gap:4px;flex-wrap:wrap}.table-note[data-v-6d2745bc]{margin-top:10px;font-size:12px;text-align:right}.dialog[data-v-6d2745bc]{width:440px}.vp-field[data-v-6d2745bc]{margin-bottom:10px}.vp-tip[data-v-6d2745bc]{font-size:12px;margin-top:8px}.input-dialog[data-v-4b14ba4f]{width:400px}.field label[data-v-4b14ba4f]{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.modal-enter-active[data-v-4b14ba4f],.modal-leave-active[data-v-4b14ba4f]{transition:opacity .15s ease}.modal-enter-from[data-v-4b14ba4f],.modal-leave-to[data-v-4b14ba4f]{opacity:0}@media (max-width: 720px){.input-dialog[data-v-4b14ba4f]{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}.dialog-btns .btn[data-v-4b14ba4f]{flex:1;height:40px}}.settings[data-v-10f77319]{display:flex;flex-direction:column;gap:12px;max-width:640px}.acc-line[data-v-10f77319]{font-size:12px;margin-bottom:10px;line-height:1.7}.rule-grid[data-v-10f77319]{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}.rule-item label[data-v-10f77319]{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.rule-save[data-v-10f77319]{display:flex;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap}.proj-add[data-v-10f77319]{display:flex;gap:8px}.proj-tip[data-v-10f77319]{font-size:12px;margin-top:6px}.proj-row[data-v-10f77319]{display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--border)}.proj-row[data-v-10f77319]:last-child{border-bottom:none}.proj-name[data-v-10f77319]{flex:1;word-break:break-all}.proj-name.archived[data-v-10f77319]{color:var(--text-3);text-decoration:line-through}.loc-note[data-v-10f77319]{font-size:12px}.ai-grid[data-v-10f77319]{display:flex;flex-direction:column;gap:10px}.backup-row[data-v-10f77319]{display:flex;gap:8px;flex-wrap:wrap}.cat-block[data-v-10f77319]{margin-top:12px}.cat-block[data-v-10f77319]:first-of-type{margin-top:0}.cat-head[data-v-10f77319]{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;font-size:12px}.cat-chips[data-v-10f77319]{display:flex;flex-wrap:wrap;gap:6px}.cat-chip[data-v-10f77319]{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--border);border-radius:999px;padding:2px 8px;font-size:12px;background:var(--bg-subtle)}.chip-btn[data-v-10f77319]{border:none;background:transparent;color:var(--text-3);cursor:pointer;font-size:11px;padding:0 1px}.chip-btn[data-v-10f77319]:hover{color:var(--accent)}.import-error[data-v-10f77319]{color:var(--danger);font-size:12px;margin-top:8px}.backup-note[data-v-10f77319]{font-size:12px;margin-top:10px}.tp[data-v-a8f9ed22]{position:fixed;right:20px;bottom:20px;z-index:40;display:flex;align-items:center;gap:10px;min-width:0;max-width:340px;padding:10px 12px;background:var(--bg-page);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-float);cursor:pointer;text-align:left;transition:border-color .12s}.tp[data-v-a8f9ed22]:hover{border-color:var(--border-strong)}.tp-pulse[data-v-a8f9ed22]{width:9px;height:9px;border-radius:50%;background:var(--accent);position:relative;flex:none}.tp-pulse[data-v-a8f9ed22]:after{content:"";position:absolute;top:-4px;right:-4px;bottom:-4px;left:-4px;border-radius:50%;border:2px solid var(--accent);animation:tp-ring-a8f9ed22 1.6s ease-out infinite}@keyframes tp-ring-a8f9ed22{0%{transform:scale(.5);opacity:.6}to{transform:scale(1.5);opacity:0}}.tp-main[data-v-a8f9ed22]{display:flex;flex-direction:column;min-width:0}.tp-title[data-v-a8f9ed22]{font-size:13px;font-weight:600;color:var(--text-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-meta[data-v-a8f9ed22]{font-size:11px;color:var(--text-3)}.tp-time[data-v-a8f9ed22]{font-size:16px;font-weight:600;color:var(--accent);font-variant-numeric:tabular-nums;margin-left:2px;flex:none}.tp-stop[data-v-a8f9ed22]{flex:none;font-size:12px;color:var(--text-2);border:1px solid var(--border-strong);border-radius:var(--radius-sm);padding:3px 10px;transition:all .12s}.tp-stop[data-v-a8f9ed22]:hover{color:var(--danger);border-color:var(--danger);background:#fdf0f0}.tp-enter-active[data-v-a8f9ed22],.tp-leave-active[data-v-a8f9ed22]{transition:all .2s ease}.tp-enter-from[data-v-a8f9ed22],.tp-leave-to[data-v-a8f9ed22]{opacity:0;transform:translateY(10px)}@media (max-width: 720px){.tp[data-v-a8f9ed22]{left:12px;right:12px;bottom:calc(64px + env(safe-area-inset-bottom));max-width:none}}.admin-page[data-v-2d48d2c9]{display:flex;flex-direction:column;gap:12px;max-width:860px}.toolbar[data-v-2d48d2c9]{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border);flex-wrap:wrap}.head-wrap[data-v-2d48d2c9]{flex:1;min-width:0}.tb-title[data-v-2d48d2c9]{font-weight:600;font-size:14px}.tb-sub[data-v-2d48d2c9]{font-size:12px;margin-top:2px}.tb-error[data-v-2d48d2c9]{padding:8px 16px 0}.table-card[data-v-2d48d2c9]{overflow-x:auto}.admin-table td[data-v-2d48d2c9]{white-space:nowrap}.td-name[data-v-2d48d2c9]{font-weight:500}.role-badge[data-v-2d48d2c9]{display:inline-flex;align-items:center;background:var(--accent-bg);color:var(--accent);border-radius:999px;font-size:12px;line-height:18px;padding:1px 9px}.load-line[data-v-2d48d2c9]{padding:12px 16px;font-size:12px}.admin-note[data-v-2d48d2c9]{font-size:12px;padding:0 2px}.ops[data-v-2d48d2c9]{display:inline-flex;gap:6px}.form-row[data-v-2d48d2c9]{display:flex;flex-direction:column;gap:5px;margin-top:10px}.dialog[data-v-2d48d2c9]{width:420px}.empty[data-v-2d48d2c9]{text-align:center}@media (max-width: 720px){.admin-table td[data-v-2d48d2c9],.admin-table th[data-v-2d48d2c9]{white-space:normal}}.login-page[data-v-e9c1c40d]{min-height:100vh;min-height:100dvh;background:linear-gradient(180deg,#EBF0F8 0%,var(--bg-app) 46%);display:flex;align-items:center;justify-content:center;padding:20px}.login-card .input[data-v-e9c1c40d]{height:38px}.login-card[data-v-e9c1c40d]{width:400px;max-width:100%;padding:30px 28px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow-float);border-radius:var(--radius-lg)}.login-brand[data-v-e9c1c40d]{text-align:center;margin-bottom:6px}.brand-icon[data-v-e9c1c40d]{width:46px;height:46px;margin:0 auto 10px;border-radius:12px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center}.login-title[data-v-e9c1c40d]{font-size:18px;font-weight:600;color:var(--text-1)}.login-sub[data-v-e9c1c40d]{font-size:12px;margin-top:4px;line-height:1.7}.form-error[data-v-e9c1c40d]{color:var(--danger);font-size:12px}.login-btn[data-v-e9c1c40d]{margin-top:2px;height:36px}.login-note[data-v-e9c1c40d]{font-size:12px;text-align:center;line-height:1.7}.app[data-v-ab53c58b]{display:flex;height:100vh;height:100dvh;overflow:hidden;background:var(--bg-app)}.side[data-v-ab53c58b]{width:var(--side-w);flex:none;display:flex;flex-direction:column;background:var(--bg-page);border-right:1px solid var(--border)}.brand[data-v-ab53c58b]{display:flex;align-items:center;gap:9px;height:var(--topbar-h);flex:none;padding:0 16px;border-bottom:1px solid var(--border);cursor:pointer}.brand-mark[data-v-ab53c58b]{width:26px;height:26px;flex:none;border-radius:7px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center}.brand-name[data-v-ab53c58b]{font-size:14px;font-weight:600;letter-spacing:.3px;white-space:nowrap}.side-nav[data-v-ab53c58b]{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:2px}.nav-group[data-v-ab53c58b]{font-size:11px;color:var(--text-3);padding:12px 8px 4px;letter-spacing:2px;white-space:nowrap}.nav-btn[data-v-ab53c58b]{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;border:none;background:transparent;border-radius:var(--radius-sm);color:var(--text-2);cursor:pointer;font-size:13px;position:relative;text-align:left;transition:background .12s,color .12s}.nav-btn[data-v-ab53c58b]:hover{background:var(--bg-hover);color:var(--text-1)}.nav-btn.active[data-v-ab53c58b]{background:var(--accent-bg);color:var(--accent);font-weight:500}.nav-btn.active[data-v-ab53c58b]:before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:2px;background:var(--accent)}.nav-label[data-v-ab53c58b]{white-space:nowrap}.nav-btn[data-v-ab53c58b]:after{content:attr(data-tip);position:absolute;left:50px;top:50%;transform:translateY(-50%);background:var(--text-1);color:#fff;font-size:12px;line-height:1.4;padding:2px 8px;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:40}.side-foot[data-v-ab53c58b]{flex:none;display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid var(--border)}.avatar[data-v-ab53c58b]{width:28px;height:28px;flex:none;border-radius:50%;background:var(--accent-bg);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}.foot-name[data-v-ab53c58b]{flex:1;min-width:0;font-size:13px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main[data-v-ab53c58b]{flex:1;display:flex;flex-direction:column;min-width:0}.topbar[data-v-ab53c58b]{height:var(--topbar-h);flex:none;background:var(--bg-page);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;padding:0 20px;z-index:10}.title[data-v-ab53c58b]{font-size:15px;font-weight:600;white-space:nowrap}.gsearch[data-v-ab53c58b]{position:relative;width:320px;max-width:38vw}.gs-icon[data-v-ab53c58b]{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--text-3)}.gs-input[data-v-ab53c58b]{height:32px;padding-left:31px;border-radius:999px;background:var(--bg-subtle);border-color:transparent}.gs-input[data-v-ab53c58b]:focus{background:var(--bg-page);border-color:var(--accent)}.gs-panel[data-v-ab53c58b]{position:absolute;top:38px;left:0;right:0;background:var(--bg-page);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-float);z-index:50;max-height:420px;overflow:auto;padding:6px}.gs-group[data-v-ab53c58b]{font-size:12px;padding:6px 8px 2px}.gs-item[data-v-ab53c58b]{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:var(--radius-sm);cursor:pointer}.gs-item[data-v-ab53c58b]:hover{background:var(--bg-hover)}.gs-text[data-v-ab53c58b],.gs-sub[data-v-ab53c58b]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gs-text[data-v-ab53c58b]{font-size:13px}.gs-sub[data-v-ab53c58b]{font-size:12px}.gs-date[data-v-ab53c58b]{font-size:12px;flex:none}.gs-empty[data-v-ab53c58b]{padding:10px;font-size:12px;text-align:center}.content[data-v-ab53c58b]{flex:1;overflow:auto}.content-inner[data-v-ab53c58b]{max-width:1280px;margin:0 auto;padding:20px 24px 48px}.toast-wrap[data-v-ab53c58b]{position:fixed;top:68px;right:20px;z-index:60;display:flex;flex-direction:column;gap:8px;align-items:flex-end;pointer-events:none}.toast[data-v-ab53c58b]{background:var(--bg-page);border:1px solid var(--border);box-shadow:var(--shadow-float);border-radius:var(--radius-sm);padding:8px 14px;font-size:13px;color:var(--text-1)}.toast-enter-from[data-v-ab53c58b],.toast-leave-to[data-v-ab53c58b]{opacity:0;transform:translateY(-4px)}.toast-enter-active[data-v-ab53c58b],.toast-leave-active[data-v-ab53c58b]{transition:all .15s ease}.mob-search-btn[data-v-ab53c58b]{display:none;width:32px;height:32px;border:none;background:transparent;border-radius:var(--radius-sm);color:var(--text-2);cursor:pointer;align-items:center;justify-content:center}.tabbar[data-v-ab53c58b]{display:none;position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--bg-page);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom)}.tab-btn[data-v-ab53c58b]{flex:1;height:50px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:none;background:transparent;color:var(--text-3);cursor:pointer;font-size:11px}.tab-btn.active[data-v-ab53c58b]{color:var(--accent);font-weight:500}.sheet-mask[data-v-ab53c58b]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;background:#1d212966}.more-sheet[data-v-ab53c58b]{position:absolute;left:0;right:0;bottom:0;background:var(--bg-page);border-radius:16px 16px 0 0;padding:6px 14px calc(14px + env(safe-area-inset-bottom));display:flex;flex-direction:column}.sheet-handle[data-v-ab53c58b]{width:36px;height:4px;border-radius:2px;background:var(--border-strong);margin:4px auto 8px;flex:none}.sheet-user[data-v-ab53c58b]{font-size:12px;color:var(--text-3);padding:4px 6px 10px;border-bottom:1px solid var(--border);margin-bottom:4px}.sheet-row[data-v-ab53c58b]{display:flex;align-items:center;gap:12px;height:46px;border:none;background:transparent;color:var(--text-1);font-size:14px;cursor:pointer;border-radius:var(--radius-sm);text-align:left;padding:0 6px}.sheet-row[data-v-ab53c58b]:hover,.sheet-row[data-v-ab53c58b]:active{background:var(--bg-hover)}.sheet-name[data-v-ab53c58b]{flex:1}.sheet-go[data-v-ab53c58b]{color:var(--text-3)}.sheet-divider[data-v-ab53c58b]{height:1px;background:var(--border);margin:6px 0}.sheet-danger[data-v-ab53c58b]{color:var(--danger)}.msw-mask[data-v-ab53c58b]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;background:var(--bg-page)}.msw[data-v-ab53c58b]{height:100%;display:flex;flex-direction:column}.msw-bar[data-v-ab53c58b]{height:52px;flex:none;display:flex;align-items:center;gap:8px;padding:0 12px;border-bottom:1px solid var(--border)}.msw-icon[data-v-ab53c58b]{color:var(--text-3)}.msw-input[data-v-ab53c58b]{flex:1;height:34px;border:none;outline:none;font-size:14px;background:transparent;color:var(--text-1)}.msw-results[data-v-ab53c58b]{flex:1;overflow:auto;padding:10px 4px calc(20px + env(safe-area-inset-bottom))}.msw-item[data-v-ab53c58b]{display:flex;align-items:center;gap:8px;padding:10px;border-radius:var(--radius-sm);cursor:pointer}.msw-item[data-v-ab53c58b]:hover,.msw-item[data-v-ab53c58b]:active{background:var(--bg-hover)}@media (max-width: 1000px) and (min-width: 721px){.side[data-v-ab53c58b]{width:var(--side-w-collapsed)}.brand[data-v-ab53c58b]{justify-content:center;padding:0}.brand-name[data-v-ab53c58b],.nav-label[data-v-ab53c58b],.nav-group[data-v-ab53c58b]{display:none}.nav-btn[data-v-ab53c58b]{justify-content:center;padding:0;width:40px;align-self:center}.nav-btn.active[data-v-ab53c58b]:before{display:none}.nav-btn[data-v-ab53c58b]:hover:after{opacity:1}.side-foot[data-v-ab53c58b]{flex-direction:column;gap:6px}.foot-name[data-v-ab53c58b]{display:none}}@media (max-width: 720px){.app[data-v-ab53c58b]{display:block;height:100dvh}.side[data-v-ab53c58b]{display:none}.main[data-v-ab53c58b]{display:flex;flex-direction:column;height:100dvh;min-width:0}.topbar[data-v-ab53c58b]{height:50px;min-height:50px;padding:0 10px;gap:6px}.title[data-v-ab53c58b]{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsearch[data-v-ab53c58b],.gsearch .gs-panel[data-v-ab53c58b]{display:none}.mob-search-btn[data-v-ab53c58b]{display:flex}.mob-search-btn[data-v-ab53c58b]{margin-left:auto}.tabbar[data-v-ab53c58b]{display:flex}.tab-btn[data-v-ab53c58b]{height:56px;font-size:11px}.tab-btn .icon[data-v-ab53c58b]{width:22px;height:22px}.content[data-v-ab53c58b]{flex:1;min-height:0}.content-inner[data-v-ab53c58b]{max-width:none;padding:12px 12px calc(78px + env(safe-area-inset-bottom))}.toast-wrap[data-v-ab53c58b]{top:6px;right:10px;left:10px;align-items:flex-start}}:root{--bg-app: #F5F6F8;--bg-page: #FFFFFF;--bg-subtle: #F7F8FA;--bg-hover: #F2F3F5;--text-1: #1D2129;--text-2: #4E5969;--text-3: #86909C;--border: #E8EAEE;--border-strong: #DCDFE4;--accent: #3370FF;--accent-deep: #2B5FD9;--accent-bg: #EEF4FF;--ok: #23A757;--warn: #E8842C;--danger: #E5484D;--dot-empty: #C9CDD4;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--shadow-card: 0 1px 2px rgba(16, 24, 40, .04);--shadow-float: 0 12px 32px -8px rgba(16, 24, 40, .14), 0 4px 12px rgba(16, 24, 40, .06);--side-w: 216px;--side-w-collapsed: 60px;--topbar-h: 56px}*{box-sizing:border-box}html,body{margin:0;padding:0}body{background:var(--bg-app);color:var(--text-1);font-family:-apple-system,PingFang SC,Microsoft YaHei,system-ui,sans-serif;font-size:13px;line-height:1.6;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button,input,select,textarea{font:inherit;color:inherit}.num{font-variant-numeric:tabular-nums}.flex1{flex:1;min-width:0}.muted{color:var(--text-3)}.muted2{color:var(--text-2)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;height:32px;border-radius:var(--radius-sm);border:1px solid var(--border-strong);background:var(--bg-page);color:var(--text-1);cursor:pointer;white-space:nowrap;font-weight:500;transition:background .12s,border-color .12s,color .12s}.btn:hover{background:var(--bg-hover);border-color:var(--border-strong)}.btn:active{transform:translateY(1px)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 1px 2px #3370ff47}.btn-primary:hover{background:var(--accent-deep);border-color:var(--accent-deep)}.btn-primary:active{box-shadow:none}.btn-danger{color:var(--danger);border-color:var(--danger);background:var(--bg-page)}.btn-danger:hover{background:#fdf0f0}.btn-danger-solid{background:var(--danger);border-color:var(--danger);color:#fff}.btn-danger-solid:hover{background:#d13a3f}.btn-sm{height:28px;padding:0 12px;font-size:12px}.btn-xs{height:24px;padding:0 10px;font-size:12px}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;border:none;background:transparent;border-radius:var(--radius-sm);color:var(--text-3);cursor:pointer;transition:background .12s,color .12s}.icon-btn:hover{background:var(--bg-hover);color:var(--text-1)}.icon-btn.active{color:var(--accent)}.icon-btn.active-warn{color:var(--warn)}.input,.select,.textarea{height:32px;padding:0 10px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--bg-page);outline:none;width:100%;transition:border-color .12s,box-shadow .12s}.textarea{height:auto;min-height:64px;padding:8px 10px;resize:vertical;line-height:1.7}.input:focus,.select:focus,.textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #3370ff1a}.input::placeholder,.textarea::placeholder{color:var(--text-3)}.input.invalid,.input.invalid:focus{border-color:var(--danger);box-shadow:0 0 0 3px #e5484d1a}.card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-page);box-shadow:var(--shadow-card)}.section{padding:16px 18px}.section-title,.sec-title{font-weight:600;margin-bottom:12px;font-size:13px;color:var(--text-1)}.sec{padding:16px 18px}.empty{text-align:center;padding:28px 0}.tag{display:inline-block;padding:0 8px;height:22px;line-height:20px;border-radius:4px;font-size:12px;background:var(--bg-subtle);color:var(--text-2);border:1px solid var(--border);white-space:nowrap}.dot{width:6px;height:6px;border-radius:50%;display:inline-block;flex:none}.dot.normal{background:var(--ok)}.dot.late,.dot.early,.dot.incomplete{background:var(--warn)}.dot.absent{background:var(--danger)}.dot.none,.dot.leave{background:var(--dot-empty)}.dot.rest{background:var(--border)}.amt-income{color:var(--ok)}.amt-expense{color:var(--text-1)}.amt-warn{color:var(--warn)}.seg{display:inline-flex;border:1px solid var(--border-strong);border-radius:var(--radius-sm);overflow:hidden;background:var(--bg-page)}.seg-btn{border:none;background:var(--bg-page);color:var(--text-2);cursor:pointer;font-size:12px;height:28px;padding:0 12px;border-right:1px solid var(--border);transition:background .12s,color .12s}.seg-btn:last-child{border-right:none}.seg-btn:hover{background:var(--bg-hover)}.seg-btn.active{background:var(--accent-bg);color:var(--accent);font-weight:500}.toggle-btn{height:32px;width:100%;border:1px solid var(--border-strong);background:var(--bg-page);border-radius:var(--radius-sm);cursor:pointer;font-size:13px;color:var(--text-2);transition:all .12s}.toggle-btn:hover{background:var(--bg-hover)}.toggle-btn.on{color:var(--accent);border-color:var(--accent);background:var(--accent-bg)}.toggle-btn.onwarn{color:var(--warn);border-color:var(--warn);background:#fdf4ec}.tx-table,.cred-table,.admin-table{width:100%;border-collapse:collapse;font-size:13px}.tx-table th,.cred-table th,.admin-table th{text-align:left;font-weight:500;color:var(--text-3);font-size:12px;background:var(--bg-subtle);padding:9px 14px;border-bottom:1px solid var(--border);white-space:nowrap}.tx-table td,.cred-table td,.admin-table td{padding:10px 14px;border-bottom:1px solid var(--border);vertical-align:top;word-break:break-all}.tx-table tbody tr:hover,.cred-table tbody tr:hover,.admin-table tbody tr:hover{background:#fafbfc}.tx-table tbody tr:last-child td,.cred-table tbody tr:last-child td,.admin-table tbody tr:last-child td{border-bottom:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d212973;display:flex;align-items:center;justify-content:center;z-index:90;padding:16px}.dialog{width:480px;max-width:calc(100vw - 32px);max-height:86vh;max-height:86dvh;overflow:auto;background:var(--bg-page);border-radius:var(--radius-lg);box-shadow:var(--shadow-float);display:flex;flex-direction:column}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid var(--border);flex:none}.dialog-title{font-size:14px;font-weight:600;color:var(--text-1)}.dialog-sub{font-size:12px;margin-top:2px;color:var(--text-3)}.dialog-body{padding:16px 20px;overflow:auto}.dialog-btns{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;border-top:1px solid var(--border);flex:none}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}.form-grid .field.span2,.field.span2{grid-column:span 2}.field label,.form-row label{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.form-error{color:var(--danger);font-size:12px;margin-top:8px}.stat-card{padding:14px 16px}.stat-num{font-size:22px;font-weight:600;margin-top:2px;letter-spacing:-.2px}.bar-row{display:flex;align-items:center;gap:10px;margin:7px 0}.bar-label{flex:none;color:var(--text-2);font-size:12px;text-align:right}.bar-track{flex:1;height:8px;border-radius:4px;background:var(--bg-subtle);overflow:hidden}.bar-fill{display:block;height:100%;background:var(--accent);border-radius:4px}.bar-num{font-size:12px;flex:none;color:var(--text-3)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:#d3d7de;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#b9bec7}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-corner{background:transparent}.tx-table th:nth-child(3),.tx-table td:nth-child(3){text-align:right}.icon{display:inline-flex;align-items:center;justify-content:center;flex:none}.icon svg{width:100%;height:100%;display:block}@media (max-width: 720px){input,select,textarea{font-size:16px!important}input[type=checkbox]{font-size:initial}}@media (max-width: 720px){.btn{height:36px;padding:0 14px}.btn-sm{height:32px;padding:0 12px}.btn-xs{height:30px;padding:0 12px}.icon-btn{width:34px;height:34px}.seg-btn{height:34px;padding:0 13px}.input,.select{height:38px;padding:0 12px}.textarea{min-height:76px;padding:10px 12px}.toggle-btn{height:38px}.tag{height:24px;line-height:22px;padding:0 9px}.dot{width:7px;height:7px}.dialog{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:90vh;max-height:90dvh}.dialog-head{padding:14px 16px 10px!important}.dialog-body{padding:14px 16px!important}.dialog-btns{padding:10px 16px calc(12px + env(safe-area-inset-bottom))!important;gap:10px}.dialog-btns .btn{flex:1;height:40px}.form-grid{grid-template-columns:1fr!important}.card{border-radius:12px}.section,.sec{padding:12px}.stat-num{font-size:20px}.empty{padding:22px 12px}input.input,select.select,textarea.textarea{width:100%;box-sizing:border-box}.btn{touch-action:manipulation}.drawer{top:auto!important;left:0!important;width:100%!important;height:min(86vh,86dvh)!important;border-left:none!important;border-top:1px solid var(--border);border-radius:14px 14px 0 0!important;box-shadow:0 -8px 24px #1018281a}.drawer-enter-active,.drawer-leave-active{transition:transform .2s ease,opacity .2s ease}.drawer-enter-from,.drawer-leave-to{transform:translateY(28px);opacity:0}.drawer-head{border-radius:14px 14px 0 0}.drawer-body{padding:12px!important}.tx-table{min-width:0!important}.tx-table thead{display:none!important}.tx-table tr{display:block;padding:10px 12px;border-bottom:1px solid var(--border);background:transparent}.tx-table tbody tr:last-child{border-bottom:none}.tx-table td{display:flex!important;align-items:center;justify-content:space-between;gap:12px;padding:3px 0!important;border:none!important;white-space:normal!important}.tx-table td:before{content:attr(data-label);color:var(--text-3);font-size:12px;flex:none}.tx-table td.ops-cell:before{content:none}.tx-table td.ops-cell{justify-content:flex-end;flex-wrap:wrap;gap:8px}.tx-table td.ops-cell .btn{flex:none}.tx-table td.empty{justify-content:center}.tx-table td.empty:before{content:none!important}.table-card,.tx-card{overflow-x:auto}.cred-table{min-width:560px!important}.th-ops{width:auto!important}.vault-toolbar{flex-wrap:wrap;row-gap:8px}.vault-toolbar .search-wrap{width:100%;max-width:none!important}.vault-toolbar .flex1{display:none}.vault-toolbar .btn{flex:none}.cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.stat-card{padding:12px 14px!important}.rule-grid,.two-col{grid-template-columns:1fr!important}.cal-toolbar{margin-bottom:10px}.cal-cell{min-height:58px!important;padding:5px 6px!important}.cal-marks{margin-top:4px!important;height:14px!important;gap:4px!important}} +.confirm-dialog[data-v-1f3675f2]{width:400px;padding:22px 22px 18px}.confirm-body[data-v-1f3675f2]{display:flex;gap:14px;align-items:flex-start}.confirm-badge[data-v-1f3675f2]{width:40px;height:40px;flex:none;border-radius:50%;background:#fdeeee;color:var(--danger);display:flex;align-items:center;justify-content:center}.confirm-text[data-v-1f3675f2]{flex:1;min-width:0}.confirm-title[data-v-1f3675f2]{font-size:15px;font-weight:600;color:var(--text-1);line-height:1.4}.confirm-title.is-danger[data-v-1f3675f2]{color:var(--danger)}.confirm-msg[data-v-1f3675f2]{margin-top:6px;color:var(--text-2);font-size:13px;line-height:1.7;word-break:break-all}.confirm-btns[data-v-1f3675f2]{margin-top:18px;display:flex;justify-content:flex-end;gap:8px}.modal-enter-active[data-v-1f3675f2],.modal-leave-active[data-v-1f3675f2]{transition:opacity .15s ease}.modal-enter-from[data-v-1f3675f2],.modal-leave-to[data-v-1f3675f2]{opacity:0}@media (max-width: 720px){.confirm-dialog[data-v-1f3675f2]{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}.confirm-btns .btn[data-v-1f3675f2]{flex:1;height:40px}.confirm-btns[data-v-1f3675f2]{margin-top:16px}}.dialog[data-v-91c30038]{width:560px}.min-chips[data-v-91c30038]{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}.min-chip[data-v-91c30038]{border:1px solid var(--border-strong);background:var(--bg-page);border-radius:999px;height:24px;padding:0 10px;font-size:12px;color:var(--text-2);cursor:pointer;transition:all .12s}.min-chip[data-v-91c30038]:hover{background:var(--bg-hover)}.min-chip.on[data-v-91c30038]{background:var(--accent-bg);border-color:var(--accent);color:var(--accent)}.dp-head[data-v-81276f4c]{margin-bottom:12px}.dp-date[data-v-81276f4c]{font-size:14px;font-weight:600}.att-grid[data-v-81276f4c]{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}.att-cell label[data-v-81276f4c]{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.att-val[data-v-81276f4c]{display:flex;align-items:center;gap:6px;min-height:32px;font-size:13px}.att-val>.num[data-v-81276f4c]{font-size:14px;font-weight:600;letter-spacing:.2px}.val-empty[data-v-81276f4c]{color:var(--text-3)}.edit-row[data-v-81276f4c]{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.time-input[data-v-81276f4c]{width:104px}.att-note[data-v-81276f4c]{margin-top:10px;font-size:12px}.att-actions[data-v-81276f4c]{display:flex;gap:8px;margin-top:12px;flex-wrap:wrap}.form-footer[data-v-81276f4c]{display:flex;justify-content:flex-end;gap:8px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}.list-sec[data-v-81276f4c]{margin-bottom:4px}.sec-head[data-v-81276f4c]{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:10px}.sec-head .sec-title[data-v-81276f4c]{margin-bottom:0}.item[data-v-81276f4c]{border:1px solid var(--border);border-radius:var(--radius-sm);padding:9px 12px;margin-bottom:6px;background:var(--bg-subtle);transition:border-color .12s,background .12s}.item[data-v-81276f4c]:hover{border-color:var(--border-strong);background:var(--bg-page)}.item-main[data-v-81276f4c]{display:flex;align-items:center;gap:8px;min-height:26px;flex-wrap:wrap}.item-content[data-v-81276f4c]{cursor:text;word-break:break-all;font-weight:500}.item-meta[data-v-81276f4c]{font-size:12px}.item-sub[data-v-81276f4c]{margin-top:6px;padding-top:6px;border-top:1px dashed var(--border);font-size:12px;display:flex;flex-direction:column;gap:2px}.dp-foot[data-v-81276f4c]{margin-top:10px;font-size:12px;text-align:right}@media (max-width: 720px){.dp-head[data-v-81276f4c]{margin-bottom:10px}.att-grid[data-v-81276f4c]{grid-template-columns:1fr 1fr;gap:10px 12px}.att-cell label[data-v-81276f4c]{margin-bottom:3px}.att-actions[data-v-81276f4c]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.att-actions .btn[data-v-81276f4c]{width:100%}.edit-row[data-v-81276f4c]{flex-wrap:wrap}.edit-row .time-input[data-v-81276f4c]{width:100%;flex:1 1 100%}.edit-row .btn[data-v-81276f4c]{flex:1}.item-main[data-v-81276f4c]{gap:6px}}.cal-toolbar[data-v-abd71a5b]{display:flex;align-items:center;gap:10px;margin-bottom:12px}.cal-title[data-v-abd71a5b]{font-size:14px;font-weight:600;min-width:96px;text-align:center}.cal-card[data-v-abd71a5b]{padding:0;overflow:hidden}.cal-head[data-v-abd71a5b],.cal-grid[data-v-abd71a5b]{display:grid;grid-template-columns:repeat(7,1fr);gap:1px;background:var(--border)}.cal-week[data-v-abd71a5b]{background:var(--bg-subtle);text-align:center;padding:7px 0;font-size:12px;font-weight:500;color:var(--text-3)}.cal-cell[data-v-abd71a5b]{min-height:92px;padding:6px 8px;text-align:left;background:var(--bg-page);border:none;cursor:pointer;display:block;font-size:13px;transition:background .12s}.cal-cell[data-v-abd71a5b]:hover{background:var(--bg-subtle)}.cal-cell.blank[data-v-abd71a5b]{cursor:default;background:var(--bg-subtle)}.cal-cell.is-today[data-v-abd71a5b]{background:#f5f9ff}.cal-cell.selected[data-v-abd71a5b]{background:var(--accent-bg);box-shadow:inset 0 0 0 2px var(--accent)}.daynum.today[data-v-abd71a5b]{color:var(--accent);font-weight:600}.cal-cell.weekend .daynum[data-v-abd71a5b]{color:var(--text-3)}.cal-marks[data-v-abd71a5b]{display:flex;align-items:center;gap:4px;margin-top:8px;height:14px}.mark-log[data-v-abd71a5b]{color:var(--text-3)}.mark-star[data-v-abd71a5b]{color:var(--accent)}.drawer[data-v-abd71a5b]{position:fixed;top:0;right:0;bottom:0;width:min(440px,100%);background:var(--bg-page);border-left:1px solid var(--border);box-shadow:var(--shadow-float);z-index:20;display:flex;flex-direction:column}.drawer-head[data-v-abd71a5b]{height:48px;flex:none;display:flex;align-items:center;justify-content:space-between;padding:0 16px;border-bottom:1px solid var(--border)}.drawer-title[data-v-abd71a5b]{font-weight:600}.drawer-body[data-v-abd71a5b]{flex:1;overflow:auto;padding:16px}.drawer-enter-active[data-v-abd71a5b],.drawer-leave-active[data-v-abd71a5b]{transition:opacity .15s ease}.drawer-enter-from[data-v-abd71a5b],.drawer-leave-to[data-v-abd71a5b]{opacity:0}@media (max-width: 720px){.cal-title[data-v-abd71a5b]{min-width:76px;font-size:13px}.drawer[data-v-abd71a5b]{width:100%}}.detail-page[data-v-2bb84c76]{display:flex;flex-direction:column}.toolbar[data-v-2bb84c76]{padding:10px 16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:12px}.nav-row[data-v-2bb84c76]{display:flex;align-items:center;gap:6px}.date-title[data-v-2bb84c76]{font-size:14px;font-weight:600;min-width:170px;text-align:center}.date-title.is-today[data-v-2bb84c76]{color:var(--accent)}.w-date[data-v-2bb84c76]{width:150px;flex:none}.tool-sep[data-v-2bb84c76]{width:1px;align-self:stretch;background:var(--border)}.exp-row[data-v-2bb84c76]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.exp-label[data-v-2bb84c76]{font-size:12px}.w-exp[data-v-2bb84c76]{width:140px;flex:none}@media (max-width: 720px){.tool-sep[data-v-2bb84c76]{display:none}.toolbar[data-v-2bb84c76]{padding:10px 12px;gap:10px}.nav-row[data-v-2bb84c76]{flex:1 1 100%}.date-title[data-v-2bb84c76]{min-width:0;flex:1;text-align:left}.w-date[data-v-2bb84c76]{flex:1;min-width:120px;width:auto}.exp-row[data-v-2bb84c76]{width:100%}.exp-row .seg[data-v-2bb84c76]{flex:1;display:flex}.exp-row .seg-btn[data-v-2bb84c76]{flex:1;padding:0 6px}.w-exp[data-v-2bb84c76]{flex:1;min-width:0;width:auto}}.plan-page[data-v-ffd19b28]{display:flex;flex-direction:column}.blk-head[data-v-ffd19b28]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:4px 2px 10px}.blk-head-text[data-v-ffd19b28]{min-width:0}.blk-title[data-v-ffd19b28]{font-size:14px;font-weight:600}.blk-sub[data-v-ffd19b28]{font-size:12px;margin-top:1px}.day-head[data-v-ffd19b28]{margin-top:18px}.day-ops[data-v-ffd19b28]{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.date-chip[data-v-ffd19b28]{min-width:74px;text-align:center;font-weight:600;font-size:13px}.date-chip.today[data-v-ffd19b28]{color:var(--accent)}.timer-live[data-v-ffd19b28]{color:var(--accent);font-weight:600}.goal-card[data-v-ffd19b28]{display:flex;align-items:flex-start;gap:12px;padding:14px 16px;margin-bottom:10px}.goal-main[data-v-ffd19b28]{flex:1;min-width:0}.goal-line[data-v-ffd19b28]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.goal-name[data-v-ffd19b28]{font-size:14px;font-weight:500;word-break:break-all}.goal-range[data-v-ffd19b28]{font-size:12px}.goal-bar[data-v-ffd19b28]{height:6px;border-radius:3px;background:var(--bg-subtle);overflow:hidden;margin-top:10px}.goal-bar-fill[data-v-ffd19b28]{display:block;height:100%;background:var(--accent);border-radius:3px}.goal-meta[data-v-ffd19b28]{font-size:12px;margin-top:6px}.goal-ops[data-v-ffd19b28]{display:flex;gap:4px}.list-card[data-v-ffd19b28]{overflow:hidden}.plan-item[data-v-ffd19b28]{display:flex;align-items:flex-start;gap:12px;padding:12px 16px;border-bottom:1px solid var(--border)}.plan-item[data-v-ffd19b28]:last-child{border-bottom:none}.plan-item.done[data-v-ffd19b28]{opacity:.6}.plan-item.skip[data-v-ffd19b28]{opacity:.48}.plan-item.running[data-v-ffd19b28]{box-shadow:inset 3px 0 0 var(--accent)}.pi-time[data-v-ffd19b28]{font-size:13px;font-weight:600;min-width:92px;padding-top:2px}.pi-main[data-v-ffd19b28]{flex:1;min-width:0}.pi-title[data-v-ffd19b28]{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.pi-text[data-v-ffd19b28]{font-size:14px;font-weight:500;word-break:break-all}.pi-text.strike[data-v-ffd19b28]{text-decoration:line-through}.state-done[data-v-ffd19b28]{color:var(--ok);font-size:12px}.state-skip[data-v-ffd19b28]{color:var(--text-3);font-size:12px}.pi-note[data-v-ffd19b28],.pi-meta[data-v-ffd19b28]{font-size:12px;margin-top:3px}.pi-ops[data-v-ffd19b28]{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}.timer-on[data-v-ffd19b28]{color:var(--accent);border-color:var(--accent)}.empty[data-v-ffd19b28]{padding:28px 16px}.dialog[data-v-ffd19b28]{width:420px}.form-row[data-v-ffd19b28]{display:flex;flex-direction:column;gap:5px;margin-top:10px}.form-row.two[data-v-ffd19b28]{flex-direction:row;gap:10px}.form-row.two>div[data-v-ffd19b28]{flex:1;display:flex;flex-direction:column;gap:5px}.goal-hint[data-v-ffd19b28]{font-size:12px;margin-top:8px}@media (max-width: 720px){.blk-head[data-v-ffd19b28]{margin:0 0 10px}.day-head[data-v-ffd19b28]{margin-top:16px}.day-ops[data-v-ffd19b28]{width:100%}.day-ops .btn[data-v-ffd19b28]{flex:1;min-width:0}.day-ops .btn-primary[data-v-ffd19b28]{flex:1.5}.date-chip[data-v-ffd19b28]{min-width:64px}.plan-item[data-v-ffd19b28]{flex-wrap:wrap;padding:12px;gap:10px}.pi-time[data-v-ffd19b28]{min-width:0;padding-top:0}.pi-ops[data-v-ffd19b28]{width:100%;justify-content:flex-start;gap:8px}.pi-ops .btn-xs[data-v-ffd19b28]{flex:1;min-height:32px}.goal-card[data-v-ffd19b28]{position:relative;flex-direction:column;gap:8px}.goal-main[data-v-ffd19b28]{padding-right:0}.goal-line[data-v-ffd19b28]{padding-right:72px}.goal-ops[data-v-ffd19b28]{position:absolute;top:10px;right:8px}}.cards[data-v-5469ae68]{display:grid;grid-template-columns:repeat(4,1fr);gap:12px}.section[data-v-5469ae68]{margin-top:12px}.heat[data-v-5469ae68]{display:flex;gap:3px;overflow-x:auto;padding-bottom:4px}.heat-col[data-v-5469ae68]{display:flex;flex-direction:column;gap:3px}.heat-cell[data-v-5469ae68]{width:12px;height:12px;border-radius:3px;display:inline-block}.lv0[data-v-5469ae68]{background:var(--bg-subtle);border:1px solid var(--border)}.lv1[data-v-5469ae68]{background:#e4eeff}.lv2[data-v-5469ae68]{background:#bfd6ff}.lv3[data-v-5469ae68]{background:#7fa8f5}.lv4[data-v-5469ae68]{background:var(--accent)}.heat-legend[data-v-5469ae68]{display:flex;align-items:center;gap:3px;margin-top:10px;font-size:12px}.two-col[data-v-5469ae68]{display:grid;grid-template-columns:1fr 1fr;gap:12px}.two-col .section[data-v-5469ae68]{margin-top:0}.bar-label[data-v-5469ae68]{width:72px}.bar-num[data-v-5469ae68]{width:92px}.loc-label[data-v-5469ae68]{width:110px;text-align:left}@media (max-width: 720px){.cards[data-v-5469ae68]{grid-template-columns:repeat(2,1fr)}.two-col[data-v-5469ae68]{grid-template-columns:1fr}.two-col .section[data-v-5469ae68]{margin-top:12px}}.report-toolbar[data-v-7e1b08ed]{display:flex;align-items:center;gap:10px;margin-bottom:12px;flex-wrap:wrap}.ai-error[data-v-7e1b08ed]{color:var(--danger);font-size:12px;margin:0 0 8px}.w-date[data-v-7e1b08ed]{width:140px;flex:none}.report-grid[data-v-7e1b08ed]{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:12px;align-items:start}.section-title[data-v-7e1b08ed]{margin-bottom:10px}.section+.section[data-v-7e1b08ed]{margin-top:12px}.note-label[data-v-7e1b08ed]{display:block;font-size:12px;margin:8px 0 4px}.note-saved[data-v-7e1b08ed]{font-size:12px;margin-top:6px}.md-editor[data-v-7e1b08ed]{min-height:420px;line-height:1.7}.sum-row[data-v-7e1b08ed]{display:flex;justify-content:space-between;padding:3px 0;font-size:12px}.sum-row span[data-v-7e1b08ed]:last-child{font-weight:500}.section-sub[data-v-7e1b08ed]{font-weight:600;margin:12px 0 4px;font-size:12px;color:var(--text-2)}.sum-item[data-v-7e1b08ed]{font-size:12px;padding:2px 0;word-break:break-all}.sum-empty[data-v-7e1b08ed]{font-size:12px}@media (max-width: 960px){.report-grid[data-v-7e1b08ed]{grid-template-columns:1fr}}@media (max-width: 720px){.report-toolbar[data-v-7e1b08ed]{gap:8px}.report-toolbar .seg[data-v-7e1b08ed]{flex:1 1 100%;display:flex}.report-toolbar .seg-btn[data-v-7e1b08ed]{flex:1}.w-date[data-v-7e1b08ed]{flex:1;min-width:0;width:auto}.md-editor[data-v-7e1b08ed]{min-height:300px}}.dialog[data-v-e9a4e878]{width:480px}.add-cat[data-v-e9a4e878]{display:flex;gap:6px;margin-top:6px}.amt-input[data-v-e9a4e878]{height:38px;font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}@media (max-width: 720px){.dialog-btns .btn[data-v-e9a4e878]{flex:1;height:40px}}.add-cat-input[data-v-e9a4e878]{flex:1;height:28px;font-size:12px}@media (max-width: 720px){.add-cat-input[data-v-e9a4e878],.add-cat .btn[data-v-e9a4e878]{height:34px}}.period-dialog[data-v-6269639e]{width:400px}.seg-row[data-v-6269639e]{display:flex;width:100%}.seg-row .seg-btn[data-v-6269639e]{flex:1}.pane[data-v-6269639e]{margin-top:12px;max-height:46vh;overflow-y:auto;display:flex;flex-direction:column;gap:4px}.opt[data-v-6269639e]{display:flex;align-items:center;justify-content:space-between;gap:8px;border:none;background:transparent;cursor:pointer;padding:8px 10px;border-radius:var(--radius-sm);font-size:13px;color:var(--text-1);text-align:left;transition:background .12s}.opt[data-v-6269639e]:hover{background:var(--bg-hover)}.opt.active[data-v-6269639e]{background:#3370ff14;color:var(--accent);font-weight:600}.opt.active .muted[data-v-6269639e]{color:var(--accent);opacity:.75}.anchor-row[data-v-6269639e]{display:flex;align-items:center;gap:8px}.anchor-label[data-v-6269639e]{font-size:12px;color:var(--text-2);flex:none}.anchor-row .input[data-v-6269639e]{flex:1;min-width:0}.hint[data-v-6269639e]{font-size:12px;color:var(--text-3);padding:4px 2px}.custom-grid[data-v-6269639e]{display:grid;grid-template-columns:1fr 1fr;gap:8px}.apply-btn[data-v-6269639e]{width:100%;margin-top:6px}.modal-enter-active[data-v-6269639e],.modal-leave-active[data-v-6269639e]{transition:opacity .15s ease}.modal-enter-from[data-v-6269639e],.modal-leave-to[data-v-6269639e]{opacity:0}@media (max-width: 720px){.period-dialog[data-v-6269639e]{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}.dialog-btns .btn[data-v-6269639e]{flex:1;height:40px}.pane[data-v-6269639e]{max-height:48vh}}.ledger-toolbar[data-v-f021b1ed]{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}.period-title[data-v-f021b1ed]{display:inline-flex;align-items:center;justify-content:center;gap:5px;border:none;background:transparent;cursor:pointer;font-size:14px;font-weight:600;color:var(--text-1);padding:5px 10px;border-radius:var(--radius-sm);transition:background .12s}.period-title[data-v-f021b1ed]:hover{background:var(--bg-hover)}.w-filter[data-v-f021b1ed]{width:110px;flex:none}.icon-btn[data-v-f021b1ed]:disabled{opacity:.35;cursor:default}.cards[data-v-f021b1ed]{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:12px}.stat-card[data-v-f021b1ed]{border-left:3px solid var(--border)}.stat-income[data-v-f021b1ed]{border-left-color:var(--ok)}.stat-expense[data-v-f021b1ed]{border-left-color:var(--text-3)}.stat-balance[data-v-f021b1ed]{border-left-color:var(--accent)}.stat-pending[data-v-f021b1ed]{border-left-color:var(--warn)}.card.sec[data-v-f021b1ed],.card.section[data-v-f021b1ed]{margin-top:12px}.sec-head[data-v-f021b1ed]{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:12px}.sec-head .sec-title[data-v-f021b1ed]{margin-bottom:0}.legend[data-v-f021b1ed]{display:inline-flex;align-items:center;gap:5px;font-size:12px}.legend .lg[data-v-f021b1ed]{width:8px;height:8px;border-radius:2px;display:inline-block;margin-left:8px}.legend .lg[data-v-f021b1ed]:first-child{margin-left:0}.chart-wrap[data-v-f021b1ed]{min-width:0}.chart[data-v-f021b1ed]{display:flex;align-items:stretch;gap:3px;height:110px}.chart-col[data-v-f021b1ed]{flex:1;min-width:0;display:flex}.chart-bars[data-v-f021b1ed]{flex:1;display:flex;align-items:flex-end;justify-content:center;gap:2px}.cbar[data-v-f021b1ed]{width:6px;max-width:12px;border-radius:2px 2px 0 0;min-height:0}.cbar-income[data-v-f021b1ed]{background:var(--ok);opacity:.85}.cbar-expense[data-v-f021b1ed]{background:var(--text-3);opacity:.8}.chart-axis[data-v-f021b1ed]{display:flex;gap:3px;border-top:1px solid var(--border);margin-top:0}.chart-label[data-v-f021b1ed]{flex:1;min-width:0;text-align:center;font-size:10px;color:var(--text-3);line-height:18px;height:18px;overflow:hidden;white-space:nowrap}.chart-hint[data-v-f021b1ed]{font-size:12px;margin-bottom:6px}.chart-col:hover .cbar-income[data-v-f021b1ed],.chart-col:hover .cbar-expense[data-v-f021b1ed]{opacity:1}.chip-row[data-v-f021b1ed]{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}.chip[data-v-f021b1ed]{height:24px;padding:0 10px;border:1px solid var(--border-strong);border-radius:999px;background:var(--bg-page);color:var(--text-2);font-size:12px;cursor:pointer;white-space:nowrap;transition:all .12s}.chip[data-v-f021b1ed]:hover{background:var(--bg-hover)}.chip.active[data-v-f021b1ed]{background:var(--accent-bg);border-color:var(--accent);color:var(--accent);font-weight:500}.sel-strip[data-v-f021b1ed]{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;background:var(--accent-bg);border-radius:var(--radius-sm);padding:7px 10px;font-size:12px;color:var(--accent);margin-bottom:10px}.bar-row[data-v-f021b1ed]{display:flex;align-items:center;gap:8px;margin:8px 0;transition:opacity .12s}.bar-row.dim[data-v-f021b1ed]{opacity:.4}.cat-dot[data-v-f021b1ed]{width:8px;height:8px;border-radius:2px;flex:none}.bar-label[data-v-f021b1ed]{flex:none;width:72px;color:var(--text-2);font-size:12px;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.bar-track[data-v-f021b1ed]{flex:1;height:8px;border-radius:4px;background:var(--bg-subtle);overflow:hidden}.bar-amt[data-v-f021b1ed]{flex:none;width:88px;text-align:right;font-size:12px}.bar-pct[data-v-f021b1ed]{flex:none;width:38px;text-align:right;font-size:12px}.td-note[data-v-f021b1ed]{color:var(--text-2)}.tx-pending[data-v-f021b1ed]{color:var(--warn);font-size:12px}.tx-done[data-v-f021b1ed]{color:var(--ok);font-size:12px}.th-ops[data-v-f021b1ed]{width:220px}.ops[data-v-f021b1ed]{display:flex;gap:4px;flex-wrap:wrap}.table-card[data-v-f021b1ed]{overflow-x:auto}.table-note[data-v-f021b1ed]{margin-top:10px;font-size:12px;text-align:right}@media (max-width: 720px){.ledger-toolbar[data-v-f021b1ed]{gap:8px}.ledger-toolbar .flex1[data-v-f021b1ed]{display:none}.period-title[data-v-f021b1ed]{flex:1;justify-content:flex-start;padding-left:0}.w-filter[data-v-f021b1ed]{flex:1 1 calc(50% - 4px);min-width:0;width:auto}.ledger-toolbar .btn-primary[data-v-f021b1ed]{flex:1 1 100%;order:9}.chart[data-v-f021b1ed]{overflow-x:auto}.chart-col[data-v-f021b1ed]{min-width:11px}.cbar[data-v-f021b1ed]{width:4px}.bar-label[data-v-f021b1ed]{width:60px}.bar-amt[data-v-f021b1ed]{width:78px}}.memo-page[data-v-a0931fc7]{display:grid;grid-template-columns:280px minmax(0,1fr);gap:12px;align-items:stretch}.memo-list[data-v-a0931fc7]{display:flex;flex-direction:column;max-height:calc(100vh - 150px)}.pane-head[data-v-a0931fc7]{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 10px;border-bottom:1px solid var(--border);flex:none}.pane-title[data-v-a0931fc7]{font-size:13px;font-weight:600}.memo-scroll[data-v-a0931fc7]{overflow:auto;padding:6px}.memo-item[data-v-a0931fc7]{padding:8px 10px;border-radius:var(--radius-sm);cursor:pointer;margin-bottom:2px}.memo-item[data-v-a0931fc7]:hover{background:var(--bg-hover)}.memo-item.active[data-v-a0931fc7]{background:var(--accent-bg)}.memo-item.active .memo-item-title[data-v-a0931fc7]{color:var(--accent)}.memo-item-title[data-v-a0931fc7]{font-size:13px;font-weight:500;word-break:break-all}.memo-item-sub[data-v-a0931fc7]{font-size:12px;margin-top:2px;word-break:break-all}.memo-item-time[data-v-a0931fc7]{font-size:11px;margin-top:2px}.memo-editor[data-v-a0931fc7]{padding:16px 18px;min-height:420px;display:flex;flex-direction:column}.title-input[data-v-a0931fc7]{font-size:15px;font-weight:600;margin-bottom:10px}.content-textarea[data-v-a0931fc7]{flex:1;min-height:340px;line-height:1.8}.editor-foot[data-v-a0931fc7]{display:flex;align-items:center;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--border)}.foot-info[data-v-a0931fc7]{font-size:12px}.editor-empty[data-v-a0931fc7]{display:flex;align-items:center;justify-content:center;flex:1;padding:60px 0}@media (max-width: 800px){.memo-page[data-v-a0931fc7]{grid-template-columns:1fr;gap:10px}.memo-list[data-v-a0931fc7]{max-height:210px}.content-textarea[data-v-a0931fc7]{min-height:260px}.title-input[data-v-a0931fc7]{height:38px}.editor-foot[data-v-a0931fc7]{flex-wrap:wrap}.editor-foot .btn[data-v-a0931fc7]{flex:1;min-height:34px}}.dialog[data-v-2eafe20e]{width:480px}.pwd-row[data-v-2eafe20e]{display:flex;gap:8px}.pwd-row .input[data-v-2eafe20e]{flex:1}.lock-card[data-v-6d2745bc]{max-width:380px;margin:60px auto 0;padding:28px 24px;text-align:center;display:flex;flex-direction:column;gap:10px}.lock-badge[data-v-6d2745bc]{width:52px;height:52px;margin:0 auto;border-radius:50%;background:var(--accent-bg);color:var(--accent);display:flex;align-items:center;justify-content:center}.lock-title[data-v-6d2745bc]{font-size:15px;font-weight:600}.lock-tip[data-v-6d2745bc]{font-size:12px;line-height:1.7}.lock-btn[data-v-6d2745bc]{margin-top:4px}.vault-toolbar[data-v-6d2745bc]{display:flex;align-items:center;gap:8px;margin-bottom:12px;flex-wrap:wrap}.search-wrap[data-v-6d2745bc]{position:relative;width:280px;max-width:100%}.search-wrap .input[data-v-6d2745bc]{padding-left:30px}.search-icon[data-v-6d2745bc]{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--text-3)}.table-card[data-v-6d2745bc]{overflow-x:auto}.td-system[data-v-6d2745bc]{font-weight:500}.th-ops[data-v-6d2745bc]{width:150px}.pwd-cell[data-v-6d2745bc]{display:flex;align-items:center;gap:4px;flex-wrap:wrap}.pwd-text[data-v-6d2745bc]{letter-spacing:1px;font-family:ui-monospace,SFMono-Regular,Consolas,monospace}.copyable[data-v-6d2745bc]{cursor:pointer}.copyable[data-v-6d2745bc]:hover{color:var(--accent)}.ops[data-v-6d2745bc]{display:flex;gap:4px;flex-wrap:wrap}.table-note[data-v-6d2745bc]{margin-top:10px;font-size:12px;text-align:right}.dialog[data-v-6d2745bc]{width:440px}.vp-field[data-v-6d2745bc]{margin-bottom:10px}.vp-tip[data-v-6d2745bc]{font-size:12px;margin-top:8px}.input-dialog[data-v-4b14ba4f]{width:400px}.field label[data-v-4b14ba4f]{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.modal-enter-active[data-v-4b14ba4f],.modal-leave-active[data-v-4b14ba4f]{transition:opacity .15s ease}.modal-enter-from[data-v-4b14ba4f],.modal-leave-to[data-v-4b14ba4f]{opacity:0}@media (max-width: 720px){.input-dialog[data-v-4b14ba4f]{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important}.dialog-btns .btn[data-v-4b14ba4f]{flex:1;height:40px}}.settings[data-v-10f77319]{display:flex;flex-direction:column;gap:12px;max-width:640px}.acc-line[data-v-10f77319]{font-size:12px;margin-bottom:10px;line-height:1.7}.rule-grid[data-v-10f77319]{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px}.rule-item label[data-v-10f77319]{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.rule-save[data-v-10f77319]{display:flex;align-items:center;gap:10px;margin-top:12px;flex-wrap:wrap}.proj-add[data-v-10f77319]{display:flex;gap:8px}.proj-tip[data-v-10f77319]{font-size:12px;margin-top:6px}.proj-row[data-v-10f77319]{display:flex;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--border)}.proj-row[data-v-10f77319]:last-child{border-bottom:none}.proj-name[data-v-10f77319]{flex:1;word-break:break-all}.proj-name.archived[data-v-10f77319]{color:var(--text-3);text-decoration:line-through}.loc-note[data-v-10f77319]{font-size:12px}.ai-grid[data-v-10f77319]{display:flex;flex-direction:column;gap:10px}.backup-row[data-v-10f77319]{display:flex;gap:8px;flex-wrap:wrap}.cat-block[data-v-10f77319]{margin-top:12px}.cat-block[data-v-10f77319]:first-of-type{margin-top:0}.cat-head[data-v-10f77319]{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;font-size:12px}.cat-chips[data-v-10f77319]{display:flex;flex-wrap:wrap;gap:6px}.cat-chip[data-v-10f77319]{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--border);border-radius:999px;padding:2px 8px;font-size:12px;background:var(--bg-subtle)}.chip-btn[data-v-10f77319]{border:none;background:transparent;color:var(--text-3);cursor:pointer;font-size:11px;padding:0 1px}.chip-btn[data-v-10f77319]:hover{color:var(--accent)}.import-error[data-v-10f77319]{color:var(--danger);font-size:12px;margin-top:8px}.backup-note[data-v-10f77319]{font-size:12px;margin-top:10px}.tp[data-v-a8f9ed22]{position:fixed;right:20px;bottom:20px;z-index:40;display:flex;align-items:center;gap:10px;min-width:0;max-width:340px;padding:10px 12px;background:var(--bg-page);border:1px solid var(--border);border-radius:12px;box-shadow:var(--shadow-float);cursor:pointer;text-align:left;transition:border-color .12s}.tp[data-v-a8f9ed22]:hover{border-color:var(--border-strong)}.tp-pulse[data-v-a8f9ed22]{width:9px;height:9px;border-radius:50%;background:var(--accent);position:relative;flex:none}.tp-pulse[data-v-a8f9ed22]:after{content:"";position:absolute;top:-4px;right:-4px;bottom:-4px;left:-4px;border-radius:50%;border:2px solid var(--accent);animation:tp-ring-a8f9ed22 1.6s ease-out infinite}@keyframes tp-ring-a8f9ed22{0%{transform:scale(.5);opacity:.6}to{transform:scale(1.5);opacity:0}}.tp-main[data-v-a8f9ed22]{display:flex;flex-direction:column;min-width:0}.tp-title[data-v-a8f9ed22]{font-size:13px;font-weight:600;color:var(--text-1);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tp-meta[data-v-a8f9ed22]{font-size:11px;color:var(--text-3)}.tp-time[data-v-a8f9ed22]{font-size:16px;font-weight:600;color:var(--accent);font-variant-numeric:tabular-nums;margin-left:2px;flex:none}.tp-stop[data-v-a8f9ed22]{flex:none;font-size:12px;color:var(--text-2);border:1px solid var(--border-strong);border-radius:var(--radius-sm);padding:3px 10px;transition:all .12s}.tp-stop[data-v-a8f9ed22]:hover{color:var(--danger);border-color:var(--danger);background:#fdf0f0}.tp-enter-active[data-v-a8f9ed22],.tp-leave-active[data-v-a8f9ed22]{transition:all .2s ease}.tp-enter-from[data-v-a8f9ed22],.tp-leave-to[data-v-a8f9ed22]{opacity:0;transform:translateY(10px)}@media (max-width: 720px){.tp[data-v-a8f9ed22]{left:12px;right:12px;bottom:calc(64px + env(safe-area-inset-bottom));max-width:none}}.admin-page[data-v-2d48d2c9]{display:flex;flex-direction:column;gap:12px;max-width:860px}.toolbar[data-v-2d48d2c9]{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--border);flex-wrap:wrap}.head-wrap[data-v-2d48d2c9]{flex:1;min-width:0}.tb-title[data-v-2d48d2c9]{font-weight:600;font-size:14px}.tb-sub[data-v-2d48d2c9]{font-size:12px;margin-top:2px}.tb-error[data-v-2d48d2c9]{padding:8px 16px 0}.table-card[data-v-2d48d2c9]{overflow-x:auto}.admin-table td[data-v-2d48d2c9]{white-space:nowrap}.td-name[data-v-2d48d2c9]{font-weight:500}.role-badge[data-v-2d48d2c9]{display:inline-flex;align-items:center;background:var(--accent-bg);color:var(--accent);border-radius:999px;font-size:12px;line-height:18px;padding:1px 9px}.load-line[data-v-2d48d2c9]{padding:12px 16px;font-size:12px}.admin-note[data-v-2d48d2c9]{font-size:12px;padding:0 2px}.ops[data-v-2d48d2c9]{display:inline-flex;gap:6px}.form-row[data-v-2d48d2c9]{display:flex;flex-direction:column;gap:5px;margin-top:10px}.dialog[data-v-2d48d2c9]{width:420px}.empty[data-v-2d48d2c9]{text-align:center}@media (max-width: 720px){.admin-table td[data-v-2d48d2c9],.admin-table th[data-v-2d48d2c9]{white-space:normal}}.login-page[data-v-e9c1c40d]{min-height:100vh;min-height:100dvh;background:linear-gradient(180deg,#EBF0F8 0%,var(--bg-app) 46%);display:flex;align-items:center;justify-content:center;padding:20px}.login-card .input[data-v-e9c1c40d]{height:38px}.login-card[data-v-e9c1c40d]{width:400px;max-width:100%;padding:30px 28px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow-float);border-radius:var(--radius-lg)}.login-brand[data-v-e9c1c40d]{text-align:center;margin-bottom:6px}.brand-icon[data-v-e9c1c40d]{width:46px;height:46px;margin:0 auto 10px;border-radius:12px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center}.login-title[data-v-e9c1c40d]{font-size:18px;font-weight:600;color:var(--text-1)}.login-sub[data-v-e9c1c40d]{font-size:12px;margin-top:4px;line-height:1.7}.form-error[data-v-e9c1c40d]{color:var(--danger);font-size:12px}.login-btn[data-v-e9c1c40d]{margin-top:2px;height:36px}.login-note[data-v-e9c1c40d]{font-size:12px;text-align:center;line-height:1.7}.app[data-v-54c408c4]{display:flex;height:100vh;height:100dvh;overflow:hidden;background:var(--bg-app)}.side[data-v-54c408c4]{width:var(--side-w);flex:none;display:flex;flex-direction:column;background:var(--bg-page);border-right:1px solid var(--border)}.brand[data-v-54c408c4]{display:flex;align-items:center;gap:9px;height:var(--topbar-h);flex:none;padding:0 16px;border-bottom:1px solid var(--border);cursor:pointer}.brand-mark[data-v-54c408c4]{width:26px;height:26px;flex:none;border-radius:7px;background:var(--accent);color:#fff;display:flex;align-items:center;justify-content:center}.brand-name[data-v-54c408c4]{font-size:14px;font-weight:600;letter-spacing:.3px;white-space:nowrap}.side-nav[data-v-54c408c4]{flex:1;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:2px}.nav-group[data-v-54c408c4]{font-size:11px;color:var(--text-3);padding:12px 8px 4px;letter-spacing:2px;white-space:nowrap}.nav-btn[data-v-54c408c4]{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;border:none;background:transparent;border-radius:var(--radius-sm);color:var(--text-2);cursor:pointer;font-size:13px;position:relative;text-align:left;transition:background .12s,color .12s}.nav-btn[data-v-54c408c4]:hover{background:var(--bg-hover);color:var(--text-1)}.nav-btn.active[data-v-54c408c4]{background:var(--accent-bg);color:var(--accent);font-weight:500}.nav-btn.active[data-v-54c408c4]:before{content:"";position:absolute;left:0;top:8px;bottom:8px;width:3px;border-radius:2px;background:var(--accent)}.nav-label[data-v-54c408c4]{white-space:nowrap}.nav-btn[data-v-54c408c4]:after{content:attr(data-tip);position:absolute;left:50px;top:50%;transform:translateY(-50%);background:var(--text-1);color:#fff;font-size:12px;line-height:1.4;padding:2px 8px;border-radius:4px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .15s;z-index:40}.side-foot[data-v-54c408c4]{flex:none;display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid var(--border)}.avatar[data-v-54c408c4]{width:28px;height:28px;flex:none;border-radius:50%;background:var(--accent-bg);color:var(--accent);display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}.foot-name[data-v-54c408c4]{flex:1;min-width:0;font-size:13px;color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.main[data-v-54c408c4]{flex:1;display:flex;flex-direction:column;min-width:0}.topbar[data-v-54c408c4]{height:var(--topbar-h);flex:none;background:var(--bg-page);border-bottom:1px solid var(--border);display:flex;align-items:center;gap:12px;padding:0 20px;z-index:10}.title[data-v-54c408c4]{font-size:15px;font-weight:600;white-space:nowrap}.gsearch[data-v-54c408c4]{position:relative;width:320px;max-width:38vw}.gs-icon[data-v-54c408c4]{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--text-3)}.gs-input[data-v-54c408c4]{height:32px;padding-left:31px;border-radius:999px;background:var(--bg-subtle);border-color:transparent}.gs-input[data-v-54c408c4]:focus{background:var(--bg-page);border-color:var(--accent)}.gs-panel[data-v-54c408c4]{position:absolute;top:38px;left:0;right:0;background:var(--bg-page);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-float);z-index:50;max-height:420px;overflow:auto;padding:6px}.gs-group[data-v-54c408c4]{font-size:12px;padding:6px 8px 2px}.gs-item[data-v-54c408c4]{display:flex;align-items:center;gap:8px;padding:7px 8px;border-radius:var(--radius-sm);cursor:pointer}.gs-item[data-v-54c408c4]:hover{background:var(--bg-hover)}.gs-text[data-v-54c408c4],.gs-sub[data-v-54c408c4]{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.gs-text[data-v-54c408c4]{font-size:13px}.gs-sub[data-v-54c408c4]{font-size:12px}.gs-date[data-v-54c408c4]{font-size:12px;flex:none}.gs-empty[data-v-54c408c4]{padding:10px;font-size:12px;text-align:center}.content[data-v-54c408c4]{flex:1;overflow:auto}.content-inner[data-v-54c408c4]{max-width:1280px;margin:0 auto;padding:20px 24px 48px}.toast-wrap[data-v-54c408c4]{position:fixed;top:68px;right:20px;z-index:60;display:flex;flex-direction:column;gap:8px;align-items:flex-end;pointer-events:none}.toast[data-v-54c408c4]{background:var(--bg-page);border:1px solid var(--border);box-shadow:var(--shadow-float);border-radius:var(--radius-sm);padding:8px 14px;font-size:13px;color:var(--text-1)}.toast-enter-from[data-v-54c408c4],.toast-leave-to[data-v-54c408c4]{opacity:0;transform:translateY(-4px)}.toast-enter-active[data-v-54c408c4],.toast-leave-active[data-v-54c408c4]{transition:all .15s ease}.mob-search-btn[data-v-54c408c4]{display:none;width:32px;height:32px;border:none;background:transparent;border-radius:var(--radius-sm);color:var(--text-2);cursor:pointer;align-items:center;justify-content:center}.tabbar[data-v-54c408c4]{display:none;position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--bg-page);border-top:1px solid var(--border);padding-bottom:env(safe-area-inset-bottom)}.tab-btn[data-v-54c408c4]{flex:1;height:50px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;border:none;background:transparent;color:var(--text-3);cursor:pointer;font-size:11px}.tab-btn.active[data-v-54c408c4]{color:var(--accent);font-weight:500}.sheet-mask[data-v-54c408c4]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;background:#1d212966}.more-sheet[data-v-54c408c4]{position:absolute;left:0;right:0;bottom:0;background:var(--bg-page);border-radius:16px 16px 0 0;padding:6px 14px calc(14px + env(safe-area-inset-bottom));display:flex;flex-direction:column}.sheet-handle[data-v-54c408c4]{width:36px;height:4px;border-radius:2px;background:var(--border-strong);margin:4px auto 8px;flex:none}.sheet-user[data-v-54c408c4]{font-size:12px;color:var(--text-3);padding:4px 6px 10px;border-bottom:1px solid var(--border);margin-bottom:4px}.sheet-row[data-v-54c408c4]{display:flex;align-items:center;gap:12px;height:46px;border:none;background:transparent;color:var(--text-1);font-size:14px;cursor:pointer;border-radius:var(--radius-sm);text-align:left;padding:0 6px}.sheet-row[data-v-54c408c4]:hover,.sheet-row[data-v-54c408c4]:active{background:var(--bg-hover)}.sheet-name[data-v-54c408c4]{flex:1}.sheet-go[data-v-54c408c4]{color:var(--text-3)}.sheet-divider[data-v-54c408c4]{height:1px;background:var(--border);margin:6px 0}.sheet-danger[data-v-54c408c4]{color:var(--danger)}.msw-mask[data-v-54c408c4]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:70;background:var(--bg-page)}.msw[data-v-54c408c4]{height:100%;display:flex;flex-direction:column}.msw-bar[data-v-54c408c4]{height:52px;flex:none;display:flex;align-items:center;gap:8px;padding:0 12px;border-bottom:1px solid var(--border)}.msw-icon[data-v-54c408c4]{color:var(--text-3)}.msw-input[data-v-54c408c4]{flex:1;height:34px;border:none;outline:none;font-size:14px;background:transparent;color:var(--text-1)}.msw-results[data-v-54c408c4]{flex:1;overflow:auto;padding:10px 4px calc(20px + env(safe-area-inset-bottom))}.msw-item[data-v-54c408c4]{display:flex;align-items:center;gap:8px;padding:10px;border-radius:var(--radius-sm);cursor:pointer}.msw-item[data-v-54c408c4]:hover,.msw-item[data-v-54c408c4]:active{background:var(--bg-hover)}@media (max-width: 1000px) and (min-width: 721px){.side[data-v-54c408c4]{width:var(--side-w-collapsed)}.brand[data-v-54c408c4]{justify-content:center;padding:0}.brand-name[data-v-54c408c4],.nav-label[data-v-54c408c4],.nav-group[data-v-54c408c4]{display:none}.nav-btn[data-v-54c408c4]{justify-content:center;padding:0;width:40px;align-self:center}.nav-btn.active[data-v-54c408c4]:before{display:none}.nav-btn[data-v-54c408c4]:hover:after{opacity:1}.side-foot[data-v-54c408c4]{flex-direction:column;gap:6px}.foot-name[data-v-54c408c4]{display:none}}@media (max-width: 720px){.app[data-v-54c408c4]{display:block;height:100dvh}.side[data-v-54c408c4]{display:none}.main[data-v-54c408c4]{display:flex;flex-direction:column;height:100dvh;min-width:0}.topbar[data-v-54c408c4]{height:50px;min-height:50px;padding:0 10px;gap:6px}.title[data-v-54c408c4]{font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gsearch[data-v-54c408c4],.gsearch .gs-panel[data-v-54c408c4]{display:none}.mob-search-btn[data-v-54c408c4]{display:flex}.mob-search-btn[data-v-54c408c4]{margin-left:auto}.tabbar[data-v-54c408c4]{display:flex}.tab-btn[data-v-54c408c4]{height:56px;font-size:11px}.tab-btn .icon[data-v-54c408c4]{width:22px;height:22px}.content[data-v-54c408c4]{flex:1;min-height:0}.content-inner[data-v-54c408c4]{max-width:none;padding:12px 12px calc(78px + env(safe-area-inset-bottom))}.toast-wrap[data-v-54c408c4]{top:6px;right:10px;left:10px;align-items:flex-start}}:root{--bg-app: #F5F6F8;--bg-page: #FFFFFF;--bg-subtle: #F7F8FA;--bg-hover: #F2F3F5;--text-1: #1D2129;--text-2: #4E5969;--text-3: #86909C;--border: #E8EAEE;--border-strong: #DCDFE4;--accent: #3370FF;--accent-deep: #2B5FD9;--accent-bg: #EEF4FF;--ok: #23A757;--warn: #E8842C;--danger: #E5484D;--dot-empty: #C9CDD4;--radius-sm: 6px;--radius-md: 10px;--radius-lg: 14px;--shadow-card: 0 1px 2px rgba(16, 24, 40, .04);--shadow-float: 0 12px 32px -8px rgba(16, 24, 40, .14), 0 4px 12px rgba(16, 24, 40, .06);--side-w: 216px;--side-w-collapsed: 60px;--topbar-h: 56px}*{box-sizing:border-box}html,body{margin:0;padding:0}body{background:var(--bg-app);color:var(--text-1);font-family:-apple-system,PingFang SC,Microsoft YaHei,system-ui,sans-serif;font-size:13px;line-height:1.6;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility}button,input,select,textarea{font:inherit;color:inherit}.num{font-variant-numeric:tabular-nums}.flex1{flex:1;min-width:0}.muted{color:var(--text-3)}.muted2{color:var(--text-2)}:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 14px;height:32px;border-radius:var(--radius-sm);border:1px solid var(--border-strong);background:var(--bg-page);color:var(--text-1);cursor:pointer;white-space:nowrap;font-weight:500;transition:background .12s,border-color .12s,color .12s}.btn:hover{background:var(--bg-hover);border-color:var(--border-strong)}.btn:active{transform:translateY(1px)}.btn:disabled{opacity:.45;cursor:not-allowed}.btn-primary{background:var(--accent);border-color:var(--accent);color:#fff;box-shadow:0 1px 2px #3370ff47}.btn-primary:hover{background:var(--accent-deep);border-color:var(--accent-deep)}.btn-primary:active{box-shadow:none}.btn-danger{color:var(--danger);border-color:var(--danger);background:var(--bg-page)}.btn-danger:hover{background:#fdf0f0}.btn-danger-solid{background:var(--danger);border-color:var(--danger);color:#fff}.btn-danger-solid:hover{background:#d13a3f}.btn-sm{height:28px;padding:0 12px;font-size:12px}.btn-xs{height:24px;padding:0 10px;font-size:12px}.icon-btn{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;flex:none;border:none;background:transparent;border-radius:var(--radius-sm);color:var(--text-3);cursor:pointer;transition:background .12s,color .12s}.icon-btn:hover{background:var(--bg-hover);color:var(--text-1)}.icon-btn.active{color:var(--accent)}.icon-btn.active-warn{color:var(--warn)}.input,.select,.textarea{height:32px;padding:0 10px;border:1px solid var(--border-strong);border-radius:var(--radius-sm);background:var(--bg-page);outline:none;width:100%;transition:border-color .12s,box-shadow .12s}.textarea{height:auto;min-height:64px;padding:8px 10px;resize:vertical;line-height:1.7}.input:focus,.select:focus,.textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px #3370ff1a}.input::placeholder,.textarea::placeholder{color:var(--text-3)}.input.invalid,.input.invalid:focus{border-color:var(--danger);box-shadow:0 0 0 3px #e5484d1a}.card{border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-page);box-shadow:var(--shadow-card)}.section{padding:16px 18px}.section-title,.sec-title{font-weight:600;margin-bottom:12px;font-size:13px;color:var(--text-1)}.sec{padding:16px 18px}.empty{text-align:center;padding:28px 0}.tag{display:inline-block;padding:0 8px;height:22px;line-height:20px;border-radius:4px;font-size:12px;background:var(--bg-subtle);color:var(--text-2);border:1px solid var(--border);white-space:nowrap}.dot{width:6px;height:6px;border-radius:50%;display:inline-block;flex:none}.dot.normal{background:var(--ok)}.dot.late,.dot.early,.dot.incomplete{background:var(--warn)}.dot.absent{background:var(--danger)}.dot.none,.dot.leave{background:var(--dot-empty)}.dot.rest{background:var(--border)}.amt-income{color:var(--ok)}.amt-expense{color:var(--text-1)}.amt-warn{color:var(--warn)}.seg{display:inline-flex;border:1px solid var(--border-strong);border-radius:var(--radius-sm);overflow:hidden;background:var(--bg-page)}.seg-btn{border:none;background:var(--bg-page);color:var(--text-2);cursor:pointer;font-size:12px;height:28px;padding:0 12px;border-right:1px solid var(--border);transition:background .12s,color .12s}.seg-btn:last-child{border-right:none}.seg-btn:hover{background:var(--bg-hover)}.seg-btn.active{background:var(--accent-bg);color:var(--accent);font-weight:500}.toggle-btn{height:32px;width:100%;border:1px solid var(--border-strong);background:var(--bg-page);border-radius:var(--radius-sm);cursor:pointer;font-size:13px;color:var(--text-2);transition:all .12s}.toggle-btn:hover{background:var(--bg-hover)}.toggle-btn.on{color:var(--accent);border-color:var(--accent);background:var(--accent-bg)}.toggle-btn.onwarn{color:var(--warn);border-color:var(--warn);background:#fdf4ec}.tx-table,.cred-table,.admin-table{width:100%;border-collapse:collapse;font-size:13px}.tx-table th,.cred-table th,.admin-table th{text-align:left;font-weight:500;color:var(--text-3);font-size:12px;background:var(--bg-subtle);padding:9px 14px;border-bottom:1px solid var(--border);white-space:nowrap}.tx-table td,.cred-table td,.admin-table td{padding:10px 14px;border-bottom:1px solid var(--border);vertical-align:top;word-break:break-all}.tx-table tbody tr:hover,.cred-table tbody tr:hover,.admin-table tbody tr:hover{background:#fafbfc}.tx-table tbody tr:last-child td,.cred-table tbody tr:last-child td,.admin-table tbody tr:last-child td{border-bottom:none}.mask{position:fixed;top:0;right:0;bottom:0;left:0;background:#1d212973;display:flex;align-items:center;justify-content:center;z-index:90;padding:16px}.dialog{width:480px;max-width:calc(100vw - 32px);max-height:86vh;max-height:86dvh;overflow:auto;background:var(--bg-page);border-radius:var(--radius-lg);box-shadow:var(--shadow-float);display:flex;flex-direction:column}.dialog-head{display:flex;align-items:flex-start;justify-content:space-between;padding:16px 20px 12px;border-bottom:1px solid var(--border);flex:none}.dialog-title{font-size:14px;font-weight:600;color:var(--text-1)}.dialog-sub{font-size:12px;margin-top:2px;color:var(--text-3)}.dialog-body{padding:16px 20px;overflow:auto}.dialog-btns{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px;border-top:1px solid var(--border);flex:none}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px}.form-grid .field.span2,.field.span2{grid-column:span 2}.field label,.form-row label{display:block;font-size:12px;color:var(--text-2);margin-bottom:4px}.form-error{color:var(--danger);font-size:12px;margin-top:8px}.stat-card{padding:14px 16px}.stat-num{font-size:22px;font-weight:600;margin-top:2px;letter-spacing:-.2px}.bar-row{display:flex;align-items:center;gap:10px;margin:7px 0}.bar-label{flex:none;color:var(--text-2);font-size:12px;text-align:right}.bar-track{flex:1;height:8px;border-radius:4px;background:var(--bg-subtle);overflow:hidden}.bar-fill{display:block;height:100%;background:var(--accent);border-radius:4px}.bar-num{font-size:12px;flex:none;color:var(--text-3)}::-webkit-scrollbar{width:8px;height:8px}::-webkit-scrollbar-thumb{background:#d3d7de;border-radius:4px}::-webkit-scrollbar-thumb:hover{background:#b9bec7}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-corner{background:transparent}.tx-table th:nth-child(3),.tx-table td:nth-child(3){text-align:right}.icon{display:inline-flex;align-items:center;justify-content:center;flex:none}.icon svg{width:100%;height:100%;display:block}@media (max-width: 720px){input,select,textarea{font-size:16px!important}input[type=checkbox]{font-size:initial}}@media (max-width: 720px){.btn{height:36px;padding:0 14px}.btn-sm{height:32px;padding:0 12px}.btn-xs{height:30px;padding:0 12px}.icon-btn{width:34px;height:34px}.seg-btn{height:34px;padding:0 13px}.input,.select{height:38px;padding:0 12px}.textarea{min-height:76px;padding:10px 12px}.toggle-btn{height:38px}.tag{height:24px;line-height:22px;padding:0 9px}.dot{width:7px;height:7px}.dialog{width:calc(100vw - 16px)!important;max-width:calc(100vw - 16px)!important;max-height:90vh;max-height:90dvh}.dialog-head{padding:14px 16px 10px!important}.dialog-body{padding:14px 16px!important}.dialog-btns{padding:10px 16px calc(12px + env(safe-area-inset-bottom))!important;gap:10px}.dialog-btns .btn{flex:1;height:40px}.form-grid{grid-template-columns:1fr!important}.card{border-radius:12px}.section,.sec{padding:12px}.stat-num{font-size:20px}.empty{padding:22px 12px}input.input,select.select,textarea.textarea{width:100%;box-sizing:border-box}.btn{touch-action:manipulation}.drawer{top:auto!important;left:0!important;width:100%!important;height:min(86vh,86dvh)!important;border-left:none!important;border-top:1px solid var(--border);border-radius:14px 14px 0 0!important;box-shadow:0 -8px 24px #1018281a}.drawer-enter-active,.drawer-leave-active{transition:transform .2s ease,opacity .2s ease}.drawer-enter-from,.drawer-leave-to{transform:translateY(28px);opacity:0}.drawer-head{border-radius:14px 14px 0 0}.drawer-body{padding:12px!important}.tx-table{min-width:0!important}.tx-table thead{display:none!important}.tx-table tr{display:block;padding:10px 12px;border-bottom:1px solid var(--border);background:transparent}.tx-table tbody tr:last-child{border-bottom:none}.tx-table td{display:flex!important;align-items:center;justify-content:space-between;gap:12px;padding:3px 0!important;border:none!important;white-space:normal!important}.tx-table td:before{content:attr(data-label);color:var(--text-3);font-size:12px;flex:none}.tx-table td.ops-cell:before{content:none}.tx-table td.ops-cell{justify-content:flex-end;flex-wrap:wrap;gap:8px}.tx-table td.ops-cell .btn{flex:none}.tx-table td.empty{justify-content:center}.tx-table td.empty:before{content:none!important}.table-card,.tx-card{overflow-x:auto}.cred-table{min-width:560px!important}.th-ops{width:auto!important}.vault-toolbar{flex-wrap:wrap;row-gap:8px}.vault-toolbar .search-wrap{width:100%;max-width:none!important}.vault-toolbar .flex1{display:none}.vault-toolbar .btn{flex:none}.cards{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}.stat-card{padding:12px 14px!important}.rule-grid,.two-col{grid-template-columns:1fr!important}.cal-toolbar{margin-bottom:10px}.cal-cell{min-height:58px!important;padding:5px 6px!important}.cal-marks{margin-top:4px!important;height:14px!important;gap:4px!important}} diff --git a/intern-log/dist/assets/index-prZXT88d.js b/intern-log/dist/assets/index-C9urKISR.js similarity index 69% rename from intern-log/dist/assets/index-prZXT88d.js rename to intern-log/dist/assets/index-C9urKISR.js index 1f63d51..050af2c 100644 --- a/intern-log/dist/assets/index-prZXT88d.js +++ b/intern-log/dist/assets/index-C9urKISR.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./web-oDK3lWem.js","./index-BI5aMIlx.js","./index-CwfY7_G6.css"])))=>i.map(i=>d[i]); -import{r as s,_ as i}from"./index-BI5aMIlx.js";var t;(function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE"})(t||(t={}));var a;(function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"})(a||(a={}));const E=s("Filesystem",{web:()=>i(()=>import("./web-oDK3lWem.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>new e.FilesystemWeb)});export{t as Directory,a as Encoding,E as Filesystem}; +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./web-DCGLAtF7.js","./index-COEpAapF.js","./index-BWain5t9.css"])))=>i.map(i=>d[i]); +import{r as s,_ as i}from"./index-COEpAapF.js";var t;(function(e){e.Documents="DOCUMENTS",e.Data="DATA",e.Library="LIBRARY",e.Cache="CACHE",e.External="EXTERNAL",e.ExternalStorage="EXTERNAL_STORAGE"})(t||(t={}));var a;(function(e){e.UTF8="utf8",e.ASCII="ascii",e.UTF16="utf16"})(a||(a={}));const E=s("Filesystem",{web:()=>i(()=>import("./web-DCGLAtF7.js"),__vite__mapDeps([0,1,2]),import.meta.url).then(e=>new e.FilesystemWeb)});export{t as Directory,a as Encoding,E as Filesystem}; diff --git a/intern-log/dist/assets/index-BI5aMIlx.js b/intern-log/dist/assets/index-COEpAapF.js similarity index 93% rename from intern-log/dist/assets/index-BI5aMIlx.js rename to intern-log/dist/assets/index-COEpAapF.js index 71df6d9..d4da97a 100644 --- a/intern-log/dist/assets/index-BI5aMIlx.js +++ b/intern-log/dist/assets/index-COEpAapF.js @@ -2,26 +2,26 @@ * @vue/shared v3.5.44 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Ji(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $t={},Ms=[],Dn=()=>{},Zu=()=>!1,ca=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),da=e=>e.startsWith("onUpdate:"),Rt=Object.assign,Xi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},gf=Object.prototype.hasOwnProperty,yt=(e,t)=>gf.call(e,t),Ge=Array.isArray,is=e=>Wo(e)==="[object Map]",Ls=e=>Wo(e)==="[object Set]",eu=e=>Wo(e)==="[object Date]",rt=e=>typeof e=="function",Ot=e=>typeof e=="string",Ln=e=>typeof e=="symbol",_t=e=>e!==null&&typeof e=="object",ec=e=>(_t(e)||rt(e))&&rt(e.then)&&rt(e.catch),tc=Object.prototype.toString,Wo=e=>tc.call(e),bf=e=>Wo(e).slice(8,-1),nc=e=>Wo(e)==="[object Object]",Qi=e=>Ot(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,So=Ji(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fa=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},wf=/-\w/g,kn=fa(e=>e.replace(wf,t=>t.slice(1).toUpperCase())),_f=/\B([A-Z])/g,hs=fa(e=>e.replace(_f,"-$1").toLowerCase()),sc=fa(e=>e.charAt(0).toUpperCase()+e.slice(1)),ri=fa(e=>e?`on${sc(e)}`:""),jn=(e,t)=>!Object.is(e,t),Mr=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},pa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},kf=e=>{const t=Ot(e)?Number(e):NaN;return isNaN(t)?e:t};let tu;const va=()=>tu||(tu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function pn(e){if(Ge(e)){const t={};for(let n=0;nn.startsWith("/*")?"":n).split(Cf).forEach(n=>{if(n){const o=n.split(xf);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ze(e){let t="";if(Ot(e))t=e;else if(Ge(e))for(let n=0;ncs(n,t))}const ac=e=>!!(e&&e.__v_isRef===!0),F=e=>Ot(e)?e:e==null?"":Ge(e)||_t(e)&&(e.toString===tc||!rt(e.toString))?ac(e)?F(e.value):JSON.stringify(e,ic,2):String(e),ic=(e,t)=>ac(t)?ic(e,t.value):is(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,r],l)=>(n[ai(o,l)+" =>"]=r,n),{})}:Ls(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ai(n))}:Ln(t)?ai(t):_t(t)&&!Ge(t)&&!nc(t)?String(t):t,ai=(e,t="")=>{var n;return Ln(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/** +**/function Ji(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const $t={},Ms=[],Dn=()=>{},Zu=()=>!1,ca=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),da=e=>e.startsWith("onUpdate:"),Rt=Object.assign,Xi=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},gf=Object.prototype.hasOwnProperty,yt=(e,t)=>gf.call(e,t),Ge=Array.isArray,is=e=>Wo(e)==="[object Map]",Ls=e=>Wo(e)==="[object Set]",eu=e=>Wo(e)==="[object Date]",rt=e=>typeof e=="function",Ot=e=>typeof e=="string",Ln=e=>typeof e=="symbol",_t=e=>e!==null&&typeof e=="object",ec=e=>(_t(e)||rt(e))&&rt(e.then)&&rt(e.catch),tc=Object.prototype.toString,Wo=e=>tc.call(e),bf=e=>Wo(e).slice(8,-1),nc=e=>Wo(e)==="[object Object]",Qi=e=>Ot(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Eo=Ji(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),fa=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},wf=/-\w/g,kn=fa(e=>e.replace(wf,t=>t.slice(1).toUpperCase())),_f=/\B([A-Z])/g,hs=fa(e=>e.replace(_f,"-$1").toLowerCase()),sc=fa(e=>e.charAt(0).toUpperCase()+e.slice(1)),ri=fa(e=>e?`on${sc(e)}`:""),jn=(e,t)=>!Object.is(e,t),Mr=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},pa=e=>{const t=parseFloat(e);return isNaN(t)?e:t},kf=e=>{const t=Ot(e)?Number(e):NaN;return isNaN(t)?e:t};let tu;const va=()=>tu||(tu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function pn(e){if(Ge(e)){const t={};for(let n=0;nn.startsWith("/*")?"":n).split(Cf).forEach(n=>{if(n){const o=n.split(xf);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ze(e){let t="";if(Ot(e))t=e;else if(Ge(e))for(let n=0;ncs(n,t))}const ac=e=>!!(e&&e.__v_isRef===!0),F=e=>Ot(e)?e:e==null?"":Ge(e)||_t(e)&&(e.toString===tc||!rt(e.toString))?ac(e)?F(e.value):JSON.stringify(e,ic,2):String(e),ic=(e,t)=>ac(t)?ic(e,t.value):is(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,r],l)=>(n[ai(o,l)+" =>"]=r,n),{})}:Ls(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>ai(n))}:Ln(t)?ai(t):_t(t)&&!Ge(t)&&!nc(t)?String(t):t,ai=(e,t="")=>{var n;return Ln(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 zt;class Mf{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&&zt&&(zt.active?(this.parent=zt,this.index=(zt.scopes||(zt.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 o=this.scopes.slice();for(t=0,n=o.length;t0&&--this._on===0){if(zt===this)zt=this.prevScope;else{let t=zt;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,o;for(n=0,o=this.effects.length;n0)return;if(Ao){let t=Ao;for(Ao=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Eo;){let t=Eo;for(Eo=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function dc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fc(e){let t,n=e.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),tl(o),jf(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}e.deps=t,e.depsTail=n}function _i(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(pc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function pc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===jo)||(e.globalVersion=jo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_i(e))))return;e.flags|=2;const t=e.dep,n=Et,o=Cn;Et=e,Cn=!0;try{dc(e);const r=e.fn(e._value);(t.version===0||jn(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Et=n,Cn=o,fc(e),e.flags&=-3}}function tl(e,t=!1){const{dep:n,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)tl(l,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jf(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Cn=!0;const vc=[];function Rn(){vc.push(Cn),Cn=!1}function Kn(){const e=vc.pop();Cn=e===void 0?!0:e}function ou(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Et;Et=void 0;try{t()}finally{Et=n}}}let jo=0;class Df{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 nl{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Et||!Cn||Et===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Et)n=this.activeLink=new Df(Et,this),Et.deps?(n.prevDep=Et.depsTail,Et.depsTail.nextDep=n,Et.depsTail=n):Et.deps=Et.depsTail=n,mc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Et.depsTail,n.nextDep=void 0,Et.depsTail.nextDep=n,Et.depsTail=n,Et.deps===n&&(Et.deps=o)}return n}trigger(t){this.version++,jo++,this.notify(t)}notify(t){Zi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{el()}}}function mc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)mc(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ki=new WeakMap,js=Symbol(""),Ci=Symbol(""),Do=Symbol("");function Xt(e,t,n){if(Cn&&Et){let o=ki.get(e);o||ki.set(e,o=new Map);let r=o.get(n);r||(o.set(n,r=new nl),r.map=o,r.key=n),r.track()}}function Hn(e,t,n,o,r,l){const u=ki.get(e);if(!u){jo++;return}const f=v=>{v&&v.trigger()};if(Zi(),t==="clear")u.forEach(f);else{const v=Ge(e),y=v&&Qi(n);if(v&&n==="length"){const m=Number(o);u.forEach((w,T)=>{(T==="length"||T===Do||!Ln(T)&&T>=m)&&f(w)})}else switch((n!==void 0||u.has(void 0))&&f(u.get(n)),y&&f(u.get(Do)),t){case"add":v?y&&f(u.get("length")):(f(u.get(js)),is(e)&&f(u.get(Ci)));break;case"delete":v||(f(u.get(js)),is(e)&&f(u.get(Ci)));break;case"set":is(e)&&f(u.get(js));break}}el()}function Ys(e){const t=mt(e);return t===e||(Xt(t,"iterate",Do),mn(e))?t:Nn(e)?ls(e)?t.map(n=>ds(yn(n))):t.map(ds):t.map(yn)}function ma(e){return Xt(e=mt(e),"iterate",Do),e}function On(e,t){return Nn(e)?ds(ls(e)?yn(t):t):yn(t)}const Lf={__proto__:null,[Symbol.iterator](){return li(this,Symbol.iterator,e=>On(this,e))},concat(...e){return Ys(this).concat(...e.map(t=>Ge(t)?Ys(t):t))},entries(){return li(this,"entries",e=>(e[1]=On(this,e[1]),e))},every(e,t){return Bn(this,"every",e,t,void 0,arguments)},filter(e,t){return Bn(this,"filter",e,t,n=>n.map(o=>On(this,o)),arguments)},find(e,t){return Bn(this,"find",e,t,n=>On(this,n),arguments)},findIndex(e,t){return Bn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Bn(this,"findLast",e,t,n=>On(this,n),arguments)},findLastIndex(e,t){return Bn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Bn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ui(this,"includes",e)},indexOf(...e){return ui(this,"indexOf",e)},join(e){return Ys(this).join(e)},lastIndexOf(...e){return ui(this,"lastIndexOf",e)},map(e,t){return Bn(this,"map",e,t,void 0,arguments)},pop(){return wo(this,"pop")},push(...e){return wo(this,"push",e)},reduce(e,...t){return au(this,"reduce",e,t)},reduceRight(e,...t){return au(this,"reduceRight",e,t)},shift(){return wo(this,"shift")},some(e,t){return Bn(this,"some",e,t,void 0,arguments)},splice(...e){return wo(this,"splice",e)},toReversed(){return Ys(this).toReversed()},toSorted(e){return Ys(this).toSorted(e)},toSpliced(...e){return Ys(this).toSpliced(...e)},unshift(...e){return wo(this,"unshift",e)},values(){return li(this,"values",e=>On(this,e))}};function li(e,t,n){const o=ma(e),r=o[t],l=r.call(o);if(o!==e&&!mn(e)){if(l[Symbol.toStringTag]==="Array Iterator"){const u=Object.create(Object.getPrototypeOf(l));return u.next=()=>ru(l.next(),n),r!==hc[t]&&Object.defineProperties(u,{return:{get(){const f=l.return;return typeof f=="function"?f.bind(l):f}},throw:{get(){const f=l.throw;return typeof f=="function"?f.bind(l):f}}}),u}l._next=l.next,l.next=()=>ru(l._next(),n)}return l}function ru(e,t){return e.done||(e.value=t(e.value)),e}const hc=Array.prototype;function Bn(e,t,n,o,r,l){const u=ma(e),f=u!==e&&!mn(e),v=u[t];if(v!==hc[t]){const w=v.apply(e,l);return f?yn(w):w}let y=n;u!==e&&(f?y=function(w,T){return n.call(this,On(e,w),T,e)}:n.length>2&&(y=function(w,T){return n.call(this,w,T,e)}));const m=v.call(u,y,o);return f&&r?r(m):m}function au(e,t,n,o){const r=ma(e),l=r!==e&&!mn(e);let u=n,f=!1;r!==e&&(l?(f=o.length===0,u=function(y,m,w){return f&&(f=!1,y=On(e,y)),n.call(this,y,On(e,m),w,e)}):n.length>3&&(u=function(y,m,w){return n.call(this,y,m,w,e)}));const v=r[t](u,...o);return f?On(e,v):v}function ui(e,t,n){const o=mt(e);Xt(o,"iterate",Do);const r=o[t](...n);return(r===-1||r===!1)&&al(n[0])?(n[0]=mt(n[0]),o[t](...n)):r}function wo(e,t,n=[]){Rn(),Zi();const o=mt(e)[t].apply(e,n);return el(),Kn(),o}const Rf=Ji("__proto__,__v_isRef,__isVue"),yc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ln));function Kf(e){Ln(e)||(e=String(e));const t=mt(this);return Xt(t,"has",e),t.hasOwnProperty(e)}class gc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return l;if(n==="__v_raw")return o===(r?l?Gf:kc:l?_c:wc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const u=Ge(t);if(!r){let v;if(u&&(v=Lf[n]))return v;if(n==="hasOwnProperty")return Kf}const f=Reflect.get(t,n,Zt(t)?t:o);if((Ln(n)?yc.has(n):Rf(n))||(r||Xt(t,"get",n),l))return f;if(Zt(f)){const v=u&&Qi(n)?f:f.value;return r&&_t(v)?$i(v):v}return _t(f)?r?$i(f):ol(f):f}}class bc extends gc{constructor(t=!1){super(!1,t)}set(t,n,o,r){let l=t[n];const u=Ge(t)&&Qi(n);if(!this._isShallow){const y=Nn(l);if(!mn(o)&&!Nn(o)&&(l=mt(l),o=mt(o)),!u&&Zt(l)&&!Zt(o))return y||(l.value=o),!0}const f=u?Number(n)e,$r=e=>Reflect.getPrototypeOf(e);function Uf(e,t,n){return function(...o){const r=this.__v_raw,l=mt(r),u=is(l),f=e==="entries"||e===Symbol.iterator&&u,v=e==="keys"&&u,y=r[e](...o),m=n?xi:t?ds:yn;return!t&&Xt(l,"iterate",v?Ci:js),Rt(Object.create(y),{next(){const{value:w,done:T}=y.next();return T?{value:w,done:T}:{value:f?[m(w[0]),m(w[1])]:m(w),done:T}}})}}function Sr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function qf(e,t){const n={get(r){const l=this.__v_raw,u=mt(l),f=mt(r);e||(jn(r,f)&&Xt(u,"get",r),Xt(u,"get",f));const{has:v}=$r(u),y=t?xi:e?ds:yn;if(v.call(u,r))return y(l.get(r));if(v.call(u,f))return y(l.get(f));l!==u&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Xt(mt(r),"iterate",js),r.size},has(r){const l=this.__v_raw,u=mt(l),f=mt(r);return e||(jn(r,f)&&Xt(u,"has",r),Xt(u,"has",f)),r===f?l.has(r):l.has(r)||l.has(f)},forEach(r,l){const u=this,f=u.__v_raw,v=mt(f),y=t?xi:e?ds:yn;return!e&&Xt(v,"iterate",js),f.forEach((m,w)=>r.call(l,y(m),y(w),u))}};return Rt(n,e?{add:Sr("add"),set:Sr("set"),delete:Sr("delete"),clear:Sr("clear")}:{add(r){const l=mt(this),u=$r(l),f=mt(r),v=!t&&!mn(r)&&!Nn(r)?f:r;return u.has.call(l,v)||jn(r,v)&&u.has.call(l,r)||jn(f,v)&&u.has.call(l,f)||(l.add(v),Hn(l,"add",v,v)),this},set(r,l){!t&&!mn(l)&&!Nn(l)&&(l=mt(l));const u=mt(this),{has:f,get:v}=$r(u);let y=f.call(u,r);y||(r=mt(r),y=f.call(u,r));const m=v.call(u,r);return u.set(r,l),y?jn(l,m)&&Hn(u,"set",r,l):Hn(u,"add",r,l),this},delete(r){const l=mt(this),{has:u,get:f}=$r(l);let v=u.call(l,r);v||(r=mt(r),v=u.call(l,r)),f&&f.call(l,r);const y=l.delete(r);return v&&Hn(l,"delete",r,void 0),y},clear(){const r=mt(this),l=r.size!==0,u=r.clear();return l&&Hn(r,"clear",void 0,void 0),u}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Uf(r,e,t)}),n}function sl(e,t){const n=qf(e,t);return(o,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_isShallow"?t:r==="__v_raw"?o:Reflect.get(yt(n,r)&&r in o?n:o,r,l)}const Hf={get:sl(!1,!1)},zf={get:sl(!1,!0)},Wf={get:sl(!0,!1)};const wc=new WeakMap,_c=new WeakMap,kc=new WeakMap,Gf=new WeakMap;function Yf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ol(e){return Nn(e)?e:rl(e,!1,Ff,Hf,wc)}function Jf(e){return rl(e,!1,Bf,zf,_c)}function $i(e){return rl(e,!0,Vf,Wf,kc)}function rl(e,t,n,o,r){if(!_t(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const l=r.get(e);if(l)return l;const u=Yf(bf(e));if(u===0)return e;const f=new Proxy(e,u===2?o:n);return r.set(e,f),f}function ls(e){return Nn(e)?ls(e.__v_raw):!!(e&&e.__v_isReactive)}function Nn(e){return!!(e&&e.__v_isReadonly)}function mn(e){return!!(e&&e.__v_isShallow)}function al(e){return e?!!e.__v_raw:!1}function mt(e){const t=e&&e.__v_raw;return t?mt(t):e}function Xf(e){return!yt(e,"__v_skip")&&Object.isExtensible(e)&&oc(e,"__v_skip",!0),e}const yn=e=>_t(e)?ol(e):e,ds=e=>_t(e)?$i(e):e;function Zt(e){return e?e.__v_isRef===!0:!1}function P(e){return Qf(e,!1)}function Qf(e,t){return Zt(e)?e:new Zf(e,t)}class Zf{constructor(t,n){this.dep=new nl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:mt(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||mn(t)||Nn(t);t=o?t:mt(t),jn(t,n)&&(this._rawValue=t,this._value=o?t:yn(t),this.dep.trigger())}}function Wt(e){return Zt(e)?e.value:e}const ep={get:(e,t,n)=>t==="__v_raw"?e:Wt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return Zt(r)&&!Zt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Cc(e){return ls(e)?e:new Proxy(e,ep)}class tp{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new nl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=jo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Et!==this)return cc(this,!0),!0}get value(){const t=this.dep.track();return pc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function np(e,t,n=!1){let o,r;return rt(e)?o=e:(o=e.get,r=e.set),new tp(o,r,n)}const Er={},Br=new WeakMap;let Es;function sp(e,t=!1,n=Es){if(n){let o=Br.get(n);o||Br.set(n,o=[]),o.push(e)}}function op(e,t,n=$t){const{immediate:o,deep:r,once:l,scheduler:u,augmentJob:f,call:v}=n,y=S=>r?S:mn(S)||r===!1||r===0?zn(S,1):zn(S);let m,w,T,$,I=!1,J=!1;if(Zt(e)?(w=()=>e.value,I=mn(e)):ls(e)?(w=()=>y(e),I=!0):Ge(e)?(J=!0,I=e.some(S=>ls(S)||mn(S)),w=()=>e.map(S=>{if(Zt(S))return S.value;if(ls(S))return y(S);if(rt(S))return v?v(S,2):S()})):rt(e)?t?w=v?()=>v(e,2):e:w=()=>{if(T){Rn();try{T()}finally{Kn()}}const S=Es;Es=m;try{return v?v(e,3,[$]):e($)}finally{Es=S}}:w=Dn,t&&r){const S=w,M=r===!0?1/0:r;w=()=>zn(S(),M)}const ae=If(),de=()=>{m.stop(),ae&&ae.active&&Xi(ae.effects,m)};if(l&&t){const S=t;t=(...M)=>{try{return S(...M)}finally{de()}}}let ue=J?new Array(e.length).fill(Er):Er;const G=S=>{if(!(!(m.flags&1)||!m.dirty&&!S))if(t){const M=m.run();if(S||r||I||(J?M.some((ee,q)=>jn(ee,ue[q])):jn(M,ue))){const ee=Es;Rn();try{T&&T(),Es=m;const q=[M,ue===Er?void 0:J&&ue[0]===Er?[]:ue,$];ue=M,v?v(t,3,q):t(...q)}finally{Es=ee,Kn()}}}else m.run()};return f&&f(G),m=new lc(w),m.scheduler=u?()=>u(G,!1):G,$=S=>sp(S,!1,m),T=m.onStop=()=>{const S=Br.get(m);if(S){if(v)v(S,4);else for(const M of S)M();Br.delete(m)}},t?o?G(!0):ue=m.run():u?u(G.bind(null,!0),!0):m.run(),de.pause=m.pause.bind(m),de.resume=m.resume.bind(m),de.stop=de,de}function zn(e,t=1/0,n){if(t<=0||!_t(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Zt(e))zn(e.value,t,n);else if(Ge(e))for(let o=0;o{zn(o,t,n)});else if(nc(e)){for(const o in e)zn(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&zn(e[o],t,n)}return e}/** +**/let zt;class Mf{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&&zt&&(zt.active?(this.parent=zt,this.index=(zt.scopes||(zt.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 o=this.scopes.slice();for(t=0,n=o.length;t0&&--this._on===0){if(zt===this)zt=this.prevScope;else{let t=zt;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,o;for(n=0,o=this.effects.length;n0)return;if(To){let t=To;for(To=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Ao;){let t=Ao;for(Ao=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function dc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function fc(e){let t,n=e.depsTail,o=n;for(;o;){const r=o.prevDep;o.version===-1?(o===n&&(n=r),tl(o),jf(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=r}e.deps=t,e.depsTail=n}function _i(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(pc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function pc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Do)||(e.globalVersion=Do,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!_i(e))))return;e.flags|=2;const t=e.dep,n=Et,o=Cn;Et=e,Cn=!0;try{dc(e);const r=e.fn(e._value);(t.version===0||jn(r,e._value))&&(e.flags|=128,e._value=r,t.version++)}catch(r){throw t.version++,r}finally{Et=n,Cn=o,fc(e),e.flags&=-3}}function tl(e,t=!1){const{dep:n,prevSub:o,nextSub:r}=e;if(o&&(o.nextSub=r,e.prevSub=void 0),r&&(r.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let l=n.computed.deps;l;l=l.nextDep)tl(l,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function jf(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Cn=!0;const vc=[];function Rn(){vc.push(Cn),Cn=!1}function Kn(){const e=vc.pop();Cn=e===void 0?!0:e}function ou(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Et;Et=void 0;try{t()}finally{Et=n}}}let Do=0;class Df{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 nl{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!Et||!Cn||Et===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Et)n=this.activeLink=new Df(Et,this),Et.deps?(n.prevDep=Et.depsTail,Et.depsTail.nextDep=n,Et.depsTail=n):Et.deps=Et.depsTail=n,mc(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Et.depsTail,n.nextDep=void 0,Et.depsTail.nextDep=n,Et.depsTail=n,Et.deps===n&&(Et.deps=o)}return n}trigger(t){this.version++,Do++,this.notify(t)}notify(t){Zi();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{el()}}}function mc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)mc(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ki=new WeakMap,js=Symbol(""),Ci=Symbol(""),Lo=Symbol("");function Xt(e,t,n){if(Cn&&Et){let o=ki.get(e);o||ki.set(e,o=new Map);let r=o.get(n);r||(o.set(n,r=new nl),r.map=o,r.key=n),r.track()}}function Hn(e,t,n,o,r,l){const u=ki.get(e);if(!u){Do++;return}const f=v=>{v&&v.trigger()};if(Zi(),t==="clear")u.forEach(f);else{const v=Ge(e),y=v&&Qi(n);if(v&&n==="length"){const m=Number(o);u.forEach((w,T)=>{(T==="length"||T===Lo||!Ln(T)&&T>=m)&&f(w)})}else switch((n!==void 0||u.has(void 0))&&f(u.get(n)),y&&f(u.get(Lo)),t){case"add":v?y&&f(u.get("length")):(f(u.get(js)),is(e)&&f(u.get(Ci)));break;case"delete":v||(f(u.get(js)),is(e)&&f(u.get(Ci)));break;case"set":is(e)&&f(u.get(js));break}}el()}function Ys(e){const t=mt(e);return t===e||(Xt(t,"iterate",Lo),mn(e))?t:Nn(e)?ls(e)?t.map(n=>ds(yn(n))):t.map(ds):t.map(yn)}function ma(e){return Xt(e=mt(e),"iterate",Lo),e}function On(e,t){return Nn(e)?ds(ls(e)?yn(t):t):yn(t)}const Lf={__proto__:null,[Symbol.iterator](){return li(this,Symbol.iterator,e=>On(this,e))},concat(...e){return Ys(this).concat(...e.map(t=>Ge(t)?Ys(t):t))},entries(){return li(this,"entries",e=>(e[1]=On(this,e[1]),e))},every(e,t){return Bn(this,"every",e,t,void 0,arguments)},filter(e,t){return Bn(this,"filter",e,t,n=>n.map(o=>On(this,o)),arguments)},find(e,t){return Bn(this,"find",e,t,n=>On(this,n),arguments)},findIndex(e,t){return Bn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Bn(this,"findLast",e,t,n=>On(this,n),arguments)},findLastIndex(e,t){return Bn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Bn(this,"forEach",e,t,void 0,arguments)},includes(...e){return ui(this,"includes",e)},indexOf(...e){return ui(this,"indexOf",e)},join(e){return Ys(this).join(e)},lastIndexOf(...e){return ui(this,"lastIndexOf",e)},map(e,t){return Bn(this,"map",e,t,void 0,arguments)},pop(){return _o(this,"pop")},push(...e){return _o(this,"push",e)},reduce(e,...t){return au(this,"reduce",e,t)},reduceRight(e,...t){return au(this,"reduceRight",e,t)},shift(){return _o(this,"shift")},some(e,t){return Bn(this,"some",e,t,void 0,arguments)},splice(...e){return _o(this,"splice",e)},toReversed(){return Ys(this).toReversed()},toSorted(e){return Ys(this).toSorted(e)},toSpliced(...e){return Ys(this).toSpliced(...e)},unshift(...e){return _o(this,"unshift",e)},values(){return li(this,"values",e=>On(this,e))}};function li(e,t,n){const o=ma(e),r=o[t],l=r.call(o);if(o!==e&&!mn(e)){if(l[Symbol.toStringTag]==="Array Iterator"){const u=Object.create(Object.getPrototypeOf(l));return u.next=()=>ru(l.next(),n),r!==hc[t]&&Object.defineProperties(u,{return:{get(){const f=l.return;return typeof f=="function"?f.bind(l):f}},throw:{get(){const f=l.throw;return typeof f=="function"?f.bind(l):f}}}),u}l._next=l.next,l.next=()=>ru(l._next(),n)}return l}function ru(e,t){return e.done||(e.value=t(e.value)),e}const hc=Array.prototype;function Bn(e,t,n,o,r,l){const u=ma(e),f=u!==e&&!mn(e),v=u[t];if(v!==hc[t]){const w=v.apply(e,l);return f?yn(w):w}let y=n;u!==e&&(f?y=function(w,T){return n.call(this,On(e,w),T,e)}:n.length>2&&(y=function(w,T){return n.call(this,w,T,e)}));const m=v.call(u,y,o);return f&&r?r(m):m}function au(e,t,n,o){const r=ma(e),l=r!==e&&!mn(e);let u=n,f=!1;r!==e&&(l?(f=o.length===0,u=function(y,m,w){return f&&(f=!1,y=On(e,y)),n.call(this,y,On(e,m),w,e)}):n.length>3&&(u=function(y,m,w){return n.call(this,y,m,w,e)}));const v=r[t](u,...o);return f?On(e,v):v}function ui(e,t,n){const o=mt(e);Xt(o,"iterate",Lo);const r=o[t](...n);return(r===-1||r===!1)&&al(n[0])?(n[0]=mt(n[0]),o[t](...n)):r}function _o(e,t,n=[]){Rn(),Zi();const o=mt(e)[t].apply(e,n);return el(),Kn(),o}const Rf=Ji("__proto__,__v_isRef,__isVue"),yc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ln));function Kf(e){Ln(e)||(e=String(e));const t=mt(this);return Xt(t,"has",e),t.hasOwnProperty(e)}class gc{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const r=this._isReadonly,l=this._isShallow;if(n==="__v_isReactive")return!r;if(n==="__v_isReadonly")return r;if(n==="__v_isShallow")return l;if(n==="__v_raw")return o===(r?l?Gf:kc:l?_c:wc).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const u=Ge(t);if(!r){let v;if(u&&(v=Lf[n]))return v;if(n==="hasOwnProperty")return Kf}const f=Reflect.get(t,n,Zt(t)?t:o);if((Ln(n)?yc.has(n):Rf(n))||(r||Xt(t,"get",n),l))return f;if(Zt(f)){const v=u&&Qi(n)?f:f.value;return r&&_t(v)?$i(v):v}return _t(f)?r?$i(f):ol(f):f}}class bc extends gc{constructor(t=!1){super(!1,t)}set(t,n,o,r){let l=t[n];const u=Ge(t)&&Qi(n);if(!this._isShallow){const y=Nn(l);if(!mn(o)&&!Nn(o)&&(l=mt(l),o=mt(o)),!u&&Zt(l)&&!Zt(o))return y||(l.value=o),!0}const f=u?Number(n)e,$r=e=>Reflect.getPrototypeOf(e);function Uf(e,t,n){return function(...o){const r=this.__v_raw,l=mt(r),u=is(l),f=e==="entries"||e===Symbol.iterator&&u,v=e==="keys"&&u,y=r[e](...o),m=n?xi:t?ds:yn;return!t&&Xt(l,"iterate",v?Ci:js),Rt(Object.create(y),{next(){const{value:w,done:T}=y.next();return T?{value:w,done:T}:{value:f?[m(w[0]),m(w[1])]:m(w),done:T}}})}}function Sr(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function qf(e,t){const n={get(r){const l=this.__v_raw,u=mt(l),f=mt(r);e||(jn(r,f)&&Xt(u,"get",r),Xt(u,"get",f));const{has:v}=$r(u),y=t?xi:e?ds:yn;if(v.call(u,r))return y(l.get(r));if(v.call(u,f))return y(l.get(f));l!==u&&l.get(r)},get size(){const r=this.__v_raw;return!e&&Xt(mt(r),"iterate",js),r.size},has(r){const l=this.__v_raw,u=mt(l),f=mt(r);return e||(jn(r,f)&&Xt(u,"has",r),Xt(u,"has",f)),r===f?l.has(r):l.has(r)||l.has(f)},forEach(r,l){const u=this,f=u.__v_raw,v=mt(f),y=t?xi:e?ds:yn;return!e&&Xt(v,"iterate",js),f.forEach((m,w)=>r.call(l,y(m),y(w),u))}};return Rt(n,e?{add:Sr("add"),set:Sr("set"),delete:Sr("delete"),clear:Sr("clear")}:{add(r){const l=mt(this),u=$r(l),f=mt(r),v=!t&&!mn(r)&&!Nn(r)?f:r;return u.has.call(l,v)||jn(r,v)&&u.has.call(l,r)||jn(f,v)&&u.has.call(l,f)||(l.add(v),Hn(l,"add",v,v)),this},set(r,l){!t&&!mn(l)&&!Nn(l)&&(l=mt(l));const u=mt(this),{has:f,get:v}=$r(u);let y=f.call(u,r);y||(r=mt(r),y=f.call(u,r));const m=v.call(u,r);return u.set(r,l),y?jn(l,m)&&Hn(u,"set",r,l):Hn(u,"add",r,l),this},delete(r){const l=mt(this),{has:u,get:f}=$r(l);let v=u.call(l,r);v||(r=mt(r),v=u.call(l,r)),f&&f.call(l,r);const y=l.delete(r);return v&&Hn(l,"delete",r,void 0),y},clear(){const r=mt(this),l=r.size!==0,u=r.clear();return l&&Hn(r,"clear",void 0,void 0),u}}),["keys","values","entries",Symbol.iterator].forEach(r=>{n[r]=Uf(r,e,t)}),n}function sl(e,t){const n=qf(e,t);return(o,r,l)=>r==="__v_isReactive"?!e:r==="__v_isReadonly"?e:r==="__v_isShallow"?t:r==="__v_raw"?o:Reflect.get(yt(n,r)&&r in o?n:o,r,l)}const Hf={get:sl(!1,!1)},zf={get:sl(!1,!0)},Wf={get:sl(!0,!1)};const wc=new WeakMap,_c=new WeakMap,kc=new WeakMap,Gf=new WeakMap;function Yf(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function ol(e){return Nn(e)?e:rl(e,!1,Ff,Hf,wc)}function Jf(e){return rl(e,!1,Bf,zf,_c)}function $i(e){return rl(e,!0,Vf,Wf,kc)}function rl(e,t,n,o,r){if(!_t(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const l=r.get(e);if(l)return l;const u=Yf(bf(e));if(u===0)return e;const f=new Proxy(e,u===2?o:n);return r.set(e,f),f}function ls(e){return Nn(e)?ls(e.__v_raw):!!(e&&e.__v_isReactive)}function Nn(e){return!!(e&&e.__v_isReadonly)}function mn(e){return!!(e&&e.__v_isShallow)}function al(e){return e?!!e.__v_raw:!1}function mt(e){const t=e&&e.__v_raw;return t?mt(t):e}function Xf(e){return!yt(e,"__v_skip")&&Object.isExtensible(e)&&oc(e,"__v_skip",!0),e}const yn=e=>_t(e)?ol(e):e,ds=e=>_t(e)?$i(e):e;function Zt(e){return e?e.__v_isRef===!0:!1}function P(e){return Qf(e,!1)}function Qf(e,t){return Zt(e)?e:new Zf(e,t)}class Zf{constructor(t,n){this.dep=new nl,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:mt(t),this._value=n?t:yn(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||mn(t)||Nn(t);t=o?t:mt(t),jn(t,n)&&(this._rawValue=t,this._value=o?t:yn(t),this.dep.trigger())}}function Wt(e){return Zt(e)?e.value:e}const ep={get:(e,t,n)=>t==="__v_raw"?e:Wt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return Zt(r)&&!Zt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Cc(e){return ls(e)?e:new Proxy(e,ep)}class tp{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new nl(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Do-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Et!==this)return cc(this,!0),!0}get value(){const t=this.dep.track();return pc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function np(e,t,n=!1){let o,r;return rt(e)?o=e:(o=e.get,r=e.set),new tp(o,r,n)}const Er={},Br=new WeakMap;let Es;function sp(e,t=!1,n=Es){if(n){let o=Br.get(n);o||Br.set(n,o=[]),o.push(e)}}function op(e,t,n=$t){const{immediate:o,deep:r,once:l,scheduler:u,augmentJob:f,call:v}=n,y=S=>r?S:mn(S)||r===!1||r===0?zn(S,1):zn(S);let m,w,T,$,I=!1,J=!1;if(Zt(e)?(w=()=>e.value,I=mn(e)):ls(e)?(w=()=>y(e),I=!0):Ge(e)?(J=!0,I=e.some(S=>ls(S)||mn(S)),w=()=>e.map(S=>{if(Zt(S))return S.value;if(ls(S))return y(S);if(rt(S))return v?v(S,2):S()})):rt(e)?t?w=v?()=>v(e,2):e:w=()=>{if(T){Rn();try{T()}finally{Kn()}}const S=Es;Es=m;try{return v?v(e,3,[$]):e($)}finally{Es=S}}:w=Dn,t&&r){const S=w,M=r===!0?1/0:r;w=()=>zn(S(),M)}const ae=If(),de=()=>{m.stop(),ae&&ae.active&&Xi(ae.effects,m)};if(l&&t){const S=t;t=(...M)=>{try{return S(...M)}finally{de()}}}let ue=J?new Array(e.length).fill(Er):Er;const G=S=>{if(!(!(m.flags&1)||!m.dirty&&!S))if(t){const M=m.run();if(S||r||I||(J?M.some((ee,q)=>jn(ee,ue[q])):jn(M,ue))){const ee=Es;Rn();try{T&&T(),Es=m;const q=[M,ue===Er?void 0:J&&ue[0]===Er?[]:ue,$];ue=M,v?v(t,3,q):t(...q)}finally{Es=ee,Kn()}}}else m.run()};return f&&f(G),m=new lc(w),m.scheduler=u?()=>u(G,!1):G,$=S=>sp(S,!1,m),T=m.onStop=()=>{const S=Br.get(m);if(S){if(v)v(S,4);else for(const M of S)M();Br.delete(m)}},t?o?G(!0):ue=m.run():u?u(G.bind(null,!0),!0):m.run(),de.pause=m.pause.bind(m),de.resume=m.resume.bind(m),de.stop=de,de}function zn(e,t=1/0,n){if(t<=0||!_t(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Zt(e))zn(e.value,t,n);else if(Ge(e))for(let o=0;o{zn(o,t,n)});else if(nc(e)){for(const o in e)zn(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&zn(e[o],t,n)}return e}/** * @vue/runtime-core v3.5.44 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function Go(e,t,n,o){try{return o?e(...o):e()}catch(r){ha(r,t,n)}}function gn(e,t,n,o){if(rt(e)){const r=Go(e,t,n,o);return r&&ec(r)&&r.catch(l=>{ha(l,t,n)}),r}if(Ge(e)){const r=[];for(let l=0;l>>1,r=sn[o],l=Lo(r);l=Lo(n)?sn.push(e):sn.splice(ap(t),0,e),e.flags|=1,$c()}}function $c(){Ur||(Ur=xc.then(Ac))}function ip(e){if(!Ge(e))as&&e.id===-1?as.splice(Js+1,0,e):e.flags&1||(Mn.push(e),e.flags|=1);else for(let t=0;t=t))continue;sn.splice(o,1),o=e?o-1:_n,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ec(e,t,n=0){if(Mn.length){let o=Mn,r=0;if(t){o=[];for(let u=0;uLo(u)-Lo(f));if(Mn.length=r,as){for(let u=0;ue.id==null?e.flags&2?-1:1/0:e.id;function Ac(e){try{for(_n=0;_n{o._d&&Gr(-1);const l=qr(t),u=Ds.length;let f;try{f=e(...r)}finally{for(let v=Ds.length;v>u;v--)sd();qr(l),o._d&&Gr(1)}return f};return o._n=!0,o._c=!0,o._d=!0,o}function Pe(e,t){if(vn===null)return e;const n=ka(vn),o=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&rt(t)?t.call(o&&o.proxy):t}}const cp=Symbol.for("v-scx"),dp=()=>Ir(cp);function pt(e,t,n){return Pc(e,t,n)}function Pc(e,t,n=$t){const{immediate:o,deep:r,flush:l,once:u}=n,f=Rt({},n),v=t&&o||!t&&l!=="post";let y;if(Bo){if(l==="sync"){const $=dp();y=$.__watcherHandles||($.__watcherHandles=[])}else if(!v){const $=()=>{};return $.stop=Dn,$.resume=Dn,$.pause=Dn,$}}const m=on;f.call=($,I,J)=>gn($,m,I,J);let w=!1;l==="post"?f.scheduler=$=>{$.i=m,nn($,m&&m.suspense)}:l!=="sync"&&(w=!0,f.scheduler=($,I)=>{I?$():il($)}),f.augmentJob=$=>{t&&($.flags|=4),w&&($.flags|=2,m&&($.id=m.uid,$.i=m))};const T=op(e,t,f);return Bo&&(y?y.push(T):v&&T()),T}function fp(e,t,n){const o=this.proxy,r=Ot(e)?e.includes(".")?Oc(o,e):()=>o[e]:e.bind(o,o);let l;rt(t)?l=t:(l=t.handler,n=t);const u=Yo(this),f=Pc(r,l.bind(o),n);return u(),f}function Oc(e,t){const n=t.split(".");return()=>{let o=e;for(let r=0;re.__isTeleport,Ts=e=>e&&(e.disabled||e.disabled===""),pp=e=>e&&(e.defer||e.defer===""),iu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,lu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Si=(e,t)=>{const n=e&&e.to;return Ot(n)?t?t(n):null:n},vp={name:"Teleport",__isTeleport:!0,process(e,t,n,o,r,l,u,f,v,y){const{mc:m,pc:w,pbc:T,o:{insert:$,querySelector:I,createText:J,createComment:ae,parentNode:de}}=y,ue=Ts(t.props);let{dynamicChildren:G}=t;const S=(q,oe,j)=>{q.shapeFlag&16&&m(q.children,oe,j,r,l,u,f,v)},M=(q=t)=>{const oe=Ts(q.props),j=q.target=Si(q.props,I),A=Ei(j,q,J,$);j&&(u!=="svg"&&iu(j)?u="svg":u!=="mathml"&&lu(j)&&(u="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(j),oe||(S(q,j,A),Co(q,!1)))},ee=q=>{const oe=()=>{if(os.get(q)===oe){if(os.delete(q),Ts(q.props)){const j=de(q.el)||n;S(q,j,q.anchor),Co(q,!0)}M(q)}};os.set(q,oe),nn(oe,l)};if(e==null){const q=t.el=J(""),oe=t.anchor=J("");if($(q,n,o),$(oe,n,o),pp(t.props)||l&&l.pendingBranch){ee(t);return}ue&&(S(t,n,oe),Co(t,!0)),M()}else{t.el=e.el;const q=t.anchor=e.anchor,oe=os.get(e);if(oe){oe.flags|=8,os.delete(e),ee(t);return}t.targetStart=e.targetStart;const j=t.target=e.target,A=t.targetAnchor=e.targetAnchor,O=Ts(e.props),ne=O?n:j,Ie=O?q:A;if(u==="svg"||iu(j)?u="svg":(u==="mathml"||lu(j))&&(u="mathml"),G?(T(e.dynamicChildren,G,ne,r,l,u,f),dl(e,t,!0)):v||w(e,t,ne,Ie,r,l,u,f,!1),ue)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ar(t,n,q,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Se=Si(t.props,I);Se&&(t.target=Se,Ar(t,Se,null,y,0))}else O&&Ar(t,j,A,y,1);Co(t,ue)}},remove(e,t,n,{um:o,o:{remove:r}},l){const{shapeFlag:u,children:f,anchor:v,targetStart:y,targetAnchor:m,target:w,props:T}=e,$=Ts(T),I=l||!$,J=os.get(e);if(J&&(J.flags|=8,os.delete(e)),w&&(r(y),r(m)),l&&r(v),!J&&($||w)&&u&16)for(let ae=0;ae{e.isMounted=!0}),Fc(()=>{e.isUnmounting=!0}),e}const dn=[Function,Array],jc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:dn,onEnter:dn,onAfterEnter:dn,onEnterCancelled:dn,onBeforeLeave:dn,onLeave:dn,onAfterLeave:dn,onLeaveCancelled:dn,onBeforeAppear:dn,onAppear:dn,onAfterAppear:dn,onAppearCancelled:dn},hp={name:"BaseTransition",props:jc,setup(e,{slots:t}){const n=fl(),o=Ic();return()=>{const r=t.default&&ll(t.default(),!0),l=r&&r.length?Dc(r):n.subTree?me():void 0;if(!l)return;const u=mt(e),{mode:f}=u;if(o.isLeaving)return di(l);const v=Hr(l);if(!v)return di(l);let y=Ro(v,u,o,n,w=>y=w);v.type!==Qt&&fs(v,y);let m=n.subTree&&Hr(n.subTree);if(m&&m.type!==Qt&&!Ps(m,v)&&Ko(n.subTree)){let w=Ro(m,u,o,n);if(fs(m,w),f==="out-in"&&v.type!==Qt)return o.isLeaving=!0,w.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete w.afterLeave,m=void 0},di(l);f==="in-out"&&v.type!==Qt?w.delayLeave=(T,$,I)=>{const J=Lc(o,m);J[String(m.key)]=m,T[fn]=()=>{$(),T[fn]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{I(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return l}}};function Dc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Qt){t=n;break}}return t}const yp=hp;function Lc(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Ro(e,t,n,o,r){const{appear:l,mode:u,persisted:f=!1,onBeforeEnter:v,onEnter:y,onAfterEnter:m,onEnterCancelled:w,onBeforeLeave:T,onLeave:$,onAfterLeave:I,onLeaveCancelled:J,onBeforeAppear:ae,onAppear:de,onAfterAppear:ue,onAppearCancelled:G}=t,S=String(e.key),M=Lc(n,e),ee=(j,A)=>{j&&gn(j,o,9,A)},q=(j,A)=>{const O=A[1];ee(j,A),Ge(j)?j.every(ne=>ne.length<=1)&&O():j.length<=1&&O()},oe={mode:u,persisted:f,beforeEnter(j){let A=v;if(!n.isMounted)if(l)A=ae||v;else return;j[fn]&&j[fn](!0);const O=M[S];if(O&&Ps(e,O)){let ne=O.el[fn];if(!ne){const Ie=Ko(O);ne=Ie&&Ie.el[fn]}ne&&ne()}ee(A,[j])},enter(j){if(M[S]===e)return;let A=y,O=m,ne=w;if(!n.isMounted)if(l)A=de||y,O=ue||m,ne=G||w;else return;let Ie=!1;j[_o]=_e=>{Ie||(Ie=!0,_e?ee(ne,[j]):ee(O,[j]),oe.delayedLeave&&oe.delayedLeave(),j[_o]=void 0)};const Se=j[_o].bind(null,!1);A?q(A,[j,Se]):Se()},leave(j,A){const O=String(e.key);if(j[_o]&&j[_o](!0),n.isUnmounting)return A();ee(T,[j]);let ne=!1;j[fn]=Se=>{ne||(ne=!0,A(),Se?ee(J,[j]):ee(I,[j]),j[fn]=void 0,M[O]===e&&delete M[O])};const Ie=j[fn].bind(null,!1);M[O]=e,$?q($,[j,Ie]):Ie()},clone(j){const A=Ro(j,t,n,o,r);return r&&r(A),A}};return oe}function di(e){if(ga(e))return e=ps(e),e.children=null,e}function Hr(e){if(!ga(e))return ya(e.type)&&e.children?Dc(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&&rt(n.default))return n.default()}}function fs(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;fs(ya(n.type)&&Hr(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===Oe&&Ge(e.children)){const n=Hc(e.children,!1);n&&fs(n,t)}}function ll(e,t=!1,n){let o=[],r=0;for(let l=0;l1)for(let l=0;lTo(J,t&&(Ge(t)?t[ae]:t),n,o,r));return}if(Po(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&To(e,t,n,o.component.subTree);return}const l=o.shapeFlag&4?ka(o.component):o.el,u=r?null:l,{i:f,r:v}=e,y=t&&t.r,m=f.refs===$t?f.refs={}:f.refs,w=f.setupState,T=mt(w),$=w===$t?Zu:J=>uu(m,J)?!1:yt(T,J),I=(J,ae)=>!(ae&&uu(m,ae));if(y!=null&&y!==v){if(cu(t),Ot(y))m[y]=null,$(y)&&(w[y]=null);else if(Zt(y)){const J=t;I(y,J.k)&&(y.value=null),J.k&&(m[J.k]=null)}}if(rt(v))Go(v,f,12,[u,m]);else{const J=Ot(v),ae=Zt(v);if(J||ae){const de=()=>{if(e.f){const ue=J?$(v)?w[v]:m[v]:I()||!e.k?v.value:m[e.k];if(r)Ge(ue)&&Xi(ue,l);else if(Ge(ue))ue.includes(l)||ue.push(l);else if(J)m[v]=[l],$(v)&&(w[v]=m[v]);else{const G=[l];I(v,e.k)&&(v.value=G),e.k&&(m[e.k]=G)}}else J?(m[v]=u,$(v)&&(w[v]=u)):ae&&(I(v,e.k)&&(v.value=u),e.k&&(m[e.k]=u))};if(u){const ue=()=>{de(),zr.delete(e)};ue.id=-1,zr.set(e,ue),nn(ue,n)}else cu(e),de()}}}function cu(e){const t=zr.get(e);t&&(t.flags|=8,zr.delete(e))}va().requestIdleCallback;va().cancelIdleCallback;const Po=e=>!!e.type.__asyncLoader,ga=e=>e.type.__isKeepAlive;function gp(e,t){Kc(e,"a",t)}function bp(e,t){Kc(e,"da",t)}function Kc(e,t,n=on){const o=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(ba(t,o,n),n){let r=n.parent;for(;r&&r.parent;)ga(r.parent.vnode)&&wp(o,t,n,r),r=r.parent}}function wp(e,t,n,o){const r=ba(t,e,o,!0);bn(()=>{Xi(o[t],r)},n)}function ba(e,t,n=on,o=!1){if(n){const r=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...u)=>{Rn();const f=Yo(n),v=gn(t,n,e,u);return f(),Kn(),v});return o?r.unshift(l):r.push(l),l}}const Yn=e=>(t,n=on)=>{(!Bo||e==="sp")&&ba(e,(...o)=>t(...o),n)},_p=Yn("bm"),cn=Yn("m"),kp=Yn("bu"),Nc=Yn("u"),Fc=Yn("bum"),bn=Yn("um"),Cp=Yn("sp"),xp=Yn("rtg"),$p=Yn("rtc");function Sp(e,t=on){ba("ec",e,t)}const Ep=Symbol.for("v-ndc");function st(e,t,n,o){let r;const l=n,u=Ge(e);if(u||Ot(e)){const f=u&&ls(e);let v=!1,y=!1;f&&(v=!mn(e),y=Nn(e),e=ma(e)),r=new Array(e.length);for(let m=0,w=e.length;mt(f,v,void 0,l));else{const f=Object.keys(e);r=new Array(f.length);for(let v=0,y=f.length;ve?ld(e)?ka(e):Ai(e.parent):null,Oo=Rt(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=>Ai(e.parent),$root:e=>Ai(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Bc(e),$forceUpdate:e=>e.f||(e.f=()=>{il(e.update)}),$nextTick:e=>e.n||(e.n=Ks.bind(e.proxy)),$watch:e=>fp.bind(e)}),fi=(e,t)=>e!==$t&&!e.__isScriptSetup&&yt(e,t),Ap={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:l,accessCache:u,type:f,appContext:v}=e;if(t[0]!=="$"){const T=u[t];if(T!==void 0)switch(T){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return l[t]}else{if(fi(o,t))return u[t]=1,o[t];if(r!==$t&&yt(r,t))return u[t]=2,r[t];if(yt(l,t))return u[t]=3,l[t];if(n!==$t&&yt(n,t))return u[t]=4,n[t];Ti&&(u[t]=0)}}const y=Oo[t];let m,w;if(y)return t==="$attrs"&&Xt(e.attrs,"get",""),y(e);if((m=f.__cssModules)&&(m=m[t]))return m;if(n!==$t&&yt(n,t))return u[t]=4,n[t];if(w=v.config.globalProperties,yt(w,t))return w[t]},set({_:e},t,n){const{data:o,setupState:r,ctx:l}=e;return fi(r,t)?(r[t]=n,!0):o!==$t&&yt(o,t)?(o[t]=n,!0):yt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,props:l,type:u}},f){let v;return!!(n[f]||e!==$t&&f[0]!=="$"&&yt(e,f)||fi(t,f)||yt(l,f)||yt(o,f)||yt(Oo,f)||yt(r.config.globalProperties,f)||(v=u.__cssModules)&&v[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:yt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function du(e){return Ge(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ti=!0;function Tp(e){const t=Bc(e),n=e.proxy,o=e.ctx;Ti=!1,t.beforeCreate&&fu(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:u,watch:f,provide:v,inject:y,created:m,beforeMount:w,mounted:T,beforeUpdate:$,updated:I,activated:J,deactivated:ae,beforeDestroy:de,beforeUnmount:ue,destroyed:G,unmounted:S,render:M,renderTracked:ee,renderTriggered:q,errorCaptured:oe,serverPrefetch:j,expose:A,inheritAttrs:O,components:ne,directives:Ie,filters:Se}=t;if(y&&Pp(y,o,null),u)for(const qe in u){const Ue=u[qe];rt(Ue)&&(o[qe]=Ue.bind(n))}if(r){const qe=r.call(n,n);_t(qe)&&(e.data=ol(qe))}if(Ti=!0,l)for(const qe in l){const Ue=l[qe],tt=rt(Ue)?Ue.bind(n,n):rt(Ue.get)?Ue.get.bind(n,n):Dn,Ye=!rt(Ue)&&rt(Ue.set)?Ue.set.bind(n):Dn,We=nt({get:tt,set:Ye});Object.defineProperty(o,qe,{enumerable:!0,configurable:!0,get:()=>We.value,set:le=>We.value=le})}if(f)for(const qe in f)Vc(f[qe],o,n,qe);if(v){const qe=rt(v)?v.call(n):v;Reflect.ownKeys(qe).forEach(Ue=>{up(Ue,qe[Ue])})}m&&fu(m,e,"c");function Me(qe,Ue){Ge(Ue)?Ue.forEach(tt=>qe(tt.bind(n))):Ue&&qe(Ue.bind(n))}if(Me(_p,w),Me(cn,T),Me(kp,$),Me(Nc,I),Me(gp,J),Me(bp,ae),Me(Sp,oe),Me($p,ee),Me(xp,q),Me(Fc,ue),Me(bn,S),Me(Cp,j),Ge(A))if(A.length){const qe=e.exposed||(e.exposed={});A.forEach(Ue=>{Object.defineProperty(qe,Ue,{get:()=>n[Ue],set:tt=>n[Ue]=tt,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===Dn&&(e.render=M),O!=null&&(e.inheritAttrs=O),ne&&(e.components=ne),Ie&&(e.directives=Ie),j&&Rc(e)}function Pp(e,t,n=Dn){Ge(e)&&(e=Pi(e));for(const o in e){const r=e[o];let l;_t(r)?"default"in r?l=Ir(r.from||o,r.default,!0):l=Ir(r.from||o):l=Ir(r),Zt(l)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>l.value,set:u=>l.value=u}):t[o]=l}}function fu(e,t,n){gn(Ge(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vc(e,t,n,o){let r=o.includes(".")?Oc(n,o):()=>n[o];if(Ot(e)){const l=t[e];rt(l)&&pt(r,l)}else if(rt(e))pt(r,e.bind(n));else if(_t(e))if(Ge(e))e.forEach(l=>Vc(l,t,n,o));else{const l=rt(e.handler)?e.handler.bind(n):t[e.handler];rt(l)&&pt(r,l,e)}}function Bc(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:u}}=e.appContext,f=l.get(t);let v;return f?v=f:!r.length&&!n&&!o?v=t:(v={},r.length&&r.forEach(y=>Wr(v,y,u,!0)),Wr(v,t,u)),_t(t)&&l.set(t,v),v}function Wr(e,t,n,o=!1){const{mixins:r,extends:l}=t;l&&Wr(e,l,n,!0),r&&r.forEach(u=>Wr(e,u,n,!0));for(const u in t)if(!(o&&u==="expose")){const f=Op[u]||n&&n[u];e[u]=f?f(e[u],t[u]):t[u]}return e}const Op={data:pu,props:vu,emits:vu,methods:xo,computed:xo,beforeCreate:tn,created:tn,beforeMount:tn,mounted:tn,beforeUpdate:tn,updated:tn,beforeDestroy:tn,beforeUnmount:tn,destroyed:tn,unmounted:tn,activated:tn,deactivated:tn,errorCaptured:tn,serverPrefetch:tn,components:xo,directives:xo,watch:Ip,provide:pu,inject:Mp};function pu(e,t){return t?e?function(){return Rt(rt(e)?e.call(this,this):e,rt(t)?t.call(this,this):t)}:t:e}function Mp(e,t){return xo(Pi(e),Pi(t))}function Pi(e){if(Ge(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${kn(t)}Modifiers`]||e[`${hs(t)}Modifiers`];function Rp(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||$t;let r=n;const l=t.startsWith("update:"),u=l&&Lp(o,t.slice(7));u&&(u.trim&&(r=n.map(m=>Ot(m)?m.trim():m)),u.number&&(r=r.map(pa)));let f,v=o[f=ri(t)]||o[f=ri(kn(t))];!v&&l&&(v=o[f=ri(hs(t))]),v&&gn(v,e,6,r);const y=o[f+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,gn(y,e,6,r)}}const Kp=new WeakMap;function qc(e,t,n=!1){const o=n?Kp:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const l=e.emits;let u={},f=!1;if(!rt(e)){const v=y=>{const m=qc(y,t,!0);m&&(f=!0,Rt(u,m))};!n&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}return!l&&!f?(_t(e)&&o.set(e,null),null):(Ge(l)?l.forEach(v=>u[v]=null):Rt(u,l),_t(e)&&o.set(e,u),u)}function wa(e,t){return!e||!ca(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),yt(e,t[0].toLowerCase()+t.slice(1))||yt(e,hs(t))||yt(e,t))}function mu(e){const{type:t,vnode:n,proxy:o,withProxy:r,propsOptions:[l],slots:u,attrs:f,emit:v,render:y,renderCache:m,props:w,data:T,setupState:$,ctx:I,inheritAttrs:J}=e,ae=qr(e);let de,ue;try{if(n.shapeFlag&4){const S=r||o,M=S;de=In(y.call(M,S,m,w,$,T,I)),ue=f}else{const S=t;de=In(S.length>1?S(w,{attrs:f,slots:u,emit:v}):S(w,null)),ue=t.props?f:Np(f)}}catch(S){Ds.length=0,ha(S,e,1),de=be(Qt)}let G=de;if(ue&&J!==!1){const S=Object.keys(ue),{shapeFlag:M}=G;S.length&&M&7&&(l&&S.some(da)&&(ue=Fp(ue,l)),G=ps(G,ue,!1,!0))}if(n.dirs&&(G=ps(G,null,!1,!0),G.dirs=G.dirs?G.dirs.concat(n.dirs):n.dirs),n.transition){const S=ya(G.type)&&Hr(G)||G;fs(S,n.transition)}return de=G,qr(ae),de}function Hc(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||ca(n))&&((t||(t={}))[n]=e[n]);return t},Fp=(e,t)=>{const n={};for(const o in e)(!da(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function Vp(e,t,n){const{props:o,children:r,component:l}=e,{props:u,children:f,patchFlag:v}=t,y=l.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&v>=0){if(v&1024)return!0;if(v&16)return o?hu(o,u,y):!!u;if(v&8){const m=t.dynamicProps;for(let w=0;wObject.create(Wc),Yc=e=>Object.getPrototypeOf(e)===Wc;function Up(e,t,n,o=!1){const r={},l=Gc();e.propsDefaults=Object.create(null),Jc(e,t,r,l);for(const u in e.propsOptions[0])u in r||(r[u]=void 0);n?e.props=o?r:Jf(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function qp(e,t,n,o){const{props:r,attrs:l,vnode:{patchFlag:u}}=e,f=mt(r),[v]=e.propsOptions;let y=!1;if((o||u>0)&&!(u&16)){if(u&8){const m=e.vnode.dynamicProps;for(let w=0;w{v=!0;const[T,$]=Xc(w,t,!0);Rt(u,T),$&&f.push(...$)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!l&&!v)return _t(e)&&o.set(e,Ms),Ms;if(Ge(l))for(let m=0;me==="_"||e==="_ctx"||e==="$stable",cl=e=>Ge(e)?e.map(In):[In(e)],zp=(e,t,n)=>{if(t._n)return t;const o=Sn((...r)=>cl(t(...r)),n);return o._c=!1,o},Qc=(e,t,n)=>{const o=e._ctx;for(const r in e){if(ul(r))continue;const l=e[r];if(rt(l))t[r]=zp(r,l,o);else if(l!=null){const u=cl(l);t[r]=()=>u}}},Zc=(e,t)=>{const n=cl(t);e.slots.default=()=>n},ed=(e,t,n)=>{for(const o in t)(n||!ul(o))&&(e[o]=t[o])},Wp=(e,t,n)=>{const o=e.slots=Gc();if(e.vnode.shapeFlag&32){const r=t._;r?(ed(o,t,n),n&&oc(o,"_",r,!0)):Qc(t,o)}else t&&Zc(e,t)},Gp=(e,t,n)=>{const{vnode:o,slots:r}=e;let l=!0,u=$t;if(o.shapeFlag&32){const f=t._;f?n&&f===1?l=!1:ed(r,t,n):(l=!t.$stable,Qc(t,r)),u=t}else t&&(Zc(e,t),u={default:1});if(l)for(const f in r)!ul(f)&&u[f]==null&&delete r[f]},nn=Zp;function Yp(e){return Jp(e)}function Jp(e,t){const n=va();n.__VUE__=!0;const{insert:o,remove:r,patchProp:l,createElement:u,createText:f,createComment:v,setText:y,setElementText:m,parentNode:w,nextSibling:T,setScopeId:$=Dn,insertStaticContent:I}=e,J=(_,g,C,D=null,re=null,pe=null,xe=void 0,we=null,ke=!!g.dynamicChildren)=>{if(_===g)return;_&&!Ps(_,g)&&(D=Te(_),le(_,re,pe,!0),_=null),g.patchFlag===-2&&(ke=!1,g.dynamicChildren=null),g.dynamicChildren&&_&&_.dynamicChildren&&_.dynamicChildren.hasOnce&&(g.dynamicChildren===Ms&&(g.dynamicChildren=[]),g.dynamicChildren.hasOnce=!0);const{type:ve,ref:Re,shapeFlag:V}=g;switch(ve){case _a:ae(_,g,C,D);break;case Qt:de(_,g,C,D);break;case jr:_==null&&ue(g,C,D,xe);break;case Oe:ne(_,g,C,D,re,pe,xe,we,ke);break;default:V&1?M(_,g,C,D,re,pe,xe,we,ke):V&6?Ie(_,g,C,D,re,pe,xe,we,ke):(V&64||V&128)&&ve.process(_,g,C,D,re,pe,xe,we,ke,xt)}Re!=null&&re?To(Re,_&&_.ref,pe,g||_,!g):Re==null&&_&&_.ref!=null&&To(_.ref,null,pe,_,!0)},ae=(_,g,C,D)=>{if(_==null)o(g.el=f(g.children),C,D);else{const re=g.el=_.el;g.children!==_.children&&y(re,g.children)}},de=(_,g,C,D)=>{_==null?o(g.el=v(g.children||""),C,D):g.el=_.el},ue=(_,g,C,D)=>{[_.el,_.anchor]=I(_.children,g,C,D,_.el,_.anchor)},G=({el:_,anchor:g},C,D)=>{let re;for(;_&&_!==g;)re=T(_),o(_,C,D),_=re;o(g,C,D)},S=({el:_,anchor:g})=>{let C;for(;_&&_!==g;)C=T(_),r(_),_=C;r(g)},M=(_,g,C,D,re,pe,xe,we,ke)=>{if(g.type==="svg"?xe="svg":g.type==="math"&&(xe="mathml"),_==null)ee(g,C,D,re,pe,xe,we,ke);else{const ve=_.el&&_.el._isVueCE?_.el:null;try{ve&&ve._beginPatch(),j(_,g,re,pe,xe,we,ke)}finally{ve&&ve._endPatch()}}},ee=(_,g,C,D,re,pe,xe,we)=>{let ke,ve;const{props:Re,shapeFlag:V,transition:te,dirs:R}=_;if(ke=_.el=u(_.type,pe,Re&&Re.is,Re),V&8?m(ke,_.children):V&16&&oe(_.children,ke,null,D,re,pi(_,pe),xe,we),R&&xs(_,null,D,"created"),q(ke,_,_.scopeId,xe,D),Re){for(const fe in Re)fe!=="value"&&!So(fe)&&l(ke,fe,null,Re[fe],pe,D);"value"in Re&&l(ke,"value",null,Re.value,pe),(ve=Re.onVnodeBeforeMount)&&An(ve,D,_)}R&&xs(_,null,D,"beforeMount");const L=Xp(re,te);L&&te.beforeEnter(ke),o(ke,g,C),((ve=Re&&Re.onVnodeMounted)||L||R)&&nn(()=>{try{ve&&An(ve,D,_),L&&te.enter(ke),R&&xs(_,null,D,"mounted")}finally{}},re)},q=(_,g,C,D,re)=>{if(C&&$(_,C),D)for(let pe=0;pe{for(let ve=ke;ve<_.length;ve++){const Re=_[ve]=we?qn(_[ve]):In(_[ve]);J(null,Re,g,C,D,re,pe,xe,we)}},j=(_,g,C,D,re,pe,xe)=>{const we=g.el=_.el;let{patchFlag:ke,dynamicChildren:ve,dirs:Re}=g;ke|=_.patchFlag&16;const V=_.props||$t,te=g.props||$t;let R;if(C&&$s(C,!1),(R=te.onVnodeBeforeUpdate)&&An(R,C,g,_),Re&&xs(g,_,C,"beforeUpdate"),C&&$s(C,!0),ve&&(!_.dynamicChildren||_.dynamicChildren.length!==ve.length)&&(ke=0,xe=!1,ve=null),(V.innerHTML&&te.innerHTML==null||V.textContent&&te.textContent==null)&&m(we,""),ve?A(_.dynamicChildren,ve,we,C,D,pi(g,re),pe):xe||Ue(_,g,we,null,C,D,pi(g,re),pe,!1),ke>0){if(ke&16)O(we,V,te,C,re);else if(ke&2&&V.class!==te.class&&l(we,"class",null,te.class,re),ke&4&&l(we,"style",V.style,te.style,re),ke&8){const L=g.dynamicProps;for(let fe=0;fe{R&&An(R,C,g,_),Re&&xs(g,_,C,"updated")},D)},A=(_,g,C,D,re,pe,xe)=>{for(let we=0;we{if(g!==C){if(g!==$t)for(const pe in g)!So(pe)&&!(pe in C)&&l(_,pe,g[pe],null,re,D);for(const pe in C){if(So(pe))continue;const xe=C[pe],we=g[pe];xe!==we&&pe!=="value"&&l(_,pe,we,xe,re,D)}"value"in C&&l(_,"value",g.value,C.value,re)}},ne=(_,g,C,D,re,pe,xe,we,ke)=>{const ve=g.el=_?_.el:f(""),Re=g.anchor=_?_.anchor:f("");let{patchFlag:V,dynamicChildren:te,slotScopeIds:R}=g;R&&(we=we?we.concat(R):R),_==null?(o(ve,C,D),o(Re,C,D),oe(g.children||[],C,Re,re,pe,xe,we,ke)):V>0&&V&64&&te&&_.dynamicChildren&&_.dynamicChildren.length===te.length?(A(_.dynamicChildren,te,C,re,pe,xe,we),(g.key!=null||re&&g===re.subTree)&&dl(_,g,!0)):Ue(_,g,C,Re,re,pe,xe,we,ke)},Ie=(_,g,C,D,re,pe,xe,we,ke)=>{g.slotScopeIds=we,_==null?g.shapeFlag&512?re.ctx.activate(g,C,D,xe,ke):Se(g,C,D,re,pe,xe,ke):_e(_,g,ke)},Se=(_,g,C,D,re,pe,xe)=>{const we=_.component=rv(_,D,re);if(ga(_)&&(we.ctx.renderer=xt),av(we,!1,xe),we.asyncDep){if(re&&re.registerDep(we,Me,xe,pe),!_.el){const ke=we.subTree=be(Qt);de(null,ke,g,C),_.placeholder=ke.el}}else Me(we,_,g,C,re,pe,xe)},_e=(_,g,C)=>{const D=g.component=_.component;if(Vp(_,g,C))if(D.asyncDep&&!D.asyncResolved){g.el=_.el,g.placeholder=_.placeholder,qe(D,g,C);return}else D.next=g,D.update();else g.el=_.el,g.placeholder=_.placeholder,D.vnode=g},Me=(_,g,C,D,re,pe,xe)=>{const we=()=>{if(_.isMounted){let{next:V,bu:te,u:R,parent:L,vnode:fe}=_;{const Ze=td(_);if(Ze){V&&(V.el=fe.el,qe(_,V,xe)),Ze.asyncDep.then(()=>{nn(()=>{_.isUnmounted||ve()},re)});return}}let je=V,Je;$s(_,!1),V?(V.el=fe.el,qe(_,V,xe)):V=fe,te&&Mr(te),(Je=V.props&&V.props.onVnodeBeforeUpdate)&&An(Je,L,V,fe),$s(_,!0);const ft=mu(_),It=_.subTree;_.subTree=ft,J(It,ft,w(It.el),Te(It),_,re,pe),V.el=ft.el,je===null&&Bp(_,ft.el),R&&nn(R,re),(Je=V.props&&V.props.onVnodeUpdated)&&nn(()=>An(Je,L,V,fe),re)}else{let V;const{el:te,props:R}=g,{bm:L,m:fe,parent:je,root:Je,type:ft}=_,It=Po(g);$s(_,!1),L&&Mr(L),!It&&(V=R&&R.onVnodeBeforeMount)&&An(V,je,g),$s(_,!0);{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(ft,_.parent?_.parent.type:void 0);const Ze=_.subTree=mu(_);J(null,Ze,C,D,_,re,pe),g.el=Ze.el}if(fe&&nn(fe,re),!It&&(V=R&&R.onVnodeMounted)){const Ze=g;nn(()=>An(V,je,Ze),re)}(g.shapeFlag&256||je&&Po(je.vnode)&&je.vnode.shapeFlag&256)&&_.a&&nn(_.a,re),_.isMounted=!0,g=C=D=null}};_.scope.on();const ke=_.effect=new lc(we);_.scope.off();const ve=_.update=ke.run.bind(ke),Re=_.job=ke.runIfDirty.bind(ke);Re.i=_,Re.id=_.uid,ke.scheduler=()=>il(Re),$s(_,!0),ve()},qe=(_,g,C)=>{g.component=_;const D=_.vnode.props;_.vnode=g,_.next=null,qp(_,g.props,D,C),Gp(_,g.children,C),Rn(),Sc(_),Kn()},Ue=(_,g,C,D,re,pe,xe,we,ke=!1)=>{const ve=_&&_.children,Re=_?_.shapeFlag:0,V=g.children,{patchFlag:te,shapeFlag:R}=g;if(te>0){if(te&128){Ye(ve,V,C,D,re,pe,xe,we,ke);return}else if(te&256){tt(ve,V,C,D,re,pe,xe,we,ke);return}}R&8?(Re&16&&it(ve,re,pe),V!==ve&&m(C,V)):Re&16?R&16?Ye(ve,V,C,D,re,pe,xe,we,ke):it(ve,re,pe,!0):(Re&8&&m(C,""),R&16&&oe(V,C,D,re,pe,xe,we,ke))},tt=(_,g,C,D,re,pe,xe,we,ke)=>{_=_||Ms,g=g||Ms;const ve=_.length,Re=g.length,V=Math.min(ve,Re);let te;for(te=0;teRe?it(_,re,pe,!0,!1,V):oe(g,C,D,re,pe,xe,we,ke,V)},Ye=(_,g,C,D,re,pe,xe,we,ke)=>{let ve=0;const Re=g.length;let V=_.length-1,te=Re-1;for(;ve<=V&&ve<=te;){const R=_[ve],L=g[ve]=ke?qn(g[ve]):In(g[ve]);if(Ps(R,L))J(R,L,C,null,re,pe,xe,we,ke);else break;ve++}for(;ve<=V&&ve<=te;){const R=_[V],L=g[te]=ke?qn(g[te]):In(g[te]);if(Ps(R,L))J(R,L,C,null,re,pe,xe,we,ke);else break;V--,te--}if(ve>V){if(ve<=te){const R=te+1,L=Rte)for(;ve<=V;)le(_[ve],re,pe,!0),ve++;else{const R=ve,L=ve,fe=new Map;for(ve=L;ve<=te;ve++){const bt=g[ve]=ke?qn(g[ve]):In(g[ve]);bt.key!=null&&fe.set(bt.key,ve)}let je,Je=0;const ft=te-L+1;let It=!1,Ze=0;const et=new Array(ft);for(ve=0;ve=ft){le(bt,re,pe,!0);continue}let wt;if(bt.key!=null)wt=fe.get(bt.key);else for(je=L;je<=te;je++)if(et[je-L]===0&&Ps(bt,g[je])){wt=je;break}wt===void 0?le(bt,re,pe,!0):(et[wt-L]=ve+1,wt>=Ze?Ze=wt:It=!0,J(bt,g[wt],C,null,re,pe,xe,we,ke),Je++)}const Bt=It?Qp(et):Ms;for(je=Bt.length-1,ve=ft-1;ve>=0;ve--){const bt=L+ve,wt=g[bt],Ne=g[bt+1],rn=bt+1{const{el:pe,type:xe,transition:we,children:ke,shapeFlag:ve}=_;if(ve&6){We(_.component.subTree,g,C,D);return}if(ve&128){_.suspense.move(g,C,D);return}if(ve&64){xe.move(_,g,C,xt);return}if(xe===Oe){o(pe,g,C);for(let V=0;Vwe.enter(pe),re));else{const{leave:V,delayLeave:te,afterLeave:R}=we,L=()=>{_.ctx.isUnmounted?r(pe):o(pe,g,C)},fe=()=>{const je=pe._isLeaving||!!pe[fn];pe._isLeaving&&pe[fn](!0),we.persisted&&!je?L():V(pe,()=>{L(),R&&R()})};te?te(pe,L,fe):fe()}else o(pe,g,C)},le=(_,g,C,D=!1,re=!1)=>{const{type:pe,props:xe,ref:we,children:ke,dynamicChildren:ve,shapeFlag:Re,patchFlag:V,dirs:te,cacheIndex:R,memo:L}=_;if((V===-2||ve&&ve.hasOnce)&&(re=!1),we!=null&&(Rn(),To(we,null,C,_,!0),Kn()),R!=null&&(!_.ctx||_.ctx===g)&&(g.renderCache[R]=void 0),Re&256){g.ctx.deactivate(_);return}const fe=Re&1&&te,je=!Po(_);let Je;if(je&&(Je=xe&&xe.onVnodeBeforeUnmount)&&An(Je,g,_),Re&6)lt(_.component,C,D);else{if(Re&128){_.suspense.unmount(C,D);return}fe&&xs(_,null,g,"beforeUnmount"),Re&64?_.type.remove(_,g,C,xt,D):ve&&!ve.hasOnce&&(pe!==Oe||V>0&&V&64)?it(ve,g,C,!1,!0):(pe===Oe&&V&384||!re&&Re&16)&&it(ke,g,C),D&&Q(_)}const ft=L!=null&&R==null;(je&&(Je=xe&&xe.onVnodeUnmounted)||fe||ft)&&nn(()=>{Je&&An(Je,g,_),fe&&xs(_,null,g,"unmounted"),ft&&(_.el=null)},C)},Q=_=>{const{type:g,el:C,anchor:D,transition:re}=_,pe=g===Oe;if(pe&&!re){Ae(C,D);return}if(g===jr){S(_),re&&!re.persisted&&re.afterLeave&&re.afterLeave();return}const xe=pe?Ko(_):_,we=()=>{pe?w(C)&&Ae(C,D):r(C),re&&!re.persisted&&re.afterLeave&&re.afterLeave()};if(xe&&xe.shapeFlag&1&&re&&!re.persisted){const{leave:ke,delayLeave:ve}=re,Re=xe.el,V=()=>ke(Re,we);ve?ve(Re,we,V):V()}else we()},Ae=(_,g)=>{let C;for(;_!==g;)C=T(_),r(_),_=C;r(g)},lt=(_,g,C)=>{const{bum:D,scope:re,job:pe,subTree:xe,um:we,m:ke,a:ve}=_;gu(ke),gu(ve),D&&Mr(D),re.stop(),pe?(pe.flags|=8,le(xe,_,g,C)):_.vnode.el&&xe&&(xe.transition=_.vnode.transition,le(xe,_,g,C)),we&&nn(we,g),nn(()=>{_.isUnmounted=!0},g)},it=(_,g,C,D=!1,re=!1,pe=0)=>{for(let xe=pe;xe<_.length;xe++)le(_[xe],g,C,D,re)},Te=_=>{if(_.shapeFlag&6)return Te(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const g=T(_.anchor||_.el),C=g&&g[Mc];return C?T(C):g},kt=(_,g,C)=>{const D=_&&g._vnode?void 0:_&&_.component?_.component.uid:ov();lp(()=>{_==null?g._vnode&&le(g._vnode,null,null,!0):J(g._vnode||null,_,g,null,null,null,C),g._vnode=_},D)},xt={p:J,um:le,m:We,r:Q,mt:Se,mc:oe,pc:Ue,pbc:A,n:Te,o:e};return{render:kt,hydrate:void 0,createApp:Dp(kt)}}function pi({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 $s({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Xp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function dl(e,t,n=!1){const o=e.children,r=t.children;if(Ge(o)&&Ge(r))for(let l=0;l>1,e[n[f]]0&&(t[o]=n[l-1]),n[l]=o)}}for(l=n.length,u=n[l-1];l-- >0;)n[l]=u,u=t[u];return n}function td(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:td(t)}function gu(e){if(e)for(let t=0;te.__isSuspense;function Zp(e,t){t&&t.pendingBranch?Ge(e)?t.effects.push(...e):t.effects.push(e):ip(e)}const Oe=Symbol.for("v-fgt"),_a=Symbol.for("v-txt"),Qt=Symbol.for("v-cmt"),jr=Symbol.for("v-stc"),Ds=[];let un=null;function x(e=!1){Ds.push(un=e?null:[])}function sd(){Ds.pop(),un=Ds[Ds.length-1]||null}let No=1;function Gr(e,t=!1){No+=e,e<0&&un&&t&&(un.hasOnce=!0)}function od(e){return e.dynamicChildren=No>0?un||Ms:null,sd(),No>0&&un&&un.push(e),e}function E(e,t,n,o,r,l){return od(i(e,t,n,o,r,l,!0))}function Ct(e,t,n,o,r){return od(be(e,t,n,o,r,!0))}function Fo(e){return e?e.__v_isVNode===!0:!1}function Ps(e,t){return e.type===t.type&&e.key===t.key}const rd=({key:e})=>e??null,Dr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ot(e)||Zt(e)||rt(e)?{i:vn,r:e,k:t,f:!!n}:e:null);function i(e,t=null,n=null,o=0,r=null,l=e===Oe?0:1,u=!1,f=!1){const v={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rd(t),ref:t&&Dr(t),scopeId:Tc,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:l,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:vn};return f?(Yr(v,n),l&128&&e.normalize(v)):n&&(v.shapeFlag|=Ot(n)?8:16),No>0&&!u&&un&&(v.patchFlag>0||l&6)&&v.patchFlag!==32&&un.push(v),v}const be=ev;function ev(e,t=null,n=null,o=0,r=null,l=!1){if((!e||e===Ep)&&(e=Qt),Fo(e)){const f=ps(e,t,!0);return n&&Yr(f,n),No>0&&!l&&un&&(f.shapeFlag&6?un[un.indexOf(e)]=f:un.push(f)),f.patchFlag=-2,f}if(cv(e)&&(e=e.__vccOpts),t){t=tv(t);let{class:f,style:v}=t;f&&!Ot(f)&&(t.class=ze(f)),_t(v)&&(al(v)&&!Ge(v)&&(v=Rt({},v)),t.style=pn(v))}const u=Ot(e)?1:nd(e)?128:ya(e)?64:_t(e)?4:rt(e)?2:0;return i(e,t,n,o,r,u,l,!0)}function tv(e){return e?al(e)||Yc(e)?Rt({},e):e:null}function ps(e,t,n=!1,o=!1){const{props:r,ref:l,patchFlag:u,children:f,transition:v}=e,y=t?nv(r||{},t):r,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&rd(y),ref:t&&t.ref?n&&l?Ge(l)?l.concat(Dr(t)):[l,Dr(t)]:Dr(t):l,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!==Oe?u===-1?16:u|16:u,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:v,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ps(e.ssContent),ssFallback:e.ssFallback&&ps(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return v&&o&&fs(m,v.clone(m)),m}function At(e=" ",t=0){return be(_a,null,e,t)}function ad(e,t){const n=be(jr,null,e);return n.staticCount=t,n}function me(e="",t=!1){return t?(x(),Ct(Qt,null,e)):be(Qt,null,e)}function In(e){return e==null||typeof e=="boolean"?be(Qt):Ge(e)?be(Oe,null,e.slice()):Fo(e)?qn(e):be(_a,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ps(e)}function Yr(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(Ge(t))n=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Yr(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Yc(t)?t._ctx=vn:r===3&&vn&&(vn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(rt(t)){if(o&65){Yr(e,{default:t});return}t={default:t,_ctx:vn},n=32}else t=String(t),o&64?(n=16,t=[At(t)]):n=8;e.children=t,e.shapeFlag|=n}function nv(...e){const t={};for(let n=0;non||vn;let Jr,Vo;{const e=va(),t=(n,o)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(o),l=>{r.length>1?r.forEach(u=>u(l)):r[0](l)}};Jr=t("__VUE_INSTANCE_SETTERS__",n=>on=n),Vo=t("__VUE_SSR_SETTERS__",n=>Bo=n)}const Yo=e=>{const t=on;return Jr(e),e.scope.on(),()=>{e.scope.off(),Jr(t)}},bu=()=>{on&&on.scope.off(),Jr(null)};function ld(e){return e.vnode.shapeFlag&4}let Bo=!1;function av(e,t=!1,n=!1){t&&Vo(t);const{props:o,children:r}=e.vnode,l=ld(e);Up(e,o,l,t),Wp(e,r,n||t);const u=l?iv(e,t):void 0;return t&&Vo(!1),u}function iv(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ap);const{setup:o}=n;if(o){Rn();const r=e.setupContext=o.length>1?uv(e):null,l=Yo(e),u=Go(o,e,0,[e.props,r]),f=ec(u);if(Kn(),l(),(f||e.sp)&&!Po(e)&&Rc(e),f){if(u.then(bu,bu),t)return u.then(v=>{Vo(!0);try{wu(e,v,t)}finally{Vo(!1)}}).catch(v=>{ha(v,e,0)});e.asyncDep=u}else wu(e,u)}else ud(e)}function wu(e,t,n){rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_t(t)&&(e.setupState=Cc(t)),ud(e)}function ud(e,t,n){const o=e.type;e.render||(e.render=o.render||Dn);{const r=Yo(e);Rn();try{Tp(e)}finally{Kn(),r()}}}const lv={get(e,t){return Xt(e,"get",""),e[t]}};function uv(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,lv),slots:e.slots,emit:e.emit,expose:t}}function ka(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Cc(Xf(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Oo)return Oo[n](e)},has(t,n){return n in t||n in Oo}})):e.proxy}function cv(e){return rt(e)&&"__vccOpts"in e}const nt=(e,t)=>np(e,t,Bo);function dv(e,t,n){try{Gr(-1);const o=arguments.length;return o===2?_t(t)&&!Ge(t)?Fo(t)?be(e,null,[t]):be(e,t):be(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Fo(n)&&(n=[n]),be(e,t,n))}finally{Gr(1)}}const fv="3.5.44";/** +**/function Go(e,t,n,o){try{return o?e(...o):e()}catch(r){ha(r,t,n)}}function gn(e,t,n,o){if(rt(e)){const r=Go(e,t,n,o);return r&&ec(r)&&r.catch(l=>{ha(l,t,n)}),r}if(Ge(e)){const r=[];for(let l=0;l>>1,r=sn[o],l=Ro(r);l=Ro(n)?sn.push(e):sn.splice(ap(t),0,e),e.flags|=1,$c()}}function $c(){Ur||(Ur=xc.then(Ac))}function ip(e){if(!Ge(e))as&&e.id===-1?as.splice(Js+1,0,e):e.flags&1||(Mn.push(e),e.flags|=1);else for(let t=0;t=t))continue;sn.splice(o,1),o=e?o-1:_n,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Ec(e,t,n=0){if(Mn.length){let o=Mn,r=0;if(t){o=[];for(let u=0;uRo(u)-Ro(f));if(Mn.length=r,as){for(let u=0;ue.id==null?e.flags&2?-1:1/0:e.id;function Ac(e){try{for(_n=0;_n{o._d&&Gr(-1);const l=qr(t),u=Ds.length;let f;try{f=e(...r)}finally{for(let v=Ds.length;v>u;v--)sd();qr(l),o._d&&Gr(1)}return f};return o._n=!0,o._c=!0,o._d=!0,o}function Pe(e,t){if(vn===null)return e;const n=ka(vn),o=e.dirs||(e.dirs=[]);for(let r=0;r1)return n&&rt(t)?t.call(o&&o.proxy):t}}const cp=Symbol.for("v-scx"),dp=()=>Ir(cp);function pt(e,t,n){return Pc(e,t,n)}function Pc(e,t,n=$t){const{immediate:o,deep:r,flush:l,once:u}=n,f=Rt({},n),v=t&&o||!t&&l!=="post";let y;if(Uo){if(l==="sync"){const $=dp();y=$.__watcherHandles||($.__watcherHandles=[])}else if(!v){const $=()=>{};return $.stop=Dn,$.resume=Dn,$.pause=Dn,$}}const m=on;f.call=($,I,J)=>gn($,m,I,J);let w=!1;l==="post"?f.scheduler=$=>{$.i=m,nn($,m&&m.suspense)}:l!=="sync"&&(w=!0,f.scheduler=($,I)=>{I?$():il($)}),f.augmentJob=$=>{t&&($.flags|=4),w&&($.flags|=2,m&&($.id=m.uid,$.i=m))};const T=op(e,t,f);return Uo&&(y?y.push(T):v&&T()),T}function fp(e,t,n){const o=this.proxy,r=Ot(e)?e.includes(".")?Oc(o,e):()=>o[e]:e.bind(o,o);let l;rt(t)?l=t:(l=t.handler,n=t);const u=Yo(this),f=Pc(r,l.bind(o),n);return u(),f}function Oc(e,t){const n=t.split(".");return()=>{let o=e;for(let r=0;re.__isTeleport,Ts=e=>e&&(e.disabled||e.disabled===""),pp=e=>e&&(e.defer||e.defer===""),iu=e=>typeof SVGElement<"u"&&e instanceof SVGElement,lu=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,Si=(e,t)=>{const n=e&&e.to;return Ot(n)?t?t(n):null:n},vp={name:"Teleport",__isTeleport:!0,process(e,t,n,o,r,l,u,f,v,y){const{mc:m,pc:w,pbc:T,o:{insert:$,querySelector:I,createText:J,createComment:ae,parentNode:de}}=y,ue=Ts(t.props);let{dynamicChildren:G}=t;const S=(q,oe,j)=>{q.shapeFlag&16&&m(q.children,oe,j,r,l,u,f,v)},M=(q=t)=>{const oe=Ts(q.props),j=q.target=Si(q.props,I),A=Ei(j,q,J,$);j&&(u!=="svg"&&iu(j)?u="svg":u!=="mathml"&&lu(j)&&(u="mathml"),r&&r.isCE&&(r.ce._teleportTargets||(r.ce._teleportTargets=new Set)).add(j),oe||(S(q,j,A),xo(q,!1)))},ee=q=>{const oe=()=>{if(os.get(q)===oe){if(os.delete(q),Ts(q.props)){const j=de(q.el)||n;S(q,j,q.anchor),xo(q,!0)}M(q)}};os.set(q,oe),nn(oe,l)};if(e==null){const q=t.el=J(""),oe=t.anchor=J("");if($(q,n,o),$(oe,n,o),pp(t.props)||l&&l.pendingBranch){ee(t);return}ue&&(S(t,n,oe),xo(t,!0)),M()}else{t.el=e.el;const q=t.anchor=e.anchor,oe=os.get(e);if(oe){oe.flags|=8,os.delete(e),ee(t);return}t.targetStart=e.targetStart;const j=t.target=e.target,A=t.targetAnchor=e.targetAnchor,O=Ts(e.props),ne=O?n:j,Ie=O?q:A;if(u==="svg"||iu(j)?u="svg":(u==="mathml"||lu(j))&&(u="mathml"),G?(T(e.dynamicChildren,G,ne,r,l,u,f),dl(e,t,!0)):v||w(e,t,ne,Ie,r,l,u,f,!1),ue)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Ar(t,n,q,y,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const Se=Si(t.props,I);Se&&(t.target=Se,Ar(t,Se,null,y,0))}else O&&Ar(t,j,A,y,1);xo(t,ue)}},remove(e,t,n,{um:o,o:{remove:r}},l){const{shapeFlag:u,children:f,anchor:v,targetStart:y,targetAnchor:m,target:w,props:T}=e,$=Ts(T),I=l||!$,J=os.get(e);if(J&&(J.flags|=8,os.delete(e)),w&&(r(y),r(m)),l&&r(v),!J&&($||w)&&u&16)for(let ae=0;ae{e.isMounted=!0}),Fc(()=>{e.isUnmounting=!0}),e}const dn=[Function,Array],jc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:dn,onEnter:dn,onAfterEnter:dn,onEnterCancelled:dn,onBeforeLeave:dn,onLeave:dn,onAfterLeave:dn,onLeaveCancelled:dn,onBeforeAppear:dn,onAppear:dn,onAfterAppear:dn,onAppearCancelled:dn},hp={name:"BaseTransition",props:jc,setup(e,{slots:t}){const n=fl(),o=Ic();return()=>{const r=t.default&&ll(t.default(),!0),l=r&&r.length?Dc(r):n.subTree?me():void 0;if(!l)return;const u=mt(e),{mode:f}=u;if(o.isLeaving)return di(l);const v=Hr(l);if(!v)return di(l);let y=Ko(v,u,o,n,w=>y=w);v.type!==Qt&&fs(v,y);let m=n.subTree&&Hr(n.subTree);if(m&&m.type!==Qt&&!Ps(m,v)&&No(n.subTree)){let w=Ko(m,u,o,n);if(fs(m,w),f==="out-in"&&v.type!==Qt)return o.isLeaving=!0,w.afterLeave=()=>{o.isLeaving=!1,n.job.flags&8||n.update(),delete w.afterLeave,m=void 0},di(l);f==="in-out"&&v.type!==Qt?w.delayLeave=(T,$,I)=>{const J=Lc(o,m);J[String(m.key)]=m,T[fn]=()=>{$(),T[fn]=void 0,delete y.delayedLeave,m=void 0},y.delayedLeave=()=>{I(),delete y.delayedLeave,m=void 0}}:m=void 0}else m&&(m=void 0);return l}}};function Dc(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==Qt){t=n;break}}return t}const yp=hp;function Lc(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Ko(e,t,n,o,r){const{appear:l,mode:u,persisted:f=!1,onBeforeEnter:v,onEnter:y,onAfterEnter:m,onEnterCancelled:w,onBeforeLeave:T,onLeave:$,onAfterLeave:I,onLeaveCancelled:J,onBeforeAppear:ae,onAppear:de,onAfterAppear:ue,onAppearCancelled:G}=t,S=String(e.key),M=Lc(n,e),ee=(j,A)=>{j&&gn(j,o,9,A)},q=(j,A)=>{const O=A[1];ee(j,A),Ge(j)?j.every(ne=>ne.length<=1)&&O():j.length<=1&&O()},oe={mode:u,persisted:f,beforeEnter(j){let A=v;if(!n.isMounted)if(l)A=ae||v;else return;j[fn]&&j[fn](!0);const O=M[S];if(O&&Ps(e,O)){let ne=O.el[fn];if(!ne){const Ie=No(O);ne=Ie&&Ie.el[fn]}ne&&ne()}ee(A,[j])},enter(j){if(M[S]===e)return;let A=y,O=m,ne=w;if(!n.isMounted)if(l)A=de||y,O=ue||m,ne=G||w;else return;let Ie=!1;j[ko]=_e=>{Ie||(Ie=!0,_e?ee(ne,[j]):ee(O,[j]),oe.delayedLeave&&oe.delayedLeave(),j[ko]=void 0)};const Se=j[ko].bind(null,!1);A?q(A,[j,Se]):Se()},leave(j,A){const O=String(e.key);if(j[ko]&&j[ko](!0),n.isUnmounting)return A();ee(T,[j]);let ne=!1;j[fn]=Se=>{ne||(ne=!0,A(),Se?ee(J,[j]):ee(I,[j]),j[fn]=void 0,M[O]===e&&delete M[O])};const Ie=j[fn].bind(null,!1);M[O]=e,$?q($,[j,Ie]):Ie()},clone(j){const A=Ko(j,t,n,o,r);return r&&r(A),A}};return oe}function di(e){if(ga(e))return e=ps(e),e.children=null,e}function Hr(e){if(!ga(e))return ya(e.type)&&e.children?Dc(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&&rt(n.default))return n.default()}}function fs(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const n=e.component.subTree;fs(ya(n.type)&&Hr(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===Oe&&Ge(e.children)){const n=Hc(e.children,!1);n&&fs(n,t)}}function ll(e,t=!1,n){let o=[],r=0;for(let l=0;l1)for(let l=0;lPo(J,t&&(Ge(t)?t[ae]:t),n,o,r));return}if(Oo(o)&&!r){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&Po(e,t,n,o.component.subTree);return}const l=o.shapeFlag&4?ka(o.component):o.el,u=r?null:l,{i:f,r:v}=e,y=t&&t.r,m=f.refs===$t?f.refs={}:f.refs,w=f.setupState,T=mt(w),$=w===$t?Zu:J=>uu(m,J)?!1:yt(T,J),I=(J,ae)=>!(ae&&uu(m,ae));if(y!=null&&y!==v){if(cu(t),Ot(y))m[y]=null,$(y)&&(w[y]=null);else if(Zt(y)){const J=t;I(y,J.k)&&(y.value=null),J.k&&(m[J.k]=null)}}if(rt(v))Go(v,f,12,[u,m]);else{const J=Ot(v),ae=Zt(v);if(J||ae){const de=()=>{if(e.f){const ue=J?$(v)?w[v]:m[v]:I()||!e.k?v.value:m[e.k];if(r)Ge(ue)&&Xi(ue,l);else if(Ge(ue))ue.includes(l)||ue.push(l);else if(J)m[v]=[l],$(v)&&(w[v]=m[v]);else{const G=[l];I(v,e.k)&&(v.value=G),e.k&&(m[e.k]=G)}}else J?(m[v]=u,$(v)&&(w[v]=u)):ae&&(I(v,e.k)&&(v.value=u),e.k&&(m[e.k]=u))};if(u){const ue=()=>{de(),zr.delete(e)};ue.id=-1,zr.set(e,ue),nn(ue,n)}else cu(e),de()}}}function cu(e){const t=zr.get(e);t&&(t.flags|=8,zr.delete(e))}va().requestIdleCallback;va().cancelIdleCallback;const Oo=e=>!!e.type.__asyncLoader,ga=e=>e.type.__isKeepAlive;function gp(e,t){Kc(e,"a",t)}function bp(e,t){Kc(e,"da",t)}function Kc(e,t,n=on){const o=e.__wdc||(e.__wdc=()=>{let r=n;for(;r;){if(r.isDeactivated)return;r=r.parent}return e()});if(ba(t,o,n),n){let r=n.parent;for(;r&&r.parent;)ga(r.parent.vnode)&&wp(o,t,n,r),r=r.parent}}function wp(e,t,n,o){const r=ba(t,e,o,!0);bn(()=>{Xi(o[t],r)},n)}function ba(e,t,n=on,o=!1){if(n){const r=n[e]||(n[e]=[]),l=t.__weh||(t.__weh=(...u)=>{Rn();const f=Yo(n),v=gn(t,n,e,u);return f(),Kn(),v});return o?r.unshift(l):r.push(l),l}}const Yn=e=>(t,n=on)=>{(!Uo||e==="sp")&&ba(e,(...o)=>t(...o),n)},_p=Yn("bm"),cn=Yn("m"),kp=Yn("bu"),Nc=Yn("u"),Fc=Yn("bum"),bn=Yn("um"),Cp=Yn("sp"),xp=Yn("rtg"),$p=Yn("rtc");function Sp(e,t=on){ba("ec",e,t)}const Ep=Symbol.for("v-ndc");function st(e,t,n,o){let r;const l=n,u=Ge(e);if(u||Ot(e)){const f=u&&ls(e);let v=!1,y=!1;f&&(v=!mn(e),y=Nn(e),e=ma(e)),r=new Array(e.length);for(let m=0,w=e.length;mt(f,v,void 0,l));else{const f=Object.keys(e);r=new Array(f.length);for(let v=0,y=f.length;ve?ld(e)?ka(e):Ai(e.parent):null,Mo=Rt(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=>Ai(e.parent),$root:e=>Ai(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Bc(e),$forceUpdate:e=>e.f||(e.f=()=>{il(e.update)}),$nextTick:e=>e.n||(e.n=Ks.bind(e.proxy)),$watch:e=>fp.bind(e)}),fi=(e,t)=>e!==$t&&!e.__isScriptSetup&&yt(e,t),Ap={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:r,props:l,accessCache:u,type:f,appContext:v}=e;if(t[0]!=="$"){const T=u[t];if(T!==void 0)switch(T){case 1:return o[t];case 2:return r[t];case 4:return n[t];case 3:return l[t]}else{if(fi(o,t))return u[t]=1,o[t];if(r!==$t&&yt(r,t))return u[t]=2,r[t];if(yt(l,t))return u[t]=3,l[t];if(n!==$t&&yt(n,t))return u[t]=4,n[t];Ti&&(u[t]=0)}}const y=Mo[t];let m,w;if(y)return t==="$attrs"&&Xt(e.attrs,"get",""),y(e);if((m=f.__cssModules)&&(m=m[t]))return m;if(n!==$t&&yt(n,t))return u[t]=4,n[t];if(w=v.config.globalProperties,yt(w,t))return w[t]},set({_:e},t,n){const{data:o,setupState:r,ctx:l}=e;return fi(r,t)?(r[t]=n,!0):o!==$t&&yt(o,t)?(o[t]=n,!0):yt(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(l[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:r,props:l,type:u}},f){let v;return!!(n[f]||e!==$t&&f[0]!=="$"&&yt(e,f)||fi(t,f)||yt(l,f)||yt(o,f)||yt(Mo,f)||yt(r.config.globalProperties,f)||(v=u.__cssModules)&&v[f])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:yt(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function du(e){return Ge(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Ti=!0;function Tp(e){const t=Bc(e),n=e.proxy,o=e.ctx;Ti=!1,t.beforeCreate&&fu(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:u,watch:f,provide:v,inject:y,created:m,beforeMount:w,mounted:T,beforeUpdate:$,updated:I,activated:J,deactivated:ae,beforeDestroy:de,beforeUnmount:ue,destroyed:G,unmounted:S,render:M,renderTracked:ee,renderTriggered:q,errorCaptured:oe,serverPrefetch:j,expose:A,inheritAttrs:O,components:ne,directives:Ie,filters:Se}=t;if(y&&Pp(y,o,null),u)for(const qe in u){const Ue=u[qe];rt(Ue)&&(o[qe]=Ue.bind(n))}if(r){const qe=r.call(n,n);_t(qe)&&(e.data=ol(qe))}if(Ti=!0,l)for(const qe in l){const Ue=l[qe],tt=rt(Ue)?Ue.bind(n,n):rt(Ue.get)?Ue.get.bind(n,n):Dn,Ye=!rt(Ue)&&rt(Ue.set)?Ue.set.bind(n):Dn,We=nt({get:tt,set:Ye});Object.defineProperty(o,qe,{enumerable:!0,configurable:!0,get:()=>We.value,set:le=>We.value=le})}if(f)for(const qe in f)Vc(f[qe],o,n,qe);if(v){const qe=rt(v)?v.call(n):v;Reflect.ownKeys(qe).forEach(Ue=>{up(Ue,qe[Ue])})}m&&fu(m,e,"c");function Me(qe,Ue){Ge(Ue)?Ue.forEach(tt=>qe(tt.bind(n))):Ue&&qe(Ue.bind(n))}if(Me(_p,w),Me(cn,T),Me(kp,$),Me(Nc,I),Me(gp,J),Me(bp,ae),Me(Sp,oe),Me($p,ee),Me(xp,q),Me(Fc,ue),Me(bn,S),Me(Cp,j),Ge(A))if(A.length){const qe=e.exposed||(e.exposed={});A.forEach(Ue=>{Object.defineProperty(qe,Ue,{get:()=>n[Ue],set:tt=>n[Ue]=tt,enumerable:!0})})}else e.exposed||(e.exposed={});M&&e.render===Dn&&(e.render=M),O!=null&&(e.inheritAttrs=O),ne&&(e.components=ne),Ie&&(e.directives=Ie),j&&Rc(e)}function Pp(e,t,n=Dn){Ge(e)&&(e=Pi(e));for(const o in e){const r=e[o];let l;_t(r)?"default"in r?l=Ir(r.from||o,r.default,!0):l=Ir(r.from||o):l=Ir(r),Zt(l)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>l.value,set:u=>l.value=u}):t[o]=l}}function fu(e,t,n){gn(Ge(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function Vc(e,t,n,o){let r=o.includes(".")?Oc(n,o):()=>n[o];if(Ot(e)){const l=t[e];rt(l)&&pt(r,l)}else if(rt(e))pt(r,e.bind(n));else if(_t(e))if(Ge(e))e.forEach(l=>Vc(l,t,n,o));else{const l=rt(e.handler)?e.handler.bind(n):t[e.handler];rt(l)&&pt(r,l,e)}}function Bc(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:l,config:{optionMergeStrategies:u}}=e.appContext,f=l.get(t);let v;return f?v=f:!r.length&&!n&&!o?v=t:(v={},r.length&&r.forEach(y=>Wr(v,y,u,!0)),Wr(v,t,u)),_t(t)&&l.set(t,v),v}function Wr(e,t,n,o=!1){const{mixins:r,extends:l}=t;l&&Wr(e,l,n,!0),r&&r.forEach(u=>Wr(e,u,n,!0));for(const u in t)if(!(o&&u==="expose")){const f=Op[u]||n&&n[u];e[u]=f?f(e[u],t[u]):t[u]}return e}const Op={data:pu,props:vu,emits:vu,methods:$o,computed:$o,beforeCreate:tn,created:tn,beforeMount:tn,mounted:tn,beforeUpdate:tn,updated:tn,beforeDestroy:tn,beforeUnmount:tn,destroyed:tn,unmounted:tn,activated:tn,deactivated:tn,errorCaptured:tn,serverPrefetch:tn,components:$o,directives:$o,watch:Ip,provide:pu,inject:Mp};function pu(e,t){return t?e?function(){return Rt(rt(e)?e.call(this,this):e,rt(t)?t.call(this,this):t)}:t:e}function Mp(e,t){return $o(Pi(e),Pi(t))}function Pi(e){if(Ge(e)){const t={};for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${kn(t)}Modifiers`]||e[`${hs(t)}Modifiers`];function Rp(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||$t;let r=n;const l=t.startsWith("update:"),u=l&&Lp(o,t.slice(7));u&&(u.trim&&(r=n.map(m=>Ot(m)?m.trim():m)),u.number&&(r=r.map(pa)));let f,v=o[f=ri(t)]||o[f=ri(kn(t))];!v&&l&&(v=o[f=ri(hs(t))]),v&&gn(v,e,6,r);const y=o[f+"Once"];if(y){if(!e.emitted)e.emitted={};else if(e.emitted[f])return;e.emitted[f]=!0,gn(y,e,6,r)}}const Kp=new WeakMap;function qc(e,t,n=!1){const o=n?Kp:t.emitsCache,r=o.get(e);if(r!==void 0)return r;const l=e.emits;let u={},f=!1;if(!rt(e)){const v=y=>{const m=qc(y,t,!0);m&&(f=!0,Rt(u,m))};!n&&t.mixins.length&&t.mixins.forEach(v),e.extends&&v(e.extends),e.mixins&&e.mixins.forEach(v)}return!l&&!f?(_t(e)&&o.set(e,null),null):(Ge(l)?l.forEach(v=>u[v]=null):Rt(u,l),_t(e)&&o.set(e,u),u)}function wa(e,t){return!e||!ca(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),yt(e,t[0].toLowerCase()+t.slice(1))||yt(e,hs(t))||yt(e,t))}function mu(e){const{type:t,vnode:n,proxy:o,withProxy:r,propsOptions:[l],slots:u,attrs:f,emit:v,render:y,renderCache:m,props:w,data:T,setupState:$,ctx:I,inheritAttrs:J}=e,ae=qr(e);let de,ue;try{if(n.shapeFlag&4){const S=r||o,M=S;de=In(y.call(M,S,m,w,$,T,I)),ue=f}else{const S=t;de=In(S.length>1?S(w,{attrs:f,slots:u,emit:v}):S(w,null)),ue=t.props?f:Np(f)}}catch(S){Ds.length=0,ha(S,e,1),de=be(Qt)}let G=de;if(ue&&J!==!1){const S=Object.keys(ue),{shapeFlag:M}=G;S.length&&M&7&&(l&&S.some(da)&&(ue=Fp(ue,l)),G=ps(G,ue,!1,!0))}if(n.dirs&&(G=ps(G,null,!1,!0),G.dirs=G.dirs?G.dirs.concat(n.dirs):n.dirs),n.transition){const S=ya(G.type)&&Hr(G)||G;fs(S,n.transition)}return de=G,qr(ae),de}function Hc(e,t=!0){let n;for(let o=0;o{let t;for(const n in e)(n==="class"||n==="style"||ca(n))&&((t||(t={}))[n]=e[n]);return t},Fp=(e,t)=>{const n={};for(const o in e)(!da(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function Vp(e,t,n){const{props:o,children:r,component:l}=e,{props:u,children:f,patchFlag:v}=t,y=l.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&v>=0){if(v&1024)return!0;if(v&16)return o?hu(o,u,y):!!u;if(v&8){const m=t.dynamicProps;for(let w=0;wObject.create(Wc),Yc=e=>Object.getPrototypeOf(e)===Wc;function Up(e,t,n,o=!1){const r={},l=Gc();e.propsDefaults=Object.create(null),Jc(e,t,r,l);for(const u in e.propsOptions[0])u in r||(r[u]=void 0);n?e.props=o?r:Jf(r):e.type.props?e.props=r:e.props=l,e.attrs=l}function qp(e,t,n,o){const{props:r,attrs:l,vnode:{patchFlag:u}}=e,f=mt(r),[v]=e.propsOptions;let y=!1;if((o||u>0)&&!(u&16)){if(u&8){const m=e.vnode.dynamicProps;for(let w=0;w{v=!0;const[T,$]=Xc(w,t,!0);Rt(u,T),$&&f.push(...$)};!n&&t.mixins.length&&t.mixins.forEach(m),e.extends&&m(e.extends),e.mixins&&e.mixins.forEach(m)}if(!l&&!v)return _t(e)&&o.set(e,Ms),Ms;if(Ge(l))for(let m=0;me==="_"||e==="_ctx"||e==="$stable",cl=e=>Ge(e)?e.map(In):[In(e)],zp=(e,t,n)=>{if(t._n)return t;const o=Sn((...r)=>cl(t(...r)),n);return o._c=!1,o},Qc=(e,t,n)=>{const o=e._ctx;for(const r in e){if(ul(r))continue;const l=e[r];if(rt(l))t[r]=zp(r,l,o);else if(l!=null){const u=cl(l);t[r]=()=>u}}},Zc=(e,t)=>{const n=cl(t);e.slots.default=()=>n},ed=(e,t,n)=>{for(const o in t)(n||!ul(o))&&(e[o]=t[o])},Wp=(e,t,n)=>{const o=e.slots=Gc();if(e.vnode.shapeFlag&32){const r=t._;r?(ed(o,t,n),n&&oc(o,"_",r,!0)):Qc(t,o)}else t&&Zc(e,t)},Gp=(e,t,n)=>{const{vnode:o,slots:r}=e;let l=!0,u=$t;if(o.shapeFlag&32){const f=t._;f?n&&f===1?l=!1:ed(r,t,n):(l=!t.$stable,Qc(t,r)),u=t}else t&&(Zc(e,t),u={default:1});if(l)for(const f in r)!ul(f)&&u[f]==null&&delete r[f]},nn=Zp;function Yp(e){return Jp(e)}function Jp(e,t){const n=va();n.__VUE__=!0;const{insert:o,remove:r,patchProp:l,createElement:u,createText:f,createComment:v,setText:y,setElementText:m,parentNode:w,nextSibling:T,setScopeId:$=Dn,insertStaticContent:I}=e,J=(_,g,C,D=null,re=null,pe=null,xe=void 0,we=null,ke=!!g.dynamicChildren)=>{if(_===g)return;_&&!Ps(_,g)&&(D=Te(_),le(_,re,pe,!0),_=null),g.patchFlag===-2&&(ke=!1,g.dynamicChildren=null),g.dynamicChildren&&_&&_.dynamicChildren&&_.dynamicChildren.hasOnce&&(g.dynamicChildren===Ms&&(g.dynamicChildren=[]),g.dynamicChildren.hasOnce=!0);const{type:ve,ref:Re,shapeFlag:V}=g;switch(ve){case _a:ae(_,g,C,D);break;case Qt:de(_,g,C,D);break;case jr:_==null&&ue(g,C,D,xe);break;case Oe:ne(_,g,C,D,re,pe,xe,we,ke);break;default:V&1?M(_,g,C,D,re,pe,xe,we,ke):V&6?Ie(_,g,C,D,re,pe,xe,we,ke):(V&64||V&128)&&ve.process(_,g,C,D,re,pe,xe,we,ke,xt)}Re!=null&&re?Po(Re,_&&_.ref,pe,g||_,!g):Re==null&&_&&_.ref!=null&&Po(_.ref,null,pe,_,!0)},ae=(_,g,C,D)=>{if(_==null)o(g.el=f(g.children),C,D);else{const re=g.el=_.el;g.children!==_.children&&y(re,g.children)}},de=(_,g,C,D)=>{_==null?o(g.el=v(g.children||""),C,D):g.el=_.el},ue=(_,g,C,D)=>{[_.el,_.anchor]=I(_.children,g,C,D,_.el,_.anchor)},G=({el:_,anchor:g},C,D)=>{let re;for(;_&&_!==g;)re=T(_),o(_,C,D),_=re;o(g,C,D)},S=({el:_,anchor:g})=>{let C;for(;_&&_!==g;)C=T(_),r(_),_=C;r(g)},M=(_,g,C,D,re,pe,xe,we,ke)=>{if(g.type==="svg"?xe="svg":g.type==="math"&&(xe="mathml"),_==null)ee(g,C,D,re,pe,xe,we,ke);else{const ve=_.el&&_.el._isVueCE?_.el:null;try{ve&&ve._beginPatch(),j(_,g,re,pe,xe,we,ke)}finally{ve&&ve._endPatch()}}},ee=(_,g,C,D,re,pe,xe,we)=>{let ke,ve;const{props:Re,shapeFlag:V,transition:te,dirs:R}=_;if(ke=_.el=u(_.type,pe,Re&&Re.is,Re),V&8?m(ke,_.children):V&16&&oe(_.children,ke,null,D,re,pi(_,pe),xe,we),R&&xs(_,null,D,"created"),q(ke,_,_.scopeId,xe,D),Re){for(const fe in Re)fe!=="value"&&!Eo(fe)&&l(ke,fe,null,Re[fe],pe,D);"value"in Re&&l(ke,"value",null,Re.value,pe),(ve=Re.onVnodeBeforeMount)&&An(ve,D,_)}R&&xs(_,null,D,"beforeMount");const L=Xp(re,te);L&&te.beforeEnter(ke),o(ke,g,C),((ve=Re&&Re.onVnodeMounted)||L||R)&&nn(()=>{try{ve&&An(ve,D,_),L&&te.enter(ke),R&&xs(_,null,D,"mounted")}finally{}},re)},q=(_,g,C,D,re)=>{if(C&&$(_,C),D)for(let pe=0;pe{for(let ve=ke;ve<_.length;ve++){const Re=_[ve]=we?qn(_[ve]):In(_[ve]);J(null,Re,g,C,D,re,pe,xe,we)}},j=(_,g,C,D,re,pe,xe)=>{const we=g.el=_.el;let{patchFlag:ke,dynamicChildren:ve,dirs:Re}=g;ke|=_.patchFlag&16;const V=_.props||$t,te=g.props||$t;let R;if(C&&$s(C,!1),(R=te.onVnodeBeforeUpdate)&&An(R,C,g,_),Re&&xs(g,_,C,"beforeUpdate"),C&&$s(C,!0),ve&&(!_.dynamicChildren||_.dynamicChildren.length!==ve.length)&&(ke=0,xe=!1,ve=null),(V.innerHTML&&te.innerHTML==null||V.textContent&&te.textContent==null)&&m(we,""),ve?A(_.dynamicChildren,ve,we,C,D,pi(g,re),pe):xe||Ue(_,g,we,null,C,D,pi(g,re),pe,!1),ke>0){if(ke&16)O(we,V,te,C,re);else if(ke&2&&V.class!==te.class&&l(we,"class",null,te.class,re),ke&4&&l(we,"style",V.style,te.style,re),ke&8){const L=g.dynamicProps;for(let fe=0;fe{R&&An(R,C,g,_),Re&&xs(g,_,C,"updated")},D)},A=(_,g,C,D,re,pe,xe)=>{for(let we=0;we{if(g!==C){if(g!==$t)for(const pe in g)!Eo(pe)&&!(pe in C)&&l(_,pe,g[pe],null,re,D);for(const pe in C){if(Eo(pe))continue;const xe=C[pe],we=g[pe];xe!==we&&pe!=="value"&&l(_,pe,we,xe,re,D)}"value"in C&&l(_,"value",g.value,C.value,re)}},ne=(_,g,C,D,re,pe,xe,we,ke)=>{const ve=g.el=_?_.el:f(""),Re=g.anchor=_?_.anchor:f("");let{patchFlag:V,dynamicChildren:te,slotScopeIds:R}=g;R&&(we=we?we.concat(R):R),_==null?(o(ve,C,D),o(Re,C,D),oe(g.children||[],C,Re,re,pe,xe,we,ke)):V>0&&V&64&&te&&_.dynamicChildren&&_.dynamicChildren.length===te.length?(A(_.dynamicChildren,te,C,re,pe,xe,we),(g.key!=null||re&&g===re.subTree)&&dl(_,g,!0)):Ue(_,g,C,Re,re,pe,xe,we,ke)},Ie=(_,g,C,D,re,pe,xe,we,ke)=>{g.slotScopeIds=we,_==null?g.shapeFlag&512?re.ctx.activate(g,C,D,xe,ke):Se(g,C,D,re,pe,xe,ke):_e(_,g,ke)},Se=(_,g,C,D,re,pe,xe)=>{const we=_.component=rv(_,D,re);if(ga(_)&&(we.ctx.renderer=xt),av(we,!1,xe),we.asyncDep){if(re&&re.registerDep(we,Me,xe,pe),!_.el){const ke=we.subTree=be(Qt);de(null,ke,g,C),_.placeholder=ke.el}}else Me(we,_,g,C,re,pe,xe)},_e=(_,g,C)=>{const D=g.component=_.component;if(Vp(_,g,C))if(D.asyncDep&&!D.asyncResolved){g.el=_.el,g.placeholder=_.placeholder,qe(D,g,C);return}else D.next=g,D.update();else g.el=_.el,g.placeholder=_.placeholder,D.vnode=g},Me=(_,g,C,D,re,pe,xe)=>{const we=()=>{if(_.isMounted){let{next:V,bu:te,u:R,parent:L,vnode:fe}=_;{const Ze=td(_);if(Ze){V&&(V.el=fe.el,qe(_,V,xe)),Ze.asyncDep.then(()=>{nn(()=>{_.isUnmounted||ve()},re)});return}}let je=V,Je;$s(_,!1),V?(V.el=fe.el,qe(_,V,xe)):V=fe,te&&Mr(te),(Je=V.props&&V.props.onVnodeBeforeUpdate)&&An(Je,L,V,fe),$s(_,!0);const ft=mu(_),It=_.subTree;_.subTree=ft,J(It,ft,w(It.el),Te(It),_,re,pe),V.el=ft.el,je===null&&Bp(_,ft.el),R&&nn(R,re),(Je=V.props&&V.props.onVnodeUpdated)&&nn(()=>An(Je,L,V,fe),re)}else{let V;const{el:te,props:R}=g,{bm:L,m:fe,parent:je,root:Je,type:ft}=_,It=Oo(g);$s(_,!1),L&&Mr(L),!It&&(V=R&&R.onVnodeBeforeMount)&&An(V,je,g),$s(_,!0);{Je.ce&&Je.ce._hasShadowRoot()&&Je.ce._injectChildStyle(ft,_.parent?_.parent.type:void 0);const Ze=_.subTree=mu(_);J(null,Ze,C,D,_,re,pe),g.el=Ze.el}if(fe&&nn(fe,re),!It&&(V=R&&R.onVnodeMounted)){const Ze=g;nn(()=>An(V,je,Ze),re)}(g.shapeFlag&256||je&&Oo(je.vnode)&&je.vnode.shapeFlag&256)&&_.a&&nn(_.a,re),_.isMounted=!0,g=C=D=null}};_.scope.on();const ke=_.effect=new lc(we);_.scope.off();const ve=_.update=ke.run.bind(ke),Re=_.job=ke.runIfDirty.bind(ke);Re.i=_,Re.id=_.uid,ke.scheduler=()=>il(Re),$s(_,!0),ve()},qe=(_,g,C)=>{g.component=_;const D=_.vnode.props;_.vnode=g,_.next=null,qp(_,g.props,D,C),Gp(_,g.children,C),Rn(),Sc(_),Kn()},Ue=(_,g,C,D,re,pe,xe,we,ke=!1)=>{const ve=_&&_.children,Re=_?_.shapeFlag:0,V=g.children,{patchFlag:te,shapeFlag:R}=g;if(te>0){if(te&128){Ye(ve,V,C,D,re,pe,xe,we,ke);return}else if(te&256){tt(ve,V,C,D,re,pe,xe,we,ke);return}}R&8?(Re&16&&it(ve,re,pe),V!==ve&&m(C,V)):Re&16?R&16?Ye(ve,V,C,D,re,pe,xe,we,ke):it(ve,re,pe,!0):(Re&8&&m(C,""),R&16&&oe(V,C,D,re,pe,xe,we,ke))},tt=(_,g,C,D,re,pe,xe,we,ke)=>{_=_||Ms,g=g||Ms;const ve=_.length,Re=g.length,V=Math.min(ve,Re);let te;for(te=0;teRe?it(_,re,pe,!0,!1,V):oe(g,C,D,re,pe,xe,we,ke,V)},Ye=(_,g,C,D,re,pe,xe,we,ke)=>{let ve=0;const Re=g.length;let V=_.length-1,te=Re-1;for(;ve<=V&&ve<=te;){const R=_[ve],L=g[ve]=ke?qn(g[ve]):In(g[ve]);if(Ps(R,L))J(R,L,C,null,re,pe,xe,we,ke);else break;ve++}for(;ve<=V&&ve<=te;){const R=_[V],L=g[te]=ke?qn(g[te]):In(g[te]);if(Ps(R,L))J(R,L,C,null,re,pe,xe,we,ke);else break;V--,te--}if(ve>V){if(ve<=te){const R=te+1,L=Rte)for(;ve<=V;)le(_[ve],re,pe,!0),ve++;else{const R=ve,L=ve,fe=new Map;for(ve=L;ve<=te;ve++){const bt=g[ve]=ke?qn(g[ve]):In(g[ve]);bt.key!=null&&fe.set(bt.key,ve)}let je,Je=0;const ft=te-L+1;let It=!1,Ze=0;const et=new Array(ft);for(ve=0;ve=ft){le(bt,re,pe,!0);continue}let wt;if(bt.key!=null)wt=fe.get(bt.key);else for(je=L;je<=te;je++)if(et[je-L]===0&&Ps(bt,g[je])){wt=je;break}wt===void 0?le(bt,re,pe,!0):(et[wt-L]=ve+1,wt>=Ze?Ze=wt:It=!0,J(bt,g[wt],C,null,re,pe,xe,we,ke),Je++)}const Bt=It?Qp(et):Ms;for(je=Bt.length-1,ve=ft-1;ve>=0;ve--){const bt=L+ve,wt=g[bt],Ne=g[bt+1],rn=bt+1{const{el:pe,type:xe,transition:we,children:ke,shapeFlag:ve}=_;if(ve&6){We(_.component.subTree,g,C,D);return}if(ve&128){_.suspense.move(g,C,D);return}if(ve&64){xe.move(_,g,C,xt);return}if(xe===Oe){o(pe,g,C);for(let V=0;Vwe.enter(pe),re));else{const{leave:V,delayLeave:te,afterLeave:R}=we,L=()=>{_.ctx.isUnmounted?r(pe):o(pe,g,C)},fe=()=>{const je=pe._isLeaving||!!pe[fn];pe._isLeaving&&pe[fn](!0),we.persisted&&!je?L():V(pe,()=>{L(),R&&R()})};te?te(pe,L,fe):fe()}else o(pe,g,C)},le=(_,g,C,D=!1,re=!1)=>{const{type:pe,props:xe,ref:we,children:ke,dynamicChildren:ve,shapeFlag:Re,patchFlag:V,dirs:te,cacheIndex:R,memo:L}=_;if((V===-2||ve&&ve.hasOnce)&&(re=!1),we!=null&&(Rn(),Po(we,null,C,_,!0),Kn()),R!=null&&(!_.ctx||_.ctx===g)&&(g.renderCache[R]=void 0),Re&256){g.ctx.deactivate(_);return}const fe=Re&1&&te,je=!Oo(_);let Je;if(je&&(Je=xe&&xe.onVnodeBeforeUnmount)&&An(Je,g,_),Re&6)lt(_.component,C,D);else{if(Re&128){_.suspense.unmount(C,D);return}fe&&xs(_,null,g,"beforeUnmount"),Re&64?_.type.remove(_,g,C,xt,D):ve&&!ve.hasOnce&&(pe!==Oe||V>0&&V&64)?it(ve,g,C,!1,!0):(pe===Oe&&V&384||!re&&Re&16)&&it(ke,g,C),D&&Q(_)}const ft=L!=null&&R==null;(je&&(Je=xe&&xe.onVnodeUnmounted)||fe||ft)&&nn(()=>{Je&&An(Je,g,_),fe&&xs(_,null,g,"unmounted"),ft&&(_.el=null)},C)},Q=_=>{const{type:g,el:C,anchor:D,transition:re}=_,pe=g===Oe;if(pe&&!re){Ae(C,D);return}if(g===jr){S(_),re&&!re.persisted&&re.afterLeave&&re.afterLeave();return}const xe=pe?No(_):_,we=()=>{pe?w(C)&&Ae(C,D):r(C),re&&!re.persisted&&re.afterLeave&&re.afterLeave()};if(xe&&xe.shapeFlag&1&&re&&!re.persisted){const{leave:ke,delayLeave:ve}=re,Re=xe.el,V=()=>ke(Re,we);ve?ve(Re,we,V):V()}else we()},Ae=(_,g)=>{let C;for(;_!==g;)C=T(_),r(_),_=C;r(g)},lt=(_,g,C)=>{const{bum:D,scope:re,job:pe,subTree:xe,um:we,m:ke,a:ve}=_;gu(ke),gu(ve),D&&Mr(D),re.stop(),pe?(pe.flags|=8,le(xe,_,g,C)):_.vnode.el&&xe&&(xe.transition=_.vnode.transition,le(xe,_,g,C)),we&&nn(we,g),nn(()=>{_.isUnmounted=!0},g)},it=(_,g,C,D=!1,re=!1,pe=0)=>{for(let xe=pe;xe<_.length;xe++)le(_[xe],g,C,D,re)},Te=_=>{if(_.shapeFlag&6)return Te(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const g=T(_.anchor||_.el),C=g&&g[Mc];return C?T(C):g},kt=(_,g,C)=>{const D=_&&g._vnode?void 0:_&&_.component?_.component.uid:ov();lp(()=>{_==null?g._vnode&&le(g._vnode,null,null,!0):J(g._vnode||null,_,g,null,null,null,C),g._vnode=_},D)},xt={p:J,um:le,m:We,r:Q,mt:Se,mc:oe,pc:Ue,pbc:A,n:Te,o:e};return{render:kt,hydrate:void 0,createApp:Dp(kt)}}function pi({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 $s({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Xp(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function dl(e,t,n=!1){const o=e.children,r=t.children;if(Ge(o)&&Ge(r))for(let l=0;l>1,e[n[f]]0&&(t[o]=n[l-1]),n[l]=o)}}for(l=n.length,u=n[l-1];l-- >0;)n[l]=u,u=t[u];return n}function td(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:td(t)}function gu(e){if(e)for(let t=0;te.__isSuspense;function Zp(e,t){t&&t.pendingBranch?Ge(e)?t.effects.push(...e):t.effects.push(e):ip(e)}const Oe=Symbol.for("v-fgt"),_a=Symbol.for("v-txt"),Qt=Symbol.for("v-cmt"),jr=Symbol.for("v-stc"),Ds=[];let un=null;function x(e=!1){Ds.push(un=e?null:[])}function sd(){Ds.pop(),un=Ds[Ds.length-1]||null}let Fo=1;function Gr(e,t=!1){Fo+=e,e<0&&un&&t&&(un.hasOnce=!0)}function od(e){return e.dynamicChildren=Fo>0?un||Ms:null,sd(),Fo>0&&un&&un.push(e),e}function E(e,t,n,o,r,l){return od(i(e,t,n,o,r,l,!0))}function Ct(e,t,n,o,r){return od(be(e,t,n,o,r,!0))}function Vo(e){return e?e.__v_isVNode===!0:!1}function Ps(e,t){return e.type===t.type&&e.key===t.key}const rd=({key:e})=>e??null,Dr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ot(e)||Zt(e)||rt(e)?{i:vn,r:e,k:t,f:!!n}:e:null);function i(e,t=null,n=null,o=0,r=null,l=e===Oe?0:1,u=!1,f=!1){const v={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&rd(t),ref:t&&Dr(t),scopeId:Tc,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:l,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:vn};return f?(Yr(v,n),l&128&&e.normalize(v)):n&&(v.shapeFlag|=Ot(n)?8:16),Fo>0&&!u&&un&&(v.patchFlag>0||l&6)&&v.patchFlag!==32&&un.push(v),v}const be=ev;function ev(e,t=null,n=null,o=0,r=null,l=!1){if((!e||e===Ep)&&(e=Qt),Vo(e)){const f=ps(e,t,!0);return n&&Yr(f,n),Fo>0&&!l&&un&&(f.shapeFlag&6?un[un.indexOf(e)]=f:un.push(f)),f.patchFlag=-2,f}if(cv(e)&&(e=e.__vccOpts),t){t=tv(t);let{class:f,style:v}=t;f&&!Ot(f)&&(t.class=ze(f)),_t(v)&&(al(v)&&!Ge(v)&&(v=Rt({},v)),t.style=pn(v))}const u=Ot(e)?1:nd(e)?128:ya(e)?64:_t(e)?4:rt(e)?2:0;return i(e,t,n,o,r,u,l,!0)}function tv(e){return e?al(e)||Yc(e)?Rt({},e):e:null}function ps(e,t,n=!1,o=!1){const{props:r,ref:l,patchFlag:u,children:f,transition:v}=e,y=t?nv(r||{},t):r,m={__v_isVNode:!0,__v_skip:!0,type:e.type,props:y,key:y&&rd(y),ref:t&&t.ref?n&&l?Ge(l)?l.concat(Dr(t)):[l,Dr(t)]:Dr(t):l,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!==Oe?u===-1?16:u|16:u,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:v,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ps(e.ssContent),ssFallback:e.ssFallback&&ps(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return v&&o&&fs(m,v.clone(m)),m}function At(e=" ",t=0){return be(_a,null,e,t)}function ad(e,t){const n=be(jr,null,e);return n.staticCount=t,n}function me(e="",t=!1){return t?(x(),Ct(Qt,null,e)):be(Qt,null,e)}function In(e){return e==null||typeof e=="boolean"?be(Qt):Ge(e)?be(Oe,null,e.slice()):Vo(e)?qn(e):be(_a,null,String(e))}function qn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ps(e)}function Yr(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(Ge(t))n=16;else if(typeof t=="object")if(o&65){const r=t.default;r&&(r._c&&(r._d=!1),Yr(e,r()),r._c&&(r._d=!0));return}else{n=32;const r=t._;!r&&!Yc(t)?t._ctx=vn:r===3&&vn&&(vn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(rt(t)){if(o&65){Yr(e,{default:t});return}t={default:t,_ctx:vn},n=32}else t=String(t),o&64?(n=16,t=[At(t)]):n=8;e.children=t,e.shapeFlag|=n}function nv(...e){const t={};for(let n=0;non||vn;let Jr,Bo;{const e=va(),t=(n,o)=>{let r;return(r=e[n])||(r=e[n]=[]),r.push(o),l=>{r.length>1?r.forEach(u=>u(l)):r[0](l)}};Jr=t("__VUE_INSTANCE_SETTERS__",n=>on=n),Bo=t("__VUE_SSR_SETTERS__",n=>Uo=n)}const Yo=e=>{const t=on;return Jr(e),e.scope.on(),()=>{e.scope.off(),Jr(t)}},bu=()=>{on&&on.scope.off(),Jr(null)};function ld(e){return e.vnode.shapeFlag&4}let Uo=!1;function av(e,t=!1,n=!1){t&&Bo(t);const{props:o,children:r}=e.vnode,l=ld(e);Up(e,o,l,t),Wp(e,r,n||t);const u=l?iv(e,t):void 0;return t&&Bo(!1),u}function iv(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ap);const{setup:o}=n;if(o){Rn();const r=e.setupContext=o.length>1?uv(e):null,l=Yo(e),u=Go(o,e,0,[e.props,r]),f=ec(u);if(Kn(),l(),(f||e.sp)&&!Oo(e)&&Rc(e),f){if(u.then(bu,bu),t)return u.then(v=>{Bo(!0);try{wu(e,v,t)}finally{Bo(!1)}}).catch(v=>{ha(v,e,0)});e.asyncDep=u}else wu(e,u)}else ud(e)}function wu(e,t,n){rt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_t(t)&&(e.setupState=Cc(t)),ud(e)}function ud(e,t,n){const o=e.type;e.render||(e.render=o.render||Dn);{const r=Yo(e);Rn();try{Tp(e)}finally{Kn(),r()}}}const lv={get(e,t){return Xt(e,"get",""),e[t]}};function uv(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,lv),slots:e.slots,emit:e.emit,expose:t}}function ka(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Cc(Xf(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Mo)return Mo[n](e)},has(t,n){return n in t||n in Mo}})):e.proxy}function cv(e){return rt(e)&&"__vccOpts"in e}const nt=(e,t)=>np(e,t,Uo);function dv(e,t,n){try{Gr(-1);const o=arguments.length;return o===2?_t(t)&&!Ge(t)?Vo(t)?be(e,null,[t]):be(e,t):be(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&Vo(n)&&(n=[n]),be(e,t,n))}finally{Gr(1)}}const fv="3.5.44";/** * @vue/runtime-dom v3.5.44 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let Ii;const _u=typeof window<"u"&&window.trustedTypes;if(_u)try{Ii=_u.createPolicy("vue",{createHTML:e=>e})}catch{}const cd=Ii?e=>Ii.createHTML(e):e=>e,pv="http://www.w3.org/2000/svg",vv="http://www.w3.org/1998/Math/MathML",Un=typeof document<"u"?document:null,ku=Un&&Un.createElement("template"),mv={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t==="svg"?Un.createElementNS(pv,e):t==="mathml"?Un.createElementNS(vv,e):n?Un.createElement(e,{is:n}):Un.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>Un.createTextNode(e),createComment:e=>Un.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Un.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,l){const u=n?n.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===l||!(r=r.nextSibling)););else{ku.innerHTML=cd(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const f=ku.content;if(o==="svg"||o==="mathml"){const v=f.firstChild;for(;v.firstChild;)f.appendChild(v.firstChild);f.removeChild(v)}t.insertBefore(f,n)}return[u?u.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ss="transition",ko="animation",so=Symbol("_vtc"),dd={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},fd=Rt({},jc,dd),hv=e=>(e.displayName="Transition",e.props=fd,e),Jn=hv((e,{slots:t})=>dv(yp,pd(e),t)),Ss=(e,t=[])=>{Ge(e)?e.forEach(n=>n(...t)):e&&e(...t)},Cu=e=>e?Ge(e)?e.some(t=>t.length>1):e.length>1:!1;function pd(e){const t={};for(const ne in e)ne in dd||(t[ne]=e[ne]);if(e.css===!1)return t;const{name:n="v",type:o,duration:r,enterFromClass:l=`${n}-enter-from`,enterActiveClass:u=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:v=l,appearActiveClass:y=u,appearToClass:m=f,leaveFromClass:w=`${n}-leave-from`,leaveActiveClass:T=`${n}-leave-active`,leaveToClass:$=`${n}-leave-to`}=e,I=yv(r),J=I&&I[0],ae=I&&I[1],{onBeforeEnter:de,onEnter:ue,onEnterCancelled:G,onLeave:S,onLeaveCancelled:M,onBeforeAppear:ee=de,onAppear:q=ue,onAppearCancelled:oe=G}=t,j=(ne,Ie,Se,_e)=>{ne._enterCancelled=_e,rs(ne,Ie?m:f),rs(ne,Ie?y:u),Se&&Se()},A=(ne,Ie)=>{ne._isLeaving=!1,rs(ne,w),rs(ne,$),rs(ne,T),Ie&&Ie()},O=ne=>(Ie,Se)=>{const _e=ne?q:ue,Me=()=>j(Ie,ne,Se);Ss(_e,[Ie,Me]),xu(()=>{rs(Ie,ne?v:l),Tn(Ie,ne?m:f),Cu(_e)||$u(Ie,o,J,Me)})};return Rt(t,{onBeforeEnter(ne){Ss(de,[ne]),Tn(ne,l),Tn(ne,u)},onBeforeAppear(ne){Ss(ee,[ne]),Tn(ne,v),Tn(ne,y)},onEnter:O(!1),onAppear:O(!0),onLeave(ne,Ie){ne._isLeaving=!0;const Se=()=>A(ne,Ie);Tn(ne,w),ne._enterCancelled?(Tn(ne,T),ji(ne)):(ji(ne),Tn(ne,T)),xu(()=>{ne._isLeaving&&(rs(ne,w),Tn(ne,$),Cu(S)||$u(ne,o,ae,Se))}),Ss(S,[ne,Se])},onEnterCancelled(ne){j(ne,!1,void 0,!0),Ss(G,[ne])},onAppearCancelled(ne){j(ne,!0,void 0,!0),Ss(oe,[ne])},onLeaveCancelled(ne){A(ne),Ss(M,[ne])}})}function yv(e){if(e==null)return null;if(_t(e))return[vi(e.enter),vi(e.leave)];{const t=vi(e);return[t,t]}}function vi(e){return kf(e)}function Tn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[so]||(e[so]=new Set)).add(t)}function rs(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[so];n&&(n.delete(t),n.size||(e[so]=void 0))}function xu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let gv=0;function $u(e,t,n,o){const r=e._endId=++gv,l=()=>{r===e._endId&&o()};if(n!=null)return setTimeout(l,n);const{type:u,timeout:f,propCount:v}=vd(e,t);if(!u)return o();const y=u+"end";let m=0;const w=()=>{e.removeEventListener(y,T),l()},T=$=>{$.target===e&&++m>=v&&w()};setTimeout(()=>{m(n[I]||"").split(", "),r=o(`${ss}Delay`),l=o(`${ss}Duration`),u=Su(r,l),f=o(`${ko}Delay`),v=o(`${ko}Duration`),y=Su(f,v);let m=null,w=0,T=0;t===ss?u>0&&(m=ss,w=u,T=l.length):t===ko?y>0&&(m=ko,w=y,T=v.length):(w=Math.max(u,y),m=w>0?u>y?ss:ko:null,T=m?m===ss?l.length:v.length:0);const $=m===ss&&/\b(?:transform|all)(?:,|$)/.test(o(`${ss}Property`).toString());return{type:m,timeout:w,propCount:T,hasTransform:$}}function Su(e,t){for(;e.lengthEu(n)+Eu(e[o])))}function Eu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ji(e){return(e?e.ownerDocument:document).body.offsetHeight}function bv(e,t,n){const o=e[so];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Au=Symbol("_vod"),md=Symbol("_vsh"),wv=Symbol(""),_v=/(?:^|;)\s*display\s*:/;function kv(e,t,n){const o=e.style,r=Ot(n);let l=!1;if(n&&!r){if(t)if(Ot(t))for(const u of t.split(";")){const f=u.slice(0,u.indexOf(":")).trim();n[f]==null&&$o(o,f,"")}else for(const u in t)n[u]==null&&$o(o,u,"");for(const u in n){u==="display"&&(l=!0);const f=n[u];f!=null?xv(e,u,!Ot(t)&&t?t[u]:void 0,f)||$o(o,u,f):$o(o,u,"")}}else if(r){if(t!==n){const u=o[wv];u&&(n+=";"+u),o.cssText=n,l=_v.test(n)}}else t&&e.removeAttribute("style");Au in e&&((!r||t!==n)&&(e[Au]=l?o.display:""),e[md]&&(o.display="none"))}const Tr=/\s*!important$/;function $o(e,t,n){if(Ge(n))n.forEach(o=>$o(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))Tr.test(n)?e.setProperty(t,n.replace(Tr,""),"important"):e.setProperty(t,n);else{const o=Cv(e,t);Tr.test(n)?e.setProperty(hs(o),n.replace(Tr,""),"important"):e[o]=n}}const Tu=["Webkit","Moz","ms"],mi={};function Cv(e,t){const n=mi[t];if(n)return n;let o=kn(t);if(o!=="filter"&&o in e)return mi[t]=o;o=sc(o);for(let r=0;rhi||(Pv.then(()=>hi=0),hi=Date.now());function Mv(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const r=n.value;if(Ge(r)){const l=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{l.call(o),o._stopped=!0};const u=r.slice(),f=[o];for(let v=0;ve.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Iv=(e,t,n,o,r,l)=>{const u=r==="svg";t==="class"?bv(e,o,u):t==="style"?kv(e,n,o):ca(t)?da(t)||Sv(e,t,n,o,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jv(e,t,o,u))?(Mu(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ou(e,t,o,u,l,t!=="value")):e._isVueCE&&(Dv(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ot(o)))?Mu(e,kn(t),o,l,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Ou(e,t,o,u))};function jv(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ju(t)&&rt(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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ju(t)&&Ot(n)?!1:t in e}function Dv(e,t){const n=e._def.props;if(!n)return!1;const o=kn(t);return Array.isArray(n)?n.some(r=>kn(r)===o):Object.keys(n).some(r=>kn(r)===o)}const hd=new WeakMap,yd=new WeakMap,Xr=Symbol("_moveCb"),Du=Symbol("_enterCb"),Di=new WeakMap,Lv=e=>(delete e.props.mode,e),Rv=Lv({name:"TransitionGroup",props:Rt({},fd,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=fl(),o=Ic();let r,l,u,f;const v=()=>(f===void 0&&(f=r.length>0&&Hv(r[0].el,n.vnode.el,Lu(e))),f);return Nc(()=>{if(Di.delete(n),!v()){r=[],u=void 0;return}const y=Lu(e);r.forEach(Nv);const m=u&&qv(u,n.vnode.el);u=void 0,r.forEach(T=>Fv(T,m));const w=r.filter(Vv);ji(n.vnode.el),w.forEach(T=>{const $=T.el,I=$.style;Tn($,y),I.transform=I.webkitTransform=I.transitionDuration="";const J=$[Xr]=ae=>{ae&&ae.target!==$||(!ae||ae.propertyName.endsWith("transform"))&&($.removeEventListener("transitionend",J),$[Xr]=null,rs($,y))};$.addEventListener("transitionend",J)}),r=[]}),()=>{const y=mt(e),m=pd(y);let w=y.tag||Oe;if(r=[],f=void 0,l)for(let T=0;To.willMove()&&o.item.contains(t));return n&&Ca(n.item,n)}function Hv(e,t,n){const o=e.cloneNode(),r=e[so];r&&r.forEach(f=>{f.split(/\s+/).forEach(v=>v&&o.classList.remove(v))}),n.split(/\s+/).forEach(f=>f&&o.classList.add(f)),o.style.display="none";const l=t.nodeType===1?t:t.parentNode;l.appendChild(o);const{hasTransform:u}=vd(o);return l.removeChild(o),u}const Qr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ge(t)?n=>Mr(t,n):t};function zv(e){e.target.composing=!0}function Ru(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Is=Symbol("_assign"),Pr=Symbol("_initialValue");function yi(e,t,n){return t&&(e=e.trim()),n&&(e=pa(e)),e}const Le={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e.parentNode&&(e.type==="text"?e[Pr]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Pr]=e.defaultValue.replace(/\r\n?/g,` +**/let Ii;const _u=typeof window<"u"&&window.trustedTypes;if(_u)try{Ii=_u.createPolicy("vue",{createHTML:e=>e})}catch{}const cd=Ii?e=>Ii.createHTML(e):e=>e,pv="http://www.w3.org/2000/svg",vv="http://www.w3.org/1998/Math/MathML",Un=typeof document<"u"?document:null,ku=Un&&Un.createElement("template"),mv={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t==="svg"?Un.createElementNS(pv,e):t==="mathml"?Un.createElementNS(vv,e):n?Un.createElement(e,{is:n}):Un.createElement(e);return e==="select"&&o&&o.multiple!=null&&r.setAttribute("multiple",o.multiple),r},createText:e=>Un.createTextNode(e),createComment:e=>Un.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Un.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,l){const u=n?n.previousSibling:t.lastChild;if(r&&(r===l||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),!(r===l||!(r=r.nextSibling)););else{ku.innerHTML=cd(o==="svg"?`${e}`:o==="mathml"?`${e}`:e);const f=ku.content;if(o==="svg"||o==="mathml"){const v=f.firstChild;for(;v.firstChild;)f.appendChild(v.firstChild);f.removeChild(v)}t.insertBefore(f,n)}return[u?u.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ss="transition",Co="animation",oo=Symbol("_vtc"),dd={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},fd=Rt({},jc,dd),hv=e=>(e.displayName="Transition",e.props=fd,e),Jn=hv((e,{slots:t})=>dv(yp,pd(e),t)),Ss=(e,t=[])=>{Ge(e)?e.forEach(n=>n(...t)):e&&e(...t)},Cu=e=>e?Ge(e)?e.some(t=>t.length>1):e.length>1:!1;function pd(e){const t={};for(const ne in e)ne in dd||(t[ne]=e[ne]);if(e.css===!1)return t;const{name:n="v",type:o,duration:r,enterFromClass:l=`${n}-enter-from`,enterActiveClass:u=`${n}-enter-active`,enterToClass:f=`${n}-enter-to`,appearFromClass:v=l,appearActiveClass:y=u,appearToClass:m=f,leaveFromClass:w=`${n}-leave-from`,leaveActiveClass:T=`${n}-leave-active`,leaveToClass:$=`${n}-leave-to`}=e,I=yv(r),J=I&&I[0],ae=I&&I[1],{onBeforeEnter:de,onEnter:ue,onEnterCancelled:G,onLeave:S,onLeaveCancelled:M,onBeforeAppear:ee=de,onAppear:q=ue,onAppearCancelled:oe=G}=t,j=(ne,Ie,Se,_e)=>{ne._enterCancelled=_e,rs(ne,Ie?m:f),rs(ne,Ie?y:u),Se&&Se()},A=(ne,Ie)=>{ne._isLeaving=!1,rs(ne,w),rs(ne,$),rs(ne,T),Ie&&Ie()},O=ne=>(Ie,Se)=>{const _e=ne?q:ue,Me=()=>j(Ie,ne,Se);Ss(_e,[Ie,Me]),xu(()=>{rs(Ie,ne?v:l),Tn(Ie,ne?m:f),Cu(_e)||$u(Ie,o,J,Me)})};return Rt(t,{onBeforeEnter(ne){Ss(de,[ne]),Tn(ne,l),Tn(ne,u)},onBeforeAppear(ne){Ss(ee,[ne]),Tn(ne,v),Tn(ne,y)},onEnter:O(!1),onAppear:O(!0),onLeave(ne,Ie){ne._isLeaving=!0;const Se=()=>A(ne,Ie);Tn(ne,w),ne._enterCancelled?(Tn(ne,T),ji(ne)):(ji(ne),Tn(ne,T)),xu(()=>{ne._isLeaving&&(rs(ne,w),Tn(ne,$),Cu(S)||$u(ne,o,ae,Se))}),Ss(S,[ne,Se])},onEnterCancelled(ne){j(ne,!1,void 0,!0),Ss(G,[ne])},onAppearCancelled(ne){j(ne,!0,void 0,!0),Ss(oe,[ne])},onLeaveCancelled(ne){A(ne),Ss(M,[ne])}})}function yv(e){if(e==null)return null;if(_t(e))return[vi(e.enter),vi(e.leave)];{const t=vi(e);return[t,t]}}function vi(e){return kf(e)}function Tn(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[oo]||(e[oo]=new Set)).add(t)}function rs(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.remove(o));const n=e[oo];n&&(n.delete(t),n.size||(e[oo]=void 0))}function xu(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let gv=0;function $u(e,t,n,o){const r=e._endId=++gv,l=()=>{r===e._endId&&o()};if(n!=null)return setTimeout(l,n);const{type:u,timeout:f,propCount:v}=vd(e,t);if(!u)return o();const y=u+"end";let m=0;const w=()=>{e.removeEventListener(y,T),l()},T=$=>{$.target===e&&++m>=v&&w()};setTimeout(()=>{m(n[I]||"").split(", "),r=o(`${ss}Delay`),l=o(`${ss}Duration`),u=Su(r,l),f=o(`${Co}Delay`),v=o(`${Co}Duration`),y=Su(f,v);let m=null,w=0,T=0;t===ss?u>0&&(m=ss,w=u,T=l.length):t===Co?y>0&&(m=Co,w=y,T=v.length):(w=Math.max(u,y),m=w>0?u>y?ss:Co:null,T=m?m===ss?l.length:v.length:0);const $=m===ss&&/\b(?:transform|all)(?:,|$)/.test(o(`${ss}Property`).toString());return{type:m,timeout:w,propCount:T,hasTransform:$}}function Su(e,t){for(;e.lengthEu(n)+Eu(e[o])))}function Eu(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function ji(e){return(e?e.ownerDocument:document).body.offsetHeight}function bv(e,t,n){const o=e[oo];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Au=Symbol("_vod"),md=Symbol("_vsh"),wv=Symbol(""),_v=/(?:^|;)\s*display\s*:/;function kv(e,t,n){const o=e.style,r=Ot(n);let l=!1;if(n&&!r){if(t)if(Ot(t))for(const u of t.split(";")){const f=u.slice(0,u.indexOf(":")).trim();n[f]==null&&So(o,f,"")}else for(const u in t)n[u]==null&&So(o,u,"");for(const u in n){u==="display"&&(l=!0);const f=n[u];f!=null?xv(e,u,!Ot(t)&&t?t[u]:void 0,f)||So(o,u,f):So(o,u,"")}}else if(r){if(t!==n){const u=o[wv];u&&(n+=";"+u),o.cssText=n,l=_v.test(n)}}else t&&e.removeAttribute("style");Au in e&&((!r||t!==n)&&(e[Au]=l?o.display:""),e[md]&&(o.display="none"))}const Tr=/\s*!important$/;function So(e,t,n){if(Ge(n))n.forEach(o=>So(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))Tr.test(n)?e.setProperty(t,n.replace(Tr,""),"important"):e.setProperty(t,n);else{const o=Cv(e,t);Tr.test(n)?e.setProperty(hs(o),n.replace(Tr,""),"important"):e[o]=n}}const Tu=["Webkit","Moz","ms"],mi={};function Cv(e,t){const n=mi[t];if(n)return n;let o=kn(t);if(o!=="filter"&&o in e)return mi[t]=o;o=sc(o);for(let r=0;rhi||(Pv.then(()=>hi=0),hi=Date.now());function Mv(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;const r=n.value;if(Ge(r)){const l=o.stopImmediatePropagation;o.stopImmediatePropagation=()=>{l.call(o),o._stopped=!0};const u=r.slice(),f=[o];for(let v=0;ve.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Iv=(e,t,n,o,r,l)=>{const u=r==="svg";t==="class"?bv(e,o,u):t==="style"?kv(e,n,o):ca(t)?da(t)||Sv(e,t,n,o,l):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):jv(e,t,o,u))?(Mu(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ou(e,t,o,u,l,t!=="value")):e._isVueCE&&(Dv(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Ot(o)))?Mu(e,kn(t),o,l,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Ou(e,t,o,u))};function jv(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&ju(t)&&rt(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 r=e.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return ju(t)&&Ot(n)?!1:t in e}function Dv(e,t){const n=e._def.props;if(!n)return!1;const o=kn(t);return Array.isArray(n)?n.some(r=>kn(r)===o):Object.keys(n).some(r=>kn(r)===o)}const hd=new WeakMap,yd=new WeakMap,Xr=Symbol("_moveCb"),Du=Symbol("_enterCb"),Di=new WeakMap,Lv=e=>(delete e.props.mode,e),Rv=Lv({name:"TransitionGroup",props:Rt({},fd,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=fl(),o=Ic();let r,l,u,f;const v=()=>(f===void 0&&(f=r.length>0&&Hv(r[0].el,n.vnode.el,Lu(e))),f);return Nc(()=>{if(Di.delete(n),!v()){r=[],u=void 0;return}const y=Lu(e);r.forEach(Nv);const m=u&&qv(u,n.vnode.el);u=void 0,r.forEach(T=>Fv(T,m));const w=r.filter(Vv);ji(n.vnode.el),w.forEach(T=>{const $=T.el,I=$.style;Tn($,y),I.transform=I.webkitTransform=I.transitionDuration="";const J=$[Xr]=ae=>{ae&&ae.target!==$||(!ae||ae.propertyName.endsWith("transform"))&&($.removeEventListener("transitionend",J),$[Xr]=null,rs($,y))};$.addEventListener("transitionend",J)}),r=[]}),()=>{const y=mt(e),m=pd(y);let w=y.tag||Oe;if(r=[],f=void 0,l)for(let T=0;To.willMove()&&o.item.contains(t));return n&&Ca(n.item,n)}function Hv(e,t,n){const o=e.cloneNode(),r=e[oo];r&&r.forEach(f=>{f.split(/\s+/).forEach(v=>v&&o.classList.remove(v))}),n.split(/\s+/).forEach(f=>f&&o.classList.add(f)),o.style.display="none";const l=t.nodeType===1?t:t.parentNode;l.appendChild(o);const{hasTransform:u}=vd(o);return l.removeChild(o),u}const Qr=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ge(t)?n=>Mr(t,n):t};function zv(e){e.target.composing=!0}function Ru(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Is=Symbol("_assign"),Pr=Symbol("_initialValue");function yi(e,t,n){return t&&(e=e.trim()),n&&(e=pa(e)),e}const Le={created(e,{modifiers:{lazy:t,trim:n,number:o}},r){e.parentNode&&(e.type==="text"?e[Pr]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Pr]=e.defaultValue.replace(/\r\n?/g,` `))),e[Is]=Qr(r);const l=o||r.props&&r.props.type==="number";Os(e,t?"change":"input",u=>{u.target.composing||e[Is](yi(e.value,n,l))}),(n||l)&&Os(e,"change",()=>{e.value=yi(e.value,n,l)}),t||(Os(e,"compositionstart",zv),Os(e,"compositionend",Ru),Os(e,"change",Ru))},mounted(e,{value:t,modifiers:{trim:n,number:o}}){const r=t??"",l=e[Pr];delete e[Pr],l!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==l?e[Is](yi(e.value,n,o)):e.value=r},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:r,number:l}},u){if(e[Is]=Qr(u),e.composing)return;const f=(l||e.type==="number")&&!/^0\d/.test(e.value)?pa(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"&&(o&&t===n||r&&e.value.trim()===v)||(e.value=v)}},vs={deep:!0,created(e,{value:t,modifiers:{number:n}},o){e._modelValue=t,Os(e,"change",()=>{const r=Array.prototype.filter.call(e.options,v=>v.selected).map(v=>n?pa(Zr(v)):Zr(v)),l=e.multiple,u=l?Ls(e._modelValue)?new Set(r):r:r[0],f=e._pendingValue=[l,l?Ge(u)?r.slice():r:u];try{e[Is](u)}finally{Ks(()=>{e._pendingValue===f&&(e._pendingValue=void 0)})}}),e[Is]=Qr(o)},mounted(e,{value:t}){Ku(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[Is]=Qr(n)},updated(e,{value:t}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!Wv(t,n[1],n[0]))&&Ku(e,t)}};function Wv(e,t,n){if(!n||Ge(e))return cs(e,t);if(Ls(e)){if(e.size!==t.length)return!1;for(const o of t)if(!e.has(o))return!1;return!0}return!1}function Ku(e,t){const n=e.multiple,o=Ge(t);if(!(n&&!o&&!Ls(t))){for(let r=0,l=e.options.length;rString(y)===String(f)):u.selected=Of(t,f)>-1}else u.selected=t.has(f);else if(cs(Zr(u),t)){e.selectedIndex!==r&&(e.selectedIndex=r);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Zr(e){return"_value"in e?e._value:e.value}const Gv=["ctrl","shift","alt","meta"],Yv={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)=>Gv.some(n=>e[`${n}Key`]&&!t.includes(n))},Ut=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(r,...l)=>{for(let u=0;u{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=r=>{if(!("key"in r))return;const l=hs(r.key);if(t.some(u=>u===l||Jv[u]===l))return e(r)})},Xv=Rt({patchProp:Iv},mv);let Nu;function Qv(){return Nu||(Nu=Yp(Xv))}const Zv=(...e)=>{const t=Qv().createApp(...e),{mount:n}=t;return t.mount=o=>{const r=tm(o);if(!r)return;const l=t._component;!rt(l)&&!l.render&&!l.template&&(l.template=r.innerHTML),r.nodeType===1&&(r.textContent="");const u=n(r,!1,em(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),u},t};function em(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function tm(e){return Ot(e)?document.querySelector(e):e}function Mt(e){return''+e+""}const nm={calendar:Mt(''),clock:Mt(''),"check-circle":Mt(''),edit:Mt(''),tag:Mt(''),star:Mt(''),close:Mt(''),flag:Mt(''),chart:Mt(''),export:Mt(''),"chevron-left":Mt(''),"chevron-right":Mt(''),"chevron-down":Mt(''),plus:Mt(''),search:Mt(''),settings:Mt(''),memo:Mt(''),lock:Mt(''),wallet:Mt(''),more:Mt(''),shield:Mt(''),warning:Mt(''),plan:Mt('')},sm=["innerHTML"],He=Kt({__name:"Icon",props:{name:{},size:{default:16}},setup(e){const t=e,n=nt(()=>nm[t.name]||"");return(o,r)=>(x(),E("span",{class:"icon",style:pn({width:e.size+"px",height:e.size+"px"}),innerHTML:n.value},null,12,sm))}}),om=["aria-label"],rm={class:"confirm-body"},am={key:0,class:"confirm-badge"},im={class:"confirm-text"},lm={class:"confirm-msg"},um={class:"confirm-btns"},cm=Kt({__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,o=t;function r(l){n.open&&l.key==="Escape"&&o("cancel")}return pt(()=>n.open,l=>{l?window.addEventListener("keydown",r):window.removeEventListener("keydown",r)}),bn(()=>window.removeEventListener("keydown",r)),(l,u)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:u[2]||(u[2]=Ut(f=>o("cancel"),["self"]))},[i("div",{class:"dialog confirm-dialog",role:"dialog","aria-label":e.title},[i("div",rm,[e.danger?(x(),E("div",am,[be(He,{name:"warning",size:22})])):me("",!0),i("div",im,[i("div",{class:ze(["confirm-title",{"is-danger":e.danger}])},F(e.title),3),i("div",lm,F(e.message),1)])]),i("div",um,[i("button",{class:"btn",onClick:u[0]||(u[0]=f=>o("cancel"))},F(e.cancelText),1),i("button",{class:ze(["btn",e.danger?"btn-danger-solid":"btn-primary"]),onClick:u[1]||(u[1]=f=>o("confirm"))},F(e.confirmText),3)])],8,om)])):me("",!0)]),_:1})]))}}),Vt=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},xn=Vt(cm,[["__scopeId","data-v-1f3675f2"]]);var Fu=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dm(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gd={exports:{}};(function(e,t){((n,o)=>{e.exports=o()})(Fu,function(){var n=function(s,a){return(n=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(c,d){c.__proto__=d}:function(c,d){for(var p in d)Object.prototype.hasOwnProperty.call(d,p)&&(c[p]=d[p])}))(s,a)},o=function(){return(o=Object.assign||function(s){for(var a,c=1,d=arguments.length;c"u"||l.Promise||(l.Promise=Promise);var y=Object.getPrototypeOf,m={}.hasOwnProperty;function w(s,a){return m.call(s,a)}function T(s,a){typeof a=="function"&&(a=a(y(s))),(typeof Reflect>"u"?u:Reflect.ownKeys)(a).forEach(function(c){I(s,c,a[c])})}var $=Object.defineProperty;function I(s,a,c,d){$(s,a,v(c&&w(c,"get")&&typeof c.get=="function"?{get:c.get,set:c.set,configurable:!0}:{value:c,configurable:!0,writable:!0},d))}function J(s){return{from:function(a){return s.prototype=Object.create(a.prototype),I(s.prototype,"constructor",s),{extend:T.bind(null,s.prototype)}}}}var ae=Object.getOwnPropertyDescriptor,de=[].slice;function ue(s,a,c){return de.call(s,a,c)}function G(s,a){return a(s)}function S(s){if(!s)throw new Error("Assertion Failed")}function M(s){l.setImmediate?setImmediate(s):setTimeout(s,0)}function ee(s,a){if(typeof a=="string"&&w(s,a))return s[a];if(!a)return s;if(typeof a!="string"){for(var c=[],d=0,p=a.length;d"u"?[]:(fe=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[L=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(L),fe]:[fe,y(fe),fe]),fe=L[0],Ws=L[1],Ws=Ws&&Ws.then,je=fe&&fe.constructor,Je=!!L[2],ft=function(s,a){rn.push([s,a]),Ze&&(queueMicrotask(Wd),Ze=!1)},It=!0,Ze=!0,et=[],Bt=[],bt=C,wt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:g,pgp:!1,env:{},finalize:g},Ne=wt,rn=[],ys=0,er=[];function De(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var a=this._PSD=Ne;if(typeof s!="function"){if(s!==te)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Ta(this,this._value)}else this._state=null,this._value=null,++a.ref,function c(d,p){try{p(function(h){if(d._state===null){if(h===d)throw new TypeError("A promise cannot be resolved with itself.");var b=d._lib&&Vs();h&&typeof h.then=="function"?c(d,function(k,N){h instanceof De?h._then(k,N):h.then(k,N)}):(d._state=!0,d._value=h,kl(d)),b&&Bs()}},Ta.bind(null,d))}catch(h){Ta(d,h)}}(this,s)}var Aa={get:function(){var s=Ne,a=or;function c(d,p){var h=this,b=!s.global&&(s!==Ne||a!==or),k=b&&!Qn(),N=new De(function(X,U){Pa(h,new _l(xl(d,s,b,k),xl(p,s,b,k),X,U,s))});return this._consoleTask&&(N._consoleTask=this._consoleTask),N}return c.prototype=te,c},set:function(s){I(this,"then",s&&s.prototype===te?Aa:{get:function(){return s},set:Aa.set})}};function _l(s,a,c,d,p){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof a=="function"?a:null,this.resolve=c,this.reject=d,this.psd=p}function Ta(s,a){var c,d;Bt.push(a),s._state===null&&(c=s._lib&&Vs(),a=bt(a),s._state=!1,s._value=a,d=s,et.some(function(p){return p._value===d._value})||et.push(d),kl(s),c)&&Bs()}function kl(s){var a=s._listeners;s._listeners=[];for(var c=0,d=a.length;c{for(var b=et.length;b;)if(et[--b]._value===h._value)return et.splice(b,1)})(a),c.resolve(d)}catch(h){c.reject(h)}finally{--ys==0&&Oa(),--c.psd.ref||c.psd.finalize()}}function Wd(){gs(wt,function(){Vs()&&Bs()})}function Vs(){var s=It;return Ze=It=!1,s}function Bs(){var s,a,c;do for(;0.",$l="String expected.",ar="__dbnames",Ia="readonly",ja="readwrite";function ws(s,a){return s?a?function(){return s.apply(this,arguments)&&a.apply(this,arguments)}:s:a}var Sl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ir(s){return typeof s!="string"||/\./.test(s)?function(a){return a}:function(a){return a[s]===void 0&&s in a&&delete(a=Ie(a))[s],a}}function El(){throw Ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function dt(s,a){try{var c=Al(s),d=Al(a);if(c!==d)return c==="Array"?1:d==="Array"?-1:c==="binary"?1:d==="binary"?-1:c==="string"?1:d==="string"?-1:c==="Date"?1:d!=="Date"?NaN:-1;switch(c){case"number":case"Date":case"string":return a{var k=U,N=b;if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function X(){this.constructor=k}function U(){return b!==null&&b.apply(this,arguments)||this}return n(k,N),k.prototype=N===null?Object.create(N):(X.prototype=N.prototype,new X),Object.defineProperty(U.prototype,"db",{get:function(){return a},enumerable:!1,configurable:!0}),U.prototype.table=function(){return c},U})(s)),new Set),p=s.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(b){return d.add(b)});function h(b){if(!b)return b;var k,N=Object.create(s.prototype);for(k in b)if(!d.has(k))try{N[k]=b[k]}catch{}return N}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),s},St.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},St.prototype.add=function(s,a){var c=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,b=s;return h&&p&&(b=ir(h)(s)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"add",keys:a!=null?[a]:null,values:[b]})}).then(function(k){return k.numFailures?De.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{q(s,h,k)}catch{}return k})},St.prototype.upsert=function(s,a){var c=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return c.core.get({trans:p,key:s}).then(function(h){var b=h??{};return Ol(b,a),d&&q(b,d,s),c.core.mutate({trans:p,type:"put",values:[b],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[a]}}).then(function(k){return k.numFailures?De.reject(k.failures[0]):!!h})})})},St.prototype.update=function(s,a){return typeof s!="object"||f(s)?this.where(":id").equals(s).modify(a):(s=ee(s,this.schema.primKey.keyPath))===void 0?jt(new Ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(a)},St.prototype.put=function(s,a){var c=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,b=s;return h&&p&&(b=ir(h)(s)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"put",values:[b],keys:a!=null?[a]:null})}).then(function(k){return k.numFailures?De.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{q(s,h,k)}catch{}return k})},St.prototype.delete=function(s){var a=this;return this._trans("readwrite",function(c){return a.core.mutate({trans:c,type:"delete",keys:[s]}).then(function(d){return lr(a,[s],d)}).then(function(d){return d.numFailures?De.reject(d.failures[0]):void 0})})},St.prototype.clear=function(){var s=this;return this._trans("readwrite",function(a){return s.core.mutate({trans:a,type:"deleteRange",range:Sl}).then(function(c){return lr(s,null,c)})}).then(function(a){return a.numFailures?De.reject(a.failures[0]):void 0})},St.prototype.bulkGet=function(s){var a=this;return this._trans("readonly",function(c){return a.core.getMany({keys:s,trans:c}).then(function(d){return d.map(function(p){return a.hook.reading.fire(p)})})})},St.prototype.bulkAdd=function(s,a,c){var d=this,p=Array.isArray(a)?a:void 0,h=(c=c||(p?void 0:a))?c.allKeys:void 0;return this._trans("readwrite",function(b){var k=d.schema.primKey,X=k.auto,k=k.keyPath;if(k&&p)throw new Ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ke.InvalidArgument("Arguments objects and keys must have the same length");var N=s.length,X=k&&X?s.map(ir(k)):s;return d.core.mutate({trans:b,type:"add",keys:p,values:X,wantResults:h}).then(function(U){var K=U.numFailures,B=U.failures;if(K===0)return h?U.results:U.lastResult;throw new Te("".concat(d.name,".bulkAdd(): ").concat(K," of ").concat(N," operations failed"),B)})})},St.prototype.bulkPut=function(s,a,c){var d=this,p=Array.isArray(a)?a:void 0,h=(c=c||(p?void 0:a))?c.allKeys:void 0;return this._trans("readwrite",function(b){var k=d.schema.primKey,X=k.auto,k=k.keyPath;if(k&&p)throw new Ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ke.InvalidArgument("Arguments objects and keys must have the same length");var N=s.length,X=k&&X?s.map(ir(k)):s;return d.core.mutate({trans:b,type:"put",keys:p,values:X,wantResults:h}).then(function(U){var K=U.numFailures,B=U.failures;if(K===0)return h?U.results:U.lastResult;throw new Te("".concat(d.name,".bulkPut(): ").concat(K," of ").concat(N," operations failed"),B)})})},St.prototype.bulkUpdate=function(s){var a=this,c=this.core,d=s.map(function(b){return b.key}),p=s.map(function(b){return b.changes}),h=[];return this._trans("readwrite",function(b){return c.getMany({trans:b,keys:d,cache:"clone"}).then(function(k){var N=[],X=[],U=(s.forEach(function(K,B){var Y=K.key,z=K.changes,H=k[B];if(H){for(var W=0,se=Object.keys(z);WZ+ce&&W(Z+X)})})}var se=qs(c)&&c.limit===1/0&&(typeof s!="function"||z)&&{index:c.index,range:c.range};return W(0).then(function(){if(0{for(var Qe=Math.min(Ce.length,Be.length),at=-1,ct=0;ct=B})).length===0?De.resolve():(W.forEach(function(Z){H.push(function(){var ce,he,ge,Ee=se,Ce=Z._cfg.dbschema,Fe=(yr(K,Ee,z),yr(K,Ce,z),se=K._dbSchema=Ce,Ba(Ee,Ce)),$e=(Fe.add.forEach(function(Be){Ua(z,Be[0],Be[1].primKey,Be[1].indexes)}),Fe.change.forEach(function(Be){if(Be.recreate)throw new Ke.Upgrade("Not yet support for changing primary key");var ye=z.objectStore(Be.name);Be.add.forEach(function(Xe){return mr(ye,Xe)}),Be.change.forEach(function(Xe){ye.deleteIndex(Xe.name),mr(ye,Xe)}),Be.del.forEach(function(Xe){return ye.deleteIndex(Xe)})}),Z._cfg.contentUpgrade);if($e&&Z._cfg.version>B)return pr(K,z),Y._memoizedTables={},ce=oe(Ce),Fe.del.forEach(function(Be){ce[Be]=Ee[Be]}),Va(K,[K.Transaction.prototype]),vr(K,[K.Transaction.prototype],u(ce),ce),Y.schema=ce,(he=We($e))&&Us(),Ce=De.follow(function(){var Be;(ge=$e(Y))&&he&&(Be=Qn.bind(null,null),ge.then(Be,Be))}),ge&&typeof ge.then=="function"?De.resolve(ge):Ce.then(function(){return ge})}),H.push(function(ce){var he,ge,Ee=Z._cfg.dbschema;he=Ee,ge=ce,[].slice.call(ge.db.objectStoreNames).forEach(function(Ce){return he[Ce]==null&&ge.db.deleteObjectStore(Ce)}),Va(K,[K.Transaction.prototype]),vr(K,[K.Transaction.prototype],K._storeNames,K._dbSchema),Y.schema=K._dbSchema}),H.push(function(ce){K.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(K.idbdb.version/10)===Z._cfg.version?(K.idbdb.deleteObjectStore("$meta"),delete K._dbSchema.$meta,K._storeNames=K._storeNames.filter(function(he){return he!=="$meta"})):ce.objectStore("$meta").put(Z._cfg.version,"version"))})}),function Z(){return H.length?De.resolve(H.shift()(Y.idbtrans)).then(Z):De.resolve()}().then(function(){Fl(se,z)}))}).catch(b);var N,X;u(p).forEach(function(U){Ua(c,U,p[U].primKey,p[U].indexes)}),pr(s,c),De.follow(function(){return s.on.populate.fire(h)}).catch(b)})}function af(s,a){Fl(s._dbSchema,a),a.db.version%10!=0||a.objectStoreNames.contains("$meta")||a.db.createObjectStore("$meta").add(Math.ceil(a.db.version/10-1),"version");var c=hr(0,s.idbdb,a);yr(s,s._dbSchema,a);for(var d=0,p=Ba(c,s._dbSchema).change;d{if(b.change.length||b.recreate)return console.warn("Unable to patch indexes of table ".concat(b.name," because it has changes on the type of index or primary key.")),{value:void 0};var k=a.objectStore(b.name);b.add.forEach(function(N){Re&&console.debug("Dexie upgrade patch: Creating missing index ".concat(b.name,".").concat(N.src)),mr(k,N)})})(p[d]);if(typeof h=="object")return h.value}}function Ba(s,a){var c,d={del:[],add:[],change:[]};for(c in s)a[c]||d.del.push(c);for(c in a){var p=s[c],h=a[c];if(p){var b={name:c,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||p.primKey.auto!==h.primKey.auto)b.recreate=!0,d.change.push(b);else{var k=p.idxByName,N=h.idxByName,X=void 0;for(X in k)N[X]||b.del.push(X);for(X in N){var U=k[X],K=N[X];U?U.src!==K.src&&b.change.push(K):b.add.push(K)}(0{var s,a,c;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,a=new FinalizationRegistry(function(d){s.delete(d)}),{toArray:function(){return Array.from(s).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);s.add(p),a.register(d._novip,p,p),s.size>d._options.maxConnections&&(p=s.values().next().value,s.delete(p),a.unregister(p))},remove:function(d){if(d)for(var p=s.values(),h=p.next();!h.done;){var b=h.value;if(b.deref()===d._novip)return s.delete(b),void a.unregister(b);h=p.next()}}}):(c=[],{toArray:function(){return c},add:function(d){c.push(d._novip)},remove:function(d){d&&(d=c.indexOf(d._novip))!==-1&&c.splice(d,1)}})})();function qa(s,a){var c=s._dbNamesDB;return c||(c=s._dbNamesDB=new Vn(ar,{addons:[],indexedDB:s,IDBKeyRange:a})).version(1).stores({dbnames:"name"}),c.table("dbnames")}function Ha(s){return s&&typeof s.databases=="function"}function za(s){return Xn(function(){return Ne.letThrough=!0,s()})}function Wa(s){return!("from"in s)}var Gt=function(s,a){var c;if(!this)return c=new Gt,s&&"d"in s&&v(c,s),c;v(this,arguments.length?{d:1,from:s,to:1Math.pow(2,62)?0:W.oldVersion,K=se<1,s.idbdb=H.result,h&&af(s,U),rf(s,se/10,U,Y))},Y),H.onsuccess=Pt(function(){U=null;var W,se,Z,ce,he,ge,Ee=s.idbdb=H.result,Ce=ue(Ee.objectStoreNames);if(0"u"?De.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(B){function Y(){return indexedDB.databases().finally(B)}N=setInterval(Y,100),Y()}).finally(function(){return clearInterval(N)}):Promise.resolve()).then(k)]).then(function(){return b(),a.onReadyBeingFired=[],De.resolve(za(function(){return s.on.ready.fire(s.vip)})).then(function B(){var Y;if(0a.limit?d.length=a.limit:s.length===a.limit&&d.length{if(c===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((c=dt(c,d))===0){if(p&&h)return 0;if(p)return 1;if(h)return-1}return c})(s.lower,a.lower,s.lowerOpen,a.lowerOpen)<=0&&0<=((c,d,p,h)=>{if(c===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((c=dt(c,d))===0){if(p&&h)return 0;if(p)return-1;if(h)return 1}return c})(s.upper,a.upper,s.upperOpen,a.upperOpen)}function mf(s,a,c,d){s.subscribers.add(c),d.addEventListener("abort",function(){var p,h;s.subscribers.delete(c),s.subscribers.size===0&&(p=s,h=a,setTimeout(function(){p.subscribers.size===0&&Ue(h,p)},3e3))})}var hf={stack:"dbcore",level:0,name:"Cache",create:function(s){var a=s.schema.name;return o(o({},s),{transaction:function(c,d,p){var h,b,k=s.transaction(c,d,p);return d==="readwrite"&&(p=(h=new AbortController).signal,k.addEventListener("abort",(b=function(N){return function(){if(h.abort(),d==="readwrite"){for(var X=new Set,U=0,K=c;U{var se=_s["idb://".concat(Y,"/").concat(z)];if(!se)return[];if(!(Y=se.queries[H]))return[null,!1,se,null];var Z=Y[(W.query?W.query.index.name:null)||""];if(!Z)return[null,!1,se,null];switch(H){case"query":var ce=(he=W.direction)!=null?he:"next",he=Z.find(function(ge){var Ee;return ge.req.limit===W.limit&&ge.req.values===W.values&&((Ee=ge.req.direction)!=null?Ee:"next")===ce&&Xl(ge.req.query.range,W.query.range)});return he?[he,!0,se,Z]:[Z.find(function(ge){var Ee;return("limit"in ge.req?ge.req.limit:1/0)>=W.limit&&((Ee=ge.req.direction)!=null?Ee:"next")===ce&&(!W.values||ge.req.values)&&vf(ge.req.query.range,W.query.range)}),!1,se,Z];case"count":return he=Z.find(function(ge){return Xl(ge.req.query.range,W.query.range)}),[he,!!he,se,Z]}})(a,c,"query",h),B=K[0],X=K[2],U=K[3],B&&K[1]?B.obsSet=h.obsSet:(K=d.query(h).then(function(Y){var z=Y.result;if(B&&(B.res=z),b){for(var H=0,W=z.length;H{var he=Vs();try{h&&Us();var ge=Xn(s,ce);return ge=h?ge.finally(Qn):ge}finally{he&&Bs()}})(se={subscr:W,signal:b.signal,requery:B,querier:s,trans:null}),K||(ts.storagemutated.subscribe(z),K=!0),Promise.resolve(Z).then(function(ce){c=!0,a=ce,k||se.signal.aborted||(Y()||(X=W,Y())?B():(N={},Ma(function(){return!k&&p.next&&p.next(ce)})))},function(ce){c=!1,["DatabaseClosedError","AbortError"].includes(ce==null?void 0:ce.name)||k||Ma(function(){k||p.error&&p.error(ce)})}))};return setTimeout(B,0),U});return d.hasValue=function(){return c},d.getValue=function(){return a},d}var ks=Vn;function si(s){var a=ns;try{ns=!0,ts.storagemutated.fire(s),Xa(s,!0)}finally{ns=a}}T(ks,o(o({},le),{delete:function(s){return new ks(s,{addons:[]}).delete()},exists:function(s){return new ks(s,{addons:[]}).open().then(function(a){return a.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return a=ks.dependencies,c=a.indexedDB,a=a.IDBKeyRange,(Ha(c)?Promise.resolve(c.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==ar})}):qa(c,a).toCollection().primaryKeys()).then(s)}catch{return jt(new Ke.MissingAPI)}var a,c},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return Ne.trans?gs(Ne.transless||wt,s):s()},vip:za,async:function(s){return function(){try{var a=Qa(s.apply(this,arguments));return a&&typeof a.then=="function"?a:De.resolve(a)}catch(c){return jt(c)}}},spawn:function(s,a,c){try{var d=Qa(s.apply(c,a||[]));return d&&typeof d.then=="function"?d:De.resolve(d)}catch(p){return jt(p)}},currentTransaction:{get:function(){return Ne.trans||null}},waitFor:function(s,a){return s=De.resolve(typeof s=="function"?ks.ignoreTransaction(s):s).timeout(a||6e4),Ne.trans?Ne.trans.waitFor(s):s},Promise:De,debug:{get:function(){return Re},set:function(s){V(s)}},derive:J,extend:v,props:T,override:G,Events:fo,on:ts,liveQuery:Ql,extendObservabilitySet:br,getByKeyPath:ee,setByKeyPath:q,delByKeyPath:function(s,a){typeof a=="string"?q(s,a,void 0):"length"in a&&[].map.call(a,function(c){q(s,c,void 0)})},shallowClone:oe,deepClone:Ie,getObjectDiff:Za,cmp:dt,asap:M,minKey:-1/0,addons:[],connections:{get:yo.toArray},errnames:kt,dependencies:Cr,cache:_s,semVer:"4.4.6",version:"4.4.6".split(".").map(function(s){return parseInt(s)}).reduce(function(s,a,c){return s+a/Math.pow(10,2*c)})})),ks.maxKey=mo(ks.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(ts(fr,function(s){ns||(s=new CustomEvent(Ra,{detail:s}),ns=!0,dispatchEvent(s),ns=!1)}),addEventListener(Ra,function(s){s=s.detail,ns||si(s)}));var Gs,ns=!1,Zl=function(){};return typeof BroadcastChannel<"u"&&((Zl=function(){(Gs=new BroadcastChannel(Ra)).onmessage=function(s){return s.data&&si(s.data)}})(),typeof Gs.unref=="function"&&Gs.unref(),ts(fr,function(s){ns||Gs.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!Vn.disableBfCache&&s.persisted){Re&&console.debug("Dexie: handling persisted pagehide"),Gs!=null&&Gs.close();for(var a=0,c=yo.toArray();a{const o={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};await n.table("log_item").toCollection().modify(r=>{r.category&&o[r.category]&&(r.category=o[r.category])})}),this.version(6).stores({plan:"++id, date, status, goal_id",goal:"++id, start_date"})}}let ie;function mm(e){ie=e}function pl(){ie&&ie.close(),ie=void 0}const hm=6,Bu=["公司","客户现场","出差","居家办公"],ym={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};function Uo(e){return ym[e]||e}function Mo(e){return e<10?"0"+e:String(e)}function us(e){return e.getFullYear()+"-"+Mo(e.getMonth()+1)+"-"+Mo(e.getDate())}function ut(){return us(new Date)}function gt(){const e=new Date;return us(e)+"T"+Mo(e.getHours())+":"+Mo(e.getMinutes())+":"+Mo(e.getSeconds())}function Wn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function Gn(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Ft(e,t){const n=Gn(e);return n.setDate(n.getDate()+t),us(n)}function qo(e,t){const n=Gn(e),o=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const r=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,r)),us(n)}function Zs(e){const t=Gn(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),us(t)}function gm(e){const t=Gn(e).getDay();return t===0||t===6}function bm(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function bd(e){const t=Gn(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const wm=15e4;function Ri(e){const t=new Uint8Array(e);let n="";for(let o=0;o({}));if(!r.ok){const u=l&&l.error||"服务返回 "+r.status;throw e==="register"&&r.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(u))}if(!l.userId||!l.username)throw new Error("登录响应异常");return{userId:String(l.userId),username:String(l.username)}}async function yl(e,t,n){const o=await Nm(n,e,t);ra(o.userId);const r={userId:o.userId,username:o.username};return Rm(r),$d(o.username,t),r}async function Fm(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return yl(n,t,"login")}async function Vm(e,t,n){const o=(e||"").trim();if(o.length<2||o.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return yl(o,t,"register")}async function Bm(){const e=hn();if(!e)return null;try{return await yl(e.username,e.password,"login")}catch{return null}}async function Um(){sa(),pl(),oa=null,xd()}function qm(){sa(),pl(),oa=null,xd(),Km()}async function Hm(e,t){if(!zo())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const o=hn();if(!o||o.password!==e)throw new Error("旧密码不正确");const r=await Ns();let l;try{l=await fetch(r+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Sd()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u&&u.error||"修改失败 "+l.status)}$d(o.username,t)}async function zm(){if(!zo())throw new Error("未登录");const t=await Ns();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+Sd()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(o&&o.error||"删除失败 "+n.status)}qm()}function Sd(){return $a()}const Fi=P(null),Vi=P(null),Jo=P(0);function As(){Jo.value++}const Ed=P(0);function Wm(){Ed.value++}const eo=P(""),ro=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","goal","transaction","plan"],Xs=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function Lr(e){return JSON.stringify(e)}async function Gm(e){return ie.table(e).toArray()}function Rr(e,t){return e==="setting"?t.key:t.id}async function Ym(){for(const e of ro){const t=ie.table(e),n=await t.toArray();for(const o of n){if(e==="setting"&&Xs.has(o.key))continue;const r={};o.uuid||(r.uuid=Jm()),!o.updated_at&&o.created_at&&(r.updated_at=o.created_at),Object.keys(r).length&&await t.update(Rr(e,o),r)}}}function Jm(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Xm(){return hn()!=null}async function Qm(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function Zm(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function Ad(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 o=await n.json();if(!o||!o.token)throw new Error("云端登录异常");return String(o.token)}async function eh(e,t){let n=$a();return n||(n=await Ad(e,t),Ho(n),n)}async function Td(){const e=hn();if(!e)throw new Error("未登录");const t=await Ns(),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 Bi(){const e=hn();if(!e)throw new Error("未登录,无法同步");return Id({baseUrl:await Ns(),username:e.username,password:e.password})}async function Pd(){try{await Bi()}catch(e){eo.value=e instanceof Error?e.message:String(e);try{await Bi()}catch{}}}function Od(e,t,n){const o={};for(const r of Object.keys(t))r!=="id"&&(o[r]=t[r]);if(e==="log_item"){delete o.work_log_id,delete o.project_id;const r=t.work_log_id?n.workLog.get(t.work_log_id):null;r&&r.uuid&&(o.wuuid=r.uuid);const l=t.project_id?n.project.get(t.project_id):null;l&&l.uuid&&(o.puuid=l.uuid)}if(e==="plan"){delete o.goal_id;const r=t.goal_id?n.goal.get(t.goal_id):null;r&&r.uuid&&(o.guuid=r.uuid)}return o}async function Md(){const e=await ie.work_log.toArray(),t=await ie.project.toArray(),n=await ie.goal.toArray();return{workLog:new Map(e.map(o=>[o.id,o])),project:new Map(t.map(o=>[o.id,o])),goal:new Map(n.map(o=>[o.id,o]))}}let Io=!1,Kr=!1,Ui=!1,to=null,Pn=null,qi="",Hi=!1,Nr=null;async function no(){if(Io){Kr=!0;return}try{if(!await Xm())return;await Id(await th()),eo.value=""}catch(e){eo.value=e instanceof Error?e.message:String(e)}}async function th(){const e=hn();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Ns(),username:e.username,password:e.password}}function nh(){if(Hi)return;Hi=!0,Nr=pm(async()=>{const t={};for(const n of ro)t[n]=await ie.table(n).count();return t}).subscribe({next:()=>{Ui||Io||(to&&globalThis.clearTimeout(to),to=globalThis.setTimeout(()=>{no()},3e3))},error:()=>{}})}function sh(){Nr&&(Nr.unsubscribe(),Nr=null),Pn&&(Pn.close(),Pn=null,qi=""),to&&(globalThis.clearTimeout(to),to=null),Hi=!1}function oh(e,t){const n=e+"|"+t;if(!(Pn&&qi===n)){Pn&&(Pn.close(),Pn=null);try{Pn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),qi=n,Pn.onmessage=()=>{no()}}catch{Pn=null}}}async function Id(e){if(Io)return Kr=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};Io=!0,Ui=!0;try{const t=await zi(e);return Kr&&(Kr=!1,globalThis.setTimeout(()=>{no()},800)),t}finally{Io=!1,Ui=!1}}async function zi(e,t=!1){var ee;const n=e.baseUrl.trim().replace(/\/+$/,"");if(!n)throw new Error("请先配置同步服务地址");await Ym();const o=await Md(),r=await ie.sync_mirror.toArray(),l=new Map;for(const q of r)l.set(q.table+"|"+q.uuid,q);const u={},f=[];let v=0;for(const q of ro){let oe=await Gm(q);q==="setting"&&(oe=oe.filter(A=>!Xs.has(A.key)));const j=new Map;for(const A of oe)j.set(A.uuid,A);for(const[A,O]of j){const ne=Od(q,O,o),Ie=Lr(ne),Se=l.get(q+"|"+A);(!Se||Se.hash!==Ie)&&(u[q]=u[q]||[],u[q].push(ne),v++)}for(const[A,O]of l)A.startsWith(q+"|")&&!j.has(O.uuid)&&f.push({table:q,uuid:O.uuid,deleted_at:gt()});u[q]=u[q]||[]}f.push(...uh());const y=await eh(n,e),m=q=>fetch(n+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+q},body:JSON.stringify({device:"client",tables:u,tombstones:f})});let w=await m(y);if(w.status===401){Ho("");const q=await Ad(n,e);Ho(q),w=await m(q)}if(!w.ok)throw new Error("同步服务返回 "+w.status);const T=await w.json(),$=String(T.dataEpoch||""),I="dsh_sync_epoch_"+(((ee=hn())==null?void 0:ee.username)||"anon"),J=$?localStorage.getItem(I):null;if(!t&&J&&$&&J!==$)return await ie.sync_mirror.clear(),localStorage.setItem(I,$),zi(e,!0);const ae=T.tables||{},de=T.tombstones||[],ue=ro.reduce((q,oe)=>q+(ae[oe]||[]).length,0),G=r.length-f.length;if(!t&&ue0||S.removed>0||v>0)&&As(),{pushed:v,pulled:S.changed,removed:S.removed,errors:0,at:M}}function jd(){var t;return"dsh_idmap_"+(((t=hn())==null?void 0:t.username)||"anon")}function rh(){try{const e=localStorage.getItem(jd());if(e)return JSON.parse(e)}catch{}return{}}function ah(e){try{localStorage.setItem(jd(),JSON.stringify(e))}catch{}}async function ih(e,t){const n=rh(),o=new Set(t.map($=>$.table+"|"+$.uuid)),r=new Map;for(const $ of await ie.sync_mirror.toArray())r.set($.table+"|"+$.uuid,$);const l=new Set(Array.from(r.keys()).map($=>$.split("|")[1]));let u=0,f=0;const v={},y={},m={};for(const $ of ro){const I=ie.table($),J=await I.toArray(),ae=new Map(J.map(A=>[Rr($,A),A])),de=new Map(J.filter(A=>A.uuid).map(A=>[A.uuid,A])),ue=(e[$]||[]).filter(A=>A&&typeof A=="object"&&A.uuid).filter(A=>!o.has($+"|"+A.uuid)),G=ue.filter(A=>!($==="setting"&&Xs.has(A.key))),S=ue.filter(A=>$==="setting"&&Xs.has(A.key));for(const A of S)lh($,A.uuid);const M=$==="setting"?[]:J.filter(A=>A.uuid&&!l.has(A.uuid)&&!o.has($+"|"+A.uuid)),ee={v:Math.max(0,...J.map(A=>Number(A.id)||0))};G.length;const q=[];for(const A of G){const O={...A};if($==="log_item"){const Se=O.wuuid?v[O.wuuid]:void 0;if(!Se)continue;O.work_log_id=Se,delete O.wuuid,O.project_id=O.puuid?y[O.puuid]??null:null,delete O.puuid}if($==="plan")if(O.guuid){const Se=m[O.guuid];O.goal_id=Se??null,delete O.guuid}else O.goal_id=null;let ne=Rr($,A);if($==="setting")ne=A.key;else{const Se=n[$]&&n[$][A.uuid],_e=de.get(A.uuid);_e&&_e.id!=null?ne=_e.id:typeof Se=="number"?ne=Se:ne=++ee.v}const Ie={...O,id:ne};$==="setting"&&Xs.has(Ie.key)||(q.push(Ie),$==="work_log"&&(v[A.uuid]=ne),$==="project"&&(y[A.uuid]=ne),$==="goal"&&(m[A.uuid]=ne))}const oe=q.concat(M);for(const A of oe){const O=ae.get(Rr($,A));(!O||Lr(O)!==Lr(A))&&u++}f+=J.filter(A=>A.uuid&&!q.some(O=>O.uuid===A.uuid)&&!o.has($+"|"+A.uuid)).length,await I.clear(),oe.length&&await I.bulkPut(oe);const j={};for(const A of oe)A.uuid&&(j[A.uuid]=A.id);n[$]=j}ah(n);const w=await Md(),T=[];for(const $ of ro){const I=await ie.table($).toArray();for(const J of I)$==="setting"&&Xs.has(J.key)||J.uuid&&T.push({table:$,uuid:J.uuid,hash:Lr(Od($,J,w))})}return await ie.sync_mirror.clear(),T.length&&await ie.sync_mirror.bulkAdd(T.map($=>({...$}))),await ie.tombstone.clear(),{changed:u,removed:f+aa.length}}const aa=[];function lh(e,t){aa.some(n=>n.table===e&&n.uuid===t)||aa.push({table:e,uuid:t,deleted_at:gt()})}function uh(){return aa.splice(0)}const ch=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function ht(){await Pd()}async function Tt(e,t){const n=await ie.setting.get(e);return n?n.value:t}async function Nt(e,t){await ie.setting.put({key:e,value:t}),ch.has(e)||await ht()}async function ms(){const e=await Promise.all([Tt("work_start","09:00"),Tt("work_end","18:00"),Tt("grace_minutes","10"),Tt("lunch_minutes","60"),Tt("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 dh(){return Tt("last_location","")}async function fh(e,t){const n=t.trim();await Nt("last_location",n),n&&await ia(n);let o=!1;const r=await Fs(e);r&&r.id?(r.location||"")!==n&&(await ie.attendance.update(r.id,{location:n||null}),o=!0):n&&(await ie.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:gt()}),o=!0),o&&await ht()}async function gl(){const e=await Tt("location_presets","");if(!e)return Bu.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 Bu.slice()}async function Dd(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await Nt("location_presets",JSON.stringify(t))}async function ia(e){const t=e.trim();if(!t)return;const n=await gl();n.includes(t)||await Dd([...n,t])}async function ao(e=!1){const t=await ie.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function ph(e){await ie.project.add({name:e.trim(),archived:0,created_at:gt()}),await ht()}async function vh(e,t){await ie.project.update(e,{name:t.trim()}),await ht()}async function mh(e,t){await ie.project.update(e,{archived:t?1:0}),await ht()}async function Fs(e){return ie.attendance.where("date").equals(e).first()}async function hh(e,t){const n=((t===void 0?await Tt("last_location",""):t)||"").trim();let o=!1;const r=await Fs(e);if(r&&r.id){if(!r.clock_in_at){const l={clock_in_at:gt()};n&&(l.location=n),await ie.attendance.update(r.id,l),o=!0}n&&(await Tt("last_location","")!==n&&await Nt("last_location",n),await ia(n)),o&&await ht();return}await ie.attendance.add({date:e,clock_in_at:gt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:gt()}),n&&(await Nt("last_location",n),await ia(n)),await ht()}async function yh(e){const t=await Fs(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await ie.attendance.update(t.id,{clock_out_at:gt()}),await ht())}async function gh(e,t,n,o,r){(r||"").trim()&&await ia(r);const l=await Fs(e),u={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:o||null,location:(r||"").trim()||null,created_at:gt()};l&&l.id?await ie.attendance.update(l.id,u):await ie.attendance.add(u),await ht()}async function bh(e,t,n){const o=(n||"").trim();if(!o)return;const r=await Fs(e);r&&r.id&&(await ie.attendance.update(r.id,{[t]:e+"T"+o+":00"}),await ht())}async function Xo(e,t){return ie.attendance.where("date").between(e,t,!0,!0).toArray()}async function wh(e,t){const n=await Fs(e);if(t){const o={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:gt()};n&&n.id?await ie.attendance.update(n.id,o):await ie.attendance.add({...o,note:null,location:null})}else n&&n.id&&await ie.attendance.update(n.id,{kind:"normal"});await ht()}async function _h(e){const t=await ie.work_log.where("date").equals(e).first();return t||{id:await ie.work_log.add({date:e,created_at:gt()}),date:e,created_at:gt()}}async function kh(e){return ie.work_log.where("date").equals(e).first()}async function Ch(e){const t=await kh(e);return!t||!t.id?[]:(await ie.log_item.where("work_log_id").equals(t.id).toArray()).sort((o,r)=>r.id-o.id)}async function xh(e,t){const n=await ie.work_log.where("date").equals(e).first();let o;n&&n.id?o=n:o=await _h(e),await ie.table("log_item").add({work_log_id:o.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:gt()});const r=t.project_id?String(t.project_id):"";await Tt("last_project","")!==r&&await Nt("last_project",r),await Tt("last_category","")!==t.category&&await Nt("last_category",t.category),await ht()}async function bi(e,t){await ie.table("log_item").update(e,t),await ht()}async function $h(e){await ie.table("log_item").delete(e),await ht()}async function Qo(e,t){const n=await ie.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const o=new Map(n.map(l=>[l.id,l.date]));return(await ie.table("log_item").where("work_log_id").anyOf(n.map(l=>l.id)).toArray()).map(l=>({...l,date:o.get(l.work_log_id)||""})).sort((l,u)=>l.date===u.date?l.id-u.id:l.daten.start_time!!t.timer_started_at).toArray();return e.length?e[0]:null}async function Ph(e){const t=gt();await ie.plan.add({date:e.date,start_time:e.start_time,end_time:e.end_time,title:e.title.trim(),kind:e.kind.trim()||"其他",note:e.note||null,status:"todo",actual_minutes:0,timer_started_at:null,uuid:"",created_at:t,updated_at:t}),await ht()}async function Oh(e,t){await ie.plan.update(e,{...t,updated_at:gt()}),await ht()}async function Mh(e){await ie.plan.delete(e),await ht()}async function Ih(e,t){const n=await ie.plan.get(e);n&&(t!=="todo"&&n.timer_started_at&&await Sa(e),await ie.plan.update(e,{status:t,updated_at:gt()}),await ht())}async function jh(e){const t=await ie.plan.filter(n=>!!n.timer_started_at).toArray();for(const n of t)n.id!==e&&await Sa(n.id);await ie.plan.update(e,{timer_started_at:gt(),updated_at:gt()}),await ht()}async function Sa(e){const t=await ie.plan.get(e);if(!t||!t.timer_started_at)return;const n=Math.max(0,Math.round((Date.now()-new Date(t.timer_started_at).getTime())/6e4));await ie.plan.update(e,{actual_minutes:(t.actual_minutes||0)+n,timer_started_at:null,updated_at:gt()}),await ht()}const Dh=366;function Lh(e,t){const n=[];let o=e,r=0;for(;o<=t&&rr.status==="done").length,total:o.length})}return t}async function Kh(){return(await ie.goal.toArray()).sort((t,n)=>t.start_datet.updated_at[u.id,u.date]));return(await ie.table("log_item").toArray()).filter(u=>((u.content||"")+" "+(u.takeaway||"")+" "+(u.remark||"")).toLowerCase().includes(n)).sort((u,f)=>f.id-u.id).slice(0,t).map(u=>({...u,date:r.get(u.work_log_id)||""}))}async function Wh(e,t=4){const n=e.trim().toLowerCase();return n?(await ie.memo.toArray()).filter(r=>((r.title||"")+" "+(r.content||"")).toLowerCase().includes(n)).sort((r,l)=>r.updated_atn{await Promise.all([ie.project.clear(),ie.work_log.clear(),o.clear(),ie.attendance.clear(),ie.weekly_note.clear(),ie.setting.clear(),ie.memo.clear(),ie.credential.clear(),r.clear(),u.clear(),l.clear()]),n.project&&n.project.length&&await ie.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await ie.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await o.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await ie.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await ie.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await ie.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await ie.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await ie.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await r.bulkAdd(n.transaction),n.goal&&n.goal.length&&await u.bulkAdd(n.goal),n.plan&&n.plan.length&&await l.bulkAdd(n.plan)}),await ht()}const ny=["制度学习","产品学习","打杂","项目实操","售后服务"],sy=["餐饮","交通","住房","通讯","学习","娱乐","其他"],oy=["工资","报销","其他"],Ld="log_categories",Rd="ledger_expense_categories",Kd="ledger_income_categories";function Nd(e,t){if(!e)return t.slice();try{const n=JSON.parse(e);if(Array.isArray(n)){const o=n.filter(r=>typeof r=="string"&&r.trim()).map(r=>r.trim());if(o.length)return Array.from(new Set(o))}}catch{}return t.slice()}async function Zo(){return Nd(await Tt(Ld,""),ny)}async function ry(e){await Nt(Ld,JSON.stringify(e))}async function la(e){return Nd(await Tt(e==="expense"?Rd:Kd,""),e==="expense"?sy:oy)}async function Wi(e,t){await Nt(e==="expense"?Rd:Kd,JSON.stringify(t))}const ay={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},iy={class:"dialog-head"},ly={class:"dialog-title"},uy={key:0,class:"muted dialog-sub"},cy={class:"dialog-body"},dy={class:"form-grid"},fy={class:"field span2"},py={key:0,class:"form-error"},vy={class:"field"},my=["value"],hy={class:"field"},yy=["value"],gy={class:"field"},by={class:"min-chips"},wy=["onClick"],_y={class:"field"},ky={class:"field span2"},Cy={class:"field"},xy={class:"field"},$y={class:"dialog-btns"},Sy=Kt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=P([]);Zo().then(ue=>{n.value=ue});const o=e,r=t,l=P(""),u=P(null),f=P("dev"),v=P(null),y=P(""),m=P(""),w=P(0),T=P(0),$=P(""),I=P(null),J=nt(()=>{var S;const ue=o.projects.filter(M=>M.archived!==1),G=(S=o.item)==null?void 0:S.project_id;if(G&&!ue.some(M=>M.id===G)){const M=o.projects.find(q=>q.id===G),ee=ue.slice();return M&&ee.unshift({...M,name:M.name+"(已归档)"}),ee}return ue});function ae(ue){o.open&&ue.key==="Escape"&&r("cancel")}pt(()=>o.open,async ue=>{var G;if(ue){const S=o.item;l.value=(S==null?void 0:S.content)??"",u.value=(S==null?void 0:S.project_id)??null,f.value=(S==null?void 0:S.category)??"dev",v.value=(S==null?void 0:S.minutes)??null,y.value=(S==null?void 0:S.takeaway)??"",m.value=(S==null?void 0:S.remark)??"",w.value=(S==null?void 0:S.is_milestone)??0,T.value=(S==null?void 0:S.needs_followup)??0,$.value="",window.addEventListener("keydown",ae),await Ks(),(G=I.value)==null||G.focus()}else window.removeEventListener("keydown",ae)}),bn(()=>window.removeEventListener("keydown",ae)),pt(l,()=>{$.value&&($.value="")});function de(){const ue=l.value.trim();if(!ue){$.value="请填写工作内容";return}if(!o.item||!o.item.id){r("save",{id:0,content:ue,project_id:u.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:y.value.trim()||null,remark:m.value.trim()||null,is_milestone:w.value,needs_followup:T.value});return}r("save",{id:o.item.id,content:ue,project_id:u.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:y.value.trim()||null,remark:m.value.trim()||null,is_milestone:w.value?1:0,needs_followup:T.value?1:0})}return(ue,G)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:G[10]||(G[10]=Ut(S=>r("cancel"),["self"]))},[i("div",ay,[i("div",iy,[i("div",null,[i("div",ly,F(e.item?"编辑工作记录":"添加工作记录"),1),e.date?(x(),E("div",uy,F(e.date),1)):me("",!0)]),i("button",{class:"icon-btn",title:"关闭",onClick:G[0]||(G[0]=S=>r("cancel"))},[be(He,{name:"close",size:16})])]),i("div",cy,[i("div",dy,[i("div",fy,[G[11]||(G[11]=i("label",null,"工作内容(必填)",-1)),Pe(i("input",{ref_key:"contentInput",ref:I,class:ze(["input",{invalid:$.value}]),"onUpdate:modelValue":G[1]||(G[1]=S=>l.value=S),onKeydown:Lt(de,["enter"])},null,34),[[Le,l.value]]),$.value?(x(),E("div",py,F($.value),1)):me("",!0)]),i("div",vy,[G[13]||(G[13]=i("label",null,"所属项目",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":G[2]||(G[2]=S=>u.value=S)},[G[12]||(G[12]=i("option",{value:null},"无项目",-1)),(x(!0),E(Oe,null,st(J.value,S=>(x(),E("option",{key:S.id,value:S.id},F(S.name),9,my))),128))],512),[[vs,u.value]])]),i("div",hy,[G[14]||(G[14]=i("label",null,"工作分类",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":G[3]||(G[3]=S=>f.value=S)},[(x(!0),E(Oe,null,st(n.value,S=>(x(),E("option",{key:S,value:S},F(S),9,yy))),128))],512),[[vs,f.value]])]),i("div",gy,[G[15]||(G[15]=i("label",null,"耗时(分钟)",-1)),Pe(i("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":G[4]||(G[4]=S=>v.value=S),placeholder:"选填"},null,512),[[Le,v.value,void 0,{number:!0}]]),i("div",by,[(x(),E(Oe,null,st([15,30,60,90,120],S=>i("button",{key:S,type:"button",class:ze(["min-chip",{on:v.value===S}]),onClick:M=>v.value=v.value===S?null:S},F(S)+"分",11,wy)),64))])]),i("div",_y,[G[16]||(G[16]=i("label",null,"主要收获",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":G[5]||(G[5]=S=>y.value=S),placeholder:"一句话:学到了什么"},null,512),[[Le,y.value]])]),i("div",ky,[G[17]||(G[17]=i("label",null,"备注",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":G[6]||(G[6]=S=>m.value=S),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Le,m.value]])]),i("div",Cy,[G[18]||(G[18]=i("label",null,"成果标记",-1)),i("button",{class:ze(["toggle-btn",{on:w.value===1}]),onClick:G[7]||(G[7]=S=>w.value=w.value===1?0:1)},F(w.value===1?"已标记为成果":"未标记"),3)]),i("div",xy,[G[19]||(G[19]=i("label",null,"待跟进",-1)),i("button",{class:ze(["toggle-btn",{onwarn:T.value===1}]),onClick:G[8]||(G[8]=S=>T.value=T.value===1?0:1)},F(T.value===1?"需要跟进":"无需跟进"),3)])])]),i("div",$y,[i("button",{class:"btn btn-sm",onClick:G[9]||(G[9]=S=>r("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:de},F(e.item?"保存修改":"添加"),1)])])])):me("",!0)]),_:1})]))}}),Ey=Vt(Sy,[["__scopeId","data-v-91c30038"]]);function Or(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function uo(e,t,n,o){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(gm(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return o?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const r=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:o?"进行中":"未完成",makeup:r,workedMinutes:null};const l=Or(Wn(e.clock_in_at)),u=Or(Wn(e.clock_out_at)),f=Or(n.work_start),v=Or(n.work_end);let y="normal";!r&&l>f+n.grace_minutes?y="late":!r&&u{Fr.value=Fr.value.filter(n=>n.id!==t)},2e3)}function Ty(){return Fr}const Py={class:"day-panel"},Oy={class:"dp-head"},My={class:"dp-date"},Iy={class:"card sec"},jy={class:"att-grid"},Dy={class:"att-cell"},Ly={key:0,class:"edit-row"},Ry={key:1,class:"att-val"},Ky={class:"att-cell"},Ny={key:0,class:"edit-row"},Fy={key:1,class:"att-val"},Vy={class:"att-cell"},By=["list"],Uy=["id"],qy=["value"],Hy={class:"att-cell"},zy={class:"att-val status-val"},Wy={key:0,class:"tag"},Gy={key:1,class:"muted"},Yy={key:0,class:"att-note muted"},Jy={class:"att-actions"},Xy=["disabled"],Qy=["disabled"],Zy=["disabled"],eg=["disabled"],tg={key:0,class:"card sec makeup"},ng={class:"form-grid"},sg={class:"field"},og={class:"field"},rg={class:"field span2"},ag=["list"],ig={class:"field span2"},lg={key:0,class:"form-error"},ug={class:"form-footer"},cg={class:"list-sec"},dg={class:"sec-head"},fg={class:"sec-title"},pg={key:0,class:"empty muted"},vg={class:"item-main"},mg={class:"tag"},hg=["onClick"],yg={key:0,class:"muted item-meta"},gg={key:1,class:"muted num item-meta"},bg=["onClick"],wg=["onClick"],_g=["onClick"],kg=["onClick"],Cg={key:0,class:"item-sub"},xg={key:0,class:"muted2"},$g={key:1,class:"muted"},Sg={key:1,class:"dp-foot muted num"},Eg=Kt({__name:"DayPanel",props:{date:{}},setup(e){const t=P([]);Zo().then(_=>{t.value=_});const n=e,o=P(!0),r=P(null),l=P(void 0),u=P([]),f=P([]),v=P(""),y=P([]),m=nt(()=>"loc-list-"+n.date),w=nt(()=>n.date===ut());async function T(){o.value=!0,r.value=await ms(),l.value=await Fs(n.date),u.value=await Ch(n.date),f.value=await ao(!0),y.value=await gl(),v.value=l.value&&l.value.location||await dh(),o.value=!1}cn(T),pt(()=>n.date,T),pt(Jo,()=>{T()});function $(_){if(!_)return"";const g=f.value.find(C=>C.id===_);return g?g.name:"已删除项目"}const I=nt(()=>r.value?uo(l.value,n.date,r.value,w.value):null),J=nt(()=>u.value.reduce((_,g)=>_+(g.minutes||0),0)),ae=P(!1);async function de(){ae.value||(ae.value=!0,await hh(n.date,v.value),await T(),As(),Ve("上班打卡成功"),ae.value=!1)}async function ue(){ae.value||(ae.value=!0,await yh(n.date),await T(),As(),Ve("下班打卡成功"),ae.value=!1)}async function G(){await fh(n.date,v.value),As(),Ve("地点已更新")}const S=P(!1),M=nt(()=>{var _;return((_=l.value)==null?void 0:_.kind)==="leave"});function ee(){if(l.value&&l.value.clock_in_at){S.value=!0;return}q(!0)}async function q(_){S.value=!1,await wh(n.date,_),await T(),As(),Ve(_?"已标记为休假":"已取消休假")}const oe=P(null),j=P(""),A=P(null);pt(oe,async _=>{var g;_&&(await Ks(),(g=A.value)==null||g.focus())});function O(_){var C,D;const g=_==="in"?(C=l.value)==null?void 0:C.clock_in_at:(D=l.value)==null?void 0:D.clock_out_at;oe.value=_,j.value=g?Wn(g):_==="in"?"09:00":"18:00"}function ne(){oe.value=null}async function Ie(){const _=oe.value;_&&(oe.value=null,j.value&&(await bh(n.date,_==="in"?"clock_in_at":"clock_out_at",j.value),await T(),As(),Ve("打卡时间已修改")))}const Se=P(!1),_e=P("09:00"),Me=P("18:00"),qe=P(""),Ue=P(""),tt=P("");function Ye(){Ue.value=v.value,tt.value="",Se.value=!Se.value}async function We(){if(!_e.value||!Me.value){tt.value="请填写上班与下班时间";return}await gh(n.date,n.date+"T"+_e.value+":00",n.date+"T"+Me.value+":00",qe.value.trim(),Ue.value),Se.value=!1,qe.value="",tt.value="",await T(),As(),Ve("补卡已保存")}const le=P(null),Q=P(!1);function Ae(_){le.value=_,Q.value=!0}function lt(){le.value=null,Q.value=!0}async function it(_){_.id?(await bi(_.id,{content:_.content,project_id:_.project_id,category:_.category,minutes:_.minutes,takeaway:_.takeaway,remark:_.remark,is_milestone:_.is_milestone,needs_followup:_.needs_followup}),Ve("记录已更新")):(await xh(n.date,{content:_.content,project_id:_.project_id,category:_.category,minutes:_.minutes,takeaway:_.takeaway,remark:_.remark}),Ve("记录已添加")),le.value=null,Q.value=!1,await T()}async function Te(_){await bi(_.id,{is_milestone:_.is_milestone?0:1}),await T()}async function kt(_){await bi(_.id,{needs_followup:_.needs_followup?0:1}),await T()}const xt=P(null);async function Ke(){xt.value&&xt.value.id&&await $h(xt.value.id),xt.value=null,await T(),Ve("记录已删除")}return(_,g)=>(x(),E("div",Py,[i("div",Oy,[i("div",My,F(Wt(bd)(e.date)),1)]),i("div",Iy,[g[19]||(g[19]=i("div",{class:"sec-title"},"出勤信息",-1)),i("div",jy,[i("div",Dy,[g[15]||(g[15]=i("label",null,"上班时间",-1)),oe.value==="in"?(x(),E("div",Ly,[Pe(i("input",{ref_key:"timeInput",ref:A,type:"time",class:"input time-input","onUpdate:modelValue":g[0]||(g[0]=C=>j.value=C),onKeydown:[Lt(Ie,["enter"]),Lt(ne,["esc"])]},null,544),[[Le,j.value]]),i("button",{class:"btn btn-primary btn-sm",onClick:Ie},"确认"),i("button",{class:"btn btn-sm",onClick:ne},"取消")])):(x(),E("div",Ry,[i("span",{class:ze(["num",{"val-empty":!(l.value&&l.value.clock_in_at)}])},F(l.value&&l.value.clock_in_at?Wt(Wn)(l.value.clock_in_at):"未打卡"),3),l.value&&l.value.id?(x(),E("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:g[1]||(g[1]=C=>O("in"))},[be(He,{name:"edit",size:13})])):me("",!0)]))]),i("div",Ky,[g[16]||(g[16]=i("label",null,"下班时间",-1)),oe.value==="out"?(x(),E("div",Ny,[Pe(i("input",{ref_key:"timeInput",ref:A,type:"time",class:"input time-input","onUpdate:modelValue":g[2]||(g[2]=C=>j.value=C),onKeydown:[Lt(Ie,["enter"]),Lt(ne,["esc"])]},null,544),[[Le,j.value]]),i("button",{class:"btn btn-primary btn-sm",onClick:Ie},"确认"),i("button",{class:"btn btn-sm",onClick:ne},"取消")])):(x(),E("div",Fy,[i("span",{class:ze(["num",{"val-empty":!(l.value&&l.value.clock_out_at)}])},F(l.value&&l.value.clock_out_at?Wt(Wn)(l.value.clock_out_at):"未打卡"),3),l.value&&l.value.id?(x(),E("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:g[3]||(g[3]=C=>O("out"))},[be(He,{name:"edit",size:13})])):me("",!0)]))]),i("div",Vy,[g[17]||(g[17]=i("label",null,"上班地点",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":g[4]||(g[4]=C=>v.value=C),list:m.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:G},null,40,By),[[Le,v.value]]),i("datalist",{id:m.value},[(x(!0),E(Oe,null,st(y.value,C=>(x(),E("option",{key:C,value:C},null,8,qy))),128))],8,Uy)]),i("div",Hy,[g[18]||(g[18]=i("label",null,"考勤状态",-1)),i("div",zy,[I.value?(x(),E(Oe,{key:0},[i("span",{class:ze(["dot",I.value.status])},null,2),i("span",null,F(I.value.label),1),l.value&&l.value.kind==="makeup"?(x(),E("span",Wy,"补卡")):me("",!0)],64)):(x(),E("span",Gy,"--"))])])]),l.value&&l.value.note?(x(),E("div",Yy,"补卡说明:"+F(l.value.note),1)):me("",!0),i("div",Jy,[w.value&&(!l.value||!l.value.clock_in_at)?(x(),E("button",{key:0,class:"btn btn-primary btn-sm",disabled:ae.value,onClick:de},"上班打卡",8,Xy)):w.value&&l.value&&l.value.clock_in_at&&!l.value.clock_out_at?(x(),E("button",{key:1,class:"btn btn-primary btn-sm",disabled:ae.value,onClick:ue},"下班打卡",8,Qy)):me("",!0),!w.value&&(!l.value||!l.value.clock_in_at)?(x(),E("button",{key:2,class:"btn btn-sm",onClick:Ye},"补卡")):me("",!0),M.value?(x(),E("button",{key:4,class:"btn btn-sm",disabled:ae.value,onClick:g[5]||(g[5]=C=>q(!1))},"取消休假",8,eg)):(x(),E("button",{key:3,class:"btn btn-sm",disabled:ae.value,onClick:ee},"标记休假",8,Zy))])]),Se.value?(x(),E("div",tg,[g[24]||(g[24]=i("div",{class:"sec-title"},"补卡登记",-1)),i("div",ng,[i("div",sg,[g[20]||(g[20]=i("label",null,"上班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":g[6]||(g[6]=C=>_e.value=C)},null,512),[[Le,_e.value]])]),i("div",og,[g[21]||(g[21]=i("label",null,"下班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":g[7]||(g[7]=C=>Me.value=C)},null,512),[[Le,Me.value]])]),i("div",rg,[g[22]||(g[22]=i("label",null,"上班地点",-1)),Pe(i("input",{class:"input",list:m.value,"onUpdate:modelValue":g[8]||(g[8]=C=>Ue.value=C),placeholder:"可直接输入"},null,8,ag),[[Le,Ue.value]])]),i("div",ig,[g[23]||(g[23]=i("label",null,"补卡原因",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":g[9]||(g[9]=C=>qe.value=C),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Le,qe.value]])])]),tt.value?(x(),E("div",lg,F(tt.value),1)):me("",!0),i("div",ug,[i("button",{class:"btn btn-sm",onClick:g[10]||(g[10]=C=>Se.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:We},"保存补卡")])])):me("",!0),i("div",cg,[i("div",dg,[i("span",fg,"工作记录("+F(u.value.length)+")",1),i("button",{class:"btn btn-primary btn-sm",onClick:lt},[be(He,{name:"plus",size:14}),g[25]||(g[25]=At(" 添加记录",-1))])]),!u.value.length&&!o.value?(x(),E("div",pg,"暂无记录")):me("",!0),(x(!0),E(Oe,null,st(u.value,C=>(x(),E("div",{key:C.id,class:"item"},[i("div",vg,[i("span",mg,F(Wt(Uo)(C.category)),1),i("span",{class:"item-content",title:"点击编辑",onClick:D=>Ae(C)},F(C.content),9,hg),C.project_id?(x(),E("span",yg,F($(C.project_id)),1)):me("",!0),C.minutes?(x(),E("span",gg,F(C.minutes)+" 分钟",1)):me("",!0),g[26]||(g[26]=i("span",{class:"flex1"},null,-1)),i("button",{class:"icon-btn",title:"编辑完整信息",onClick:D=>Ae(C)},[be(He,{name:"edit",size:14})],8,bg),i("button",{class:ze(["icon-btn",{active:C.is_milestone===1}]),title:"成果标记",onClick:D=>Te(C)},[be(He,{name:"star",size:14})],10,wg),i("button",{class:ze(["icon-btn",{"active-warn":C.needs_followup===1}]),title:"待跟进",onClick:D=>kt(C)},[be(He,{name:"flag",size:14})],10,_g),i("button",{class:"icon-btn",title:"删除",onClick:D=>xt.value=C},[be(He,{name:"close",size:14})],8,kg)]),C.takeaway||C.remark?(x(),E("div",Cg,[C.takeaway?(x(),E("div",xg,"收获:"+F(C.takeaway),1)):me("",!0),C.remark?(x(),E("div",$g,"备注:"+F(C.remark),1)):me("",!0)])):me("",!0)]))),128)),u.value.length?(x(),E("div",Sg,[At(" 共 "+F(u.value.length)+" 条事项 ",1),J.value?(x(),E(Oe,{key:0},[At(" · "+F((J.value/60).toFixed(1))+" 小时",1)],64)):me("",!0)])):me("",!0)]),be(xn,{open:!!xt.value,title:"删除确认",message:xt.value?"将删除工作记录「"+xt.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:g[11]||(g[11]=C=>xt.value=null),onConfirm:Ke},null,8,["open","message"]),be(xn,{open:S.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:g[12]||(g[12]=C=>S.value=!1),onConfirm:g[13]||(g[13]=C=>q(!0))},null,8,["open"]),be(Ey,{open:Q.value,item:le.value,projects:f.value,date:e.date,onCancel:g[14]||(g[14]=C=>Q.value=!1),onSave:it},null,8,["open","item","projects","date"])]))}}),Fd=Vt(Eg,[["__scopeId","data-v-81276f4c"]]),Ag={class:"cal-page"},Tg={class:"cal-toolbar"},Pg={class:"cal-title num"},Og=["disabled"],Mg={class:"card cal-card"},Ig={class:"cal-head"},jg={class:"cal-grid"},Dg=["title","onClick"],Lg={class:"cal-marks"},Rg={key:0,class:"drawer"},Kg={class:"drawer-head"},Ng={class:"drawer-body"},Fg=Kt({__name:"CalendarView",setup(e){const t=P(ut()),n=nt(()=>Number(t.value.slice(0,4))),o=nt(()=>Number(t.value.slice(5,7))-1),r=nt(()=>n.value+" 年 "+(o.value+1)+" 月"),l=["一","二","三","四","五","六","日"],u=nt(()=>{const S=(new Date(n.value,o.value,1).getDay()+6)%7,M=new Date(n.value,o.value+1,0).getDate(),ee=[];for(let q=0;q[O.date,O])),oe=M[2],j=new Map;for(const O of u.value){if(!O.inMonth)continue;const ne=uo(q.get(O.date),O.date,ee,O.date===v),Ie=oe.filter(Se=>Se.date===O.date);j.set(O.date,{status:ne.status,label:ne.label,location:((A=q.get(O.date))==null?void 0:A.location)||"",hasLog:Ie.length>0,hasMilestone:Ie.some(Se=>Se.is_milestone===1)})}f.value=j}pt([n,o],y,{immediate:!0}),pt(Jo,()=>{y()});function m(G){var S;return((S=f.value.get(G))==null?void 0:S.status)??""}function w(G){const S=f.value.get(G);return S?G+" · "+S.label+(S.location?" · "+S.location:""):G}function T(G){var S;return!!((S=f.value.get(G))!=null&&S.hasLog)}function $(G){var S;return!!((S=f.value.get(G))!=null&&S.hasMilestone)}function I(){t.value=qo(t.value,-1)}function J(){t.value=qo(t.value,1)}function ae(){t.value=ut()}const de=P(null);function ue(G,S){S&&(de.value=G)}return pt(Fi,G=>{G&&(t.value=G,de.value=G,Fi.value=null)},{immediate:!0}),(G,S)=>(x(),E("div",Ag,[i("div",Tg,[i("button",{class:"icon-btn",title:"上一月",onClick:I},[be(He,{name:"chevron-left",size:16})]),i("span",Pg,F(r.value),1),i("button",{class:"icon-btn",title:"下一月",onClick:J},[be(He,{name:"chevron-right",size:16})]),i("button",{class:"btn btn-sm",disabled:t.value===Wt(v),onClick:ae},"回到本月",8,Og)]),i("div",Mg,[i("div",Ig,[(x(),E(Oe,null,st(l,M=>i("span",{key:M,class:"cal-week"},F(M),1)),64))]),i("div",jg,[(x(!0),E(Oe,null,st(u.value,(M,ee)=>(x(),E("button",{key:ee,class:ze(["cal-cell",{blank:!M.inMonth,weekend:M.weekend,selected:de.value===M.date,"is-today":M.date===Wt(v)}]),title:M.inMonth?w(M.date):void 0,onClick:q=>ue(M.date,M.inMonth)},[M.inMonth?(x(),E(Oe,{key:0},[i("span",{class:ze(["daynum num",{today:M.date===Wt(v)}])},F(Number(M.date.slice(8,10))),3),i("span",Lg,[m(M.date)?(x(),E("span",{key:0,class:ze(["dot",m(M.date)])},null,2)):me("",!0),T(M.date)?(x(),Ct(He,{key:1,name:"check-circle",size:12,class:"mark-log"})):me("",!0),$(M.date)?(x(),Ct(He,{key:2,name:"star",size:12,class:"mark-star"})):me("",!0)])],64)):me("",!0)],10,Dg))),128))])]),be(Jn,{name:"drawer"},{default:Sn(()=>[de.value?(x(),E("aside",Rg,[i("div",Kg,[S[1]||(S[1]=i("span",{class:"drawer-title"},"当日详情",-1)),i("button",{class:"icon-btn",onClick:S[0]||(S[0]=M=>de.value=null)},[be(He,{name:"close",size:16})])]),i("div",Ng,[be(Fd,{date:de.value},null,8,["date"])])])):me("",!0)]),_:1})]))}}),Vg=Vt(Fg,[["__scopeId","data-v-abd71a5b"]]),Bg="modulepreload",Ug=function(e,t){return new URL(e,t).href},qu={},Vd=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){const u=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),v=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));r=Promise.allSettled(n.map(y=>{if(y=Ug(y,o),y in qu)return;qu[y]=!0;const m=y.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!o)for(let I=u.length-1;I>=0;I--){const J=u[I];if(J.href===y&&(!m||J.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${w}`))return;const $=document.createElement("link");if($.rel=m?"stylesheet":Bg,m||($.as="script"),$.crossOrigin="",$.href=y,v&&$.setAttribute("nonce",v),document.head.appendChild($),m)return new Promise((I,J)=>{$.addEventListener("load",I),$.addEventListener("error",()=>J(new Error(`Unable to preload CSS for ${y}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return r.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const qg=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},o=(l,u)=>{n.platforms.set(l,u)},r=l=>{n.platforms.has(l)&&(n.currentPlatform=n.platforms.get(l))};return n.addPlatform=o,n.setPlatform=r,n},Hg=e=>e.CapacitorPlatforms=qg(e),Bd=Hg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Bd.addPlatform;Bd.setPlatform;var io;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(io||(io={}));class wi extends Error{constructor(t,n,o){super(t),this.message=t,this.code=n,this.data=o}}const zg=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"},Wg=e=>{var t,n,o,r,l;const u=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},v=f.Plugins=f.Plugins||{},y=e.CapacitorPlatforms,m=()=>u!==null?u.name:zg(e),w=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,T=()=>w()!=="web",$=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||T,I=q=>{const oe=S.get(q);return!!(oe!=null&&oe.platforms.has(w())||de(q))},J=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||I,ae=q=>{var oe;return(oe=f.PluginHeaders)===null||oe===void 0?void 0:oe.find(j=>j.name===q)},de=((r=y==null?void 0:y.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||ae,ue=q=>e.console.error(q),G=(q,oe,j)=>Promise.reject(`${j} does not have an implementation of "${oe}".`),S=new Map,M=(q,oe={})=>{const j=S.get(q);if(j)return console.warn(`Capacitor plugin "${q}" already registered. Cannot register plugins twice.`),j.proxy;const A=w(),O=de(q);let ne;const Ie=async()=>(!ne&&A in oe?ne=typeof oe[A]=="function"?ne=await oe[A]():ne=oe[A]:u!==null&&!ne&&"web"in oe&&(ne=typeof oe.web=="function"?ne=await oe.web():ne=oe.web),ne),Se=(Ye,We)=>{var le,Q;if(O){const Ae=O==null?void 0:O.methods.find(lt=>We===lt.name);if(Ae)return Ae.rtype==="promise"?lt=>f.nativePromise(q,We.toString(),lt):(lt,it)=>f.nativeCallback(q,We.toString(),lt,it);if(Ye)return(le=Ye[We])===null||le===void 0?void 0:le.bind(Ye)}else{if(Ye)return(Q=Ye[We])===null||Q===void 0?void 0:Q.bind(Ye);throw new wi(`"${q}" plugin is not implemented on ${A}`,io.Unimplemented)}},_e=Ye=>{let We;const le=(...Q)=>{const Ae=Ie().then(lt=>{const it=Se(lt,Ye);if(it){const Te=it(...Q);return We=Te==null?void 0:Te.remove,Te}else throw new wi(`"${q}.${Ye}()" is not implemented on ${A}`,io.Unimplemented)});return Ye==="addListener"&&(Ae.remove=async()=>We()),Ae};return le.toString=()=>`${Ye.toString()}() { [capacitor code] }`,Object.defineProperty(le,"name",{value:Ye,writable:!1,configurable:!1}),le},Me=_e("addListener"),qe=_e("removeListener"),Ue=(Ye,We)=>{const le=Me({eventName:Ye},We),Q=async()=>{const lt=await le;qe({eventName:Ye,callbackId:lt},We)},Ae=new Promise(lt=>le.then(()=>lt({remove:Q})));return Ae.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await Q()},Ae},tt=new Proxy({},{get(Ye,We){switch(We){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return O?Ue:Me;case"removeListener":return qe;default:return _e(We)}}});return v[q]=tt,S.set(q,{name:q,proxy:tt,platforms:new Set([...Object.keys(oe),...O?[A]:[]])}),tt},ee=((l=y==null?void 0:y.currentPlatform)===null||l===void 0?void 0:l.registerPlugin)||M;return f.convertFileSrc||(f.convertFileSrc=q=>q),f.getPlatform=w,f.handleError=ue,f.isNativePlatform=$,f.isPluginAvailable=J,f.pluginMethodNoop=G,f.registerPlugin=ee,f.Exception=wi,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},Gg=e=>e.Capacitor=Wg(e),lo=Gg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ud=lo.registerPlugin;lo.Plugins;class qd{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 o=!1;this.listeners[t]||(this.listeners[t]=[],o=!0),this.listeners[t].push(n);const l=this.windowListeners[t];l&&!l.registered&&this.addWindowListener(l),o&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,n);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,o){const r=this.listeners[t];if(!r){if(o){let l=this.retainedEventArguments[t];l||(l=[]),l.push(n),this.retainedEventArguments[t]=l}return}r.forEach(l=>l(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:o=>{this.notifyListeners(n,o)}}}unimplemented(t="not implemented"){return new lo.Exception(t,io.Unimplemented)}unavailable(t="not available"){return new lo.Exception(t,io.Unavailable)}async removeListener(t,n){const o=this.listeners[t];if(!o)return;const r=o.indexOf(n);this.listeners[t].splice(r,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(o=>{this.notifyListeners(t,o)}))}}const Hu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),zu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Yg extends qd{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(o=>{if(o.length<=0)return;let[r,l]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=zu(r).trim(),l=zu(l).trim(),n[r]=l}),n}async setCookie(t){try{const n=Hu(t.key),o=Hu(t.value),r=`; expires=${(t.expires||"").replace("expires=","")}`,l=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${o||""}${r}; path=${l}; ${u};`}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)}}}Ud("CapacitorCookies",{web:()=>new Yg});const Jg=async e=>new Promise((t,n)=>{const o=new FileReader;o.onload=()=>{const r=o.result;t(r.indexOf(",")>=0?r.split(",")[1]:r)},o.onerror=r=>n(r),o.readAsDataURL(e)}),Xg=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(r=>r.toLocaleLowerCase()).reduce((r,l,u)=>(r[l]=e[t[u]],r),{})},Qg=(e,t=!0)=>e?Object.entries(e).reduce((o,r)=>{const[l,u]=r;let f,v;return Array.isArray(u)?(v="",u.forEach(y=>{f=t?encodeURIComponent(y):y,v+=`${l}=${f}&`}),v.slice(0,-1)):(f=t?encodeURIComponent(u):u,v=`${l}=${f}`),`${o}&${v}`},"").substr(1):null,Zg=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),r=Xg(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(r.includes("application/x-www-form-urlencoded")){const l=new URLSearchParams;for(const[u,f]of Object.entries(e.data||{}))l.set(u,f);n.body=l.toString()}else if(r.includes("multipart/form-data")||e.data instanceof FormData){const l=new FormData;if(e.data instanceof FormData)e.data.forEach((f,v)=>{l.append(v,f)});else for(const f of Object.keys(e.data))l.append(f,e.data[f]);n.body=l;const u=new Headers(n.headers);u.delete("content-type"),n.headers=u}else(r.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class eb extends qd{async request(t){const n=Zg(t,t.webFetchExtra),o=Qg(t.params,t.shouldEncodeUrlParams),r=o?`${t.url}?${o}`:t.url,l=await fetch(r,n),u=l.headers.get("content-type")||"";let{responseType:f="text"}=l.ok?t:{};u.includes("application/json")&&(f="json");let v,y;switch(f){case"arraybuffer":case"blob":y=await l.blob(),v=await Jg(y);break;case"json":v=await l.json();break;case"document":case"text":default:v=await l.text()}const m={};return l.headers.forEach((w,T)=>{m[T]=w}),{data:v,headers:m,status:l.status,url:l.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"}))}}Ud("CapacitorHttp",{web:()=>new eb});async function Ea(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const u=await n.electronAPI.saveFile(e,t);return u&&u.saved?u.path:""}if(lo.isNativePlatform()){const{Filesystem:u,Directory:f,Encoding:v}=await Vd(async()=>{const{Filesystem:y,Directory:m,Encoding:w}=await import("./index-prZXT88d.js");return{Filesystem:y,Directory:m,Encoding:w}},[],import.meta.url);try{return(await u.writeFile({path:e,data:t,directory:f.Documents,encoding:v.UTF8,recursive:!0})).uri}catch{return(await u.writeFile({path:e,data:t,directory:f.Cache,encoding:v.UTF8,recursive:!0})).uri}}const o=new Blob([t],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(o),l=document.createElement("a");return l.href=r,l.download=e,l.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e4),""}const tb=Object.freeze(Object.defineProperty({__proto__:null,downloadText:Ea},Symbol.toStringTag,{value:"Module"})),nb={class:"detail-page"},sb={class:"card toolbar"},ob={class:"nav-row"},rb=["value"],ab=["disabled"],ib={class:"exp-row"},lb={class:"seg"},ub=["disabled"],cb=Kt({__name:"TodayView",setup(e){const t=P(ut()),n=nt(()=>t.value===ut());function o(){t.value=Ft(t.value,-1)}function r(){t.value=Ft(t.value,1)}function l(){t.value=ut()}const u=P("day"),f=P(ut()),v=P(ut()),y=P(!1);function m(){if(u.value==="day")return{start:t.value,end:t.value,label:t.value};if(u.value==="week"){const $=Zs(f.value);return{start:$,end:Ft($,6),label:$+"_"+Ft($,6)}}if(u.value==="month"){const $=f.value.slice(0,4),I=f.value.slice(5,7),J=new Date(Number($),Number(I),0).getDate();return{start:$+"-"+I+"-01",end:$+"-"+I+"-"+J,label:$+"-"+I}}return{start:f.value,end:v.value,label:f.value+"_"+v.value}}async function w(){if(!y.value){y.value=!0;try{const{start:$,end:I,label:J}=m(),[ae,de,ue,G]=await Promise.all([ms(),Xo($,I),Qo($,I),ao(!0)]),S=new Map(G.map(j=>[j.id,j.name])),M=["# 工作详情 "+J,""],ee=["周日","周一","周二","周三","周四","周五","周六"];let q=$,oe=0;for(;q<=I&&oe<400;){const j=ue.filter(O=>O.date===q),A=de.find(O=>O.date===q);if(A||j.length){if(M.push("## "+q+" "+ee[new Date(q+"T00:00:00").getDay()],""),A&&(A.clock_in_at||A.kind==="makeup")){const O=uo(A,q,ae,q===ut()),ne=[Wn(A.clock_in_at),"–",Wn(A.clock_out_at),"·",O.label];A.location&&ne.push("· 地点:"+A.location),M.push("考勤:"+ne.join(" "),"")}for(const O of j){const ne=O.project_id&&S.get(O.project_id)||"",Ie="- 【"+Uo(O.category)+"】"+O.content+(O.minutes?"("+O.minutes+" 分钟)":"")+(ne?" @"+ne:"");M.push(Ie),O.takeaway&&M.push(" - 收获:"+O.takeaway),O.needs_followup===1&&O.remark?M.push(" - 待跟进:"+O.remark):O.remark&&M.push(" - 备注:"+O.remark)}M.push("")}q=Ft(q,1),oe++}await Ea("工作详情_"+J+".md",M.join(` -`)),Ve("已导出 Markdown")}finally{y.value=!1}}}function T($){const I=$.target.value;I&&(t.value=I)}return pt(t,$=>{f.value=$,u.value==="custom"&&(v.value=$)}),($,I)=>(x(),E("div",nb,[i("div",sb,[i("div",ob,[i("button",{class:"icon-btn",title:"前一天",onClick:o},[be(He,{name:"chevron-left",size:16})]),i("span",{class:ze(["date-title num",{"is-today":n.value}])},F(Wt(bd)(t.value)),3),i("button",{class:"icon-btn",title:"后一天",onClick:r},[be(He,{name:"chevron-right",size:16})]),i("input",{type:"date",class:"input w-date",value:t.value,onChange:T},null,40,rb),i("button",{class:"btn btn-sm",disabled:n.value,onClick:l},"回到今天",8,ab)]),I[7]||(I[7]=i("div",{class:"tool-sep"},null,-1)),i("div",ib,[I[6]||(I[6]=i("span",{class:"muted exp-label"},"导出",-1)),i("div",lb,[i("button",{class:ze(["seg-btn",{active:u.value==="day"}]),onClick:I[0]||(I[0]=J=>u.value="day")},"指定日",2),i("button",{class:ze(["seg-btn",{active:u.value==="week"}]),onClick:I[1]||(I[1]=J=>u.value="week")},"当周",2),i("button",{class:ze(["seg-btn",{active:u.value==="month"}]),onClick:I[2]||(I[2]=J=>u.value="month")},"当月",2),i("button",{class:ze(["seg-btn",{active:u.value==="custom"}]),onClick:I[3]||(I[3]=J=>u.value="custom")},"自定义",2)]),u.value!=="day"?Pe((x(),E("input",{key:0,class:"input w-exp",type:"date","onUpdate:modelValue":I[4]||(I[4]=J=>f.value=J)},null,512)),[[Le,f.value]]):me("",!0),u.value==="custom"?Pe((x(),E("input",{key:1,class:"input w-exp",type:"date","onUpdate:modelValue":I[5]||(I[5]=J=>v.value=J)},null,512)),[[Le,v.value]]):me("",!0),i("button",{class:"btn btn-sm",disabled:y.value,onClick:w},"导出 Markdown",8,ub)])]),be(Fd,{date:t.value},null,8,["date"])]))}}),db=Vt(cb,[["__scopeId","data-v-2bb84c76"]]),fb={class:"plan-page"},pb={class:"blk-head"},vb={key:0,class:"card empty muted"},mb={class:"goal-main"},hb={class:"goal-line"},yb={class:"tag"},gb={class:"goal-name"},bb={class:"muted num goal-range"},wb={class:"goal-bar"},_b={class:"muted num goal-meta"},kb={class:"goal-ops"},Cb=["onClick"],xb=["onClick"],$b={class:"blk-head day-head"},Sb={class:"blk-head-text"},Eb={class:"muted blk-sub num"},Ab={class:"day-ops"},Tb={class:"card list-card"},Pb={key:0,class:"empty muted"},Ob={class:"pi-time num"},Mb={class:"muted"},Ib={class:"pi-main"},jb={class:"pi-title"},Db={class:"tag"},Lb={key:0,class:"tag tag-goal"},Rb={key:1,class:"state-done"},Kb={key:2,class:"state-skip"},Nb={key:0,class:"muted pi-note"},Fb={class:"muted pi-meta num"},Vb={key:0,class:"timer-live"},Bb={class:"pi-ops"},Ub=["onClick"],qb=["onClick"],Hb=["onClick"],zb=["onClick"],Wb=["onClick"],Gb=["onClick"],Yb={class:"dialog",role:"dialog","aria-label":"计划"},Jb={class:"dialog-head"},Xb={class:"dialog-title"},Qb={class:"dialog-body"},Zb={class:"form-row"},ew={class:"form-row"},tw=["value"],nw={class:"form-row two"},sw={class:"form-row"},ow={key:0,class:"form-error"},rw={class:"dialog-btns"},aw={class:"dialog",role:"dialog","aria-label":"长期计划"},iw={class:"dialog-head"},lw={class:"dialog-title"},uw={class:"dialog-body"},cw={class:"form-row"},dw={class:"form-row"},fw=["value"],pw={class:"form-row two"},vw={class:"form-row"},mw={key:0,class:"form-error"},hw={class:"dialog-btns"},yw=Kt({__name:"PlanView",setup(e){const t=P([]),n=P({}),o=P(!1),r=P(null),l=P(""),u=P("学习"),f=P(ut()),v=P(Ft(ut(),6)),y=P(""),m=P(""),w=P(null);function T(){r.value=null,l.value="",u.value="学习",f.value=ut(),v.value=Ft(ut(),6),y.value="",m.value="",o.value=!0}function $(g){r.value=g,l.value=g.title,u.value=g.kind,f.value=g.start_date,v.value=g.end_date,y.value=g.note||"",m.value="",o.value=!0}async function I(){if(!l.value.trim()){m.value="请填写计划名称";return}if(v.valueae.value===ut());async function ee(){ue.value=!0;const[g,C,D]=await Promise.all([Ah(ae.value),Kh(),Rh()]);de.value=g,t.value=C;const re={};for(const pe of D)re[String(pe.goalId)]={done:pe.done,total:pe.total};n.value=re,ue.value=!1}pt(ae,ee),pt(Jo,ee),cn(()=>{ee(),S=window.setInterval(()=>{G.value=Date.now()},3e4)}),bn(()=>{S&&window.clearInterval(S)});function q(){ae.value=Ft(ae.value,-1)}function oe(){ae.value=Ft(ae.value,1)}function j(){ae.value=ut()}const A=nt(()=>{const g=de.value.length,C=de.value.filter(we=>we.status==="done").length,D=de.value.reduce((we,ke)=>we+O(ke),0),re=de.value.reduce((we,ke)=>we+(ke.actual_minutes||0),0);let pe=0;const xe=Ie.value;if(xe){const we=de.value.find(ke=>ke.id===xe);we&&(pe=Se(we))}return{total:g,done:C,plannedMin:D,actualMin:re+pe}});function O(g){const[C,D]=g.start_time.split(":").map(Number),[re,pe]=g.end_time.split(":").map(Number);return Math.max(0,re*60+pe-(C*60+D))}function ne(g){return g<60?g+" 分钟":Math.floor(g/60)+" 小时 "+g%60+" 分"}const Ie=nt(()=>{const g=de.value.find(C=>!!C.timer_started_at);return g?g.id:null});function Se(g){if(!g.timer_started_at)return g.actual_minutes||0;const C=Math.max(0,Math.round((G.value-new Date(g.timer_started_at).getTime())/6e4));return(g.actual_minutes||0)+C}async function _e(g){g.timer_started_at?(await Sa(g.id),Ve("已停止计时:"+g.title)):(await jh(g.id),Ve("开始计时:"+g.title)),Wm(),await ee()}async function Me(g,C){await Ih(g.id,C),await ee()}const qe=P(!1),Ue=P(null),tt=P(""),Ye=P("学习"),We=P("09:00"),le=P("10:00"),Q=P(""),Ae=P(""),lt=["学习","健身","自律","工作","阅读","其他"];function it(){Ue.value=null,tt.value="",Ye.value="学习",We.value="09:00",le.value="10:00",Q.value="",Ae.value="",qe.value=!0}function Te(g){Ue.value=g.id,tt.value=g.title,Ye.value=g.kind,We.value=g.start_time,le.value=g.end_time,Q.value=g.note||"",Ae.value="",qe.value=!0}async function kt(){if(!tt.value.trim()){Ae.value="请填写计划内容";return}if(le.value<=We.value){Ae.value="结束时间需晚于开始时间";return}Ue.value?(await Oh(Ue.value,{title:tt.value.trim(),kind:Ye.value,start_time:We.value,end_time:le.value,note:Q.value}),Ve("计划已更新")):(await Ph({date:ae.value,start_time:We.value,end_time:le.value,title:tt.value,kind:Ye.value,note:Q.value}),Ve("计划已添加")),qe.value=!1,await ee()}async function xt(g){await Mh(g.id),Ve("已删除"),await ee()}const Ke=["周日","周一","周二","周三","周四","周五","周六"];function _(g){return Ke[Gn(g).getDay()]}return(g,C)=>(x(),E("div",fb,[i("div",pb,[C[18]||(C[18]=i("div",{class:"blk-head-text"},[i("div",{class:"blk-title"},"长期计划"),i("div",{class:"muted blk-sub"},"跨越多天的目标,自动落实到每一天")],-1)),i("button",{class:"btn btn-sm",onClick:T},[be(He,{name:"plus",size:14}),C[17]||(C[17]=At(" 新建长期计划",-1))])]),t.value.length?me("",!0):(x(),E("div",vb," 暂无长期计划。创建一个跨越多天的目标(如「产品文档学习」),系统会自动生成每天的打卡任务。 ")),(x(!0),E(Oe,null,st(t.value,D=>(x(),E("div",{key:D.id,class:"card goal-card"},[i("div",mb,[i("div",hb,[i("span",yb,F(D.kind),1),i("span",gb,F(D.title),1),i("span",bb,F(D.start_date.slice(5))+" ~ "+F(D.end_date.slice(5)),1)]),i("div",wb,[i("span",{class:"goal-bar-fill",style:pn({width:(n.value[String(D.id)]?Math.round(n.value[String(D.id)].done/Math.max(1,n.value[String(D.id)].total)*100):0)+"%",background:n.value[String(D.id)]&&n.value[String(D.id)].done>=n.value[String(D.id)].total&&n.value[String(D.id)].total>0?"var(--ok)":"var(--accent)"})},null,4)]),i("div",_b,[At(F(n.value[String(D.id)]?n.value[String(D.id)].done+"/"+n.value[String(D.id)].total+" 天已完成":"0/"+(n.value[String(D.id)]?n.value[String(D.id)].total:0)+" 天")+" ",1),D.note?(x(),E(Oe,{key:0},[At(" · "+F(D.note),1)],64)):me("",!0)])]),i("div",kb,[i("button",{class:"icon-btn",title:"编辑",onClick:re=>$(D)},[be(He,{name:"edit",size:14})],8,Cb),i("button",{class:"icon-btn",title:"删除",onClick:re=>w.value=D},[be(He,{name:"close",size:14})],8,xb)])]))),128)),i("div",$b,[i("div",Sb,[C[21]||(C[21]=i("div",{class:"blk-title"},"每日安排",-1)),i("div",Eb,[At(" 共 "+F(A.value.total)+" 项 · 完成 "+F(A.value.done)+" 项 · 计划 "+F(ne(A.value.plannedMin))+" · 实际投入 "+F(ne(A.value.actualMin))+" ",1),Ie.value?(x(),E(Oe,{key:0},[C[19]||(C[19]=At(" · ",-1)),C[20]||(C[20]=i("span",{class:"timer-live"},"计时中",-1))],64)):me("",!0)])]),i("div",Ab,[i("button",{class:"icon-btn",title:"前一天",onClick:q},[be(He,{name:"chevron-left",size:16})]),i("span",{class:ze(["date-chip num",{today:M.value}])},F(ae.value.slice(5))+" "+F(_(ae.value)),3),i("button",{class:"icon-btn",title:"后一天",onClick:oe},[be(He,{name:"chevron-right",size:16})]),i("button",{class:ze(["btn btn-sm",{"btn-primary":!M.value}]),onClick:j},"今天",2),i("button",{class:"btn btn-primary btn-sm",onClick:it},[be(He,{name:"plus",size:14}),C[22]||(C[22]=At(" 添加计划",-1))])])]),i("div",Tb,[!ue.value&&!de.value.length?(x(),E("div",Pb,"今天还没有计划,点「添加计划」开始规划。")):me("",!0),(x(!0),E(Oe,null,st(de.value,D=>(x(),E("div",{key:D.id,class:ze(["plan-item",{done:D.status==="done",skip:D.status==="skip",running:!!D.timer_started_at}])},[i("div",Ob,[At(F(D.start_time),1),i("span",Mb," - "+F(D.end_time),1)]),i("div",Ib,[i("div",jb,[i("span",Db,F(D.kind),1),D.goal_id?(x(),E("span",Lb,"长期")):me("",!0),i("span",{class:ze(["pi-text",{strike:D.status==="done"}])},F(D.title),3),D.status==="done"?(x(),E("span",Rb,"已完成")):D.status==="skip"?(x(),E("span",Kb,"已跳过")):me("",!0)]),D.note?(x(),E("div",Nb,F(D.note),1)):me("",!0),i("div",Fb,[D.timer_started_at?(x(),E("span",Vb,"计时中 · 已 "+F(Se(D))+" 分钟",1)):D.actual_minutes>0?(x(),E(Oe,{key:1},[At("实际投入 "+F(D.actual_minutes)+" 分钟",1)],64)):me("",!0)])]),i("div",Bb,[D.status!=="done"?(x(),E("button",{key:0,class:ze(["btn btn-xs",{"timer-on":!!D.timer_started_at}]),onClick:re=>_e(D)},F(D.timer_started_at?"停止计时":"计时"),11,Ub)):me("",!0),D.status!=="done"?(x(),E("button",{key:1,class:"btn btn-xs",onClick:re=>Me(D,"done")},"完成",8,qb)):me("",!0),D.status==="todo"?(x(),E("button",{key:2,class:"btn btn-xs",onClick:re=>Me(D,"skip")},"跳过",8,Hb)):me("",!0),D.status!=="todo"?(x(),E("button",{key:3,class:"btn btn-xs",onClick:re=>Me(D,"todo")},"恢复",8,zb)):me("",!0),i("button",{class:"icon-btn",title:"编辑",onClick:re=>Te(D)},[be(He,{name:"edit",size:14})],8,Wb),i("button",{class:"icon-btn",title:"删除",onClick:re=>xt(D)},[be(He,{name:"close",size:14})],8,Gb)])],2))),128))]),(x(),Ct($n,{to:"body"},[qe.value?(x(),E("div",{key:0,class:"mask",onClick:C[7]||(C[7]=Ut(D=>qe.value=!1,["self"]))},[i("div",Yb,[i("div",Jb,[i("span",Xb,F(Ue.value?"编辑计划":"添加计划"),1),i("button",{class:"icon-btn",onClick:C[0]||(C[0]=D=>qe.value=!1)},[be(He,{name:"close",size:16})])]),i("div",Qb,[i("div",Zb,[C[23]||(C[23]=i("label",null,"计划内容(学什么、做什么)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[1]||(C[1]=D=>tt.value=D),placeholder:"如:产品文档第三章 / 晨跑 5 公里",onKeydown:Lt(kt,["enter"])},null,544),[[Le,tt.value]])]),i("div",ew,[C[24]||(C[24]=i("label",null,"类别",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":C[2]||(C[2]=D=>Ye.value=D)},[(x(),E(Oe,null,st(lt,D=>i("option",{key:D,value:D},F(D),9,tw)),64))],512),[[vs,Ye.value]])]),i("div",nw,[i("div",null,[C[25]||(C[25]=i("label",null,"开始时间",-1)),Pe(i("input",{class:"input",type:"time","onUpdate:modelValue":C[3]||(C[3]=D=>We.value=D)},null,512),[[Le,We.value]])]),i("div",null,[C[26]||(C[26]=i("label",null,"结束时间",-1)),Pe(i("input",{class:"input",type:"time","onUpdate:modelValue":C[4]||(C[4]=D=>le.value=D)},null,512),[[Le,le.value]])])]),i("div",sw,[C[27]||(C[27]=i("label",null,"备注(选填)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[5]||(C[5]=D=>Q.value=D),placeholder:"目标、资料、提醒等",onKeydown:Lt(kt,["enter"])},null,544),[[Le,Q.value]])]),Ae.value?(x(),E("div",ow,F(Ae.value),1)):me("",!0)]),i("div",rw,[i("button",{class:"btn btn-sm",onClick:C[6]||(C[6]=D=>qe.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:kt},F(Ue.value?"保存":"添加"),1)])])])):me("",!0)])),(x(),Ct($n,{to:"body"},[o.value?(x(),E("div",{key:0,class:"mask",onClick:C[15]||(C[15]=Ut(D=>o.value=!1,["self"]))},[i("div",aw,[i("div",iw,[i("span",lw,F(r.value?"编辑长期计划":"新建长期计划"),1),i("button",{class:"icon-btn",onClick:C[8]||(C[8]=D=>o.value=!1)},[be(He,{name:"close",size:16})])]),i("div",uw,[i("div",cw,[C[28]||(C[28]=i("label",null,"计划名称(落实为每天一条任务)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[9]||(C[9]=D=>l.value=D),placeholder:"如:产品文档学习 / 健身月计划"},null,512),[[Le,l.value]])]),i("div",dw,[C[29]||(C[29]=i("label",null,"类别",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":C[10]||(C[10]=D=>u.value=D)},[(x(),E(Oe,null,st(lt,D=>i("option",{key:D,value:D},F(D),9,fw)),64))],512),[[vs,u.value]])]),i("div",pw,[i("div",null,[C[30]||(C[30]=i("label",null,"开始日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":C[11]||(C[11]=D=>f.value=D)},null,512),[[Le,f.value]])]),i("div",null,[C[31]||(C[31]=i("label",null,"结束日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":C[12]||(C[12]=D=>v.value=D)},null,512),[[Le,v.value]])])]),i("div",vw,[C[32]||(C[32]=i("label",null,"备注(选填)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[13]||(C[13]=D=>y.value=D)},null,512),[[Le,y.value]])]),m.value?(x(),E("div",mw,F(m.value),1)):me("",!0),C[33]||(C[33]=i("div",{class:"muted goal-hint"},"创建后区间内每一天都会生成一条任务,可在每日安排中逐日打卡与计时。",-1))]),i("div",hw,[i("button",{class:"btn btn-sm",onClick:C[14]||(C[14]=D=>o.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:I},F(r.value?"保存":"创建"),1)])])])):me("",!0)])),be(xn,{open:!!w.value,title:"删除长期计划",message:w.value?"将删除「"+w.value.title+"」及其全部每日任务(含已完成记录),不可恢复。":"","confirm-text":"删除",danger:"",onCancel:C[16]||(C[16]=D=>w.value=null),onConfirm:J},null,8,["open","message"])]))}}),gw=Vt(yw,[["__scopeId","data-v-ffd19b28"]]),bw={class:"stats"},ww={class:"cards"},_w={class:"card stat-card"},kw={class:"stat-num num"},Cw={class:"card stat-card"},xw={class:"stat-num num"},$w={class:"card stat-card"},Sw={class:"stat-num num"},Ew={class:"card stat-card"},Aw={class:"stat-num num"},Tw={class:"card section"},Pw={class:"heat"},Ow=["title"],Mw={class:"two-col"},Iw={class:"card section"},jw={class:"bar-label"},Dw={class:"bar-track"},Lw={class:"muted num bar-num"},Rw={key:0,class:"muted"},Kw={class:"card section"},Nw={class:"bar-label"},Fw={class:"bar-track"},Vw={class:"muted num bar-num"},Bw={key:0,class:"muted"},Uw={class:"card section"},qw={class:"bar-label loc-label"},Hw={class:"bar-track"},zw={class:"muted num bar-num"},Ww={key:0,class:"muted"},Gw=Kt({__name:"StatsView",setup(e){const t=P({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=P([]),o=P([]),r=P([]),l=P([]);async function u(){const y=ut(),m="2000-01-01",w=await Promise.all([ms(),Xo(m,y),Qo(m,y),ao(!0)]),T=w[0],$=w[1],I=w[2],J=w[3],ae=$.filter(_e=>_e.clock_in_at||_e.kind==="makeup");let de=0;for(const _e of ae){const Me=uo(_e,_e.date,T,_e.date===y);de+=Me.workedMinutes??0}const ue=new Set(I.map(_e=>_e.date));let G=0,S=y;for(ue.has(S)||(S=Ft(y,-1));ue.has(S);)G++,S=Ft(S,-1);t.value={attendDays:ae.length,totalHours:(de/60).toFixed(1),itemCount:I.length,streak:G};const M=new Map;for(const _e of ae){const Me=_e.location||"未记录";M.set(Me,(M.get(Me)||0)+1)}l.value=Array.from(M.entries()).map(_e=>({name:_e[0],count:_e[1],percent:Math.round(_e[1]/(ae.length||1)*100)})).sort((_e,Me)=>Me.count-_e.count);const ee=I.length||1,q=await Zo(),oe=new Map;for(const _e of I)oe.set(_e.category,(oe.get(_e.category)||0)+1);const j=new Set(q);for(const _e of oe.keys())j.has(_e)||q.push(_e);o.value=q.map(_e=>{const Me=oe.get(_e)||0;return{key:_e,label:_e,count:Me,percent:Math.round(Me/ee*100)}}).filter(_e=>_e.count>0).sort((_e,Me)=>Me.count-_e.count);const A=new Map(J.map(_e=>[_e.id,_e.name])),O=new Map;for(const _e of I){const Me=_e.project_id?A.get(_e.project_id)||"已删除项目":"无项目";O.set(Me,(O.get(Me)||0)+1)}r.value=Array.from(O.entries()).map(_e=>({name:_e[0],count:_e[1],percent:Math.round(_e[1]/ee*100)})).sort((_e,Me)=>Me.count-_e.count);const ne=new Map;for(const _e of I)ne.set(_e.date,(ne.get(_e.date)||0)+1);const Ie=Zs(y),Se=[];for(let _e=11;_e>=0;_e--){const Me=Ft(Ie,-7*_e),qe=[];for(let Ue=0;Ue<7;Ue++){const tt=Ft(Me,Ue);qe.push({date:tt,count:ne.get(tt)||0})}Se.push(qe)}n.value=Se}cn(async()=>{await u()}),pt(Jo,()=>{u()});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)=>(x(),E("div",bw,[i("div",ww,[i("div",_w,[m[0]||(m[0]=i("div",{class:"muted"},"出勤天数",-1)),i("div",kw,F(t.value.attendDays),1)]),i("div",Cw,[m[1]||(m[1]=i("div",{class:"muted"},"累计工时(小时)",-1)),i("div",xw,F(t.value.totalHours),1)]),i("div",$w,[m[2]||(m[2]=i("div",{class:"muted"},"记录条数",-1)),i("div",Sw,F(t.value.itemCount),1)]),i("div",Ew,[m[3]||(m[3]=i("div",{class:"muted"},"连续记录(天)",-1)),i("div",Aw,F(t.value.streak),1)])]),i("div",Tw,[m[4]||(m[4]=i("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),i("div",Pw,[(x(!0),E(Oe,null,st(n.value,(w,T)=>(x(),E("div",{key:T,class:"heat-col"},[(x(!0),E(Oe,null,st(w,$=>(x(),E("span",{key:$.date,class:ze(["heat-cell","lv"+f($.count)]),title:v($.date,$.count)},null,10,Ow))),128))]))),128))]),m[5]||(m[5]=ad('
少多
',1))]),i("div",Mw,[i("div",Iw,[m[6]||(m[6]=i("div",{class:"section-title"},"分类分布",-1)),(x(!0),E(Oe,null,st(o.value,w=>(x(),E("div",{key:w.key,class:"bar-row"},[i("span",jw,F(w.label),1),i("span",Dw,[i("span",{class:"bar-fill",style:pn({width:w.percent+"%"})},null,4)]),i("span",Lw,F(w.count)+" 条 · "+F(w.percent)+"%",1)]))),128)),o.value.length?me("",!0):(x(),E("div",Rw,"暂无数据"))]),i("div",Kw,[m[7]||(m[7]=i("div",{class:"section-title"},"项目投入",-1)),(x(!0),E(Oe,null,st(r.value,w=>(x(),E("div",{key:w.name,class:"bar-row"},[i("span",Nw,F(w.name),1),i("span",Fw,[i("span",{class:"bar-fill",style:pn({width:w.percent+"%"})},null,4)]),i("span",Vw,F(w.count)+" 条 · "+F(w.percent)+"%",1)]))),128)),r.value.length?me("",!0):(x(),E("div",Bw,"暂无数据"))])]),i("div",Uw,[m[8]||(m[8]=i("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(x(!0),E(Oe,null,st(l.value,w=>(x(),E("div",{key:w.name,class:"bar-row"},[i("span",qw,F(w.name),1),i("span",Hw,[i("span",{class:"bar-fill",style:pn({width:w.percent+"%"})},null,4)]),i("span",zw,F(w.count)+" 天 · "+F(w.percent)+"%",1)]))),128)),l.value.length?me("",!0):(x(),E("div",Ww,"暂无数据"))])]))}}),Yw=Vt(Gw,[["__scopeId","data-v-5469ae68"]]);async function Jw(e,t,n){const o=ut(),r=await Promise.all([ms(),Xo(e,t),Qo(e,t),ao(!0),Eh(e,t),Zo()]),l=r[0],u=r[1],f=r[2],v=r[3],y=r[4],m=r[5];let w=0,T=0,$=0;for(const O of u){(O.clock_in_at||O.kind==="makeup")&&w++,O.kind==="makeup"&&$++;const ne=uo(O,O.date,l,O.date===o);T+=ne.workedMinutes??0}const I=new Map;for(const O of u){if(!(O.clock_in_at||O.kind==="makeup"))continue;const ne=O.location||"未记录";I.set(ne,(I.get(ne)||0)+1)}const J=Array.from(I.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,ne)=>ne.count-O.count),ae=f.length||1,de=new Map;for(const O of f)de.set(O.category,(de.get(O.category)||0)+1);const ue=new Set(m);for(const O of de.keys())ue.has(O)||m.push(O);const G=m.map(O=>{const ne=de.get(O)||0;return{key:O,label:O,count:ne,percent:Math.round(ne/ae*100)}}).filter(O=>O.count>0).sort((O,ne)=>ne.count-O.count),S=new Map(v.map(O=>[O.id,O.name])),M=new Map;for(const O of f){const ne=O.project_id?S.get(O.project_id)||"已删除项目":"无项目";M.set(ne,(M.get(ne)||0)+1)}const ee=Array.from(M.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,ne)=>ne.count-O.count),q=f.filter(O=>O.is_milestone===1).map(O=>({date:O.date,content:O.content})),oe=f.filter(O=>O.needs_followup===1).map(O=>({date:O.date,content:O.content,remark:O.remark||""})),j=f.filter(O=>!!O.takeaway).map(O=>({date:O.date,text:O.takeaway})),A=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:w,totalHours:(T/60).toFixed(1),makeupCount:$,leaveCount:u.filter(O=>O.kind==="leave").length,itemCount:f.length,categoryStats:G,projectStats:ee,locationStats:J,milestones:q,followups:oe,takeaways:j,weekNotes:A}}function Xw(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(o=>o.name!=="未记录");n.length&&t.push("其中:"+n.map(o=>o.name+" "+o.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(o=>o.label+" "+o.percent+"%("+o.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(o=>o.name+" "+o.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((o,r)=>t.push(r+1+". 【成果】"+o.content+"("+o.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(o=>t.push("- 【待跟进】"+o.content+(o.remark?"("+o.date+" 备注:"+o.remark+")":"("+o.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(o=>t.push("- "+o.text+"("+o.date+")")):t.push("(无)");for(const o of e.weekNotes)t.push(""),t.push("### 周记("+o.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(o.highlights||"(无)")),t.push("- 踩的坑:"+(o.challenges||"(无)")),t.push("- 下周计划:"+(o.plan_next||"(无)"));return t.push(""),t.join(` -`)}async function Gi(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 Qw(e){const t=await Promise.all([Tt("ai_base_url",""),Tt("ai_api_key",""),Tt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),o=t[1].trim(),r=t[2].trim();if(!n||!r)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const l=n+"/chat/completions",u={"Content-Type":"application/json"};o&&(u.Authorization="Bearer "+o);const v=JSON.stringify({model:r,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(l,{method:"POST",headers:u,body:v})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let T="接口返回 "+y.status;try{const $=await y.json();$&&$.error&&$.error.message&&(T+=":"+$.error.message)}catch{}throw new Error(T)}const m=await y.json(),w=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!w)throw new Error("接口未返回内容");return String(w)}const Zw={class:"report"},e_={class:"report-toolbar"},t_={class:"seg"},n_=["onClick"],s_=["disabled"],o_=["disabled"],r_={key:0,class:"ai-error"},a_={class:"report-grid"},i_={class:"report-left"},l_={class:"card section"},u_={class:"section-title"},c_={class:"muted note-saved"},d_={class:"card section"},f_={class:"report-right"},p_={key:0,class:"card section"},v_={class:"sum-row"},m_={class:"num"},h_={class:"sum-row"},y_={class:"num"},g_={class:"sum-row"},b_={class:"num"},w_={class:"sum-row"},__={class:"num"},k_={class:"sum-row"},C_={class:"num"},x_={class:"muted"},$_={class:"num"},S_={key:0,class:"muted sum-empty"},E_={class:"muted"},A_={key:1,class:"muted sum-empty"},T_={class:"muted"},P_={key:2,class:"muted sum-empty"},O_={class:"muted"},M_={key:3,class:"muted sum-empty"},I_=Kt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=P("week"),o=P(Zs(ut())),r=P(ut()),l=P(null),u=P(""),f=P(!1),v=P(!1),y=P(null),m=P(""),w=P(Zs(ut())),T=P(""),$=P(""),I=P(""),J=P(!1);async function ae(){const oe=await bl(w.value);T.value=(oe==null?void 0:oe.highlights)||"",$.value=(oe==null?void 0:oe.challenges)||"",I.value=(oe==null?void 0:oe.plan_next)||"",J.value=!1}async function de(){await Sh(w.value,{highlights:T.value.trim()||null,challenges:$.value.trim()||null,plan_next:I.value.trim()||null}),J.value=!0,await G()}function ue(oe){const j=ut();if(oe==="week"){const A=Zs(j);return{start:A,end:Ft(A,6),label:"本周"}}if(oe==="month"){const A=j.slice(0,7);return{start:A+"-01",end:j,label:A+" 本月"}}return oe==="all"?{start:"2000-01-01",end:j,label:"全部实习期"}:{start:o.value,end:r.value,label:o.value+" ~ "+r.value}}async function G(){f.value=!0;const oe=ue(n.value),j=await Jw(oe.start,oe.end,oe.label);l.value=j,u.value=Xw(j),f.value=!1}pt(n,G),pt([o,r],()=>{n.value==="custom"&&G()}),cn(async()=>{await ae(),await G()});async function S(){const oe=ut().replace(/-/g,""),j=await Ea("实习工作总结_"+oe+".md",u.value);Ve(j?"总结已导出到:"+j:"总结已导出到系统下载目录")}async function M(){await Gi(u.value),Ve("总结已复制到剪贴板")}async function ee(){if(v.value)return;m.value="";const oe=u.value.trim();if(!oe){m.value="当前草稿为空,无法润色";return}v.value=!0;try{y.value=u.value,u.value=await Qw(oe),Ve("AI 润色完成")}catch(j){y.value=null,m.value=j instanceof Error?j.message:"润色失败"}v.value=!1}function q(){y.value!==null&&(u.value=y.value),y.value=null}return(oe,j)=>(x(),E("div",Zw,[i("div",e_,[i("div",t_,[(x(),E(Oe,null,st(t,A=>i("button",{key:A.key,class:ze(["seg-btn",{active:n.value===A.key}]),onClick:O=>n.value=A.key},F(A.label),11,n_)),64))]),n.value==="custom"?(x(),E(Oe,{key:0},[Pe(i("input",{type:"date",class:"input w-date","onUpdate:modelValue":j[0]||(j[0]=A=>o.value=A)},null,512),[[Le,o.value]]),j[6]||(j[6]=i("span",{class:"muted"},"至",-1)),Pe(i("input",{type:"date",class:"input w-date","onUpdate:modelValue":j[1]||(j[1]=A=>r.value=A)},null,512),[[Le,r.value]])],64)):me("",!0),j[10]||(j[10]=i("span",{class:"flex1"},null,-1)),i("button",{class:"btn btn-sm",disabled:v.value,onClick:ee},[be(He,{name:"edit",size:14}),j[7]||(j[7]=At("AI 润色 ",-1))],8,s_),y.value!==null?(x(),E("button",{key:1,class:"btn btn-sm",onClick:q},"还原润色前")):me("",!0),i("button",{class:"btn btn-sm",disabled:f.value,onClick:G},[be(He,{name:"edit",size:14}),j[8]||(j[8]=At("重新生成 ",-1))],8,o_),i("button",{class:"btn btn-sm",onClick:M},"复制"),i("button",{class:"btn btn-primary btn-sm",onClick:S},[be(He,{name:"export",size:14}),j[9]||(j[9]=At("导出 Markdown ",-1))])]),m.value?(x(),E("div",r_,F(m.value),1)):me("",!0),i("div",a_,[i("div",i_,[i("div",l_,[i("div",u_,"本周周记("+F(w.value)+" 起)",1),j[11]||(j[11]=i("label",{class:"note-label muted"},"本周亮点",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":j[2]||(j[2]=A=>T.value=A),placeholder:"本周最有价值的一件事",onBlur:de},null,544),[[Le,T.value]]),j[12]||(j[12]=i("label",{class:"note-label muted"},"踩的坑",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":j[3]||(j[3]=A=>$.value=A),placeholder:"遇到的问题与教训",onBlur:de},null,544),[[Le,$.value]]),j[13]||(j[13]=i("label",{class:"note-label muted"},"下周计划",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":j[4]||(j[4]=A=>I.value=A),placeholder:"下周准备做什么",onBlur:de},null,544),[[Le,I.value]]),i("div",c_,F(J.value?"已保存":"失焦自动保存"),1)]),i("div",d_,[j[14]||(j[14]=i("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Pe(i("textarea",{class:"textarea md-editor","onUpdate:modelValue":j[5]||(j[5]=A=>u.value=A),spellcheck:"false"},null,512),[[Le,u.value]])])]),i("div",f_,[l.value?(x(),E("div",p_,[j[20]||(j[20]=i("div",{class:"section-title"},"数据摘要",-1)),i("div",v_,[j[15]||(j[15]=i("span",{class:"muted"},"出勤",-1)),i("span",m_,F(l.value.attendDays)+" 天",1)]),i("div",h_,[j[16]||(j[16]=i("span",{class:"muted"},"工时",-1)),i("span",y_,F(l.value.totalHours)+" 小时",1)]),i("div",g_,[j[17]||(j[17]=i("span",{class:"muted"},"补卡",-1)),i("span",b_,F(l.value.makeupCount)+" 次",1)]),i("div",w_,[j[18]||(j[18]=i("span",{class:"muted"},"请假",-1)),i("span",__,F(l.value.leaveCount)+" 天",1)]),i("div",k_,[j[19]||(j[19]=i("span",{class:"muted"},"记录",-1)),i("span",C_,F(l.value.itemCount)+" 条",1)]),j[21]||(j[21]=i("div",{class:"section-sub"},"分类分布",-1)),(x(!0),E(Oe,null,st(l.value.categoryStats,A=>(x(),E("div",{key:A.key,class:"sum-row"},[i("span",x_,F(A.label),1),i("span",$_,F(A.count)+" 条 · "+F(A.percent)+"%",1)]))),128)),l.value.categoryStats.length?me("",!0):(x(),E("div",S_,"(无)")),j[22]||(j[22]=i("div",{class:"section-sub"},"主要成果",-1)),(x(!0),E(Oe,null,st(l.value.milestones,(A,O)=>(x(),E("div",{key:"m"+O,class:"sum-item"},[At(F(A.content),1),i("span",E_,"("+F(A.date)+")",1)]))),128)),l.value.milestones.length?me("",!0):(x(),E("div",A_,"(无)")),j[23]||(j[23]=i("div",{class:"section-sub"},"待跟进",-1)),(x(!0),E(Oe,null,st(l.value.followups,(A,O)=>(x(),E("div",{key:"f"+O,class:"sum-item"},[At(F(A.content),1),i("span",T_,"("+F(A.date)+")",1)]))),128)),l.value.followups.length?me("",!0):(x(),E("div",P_,"(无)")),j[24]||(j[24]=i("div",{class:"section-sub"},"学习与成长",-1)),(x(!0),E(Oe,null,st(l.value.takeaways,(A,O)=>(x(),E("div",{key:"t"+O,class:"sum-item"},[At(F(A.text),1),i("span",O_,"("+F(A.date)+")",1)]))),128)),l.value.takeaways.length?me("",!0):(x(),E("div",M_,"(无)"))])):me("",!0)])])]))}}),j_=Vt(I_,[["__scopeId","data-v-7e1b08ed"]]),D_=["aria-label"],L_={class:"dialog-head"},R_={class:"dialog-title"},K_={class:"dialog-body"},N_={class:"form-grid"},F_={class:"field span2"},V_={class:"seg"},B_={class:"field"},U_={class:"field"},q_={class:"field"},H_=["value"],z_={class:"add-cat"},W_=["onKeydown"],G_={key:0,class:"field span2"},Y_={class:"seg"},J_={class:"field span2"},X_={key:0,class:"form-error"},Q_={class:"dialog-btns"},Z_=Kt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,o=t,r=P("expense"),l=P(""),u=P(""),f=P(""),v=P(""),y=P(!1),m=P(!1),w=P(""),T=P(null);function $(S){n.open&&S.key==="Escape"&&o("cancel")}pt(()=>n.open,async S=>{var M;S?(await J(),r.value=n.initial.type==="income"?"income":"expense",l.value=n.initial.category,u.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,w.value="",window.addEventListener("keydown",$),await Ks(),(M=T.value)==null||M.focus()):window.removeEventListener("keydown",$)}),bn(()=>window.removeEventListener("keydown",$)),pt(r,async()=>{await J(),l.value=I.value[0]||""});const I=P([]);async function J(){I.value=await la(r.value)}const ae=P("");async function de(){const S=ae.value.trim();if(S){if(I.value.includes(S)){ae.value="";return}I.value.push(S),await Wi(r.value,I.value),l.value=S,ae.value=""}}function ue(){return l.value&&I.value.includes(l.value)?l.value:I.value[0]}function G(){const S=String(u.value??"").trim(),M=Number(S);if(!S||!isFinite(M)||M<=0){w.value="请填写大于 0 的金额";return}if(!f.value){w.value="请选择日期";return}const ee=r.value==="expense"&&y.value?1:0;o("save",{type:r.value,category:ue(),amount:Math.round(M*100),date:f.value,note:String(v.value??"").trim(),reimbursable:ee,reimbursed:ee&&m.value?1:0})}return(S,M)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:M[12]||(M[12]=Ut(ee=>o("cancel"),["self"]))},[i("div",{class:"dialog",role:"dialog","aria-label":e.title},[i("div",L_,[i("span",R_,F(e.title),1),i("button",{class:"icon-btn",title:"关闭",onClick:M[0]||(M[0]=ee=>o("cancel"))},[be(He,{name:"close",size:16})])]),i("div",K_,[i("div",N_,[i("div",F_,[M[13]||(M[13]=i("label",null,"类型",-1)),i("div",V_,[i("button",{class:ze(["seg-btn",{active:r.value==="expense"}]),onClick:M[1]||(M[1]=ee=>r.value="expense")},"支出",2),i("button",{class:ze(["seg-btn",{active:r.value==="income"}]),onClick:M[2]||(M[2]=ee=>r.value="income")},"收入",2)])]),i("div",B_,[M[14]||(M[14]=i("label",null,"金额(元)",-1)),Pe(i("input",{ref_key:"amountInput",ref:T,class:ze(["input amt-input",{invalid:w.value}]),"onUpdate:modelValue":M[3]||(M[3]=ee=>u.value=ee),type:"number",min:"0",step:"0.01",placeholder:"0.00",inputmode:"decimal"},null,2),[[Le,u.value]])]),i("div",U_,[M[15]||(M[15]=i("label",null,"日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":M[4]||(M[4]=ee=>f.value=ee)},null,512),[[Le,f.value]])]),i("div",q_,[M[16]||(M[16]=i("label",null,"分类",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":M[5]||(M[5]=ee=>l.value=ee)},[(x(!0),E(Oe,null,st(I.value,ee=>(x(),E("option",{key:ee,value:ee},F(ee),9,H_))),128))],512),[[vs,l.value]]),i("div",z_,[Pe(i("input",{class:"input add-cat-input","onUpdate:modelValue":M[6]||(M[6]=ee=>ae.value=ee),placeholder:"新增分类名",onKeydown:Lt(Ut(de,["prevent"]),["enter"])},null,40,W_),[[Le,ae.value]]),i("button",{class:"btn btn-xs",type:"button",onClick:de},"添加")])]),r.value==="expense"?(x(),E("div",G_,[M[17]||(M[17]=i("label",null,"报销状态",-1)),i("div",Y_,[i("button",{class:ze(["seg-btn",{active:!y.value}]),onClick:M[7]||(M[7]=ee=>{y.value=!1,m.value=!1})},"无需报销",2),i("button",{class:ze(["seg-btn",{active:y.value&&!m.value}]),onClick:M[8]||(M[8]=ee=>{y.value=!0,m.value=!1})},"待报销",2),i("button",{class:ze(["seg-btn",{active:y.value&&m.value}]),onClick:M[9]||(M[9]=ee=>{y.value=!0,m.value=!0})},"已报销",2)])])):me("",!0),i("div",J_,[M[18]||(M[18]=i("label",null,"备注",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":M[10]||(M[10]=ee=>v.value=ee),placeholder:"选填"},null,512),[[Le,v.value]])])]),w.value?(x(),E("div",X_,F(w.value),1)):me("",!0)]),i("div",Q_,[i("button",{class:"btn btn-sm",onClick:M[11]||(M[11]=ee=>o("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:G},"保存")])],8,D_)])):me("",!0)]),_:1})]))}}),e1=Vt(Z_,[["__scopeId","data-v-e9a4e878"]]);function wl(e,t){return qo(e,t-1)}function Hd(e,t){return Ft(qo(e,t),-1)}function Wu(e,t){if(!e||t1&&t[]}},emits:["close","apply","saveAnchor"],setup(e,{emit:t}){const n=e,o=t,r=P(n.mode),l=P(n.month.slice(0,7)),u=P(n.cycleSel),f=P(n.customStart),v=P(n.customEnd),y=P(n.anchor),m=P("");function w(G){G.key==="Escape"&&o("close")}pt(()=>n.open,G=>{G?(r.value=n.mode,l.value=n.month.slice(0,7),u.value=n.cycleSel,f.value=n.customStart,v.value=n.customEnd,y.value=n.anchor,m.value="",window.addEventListener("keydown",w)):window.removeEventListener("keydown",w)}),pt(()=>[n.anchor,n.cycleSel],()=>{y.value=n.anchor,u.value=n.cycleSel}),bn(()=>window.removeEventListener("keydown",w));const T=nt(()=>{const G=new Set(n.months);return G.add(l.value),G.add(ut().slice(0,7)),Array.from(G).sort((S,M)=>Sn.anchor?ua(Ft(n.anchor,-1),n.anchor):"");function I(G){return G.slice(0,4)+" 年 "+Number(G.slice(5,7))+" 月"}function J(G){l.value=G,o("apply",{mode:"month",month:G}),o("close")}function ae(G){u.value=G,o("apply",{mode:"cycle",cycle:G}),o("close")}function de(){y.value&&o("saveAnchor",y.value)}function ue(){if(!f.value||!v.value){m.value="请选择开始和结束日期";return}if(f.value>v.value){m.value="开始日期不能晚于结束日期";return}m.value="",o("apply",{mode:"custom",customStart:f.value,customEnd:v.value}),o("close")}return(G,S)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:S[9]||(S[9]=Ut(M=>o("close"),["self"]))},[i("div",n1,[i("div",s1,[S[10]||(S[10]=i("span",{class:"dialog-title"},"统计周期",-1)),i("button",{class:"icon-btn",title:"关闭",onClick:S[0]||(S[0]=M=>o("close"))},[be(He,{name:"close",size:16})])]),i("div",o1,[i("div",r1,[i("button",{class:ze(["seg-btn",{active:r.value==="month"}]),onClick:S[1]||(S[1]=M=>r.value="month")},"按月",2),i("button",{class:ze(["seg-btn",{active:r.value==="cycle"}]),onClick:S[2]||(S[2]=M=>r.value="cycle")},"按期",2),i("button",{class:ze(["seg-btn",{active:r.value==="custom"}]),onClick:S[3]||(S[3]=M=>r.value="custom")},"自定义",2)]),r.value==="month"?(x(),E("div",a1,[(x(!0),E(Oe,null,st(T.value,M=>(x(),E("button",{key:M,class:ze(["opt",{active:M===l.value}]),onClick:ee=>J(M)},[i("span",null,F(I(M)),1),M===l.value?(x(),Ct(He,{key:0,name:"check-circle",size:15})):me("",!0)],10,i1))),128)),T.value.length?me("",!0):(x(),E("div",l1,"还没有账目记录"))])):r.value==="cycle"?(x(),E("div",u1,[i("div",c1,[S[11]||(S[11]=i("span",{class:"anchor-label"},"账期起点",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":S[4]||(S[4]=M=>y.value=M)},null,512),[[Le,y.value]]),i("button",{class:"btn btn-sm",disabled:!y.value||y.value===e.anchor,onClick:de},"保存",8,d1)]),y.value?y.value!==e.anchor?(x(),E("div",p1,"起点已修改,保存后按新起点重新切分")):me("",!0):(x(),E("div",f1,"填写实习开始日期并保存,自动切分为第 1、2、3…期(每期到下月同日前一天)")),e.anchor?(x(),E(Oe,{key:2},[e.hasBefore?(x(),E("button",{key:0,class:ze(["opt",{active:u.value==="before"}]),onClick:S[5]||(S[5]=M=>ae("before"))},[S[12]||(S[12]=i("span",null,"起点前",-1)),i("span",v1,"~ "+F($.value),1)],2)):me("",!0),(x(!0),E(Oe,null,st(e.cycleCount,M=>(x(),E("button",{key:M,class:ze(["opt",{active:u.value===M}]),onClick:ee=>ae(M)},[i("span",null,"第 "+F(M)+" 期",1),i("span",h1,F(Wt(Yi)(Wt(wl)(e.anchor,M),Wt(Hd)(e.anchor,M))),1)],10,m1))),128))],64)):me("",!0)])):(x(),E("div",y1,[i("div",g1,[i("div",b1,[S[13]||(S[13]=i("label",null,"开始日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":S[6]||(S[6]=M=>f.value=M)},null,512),[[Le,f.value]])]),i("div",w1,[S[14]||(S[14]=i("label",null,"结束日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":S[7]||(S[7]=M=>v.value=M)},null,512),[[Le,v.value]])])]),m.value?(x(),E("div",_1,F(m.value),1)):me("",!0),i("button",{class:"btn btn-primary apply-btn",onClick:ue},"应用区间")]))]),i("div",k1,[i("button",{class:"btn btn-sm",onClick:S[8]||(S[8]=M=>o("close"))},"关闭")])])])):me("",!0)]),_:1})]))}}),x1=Vt(C1,[["__scopeId","data-v-6269639e"]]),$1={class:"ledger-page"},S1={class:"ledger-toolbar"},E1=["disabled"],A1={class:"num"},T1=["disabled"],P1={class:"cards"},O1={class:"card stat-card stat-income"},M1={class:"stat-num num amt-income"},I1={class:"card stat-card stat-expense"},j1={class:"stat-num num"},D1={class:"card stat-card stat-balance"},L1={class:"card stat-card stat-pending"},R1={class:"stat-num num amt-warn"},K1={class:"card sec chart-sec"},N1={key:0,class:"chart-hint muted"},F1={key:1,class:"chart-wrap"},V1={class:"chart"},B1=["title"],U1={class:"chart-bars"},q1={class:"chart-axis"},H1={key:2,class:"empty muted"},z1={key:0,class:"card sec"},W1={class:"sec-head"},G1={class:"seg"},Y1={class:"chip-row"},J1=["onClick"],X1={key:0,class:"sel-strip"},Q1={class:"num"},Z1=["title"],e0={class:"bar-label"},t0={class:"bar-track"},n0={class:"bar-amt num"},s0={class:"bar-pct num muted"},o0={key:1,class:"card section"},r0={class:"form-error"},a0={class:"card table-card"},i0={class:"tx-table"},l0={class:"num","data-label":"日期"},u0={"data-label":"分类"},c0={class:"tag"},d0={class:"td-note","data-label":"备注"},f0={"data-label":"报销"},p0={key:0,class:"muted"},v0={key:1,class:"tx-done"},m0={key:2,class:"tx-pending"},h0={class:"ops-cell"},y0={class:"ops"},g0=["onClick"],b0=["onClick"],w0=["onClick"],_0={key:0},k0={class:"muted table-note num"},Gu="dsh_ledger_mode",Yu="dsh_ledger_cycle",Ju="dsh_ledger_cstart",Xu="dsh_ledger_cend",C0="0000-01-01",x0=Kt({__name:"LedgerView",setup(e){const t=["#3370FF","#23A757","#7A5AF8","#0EA5A0","#E8842C","#D96D5A","#5B7A99","#B56CC6"];function n(V){let te=0;for(let R=0;R>>0;return t[te%t.length]}function o(V){return(V/100).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}const r=P("month"),l=P(ut()),u=P(1),f=P(ut().slice(0,7)+"-01"),v=P(ut()),y=P(""),m=P(!1),w=P([]),T=P([]),$=P(!0),I=P(""),J=P(!1),ae=P(null),de=P({type:"expense",category:"",amountYuan:"",date:ut(),note:"",reimbursable:0,reimbursed:0}),ue=P(null),G=P(!1);function S(V){const te=Number(V.slice(0,4)),R=Number(V.slice(5,7))-1,L=new Date(te,R+1,0).getDate();return V+"-"+(L<10?"0"+L:String(L))}const M=nt(()=>y.value?Math.max(1,Wu(y.value,ut())):1),ee=nt(()=>r.value==="month"?l.value.slice(0,7)+"-01":r.value==="custom"?f.value:y.value?u.value==="before"?C0:wl(y.value,u.value):l.value.slice(0,7)+"-01"),q=nt(()=>r.value==="month"?S(l.value.slice(0,7)):r.value==="custom"?v.value:y.value?u.value==="before"?Ft(y.value,-1):Hd(y.value,u.value):S(l.value.slice(0,7))),oe=nt(()=>r.value==="month"?Number(l.value.slice(0,4))+" 年 "+Number(l.value.slice(5,7))+" 月":r.value==="custom"?Yi(ee.value,q.value):y.value?u.value==="before"?"起点前 · ~ "+ua(Ft(y.value,-1),y.value):"第 "+u.value+" 期 · "+Yi(ee.value,q.value):"按期统计 · 设置起点"),j=nt(()=>r.value==="month"?!0:r.value==="cycle"&&y.value?u.value==="before"?!1:u.value>1||m.value:!1),A=nt(()=>r.value==="month"?!0:r.value==="cycle"&&y.value?u.value==="before"?!0:u.valueM.value)){if(te<1){m.value&&(u.value="before");return}u.value=te}}const ne=nt(()=>r.value==="month"?l.value.slice(0,7)!==ut().slice(0,7):r.value==="cycle"?!!y.value&&u.value!==M.value:!1);function Ie(){r.value==="cycle"?u.value=M.value:l.value=ut()}async function Se(){$.value=!0;try{T.value=await Gh(ee.value,q.value),I.value=""}catch(V){I.value="账目加载失败:"+(V instanceof Error?V.stack||V.message:String(V)),Ve("账目加载失败")}$.value=!1}cn(async()=>{const V=localStorage.getItem(Gu);(V==="month"||V==="cycle"||V==="custom")&&(r.value=V);const te=localStorage.getItem(Ju),R=localStorage.getItem(Xu);te&&R&&te<=R&&(f.value=te,v.value=R);const L=localStorage.getItem(Yu);L==="before"?u.value="before":L&&Number(L)>=1&&(u.value=Number(L)),y.value=await Tt("ledger.anchor",""),u.value!=="before"&&u.value>M.value&&(u.value=M.value),await Se()}),pt([ee,q],()=>{it.value=[],Se()}),pt(r,V=>localStorage.setItem(Gu,V)),pt(u,V=>localStorage.setItem(Yu,String(V))),pt([f,v],([V,te])=>{localStorage.setItem(Ju,V),localStorage.setItem(Xu,te)});async function _e(){try{w.value=await Zh(),m.value=y.value?await Uu(y.value)>0:!1}catch{}G.value=!0}function Me(V){r.value=V.mode,V.month&&(l.value=V.month+"-01"),V.cycle!==void 0&&(u.value=V.cycle),V.customStart&&(f.value=V.customStart),V.customEnd&&(v.value=V.customEnd)}async function qe(V){y.value=V,await Nt("ledger.anchor",V),r.value="cycle",u.value=Math.max(1,Wu(V,ut()));try{m.value=await Uu(V)>0}catch{}Ve("账期起点已保存,已按新起点切分期数")}const Ue=P([]);async function tt(){Ue.value=await la("expense")}tt();const Ye=nt(()=>T.value.slice().sort((V,te)=>V.date===te.date?te.id-V.id:V.date{let V=0,te=0,R=0;for(const L of T.value)L.type==="income"?V+=L.amount:(te+=L.amount,L.reimbursable===1&&L.reimbursed!==1&&(R+=L.amount));return{income:V,expense:te,pending:R,balance:V-te}}),le=P(""),Q=nt(()=>{le.value="";const V=[],te=ee.value,R=q.value;if(!te||!R||te>R)return V;const L=Math.round((Gn(R).getTime()-Gn(te).getTime())/864e5)+1,fe=new Map,je=new Map;for(const et of T.value){const Bt=fe.get(et.date)||{i:0,e:0};et.type==="income"?Bt.i+=et.amount:Bt.e+=et.amount,fe.set(et.date,Bt);const bt=et.date.slice(0,7),wt=je.get(bt)||{i:0,e:0};et.type==="income"?wt.i+=et.amount:wt.e+=et.amount,je.set(bt,wt)}let Je=[],ft="day";if(L<=92){let et=te,Bt=0;for(;et<=R&&Bt<4e3;)Je.push(et),et=Ft(et,1),Bt++}else{ft="month";let et=te.slice(0,7);const Bt=R.slice(0,7);let bt=0;for(;et<=Bt&&bt<600;){Je.push(et);const wt=Number(et.slice(0,4)),Ne=Number(et.slice(5,7))-1,rn=new Date(wt,Ne+1,1);et=rn.getFullYear()+"-"+(rn.getMonth()+1<10?"0"+(rn.getMonth()+1):String(rn.getMonth()+1)),bt++}}if(!Je.length)return V;Je.length>120&&(ft==="day"?le.value="时间跨度较长,仅展示最近 120 天":le.value="时间跨度较长,仅展示最近 120 个月",Je=Je.slice(-120));const It=ft==="day"?fe:je,Ze=Math.max(1,Math.ceil(Je.length/8));return Je.forEach((et,Bt)=>{const bt=It.get(et)||{i:0,e:0};let wt="",Ne="";ft==="day"?(wt=Number(et.slice(5,7))+"."+Number(et.slice(8,10)),Ne=et+" · 支出 "+o(bt.e)+" · 收入 "+o(bt.i)):(wt=et.slice(2,4)+"."+Number(et.slice(5,7)),Ne=Number(et.slice(0,4))+" 年 "+Number(et.slice(5,7))+" 月 · 支出 "+o(bt.e)+" · 收入 "+o(bt.i)),V.push({label:wt,tip:Ne,income:bt.i,expense:bt.e,showLabel:Bt%Ze===0||Bt===Je.length-1})}),V}),Ae=nt(()=>{let V=0;for(const te of Q.value)V=Math.max(V,te.income,te.expense);return V||1}),lt=P("expense"),it=P([]);pt(lt,()=>{it.value=[]});function Te(V){const te=it.value.indexOf(V);te>=0?it.value.splice(te,1):it.value=[...it.value,V]}const kt=nt(()=>{const V=new Map;for(const te of T.value){if(te.type!==lt.value)continue;const R=V.get(te.category)||{name:te.category,amount:0,count:0};R.amount+=te.amount,R.count++,V.set(te.category,R)}return Array.from(V.values()).sort((te,R)=>R.amount-te.amount)}),xt=nt(()=>kt.value.reduce((V,te)=>V+te.amount,0)),Ke=nt(()=>kt.value.map(V=>({...V,color:n(V.name),percent:xt.value?Math.round(V.amount/xt.value*100):0,dim:it.value.length>0&&!it.value.includes(V.name)}))),_=nt(()=>{if(!it.value.length)return null;let V=0,te=0;for(const R of T.value)R.type!==lt.value||!it.value.includes(R.category)||(V+=R.amount,te++);return{cats:it.value.length,count:te,amount:V,percent:xt.value?Math.round(V/xt.value*100):0}}),g=P("all"),C=P("all"),D=nt(()=>Ye.value.filter(V=>!(g.value!=="all"&&V.type!==g.value||it.value.length&&!it.value.includes(V.category)||C.value==="pending"&&!(V.type==="expense"&&V.reimbursable===1&&V.reimbursed!==1)||C.value==="done"&&!(V.reimbursable===1&&V.reimbursed===1))));function re(V){return o(V)}function pe(V){return(V.type==="income"?"+":"-")+o(V.amount)}async function xe(V){await Qh(V.id),await Se(),Ve("已标记为已报销")}function we(V){ae.value=V.id,de.value={type:V.type,category:V.category,amountYuan:re(V.amount).replace(/,/g,""),date:V.date,note:V.note||"",reimbursable:V.reimbursable,reimbursed:V.reimbursed},J.value=!0}function ke(){ae.value=null,de.value={type:"expense",category:Ue.value[0]||"",amountYuan:"",date:ut(),note:"",reimbursable:0,reimbursed:0},J.value=!0}async function ve(V){if(ae.value){await Jh(ae.value,V),J.value=!1,await Se(),Ve("账目已更新");return}await Yh({type:V.type,category:V.category,amount:V.amount,date:V.date,note:V.note,reimbursable:V.reimbursable,reimbursed:V.reimbursed}),J.value=!1,await Se(),Ve("已记一笔")}async function Re(){ue.value&&ue.value.id&&await Xh(ue.value.id),ue.value=null,await Se(),Ve("账目已删除")}return(V,te)=>(x(),E("div",$1,[i("div",S1,[r.value!=="custom"?(x(),E("button",{key:0,class:"icon-btn",disabled:!j.value,title:"上一周期",onClick:te[0]||(te[0]=R=>O(-1))},[be(He,{name:"chevron-left",size:16})],8,E1)):me("",!0),i("button",{class:"period-title",title:"选择统计周期",onClick:_e},[i("span",A1,F(oe.value),1),be(He,{name:"chevron-down",size:14})]),r.value!=="custom"?(x(),E("button",{key:1,class:"icon-btn",disabled:!A.value,title:"下一周期",onClick:te[1]||(te[1]=R=>O(1))},[be(He,{name:"chevron-right",size:16})],8,T1)):me("",!0),ne.value?(x(),E("button",{key:2,class:"btn btn-sm",onClick:Ie},F(r.value==="cycle"?"回到本期":"回到本月"),1)):me("",!0),te[13]||(te[13]=i("span",{class:"flex1"},null,-1)),Pe(i("select",{class:"select w-filter","onUpdate:modelValue":te[2]||(te[2]=R=>g.value=R)},[...te[10]||(te[10]=[i("option",{value:"all"},"全部类型",-1),i("option",{value:"expense"},"仅支出",-1),i("option",{value:"income"},"仅收入",-1)])],512),[[vs,g.value]]),Pe(i("select",{class:"select w-filter","onUpdate:modelValue":te[3]||(te[3]=R=>C.value=R)},[...te[11]||(te[11]=[i("option",{value:"all"},"全部报销",-1),i("option",{value:"pending"},"待报销",-1),i("option",{value:"done"},"已报销",-1)])],512),[[vs,C.value]]),i("button",{class:"btn btn-primary btn-sm",onClick:ke},[be(He,{name:"plus",size:14}),te[12]||(te[12]=At(" 记一笔",-1))])]),i("div",P1,[i("div",O1,[te[14]||(te[14]=i("div",{class:"muted"},"本期收入(元)",-1)),i("div",M1,F(re(We.value.income)),1)]),i("div",I1,[te[15]||(te[15]=i("div",{class:"muted"},"本期支出(元)",-1)),i("div",j1,F(re(We.value.expense)),1)]),i("div",D1,[te[16]||(te[16]=i("div",{class:"muted"},"本期结余(元)",-1)),i("div",{class:ze(["stat-num num",{"amt-income":We.value.balance>=0,"amt-expense":We.value.balance<0}])},F(re(We.value.balance)),3)]),i("div",L1,[te[17]||(te[17]=i("div",{class:"muted"},"待报销(元)",-1)),i("div",R1,F(re(We.value.pending)),1)])]),i("div",K1,[te[18]||(te[18]=ad('
每日收支收入 支出
',1)),le.value?(x(),E("div",N1,F(le.value),1)):me("",!0),Q.value.length?(x(),E("div",F1,[i("div",V1,[(x(!0),E(Oe,null,st(Q.value,(R,L)=>(x(),E("div",{key:L,class:"chart-col",title:R.tip},[i("div",U1,[i("div",{class:"cbar cbar-income",style:pn({height:Math.round(R.income/Ae.value*100)+"%"})},null,4),i("div",{class:"cbar cbar-expense",style:pn({height:Math.round(R.expense/Ae.value*100)+"%"})},null,4)])],8,B1))),128))]),i("div",q1,[(x(!0),E(Oe,null,st(Q.value,(R,L)=>(x(),E("span",{key:L,class:"chart-label num"},F(R.showLabel?R.label:""),1))),128))])])):(x(),E("div",H1,"本周期暂无账目"))]),kt.value.length?(x(),E("div",z1,[i("div",W1,[te[19]||(te[19]=i("span",{class:"sec-title"},"分类统计",-1)),i("div",G1,[i("button",{class:ze(["seg-btn",{active:lt.value==="expense"}]),onClick:te[4]||(te[4]=R=>lt.value="expense")},"支出",2),i("button",{class:ze(["seg-btn",{active:lt.value==="income"}]),onClick:te[5]||(te[5]=R=>lt.value="income")},"收入",2)])]),i("div",Y1,[i("button",{class:ze(["chip",{active:!it.value.length}]),onClick:te[6]||(te[6]=R=>it.value=[])},"全部",2),(x(!0),E(Oe,null,st(kt.value,R=>(x(),E("button",{key:R.name,class:ze(["chip",{active:it.value.includes(R.name)}]),onClick:L=>Te(R.name)},F(R.name),11,J1))),128))]),_.value?(x(),E("div",X1,[i("span",null,"已选 "+F(_.value.cats)+" 类 · "+F(_.value.count)+" 笔",1),i("span",Q1,F(re(_.value.amount))+" 元 · 占本期"+F(lt.value==="expense"?"支出":"收入")+" "+F(_.value.percent)+"%",1)])):me("",!0),(x(!0),E(Oe,null,st(Ke.value,R=>(x(),E("div",{key:R.name,class:ze(["bar-row",{dim:R.dim}]),title:R.count+" 笔"},[i("i",{class:"cat-dot",style:pn({background:R.color})},null,4),i("span",e0,F(R.name),1),i("span",t0,[i("span",{class:"bar-fill",style:pn({width:R.percent+"%",background:R.color})},null,4)]),i("span",n0,F(re(R.amount)),1),i("span",s0,F(R.percent)+"%",1)],10,Z1))),128))])):me("",!0),I.value?(x(),E("div",o0,[i("div",r0,F(I.value),1),te[20]||(te[20]=i("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):me("",!0),i("div",a0,[i("table",i0,[te[22]||(te[22]=i("thead",null,[i("tr",null,[i("th",null,"日期"),i("th",null,"分类"),i("th",null,"金额(元)"),i("th",null,"备注"),i("th",null,"报销"),i("th",{class:"th-ops"},"操作")])],-1)),i("tbody",null,[(x(!0),E(Oe,null,st(D.value,R=>(x(),E("tr",{key:R.id},[i("td",l0,F(R.date),1),i("td",u0,[i("span",c0,F(R.category),1)]),i("td",{class:ze(["num",R.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},F(pe(R)),3),i("td",d0,F(R.note||"--"),1),i("td",f0,[R.type!=="expense"||R.reimbursable!==1?(x(),E("span",p0,"--")):R.reimbursed===1?(x(),E("span",v0,"已报销")):(x(),E("span",m0,"待报销"))]),i("td",h0,[i("div",y0,[R.type==="expense"&&R.reimbursable===1&&R.reimbursed!==1?(x(),E("button",{key:0,class:"btn btn-xs",onClick:L=>xe(R)},"标记已报销",8,g0)):me("",!0),i("button",{class:"btn btn-xs",onClick:L=>we(R)},"编辑",8,b0),i("button",{class:"btn btn-xs",onClick:L=>ue.value=R},"删除",8,w0)])])]))),128)),!D.value.length&&!$.value?(x(),E("tr",_0,[...te[21]||(te[21]=[i("td",{colspan:"6",class:"empty muted"},"该周期暂无账目",-1)])])):me("",!0)])])]),i("div",k0,"本期 "+F(T.value.length)+" 条 · 当前筛选 "+F(D.value.length)+" 条",1),be(e1,{open:J.value,title:ae.value?"编辑账目":"记一笔",initial:de.value,onCancel:te[7]||(te[7]=R=>J.value=!1),onSave:ve},null,8,["open","title","initial"]),be(x1,{open:G.value,mode:r.value,anchor:y.value,month:l.value,"cycle-sel":u.value,"custom-start":f.value,"custom-end":v.value,"cycle-count":M.value,"has-before":m.value,months:w.value,onClose:te[8]||(te[8]=R=>G.value=!1),onApply:Me,onSaveAnchor:qe},null,8,["open","mode","anchor","month","cycle-sel","custom-start","custom-end","cycle-count","has-before","months"]),be(xn,{open:!!ue.value,title:"删除确认",message:ue.value?"将删除 "+ue.value.date+" 的账目("+ue.value.category+" "+re(ue.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:te[9]||(te[9]=R=>ue.value=null),onConfirm:Re},null,8,["open","message"])]))}}),$0=Vt(x0,[["__scopeId","data-v-f021b1ed"]]),S0={class:"memo-page"},E0={class:"card memo-list"},A0={class:"pane-head"},T0={class:"pane-title"},P0={class:"memo-scroll"},O0=["onClick"],M0={class:"memo-item-title"},I0={class:"muted memo-item-sub"},j0={class:"muted num memo-item-time"},D0={key:0,class:"muted empty"},L0={class:"card memo-editor"},R0={class:"editor-foot"},K0={class:"muted foot-info"},N0=["disabled"],F0=["disabled"],V0={key:1,class:"empty muted editor-empty"},B0=Kt({__name:"MemoView",setup(e){const t=P([]),n=P(null),o=P(!1),r=P(""),l=P(""),u=P(null),f=P(null);async function v(){if(t.value=await Bh(),n.value&&n.value.id){const ee=t.value.find(q=>q.id===n.value.id);ee&&(n.value=ee)}}cn(async()=>{await v(),t.value.length&&w(t.value[0]),window.addEventListener("keydown",y)}),bn(()=>window.removeEventListener("keydown",y)),pt(Vi,async ee=>{if(!ee)return;t.value.length||await v();const q=t.value.find(oe=>oe.id===ee);Vi.value=null,q&&T(q)},{immediate:!0});function y(ee){(ee.ctrlKey||ee.metaKey)&&ee.key.toLowerCase()==="s"&&o.value&&m.value&&(ee.preventDefault(),ae())}const m=nt(()=>{if(!o.value)return!1;const ee=n.value?n.value.title:"",q=n.value?n.value.content:"";return r.value!==ee||l.value!==q});function w(ee){n.value=ee,o.value=!0,r.value=ee.title,l.value=ee.content}function T(ee){if(!(o.value&&n.value&&n.value.id===ee.id)){if(m.value){f.value={type:"select",memo:ee};return}w(ee)}}function $(){if(m.value){f.value={type:"new"};return}I()}function I(){n.value=null,o.value=!0,r.value="",l.value=""}function J(){n.value?w(n.value):I()}async function ae(){if(!r.value.trim()&&!l.value.trim()){Ve("标题与内容不能都为空");return}if(n.value&&n.value.id)await qh(n.value.id,r.value,l.value),Ve("备忘已保存");else{const ee=await Uh(r.value,l.value);n.value=ee,r.value=ee.title,l.value=ee.content,Ve("备忘已创建")}await v()}function de(){n.value&&n.value.id&&(u.value=n.value)}async function ue(){u.value&&u.value.id&&(await Hh(u.value.id),Ve("备忘已删除")),u.value=null,await v(),I()}function G(){const ee=f.value;f.value=null,ee&&(ee.type==="select"?w(ee.memo):I())}function S(ee){return(ee.content||"").replace(/\s+/g," ").slice(0,30)}function M(ee){return ee.replace("T"," ").slice(0,16)}return(ee,q)=>(x(),E("div",S0,[i("aside",E0,[i("div",A0,[i("span",T0,"备忘录("+F(t.value.length)+")",1),i("button",{class:"btn btn-primary btn-sm",onClick:$},"新建")]),i("div",P0,[(x(!0),E(Oe,null,st(t.value,oe=>(x(),E("div",{key:oe.id,class:ze(["memo-item",{active:o.value&&n.value&&n.value.id===oe.id}]),onClick:j=>T(oe)},[i("div",M0,F(oe.title||"无标题"),1),i("div",I0,F(S(oe)||"空"),1),i("div",j0,F(M(oe.updated_at)),1)],10,O0))),128)),t.value.length?me("",!0):(x(),E("div",D0,"暂无备忘"))])]),i("section",L0,[o.value?(x(),E(Oe,{key:0},[Pe(i("input",{class:"input title-input","onUpdate:modelValue":q[0]||(q[0]=oe=>r.value=oe),placeholder:"标题"},null,512),[[Le,r.value]]),Pe(i("textarea",{class:"textarea content-textarea","onUpdate:modelValue":q[1]||(q[1]=oe=>l.value=oe),placeholder:"内容"},null,512),[[Le,l.value]]),i("div",R0,[i("span",K0,[m.value?(x(),E(Oe,{key:0},[At("有未保存修改")],64)):n.value&&n.value.id?(x(),E(Oe,{key:1},[At("更新于 "+F(M(n.value.updated_at)),1)],64)):(x(),E(Oe,{key:2},[At("新备忘")],64))]),q[4]||(q[4]=i("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(x(),E("button",{key:0,class:"btn btn-sm",onClick:de},"删除")):me("",!0),i("button",{class:"btn btn-sm",disabled:!m.value,onClick:J},"放弃修改",8,N0),i("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:ae},"保存",8,F0)])],64)):(x(),E("div",V0,"选择左侧备忘,或点击右上角新建"))]),be(xn,{open:!!u.value,title:"删除确认",message:u.value?"将删除备忘「"+(u.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:q[2]||(q[2]=oe=>u.value=null),onConfirm:ue},null,8,["open","message"]),be(xn,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:q[3]||(q[3]=oe=>f.value=null),onConfirm:G},null,8,["open"])]))}}),U0=Vt(B0,[["__scopeId","data-v-a0931fc7"]]),q0=["aria-label"],H0={class:"dialog-head"},z0={class:"dialog-title"},W0={class:"dialog-body"},G0={class:"form-grid"},Y0={class:"field span2"},J0={class:"field span2"},X0={class:"field span2"},Q0={class:"pwd-row"},Z0={class:"field span2"},ek={key:0,class:"form-error"},tk={class:"dialog-btns"},nk=Kt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,o=t,r=P(""),l=P(""),u=P(""),f=P(""),v=P(""),y=P(null);function m($){n.open&&$.key==="Escape"&&o("cancel")}pt(()=>n.open,async $=>{var I;$?(r.value=n.initial.system,l.value=n.initial.account,u.value=n.initial.password,f.value=n.initial.remark,v.value="",window.addEventListener("keydown",m),await Ks(),(I=y.value)==null||I.focus()):window.removeEventListener("keydown",m)}),bn(()=>window.removeEventListener("keydown",m));function w(){const $="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",I="!@#$%^&*",J=crypto.getRandomValues(new Uint8Array(14));let ae="";for(let de=0;de(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:I[6]||(I[6]=Ut(J=>o("cancel"),["self"]))},[i("div",{class:"dialog",role:"dialog","aria-label":e.title},[i("div",H0,[i("span",z0,F(e.title),1),i("button",{class:"icon-btn",title:"关闭",onClick:I[0]||(I[0]=J=>o("cancel"))},[be(He,{name:"close",size:16})])]),i("div",W0,[i("div",G0,[i("div",Y0,[I[7]||(I[7]=i("label",null,"系统名称(必填)",-1)),Pe(i("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":I[1]||(I[1]=J=>r.value=J),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Le,r.value]])]),i("div",J0,[I[8]||(I[8]=i("label",null,"账号(必填)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":I[2]||(I[2]=J=>l.value=J),placeholder:"用户名、工号或邮箱"},null,512),[[Le,l.value]])]),i("div",X0,[I[9]||(I[9]=i("label",null,"密码(必填)",-1)),i("div",Q0,[Pe(i("input",{class:"input","onUpdate:modelValue":I[3]||(I[3]=J=>u.value=J),placeholder:"输入或点击生成"},null,512),[[Le,u.value]]),i("button",{class:"btn btn-sm",onClick:w},"生成")])]),i("div",Z0,[I[10]||(I[10]=i("label",null,"备注",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":I[4]||(I[4]=J=>f.value=J),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Le,f.value]])])]),v.value?(x(),E("div",ek,F(v.value),1)):me("",!0)]),i("div",tk,[i("button",{class:"btn btn-sm",onClick:I[5]||(I[5]=J=>o("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:T},"保存")])],8,q0)])):me("",!0)]),_:1})]))}}),sk=Vt(nk,[["__scopeId","data-v-2eafe20e"]]),ok={class:"vault-page"},rk={key:0,class:"empty muted"},ak={key:1,class:"card lock-card"},ik={class:"lock-badge"},lk={key:0,class:"form-error"},uk=["disabled"],ck={key:0,class:"form-error"},dk=["disabled"],fk={class:"vault-toolbar"},pk={class:"search-wrap"},vk={class:"card table-card"},mk={class:"cred-table"},hk={class:"td-system"},yk=["onClick"],gk={class:"pwd-cell"},bk={class:"num pwd-text"},wk=["onClick"],_k=["onClick"],kk={class:"td-remark"},Ck={class:"td-ops"},xk={class:"ops"},$k=["onClick"],Sk=["onClick"],Ek={key:0},Ak={class:"muted table-note num"},Tk={class:"dialog pwd-dialog"},Pk={class:"dialog-head"},Ok={class:"dialog-body"},Mk={class:"vp-field"},Ik={class:"vp-field"},jk={class:"vp-field"},Dk={key:0,class:"form-error"},Lk={class:"dialog-btns"},Rk=5*60*1e3,Kk=Kt({__name:"VaultView",setup(e){const t=P(null),n=P(km()),o=P(!1),r=P(""),l=P(""),u=P(""),f=P(""),v=P(""),y=P([]),m=P(""),w=P({}),T=P(!1),$=P(null),I=P({system:"",account:"",password:"",remark:""}),J=P(null),ae=P(!1),de=P(""),ue=P(""),G=P(""),S=P("");async function M(){y.value=await Em(),w.value={}}let ee=null;function q(){ee!==null&&window.clearTimeout(ee),ee=window.setTimeout(()=>{n.value&&(sa(),n.value=!1,y.value=[],w.value={},Ve("长时间未操作,密码库已自动锁定"))},Rk)}function oe(){n.value&&q()}cn(async()=>{t.value=await _d(),window.addEventListener("click",oe),window.addEventListener("keydown",oe),n.value&&q()}),bn(()=>{window.removeEventListener("click",oe),window.removeEventListener("keydown",oe),ee!==null&&window.clearTimeout(ee)});const j=nt(()=>{const le=m.value.trim().toLowerCase();return le?y.value.filter(Q=>(Q.system+" "+Q.account+" "+(Q.remark||"")).toLowerCase().includes(le)):y.value});async function A(){if(!o.value){if(u.value="",!r.value){u.value="请输入主密码";return}if(r.value.length<6){u.value="主密码至少 6 位";return}if(r.value!==l.value){u.value="两次输入的主密码不一致";return}o.value=!0;try{await Cm(r.value),r.value="",l.value="",n.value=!0,q(),await M(),Ve("主密码已设置,密码库已解锁")}catch(le){u.value=le instanceof Error?le.message:"设置失败"}o.value=!1}}async function O(){if(!o.value){if(v.value="",!f.value){v.value="请输入主密码";return}o.value=!0;try{await xm(f.value),f.value="",n.value=!0,q(),await M()}catch(le){v.value=le instanceof Error?le.message:"解锁失败"}o.value=!1}}function ne(){sa(),n.value=!1,y.value=[],w.value={},ee!==null&&window.clearTimeout(ee),Ve("密码库已锁定")}async function Ie(le){const Q=le.id;if(w.value[Q]){w.value[Q]=!1;return}try{le.passwordPlain=await gi(Q),w.value[Q]=!0}catch(Ae){Ve(Ae instanceof Error?Ae.message:"解密失败")}}async function Se(le){try{const Q=await gi(le.id);await Gi(Q),Ve("密码已复制")}catch(Q){Ve(Q instanceof Error?Q.message:"复制失败")}}async function _e(le){await Gi(le.account),Ve("账号已复制")}function Me(){$.value=null,I.value={system:"",account:"",password:"",remark:""},T.value=!0}async function qe(le){try{const Q=await gi(le.id);$.value=le.id,I.value={system:le.system,account:le.account,password:Q,remark:le.remark||""},T.value=!0}catch(Q){Ve(Q instanceof Error?Q.message:"解密失败")}}async function Ue(le){const Q=$.value??void 0;await Am(le,Q),T.value=!1,await M(),Ve(Q?"账号已更新":"账号已添加")}async function tt(){J.value&&J.value.id&&(await Tm(J.value.id),Ve("账号已删除")),J.value=null,await M()}function Ye(){de.value="",ue.value="",G.value="",S.value="",ae.value=!0}async function We(){S.value="";try{const le=await Pm(de.value,ue.value);ae.value=!1,de.value="",ue.value="",G.value="",Ve("主密码已修改,"+le+" 条账号密码已重新加密")}catch(le){S.value=le instanceof Error?le.message:"修改失败"}}return(le,Q)=>(x(),E("div",ok,[t.value===null?(x(),E("div",rk,"加载中")):n.value?(x(),E(Oe,{key:2},[i("div",fk,[i("div",pk,[be(He,{name:"search",size:14,class:"search-icon"}),Pe(i("input",{class:"input","onUpdate:modelValue":Q[3]||(Q[3]=Ae=>m.value=Ae),placeholder:"搜索系统名称、账号或备注"},null,512),[[Le,m.value]])]),Q[16]||(Q[16]=i("span",{class:"flex1"},null,-1)),i("button",{class:"btn btn-sm",onClick:Ye},"修改主密码"),i("button",{class:"btn btn-sm",onClick:ne},"锁定"),i("button",{class:"btn btn-primary btn-sm",onClick:Me},"新增账号")]),i("div",vk,[i("table",mk,[Q[18]||(Q[18]=i("thead",null,[i("tr",null,[i("th",null,"系统名称"),i("th",null,"账号"),i("th",null,"密码"),i("th",null,"备注"),i("th",{class:"th-ops"},"操作")])],-1)),i("tbody",null,[(x(!0),E(Oe,null,st(j.value,Ae=>(x(),E("tr",{key:Ae.id},[i("td",hk,F(Ae.system),1),i("td",null,[i("span",{class:"copyable",title:"点击复制账号",onClick:lt=>_e(Ae)},F(Ae.account),9,yk)]),i("td",null,[i("div",gk,[i("span",bk,F(w.value[Ae.id]?Ae.passwordPlain:"........"),1),i("button",{class:"btn btn-xs",onClick:lt=>Ie(Ae)},F(w.value[Ae.id]?"隐藏":"显示"),9,wk),i("button",{class:"btn btn-xs",onClick:lt=>Se(Ae)},"复制",8,_k)])]),i("td",kk,F(Ae.remark||"--"),1),i("td",Ck,[i("div",xk,[i("button",{class:"btn btn-xs",onClick:lt=>qe(Ae)},"编辑",8,$k),i("button",{class:"btn btn-xs",onClick:lt=>J.value=Ae},"删除",8,Sk)])])]))),128)),j.value.length?me("",!0):(x(),E("tr",Ek,[...Q[17]||(Q[17]=[i("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),i("div",Ak,"共 "+F(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):(x(),E("div",ak,[i("div",ik,[be(He,{name:"lock",size:26})]),t.value===!1?(x(),E(Oe,{key:0},[Q[12]||(Q[12]=i("div",{class:"lock-title"},"设置主密码",-1)),Q[13]||(Q[13]=i("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[0]||(Q[0]=Ae=>r.value=Ae),placeholder:"设置主密码(至少 6 位)",onKeydown:Lt(A,["enter"])},null,544),[[Le,r.value]]),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[1]||(Q[1]=Ae=>l.value=Ae),placeholder:"再次输入主密码",onKeydown:Lt(A,["enter"])},null,544),[[Le,l.value]]),u.value?(x(),E("div",lk,F(u.value),1)):me("",!0),i("button",{class:"btn btn-primary lock-btn",disabled:o.value,onClick:A},"完成设置并解锁",8,uk)],64)):(x(),E(Oe,{key:1},[Q[14]||(Q[14]=i("div",{class:"lock-title"},"密码库已锁定",-1)),Q[15]||(Q[15]=i("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[2]||(Q[2]=Ae=>f.value=Ae),placeholder:"主密码",onKeydown:Lt(O,["enter"])},null,544),[[Le,f.value]]),v.value?(x(),E("div",ck,F(v.value),1)):me("",!0),i("button",{class:"btn btn-primary lock-btn",disabled:o.value,onClick:O},"解锁",8,dk)],64))])),be(sk,{open:T.value,title:$.value?"编辑账号":"新增账号",initial:I.value,onCancel:Q[4]||(Q[4]=Ae=>T.value=!1),onSave:Ue},null,8,["open","title","initial"]),be(xn,{open:!!J.value,title:"删除确认",message:J.value?"将删除系统「"+J.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Q[5]||(Q[5]=Ae=>J.value=null),onConfirm:tt},null,8,["open","message"]),(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[ae.value?(x(),E("div",{key:0,class:"mask",onClick:Q[11]||(Q[11]=Ut(Ae=>ae.value=!1,["self"]))},[i("div",Tk,[i("div",Pk,[Q[19]||(Q[19]=i("span",{class:"dialog-title"},"修改主密码",-1)),i("button",{class:"icon-btn",title:"关闭",onClick:Q[6]||(Q[6]=Ae=>ae.value=!1)},[be(He,{name:"close",size:16})])]),i("div",Ok,[i("div",Mk,[Q[20]||(Q[20]=i("label",null,"旧主密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[7]||(Q[7]=Ae=>de.value=Ae)},null,512),[[Le,de.value]])]),i("div",Ik,[Q[21]||(Q[21]=i("label",null,"新主密码(至少 6 位)",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[8]||(Q[8]=Ae=>ue.value=Ae)},null,512),[[Le,ue.value]])]),i("div",jk,[Q[22]||(Q[22]=i("label",null,"确认新主密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[9]||(Q[9]=Ae=>G.value=Ae)},null,512),[[Le,G.value]])]),S.value?(x(),E("div",Dk,F(S.value),1)):me("",!0),Q[23]||(Q[23]=i("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),i("div",Lk,[i("button",{class:"btn btn-sm",onClick:Q[10]||(Q[10]=Ae=>ae.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:We},"确认修改")])])])):me("",!0)]),_:1})]))]))}}),Nk=Vt(Kk,[["__scopeId","data-v-6d2745bc"]]),Fk=["aria-label"],Vk={class:"dialog-head"},Bk={class:"dialog-title"},Uk={class:"dialog-body"},qk={class:"field"},Hk={key:0},zk=["placeholder"],Wk={key:1,class:"form-error"},Gk={class:"dialog-btns"},Yk=Kt({__name:"InputDialog",props:{open:{type:Boolean},title:{},label:{default:""},placeholder:{default:""},initial:{default:""},confirmText:{default:"确定"},validate:{}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,o=t,r=P(""),l=P(""),u=P(null);function f(y){n.open&&y.key==="Escape"&&o("cancel")}pt(()=>n.open,async y=>{var m,w;y?(r.value=n.initial,l.value="",window.addEventListener("keydown",f),await Ks(),(m=u.value)==null||m.focus(),(w=u.value)==null||w.select()):window.removeEventListener("keydown",f)}),bn(()=>window.removeEventListener("keydown",f));function v(){const y=r.value.trim();if(!y){l.value="请输入内容";return}const m=n.validate?n.validate(y):null;if(m){l.value=m;return}o("confirm",y)}return(y,m)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:m[3]||(m[3]=Ut(w=>o("cancel"),["self"]))},[i("div",{class:"dialog input-dialog",role:"dialog","aria-label":e.title},[i("div",Vk,[i("span",Bk,F(e.title),1),i("button",{class:"icon-btn",title:"关闭",onClick:m[0]||(m[0]=w=>o("cancel"))},[be(He,{name:"close",size:16})])]),i("div",Uk,[i("div",qk,[e.label?(x(),E("label",Hk,F(e.label),1)):me("",!0),Pe(i("input",{ref_key:"input",ref:u,class:ze(["input",{invalid:l.value}]),"onUpdate:modelValue":m[1]||(m[1]=w=>r.value=w),placeholder:e.placeholder,maxlength:"20",onKeydown:Lt(v,["enter"])},null,42,zk),[[Le,r.value]]),l.value?(x(),E("div",Wk,F(l.value),1)):me("",!0)])]),i("div",Gk,[i("button",{class:"btn btn-sm",onClick:m[2]||(m[2]=w=>o("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:v},F(e.confirmText),1)])],8,Fk)])):me("",!0)]),_:1})]))}}),Jk=Vt(Yk,[["__scopeId","data-v-4b14ba4f"]]);function Xk(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Qu(e,t){const o="\uFEFF"+t.map(f=>f.map(Xk).join(",")).join(`\r -`);if(lo.isNativePlatform()){const{downloadText:f}=await Vd(async()=>{const{downloadText:v}=await Promise.resolve().then(()=>tb);return{downloadText:v}},void 0,import.meta.url);return f(e,o)}const r=new Blob([o],{type:"text/csv;charset=utf-8"}),l=URL.createObjectURL(r),u=document.createElement("a");return u.href=l,u.download=e,u.click(),window.setTimeout(()=>URL.revokeObjectURL(l),1e4),""}const Qk={class:"settings"},Zk={class:"card section"},eC={class:"muted acc-line"},tC={class:"ai-grid"},nC={class:"rule-item"},sC={class:"rule-item"},oC={class:"rule-item"},rC={key:0,class:"form-error"},aC={class:"rule-save"},iC={class:"card section"},lC={class:"rule-grid"},uC={class:"rule-item"},cC={class:"rule-item"},dC={class:"rule-item"},fC={class:"rule-item"},pC={class:"rule-item"},vC={class:"card section"},mC={class:"proj-add"},hC={key:0,class:"muted proj-tip"},yC=["onKeydown"],gC=["onClick"],bC=["onClick"],wC=["onClick"],_C={key:1,class:"muted"},kC={class:"card section"},CC={class:"card section"},xC={class:"muted acc-line"},$C={class:"rule-save"},SC=["disabled"],EC={key:0,class:"muted acc-line"},AC={key:1,class:"form-error"},TC={key:2,class:"form-error"},PC={class:"card section"},OC={class:"ai-grid"},MC={class:"rule-item"},IC={class:"rule-item"},jC={class:"rule-item"},DC={class:"card section"},LC={class:"cat-block"},RC={class:"cat-head"},KC={class:"cat-chips"},NC=["onClick"],FC=["onClick"],VC={class:"cat-block"},BC={class:"cat-head"},UC={class:"cat-chips"},qC=["onClick"],HC=["onClick"],zC={class:"cat-block"},WC={class:"cat-head"},GC={class:"cat-chips"},YC=["onClick"],JC=["onClick"],XC={class:"card section"},QC={class:"backup-row"},ZC={key:0,class:"import-error"},ex=Kt({__name:"SettingsView",setup(e){var te;const t=P({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=P([]),o=P(""),r=P(""),l=P(""),u=P(""),f=P(""),v=P(""),y=P(null),m=P(""),w=P([]),T=P([]),$=P([]);async function I(){w.value=await Zo(),T.value=await la("expense"),$.value=await la("income")}const J=P({open:!1,kind:"log",index:-1,initial:""}),ae=P(null);function de(R){return R==="log"?w.value:R==="expense"?T.value:$.value}async function ue(R,L){R==="log"?(w.value=L,await ry(L)):R==="expense"?(T.value=L,await Wi("expense",L)):($.value=L,await Wi("income",L))}function G(R){J.value={open:!0,kind:R,index:-1,initial:""}}function S(R,L,fe){J.value={open:!0,kind:R,index:L,initial:fe}}function M(R){const{kind:L,index:fe}=J.value,je=de(L);return je.includes(R)&&!(fe>=0&&je[fe]===R)?"该分类已存在":null}async function ee(R){const{kind:L,index:fe}=J.value;fe>=0?(await ue(L,de(L).map((je,Je)=>Je===fe?R:je)),Ve("分类已更新(历史记录自动跟随显示)")):(await ue(L,[...de(L),R]),Ve("分类已添加")),J.value.open=!1}function q(R,L){const fe=de(R);if(fe.length<=1){Ve("至少保留一个分类");return}ae.value={kind:R,index:L,name:fe[L]}}async function oe(){if(!ae.value)return;const{kind:R,index:L}=ae.value;await ue(R,de(R).filter((fe,je)=>je!==L)),Ve("分类已删除"),ae.value=null}const j=P(null),A=P(null),O=P(""),ne=P(((te=zo())==null?void 0:te.username)||""),Ie=P(""),Se=P(""),_e=P(""),Me=P(""),qe=P(!1),Ue="0.8.0",tt=P(""),Ye=P(""),We=P(""),le=P(""),Q=P(!1),Ae=P("");async function lt(){var R;tt.value=((R=hn())==null?void 0:R.username)||"",Ae.value=await Qm(),le.value=eo.value}pt(eo,R=>{le.value=R});async function it(){We.value="";try{await Td(),Ve("云端绑定已重建")}catch(R){We.value=R instanceof Error?R.message:"绑定失败"}}async function Te(){if(!Q.value){We.value="",le.value=eo.value,Q.value=!0;try{const R=await Bi();Ae.value=R.at,Ye.value="推送 "+R.pushed+" 条 · 拉取 "+R.pulled+" 条 · 删除 "+R.removed+" 条",le.value="",Ve("同步完成")}catch(R){We.value=R instanceof Error?R.message:"同步失败"}Q.value=!1}}async function kt(){if(Me.value="",Se.value!==_e.value){Me.value="两次输入的新密码不一致";return}try{await Hm(Ie.value,Se.value),Ie.value="",Se.value="",_e.value="",Ve("登录密码已修改")}catch(R){Me.value=R instanceof Error?R.message:"修改失败"}}async function xt(){await zm(),window.location.reload()}async function Ke(){t.value=await ms(),n.value=await ao(!0),l.value=(await gl()).join(` -`),u.value=await Tt("ai_base_url",""),f.value=await Tt("ai_api_key",""),v.value=await Tt("ai_model",""),await lt(),await I()}async function _(){await Nt("ai_base_url",u.value.trim()),await Nt("ai_api_key",f.value.trim()),await Nt("ai_model",v.value.trim()),Ve("AI 配置已保存")}async function g(){const R=ut(),L=await Promise.all([Qo("2000-01-01",R),ao(!0)]),fe=L[0],je=L[1],Je=new Map(je.map(Ze=>[Ze.id,Ze.name])),ft=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const Ze of fe)ft.push([Ze.date,Uo(Ze.category),Ze.project_id&&Je.get(Ze.project_id)||"",Ze.content,Ze.minutes==null?"":Ze.minutes,Ze.is_milestone?"是":"",Ze.needs_followup?"是":"",Ze.takeaway||"",Ze.remark||""]);const It=await Qu("工作记录_"+R.replace(/-/g,"")+".csv",ft);Ve(It?"CSV 已导出到:"+It:"CSV 已导出到系统下载目录")}async function C(){const R=ut(),L=await Promise.all([ms(),Xo("2000-01-01",R)]),fe=L[0],je=L[1],Je=["周日","周一","周二","周三","周四","周五","周六"],ft=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const Ze of je){const et=uo(Ze,Ze.date,fe,Ze.date===R);ft.push([Ze.date,Je[Gn(Ze.date).getDay()],et.label,Ze.clock_in_at?Wn(Ze.clock_in_at):"",Ze.clock_out_at?Wn(Ze.clock_out_at):"",Ze.location||"",Ze.kind==="makeup"?"补卡":Ze.kind==="leave"?"休假":"正常",Ze.note||""])}const It=await Qu("考勤记录_"+R.replace(/-/g,"")+".csv",ft);Ve(It?"CSV 已导出到:"+It:"CSV 已导出到系统下载目录")}cn(Ke);async function D(){await Nt("work_start",t.value.work_start),await Nt("work_end",t.value.work_end),await Nt("grace_minutes",String(t.value.grace_minutes)),await Nt("lunch_minutes",String(t.value.lunch_minutes)),await Nt("remind_weekly",t.value.remind_weekly),Ve("打卡规则已保存")}async function re(){await Dd(l.value.split(` -`)),Ve("常用地点已保存")}async function pe(){const R=o.value.trim();if(R){try{await ph(R),r.value="",o.value=""}catch{r.value="项目名已存在"}await Ke()}}function xe(R){y.value=R.id,m.value=R.name}async function we(R){const L=m.value.trim();if(L)try{await vh(R.id,L),r.value=""}catch{r.value="项目名已存在"}y.value=null,await Ke()}async function ke(R){await mh(R.id,R.archived!==1),await Ke()}async function ve(){try{const R=await ey(),L=await Ea("实习日志备份_"+ut().replace(/-/g,"")+".json",R);Ve(L?"备份已导出到:"+L:"备份已导出到系统下载目录")}catch(R){Ve("导出失败:"+(R instanceof Error?R.message:String(R)))}}function Re(R){const L=R.target,fe=L.files&&L.files[0];if(O.value="",!fe)return;const je=fe.name;fe.text().then(Je=>{A.value={name:je,text:Je}}),L.value=""}async function V(){if(A.value)try{await ty(A.value.text),A.value=null,O.value="",await Ke(),Ve("数据导入完成")}catch(R){A.value=null,O.value=R instanceof Error?R.message:"导入失败"}}return(R,L)=>(x(),E("div",Qk,[i("div",Zk,[L[27]||(L[27]=i("div",{class:"section-title"},"账号与隐私",-1)),i("div",eC,"v"+F(Wt(Ue))+" · 当前账号 "+F(ne.value)+" · 登录密码仅存 PBKDF2 哈希",1),i("div",tC,[i("div",nC,[L[24]||(L[24]=i("label",null,"旧登录密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":L[0]||(L[0]=fe=>Ie.value=fe)},null,512),[[Le,Ie.value]])]),i("div",sC,[L[25]||(L[25]=i("label",null,"新登录密码(至少 6 位)",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":L[1]||(L[1]=fe=>Se.value=fe)},null,512),[[Le,Se.value]])]),i("div",oC,[L[26]||(L[26]=i("label",null,"确认新登录密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":L[2]||(L[2]=fe=>_e.value=fe)},null,512),[[Le,_e.value]])])]),Me.value?(x(),E("div",rC,F(Me.value),1)):me("",!0),i("div",aC,[i("button",{class:"btn btn-primary btn-sm",onClick:kt},"修改登录密码"),i("button",{class:"btn btn-sm btn-danger",onClick:L[3]||(L[3]=fe=>qe.value=!0)},"删除此用户及全部数据")])]),i("div",iC,[L[34]||(L[34]=i("div",{class:"section-title"},"打卡规则",-1)),i("div",lC,[i("div",uC,[L[28]||(L[28]=i("label",null,"上班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":L[4]||(L[4]=fe=>t.value.work_start=fe)},null,512),[[Le,t.value.work_start]])]),i("div",cC,[L[29]||(L[29]=i("label",null,"下班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":L[5]||(L[5]=fe=>t.value.work_end=fe)},null,512),[[Le,t.value.work_end]])]),i("div",dC,[L[30]||(L[30]=i("label",null,"迟到宽限(分钟)",-1)),Pe(i("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":L[6]||(L[6]=fe=>t.value.grace_minutes=fe)},null,512),[[Le,t.value.grace_minutes,void 0,{number:!0}]])]),i("div",fC,[L[31]||(L[31]=i("label",null,"午休扣除(分钟)",-1)),Pe(i("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":L[7]||(L[7]=fe=>t.value.lunch_minutes=fe)},null,512),[[Le,t.value.lunch_minutes,void 0,{number:!0}]])]),i("div",pC,[L[33]||(L[33]=i("label",null,"周记提醒",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":L[8]||(L[8]=fe=>t.value.remind_weekly=fe)},[...L[32]||(L[32]=[i("option",{value:"friday"},"每周五提醒",-1),i("option",{value:"off"},"关闭",-1)])],512),[[vs,t.value.remind_weekly]])])]),i("div",{class:"rule-save"},[i("button",{class:"btn btn-primary btn-sm",onClick:D},"保存规则")])]),i("div",vC,[L[35]||(L[35]=i("div",{class:"section-title"},"项目管理",-1)),i("div",mC,[Pe(i("input",{class:"input","onUpdate:modelValue":L[9]||(L[9]=fe=>o.value=fe),placeholder:"新项目名称",onKeydown:Lt(pe,["enter"])},null,544),[[Le,o.value]]),i("button",{class:"btn btn-sm",onClick:pe},"添加")]),r.value?(x(),E("div",hC,F(r.value),1)):me("",!0),(x(!0),E(Oe,null,st(n.value,fe=>(x(),E("div",{key:fe.id,class:"proj-row"},[y.value===fe.id?(x(),E(Oe,{key:0},[Pe(i("input",{class:"input","onUpdate:modelValue":L[10]||(L[10]=je=>m.value=je),onKeydown:Lt(je=>we(fe),["enter"])},null,40,yC),[[Le,m.value]]),i("button",{class:"btn btn-sm",onClick:je=>we(fe)},"保存",8,gC),i("button",{class:"btn btn-sm",onClick:L[11]||(L[11]=je=>y.value=null)},"取消")],64)):(x(),E(Oe,{key:1},[i("span",{class:ze(["proj-name",{archived:fe.archived===1}])},F(fe.name),3),i("button",{class:"icon-btn",title:"重命名",onClick:je=>xe(fe)},[be(He,{name:"edit",size:14})],8,bC),i("button",{class:"btn btn-sm",onClick:je=>ke(fe)},F(fe.archived===1?"恢复":"归档"),9,wC)],64))]))),128)),n.value.length?me("",!0):(x(),E("div",_C,"暂无项目,先添加一个"))]),i("div",kC,[L[37]||(L[37]=i("div",{class:"section-title"},"常用地点",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":L[12]||(L[12]=fe=>l.value=fe),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Le,l.value]]),i("div",{class:"rule-save"},[i("button",{class:"btn btn-primary btn-sm",onClick:re},"保存地点"),L[36]||(L[36]=i("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),i("div",CC,[L[38]||(L[38]=i("div",{class:"section-title"},"多端数据同步",-1)),i("div",xC,"云端账号:"+F(tt.value||"未绑定")+" · 数据存于服务器,其他端变更秒级自动刷新",1),i("div",$C,[i("button",{class:"btn btn-primary btn-sm",disabled:Q.value,onClick:Te},F(Q.value?"同步中":"立即同步"),9,SC),i("button",{class:"btn btn-sm",onClick:it},"重新校验连接")]),Ye.value?(x(),E("div",EC,"上次同步:"+F(Ae.value||"--")+" · "+F(Ye.value),1)):me("",!0),We.value?(x(),E("div",AC,F(We.value),1)):me("",!0),le.value?(x(),E("div",TC,"最近自动同步失败:"+F(le.value)+"(可点「立即同步」重试)",1)):me("",!0)]),i("div",PC,[L[43]||(L[43]=i("div",{class:"section-title"},"AI 润色配置(可选)",-1)),i("div",OC,[i("div",MC,[L[39]||(L[39]=i("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":L[13]||(L[13]=fe=>u.value=fe),placeholder:"https://api.example.com/v1"},null,512),[[Le,u.value]])]),i("div",IC,[L[40]||(L[40]=i("label",null,"API Key",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":L[14]||(L[14]=fe=>f.value=fe),placeholder:"sk-..."},null,512),[[Le,f.value]])]),i("div",jC,[L[41]||(L[41]=i("label",null,"模型名称",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":L[15]||(L[15]=fe=>v.value=fe),placeholder:"如:deepseek-chat"},null,512),[[Le,v.value]])])]),i("div",{class:"rule-save"},[i("button",{class:"btn btn-primary btn-sm",onClick:_},"保存 AI 配置"),L[42]||(L[42]=i("span",{class:"muted loc-note"},"配置仅保存在本机;总结页「AI 润色」需此处先配置",-1))])]),i("div",DC,[L[47]||(L[47]=i("div",{class:"section-title"},"工作分类",-1)),i("div",LC,[i("div",RC,[L[44]||(L[44]=i("span",{class:"muted"},"工作记录分类",-1)),i("button",{class:"btn btn-xs",onClick:L[16]||(L[16]=fe=>G("log"))},"添加")]),i("div",KC,[(x(!0),E(Oe,null,st(w.value,(fe,je)=>(x(),E("span",{key:fe+je,class:"cat-chip"},[At(F(fe)+" ",1),i("button",{class:"chip-btn",title:"修改",onClick:Je=>S("log",je,fe)},"改",8,NC),i("button",{class:"chip-btn",title:"删除",onClick:Je=>q("log",je)},"删",8,FC)]))),128))])]),i("div",VC,[i("div",BC,[L[45]||(L[45]=i("span",{class:"muted"},"记账支出分类",-1)),i("button",{class:"btn btn-xs",onClick:L[17]||(L[17]=fe=>G("expense"))},"添加")]),i("div",UC,[(x(!0),E(Oe,null,st(T.value,(fe,je)=>(x(),E("span",{key:fe+je,class:"cat-chip"},[At(F(fe)+" ",1),i("button",{class:"chip-btn",title:"修改",onClick:Je=>S("expense",je,fe)},"改",8,qC),i("button",{class:"chip-btn",title:"删除",onClick:Je=>q("expense",je)},"删",8,HC)]))),128))])]),i("div",zC,[i("div",WC,[L[46]||(L[46]=i("span",{class:"muted"},"记账收入分类",-1)),i("button",{class:"btn btn-xs",onClick:L[18]||(L[18]=fe=>G("income"))},"添加")]),i("div",GC,[(x(!0),E(Oe,null,st($.value,(fe,je)=>(x(),E("span",{key:fe+je,class:"cat-chip"},[At(F(fe)+" ",1),i("button",{class:"chip-btn",title:"修改",onClick:Je=>S("income",je,fe)},"改",8,YC),i("button",{class:"chip-btn",title:"删除",onClick:Je=>q("income",je)},"删",8,JC)]))),128))])])]),i("div",XC,[L[48]||(L[48]=i("div",{class:"section-title"},"数据备份",-1)),i("div",QC,[i("button",{class:"btn btn-sm",onClick:ve},"导出 JSON 备份"),i("button",{class:"btn btn-sm",onClick:L[19]||(L[19]=fe=>{var je;return(je=j.value)==null?void 0:je.click()})},"导入 JSON 备份"),i("button",{class:"btn btn-sm",onClick:g},"导出工作记录 CSV"),i("button",{class:"btn btn-sm",onClick:C},"导出考勤 CSV"),i("input",{ref_key:"fileInput",ref:j,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Re},null,544)]),O.value?(x(),E("div",ZC,F(O.value),1)):me("",!0),L[49]||(L[49]=i("div",{class:"muted backup-note"},"数据保存在云端服务器;导出的 JSON 备份用于跨设备迁移或灾后恢复。",-1))]),be(Jk,{open:J.value.open,title:J.value.index>=0?"修改分类名称":"添加分类",label:"分类名称",placeholder:"如:制度学习 / 差旅交通",initial:J.value.initial,validate:M,"confirm-text":"保存",onCancel:L[20]||(L[20]=fe=>J.value.open=!1),onConfirm:ee},null,8,["open","title","initial"]),be(xn,{open:!!ae.value,title:"删除分类",message:ae.value?"将删除分类「"+ae.value.name+"」。历史记录不受影响,仍按原分类展示。":"","confirm-text":"删除",danger:"",onCancel:L[21]||(L[21]=fe=>ae.value=null),onConfirm:oe},null,8,["open","message"]),be(xn,{open:!!A.value,title:"导入确认",message:A.value?"将从文件「"+A.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:L[22]||(L[22]=fe=>A.value=null),onConfirm:V},null,8,["open","message"]),be(xn,{open:qe.value,title:"删除用户确认",message:"将永久删除云端账号「"+ne.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:L[23]||(L[23]=fe=>qe.value=!1),onConfirm:xt},null,8,["open","message"])]))}}),tx=Vt(ex,[["__scopeId","data-v-10f77319"]]),nx={class:"tp-main"},sx={class:"tp-title"},ox={class:"tp-meta"},rx={class:"tp-time num"},ax=Kt({__name:"TimerPanel",setup(e){const t=P(null),n=P(Date.now());let o=null,r=null;async function l(){try{t.value=await Th()}catch{}}const u=nt(()=>{const m=t.value;if(!m||!m.timer_started_at)return 0;const w=(m.actual_minutes||0)*60,T=Math.max(0,Math.floor((n.value-new Date(m.timer_started_at).getTime())/1e3));return w+T}),f=nt(()=>{const m=u.value,w=Math.floor(m/3600),T=Math.floor(m%3600/60),$=m%60,I=J=>String(J).padStart(2,"0");return w>0?w+":"+I(T)+":"+I($):T+":"+I($)});async function v(){const m=t.value;m&&(await Sa(m.id),Ve("已停止计时:"+m.title),await l())}function y(){location.hash="#/plan"}return pt(Ed,()=>{l()}),cn(()=>{l(),o=window.setInterval(()=>{l()},15e3),r=window.setInterval(()=>{n.value=Date.now()},1e3),window.addEventListener("focus",l)}),bn(()=>{o!==null&&window.clearInterval(o),r!==null&&window.clearInterval(r),window.removeEventListener("focus",l)}),(m,w)=>(x(),Ct(Jn,{name:"tp"},{default:Sn(()=>[t.value&&t.value.timer_started_at?(x(),E("div",{key:0,class:"tp",onClick:y,title:"点击查看计划页"},[w[0]||(w[0]=i("span",{class:"tp-pulse"},null,-1)),i("span",nx,[i("span",sx,F(t.value.title),1),i("span",ox,F(t.value.kind)+" · 计时中",1)]),i("span",rx,F(f.value),1),i("span",{class:"tp-stop",role:"button",title:"停止计时",onClick:Ut(v,["stop"])},"停止")])):me("",!0)]),_:1}))}}),ix=Vt(ax,[["__scopeId","data-v-a8f9ed22"]]),lx={class:"admin-page"},ux={class:"card table-card"},cx={class:"toolbar"},dx={key:0,class:"form-error tb-error"},fx={class:"admin-table"},px={class:"td-name","data-label":"用户名"},vx={"data-label":"角色"},mx={key:0,class:"role-badge"},hx={key:1,class:"muted"},yx={class:"muted num","data-label":"创建时间"},gx={class:"muted num","data-label":"数据量"},bx={class:"td-ops"},wx={class:"ops"},_x=["onClick"],kx=["disabled","onClick"],Cx={key:0},xx={key:1,class:"muted load-line"},$x={class:"dialog",role:"dialog","aria-label":"新增用户"},Sx={class:"dialog-head"},Ex={class:"dialog-body"},Ax={class:"form-row"},Tx={class:"form-row"},Px={class:"form-row"},Ox={key:0,class:"form-error"},Mx={class:"dialog-btns"},Ix=["disabled"],jx={class:"dialog",role:"dialog","aria-label":"重置密码"},Dx={class:"dialog-head"},Lx={class:"dialog-title"},Rx={class:"dialog-body"},Kx={class:"form-row"},Nx={key:0,class:"form-error"},Fx={class:"dialog-btns"},Vx=["disabled"],Bx=Kt({__name:"UserAdminView",setup(e){const t=P([]),n=P(""),o=P(!0),r=P("");async function l(j,A){const O=await Ns();let ne=$a();if(!ne){const Se=hn(),_e=await fetch(O+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Se==null?void 0:Se.username,password:Se==null?void 0:Se.password})});if(_e.ok){const Me=await _e.json();ne=String(Me.token||""),Ho(ne)}}const Ie=await fetch(O+j,{method:A?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ne},body:A?JSON.stringify(A):void 0});if(Ie.status===401&&hn()){const Se=hn(),_e=await fetch(O+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Se==null?void 0:Se.username,password:Se==null?void 0:Se.password})});if(_e.ok){const Me=await _e.json();ne=String(Me.token||""),Ho(ne);const qe=await fetch(O+j,{method:A?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ne},body:A?JSON.stringify(A):void 0});return{ok:qe.ok,status:qe.status,data:await qe.json().catch(()=>({}))}}}return{ok:Ie.ok,status:Ie.status,data:await Ie.json().catch(()=>({}))}}async function u(){o.value=!0,r.value="";const j=await l("/api/admin/users");if(!j.ok){o.value=!1,r.value=j.data&&j.data.error||"加载失败 "+j.status;return}t.value=j.data.users||[],n.value=j.data.me||"",o.value=!1}function f(j){return j<=0?"--":j<1024?j+" B":j<1024*1024?(j/1024).toFixed(1)+" KB":(j/1024/1024).toFixed(2)+" MB"}function v(j){return(j||"").slice(0,10)}const y=P(!1),m=P(""),w=P(""),T=P(""),$=P(""),I=P(!1);function J(){y.value=!0,$.value="",m.value="",w.value="",T.value=""}async function ae(){const j=m.value.trim();if(w.value!==T.value){$.value="两次输入的密码不一致";return}if(w.value.length<6){$.value="密码至少 6 位";return}I.value=!0;const A=await l("/api/admin/users/create",{username:j,password:w.value});if(I.value=!1,!A.ok){$.value=A.data&&A.data.error||"创建失败 "+A.status;return}Ve("用户「"+j+"」已创建"),y.value=!1,await u()}const de=P(null),ue=P(""),G=P(""),S=P(!1);function M(j){de.value=j,ue.value="",G.value=""}async function ee(){if(!de.value)return;if(ue.value.length<6){G.value="密码至少 6 位";return}S.value=!0;const j=await l("/api/admin/users/password",{userId:de.value.id,newPassword:ue.value});if(S.value=!1,!j.ok){G.value=j.data&&j.data.error||"重置失败 "+j.status;return}Ve("已重置「"+de.value.username+"」的登录密码"),de.value=null}const q=P(null);async function oe(){if(!q.value)return;const j=await l("/api/admin/users/delete",{userId:q.value.id});if(!j.ok){q.value=null,Ve(j.data&&j.data.error||"删除失败");return}Ve("已删除账号「"+q.value.username+"」及其全部云端数据"),q.value=null,await u()}return cn(u),(j,A)=>(x(),E("div",lx,[i("div",ux,[i("div",cx,[A[12]||(A[12]=i("div",{class:"head-wrap"},[i("div",{class:"tb-title"},"用户管理"),i("div",{class:"muted tb-sub"},"云端账号统一管理 · 管理员:xionglin")],-1)),i("button",{class:"btn btn-primary btn-sm",onClick:J},[be(He,{name:"plus",size:14}),A[11]||(A[11]=At(" 新增用户 ",-1))])]),r.value?(x(),E("div",dx,F(r.value),1)):me("",!0),i("table",fx,[A[14]||(A[14]=i("thead",null,[i("tr",null,[i("th",null,"用户名"),i("th",null,"角色"),i("th",null,"创建时间"),i("th",null,"数据量"),i("th",{class:"th-ops"},"操作")])],-1)),i("tbody",null,[(x(!0),E(Oe,null,st(t.value,O=>(x(),E("tr",{key:O.id},[i("td",px,F(O.username),1),i("td",vx,[O.role==="admin"?(x(),E("span",mx,"管理员")):(x(),E("span",hx,"普通用户"))]),i("td",yx,F(v(O.created_at)),1),i("td",gx,F(f(O.data_bytes)),1),i("td",bx,[i("div",wx,[i("button",{class:"btn btn-xs",onClick:ne=>M(O)},"重置密码",8,_x),i("button",{class:"btn btn-xs btn-danger",disabled:O.id===n.value,onClick:ne=>q.value=O},"删除",8,kx)])])]))),128)),!o.value&&!t.value.length?(x(),E("tr",Cx,[...A[13]||(A[13]=[i("td",{colspan:"5",class:"empty muted"},"加载结果为空",-1)])])):me("",!0)])]),o.value?(x(),E("div",xx,"加载中")):me("",!0)]),A[20]||(A[20]=i("div",{class:"muted admin-note"},"重置密码立即生效;删除账号将移除其全部云端数据,不可恢复。自己的账号不能删除。",-1)),(x(),Ct($n,{to:"body"},[y.value?(x(),E("div",{key:0,class:"mask",onClick:A[5]||(A[5]=Ut(O=>y.value=!1,["self"]))},[i("div",$x,[i("div",Sx,[A[15]||(A[15]=i("span",{class:"dialog-title"},"新增用户",-1)),i("button",{class:"icon-btn",onClick:A[0]||(A[0]=O=>y.value=!1)},[be(He,{name:"close",size:16})])]),i("div",Ex,[i("div",Ax,[A[16]||(A[16]=i("label",null,"用户名(2 到 20 个字符)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":A[1]||(A[1]=O=>m.value=O),placeholder:"如:xiaowang"},null,512),[[Le,m.value]])]),i("div",Tx,[A[17]||(A[17]=i("label",null,"初始登录密码(至少 6 位)",-1)),Pe(i("input",{class:"input",type:"password","onUpdate:modelValue":A[2]||(A[2]=O=>w.value=O),placeholder:"转发给使用者,登录后可自行修改"},null,512),[[Le,w.value]])]),i("div",Px,[A[18]||(A[18]=i("label",null,"确认密码",-1)),Pe(i("input",{class:"input",type:"password","onUpdate:modelValue":A[3]||(A[3]=O=>T.value=O),onKeydown:Lt(ae,["enter"])},null,544),[[Le,T.value]])]),$.value?(x(),E("div",Ox,F($.value),1)):me("",!0)]),i("div",Mx,[i("button",{class:"btn btn-sm",onClick:A[4]||(A[4]=O=>y.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",disabled:I.value||!m.value.trim(),onClick:ae},F(I.value?"创建中":"创建"),9,Ix)])])])):me("",!0)])),(x(),Ct($n,{to:"body"},[de.value?(x(),E("div",{key:0,class:"mask",onClick:A[9]||(A[9]=Ut(O=>de.value=null,["self"]))},[i("div",jx,[i("div",Dx,[i("span",Lx,"重置「"+F(de.value.username)+"」的登录密码",1),i("button",{class:"icon-btn",onClick:A[6]||(A[6]=O=>de.value=null)},[be(He,{name:"close",size:16})])]),i("div",Rx,[i("div",Kx,[A[19]||(A[19]=i("label",null,"新登录密码(至少 6 位)",-1)),Pe(i("input",{class:"input",type:"password","onUpdate:modelValue":A[7]||(A[7]=O=>ue.value=O),onKeydown:Lt(ee,["enter"])},null,544),[[Le,ue.value]])]),G.value?(x(),E("div",Nx,F(G.value),1)):me("",!0)]),i("div",Fx,[i("button",{class:"btn btn-sm",onClick:A[8]||(A[8]=O=>de.value=null)},"取消"),i("button",{class:"btn btn-primary btn-sm",disabled:S.value,onClick:ee},F(S.value?"提交中":"重置"),9,Vx)])])])):me("",!0)])),be(xn,{open:!!q.value,title:"删除用户确认",message:q.value?"将永久删除云端账号「"+q.value.username+"」及其服务器上的全部数据,不可恢复。请确认。":"","confirm-text":"永久删除",danger:"",onCancel:A[10]||(A[10]=O=>q.value=null),onConfirm:oe},null,8,["open","message"])]))}}),Ux=Vt(Bx,[["__scopeId","data-v-2d48d2c9"]]),qx={class:"login-page"},Hx={class:"card login-card"},zx={class:"login-brand"},Wx={class:"brand-icon"},Gx={class:"seg"},Yx=["placeholder"],Jx={key:1,class:"form-error"},Xx=["disabled"],Qx=Kt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,o=P("login"),r=P(""),l=P(""),u=P(""),f=P(""),v=P(!1);function y(w){o.value=w,f.value="",u.value=""}async function m(){if(!v.value){f.value="",v.value=!0;try{let w;if(o.value==="login")w=await Fm(r.value,l.value);else{if(l.value.length<6){f.value="登录密码至少 6 位",v.value=!1;return}if(l.value!==u.value){f.value="两次输入的密码不一致",v.value=!1;return}w=await Vm(r.value,l.value)}n("login",w)}catch(w){f.value=w instanceof Error?w.message:"操作失败"}v.value=!1}}return(w,T)=>(x(),E("div",qx,[i("div",Hx,[i("div",zx,[i("div",Wx,[be(He,{name:"calendar",size:22})]),T[5]||(T[5]=i("div",{class:"login-title"},"实习工作日志",-1)),T[6]||(T[6]=i("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),T[7]||(T[7]=i("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),i("div",Gx,[i("button",{class:ze(["seg-btn",{active:o.value==="login"}]),onClick:T[0]||(T[0]=$=>y("login"))},"登录",2),i("button",{class:ze(["seg-btn",{active:o.value==="create"}]),onClick:T[1]||(T[1]=$=>y("create"))},"创建用户",2)]),Pe(i("input",{class:"input","onUpdate:modelValue":T[2]||(T[2]=$=>r.value=$),placeholder:"用户名(2 到 20 个字符)",onKeydown:Lt(m,["enter"])},null,544),[[Le,r.value]]),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":T[3]||(T[3]=$=>l.value=$),placeholder:o.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Lt(m,["enter"])},null,40,Yx),[[Le,l.value]]),o.value==="create"?Pe((x(),E("input",{key:0,type:"password",class:"input","onUpdate:modelValue":T[4]||(T[4]=$=>u.value=$),placeholder:"再次输入密码",onKeydown:Lt(m,["enter"])},null,544)),[[Le,u.value]]):me("",!0),f.value?(x(),E("div",Jx,F(f.value),1)):me("",!0),i("button",{class:"btn btn-primary login-btn",disabled:v.value,onClick:m},F(o.value==="login"?"登录":"创建并进入"),9,Xx),T[8]||(T[8]=i("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),Zx=Vt(Qx,[["__scopeId","data-v-e9c1c40d"]]),e$={key:1,class:"app"},t$={class:"side"},n$={class:"brand-mark"},s$={class:"side-nav"},o$={key:0,class:"nav-group"},r$=["data-tip","onClick"],a$={class:"nav-label"},i$={class:"side-foot"},l$={class:"avatar"},u$={class:"foot-name"},c$={class:"main"},d$={class:"topbar"},f$={class:"title"},p$={class:"gsearch"},v$={key:0,class:"gs-panel"},m$={key:0,class:"gs-group muted"},h$=["onMousedown"],y$={class:"tag"},g$={class:"gs-text"},b$={class:"muted num gs-date"},w$={key:1,class:"gs-group muted"},_$=["onMousedown"],k$={class:"gs-text"},C$={class:"muted gs-sub"},x$={key:1,class:"gs-empty muted"},$$={class:"content"},S$={class:"content-inner"},E$={class:"tabbar"},A$=["onClick"],T$={class:"sheet-user num"},P$=["onClick"],O$={class:"sheet-name"},M$={class:"msw"},I$={class:"msw-bar"},j$={class:"msw-results"},D$={key:0,class:"gs-group muted"},L$=["onMousedown"],R$={class:"tag"},K$={class:"gs-text"},N$={class:"muted num gs-date"},F$={key:1,class:"gs-group muted"},V$=["onMousedown"],B$={class:"gs-text"},U$={class:"muted gs-sub"},q$={key:1,class:"gs-empty muted"},H$={class:"toast-wrap"},z$=Kt({__name:"App",setup(e){const t=Ty(),n=P(zo());async function o(le){n.value=le,ra(le.userId),location.hash="#/calendar",M.value="calendar",await We(),u();try{await Td(),await no()}catch{}Ve("欢迎,"+le.username);const Q=sessionStorage.getItem("dsh_migrate_toast");Q&&(sessionStorage.removeItem("dsh_migrate_toast"),Ve("已迁移原有数据 "+Q+" 条"))}async function r(){Me.value=!1,Se.value=!1,sh(),l!==null&&(window.clearInterval(l),l=null),await Um(),n.value=null,M.value="calendar",location.hash="#/calendar",Ve("已退出登录")}let l=null;function u(){nh(),l!==null&&window.clearInterval(l),l=window.setInterval(()=>{no()},60*1e3),no()}const f=P(null),v=P(""),y=P(!1),m=P({logs:[],memos:[]});let w=null;const T=nt(()=>!!(m.value.logs.length||m.value.memos.length));function $(){w&&window.clearTimeout(w);const le=v.value;w=window.setTimeout(async()=>{const Q=le.trim();if(!Q){m.value={logs:[],memos:[]};return}const Ae=await Promise.all([zh(Q,8),Wh(Q,4)]);m.value={logs:Ae[0],memos:Ae[1]}},200)}function I(){v.value="",m.value={logs:[],memos:[]},y.value=!1}function J(le){Fi.value=le.date,ee("calendar"),I()}function ae(le){Vi.value=le.id,ee("memo"),I()}function de(){window.setTimeout(()=>{y.value=!1},150)}function ue(le){var Q;(le.ctrlKey||le.metaKey)&&le.key.toLowerCase()==="k"&&(le.preventDefault(),(Q=f.value)==null||Q.focus())}const G=[{key:"calendar",name:"日历",icon:"calendar",group:"记录"},{key:"today",name:"详情",icon:"edit",group:"记录"},{key:"plan",name:"计划",icon:"plan",group:"记录"},{key:"ledger",name:"记账",icon:"wallet",group:"工具"},{key:"memo",name:"备忘录",icon:"memo",group:"工具"},{key:"stats",name:"统计",icon:"chart",group:"分析"},{key:"report",name:"总结",icon:"export",group:"分析"},{key:"vault",name:"密码库",icon:"lock",group:"系统"},{key:"settings",name:"设置",icon:"settings",group:"系统"},{key:"admin",name:"用户管理",icon:"shield",group:"系统"}];function S(){var Q;const le=(location.hash||"").replace("#/","");return!G.some(Ae=>Ae.key===le)||le==="admin"&&(((Q=zo())==null?void 0:Q.username)||"")!=="xionglin"?"calendar":le}const M=P(S());window.addEventListener("hashchange",()=>{M.value=S()});function ee(le){location.hash="#/"+le}const q=nt(()=>G.find(le=>le.key===M.value)||G[0]),oe=nt(()=>{var le;return(((le=n.value)==null?void 0:le.username)||"")==="xionglin"}),j=nt(()=>oe.value?G:G.filter(le=>le.key!=="admin")),A=nt(()=>{const le=G.filter(Q=>!ne.includes(Q.key));return oe.value?le:le.filter(Q=>Q.key!=="admin")}),O=nt(()=>A.value.some(le=>le.key===M.value));pt([oe,M],()=>{M.value==="admin"&&!oe.value&&ee("calendar")},{immediate:!0});const ne=["calendar","today","plan","ledger"],Ie=G.filter(le=>ne.includes(le.key)),Se=P(!1);function _e(le){Se.value=!1,ee(le)}const Me=P(!1),qe=P(null);function Ue(){Me.value=!0,window.setTimeout(()=>{var le;return(le=qe.value)==null?void 0:le.focus()},60)}function tt(le){J(le),Me.value=!1}function Ye(le){ae(le),Me.value=!1}async function We(){try{if((await ms()).remind_weekly==="off")return;const Q=new Date().getDay();if(Q!==5&&Q!==6&&Q!==0)return;const Ae=await bl(Zs(ut()));if(Ae&&(Ae.highlights||Ae.challenges||Ae.plan_next))return;Ve("本周周记还没写,可在「总结」页填写")}catch{}}return cn(async()=>{window.addEventListener("keydown",ue),n.value&&(ra(n.value.userId),await We(),u())}),(le,Q)=>{var Ae,lt,it;return n.value?(x(),E("div",e$,[i("nav",t$,[i("div",{class:"brand",onClick:Q[0]||(Q[0]=Te=>ee("calendar"))},[i("span",n$,[be(He,{name:"calendar",size:15})]),Q[11]||(Q[11]=i("span",{class:"brand-name"},"实习工作日志",-1))]),i("div",s$,[(x(!0),E(Oe,null,st(j.value,(Te,kt)=>(x(),E(Oe,{key:Te.key},[kt===0||Te.group!==j.value[kt-1].group?(x(),E("div",o$,F(Te.group),1)):me("",!0),i("button",{class:ze(["nav-btn",{active:M.value===Te.key}]),"data-tip":Te.name,onClick:xt=>ee(Te.key)},[be(He,{name:Te.icon,size:17},null,8,["name"]),i("span",a$,F(Te.name),1)],10,r$)],64))),128))]),i("div",i$,[i("span",l$,F((((Ae=n.value)==null?void 0:Ae.username)||"用户").slice(0,1).toUpperCase()),1),i("span",u$,F((lt=n.value)==null?void 0:lt.username),1),i("button",{class:"icon-btn",title:"退出登录",onClick:r},[be(He,{name:"export",size:15})])])]),i("div",c$,[i("header",d$,[i("span",f$,F(q.value.name),1),i("button",{class:"mob-search-btn",title:"搜索",onClick:Ue},[be(He,{name:"search",size:16})]),i("div",p$,[be(He,{name:"search",size:14,class:"gs-icon"}),Pe(i("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":Q[1]||(Q[1]=Te=>v.value=Te),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:$,onFocus:Q[2]||(Q[2]=Te=>y.value=!0),onBlur:de,onKeydown:Lt(I,["esc"])},null,544),[[Le,v.value]]),y.value&&v.value.trim()?(x(),E("div",v$,[T.value?(x(),E(Oe,{key:0},[m.value.logs.length?(x(),E("div",m$,"工作记录")):me("",!0),(x(!0),E(Oe,null,st(m.value.logs,Te=>(x(),E("div",{key:"l"+Te.id,class:"gs-item",onMousedown:Ut(kt=>J(Te),["prevent"])},[i("span",y$,F(Wt(Uo)(Te.category)),1),i("span",g$,F(Te.content),1),i("span",b$,F(Te.date),1)],40,h$))),128)),m.value.memos.length?(x(),E("div",w$,"备忘录")):me("",!0),(x(!0),E(Oe,null,st(m.value.memos,Te=>(x(),E("div",{key:"m"+Te.id,class:"gs-item",onMousedown:Ut(kt=>ae(Te),["prevent"])},[i("span",k$,F(Te.title||"无标题"),1),i("span",C$,F(Te.content),1)],40,_$))),128))],64)):(x(),E("div",x$,"无匹配结果"))])):me("",!0)])]),i("main",$$,[i("div",S$,[M.value==="calendar"?(x(),Ct(Vg,{key:0})):M.value==="today"?(x(),Ct(db,{key:1})):M.value==="plan"?(x(),Ct(gw,{key:2})):M.value==="stats"?(x(),Ct(Yw,{key:3})):M.value==="report"?(x(),Ct(j_,{key:4})):M.value==="ledger"?(x(),Ct($0,{key:5})):M.value==="memo"?(x(),Ct(U0,{key:6})):M.value==="vault"?(x(),Ct(Nk,{key:7})):M.value==="admin"?(x(),Ct(Ux,{key:8})):(x(),Ct(tx,{key:9}))])]),i("nav",E$,[(x(!0),E(Oe,null,st(Wt(Ie),Te=>(x(),E("button",{key:Te.key,class:ze(["tab-btn",{active:M.value===Te.key}]),onClick:kt=>ee(Te.key)},[be(He,{name:Te.icon,size:20},null,8,["name"]),i("span",null,F(Te.name),1)],10,A$))),128)),i("button",{class:ze(["tab-btn",{active:O.value}]),onClick:Q[3]||(Q[3]=Te=>Se.value=!0)},[be(He,{name:"more",size:20}),Q[12]||(Q[12]=i("span",null,"更多",-1))],2)]),Se.value?(x(),E("div",{key:0,class:"sheet-mask",onClick:Q[6]||(Q[6]=Te=>Se.value=!1)},[i("div",{class:"more-sheet",onClick:Q[5]||(Q[5]=Ut(()=>{},["stop"]))},[Q[14]||(Q[14]=i("div",{class:"sheet-handle"},null,-1)),i("div",T$,F((it=n.value)==null?void 0:it.username),1),(x(!0),E(Oe,null,st(A.value,Te=>(x(),E("button",{key:Te.key,class:"sheet-row",onClick:kt=>_e(Te.key)},[be(He,{name:Te.icon,size:18},null,8,["name"]),i("span",O$,F(Te.name),1),be(He,{name:"chevron-right",size:14,class:"sheet-go"})],8,P$))),128)),Q[15]||(Q[15]=i("div",{class:"sheet-divider"},null,-1)),i("button",{class:"sheet-row sheet-danger",onClick:Q[4]||(Q[4]=Te=>{Se.value=!1,r()})},[be(He,{name:"close",size:18}),Q[13]||(Q[13]=i("span",{class:"sheet-name"},"退出登录",-1))])])])):me("",!0),Me.value?(x(),E("div",{key:1,class:"msw-mask",onClick:Q[10]||(Q[10]=Ut(Te=>Me.value=!1,["self"]))},[i("div",M$,[i("div",I$,[be(He,{name:"search",size:16,class:"msw-icon"}),Pe(i("input",{ref_key:"msInput",ref:qe,class:"msw-input","onUpdate:modelValue":Q[7]||(Q[7]=Te=>v.value=Te),placeholder:"搜索工作记录与备忘录",onInput:$,onKeydown:Q[8]||(Q[8]=Lt(Te=>Me.value=!1,["esc"]))},null,544),[[Le,v.value]]),i("button",{class:"icon-btn",onClick:Q[9]||(Q[9]=Te=>{I(),Me.value=!1})},[be(He,{name:"close",size:16})])]),i("div",j$,[T.value?(x(),E(Oe,{key:0},[m.value.logs.length?(x(),E("div",D$,"工作记录")):me("",!0),(x(!0),E(Oe,null,st(m.value.logs,Te=>(x(),E("div",{key:"l"+Te.id,class:"msw-item",onMousedown:Ut(kt=>tt(Te),["prevent"])},[i("span",R$,F(Wt(Uo)(Te.category)),1),i("span",K$,F(Te.content),1),i("span",N$,F(Te.date),1)],40,L$))),128)),m.value.memos.length?(x(),E("div",F$,"备忘录")):me("",!0),(x(!0),E(Oe,null,st(m.value.memos,Te=>(x(),E("div",{key:"m"+Te.id,class:"msw-item",onMousedown:Ut(kt=>Ye(Te),["prevent"])},[i("span",B$,F(Te.title||"无标题"),1),i("span",U$,F(Te.content),1)],40,V$))),128))],64)):v.value.trim()?(x(),E("div",q$,"无匹配结果")):me("",!0)])])])):me("",!0)]),n.value?(x(),Ct(ix,{key:0})):me("",!0),i("div",H$,[be(Kv,{name:"toast"},{default:Sn(()=>[(x(!0),E(Oe,null,st(Wt(t),Te=>(x(),E("div",{key:Te.id,class:"toast"},F(Te.text),1))),128))]),_:1})])])):(x(),Ct(Zx,{key:0,onLogin:o}))}}}),W$=Vt(z$,[["__scopeId","data-v-ab53c58b"]]);function Vr(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",l=>{l.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const o=document.createElement("div");o.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",o.textContent=e+` + `+h:""),this.inner=h||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=Q[a]||c,this.inner=null)}return J(d).from(xt),s[a]=d,s},{}),_=(Ke.Syntax=SyntaxError,Ke.Type=TypeError,Ke.Range=RangeError,le.reduce(function(s,a){return s[a+"Error"]=Ke[a],s},{}));le=fe.reduce(function(s,a){return["Syntax","Type","Range"].indexOf(a)===-1&&(s[a+"Error"]=Ke[a]),s},{});function g(){}function C(s){return s}function D(s,a){return s==null||s===C?a:function(c){return a(s(c))}}function re(s,a){return function(){s.apply(this,arguments),a.apply(this,arguments)}}function pe(s,a){return s===g?a:function(){var c=s.apply(this,arguments),d=(c!==void 0&&(arguments[0]=c),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,a.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?re(d,this.onsuccess):d),p&&(this.onerror=this.onerror?re(p,this.onerror):p),h!==void 0?h:c}}function xe(s,a){return s===g?a:function(){s.apply(this,arguments);var c=this.onsuccess,d=this.onerror;this.onsuccess=this.onerror=null,a.apply(this,arguments),c&&(this.onsuccess=this.onsuccess?re(c,this.onsuccess):c),d&&(this.onerror=this.onerror?re(d,this.onerror):d)}}function we(s,a){return s===g?a:function(){var c=s.apply(this,arguments),d=(v(arguments[0],c),this.onsuccess),p=this.onerror,h=(this.onsuccess=null,this.onerror=null,a.apply(this,arguments));return d&&(this.onsuccess=this.onsuccess?re(d,this.onsuccess):d),p&&(this.onerror=this.onerror?re(p,this.onerror):p),c===void 0?h===void 0?void 0:h:v(c,h)}}function ke(s,a){return s===g?a:function(){return a.apply(this,arguments)!==!1&&s.apply(this,arguments)}}function ve(s,a){return s===g?a:function(){var c=s.apply(this,arguments);if(c&&typeof c.then=="function"){for(var d=this,p=arguments.length,h=new Array(p);p--;)h[p]=arguments[p];return c.then(function(){return a.apply(d,h)})}return a.apply(this,arguments)}}le.ModifyError=it,le.DexieError=Ae,le.BulkError=Te;var Re=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function V(s){Re=s}var te={},R=100,L=typeof Promise>"u"?[]:(fe=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[L=crypto.subtle.digest("SHA-512",new Uint8Array([0])),y(L),fe]:[fe,y(fe),fe]),fe=L[0],Ws=L[1],Ws=Ws&&Ws.then,je=fe&&fe.constructor,Je=!!L[2],ft=function(s,a){rn.push([s,a]),Ze&&(queueMicrotask(Wd),Ze=!1)},It=!0,Ze=!0,et=[],Bt=[],bt=C,wt={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:g,pgp:!1,env:{},finalize:g},Ne=wt,rn=[],ys=0,er=[];function De(s){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var a=this._PSD=Ne;if(typeof s!="function"){if(s!==te)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&Ta(this,this._value)}else this._state=null,this._value=null,++a.ref,function c(d,p){try{p(function(h){if(d._state===null){if(h===d)throw new TypeError("A promise cannot be resolved with itself.");var b=d._lib&&Vs();h&&typeof h.then=="function"?c(d,function(k,N){h instanceof De?h._then(k,N):h.then(k,N)}):(d._state=!0,d._value=h,kl(d)),b&&Bs()}},Ta.bind(null,d))}catch(h){Ta(d,h)}}(this,s)}var Aa={get:function(){var s=Ne,a=or;function c(d,p){var h=this,b=!s.global&&(s!==Ne||a!==or),k=b&&!Qn(),N=new De(function(X,U){Pa(h,new _l(xl(d,s,b,k),xl(p,s,b,k),X,U,s))});return this._consoleTask&&(N._consoleTask=this._consoleTask),N}return c.prototype=te,c},set:function(s){I(this,"then",s&&s.prototype===te?Aa:{get:function(){return s},set:Aa.set})}};function _l(s,a,c,d,p){this.onFulfilled=typeof s=="function"?s:null,this.onRejected=typeof a=="function"?a:null,this.resolve=c,this.reject=d,this.psd=p}function Ta(s,a){var c,d;Bt.push(a),s._state===null&&(c=s._lib&&Vs(),a=bt(a),s._state=!1,s._value=a,d=s,et.some(function(p){return p._value===d._value})||et.push(d),kl(s),c)&&Bs()}function kl(s){var a=s._listeners;s._listeners=[];for(var c=0,d=a.length;c{for(var b=et.length;b;)if(et[--b]._value===h._value)return et.splice(b,1)})(a),c.resolve(d)}catch(h){c.reject(h)}finally{--ys==0&&Oa(),--c.psd.ref||c.psd.finalize()}}function Wd(){gs(wt,function(){Vs()&&Bs()})}function Vs(){var s=It;return Ze=It=!1,s}function Bs(){var s,a,c;do for(;0.",$l="String expected.",ar="__dbnames",Ia="readonly",ja="readwrite";function ws(s,a){return s?a?function(){return s.apply(this,arguments)&&a.apply(this,arguments)}:s:a}var Sl={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ir(s){return typeof s!="string"||/\./.test(s)?function(a){return a}:function(a){return a[s]===void 0&&s in a&&delete(a=Ie(a))[s],a}}function El(){throw Ke.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function dt(s,a){try{var c=Al(s),d=Al(a);if(c!==d)return c==="Array"?1:d==="Array"?-1:c==="binary"?1:d==="binary"?-1:c==="string"?1:d==="string"?-1:c==="Date"?1:d!=="Date"?NaN:-1;switch(c){case"number":case"Date":case"string":return a{var k=U,N=b;if(typeof N!="function"&&N!==null)throw new TypeError("Class extends value "+String(N)+" is not a constructor or null");function X(){this.constructor=k}function U(){return b!==null&&b.apply(this,arguments)||this}return n(k,N),k.prototype=N===null?Object.create(N):(X.prototype=N.prototype,new X),Object.defineProperty(U.prototype,"db",{get:function(){return a},enumerable:!1,configurable:!0}),U.prototype.table=function(){return c},U})(s)),new Set),p=s.prototype;p;p=y(p))Object.getOwnPropertyNames(p).forEach(function(b){return d.add(b)});function h(b){if(!b)return b;var k,N=Object.create(s.prototype);for(k in b)if(!d.has(k))try{N[k]=b[k]}catch{}return N}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=h,this.hook("reading",h),s},St.prototype.defineClass=function(){return this.mapToClass(function(s){v(this,s)})},St.prototype.add=function(s,a){var c=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,b=s;return h&&p&&(b=ir(h)(s)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"add",keys:a!=null?[a]:null,values:[b]})}).then(function(k){return k.numFailures?De.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{q(s,h,k)}catch{}return k})},St.prototype.upsert=function(s,a){var c=this,d=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return c.core.get({trans:p,key:s}).then(function(h){var b=h??{};return Ol(b,a),d&&q(b,d,s),c.core.mutate({trans:p,type:"put",values:[b],keys:[s],upsert:!0,updates:{keys:[s],changeSpecs:[a]}}).then(function(k){return k.numFailures?De.reject(k.failures[0]):!!h})})})},St.prototype.update=function(s,a){return typeof s!="object"||f(s)?this.where(":id").equals(s).modify(a):(s=ee(s,this.schema.primKey.keyPath))===void 0?jt(new Ke.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(s).modify(a)},St.prototype.put=function(s,a){var c=this,d=this.schema.primKey,p=d.auto,h=d.keyPath,b=s;return h&&p&&(b=ir(h)(s)),this._trans("readwrite",function(k){return c.core.mutate({trans:k,type:"put",values:[b],keys:a!=null?[a]:null})}).then(function(k){return k.numFailures?De.reject(k.failures[0]):k.lastResult}).then(function(k){if(h)try{q(s,h,k)}catch{}return k})},St.prototype.delete=function(s){var a=this;return this._trans("readwrite",function(c){return a.core.mutate({trans:c,type:"delete",keys:[s]}).then(function(d){return lr(a,[s],d)}).then(function(d){return d.numFailures?De.reject(d.failures[0]):void 0})})},St.prototype.clear=function(){var s=this;return this._trans("readwrite",function(a){return s.core.mutate({trans:a,type:"deleteRange",range:Sl}).then(function(c){return lr(s,null,c)})}).then(function(a){return a.numFailures?De.reject(a.failures[0]):void 0})},St.prototype.bulkGet=function(s){var a=this;return this._trans("readonly",function(c){return a.core.getMany({keys:s,trans:c}).then(function(d){return d.map(function(p){return a.hook.reading.fire(p)})})})},St.prototype.bulkAdd=function(s,a,c){var d=this,p=Array.isArray(a)?a:void 0,h=(c=c||(p?void 0:a))?c.allKeys:void 0;return this._trans("readwrite",function(b){var k=d.schema.primKey,X=k.auto,k=k.keyPath;if(k&&p)throw new Ke.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ke.InvalidArgument("Arguments objects and keys must have the same length");var N=s.length,X=k&&X?s.map(ir(k)):s;return d.core.mutate({trans:b,type:"add",keys:p,values:X,wantResults:h}).then(function(U){var K=U.numFailures,B=U.failures;if(K===0)return h?U.results:U.lastResult;throw new Te("".concat(d.name,".bulkAdd(): ").concat(K," of ").concat(N," operations failed"),B)})})},St.prototype.bulkPut=function(s,a,c){var d=this,p=Array.isArray(a)?a:void 0,h=(c=c||(p?void 0:a))?c.allKeys:void 0;return this._trans("readwrite",function(b){var k=d.schema.primKey,X=k.auto,k=k.keyPath;if(k&&p)throw new Ke.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==s.length)throw new Ke.InvalidArgument("Arguments objects and keys must have the same length");var N=s.length,X=k&&X?s.map(ir(k)):s;return d.core.mutate({trans:b,type:"put",keys:p,values:X,wantResults:h}).then(function(U){var K=U.numFailures,B=U.failures;if(K===0)return h?U.results:U.lastResult;throw new Te("".concat(d.name,".bulkPut(): ").concat(K," of ").concat(N," operations failed"),B)})})},St.prototype.bulkUpdate=function(s){var a=this,c=this.core,d=s.map(function(b){return b.key}),p=s.map(function(b){return b.changes}),h=[];return this._trans("readwrite",function(b){return c.getMany({trans:b,keys:d,cache:"clone"}).then(function(k){var N=[],X=[],U=(s.forEach(function(K,B){var Y=K.key,z=K.changes,H=k[B];if(H){for(var W=0,se=Object.keys(z);WZ+ce&&W(Z+X)})})}var se=qs(c)&&c.limit===1/0&&(typeof s!="function"||z)&&{index:c.index,range:c.range};return W(0).then(function(){if(0{for(var Qe=Math.min(Ce.length,Be.length),at=-1,ct=0;ct=B})).length===0?De.resolve():(W.forEach(function(Z){H.push(function(){var ce,he,ge,Ee=se,Ce=Z._cfg.dbschema,Fe=(yr(K,Ee,z),yr(K,Ce,z),se=K._dbSchema=Ce,Ba(Ee,Ce)),$e=(Fe.add.forEach(function(Be){Ua(z,Be[0],Be[1].primKey,Be[1].indexes)}),Fe.change.forEach(function(Be){if(Be.recreate)throw new Ke.Upgrade("Not yet support for changing primary key");var ye=z.objectStore(Be.name);Be.add.forEach(function(Xe){return mr(ye,Xe)}),Be.change.forEach(function(Xe){ye.deleteIndex(Xe.name),mr(ye,Xe)}),Be.del.forEach(function(Xe){return ye.deleteIndex(Xe)})}),Z._cfg.contentUpgrade);if($e&&Z._cfg.version>B)return pr(K,z),Y._memoizedTables={},ce=oe(Ce),Fe.del.forEach(function(Be){ce[Be]=Ee[Be]}),Va(K,[K.Transaction.prototype]),vr(K,[K.Transaction.prototype],u(ce),ce),Y.schema=ce,(he=We($e))&&Us(),Ce=De.follow(function(){var Be;(ge=$e(Y))&&he&&(Be=Qn.bind(null,null),ge.then(Be,Be))}),ge&&typeof ge.then=="function"?De.resolve(ge):Ce.then(function(){return ge})}),H.push(function(ce){var he,ge,Ee=Z._cfg.dbschema;he=Ee,ge=ce,[].slice.call(ge.db.objectStoreNames).forEach(function(Ce){return he[Ce]==null&&ge.db.deleteObjectStore(Ce)}),Va(K,[K.Transaction.prototype]),vr(K,[K.Transaction.prototype],K._storeNames,K._dbSchema),Y.schema=K._dbSchema}),H.push(function(ce){K.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(K.idbdb.version/10)===Z._cfg.version?(K.idbdb.deleteObjectStore("$meta"),delete K._dbSchema.$meta,K._storeNames=K._storeNames.filter(function(he){return he!=="$meta"})):ce.objectStore("$meta").put(Z._cfg.version,"version"))})}),function Z(){return H.length?De.resolve(H.shift()(Y.idbtrans)).then(Z):De.resolve()}().then(function(){Fl(se,z)}))}).catch(b);var N,X;u(p).forEach(function(U){Ua(c,U,p[U].primKey,p[U].indexes)}),pr(s,c),De.follow(function(){return s.on.populate.fire(h)}).catch(b)})}function af(s,a){Fl(s._dbSchema,a),a.db.version%10!=0||a.objectStoreNames.contains("$meta")||a.db.createObjectStore("$meta").add(Math.ceil(a.db.version/10-1),"version");var c=hr(0,s.idbdb,a);yr(s,s._dbSchema,a);for(var d=0,p=Ba(c,s._dbSchema).change;d{if(b.change.length||b.recreate)return console.warn("Unable to patch indexes of table ".concat(b.name," because it has changes on the type of index or primary key.")),{value:void 0};var k=a.objectStore(b.name);b.add.forEach(function(N){Re&&console.debug("Dexie upgrade patch: Creating missing index ".concat(b.name,".").concat(N.src)),mr(k,N)})})(p[d]);if(typeof h=="object")return h.value}}function Ba(s,a){var c,d={del:[],add:[],change:[]};for(c in s)a[c]||d.del.push(c);for(c in a){var p=s[c],h=a[c];if(p){var b={name:c,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||p.primKey.auto!==h.primKey.auto)b.recreate=!0,d.change.push(b);else{var k=p.idxByName,N=h.idxByName,X=void 0;for(X in k)N[X]||b.del.push(X);for(X in N){var U=k[X],K=N[X];U?U.src!==K.src&&b.change.push(K):b.add.push(K)}(0{var s,a,c;return typeof FinalizationRegistry<"u"&&typeof WeakRef<"u"?(s=new Set,a=new FinalizationRegistry(function(d){s.delete(d)}),{toArray:function(){return Array.from(s).map(function(d){return d.deref()}).filter(function(d){return d!==void 0})},add:function(d){var p=new WeakRef(d._novip);s.add(p),a.register(d._novip,p,p),s.size>d._options.maxConnections&&(p=s.values().next().value,s.delete(p),a.unregister(p))},remove:function(d){if(d)for(var p=s.values(),h=p.next();!h.done;){var b=h.value;if(b.deref()===d._novip)return s.delete(b),void a.unregister(b);h=p.next()}}}):(c=[],{toArray:function(){return c},add:function(d){c.push(d._novip)},remove:function(d){d&&(d=c.indexOf(d._novip))!==-1&&c.splice(d,1)}})})();function qa(s,a){var c=s._dbNamesDB;return c||(c=s._dbNamesDB=new Vn(ar,{addons:[],indexedDB:s,IDBKeyRange:a})).version(1).stores({dbnames:"name"}),c.table("dbnames")}function Ha(s){return s&&typeof s.databases=="function"}function za(s){return Xn(function(){return Ne.letThrough=!0,s()})}function Wa(s){return!("from"in s)}var Gt=function(s,a){var c;if(!this)return c=new Gt,s&&"d"in s&&v(c,s),c;v(this,arguments.length?{d:1,from:s,to:1Math.pow(2,62)?0:W.oldVersion,K=se<1,s.idbdb=H.result,h&&af(s,U),rf(s,se/10,U,Y))},Y),H.onsuccess=Pt(function(){U=null;var W,se,Z,ce,he,ge,Ee=s.idbdb=H.result,Ce=ue(Ee.objectStoreNames);if(0"u"?De.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(B){function Y(){return indexedDB.databases().finally(B)}N=setInterval(Y,100),Y()}).finally(function(){return clearInterval(N)}):Promise.resolve()).then(k)]).then(function(){return b(),a.onReadyBeingFired=[],De.resolve(za(function(){return s.on.ready.fire(s.vip)})).then(function B(){var Y;if(0a.limit?d.length=a.limit:s.length===a.limit&&d.length{if(c===void 0)return d!==void 0?-1:0;if(d===void 0)return 1;if((c=dt(c,d))===0){if(p&&h)return 0;if(p)return 1;if(h)return-1}return c})(s.lower,a.lower,s.lowerOpen,a.lowerOpen)<=0&&0<=((c,d,p,h)=>{if(c===void 0)return d!==void 0?1:0;if(d===void 0)return-1;if((c=dt(c,d))===0){if(p&&h)return 0;if(p)return-1;if(h)return 1}return c})(s.upper,a.upper,s.upperOpen,a.upperOpen)}function mf(s,a,c,d){s.subscribers.add(c),d.addEventListener("abort",function(){var p,h;s.subscribers.delete(c),s.subscribers.size===0&&(p=s,h=a,setTimeout(function(){p.subscribers.size===0&&Ue(h,p)},3e3))})}var hf={stack:"dbcore",level:0,name:"Cache",create:function(s){var a=s.schema.name;return o(o({},s),{transaction:function(c,d,p){var h,b,k=s.transaction(c,d,p);return d==="readwrite"&&(p=(h=new AbortController).signal,k.addEventListener("abort",(b=function(N){return function(){if(h.abort(),d==="readwrite"){for(var X=new Set,U=0,K=c;U{var se=_s["idb://".concat(Y,"/").concat(z)];if(!se)return[];if(!(Y=se.queries[H]))return[null,!1,se,null];var Z=Y[(W.query?W.query.index.name:null)||""];if(!Z)return[null,!1,se,null];switch(H){case"query":var ce=(he=W.direction)!=null?he:"next",he=Z.find(function(ge){var Ee;return ge.req.limit===W.limit&&ge.req.values===W.values&&((Ee=ge.req.direction)!=null?Ee:"next")===ce&&Xl(ge.req.query.range,W.query.range)});return he?[he,!0,se,Z]:[Z.find(function(ge){var Ee;return("limit"in ge.req?ge.req.limit:1/0)>=W.limit&&((Ee=ge.req.direction)!=null?Ee:"next")===ce&&(!W.values||ge.req.values)&&vf(ge.req.query.range,W.query.range)}),!1,se,Z];case"count":return he=Z.find(function(ge){return Xl(ge.req.query.range,W.query.range)}),[he,!!he,se,Z]}})(a,c,"query",h),B=K[0],X=K[2],U=K[3],B&&K[1]?B.obsSet=h.obsSet:(K=d.query(h).then(function(Y){var z=Y.result;if(B&&(B.res=z),b){for(var H=0,W=z.length;H{var he=Vs();try{h&&Us();var ge=Xn(s,ce);return ge=h?ge.finally(Qn):ge}finally{he&&Bs()}})(se={subscr:W,signal:b.signal,requery:B,querier:s,trans:null}),K||(ts.storagemutated.subscribe(z),K=!0),Promise.resolve(Z).then(function(ce){c=!0,a=ce,k||se.signal.aborted||(Y()||(X=W,Y())?B():(N={},Ma(function(){return!k&&p.next&&p.next(ce)})))},function(ce){c=!1,["DatabaseClosedError","AbortError"].includes(ce==null?void 0:ce.name)||k||Ma(function(){k||p.error&&p.error(ce)})}))};return setTimeout(B,0),U});return d.hasValue=function(){return c},d.getValue=function(){return a},d}var ks=Vn;function si(s){var a=ns;try{ns=!0,ts.storagemutated.fire(s),Xa(s,!0)}finally{ns=a}}T(ks,o(o({},le),{delete:function(s){return new ks(s,{addons:[]}).delete()},exists:function(s){return new ks(s,{addons:[]}).open().then(function(a){return a.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(s){try{return a=ks.dependencies,c=a.indexedDB,a=a.IDBKeyRange,(Ha(c)?Promise.resolve(c.databases()).then(function(d){return d.map(function(p){return p.name}).filter(function(p){return p!==ar})}):qa(c,a).toCollection().primaryKeys()).then(s)}catch{return jt(new Ke.MissingAPI)}var a,c},defineClass:function(){return function(s){v(this,s)}},ignoreTransaction:function(s){return Ne.trans?gs(Ne.transless||wt,s):s()},vip:za,async:function(s){return function(){try{var a=Qa(s.apply(this,arguments));return a&&typeof a.then=="function"?a:De.resolve(a)}catch(c){return jt(c)}}},spawn:function(s,a,c){try{var d=Qa(s.apply(c,a||[]));return d&&typeof d.then=="function"?d:De.resolve(d)}catch(p){return jt(p)}},currentTransaction:{get:function(){return Ne.trans||null}},waitFor:function(s,a){return s=De.resolve(typeof s=="function"?ks.ignoreTransaction(s):s).timeout(a||6e4),Ne.trans?Ne.trans.waitFor(s):s},Promise:De,debug:{get:function(){return Re},set:function(s){V(s)}},derive:J,extend:v,props:T,override:G,Events:po,on:ts,liveQuery:Ql,extendObservabilitySet:br,getByKeyPath:ee,setByKeyPath:q,delByKeyPath:function(s,a){typeof a=="string"?q(s,a,void 0):"length"in a&&[].map.call(a,function(c){q(s,c,void 0)})},shallowClone:oe,deepClone:Ie,getObjectDiff:Za,cmp:dt,asap:M,minKey:-1/0,addons:[],connections:{get:go.toArray},errnames:kt,dependencies:Cr,cache:_s,semVer:"4.4.6",version:"4.4.6".split(".").map(function(s){return parseInt(s)}).reduce(function(s,a,c){return s+a/Math.pow(10,2*c)})})),ks.maxKey=ho(ks.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(ts(fr,function(s){ns||(s=new CustomEvent(Ra,{detail:s}),ns=!0,dispatchEvent(s),ns=!1)}),addEventListener(Ra,function(s){s=s.detail,ns||si(s)}));var Gs,ns=!1,Zl=function(){};return typeof BroadcastChannel<"u"&&((Zl=function(){(Gs=new BroadcastChannel(Ra)).onmessage=function(s){return s.data&&si(s.data)}})(),typeof Gs.unref=="function"&&Gs.unref(),ts(fr,function(s){ns||Gs.postMessage(s)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(s){if(!Vn.disableBfCache&&s.persisted){Re&&console.debug("Dexie: handling persisted pagehide"),Gs!=null&&Gs.close();for(var a=0,c=go.toArray();a{const o={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};await n.table("log_item").toCollection().modify(r=>{r.category&&o[r.category]&&(r.category=o[r.category])})}),this.version(6).stores({plan:"++id, date, status, goal_id",goal:"++id, start_date"})}}let ie;function mm(e){ie=e}function pl(){ie&&ie.close(),ie=void 0}const hm=6,Bu=["公司","客户现场","出差","居家办公"],ym={dev:"项目实操",test:"项目实操",bugfix:"售后服务",learning:"产品学习",meeting:"打杂",doc:"打杂",other:"打杂"};function qo(e){return ym[e]||e}function Io(e){return e<10?"0"+e:String(e)}function us(e){return e.getFullYear()+"-"+Io(e.getMonth()+1)+"-"+Io(e.getDate())}function ut(){return us(new Date)}function gt(){const e=new Date;return us(e)+"T"+Io(e.getHours())+":"+Io(e.getMinutes())+":"+Io(e.getSeconds())}function Wn(e){if(!e)return"--:--";const t=e.indexOf("T");return t>=0?e.slice(t+1,t+6):e.slice(0,5)}function Gn(e){const t=e.split("-").map(Number);return new Date(t[0],t[1]-1,t[2])}function Ft(e,t){const n=Gn(e);return n.setDate(n.getDate()+t),us(n)}function Ho(e,t){const n=Gn(e),o=n.getDate();n.setDate(1),n.setMonth(n.getMonth()+t);const r=new Date(n.getFullYear(),n.getMonth()+1,0).getDate();return n.setDate(Math.min(o,r)),us(n)}function Zs(e){const t=Gn(e),n=(t.getDay()+6)%7;return t.setDate(t.getDate()-n),us(t)}function gm(e){const t=Gn(e).getDay();return t===0||t===6}function bm(e,t){return Math.round((new Date(t).getTime()-new Date(e).getTime())/6e4)}function bd(e){const t=Gn(e),n=["周日","周一","周二","周三","周四","周五","周六"];return t.getFullYear()+" 年 "+(t.getMonth()+1)+" 月 "+t.getDate()+" 日 "+n[t.getDay()]}const wm=15e4;function Ri(e){const t=new Uint8Array(e);let n="";for(let o=0;o({}));if(!r.ok){const u=l&&l.error||"服务返回 "+r.status;throw e==="register"&&r.status===409?new Error("云端已有同名账号且密码一致,直接登录即可"):new Error(String(u))}if(!l.userId||!l.username)throw new Error("登录响应异常");return{userId:String(l.userId),username:String(l.username)}}async function yl(e,t,n){const o=await Nm(n,e,t);ra(o.userId);const r={userId:o.userId,username:o.username};return Rm(r),$d(o.username,t),r}async function Fm(e,t){const n=(e||"").trim();if(!n||!t)throw new Error("请输入用户名与密码");return yl(n,t,"login")}async function Vm(e,t,n){const o=(e||"").trim();if(o.length<2||o.length>20)throw new Error("用户名需 2 到 20 个字符");if(t.length<6)throw new Error("登录密码至少 6 位");return yl(o,t,"register")}async function Bm(){const e=hn();if(!e)return null;try{return await yl(e.username,e.password,"login")}catch{return null}}async function Um(){sa(),pl(),oa=null,xd()}function qm(){sa(),pl(),oa=null,xd(),Km()}async function Hm(e,t){if(!eo())throw new Error("未登录");if(t.length<6)throw new Error("新密码至少 6 位");const o=hn();if(!o||o.password!==e)throw new Error("旧密码不正确");const r=await Ns();let l;try{l=await fetch(r+"/api/auth/password",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+Sd()},body:JSON.stringify({oldPassword:e,newPassword:t})})}catch{throw new Error("无法连接同步服务器")}if(!l.ok){const u=await l.json().catch(()=>({}));throw new Error(u&&u.error||"修改失败 "+l.status)}$d(o.username,t)}async function zm(){if(!eo())throw new Error("未登录");const t=await Ns();let n;try{n=await fetch(t+"/api/auth/delete",{method:"POST",headers:{Authorization:"Bearer "+Sd()}})}catch{throw new Error("无法连接同步服务器")}if(!n.ok){const o=await n.json().catch(()=>({}));throw new Error(o&&o.error||"删除失败 "+n.status)}qm()}function Sd(){return $a()}const Fi=P(null),Vi=P(null),Jo=P(0);function As(){Jo.value++}const Ed=P(0);function Wm(){Ed.value++}const to=P(""),ao=["project","work_log","log_item","attendance","weekly_note","setting","memo","credential","goal","transaction","plan"],Xs=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);function Lr(e){return JSON.stringify(e)}async function Gm(e){return ie.table(e).toArray()}function Rr(e,t){return e==="setting"?t.key:t.id}async function Ym(){for(const e of ao){const t=ie.table(e),n=await t.toArray();for(const o of n){if(e==="setting"&&Xs.has(o.key))continue;const r={};o.uuid||(r.uuid=Jm()),!o.updated_at&&o.created_at&&(r.updated_at=o.created_at),Object.keys(r).length&&await t.update(Rr(e,o),r)}}}function Jm(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"u"+Date.now().toString(36)+Math.random().toString(36).slice(2,10)}async function Xm(){return hn()!=null}async function Qm(){try{return localStorage.getItem("dsh_last_sync")||""}catch{return""}}async function Zm(e){try{localStorage.setItem("dsh_last_sync",e)}catch{}}async function Ad(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 o=await n.json();if(!o||!o.token)throw new Error("云端登录异常");return String(o.token)}async function eh(e,t){let n=$a();return n||(n=await Ad(e,t),zo(n),n)}async function Td(){const e=hn();if(!e)throw new Error("未登录");const t=await Ns(),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 Bi(){const e=hn();if(!e)throw new Error("未登录,无法同步");return Id({baseUrl:await Ns(),username:e.username,password:e.password})}async function Pd(){try{await Bi()}catch(e){to.value=e instanceof Error?e.message:String(e);try{await Bi()}catch{}}}function Od(e,t,n){const o={};for(const r of Object.keys(t))r!=="id"&&(o[r]=t[r]);if(e==="log_item"){delete o.work_log_id,delete o.project_id;const r=t.work_log_id?n.workLog.get(t.work_log_id):null;r&&r.uuid&&(o.wuuid=r.uuid);const l=t.project_id?n.project.get(t.project_id):null;l&&l.uuid&&(o.puuid=l.uuid)}if(e==="plan"){delete o.goal_id;const r=t.goal_id?n.goal.get(t.goal_id):null;r&&r.uuid&&(o.guuid=r.uuid)}return o}async function Md(){const e=await ie.work_log.toArray(),t=await ie.project.toArray(),n=await ie.goal.toArray();return{workLog:new Map(e.map(o=>[o.id,o])),project:new Map(t.map(o=>[o.id,o])),goal:new Map(n.map(o=>[o.id,o]))}}let jo=!1,Kr=!1,Ui=!1,no=null,Pn=null,qi="",Hi=!1,Nr=null;async function so(){if(jo){Kr=!0;return}try{if(!await Xm())return;await Id(await th()),to.value=""}catch(e){to.value=e instanceof Error?e.message:String(e)}}async function th(){const e=hn();if(!e)throw new Error("未登录,无法同步");return{baseUrl:await Ns(),username:e.username,password:e.password}}function nh(){if(Hi)return;Hi=!0,Nr=pm(async()=>{const t={};for(const n of ao)t[n]=await ie.table(n).count();return t}).subscribe({next:()=>{Ui||jo||(no&&globalThis.clearTimeout(no),no=globalThis.setTimeout(()=>{so()},3e3))},error:()=>{}})}function sh(){Nr&&(Nr.unsubscribe(),Nr=null),Pn&&(Pn.close(),Pn=null,qi=""),no&&(globalThis.clearTimeout(no),no=null),Hi=!1}function oh(e,t){const n=e+"|"+t;if(!(Pn&&qi===n)){Pn&&(Pn.close(),Pn=null);try{Pn=new EventSource(e+"/api/events?token="+encodeURIComponent(t)),qi=n,Pn.onmessage=()=>{so()}}catch{Pn=null}}}async function Id(e){if(jo)return Kr=!0,{pushed:0,pulled:0,removed:0,errors:0,at:""};jo=!0,Ui=!0;try{const t=await zi(e);return Kr&&(Kr=!1,globalThis.setTimeout(()=>{so()},800)),t}finally{jo=!1,Ui=!1}}async function zi(e,t=!1){var ee;const n=e.baseUrl.trim().replace(/\/+$/,"");if(!n)throw new Error("请先配置同步服务地址");await Ym();const o=await Md(),r=await ie.sync_mirror.toArray(),l=new Map;for(const q of r)l.set(q.table+"|"+q.uuid,q);const u={},f=[];let v=0;for(const q of ao){let oe=await Gm(q);q==="setting"&&(oe=oe.filter(A=>!Xs.has(A.key)));const j=new Map;for(const A of oe)j.set(A.uuid,A);for(const[A,O]of j){const ne=Od(q,O,o),Ie=Lr(ne),Se=l.get(q+"|"+A);(!Se||Se.hash!==Ie)&&(u[q]=u[q]||[],u[q].push(ne),v++)}for(const[A,O]of l)A.startsWith(q+"|")&&!j.has(O.uuid)&&f.push({table:q,uuid:O.uuid,deleted_at:gt()});u[q]=u[q]||[]}f.push(...uh());const y=await eh(n,e),m=q=>fetch(n+"/api/sync",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"Bearer "+q},body:JSON.stringify({device:"client",tables:u,tombstones:f})});let w=await m(y);if(w.status===401){zo("");const q=await Ad(n,e);zo(q),w=await m(q)}if(!w.ok)throw new Error("同步服务返回 "+w.status);const T=await w.json(),$=String(T.dataEpoch||""),I="dsh_sync_epoch_"+(((ee=hn())==null?void 0:ee.username)||"anon"),J=$?localStorage.getItem(I):null;if(!t&&J&&$&&J!==$)return await ie.sync_mirror.clear(),localStorage.setItem(I,$),zi(e,!0);const ae=T.tables||{},de=T.tombstones||[],ue=ao.reduce((q,oe)=>q+(ae[oe]||[]).length,0),G=r.length-f.length;if(!t&&ue0||S.removed>0||v>0)&&As(),{pushed:v,pulled:S.changed,removed:S.removed,errors:0,at:M}}function jd(){var t;return"dsh_idmap_"+(((t=hn())==null?void 0:t.username)||"anon")}function rh(){try{const e=localStorage.getItem(jd());if(e)return JSON.parse(e)}catch{}return{}}function ah(e){try{localStorage.setItem(jd(),JSON.stringify(e))}catch{}}async function ih(e,t){const n=rh(),o=new Set(t.map($=>$.table+"|"+$.uuid)),r=new Map;for(const $ of await ie.sync_mirror.toArray())r.set($.table+"|"+$.uuid,$);const l=new Set(Array.from(r.keys()).map($=>$.split("|")[1]));let u=0,f=0;const v={},y={},m={};for(const $ of ao){const I=ie.table($),J=await I.toArray(),ae=new Map(J.map(A=>[Rr($,A),A])),de=new Map(J.filter(A=>A.uuid).map(A=>[A.uuid,A])),ue=(e[$]||[]).filter(A=>A&&typeof A=="object"&&A.uuid).filter(A=>!o.has($+"|"+A.uuid)),G=ue.filter(A=>!($==="setting"&&Xs.has(A.key))),S=ue.filter(A=>$==="setting"&&Xs.has(A.key));for(const A of S)lh($,A.uuid);const M=$==="setting"?[]:J.filter(A=>A.uuid&&!l.has(A.uuid)&&!o.has($+"|"+A.uuid)),ee={v:Math.max(0,...J.map(A=>Number(A.id)||0))};G.length;const q=[];for(const A of G){const O={...A};if($==="log_item"){const Se=O.wuuid?v[O.wuuid]:void 0;if(!Se)continue;O.work_log_id=Se,delete O.wuuid,O.project_id=O.puuid?y[O.puuid]??null:null,delete O.puuid}if($==="plan")if(O.guuid){const Se=m[O.guuid];O.goal_id=Se??null,delete O.guuid}else O.goal_id=null;let ne=Rr($,A);if($==="setting")ne=A.key;else{const Se=n[$]&&n[$][A.uuid],_e=de.get(A.uuid);_e&&_e.id!=null?ne=_e.id:typeof Se=="number"?ne=Se:ne=++ee.v}const Ie={...O,id:ne};$==="setting"&&Xs.has(Ie.key)||(q.push(Ie),$==="work_log"&&(v[A.uuid]=ne),$==="project"&&(y[A.uuid]=ne),$==="goal"&&(m[A.uuid]=ne))}const oe=q.concat(M);for(const A of oe){const O=ae.get(Rr($,A));(!O||Lr(O)!==Lr(A))&&u++}f+=J.filter(A=>A.uuid&&!q.some(O=>O.uuid===A.uuid)&&!o.has($+"|"+A.uuid)).length,await I.clear(),oe.length&&await I.bulkPut(oe);const j={};for(const A of oe)A.uuid&&(j[A.uuid]=A.id);n[$]=j}ah(n);const w=await Md(),T=[];for(const $ of ao){const I=await ie.table($).toArray();for(const J of I)$==="setting"&&Xs.has(J.key)||J.uuid&&T.push({table:$,uuid:J.uuid,hash:Lr(Od($,J,w))})}return await ie.sync_mirror.clear(),T.length&&await ie.sync_mirror.bulkAdd(T.map($=>({...$}))),await ie.tombstone.clear(),{changed:u,removed:f+aa.length}}const aa=[];function lh(e,t){aa.some(n=>n.table===e&&n.uuid===t)||aa.push({table:e,uuid:t,deleted_at:gt()})}function uh(){return aa.splice(0)}const ch=new Set(["sync_cursor","sync_last_time","sync_token","last_project","last_category"]);async function ht(){await Pd()}async function Tt(e,t){const n=await ie.setting.get(e);return n?n.value:t}async function Nt(e,t){await ie.setting.put({key:e,value:t}),ch.has(e)||await ht()}async function ms(){const e=await Promise.all([Tt("work_start","09:00"),Tt("work_end","18:00"),Tt("grace_minutes","10"),Tt("lunch_minutes","60"),Tt("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 dh(){return Tt("last_location","")}async function fh(e,t){const n=t.trim();await Nt("last_location",n),n&&await ia(n);let o=!1;const r=await Fs(e);r&&r.id?(r.location||"")!==n&&(await ie.attendance.update(r.id,{location:n||null}),o=!0):n&&(await ie.attendance.add({date:e,clock_in_at:null,clock_out_at:null,kind:"normal",note:null,location:n,created_at:gt()}),o=!0),o&&await ht()}async function gl(){const e=await Tt("location_presets","");if(!e)return Bu.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 Bu.slice()}async function Dd(e){const t=Array.from(new Set(e.map(n=>n.trim()).filter(Boolean)));await Nt("location_presets",JSON.stringify(t))}async function ia(e){const t=e.trim();if(!t)return;const n=await gl();n.includes(t)||await Dd([...n,t])}async function io(e=!1){const t=await ie.project.orderBy("name").toArray();return e?t:t.filter(n=>n.archived!==1)}async function ph(e){await ie.project.add({name:e.trim(),archived:0,created_at:gt()}),await ht()}async function vh(e,t){await ie.project.update(e,{name:t.trim()}),await ht()}async function mh(e,t){await ie.project.update(e,{archived:t?1:0}),await ht()}async function Fs(e){return ie.attendance.where("date").equals(e).first()}async function hh(e,t){const n=((t===void 0?await Tt("last_location",""):t)||"").trim();let o=!1;const r=await Fs(e);if(r&&r.id){if(!r.clock_in_at){const l={clock_in_at:gt()};n&&(l.location=n),await ie.attendance.update(r.id,l),o=!0}n&&(await Tt("last_location","")!==n&&await Nt("last_location",n),await ia(n)),o&&await ht();return}await ie.attendance.add({date:e,clock_in_at:gt(),clock_out_at:null,kind:"normal",note:null,location:n||null,created_at:gt()}),n&&(await Nt("last_location",n),await ia(n)),await ht()}async function yh(e){const t=await Fs(e);t&&t.id&&t.clock_in_at&&!t.clock_out_at&&(await ie.attendance.update(t.id,{clock_out_at:gt()}),await ht())}async function gh(e,t,n,o,r){(r||"").trim()&&await ia(r);const l=await Fs(e),u={date:e,clock_in_at:t,clock_out_at:n,kind:"makeup",note:o||null,location:(r||"").trim()||null,created_at:gt()};l&&l.id?await ie.attendance.update(l.id,u):await ie.attendance.add(u),await ht()}async function bh(e,t,n){const o=(n||"").trim();if(!o)return;const r=await Fs(e);r&&r.id&&(await ie.attendance.update(r.id,{[t]:e+"T"+o+":00"}),await ht())}async function Xo(e,t){return ie.attendance.where("date").between(e,t,!0,!0).toArray()}async function wh(e,t){const n=await Fs(e);if(t){const o={date:e,kind:"leave",clock_in_at:null,clock_out_at:null,created_at:gt()};n&&n.id?await ie.attendance.update(n.id,o):await ie.attendance.add({...o,note:null,location:null})}else n&&n.id&&await ie.attendance.update(n.id,{kind:"normal"});await ht()}async function _h(e){const t=await ie.work_log.where("date").equals(e).first();return t||{id:await ie.work_log.add({date:e,created_at:gt()}),date:e,created_at:gt()}}async function kh(e){return ie.work_log.where("date").equals(e).first()}async function Ch(e){const t=await kh(e);return!t||!t.id?[]:(await ie.log_item.where("work_log_id").equals(t.id).toArray()).sort((o,r)=>r.id-o.id)}async function xh(e,t){const n=await ie.work_log.where("date").equals(e).first();let o;n&&n.id?o=n:o=await _h(e),await ie.table("log_item").add({work_log_id:o.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:gt()});const r=t.project_id?String(t.project_id):"";await Tt("last_project","")!==r&&await Nt("last_project",r),await Tt("last_category","")!==t.category&&await Nt("last_category",t.category),await ht()}async function bi(e,t){await ie.table("log_item").update(e,t),await ht()}async function $h(e){await ie.table("log_item").delete(e),await ht()}async function Qo(e,t){const n=await ie.work_log.where("date").between(e,t,!0,!0).toArray();if(!n.length)return[];const o=new Map(n.map(l=>[l.id,l.date]));return(await ie.table("log_item").where("work_log_id").anyOf(n.map(l=>l.id)).toArray()).map(l=>({...l,date:o.get(l.work_log_id)||""})).sort((l,u)=>l.date===u.date?l.id-u.id:l.daten.start_time!!t.timer_started_at).toArray();return e.length?e[0]:null}async function Ph(e){const t=gt();await ie.plan.add({date:e.date,start_time:e.start_time,end_time:e.end_time,title:e.title.trim(),kind:e.kind.trim()||"其他",note:e.note||null,status:"todo",actual_minutes:0,timer_started_at:null,uuid:"",created_at:t,updated_at:t}),await ht()}async function Oh(e,t){await ie.plan.update(e,{...t,updated_at:gt()}),await ht()}async function Mh(e){await ie.plan.delete(e),await ht()}async function Ih(e,t){const n=await ie.plan.get(e);n&&(t!=="todo"&&n.timer_started_at&&await Sa(e),await ie.plan.update(e,{status:t,updated_at:gt()}),await ht())}async function jh(e){const t=await ie.plan.filter(n=>!!n.timer_started_at).toArray();for(const n of t)n.id!==e&&await Sa(n.id);await ie.plan.update(e,{timer_started_at:gt(),updated_at:gt()}),await ht()}async function Sa(e){const t=await ie.plan.get(e);if(!t||!t.timer_started_at)return;const n=Math.max(0,Math.round((Date.now()-new Date(t.timer_started_at).getTime())/6e4));await ie.plan.update(e,{actual_minutes:(t.actual_minutes||0)+n,timer_started_at:null,updated_at:gt()}),await ht()}const Dh=366;function Lh(e,t){const n=[];let o=e,r=0;for(;o<=t&&rr.status==="done").length,total:o.length})}return t}async function Kh(){return(await ie.goal.toArray()).sort((t,n)=>t.start_datet.updated_at[u.id,u.date]));return(await ie.table("log_item").toArray()).filter(u=>((u.content||"")+" "+(u.takeaway||"")+" "+(u.remark||"")).toLowerCase().includes(n)).sort((u,f)=>f.id-u.id).slice(0,t).map(u=>({...u,date:r.get(u.work_log_id)||""}))}async function Wh(e,t=4){const n=e.trim().toLowerCase();return n?(await ie.memo.toArray()).filter(r=>((r.title||"")+" "+(r.content||"")).toLowerCase().includes(n)).sort((r,l)=>r.updated_atn{await Promise.all([ie.project.clear(),ie.work_log.clear(),o.clear(),ie.attendance.clear(),ie.weekly_note.clear(),ie.setting.clear(),ie.memo.clear(),ie.credential.clear(),r.clear(),u.clear(),l.clear()]),n.project&&n.project.length&&await ie.project.bulkAdd(n.project),n.work_log&&n.work_log.length&&await ie.work_log.bulkAdd(n.work_log),n.log_item&&n.log_item.length&&await o.bulkAdd(n.log_item),n.attendance&&n.attendance.length&&await ie.attendance.bulkAdd(n.attendance),n.weekly_note&&n.weekly_note.length&&await ie.weekly_note.bulkAdd(n.weekly_note),n.setting&&n.setting.length&&await ie.setting.bulkAdd(n.setting),n.memo&&n.memo.length&&await ie.memo.bulkAdd(n.memo),n.credential&&n.credential.length&&await ie.credential.bulkAdd(n.credential),n.transaction&&n.transaction.length&&await r.bulkAdd(n.transaction),n.goal&&n.goal.length&&await u.bulkAdd(n.goal),n.plan&&n.plan.length&&await l.bulkAdd(n.plan)}),await ht()}const ny=["制度学习","产品学习","打杂","项目实操","售后服务"],sy=["餐饮","交通","住房","通讯","学习","娱乐","其他"],oy=["工资","报销","其他"],Ld="log_categories",Rd="ledger_expense_categories",Kd="ledger_income_categories";function Nd(e,t){if(!e)return t.slice();try{const n=JSON.parse(e);if(Array.isArray(n)){const o=n.filter(r=>typeof r=="string"&&r.trim()).map(r=>r.trim());if(o.length)return Array.from(new Set(o))}}catch{}return t.slice()}async function Zo(){return Nd(await Tt(Ld,""),ny)}async function ry(e){await Nt(Ld,JSON.stringify(e))}async function la(e){return Nd(await Tt(e==="expense"?Rd:Kd,""),e==="expense"?sy:oy)}async function Wi(e,t){await Nt(e==="expense"?Rd:Kd,JSON.stringify(t))}const ay={class:"dialog",role:"dialog","aria-label":"编辑工作记录"},iy={class:"dialog-head"},ly={class:"dialog-title"},uy={key:0,class:"muted dialog-sub"},cy={class:"dialog-body"},dy={class:"form-grid"},fy={class:"field span2"},py={key:0,class:"form-error"},vy={class:"field"},my=["value"],hy={class:"field"},yy=["value"],gy={class:"field"},by={class:"min-chips"},wy=["onClick"],_y={class:"field"},ky={class:"field span2"},Cy={class:"field"},xy={class:"field"},$y={class:"dialog-btns"},Sy=Kt({__name:"EditLogDialog",props:{open:{type:Boolean},item:{},projects:{},date:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=P([]);Zo().then(ue=>{n.value=ue});const o=e,r=t,l=P(""),u=P(null),f=P("dev"),v=P(null),y=P(""),m=P(""),w=P(0),T=P(0),$=P(""),I=P(null),J=nt(()=>{var S;const ue=o.projects.filter(M=>M.archived!==1),G=(S=o.item)==null?void 0:S.project_id;if(G&&!ue.some(M=>M.id===G)){const M=o.projects.find(q=>q.id===G),ee=ue.slice();return M&&ee.unshift({...M,name:M.name+"(已归档)"}),ee}return ue});function ae(ue){o.open&&ue.key==="Escape"&&r("cancel")}pt(()=>o.open,async ue=>{var G;if(ue){const S=o.item;l.value=(S==null?void 0:S.content)??"",u.value=(S==null?void 0:S.project_id)??null,f.value=(S==null?void 0:S.category)??"dev",v.value=(S==null?void 0:S.minutes)??null,y.value=(S==null?void 0:S.takeaway)??"",m.value=(S==null?void 0:S.remark)??"",w.value=(S==null?void 0:S.is_milestone)??0,T.value=(S==null?void 0:S.needs_followup)??0,$.value="",window.addEventListener("keydown",ae),await Ks(),(G=I.value)==null||G.focus()}else window.removeEventListener("keydown",ae)}),bn(()=>window.removeEventListener("keydown",ae)),pt(l,()=>{$.value&&($.value="")});function de(){const ue=l.value.trim();if(!ue){$.value="请填写工作内容";return}if(!o.item||!o.item.id){r("save",{id:0,content:ue,project_id:u.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:y.value.trim()||null,remark:m.value.trim()||null,is_milestone:w.value,needs_followup:T.value});return}r("save",{id:o.item.id,content:ue,project_id:u.value,category:f.value,minutes:v.value&&v.value>0?v.value:null,takeaway:y.value.trim()||null,remark:m.value.trim()||null,is_milestone:w.value?1:0,needs_followup:T.value?1:0})}return(ue,G)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:G[10]||(G[10]=Ut(S=>r("cancel"),["self"]))},[i("div",ay,[i("div",iy,[i("div",null,[i("div",ly,F(e.item?"编辑工作记录":"添加工作记录"),1),e.date?(x(),E("div",uy,F(e.date),1)):me("",!0)]),i("button",{class:"icon-btn",title:"关闭",onClick:G[0]||(G[0]=S=>r("cancel"))},[be(He,{name:"close",size:16})])]),i("div",cy,[i("div",dy,[i("div",fy,[G[11]||(G[11]=i("label",null,"工作内容(必填)",-1)),Pe(i("input",{ref_key:"contentInput",ref:I,class:ze(["input",{invalid:$.value}]),"onUpdate:modelValue":G[1]||(G[1]=S=>l.value=S),onKeydown:Lt(de,["enter"])},null,34),[[Le,l.value]]),$.value?(x(),E("div",py,F($.value),1)):me("",!0)]),i("div",vy,[G[13]||(G[13]=i("label",null,"所属项目",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":G[2]||(G[2]=S=>u.value=S)},[G[12]||(G[12]=i("option",{value:null},"无项目",-1)),(x(!0),E(Oe,null,st(J.value,S=>(x(),E("option",{key:S.id,value:S.id},F(S.name),9,my))),128))],512),[[vs,u.value]])]),i("div",hy,[G[14]||(G[14]=i("label",null,"工作分类",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":G[3]||(G[3]=S=>f.value=S)},[(x(!0),E(Oe,null,st(n.value,S=>(x(),E("option",{key:S,value:S},F(S),9,yy))),128))],512),[[vs,f.value]])]),i("div",gy,[G[15]||(G[15]=i("label",null,"耗时(分钟)",-1)),Pe(i("input",{class:"input",type:"number",min:"0","onUpdate:modelValue":G[4]||(G[4]=S=>v.value=S),placeholder:"选填"},null,512),[[Le,v.value,void 0,{number:!0}]]),i("div",by,[(x(),E(Oe,null,st([15,30,60,90,120],S=>i("button",{key:S,type:"button",class:ze(["min-chip",{on:v.value===S}]),onClick:M=>v.value=v.value===S?null:S},F(S)+"分",11,wy)),64))])]),i("div",_y,[G[16]||(G[16]=i("label",null,"主要收获",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":G[5]||(G[5]=S=>y.value=S),placeholder:"一句话:学到了什么"},null,512),[[Le,y.value]])]),i("div",ky,[G[17]||(G[17]=i("label",null,"备注",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":G[6]||(G[6]=S=>m.value=S),placeholder:"背景、链接、未决事项(选填)"},null,512),[[Le,m.value]])]),i("div",Cy,[G[18]||(G[18]=i("label",null,"成果标记",-1)),i("button",{class:ze(["toggle-btn",{on:w.value===1}]),onClick:G[7]||(G[7]=S=>w.value=w.value===1?0:1)},F(w.value===1?"已标记为成果":"未标记"),3)]),i("div",xy,[G[19]||(G[19]=i("label",null,"待跟进",-1)),i("button",{class:ze(["toggle-btn",{onwarn:T.value===1}]),onClick:G[8]||(G[8]=S=>T.value=T.value===1?0:1)},F(T.value===1?"需要跟进":"无需跟进"),3)])])]),i("div",$y,[i("button",{class:"btn btn-sm",onClick:G[9]||(G[9]=S=>r("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:de},F(e.item?"保存修改":"添加"),1)])])])):me("",!0)]),_:1})]))}}),Ey=Vt(Sy,[["__scopeId","data-v-91c30038"]]);function Or(e){const t=e.split(":");return Number(t[0])*60+Number(t[1])}function co(e,t,n,o){if(e&&e.kind==="leave")return{status:"leave",label:"请假",makeup:!1,workedMinutes:null};if(gm(t))return{status:"rest",label:"休息日",makeup:!1,workedMinutes:null};if(!e||!e.clock_in_at)return o?{status:"none",label:"未打卡",makeup:!1,workedMinutes:null}:{status:"absent",label:"缺勤",makeup:!!(e&&e.kind==="makeup"),workedMinutes:null};const r=e.kind==="makeup";if(!e.clock_out_at)return{status:"incomplete",label:o?"进行中":"未完成",makeup:r,workedMinutes:null};const l=Or(Wn(e.clock_in_at)),u=Or(Wn(e.clock_out_at)),f=Or(n.work_start),v=Or(n.work_end);let y="normal";!r&&l>f+n.grace_minutes?y="late":!r&&u{Fr.value=Fr.value.filter(n=>n.id!==t)},2e3)}function Ty(){return Fr}const Py={class:"day-panel"},Oy={class:"dp-head"},My={class:"dp-date"},Iy={class:"card sec"},jy={class:"att-grid"},Dy={class:"att-cell"},Ly={key:0,class:"edit-row"},Ry={key:1,class:"att-val"},Ky={class:"att-cell"},Ny={key:0,class:"edit-row"},Fy={key:1,class:"att-val"},Vy={class:"att-cell"},By=["list"],Uy=["id"],qy=["value"],Hy={class:"att-cell"},zy={class:"att-val status-val"},Wy={key:0,class:"tag"},Gy={key:1,class:"muted"},Yy={key:0,class:"att-note muted"},Jy={class:"att-actions"},Xy=["disabled"],Qy=["disabled"],Zy=["disabled"],eg=["disabled"],tg={key:0,class:"card sec makeup"},ng={class:"form-grid"},sg={class:"field"},og={class:"field"},rg={class:"field span2"},ag=["list"],ig={class:"field span2"},lg={key:0,class:"form-error"},ug={class:"form-footer"},cg={class:"list-sec"},dg={class:"sec-head"},fg={class:"sec-title"},pg={key:0,class:"empty muted"},vg={class:"item-main"},mg={class:"tag"},hg=["onClick"],yg={key:0,class:"muted item-meta"},gg={key:1,class:"muted num item-meta"},bg=["onClick"],wg=["onClick"],_g=["onClick"],kg=["onClick"],Cg={key:0,class:"item-sub"},xg={key:0,class:"muted2"},$g={key:1,class:"muted"},Sg={key:1,class:"dp-foot muted num"},Eg=Kt({__name:"DayPanel",props:{date:{}},setup(e){const t=P([]);Zo().then(_=>{t.value=_});const n=e,o=P(!0),r=P(null),l=P(void 0),u=P([]),f=P([]),v=P(""),y=P([]),m=nt(()=>"loc-list-"+n.date),w=nt(()=>n.date===ut());async function T(){o.value=!0,r.value=await ms(),l.value=await Fs(n.date),u.value=await Ch(n.date),f.value=await io(!0),y.value=await gl(),v.value=l.value&&l.value.location||await dh(),o.value=!1}cn(T),pt(()=>n.date,T),pt(Jo,()=>{T()});function $(_){if(!_)return"";const g=f.value.find(C=>C.id===_);return g?g.name:"已删除项目"}const I=nt(()=>r.value?co(l.value,n.date,r.value,w.value):null),J=nt(()=>u.value.reduce((_,g)=>_+(g.minutes||0),0)),ae=P(!1);async function de(){ae.value||(ae.value=!0,await hh(n.date,v.value),await T(),As(),Ve("上班打卡成功"),ae.value=!1)}async function ue(){ae.value||(ae.value=!0,await yh(n.date),await T(),As(),Ve("下班打卡成功"),ae.value=!1)}async function G(){await fh(n.date,v.value),As(),Ve("地点已更新")}const S=P(!1),M=nt(()=>{var _;return((_=l.value)==null?void 0:_.kind)==="leave"});function ee(){if(l.value&&l.value.clock_in_at){S.value=!0;return}q(!0)}async function q(_){S.value=!1,await wh(n.date,_),await T(),As(),Ve(_?"已标记为休假":"已取消休假")}const oe=P(null),j=P(""),A=P(null);pt(oe,async _=>{var g;_&&(await Ks(),(g=A.value)==null||g.focus())});function O(_){var C,D;const g=_==="in"?(C=l.value)==null?void 0:C.clock_in_at:(D=l.value)==null?void 0:D.clock_out_at;oe.value=_,j.value=g?Wn(g):_==="in"?"09:00":"18:00"}function ne(){oe.value=null}async function Ie(){const _=oe.value;_&&(oe.value=null,j.value&&(await bh(n.date,_==="in"?"clock_in_at":"clock_out_at",j.value),await T(),As(),Ve("打卡时间已修改")))}const Se=P(!1),_e=P("09:00"),Me=P("18:00"),qe=P(""),Ue=P(""),tt=P("");function Ye(){Ue.value=v.value,tt.value="",Se.value=!Se.value}async function We(){if(!_e.value||!Me.value){tt.value="请填写上班与下班时间";return}await gh(n.date,n.date+"T"+_e.value+":00",n.date+"T"+Me.value+":00",qe.value.trim(),Ue.value),Se.value=!1,qe.value="",tt.value="",await T(),As(),Ve("补卡已保存")}const le=P(null),Q=P(!1);function Ae(_){le.value=_,Q.value=!0}function lt(){le.value=null,Q.value=!0}async function it(_){_.id?(await bi(_.id,{content:_.content,project_id:_.project_id,category:_.category,minutes:_.minutes,takeaway:_.takeaway,remark:_.remark,is_milestone:_.is_milestone,needs_followup:_.needs_followup}),Ve("记录已更新")):(await xh(n.date,{content:_.content,project_id:_.project_id,category:_.category,minutes:_.minutes,takeaway:_.takeaway,remark:_.remark}),Ve("记录已添加")),le.value=null,Q.value=!1,await T()}async function Te(_){await bi(_.id,{is_milestone:_.is_milestone?0:1}),await T()}async function kt(_){await bi(_.id,{needs_followup:_.needs_followup?0:1}),await T()}const xt=P(null);async function Ke(){xt.value&&xt.value.id&&await $h(xt.value.id),xt.value=null,await T(),Ve("记录已删除")}return(_,g)=>(x(),E("div",Py,[i("div",Oy,[i("div",My,F(Wt(bd)(e.date)),1)]),i("div",Iy,[g[19]||(g[19]=i("div",{class:"sec-title"},"出勤信息",-1)),i("div",jy,[i("div",Dy,[g[15]||(g[15]=i("label",null,"上班时间",-1)),oe.value==="in"?(x(),E("div",Ly,[Pe(i("input",{ref_key:"timeInput",ref:A,type:"time",class:"input time-input","onUpdate:modelValue":g[0]||(g[0]=C=>j.value=C),onKeydown:[Lt(Ie,["enter"]),Lt(ne,["esc"])]},null,544),[[Le,j.value]]),i("button",{class:"btn btn-primary btn-sm",onClick:Ie},"确认"),i("button",{class:"btn btn-sm",onClick:ne},"取消")])):(x(),E("div",Ry,[i("span",{class:ze(["num",{"val-empty":!(l.value&&l.value.clock_in_at)}])},F(l.value&&l.value.clock_in_at?Wt(Wn)(l.value.clock_in_at):"未打卡"),3),l.value&&l.value.id?(x(),E("button",{key:0,class:"icon-btn",title:"修改上班时间",onClick:g[1]||(g[1]=C=>O("in"))},[be(He,{name:"edit",size:13})])):me("",!0)]))]),i("div",Ky,[g[16]||(g[16]=i("label",null,"下班时间",-1)),oe.value==="out"?(x(),E("div",Ny,[Pe(i("input",{ref_key:"timeInput",ref:A,type:"time",class:"input time-input","onUpdate:modelValue":g[2]||(g[2]=C=>j.value=C),onKeydown:[Lt(Ie,["enter"]),Lt(ne,["esc"])]},null,544),[[Le,j.value]]),i("button",{class:"btn btn-primary btn-sm",onClick:Ie},"确认"),i("button",{class:"btn btn-sm",onClick:ne},"取消")])):(x(),E("div",Fy,[i("span",{class:ze(["num",{"val-empty":!(l.value&&l.value.clock_out_at)}])},F(l.value&&l.value.clock_out_at?Wt(Wn)(l.value.clock_out_at):"未打卡"),3),l.value&&l.value.id?(x(),E("button",{key:0,class:"icon-btn",title:"修改下班时间",onClick:g[3]||(g[3]=C=>O("out"))},[be(He,{name:"edit",size:13})])):me("",!0)]))]),i("div",Vy,[g[17]||(g[17]=i("label",null,"上班地点",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":g[4]||(g[4]=C=>v.value=C),list:m.value,placeholder:"可直接输入",title:"上班地点,可自由输入",onChange:G},null,40,By),[[Le,v.value]]),i("datalist",{id:m.value},[(x(!0),E(Oe,null,st(y.value,C=>(x(),E("option",{key:C,value:C},null,8,qy))),128))],8,Uy)]),i("div",Hy,[g[18]||(g[18]=i("label",null,"考勤状态",-1)),i("div",zy,[I.value?(x(),E(Oe,{key:0},[i("span",{class:ze(["dot",I.value.status])},null,2),i("span",null,F(I.value.label),1),l.value&&l.value.kind==="makeup"?(x(),E("span",Wy,"补卡")):me("",!0)],64)):(x(),E("span",Gy,"--"))])])]),l.value&&l.value.note?(x(),E("div",Yy,"补卡说明:"+F(l.value.note),1)):me("",!0),i("div",Jy,[w.value&&(!l.value||!l.value.clock_in_at)?(x(),E("button",{key:0,class:"btn btn-primary btn-sm",disabled:ae.value,onClick:de},"上班打卡",8,Xy)):w.value&&l.value&&l.value.clock_in_at&&!l.value.clock_out_at?(x(),E("button",{key:1,class:"btn btn-primary btn-sm",disabled:ae.value,onClick:ue},"下班打卡",8,Qy)):me("",!0),!w.value&&(!l.value||!l.value.clock_in_at)?(x(),E("button",{key:2,class:"btn btn-sm",onClick:Ye},"补卡")):me("",!0),M.value?(x(),E("button",{key:4,class:"btn btn-sm",disabled:ae.value,onClick:g[5]||(g[5]=C=>q(!1))},"取消休假",8,eg)):(x(),E("button",{key:3,class:"btn btn-sm",disabled:ae.value,onClick:ee},"标记休假",8,Zy))])]),Se.value?(x(),E("div",tg,[g[24]||(g[24]=i("div",{class:"sec-title"},"补卡登记",-1)),i("div",ng,[i("div",sg,[g[20]||(g[20]=i("label",null,"上班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":g[6]||(g[6]=C=>_e.value=C)},null,512),[[Le,_e.value]])]),i("div",og,[g[21]||(g[21]=i("label",null,"下班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":g[7]||(g[7]=C=>Me.value=C)},null,512),[[Le,Me.value]])]),i("div",rg,[g[22]||(g[22]=i("label",null,"上班地点",-1)),Pe(i("input",{class:"input",list:m.value,"onUpdate:modelValue":g[8]||(g[8]=C=>Ue.value=C),placeholder:"可直接输入"},null,8,ag),[[Le,Ue.value]])]),i("div",ig,[g[23]||(g[23]=i("label",null,"补卡原因",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":g[9]||(g[9]=C=>qe.value=C),placeholder:"如:外出拜访客户忘记打卡"},null,512),[[Le,qe.value]])])]),tt.value?(x(),E("div",lg,F(tt.value),1)):me("",!0),i("div",ug,[i("button",{class:"btn btn-sm",onClick:g[10]||(g[10]=C=>Se.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:We},"保存补卡")])])):me("",!0),i("div",cg,[i("div",dg,[i("span",fg,"工作记录("+F(u.value.length)+")",1),i("button",{class:"btn btn-primary btn-sm",onClick:lt},[be(He,{name:"plus",size:14}),g[25]||(g[25]=At(" 添加记录",-1))])]),!u.value.length&&!o.value?(x(),E("div",pg,"暂无记录")):me("",!0),(x(!0),E(Oe,null,st(u.value,C=>(x(),E("div",{key:C.id,class:"item"},[i("div",vg,[i("span",mg,F(Wt(qo)(C.category)),1),i("span",{class:"item-content",title:"点击编辑",onClick:D=>Ae(C)},F(C.content),9,hg),C.project_id?(x(),E("span",yg,F($(C.project_id)),1)):me("",!0),C.minutes?(x(),E("span",gg,F(C.minutes)+" 分钟",1)):me("",!0),g[26]||(g[26]=i("span",{class:"flex1"},null,-1)),i("button",{class:"icon-btn",title:"编辑完整信息",onClick:D=>Ae(C)},[be(He,{name:"edit",size:14})],8,bg),i("button",{class:ze(["icon-btn",{active:C.is_milestone===1}]),title:"成果标记",onClick:D=>Te(C)},[be(He,{name:"star",size:14})],10,wg),i("button",{class:ze(["icon-btn",{"active-warn":C.needs_followup===1}]),title:"待跟进",onClick:D=>kt(C)},[be(He,{name:"flag",size:14})],10,_g),i("button",{class:"icon-btn",title:"删除",onClick:D=>xt.value=C},[be(He,{name:"close",size:14})],8,kg)]),C.takeaway||C.remark?(x(),E("div",Cg,[C.takeaway?(x(),E("div",xg,"收获:"+F(C.takeaway),1)):me("",!0),C.remark?(x(),E("div",$g,"备注:"+F(C.remark),1)):me("",!0)])):me("",!0)]))),128)),u.value.length?(x(),E("div",Sg,[At(" 共 "+F(u.value.length)+" 条事项 ",1),J.value?(x(),E(Oe,{key:0},[At(" · "+F((J.value/60).toFixed(1))+" 小时",1)],64)):me("",!0)])):me("",!0)]),be(xn,{open:!!xt.value,title:"删除确认",message:xt.value?"将删除工作记录「"+xt.value.content+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:g[11]||(g[11]=C=>xt.value=null),onConfirm:Ke},null,8,["open","message"]),be(xn,{open:S.value,title:"标记休假确认",message:"该日已有打卡记录,标记休假将清空上下班时间。是否继续?","confirm-text":"标记休假",danger:"",onCancel:g[12]||(g[12]=C=>S.value=!1),onConfirm:g[13]||(g[13]=C=>q(!0))},null,8,["open"]),be(Ey,{open:Q.value,item:le.value,projects:f.value,date:e.date,onCancel:g[14]||(g[14]=C=>Q.value=!1),onSave:it},null,8,["open","item","projects","date"])]))}}),Fd=Vt(Eg,[["__scopeId","data-v-81276f4c"]]),Ag={class:"cal-page"},Tg={class:"cal-toolbar"},Pg={class:"cal-title num"},Og=["disabled"],Mg={class:"card cal-card"},Ig={class:"cal-head"},jg={class:"cal-grid"},Dg=["title","onClick"],Lg={class:"cal-marks"},Rg={key:0,class:"drawer"},Kg={class:"drawer-head"},Ng={class:"drawer-body"},Fg=Kt({__name:"CalendarView",setup(e){const t=P(ut()),n=nt(()=>Number(t.value.slice(0,4))),o=nt(()=>Number(t.value.slice(5,7))-1),r=nt(()=>n.value+" 年 "+(o.value+1)+" 月"),l=["一","二","三","四","五","六","日"],u=nt(()=>{const S=(new Date(n.value,o.value,1).getDay()+6)%7,M=new Date(n.value,o.value+1,0).getDate(),ee=[];for(let q=0;q[O.date,O])),oe=M[2],j=new Map;for(const O of u.value){if(!O.inMonth)continue;const ne=co(q.get(O.date),O.date,ee,O.date===v),Ie=oe.filter(Se=>Se.date===O.date);j.set(O.date,{status:ne.status,label:ne.label,location:((A=q.get(O.date))==null?void 0:A.location)||"",hasLog:Ie.length>0,hasMilestone:Ie.some(Se=>Se.is_milestone===1)})}f.value=j}pt([n,o],y,{immediate:!0}),pt(Jo,()=>{y()});function m(G){var S;return((S=f.value.get(G))==null?void 0:S.status)??""}function w(G){const S=f.value.get(G);return S?G+" · "+S.label+(S.location?" · "+S.location:""):G}function T(G){var S;return!!((S=f.value.get(G))!=null&&S.hasLog)}function $(G){var S;return!!((S=f.value.get(G))!=null&&S.hasMilestone)}function I(){t.value=Ho(t.value,-1)}function J(){t.value=Ho(t.value,1)}function ae(){t.value=ut()}const de=P(null);function ue(G,S){S&&(de.value=G)}return pt(Fi,G=>{G&&(t.value=G,de.value=G,Fi.value=null)},{immediate:!0}),(G,S)=>(x(),E("div",Ag,[i("div",Tg,[i("button",{class:"icon-btn",title:"上一月",onClick:I},[be(He,{name:"chevron-left",size:16})]),i("span",Pg,F(r.value),1),i("button",{class:"icon-btn",title:"下一月",onClick:J},[be(He,{name:"chevron-right",size:16})]),i("button",{class:"btn btn-sm",disabled:t.value===Wt(v),onClick:ae},"回到本月",8,Og)]),i("div",Mg,[i("div",Ig,[(x(),E(Oe,null,st(l,M=>i("span",{key:M,class:"cal-week"},F(M),1)),64))]),i("div",jg,[(x(!0),E(Oe,null,st(u.value,(M,ee)=>(x(),E("button",{key:ee,class:ze(["cal-cell",{blank:!M.inMonth,weekend:M.weekend,selected:de.value===M.date,"is-today":M.date===Wt(v)}]),title:M.inMonth?w(M.date):void 0,onClick:q=>ue(M.date,M.inMonth)},[M.inMonth?(x(),E(Oe,{key:0},[i("span",{class:ze(["daynum num",{today:M.date===Wt(v)}])},F(Number(M.date.slice(8,10))),3),i("span",Lg,[m(M.date)?(x(),E("span",{key:0,class:ze(["dot",m(M.date)])},null,2)):me("",!0),T(M.date)?(x(),Ct(He,{key:1,name:"check-circle",size:12,class:"mark-log"})):me("",!0),$(M.date)?(x(),Ct(He,{key:2,name:"star",size:12,class:"mark-star"})):me("",!0)])],64)):me("",!0)],10,Dg))),128))])]),be(Jn,{name:"drawer"},{default:Sn(()=>[de.value?(x(),E("aside",Rg,[i("div",Kg,[S[1]||(S[1]=i("span",{class:"drawer-title"},"当日详情",-1)),i("button",{class:"icon-btn",onClick:S[0]||(S[0]=M=>de.value=null)},[be(He,{name:"close",size:16})])]),i("div",Ng,[be(Fd,{date:de.value},null,8,["date"])])])):me("",!0)]),_:1})]))}}),Vg=Vt(Fg,[["__scopeId","data-v-abd71a5b"]]),Bg="modulepreload",Ug=function(e,t){return new URL(e,t).href},qu={},Vd=function(t,n,o){let r=Promise.resolve();if(n&&n.length>0){const u=document.getElementsByTagName("link"),f=document.querySelector("meta[property=csp-nonce]"),v=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));r=Promise.allSettled(n.map(y=>{if(y=Ug(y,o),y in qu)return;qu[y]=!0;const m=y.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!o)for(let I=u.length-1;I>=0;I--){const J=u[I];if(J.href===y&&(!m||J.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${w}`))return;const $=document.createElement("link");if($.rel=m?"stylesheet":Bg,m||($.as="script"),$.crossOrigin="",$.href=y,v&&$.setAttribute("nonce",v),document.head.appendChild($),m)return new Promise((I,J)=>{$.addEventListener("load",I),$.addEventListener("error",()=>J(new Error(`Unable to preload CSS for ${y}`)))})}))}function l(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return r.then(u=>{for(const f of u||[])f.status==="rejected"&&l(f.reason);return t().catch(l)})};/*! Capacitor: https://capacitorjs.com/ - MIT License */const qg=e=>{const t=new Map;t.set("web",{name:"web"});const n=e.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:t},o=(l,u)=>{n.platforms.set(l,u)},r=l=>{n.platforms.has(l)&&(n.currentPlatform=n.platforms.get(l))};return n.addPlatform=o,n.setPlatform=r,n},Hg=e=>e.CapacitorPlatforms=qg(e),Bd=Hg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});Bd.addPlatform;Bd.setPlatform;var lo;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(lo||(lo={}));class wi extends Error{constructor(t,n,o){super(t),this.message=t,this.code=n,this.data=o}}const zg=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"},Wg=e=>{var t,n,o,r,l;const u=e.CapacitorCustomPlatform||null,f=e.Capacitor||{},v=f.Plugins=f.Plugins||{},y=e.CapacitorPlatforms,m=()=>u!==null?u.name:zg(e),w=((t=y==null?void 0:y.currentPlatform)===null||t===void 0?void 0:t.getPlatform)||m,T=()=>w()!=="web",$=((n=y==null?void 0:y.currentPlatform)===null||n===void 0?void 0:n.isNativePlatform)||T,I=q=>{const oe=S.get(q);return!!(oe!=null&&oe.platforms.has(w())||de(q))},J=((o=y==null?void 0:y.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||I,ae=q=>{var oe;return(oe=f.PluginHeaders)===null||oe===void 0?void 0:oe.find(j=>j.name===q)},de=((r=y==null?void 0:y.currentPlatform)===null||r===void 0?void 0:r.getPluginHeader)||ae,ue=q=>e.console.error(q),G=(q,oe,j)=>Promise.reject(`${j} does not have an implementation of "${oe}".`),S=new Map,M=(q,oe={})=>{const j=S.get(q);if(j)return console.warn(`Capacitor plugin "${q}" already registered. Cannot register plugins twice.`),j.proxy;const A=w(),O=de(q);let ne;const Ie=async()=>(!ne&&A in oe?ne=typeof oe[A]=="function"?ne=await oe[A]():ne=oe[A]:u!==null&&!ne&&"web"in oe&&(ne=typeof oe.web=="function"?ne=await oe.web():ne=oe.web),ne),Se=(Ye,We)=>{var le,Q;if(O){const Ae=O==null?void 0:O.methods.find(lt=>We===lt.name);if(Ae)return Ae.rtype==="promise"?lt=>f.nativePromise(q,We.toString(),lt):(lt,it)=>f.nativeCallback(q,We.toString(),lt,it);if(Ye)return(le=Ye[We])===null||le===void 0?void 0:le.bind(Ye)}else{if(Ye)return(Q=Ye[We])===null||Q===void 0?void 0:Q.bind(Ye);throw new wi(`"${q}" plugin is not implemented on ${A}`,lo.Unimplemented)}},_e=Ye=>{let We;const le=(...Q)=>{const Ae=Ie().then(lt=>{const it=Se(lt,Ye);if(it){const Te=it(...Q);return We=Te==null?void 0:Te.remove,Te}else throw new wi(`"${q}.${Ye}()" is not implemented on ${A}`,lo.Unimplemented)});return Ye==="addListener"&&(Ae.remove=async()=>We()),Ae};return le.toString=()=>`${Ye.toString()}() { [capacitor code] }`,Object.defineProperty(le,"name",{value:Ye,writable:!1,configurable:!1}),le},Me=_e("addListener"),qe=_e("removeListener"),Ue=(Ye,We)=>{const le=Me({eventName:Ye},We),Q=async()=>{const lt=await le;qe({eventName:Ye,callbackId:lt},We)},Ae=new Promise(lt=>le.then(()=>lt({remove:Q})));return Ae.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await Q()},Ae},tt=new Proxy({},{get(Ye,We){switch(We){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return O?Ue:Me;case"removeListener":return qe;default:return _e(We)}}});return v[q]=tt,S.set(q,{name:q,proxy:tt,platforms:new Set([...Object.keys(oe),...O?[A]:[]])}),tt},ee=((l=y==null?void 0:y.currentPlatform)===null||l===void 0?void 0:l.registerPlugin)||M;return f.convertFileSrc||(f.convertFileSrc=q=>q),f.getPlatform=w,f.handleError=ue,f.isNativePlatform=$,f.isPluginAvailable=J,f.pluginMethodNoop=G,f.registerPlugin=ee,f.Exception=wi,f.DEBUG=!!f.DEBUG,f.isLoggingEnabled=!!f.isLoggingEnabled,f.platform=f.getPlatform(),f.isNative=f.isNativePlatform(),f},Gg=e=>e.Capacitor=Wg(e),uo=Gg(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),Ud=uo.registerPlugin;uo.Plugins;class qd{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 o=!1;this.listeners[t]||(this.listeners[t]=[],o=!0),this.listeners[t].push(n);const l=this.windowListeners[t];l&&!l.registered&&this.addWindowListener(l),o&&this.sendRetainedArgumentsForEvent(t);const u=async()=>this.removeListener(t,n);return Promise.resolve({remove:u})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,o){const r=this.listeners[t];if(!r){if(o){let l=this.retainedEventArguments[t];l||(l=[]),l.push(n),this.retainedEventArguments[t]=l}return}r.forEach(l=>l(n))}hasListeners(t){return!!this.listeners[t].length}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:o=>{this.notifyListeners(n,o)}}}unimplemented(t="not implemented"){return new uo.Exception(t,lo.Unimplemented)}unavailable(t="not available"){return new uo.Exception(t,lo.Unavailable)}async removeListener(t,n){const o=this.listeners[t];if(!o)return;const r=o.indexOf(n);this.listeners[t].splice(r,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(o=>{this.notifyListeners(t,o)}))}}const Hu=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),zu=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class Yg extends qd{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(o=>{if(o.length<=0)return;let[r,l]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");r=zu(r).trim(),l=zu(l).trim(),n[r]=l}),n}async setCookie(t){try{const n=Hu(t.key),o=Hu(t.value),r=`; expires=${(t.expires||"").replace("expires=","")}`,l=(t.path||"/").replace("path=",""),u=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${o||""}${r}; path=${l}; ${u};`}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)}}}Ud("CapacitorCookies",{web:()=>new Yg});const Jg=async e=>new Promise((t,n)=>{const o=new FileReader;o.onload=()=>{const r=o.result;t(r.indexOf(",")>=0?r.split(",")[1]:r)},o.onerror=r=>n(r),o.readAsDataURL(e)}),Xg=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(r=>r.toLocaleLowerCase()).reduce((r,l,u)=>(r[l]=e[t[u]],r),{})},Qg=(e,t=!0)=>e?Object.entries(e).reduce((o,r)=>{const[l,u]=r;let f,v;return Array.isArray(u)?(v="",u.forEach(y=>{f=t?encodeURIComponent(y):y,v+=`${l}=${f}&`}),v.slice(0,-1)):(f=t?encodeURIComponent(u):u,v=`${l}=${f}`),`${o}&${v}`},"").substr(1):null,Zg=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),r=Xg(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(r.includes("application/x-www-form-urlencoded")){const l=new URLSearchParams;for(const[u,f]of Object.entries(e.data||{}))l.set(u,f);n.body=l.toString()}else if(r.includes("multipart/form-data")||e.data instanceof FormData){const l=new FormData;if(e.data instanceof FormData)e.data.forEach((f,v)=>{l.append(v,f)});else for(const f of Object.keys(e.data))l.append(f,e.data[f]);n.body=l;const u=new Headers(n.headers);u.delete("content-type"),n.headers=u}else(r.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class eb extends qd{async request(t){const n=Zg(t,t.webFetchExtra),o=Qg(t.params,t.shouldEncodeUrlParams),r=o?`${t.url}?${o}`:t.url,l=await fetch(r,n),u=l.headers.get("content-type")||"";let{responseType:f="text"}=l.ok?t:{};u.includes("application/json")&&(f="json");let v,y;switch(f){case"arraybuffer":case"blob":y=await l.blob(),v=await Jg(y);break;case"json":v=await l.json();break;case"document":case"text":default:v=await l.text()}const m={};return l.headers.forEach((w,T)=>{m[T]=w}),{data:v,headers:m,status:l.status,url:l.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"}))}}Ud("CapacitorHttp",{web:()=>new eb});async function Ea(e,t){const n=window;if(n.electronAPI&&n.electronAPI.saveFile){const u=await n.electronAPI.saveFile(e,t);return u&&u.saved?u.path:""}if(uo.isNativePlatform()){const{Filesystem:u,Directory:f,Encoding:v}=await Vd(async()=>{const{Filesystem:y,Directory:m,Encoding:w}=await import("./index-C9urKISR.js");return{Filesystem:y,Directory:m,Encoding:w}},[],import.meta.url);try{return(await u.writeFile({path:e,data:t,directory:f.Documents,encoding:v.UTF8,recursive:!0})).uri}catch{return(await u.writeFile({path:e,data:t,directory:f.Cache,encoding:v.UTF8,recursive:!0})).uri}}const o=new Blob([t],{type:"text/plain;charset=utf-8"}),r=URL.createObjectURL(o),l=document.createElement("a");return l.href=r,l.download=e,l.click(),window.setTimeout(()=>URL.revokeObjectURL(r),1e4),""}const tb=Object.freeze(Object.defineProperty({__proto__:null,downloadText:Ea},Symbol.toStringTag,{value:"Module"})),nb={class:"detail-page"},sb={class:"card toolbar"},ob={class:"nav-row"},rb=["value"],ab=["disabled"],ib={class:"exp-row"},lb={class:"seg"},ub=["disabled"],cb=Kt({__name:"TodayView",setup(e){const t=P(ut()),n=nt(()=>t.value===ut());function o(){t.value=Ft(t.value,-1)}function r(){t.value=Ft(t.value,1)}function l(){t.value=ut()}const u=P("day"),f=P(ut()),v=P(ut()),y=P(!1);function m(){if(u.value==="day")return{start:t.value,end:t.value,label:t.value};if(u.value==="week"){const $=Zs(f.value);return{start:$,end:Ft($,6),label:$+"_"+Ft($,6)}}if(u.value==="month"){const $=f.value.slice(0,4),I=f.value.slice(5,7),J=new Date(Number($),Number(I),0).getDate();return{start:$+"-"+I+"-01",end:$+"-"+I+"-"+J,label:$+"-"+I}}return{start:f.value,end:v.value,label:f.value+"_"+v.value}}async function w(){if(!y.value){y.value=!0;try{const{start:$,end:I,label:J}=m(),[ae,de,ue,G]=await Promise.all([ms(),Xo($,I),Qo($,I),io(!0)]),S=new Map(G.map(j=>[j.id,j.name])),M=["# 工作详情 "+J,""],ee=["周日","周一","周二","周三","周四","周五","周六"];let q=$,oe=0;for(;q<=I&&oe<400;){const j=ue.filter(O=>O.date===q),A=de.find(O=>O.date===q);if(A||j.length){if(M.push("## "+q+" "+ee[new Date(q+"T00:00:00").getDay()],""),A&&(A.clock_in_at||A.kind==="makeup")){const O=co(A,q,ae,q===ut()),ne=[Wn(A.clock_in_at),"–",Wn(A.clock_out_at),"·",O.label];A.location&&ne.push("· 地点:"+A.location),M.push("考勤:"+ne.join(" "),"")}for(const O of j){const ne=O.project_id&&S.get(O.project_id)||"",Ie="- 【"+qo(O.category)+"】"+O.content+(O.minutes?"("+O.minutes+" 分钟)":"")+(ne?" @"+ne:"");M.push(Ie),O.takeaway&&M.push(" - 收获:"+O.takeaway),O.needs_followup===1&&O.remark?M.push(" - 待跟进:"+O.remark):O.remark&&M.push(" - 备注:"+O.remark)}M.push("")}q=Ft(q,1),oe++}await Ea("工作详情_"+J+".md",M.join(` +`)),Ve("已导出 Markdown")}finally{y.value=!1}}}function T($){const I=$.target.value;I&&(t.value=I)}return pt(t,$=>{f.value=$,u.value==="custom"&&(v.value=$)}),($,I)=>(x(),E("div",nb,[i("div",sb,[i("div",ob,[i("button",{class:"icon-btn",title:"前一天",onClick:o},[be(He,{name:"chevron-left",size:16})]),i("span",{class:ze(["date-title num",{"is-today":n.value}])},F(Wt(bd)(t.value)),3),i("button",{class:"icon-btn",title:"后一天",onClick:r},[be(He,{name:"chevron-right",size:16})]),i("input",{type:"date",class:"input w-date",value:t.value,onChange:T},null,40,rb),i("button",{class:"btn btn-sm",disabled:n.value,onClick:l},"回到今天",8,ab)]),I[7]||(I[7]=i("div",{class:"tool-sep"},null,-1)),i("div",ib,[I[6]||(I[6]=i("span",{class:"muted exp-label"},"导出",-1)),i("div",lb,[i("button",{class:ze(["seg-btn",{active:u.value==="day"}]),onClick:I[0]||(I[0]=J=>u.value="day")},"指定日",2),i("button",{class:ze(["seg-btn",{active:u.value==="week"}]),onClick:I[1]||(I[1]=J=>u.value="week")},"当周",2),i("button",{class:ze(["seg-btn",{active:u.value==="month"}]),onClick:I[2]||(I[2]=J=>u.value="month")},"当月",2),i("button",{class:ze(["seg-btn",{active:u.value==="custom"}]),onClick:I[3]||(I[3]=J=>u.value="custom")},"自定义",2)]),u.value!=="day"?Pe((x(),E("input",{key:0,class:"input w-exp",type:"date","onUpdate:modelValue":I[4]||(I[4]=J=>f.value=J)},null,512)),[[Le,f.value]]):me("",!0),u.value==="custom"?Pe((x(),E("input",{key:1,class:"input w-exp",type:"date","onUpdate:modelValue":I[5]||(I[5]=J=>v.value=J)},null,512)),[[Le,v.value]]):me("",!0),i("button",{class:"btn btn-sm",disabled:y.value,onClick:w},"导出 Markdown",8,ub)])]),be(Fd,{date:t.value},null,8,["date"])]))}}),db=Vt(cb,[["__scopeId","data-v-2bb84c76"]]),fb={class:"plan-page"},pb={class:"blk-head"},vb={key:0,class:"card empty muted"},mb={class:"goal-main"},hb={class:"goal-line"},yb={class:"tag"},gb={class:"goal-name"},bb={class:"muted num goal-range"},wb={class:"goal-bar"},_b={class:"muted num goal-meta"},kb={class:"goal-ops"},Cb=["onClick"],xb=["onClick"],$b={class:"blk-head day-head"},Sb={class:"blk-head-text"},Eb={class:"muted blk-sub num"},Ab={class:"day-ops"},Tb={class:"card list-card"},Pb={key:0,class:"empty muted"},Ob={class:"pi-time num"},Mb={class:"muted"},Ib={class:"pi-main"},jb={class:"pi-title"},Db={class:"tag"},Lb={key:0,class:"tag tag-goal"},Rb={key:1,class:"state-done"},Kb={key:2,class:"state-skip"},Nb={key:0,class:"muted pi-note"},Fb={class:"muted pi-meta num"},Vb={key:0,class:"timer-live"},Bb={class:"pi-ops"},Ub=["onClick"],qb=["onClick"],Hb=["onClick"],zb=["onClick"],Wb=["onClick"],Gb=["onClick"],Yb={class:"dialog",role:"dialog","aria-label":"计划"},Jb={class:"dialog-head"},Xb={class:"dialog-title"},Qb={class:"dialog-body"},Zb={class:"form-row"},ew={class:"form-row"},tw=["value"],nw={class:"form-row two"},sw={class:"form-row"},ow={key:0,class:"form-error"},rw={class:"dialog-btns"},aw={class:"dialog",role:"dialog","aria-label":"长期计划"},iw={class:"dialog-head"},lw={class:"dialog-title"},uw={class:"dialog-body"},cw={class:"form-row"},dw={class:"form-row"},fw=["value"],pw={class:"form-row two"},vw={class:"form-row"},mw={key:0,class:"form-error"},hw={class:"dialog-btns"},yw=Kt({__name:"PlanView",setup(e){const t=P([]),n=P({}),o=P(!1),r=P(null),l=P(""),u=P("学习"),f=P(ut()),v=P(Ft(ut(),6)),y=P(""),m=P(""),w=P(null);function T(){r.value=null,l.value="",u.value="学习",f.value=ut(),v.value=Ft(ut(),6),y.value="",m.value="",o.value=!0}function $(g){r.value=g,l.value=g.title,u.value=g.kind,f.value=g.start_date,v.value=g.end_date,y.value=g.note||"",m.value="",o.value=!0}async function I(){if(!l.value.trim()){m.value="请填写计划名称";return}if(v.valueae.value===ut());async function ee(){ue.value=!0;const[g,C,D]=await Promise.all([Ah(ae.value),Kh(),Rh()]);de.value=g,t.value=C;const re={};for(const pe of D)re[String(pe.goalId)]={done:pe.done,total:pe.total};n.value=re,ue.value=!1}pt(ae,ee),pt(Jo,ee),cn(()=>{ee(),S=window.setInterval(()=>{G.value=Date.now()},3e4)}),bn(()=>{S&&window.clearInterval(S)});function q(){ae.value=Ft(ae.value,-1)}function oe(){ae.value=Ft(ae.value,1)}function j(){ae.value=ut()}const A=nt(()=>{const g=de.value.length,C=de.value.filter(we=>we.status==="done").length,D=de.value.reduce((we,ke)=>we+O(ke),0),re=de.value.reduce((we,ke)=>we+(ke.actual_minutes||0),0);let pe=0;const xe=Ie.value;if(xe){const we=de.value.find(ke=>ke.id===xe);we&&(pe=Se(we))}return{total:g,done:C,plannedMin:D,actualMin:re+pe}});function O(g){const[C,D]=g.start_time.split(":").map(Number),[re,pe]=g.end_time.split(":").map(Number);return Math.max(0,re*60+pe-(C*60+D))}function ne(g){return g<60?g+" 分钟":Math.floor(g/60)+" 小时 "+g%60+" 分"}const Ie=nt(()=>{const g=de.value.find(C=>!!C.timer_started_at);return g?g.id:null});function Se(g){if(!g.timer_started_at)return g.actual_minutes||0;const C=Math.max(0,Math.round((G.value-new Date(g.timer_started_at).getTime())/6e4));return(g.actual_minutes||0)+C}async function _e(g){g.timer_started_at?(await Sa(g.id),Ve("已停止计时:"+g.title)):(await jh(g.id),Ve("开始计时:"+g.title)),Wm(),await ee()}async function Me(g,C){await Ih(g.id,C),await ee()}const qe=P(!1),Ue=P(null),tt=P(""),Ye=P("学习"),We=P("09:00"),le=P("10:00"),Q=P(""),Ae=P(""),lt=["学习","健身","自律","工作","阅读","其他"];function it(){Ue.value=null,tt.value="",Ye.value="学习",We.value="09:00",le.value="10:00",Q.value="",Ae.value="",qe.value=!0}function Te(g){Ue.value=g.id,tt.value=g.title,Ye.value=g.kind,We.value=g.start_time,le.value=g.end_time,Q.value=g.note||"",Ae.value="",qe.value=!0}async function kt(){if(!tt.value.trim()){Ae.value="请填写计划内容";return}if(le.value<=We.value){Ae.value="结束时间需晚于开始时间";return}Ue.value?(await Oh(Ue.value,{title:tt.value.trim(),kind:Ye.value,start_time:We.value,end_time:le.value,note:Q.value}),Ve("计划已更新")):(await Ph({date:ae.value,start_time:We.value,end_time:le.value,title:tt.value,kind:Ye.value,note:Q.value}),Ve("计划已添加")),qe.value=!1,await ee()}async function xt(g){await Mh(g.id),Ve("已删除"),await ee()}const Ke=["周日","周一","周二","周三","周四","周五","周六"];function _(g){return Ke[Gn(g).getDay()]}return(g,C)=>(x(),E("div",fb,[i("div",pb,[C[18]||(C[18]=i("div",{class:"blk-head-text"},[i("div",{class:"blk-title"},"长期计划"),i("div",{class:"muted blk-sub"},"跨越多天的目标,自动落实到每一天")],-1)),i("button",{class:"btn btn-sm",onClick:T},[be(He,{name:"plus",size:14}),C[17]||(C[17]=At(" 新建长期计划",-1))])]),t.value.length?me("",!0):(x(),E("div",vb," 暂无长期计划。创建一个跨越多天的目标(如「产品文档学习」),系统会自动生成每天的打卡任务。 ")),(x(!0),E(Oe,null,st(t.value,D=>(x(),E("div",{key:D.id,class:"card goal-card"},[i("div",mb,[i("div",hb,[i("span",yb,F(D.kind),1),i("span",gb,F(D.title),1),i("span",bb,F(D.start_date.slice(5))+" ~ "+F(D.end_date.slice(5)),1)]),i("div",wb,[i("span",{class:"goal-bar-fill",style:pn({width:(n.value[String(D.id)]?Math.round(n.value[String(D.id)].done/Math.max(1,n.value[String(D.id)].total)*100):0)+"%",background:n.value[String(D.id)]&&n.value[String(D.id)].done>=n.value[String(D.id)].total&&n.value[String(D.id)].total>0?"var(--ok)":"var(--accent)"})},null,4)]),i("div",_b,[At(F(n.value[String(D.id)]?n.value[String(D.id)].done+"/"+n.value[String(D.id)].total+" 天已完成":"0/"+(n.value[String(D.id)]?n.value[String(D.id)].total:0)+" 天")+" ",1),D.note?(x(),E(Oe,{key:0},[At(" · "+F(D.note),1)],64)):me("",!0)])]),i("div",kb,[i("button",{class:"icon-btn",title:"编辑",onClick:re=>$(D)},[be(He,{name:"edit",size:14})],8,Cb),i("button",{class:"icon-btn",title:"删除",onClick:re=>w.value=D},[be(He,{name:"close",size:14})],8,xb)])]))),128)),i("div",$b,[i("div",Sb,[C[21]||(C[21]=i("div",{class:"blk-title"},"每日安排",-1)),i("div",Eb,[At(" 共 "+F(A.value.total)+" 项 · 完成 "+F(A.value.done)+" 项 · 计划 "+F(ne(A.value.plannedMin))+" · 实际投入 "+F(ne(A.value.actualMin))+" ",1),Ie.value?(x(),E(Oe,{key:0},[C[19]||(C[19]=At(" · ",-1)),C[20]||(C[20]=i("span",{class:"timer-live"},"计时中",-1))],64)):me("",!0)])]),i("div",Ab,[i("button",{class:"icon-btn",title:"前一天",onClick:q},[be(He,{name:"chevron-left",size:16})]),i("span",{class:ze(["date-chip num",{today:M.value}])},F(ae.value.slice(5))+" "+F(_(ae.value)),3),i("button",{class:"icon-btn",title:"后一天",onClick:oe},[be(He,{name:"chevron-right",size:16})]),i("button",{class:ze(["btn btn-sm",{"btn-primary":!M.value}]),onClick:j},"今天",2),i("button",{class:"btn btn-primary btn-sm",onClick:it},[be(He,{name:"plus",size:14}),C[22]||(C[22]=At(" 添加计划",-1))])])]),i("div",Tb,[!ue.value&&!de.value.length?(x(),E("div",Pb,"今天还没有计划,点「添加计划」开始规划。")):me("",!0),(x(!0),E(Oe,null,st(de.value,D=>(x(),E("div",{key:D.id,class:ze(["plan-item",{done:D.status==="done",skip:D.status==="skip",running:!!D.timer_started_at}])},[i("div",Ob,[At(F(D.start_time),1),i("span",Mb," - "+F(D.end_time),1)]),i("div",Ib,[i("div",jb,[i("span",Db,F(D.kind),1),D.goal_id?(x(),E("span",Lb,"长期")):me("",!0),i("span",{class:ze(["pi-text",{strike:D.status==="done"}])},F(D.title),3),D.status==="done"?(x(),E("span",Rb,"已完成")):D.status==="skip"?(x(),E("span",Kb,"已跳过")):me("",!0)]),D.note?(x(),E("div",Nb,F(D.note),1)):me("",!0),i("div",Fb,[D.timer_started_at?(x(),E("span",Vb,"计时中 · 已 "+F(Se(D))+" 分钟",1)):D.actual_minutes>0?(x(),E(Oe,{key:1},[At("实际投入 "+F(D.actual_minutes)+" 分钟",1)],64)):me("",!0)])]),i("div",Bb,[D.status!=="done"?(x(),E("button",{key:0,class:ze(["btn btn-xs",{"timer-on":!!D.timer_started_at}]),onClick:re=>_e(D)},F(D.timer_started_at?"停止计时":"计时"),11,Ub)):me("",!0),D.status!=="done"?(x(),E("button",{key:1,class:"btn btn-xs",onClick:re=>Me(D,"done")},"完成",8,qb)):me("",!0),D.status==="todo"?(x(),E("button",{key:2,class:"btn btn-xs",onClick:re=>Me(D,"skip")},"跳过",8,Hb)):me("",!0),D.status!=="todo"?(x(),E("button",{key:3,class:"btn btn-xs",onClick:re=>Me(D,"todo")},"恢复",8,zb)):me("",!0),i("button",{class:"icon-btn",title:"编辑",onClick:re=>Te(D)},[be(He,{name:"edit",size:14})],8,Wb),i("button",{class:"icon-btn",title:"删除",onClick:re=>xt(D)},[be(He,{name:"close",size:14})],8,Gb)])],2))),128))]),(x(),Ct($n,{to:"body"},[qe.value?(x(),E("div",{key:0,class:"mask",onClick:C[7]||(C[7]=Ut(D=>qe.value=!1,["self"]))},[i("div",Yb,[i("div",Jb,[i("span",Xb,F(Ue.value?"编辑计划":"添加计划"),1),i("button",{class:"icon-btn",onClick:C[0]||(C[0]=D=>qe.value=!1)},[be(He,{name:"close",size:16})])]),i("div",Qb,[i("div",Zb,[C[23]||(C[23]=i("label",null,"计划内容(学什么、做什么)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[1]||(C[1]=D=>tt.value=D),placeholder:"如:产品文档第三章 / 晨跑 5 公里",onKeydown:Lt(kt,["enter"])},null,544),[[Le,tt.value]])]),i("div",ew,[C[24]||(C[24]=i("label",null,"类别",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":C[2]||(C[2]=D=>Ye.value=D)},[(x(),E(Oe,null,st(lt,D=>i("option",{key:D,value:D},F(D),9,tw)),64))],512),[[vs,Ye.value]])]),i("div",nw,[i("div",null,[C[25]||(C[25]=i("label",null,"开始时间",-1)),Pe(i("input",{class:"input",type:"time","onUpdate:modelValue":C[3]||(C[3]=D=>We.value=D)},null,512),[[Le,We.value]])]),i("div",null,[C[26]||(C[26]=i("label",null,"结束时间",-1)),Pe(i("input",{class:"input",type:"time","onUpdate:modelValue":C[4]||(C[4]=D=>le.value=D)},null,512),[[Le,le.value]])])]),i("div",sw,[C[27]||(C[27]=i("label",null,"备注(选填)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[5]||(C[5]=D=>Q.value=D),placeholder:"目标、资料、提醒等",onKeydown:Lt(kt,["enter"])},null,544),[[Le,Q.value]])]),Ae.value?(x(),E("div",ow,F(Ae.value),1)):me("",!0)]),i("div",rw,[i("button",{class:"btn btn-sm",onClick:C[6]||(C[6]=D=>qe.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:kt},F(Ue.value?"保存":"添加"),1)])])])):me("",!0)])),(x(),Ct($n,{to:"body"},[o.value?(x(),E("div",{key:0,class:"mask",onClick:C[15]||(C[15]=Ut(D=>o.value=!1,["self"]))},[i("div",aw,[i("div",iw,[i("span",lw,F(r.value?"编辑长期计划":"新建长期计划"),1),i("button",{class:"icon-btn",onClick:C[8]||(C[8]=D=>o.value=!1)},[be(He,{name:"close",size:16})])]),i("div",uw,[i("div",cw,[C[28]||(C[28]=i("label",null,"计划名称(落实为每天一条任务)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[9]||(C[9]=D=>l.value=D),placeholder:"如:产品文档学习 / 健身月计划"},null,512),[[Le,l.value]])]),i("div",dw,[C[29]||(C[29]=i("label",null,"类别",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":C[10]||(C[10]=D=>u.value=D)},[(x(),E(Oe,null,st(lt,D=>i("option",{key:D,value:D},F(D),9,fw)),64))],512),[[vs,u.value]])]),i("div",pw,[i("div",null,[C[30]||(C[30]=i("label",null,"开始日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":C[11]||(C[11]=D=>f.value=D)},null,512),[[Le,f.value]])]),i("div",null,[C[31]||(C[31]=i("label",null,"结束日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":C[12]||(C[12]=D=>v.value=D)},null,512),[[Le,v.value]])])]),i("div",vw,[C[32]||(C[32]=i("label",null,"备注(选填)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":C[13]||(C[13]=D=>y.value=D)},null,512),[[Le,y.value]])]),m.value?(x(),E("div",mw,F(m.value),1)):me("",!0),C[33]||(C[33]=i("div",{class:"muted goal-hint"},"创建后区间内每一天都会生成一条任务,可在每日安排中逐日打卡与计时。",-1))]),i("div",hw,[i("button",{class:"btn btn-sm",onClick:C[14]||(C[14]=D=>o.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:I},F(r.value?"保存":"创建"),1)])])])):me("",!0)])),be(xn,{open:!!w.value,title:"删除长期计划",message:w.value?"将删除「"+w.value.title+"」及其全部每日任务(含已完成记录),不可恢复。":"","confirm-text":"删除",danger:"",onCancel:C[16]||(C[16]=D=>w.value=null),onConfirm:J},null,8,["open","message"])]))}}),gw=Vt(yw,[["__scopeId","data-v-ffd19b28"]]),bw={class:"stats"},ww={class:"cards"},_w={class:"card stat-card"},kw={class:"stat-num num"},Cw={class:"card stat-card"},xw={class:"stat-num num"},$w={class:"card stat-card"},Sw={class:"stat-num num"},Ew={class:"card stat-card"},Aw={class:"stat-num num"},Tw={class:"card section"},Pw={class:"heat"},Ow=["title"],Mw={class:"two-col"},Iw={class:"card section"},jw={class:"bar-label"},Dw={class:"bar-track"},Lw={class:"muted num bar-num"},Rw={key:0,class:"muted"},Kw={class:"card section"},Nw={class:"bar-label"},Fw={class:"bar-track"},Vw={class:"muted num bar-num"},Bw={key:0,class:"muted"},Uw={class:"card section"},qw={class:"bar-label loc-label"},Hw={class:"bar-track"},zw={class:"muted num bar-num"},Ww={key:0,class:"muted"},Gw=Kt({__name:"StatsView",setup(e){const t=P({attendDays:0,totalHours:"0",itemCount:0,streak:0}),n=P([]),o=P([]),r=P([]),l=P([]);async function u(){const y=ut(),m="2000-01-01",w=await Promise.all([ms(),Xo(m,y),Qo(m,y),io(!0)]),T=w[0],$=w[1],I=w[2],J=w[3],ae=$.filter(_e=>_e.clock_in_at||_e.kind==="makeup");let de=0;for(const _e of ae){const Me=co(_e,_e.date,T,_e.date===y);de+=Me.workedMinutes??0}const ue=new Set(I.map(_e=>_e.date));let G=0,S=y;for(ue.has(S)||(S=Ft(y,-1));ue.has(S);)G++,S=Ft(S,-1);t.value={attendDays:ae.length,totalHours:(de/60).toFixed(1),itemCount:I.length,streak:G};const M=new Map;for(const _e of ae){const Me=_e.location||"未记录";M.set(Me,(M.get(Me)||0)+1)}l.value=Array.from(M.entries()).map(_e=>({name:_e[0],count:_e[1],percent:Math.round(_e[1]/(ae.length||1)*100)})).sort((_e,Me)=>Me.count-_e.count);const ee=I.length||1,q=await Zo(),oe=new Map;for(const _e of I)oe.set(_e.category,(oe.get(_e.category)||0)+1);const j=new Set(q);for(const _e of oe.keys())j.has(_e)||q.push(_e);o.value=q.map(_e=>{const Me=oe.get(_e)||0;return{key:_e,label:_e,count:Me,percent:Math.round(Me/ee*100)}}).filter(_e=>_e.count>0).sort((_e,Me)=>Me.count-_e.count);const A=new Map(J.map(_e=>[_e.id,_e.name])),O=new Map;for(const _e of I){const Me=_e.project_id?A.get(_e.project_id)||"已删除项目":"无项目";O.set(Me,(O.get(Me)||0)+1)}r.value=Array.from(O.entries()).map(_e=>({name:_e[0],count:_e[1],percent:Math.round(_e[1]/ee*100)})).sort((_e,Me)=>Me.count-_e.count);const ne=new Map;for(const _e of I)ne.set(_e.date,(ne.get(_e.date)||0)+1);const Ie=Zs(y),Se=[];for(let _e=11;_e>=0;_e--){const Me=Ft(Ie,-7*_e),qe=[];for(let Ue=0;Ue<7;Ue++){const tt=Ft(Me,Ue);qe.push({date:tt,count:ne.get(tt)||0})}Se.push(qe)}n.value=Se}cn(async()=>{await u()}),pt(Jo,()=>{u()});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)=>(x(),E("div",bw,[i("div",ww,[i("div",_w,[m[0]||(m[0]=i("div",{class:"muted"},"出勤天数",-1)),i("div",kw,F(t.value.attendDays),1)]),i("div",Cw,[m[1]||(m[1]=i("div",{class:"muted"},"累计工时(小时)",-1)),i("div",xw,F(t.value.totalHours),1)]),i("div",$w,[m[2]||(m[2]=i("div",{class:"muted"},"记录条数",-1)),i("div",Sw,F(t.value.itemCount),1)]),i("div",Ew,[m[3]||(m[3]=i("div",{class:"muted"},"连续记录(天)",-1)),i("div",Aw,F(t.value.streak),1)])]),i("div",Tw,[m[4]||(m[4]=i("div",{class:"section-title"},"记录热力图(近 12 周)",-1)),i("div",Pw,[(x(!0),E(Oe,null,st(n.value,(w,T)=>(x(),E("div",{key:T,class:"heat-col"},[(x(!0),E(Oe,null,st(w,$=>(x(),E("span",{key:$.date,class:ze(["heat-cell","lv"+f($.count)]),title:v($.date,$.count)},null,10,Ow))),128))]))),128))]),m[5]||(m[5]=ad('
少多
',1))]),i("div",Mw,[i("div",Iw,[m[6]||(m[6]=i("div",{class:"section-title"},"分类分布",-1)),(x(!0),E(Oe,null,st(o.value,w=>(x(),E("div",{key:w.key,class:"bar-row"},[i("span",jw,F(w.label),1),i("span",Dw,[i("span",{class:"bar-fill",style:pn({width:w.percent+"%"})},null,4)]),i("span",Lw,F(w.count)+" 条 · "+F(w.percent)+"%",1)]))),128)),o.value.length?me("",!0):(x(),E("div",Rw,"暂无数据"))]),i("div",Kw,[m[7]||(m[7]=i("div",{class:"section-title"},"项目投入",-1)),(x(!0),E(Oe,null,st(r.value,w=>(x(),E("div",{key:w.name,class:"bar-row"},[i("span",Nw,F(w.name),1),i("span",Fw,[i("span",{class:"bar-fill",style:pn({width:w.percent+"%"})},null,4)]),i("span",Vw,F(w.count)+" 条 · "+F(w.percent)+"%",1)]))),128)),r.value.length?me("",!0):(x(),E("div",Bw,"暂无数据"))])]),i("div",Uw,[m[8]||(m[8]=i("div",{class:"section-title"},"地点分布(按出勤天)",-1)),(x(!0),E(Oe,null,st(l.value,w=>(x(),E("div",{key:w.name,class:"bar-row"},[i("span",qw,F(w.name),1),i("span",Hw,[i("span",{class:"bar-fill",style:pn({width:w.percent+"%"})},null,4)]),i("span",zw,F(w.count)+" 天 · "+F(w.percent)+"%",1)]))),128)),l.value.length?me("",!0):(x(),E("div",Ww,"暂无数据"))])]))}}),Yw=Vt(Gw,[["__scopeId","data-v-5469ae68"]]);async function Jw(e,t,n){const o=ut(),r=await Promise.all([ms(),Xo(e,t),Qo(e,t),io(!0),Eh(e,t),Zo()]),l=r[0],u=r[1],f=r[2],v=r[3],y=r[4],m=r[5];let w=0,T=0,$=0;for(const O of u){(O.clock_in_at||O.kind==="makeup")&&w++,O.kind==="makeup"&&$++;const ne=co(O,O.date,l,O.date===o);T+=ne.workedMinutes??0}const I=new Map;for(const O of u){if(!(O.clock_in_at||O.kind==="makeup"))continue;const ne=O.location||"未记录";I.set(ne,(I.get(ne)||0)+1)}const J=Array.from(I.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,ne)=>ne.count-O.count),ae=f.length||1,de=new Map;for(const O of f)de.set(O.category,(de.get(O.category)||0)+1);const ue=new Set(m);for(const O of de.keys())ue.has(O)||m.push(O);const G=m.map(O=>{const ne=de.get(O)||0;return{key:O,label:O,count:ne,percent:Math.round(ne/ae*100)}}).filter(O=>O.count>0).sort((O,ne)=>ne.count-O.count),S=new Map(v.map(O=>[O.id,O.name])),M=new Map;for(const O of f){const ne=O.project_id?S.get(O.project_id)||"已删除项目":"无项目";M.set(ne,(M.get(ne)||0)+1)}const ee=Array.from(M.entries()).map(O=>({name:O[0],count:O[1]})).sort((O,ne)=>ne.count-O.count),q=f.filter(O=>O.is_milestone===1).map(O=>({date:O.date,content:O.content})),oe=f.filter(O=>O.needs_followup===1).map(O=>({date:O.date,content:O.content,remark:O.remark||""})),j=f.filter(O=>!!O.takeaway).map(O=>({date:O.date,text:O.takeaway})),A=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:w,totalHours:(T/60).toFixed(1),makeupCount:$,leaveCount:u.filter(O=>O.kind==="leave").length,itemCount:f.length,categoryStats:G,projectStats:ee,locationStats:J,milestones:q,followups:oe,takeaways:j,weekNotes:A}}function Xw(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(o=>o.name!=="未记录");n.length&&t.push("其中:"+n.map(o=>o.name+" "+o.count+" 天").join(",")),t.push(""),t.push("## 二、工作内容分布"),t.push(""),t.push(e.categoryStats.length?e.categoryStats.map(o=>o.label+" "+o.percent+"%("+o.count+" 条)").join(","):"(无记录)"),t.push(""),t.push("## 三、项目投入"),t.push(""),t.push(e.projectStats.length?e.projectStats.map(o=>o.name+" "+o.count+" 条").join(","):"(无记录)"),t.push(""),t.push("## 四、主要成果"),t.push(""),e.milestones.length?e.milestones.forEach((o,r)=>t.push(r+1+". 【成果】"+o.content+"("+o.date+")")):t.push("(无)"),t.push(""),t.push("## 五、待跟进事项"),t.push(""),e.followups.length?e.followups.forEach(o=>t.push("- 【待跟进】"+o.content+(o.remark?"("+o.date+" 备注:"+o.remark+")":"("+o.date+")"))):t.push("(无)"),t.push(""),t.push("## 六、学习与成长"),t.push(""),e.takeaways.length?e.takeaways.forEach(o=>t.push("- "+o.text+"("+o.date+")")):t.push("(无)");for(const o of e.weekNotes)t.push(""),t.push("### 周记("+o.weekStart+" 起)"),t.push(""),t.push("- 本周亮点:"+(o.highlights||"(无)")),t.push("- 踩的坑:"+(o.challenges||"(无)")),t.push("- 下周计划:"+(o.plan_next||"(无)"));return t.push(""),t.join(` +`)}async function Gi(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 Qw(e){const t=await Promise.all([Tt("ai_base_url",""),Tt("ai_api_key",""),Tt("ai_model","")]),n=t[0].trim().replace(/\/+$/,""),o=t[1].trim(),r=t[2].trim();if(!n||!r)throw new Error("请先在设置页配置 AI 接口地址与模型名称");const l=n+"/chat/completions",u={"Content-Type":"application/json"};o&&(u.Authorization="Bearer "+o);const v=JSON.stringify({model:r,messages:[{role:"system",content:"你是一名严谨的中文助理。请将用户提供的工作总结 Markdown 草稿润色为通顺、专业、简洁的工作总结。要求:保留原有章节结构与全部事实数据(数字、日期、条目),不得虚构或遗漏内容,只输出 Markdown 正文。"},{role:"user",content:e}],temperature:.3});let y;try{y=await fetch(l,{method:"POST",headers:u,body:v})}catch{throw new Error("无法访问 AI 接口:请检查地址是否正确、服务端是否允许浏览器跨域访问")}if(!y.ok){let T="接口返回 "+y.status;try{const $=await y.json();$&&$.error&&$.error.message&&(T+=":"+$.error.message)}catch{}throw new Error(T)}const m=await y.json(),w=m&&m.choices&&m.choices[0]&&m.choices[0].message&&m.choices[0].message.content;if(!w)throw new Error("接口未返回内容");return String(w)}const Zw={class:"report"},e_={class:"report-toolbar"},t_={class:"seg"},n_=["onClick"],s_=["disabled"],o_=["disabled"],r_={key:0,class:"ai-error"},a_={class:"report-grid"},i_={class:"report-left"},l_={class:"card section"},u_={class:"section-title"},c_={class:"muted note-saved"},d_={class:"card section"},f_={class:"report-right"},p_={key:0,class:"card section"},v_={class:"sum-row"},m_={class:"num"},h_={class:"sum-row"},y_={class:"num"},g_={class:"sum-row"},b_={class:"num"},w_={class:"sum-row"},__={class:"num"},k_={class:"sum-row"},C_={class:"num"},x_={class:"muted"},$_={class:"num"},S_={key:0,class:"muted sum-empty"},E_={class:"muted"},A_={key:1,class:"muted sum-empty"},T_={class:"muted"},P_={key:2,class:"muted sum-empty"},O_={class:"muted"},M_={key:3,class:"muted sum-empty"},I_=Kt({__name:"ReportView",setup(e){const t=[{key:"week",label:"本周"},{key:"month",label:"本月"},{key:"all",label:"全部"},{key:"custom",label:"自定义"}],n=P("week"),o=P(Zs(ut())),r=P(ut()),l=P(null),u=P(""),f=P(!1),v=P(!1),y=P(null),m=P(""),w=P(Zs(ut())),T=P(""),$=P(""),I=P(""),J=P(!1);async function ae(){const oe=await bl(w.value);T.value=(oe==null?void 0:oe.highlights)||"",$.value=(oe==null?void 0:oe.challenges)||"",I.value=(oe==null?void 0:oe.plan_next)||"",J.value=!1}async function de(){await Sh(w.value,{highlights:T.value.trim()||null,challenges:$.value.trim()||null,plan_next:I.value.trim()||null}),J.value=!0,await G()}function ue(oe){const j=ut();if(oe==="week"){const A=Zs(j);return{start:A,end:Ft(A,6),label:"本周"}}if(oe==="month"){const A=j.slice(0,7);return{start:A+"-01",end:j,label:A+" 本月"}}return oe==="all"?{start:"2000-01-01",end:j,label:"全部实习期"}:{start:o.value,end:r.value,label:o.value+" ~ "+r.value}}async function G(){f.value=!0;const oe=ue(n.value),j=await Jw(oe.start,oe.end,oe.label);l.value=j,u.value=Xw(j),f.value=!1}pt(n,G),pt([o,r],()=>{n.value==="custom"&&G()}),cn(async()=>{await ae(),await G()});async function S(){const oe=ut().replace(/-/g,""),j=await Ea("实习工作总结_"+oe+".md",u.value);Ve(j?"总结已导出到:"+j:"总结已导出到系统下载目录")}async function M(){await Gi(u.value),Ve("总结已复制到剪贴板")}async function ee(){if(v.value)return;m.value="";const oe=u.value.trim();if(!oe){m.value="当前草稿为空,无法润色";return}v.value=!0;try{y.value=u.value,u.value=await Qw(oe),Ve("AI 润色完成")}catch(j){y.value=null,m.value=j instanceof Error?j.message:"润色失败"}v.value=!1}function q(){y.value!==null&&(u.value=y.value),y.value=null}return(oe,j)=>(x(),E("div",Zw,[i("div",e_,[i("div",t_,[(x(),E(Oe,null,st(t,A=>i("button",{key:A.key,class:ze(["seg-btn",{active:n.value===A.key}]),onClick:O=>n.value=A.key},F(A.label),11,n_)),64))]),n.value==="custom"?(x(),E(Oe,{key:0},[Pe(i("input",{type:"date",class:"input w-date","onUpdate:modelValue":j[0]||(j[0]=A=>o.value=A)},null,512),[[Le,o.value]]),j[6]||(j[6]=i("span",{class:"muted"},"至",-1)),Pe(i("input",{type:"date",class:"input w-date","onUpdate:modelValue":j[1]||(j[1]=A=>r.value=A)},null,512),[[Le,r.value]])],64)):me("",!0),j[10]||(j[10]=i("span",{class:"flex1"},null,-1)),i("button",{class:"btn btn-sm",disabled:v.value,onClick:ee},[be(He,{name:"edit",size:14}),j[7]||(j[7]=At("AI 润色 ",-1))],8,s_),y.value!==null?(x(),E("button",{key:1,class:"btn btn-sm",onClick:q},"还原润色前")):me("",!0),i("button",{class:"btn btn-sm",disabled:f.value,onClick:G},[be(He,{name:"edit",size:14}),j[8]||(j[8]=At("重新生成 ",-1))],8,o_),i("button",{class:"btn btn-sm",onClick:M},"复制"),i("button",{class:"btn btn-primary btn-sm",onClick:S},[be(He,{name:"export",size:14}),j[9]||(j[9]=At("导出 Markdown ",-1))])]),m.value?(x(),E("div",r_,F(m.value),1)):me("",!0),i("div",a_,[i("div",i_,[i("div",l_,[i("div",u_,"本周周记("+F(w.value)+" 起)",1),j[11]||(j[11]=i("label",{class:"note-label muted"},"本周亮点",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":j[2]||(j[2]=A=>T.value=A),placeholder:"本周最有价值的一件事",onBlur:de},null,544),[[Le,T.value]]),j[12]||(j[12]=i("label",{class:"note-label muted"},"踩的坑",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":j[3]||(j[3]=A=>$.value=A),placeholder:"遇到的问题与教训",onBlur:de},null,544),[[Le,$.value]]),j[13]||(j[13]=i("label",{class:"note-label muted"},"下周计划",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":j[4]||(j[4]=A=>I.value=A),placeholder:"下周准备做什么",onBlur:de},null,544),[[Le,I.value]]),i("div",c_,F(J.value?"已保存":"失焦自动保存"),1)]),i("div",d_,[j[14]||(j[14]=i("div",{class:"section-title"},"总结草稿(可编辑)",-1)),Pe(i("textarea",{class:"textarea md-editor","onUpdate:modelValue":j[5]||(j[5]=A=>u.value=A),spellcheck:"false"},null,512),[[Le,u.value]])])]),i("div",f_,[l.value?(x(),E("div",p_,[j[20]||(j[20]=i("div",{class:"section-title"},"数据摘要",-1)),i("div",v_,[j[15]||(j[15]=i("span",{class:"muted"},"出勤",-1)),i("span",m_,F(l.value.attendDays)+" 天",1)]),i("div",h_,[j[16]||(j[16]=i("span",{class:"muted"},"工时",-1)),i("span",y_,F(l.value.totalHours)+" 小时",1)]),i("div",g_,[j[17]||(j[17]=i("span",{class:"muted"},"补卡",-1)),i("span",b_,F(l.value.makeupCount)+" 次",1)]),i("div",w_,[j[18]||(j[18]=i("span",{class:"muted"},"请假",-1)),i("span",__,F(l.value.leaveCount)+" 天",1)]),i("div",k_,[j[19]||(j[19]=i("span",{class:"muted"},"记录",-1)),i("span",C_,F(l.value.itemCount)+" 条",1)]),j[21]||(j[21]=i("div",{class:"section-sub"},"分类分布",-1)),(x(!0),E(Oe,null,st(l.value.categoryStats,A=>(x(),E("div",{key:A.key,class:"sum-row"},[i("span",x_,F(A.label),1),i("span",$_,F(A.count)+" 条 · "+F(A.percent)+"%",1)]))),128)),l.value.categoryStats.length?me("",!0):(x(),E("div",S_,"(无)")),j[22]||(j[22]=i("div",{class:"section-sub"},"主要成果",-1)),(x(!0),E(Oe,null,st(l.value.milestones,(A,O)=>(x(),E("div",{key:"m"+O,class:"sum-item"},[At(F(A.content),1),i("span",E_,"("+F(A.date)+")",1)]))),128)),l.value.milestones.length?me("",!0):(x(),E("div",A_,"(无)")),j[23]||(j[23]=i("div",{class:"section-sub"},"待跟进",-1)),(x(!0),E(Oe,null,st(l.value.followups,(A,O)=>(x(),E("div",{key:"f"+O,class:"sum-item"},[At(F(A.content),1),i("span",T_,"("+F(A.date)+")",1)]))),128)),l.value.followups.length?me("",!0):(x(),E("div",P_,"(无)")),j[24]||(j[24]=i("div",{class:"section-sub"},"学习与成长",-1)),(x(!0),E(Oe,null,st(l.value.takeaways,(A,O)=>(x(),E("div",{key:"t"+O,class:"sum-item"},[At(F(A.text),1),i("span",O_,"("+F(A.date)+")",1)]))),128)),l.value.takeaways.length?me("",!0):(x(),E("div",M_,"(无)"))])):me("",!0)])])]))}}),j_=Vt(I_,[["__scopeId","data-v-7e1b08ed"]]),D_=["aria-label"],L_={class:"dialog-head"},R_={class:"dialog-title"},K_={class:"dialog-body"},N_={class:"form-grid"},F_={class:"field span2"},V_={class:"seg"},B_={class:"field"},U_={class:"field"},q_={class:"field"},H_=["value"],z_={class:"add-cat"},W_=["onKeydown"],G_={key:0,class:"field span2"},Y_={class:"seg"},J_={class:"field span2"},X_={key:0,class:"form-error"},Q_={class:"dialog-btns"},Z_=Kt({__name:"TransactionDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,o=t,r=P("expense"),l=P(""),u=P(""),f=P(""),v=P(""),y=P(!1),m=P(!1),w=P(""),T=P(null);function $(S){n.open&&S.key==="Escape"&&o("cancel")}pt(()=>n.open,async S=>{var M;S?(await J(),r.value=n.initial.type==="income"?"income":"expense",l.value=n.initial.category,u.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,w.value="",window.addEventListener("keydown",$),await Ks(),(M=T.value)==null||M.focus()):window.removeEventListener("keydown",$)}),bn(()=>window.removeEventListener("keydown",$)),pt(r,async()=>{await J(),l.value=I.value[0]||""});const I=P([]);async function J(){I.value=await la(r.value)}const ae=P("");async function de(){const S=ae.value.trim();if(S){if(I.value.includes(S)){ae.value="";return}I.value.push(S),await Wi(r.value,I.value),l.value=S,ae.value=""}}function ue(){return l.value&&I.value.includes(l.value)?l.value:I.value[0]}function G(){const S=String(u.value??"").trim(),M=Number(S);if(!S||!isFinite(M)||M<=0){w.value="请填写大于 0 的金额";return}if(!f.value){w.value="请选择日期";return}const ee=r.value==="expense"&&y.value?1:0;o("save",{type:r.value,category:ue(),amount:Math.round(M*100),date:f.value,note:String(v.value??"").trim(),reimbursable:ee,reimbursed:ee&&m.value?1:0})}return(S,M)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:M[12]||(M[12]=Ut(ee=>o("cancel"),["self"]))},[i("div",{class:"dialog",role:"dialog","aria-label":e.title},[i("div",L_,[i("span",R_,F(e.title),1),i("button",{class:"icon-btn",title:"关闭",onClick:M[0]||(M[0]=ee=>o("cancel"))},[be(He,{name:"close",size:16})])]),i("div",K_,[i("div",N_,[i("div",F_,[M[13]||(M[13]=i("label",null,"类型",-1)),i("div",V_,[i("button",{class:ze(["seg-btn",{active:r.value==="expense"}]),onClick:M[1]||(M[1]=ee=>r.value="expense")},"支出",2),i("button",{class:ze(["seg-btn",{active:r.value==="income"}]),onClick:M[2]||(M[2]=ee=>r.value="income")},"收入",2)])]),i("div",B_,[M[14]||(M[14]=i("label",null,"金额(元)",-1)),Pe(i("input",{ref_key:"amountInput",ref:T,class:ze(["input amt-input",{invalid:w.value}]),"onUpdate:modelValue":M[3]||(M[3]=ee=>u.value=ee),type:"number",min:"0",step:"0.01",placeholder:"0.00",inputmode:"decimal"},null,2),[[Le,u.value]])]),i("div",U_,[M[15]||(M[15]=i("label",null,"日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":M[4]||(M[4]=ee=>f.value=ee)},null,512),[[Le,f.value]])]),i("div",q_,[M[16]||(M[16]=i("label",null,"分类",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":M[5]||(M[5]=ee=>l.value=ee)},[(x(!0),E(Oe,null,st(I.value,ee=>(x(),E("option",{key:ee,value:ee},F(ee),9,H_))),128))],512),[[vs,l.value]]),i("div",z_,[Pe(i("input",{class:"input add-cat-input","onUpdate:modelValue":M[6]||(M[6]=ee=>ae.value=ee),placeholder:"新增分类名",onKeydown:Lt(Ut(de,["prevent"]),["enter"])},null,40,W_),[[Le,ae.value]]),i("button",{class:"btn btn-xs",type:"button",onClick:de},"添加")])]),r.value==="expense"?(x(),E("div",G_,[M[17]||(M[17]=i("label",null,"报销状态",-1)),i("div",Y_,[i("button",{class:ze(["seg-btn",{active:!y.value}]),onClick:M[7]||(M[7]=ee=>{y.value=!1,m.value=!1})},"无需报销",2),i("button",{class:ze(["seg-btn",{active:y.value&&!m.value}]),onClick:M[8]||(M[8]=ee=>{y.value=!0,m.value=!1})},"待报销",2),i("button",{class:ze(["seg-btn",{active:y.value&&m.value}]),onClick:M[9]||(M[9]=ee=>{y.value=!0,m.value=!0})},"已报销",2)])])):me("",!0),i("div",J_,[M[18]||(M[18]=i("label",null,"备注",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":M[10]||(M[10]=ee=>v.value=ee),placeholder:"选填"},null,512),[[Le,v.value]])])]),w.value?(x(),E("div",X_,F(w.value),1)):me("",!0)]),i("div",Q_,[i("button",{class:"btn btn-sm",onClick:M[11]||(M[11]=ee=>o("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:G},"保存")])],8,D_)])):me("",!0)]),_:1})]))}}),e1=Vt(Z_,[["__scopeId","data-v-e9a4e878"]]);function wl(e,t){return Ho(e,t-1)}function Hd(e,t){return Ft(Ho(e,t),-1)}function Wu(e,t){if(!e||t1&&t[]}},emits:["close","apply","saveAnchor"],setup(e,{emit:t}){const n=e,o=t,r=P(n.mode),l=P(n.month.slice(0,7)),u=P(n.cycleSel),f=P(n.customStart),v=P(n.customEnd),y=P(n.anchor),m=P("");function w(G){G.key==="Escape"&&o("close")}pt(()=>n.open,G=>{G?(r.value=n.mode,l.value=n.month.slice(0,7),u.value=n.cycleSel,f.value=n.customStart,v.value=n.customEnd,y.value=n.anchor,m.value="",window.addEventListener("keydown",w)):window.removeEventListener("keydown",w)}),pt(()=>[n.anchor,n.cycleSel],()=>{y.value=n.anchor,u.value=n.cycleSel}),bn(()=>window.removeEventListener("keydown",w));const T=nt(()=>{const G=new Set(n.months);return G.add(l.value),G.add(ut().slice(0,7)),Array.from(G).sort((S,M)=>Sn.anchor?ua(Ft(n.anchor,-1),n.anchor):"");function I(G){return G.slice(0,4)+" 年 "+Number(G.slice(5,7))+" 月"}function J(G){l.value=G,o("apply",{mode:"month",month:G}),o("close")}function ae(G){u.value=G,o("apply",{mode:"cycle",cycle:G}),o("close")}function de(){y.value&&o("saveAnchor",y.value)}function ue(){if(!f.value||!v.value){m.value="请选择开始和结束日期";return}if(f.value>v.value){m.value="开始日期不能晚于结束日期";return}m.value="",o("apply",{mode:"custom",customStart:f.value,customEnd:v.value}),o("close")}return(G,S)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:S[9]||(S[9]=Ut(M=>o("close"),["self"]))},[i("div",n1,[i("div",s1,[S[10]||(S[10]=i("span",{class:"dialog-title"},"统计周期",-1)),i("button",{class:"icon-btn",title:"关闭",onClick:S[0]||(S[0]=M=>o("close"))},[be(He,{name:"close",size:16})])]),i("div",o1,[i("div",r1,[i("button",{class:ze(["seg-btn",{active:r.value==="month"}]),onClick:S[1]||(S[1]=M=>r.value="month")},"按月",2),i("button",{class:ze(["seg-btn",{active:r.value==="cycle"}]),onClick:S[2]||(S[2]=M=>r.value="cycle")},"按期",2),i("button",{class:ze(["seg-btn",{active:r.value==="custom"}]),onClick:S[3]||(S[3]=M=>r.value="custom")},"自定义",2)]),r.value==="month"?(x(),E("div",a1,[(x(!0),E(Oe,null,st(T.value,M=>(x(),E("button",{key:M,class:ze(["opt",{active:M===l.value}]),onClick:ee=>J(M)},[i("span",null,F(I(M)),1),M===l.value?(x(),Ct(He,{key:0,name:"check-circle",size:15})):me("",!0)],10,i1))),128)),T.value.length?me("",!0):(x(),E("div",l1,"还没有账目记录"))])):r.value==="cycle"?(x(),E("div",u1,[i("div",c1,[S[11]||(S[11]=i("span",{class:"anchor-label"},"账期起点",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":S[4]||(S[4]=M=>y.value=M)},null,512),[[Le,y.value]]),i("button",{class:"btn btn-sm",disabled:!y.value||y.value===e.anchor,onClick:de},"保存",8,d1)]),y.value?y.value!==e.anchor?(x(),E("div",p1,"起点已修改,保存后按新起点重新切分")):me("",!0):(x(),E("div",f1,"填写实习开始日期并保存,自动切分为第 1、2、3…期(每期到下月同日前一天)")),e.anchor?(x(),E(Oe,{key:2},[e.hasBefore?(x(),E("button",{key:0,class:ze(["opt",{active:u.value==="before"}]),onClick:S[5]||(S[5]=M=>ae("before"))},[S[12]||(S[12]=i("span",null,"起点前",-1)),i("span",v1,"~ "+F($.value),1)],2)):me("",!0),(x(!0),E(Oe,null,st(e.cycleCount,M=>(x(),E("button",{key:M,class:ze(["opt",{active:u.value===M}]),onClick:ee=>ae(M)},[i("span",null,"第 "+F(M)+" 期",1),i("span",h1,F(Wt(Yi)(Wt(wl)(e.anchor,M),Wt(Hd)(e.anchor,M))),1)],10,m1))),128))],64)):me("",!0)])):(x(),E("div",y1,[i("div",g1,[i("div",b1,[S[13]||(S[13]=i("label",null,"开始日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":S[6]||(S[6]=M=>f.value=M)},null,512),[[Le,f.value]])]),i("div",w1,[S[14]||(S[14]=i("label",null,"结束日期",-1)),Pe(i("input",{class:"input",type:"date","onUpdate:modelValue":S[7]||(S[7]=M=>v.value=M)},null,512),[[Le,v.value]])])]),m.value?(x(),E("div",_1,F(m.value),1)):me("",!0),i("button",{class:"btn btn-primary apply-btn",onClick:ue},"应用区间")]))]),i("div",k1,[i("button",{class:"btn btn-sm",onClick:S[8]||(S[8]=M=>o("close"))},"关闭")])])])):me("",!0)]),_:1})]))}}),x1=Vt(C1,[["__scopeId","data-v-6269639e"]]),$1={class:"ledger-page"},S1={class:"ledger-toolbar"},E1=["disabled"],A1={class:"num"},T1=["disabled"],P1={class:"cards"},O1={class:"card stat-card stat-income"},M1={class:"stat-num num amt-income"},I1={class:"card stat-card stat-expense"},j1={class:"stat-num num"},D1={class:"card stat-card stat-balance"},L1={class:"card stat-card stat-pending"},R1={class:"stat-num num amt-warn"},K1={class:"card sec chart-sec"},N1={key:0,class:"chart-hint muted"},F1={key:1,class:"chart-wrap"},V1={class:"chart"},B1=["title"],U1={class:"chart-bars"},q1={class:"chart-axis"},H1={key:2,class:"empty muted"},z1={key:0,class:"card sec"},W1={class:"sec-head"},G1={class:"seg"},Y1={class:"chip-row"},J1=["onClick"],X1={key:0,class:"sel-strip"},Q1={class:"num"},Z1=["title"],e0={class:"bar-label"},t0={class:"bar-track"},n0={class:"bar-amt num"},s0={class:"bar-pct num muted"},o0={key:1,class:"card section"},r0={class:"form-error"},a0={class:"card table-card"},i0={class:"tx-table"},l0={class:"num","data-label":"日期"},u0={"data-label":"分类"},c0={class:"tag"},d0={class:"td-note","data-label":"备注"},f0={"data-label":"报销"},p0={key:0,class:"muted"},v0={key:1,class:"tx-done"},m0={key:2,class:"tx-pending"},h0={class:"ops-cell"},y0={class:"ops"},g0=["onClick"],b0=["onClick"],w0=["onClick"],_0={key:0},k0={class:"muted table-note num"},Gu="dsh_ledger_mode",Yu="dsh_ledger_cycle",Ju="dsh_ledger_cstart",Xu="dsh_ledger_cend",C0="0000-01-01",x0=Kt({__name:"LedgerView",setup(e){const t=["#3370FF","#23A757","#7A5AF8","#0EA5A0","#E8842C","#D96D5A","#5B7A99","#B56CC6"];function n(V){let te=0;for(let R=0;R>>0;return t[te%t.length]}function o(V){return(V/100).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})}const r=P("month"),l=P(ut()),u=P(1),f=P(ut().slice(0,7)+"-01"),v=P(ut()),y=P(""),m=P(!1),w=P([]),T=P([]),$=P(!0),I=P(""),J=P(!1),ae=P(null),de=P({type:"expense",category:"",amountYuan:"",date:ut(),note:"",reimbursable:0,reimbursed:0}),ue=P(null),G=P(!1);function S(V){const te=Number(V.slice(0,4)),R=Number(V.slice(5,7))-1,L=new Date(te,R+1,0).getDate();return V+"-"+(L<10?"0"+L:String(L))}const M=nt(()=>y.value?Math.max(1,Wu(y.value,ut())):1),ee=nt(()=>r.value==="month"?l.value.slice(0,7)+"-01":r.value==="custom"?f.value:y.value?u.value==="before"?C0:wl(y.value,u.value):l.value.slice(0,7)+"-01"),q=nt(()=>r.value==="month"?S(l.value.slice(0,7)):r.value==="custom"?v.value:y.value?u.value==="before"?Ft(y.value,-1):Hd(y.value,u.value):S(l.value.slice(0,7))),oe=nt(()=>r.value==="month"?Number(l.value.slice(0,4))+" 年 "+Number(l.value.slice(5,7))+" 月":r.value==="custom"?Yi(ee.value,q.value):y.value?u.value==="before"?"起点前 · ~ "+ua(Ft(y.value,-1),y.value):"第 "+u.value+" 期 · "+Yi(ee.value,q.value):"按期统计 · 设置起点"),j=nt(()=>r.value==="month"?!0:r.value==="cycle"&&y.value?u.value==="before"?!1:u.value>1||m.value:!1),A=nt(()=>r.value==="month"?!0:r.value==="cycle"&&y.value?u.value==="before"?!0:u.valueM.value)){if(te<1){m.value&&(u.value="before");return}u.value=te}}const ne=nt(()=>r.value==="month"?l.value.slice(0,7)!==ut().slice(0,7):r.value==="cycle"?!!y.value&&u.value!==M.value:!1);function Ie(){r.value==="cycle"?u.value=M.value:l.value=ut()}async function Se(){$.value=!0;try{T.value=await Gh(ee.value,q.value),I.value=""}catch(V){I.value="账目加载失败:"+(V instanceof Error?V.stack||V.message:String(V)),Ve("账目加载失败")}$.value=!1}cn(async()=>{const V=localStorage.getItem(Gu);(V==="month"||V==="cycle"||V==="custom")&&(r.value=V);const te=localStorage.getItem(Ju),R=localStorage.getItem(Xu);te&&R&&te<=R&&(f.value=te,v.value=R);const L=localStorage.getItem(Yu);L==="before"?u.value="before":L&&Number(L)>=1&&(u.value=Number(L)),y.value=await Tt("ledger.anchor",""),u.value!=="before"&&u.value>M.value&&(u.value=M.value),await Se()}),pt([ee,q],()=>{it.value=[],Se()}),pt(r,V=>localStorage.setItem(Gu,V)),pt(u,V=>localStorage.setItem(Yu,String(V))),pt([f,v],([V,te])=>{localStorage.setItem(Ju,V),localStorage.setItem(Xu,te)});async function _e(){try{w.value=await Zh(),m.value=y.value?await Uu(y.value)>0:!1}catch{}G.value=!0}function Me(V){r.value=V.mode,V.month&&(l.value=V.month+"-01"),V.cycle!==void 0&&(u.value=V.cycle),V.customStart&&(f.value=V.customStart),V.customEnd&&(v.value=V.customEnd)}async function qe(V){y.value=V,await Nt("ledger.anchor",V),r.value="cycle",u.value=Math.max(1,Wu(V,ut()));try{m.value=await Uu(V)>0}catch{}Ve("账期起点已保存,已按新起点切分期数")}const Ue=P([]);async function tt(){Ue.value=await la("expense")}tt();const Ye=nt(()=>T.value.slice().sort((V,te)=>V.date===te.date?te.id-V.id:V.date{let V=0,te=0,R=0;for(const L of T.value)L.type==="income"?V+=L.amount:(te+=L.amount,L.reimbursable===1&&L.reimbursed!==1&&(R+=L.amount));return{income:V,expense:te,pending:R,balance:V-te}}),le=P(""),Q=nt(()=>{le.value="";const V=[],te=ee.value,R=q.value;if(!te||!R||te>R)return V;const L=Math.round((Gn(R).getTime()-Gn(te).getTime())/864e5)+1,fe=new Map,je=new Map;for(const et of T.value){const Bt=fe.get(et.date)||{i:0,e:0};et.type==="income"?Bt.i+=et.amount:Bt.e+=et.amount,fe.set(et.date,Bt);const bt=et.date.slice(0,7),wt=je.get(bt)||{i:0,e:0};et.type==="income"?wt.i+=et.amount:wt.e+=et.amount,je.set(bt,wt)}let Je=[],ft="day";if(L<=92){let et=te,Bt=0;for(;et<=R&&Bt<4e3;)Je.push(et),et=Ft(et,1),Bt++}else{ft="month";let et=te.slice(0,7);const Bt=R.slice(0,7);let bt=0;for(;et<=Bt&&bt<600;){Je.push(et);const wt=Number(et.slice(0,4)),Ne=Number(et.slice(5,7))-1,rn=new Date(wt,Ne+1,1);et=rn.getFullYear()+"-"+(rn.getMonth()+1<10?"0"+(rn.getMonth()+1):String(rn.getMonth()+1)),bt++}}if(!Je.length)return V;Je.length>120&&(ft==="day"?le.value="时间跨度较长,仅展示最近 120 天":le.value="时间跨度较长,仅展示最近 120 个月",Je=Je.slice(-120));const It=ft==="day"?fe:je,Ze=Math.max(1,Math.ceil(Je.length/8));return Je.forEach((et,Bt)=>{const bt=It.get(et)||{i:0,e:0};let wt="",Ne="";ft==="day"?(wt=Number(et.slice(5,7))+"."+Number(et.slice(8,10)),Ne=et+" · 支出 "+o(bt.e)+" · 收入 "+o(bt.i)):(wt=et.slice(2,4)+"."+Number(et.slice(5,7)),Ne=Number(et.slice(0,4))+" 年 "+Number(et.slice(5,7))+" 月 · 支出 "+o(bt.e)+" · 收入 "+o(bt.i)),V.push({label:wt,tip:Ne,income:bt.i,expense:bt.e,showLabel:Bt%Ze===0||Bt===Je.length-1})}),V}),Ae=nt(()=>{let V=0;for(const te of Q.value)V=Math.max(V,te.income,te.expense);return V||1}),lt=P("expense"),it=P([]);pt(lt,()=>{it.value=[]});function Te(V){const te=it.value.indexOf(V);te>=0?it.value.splice(te,1):it.value=[...it.value,V]}const kt=nt(()=>{const V=new Map;for(const te of T.value){if(te.type!==lt.value)continue;const R=V.get(te.category)||{name:te.category,amount:0,count:0};R.amount+=te.amount,R.count++,V.set(te.category,R)}return Array.from(V.values()).sort((te,R)=>R.amount-te.amount)}),xt=nt(()=>kt.value.reduce((V,te)=>V+te.amount,0)),Ke=nt(()=>kt.value.map(V=>({...V,color:n(V.name),percent:xt.value?Math.round(V.amount/xt.value*100):0,dim:it.value.length>0&&!it.value.includes(V.name)}))),_=nt(()=>{if(!it.value.length)return null;let V=0,te=0;for(const R of T.value)R.type!==lt.value||!it.value.includes(R.category)||(V+=R.amount,te++);return{cats:it.value.length,count:te,amount:V,percent:xt.value?Math.round(V/xt.value*100):0}}),g=P("all"),C=P("all"),D=nt(()=>Ye.value.filter(V=>!(g.value!=="all"&&V.type!==g.value||it.value.length&&!it.value.includes(V.category)||C.value==="pending"&&!(V.type==="expense"&&V.reimbursable===1&&V.reimbursed!==1)||C.value==="done"&&!(V.reimbursable===1&&V.reimbursed===1))));function re(V){return o(V)}function pe(V){return(V.type==="income"?"+":"-")+o(V.amount)}async function xe(V){await Qh(V.id),await Se(),Ve("已标记为已报销")}function we(V){ae.value=V.id,de.value={type:V.type,category:V.category,amountYuan:re(V.amount).replace(/,/g,""),date:V.date,note:V.note||"",reimbursable:V.reimbursable,reimbursed:V.reimbursed},J.value=!0}function ke(){ae.value=null,de.value={type:"expense",category:Ue.value[0]||"",amountYuan:"",date:ut(),note:"",reimbursable:0,reimbursed:0},J.value=!0}async function ve(V){if(ae.value){await Jh(ae.value,V),J.value=!1,await Se(),Ve("账目已更新");return}await Yh({type:V.type,category:V.category,amount:V.amount,date:V.date,note:V.note,reimbursable:V.reimbursable,reimbursed:V.reimbursed}),J.value=!1,await Se(),Ve("已记一笔")}async function Re(){ue.value&&ue.value.id&&await Xh(ue.value.id),ue.value=null,await Se(),Ve("账目已删除")}return(V,te)=>(x(),E("div",$1,[i("div",S1,[r.value!=="custom"?(x(),E("button",{key:0,class:"icon-btn",disabled:!j.value,title:"上一周期",onClick:te[0]||(te[0]=R=>O(-1))},[be(He,{name:"chevron-left",size:16})],8,E1)):me("",!0),i("button",{class:"period-title",title:"选择统计周期",onClick:_e},[i("span",A1,F(oe.value),1),be(He,{name:"chevron-down",size:14})]),r.value!=="custom"?(x(),E("button",{key:1,class:"icon-btn",disabled:!A.value,title:"下一周期",onClick:te[1]||(te[1]=R=>O(1))},[be(He,{name:"chevron-right",size:16})],8,T1)):me("",!0),ne.value?(x(),E("button",{key:2,class:"btn btn-sm",onClick:Ie},F(r.value==="cycle"?"回到本期":"回到本月"),1)):me("",!0),te[13]||(te[13]=i("span",{class:"flex1"},null,-1)),Pe(i("select",{class:"select w-filter","onUpdate:modelValue":te[2]||(te[2]=R=>g.value=R)},[...te[10]||(te[10]=[i("option",{value:"all"},"全部类型",-1),i("option",{value:"expense"},"仅支出",-1),i("option",{value:"income"},"仅收入",-1)])],512),[[vs,g.value]]),Pe(i("select",{class:"select w-filter","onUpdate:modelValue":te[3]||(te[3]=R=>C.value=R)},[...te[11]||(te[11]=[i("option",{value:"all"},"全部报销",-1),i("option",{value:"pending"},"待报销",-1),i("option",{value:"done"},"已报销",-1)])],512),[[vs,C.value]]),i("button",{class:"btn btn-primary btn-sm",onClick:ke},[be(He,{name:"plus",size:14}),te[12]||(te[12]=At(" 记一笔",-1))])]),i("div",P1,[i("div",O1,[te[14]||(te[14]=i("div",{class:"muted"},"本期收入(元)",-1)),i("div",M1,F(re(We.value.income)),1)]),i("div",I1,[te[15]||(te[15]=i("div",{class:"muted"},"本期支出(元)",-1)),i("div",j1,F(re(We.value.expense)),1)]),i("div",D1,[te[16]||(te[16]=i("div",{class:"muted"},"本期结余(元)",-1)),i("div",{class:ze(["stat-num num",{"amt-income":We.value.balance>=0,"amt-expense":We.value.balance<0}])},F(re(We.value.balance)),3)]),i("div",L1,[te[17]||(te[17]=i("div",{class:"muted"},"待报销(元)",-1)),i("div",R1,F(re(We.value.pending)),1)])]),i("div",K1,[te[18]||(te[18]=ad('
每日收支收入 支出
',1)),le.value?(x(),E("div",N1,F(le.value),1)):me("",!0),Q.value.length?(x(),E("div",F1,[i("div",V1,[(x(!0),E(Oe,null,st(Q.value,(R,L)=>(x(),E("div",{key:L,class:"chart-col",title:R.tip},[i("div",U1,[i("div",{class:"cbar cbar-income",style:pn({height:Math.round(R.income/Ae.value*100)+"%"})},null,4),i("div",{class:"cbar cbar-expense",style:pn({height:Math.round(R.expense/Ae.value*100)+"%"})},null,4)])],8,B1))),128))]),i("div",q1,[(x(!0),E(Oe,null,st(Q.value,(R,L)=>(x(),E("span",{key:L,class:"chart-label num"},F(R.showLabel?R.label:""),1))),128))])])):(x(),E("div",H1,"本周期暂无账目"))]),kt.value.length?(x(),E("div",z1,[i("div",W1,[te[19]||(te[19]=i("span",{class:"sec-title"},"分类统计",-1)),i("div",G1,[i("button",{class:ze(["seg-btn",{active:lt.value==="expense"}]),onClick:te[4]||(te[4]=R=>lt.value="expense")},"支出",2),i("button",{class:ze(["seg-btn",{active:lt.value==="income"}]),onClick:te[5]||(te[5]=R=>lt.value="income")},"收入",2)])]),i("div",Y1,[i("button",{class:ze(["chip",{active:!it.value.length}]),onClick:te[6]||(te[6]=R=>it.value=[])},"全部",2),(x(!0),E(Oe,null,st(kt.value,R=>(x(),E("button",{key:R.name,class:ze(["chip",{active:it.value.includes(R.name)}]),onClick:L=>Te(R.name)},F(R.name),11,J1))),128))]),_.value?(x(),E("div",X1,[i("span",null,"已选 "+F(_.value.cats)+" 类 · "+F(_.value.count)+" 笔",1),i("span",Q1,F(re(_.value.amount))+" 元 · 占本期"+F(lt.value==="expense"?"支出":"收入")+" "+F(_.value.percent)+"%",1)])):me("",!0),(x(!0),E(Oe,null,st(Ke.value,R=>(x(),E("div",{key:R.name,class:ze(["bar-row",{dim:R.dim}]),title:R.count+" 笔"},[i("i",{class:"cat-dot",style:pn({background:R.color})},null,4),i("span",e0,F(R.name),1),i("span",t0,[i("span",{class:"bar-fill",style:pn({width:R.percent+"%",background:R.color})},null,4)]),i("span",n0,F(re(R.amount)),1),i("span",s0,F(R.percent)+"%",1)],10,Z1))),128))])):me("",!0),I.value?(x(),E("div",o0,[i("div",r0,F(I.value),1),te[20]||(te[20]=i("div",{class:"muted loc-note"},"请将上方完整错误文字发送给开发者",-1))])):me("",!0),i("div",a0,[i("table",i0,[te[22]||(te[22]=i("thead",null,[i("tr",null,[i("th",null,"日期"),i("th",null,"分类"),i("th",null,"金额(元)"),i("th",null,"备注"),i("th",null,"报销"),i("th",{class:"th-ops"},"操作")])],-1)),i("tbody",null,[(x(!0),E(Oe,null,st(D.value,R=>(x(),E("tr",{key:R.id},[i("td",l0,F(R.date),1),i("td",u0,[i("span",c0,F(R.category),1)]),i("td",{class:ze(["num",R.type==="income"?"amt-income":"amt-expense"]),"data-label":"金额"},F(pe(R)),3),i("td",d0,F(R.note||"--"),1),i("td",f0,[R.type!=="expense"||R.reimbursable!==1?(x(),E("span",p0,"--")):R.reimbursed===1?(x(),E("span",v0,"已报销")):(x(),E("span",m0,"待报销"))]),i("td",h0,[i("div",y0,[R.type==="expense"&&R.reimbursable===1&&R.reimbursed!==1?(x(),E("button",{key:0,class:"btn btn-xs",onClick:L=>xe(R)},"标记已报销",8,g0)):me("",!0),i("button",{class:"btn btn-xs",onClick:L=>we(R)},"编辑",8,b0),i("button",{class:"btn btn-xs",onClick:L=>ue.value=R},"删除",8,w0)])])]))),128)),!D.value.length&&!$.value?(x(),E("tr",_0,[...te[21]||(te[21]=[i("td",{colspan:"6",class:"empty muted"},"该周期暂无账目",-1)])])):me("",!0)])])]),i("div",k0,"本期 "+F(T.value.length)+" 条 · 当前筛选 "+F(D.value.length)+" 条",1),be(e1,{open:J.value,title:ae.value?"编辑账目":"记一笔",initial:de.value,onCancel:te[7]||(te[7]=R=>J.value=!1),onSave:ve},null,8,["open","title","initial"]),be(x1,{open:G.value,mode:r.value,anchor:y.value,month:l.value,"cycle-sel":u.value,"custom-start":f.value,"custom-end":v.value,"cycle-count":M.value,"has-before":m.value,months:w.value,onClose:te[8]||(te[8]=R=>G.value=!1),onApply:Me,onSaveAnchor:qe},null,8,["open","mode","anchor","month","cycle-sel","custom-start","custom-end","cycle-count","has-before","months"]),be(xn,{open:!!ue.value,title:"删除确认",message:ue.value?"将删除 "+ue.value.date+" 的账目("+ue.value.category+" "+re(ue.value.amount)+" 元)。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:te[9]||(te[9]=R=>ue.value=null),onConfirm:Re},null,8,["open","message"])]))}}),$0=Vt(x0,[["__scopeId","data-v-f021b1ed"]]),S0={class:"memo-page"},E0={class:"card memo-list"},A0={class:"pane-head"},T0={class:"pane-title"},P0={class:"memo-scroll"},O0=["onClick"],M0={class:"memo-item-title"},I0={class:"muted memo-item-sub"},j0={class:"muted num memo-item-time"},D0={key:0,class:"muted empty"},L0={class:"card memo-editor"},R0={class:"editor-foot"},K0={class:"muted foot-info"},N0=["disabled"],F0=["disabled"],V0={key:1,class:"empty muted editor-empty"},B0=Kt({__name:"MemoView",setup(e){const t=P([]),n=P(null),o=P(!1),r=P(""),l=P(""),u=P(null),f=P(null);async function v(){if(t.value=await Bh(),n.value&&n.value.id){const ee=t.value.find(q=>q.id===n.value.id);ee&&(n.value=ee)}}cn(async()=>{await v(),t.value.length&&w(t.value[0]),window.addEventListener("keydown",y)}),bn(()=>window.removeEventListener("keydown",y)),pt(Vi,async ee=>{if(!ee)return;t.value.length||await v();const q=t.value.find(oe=>oe.id===ee);Vi.value=null,q&&T(q)},{immediate:!0});function y(ee){(ee.ctrlKey||ee.metaKey)&&ee.key.toLowerCase()==="s"&&o.value&&m.value&&(ee.preventDefault(),ae())}const m=nt(()=>{if(!o.value)return!1;const ee=n.value?n.value.title:"",q=n.value?n.value.content:"";return r.value!==ee||l.value!==q});function w(ee){n.value=ee,o.value=!0,r.value=ee.title,l.value=ee.content}function T(ee){if(!(o.value&&n.value&&n.value.id===ee.id)){if(m.value){f.value={type:"select",memo:ee};return}w(ee)}}function $(){if(m.value){f.value={type:"new"};return}I()}function I(){n.value=null,o.value=!0,r.value="",l.value=""}function J(){n.value?w(n.value):I()}async function ae(){if(!r.value.trim()&&!l.value.trim()){Ve("标题与内容不能都为空");return}if(n.value&&n.value.id)await qh(n.value.id,r.value,l.value),Ve("备忘已保存");else{const ee=await Uh(r.value,l.value);n.value=ee,r.value=ee.title,l.value=ee.content,Ve("备忘已创建")}await v()}function de(){n.value&&n.value.id&&(u.value=n.value)}async function ue(){u.value&&u.value.id&&(await Hh(u.value.id),Ve("备忘已删除")),u.value=null,await v(),I()}function G(){const ee=f.value;f.value=null,ee&&(ee.type==="select"?w(ee.memo):I())}function S(ee){return(ee.content||"").replace(/\s+/g," ").slice(0,30)}function M(ee){return ee.replace("T"," ").slice(0,16)}return(ee,q)=>(x(),E("div",S0,[i("aside",E0,[i("div",A0,[i("span",T0,"备忘录("+F(t.value.length)+")",1),i("button",{class:"btn btn-primary btn-sm",onClick:$},"新建")]),i("div",P0,[(x(!0),E(Oe,null,st(t.value,oe=>(x(),E("div",{key:oe.id,class:ze(["memo-item",{active:o.value&&n.value&&n.value.id===oe.id}]),onClick:j=>T(oe)},[i("div",M0,F(oe.title||"无标题"),1),i("div",I0,F(S(oe)||"空"),1),i("div",j0,F(M(oe.updated_at)),1)],10,O0))),128)),t.value.length?me("",!0):(x(),E("div",D0,"暂无备忘"))])]),i("section",L0,[o.value?(x(),E(Oe,{key:0},[Pe(i("input",{class:"input title-input","onUpdate:modelValue":q[0]||(q[0]=oe=>r.value=oe),placeholder:"标题"},null,512),[[Le,r.value]]),Pe(i("textarea",{class:"textarea content-textarea","onUpdate:modelValue":q[1]||(q[1]=oe=>l.value=oe),placeholder:"内容"},null,512),[[Le,l.value]]),i("div",R0,[i("span",K0,[m.value?(x(),E(Oe,{key:0},[At("有未保存修改")],64)):n.value&&n.value.id?(x(),E(Oe,{key:1},[At("更新于 "+F(M(n.value.updated_at)),1)],64)):(x(),E(Oe,{key:2},[At("新备忘")],64))]),q[4]||(q[4]=i("span",{class:"flex1"},null,-1)),n.value&&n.value.id?(x(),E("button",{key:0,class:"btn btn-sm",onClick:de},"删除")):me("",!0),i("button",{class:"btn btn-sm",disabled:!m.value,onClick:J},"放弃修改",8,N0),i("button",{class:"btn btn-primary btn-sm",disabled:!m.value,onClick:ae},"保存",8,F0)])],64)):(x(),E("div",V0,"选择左侧备忘,或点击右上角新建"))]),be(xn,{open:!!u.value,title:"删除确认",message:u.value?"将删除备忘「"+(u.value.title||"无标题")+"」。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:q[2]||(q[2]=oe=>u.value=null),onConfirm:ue},null,8,["open","message"]),be(xn,{open:!!f.value,title:"未保存提示",message:"当前备忘有未保存的修改,继续操作将丢失这些修改。","confirm-text":"放弃修改并继续",onCancel:q[3]||(q[3]=oe=>f.value=null),onConfirm:G},null,8,["open"])]))}}),U0=Vt(B0,[["__scopeId","data-v-a0931fc7"]]),q0=["aria-label"],H0={class:"dialog-head"},z0={class:"dialog-title"},W0={class:"dialog-body"},G0={class:"form-grid"},Y0={class:"field span2"},J0={class:"field span2"},X0={class:"field span2"},Q0={class:"pwd-row"},Z0={class:"field span2"},ek={key:0,class:"form-error"},tk={class:"dialog-btns"},nk=Kt({__name:"CredentialDialog",props:{open:{type:Boolean},title:{},initial:{}},emits:["cancel","save"],setup(e,{emit:t}){const n=e,o=t,r=P(""),l=P(""),u=P(""),f=P(""),v=P(""),y=P(null);function m($){n.open&&$.key==="Escape"&&o("cancel")}pt(()=>n.open,async $=>{var I;$?(r.value=n.initial.system,l.value=n.initial.account,u.value=n.initial.password,f.value=n.initial.remark,v.value="",window.addEventListener("keydown",m),await Ks(),(I=y.value)==null||I.focus()):window.removeEventListener("keydown",m)}),bn(()=>window.removeEventListener("keydown",m));function w(){const $="ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789",I="!@#$%^&*",J=crypto.getRandomValues(new Uint8Array(14));let ae="";for(let de=0;de(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:I[6]||(I[6]=Ut(J=>o("cancel"),["self"]))},[i("div",{class:"dialog",role:"dialog","aria-label":e.title},[i("div",H0,[i("span",z0,F(e.title),1),i("button",{class:"icon-btn",title:"关闭",onClick:I[0]||(I[0]=J=>o("cancel"))},[be(He,{name:"close",size:16})])]),i("div",W0,[i("div",G0,[i("div",Y0,[I[7]||(I[7]=i("label",null,"系统名称(必填)",-1)),Pe(i("input",{ref_key:"systemInput",ref:y,class:"input","onUpdate:modelValue":I[1]||(I[1]=J=>r.value=J),placeholder:"如:企业邮箱 / OA / VPN"},null,512),[[Le,r.value]])]),i("div",J0,[I[8]||(I[8]=i("label",null,"账号(必填)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":I[2]||(I[2]=J=>l.value=J),placeholder:"用户名、工号或邮箱"},null,512),[[Le,l.value]])]),i("div",X0,[I[9]||(I[9]=i("label",null,"密码(必填)",-1)),i("div",Q0,[Pe(i("input",{class:"input","onUpdate:modelValue":I[3]||(I[3]=J=>u.value=J),placeholder:"输入或点击生成"},null,512),[[Le,u.value]]),i("button",{class:"btn btn-sm",onClick:w},"生成")])]),i("div",Z0,[I[10]||(I[10]=i("label",null,"备注",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":I[4]||(I[4]=J=>f.value=J),placeholder:"用途、到期时间、负责人等(选填)"},null,512),[[Le,f.value]])])]),v.value?(x(),E("div",ek,F(v.value),1)):me("",!0)]),i("div",tk,[i("button",{class:"btn btn-sm",onClick:I[5]||(I[5]=J=>o("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:T},"保存")])],8,q0)])):me("",!0)]),_:1})]))}}),sk=Vt(nk,[["__scopeId","data-v-2eafe20e"]]),ok={class:"vault-page"},rk={key:0,class:"empty muted"},ak={key:1,class:"card lock-card"},ik={class:"lock-badge"},lk={key:0,class:"form-error"},uk=["disabled"],ck={key:0,class:"form-error"},dk=["disabled"],fk={class:"vault-toolbar"},pk={class:"search-wrap"},vk={class:"card table-card"},mk={class:"cred-table"},hk={class:"td-system"},yk=["onClick"],gk={class:"pwd-cell"},bk={class:"num pwd-text"},wk=["onClick"],_k=["onClick"],kk={class:"td-remark"},Ck={class:"td-ops"},xk={class:"ops"},$k=["onClick"],Sk=["onClick"],Ek={key:0},Ak={class:"muted table-note num"},Tk={class:"dialog pwd-dialog"},Pk={class:"dialog-head"},Ok={class:"dialog-body"},Mk={class:"vp-field"},Ik={class:"vp-field"},jk={class:"vp-field"},Dk={key:0,class:"form-error"},Lk={class:"dialog-btns"},Rk=5*60*1e3,Kk=Kt({__name:"VaultView",setup(e){const t=P(null),n=P(km()),o=P(!1),r=P(""),l=P(""),u=P(""),f=P(""),v=P(""),y=P([]),m=P(""),w=P({}),T=P(!1),$=P(null),I=P({system:"",account:"",password:"",remark:""}),J=P(null),ae=P(!1),de=P(""),ue=P(""),G=P(""),S=P("");async function M(){y.value=await Em(),w.value={}}let ee=null;function q(){ee!==null&&window.clearTimeout(ee),ee=window.setTimeout(()=>{n.value&&(sa(),n.value=!1,y.value=[],w.value={},Ve("长时间未操作,密码库已自动锁定"))},Rk)}function oe(){n.value&&q()}cn(async()=>{t.value=await _d(),window.addEventListener("click",oe),window.addEventListener("keydown",oe),n.value&&q()}),bn(()=>{window.removeEventListener("click",oe),window.removeEventListener("keydown",oe),ee!==null&&window.clearTimeout(ee)});const j=nt(()=>{const le=m.value.trim().toLowerCase();return le?y.value.filter(Q=>(Q.system+" "+Q.account+" "+(Q.remark||"")).toLowerCase().includes(le)):y.value});async function A(){if(!o.value){if(u.value="",!r.value){u.value="请输入主密码";return}if(r.value.length<6){u.value="主密码至少 6 位";return}if(r.value!==l.value){u.value="两次输入的主密码不一致";return}o.value=!0;try{await Cm(r.value),r.value="",l.value="",n.value=!0,q(),await M(),Ve("主密码已设置,密码库已解锁")}catch(le){u.value=le instanceof Error?le.message:"设置失败"}o.value=!1}}async function O(){if(!o.value){if(v.value="",!f.value){v.value="请输入主密码";return}o.value=!0;try{await xm(f.value),f.value="",n.value=!0,q(),await M()}catch(le){v.value=le instanceof Error?le.message:"解锁失败"}o.value=!1}}function ne(){sa(),n.value=!1,y.value=[],w.value={},ee!==null&&window.clearTimeout(ee),Ve("密码库已锁定")}async function Ie(le){const Q=le.id;if(w.value[Q]){w.value[Q]=!1;return}try{le.passwordPlain=await gi(Q),w.value[Q]=!0}catch(Ae){Ve(Ae instanceof Error?Ae.message:"解密失败")}}async function Se(le){try{const Q=await gi(le.id);await Gi(Q),Ve("密码已复制")}catch(Q){Ve(Q instanceof Error?Q.message:"复制失败")}}async function _e(le){await Gi(le.account),Ve("账号已复制")}function Me(){$.value=null,I.value={system:"",account:"",password:"",remark:""},T.value=!0}async function qe(le){try{const Q=await gi(le.id);$.value=le.id,I.value={system:le.system,account:le.account,password:Q,remark:le.remark||""},T.value=!0}catch(Q){Ve(Q instanceof Error?Q.message:"解密失败")}}async function Ue(le){const Q=$.value??void 0;await Am(le,Q),T.value=!1,await M(),Ve(Q?"账号已更新":"账号已添加")}async function tt(){J.value&&J.value.id&&(await Tm(J.value.id),Ve("账号已删除")),J.value=null,await M()}function Ye(){de.value="",ue.value="",G.value="",S.value="",ae.value=!0}async function We(){S.value="";try{const le=await Pm(de.value,ue.value);ae.value=!1,de.value="",ue.value="",G.value="",Ve("主密码已修改,"+le+" 条账号密码已重新加密")}catch(le){S.value=le instanceof Error?le.message:"修改失败"}}return(le,Q)=>(x(),E("div",ok,[t.value===null?(x(),E("div",rk,"加载中")):n.value?(x(),E(Oe,{key:2},[i("div",fk,[i("div",pk,[be(He,{name:"search",size:14,class:"search-icon"}),Pe(i("input",{class:"input","onUpdate:modelValue":Q[3]||(Q[3]=Ae=>m.value=Ae),placeholder:"搜索系统名称、账号或备注"},null,512),[[Le,m.value]])]),Q[16]||(Q[16]=i("span",{class:"flex1"},null,-1)),i("button",{class:"btn btn-sm",onClick:Ye},"修改主密码"),i("button",{class:"btn btn-sm",onClick:ne},"锁定"),i("button",{class:"btn btn-primary btn-sm",onClick:Me},"新增账号")]),i("div",vk,[i("table",mk,[Q[18]||(Q[18]=i("thead",null,[i("tr",null,[i("th",null,"系统名称"),i("th",null,"账号"),i("th",null,"密码"),i("th",null,"备注"),i("th",{class:"th-ops"},"操作")])],-1)),i("tbody",null,[(x(!0),E(Oe,null,st(j.value,Ae=>(x(),E("tr",{key:Ae.id},[i("td",hk,F(Ae.system),1),i("td",null,[i("span",{class:"copyable",title:"点击复制账号",onClick:lt=>_e(Ae)},F(Ae.account),9,yk)]),i("td",null,[i("div",gk,[i("span",bk,F(w.value[Ae.id]?Ae.passwordPlain:"........"),1),i("button",{class:"btn btn-xs",onClick:lt=>Ie(Ae)},F(w.value[Ae.id]?"隐藏":"显示"),9,wk),i("button",{class:"btn btn-xs",onClick:lt=>Se(Ae)},"复制",8,_k)])]),i("td",kk,F(Ae.remark||"--"),1),i("td",Ck,[i("div",xk,[i("button",{class:"btn btn-xs",onClick:lt=>qe(Ae)},"编辑",8,$k),i("button",{class:"btn btn-xs",onClick:lt=>J.value=Ae},"删除",8,Sk)])])]))),128)),j.value.length?me("",!0):(x(),E("tr",Ek,[...Q[17]||(Q[17]=[i("td",{colspan:"5",class:"empty muted"},"暂无账号,点击右上角新增",-1)])]))])])]),i("div",Ak,"共 "+F(y.value.length)+" 条账号记录 · 密码以 AES-256-GCM 加密,服务器仅存密文",1)],64)):(x(),E("div",ak,[i("div",ik,[be(He,{name:"lock",size:26})]),t.value===!1?(x(),E(Oe,{key:0},[Q[12]||(Q[12]=i("div",{class:"lock-title"},"设置主密码",-1)),Q[13]||(Q[13]=i("div",{class:"muted lock-tip"},"主密码用于加密保存在本机的账号密码,遗忘后无法找回,请务必牢记",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[0]||(Q[0]=Ae=>r.value=Ae),placeholder:"设置主密码(至少 6 位)",onKeydown:Lt(A,["enter"])},null,544),[[Le,r.value]]),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[1]||(Q[1]=Ae=>l.value=Ae),placeholder:"再次输入主密码",onKeydown:Lt(A,["enter"])},null,544),[[Le,l.value]]),u.value?(x(),E("div",lk,F(u.value),1)):me("",!0),i("button",{class:"btn btn-primary lock-btn",disabled:o.value,onClick:A},"完成设置并解锁",8,uk)],64)):(x(),E(Oe,{key:1},[Q[14]||(Q[14]=i("div",{class:"lock-title"},"密码库已锁定",-1)),Q[15]||(Q[15]=i("div",{class:"muted lock-tip"},"输入主密码解锁后查看与复制密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[2]||(Q[2]=Ae=>f.value=Ae),placeholder:"主密码",onKeydown:Lt(O,["enter"])},null,544),[[Le,f.value]]),v.value?(x(),E("div",ck,F(v.value),1)):me("",!0),i("button",{class:"btn btn-primary lock-btn",disabled:o.value,onClick:O},"解锁",8,dk)],64))])),be(sk,{open:T.value,title:$.value?"编辑账号":"新增账号",initial:I.value,onCancel:Q[4]||(Q[4]=Ae=>T.value=!1),onSave:Ue},null,8,["open","title","initial"]),be(xn,{open:!!J.value,title:"删除确认",message:J.value?"将删除系统「"+J.value.system+"」的账号记录。删除后不可恢复。":"","confirm-text":"删除",danger:"",onCancel:Q[5]||(Q[5]=Ae=>J.value=null),onConfirm:tt},null,8,["open","message"]),(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[ae.value?(x(),E("div",{key:0,class:"mask",onClick:Q[11]||(Q[11]=Ut(Ae=>ae.value=!1,["self"]))},[i("div",Tk,[i("div",Pk,[Q[19]||(Q[19]=i("span",{class:"dialog-title"},"修改主密码",-1)),i("button",{class:"icon-btn",title:"关闭",onClick:Q[6]||(Q[6]=Ae=>ae.value=!1)},[be(He,{name:"close",size:16})])]),i("div",Ok,[i("div",Mk,[Q[20]||(Q[20]=i("label",null,"旧主密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[7]||(Q[7]=Ae=>de.value=Ae)},null,512),[[Le,de.value]])]),i("div",Ik,[Q[21]||(Q[21]=i("label",null,"新主密码(至少 6 位)",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[8]||(Q[8]=Ae=>ue.value=Ae)},null,512),[[Le,ue.value]])]),i("div",jk,[Q[22]||(Q[22]=i("label",null,"确认新主密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":Q[9]||(Q[9]=Ae=>G.value=Ae)},null,512),[[Le,G.value]])]),S.value?(x(),E("div",Dk,F(S.value),1)):me("",!0),Q[23]||(Q[23]=i("div",{class:"muted vp-tip"},"确认后所有账号密码将使用新主密码重新加密",-1))]),i("div",Lk,[i("button",{class:"btn btn-sm",onClick:Q[10]||(Q[10]=Ae=>ae.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:We},"确认修改")])])])):me("",!0)]),_:1})]))]))}}),Nk=Vt(Kk,[["__scopeId","data-v-6d2745bc"]]),Fk=["aria-label"],Vk={class:"dialog-head"},Bk={class:"dialog-title"},Uk={class:"dialog-body"},qk={class:"field"},Hk={key:0},zk=["placeholder"],Wk={key:1,class:"form-error"},Gk={class:"dialog-btns"},Yk=Kt({__name:"InputDialog",props:{open:{type:Boolean},title:{},label:{default:""},placeholder:{default:""},initial:{default:""},confirmText:{default:"确定"},validate:{}},emits:["cancel","confirm"],setup(e,{emit:t}){const n=e,o=t,r=P(""),l=P(""),u=P(null);function f(y){n.open&&y.key==="Escape"&&o("cancel")}pt(()=>n.open,async y=>{var m,w;y?(r.value=n.initial,l.value="",window.addEventListener("keydown",f),await Ks(),(m=u.value)==null||m.focus(),(w=u.value)==null||w.select()):window.removeEventListener("keydown",f)}),bn(()=>window.removeEventListener("keydown",f));function v(){const y=r.value.trim();if(!y){l.value="请输入内容";return}const m=n.validate?n.validate(y):null;if(m){l.value=m;return}o("confirm",y)}return(y,m)=>(x(),Ct($n,{to:"body"},[be(Jn,{name:"modal"},{default:Sn(()=>[e.open?(x(),E("div",{key:0,class:"mask",onClick:m[3]||(m[3]=Ut(w=>o("cancel"),["self"]))},[i("div",{class:"dialog input-dialog",role:"dialog","aria-label":e.title},[i("div",Vk,[i("span",Bk,F(e.title),1),i("button",{class:"icon-btn",title:"关闭",onClick:m[0]||(m[0]=w=>o("cancel"))},[be(He,{name:"close",size:16})])]),i("div",Uk,[i("div",qk,[e.label?(x(),E("label",Hk,F(e.label),1)):me("",!0),Pe(i("input",{ref_key:"input",ref:u,class:ze(["input",{invalid:l.value}]),"onUpdate:modelValue":m[1]||(m[1]=w=>r.value=w),placeholder:e.placeholder,maxlength:"20",onKeydown:Lt(v,["enter"])},null,42,zk),[[Le,r.value]]),l.value?(x(),E("div",Wk,F(l.value),1)):me("",!0)])]),i("div",Gk,[i("button",{class:"btn btn-sm",onClick:m[2]||(m[2]=w=>o("cancel"))},"取消"),i("button",{class:"btn btn-primary btn-sm",onClick:v},F(e.confirmText),1)])],8,Fk)])):me("",!0)]),_:1})]))}}),Jk=Vt(Yk,[["__scopeId","data-v-4b14ba4f"]]);function Xk(e){return'"'+(e==null?"":String(e)).replace(/"/g,'""')+'"'}async function Qu(e,t){const o="\uFEFF"+t.map(f=>f.map(Xk).join(",")).join(`\r +`);if(uo.isNativePlatform()){const{downloadText:f}=await Vd(async()=>{const{downloadText:v}=await Promise.resolve().then(()=>tb);return{downloadText:v}},void 0,import.meta.url);return f(e,o)}const r=new Blob([o],{type:"text/csv;charset=utf-8"}),l=URL.createObjectURL(r),u=document.createElement("a");return u.href=l,u.download=e,u.click(),window.setTimeout(()=>URL.revokeObjectURL(l),1e4),""}const Qk={class:"settings"},Zk={class:"card section"},eC={class:"muted acc-line"},tC={class:"ai-grid"},nC={class:"rule-item"},sC={class:"rule-item"},oC={class:"rule-item"},rC={key:0,class:"form-error"},aC={class:"rule-save"},iC={class:"card section"},lC={class:"rule-grid"},uC={class:"rule-item"},cC={class:"rule-item"},dC={class:"rule-item"},fC={class:"rule-item"},pC={class:"rule-item"},vC={class:"card section"},mC={class:"proj-add"},hC={key:0,class:"muted proj-tip"},yC=["onKeydown"],gC=["onClick"],bC=["onClick"],wC=["onClick"],_C={key:1,class:"muted"},kC={class:"card section"},CC={class:"card section"},xC={class:"muted acc-line"},$C={class:"rule-save"},SC=["disabled"],EC={key:0,class:"muted acc-line"},AC={key:1,class:"form-error"},TC={key:2,class:"form-error"},PC={class:"card section"},OC={class:"ai-grid"},MC={class:"rule-item"},IC={class:"rule-item"},jC={class:"rule-item"},DC={class:"card section"},LC={class:"cat-block"},RC={class:"cat-head"},KC={class:"cat-chips"},NC=["onClick"],FC=["onClick"],VC={class:"cat-block"},BC={class:"cat-head"},UC={class:"cat-chips"},qC=["onClick"],HC=["onClick"],zC={class:"cat-block"},WC={class:"cat-head"},GC={class:"cat-chips"},YC=["onClick"],JC=["onClick"],XC={class:"card section"},QC={class:"backup-row"},ZC={key:0,class:"import-error"},ex=Kt({__name:"SettingsView",setup(e){var te;const t=P({work_start:"09:00",work_end:"18:00",grace_minutes:10,lunch_minutes:60,remind_weekly:"friday"}),n=P([]),o=P(""),r=P(""),l=P(""),u=P(""),f=P(""),v=P(""),y=P(null),m=P(""),w=P([]),T=P([]),$=P([]);async function I(){w.value=await Zo(),T.value=await la("expense"),$.value=await la("income")}const J=P({open:!1,kind:"log",index:-1,initial:""}),ae=P(null);function de(R){return R==="log"?w.value:R==="expense"?T.value:$.value}async function ue(R,L){R==="log"?(w.value=L,await ry(L)):R==="expense"?(T.value=L,await Wi("expense",L)):($.value=L,await Wi("income",L))}function G(R){J.value={open:!0,kind:R,index:-1,initial:""}}function S(R,L,fe){J.value={open:!0,kind:R,index:L,initial:fe}}function M(R){const{kind:L,index:fe}=J.value,je=de(L);return je.includes(R)&&!(fe>=0&&je[fe]===R)?"该分类已存在":null}async function ee(R){const{kind:L,index:fe}=J.value;fe>=0?(await ue(L,de(L).map((je,Je)=>Je===fe?R:je)),Ve("分类已更新(历史记录自动跟随显示)")):(await ue(L,[...de(L),R]),Ve("分类已添加")),J.value.open=!1}function q(R,L){const fe=de(R);if(fe.length<=1){Ve("至少保留一个分类");return}ae.value={kind:R,index:L,name:fe[L]}}async function oe(){if(!ae.value)return;const{kind:R,index:L}=ae.value;await ue(R,de(R).filter((fe,je)=>je!==L)),Ve("分类已删除"),ae.value=null}const j=P(null),A=P(null),O=P(""),ne=P(((te=eo())==null?void 0:te.username)||""),Ie=P(""),Se=P(""),_e=P(""),Me=P(""),qe=P(!1),Ue="0.8.1",tt=P(""),Ye=P(""),We=P(""),le=P(""),Q=P(!1),Ae=P("");async function lt(){var R;tt.value=((R=hn())==null?void 0:R.username)||"",Ae.value=await Qm(),le.value=to.value}pt(to,R=>{le.value=R});async function it(){We.value="";try{await Td(),Ve("云端绑定已重建")}catch(R){We.value=R instanceof Error?R.message:"绑定失败"}}async function Te(){if(!Q.value){We.value="",le.value=to.value,Q.value=!0;try{const R=await Bi();Ae.value=R.at,Ye.value="推送 "+R.pushed+" 条 · 拉取 "+R.pulled+" 条 · 删除 "+R.removed+" 条",le.value="",Ve("同步完成")}catch(R){We.value=R instanceof Error?R.message:"同步失败"}Q.value=!1}}async function kt(){if(Me.value="",Se.value!==_e.value){Me.value="两次输入的新密码不一致";return}try{await Hm(Ie.value,Se.value),Ie.value="",Se.value="",_e.value="",Ve("登录密码已修改")}catch(R){Me.value=R instanceof Error?R.message:"修改失败"}}async function xt(){await zm(),window.location.reload()}async function Ke(){t.value=await ms(),n.value=await io(!0),l.value=(await gl()).join(` +`),u.value=await Tt("ai_base_url",""),f.value=await Tt("ai_api_key",""),v.value=await Tt("ai_model",""),await lt(),await I()}async function _(){await Nt("ai_base_url",u.value.trim()),await Nt("ai_api_key",f.value.trim()),await Nt("ai_model",v.value.trim()),Ve("AI 配置已保存")}async function g(){const R=ut(),L=await Promise.all([Qo("2000-01-01",R),io(!0)]),fe=L[0],je=L[1],Je=new Map(je.map(Ze=>[Ze.id,Ze.name])),ft=[["日期","分类","项目","内容","耗时(分钟)","成果","待跟进","收获","备注"]];for(const Ze of fe)ft.push([Ze.date,qo(Ze.category),Ze.project_id&&Je.get(Ze.project_id)||"",Ze.content,Ze.minutes==null?"":Ze.minutes,Ze.is_milestone?"是":"",Ze.needs_followup?"是":"",Ze.takeaway||"",Ze.remark||""]);const It=await Qu("工作记录_"+R.replace(/-/g,"")+".csv",ft);Ve(It?"CSV 已导出到:"+It:"CSV 已导出到系统下载目录")}async function C(){const R=ut(),L=await Promise.all([ms(),Xo("2000-01-01",R)]),fe=L[0],je=L[1],Je=["周日","周一","周二","周三","周四","周五","周六"],ft=[["日期","星期","状态","上班时间","下班时间","地点","类型","说明"]];for(const Ze of je){const et=co(Ze,Ze.date,fe,Ze.date===R);ft.push([Ze.date,Je[Gn(Ze.date).getDay()],et.label,Ze.clock_in_at?Wn(Ze.clock_in_at):"",Ze.clock_out_at?Wn(Ze.clock_out_at):"",Ze.location||"",Ze.kind==="makeup"?"补卡":Ze.kind==="leave"?"休假":"正常",Ze.note||""])}const It=await Qu("考勤记录_"+R.replace(/-/g,"")+".csv",ft);Ve(It?"CSV 已导出到:"+It:"CSV 已导出到系统下载目录")}cn(Ke);async function D(){await Nt("work_start",t.value.work_start),await Nt("work_end",t.value.work_end),await Nt("grace_minutes",String(t.value.grace_minutes)),await Nt("lunch_minutes",String(t.value.lunch_minutes)),await Nt("remind_weekly",t.value.remind_weekly),Ve("打卡规则已保存")}async function re(){await Dd(l.value.split(` +`)),Ve("常用地点已保存")}async function pe(){const R=o.value.trim();if(R){try{await ph(R),r.value="",o.value=""}catch{r.value="项目名已存在"}await Ke()}}function xe(R){y.value=R.id,m.value=R.name}async function we(R){const L=m.value.trim();if(L)try{await vh(R.id,L),r.value=""}catch{r.value="项目名已存在"}y.value=null,await Ke()}async function ke(R){await mh(R.id,R.archived!==1),await Ke()}async function ve(){try{const R=await ey(),L=await Ea("实习日志备份_"+ut().replace(/-/g,"")+".json",R);Ve(L?"备份已导出到:"+L:"备份已导出到系统下载目录")}catch(R){Ve("导出失败:"+(R instanceof Error?R.message:String(R)))}}function Re(R){const L=R.target,fe=L.files&&L.files[0];if(O.value="",!fe)return;const je=fe.name;fe.text().then(Je=>{A.value={name:je,text:Je}}),L.value=""}async function V(){if(A.value)try{await ty(A.value.text),A.value=null,O.value="",await Ke(),Ve("数据导入完成")}catch(R){A.value=null,O.value=R instanceof Error?R.message:"导入失败"}}return(R,L)=>(x(),E("div",Qk,[i("div",Zk,[L[27]||(L[27]=i("div",{class:"section-title"},"账号与隐私",-1)),i("div",eC,"v"+F(Wt(Ue))+" · 当前账号 "+F(ne.value)+" · 登录密码仅存 PBKDF2 哈希",1),i("div",tC,[i("div",nC,[L[24]||(L[24]=i("label",null,"旧登录密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":L[0]||(L[0]=fe=>Ie.value=fe)},null,512),[[Le,Ie.value]])]),i("div",sC,[L[25]||(L[25]=i("label",null,"新登录密码(至少 6 位)",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":L[1]||(L[1]=fe=>Se.value=fe)},null,512),[[Le,Se.value]])]),i("div",oC,[L[26]||(L[26]=i("label",null,"确认新登录密码",-1)),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":L[2]||(L[2]=fe=>_e.value=fe)},null,512),[[Le,_e.value]])])]),Me.value?(x(),E("div",rC,F(Me.value),1)):me("",!0),i("div",aC,[i("button",{class:"btn btn-primary btn-sm",onClick:kt},"修改登录密码"),i("button",{class:"btn btn-sm btn-danger",onClick:L[3]||(L[3]=fe=>qe.value=!0)},"删除此用户及全部数据")])]),i("div",iC,[L[34]||(L[34]=i("div",{class:"section-title"},"打卡规则",-1)),i("div",lC,[i("div",uC,[L[28]||(L[28]=i("label",null,"上班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":L[4]||(L[4]=fe=>t.value.work_start=fe)},null,512),[[Le,t.value.work_start]])]),i("div",cC,[L[29]||(L[29]=i("label",null,"下班时间",-1)),Pe(i("input",{type:"time",class:"input","onUpdate:modelValue":L[5]||(L[5]=fe=>t.value.work_end=fe)},null,512),[[Le,t.value.work_end]])]),i("div",dC,[L[30]||(L[30]=i("label",null,"迟到宽限(分钟)",-1)),Pe(i("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":L[6]||(L[6]=fe=>t.value.grace_minutes=fe)},null,512),[[Le,t.value.grace_minutes,void 0,{number:!0}]])]),i("div",fC,[L[31]||(L[31]=i("label",null,"午休扣除(分钟)",-1)),Pe(i("input",{type:"number",class:"input",min:"0","onUpdate:modelValue":L[7]||(L[7]=fe=>t.value.lunch_minutes=fe)},null,512),[[Le,t.value.lunch_minutes,void 0,{number:!0}]])]),i("div",pC,[L[33]||(L[33]=i("label",null,"周记提醒",-1)),Pe(i("select",{class:"select","onUpdate:modelValue":L[8]||(L[8]=fe=>t.value.remind_weekly=fe)},[...L[32]||(L[32]=[i("option",{value:"friday"},"每周五提醒",-1),i("option",{value:"off"},"关闭",-1)])],512),[[vs,t.value.remind_weekly]])])]),i("div",{class:"rule-save"},[i("button",{class:"btn btn-primary btn-sm",onClick:D},"保存规则")])]),i("div",vC,[L[35]||(L[35]=i("div",{class:"section-title"},"项目管理",-1)),i("div",mC,[Pe(i("input",{class:"input","onUpdate:modelValue":L[9]||(L[9]=fe=>o.value=fe),placeholder:"新项目名称",onKeydown:Lt(pe,["enter"])},null,544),[[Le,o.value]]),i("button",{class:"btn btn-sm",onClick:pe},"添加")]),r.value?(x(),E("div",hC,F(r.value),1)):me("",!0),(x(!0),E(Oe,null,st(n.value,fe=>(x(),E("div",{key:fe.id,class:"proj-row"},[y.value===fe.id?(x(),E(Oe,{key:0},[Pe(i("input",{class:"input","onUpdate:modelValue":L[10]||(L[10]=je=>m.value=je),onKeydown:Lt(je=>we(fe),["enter"])},null,40,yC),[[Le,m.value]]),i("button",{class:"btn btn-sm",onClick:je=>we(fe)},"保存",8,gC),i("button",{class:"btn btn-sm",onClick:L[11]||(L[11]=je=>y.value=null)},"取消")],64)):(x(),E(Oe,{key:1},[i("span",{class:ze(["proj-name",{archived:fe.archived===1}])},F(fe.name),3),i("button",{class:"icon-btn",title:"重命名",onClick:je=>xe(fe)},[be(He,{name:"edit",size:14})],8,bC),i("button",{class:"btn btn-sm",onClick:je=>ke(fe)},F(fe.archived===1?"恢复":"归档"),9,wC)],64))]))),128)),n.value.length?me("",!0):(x(),E("div",_C,"暂无项目,先添加一个"))]),i("div",kC,[L[37]||(L[37]=i("div",{class:"section-title"},"常用地点",-1)),Pe(i("textarea",{class:"textarea","onUpdate:modelValue":L[12]||(L[12]=fe=>l.value=fe),placeholder:"每行一个地点,如:公司、客户现场、出差、居家办公"},null,512),[[Le,l.value]]),i("div",{class:"rule-save"},[i("button",{class:"btn btn-primary btn-sm",onClick:re},"保存地点"),L[36]||(L[36]=i("span",{class:"muted loc-note"},"打卡时可直接输入新地点,保存后自动加入列表",-1))])]),i("div",CC,[L[38]||(L[38]=i("div",{class:"section-title"},"多端数据同步",-1)),i("div",xC,"云端账号:"+F(tt.value||"未绑定")+" · 数据存于服务器,其他端变更秒级自动刷新",1),i("div",$C,[i("button",{class:"btn btn-primary btn-sm",disabled:Q.value,onClick:Te},F(Q.value?"同步中":"立即同步"),9,SC),i("button",{class:"btn btn-sm",onClick:it},"重新校验连接")]),Ye.value?(x(),E("div",EC,"上次同步:"+F(Ae.value||"--")+" · "+F(Ye.value),1)):me("",!0),We.value?(x(),E("div",AC,F(We.value),1)):me("",!0),le.value?(x(),E("div",TC,"最近自动同步失败:"+F(le.value)+"(可点「立即同步」重试)",1)):me("",!0)]),i("div",PC,[L[43]||(L[43]=i("div",{class:"section-title"},"AI 润色配置(可选)",-1)),i("div",OC,[i("div",MC,[L[39]||(L[39]=i("label",null,"接口地址(OpenAI 兼容,到 /v1 为止)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":L[13]||(L[13]=fe=>u.value=fe),placeholder:"https://api.example.com/v1"},null,512),[[Le,u.value]])]),i("div",IC,[L[40]||(L[40]=i("label",null,"API Key",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":L[14]||(L[14]=fe=>f.value=fe),placeholder:"sk-..."},null,512),[[Le,f.value]])]),i("div",jC,[L[41]||(L[41]=i("label",null,"模型名称",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":L[15]||(L[15]=fe=>v.value=fe),placeholder:"如:deepseek-chat"},null,512),[[Le,v.value]])])]),i("div",{class:"rule-save"},[i("button",{class:"btn btn-primary btn-sm",onClick:_},"保存 AI 配置"),L[42]||(L[42]=i("span",{class:"muted loc-note"},"配置仅保存在本机;总结页「AI 润色」需此处先配置",-1))])]),i("div",DC,[L[47]||(L[47]=i("div",{class:"section-title"},"工作分类",-1)),i("div",LC,[i("div",RC,[L[44]||(L[44]=i("span",{class:"muted"},"工作记录分类",-1)),i("button",{class:"btn btn-xs",onClick:L[16]||(L[16]=fe=>G("log"))},"添加")]),i("div",KC,[(x(!0),E(Oe,null,st(w.value,(fe,je)=>(x(),E("span",{key:fe+je,class:"cat-chip"},[At(F(fe)+" ",1),i("button",{class:"chip-btn",title:"修改",onClick:Je=>S("log",je,fe)},"改",8,NC),i("button",{class:"chip-btn",title:"删除",onClick:Je=>q("log",je)},"删",8,FC)]))),128))])]),i("div",VC,[i("div",BC,[L[45]||(L[45]=i("span",{class:"muted"},"记账支出分类",-1)),i("button",{class:"btn btn-xs",onClick:L[17]||(L[17]=fe=>G("expense"))},"添加")]),i("div",UC,[(x(!0),E(Oe,null,st(T.value,(fe,je)=>(x(),E("span",{key:fe+je,class:"cat-chip"},[At(F(fe)+" ",1),i("button",{class:"chip-btn",title:"修改",onClick:Je=>S("expense",je,fe)},"改",8,qC),i("button",{class:"chip-btn",title:"删除",onClick:Je=>q("expense",je)},"删",8,HC)]))),128))])]),i("div",zC,[i("div",WC,[L[46]||(L[46]=i("span",{class:"muted"},"记账收入分类",-1)),i("button",{class:"btn btn-xs",onClick:L[18]||(L[18]=fe=>G("income"))},"添加")]),i("div",GC,[(x(!0),E(Oe,null,st($.value,(fe,je)=>(x(),E("span",{key:fe+je,class:"cat-chip"},[At(F(fe)+" ",1),i("button",{class:"chip-btn",title:"修改",onClick:Je=>S("income",je,fe)},"改",8,YC),i("button",{class:"chip-btn",title:"删除",onClick:Je=>q("income",je)},"删",8,JC)]))),128))])])]),i("div",XC,[L[48]||(L[48]=i("div",{class:"section-title"},"数据备份",-1)),i("div",QC,[i("button",{class:"btn btn-sm",onClick:ve},"导出 JSON 备份"),i("button",{class:"btn btn-sm",onClick:L[19]||(L[19]=fe=>{var je;return(je=j.value)==null?void 0:je.click()})},"导入 JSON 备份"),i("button",{class:"btn btn-sm",onClick:g},"导出工作记录 CSV"),i("button",{class:"btn btn-sm",onClick:C},"导出考勤 CSV"),i("input",{ref_key:"fileInput",ref:j,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:Re},null,544)]),O.value?(x(),E("div",ZC,F(O.value),1)):me("",!0),L[49]||(L[49]=i("div",{class:"muted backup-note"},"数据保存在云端服务器;导出的 JSON 备份用于跨设备迁移或灾后恢复。",-1))]),be(Jk,{open:J.value.open,title:J.value.index>=0?"修改分类名称":"添加分类",label:"分类名称",placeholder:"如:制度学习 / 差旅交通",initial:J.value.initial,validate:M,"confirm-text":"保存",onCancel:L[20]||(L[20]=fe=>J.value.open=!1),onConfirm:ee},null,8,["open","title","initial"]),be(xn,{open:!!ae.value,title:"删除分类",message:ae.value?"将删除分类「"+ae.value.name+"」。历史记录不受影响,仍按原分类展示。":"","confirm-text":"删除",danger:"",onCancel:L[21]||(L[21]=fe=>ae.value=null),onConfirm:oe},null,8,["open","message"]),be(xn,{open:!!A.value,title:"导入确认",message:A.value?"将从文件「"+A.value.name+"」导入备份。现有全部数据将被覆盖,且不可恢复,请先确认已导出当前备份。":"","confirm-text":"覆盖导入",danger:"",onCancel:L[22]||(L[22]=fe=>A.value=null),onConfirm:V},null,8,["open","message"]),be(xn,{open:qe.value,title:"删除用户确认",message:"将永久删除云端账号「"+ne.value+"」及其服务器上的全部数据:工作日志、考勤、备忘录、账号密码库都将被清除,任何设备都无法再取回,且不可恢复。请确认。","confirm-text":"永久删除",danger:"",onCancel:L[23]||(L[23]=fe=>qe.value=!1),onConfirm:xt},null,8,["open","message"])]))}}),tx=Vt(ex,[["__scopeId","data-v-10f77319"]]),nx={class:"tp-main"},sx={class:"tp-title"},ox={class:"tp-meta"},rx={class:"tp-time num"},ax=Kt({__name:"TimerPanel",setup(e){const t=P(null),n=P(Date.now());let o=null,r=null;async function l(){try{t.value=await Th()}catch{}}const u=nt(()=>{const m=t.value;if(!m||!m.timer_started_at)return 0;const w=(m.actual_minutes||0)*60,T=Math.max(0,Math.floor((n.value-new Date(m.timer_started_at).getTime())/1e3));return w+T}),f=nt(()=>{const m=u.value,w=Math.floor(m/3600),T=Math.floor(m%3600/60),$=m%60,I=J=>String(J).padStart(2,"0");return w>0?w+":"+I(T)+":"+I($):T+":"+I($)});async function v(){const m=t.value;m&&(await Sa(m.id),Ve("已停止计时:"+m.title),await l())}function y(){location.hash="#/plan"}return pt(Ed,()=>{l()}),cn(()=>{l(),o=window.setInterval(()=>{l()},15e3),r=window.setInterval(()=>{n.value=Date.now()},1e3),window.addEventListener("focus",l)}),bn(()=>{o!==null&&window.clearInterval(o),r!==null&&window.clearInterval(r),window.removeEventListener("focus",l)}),(m,w)=>(x(),Ct(Jn,{name:"tp"},{default:Sn(()=>[t.value&&t.value.timer_started_at?(x(),E("div",{key:0,class:"tp",onClick:y,title:"点击查看计划页"},[w[0]||(w[0]=i("span",{class:"tp-pulse"},null,-1)),i("span",nx,[i("span",sx,F(t.value.title),1),i("span",ox,F(t.value.kind)+" · 计时中",1)]),i("span",rx,F(f.value),1),i("span",{class:"tp-stop",role:"button",title:"停止计时",onClick:Ut(v,["stop"])},"停止")])):me("",!0)]),_:1}))}}),ix=Vt(ax,[["__scopeId","data-v-a8f9ed22"]]),lx={class:"admin-page"},ux={class:"card table-card"},cx={class:"toolbar"},dx={key:0,class:"form-error tb-error"},fx={class:"admin-table"},px={class:"td-name","data-label":"用户名"},vx={"data-label":"角色"},mx={key:0,class:"role-badge"},hx={key:1,class:"muted"},yx={class:"muted num","data-label":"创建时间"},gx={class:"muted num","data-label":"数据量"},bx={class:"td-ops"},wx={class:"ops"},_x=["onClick"],kx=["disabled","onClick"],Cx={key:0},xx={key:1,class:"muted load-line"},$x={class:"dialog",role:"dialog","aria-label":"新增用户"},Sx={class:"dialog-head"},Ex={class:"dialog-body"},Ax={class:"form-row"},Tx={class:"form-row"},Px={class:"form-row"},Ox={key:0,class:"form-error"},Mx={class:"dialog-btns"},Ix=["disabled"],jx={class:"dialog",role:"dialog","aria-label":"重置密码"},Dx={class:"dialog-head"},Lx={class:"dialog-title"},Rx={class:"dialog-body"},Kx={class:"form-row"},Nx={key:0,class:"form-error"},Fx={class:"dialog-btns"},Vx=["disabled"],Bx=Kt({__name:"UserAdminView",setup(e){const t=P([]),n=P(""),o=P(!0),r=P("");async function l(j,A){const O=await Ns();let ne=$a();if(!ne){const Se=hn(),_e=await fetch(O+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Se==null?void 0:Se.username,password:Se==null?void 0:Se.password})});if(_e.ok){const Me=await _e.json();ne=String(Me.token||""),zo(ne)}}const Ie=await fetch(O+j,{method:A?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ne},body:A?JSON.stringify(A):void 0});if(Ie.status===401&&hn()){const Se=hn(),_e=await fetch(O+"/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:Se==null?void 0:Se.username,password:Se==null?void 0:Se.password})});if(_e.ok){const Me=await _e.json();ne=String(Me.token||""),zo(ne);const qe=await fetch(O+j,{method:A?"POST":"GET",headers:{"Content-Type":"application/json",Authorization:"Bearer "+ne},body:A?JSON.stringify(A):void 0});return{ok:qe.ok,status:qe.status,data:await qe.json().catch(()=>({}))}}}return{ok:Ie.ok,status:Ie.status,data:await Ie.json().catch(()=>({}))}}async function u(){o.value=!0,r.value="";const j=await l("/api/admin/users");if(!j.ok){o.value=!1,r.value=j.data&&j.data.error||"加载失败 "+j.status;return}t.value=j.data.users||[],n.value=j.data.me||"",o.value=!1}function f(j){return j<=0?"--":j<1024?j+" B":j<1024*1024?(j/1024).toFixed(1)+" KB":(j/1024/1024).toFixed(2)+" MB"}function v(j){return(j||"").slice(0,10)}const y=P(!1),m=P(""),w=P(""),T=P(""),$=P(""),I=P(!1);function J(){y.value=!0,$.value="",m.value="",w.value="",T.value=""}async function ae(){const j=m.value.trim();if(w.value!==T.value){$.value="两次输入的密码不一致";return}if(w.value.length<6){$.value="密码至少 6 位";return}I.value=!0;const A=await l("/api/admin/users/create",{username:j,password:w.value});if(I.value=!1,!A.ok){$.value=A.data&&A.data.error||"创建失败 "+A.status;return}Ve("用户「"+j+"」已创建"),y.value=!1,await u()}const de=P(null),ue=P(""),G=P(""),S=P(!1);function M(j){de.value=j,ue.value="",G.value=""}async function ee(){if(!de.value)return;if(ue.value.length<6){G.value="密码至少 6 位";return}S.value=!0;const j=await l("/api/admin/users/password",{userId:de.value.id,newPassword:ue.value});if(S.value=!1,!j.ok){G.value=j.data&&j.data.error||"重置失败 "+j.status;return}Ve("已重置「"+de.value.username+"」的登录密码"),de.value=null}const q=P(null);async function oe(){if(!q.value)return;const j=await l("/api/admin/users/delete",{userId:q.value.id});if(!j.ok){q.value=null,Ve(j.data&&j.data.error||"删除失败");return}Ve("已删除账号「"+q.value.username+"」及其全部云端数据"),q.value=null,await u()}return cn(u),(j,A)=>(x(),E("div",lx,[i("div",ux,[i("div",cx,[A[12]||(A[12]=i("div",{class:"head-wrap"},[i("div",{class:"tb-title"},"用户管理"),i("div",{class:"muted tb-sub"},"云端账号统一管理 · 管理员:xionglin")],-1)),i("button",{class:"btn btn-primary btn-sm",onClick:J},[be(He,{name:"plus",size:14}),A[11]||(A[11]=At(" 新增用户 ",-1))])]),r.value?(x(),E("div",dx,F(r.value),1)):me("",!0),i("table",fx,[A[14]||(A[14]=i("thead",null,[i("tr",null,[i("th",null,"用户名"),i("th",null,"角色"),i("th",null,"创建时间"),i("th",null,"数据量"),i("th",{class:"th-ops"},"操作")])],-1)),i("tbody",null,[(x(!0),E(Oe,null,st(t.value,O=>(x(),E("tr",{key:O.id},[i("td",px,F(O.username),1),i("td",vx,[O.role==="admin"?(x(),E("span",mx,"管理员")):(x(),E("span",hx,"普通用户"))]),i("td",yx,F(v(O.created_at)),1),i("td",gx,F(f(O.data_bytes)),1),i("td",bx,[i("div",wx,[i("button",{class:"btn btn-xs",onClick:ne=>M(O)},"重置密码",8,_x),i("button",{class:"btn btn-xs btn-danger",disabled:O.id===n.value,onClick:ne=>q.value=O},"删除",8,kx)])])]))),128)),!o.value&&!t.value.length?(x(),E("tr",Cx,[...A[13]||(A[13]=[i("td",{colspan:"5",class:"empty muted"},"加载结果为空",-1)])])):me("",!0)])]),o.value?(x(),E("div",xx,"加载中")):me("",!0)]),A[20]||(A[20]=i("div",{class:"muted admin-note"},"重置密码立即生效;删除账号将移除其全部云端数据,不可恢复。自己的账号不能删除。",-1)),(x(),Ct($n,{to:"body"},[y.value?(x(),E("div",{key:0,class:"mask",onClick:A[5]||(A[5]=Ut(O=>y.value=!1,["self"]))},[i("div",$x,[i("div",Sx,[A[15]||(A[15]=i("span",{class:"dialog-title"},"新增用户",-1)),i("button",{class:"icon-btn",onClick:A[0]||(A[0]=O=>y.value=!1)},[be(He,{name:"close",size:16})])]),i("div",Ex,[i("div",Ax,[A[16]||(A[16]=i("label",null,"用户名(2 到 20 个字符)",-1)),Pe(i("input",{class:"input","onUpdate:modelValue":A[1]||(A[1]=O=>m.value=O),placeholder:"如:xiaowang"},null,512),[[Le,m.value]])]),i("div",Tx,[A[17]||(A[17]=i("label",null,"初始登录密码(至少 6 位)",-1)),Pe(i("input",{class:"input",type:"password","onUpdate:modelValue":A[2]||(A[2]=O=>w.value=O),placeholder:"转发给使用者,登录后可自行修改"},null,512),[[Le,w.value]])]),i("div",Px,[A[18]||(A[18]=i("label",null,"确认密码",-1)),Pe(i("input",{class:"input",type:"password","onUpdate:modelValue":A[3]||(A[3]=O=>T.value=O),onKeydown:Lt(ae,["enter"])},null,544),[[Le,T.value]])]),$.value?(x(),E("div",Ox,F($.value),1)):me("",!0)]),i("div",Mx,[i("button",{class:"btn btn-sm",onClick:A[4]||(A[4]=O=>y.value=!1)},"取消"),i("button",{class:"btn btn-primary btn-sm",disabled:I.value||!m.value.trim(),onClick:ae},F(I.value?"创建中":"创建"),9,Ix)])])])):me("",!0)])),(x(),Ct($n,{to:"body"},[de.value?(x(),E("div",{key:0,class:"mask",onClick:A[9]||(A[9]=Ut(O=>de.value=null,["self"]))},[i("div",jx,[i("div",Dx,[i("span",Lx,"重置「"+F(de.value.username)+"」的登录密码",1),i("button",{class:"icon-btn",onClick:A[6]||(A[6]=O=>de.value=null)},[be(He,{name:"close",size:16})])]),i("div",Rx,[i("div",Kx,[A[19]||(A[19]=i("label",null,"新登录密码(至少 6 位)",-1)),Pe(i("input",{class:"input",type:"password","onUpdate:modelValue":A[7]||(A[7]=O=>ue.value=O),onKeydown:Lt(ee,["enter"])},null,544),[[Le,ue.value]])]),G.value?(x(),E("div",Nx,F(G.value),1)):me("",!0)]),i("div",Fx,[i("button",{class:"btn btn-sm",onClick:A[8]||(A[8]=O=>de.value=null)},"取消"),i("button",{class:"btn btn-primary btn-sm",disabled:S.value,onClick:ee},F(S.value?"提交中":"重置"),9,Vx)])])])):me("",!0)])),be(xn,{open:!!q.value,title:"删除用户确认",message:q.value?"将永久删除云端账号「"+q.value.username+"」及其服务器上的全部数据,不可恢复。请确认。":"","confirm-text":"永久删除",danger:"",onCancel:A[10]||(A[10]=O=>q.value=null),onConfirm:oe},null,8,["open","message"])]))}}),Ux=Vt(Bx,[["__scopeId","data-v-2d48d2c9"]]),qx={class:"login-page"},Hx={class:"card login-card"},zx={class:"login-brand"},Wx={class:"brand-icon"},Gx={class:"seg"},Yx=["placeholder"],Jx={key:1,class:"form-error"},Xx=["disabled"],Qx=Kt({__name:"LoginView",emits:["login"],setup(e,{emit:t}){const n=t,o=P("login"),r=P(""),l=P(""),u=P(""),f=P(""),v=P(!1);function y(w){o.value=w,f.value="",u.value=""}async function m(){if(!v.value){f.value="",v.value=!0;try{let w;if(o.value==="login")w=await Fm(r.value,l.value);else{if(l.value.length<6){f.value="登录密码至少 6 位",v.value=!1;return}if(l.value!==u.value){f.value="两次输入的密码不一致",v.value=!1;return}w=await Vm(r.value,l.value)}n("login",w)}catch(w){f.value=w instanceof Error?w.message:"操作失败"}v.value=!1}}return(w,T)=>(x(),E("div",qx,[i("div",Hx,[i("div",zx,[i("div",Wx,[be(He,{name:"calendar",size:22})]),T[5]||(T[5]=i("div",{class:"login-title"},"实习工作日志",-1)),T[6]||(T[6]=i("div",{class:"muted login-sub"},"打卡 · 记录 · 总结 · 备忘录 · 密码库",-1)),T[7]||(T[7]=i("div",{class:"muted login-sub"},"数据保存在云端服务器,所有设备登录同一账号即可实时同步",-1))]),i("div",Gx,[i("button",{class:ze(["seg-btn",{active:o.value==="login"}]),onClick:T[0]||(T[0]=$=>y("login"))},"登录",2),i("button",{class:ze(["seg-btn",{active:o.value==="create"}]),onClick:T[1]||(T[1]=$=>y("create"))},"创建用户",2)]),Pe(i("input",{class:"input","onUpdate:modelValue":T[2]||(T[2]=$=>r.value=$),placeholder:"用户名(2 到 20 个字符)",onKeydown:Lt(m,["enter"])},null,544),[[Le,r.value]]),Pe(i("input",{type:"password",class:"input","onUpdate:modelValue":T[3]||(T[3]=$=>l.value=$),placeholder:o.value==="login"?"登录密码":"设置登录密码(至少 6 位)",onKeydown:Lt(m,["enter"])},null,40,Yx),[[Le,l.value]]),o.value==="create"?Pe((x(),E("input",{key:0,type:"password",class:"input","onUpdate:modelValue":T[4]||(T[4]=$=>u.value=$),placeholder:"再次输入密码",onKeydown:Lt(m,["enter"])},null,544)),[[Le,u.value]]):me("",!0),f.value?(x(),E("div",Jx,F(f.value),1)):me("",!0),i("button",{class:"btn btn-primary login-btn",disabled:v.value,onClick:m},F(o.value==="login"?"登录":"创建并进入"),9,Xx),T[8]||(T[8]=i("div",{class:"muted login-note"}," 登录密码仅服务器保存哈希;本机保存加密的自动登录凭据,登录后无需重复输入 ",-1))])]))}}),Zx=Vt(Qx,[["__scopeId","data-v-e9c1c40d"]]),e$={key:1,class:"app"},t$={class:"side"},n$={class:"brand-mark"},s$={class:"side-nav"},o$={key:0,class:"nav-group"},r$=["data-tip","onClick"],a$={class:"nav-label"},i$={class:"side-foot"},l$={class:"avatar"},u$={class:"foot-name"},c$={class:"main"},d$={class:"topbar"},f$={class:"title"},p$={class:"gsearch"},v$={key:0,class:"gs-panel"},m$={key:0,class:"gs-group muted"},h$=["onMousedown"],y$={class:"tag"},g$={class:"gs-text"},b$={class:"muted num gs-date"},w$={key:1,class:"gs-group muted"},_$=["onMousedown"],k$={class:"gs-text"},C$={class:"muted gs-sub"},x$={key:1,class:"gs-empty muted"},$$={class:"content"},S$={class:"content-inner"},E$={class:"tabbar"},A$=["onClick"],T$={class:"sheet-user num"},P$=["onClick"],O$={class:"sheet-name"},M$={class:"msw"},I$={class:"msw-bar"},j$={class:"msw-results"},D$={key:0,class:"gs-group muted"},L$=["onMousedown"],R$={class:"tag"},K$={class:"gs-text"},N$={class:"muted num gs-date"},F$={key:1,class:"gs-group muted"},V$=["onMousedown"],B$={class:"gs-text"},U$={class:"muted gs-sub"},q$={key:1,class:"gs-empty muted"},H$={class:"toast-wrap"},z$=Kt({__name:"App",setup(e){const t=Ty(),n=P(eo()&&ie?eo():null);async function o(le){n.value=le,ra(le.userId),location.hash="#/calendar",M.value="calendar",await We(),u();try{await Td(),await so()}catch{}Ve("欢迎,"+le.username);const Q=sessionStorage.getItem("dsh_migrate_toast");Q&&(sessionStorage.removeItem("dsh_migrate_toast"),Ve("已迁移原有数据 "+Q+" 条"))}async function r(){Me.value=!1,Se.value=!1,sh(),l!==null&&(window.clearInterval(l),l=null),n.value=null,await Um(),M.value="calendar",location.hash="#/calendar",Ve("已退出登录")}let l=null;function u(){nh(),l!==null&&window.clearInterval(l),l=window.setInterval(()=>{so()},60*1e3),so()}const f=P(null),v=P(""),y=P(!1),m=P({logs:[],memos:[]});let w=null;const T=nt(()=>!!(m.value.logs.length||m.value.memos.length));function $(){w&&window.clearTimeout(w);const le=v.value;w=window.setTimeout(async()=>{const Q=le.trim();if(!Q){m.value={logs:[],memos:[]};return}const Ae=await Promise.all([zh(Q,8),Wh(Q,4)]);m.value={logs:Ae[0],memos:Ae[1]}},200)}function I(){v.value="",m.value={logs:[],memos:[]},y.value=!1}function J(le){Fi.value=le.date,ee("calendar"),I()}function ae(le){Vi.value=le.id,ee("memo"),I()}function de(){window.setTimeout(()=>{y.value=!1},150)}function ue(le){var Q;(le.ctrlKey||le.metaKey)&&le.key.toLowerCase()==="k"&&(le.preventDefault(),(Q=f.value)==null||Q.focus())}const G=[{key:"calendar",name:"日历",icon:"calendar",group:"记录"},{key:"today",name:"详情",icon:"edit",group:"记录"},{key:"plan",name:"计划",icon:"plan",group:"记录"},{key:"ledger",name:"记账",icon:"wallet",group:"工具"},{key:"memo",name:"备忘录",icon:"memo",group:"工具"},{key:"stats",name:"统计",icon:"chart",group:"分析"},{key:"report",name:"总结",icon:"export",group:"分析"},{key:"vault",name:"密码库",icon:"lock",group:"系统"},{key:"settings",name:"设置",icon:"settings",group:"系统"},{key:"admin",name:"用户管理",icon:"shield",group:"系统"}];function S(){var Q;const le=(location.hash||"").replace("#/","");return!G.some(Ae=>Ae.key===le)||le==="admin"&&(((Q=eo())==null?void 0:Q.username)||"")!=="xionglin"?"calendar":le}const M=P(S());window.addEventListener("hashchange",()=>{M.value=S()});function ee(le){location.hash="#/"+le}const q=nt(()=>G.find(le=>le.key===M.value)||G[0]),oe=nt(()=>{var le;return(((le=n.value)==null?void 0:le.username)||"")==="xionglin"}),j=nt(()=>oe.value?G:G.filter(le=>le.key!=="admin")),A=nt(()=>{const le=G.filter(Q=>!ne.includes(Q.key));return oe.value?le:le.filter(Q=>Q.key!=="admin")}),O=nt(()=>A.value.some(le=>le.key===M.value));pt([oe,M],()=>{M.value==="admin"&&!oe.value&&ee("calendar")},{immediate:!0});const ne=["calendar","today","plan","ledger"],Ie=G.filter(le=>ne.includes(le.key)),Se=P(!1);function _e(le){Se.value=!1,ee(le)}const Me=P(!1),qe=P(null);function Ue(){Me.value=!0,window.setTimeout(()=>{var le;return(le=qe.value)==null?void 0:le.focus()},60)}function tt(le){J(le),Me.value=!1}function Ye(le){ae(le),Me.value=!1}async function We(){try{if((await ms()).remind_weekly==="off")return;const Q=new Date().getDay();if(Q!==5&&Q!==6&&Q!==0)return;const Ae=await bl(Zs(ut()));if(Ae&&(Ae.highlights||Ae.challenges||Ae.plan_next))return;Ve("本周周记还没写,可在「总结」页填写")}catch{}}return cn(async()=>{window.addEventListener("keydown",ue),n.value&&(ra(n.value.userId),await We(),u())}),(le,Q)=>{var Ae,lt,it;return n.value?(x(),E("div",e$,[i("nav",t$,[i("div",{class:"brand",onClick:Q[0]||(Q[0]=Te=>ee("calendar"))},[i("span",n$,[be(He,{name:"calendar",size:15})]),Q[11]||(Q[11]=i("span",{class:"brand-name"},"实习工作日志",-1))]),i("div",s$,[(x(!0),E(Oe,null,st(j.value,(Te,kt)=>(x(),E(Oe,{key:Te.key},[kt===0||Te.group!==j.value[kt-1].group?(x(),E("div",o$,F(Te.group),1)):me("",!0),i("button",{class:ze(["nav-btn",{active:M.value===Te.key}]),"data-tip":Te.name,onClick:xt=>ee(Te.key)},[be(He,{name:Te.icon,size:17},null,8,["name"]),i("span",a$,F(Te.name),1)],10,r$)],64))),128))]),i("div",i$,[i("span",l$,F((((Ae=n.value)==null?void 0:Ae.username)||"用户").slice(0,1).toUpperCase()),1),i("span",u$,F((lt=n.value)==null?void 0:lt.username),1),i("button",{class:"icon-btn",title:"退出登录",onClick:r},[be(He,{name:"export",size:15})])])]),i("div",c$,[i("header",d$,[i("span",f$,F(q.value.name),1),i("button",{class:"mob-search-btn",title:"搜索",onClick:Ue},[be(He,{name:"search",size:16})]),i("div",p$,[be(He,{name:"search",size:14,class:"gs-icon"}),Pe(i("input",{ref_key:"gsInput",ref:f,class:"input gs-input","onUpdate:modelValue":Q[1]||(Q[1]=Te=>v.value=Te),placeholder:"搜索工作记录与备忘录(Ctrl+K)",onInput:$,onFocus:Q[2]||(Q[2]=Te=>y.value=!0),onBlur:de,onKeydown:Lt(I,["esc"])},null,544),[[Le,v.value]]),y.value&&v.value.trim()?(x(),E("div",v$,[T.value?(x(),E(Oe,{key:0},[m.value.logs.length?(x(),E("div",m$,"工作记录")):me("",!0),(x(!0),E(Oe,null,st(m.value.logs,Te=>(x(),E("div",{key:"l"+Te.id,class:"gs-item",onMousedown:Ut(kt=>J(Te),["prevent"])},[i("span",y$,F(Wt(qo)(Te.category)),1),i("span",g$,F(Te.content),1),i("span",b$,F(Te.date),1)],40,h$))),128)),m.value.memos.length?(x(),E("div",w$,"备忘录")):me("",!0),(x(!0),E(Oe,null,st(m.value.memos,Te=>(x(),E("div",{key:"m"+Te.id,class:"gs-item",onMousedown:Ut(kt=>ae(Te),["prevent"])},[i("span",k$,F(Te.title||"无标题"),1),i("span",C$,F(Te.content),1)],40,_$))),128))],64)):(x(),E("div",x$,"无匹配结果"))])):me("",!0)])]),i("main",$$,[i("div",S$,[M.value==="calendar"?(x(),Ct(Vg,{key:0})):M.value==="today"?(x(),Ct(db,{key:1})):M.value==="plan"?(x(),Ct(gw,{key:2})):M.value==="stats"?(x(),Ct(Yw,{key:3})):M.value==="report"?(x(),Ct(j_,{key:4})):M.value==="ledger"?(x(),Ct($0,{key:5})):M.value==="memo"?(x(),Ct(U0,{key:6})):M.value==="vault"?(x(),Ct(Nk,{key:7})):M.value==="admin"?(x(),Ct(Ux,{key:8})):(x(),Ct(tx,{key:9}))])]),i("nav",E$,[(x(!0),E(Oe,null,st(Wt(Ie),Te=>(x(),E("button",{key:Te.key,class:ze(["tab-btn",{active:M.value===Te.key}]),onClick:kt=>ee(Te.key)},[be(He,{name:Te.icon,size:20},null,8,["name"]),i("span",null,F(Te.name),1)],10,A$))),128)),i("button",{class:ze(["tab-btn",{active:O.value}]),onClick:Q[3]||(Q[3]=Te=>Se.value=!0)},[be(He,{name:"more",size:20}),Q[12]||(Q[12]=i("span",null,"更多",-1))],2)]),Se.value?(x(),E("div",{key:0,class:"sheet-mask",onClick:Q[6]||(Q[6]=Te=>Se.value=!1)},[i("div",{class:"more-sheet",onClick:Q[5]||(Q[5]=Ut(()=>{},["stop"]))},[Q[14]||(Q[14]=i("div",{class:"sheet-handle"},null,-1)),i("div",T$,F((it=n.value)==null?void 0:it.username),1),(x(!0),E(Oe,null,st(A.value,Te=>(x(),E("button",{key:Te.key,class:"sheet-row",onClick:kt=>_e(Te.key)},[be(He,{name:Te.icon,size:18},null,8,["name"]),i("span",O$,F(Te.name),1),be(He,{name:"chevron-right",size:14,class:"sheet-go"})],8,P$))),128)),Q[15]||(Q[15]=i("div",{class:"sheet-divider"},null,-1)),i("button",{class:"sheet-row sheet-danger",onClick:Q[4]||(Q[4]=Te=>{Se.value=!1,r()})},[be(He,{name:"close",size:18}),Q[13]||(Q[13]=i("span",{class:"sheet-name"},"退出登录",-1))])])])):me("",!0),Me.value?(x(),E("div",{key:1,class:"msw-mask",onClick:Q[10]||(Q[10]=Ut(Te=>Me.value=!1,["self"]))},[i("div",M$,[i("div",I$,[be(He,{name:"search",size:16,class:"msw-icon"}),Pe(i("input",{ref_key:"msInput",ref:qe,class:"msw-input","onUpdate:modelValue":Q[7]||(Q[7]=Te=>v.value=Te),placeholder:"搜索工作记录与备忘录",onInput:$,onKeydown:Q[8]||(Q[8]=Lt(Te=>Me.value=!1,["esc"]))},null,544),[[Le,v.value]]),i("button",{class:"icon-btn",onClick:Q[9]||(Q[9]=Te=>{I(),Me.value=!1})},[be(He,{name:"close",size:16})])]),i("div",j$,[T.value?(x(),E(Oe,{key:0},[m.value.logs.length?(x(),E("div",D$,"工作记录")):me("",!0),(x(!0),E(Oe,null,st(m.value.logs,Te=>(x(),E("div",{key:"l"+Te.id,class:"msw-item",onMousedown:Ut(kt=>tt(Te),["prevent"])},[i("span",R$,F(Wt(qo)(Te.category)),1),i("span",K$,F(Te.content),1),i("span",N$,F(Te.date),1)],40,L$))),128)),m.value.memos.length?(x(),E("div",F$,"备忘录")):me("",!0),(x(!0),E(Oe,null,st(m.value.memos,Te=>(x(),E("div",{key:"m"+Te.id,class:"msw-item",onMousedown:Ut(kt=>Ye(Te),["prevent"])},[i("span",B$,F(Te.title||"无标题"),1),i("span",U$,F(Te.content),1)],40,V$))),128))],64)):v.value.trim()?(x(),E("div",q$,"无匹配结果")):me("",!0)])])])):me("",!0)]),n.value?(x(),Ct(ix,{key:0})):me("",!0),i("div",H$,[be(Kv,{name:"toast"},{default:Sn(()=>[(x(!0),E(Oe,null,st(Wt(t),Te=>(x(),E("div",{key:Te.id,class:"toast"},F(Te.text),1))),128))]),_:1})])])):(x(),Ct(Zx,{key:0,onLogin:o}))}}}),W$=Vt(z$,[["__scopeId","data-v-54c408c4"]]);function Vr(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",l=>{l.target===n&&n.parentElement&&n.parentElement.removeChild(n)}),document.body.appendChild(n));const o=document.createElement("div");o.style.cssText="border:1px solid #E5484D;border-radius:8px;padding:12px;margin-bottom:12px;word-break:break-all;white-space:pre-wrap;",o.textContent=e+` `+t;const r=document.createElement("button");r.textContent="重新加载",r.style.cssText="margin:-4px 0 12px;padding:6px 16px;border:1px solid #E5484D;border-radius:6px;background:#FFFFFF;color:#E5484D;font-size:13px;cursor:pointer;",r.addEventListener("click",()=>{try{location.reload()}catch{}}),n.appendChild(o),n.appendChild(r)}catch{}}async function G$(){const e=await Bm();e&&ra(e.userId);const t=Zv(W$);t.config.errorHandler=(n,o,r)=>{const l=n;Vr("应用内部错误(点击空白处关闭,请将以下内容发送给开发者)",l&&(l.stack||l.message)||String(n)+` 触发位置: `+r)},window.addEventListener("unhandledrejection",n=>{const o=n.reason;Vr("未处理的异步错误(点击空白处关闭)",o&&(o.stack||o.message)||String(n.reason))}),window.addEventListener("error",n=>{n.message&&n.message!=="ResizeObserver loop limit exceeded"&&Vr("运行错误(点击空白处关闭)",n.message)}),t.mount("#app"),"serviceWorker"in navigator&&location.protocol.startsWith("http")&&window.addEventListener("load",()=>{navigator.serviceWorker.register("sw.js").catch(()=>{})})}G$().catch(e=>{Vr("无法启动:连接同步服务器失败",e&&(e.stack||e.message)||String(e))});export{qd as W,Vd as _,Zg as b,Ud as r}; diff --git a/intern-log/dist/assets/web-oDK3lWem.js b/intern-log/dist/assets/web-DCGLAtF7.js similarity index 98% rename from intern-log/dist/assets/web-oDK3lWem.js rename to intern-log/dist/assets/web-DCGLAtF7.js index 1620c5b..466b9a7 100644 --- a/intern-log/dist/assets/web-oDK3lWem.js +++ b/intern-log/dist/assets/web-DCGLAtF7.js @@ -1 +1 @@ -import{W as P,b as x}from"./index-BI5aMIlx.js";import{Encoding as E}from"./index-prZXT88d.js";function m(w){const e=w.split("/").filter(t=>t!=="."),r=[];return e.forEach(t=>{t===".."&&r.length>0&&r[r.length-1]!==".."?r.pop():r.push(t)}),r.join("/")}function R(w,e){w=m(w),e=m(e);const r=w.split("/"),t=e.split("/");return w!==e&&r.every((i,n)=>i===t[n])}class g extends P{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME="Disc",this._writeCmds=["add","put","delete"],this.downloadFile=async e=>{var r,t;const i=x(e,e.webFetchExtra),n=await fetch(e.url,i);let s;if(!e.progress)s=await n.blob();else if(!(n!=null&&n.body))s=new Blob;else{const c=n.body.getReader();let o=0;const d=[],h=n.headers.get("content-type"),y=parseInt(n.headers.get("content-length")||"0",10);for(;;){const{done:f,value:p}=await c.read();if(f)break;d.push(p),o+=(p==null?void 0:p.length)||0;const b={url:e.url,bytes:o,contentLength:y};this.notifyListeners("progress",b)}const u=new Uint8Array(o);let l=0;for(const f of d)typeof f>"u"||(u.set(f,l),l+=f.length);s=new Blob([u.buffer],{type:h||void 0})}return{path:(await this.writeFile({path:e.path,directory:(r=e.directory)!==null&&r!==void 0?r:void 0,recursive:(t=e.recursive)!==null&&t!==void 0?t:!1,data:s})).uri,blob:s}}}async initDb(){if(this._db!==void 0)return this._db;if(!("indexedDB"in window))throw this.unavailable("This browser doesn't support IndexedDB");return new Promise((e,r)=>{const t=indexedDB.open(this.DB_NAME,this.DB_VERSION);t.onupgradeneeded=g.doUpgrade,t.onsuccess=()=>{this._db=t.result,e(t.result)},t.onerror=()=>r(t.error),t.onblocked=()=>{console.warn("db blocked")}})}static doUpgrade(e){const t=e.target.result;switch(e.oldVersion){case 0:case 1:default:t.objectStoreNames.contains("FileStorage")&&t.deleteObjectStore("FileStorage"),t.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}}async dbRequest(e,r){const t=this._writeCmds.indexOf(e)!==-1?"readwrite":"readonly";return this.initDb().then(i=>new Promise((n,s)=>{const o=i.transaction(["FileStorage"],t).objectStore("FileStorage")[e](...r);o.onsuccess=()=>n(o.result),o.onerror=()=>s(o.error)}))}async dbIndexRequest(e,r,t){const i=this._writeCmds.indexOf(r)!==-1?"readwrite":"readonly";return this.initDb().then(n=>new Promise((s,a)=>{const h=n.transaction(["FileStorage"],i).objectStore("FileStorage").index(e)[r](...t);h.onsuccess=()=>s(h.result),h.onerror=()=>a(h.error)}))}getPath(e,r){const t=r!==void 0?r.replace(/^[/]+|[/]+$/g,""):"";let i="";return e!==void 0&&(i+="/"+e),r!==""&&(i+="/"+t),i}async clear(){(await this.initDb()).transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear()}async readFile(e){const r=this.getPath(e.directory,e.path),t=await this.dbRequest("get",[r]);if(t===void 0)throw Error("File does not exist.");return{data:t.content?t.content:""}}async writeFile(e){const r=this.getPath(e.directory,e.path);let t=e.data;const i=e.encoding,n=e.recursive,s=await this.dbRequest("get",[r]);if(s&&s.type==="directory")throw Error("The supplied path is a directory.");const a=r.substr(0,r.lastIndexOf("/"));if(await this.dbRequest("get",[a])===void 0){const h=a.indexOf("/",1);if(h!==-1){const y=a.substr(h);await this.mkdir({path:y,directory:e.directory,recursive:n})}}if(!i&&!(t instanceof Blob)&&(t=t.indexOf(",")>=0?t.split(",")[1]:t,!this.isBase64String(t)))throw Error("The supplied data is not valid base64 content.");const o=Date.now(),d={path:r,folder:a,type:"file",size:t instanceof Blob?t.size:t.length,ctime:o,mtime:o,content:t};return await this.dbRequest("put",[d]),{uri:d.path}}async appendFile(e){const r=this.getPath(e.directory,e.path);let t=e.data;const i=e.encoding,n=r.substr(0,r.lastIndexOf("/")),s=Date.now();let a=s;const c=await this.dbRequest("get",[r]);if(c&&c.type==="directory")throw Error("The supplied path is a directory.");if(await this.dbRequest("get",[n])===void 0){const h=n.indexOf("/",1);if(h!==-1){const y=n.substr(h);await this.mkdir({path:y,directory:e.directory,recursive:!0})}}if(!i&&!this.isBase64String(t))throw Error("The supplied data is not valid base64 content.");if(c!==void 0){if(c.content instanceof Blob)throw Error("The occupied entry contains a Blob object which cannot be appended to.");c.content!==void 0&&!i?t=btoa(atob(c.content)+atob(t)):t=c.content+t,a=c.ctime}const d={path:r,folder:n,type:"file",size:t.length,ctime:a,mtime:s,content:t};await this.dbRequest("put",[d])}async deleteFile(e){const r=this.getPath(e.directory,e.path);if(await this.dbRequest("get",[r])===void 0)throw Error("File does not exist.");if((await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(r)])).length!==0)throw Error("Folder is not empty.");await this.dbRequest("delete",[r])}async mkdir(e){const r=this.getPath(e.directory,e.path),t=e.recursive,i=r.substr(0,r.lastIndexOf("/")),n=(r.match(/\//g)||[]).length,s=await this.dbRequest("get",[i]),a=await this.dbRequest("get",[r]);if(n===1)throw Error("Cannot create Root directory");if(a!==void 0)throw Error("Current directory does already exist.");if(!t&&n!==2&&s===void 0)throw Error("Parent directory must exist");if(t&&n!==2&&s===void 0){const d=i.substr(i.indexOf("/",1));await this.mkdir({path:d,directory:e.directory,recursive:t})}const c=Date.now(),o={path:r,folder:i,type:"directory",size:0,ctime:c,mtime:c};await this.dbRequest("put",[o])}async rmdir(e){const{path:r,directory:t,recursive:i}=e,n=this.getPath(t,r),s=await this.dbRequest("get",[n]);if(s===void 0)throw Error("Folder does not exist.");if(s.type!=="directory")throw Error("Requested path is not a directory");const a=await this.readdir({path:r,directory:t});if(a.files.length!==0&&!i)throw Error("Folder is not empty");for(const c of a.files){const o=`${r}/${c.name}`;(await this.stat({path:o,directory:t})).type==="file"?await this.deleteFile({path:o,directory:t}):await this.rmdir({path:o,directory:t,recursive:i})}await this.dbRequest("delete",[n])}async readdir(e){const r=this.getPath(e.directory,e.path),t=await this.dbRequest("get",[r]);if(e.path!==""&&t===void 0)throw Error("Folder does not exist.");const i=await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(r)]);return{files:await Promise.all(i.map(async s=>{let a=await this.dbRequest("get",[s]);return a===void 0&&(a=await this.dbRequest("get",[s+"/"])),{name:s.substring(r.length+1),type:a.type,size:a.size,ctime:a.ctime,mtime:a.mtime,uri:a.path}}))}}async getUri(e){const r=this.getPath(e.directory,e.path);let t=await this.dbRequest("get",[r]);return t===void 0&&(t=await this.dbRequest("get",[r+"/"])),{uri:(t==null?void 0:t.path)||r}}async stat(e){const r=this.getPath(e.directory,e.path);let t=await this.dbRequest("get",[r]);if(t===void 0&&(t=await this.dbRequest("get",[r+"/"])),t===void 0)throw Error("Entry does not exist.");return{type:t.type,size:t.size,ctime:t.ctime,mtime:t.mtime,uri:t.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:"granted"}}async checkPermissions(){return{publicStorage:"granted"}}async _copy(e,r=!1){let{toDirectory:t}=e;const{to:i,from:n,directory:s}=e;if(!i||!n)throw Error("Both to and from must be provided");t||(t=s);const a=this.getPath(s,n),c=this.getPath(t,i);if(a===c)return{uri:c};if(R(a,c))throw Error("To path cannot contain the from path");let o;try{o=await this.stat({path:i,directory:t})}catch{const l=i.split("/");l.pop();const f=l.join("/");if(l.length>0&&(await this.stat({path:f,directory:t})).type!=="directory")throw new Error("Parent directory of the to path is a file")}if(o&&o.type==="directory")throw new Error("Cannot overwrite a directory with a file");const d=await this.stat({path:n,directory:s}),h=async(u,l,f)=>{const p=this.getPath(t,u),b=await this.dbRequest("get",[p]);b.ctime=l,b.mtime=f,await this.dbRequest("put",[b])},y=d.ctime?d.ctime:Date.now();switch(d.type){case"file":{const u=await this.readFile({path:n,directory:s});r&&await this.deleteFile({path:n,directory:s});let l;!(u.data instanceof Blob)&&!this.isBase64String(u.data)&&(l=E.UTF8);const f=await this.writeFile({path:i,directory:t,data:u.data,encoding:l});return r&&await h(i,y,d.mtime),f}case"directory":{if(o)throw Error("Cannot move a directory over an existing object");try{await this.mkdir({path:i,directory:t,recursive:!1}),r&&await h(i,y,d.mtime)}catch{}const u=(await this.readdir({path:n,directory:s})).files;for(const l of u)await this._copy({from:`${n}/${l.name}`,to:`${i}/${l.name}`,directory:s,toDirectory:t},r);r&&await this.rmdir({path:n,directory:s})}}return{uri:c}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}}g._debug=!0;export{g as FilesystemWeb}; +import{W as P,b as x}from"./index-COEpAapF.js";import{Encoding as E}from"./index-C9urKISR.js";function m(w){const e=w.split("/").filter(t=>t!=="."),r=[];return e.forEach(t=>{t===".."&&r.length>0&&r[r.length-1]!==".."?r.pop():r.push(t)}),r.join("/")}function R(w,e){w=m(w),e=m(e);const r=w.split("/"),t=e.split("/");return w!==e&&r.every((i,n)=>i===t[n])}class g extends P{constructor(){super(...arguments),this.DB_VERSION=1,this.DB_NAME="Disc",this._writeCmds=["add","put","delete"],this.downloadFile=async e=>{var r,t;const i=x(e,e.webFetchExtra),n=await fetch(e.url,i);let s;if(!e.progress)s=await n.blob();else if(!(n!=null&&n.body))s=new Blob;else{const c=n.body.getReader();let o=0;const d=[],h=n.headers.get("content-type"),y=parseInt(n.headers.get("content-length")||"0",10);for(;;){const{done:f,value:p}=await c.read();if(f)break;d.push(p),o+=(p==null?void 0:p.length)||0;const b={url:e.url,bytes:o,contentLength:y};this.notifyListeners("progress",b)}const u=new Uint8Array(o);let l=0;for(const f of d)typeof f>"u"||(u.set(f,l),l+=f.length);s=new Blob([u.buffer],{type:h||void 0})}return{path:(await this.writeFile({path:e.path,directory:(r=e.directory)!==null&&r!==void 0?r:void 0,recursive:(t=e.recursive)!==null&&t!==void 0?t:!1,data:s})).uri,blob:s}}}async initDb(){if(this._db!==void 0)return this._db;if(!("indexedDB"in window))throw this.unavailable("This browser doesn't support IndexedDB");return new Promise((e,r)=>{const t=indexedDB.open(this.DB_NAME,this.DB_VERSION);t.onupgradeneeded=g.doUpgrade,t.onsuccess=()=>{this._db=t.result,e(t.result)},t.onerror=()=>r(t.error),t.onblocked=()=>{console.warn("db blocked")}})}static doUpgrade(e){const t=e.target.result;switch(e.oldVersion){case 0:case 1:default:t.objectStoreNames.contains("FileStorage")&&t.deleteObjectStore("FileStorage"),t.createObjectStore("FileStorage",{keyPath:"path"}).createIndex("by_folder","folder")}}async dbRequest(e,r){const t=this._writeCmds.indexOf(e)!==-1?"readwrite":"readonly";return this.initDb().then(i=>new Promise((n,s)=>{const o=i.transaction(["FileStorage"],t).objectStore("FileStorage")[e](...r);o.onsuccess=()=>n(o.result),o.onerror=()=>s(o.error)}))}async dbIndexRequest(e,r,t){const i=this._writeCmds.indexOf(r)!==-1?"readwrite":"readonly";return this.initDb().then(n=>new Promise((s,a)=>{const h=n.transaction(["FileStorage"],i).objectStore("FileStorage").index(e)[r](...t);h.onsuccess=()=>s(h.result),h.onerror=()=>a(h.error)}))}getPath(e,r){const t=r!==void 0?r.replace(/^[/]+|[/]+$/g,""):"";let i="";return e!==void 0&&(i+="/"+e),r!==""&&(i+="/"+t),i}async clear(){(await this.initDb()).transaction(["FileStorage"],"readwrite").objectStore("FileStorage").clear()}async readFile(e){const r=this.getPath(e.directory,e.path),t=await this.dbRequest("get",[r]);if(t===void 0)throw Error("File does not exist.");return{data:t.content?t.content:""}}async writeFile(e){const r=this.getPath(e.directory,e.path);let t=e.data;const i=e.encoding,n=e.recursive,s=await this.dbRequest("get",[r]);if(s&&s.type==="directory")throw Error("The supplied path is a directory.");const a=r.substr(0,r.lastIndexOf("/"));if(await this.dbRequest("get",[a])===void 0){const h=a.indexOf("/",1);if(h!==-1){const y=a.substr(h);await this.mkdir({path:y,directory:e.directory,recursive:n})}}if(!i&&!(t instanceof Blob)&&(t=t.indexOf(",")>=0?t.split(",")[1]:t,!this.isBase64String(t)))throw Error("The supplied data is not valid base64 content.");const o=Date.now(),d={path:r,folder:a,type:"file",size:t instanceof Blob?t.size:t.length,ctime:o,mtime:o,content:t};return await this.dbRequest("put",[d]),{uri:d.path}}async appendFile(e){const r=this.getPath(e.directory,e.path);let t=e.data;const i=e.encoding,n=r.substr(0,r.lastIndexOf("/")),s=Date.now();let a=s;const c=await this.dbRequest("get",[r]);if(c&&c.type==="directory")throw Error("The supplied path is a directory.");if(await this.dbRequest("get",[n])===void 0){const h=n.indexOf("/",1);if(h!==-1){const y=n.substr(h);await this.mkdir({path:y,directory:e.directory,recursive:!0})}}if(!i&&!this.isBase64String(t))throw Error("The supplied data is not valid base64 content.");if(c!==void 0){if(c.content instanceof Blob)throw Error("The occupied entry contains a Blob object which cannot be appended to.");c.content!==void 0&&!i?t=btoa(atob(c.content)+atob(t)):t=c.content+t,a=c.ctime}const d={path:r,folder:n,type:"file",size:t.length,ctime:a,mtime:s,content:t};await this.dbRequest("put",[d])}async deleteFile(e){const r=this.getPath(e.directory,e.path);if(await this.dbRequest("get",[r])===void 0)throw Error("File does not exist.");if((await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(r)])).length!==0)throw Error("Folder is not empty.");await this.dbRequest("delete",[r])}async mkdir(e){const r=this.getPath(e.directory,e.path),t=e.recursive,i=r.substr(0,r.lastIndexOf("/")),n=(r.match(/\//g)||[]).length,s=await this.dbRequest("get",[i]),a=await this.dbRequest("get",[r]);if(n===1)throw Error("Cannot create Root directory");if(a!==void 0)throw Error("Current directory does already exist.");if(!t&&n!==2&&s===void 0)throw Error("Parent directory must exist");if(t&&n!==2&&s===void 0){const d=i.substr(i.indexOf("/",1));await this.mkdir({path:d,directory:e.directory,recursive:t})}const c=Date.now(),o={path:r,folder:i,type:"directory",size:0,ctime:c,mtime:c};await this.dbRequest("put",[o])}async rmdir(e){const{path:r,directory:t,recursive:i}=e,n=this.getPath(t,r),s=await this.dbRequest("get",[n]);if(s===void 0)throw Error("Folder does not exist.");if(s.type!=="directory")throw Error("Requested path is not a directory");const a=await this.readdir({path:r,directory:t});if(a.files.length!==0&&!i)throw Error("Folder is not empty");for(const c of a.files){const o=`${r}/${c.name}`;(await this.stat({path:o,directory:t})).type==="file"?await this.deleteFile({path:o,directory:t}):await this.rmdir({path:o,directory:t,recursive:i})}await this.dbRequest("delete",[n])}async readdir(e){const r=this.getPath(e.directory,e.path),t=await this.dbRequest("get",[r]);if(e.path!==""&&t===void 0)throw Error("Folder does not exist.");const i=await this.dbIndexRequest("by_folder","getAllKeys",[IDBKeyRange.only(r)]);return{files:await Promise.all(i.map(async s=>{let a=await this.dbRequest("get",[s]);return a===void 0&&(a=await this.dbRequest("get",[s+"/"])),{name:s.substring(r.length+1),type:a.type,size:a.size,ctime:a.ctime,mtime:a.mtime,uri:a.path}}))}}async getUri(e){const r=this.getPath(e.directory,e.path);let t=await this.dbRequest("get",[r]);return t===void 0&&(t=await this.dbRequest("get",[r+"/"])),{uri:(t==null?void 0:t.path)||r}}async stat(e){const r=this.getPath(e.directory,e.path);let t=await this.dbRequest("get",[r]);if(t===void 0&&(t=await this.dbRequest("get",[r+"/"])),t===void 0)throw Error("Entry does not exist.");return{type:t.type,size:t.size,ctime:t.ctime,mtime:t.mtime,uri:t.path}}async rename(e){await this._copy(e,!0)}async copy(e){return this._copy(e,!1)}async requestPermissions(){return{publicStorage:"granted"}}async checkPermissions(){return{publicStorage:"granted"}}async _copy(e,r=!1){let{toDirectory:t}=e;const{to:i,from:n,directory:s}=e;if(!i||!n)throw Error("Both to and from must be provided");t||(t=s);const a=this.getPath(s,n),c=this.getPath(t,i);if(a===c)return{uri:c};if(R(a,c))throw Error("To path cannot contain the from path");let o;try{o=await this.stat({path:i,directory:t})}catch{const l=i.split("/");l.pop();const f=l.join("/");if(l.length>0&&(await this.stat({path:f,directory:t})).type!=="directory")throw new Error("Parent directory of the to path is a file")}if(o&&o.type==="directory")throw new Error("Cannot overwrite a directory with a file");const d=await this.stat({path:n,directory:s}),h=async(u,l,f)=>{const p=this.getPath(t,u),b=await this.dbRequest("get",[p]);b.ctime=l,b.mtime=f,await this.dbRequest("put",[b])},y=d.ctime?d.ctime:Date.now();switch(d.type){case"file":{const u=await this.readFile({path:n,directory:s});r&&await this.deleteFile({path:n,directory:s});let l;!(u.data instanceof Blob)&&!this.isBase64String(u.data)&&(l=E.UTF8);const f=await this.writeFile({path:i,directory:t,data:u.data,encoding:l});return r&&await h(i,y,d.mtime),f}case"directory":{if(o)throw Error("Cannot move a directory over an existing object");try{await this.mkdir({path:i,directory:t,recursive:!1}),r&&await h(i,y,d.mtime)}catch{}const u=(await this.readdir({path:n,directory:s})).files;for(const l of u)await this._copy({from:`${n}/${l.name}`,to:`${i}/${l.name}`,directory:s,toDirectory:t},r);r&&await this.rmdir({path:n,directory:s})}}return{uri:c}}isBase64String(e){try{return btoa(atob(e))==e}catch{return!1}}}g._debug=!0;export{g as FilesystemWeb}; diff --git a/intern-log/dist/index.html b/intern-log/dist/index.html index 04f6c22..2ded9b5 100644 --- a/intern-log/dist/index.html +++ b/intern-log/dist/index.html @@ -8,8 +8,8 @@ 实习工作日志 - - + +
diff --git a/intern-log/package.json b/intern-log/package.json index ccd8e2e..e1806f9 100644 --- a/intern-log/package.json +++ b/intern-log/package.json @@ -1,7 +1,7 @@ { "name": "intern-log", "private": true, - "version": "0.8.0", + "version": "0.8.1", "type": "module", "scripts": { "dev": "vite", diff --git a/intern-log/src/App.vue b/intern-log/src/App.vue index c2f91ea..5e407d1 100644 --- a/intern-log/src/App.vue +++ b/intern-log/src/App.vue @@ -19,12 +19,14 @@ import { getWorkRule, getWeeklyNote, searchLogItems, searchMemos } from './db/re import { todayStr, weekStart } from './lib/date' import { showToast, useToasts } from './lib/toast' import { focusDate, focusMemo } from './lib/bus' -import { categoryLabel, type LogItem, type Memo } from './db/schema' +import { categoryLabel, db, type LogItem, type Memo } from './db/schema' const toasts = useToasts() // ---- 用户会话(持久化登录,退出走顶栏按钮)---- -const session = ref(getSession()) +// 会话恢复必须确认本地缓存库已绑定:静默登录失败(如服务器重启窗口期)时 +// db 仍为 undefined,此时退回登录页,避免视图挂载即读库崩溃 +const session = ref(getSession() && db ? getSession() : null) async function onLogin(s: Session) { session.value = s openUserDatabase(s.userId) @@ -48,8 +50,8 @@ async function doLogout() { moreOpen.value = false stopRealtime() if (syncTimer !== null) { window.clearInterval(syncTimer); syncTimer = null } + session.value = null // 先卸载视图再解绑缓存库,避免微任务间隙读到已关闭的库 await logoutUser() - session.value = null route.value = 'calendar' location.hash = '#/calendar' showToast('已退出登录')