@loicngr/kobo 2.1.4 → 2.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/CONFIGURATION.md +11 -3
- package/dist/server/index.js +24 -91
- package/dist/server/routes/git.js +6 -7
- package/dist/server/routes/settings.js +21 -11
- package/dist/server/routes/workspaces.js +84 -74
- package/dist/server/services/agent/engines/claude-code/event-mapper.js +33 -0
- package/dist/server/services/agent/engines/codex/engine.js +10 -1
- package/dist/server/services/agent/engines/codex/event-mapper.js +2 -0
- package/dist/server/services/agent/integration-mcp.js +4 -3
- package/dist/server/services/agent/orchestrator.js +1 -1
- package/dist/server/services/agent/streaming-batcher.js +14 -3
- package/dist/server/services/engine-handoff-service.js +120 -24
- package/dist/server/services/pr-checkout-service.js +90 -53
- package/dist/server/services/pr-watcher-service.js +13 -7
- package/dist/server/services/retention/worker.js +40 -0
- package/dist/server/services/review-service.js +8 -4
- package/dist/server/services/session-event-metrics.js +43 -0
- package/dist/server/services/session-handoff-service.js +6 -4
- package/dist/server/services/templates-service.js +67 -49
- package/dist/server/services/terminal-service.js +45 -14
- package/dist/server/services/terminal-websocket-service.js +143 -0
- package/dist/server/services/wakeup-service.js +23 -21
- package/dist/server/services/workspace-service.js +3 -44
- package/dist/server/services/workspace-template-service.js +16 -18
- package/dist/server/services/worktree-purge-service.js +1 -4
- package/dist/server/services/ws-events-retention-service.js +197 -104
- package/dist/server/services/ws-events-retention-worker-service.js +112 -0
- package/dist/server/utils/atomic-json-file.js +23 -0
- package/dist/server/utils/git-ops.js +262 -60
- package/dist/shared/codex-models.js +20 -3
- package/dist/shared/models.js +12 -0
- package/package.json +6 -6
- package/src/client/dist/pwa/assets/ActivityFeed-BO1mKMJ0.js +1 -0
- package/src/client/dist/pwa/assets/ActivityFeed-ZTxXVmNM.css +1 -0
- package/src/client/dist/pwa/assets/ChangelogPage-BXNz7PGb.js +1 -0
- package/src/client/dist/pwa/assets/ChangelogPage-DVyx9ZjV.css +1 -0
- package/src/client/dist/pwa/assets/ComparisonPanel-ByVbqYCs.css +1 -0
- package/src/client/dist/pwa/assets/ComparisonPanel-CfmJHeH_.js +2 -0
- package/src/client/dist/pwa/assets/CreatePage-6_AP5zso.js +2 -0
- package/src/client/dist/pwa/assets/CreatePage-CMyl2j8Z.css +1 -0
- package/src/client/dist/pwa/assets/DashboardPage-BKCrV6u0.js +1 -0
- package/src/client/dist/pwa/assets/DashboardPage-CtaHaVdf.css +1 -0
- package/src/client/dist/pwa/assets/DiffViewer-BMzrb9fB.js +8 -0
- package/src/client/dist/pwa/assets/DocumentsPanel-CqGg38Oi.js +1 -0
- package/src/client/dist/pwa/assets/{DrawerToggleButton-Bh4FXdtJ.js → DrawerToggleButton-DKytIBlk.js} +1 -1
- package/src/client/dist/pwa/assets/{GitPanel-C4wOcZV2.css → GitPanel-C3blk_Pd.css} +1 -1
- package/src/client/dist/pwa/assets/GitPanel-DRzhrs_V.js +3 -0
- package/src/client/dist/pwa/assets/HealthPage-DT8FGrKA.css +1 -0
- package/src/client/dist/pwa/assets/HealthPage-DWotmfkh.js +1 -0
- package/src/client/dist/pwa/assets/MainLayout-DkSavoiV.css +1 -0
- package/src/client/dist/pwa/assets/MainLayout-fRVZ01LN.js +2 -0
- package/src/client/dist/pwa/assets/QBanner-mzrnn82R.js +1 -0
- package/src/client/dist/pwa/assets/{QBtnDropdown-DVbxGTNb.js → QBtnDropdown-BGGvQIvH.js} +1 -1
- package/src/client/dist/pwa/assets/QChip-Chu7r6RZ.js +1 -0
- package/src/client/dist/pwa/assets/QExpansionItem-C2XXHOHk.js +1 -0
- package/src/client/dist/pwa/assets/QItemSection-CR3Kfibl.js +1 -0
- package/src/client/dist/pwa/assets/QList-DnezW6gW.js +1 -0
- package/src/client/dist/pwa/assets/QMarkupTable-wuDf50Oh.js +1 -0
- package/src/client/dist/pwa/assets/QScrollArea-BnmQ9US7.js +1 -0
- package/src/client/dist/pwa/assets/QSelect-BskTzVCM.js +1 -0
- package/src/client/dist/pwa/assets/{QTooltip-BLhkNT4s.js → QTooltip-CO84H0cq.js} +1 -1
- package/src/client/dist/pwa/assets/SchedulePanel-CBM_GpS3.css +1 -0
- package/src/client/dist/pwa/assets/SchedulePanel-CPirTYw5.js +1 -0
- package/src/client/dist/pwa/assets/SearchPage-CnT0-Hpe.js +1 -0
- package/src/client/dist/pwa/assets/{SettingsPage-BYdLXJEJ.css → SettingsPage-CpykRKq2.css} +1 -1
- package/src/client/dist/pwa/assets/SettingsPage-DCMZL7GO.js +9 -0
- package/src/client/dist/pwa/assets/SplitWorkspacePage-DwWsD7f5.js +1 -0
- package/src/client/dist/pwa/assets/{TerminalPanel-D2j5AA8S.js → TerminalPanel-C4dYabx6.js} +2 -2
- package/src/client/dist/pwa/assets/{TerminalPanel-DbVZk0vD.css → TerminalPanel-Dz9EE-Ph.css} +1 -1
- package/src/client/dist/pwa/assets/ToolCallItem-CjXWiKJc.js +8 -0
- package/src/client/dist/pwa/assets/ToolCallItem-DhjdG8vp.css +1 -0
- package/src/client/dist/pwa/assets/{TouchPan-C0EqFcrr.js → TouchPan-6fI8xFPq.js} +1 -1
- package/src/client/dist/pwa/assets/{TourReplayButton-DlMvPblb.js → TourReplayButton-DhbNI6O5.js} +1 -1
- package/src/client/dist/pwa/assets/WorkspaceAttentionLabels-CZxW7QSq.js +1 -0
- package/src/client/dist/pwa/assets/WorkspaceAttentionLabels-DSw8Upcp.css +1 -0
- package/src/client/dist/pwa/assets/WorkspacePage-B0wCQdev.js +4 -0
- package/src/client/dist/pwa/assets/{WorkspacePage--5HsnMQ1.css → WorkspacePage-BnW-gp3u.css} +1 -1
- package/src/client/dist/pwa/assets/{browser-DNEbLF-4.js → browser-CTkGHrN5.js} +1 -1
- package/src/client/dist/pwa/assets/build-path-tree-Bd50EZMW.js +1 -0
- package/src/client/dist/pwa/assets/custom-sounds-DoPDmcY5.js +1 -0
- package/src/client/dist/pwa/assets/de-BPtzBQu0.js +17 -0
- package/src/client/dist/pwa/assets/defineProperty-BbfpZ9Tg.js +1 -0
- package/src/client/dist/pwa/assets/{editor.api-PENN0io6.js → editor.api-CKcTKXcM.js} +1 -1
- package/src/client/dist/pwa/assets/efforts-CDsBbk8o.js +9 -0
- package/src/client/dist/pwa/assets/es-BoNOfG0w.js +17 -0
- package/src/client/dist/pwa/assets/expand-template-D6zFPzzB.js +1 -0
- package/src/client/dist/pwa/assets/{format-CVI7mr7G.js → format-MtzcnR3z.js} +7 -7
- package/src/client/dist/pwa/assets/formatters-DCjBZ47F.js +1 -0
- package/src/client/dist/pwa/assets/fr-Bu92fK5U.js +17 -0
- package/src/client/dist/pwa/assets/{freemarker2-BxN_Aq6C.js → freemarker2-JGUTjYvR.js} +1 -1
- package/src/client/dist/pwa/assets/{handlebars-C9UHXtO1.js → handlebars-BWStl2Hc.js} +1 -1
- package/src/client/dist/pwa/assets/{html-CTH9wSJr.js → html-CjGCxUEe.js} +1 -1
- package/src/client/dist/pwa/assets/i18n-DKj-umtn.js +19 -0
- package/src/client/dist/pwa/assets/i18n-DtmbeJu8.js +1 -0
- package/src/client/dist/pwa/assets/index-BPmUmc6D.js +2 -0
- package/src/client/dist/pwa/assets/it-CrA4Q7oc.js +17 -0
- package/src/client/dist/pwa/assets/{javascript-WT4BS8p4.js → javascript-C_jd0j2i.js} +1 -1
- package/src/client/dist/pwa/assets/latest-request-CBPb8UWQ.js +1 -0
- package/src/client/dist/pwa/assets/{liquid-D6dfe-gU.js → liquid-DMyQVGkp.js} +1 -1
- package/src/client/dist/pwa/assets/{mdx-B8pNXNeC.js → mdx-DeW5qzOU.js} +1 -1
- package/src/client/dist/pwa/assets/{monaco-contributions-COLfslyi.js → monaco-contributions-Be_o6s3m.js} +1 -1
- package/src/client/dist/pwa/assets/monaco.contribution-VUGNbVME.js +2 -0
- package/src/client/dist/pwa/assets/network-auth-CSx0jS5X.js +1 -0
- package/src/client/dist/pwa/assets/{notify-theme-7MsG-MyN.js → notify-theme-uhSG2r09.js} +1 -1
- package/src/client/dist/pwa/assets/{permissionModes-B-ciuUbz.js → permissionModes-Cc5VaOdC.js} +1 -1
- package/src/client/dist/pwa/assets/preload-helper-DjzSQ1t3.js +1 -0
- package/src/client/dist/pwa/assets/{project-color-Bo6iEcqN.js → project-color-BQbOnYBN.js} +1 -1
- package/src/client/dist/pwa/assets/{python-D2gb6Jjz.js → python-C1v3VovI.js} +1 -1
- package/src/client/dist/pwa/assets/{razor-dksrCQF2.js → razor-DMEmKSdO.js} +1 -1
- package/src/client/dist/pwa/assets/{render-chat-markdown-px_6WDIX.js → render-chat-markdown-CafzCcmu.js} +1 -1
- package/src/client/dist/pwa/assets/{typescript-DTPyRTrW.js → typescript-rKyiSQID.js} +1 -1
- package/src/client/dist/pwa/assets/use-checkbox-BqDMQ6x7.js +1 -0
- package/src/client/dist/pwa/assets/use-search-index-status-BL3cb04x.js +1 -0
- package/src/client/dist/pwa/assets/{use-tours-b00RruX_.js → use-tours-Dum-bOyQ.js} +2 -2
- package/src/client/dist/pwa/assets/use-worktree-restore-BQyoz3Qa.js +1 -0
- package/src/client/dist/pwa/assets/workspace-templates-YRwFjkUh.js +1 -0
- package/src/client/dist/pwa/assets/{xml-mxUZCM4r.js → xml-U_pDcywM.js} +1 -1
- package/src/client/dist/pwa/assets/{yaml-BuN8sUWC.js → yaml-CRCd_ET9.js} +1 -1
- package/src/client/dist/pwa/index.html +6 -3
- package/src/client/dist/pwa/sw.js +1 -1
- package/src/client/dist/pwa/assets/ActivityFeed-DCmiJP-z.css +0 -1
- package/src/client/dist/pwa/assets/ActivityFeed-DdGARu8o.js +0 -8
- package/src/client/dist/pwa/assets/ChangelogPage-CGenjiI5.js +0 -1
- package/src/client/dist/pwa/assets/ChangelogPage-DKJkFiU_.css +0 -1
- package/src/client/dist/pwa/assets/ComparisonPanel-CRRaDs2D.css +0 -1
- package/src/client/dist/pwa/assets/ComparisonPanel-aXgjEulK.js +0 -2
- package/src/client/dist/pwa/assets/CreatePage-B9C9J9Pw.css +0 -1
- package/src/client/dist/pwa/assets/CreatePage-BaB_30xJ.js +0 -2
- package/src/client/dist/pwa/assets/DashboardPage-DsbwmO2W.js +0 -1
- package/src/client/dist/pwa/assets/DashboardPage-XiCj24i2.css +0 -1
- package/src/client/dist/pwa/assets/DiffViewer--dUMf7b3.js +0 -8
- package/src/client/dist/pwa/assets/DocumentsPanel-DTjEUYUd.js +0 -1
- package/src/client/dist/pwa/assets/GitPanel-PUPLj0M8.js +0 -3
- package/src/client/dist/pwa/assets/HealthPage-BHgucifz.js +0 -1
- package/src/client/dist/pwa/assets/HealthPage-CFZ-tdKK.css +0 -1
- package/src/client/dist/pwa/assets/MainLayout-CNmwCnDD.css +0 -1
- package/src/client/dist/pwa/assets/MainLayout-CQVLnTX3.js +0 -2
- package/src/client/dist/pwa/assets/QBanner-XE0EMe9L.js +0 -1
- package/src/client/dist/pwa/assets/QChip-Bt_JvnHb.js +0 -1
- package/src/client/dist/pwa/assets/QExpansionItem-CxEBY3jY.js +0 -1
- package/src/client/dist/pwa/assets/QItemSection-Cf6OZEH4.js +0 -1
- package/src/client/dist/pwa/assets/QList-Z90BspT4.js +0 -1
- package/src/client/dist/pwa/assets/QMarkupTable-Bwjknbmw.js +0 -1
- package/src/client/dist/pwa/assets/QSelect-CMzJDhi-.js +0 -1
- package/src/client/dist/pwa/assets/SchedulePanel-BYKSFoFj.css +0 -1
- package/src/client/dist/pwa/assets/SchedulePanel-DTVwe7sX.js +0 -1
- package/src/client/dist/pwa/assets/SearchPage-CtrR7dNr.js +0 -1
- package/src/client/dist/pwa/assets/SettingsPage-Bl_RNTGi.js +0 -9
- package/src/client/dist/pwa/assets/SplitWorkspacePage-Bac_Pzmm.js +0 -1
- package/src/client/dist/pwa/assets/WorkspaceAttentionLabels-BAk5l4Ik.js +0 -1
- package/src/client/dist/pwa/assets/WorkspaceAttentionLabels-CrLP_I5S.css +0 -1
- package/src/client/dist/pwa/assets/WorkspacePage-FScR5YAD.js +0 -4
- package/src/client/dist/pwa/assets/build-path-tree-C0b61nxI.js +0 -1
- package/src/client/dist/pwa/assets/custom-sounds-DE4JLdGG.js +0 -1
- package/src/client/dist/pwa/assets/de-DgZ9jKq_.js +0 -17
- package/src/client/dist/pwa/assets/documents-CALwmao-.js +0 -1
- package/src/client/dist/pwa/assets/efforts-Detdm-FH.js +0 -9
- package/src/client/dist/pwa/assets/es-zvlgzw9H.js +0 -17
- package/src/client/dist/pwa/assets/expand-template-ZIVLPdW2.js +0 -1
- package/src/client/dist/pwa/assets/formatters-C_zcfJBt.js +0 -1
- package/src/client/dist/pwa/assets/fr-BICzq59I.js +0 -17
- package/src/client/dist/pwa/assets/i18n-DG_vChZ3.js +0 -1
- package/src/client/dist/pwa/assets/index-fuLr-ZVa.js +0 -20
- package/src/client/dist/pwa/assets/it-BIGArQrS.js +0 -17
- package/src/client/dist/pwa/assets/monaco.contribution-CDhuQbzi.js +0 -2
- package/src/client/dist/pwa/assets/network-auth-QouPCx6A.js +0 -1
- package/src/client/dist/pwa/assets/pending-diff-open-CX24u9gW.js +0 -1
- package/src/client/dist/pwa/assets/pinia-BdFjQEqa.js +0 -1
- package/src/client/dist/pwa/assets/use-checkbox-Bh9EQhkV.js +0 -1
- package/src/client/dist/pwa/assets/use-search-index-status-_nCyACc7.js +0 -1
- package/src/client/dist/pwa/assets/use-worktree-restore-BDOZc9fk.js +0 -1
- package/src/client/dist/pwa/assets/workspace-templates-DV9Njz0T.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MainLayout-fRVZ01LN.js","assets/reactivity.esm-bundler-tuEvQ47f.js","assets/runtime-core.esm-bundler-DOiZcasU.js","assets/QBtn-b_baQtAt.js","assets/latest-request-CBPb8UWQ.js","assets/defineProperty-BbfpZ9Tg.js","assets/i18n-DKj-umtn.js","assets/preload-helper-DjzSQ1t3.js","assets/use-id-b4A2I8LB.js","assets/QList-DnezW6gW.js","assets/QSelect-BskTzVCM.js","assets/private.use-form-vxvbh_VN.js","assets/QItemSection-CR3Kfibl.js","assets/use-tours-Dum-bOyQ.js","assets/use-tours-CTZuBZOi.css","assets/QChip-Chu7r6RZ.js","assets/ToolCallItem-CjXWiKJc.js","assets/QTooltip-CO84H0cq.js","assets/render-chat-markdown-CafzCcmu.js","assets/ToolCallItem-DhjdG8vp.css","assets/use-worktree-restore-BQyoz3Qa.js","assets/use-worktree-restore-B-9jHocY.css","assets/QBadge-rGILsUYl.js","assets/ClosePopup-C1a82pL9.js","assets/use-is-mobile-DLIZxEo9.js","assets/permissionModes-Cc5VaOdC.js","assets/efforts-CDsBbk8o.js","assets/WorkspaceAttentionLabels-CZxW7QSq.js","assets/formatters-DCjBZ47F.js","assets/WorkspaceAttentionLabels-DSw8Upcp.css","assets/custom-sounds-DoPDmcY5.js","assets/TouchPan-6fI8xFPq.js","assets/QBanner-mzrnn82R.js","assets/project-color-BQbOnYBN.js","assets/SettingsPage-DCMZL7GO.js","assets/QExpansionItem-C2XXHOHk.js","assets/use-slide-transition-C5eDGOmu.js","assets/QBtnDropdown-BGGvQIvH.js","assets/QBtnGroup-CUmAgBV8.js","assets/QPage-BCDXjfVj.js","assets/DrawerToggleButton-DKytIBlk.js","assets/TourReplayButton-DhbNI6O5.js","assets/workspace-templates-YRwFjkUh.js","assets/workspace-page-layout-Dw9NhZsL.js","assets/SettingsPage-CpykRKq2.css","assets/MainLayout-DkSavoiV.css","assets/DashboardPage-BKCrV6u0.js","assets/QMarkupTable-wuDf50Oh.js","assets/DashboardPage-CtaHaVdf.css","assets/WorkspacePage-B0wCQdev.js","assets/QSpinnerDots-BsKmccpX.js","assets/clipboard-t9qe6lK7.js","assets/expand-template-D6zFPzzB.js","assets/expand-template-CTUNyJrv.css","assets/use-search-index-status-BL3cb04x.js","assets/WorkspacePage-BnW-gp3u.css","assets/SplitWorkspacePage-DwWsD7f5.js","assets/SplitWorkspacePage-lWQO8xro.css","assets/CreatePage-6_AP5zso.js","assets/QBtnToggle-COL46j6W.js","assets/CreatePage-CMyl2j8Z.css","assets/SearchPage-CnT0-Hpe.js","assets/SearchPage-BGc1oQSM.css","assets/HealthPage-DWotmfkh.js","assets/HealthPage-DT8FGrKA.css","assets/ChangelogPage-BXNz7PGb.js","assets/ChangelogPage-DVyx9ZjV.css","assets/i18n-DtmbeJu8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{C as e,M as t,S as n,b as r,dt as i,f as a,g as o,v as s}from"./reactivity.esm-bundler-tuEvQ47f.js";import{C as c,F as l,J as u,L as d,M as f,N as p,O as m,P as h,R as g,T as _,V as v,Y as y,_ as b,b as x,d as S,f as C,j as w,k as T,l as E,p as D,r as ee,u as O,y as k}from"./runtime-core.esm-bundler-DOiZcasU.js";import{A,C as j,G as M,H as te,I as ne,M as re,N as ie,P as ae,Q as N,S as oe,T as se,U as ce,W as le,X as P,Y as F,at as ue,b as I,ct as L,d as de,dt as fe,et as pe,f as me,it as he,j as ge,k as _e,l as ve,lt as ye,m as be,nt as R,o as xe,ot as z,p as Se,pt as Ce,s as we,st as Te,t as Ee,tt as De,u as Oe,ut as ke,x as Ae}from"./QBtn-b_baQtAt.js";import{a as B,c as je,d as Me,i as V,l as H,m as Ne,n as Pe,o as U,p as Fe,r as Ie,s as Le,u as Re}from"./latest-request-CBPb8UWQ.js";import{C as ze,S as Be,_ as Ve,a as He,b as Ue,c as We,f as Ge,l as Ke,p as qe,s as Je,t as Ye,u as Xe,v as Ze,w as Qe,x as $e,y as et}from"./use-id-b4A2I8LB.js";import{t as tt}from"./defineProperty-BbfpZ9Tg.js";import{a as nt,n as rt}from"./i18n-DKj-umtn.js";import{t as W}from"./preload-helper-DjzSQ1t3.js";import{i as it,n as at,r as ot}from"./private.use-form-vxvbh_VN.js";import{a as st,i as ct,n as lt,r as ut,t as dt}from"./use-checkbox-BqDMQ6x7.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ft=[`sm`,`md`,`lg`,`xl`],{passive:pt}=F,mt=he({width:0,height:0,name:`xs`,sizes:{sm:600,md:1024,lg:1440,xl:1920},lt:{sm:!0,md:!0,lg:!0,xl:!0},gt:{xs:!1,sm:!1,md:!1,lg:!1},xs:!0,sm:!1,md:!1,lg:!1,xl:!1,orientation:{type:`portrait-primary`,angle:0,portrait:!0,landscape:!1}},{setSizes:P,setDebounce:P,install({$q:e,onSSRHydrated:t}){if(e.screen=this,this.__installed){e.config.screen!==void 0&&(e.config.screen.bodyClasses?this.__update(!0):document.body.classList.remove(`screen--${this.name}`));return}let{visualViewport:n}=window,r=n||window,i=document.scrollingElement||document.documentElement,a=n===void 0||z.is.mobile?()=>[Math.max(window.innerWidth,i.clientWidth),Math.max(window.innerHeight,i.clientHeight)]:()=>[n.width*n.scale+window.innerWidth-i.clientWidth,n.height*n.scale+window.innerHeight-i.clientHeight],o=e.config.screen?.bodyClasses===!0;this.__update=e=>{let[t,n]=a();if(n!==this.height&&(this.height=n),t!==this.width)this.width=t;else if(e!==!0)return;let r=this.sizes;this.gt.xs=t>=r.sm,this.gt.sm=t>=r.md,this.gt.md=t>=r.lg,this.gt.lg=t>=r.xl,this.lt.sm=t<r.sm,this.lt.md=t<r.md,this.lt.lg=t<r.lg,this.lt.xl=t<r.xl,this.xs=this.lt.sm,this.sm=this.gt.xs&&this.lt.md,this.md=this.gt.sm&&this.lt.lg,this.lg=this.gt.md&&this.lt.xl,this.xl=this.gt.lg,r=this.xs&&`xs`||this.sm&&`sm`||this.md&&`md`||this.lg&&`lg`||`xl`,r!==this.name&&(o&&(document.body.classList.remove(`screen--${this.name}`),document.body.classList.add(`screen--${r}`)),this.name=r)};let s,c={},l=16;this.setSizes=e=>{ft.forEach(t=>{e[t]!==void 0&&(c[t]=e[t])})},this.setDebounce=e=>{l=e};let u=()=>{let e=getComputedStyle(document.body);e.getPropertyValue(`--q-size-sm`)&&ft.forEach(t=>{this.sizes[t]=Number.parseInt(e.getPropertyValue(`--q-size-${t}`),10)}),this.setSizes=e=>{ft.forEach(t=>{e[t]&&(this.sizes[t]=e[t])}),this.__update(!0)},this.setDebounce=e=>{s!==void 0&&(s.flush?.(),r.removeEventListener(`resize`,s,pt)),s=e>0?M(this.__update,e):this.__update,r.addEventListener(`resize`,s,pt)},this.setDebounce(l),Object.keys(c).length===0?this.__update():(this.setSizes(c),c=void 0),o&&this.name===`xs`&&document.body.classList.add(`screen--xs`);let{orientation:t}=window.screen,n=()=>{let{type:e,angle:n}=t,r=e.startsWith(`portrait`);Object.assign(this.orientation,{type:e,angle:n,portrait:r,landscape:!r})};n(),t.addEventListener(`change`,n,pt)};Te.value?t.push(u):u()}}),ht=`data-dark-auto`,G=he({isActive:!1,mode:!1},{__media:void 0,set(e){G.mode=e,e===`auto`?(G.__media===void 0&&(G.__media=window.matchMedia(`(prefers-color-scheme: dark)`),G.__updateMedia=()=>{G.set(`auto`)},G.__media.addListener(G.__updateMedia)),e=G.__media.matches):G.__media!==void 0&&(G.__media.removeListener(G.__updateMedia),G.__media=void 0),G.isActive=e===!0,document.body.classList.remove(`body--${e===!0?`light`:`dark`}`),document.body.classList.add(`body--${e===!0?`dark`:`light`}`)},toggle(){G.set(!G.isActive)},install({$q:e,ssrContext:t,onSSRHydrated:n}){if(e.dark=this,!this.__installed){if(Te.value){if(document.body.hasAttribute(ht)){this.mode=`auto`,n.push(()=>{document.body.removeAttribute(ht),this.mode===`auto`&&this.set(`auto`)});return}this.set(document.body.classList.contains(`body--dark`));return}this.set(e.config.dark??!1)}}});function gt(e,t,n=document.body){if(typeof e!=`string`)throw TypeError(`Expected a string as propName`);if(typeof t!=`string`)throw TypeError(`Expected a string as value`);if(!(n instanceof Element))throw TypeError(`Expected a DOM element`);n.style.setProperty(`--q-${e}`,t)}function _t(e){if(e.ios)return`ios`;if(e.android)return`android`}function vt({is:e,has:t,within:n},r){let i=[e.desktop?`desktop`:`mobile`,`${t.touch?``:`no-`}touch`];if(e.mobile){let t=_t(e);t!==void 0&&i.push(`platform-`+t)}if(e.nativeMobile){let t=e.nativeMobileWrapper,n=r[t];i.push(t,`native-mobile`),e.ios&&(n===void 0||n.iosStatusBarPadding)?i.push(`q-ios-padding`):e.android&&(n===void 0||n.androidStatusBarPadding!==!1)&&i.push(`q-safe-area-padding`)}else e.electron?i.push(`electron`):e.bex&&i.push(`bex`);return n.iframe&&i.push(`within-iframe`),i}function yt(){let{is:e}=z,t=document.body.className,n=new Set(t.replaceAll(/ {2}/g,` `).split(` `));if(!e.nativeMobile&&!e.electron&&!e.bex){if(e.desktop)n.delete(`mobile`),n.delete(`platform-ios`),n.delete(`platform-android`),n.add(`desktop`);else if(e.mobile){n.delete(`desktop`),n.add(`mobile`),n.delete(`platform-ios`),n.delete(`platform-android`);let t=_t(e);t!==void 0&&n.add(`platform-${t}`)}}z.has.touch&&(n.delete(`no-touch`),n.add(`touch`)),z.within.iframe&&n.add(`within-iframe`);let r=[...n].join(` `);t!==r&&(document.body.className=r)}function bt(e){for(let t in e)gt(t,e[t])}var xt={install(e){if(!this.__installed){if(Te.value)yt();else{let{$q:t}=e;t.config.brand!==void 0&&bt(t.config.brand),document.body.classList.add(...vt(z,t.config))}z.is.ios&&document.body.addEventListener(`touchstart`,P),window.addEventListener(`keydown`,ce,!0)}}},St=()=>!0;function Ct(e){return typeof e==`string`&&e!==``&&e!==`/`&&e!==`#/`}function wt(e){return e.startsWith(`#`)&&(e=e.slice(1)),e.startsWith(`/`)||(e=`/`+e),e.endsWith(`/`)&&(e=e.slice(0,-1)),`#`+e}function Tt(e){if(e.backButtonExit===!1)return()=>!1;if(e.backButtonExit===`*`)return St;let t=[`#/`];return Array.isArray(e.backButtonExit)&&t.push(...e.backButtonExit.filter(Ct).map(wt)),()=>t.includes(window.location.hash)}var Et={__history:[],add:P,remove:P,install({$q:e}){if(this.__installed)return;let{cordova:t,capacitor:n}=z.is;if(!t&&!n)return;let r=e.config[t?`cordova`:`capacitor`];if(r?.backButton===!1||n&&(window.Capacitor===void 0||window.Capacitor.Plugins.App===void 0))return;this.add=e=>{e.condition===void 0&&(e.condition=St),this.__history.push(e)},this.remove=e=>{let t=this.__history.indexOf(e);t!==-1&&this.__history.splice(t,1)};let i=Tt({backButtonExit:!0,...r}),a=()=>{if(this.__history.length!==0){let e=this.__history.at(-1);e.condition()&&(this.__history.pop(),e.handler())}else i()?navigator.app.exitApp():window.history.back()};t?document.addEventListener(`deviceready`,()=>{document.addEventListener(`backbutton`,a,!1)}):window.Capacitor.Plugins.App.addListener(`backButton`,a)}},Dt={isoName:`en-US`,nativeName:`English (US)`,label:{clear:`Clear`,ok:`OK`,cancel:`Cancel`,close:`Close`,set:`Set`,select:`Select`,reset:`Reset`,remove:`Remove`,update:`Update`,create:`Create`,search:`Search`,filter:`Filter`,refresh:`Refresh`,minimum:`Minimum`,maximum:`Maximum`,range:`Range`,noValue:`No value`,resize:`Resize`,expand:e=>e?`Expand "${e}"`:`Expand`,collapse:e=>e?`Collapse "${e}"`:`Collapse`},date:{days:`Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday`.split(`_`),daysShort:`Sun_Mon_Tue_Wed_Thu_Fri_Sat`.split(`_`),months:`January_February_March_April_May_June_July_August_September_October_November_December`.split(`_`),monthsShort:`Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec`.split(`_`),firstDayOfWeek:0,format24h:!1,pluralDay:`days`,prevMonth:`Previous month`,nextMonth:`Next month`,prevYear:`Previous year`,nextYear:`Next year`,today:`Today`,prevRangeYears:e=>`Previous ${e} years`,nextRangeYears:e=>`Next ${e} years`,hour:`Hour`,minute:`Minute`,second:`Second`,now:`Current time`},table:{noData:`No data available`,noResults:`No matching records found`,loading:`Loading...`,selectedRecords:e=>e===1?`1 record selected.`:(e===0?`No`:e)+` records selected.`,recordsPerPage:`Records per page:`,allRows:`All`,pagination:(e,t,n)=>e+`–`+t+` of `+n,columns:`Columns`,selectAllRows:`Select all rows`,selectRow:`Select row`},pagination:{label:`Pagination`,first:`First page`,prev:`Previous page`,next:`Next page`,last:`Last page`},carousel:{prevSlide:`Previous slide`,nextSlide:`Next slide`},colorPicker:{spectrum:`Spectrum`,tune:`Tune`,palette:`Palette`,value:`Color value`,hue:`Hue`,alpha:`Opacity`,saturation:`Saturation`,brightness:`Brightness`},uploader:{addFiles:`Pick files`,upload:`Upload files`,abort:`Abort upload`,removeQueued:`Remove queued files`,removeUploaded:`Remove uploaded files`,removeFile:`Remove file`},editor:{toolbar:`Editor toolbar`,url:`URL`,bold:`Bold`,italic:`Italic`,strikethrough:`Strikethrough`,underline:`Underline`,unorderedList:`Unordered List`,orderedList:`Ordered List`,subscript:`Subscript`,superscript:`Superscript`,hyperlink:`Hyperlink`,toggleFullscreen:`Toggle Fullscreen`,quote:`Quote`,left:`Left align`,center:`Center align`,right:`Right align`,justify:`Justify align`,print:`Print`,outdent:`Decrease indentation`,indent:`Increase indentation`,removeFormat:`Remove formatting`,formatting:`Formatting`,fontSize:`Font Size`,align:`Align`,hr:`Insert Horizontal Rule`,undo:`Undo`,redo:`Redo`,heading1:`Heading 1`,heading2:`Heading 2`,heading3:`Heading 3`,heading4:`Heading 4`,heading5:`Heading 5`,heading6:`Heading 6`,paragraph:`Paragraph`,code:`Code`,size1:`Very small`,size2:`A bit small`,size3:`Normal`,size4:`Medium-large`,size5:`Big`,size6:`Very big`,size7:`Maximum`,defaultFont:`Default Font`,viewSource:`View Source`},tree:{noNodes:`No nodes available`,noResults:`No matching nodes found`}};function Ot(e){return e.split(/[-_]/).map((e,t)=>t===0?e.toLowerCase():t>1||e.length<4?e.toUpperCase():e[0].toUpperCase()+e.slice(1).toLowerCase())}function kt(){let e=Array.isArray(navigator.languages)&&navigator.languages.length!==0?navigator.languages[0]:navigator.language;if(typeof e==`string`)return Ot(e).join(`-`)}function At(e){try{let{language:t,script:n,region:r}=new Intl.Locale(e).maximize();return{language:t,script:n,region:r}}catch{}}function jt(e,t){if(typeof e!=`string`||!Array.isArray(t))return;let n=new Map;for(let e of t){if(typeof e!=`string`)continue;let t=e.toLowerCase().replaceAll(`_`,`-`);n.has(t)||n.set(t,e)}if(n.size===0)return;let r=Ot(e),i=[];for(let e=r.length;e>1;e--)i.push(r.slice(0,e).join(`-`));if(r.length>2&&r[1].length===4){let e=[r[0],...r.slice(2)];for(let t=e.length;t>1;t--)i.push(e.slice(0,t).join(`-`))}i.push(r[0]);for(let e of i){let t=n.get(e.toLowerCase());if(t!==void 0)return t}let a=At(r.join(`-`));if(a===void 0)return;let o=At(a.language).region,s;for(let[e,t]of n){let n=At(e);if(n===void 0||n.language!==a.language)continue;let r=(n.script===a.script?4:0)+(n.region===a.region?2:0)+ +(n.region===o),i=e.split(`-`).length;(s===void 0||r>s.score||r===s.score&&i<s.depth)&&(s={tag:t,score:r,depth:i})}return s?.tag}var Mt=he({__qLang:{}},{getLocale:kt,getClosestIsoName:jt,set(e=Dt,t){let n={...e,rtl:e.rtl===!0,getLocale:kt,getClosestIsoName:jt};if(n.set=Mt.set,Mt.__langConfig===void 0||!Mt.__langConfig.noHtmlAttrs){let e=document.documentElement;e.setAttribute(`dir`,n.rtl?`rtl`:`ltr`),e.setAttribute(`lang`,n.isoName)}for(let e of Object.keys(Mt.__qLang))e in n||delete Mt.__qLang[e];Object.assign(Mt.__qLang,n)},install({$q:e,lang:t,ssrContext:n}){e.lang=Mt.__qLang,Mt.__langConfig=e.config.lang,this.__installed?t!==void 0&&this.set(t):(this.props=new Proxy(this.__qLang,{get:Reflect.get,ownKeys(e){return Reflect.ownKeys(e).filter(e=>e!==`set`&&e!==`getLocale`&&e!==`getClosestIsoName`)}}),this.set(t||Dt))}}),Nt={name:`material-icons`,type:{positive:`check_circle`,negative:`warning`,info:`info`,warning:`priority_high`},arrow:{up:`arrow_upward`,right:`arrow_forward`,down:`arrow_downward`,left:`arrow_back`,dropdown:`arrow_drop_down`},chevron:{left:`chevron_left`,right:`chevron_right`},colorPicker:{spectrum:`gradient`,tune:`tune`,palette:`style`},pullToRefresh:{icon:`refresh`},carousel:{left:`chevron_left`,right:`chevron_right`,up:`keyboard_arrow_up`,down:`keyboard_arrow_down`,navigationIcon:`lens`},chip:{remove:`cancel`,selected:`check`},datetime:{arrowLeft:`chevron_left`,arrowRight:`chevron_right`,now:`access_time`,today:`today`},editor:{bold:`format_bold`,italic:`format_italic`,strikethrough:`strikethrough_s`,underline:`format_underlined`,unorderedList:`format_list_bulleted`,orderedList:`format_list_numbered`,subscript:`vertical_align_bottom`,superscript:`vertical_align_top`,hyperlink:`link`,toggleFullscreen:`fullscreen`,quote:`format_quote`,left:`format_align_left`,center:`format_align_center`,right:`format_align_right`,justify:`format_align_justify`,print:`print`,outdent:`format_indent_decrease`,indent:`format_indent_increase`,removeFormat:`format_clear`,formatting:`text_format`,fontSize:`format_size`,align:`format_align_left`,hr:`remove`,undo:`undo`,redo:`redo`,heading:`format_size`,code:`code`,size:`format_size`,font:`font_download`,viewSource:`code`},expansionItem:{icon:`keyboard_arrow_down`,denseIcon:`arrow_drop_down`},fab:{icon:`add`,activeIcon:`close`},field:{clear:`cancel`,error:`error`},pagination:{first:`first_page`,prev:`keyboard_arrow_left`,next:`keyboard_arrow_right`,last:`last_page`},rating:{icon:`grade`},stepper:{done:`check`,active:`edit`,error:`warning`},tabs:{left:`chevron_left`,right:`chevron_right`,up:`keyboard_arrow_up`,down:`keyboard_arrow_down`},table:{arrowUp:`arrow_upward`,warning:`warning`,firstPage:`first_page`,prevPage:`chevron_left`,nextPage:`chevron_right`,lastPage:`last_page`},tree:{icon:`play_arrow`},uploader:{done:`done`,clear:`clear`,add:`add_box`,upload:`cloud_upload`,removeQueue:`clear_all`,removeUploaded:`done_all`}},Pt=he({iconMapFn:null,__qIconSet:{}},{set(e,t){let n={...e};n.set=Pt.set,Object.assign(Pt.__qIconSet,n)},install({$q:e,iconSet:t,ssrContext:n}){e.config.iconMapFn!==void 0&&(this.iconMapFn=e.config.iconMapFn),e.iconSet=this.__qIconSet,L(e,`iconMapFn`,()=>this.iconMapFn,e=>{this.iconMapFn=e}),this.__installed?t!==void 0&&this.set(t):(this.props=new Proxy(this.__qIconSet,{get:Reflect.get,ownKeys(e){return Reflect.ownKeys(e).filter(e=>e!==`set`)}}),this.set(t||Nt))}});function Ft(e){return e.constructor===ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function It(e,t,n){return typeof e==`function`&&e!==n&&typeof t==`function`&&t!==n}function Lt(e,t){if(e===t)return!0;if(e!==null&&t!==null&&typeof e==`object`&&typeof t==`object`){if(e.constructor!==t.constructor)return!1;let n,r;if(e.constructor===Array){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Lt(e[r],t[r]))return!1;return!0}if(e.constructor===Map){if(e.size!==t.size)return!1;let n=e.entries();for(r=n.next();!r.done;){if(!t.has(r.value[0]))return!1;r=n.next()}for(n=e.entries(),r=n.next();!r.done;){if(!Lt(r.value[1],t.get(r.value[0])))return!1;r=n.next()}return!0}if(e.constructor===Set){if(e.size!==t.size)return!1;let n=e.entries();for(r=n.next();!r.done;){if(!t.has(r.value[0]))return!1;r=n.next()}return!0}if(e.constructor===ArrayBuffer||e.constructor===DataView){if(e.byteLength!==t.byteLength)return!1;e=Ft(e),t=Ft(t)}if(ArrayBuffer.isView(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(It(e.valueOf,t.valueOf,Object.prototype.valueOf))return e.valueOf()===t.valueOf();if(It(e.toString,t.toString,Object.prototype.toString))return e.toString()===t.toString();let i=Object.keys(e).filter(t=>e[t]!==void 0);if(n=i.length,n!==Object.keys(t).filter(e=>t[e]!==void 0).length)return!1;for(r=n;r--!==0;){let n=i[r];if(!Lt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function K(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Rt(e){return Object.prototype.toString.call(e)===`[object Date]`}function zt(e){return Object.prototype.toString.call(e)===`[object RegExp]`}function Bt(e){return typeof e==`number`&&Number.isFinite(e)}var Vt={deepEqual:Lt,object:K,date:Rt,regexp:zt,number:Bt},Ht=[ue,xt,G,mt,Et,Mt,Pt];function Ut(e,t){let n=fe(e);n.config.globalProperties=t.config.globalProperties;let{reload:r,...i}=t._context;return Object.assign(n._context,i),n}function Wt(e,t){t.forEach(t=>{t.install(e),t.__installed=!0})}function Gt(e,t,n){e.config.globalProperties.$q=n.$q,e.provide(`_q_`,n.$q),Wt(n,Ht),t.components!==void 0&&Object.values(t.components).forEach(t=>{K(t)&&t.name!==void 0&&e.component(t.name,t)}),t.directives!==void 0&&Object.values(t.directives).forEach(t=>{K(t)&&t.name!==void 0&&e.directive(t.name,t)}),t.plugins!==void 0&&Wt(n,Object.values(t.plugins).filter(e=>typeof e.install==`function`&&!Ht.includes(e))),Te.value&&(n.$q.onSSRHydrated=()=>{n.onSSRHydrated.forEach(e=>{e()}),n.$q.onSSRHydrated=()=>{}})}var Kt={name:`Quasar`,version:`2.34.0`,install:function(e,t={}){let n={version:`2.34.0`};ae?n.config=t.config||{}:(t.config!==void 0&&Object.assign(ie,t.config),n.config={...ie},re()),Gt(e,t,{parentApp:e,$q:n,lang:t.lang,iconSet:t.iconSet,onSSRHydrated:[]})},lang:Mt,iconSet:Pt},qt=R({name:`QCardSection`,props:{tag:{type:String,default:`div`},horizontal:Boolean},setup(e,{slots:t}){let n=E(()=>`q-card__section q-card__section--${e.horizontal?`horiz row no-wrap`:`vert`}`);return()=>c(e.tag,{class:n.value},j(t.default))}}),Jt=_e({xs:2,sm:4,md:6,lg:10,xl:14});function Yt(e){return{transform:`scaleX(${e})`}}var Xt=R({name:`QLinearProgress`,props:{...Ne,...ge,value:{type:Number,default:0},buffer:Number,color:String,trackColor:String,reverse:Boolean,stripe:Boolean,indeterminate:Boolean,query:Boolean,rounded:Boolean,animationSpeed:{type:[String,Number],default:2100},instantFeedback:Boolean},setup(e,{slots:t}){let n=I(),r=Fe(e,n),i=E(()=>e.indeterminate||e.query),a=E(()=>({...Jt(e.size),"--q-linear-progress-speed":`${e.animationSpeed}ms`})),o=E(()=>`q-linear-progress`+(e.color===void 0?``:` text-${e.color}`)+(e.reverse||e.query?` q-linear-progress--reverse`:``)+(e.rounded?` rounded-borders`:``)),s=E(()=>Yt(e.buffer===void 0?1:e.buffer)),l=E(()=>`with${e.instantFeedback?`out`:``}-transition`),u=E(()=>`q-linear-progress__track absolute-full q-linear-progress__track--${l.value} q-linear-progress__track--${r()?`dark`:`light`}`+(e.trackColor===void 0?``:` bg-${e.trackColor}`)),d=E(()=>Yt(i.value?1:e.value)),f=E(()=>`q-linear-progress__model absolute-full q-linear-progress__model--${l.value} q-linear-progress__model--${i.value?`in`:``}determinate`),p=E(()=>({width:`${e.value*100}%`})),m=E(()=>`q-linear-progress__stripe absolute-${e.reverse?`right`:`left`} q-linear-progress__stripe--${l.value}`);return()=>{let n=[c(`div`,{class:u.value,style:s.value}),c(`div`,{class:f.value,style:d.value})];return e.stripe&&!i.value&&n.push(c(`div`,{class:m.value,style:p.value})),c(`div`,{class:o.value,style:a.value,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":1,"aria-valuenow":e.indeterminate||e.query?void 0:e.value},Ae(t.default,n))}}}),Zt=R({name:`QCard`,props:{...Ne,tag:{type:String,default:`div`},square:Boolean,flat:Boolean,bordered:Boolean},setup(e,{slots:t}){let n=I(),r=Fe(e,n),i=E(()=>`q-card`+(r()?` q-card--dark q-dark`:``)+(e.bordered?` q-card--bordered`:``)+(e.square?` q-card--square no-border-radius`:``)+(e.flat?` q-card--flat no-shadow`:``));return()=>c(e.tag,{class:i.value},j(t.default))}});function Qt(e,t,n){let r;function i(){r!==void 0&&(Et.remove(r),r=void 0)}return w(()=>{e.value&&i()}),{removeFromHistory:i,addToHistory(){r={condition:()=>n.value,handler:t},Et.add(r)}}}function $t(e,t){let{proxy:n}=x(),r=null;function i(t){r=e.noRefocus||t===!0?null:document.activeElement}function a(e){r=e||null}function o(){r=null}function s(e){return(e?.type.indexOf(`key`)===0?r.closest(`[tabindex]:not([tabindex^="-"])`):void 0)||r}function c(e){if(r===null)return;let t=s(e);r=null;let i=Ve.indexOf(n);if(i!==-1){for(let e=Ve.length-1;e>i;e--)if(Ve[e].__adoptRefocusTarget?.(t,n.contentEl)===!0)return}Xe(()=>{t.isConnected&&Ge(t)})}function l(e){r!==null&&(r.isConnected&&Ge(s(e)),r=null)}function u(n,i){return t()?(!e.noRefocus&&(r===null||i?.contains(r)===!0)&&(r=n),!0):!1}return{captureRefocusTarget:i,setRefocusTarget:a,clearRefocusTarget:o,restoreFocus:c,restoreFocusSync:l,adoptRefocusTarget:u}}var en=[Element,String,Object],tn=[null,document,document.body,document.scrollingElement,document.documentElement];function nn(e,t){let n=me(t);if(n!==void 0&&n!==window&&!(n instanceof Element)&&!tn.includes(n)&&(console.warn(`[Quasar] scroll-target: the specified value is not an Element nor a component with a root element; falling back to auto detection`),n=void 0),n===void 0){if(e==null)return window;n=e.closest(`.scroll,.scroll-y,.overflow-auto`)}return tn.includes(n)?window:n}function rn(e){return e===window?window.scrollY:e.scrollTop}function an(e){return e===window?window.scrollX:e.scrollLeft}function on(e,t,n=0,r){let i=r===void 0?performance.now():r,a=rn(e);if(n<=0){a!==t&&cn(e,t);return}requestAnimationFrame(r=>{let o=r-i,s=a+(t-a)/Math.max(o,n)*o;cn(e,s),s!==t&&on(e,t,n-o,r)})}function sn(e,t,n=0,r){let i=r===void 0?performance.now():r,a=an(e);if(n<=0){a!==t&&ln(e,t);return}requestAnimationFrame(r=>{let o=r-i,s=a+(t-a)/Math.max(o,n)*o;ln(e,s),s!==t&&sn(e,t,n-o,r)})}function cn(e,t){if(e===window){window.scrollTo(window.scrollX,t);return}e.scrollTop=t}function ln(e,t){if(e===window){window.scrollTo(t,window.scrollY);return}e.scrollLeft=t}function un(e,t,n){if(n){on(e,t,n);return}cn(e,t)}function dn(e,t,n){if(n){sn(e,t,n);return}ln(e,t)}var fn;function pn(){if(fn!==void 0)return fn;let e=document.createElement(`p`),t=document.createElement(`div`);de(e,{width:`100%`,height:`200px`}),de(t,{position:`absolute`,top:`0px`,left:`0px`,visibility:`hidden`,width:`200px`,height:`150px`,overflow:`hidden`}),t.append(e),document.body.append(t);let n=e.offsetWidth;t.style.overflow=`scroll`;let r=e.offsetWidth;return n===r&&(r=t.clientWidth),t.remove(),fn=n-r,fn}var mn=0,hn,gn,_n,vn=!1,yn,bn,xn=!1,Sn,Cn=null,wn=new Set;function Tn(e){wn.add(e)}function En(e){wn.delete(e)}function Dn(e){vn||(vn=!0,requestAnimationFrame(()=>{vn=!1;let{height:t,scale:n}=e.target;if(Math.abs(n-1)>.01)return;let{clientHeight:r,scrollTop:i}=document.scrollingElement;(_n===void 0||t!==window.innerHeight)&&(_n=r-t,document.scrollingElement.scrollTop=i),i>_n&&(document.scrollingElement.scrollTop-=Math.ceil((i-_n)/8))}))}function On(e){let t=document.body;if(e===`add`){hn=an(window),gn=rn(window),Sn=window.location.pathname,xn=z.is.ios;let e=[`q-document--prevent-scroll`];xn?(yn=t.style.left,bn=t.style.top,t.style.left=`-${hn}px`,t.style.top=`-${gn}px`,e.push(`q-document--pin-body`)):(e.push(`q-document--clip-scroll`),window.innerWidth-document.documentElement.clientWidth>0&&e.push(`q-document--reserve-scrollbar`)),document.documentElement.classList.add(...e),document.qScrollPrevented=!0,xn&&(window.scrollTo(0,0),window.visualViewport?.addEventListener(`resize`,Dn,F.passiveCapture),window.visualViewport?.addEventListener(`scroll`,Dn,F.passiveCapture),window.scrollTo(0,0))}else xn&&(window.visualViewport?.removeEventListener(`resize`,Dn,F.passiveCapture),window.visualViewport?.removeEventListener(`scroll`,Dn,F.passiveCapture)),document.documentElement.classList.remove(`q-document--prevent-scroll`,`q-document--clip-scroll`,`q-document--reserve-scrollbar`,`q-document--pin-body`),document.qScrollPrevented=!1,xn&&(t.style.left=yn,t.style.top=bn),xn&&window.location.pathname===Sn&&(an(window)!==hn||rn(window)!==gn)?window.scrollTo(hn,gn):wn.forEach(e=>{e()}),_n=void 0}function kn(e){let t=`add`;if(e===!0){if(mn++,Cn!==null){clearTimeout(Cn),Cn=null;return}if(mn>1)return}else{if(mn===0||(mn--,mn>0))return;if(t=`remove`,xn&&z.is.nativeMobile){Cn!==null&&clearTimeout(Cn),Cn=setTimeout(()=>{On(t),Cn=null},100);return}}On(t)}function An(){let e;return{preventBodyScroll(t){t!==e&&(e!==void 0||t)&&(e=t,kn(t))}}}var jn=[];function Mn(e){jn.at(-1)(e)}function Nn(e){jn.push(e),jn.length===1&&document.body.addEventListener(`focusin`,Mn)}function Pn(e){let t=jn.indexOf(e);t!==-1&&(jn.splice(t,1),jn.length===0&&document.body.removeEventListener(`focusin`,Mn))}var Fn=0,In={standard:`fixed-full flex-center`,top:`fixed-top justify-center`,bottom:`fixed-bottom justify-center`,right:`fixed-right items-center`,left:`fixed-left items-center`},Ln={standard:[`scale`,`scale`],top:[`slide-down`,`slide-up`],bottom:[`slide-up`,`slide-down`],right:[`slide-left`,`slide-right`],left:[`slide-right`,`slide-left`]},Rn=R({name:`QDialog`,inheritAttrs:!1,props:{...Be,...et,transitionShow:String,transitionHide:String,persistent:Boolean,autoClose:Boolean,allowFocusOutside:Boolean,noEscDismiss:Boolean,noBackdropDismiss:Boolean,noRouteDismiss:Boolean,noRefocus:Boolean,noFocus:Boolean,noShake:Boolean,seamless:Boolean,maximized:Boolean,fullWidth:Boolean,fullHeight:Boolean,square:Boolean,backdropFilter:String,position:{type:String,default:`standard`,validator:e=>[`standard`,`top`,`bottom`,`left`,`right`].includes(e)}},emits:[...$e,`shake`,`click`,`escapeKey`],setup(e,{slots:t,emit:r,attrs:i}){let a=x(),o=I(),l=n(null),d=n(null),f=s(!1),p=s(!1),m=s(null),h=null,g=!1,_=!1,v=!1,y=E(()=>!e.persistent&&!e.noRouteDismiss&&!e.seamless),{preventBodyScroll:b}=An(),{registerTransitionEnd:S}=Qe(e),{registerTick:C,removeTick:T}=ze(),{transitionProps:D,transitionStyle:ee}=Ze(e,()=>Ln[e.position][0],()=>Ln[e.position][1]),O=E(()=>ee()+(e.backdropFilter===void 0?``:`;backdrop-filter:${e.backdropFilter};-webkit-backdrop-filter:${e.backdropFilter}`)),{showPortal:k,hidePortal:A,portalIsOpening:M,renderPortal:te}=Ke(a,d,we,`dialog`),{captureRefocusTarget:ne,setRefocusTarget:re,clearRefocusTarget:ie,restoreFocus:ae,adoptRefocusTarget:N}=$t(e,()=>!e.noFocus&&M()),{hide:oe}=Ue({showing:f,hideOnRouteChange:y,handleShow:me,handleHide:he,handleRouteChange:ge,processOnMount:!0}),{addToHistory:se,removeFromHistory:ce}=Qt(f,oe,y),le=E(()=>`q-dialog__inner flex no-pointer-events q-dialog__inner--${e.maximized?`maximized`:`minimized`} q-dialog__inner--${e.position} ${In[e.position]}`+(p.value?` q-dialog__inner--animating`:``)+(m.value===null?``:` q-dialog__inner--keyboard`)+(e.fullWidth?` q-dialog__inner--fullwidth`:``)+(e.fullHeight?` q-dialog__inner--fullheight`:``)+(e.square?` q-dialog__inner--square`:``)),P=E(()=>f.value&&!e.seamless),ue=E(()=>e.autoClose?{onClick:z}:{}),L=E(()=>`q-dialog fullscreen no-pointer-events q-dialog--${P.value?`modal`:`seamless`}`);u(()=>e.maximized,e=>{f.value&&xe(e)}),u(P,e=>{b(e),e?(Nn(Ce),Je(be)):(Pn(Ce),We(be))});function de(){let{offsetTop:e,height:t,scale:n}=window.visualViewport,{innerHeight:r}=window;if(Math.abs(n-1)>.01||r-t<1){m.value=null;return}let i=Math.round(e),a=Math.round(r-e-t),o=m.value;(o===null||o.top!==i||o.bottom!==a)&&(m.value={top:i,bottom:a,height:Math.round(t)})}function fe(e){let t=e?`addEventListener`:`removeEventListener`;v=e,window.visualViewport?.[t](`resize`,de,F.passive),window.visualViewport?.[t](`scroll`,de,F.passive),e&&window.visualViewport!==void 0?de():m.value=null}function pe(){let t=m.value;return t===null?ee():`${ee()};--q-dialog-viewport-height:${t.height}px`+(e.position===`bottom`?``:`;top:${t.top}px`)+(e.position===`top`?``:`;bottom:${t.bottom}px`)}function me(t){se(),ne(),xe(e.maximized),k(),p.value=!0,o.platform.is.ios&&fe(!0),e.noFocus?T():(document.activeElement?.blur(),C(_e)),S(()=>{if(o.platform.is.ios){if(!e.seamless&&document.activeElement){let{top:e,bottom:t}=document.activeElement.getBoundingClientRect(),{innerHeight:n}=window,r=window.visualViewport?.height??n;e>0&&t>r/2&&(document.scrollingElement.scrollTop=Math.min(document.scrollingElement.scrollHeight-r,t>=n?1/0:Math.ceil(document.scrollingElement.scrollTop+t-r/2))),document.activeElement.scrollIntoView()}_=!0,d.value.click(),_=!1}k(!0),p.value=!1,r(`show`,t)})}function he(e){T(),ce(),R(!0),p.value=!0,A(),ae(e),S(()=>{A(!0),p.value=!1,r(`hide`,e)})}function ge(){ie()}function _e(e){Xe(()=>{let t=d.value;if(t!==null&&t.contains!==void 0){if(e!==void 0){let n=t.querySelector(e);if(n!==null){n.focus({preventScroll:!0});return}}t.contains(document.activeElement)||(t=t.querySelector(`[autofocus][tabindex], [data-autofocus][tabindex]`)||t.querySelector(`[autofocus] [tabindex], [data-autofocus] [tabindex]`)||t.querySelector(`[autofocus], [data-autofocus]`)||t,t.focus({preventScroll:!0}))}})}function ve(e){e&&typeof e.focus==`function`?e.focus({preventScroll:!0}):_e(),r(`shake`);let t=d.value;t!==null&&(t.classList.remove(`q-animate--scale`),t.classList.add(`q-animate--scale`),h!==null&&clearTimeout(h),h=setTimeout(()=>{h=null,d.value!==null&&(t.classList.remove(`q-animate--scale`),_e())},170))}function be(t){e.seamless||(e.persistent||e.noEscDismiss?!e.maximized&&!e.noShake&&ve():(r(`escapeKey`),oe(t)))}function R(t){h!==null&&(clearTimeout(h),h=null),(t||f.value)&&(xe(!1),v&&fe(!1),e.seamless||(b(!1),Pn(Ce),We(be))),t||ie()}function xe(e){e?g||=(Fn<1&&document.body.classList.add(`q-body--dialog`),Fn++,!0):g&&=(Fn<2&&document.body.classList.remove(`q-body--dialog`),Fn--,!1)}function z(e){_||(oe(e),r(`click`,e))}function Se(t){t.button===0&&(!e.persistent&&!e.noBackdropDismiss?oe(t):e.noShake||ve())}function Ce(t){!e.allowFocusOutside&&!M()&&!Oe(d.value,t.target)&&!He(d.value,t.target)&&_e(`[tabindex]:not([tabindex="-1"])`)}Object.assign(a.proxy,{focus:_e,shake:ve,__updateRefocusTarget:re,__adoptRefocusTarget:N,__getAriaModalEl:()=>P.value?l.value:null}),w(R);function we(){return c(`div`,{ref:l,role:`dialog`,"aria-modal":P.value?`true`:`false`,...i,class:[L.value,i.class]},[c(ye,{name:`q-transition--fade`,appear:!0},()=>P.value?c(`div`,{class:`q-dialog__backdrop fixed-full`,style:O.value,"aria-hidden":`true`,onMousedown:Se}):null),c(ye,D(),()=>f.value?c(`div`,{ref:d,class:le.value,style:pe(),tabindex:-1,...ue.value},j(t.default)):null)])}return te}}),zn=Me(`migration`,()=>{let e=s({state:`idle`});async function t(){try{let t=await U(`/api/migration/status`);if(!t.ok)return;e.value=await t.json()}catch{}}function n(t){e.value={...t}}return{status:e,fetchInitial:t,update:n}}),Bn={class:`text-h6`},Vn={class:`text-h6`},Hn={class:`text-h6 text-negative`},Un={class:`q-mt-sm`},Wn={key:0,class:`q-mt-md text-caption`},Gn={class:`q-mt-md text-caption`},Kn=k({__name:`MigrationOverlay`,setup(e){let{t:n}=nt(),r=zn(),a=E(()=>[`backing-up`,`running`,`error`].includes(r.status.state));return h(()=>{r.fetchInitial()}),(e,o)=>(d(),S(Rn,{modelValue:a.value,"onUpdate:modelValue":o[0]||=e=>a.value=e,persistent:``,"no-backdrop-dismiss":``},{default:y(()=>[b(Zt,{style:{"min-width":`400px`}},{default:y(()=>[t(r).status.state===`backing-up`?(d(),S(qt,{key:0},{default:y(()=>[O(`div`,Bn,i(t(n)(`migration.backing_up`)),1),b(se,{class:`q-mt-md`})]),_:1})):t(r).status.state===`running`?(d(),S(qt,{key:1},{default:y(()=>[O(`div`,Vn,i(t(n)(`migration.running`,{processed:t(r).status.processed,total:t(r).status.total})),1),b(Xt,{value:t(r).status.total>0?t(r).status.processed/t(r).status.total:0,class:`q-mt-md`},null,8,[`value`])]),_:1})):t(r).status.state===`error`?(d(),S(qt,{key:2},{default:y(()=>[O(`div`,Hn,i(t(n)(`migration.error`)),1),O(`div`,Un,i(t(r).status.errorMessage),1),t(r).status.backupPath?(d(),D(`div`,Wn,i(t(n)(`migration.backup_location`,{path:t(r).status.backupPath})),1)):C(``,!0),O(`div`,Gn,i(t(n)(`migration.retry`)),1)]),_:1})):C(``,!0)]),_:1})]),_:1},8,[`modelValue`]))}});function qn(e){if(e.codePointAt(0)!==111||e.codePointAt(1)!==110)return!1;let t=e.codePointAt(2);return t>=65&&t<=90}function Jn(e,t){let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(let r of n)if(e[r]!==t[r]||!(r in t))return!0;return!1}function Yn(){let e=x(),{attrs:t}=e,n={listeners:s({}),attributes:s({})};function r(){let r={},i={};for(let e in t)e!==`class`&&e!==`style`&&!qn(e)&&(r[e]=t[e]);for(let t in e.vnode.props)qn(t)&&(i[t]=e.vnode.props[t]);Jn(r,n.attributes.value)&&(n.attributes.value=r),Jn(i,n.listeners.value)&&(n.listeners.value=i)}return f(r),r(),n}function Xn({validate:e,resetValidation:t,requiresQForm:n}){let r=_(ne,!1);if(r!==!1){let{props:n,proxy:i}=x();Object.assign(i,{validate:e,resetValidation:t}),u(()=>n.disable,e=>{e?(typeof t==`function`&&t(),r.unbindComponent(i)):r.bindComponent(i)}),h(()=>{n.disable||r.bindComponent(i)}),w(()=>{n.disable||r.unbindComponent(i)})}else n&&console.error(`Parent QForm not found on useFormChild()!`)}var Zn=/^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/,Qn=/^#[0-9a-fA-F]{4}([0-9a-fA-F]{4})?$/,$n=/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/,er=/^rgb\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5])\)$/,tr=/^rgba\(((0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),){2}(0|[1-9][\d]?|1[\d]{0,2}|2[\d]?|2[0-4][\d]|25[0-5]),(0(\.[\d]+)?|1(\.0+)?)\)$/,nr=/^-?[\d]+\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/,rr=/^([0-1]?\d|2[0-3]):[0-5]\d$/,ir=/^([0-1]?\d|2[0-3]):[0-5]\d:[0-5]\d$/,ar=/^([0-1]?\d|2[0-3]):[0-5]\d(:[0-5]\d)?$/,or=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,sr={date:e=>nr.test(e),time:e=>rr.test(e),fulltime:e=>ir.test(e),timeOrFulltime:e=>ar.test(e),email:e=>or.test(e),hexColor:e=>Zn.test(e),hexaColor:e=>Qn.test(e),hexOrHexaColor:e=>$n.test(e),rgbColor:e=>er.test(e),rgbaColor:e=>tr.test(e),rgbOrRgbaColor:e=>er.test(e)||tr.test(e),hexOrRgbColor:e=>Zn.test(e)||er.test(e),hexaOrRgbaColor:e=>Qn.test(e)||tr.test(e),anyColor:e=>$n.test(e)||er.test(e)||tr.test(e)},cr=[!0,!1,`ondemand`],lr={modelValue:{},error:{type:Boolean,default:null},errorMessage:String,noErrorIcon:Boolean,rules:Array,reactiveRules:Boolean,lazyRules:{type:[Boolean,String],default:!1,validator:e=>cr.includes(e)}};function ur(e,t){let{props:n,proxy:r}=x(),i=s(!1),a=s(null),o=s(!1);Xn({validate:y,resetValidation:v});let c=0,l,d=!1,f=!1,p=E(()=>n.rules!==void 0&&n.rules!==null&&n.rules.length!==0),m=E(()=>!n.disable&&p.value&&!t.value),h=E(()=>n.error===!0||i.value),g=E(()=>typeof n.errorMessage==`string`&&n.errorMessage.length!==0?n.errorMessage:a.value);u(()=>n.modelValue,()=>{o.value=!0,m.value&&(n.lazyRules===!1||n.lazyRules===!0&&i.value)&&b()});function _(){n.lazyRules!==`ondemand`&&m.value&&o.value&&b()}u(()=>n.reactiveRules,e=>{e?l===void 0&&(l=u(()=>n.rules,_,{immediate:!0,deep:!0})):l!==void 0&&(l(),l=void 0)},{immediate:!0}),u(()=>n.lazyRules,_),u(e,e=>{e?o.value=!0:n.lazyRules!==`ondemand`&&(m.value?b():!n.disable&&p.value&&t.value&&(f=!0))});function v(){c++,t.value=!1,o.value=!1,i.value=!1,a.value=null,f=!1,b.cancel()}function y(e=n.modelValue){if(n.disable||!p.value)return!0;let r=++c,s=n.modelValue;f=!1;let l=()=>{let e=f;f=!1,!d&&n.modelValue!==s&&m.value&&n.lazyRules!==`ondemand`&&(n.lazyRules===!1||i.value||e)&&b()},u=t.value?()=>{}:()=>{o.value=!0},h=(e,n)=>{e&&u(),i.value=e,a.value=n||null,t.value=!1},g=[];for(let t=0;t<n.rules.length;t++){let r=n.rules[t],i;if(typeof r==`function`?i=r(e,sr):typeof r==`string`&&(sr[r]===void 0?(console.error(`Unknown validation pattern rule: "${r}"`),i=!1):i=sr[r](e)),i===!1||typeof i==`string`)return h(!0,i),!1;i!==!0&&i!==void 0&&g.push(i)}return g.length===0?(h(!1),!0):(t.value=!0,Promise.all(g).then(e=>{if(e===void 0||!Array.isArray(e)||e.length===0)return r===c&&(h(!1),l()),!0;let t=e.find(e=>e===!1||typeof e==`string`);return r===c&&(h(t!==void 0,t),l()),t===void 0},e=>(r===c&&(console.error(e),h(!0),l()),!1)))}let b=M(y,0);return w(()=>{d=!0,l?.(),b.cancel()}),Object.assign(r,{resetValidation:v,validate:y}),L(r,`hasError`,()=>h.value),{isDirtyModel:o,hasRules:p,hasError:h,errorMessage:g,validate:y,resetValidation:v}}function dr(e){return e!=null&&String(e).length!==0}var fr={...Ne,...lr,label:String,stackLabel:Boolean,hint:String,hideHint:Boolean,prefix:String,suffix:String,labelColor:String,color:String,bgColor:String,filled:Boolean,outlined:Boolean,borderless:Boolean,standout:[Boolean,String],square:Boolean,loading:Boolean,labelSlot:Boolean,bottomSlots:Boolean,hideBottomSpace:Boolean,rounded:Boolean,dense:Boolean,itemAligned:Boolean,counter:Boolean,clearable:Boolean,clearIcon:String,disable:Boolean,readonly:Boolean,autofocus:Boolean,for:String,maxlength:[Number,String]},pr=[`update:modelValue`,`clear`,`focus`,`blur`];function mr({requiredForAttr:e=!0,tagProp:t,changeEvent:r=!1}={}){let{props:i}=x(),a=Fe(i,I()),o=Ye({required:e,getValue:()=>i.for});return{requiredForAttr:e,changeEvent:r,tag:t?{get value(){return i.tag}}:{value:`label`},isDark:a,editable:E(()=>!i.disable&&!i.readonly),innerLoading:s(!1),focused:s(!1),hasPopupOpen:!1,splitAttrs:Yn(),targetUid:o,rootRef:n(null),targetRef:n(null),controlRef:n(null)}}var hr={class:`q-field__prepend q-field__marginal row no-wrap items-center`,key:`prepend`,onClick:N},gr={class:`q-field__append q-field__marginal row no-wrap items-center`,key:`append`,onClick:N},_r=`input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), a[href], [tabindex]:not([disabled]), [contenteditable]:not([contenteditable="false"])`,vr={class:`q-field__control-container col relative-position row no-wrap q-anchor--skip`},yr={class:`q-field__prefix no-pointer-events row items-center`},br={class:`q-field__suffix no-pointer-events row items-center`},xr={class:`q-field__inner relative-position col self-stretch`},Sr={class:`q-field__before q-field__marginal row no-wrap items-center`,onClick:N},Cr={class:`q-field__after q-field__marginal row no-wrap items-center`,onClick:N},wr={};function Tr(e,t){return t.focused.value&&typeof e.standout==`string`&&e.standout.length!==0}function Er(e,t){return t===null?null:c(`div`,{key:e,class:`q-field__append q-field__marginal row no-wrap items-center q-anchor--skip`},t)}function Dr(e){let{props:t,emit:n,slots:r,attrs:i,proxy:a}=x(),o=I(),s=null;e.hasValue===void 0&&(e.hasValue=E(()=>dr(t.modelValue))),e.emitValue===void 0&&(e.emitValue=e=>{n(`update:modelValue`,e)}),e.controlEvents===void 0&&(e.controlEvents={onFocusin:re,onFocusout:ie,onPopupShow:ae,onPopupHide:oe}),Object.assign(e,{clearValue:ce,onControlFocusin:re,onControlFocusout:ie,focus:M}),e.computedCounter===void 0&&(e.computedCounter=E(()=>{if(t.counter){let e=typeof t.modelValue==`string`||typeof t.modelValue==`number`?String(t.modelValue).length:Array.isArray(t.modelValue)?t.modelValue.length:0,n=t.maxlength===void 0?t.maxValues:t.maxlength;return e+(n===void 0?``:` / `+n)}}));let{isDirtyModel:l,hasRules:u,hasError:d,errorMessage:f,resetValidation:g}=ur(e.focused,e.innerLoading),_=E(()=>d.value&&e.targetUid.value?`${e.targetUid.value}_error`:void 0);function v(e){if(d.value!==!0)return wr;let n={"aria-invalid":`true`};return _.value!==void 0&&(!t.hideBottomSpace||t.counter||r.counter!==void 0||f.value!==null||r.error!==void 0)&&(n[`aria-errormessage`]=e?.[`aria-errormessage`]===void 0?_.value:e[`aria-errormessage`],n[`aria-describedby`]=e?.[`aria-describedby`]===void 0?_.value:`${e[`aria-describedby`]} ${_.value}`),n}Object.assign(e,{hasError:d,errorMessage:f,errorMessageId:_,getErrorAriaAttrs:v});let y=e.floatingLabel===void 0?E(()=>t.stackLabel||e.focused.value||e.hasValue.value):E(()=>t.stackLabel||e.focused.value||e.floatingLabel.value),b=E(()=>t.bottomSlots||t.hint!==void 0||u.value||t.counter||t.error!==null),S=E(()=>`q-field row no-wrap items-start q-field--`+(t.filled?`filled`:t.outlined?`outlined`:t.borderless?`borderless`:t.standout?`standout`:`standard`)+(e.fieldClass===void 0?``:` ${e.fieldClass.value}`)+(t.rounded?` q-field--rounded`:``)+(t.square?` q-field--square`:``)+(y.value?` q-field--float`:``)+(D.value?` q-field--labeled`:``)+(t.dense?` q-field--dense`:``)+(t.itemAligned?` q-field--item-aligned q-item-type`:``)+(e.isDark()?` q-field--dark`:``)+(e.getControl===void 0?` q-field--auto-height`:``)+(e.focused.value?` q-field--focused`:``)+(d.value?` q-field--error`:Tr(t,e)?` q-field--standout-custom`:``)+(d.value||e.focused.value?` q-field--highlighted`:``)+(!t.hideBottomSpace&&b.value?` q-field--with-bottom`:``)+(t.disable?` q-field--disabled`:t.readonly?` q-field--readonly`:``)),C=E(()=>`q-field__control relative-position row no-wrap`+(t.bgColor===void 0?``:` bg-${t.bgColor}`)+(d.value?` text-negative`:Tr(t,e)?` ${t.standout}`:t.color===void 0?``:` text-${t.color}`)),D=E(()=>t.labelSlot||t.label!==void 0),ee=E(()=>`q-field__label no-pointer-events absolute ellipsis`+(t.labelColor!==void 0&&!d.value?` text-${t.labelColor}`:``)),O=E(()=>L({id:e.targetUid.value,editable:e.editable.value,focused:e.focused.value,floatingLabel:y.value,modelValue:t.modelValue,emitValue:e.emitValue,ariaInvalid:d.value===!0?`true`:void 0,ariaDescribedby:_.value,ariaErrormessage:_.value},`field`,()=>e.rootRef.value)),k=E(()=>{let n={};return e.targetUid.value&&(n.for=e.targetUid.value),t.disable&&(n[`aria-disabled`]=`true`),n});function A(){let t=document.activeElement,n=e.targetRef?.value;n&&(t===null||t.id!==e.targetUid.value)&&(n.hasAttribute(`tabindex`)||(n=n.querySelector(`[tabindex]`)),n!==t&&n?.focus({preventScroll:!0}))}function M(){Xe(A)}function te(t){let n=t.target,r=e.targetUid.value===null?null:document.getElementById(e.targetUid.value);if(!(r!==null&&n.contains(r)&&(r.focus({preventScroll:!0}),document.activeElement===r))){for(let e of n.querySelectorAll(_r))if(e.focus({preventScroll:!0}),document.activeElement===e)return}}function ne(){qe(A);let t=document.activeElement;t!==null&&e.rootRef.value.contains(t)&&t.blur()}function re(r){s!==null&&(clearTimeout(s),s=null),!t.disable&&!e.focused.value&&(e.focused.value=!0,n(`focus`,r))}function ie(t,r){s!==null&&clearTimeout(s),s=setTimeout(()=>{s=null,!(document.hasFocus()&&(e.hasPopupOpen||e.controlRef===void 0||e.controlRef.value===null||e.controlRef.value.contains(document.activeElement)))&&(e.focused.value&&(e.focused.value=!1,n(`blur`,t)),r?.())},0)}function ae(t){e.hasPopupOpen=!0,re(t)}function oe(t){e.hasPopupOpen=!1,ie(t)}function ce(r){De(r),o.platform.is.mobile?e.rootRef.value.contains(document.activeElement)&&document.activeElement.blur():(e.targetRef?.value||e.rootRef.value).focus(),t.type===`file`&&(e.inputRef.value.value=null),e.onClear?.(),n(`update:modelValue`,null),e.changeEvent&&n(`change`,null),n(`clear`,t.modelValue),m(()=>{let e=l.value;g(),l.value=e})}function le(e){[13,32].includes(e.keyCode)&&ce(e)}function P(){let n=[];r.prepend!==void 0&&n.push(c(`div`,hr,r.prepend())),n.push(c(`div`,vr,F())),d.value&&!t.noErrorIcon&&n.push(Er(`error`,[c(ve,{name:o.iconSet.field.error,color:`negative`})]));let i=t.loading||e.innerLoading.value?r.loading===void 0?e.shouldHideLoadingIndicator?.()?null:[c(se,{color:t.color})]:r.loading():null;return i===null?t.clearable&&e.hasValue.value&&e.editable.value&&n.push(Er(`inner-clearable-append`,[c(ve,{class:`q-field__focusable-action`,name:t.clearIcon||o.iconSet.field.clear,tabindex:0,role:`button`,"aria-hidden":`false`,"aria-label":o.lang.label.clear,onKeyup:le,onClick:ce})])):n.push(Er(`inner-loading-append`,i)),r.append!==void 0&&n.push(c(`div`,gr,r.append())),e.getInnerAppend!==void 0&&n.push(Er(`inner-append`,e.getInnerAppend())),e.getControlChild!==void 0&&n.push(e.getControlChild()),n}function F(){let n=[];return t.prefix!==void 0&&t.prefix!==null&&n.push(c(`div`,yr,t.prefix)),e.getShadowControl!==void 0&&e.hasShadow.value&&n.push(e.getShadowControl()),D.value&&n.push(c(`div`,{class:ee.value},j(r.label,t.label))),e.getControl===void 0?r.rawControl===void 0?r.control!==void 0&&n.push(c(`div`,{ref:e.targetRef,class:`q-field__native row`,tabindex:-1,...e.splitAttrs.attributes.value,"data-autofocus":t.autofocus||void 0,onFocus:te},r.control(O.value))):n.push(r.rawControl()):n.push(e.getControl()),t.suffix!==void 0&&t.suffix!==null&&n.push(c(`div`,br,t.suffix)),n.concat(j(r.default))}let ue=null,de=!1;function fe(){let n,i;d.value?f.value===null?(n=j(r.error),i=`q--slot-error`):(n=[c(`div`,{role:`alert`},f.value)],i=`q--slot-error-${f.value}`):(!t.hideHint||e.focused.value)&&(t.hint===void 0?(n=j(r.hint),i=`q--slot-hint`):(n=[c(`div`,t.hint)],i=`q--slot-hint-${t.hint}`));let a=t.counter||r.counter!==void 0;if(!t.hideBottomSpace||a||n!==void 0)return i!==ue&&(de=ue!==null,ue=i),c(`div`,{class:`q-field__bottom row items-start q-field__bottom--`+(t.hideBottomSpace?`stale`:`animated`),onClick:N},[c(`div`,{key:i,id:d.value===!0?_.value:void 0,class:`q-field__messages col`+(de&&!t.hideBottomSpace?` q-field__messages--animated`:``)},n),a?c(`div`,{class:`q-field__counter`},r.counter===void 0?e.computedCounter.value:r.counter()):null])}let pe=!1;return p(()=>{pe=!0}),T(()=>{pe&&t.autofocus&&a.focus()}),t.autofocus&&h(()=>{a.focus()}),w(()=>{s!==null&&clearTimeout(s)}),Object.assign(a,{focus:M,blur:ne}),function(){let n=e.getControl===void 0&&r.control===void 0?{...e.splitAttrs.attributes.value,"data-autofocus":t.autofocus||void 0,...k.value}:k.value;return c(e.tag.value,{ref:e.rootRef,class:[S.value,i.class],style:i.style,...n},[r.before===void 0?null:c(`div`,Sr,r.before()),c(`div`,xr,[c(`div`,{ref:e.controlRef,class:C.value,tabindex:-1,...e.controlEvents},P()),b.value?fe():null]),r.after===void 0?null:c(`div`,Cr,r.after())])}}var Or={date:`####/##/##`,datetime:`####/##/## ##:##`,time:`##:##`,fulltime:`##:##:##`,phone:`(###) ### - ####`,card:`#### #### #### ####`},kr={"[\\d]":e=>{let t=e.codePointAt(0);return t>47&&t<58},"[a-zA-Z]":e=>{let t=e.codePointAt(0);return t>64&&t<91||t>96&&t<123},"[0-9a-zA-Z]":e=>{let t=e.codePointAt(0);return t>47&&t<58||t>64&&t<91||t>96&&t<123}},{tokenMap:Ar,tokenKeys:jr}=Mr({"#":{pattern:`[\\d]`,negate:`[^\\d]`},S:{pattern:`[a-zA-Z]`,negate:`[^a-zA-Z]`},N:{pattern:`[0-9a-zA-Z]`,negate:`[^0-9a-zA-Z]`},A:{pattern:`[a-zA-Z]`,negate:`[^a-zA-Z]`,transform:e=>e.toLocaleUpperCase()},a:{pattern:`[a-zA-Z]`,negate:`[^a-zA-Z]`,transform:e=>e.toLocaleLowerCase()},X:{pattern:`[0-9a-zA-Z]`,negate:`[^0-9a-zA-Z]`,transform:e=>e.toLocaleUpperCase()},x:{pattern:`[0-9a-zA-Z]`,negate:`[^0-9a-zA-Z]`,transform:e=>e.toLocaleLowerCase()}});function Mr(e){let t=Object.keys(e),n={};return t.forEach(t=>{let r=e[t],i;if(Object.hasOwn(kr,r.pattern))i=kr[r.pattern];else{let e=new RegExp(r.pattern);i=t=>e.test(t)}n[t]={...r,test:i}}),{tokenMap:n,tokenKeys:t}}function Nr(e){return RegExp("\\\\([^.*+?^${}()|([\\]])|([.*+?^${}()|[\\]])|(["+e.join(``)+`])|(.)`,`g`)}var Pr=[`insertText`,`deleteContentBackward`,`deleteContentForward`,`deleteWordBackward`,`deleteWordForward`,`deleteByCut`],Fr=/[.*+?^${}()|[\]\\]/g,Ir=Nr(jr),q=String.fromCodePoint(1),Lr={mask:String,reverseFillMask:Boolean,fillMask:[Boolean,String],unmaskedValue:Boolean,maskTokens:Object};function Rr(e,t,n,r,i){let a,o,c,l,d,f,p,h=E(()=>{if(e.maskTokens===void 0||e.maskTokens===null)return{tokenMap:Ar,tokenRegexMask:Ir};let{tokenMap:t}=Mr(e.maskTokens),n={...Ar,...t};return{tokenMap:n,tokenRegexMask:Nr(Object.keys(n))}}),g=s(null),_=s(y());function v(){return e.autogrow||[`textarea`,`text`,`search`,`url`,`tel`,`password`].includes(e.type)}u(()=>e.type+e.autogrow,x),u(()=>e.mask,n=>{if(n!==void 0)w(_.value,!0);else{let n=M(g.value?te(_.value,p):_.value);x(),e.modelValue!==n&&t(`update:modelValue`,n)}}),u(()=>e.fillMask+e.reverseFillMask,()=>{g.value&&w(_.value,!0)}),u(()=>e.unmaskedValue,()=>{g.value&&w(_.value)}),u(()=>e.maskTokens,()=>{g.value&&w(_.value,!0)},{deep:!0});function y(){if(x(),g.value){let t=k(M(e.modelValue));return p=t.length,e.fillMask===!1?t:ne(t)}return p=0,e.modelValue}function b(e){if(e<a.length)return a.slice(-e);let t=``,n=a,r=n.indexOf(q);if(r!==-1){for(let r=e-n.length;r>0;r--)t+=q;n=n.slice(0,r)+t+n.slice(r)}return n}function x(){if(g.value=e.mask!==void 0&&e.mask.length!==0&&v(),!g.value){l=void 0,a=``,o=``;return}let t=Or[e.mask]===void 0?e.mask:Or[e.mask],n=typeof e.fillMask==`string`&&e.fillMask.length!==0?e.fillMask.slice(0,1):`_`,r=n.replace(Fr,String.raw`\$&`),i=[],s=[],u=[],d=e.reverseFillMask,f=``,p=``;t.replace(h.value.tokenRegexMask,(e,t,n,r,a)=>{if(r!==void 0){let e=h.value.tokenMap[r];u.push(e),p=e.negate,d&&=(s.push({c:e,overflow:!0}),!1),s.push({c:e});return}if(n!==void 0)f=`\\`+(n===`\\`?``:n),u.push(n);else{let e=t===void 0?a:t;f=e===`\\`?String.raw`\\\\`:e.replace(Fr,String.raw`\\$&`),u.push(e)}i.push(`([^`+f+`]+)?`+f+`?`)});let m=[...new Set(u.filter(e=>typeof e!=`string`).map(({pattern:e})=>e))],_=RegExp(`^`+i.join(``)+`(`+(f===``?`.`:`[^`+f+`]`)+`+)?`+(f===``?``:`[`+f+`]*`)+`$`),y=s.length-1,b=m.length===1?p:`(?:`+m.map(e=>`(?!`+e+`)`).join(``)+String.raw`[\s\S])`,x=({c:e,overflow:t})=>t===!0?`(?:`+b+`+)?(`+e.pattern+`+)?(?:`+b+`+)?(`+e.pattern+`+)?`:`(?:`+b+`+)?(`+e.pattern+`)?`,S=s.map((t,n)=>{let i=x(t);return n===0&&e.reverseFillMask?RegExp(`^`+r+`*`+i):RegExp(n===y?`^`+i+`(`+(p===``?`.`:p)+`+)?`+(e.reverseFillMask?`$`:r+`*`):`^`+i)});c=u,l=t=>{let n=_.exec(e.reverseFillMask?t:t.slice(0,u.length+1));n!==null&&(t=n.slice(1).join(``));let r=[],i=S.length;for(let e=0,n=t;e<i;e++){let t=S[e].exec(n);if(t===null)break;n=n.slice(t.shift().length),r.push(...t)}return r.length===0?t:r.join(``)},a=u.map(e=>typeof e==`string`?e:q).join(``),o=a.split(q).join(n)}function S(t,n){let r=t.length,i=e.reverseFillMask?b(r):a,o=e.reverseFillMask?c.length-r:0,s=e.reverseFillMask?0:Math.min(n,r),l=e.reverseFillMask?r-n:r;return e=>{if(i[e]!==q||e>=s&&e<l)return!1;let n=c[o+e];return n===void 0||typeof n==`string`||n.test(t[e])}}function C(e,t,n){let r=S(e,n),i=0;for(let e=0;e<t;e++)r(e)&&i++;return i}function w(t,s,c){let l=r.value,u=l?.selectionEnd??0,f=l===null?0:l.value.length-u,h=s!==!0&&typeof _.value==`string`&&Pr.includes(c)?j(_.value,p,t,c):M(t),g;s===!0&&l!==null&&a.length!==0&&(g=C(l.value,u,p)),s===!0&&x();let v=k(h,s),y=e.fillMask===!1?v:ne(v),b=v.length,S=_.value!==y,w=S||b!==p;p=b;let T=e.fillMask!==!1&&b===0;l!==null&&l.value!==y&&(l.value=y),S&&(_.value=y),l!==null&&document.activeElement===l&&m(()=>{if(T){let t=e.reverseFillMask?o.length:0;l.setSelectionRange(t,t,`forward`);return}if(g!==void 0){let e=0,t=0;for(;e<y.length&&t<g;)t=C(y,e+1,b),e++;l.setSelectionRange(e,e,`forward`);return}if(c===`insertFromPaste`&&!e.reverseFillMask){let e=l.selectionEnd,t=u-1;for(let n=d;n<=t&&n<e;n++)a[n]!==q&&t++;D.right(l,t);return}if([`deleteContentBackward`,`deleteContentForward`].includes(c)){let t=e.reverseFillMask?u===0?+(y.length>v.length):Math.max(0,y.length-(T?0:Math.min(v.length,f)+1))+1:u;l.setSelectionRange(t,t,`forward`);return}if(e.reverseFillMask){if(w){let e=Math.max(0,y.length-(T?0:Math.min(v.length,f+1)));e===1&&u===1?l.setSelectionRange(e,e,`forward`):D.rightReverse(l,e)}else{let e=y.length-f;l.setSelectionRange(e,e,`backward`)}}else if(w){let e=Math.max(0,a.indexOf(q),Math.min(v.length,u)-1);D.right(l,e)}else{let e=u-1;D.right(l,e)}});let E=e.unmaskedValue?M(v):y;String(e.modelValue)!==E&&(e.modelValue!==null||E!==``)?n(E,!0):i!==void 0&&i()}function T(e,t,n){let r=k(M(e.value));t=Math.max(0,a.indexOf(q),Math.min(r.length,t)),d=t,e.setSelectionRange(t,n,`forward`)}let D={left(e,t){let n=!a.slice(t-1).includes(q),r=Math.max(0,t-1);for(;r>=0;r--)if(a[r]===q){t=r,n&&t++;break}if(r<0&&a[t]!==void 0&&a[t]!==q)return D.right(e,0);t>=0&&e.setSelectionRange(t,t,`backward`)},right(e,t){let n=e.value.length,r=Math.min(n,t+1);for(;r<=n;r++)if(a[r]===q){t=r;break}else a[r-1]===q&&(t=r);if(r>n&&a[t-1]!==void 0&&a[t-1]!==q)return D.left(e,n);e.setSelectionRange(t,t,`forward`)},leftReverse(e,t){let n=b(e.value.length),r=Math.max(0,t-1);for(;r>=0;r--)if(n[r-1]===q){t=r;break}else if(n[r]===q&&(t=r,r===0))break;if(r<0&&n[t]!==void 0&&n[t]!==q)return D.rightReverse(e,0);t>=0&&e.setSelectionRange(t,t,`backward`)},rightReverse(e,t){let n=e.value.length,r=b(n),i=!r.slice(0,t+1).includes(q),a=Math.min(n,t+1);for(;a<=n;a++)if(r[a-1]===q){t=a,t>0&&i&&t--;break}if(a>n&&r[t-1]!==void 0&&r[t-1]!==q)return D.leftReverse(e,n);e.setSelectionRange(t,t,`forward`)}};function ee(e){t(`click`,e),f=void 0}function O(n){if(t(`keydown`,n),n.defaultPrevented||n.altKey||le(n))return;let i=r.value,a=i.selectionStart,o=i.selectionEnd;if(n.shiftKey||(f=void 0),n.keyCode===37||n.keyCode===39){n.shiftKey&&f===void 0&&(f=i.selectionDirection===`forward`?a:o);let t=D[(n.keyCode===39?`right`:`left`)+(e.reverseFillMask?`Reverse`:``)];if(n.preventDefault(),t(i,f===a?o:a),n.shiftKey){let e=i.selectionStart;i.setSelectionRange(Math.min(f,e),Math.max(f,e),`forward`)}}else n.keyCode===8&&!e.reverseFillMask&&a===o?(D.left(i,a),i.setSelectionRange(i.selectionStart,o,`backward`)):n.keyCode===46&&e.reverseFillMask&&a===o&&(D.rightReverse(i,o),i.setSelectionRange(a,i.selectionEnd,`forward`))}function k(t,n){if(t==null||t===``)return``;if(e.reverseFillMask)return A(t,n);let r=c,i=0,a=``;for(let e=0;e<r.length;e++){let o=t[i],s=r[e];if(typeof s==`string`)a+=s,n===!0&&o===s&&i++;else if(o!==void 0&&s.test(o))a+=s.transform===void 0?o:s.transform(o),i++;else return a}return a}function A(e,t){let n=c,r=a.indexOf(q),i=e.length-1,o=``,s=``;for(let a=n.length-1;a>=0&&i!==-1;a--){let c=n[a],l=e[i];if(typeof c==`string`)s=c+s,t===!0&&l===c&&i--;else if(l!==void 0&&c.test(l)){o=s+o,s=``;do o=(c.transform===void 0?l:c.transform(l))+o,i--,l=e[i];while(r===a&&l!==void 0&&c.test(l))}else return o}return o}function j(t,n,r,i){let a=t.length,o=r.length,s=Math.min(a,o),l=0;for(;l<s&&t[l]===r[l];)l++;let u=0;for(;u<s-l&&t[a-1-u]===r[o-1-u];)u++;let d=S(t,n),f=``,p=``;for(let e=0;e<l;e++)d(e)&&(f+=t[e]);for(let e=a-u;e<a;e++)d(e)&&(p+=t[e]);let m=``,h=r.slice(l,o-u);if(h.length!==0){if(e.reverseFillMask)for(let e of h)c.some(t=>typeof t!=`string`&&t.test(e))&&(m+=e);else{let e=c.filter(e=>typeof e!=`string`),t=f.length;for(let n of h)e[t]!==void 0&&e[t].test(n)&&(m+=n,t++)}}else if(!e.reverseFillMask&&l+u<a){let e=!1;for(let t=l;t<a-u;t++)if(d(t)){e=!0;break}e||(i===`deleteContentForward`?p=p.slice(1):f=f.slice(0,-1))}return f+m+p}function M(e){return typeof e!=`string`||l===void 0?typeof e==`number`?l(String(e)):e:l(e)}function te(t,n){return n>=t.length?t:e.reverseFillMask?t.slice(t.length-n):t.slice(0,n)}function ne(t){return o.length-t.length<=0?t:e.reverseFillMask&&t.length!==0?o.slice(0,-t.length)+t:t+o.slice(t.length)}return{innerValue:_,hasMask:g,moveCursorForPaste:T,updateMaskValue:w,onMaskedKeydown:O,onMaskedClick:ee}}var zr=typeof CSS>`u`||CSS.supports(`field-sizing`,`content`)?void 0:Br;function Br(e,t,n,r){let i=null;function a(){i!==null&&(cancelAnimationFrame(i),i=null)}function o(){i===null&&(i=requestAnimationFrame(()=>{i=null;let e=n.value;if(e!==null){let t=e.parentNode.style,{scrollTop:n}=e,{overflowY:i,maxHeight:a}=r.platform.is.firefox?{}:window.getComputedStyle(e),o=i!==void 0&&i!==`scroll`;o&&(e.style.overflowY=`hidden`),t.marginBottom=e.scrollHeight-1+`px`,e.style.height=`1px`,e.style.height=e.scrollHeight+`px`,o&&(e.style.overflowY=Number.parseInt(a,10)<e.scrollHeight?`auto`:`hidden`),t.marginBottom=``,e.scrollTop=n}}))}return u(()=>e.autogrow,e=>{if(e)m(o);else if(n.value!==null){a();let{style:e}=n.value;e.overflowY=``,e.height=t.rows>0?`auto`:``}}),u(()=>e.dense,()=>{e.autogrow&&m(o)}),h(()=>{e.autogrow&&o()}),w(a),o}function Vr(e,t){function n(){let t=e.modelValue;try{let e=new DataTransfer;return Object(t)===t&&(`length`in t?[...t]:[t]).forEach(t=>{e.items.add(t)}),{files:e.files}}catch{return{files:void 0}}}return E(t?()=>{if(e.type===`file`)return n()}:n)}var Hr=/[\u3000-\u303F\u3040-\u309F\u30A0-\u30FF\uFF00-\uFF9F\u4E00-\u9FAF\u3400-\u4DBF]/,Ur=/[\u4E00-\u9FFF\u3400-\u4DBF\u{20000}-\u{2A6DF}\u{2A700}-\u{2B73F}\u{2B740}-\u{2B81F}\u{2B820}-\u{2CEAF}\uF900-\uFAFF\u3300-\u33FF\uFE30-\uFE4F\uF900-\uFAFF\u{2F800}-\u{2FA1F}]/u,Wr=/[\u3131-\u314E\u314F-\u3163\uAC00-\uD7A3]/,Gr=/[a-z0-9_ -]$/i;function Kr(e){return function(t){if(t.type===`compositionend`||t.type===`change`){if(!t.target.qComposing)return;t.target.qComposing=!1,e(t)}else t.type===`compositionupdate`&&!t.target.qComposing&&typeof t.data==`string`&&(z.is.firefox?!Gr.test(t.data):Hr.test(t.data)||Ur.test(t.data)||Wr.test(t.data))&&(t.target.qComposing=!0)}}var qr=R({name:`QInput`,inheritAttrs:!1,props:{...fr,...Lr,...it,modelValue:[String,Number,FileList],modelModifiers:Object,shadowText:String,type:{type:String,default:`text`},debounce:[String,Number],autogrow:Boolean,inputClass:[Array,String,Object],inputStyle:[Array,String,Object]},emits:[...pr,`paste`,`change`,`keydown`,`click`,`animationend`],setup(e,{emit:t,attrs:r}){let{proxy:i}=x(),a=I(),o={},s=NaN,l=!1,d=!1,f=null,p,h=n(null),g=ot(e),{innerValue:_,hasMask:v,moveCursorForPaste:y,updateMaskValue:b,onMaskedKeydown:S,onMaskedClick:C}=Rr(e,t,le,h,()=>{P(),delete o.value}),T=Vr(e,!0),D=E(()=>dr(_.value)),ee=Kr(se);function O(e){if(v.value&&e.type===`compositionstart`){e.target.qComposing=!0;return}ee(e)}let k=mr({changeEvent:!0}),A=E(()=>e.type===`textarea`||e.autogrow),j=zr?.(e,r,h,a),M=E(()=>A.value||[`text`,`search`,`url`,`tel`,`password`].includes(e.type)),te=E(()=>{let t={...k.splitAttrs.listeners.value,onInput:se,onPaste:oe,onChange:ue,onBlur:de,onFocus:pe};return t.onCompositionstart=t.onCompositionupdate=t.onCompositionend=O,v.value&&(t.onKeydown=S,t.onClick=C),j&&e.autogrow&&(t.onAnimationend=ce),t}),ne=E(()=>{let t={tabindex:0,"data-autofocus":e.autofocus||void 0,rows:e.type===`textarea`?6:void 0,"aria-label":e.label,name:g(),...k.splitAttrs.attributes.value,id:k.targetUid.value,maxlength:e.maxlength,disabled:e.disable,readonly:e.readonly};return A.value||(t.type=e.type),e.autogrow&&(t.rows=1),t});u(()=>e.type,()=>{h.value&&(h.value.value=e.modelValue)}),u(()=>e.modelValue,t=>{if(p!==void 0&&(P(),l=!1,d=!1,delete o.value),v.value){if(d&&(d=!1,String(t)===s))return;b(t)}else _.value!==t&&(_.value=t,e.type===`number`&&Object.hasOwn(o,`value`)&&(l?l=!1:delete o.value),e.modelModifiers?.trim===!0&&Object.hasOwn(o,`value`)&&(typeof o.value!=`string`||o.value.trim()!==t)&&delete o.value);j&&e.autogrow&&m(j)});function re(){let e=document.activeElement;h.value!==null&&h.value!==e&&(e===null||e.id!==k.targetUid.value)&&h.value.focus({preventScroll:!0})}function ie(){Xe(re)}function ae(){qe(re);let e=document.activeElement;e!==null&&k.rootRef.value.contains(e)&&e.blur()}function N(){h.value?.select()}function oe(n){if(v.value&&e.reverseFillMask!==!0){let e=n.target;y(e,e.selectionStart,e.selectionEnd)}t(`paste`,n)}function se(n){if(!n||!n.target)return;if(e.type===`file`){t(`update:modelValue`,n.target.files);return}let r=n.target.value;if(n.target.qComposing){o.value=r;return}if(v.value)b(r,!1,n.inputType);else if(e.modelModifiers?.trim===!0&&(o.value=r),le(r),M.value&&n.target===document.activeElement){let{selectionStart:e,selectionEnd:t}=n.target;e!==void 0&&t!==void 0&&m(()=>{n.target===document.activeElement&&r.indexOf(n.target.value)===0&&n.target.setSelectionRange(e,t)})}j&&e.autogrow&&j()}function ce(e){t(`animationend`,e),j()}function le(n,r){p=()=>{f=null,e.type!==`number`&&(e.modelModifiers?.trim!==!0||v.value)&&Object.hasOwn(o,`value`)&&delete o.value,e.modelValue!==n&&s!==n&&(s=n,r===!0&&(d=!0),t(`update:modelValue`,n),m(()=>{s===n&&(s=NaN)})),p=void 0},e.type===`number`&&(l=!0,o.value=n);let i=()=>{v.value?delete o.value:o.value=n};e.modelModifiers?.lazy===!0?i():e.debounce===void 0?p():(f!==null&&clearTimeout(f),i(),f=setTimeout(p,e.debounce))}function P(){f!==null&&(clearTimeout(f),f=null),p=void 0}function F(){P(),l=!1,d=!1,delete o.value}function ue(e){O(e),f!==null&&(clearTimeout(f),f=null),p?.(),t(`change`,e.target.value)}function de(t){t!==void 0&&pe(t),f!==null&&(clearTimeout(f),f=null),p?.(),l=!1,d=!1,delete o.value,e.type!==`file`&&setTimeout(()=>{h.value!==null&&(h.value.value=_.value===void 0?``:_.value)},0)}function fe(){return Object.hasOwn(o,`value`)?o.value:_.value===void 0?``:_.value}w(()=>{de()}),Object.assign(k,{innerValue:_,fieldClass:E(()=>`q-${A.value?`textarea`:`input`}`+(e.autogrow?` q-textarea--autogrow`:``)),hasShadow:E(()=>e.type!==`file`&&typeof e.shadowText==`string`&&e.shadowText.length!==0),inputRef:h,emitValue:le,onClear:F,hasValue:D,floatingLabel:E(()=>D.value&&(e.type!==`number`||Number.isFinite(Number(_.value)))||dr(e.displayValue)),getControl:()=>{let t=ne.value;return c(A.value?`textarea`:`input`,{ref:h,class:[`q-field__native q-placeholder`,e.inputClass],style:e.inputStyle,...t,...k.getErrorAriaAttrs(t),...te.value,...e.type===`file`?T.value:{value:fe()}})},getShadowControl:()=>c(`div`,{class:`q-field__native q-field__shadow absolute-bottom no-pointer-events`+(A.value?``:` text-no-wrap`)},[c(`span`,{class:`invisible`},fe()),c(`span`,e.shadowText)])});let me=Dr(k);return Object.assign(i,{focus:ie,blur:ae,select:N,getNativeElement:()=>h.value}),L(i,`nativeEl`,()=>h.value),me}}),Jr=R({name:`QCardActions`,props:{...we,vertical:Boolean},setup(e,{slots:t}){let n=xe(e),r=E(()=>`q-card__actions ${n()} q-card__actions--${e.vertical?`vert column`:`horiz row`}`);return()=>c(`div`,{class:r.value},j(t.default))}}),Yr=`kobo:network-token`;function Xr(){try{return localStorage.getItem(Yr)}catch{return null}}function Zr(e){try{localStorage.setItem(Yr,e),window.dispatchEvent(new Event(`kobo:auth-token-changed`))}catch{}}function Qr(e){try{let t=new URL(e,window.location.origin);return t.origin===window.location.origin&&t.pathname.startsWith(`/api/`)}catch{return typeof e==`string`&&e.startsWith(`/api/`)}}function $r(e,t){return t?`${e}${e.includes(`?`)?`&`:`?`}token=${encodeURIComponent(t)}`:e}var ei=s(!1);function ti(){ei.value=!0}function ni(){ei.value=!1}var ri={class:`text-h6`},ii={class:`text-caption text-kobo-3 q-mt-sm`},ai=k({__name:`NetworkLoginDialog`,setup(e){let{t:n}=nt(),r=E({get:()=>ei.value,set:e=>{e||ni()}}),a=s(``),o=s(!1),c=s(!1),l=s(``);async function u(){let e=a.value.trim();if(e){o.value=!0,c.value=!1;try{let t=await je(`/api/settings/network/ping`,{headers:{"X-Kobo-Token":e}});if(t.ok){Zr(e),ni(),window.location.reload();return}l.value=t.status===401?n(`network.login.invalid`):n(`network.login.serverError`),c.value=!0}catch{l.value=n(`network.login.unreachable`),c.value=!0}finally{o.value=!1}}}return(e,s)=>(d(),S(Rn,{modelValue:r.value,"onUpdate:modelValue":s[1]||=e=>r.value=e,persistent:``},{default:y(()=>[b(Zt,{style:{"min-width":`320px`,"max-width":`90vw`}},{default:y(()=>[b(qt,null,{default:y(()=>[O(`div`,ri,i(t(n)(`network.login.title`)),1),O(`div`,ii,i(t(n)(`network.login.description`)),1)]),_:1}),b(qt,null,{default:y(()=>[b(qr,{modelValue:a.value,"onUpdate:modelValue":s[0]||=e=>a.value=e,label:t(n)(`network.login.tokenLabel`),placeholder:t(n)(`network.login.tokenPlaceholder`),error:c.value,"error-message":l.value,autofocus:``,dense:``,outlined:``,onKeyup:Ce(u,[`enter`])},null,8,[`modelValue`,`label`,`placeholder`,`error`,`error-message`])]),_:1}),b(Jr,{align:`right`},{default:y(()=>[b(Ee,{label:t(n)(`network.login.connect`),color:`primary`,loading:o.value,unelevated:``,onClick:u},null,8,[`label`,`loading`])]),_:1})]),_:1})]),_:1},8,[`modelValue`]))}}),oi=new WeakMap;function si(e){return oi.get(e)}function ci(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{...t}]))}function li(e){let t=new Set,n=u(()=>e.queuedMessages,()=>{for(let n of t)n(ci(e.queuedMessages))},{deep:!0,flush:`sync`});return{queue:(...t)=>e.queueMessage(...t),cancel:(...t)=>e.cancelQueuedMessage(...t),flush:(...t)=>e.flushQueuedMessage(...t),subscribe(n){return t.add(n),n(ci(e.queuedMessages)),()=>{t.delete(n)}},dispose(){n(),t.clear()}}}function ui(e,t){oi.set(e,t);let n=t.subscribe(t=>{e.queuedMessages=t});return()=>{n(),oi.delete(e)}}var di=Me(`templates`,{state:()=>({templates:[],defaultSlugs:[],loading:!1,loaded:!1}),getters:{isDefault:e=>t=>e.defaultSlugs.includes(t)},actions:{async fetchTemplates(){if(!this.loading){this.loading=!0;try{let e=await U(`/api/templates`);if(!e.ok)throw await H(e);let t=await e.json();this.templates=t.templates,this.defaultSlugs=t.defaultSlugs??[],this.loaded=!0}catch(e){console.error(`[templates store] fetchTemplates failed:`,e)}finally{this.loading=!1}}},async createTemplate(e){let t=await U(`/api/templates`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e)});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}let n=await t.json();return this.templates.push(n),n},async updateTemplate(e,t){let n=await U(`/api/templates/${encodeURIComponent(e)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}let r=await n.json(),i=this.templates.findIndex(t=>t.slug===e);return i>=0&&(this.templates[i]=r),r},async reloadDefaults(){let e=await U(`/api/templates/reload-defaults`,{method:`POST`});if(!e.ok){let t=await e.json().catch(()=>({}));throw Error(t.error??`HTTP ${e.status}`)}let t=await e.json();return t.added.length>0&&await this.fetchTemplates(),t},async deleteTemplate(e){let t=await Le(`/api/templates/${encodeURIComponent(e)}`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}this.templates=this.templates.filter(t=>t.slug!==e)},async resetToDefault(e){let t=await U(`/api/templates/${encodeURIComponent(e)}/reset-default`,{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({error:`Reset failed`}));throw Error(e.error??`Reset failed`)}let{template:n}=await t.json(),r=this.templates.findIndex(t=>t.slug===e);return r>=0?this.templates[r]=n:this.templates.push(n),n}}}),fi=R({name:`QAvatar`,props:{...ge,fontSize:String,color:String,textColor:String,icon:String,square:Boolean,rounded:Boolean},setup(e,{slots:t}){let n=E(()=>`q-avatar`+(e.color?` bg-${e.color}`:``)+(e.textColor?` text-${e.textColor} q-chip--colored`:``)+(e.square?` q-avatar--square`:e.rounded?` rounded-borders`:``)),r=E(()=>e.fontSize?{fontSize:e.fontSize}:null);return()=>{let i=e.icon===void 0?void 0:[c(ve,{name:e.icon})],a={class:n.value};return e.size!==void 0&&(a.style=A(e.size)),c(`div`,a,[c(`div`,{class:`q-avatar__content row flex-center overflow-hidden`,style:r.value},oe(t.default,i))])}}}),pi=0,mi={},hi={},gi={},_i={},vi=/^\s*$/,yi=[],bi=[void 0,null,!0,!1,``],xi=[`top-left`,`top-right`,`bottom-left`,`bottom-right`,`top`,`bottom`,`left`,`right`,`center`],Si=[`top-left`,`top-right`,`bottom-left`,`bottom-right`],Ci={positive:{icon:e=>e.iconSet.type.positive,color:`positive`},negative:{icon:e=>e.iconSet.type.negative,color:`negative`},warning:{icon:e=>e.iconSet.type.warning,color:`warning`,textColor:`dark`},info:{icon:e=>e.iconSet.type.info,color:`info`},ongoing:{group:!1,timeout:0,spinner:!0,color:`grey-8`}};function wi(e,t,n){if(!e)return Di(`parameter required`);let r,i={textColor:`white`};if(e.ignoreDefaults||Object.assign(i,mi),K(e)||(i.type&&Object.assign(i,Ci[i.type]),e={message:e}),Object.assign(i,Ci[e.type||i.type],e),typeof i.icon==`function`&&(i.icon=i.icon(t)),i.spinner=i.spinner?i.spinner===!0?se:a(i.spinner):!1,i.meta={hasMedia:!!(i.spinner||i.icon||i.avatar),hasText:Ei(i.message)||Ei(i.caption)},i.position){if(!xi.includes(i.position))return Di(`wrong position`,e)}else i.position=`bottom`;if(bi.includes(i.timeout))i.timeout=5e3;else{let t=Number.parseFloat(i.timeout);if(!Number.isFinite(t)||t<0)return Di(`wrong timeout`,e);i.timeout=t}i.timeout===0?i.progress=!1:i.progress&&(i.meta.progressClass=`q-notification__progress`+(i.progressClass?` ${i.progressClass}`:``),i.meta.progressStyle={animationDuration:`${i.timeout+1e3}ms`});let o=[...Array.isArray(e.actions)?e.actions:[],...!e.ignoreDefaults&&Array.isArray(mi.actions)?mi.actions:[],...Array.isArray(Ci[e.type]?.actions)?Ci[e.type].actions:[]],{closeBtn:s}=i;if(s&&o.push({label:typeof s==`string`?s:t.lang.label.close}),i.actions=o.map(({handler:e,noDismiss:t,...n})=>({flat:!0,...n,onClick:typeof e==`function`?()=>{e(),t||c()}:()=>{c()}})),i.multiLine===void 0&&(i.multiLine=i.actions.length>1),Object.assign(i.meta,{class:`q-notification row items-stretch q-notification--${i.multiLine?`multi-line`:`standard`}`+(i.color===void 0?``:` bg-${i.color}`)+(i.textColor===void 0?``:` text-${i.textColor}`)+(i.classes===void 0?``:` ${i.classes}`),wrapperClass:`q-notification__wrapper col relative-position border-radius-inherit `+(i.multiLine?`column no-wrap justify-center`:`row items-center`),contentClass:`q-notification__content row items-center`+(i.multiLine?``:` col`),leftClass:i.meta.hasText?`additional`:`single`,attrs:{role:`alert`,...i.attrs}}),i.group===!1?(i.group=void 0,i.meta.group=void 0):((i.group===void 0||i.group===!0)&&(i.group=[i.message,i.caption,i.multiLine,...i.actions.map(e=>`${e.label}*${e.icon}`)].join(`|`)),i.meta.group=i.group+`|`+i.position),i.actions.length===0?i.actions=void 0:i.meta.actionsClass=`q-notification__actions row items-center `+(i.multiLine?`justify-end`:`col-auto`)+(i.meta.hasMedia?` q-notification__actions--with-media`:``),n!==void 0){n.notif.meta.timer&&(clearTimeout(n.notif.meta.timer),n.notif.meta.timer=void 0),i.meta.uid=n.notif.meta.uid;let e=gi[i.position].value.indexOf(n.notif);gi[i.position].value[e]=i}else{let t=hi[i.meta.group];if(t===void 0){if(i.meta.uid=pi++,i.meta.badge=1,[`left`,`right`,`center`].includes(i.position))gi[i.position].value.splice(Math.floor(gi[i.position].value.length/2),0,i);else{let e=i.position.includes(`top`)?`unshift`:`push`;gi[i.position].value[e](i)}i.group!==void 0&&(hi[i.meta.group]=i)}else{if(t.meta.timer&&(clearTimeout(t.meta.timer),t.meta.timer=void 0),i.badgePosition!==void 0){if(!Si.includes(i.badgePosition))return Di(`wrong badgePosition`,e)}else i.badgePosition=`top-${i.position.includes(`left`)?`right`:`left`}`;i.meta.uid=t.meta.uid,i.meta.badge=t.meta.badge+1,i.meta.badgeClass=`q-notification__badge q-notification__badge--${i.badgePosition}`+(i.badgeColor===void 0?``:` bg-${i.badgeColor}`)+(i.badgeTextColor===void 0?``:` text-${i.badgeTextColor}`)+(i.badgeClass?` ${i.badgeClass}`:``);let n=gi[i.position].value.indexOf(t);gi[i.position].value[n]=hi[i.meta.group]=i}}let c=()=>{Ti(i),r=void 0};if(i.timeout>0&&(i.meta.timer=setTimeout(()=>{i.meta.timer=void 0,c()},i.timeout+1e3)),i.group!==void 0)return t=>{t===void 0?c():Di(`trying to update a grouped one which is forbidden`,e)};if(r={dismiss:c,config:e,notif:i},n!==void 0){Object.assign(n,r);return}return e=>{r!==void 0&&(e===void 0?r.dismiss():wi({...r.config,...e,group:!1,position:i.position},t,r))}}function Ti(e){e.meta.timer&&(clearTimeout(e.meta.timer),e.meta.timer=void 0);let t=gi[e.position].value.indexOf(e);if(t!==-1){e.group!==void 0&&delete hi[e.meta.group];let n=yi[String(e.meta.uid)];if(n){let{width:e,height:t}=getComputedStyle(n);n.style.left=`${n.offsetLeft}px`,n.style.width=e,n.style.height=t}gi[e.position].value.splice(t,1),typeof e.onDismiss==`function`&&e.onDismiss()}}function Ei(e){return e!=null&&!vi.test(e)}function Di(e,t){return console.error(`Notify: ${e}`,t),!1}function Oi(){return R({name:`QNotifications`,devtools:{hide:!0},setup(){return()=>c(`div`,{class:`q-notifications`},xi.map(e=>c(ke,{key:e,class:_i[e],tag:`div`,name:`q-notification--${e}`},()=>gi[e].value.map(e=>{let t=e.meta,n=[];if(t.hasMedia&&(e.spinner?n.push(c(e.spinner,{class:`q-notification__spinner q-notification__spinner--`+t.leftClass,color:e.spinnerColor,size:e.spinnerSize})):e.icon?n.push(c(ve,{class:`q-notification__icon q-notification__icon--`+t.leftClass,name:e.icon,color:e.iconColor,size:e.iconSize,role:`img`})):e.avatar&&n.push(c(fi,{class:`q-notification__avatar q-notification__avatar--`+t.leftClass},()=>c(`img`,{src:e.avatar,"aria-hidden":`true`})))),t.hasText){let t,r={class:`q-notification__message col`};if(e.html)r.innerHTML=e.caption?`<div>${e.message}</div><div class="q-notification__caption">${e.caption}</div>`:e.message;else{let n=[e.message];t=e.caption?[c(`div`,n),c(`div`,{class:`q-notification__caption`},[e.caption])]:n}n.push(c(`div`,r,t))}let r=[c(`div`,{class:t.contentClass},n)];return e.progress&&r.push(c(`div`,{key:`${t.uid}|p|${t.badge}`,class:t.progressClass,style:t.progressStyle})),e.actions&&r.push(c(`div`,{class:t.actionsClass},e.actions.map(e=>c(Ee,e)))),t.badge>1&&r.push(c(`div`,{key:`${t.uid}|${t.badge}`,class:e.meta.badgeClass,style:e.badgeStyle},[t.badge])),c(`div`,{ref:e=>{yi[String(t.uid)]=e},key:t.uid,class:t.class,...t.attrs},[c(`div`,{class:t.wrapperClass},r)])}))))}})}var ki={setDefaults(e){K(e)&&Object.assign(mi,e)},registerType(e,t){K(t)&&(Ci[e]=t)},install({$q:e,parentApp:t}){if(e.notify=this.create=t=>wi(t,e),e.notify.setDefaults=this.setDefaults,e.notify.registerType=this.registerType,e.config.notify!==void 0&&this.setDefaults(e.config.notify),!this.__installed){xi.forEach(e=>{gi[e]=s([]);let t=e===`left`||e===`center`||e===`right`?`center`:e.includes(`top`)?`top`:`bottom`,n=e.includes(`left`)?`start`:e.includes(`right`)?`end`:`center`;_i[e]=`q-notifications__list q-notifications__list--${t} fixed column no-wrap ${e===`left`||e===`right`?`items-${e===`left`?`start`:`end`} justify-center`:e===`center`?`flex-center`:`items-${n}`}`});let e=Se(`q-notify`);Ut(Oi(),t).mount(e)}}},Ai=class{constructor(){tt(this,`pending`,new Map)}wait(e,t,n){return new Promise((r,i)=>{let a=setTimeout(()=>o(Error(n)),3e4),o=e=>{clearTimeout(a),this.pending.delete(t),e?i(e):r()};this.pending.set(t,{workspaceId:e,finish:o})})}settle(e,t,n){let r=this.pending.get(t);r?.workspaceId===e&&r.finish(n)}disconnect(e){for(let t of this.pending.values())t.finish(Error(e))}},ji=new Map,Mi=s(0);function Ni(){Mi.value++}function Pi(e){e.reconnectTimer&&=(clearTimeout(e.reconnectTimer),void 0)}function Fi(e){let t=ji.get(e);t&&(Pi(t),t.ws&&(t.ws.onclose=null,t.ws.readyState===WebSocket.OPEN&&t.ws.close()),t.onDataDisposable?.dispose(),t.terminal.dispose(),ji.delete(e),Ni())}var Ii=5e3,Li=Me(`agent-stream`,()=>{let e=n(new Map),t=n(new Map),r=n(new Map),i=n(new Map),a=n(new Map),o=n(new Map),c=n(new Map),l=n(new Map),u=s(new Map),d=n(new Map);function f(e,t){p(e);let n=0;for(let[r,i]of d.value.get(e)??[])t(r)&&(n+=i);return n}function p(e){u.value.get(e)}function m(e){u.value.set(e,(u.value.get(e)??0)+1)}function h(e){return u.value.get(e)??0}function g(e){let t=l.value.get(e);return t||(t=new Set,l.value.set(e,t)),t}function _(e){return p(e),c.value.get(e)??!1}function v(e,t){(c.value.get(e)??!1)!==t&&(c.value.set(e,t),m(e))}function y(t){return p(t),e.value.get(t)??[]}function b(e){return p(e),t.value.get(e)??[]}function x(e){return p(e),r.value.get(e)??[]}function S(e){return p(e),i.value.get(e)??[]}function C(e){return p(e),a.value.get(e)}function w(e){return p(e),o.value.get(e)??!0}function T(n,o,s,c,l,u=!0){let f=e.value.get(n)??[],p=t.value.get(n)??[],h=r.value.get(n)??[],_=i.value.get(n)??[],v=g(n);if(c&&v.has(c))return;if(u){let e=d.value.get(n)??new Map;e.set(l??null,(e.get(l??null)??0)+1),d.value.set(n,e)}let y=f.length===0;f.push(o),p.push(s??new Date().toISOString()),h.push(l??null),_.push(c??null),c&&v.add(c),e.value.set(n,f),t.value.set(n,p),r.value.set(n,h),i.value.set(n,_),y&&c&&a.value.set(n,c),E(n,f,p,h,_),m(n)}function E(e,t,n,r,i){let s=t.length-Ii;if(s<=0)return;let c=s+500-1,l=i.slice(0,c),u=g(e);for(let e of l)e&&u.delete(e);t.splice(0,c),n.splice(0,c),r.splice(0,c),i.splice(0,c);let d=i.find(e=>typeof e==`string`);d?a.value.set(e,d):a.value.delete(e),o.value.set(e,!0)}function D(n,o,s,c){let l=e.value.get(n)??[],u=t.value.get(n)??[],d=r.value.get(n)??[],f=i.value.get(n)??[],p=g(n),h=[];for(let e=0;e<o.length;e++){let t=o[e];if(!t)continue;let n=c.eventIds[e]??null;n&&p.has(n)||(l.push(t),u.push(s[e]??new Date().toISOString()),d.push(c.sessionIds[e]??null),f.push(n),n&&p.add(n),h.push(e))}if(h.length===0)return h;if(e.value.set(n,l),t.value.set(n,u),r.value.set(n,d),i.value.set(n,f),!a.value.has(n)){let e=f.find(e=>typeof e==`string`);e&&a.value.set(n,e)}return E(n,l,u,d,f),m(n),h}function ee(n,s,c,l){let u=[...s],d=c?[...c]:s.map(()=>new Date().toISOString()),f=l?.sessionIds?[...l.sessionIds]:s.map(()=>null),p=l?.eventIds?[...l.eventIds]:s.map(()=>null);e.value.set(n,u),t.value.set(n,d),r.value.set(n,f),i.value.set(n,p);let h=g(n);h.clear();for(let e of p)e&&h.add(e);l?.oldestId?a.value.set(n,l.oldestId):a.value.delete(n),l&&typeof l.hasMoreOlder==`boolean`?o.value.set(n,l.hasMoreOlder):o.value.delete(n),E(n,u,d,f,p),m(n)}function O(n,s,c,l){if(s.length===0){o.value.set(n,l.hasMoreOlder),m(n);return}let u=e.value.get(n)??[],d=t.value.get(n)??[],f=r.value.get(n)??[],p=i.value.get(n)??[],h=l.sessionIds??s.map(()=>null),_=l.eventIds??s.map(()=>null);e.value.set(n,[...s,...u]),t.value.set(n,[...c,...d]),r.value.set(n,[...h,...f]),i.value.set(n,[..._,...p]);let v=g(n);for(let e of _)e&&v.add(e);l.oldestId&&a.value.set(n,l.oldestId),o.value.set(n,l.hasMoreOlder),m(n)}function k(n,a){let o=e.value.get(n),s=i.value.get(n);if(!o||!s)return;let c=s.indexOf(a);if(c===-1)return;let l=t.value.get(n),u=r.value.get(n);o.splice(c,1),s.splice(c,1),l&&l.splice(c,1),u&&u.splice(c,1),g(n).delete(a),m(n)}function A(n){e.value.delete(n),t.value.delete(n),r.value.delete(n),i.value.delete(n),a.value.delete(n),o.value.delete(n),c.value.delete(n),l.value.delete(n),d.value.delete(n),m(n)}return{events:e,timestamps:t,sessionIds:r,eventIds:i,versions:u,versionFor:h,liveAppendCountFor:f,eventsFor:y,timestampsFor:b,sessionIdsFor:x,eventIdsFor:S,oldestIdFor:C,hasMoreOlderFor:w,isCompacting:_,setCompacting:v,append:T,merge:D,reset:ee,prepend:O,removeByEventId:k,clear:A}});function Ri(e){return!!e&&e.state!==`completed`&&e.state!==`cancelled`}function zi(e){return e.state===`OPEN`&&e.reviewDecision===`CHANGES_REQUESTED`&&e.reviewers.some(e=>e.state===`CHANGES_REQUESTED`)}function Bi(e){return e.state===`OPEN`&&e.ci.rollup===`FAILURE`}function Vi(e){return e?Bi(e)||zi(e):!1}var Hi=[`executing`,`extracting`,`brainstorming`,`compacting`];function Ui(e){return!!e&&Hi.includes(e)}function Wi(e,t){return Ui(e)&&!t}function Gi(e,t,n){return Wi(e,!t||n)}var Ki={created:`workspaceStatus.created`,extracting:`workspaceStatus.extracting`,brainstorming:`workspaceStatus.brainstorming`,executing:`workspaceStatus.executing`,compacting:`workspaceStatus.compacting`,"awaiting-user":`workspaceStatus.awaitingUser`,completed:`workspaceStatus.completed`,idle:`workspaceStatus.idle`,error:`workspaceStatus.error`,quota:`workspaceStatus.quota`};function qi(e){return e?Ki[e]??null:null}async function Ji(e){let t=await e.json().catch(()=>({}));return{ok:!0,branch:t.branch??``,upToDate:t.upToDate===!0}}var Yi=class extends Error{constructor(e,t,n){super(e),tt(this,`code`,void 0),tt(this,`operation`,void 0),this.name=`WorkspaceActionError`,this.code=t,this.operation=n}};function Xi(e){return e===`running`?`in_progress`:e}var Zi=5e3,Qi=500,$i=null,ea=0,ta=0,J=new Map,na=new Map,ra=new Map,ia=new WeakMap;function aa(e){let t=ia.get(e);return t||(t=new Map,ia.set(e,t)),t}var oa=new Map,sa=new Map,ca=new WeakMap;function la(e){na.set(e,(na.get(e)??0)+1)}function ua(e,t,n){let r={...e},i=new Set([...Object.keys(e),...Object.keys(t)]);for(let a of i){let i=t[a],o=e[a],s=(na.get(a)??0)!==(n.get(a)??0),c=i?Date.parse(i.updatedAt):NaN,l=o?Date.parse(o.updatedAt):NaN;(s||Number.isFinite(c)&&c>l)&&(i?r[a]=i:delete r[a])}return r}function da(e){return e===`claude-code`?`claude-code`:null}var Y=Me(`workspace`,{state:()=>({workspaces:[],selectedWorkspaceId:null,tasks:[],activityFeeds:{},activityFeedIds:{},activityCounts:{},subagents:{},agentTodos:{},sessions:[],loadingSessions:{},sessionsErrors:{},selectedSessionId:null,archivedWorkspaces:[],archivedLoaded:!1,restoringWorktreeIds:[],workspaceLifecycleVersion:0,workspaceLifecycleVersions:{},listRequestVersion:0,archivedListRequestVersion:0,loading:!1,listLoadError:null,listPollFailureStreak:0,activeListLoadFailed:!1,loadingOlderEvents:!1,hasMoreEvents:{},providerUsage:{},chatDraft:``,queuedMessages:{},activeAgentSessionIds:{},settledAgentSessionIds:{},gitRefreshTrigger:0,gitStatsCache:{},pendingWakeups:{},pendingQuotaBackoffs:{},pendingDeferred:{},pendingQueue:{},prSnapshots:{},autoLoopStates:{},autoLoopMessages:{},autoLoopMessageVersions:{},autoLoopSnapshotVersion:0,autoLoopMessageKeys:{},autoLoopQueueTransfers:{},crons:{},creationProgress:null,agentLiveness:{},agentLivenessLoaded:{}}),getters:{selectedWorkspace:e=>e.workspaces.find(t=>t.id===e.selectedWorkspaceId)??e.archivedWorkspaces.find(t=>t.id===e.selectedWorkspaceId)??null,needsAttention(e){return e.workspaces.filter(t=>[`error`,`quota`,`awaiting-user`].includes(t.status)||Vi(e.prSnapshots[t.id])||!Ui(t.status)&&!!e.prSnapshots[t.id]?.readyToMerge)},running(e){return e.workspaces.filter(t=>Ui(t.status)&&!Vi(e.prSnapshots[t.id]))},idle(e){return e.workspaces.filter(t=>[`completed`,`idle`,`created`].includes(t.status)&&!Vi(e.prSnapshots[t.id])&&!e.prSnapshots[t.id]?.readyToMerge)},favorites(e){return e.workspaces.filter(e=>e.favoritedAt!==null)},currentAgentTodos:e=>e.selectedWorkspaceId?e.agentTodos[e.selectedWorkspaceId]??[]:[],currentSubagents:e=>{if(!e.selectedWorkspaceId)return[];let t=e.subagents[e.selectedWorkspaceId]??{};return Object.values(t).sort((e,t)=>e.startedAt.localeCompare(t.startedAt))},currentBusySubagentCount(){return this.currentSubagents.filter(e=>e.status===`running`&&!e.ambient).length},activityFeed:e=>{if(!e.selectedWorkspaceId)return[];let t=e.activityFeeds[e.selectedWorkspaceId]??[];if(!e.selectedSessionId)return e.sessions.length===0?t:[];let n=e.sessions.find(t=>t.id===e.selectedSessionId)?.engineSessionId??null,r=e.sessions.length>0?e.sessions[e.sessions.length-1].id:null,i=e.selectedSessionId===r;return t.filter(t=>t.sessionId?t.sessionId===e.selectedSessionId||n!==null&&t.sessionId===n:i)},acceptanceCriteria:e=>e.tasks.filter(e=>e.isAcceptanceCriterion),archived:e=>e.archivedWorkspaces,currentProviderUsage(e){let t=e.workspaces.find(t=>t.id===e.selectedWorkspaceId);if(!t)return null;let n=da(t.engine);return n?e.providerUsage[n]??null:null}},actions:{clearWorkspaceLocalState(e){delete this.activityFeeds[e],delete this.activityFeedIds[e],delete this.activityCounts[e],delete this.subagents[e],delete this.agentTodos[e],delete this.hasMoreEvents[e],delete this.gitStatsCache[e],delete this.pendingWakeups[e],delete this.pendingQuotaBackoffs[e],delete this.pendingDeferred[e],delete this.pendingQueue[e],delete this.prSnapshots[e],delete this.autoLoopStates[e],delete this.autoLoopMessages[e],delete this.autoLoopMessageKeys[e],delete this.crons[e],delete this.activeAgentSessionIds[e];for(let t of Object.keys(this.queuedMessages))t.startsWith(`${e}:`)&&delete this.queuedMessages[t];J.delete(e),na.delete(e),ra.delete(e),aa(this).get(e)?.abort(),aa(this).delete(e),delete this.loadingSessions[e],delete this.sessionsErrors[e],oa.delete(e),Li().clear(e),localStorage.removeItem(`kobo:session:${e}`)},setCreationProgress(e){this.creationProgress=e},clearCreationProgress(){this.creationProgress=null},async toggleFavorite(e){let t=this.workspaces.find(t=>t.id===e);if(!t)return;let n=t.favoritedAt,r=n===null,i=r?new Date().toISOString():null;this.workspaces=this.workspaces.map(t=>t.id===e?{...t,favoritedAt:i}:t);try{let t=await U(`/api/workspaces/${e}/favorite`,{method:r?`POST`:`DELETE`});if(!t.ok)throw await H(t);let n=await t.json();this.workspaces=this.workspaces.map(t=>t.id===e?n:t)}catch(t){throw this.workspaces=this.workspaces.map(t=>t.id===e?{...t,favoritedAt:n}:t),t}},async togglePrWatch(e){let t=this.workspaces.find(t=>t.id===e);if(!t)return;let n=t.prWatchDisabledAt===null,r=n?new Date().toISOString():null;this.workspaces=this.workspaces.map(t=>t.id===e?{...t,prWatchDisabledAt:r}:t);try{let t=await U(`/api/workspaces/${e}/pr-watch-disabled`,{method:n?`POST`:`DELETE`});if(!t.ok)throw await H(t);if(n){let n=await t.json();this.workspaces=this.workspaces.map(t=>t.id===e?n:t),delete this.prSnapshots[e],la(e)}else{let{workspace:n,prSnapshot:r}=await t.json();this.workspaces=this.workspaces.map(t=>t.id===e?n:t),r?this.prSnapshots[e]=r:delete this.prSnapshots[e],la(e)}}catch(n){throw this.workspaces=this.workspaces.map(n=>n.id===e?{...n,prWatchDisabledAt:t.prWatchDisabledAt}:n),n}},async setWorkspaceTags(e,t){let n=this.workspaces.find(t=>t.id===e);if(!n)return;let r=n.tags,i=[...t];this.workspaces=this.workspaces.map(t=>t.id===e?{...t,tags:i}:t);try{let n=await U(`/api/workspaces/${e}/tags`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({tags:t})});if(!n.ok)throw await H(n);let r=await n.json();this.workspaces=this.workspaces.map(t=>t.id===e?r:t)}catch(t){throw this.workspaces=this.workspaces.map(t=>t.id===e?{...t,tags:r}:t),t}},async fetchOrphanWorktrees(e){return V(`/api/git/orphan-worktrees?projectPath=${encodeURIComponent(e)}`,{cache:`no-store`})},async fetchWorkspaces(){let e=++this.listRequestVersion,t=new Map(J),n=this.workspaceLifecycleVersion;this.loading=!0;try{let r=await V(`/api/workspaces`);if(e!==this.listRequestVersion||n!==this.workspaceLifecycleVersion)return;let i=new Map(this.workspaces.map(e=>[e.id,e]));this.workspaces=(Array.isArray(r)?r:r.workspaces??[]).map(e=>(J.get(e.id)??0)===(t.get(e.id)??0)?e:i.get(e.id)??e),this.listLoadError=null,this.activeListLoadFailed=!1,this.listPollFailureStreak=0;for(let e of this.workspaces)Li().setCompacting(e.id,e.status===`compacting`),[`completed`,`idle`,`error`,`quota`].includes(e.status)&&this.finalizeRunningSubagents(e.id)}catch(t){if(e!==this.listRequestVersion||n!==this.workspaceLifecycleVersion)return;this.listLoadError=t instanceof Error?t.message:String(t),this.activeListLoadFailed=!0,console.error(`[workspace store] fetchWorkspaces failed:`,t)}finally{e===this.listRequestVersion&&(this.loading=!1)}},async retryLoadWorkspaces(){await this.fetchWorkspaces(),this.archivedLoaded&&await this.fetchArchivedWorkspaces()},async fetchArchivedWorkspaces(){let e=++this.archivedListRequestVersion,t=new Map(J),n=this.workspaceLifecycleVersion;try{let r=await V(`/api/workspaces/archived`);if(e!==this.archivedListRequestVersion||n!==this.workspaceLifecycleVersion)return;let i=new Map(this.archivedWorkspaces.map(e=>[e.id,e]));this.archivedWorkspaces=r.map(e=>(J.get(e.id)??0)===(t.get(e.id)??0)?e:i.get(e.id)??e),this.archivedLoaded=!0,this.activeListLoadFailed||(this.listLoadError=null)}catch(t){if(e!==this.archivedListRequestVersion||n!==this.workspaceLifecycleVersion)return;this.listLoadError=t instanceof Error?t.message:String(t),console.error(`[workspace store] fetchArchivedWorkspaces failed:`,t)}},async fetchWorkspaceDetails(e){let t=this.workspaceLifecycleVersions[e]??0,n=(oa.get(e)??0)+1;oa.set(e,n);let r=J.get(e)??0;try{let i=await V(`/api/workspaces/${e}`);if(this.selectedWorkspaceId!==e||oa.get(e)!==n)return;if(t===(this.workspaceLifecycleVersions[e]??0)){let t=(J.get(e)??0)!==r,n=i.workspace??i,a=t?{}:n;typeof a.status==`string`&&Li().setCompacting(e,a.status===`compacting`);let o=this.workspaces.findIndex(t=>t.id===e);if(o>=0)this.workspaces[o]={...this.workspaces[o],...a};else{let t=this.archivedWorkspaces.findIndex(t=>t.id===e);t>=0?this.archivedWorkspaces[t]={...this.archivedWorkspaces[t],...a}:a?.archivedAt&&this.archivedWorkspaces.unshift(a)}}i.tasks&&(this.tasks=i.tasks),`agentLiveness`in i&&(J.get(e)??0)===r&&this.applyAgentLiveness(e,i.agentLiveness)}catch(e){console.error(`[workspace store] fetchWorkspaceDetails failed:`,e)}},applyAgentLiveness(e,t){if(this.agentLivenessLoaded={...this.agentLivenessLoaded,[e]:!0},t){this.agentLiveness={...this.agentLiveness,[e]:t};return}if(e in this.agentLiveness){let t={...this.agentLiveness};delete t[e],this.agentLiveness=t}},async createWorkspace(e,t=[]){try{let n=JSON.stringify(e);if(t.length>0){n=new FormData,n.append(`workspace`,JSON.stringify(e));for(let e of t)n.append(`attachments`,e)}let r=await U(`/api/workspaces`,{method:`POST`,...typeof n==`string`?{headers:{"Content-Type":`application/json`}}:{},body:n});if(!r.ok){let e=await r.json().catch(()=>({}));throw new Yi(typeof e.error==`string`?e.error:`HTTP ${r.status}`,typeof e.step==`string`?e.step:void 0)}let i=r.headers.get(`X-Kobo-Branch-Adjusted`)===`1`,a=r.headers.get(`X-Kobo-Source-Fallback`)===`local`,o=await r.json(),s=o.workspace??o;this.invalidateWorkspaceLifecycleReads(s.id);let c=this.workspaces.findIndex(e=>e.id===s.id);return c>=0?this.workspaces[c]=s:this.workspaces.push(s),e.autoLoop&&this.fetchAutoLoopStates(),s._branchAdjusted=i,s._sourceFallback=a,s}catch(e){throw console.error(`[workspace store] createWorkspace failed:`,e),e}},async startWorkspace(e,t,n,r){try{await V(`/api/workspaces/${e}/start`,{method:`POST`,body:{prompt:t,agentSessionId:n,resume:r}}),await this.fetchWorkspaces()}catch(e){throw console.error(`[workspace store] startWorkspace failed:`,e),e}},async previewEngineHandoff(e,t){let n=await U(`/api/workspaces/${e}/engine-handoff-preview`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({engine:t})}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);return r.handoff},async switchEngine(e,t){let n=await U(`/api/workspaces/${e}/switch-engine`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);let i=r.workspace,a=this.workspaces.findIndex(t=>t.id===e);return a>=0&&(this.workspaces[a]=i),await this.fetchSessions(e,r.sessionId),{sessionId:r.sessionId}},async stopWorkspace(e){try{await B(`/api/workspaces/${e}/stop`,{method:`POST`}),await this.fetchWorkspaces()}catch(e){throw console.error(`[workspace store] stopWorkspace failed:`,e),e}},async interruptAgent(e,t={}){try{let n=await Le(`/api/workspaces/${e}/interrupt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>void 0),t=typeof e==`object`&&e&&!Array.isArray(e)?e:void 0,r=typeof t?.error==`string`?t.error:`HTTP ${n.status}`,i=t?.code;throw new Yi(r,n.status===409&&(i===`no_agent_running`||i===`session_not_active`)||n.status===500&&i===`interrupt_failed`?i:void 0)}}catch(e){throw console.error(`[workspace store] interruptAgent failed:`,e),e}},async stopSubagents(e,t){try{let n=await U(`/api/workspaces/${e}/subagents/stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t===void 0?{}:{id:t})}),r=await n.json().catch(()=>void 0),i=typeof r==`object`&&r&&!Array.isArray(r)?r:void 0;if(!n.ok)throw new Yi(typeof i?.error==`string`?i.error:`HTTP ${n.status}`,typeof i?.code==`string`?i.code:void 0);return typeof i?.stopped==`number`?i.stopped:0}catch(e){throw console.error(`[workspace store] stopSubagents failed:`,e),e}},async deleteWorkspace(e,t){try{let n=await U(`/api/workspaces/${e}`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})});if(!n.ok)throw await H(n);let r=[];if(n.status===200){let e=await n.json().catch(()=>({}));r=Array.isArray(e.warnings)?e.warnings:[]}return this.workspaces=this.workspaces.filter(t=>t.id!==e),this.archivedWorkspaces=this.archivedWorkspaces.filter(t=>t.id!==e),this.clearWorkspaceLocalState(e),Fi(e),this.selectedWorkspaceId===e&&(this.selectedWorkspaceId=null,this.tasks=[]),{warnings:r}}catch(e){throw console.error(`[workspace store] deleteWorkspace failed:`,e),e}},async deleteAllArchived(e){try{let t=this.archivedWorkspaces.map(e=>e.id),n=await U(`/api/workspaces/archived`,{method:`DELETE`,headers:{"Content-Type":`application/json`},body:JSON.stringify(e??{})});if(!n.ok)throw await H(n);let r=await n.json().catch(()=>({})),i=typeof r.deleted==`number`?r.deleted:0,a=Array.isArray(r.warnings)?r.warnings:[];this.archivedWorkspaces=[];for(let e of t)this.clearWorkspaceLocalState(e),Fi(e),this.selectedWorkspaceId===e&&(this.selectedWorkspaceId=null,this.tasks=[]);return{deleted:i,warnings:a,ids:t}}catch(e){throw console.error(`[workspace store] deleteAllArchived failed:`,e),e}},async updateModel(e,t){try{let n=await U(`/api/workspaces/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({model:t})});if(!n.ok)throw await H(n);let r=await n.json(),i=this.workspaces.findIndex(t=>t.id===e);i>=0&&(this.workspaces[i]=r)}catch(e){throw console.error(`[workspace store] updateModel failed:`,e),e}},async updateWorkspaceDescription(e,t){let n=this.workspaces.findIndex(t=>t.id===e);if(n<0)throw Error(`Workspace '${e}' not found in store`);let r=this.workspaces[n].description;this.workspaces[n]={...this.workspaces[n],description:t};try{let n=await U(`/api/workspaces/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({description:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}let r=await n.json();this.workspaces=this.workspaces.map(t=>t.id===e?{...t,...r}:t)}catch(n){let i=this.workspaces.findIndex(t=>t.id===e);throw i>=0&&this.workspaces[i].description===t&&(this.workspaces[i]={...this.workspaces[i],description:r}),n}},async updateReasoningEffort(e,t){try{let n=await U(`/api/workspaces/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({reasoningEffort:t})});if(!n.ok)throw await H(n);let r=await n.json(),i=this.workspaces.findIndex(t=>t.id===e);i>=0&&(this.workspaces[i]=r)}catch(e){throw console.error(`[workspace store] updateReasoningEffort failed:`,e),e}},async renameWorkspaceBranch(e,t){let n=await U(`/api/workspaces/${e}/rename-branch`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({newName:t})}),r=await n.json().catch(()=>null);if(!n.ok)throw new Yi(r?.error??`Rename failed`,r?.code);let i=r,a=this.workspaces.findIndex(t=>t.id===e);return a>=0&&(this.workspaces[a]=i),i},async resyncWorkspaceBranch(e){let t=await U(`/api/workspaces/${e}/resync-branch`,{method:`POST`});if(!t.ok)throw await H(t);let n=await t.json();if(n.changed){let t=this.workspaces.findIndex(t=>t.id===e);t>=0&&(this.workspaces[t]={...this.workspaces[t],workingBranch:n.workingBranch})}return n},async updateAgentPermissionMode(e,t){try{let n=await U(`/api/workspaces/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({agentPermissionMode:t})});if(!n.ok)throw await H(n);let r=await n.json(),i=this.workspaces.findIndex(t=>t.id===e);i>=0&&(this.workspaces[i]=r)}catch(e){throw console.error(`[workspace store] updateAgentPermissionMode failed:`,e),e}},async updateWorkflowPolicy(e,t){let n=await U(`/api/workspaces/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({workflowPolicy:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw new Yi(e.error??`HTTP ${n.status}`,e.code)}let r=await n.json(),i=this.workspaces.findIndex(t=>t.id===e);i>=0&&(this.workspaces[i]=r)},async pushBranch(e,t={}){let n=await U(`/api/workspaces/${e}/push`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({force:t.force===!0})});if(!n.ok){let e=await n.json().catch(()=>({error:`Push failed`}));throw new Yi(e.error??`Push failed`,e.code,e.operation)}return Ji(n)},async forcePushBranch(e){let t=await U(`/api/workspaces/${e}/force-push`,{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({error:`Push failed`}));throw new Yi(e.error??`Push failed`,e.code,e.operation)}return Ji(t)},async fetchGitStats(e,t={}){let n=`/api/workspaces/${e}/git-stats${t.freshFetch?`?freshFetch=1`:``}`,r=await V(n,{signal:t.signal,timeoutMs:6e4});return this.gitStatsCache[e]=r,r},async fetchBranchDivergence(e,t={}){let n=`/api/workspaces/${e}/branch-divergence?limit=${t.limit??50}`,r=await U(n,{signal:t.signal});if(!r.ok)throw await H(r);return await r.json()},async openPullRequest(e){let t=await U(`/api/workspaces/${e}/open-pr`,{method:`POST`}),n=await t.json().catch(()=>null);if(!t.ok)throw new Yi(n?.error??`Open PR failed`,n?.code);return n},async archiveWorkspace(e){try{let t=await U(`/api/workspaces/${e}/archive`,{method:`POST`});if(!t.ok)throw await H(t);let n=await t.json();return this.workspaces=this.workspaces.filter(t=>t.id!==e),this.archivedLoaded&&this.archivedWorkspaces.unshift(n),this.selectedWorkspaceId===e&&(this.selectedWorkspaceId=null,this.tasks=[]),n}catch(e){throw console.error(`[workspace store] archiveWorkspace failed:`,e),e}},invalidateWorkspaceLifecycleReads(e){this.workspaceLifecycleVersion+=1,e&&(this.workspaceLifecycleVersions[e]=(this.workspaceLifecycleVersions[e]??0)+1)},applyRestoredWorkspace(e){this.invalidateWorkspaceLifecycleReads(e.id);let t=this.workspaces.findIndex(t=>t.id===e.id);t===-1?this.workspaces.unshift(e):this.workspaces[t]=e,this.archivedWorkspaces=this.archivedWorkspaces.filter(t=>t.id!==e.id)},restoreWorktree(e){let t=ca.get(this);t||(t=new Map,ca.set(this,t));let n=t.get(e);if(n)return n;let r=this.workspaceLifecycleVersions[e]??0;this.restoringWorktreeIds.push(e);let i=(async()=>{try{let t=await U(`/api/workspaces/${e}/restore-worktree`,{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({}));throw new Yi(e.error??`HTTP ${t.status}`,e.code)}let{workspace:n}=await t.json();return r===(this.workspaceLifecycleVersions[e]??0)&&this.applyRestoredWorkspace(n),n}finally{this.restoringWorktreeIds=this.restoringWorktreeIds.filter(t=>t!==e),t.delete(e)}})();return t.set(e,i),i},async unarchiveWorkspace(e){try{let t=await U(`/api/workspaces/${e}/unarchive`,{method:`POST`});if(!t.ok){if(t.status===409){let e=await t.json().catch(()=>({})),n=Error(e.error??`worktree-purged`);throw n.code=`worktree-purged`,n}throw await H(t)}let n=await t.json();return this.archivedWorkspaces=this.archivedWorkspaces.filter(t=>t.id!==e),this.workspaces.unshift(n),n}catch(e){throw console.error(`[workspace store] unarchiveWorkspace failed:`,e),e}},async createTask(e,t,n){try{await B(`/api/workspaces/${e}/tasks`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:t,isAcceptanceCriterion:n})}),await this.fetchWorkspaceDetails(e)}catch(e){throw console.error(`[workspace store] createTask failed:`,e),e}},async updateTaskTitle(e,t,n){try{await B(`/api/workspaces/${e}/tasks/${t}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:n})}),await this.fetchWorkspaceDetails(e)}catch(e){throw console.error(`[workspace store] updateTaskTitle failed:`,e),e}},async deleteTask(e,t){try{await B(`/api/workspaces/${e}/tasks/${t}`,{method:`DELETE`}),await this.fetchWorkspaceDetails(e)}catch(e){throw console.error(`[workspace store] deleteTask failed:`,e),e}},cancelSessionReads(e){for(let[t,n]of aa(this))e&&e!==t||(n.abort(),aa(this).delete(t),delete this.loadingSessions[t])},selectWorkspace(e){this.cancelSessionReads(),this.selectedWorkspaceId=e,this.selectedSessionId=null,this.sessions=[],this.tasks=[],this.markRead(e),this.fetchWorkspaceDetails(e),this.fetchSessions(e),this.fetchPendingQuotaBackoff(e),this.fetchGitStats(e).catch(()=>{}),this.activityFeeds[e]?.length||ns().subscribe(e)},async fetchSessions(e,t){let n=aa(this);n.get(e)?.abort();let r=new AbortController;n.set(e,r);let i=(ra.get(e)??0)+1;ra.set(e,i),this.loadingSessions[e]=!0,delete this.sessionsErrors[e];try{let n=await U(`/api/workspaces/${e}/sessions`,{signal:r.signal});if(!n.ok)throw await H(n);let a=await n.json();if(this.selectedWorkspaceId!==e||ra.get(e)!==i)return;if(this.sessions=a,t===null){this.selectSession(null);return}if(t&&this.sessions.some(e=>e.id===t)){this.selectSession(t);return}let o=this.selectedSessionId&&this.sessions.some(e=>e.id===this.selectedSessionId);if(this.sessions.length>0&&!o){let t=localStorage.getItem(`kobo:session:${e}`),n=this.sessions.filter(e=>(e.activationOrder??0)>=0),r=t?n.find(e=>e.id===t):null;this.selectSession(r?.id??n[0]?.id??null)}}catch(t){if(Pe(t)||r.signal.aborted)return;ra.get(e)===i&&(this.sessionsErrors[e]=t instanceof Error?t.message:String(t)),console.error(`[workspace store] fetchSessions failed:`,t)}finally{n.get(e)===r&&n.delete(e),ra.get(e)===i&&delete this.loadingSessions[e]}},async fetchOlderEvents(e){if(this.loadingOlderEvents||this.hasMoreEvents[e]===!1)return!1;let t=this.activityFeeds[e];if(!t?.length)return!1;let n=t[0].id;this.loadingOlderEvents=!0;try{let t=await U(`/api/workspaces/${e}/events?before=${encodeURIComponent(n)}&limit=100`);if(!t.ok)throw await H(t);let r=await t.json();if(this.hasMoreEvents[e]=r.hasMore,r.events.length>0){let e=ns();for(let t of r.events)e._routeMessage(t)}return r.events.length>0}catch(e){return console.error(`[workspace store] fetchOlderEvents failed:`,e),!1}finally{this.loadingOlderEvents=!1}},selectSession(e){if(this.selectedSessionId=e,this.selectedWorkspaceId){let t=`kobo:session:${this.selectedWorkspaceId}`;e===null?localStorage.removeItem(t):localStorage.setItem(t,e)}},async createSession(e){try{let t=await U(`/api/workspaces/${e}/sessions`,{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}let n=await t.json();return this.selectedWorkspaceId===e&&(this.sessions.unshift(n),this.selectSession(n.id)),n}catch(e){throw console.error(`[workspace store] createSession failed:`,e),e}},async renameWorkspace(e,t){let n=await U(`/api/workspaces/${e}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:t})});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}let r=await n.json(),i=this.workspaces.findIndex(t=>t.id===e);i>=0&&(this.workspaces[i]={...this.workspaces[i],...r});let a=this.archivedWorkspaces.findIndex(t=>t.id===e);a>=0&&(this.archivedWorkspaces[a]={...this.archivedWorkspaces[a],...r})},async renameSession(e,t,n){let r=await U(`/api/workspaces/${e}/sessions/${t}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`HTTP ${r.status}`)}let i=await r.json().catch(()=>null),a=this.sessions.find(e=>e.id===t);a&&(a.name=i?.name??n)},async deleteSession(e,t){let n=await U(`/api/workspaces/${e}/sessions/${t}`,{method:`DELETE`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.error??`HTTP ${n.status}`);let i=this.selectedSessionId===t,a=r.workspace;if(a){let t=this.workspaces.findIndex(t=>t.id===e);t>=0&&(this.workspaces[t]=a)}await this.fetchSessions(e),i&&this.selectedWorkspaceId===e&&this.selectSession(this.sessions[0]?.id??null)},addActivityItem(e,t){if(this.activityFeeds[e]||(this.activityFeeds[e]=[]),this.activityFeedIds[e]||(this.activityFeedIds[e]=new Set),this.activityCounts[e]||(this.activityCounts[e]={toolUses:0,agentMessages:0,userMessages:0,errors:0}),t.meta?.sender!==`user`&&t.meta?.sender!==`system-prompt`)for(let t of this.activityFeeds[e])t.meta?.pending&&(t.meta.pending=!1);if(!this.activityFeedIds[e].has(t.id)){this.activityFeedIds[e].add(t.id),this.activityFeeds[e].push(t);let n=this.activityCounts[e];t.type===`tool_use`?n.toolUses++:t.type===`error`&&n.errors++,t.meta?.sender===`user`?n.userMessages++:t.type===`text`&&t.meta?.sender!==`system-prompt`&&n.agentMessages++}let n=this.activityFeeds[e];if(n.length>Zi){let t=n.splice(0,n.length-Zi),r=this.activityFeedIds[e];for(let e of t)r.delete(e.id)}},removeActivityItem(e,t){let n=this.activityFeeds[e],r=this.activityFeedIds[e];if(!n||!r)return;let i=n.findIndex(e=>e.id===t);if(i<0)return;let[a]=n.splice(i,1);r.delete(t);let o=this.activityCounts[e];o&&a&&(a.type===`tool_use`?o.toolUses=Math.max(0,o.toolUses-1):a.type===`error`&&(o.errors=Math.max(0,o.errors-1)),a.meta?.sender===`user`?o.userMessages=Math.max(0,o.userMessages-1):a.type===`text`&&a.meta?.sender!==`system-prompt`&&(o.agentMessages=Math.max(0,o.agentMessages-1)))},clearActivityFeed(e){e?(delete this.activityFeeds[e],delete this.activityFeedIds[e],delete this.activityCounts[e]):(this.activityFeeds={},this.activityFeedIds={},this.activityCounts={})},applyUsageSnapshot(e){this.providerUsage[e.providerId]=e.snapshot},async requestUsageRefresh(e){try{await B(`/api/usage/${e}/refresh`,{method:`POST`})}catch(e){console.error(`[workspace store] requestUsageRefresh failed:`,e)}},triggerGitRefresh(){this.gitRefreshTrigger++,this.schedulePrSnapshotsRefresh()},schedulePrSnapshotsRefresh(){$i!==null&&clearTimeout($i),$i=setTimeout(()=>{$i=null,this.fetchPrSnapshots()},Qi)},async fetchPrSnapshots(){let e=++ta,t=new Map(na);try{let n=await U(`/api/workspaces/pr-states`,{cache:`no-store`});if(!n.ok)return;let r=await n.json();if(e!==ta)return;this.prSnapshots=ua(r,this.prSnapshots,t)}catch(e){console.error(`[workspace-store] fetchPrSnapshots failed:`,e)}},async fetchWorkspacesInfo(){let e=this.workspaceLifecycleVersion,t=++ea,n=new Map(J),r=new Map(na),i=new Map(sa);try{let a=await V(`/api/workspaces/info`,{cache:`no-store`});if(this.listPollFailureStreak=0,this.activeListLoadFailed=!1,this.listLoadError=null,t!==ea||e!==this.workspaceLifecycleVersion)return;if(this.agentLiveness=a.agentLiveness??{},a.pendingInputs)for(let e of a.workspaces){if((sa.get(e.id)??0)!==(i.get(e.id)??0))continue;let t=this.pendingQueue[e.id]??[],n=new Map(t.map(e=>[e.toolCallId,e])),r=(a.pendingInputs[e.id]??[]).map(e=>{let t=n.get(e.toolCallId);return t&&Vt.deepEqual(t,e)?t:e});if(!(r.length===t.length&&r.every((e,n)=>e===t[n]))){this.clearAllPending(e.id);for(let t of r)this.enqueuePending(e.id,t)}}let o={...this.agentLivenessLoaded};for(let e of a.workspaces)o[e.id]=!0;this.agentLivenessLoaded=o;let s=new Map(this.workspaces.map(e=>[e.id,e]));this.workspaces=a.workspaces.map(e=>{let t=s.get(e.id),r=(J.get(e.id)??0)!==(n.get(e.id)??0);return t&&r?{...e,...t}:e});for(let e of this.workspaces)Li().setCompacting(e.id,e.status===`compacting`),[`completed`,`idle`,`error`,`quota`].includes(e.status)&&this.finalizeRunningSubagents(e.id);this.prSnapshots=ua(a.prSnapshots,this.prSnapshots,r);let c={...this.gitStatsCache};for(let[e,t]of Object.entries(a.gitStats)){let n=c[e];(!n||(t.computedAt??0)>=(n.computedAt??0))&&(c[e]=t)}this.gitStatsCache=c}catch(e){console.error(`[workspace-store] fetchWorkspacesInfo failed:`,e),this.listPollFailureStreak+=1,this.listPollFailureStreak>=2&&(this.activeListLoadFailed=!0,this.listLoadError=e instanceof Error?e.message:String(e))}},async refreshPrSnapshot(e){try{let t=await U(`/api/workspaces/pr-snapshot/refresh/${e}`,{method:`POST`});if(t.status===404){let t={...this.prSnapshots};return delete t[e],this.prSnapshots=t,la(e),null}if(!t.ok)return console.error(`[workspace-store] refreshPrSnapshot non-OK:`,t.status),null;let n=await t.json();return this.prSnapshots={...this.prSnapshots,[e]:n.snapshot},la(e),n.snapshot}catch(e){return console.error(`[workspace-store] refreshPrSnapshot failed:`,e),null}},async fetchAutoLoopStates(){let e=++this.autoLoopSnapshotVersion;try{let t=await U(`/api/workspaces/auto-loop-states`,{cache:`no-store`});if(!t.ok)return;let n=await t.json();e===this.autoLoopSnapshotVersion&&(this.autoLoopStates=n)}catch(e){console.error(`[workspace-store] fetchAutoLoopStates failed:`,e)}},async fetchAutoLoopMessages(e){let t=(this.autoLoopMessageVersions[e]??0)+1;this.autoLoopMessageVersions[e]=t;let n=await U(`/api/workspaces/${e}/auto-loop/messages`,{cache:`no-store`});if(n.ok){let r=await n.json();this.autoLoopMessageVersions[e]===t&&(this.autoLoopMessages[e]=r)}},async queueAutoLoopMessage(e,t){let n=this.autoLoopMessageKeys[e];(!n||n.content!==t)&&(n={content:t,id:Array.from(crypto.getRandomValues(new Uint32Array(4)),e=>e.toString(16)).join(`-`)},this.autoLoopMessageKeys[e]=n);let r=await Le(`/api/workspaces/${e}/auto-loop/messages`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({content:t,clientMessageId:n.id})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`HTTP ${r.status}`)}delete this.autoLoopMessageKeys[e],await this.fetchAutoLoopMessages(e).catch(()=>{})},async resolveAutoLoopMessage(e,t,n){let r=await Le(`/api/workspaces/${e}/auto-loop/messages/${t}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:n})});if(!r.ok){let e=await r.json().catch(()=>({}));throw Error(e.error??`HTTP ${r.status}`)}await this.fetchAutoLoopMessages(e)},async enableAutoLoop(e){let t=await Le(`/api/workspaces/${e}/auto-loop`,{method:`POST`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}await this.fetchAutoLoopStates()},async disableAutoLoop(e){let t=await Le(`/api/workspaces/${e}/auto-loop`,{method:`DELETE`});if(!t.ok){let e=await t.json().catch(()=>({}));throw Error(e.error??`HTTP ${t.status}`)}await this.fetchAutoLoopStates()},async forceAutoLoopReady(e){await B(`/api/workspaces/${e}/auto-loop-ready`,{method:`POST`}),await this.fetchAutoLoopStates()},setAutoLoopState(e,t){this.autoLoopStates[e]=t},clearAutoLoopState(e){delete this.autoLoopStates[e],delete this.autoLoopMessages[e],delete this.autoLoopMessageKeys[e]},async fetchCrons(e){try{let t=await U(`/api/workspaces/${e}/crons`);if(!t.ok)return;let n=await t.json();this.crons[e]=n.crons}catch(e){console.error(`[workspace-store] fetchCrons failed:`,e)}},async cancelCron(e,t){let n=this.crons[e]??[];this.crons[e]=n.filter(e=>e.id!==t);try{await B(`/api/workspaces/${e}/crons/${t}`,{method:`DELETE`})}catch(t){throw this.crons[e]=n,t}},async createCron(e,t){let n=await Le(`/api/workspaces/${e}/crons`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}await this.fetchCrons(e)},async scheduleManualWakeup(e,t){let n=await U(`/api/workspaces/${e}/pending-wakeup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)});if(!n.ok){let e=await n.json().catch(()=>({}));throw Error(e.error??`HTTP ${n.status}`)}let r=await n.json();r.pending&&(this.pendingWakeups[e]=r.pending)},async fetchPendingWakeup(e){try{let t=await U(`/api/workspaces/${e}/pending-wakeup`,{cache:`no-store`});if(!t.ok)return;let n=await t.json();n?this.pendingWakeups[e]=n:delete this.pendingWakeups[e]}catch(e){console.error(`[workspace-store] fetchPendingWakeup failed:`,e)}},setPendingWakeup(e,t){this.pendingWakeups[e]=t},clearPendingWakeup(e){delete this.pendingWakeups[e]},async cancelPendingWakeup(e){let t=this.pendingWakeups[e]!==void 0;delete this.pendingWakeups[e];try{await B(`/api/workspaces/${e}/pending-wakeup`,{method:`DELETE`})}catch(n){console.error(`[workspace-store] cancelPendingWakeup failed:`,n),t&&await this.fetchPendingWakeup(e)}},async fetchPendingQuotaBackoff(e){try{let t=await U(`/api/workspaces/${e}/quota-backoff`,{cache:`no-store`});if(!t.ok)return;let n=await t.json();n?this.pendingQuotaBackoffs[e]={...n,reason:n.reason===`transient`?`transient`:`quota`}:delete this.pendingQuotaBackoffs[e]}catch(e){console.error(`[workspace-store] fetchPendingQuotaBackoff failed:`,e)}},setPendingQuotaBackoff(e,t){this.pendingQuotaBackoffs[e]=t},clearPendingQuotaBackoff(e){delete this.pendingQuotaBackoffs[e]},async cancelQuotaBackoff(e){let t=this.pendingQuotaBackoffs[e]!==void 0;delete this.pendingQuotaBackoffs[e];try{await B(`/api/workspaces/${e}/quota-backoff`,{method:`DELETE`})}catch(n){console.error(`[workspace-store] cancelQuotaBackoff failed:`,n),t&&await this.fetchPendingQuotaBackoff(e)}},async resumeQuotaBackoffNow(e){await this.fetchSessions(e);let t=this.sessions[0];t&&(t.status===`completed`||t.status===`error`)?await this.startWorkspace(e,void 0,t.id,!0):await this.startWorkspace(e)},enqueuePending(e,t){sa.set(e,(sa.get(e)??0)+1);let n=this.pendingQueue[e]??[];n.some(e=>e.toolCallId===t.toolCallId)||(n.push(t),this.pendingQueue[e]=n,t.kind===`question`&&(this.pendingDeferred[e]={toolCallId:t.toolCallId,toolName:t.toolName,input:t.input,agentSessionId:t.agentSessionId}))},peekPending(e){return this.pendingQueue[e]?.[0]},dequeuePending(e){sa.set(e,(sa.get(e)??0)+1);let t=this.pendingQueue[e];if(!t||t.length===0)return;let n=t.shift();t.length===0&&delete this.pendingQueue[e];let r=this.pendingQueue[e]?.[0];return r&&r.kind===`question`?this.pendingDeferred[e]={toolCallId:r.toolCallId,toolName:r.toolName,input:r.input,agentSessionId:r.agentSessionId}:delete this.pendingDeferred[e],n},clearPendingForSession(e,t){if(sa.set(e,(sa.get(e)??0)+1),t===null)return;let n=this.pendingQueue[e];if(!n)return;let r=n.filter(e=>e.agentSessionId!==t);r.length===0?delete this.pendingQueue[e]:this.pendingQueue[e]=r;let i=this.pendingDeferred[e];i&&i.agentSessionId===t&&delete this.pendingDeferred[e]},clearAllPending(e){sa.set(e,(sa.get(e)??0)+1),delete this.pendingQueue[e],delete this.pendingDeferred[e]},setPendingDeferred(e,t){this.enqueuePending(e,{kind:`question`,agentSessionId:t.agentSessionId,toolCallId:t.toolCallId,toolName:t.toolName,input:t.input})},clearPendingDeferred(e,t=null){if(t===null){this.clearAllPending(e);return}this.clearPendingForSession(e,t)},getPendingDeferred(e){let t=this.peekPending(e);if(t?.kind===`question`)return{toolCallId:t.toolCallId,toolName:t.toolName,input:t.input,agentSessionId:t.agentSessionId}},async submitDeferredAnswer(e,t,n,r,i){let a=await Le(`/api/workspaces/${e}/deferred-tool-use/answer`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({answers:t,toolCallId:n,awaitingFreeForm:r,response:i})});if(!a.ok){let t=(await a.json().catch(()=>({}))).error??`HTTP ${a.status}`;if(/no deferred tool use pending|no agent running|no active engine process|no pending callback/i.test(t)){console.warn(`[workspace] submitDeferredAnswer: deferred callback expired — clearing zombie panel locally`),this.dequeuePending(e),this.fetchWorkspaces();return}throw Error(t)}this.dequeuePending(e),this.fetchWorkspaces()},async cancelDeferredAnswer(e,t,n){let r=await Le(`/api/workspaces/${e}/deferred-tool-use/cancel`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({reason:t,toolCallId:n})});if(!r.ok){let t=(await r.json().catch(()=>({}))).error??`HTTP ${r.status}`;if(/no deferred tool use pending/i.test(t)){console.warn(`[workspace] cancelDeferredAnswer: backend has no pending — clearing zombie panel locally`),this.dequeuePending(e),this.fetchWorkspaces();return}throw Error(t)}this.dequeuePending(e),this.fetchWorkspaces()},async submitDeferredPermission(e,t,n,r,i=`once`){let a=await Le(`/api/workspaces/${e}/deferred-permission/decision`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({toolCallId:t,decision:n,reason:r,scope:i})});if(!a.ok){let e=await a.json().catch(()=>({}));throw Error(e.error??`HTTP ${a.status}`)}this.dequeuePending(e),this.fetchWorkspaces()},updateAgentTodos(e,t){this.agentTodos[e]=t},agentTaskCreate(e,t,n){let r=this.agentTodos[e]?[...this.agentTodos[e]]:[];r.some(e=>e.id===t)||(r.push({id:t,content:n.subject||n.description||``,status:`pending`,activeForm:n.activeForm}),this.agentTodos[e]=r)},agentTaskSetNumber(e,t,n){let r=this.agentTodos[e];r&&(this.agentTodos[e]=r.map(e=>e.id===t?{...e,taskNumber:n}:e))},agentTaskUpdate(e,t,n){let r=this.agentTodos[e];if(r){if(n.status===`deleted`){this.agentTodos[e]=r.filter(e=>e.taskNumber!==t);return}this.agentTodos[e]=r.map(e=>e.taskNumber===t?{...e,status:n.status?Xi(n.status):e.status,content:n.content??e.content,activeForm:n.activeForm??e.activeForm}:e)}},finalizeRunningSubagents(e,t){let n=this.subagents[e];if(!n)return;let r=new Date().toISOString();for(let e of Object.keys(n)){let i=n[e];t&&i.sessionId&&i.sessionId!==t||i.status===`running`&&(n[e]={...i,status:`done`,updatedAt:r})}},upsertSubagent(e,t){this.subagents[e]||(this.subagents[e]={});let n=this.subagents[e],r=new Set([t.toolUseId,...t.taskId?[t.taskId]:[]]),i=Object.entries(n).filter(([e,t])=>r.has(e)||r.has(t.toolUseId)||!!t.taskId&&r.has(t.taskId)).sort(([,e],[,t])=>e.startedAt.localeCompare(t.startedAt)),a=i[0]?.[1];if(a&&a.status!==`running`&&t.status===`running`&&t.phase===`progress`)return;for(let[e]of i)delete n[e];let o=t.taskId??i.map(([,e])=>e.taskId).find(e=>!!e),s=a&&t.toolUseId===o?a.toolUseId:t.toolUseId,c=new Date().toISOString(),l=t.status??a?.status??`running`,u=t.phase===`started`?t.ambient===!0:t.ambient??a?.ambient,d=t.sessionId||a?.sessionId,f=t.threadIds?.length?[...new Set([...a?.threadIds??[],...t.threadIds])]:a?.threadIds;n[o??s]={toolUseId:s,...o?{taskId:o}:{},...f?.length?{threadIds:f}:{},description:t.description??a?.description??``,taskType:t.taskType??a?.taskType,status:l,...u?{ambient:!0}:{},...d?{sessionId:d}:{},lastToolName:t.lastToolName??a?.lastToolName,lastDescription:t.lastDescription??a?.lastDescription,totalTokens:t.totalTokens??a?.totalTokens,toolUses:t.toolUses??a?.toolUses,durationMs:t.durationMs??a?.durationMs,startedAt:a?.startedAt??c,updatedAt:c}},async markRead(e){try{await B(`/api/workspaces/${e}/mark-read`,{method:`POST`});let t=this.workspaces.findIndex(t=>t.id===e);t>=0&&(this.workspaces[t]={...this.workspaces[t],hasUnread:!1})}catch(e){console.error(`[workspace store] markRead failed:`,e)}},async purgeWorktree(e){try{let t=await U(`/api/workspaces/${e}/purge-worktree`,{method:`POST`}),n=await t.json();if(!t.ok)return{ok:!1,error:n.error??`HTTP ${t.status}`};let r=n.workspace;return r&&(this.updateWorkspaceFromEvent(e,{archivedAt:r.archivedAt,worktreePurgedAt:r.worktreePurgedAt,worktreePurgeRestoreData:r.worktreePurgeRestoreData}),r.archivedAt&&this.archivedLoaded&&(this.archivedWorkspaces.some(t=>t.id===e)||this.archivedWorkspaces.unshift(r),this.workspaces=this.workspaces.filter(t=>t.id!==e),this.selectedWorkspaceId===e&&(this.selectedWorkspaceId=null,this.tasks=[]))),{ok:!0,warnings:n.warnings??[]}}catch(e){return{ok:!1,error:e instanceof Error?e.message:String(e)}}},async dismissPrAttention(e,t){let n=this.prSnapshots[e];if(n)try{await B(`/api/workspaces/${e}/dismiss-pr-attention`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:t,prUpdatedAt:n.updatedAt})});let r=t===`changes-requested`?{prChangesDismissedAt:n.updatedAt}:{prCiFailureDismissedAt:n.updatedAt};this.updateWorkspaceFromEvent(e,r)}catch(e){console.error(`[workspace store] dismissPrAttention failed:`,e)}},async restorePrAttention(e,t){try{await B(`/api/workspaces/${e}/restore-pr-attention`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:t})});let n=t===`changes-requested`?{prChangesDismissedAt:null}:{prCiFailureDismissedAt:null};this.updateWorkspaceFromEvent(e,n)}catch(e){console.error(`[workspace store] restorePrAttention failed:`,e)}},queuedMessageKey(e,t){return`${e}:${t}`},getQueuedMessage(e,t){return t?this.queuedMessages[this.queuedMessageKey(e,t)]:void 0},queueMessage(e,t,n){let r=si(this);if(r)return r.queue(e,t,n);this.queuedMessages[this.queuedMessageKey(e,n)]={content:t,sessionId:n}},cancelQueuedMessage(e,t){let n=si(this);if(n)return n.cancel(e,t);t&&delete this.queuedMessages[this.queuedMessageKey(e,t)]},async flushQueuedMessage(e,t){let n=si(this);if(n)return n.flush(e,t);let r=this.getQueuedMessage(e,t);if(!r)return;if(this.autoLoopStates[e]?.auto_loop??this.workspaces.find(t=>t.id===e)?.autoLoop){let n=this.queuedMessageKey(e,t);if(this.autoLoopQueueTransfers[n])return;this.autoLoopQueueTransfers[n]=!0;try{await this.queueAutoLoopMessage(e,r.content),this.getQueuedMessage(e,t)?.content===r.content&&this.cancelQueuedMessage(e,t)}catch{}finally{delete this.autoLoopQueueTransfers[n]}return}let i=ns();i.isCompacting(e)||(this.cancelQueuedMessage(e,t),i.sendChatMessage(e,r.content,t))},setActiveAgentSession(e,t){this.activeAgentSessionIds[e]=t,delete this.settledAgentSessionIds[e]},markAgentTurnSettled(e,t){this.activeAgentSessionIds[e]===t&&(this.settledAgentSessionIds[e]=t)},isAgentTurnSettled(e){let t=this.activeAgentSessionIds[e];return t!==void 0&&this.settledAgentSessionIds[e]===t},clearActiveAgentSession(e,t){this.activeAgentSessionIds[e]===t&&(delete this.activeAgentSessionIds[e],delete this.settledAgentSessionIds[e])},clearActiveAgentSessionOwner(e){delete this.activeAgentSessionIds[e],delete this.settledAgentSessionIds[e]},updateWorkspaceFromEvent(e,t){J.set(e,(J.get(e)??0)+1);let n=this.workspaces.findIndex(t=>t.id===e);if(n>=0&&(this.workspaces[n]={...this.workspaces[n],...t}),t.status!==void 0){if(Li().setCompacting(e,t.status===`compacting`),e in this.agentLivenessLoaded){let t={...this.agentLivenessLoaded};delete t[e],this.agentLivenessLoaded=t}e===this.selectedWorkspaceId&&this.fetchWorkspaceDetails(e)}if(t.status&&[`completed`,`idle`,`error`,`quota`].includes(t.status)){let t=this.activityFeeds[e];if(t)for(let e of t)e.meta?.pending&&(e.meta.pending=!1);let n=this.subagents[e];if(n)for(let[e,t]of Object.entries(n))t.status===`running`&&(n[e]={...t,status:`done`})}}}}),fa=Me(`session-handoff`,{state:()=>({current:{},versions:{},selectedTargets:{},selectedSources:{},followedHandoffs:{},loadErrors:{}}),getters:{isActive:e=>t=>[`stopping`,`generating`,`starting`].includes(e.current[t]?.state??``),isBlocking:e=>t=>Ri(e.current[t])},actions:{apply(e,t=!1){let n=this.current[e.workspaceId];if(n&&Date.parse(n.updatedAt)>Date.parse(e.updatedAt))return;this.versions[e.workspaceId]=(this.versions[e.workspaceId]??0)+1,this.current[e.workspaceId]=e,this.loadErrors[e.workspaceId]=null,(t||this.isActive(e.workspaceId))&&(this.followedHandoffs[e.workspaceId]=e.id);let r=this.followedHandoffs[e.workspaceId]===e.id;Ri(e)||delete this.followedHandoffs[e.workspaceId];let i=Y(),a=`${e.id}:${e.targetSessionId}:${e.state===`cancelled`?`cancelled`:`restored`}`;r&&[`failed`,`interrupted`,`cancelled`].includes(e.state)&&i.selectedWorkspaceId===e.workspaceId&&this.selectedSources[e.workspaceId]!==a&&(this.selectedSources[e.workspaceId]=a,i.fetchSessions(e.workspaceId,e.sourceSessionId)),r&&e.state===`completed`&&e.targetSessionId&&i.selectedWorkspaceId===e.workspaceId&&this.selectedTargets[e.workspaceId]!==e.id&&(this.selectedTargets[e.workspaceId]=e.id,i.fetchSessions(e.workspaceId,e.targetSessionId))},async refresh(e){let t=this.versions[e]??0;try{let{handoff:n}=await V(`/api/workspaces/${e}/session-handoffs/current`);if((this.versions[e]??0)!==t)return;this.loadErrors[e]=null,n?this.apply(n):this.current[e]=null}catch(t){throw this.loadErrors[e]=t instanceof Error?t.message:String(t),t}},async start(e,t){let n=this.versions[e]??0,{handoff:r}=await V(`/api/workspaces/${e}/session-handoffs`,{method:`POST`,body:t}),i=this.current[e];return this.apply((this.versions[e]??0)!==n&&i?.id===r.id?i:r,!0),r},async decide(e,t,n){let r=this.versions[e]??0,{handoff:i}=await V(`/api/workspaces/${e}/session-handoffs/${t}/decision`,{method:`POST`,body:{action:n}}),a=this.current[e];return this.apply((this.versions[e]??0)!==r&&a?.id===i.id?a:i,!0),i}}}),pa=`custom:`,ma=RegExp(`^[A-Za-z0-9_-]{12}$`),ha=[`.wav`,`.mp3`,`.ogg`,`.webm`],ga=[...Object.values({".wav":`audio/wav`,".mp3":`audio/mpeg`,".ogg":`audio/ogg`,".webm":`audio/webm`}),...ha].join(`,`),_a=2097152;function va(e){return`${pa}${e}`}function ya(e){return typeof e==`string`&&e.startsWith(`custom:`)&&ma.test(e.slice(7))}function ba(e){return ya(e)?e.slice(7):``}function xa(e){let t=/\.[^.\\/]+$/.exec(e)?.[0]?.toLowerCase()??``;return ha.includes(t)?t:null}var Sa=`/sounds`,Ca=[{id:`neutral.wav`,labelKey:`settings.notificationSoundBasic`},{id:`ready.wav`,labelKey:`settings.notificationSoundReady`}],wa=`neutral.wav`,Ta=`inherit`,Ea=[`audioPrCiFailedSound`,`audioPrCiRecoveredSound`,`audioPrChangesRequestedSound`,`audioPrApprovedSound`,`audioPrMergeConflictSound`,`audioPrReadyToMergeSound`,`audioPrMergedSound`],Da=[`audioPrCiFailedEnabled`,`audioPrCiFailedVolume`,`audioPrCiRecoveredEnabled`,`audioPrCiRecoveredVolume`,`audioPrChangesRequestedEnabled`,`audioPrChangesRequestedVolume`,`audioPrApprovedEnabled`,`audioPrApprovedVolume`,`audioPrMergeConflictEnabled`,`audioPrMergeConflictVolume`,`audioPrReadyToMergeEnabled`,`audioPrReadyToMergeVolume`,`audioPrMergedEnabled`,`audioPrMergedVolume`],Oa={audioPrCiFailedSound:Ta,audioPrCiRecoveredSound:Ta,audioPrChangesRequestedSound:Ta,audioPrApprovedSound:Ta,audioPrMergeConflictSound:Ta,audioPrReadyToMergeSound:Ta,audioPrMergedSound:Ta,audioPrCiFailedEnabled:!1,audioPrCiFailedVolume:1,audioPrCiRecoveredEnabled:!1,audioPrCiRecoveredVolume:1,audioPrChangesRequestedEnabled:!1,audioPrChangesRequestedVolume:1,audioPrApprovedEnabled:!1,audioPrApprovedVolume:1,audioPrMergeConflictEnabled:!1,audioPrMergeConflictVolume:1,audioPrReadyToMergeEnabled:!1,audioPrReadyToMergeVolume:1,audioPrMergedEnabled:!1,audioPrMergedVolume:1},ka=new Map;function Aa(e){let t=new Map;for(let n of e){let e=ya(n)?n:va(n);ya(e)&&t.set(e,ka.get(e)??Ma(e))}ka.clear();for(let[e,n]of t)ka.set(e,n)}function ja(e,t){ka.has(e)&&ka.set(e,t)}function Ma(e){return`/api/sounds/${ba(e)}/file`}function Na(e){return ya(e)?ka.has(e):Ca.some(t=>t.id===e)}function Pa(e){return typeof e==`string`&&(ya(e)||Ca.some(t=>t.id===e))}function Fa(e){return Pa(e)?e:wa}function Ia(e){return e===`none`||e===`inherit`||Pa(e)?e:Ta}function La(e){return e&&Na(e)?e:wa}function Ra(e){if(e===`none`)return null;if(e!==`inherit`)return typeof e==`string`&&Na(e)?e:void 0}function za(e){let t=La(e);return ya(t)?ka.get(t)??Ma(t):`${Sa}/${t}`}var Ba=`mod+shift+x`,Va=[`mod`,`ctrl`,`meta`,`alt`,`shift`],Ha=new Set([`mod+w`,`mod+shift+w`,`ctrl+w`,`ctrl+shift+w`,`meta+w`,`meta+shift+w`]),Ua=new Set([`control`,...Va]);function Wa(e){return Ha.has(e)}function Ga(e){if(typeof e!=`string`||e.length===0||e!==e.toLowerCase()||Wa(e))return null;let t=e.split(`+`);if(t.some(e=>e.length===0))return null;let n=t.at(-1);if(!n||!/^[a-z0-9][a-z0-9_-]*$/.test(n)||Ua.has(n))return null;let r=t.slice(0,-1),i=new Set,a=-1;for(let e of r){let t=Va.indexOf(e);if(t<=a)return null;a=t,i.add(e)}return{modifiers:i,key:n}}var Ka=new Set([`control`,`meta`,`alt`,`shift`]),qa={" ":`space`,"+":`plus`,"-":`minus`,"=":`equal`,",":`comma`,".":`period`,"/":`slash`,"\\":`backslash`,";":`semicolon`,"'":`quote`,"[":`bracketleft`,"]":`bracketright`,"`":`backquote`};function Ja(e){let t=qa[e]??e.toLowerCase();return/^[a-z0-9][a-z0-9_-]*$/.test(t)?t:null}function Ya(e=globalThis.navigator?.platform??``){return/mac|iphone|ipad|ipod/i.test(e)?`mac`:`other`}function Xa(e,t){if(e.key===`Escape`)return{status:`cancelled`};if(Ka.has(e.key.toLowerCase()))return{status:`pending`};let n=Ja(e.key);if(!n)return{status:`pending`};let r=new Set;(t===`mac`?e.metaKey:e.ctrlKey)&&r.add(`mod`),t===`mac`&&e.ctrlKey&&r.add(`ctrl`),t===`other`&&e.metaKey&&r.add(`meta`),e.altKey&&r.add(`alt`),e.shiftKey&&r.add(`shift`);let i=[...Va.filter(e=>r.has(e)),n].join(`+`);return Wa(i)?{status:`reserved`}:{status:`accepted`,shortcut:i}}function Za(e,t,n){let r=Ga(t),i=Ja(e.key);if(!r||!i||i!==r.key)return!1;let a=r.modifiers.has(`ctrl`)||n===`other`&&r.modifiers.has(`mod`),o=r.modifiers.has(`meta`)||n===`mac`&&r.modifiers.has(`mod`);return e.ctrlKey===a&&e.metaKey===o&&e.altKey===r.modifiers.has(`alt`)&&e.shiftKey===r.modifiers.has(`shift`)}function Qa(e){return{space:`Space`,arrowup:`↑`,arrowdown:`↓`,arrowleft:`←`,arrowright:`→`}[e]??e.toUpperCase()}function $a(e,t){let n=Ga(e);return n?t===`mac`?`${[n.modifiers.has(`mod`)||n.modifiers.has(`meta`)?`⌘`:``,n.modifiers.has(`ctrl`)?`⌃`:``,n.modifiers.has(`alt`)?`⌥`:``,n.modifiers.has(`shift`)?`⇧`:``].join(``)}${Qa(n.key)}`:[n.modifiers.has(`mod`)||n.modifiers.has(`ctrl`)?`Ctrl`:``,n.modifiers.has(`meta`)?`Meta`:``,n.modifiers.has(`alt`)?`Alt`:``,n.modifiers.has(`shift`)?`Shift`:``,Qa(n.key)].filter(Boolean).join(`+`):e}var eo=`.worktrees`,to=[`commit`,`push`,`publish`],no={commit:`manual`,push:`manual`,publish:`manual`};function ro(e){return typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.entries(e).every(([e,t])=>to.includes(e)&&(t===`manual`||t===`automatic`))}function io(...e){let t={...no};for(let n of e)ro(n)&&Object.assign(t,n);return t}function ao(e){return btoa(e).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``)}var oo=Me(`settings`,{state:()=>({global:{workflowPolicy:{...no},onboardingComplete:!1,defaultModelByEngine:{"claude-code":`auto`,codex:`auto`},dangerouslySkipPermissions:!0,prPromptTemplate:``,reviewPromptTemplate:``,ciFixPromptTemplate:``,finalizationPrompt:``,notionInitialPromptTemplate:``,sentryInitialPromptTemplate:``,gitConventions:``,editorCommand:``,fileManagerCommand:``,terminalCommand:``,autoPurgeOnPrMerged:!1,autoLoopMaxRetries:5,awaitingUserReminderMinutes:0,activityDigestEnabled:!0,wsEventsRetentionDays:0,wsEventsKeepPerWorkspace:0,browserNotifications:!0,audioNotifications:!1,audioQuestionNotifications:!1,audioWorkspaceCreatedNotifications:!1,audioAgentErrorNotifications:!1,audioNotificationSound:`neutral.wav`,audioQuestionSound:`inherit`,audioWorkspaceCreatedSound:`inherit`,audioAgentErrorSound:`inherit`,...Oa,audioNotificationVolume:1,audioQuestionVolume:1,audioWorkspaceCreatedVolume:1,audioAgentErrorVolume:1,notionStatusProperty:``,notionInProgressStatus:``,notionAssigneeProperty:``,notionUserId:``,defaultPermissionModeByEngine:{"claude-code":`plan`,codex:`plan`},notionMcpKey:``,sentryMcpKey:``,bitbucketToken:``,bitbucketUsername:``,notionEnabled:!1,sentryEnabled:!1,showThinkingBlocks:!0,whipEnabled:!1,whipShortcut:Ba,whipVolume:1,tags:[],branchPrefixes:[],setupScript:``,cleanupScript:``,cleanupScriptMode:`no-tasks`,cleanupScriptOnlyOnChanges:!1,archiveScript:``,changeSourceBranchScript:``,sessionEndedScript:``,prMergedScript:``,autoLoopDisabledScript:``,worktreesPath:eo,worktreesPrefixByProject:!1,voiceEnabled:!1,voicePttKey:`alt`,voiceLanguage:`auto`,voiceModel:null,voiceCommandPath:``,voiceFfmpegPath:``,voiceTemperature:0,voicePrompt:``,voiceTranslateToEnglish:!1,voiceSuppressNonSpeechTokens:!0,flattenWorkspaceList:!1,skillSuite:`standard`,customReviewTemplate:``,customAutoLoopReviewGate:``,customAutoLoopGroomingIntro:``,customQaPromptTemplate:``,customBrainstormingInstruction:``},voiceModels:[],voiceModelsLoading:!1,voiceModelsDir:``,voiceRuntime:null,activeMcpServers:[],projects:[],loading:!1,loaded:!1,loadError:null,showVerboseSystemMessages:localStorage.getItem(`kobo:showVerboseSystemMessages`)===`true`}),getters:{getProjectByPath:e=>t=>e.projects.find(e=>e.path===t)??null,projectPaths:e=>e.projects.map(e=>e.path)},actions:{_assertLoaded(){if(!this.loaded)throw Error(`Settings were never loaded successfully — refusing to overwrite the stored configuration`)},async fetchSettings(){this.loading=!0;try{let e=await V(`/api/settings`);this.global=e.global,this.projects=e.projects,this.loadError=null,this.loaded=!0}catch(e){this.loadError=e instanceof Error?e.message:String(e),this.loaded=!1,console.error(`[settings store] fetchSettings failed:`,e)}finally{this.loading=!1}},async fetchActiveMcpServers(){try{this.activeMcpServers=await V(`/api/settings/mcp-servers`)}catch(e){console.error(`[settings store] fetchActiveMcpServers failed:`,e),this.activeMcpServers=[]}},async fetchGlobalDefaults(){return V(`/api/settings/defaults`)},async previewRetention(e,t){return V(`/api/settings/ws-events-retention-preview?days=${e}&keep=${t}`)},async updateGlobal(e){this._assertLoaded(),this.global=await V(`/api/settings/global`,{method:`PUT`,body:e})},async upsertProject(e,t){this._assertLoaded();let n=ao(e),r=await V(`/api/settings/projects/${n}`,{method:`PUT`,body:t}),i=this.projects.findIndex(t=>t.path===e);i>=0?this.projects[i]=r:this.projects.push(r)},toggleVerboseSystemMessages(){this.setVerboseSystemMessages(!this.showVerboseSystemMessages)},setVerboseSystemMessages(e){this.showVerboseSystemMessages=e,localStorage.setItem(`kobo:showVerboseSystemMessages`,String(e))},async deleteProject(e){this._assertLoaded();let t=ao(e);await V(`/api/settings/projects/${t}`,{method:`DELETE`}),this.projects=this.projects.filter(t=>t.path!==e)},async fetchVoiceModels(){this.voiceModelsLoading=!0;try{let e=await V(`/api/voice/models`);this.voiceModels=e.available,this.voiceModelsDir=e.modelsDir,this.global.voiceModel=e.activeModel}catch(e){console.error(`[settings store] fetchVoiceModels failed:`,e)}finally{this.voiceModelsLoading=!1}},async cancelVoiceModelDownload(e){try{await V(`/api/voice/models/${encodeURIComponent(e)}/download`,{method:`DELETE`})}catch(e){if(!(e instanceof Ie)||e.status!==404)throw e}await this.fetchVoiceModels()},async fetchVoiceRuntime(){try{this.voiceRuntime=await V(`/api/voice/runtime`)}catch(e){console.error(`[settings store] fetchVoiceRuntime failed:`,e)}},async downloadVoiceModel(e){await V(`/api/voice/models/${encodeURIComponent(e)}/download`,{method:`POST`}),await this.fetchVoiceModels()},async deleteVoiceModel(e){await V(`/api/voice/models/${encodeURIComponent(e)}`,{method:`DELETE`}),await this.fetchVoiceModels()}}});function so(e,t){let n=e=>e.split(`.`).map(e=>Number.parseInt(e,10)||0),r=n(e),i=n(t),a=Math.max(r.length,i.length);for(let e=0;e<a;e++){let t=(r[e]??0)-(i[e]??0);if(t!==0)return t}return 0}var co=`kobo:dismissed-update-version`,lo=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$/,uo=e=>typeof e==`string`&&lo.test(e),fo=Me(`update`,()=>{let e=s(null),t=s(null),n=s(localStorage.getItem(co)),r=s(null),i=s(null),a=s(`unknown`),o=null,c=E(()=>t.value&&e.value&&so(t.value,e.value)>0&&t.value!==n.value?t.value:null);function l(n){if(!uo(n.currentVersion))return;let o=typeof n.lastAttemptAt==`string`&&Number.isFinite(Date.parse(n.lastAttemptAt))?n.lastAttemptAt:null;r.value&&(!o||Date.parse(o)<Date.parse(r.value))||(e.value=n.currentVersion,uo(n.latestVersion)&&(t.value=n.latestVersion),o&&(r.value=o),typeof n.lastSuccessAt==`string`&&(i.value=n.lastSuccessAt),(n.checkStatus===`success`||n.checkStatus===`failed`||n.checkStatus===`unknown`)&&(a.value=n.checkStatus))}function u(){return o||(o=(async()=>{try{let e=await U(`/api/changelog`);e.ok&&l(await e.json())}catch{}finally{o=null}})(),o)}function d(){let e=c.value;e&&(n.value=e,localStorage.setItem(co,e))}return{currentVersion:e,latestVersion:t,availableVersion:c,lastAttemptAt:r,lastSuccessAt:i,checkStatus:a,applySnapshot:l,refreshSnapshot:u,dismissUpdate:d}}),po=new Set([`output`,`complete`,`error`]);function mo(e){if(!e.startsWith(`hook:`))return null;let t=e.slice(5),n=t.lastIndexOf(`:`);if(n<=0)return null;let r=t.slice(0,n),i=t.slice(n+1);return po.has(i)?{event:r,kind:i}:null}function ho(e){return`hook:${e}`}function go(e){return e.startsWith(`hook:`)}var _o=6e3,vo=typeof window<`u`&&window.parent!==window&&new URLSearchParams(window.location.search).get(`pane`)===`1`;function yo(e,t=window.location.pathname){return`${t}?pane=1#/workspace/${encodeURIComponent(e)}`}function bo(e){let t=Number(e??50);return Number.isFinite(t)?Math.max(25,Math.min(75,t)):50}function xo(e,t){return e&&e!==t?{left:e,right:t}:{left:t}}var So=null;function Co(e,t){return t.name===`split`&&e.name===`split`&&e.fullPath===So}async function wo(e,t){let n={name:`split`,query:t},r=e.resolve(n).fullPath;if(!(e.currentRoute.value.fullPath===r||So)){So=r;try{await e.replace(n)}finally{So=null}}}function To(e,t){return e||Object.keys(t).length>0}var Eo=new Map,Do=[],Oo=!1;function ko(e){let t=za(e),n=Eo.get(t);return n||(n=new Audio(t),Eo.set(t,n)),n}function Ao(e,t){let n=new Audio(za(La(e)));n.preload=`auto`,n.volume=t,n.play().catch(()=>{})}function jo(){vo||`Notification`in window&&Notification.permission==="default"&&Notification.requestPermission()}function Mo(e){return typeof e!=`number`||!Number.isFinite(e)?1:Math.max(0,Math.min(1,e))}function No(){let e=Do.shift();if(!e){Oo=!1;return}Oo=!0;let t=ko(La(e.soundId));t.volume=e.volume,t.currentTime=0;let n=!1,r=()=>{n||(n=!0,t.removeEventListener(`ended`,r),t.removeEventListener(`error`,r),No())};t.addEventListener(`ended`,r,{once:!0}),t.addEventListener(`error`,r,{once:!0}),t.play().catch(r)}function Po(e,t){let n={soundId:La(e),volume:Mo(t)};if(document.visibilityState===`hidden`){Ao(n.soundId,n.volume);return}Do.push(n),Oo||No()}function Fo(e,t){let n=ko(La(e));n.volume=Mo(t),n.currentTime=0,n.play().catch(()=>{})}function Io(e,t,n,r,i,a){if(vo)return;let o=oo();if(!document.hasFocus()&&o.global.browserNotifications&&`Notification`in window&&Notification.permission===`granted`){let r=new Notification(e,{body:t,icon:`/favicon.ico`});n&&(r.onclick=()=>{window.focus(),window.location.hash=`#/workspace/${n}`,r.close()})}(a??o.global.audioNotifications)&&r!==null&&Po(r&&r.length>0?r:o.global.audioNotificationSound??`neutral.wav`,i??o.global.audioNotificationVolume)}function Lo(e,t){let n=[{label:t.retryLabel,color:`white`,handler:t.onRetry}];t.detailsLabel&&t.onDetails&&n.push({label:t.detailsLabel,color:`white`,handler:t.onDetails}),n.push({label:t.dismissLabel,color:`grey-5`}),ki.create({type:`negative`,position:`top`,multiLine:!0,message:e,timeout:t.timeout??0,actions:n})}function Ro(e){return(typeof e==`string`?Array.from(e.replace(/[\p{Cc}\s]+/gu,` `).replace(/\p{Cs}/gu,`�`).trim()).slice(0,100).join(``):``)||`External MCP client`}function zo(e){if(!e||typeof e!=`object`)return;let t=e;if(!(t.kind!==`mcp`||t.transport!==`http`&&t.transport!==`stdio`))return{kind:`mcp`,clientName:Ro(t.clientName),transport:t.transport}}var Bo=new Map,Vo=Me(`devServer`,{state:()=>({statuses:{},logs:{}}),getters:{getStatus:e=>t=>e.statuses[t]??null},actions:{async fetchStatus(e){let t=(Bo.get(e)??0)+1;Bo.set(e,t);let n=this.statuses[e];try{let r=await V(`/api/dev-server/${e}/status`);Bo.get(e)===t&&this.statuses[e]===n&&(this.statuses[e]=r)}catch(e){console.error(`[dev-server store] fetchStatus failed:`,e)}},async startDevServer(e){try{let t=await U(`/api/dev-server/${e}/start`,{method:`POST`});if(!t.ok)throw await H(t);let n=await t.json();this.statuses[e]=n}catch(e){throw console.error(`[dev-server store] startDevServer failed:`,e),e}},async stopDevServer(e){try{let t=await U(`/api/dev-server/${e}/stop`,{method:`POST`});if(!t.ok)throw await H(t);let n=await t.json();this.statuses[e]=n}catch(e){throw console.error(`[dev-server store] stopDevServer failed:`,e),e}},async fetchLogs(e,t=200){try{let n=await U(`/api/dev-server/${e}/logs?tail=${t}`);if(!n.ok)throw await H(n);let r=await n.json();return this.logs[e]=r.logs,r.logs}catch(e){return console.error(`[dev-server store] fetchLogs failed:`,e),``}},updateFromWsEvent(e,t){this.statuses[e]=t}}}),X=rt.global.t,Ho=new Ai,Uo=0,Wo={"pr:ci-failed":{soundKey:`audioPrCiFailedSound`,enabledKey:`audioPrCiFailedEnabled`,volumeKey:`audioPrCiFailedVolume`},"pr:ci-recovered":{soundKey:`audioPrCiRecoveredSound`,enabledKey:`audioPrCiRecoveredEnabled`,volumeKey:`audioPrCiRecoveredVolume`},"pr:changes-requested":{soundKey:`audioPrChangesRequestedSound`,enabledKey:`audioPrChangesRequestedEnabled`,volumeKey:`audioPrChangesRequestedVolume`},"pr:approved":{soundKey:`audioPrApprovedSound`,enabledKey:`audioPrApprovedEnabled`,volumeKey:`audioPrApprovedVolume`},"pr:merge-conflict":{soundKey:`audioPrMergeConflictSound`,enabledKey:`audioPrMergeConflictEnabled`,volumeKey:`audioPrMergeConflictVolume`},"pr:ready-to-merge":{soundKey:`audioPrReadyToMergeSound`,enabledKey:`audioPrReadyToMergeEnabled`,volumeKey:`audioPrReadyToMergeVolume`},"pr:merged":{soundKey:`audioPrMergedSound`,enabledKey:`audioPrMergedEnabled`,volumeKey:`audioPrMergedVolume`}};function Go(e,t,n){let r=oo().global,i=Wo[n];Io(e,void 0,t,Ra(r[i.soundKey]),Number(r[i.volumeKey]),!!r[i.enabledKey])}function Ko(e,t){let n=[];return t&&n.push({label:X(`pr.openPr`),color:`white`,noDismiss:!0,handler:()=>window.open(t,`_blank`)}),n.push({label:X(`pr.openWorkspace`),color:`white`,noDismiss:!0,handler:()=>{window.location.hash=`#/workspace/${e}`}}),n.push({label:X(`pr.dismiss`),color:`white`}),n}var Z=null,qo=null,Jo=0,Yo=!1,Xo=!1,Zo=!1;function Qo(e){Zo=e}function $o(e,t,n){if(t.kind!==`session:started`)return;let r=Y();if(n){r.setActiveAgentSession(e,n);let t=r.peekPending(e);t&&t.agentSessionId===n&&r.dequeuePending(e)}let i=r.workspaces.find(t=>t.id===e);i&&(i.status===`completed`||i.status===`idle`||i.status===`error`||i.status===`quota`)&&r.updateWorkspaceFromEvent(e,{status:`executing`}),!Zo&&n&&r.selectedWorkspaceId===e&&r.selectedSessionId!==n&&r.fetchSessions(e,n).catch(e=>{console.error(`[websocket] fetchSessions on session:started failed:`,e)})}function es(e,t){let n=Y();if(t.kind===`tool:call`&&t.name===`TodoWrite`){let r=t.input?.todos;return Array.isArray(r)&&n.updateAgentTodos(e,r.map(e=>({content:typeof e.content==`string`?e.content:``,status:typeof e.status==`string`?e.status:`pending`,activeForm:typeof e.activeForm==`string`?e.activeForm:void 0}))),!0}if(t.kind===`tool:call`&&t.name===`TaskCreate`){let r=t.input??{};return n.agentTaskCreate(e,t.toolCallId,{subject:typeof r.subject==`string`?r.subject:void 0,description:typeof r.description==`string`?r.description:void 0,activeForm:typeof r.activeForm==`string`?r.activeForm:void 0}),!0}if(t.kind===`tool:result`&&typeof t.output==`string`){let r=t.output.match(/^Task #(\d+) created successfully/);if(r)return n.agentTaskSetNumber(e,t.toolCallId,Number(r[1])),!0}if(t.kind===`tool:call`&&t.name===`TaskUpdate`){let r=t.input??{},i=r.task_id??r.taskId??r.id,a=typeof i==`number`?i:typeof i==`string`?Number(i):NaN;return Number.isFinite(a)&&n.agentTaskUpdate(e,a,{status:typeof r.status==`string`?r.status:void 0,content:typeof r.subject==`string`?r.subject:void 0,activeForm:typeof r.activeForm==`string`?r.activeForm:void 0}),!0}return!1}function ts(e,t,n,r,i){let a=Li(),o=Y().activeAgentSessionIds[e],s=!i||!o||i===o;if(t.kind===`session:compacting`){!Zo&&s&&a.setCompacting(e,t.active);return}a.append(e,t,n,r,i,!Zo),!Zo&&s&&(t.kind===`session:compacted`||t.kind===`message:text`||t.kind===`tool:call`)&&a.setCompacting(e,!1),$o(e,t,i??void 0);let c=Y();if(t.kind===`session:user-input-requested`){if(t.requestKind===`question`?c.enqueuePending(e,{kind:`question`,agentSessionId:i??null,toolCallId:t.toolCallId,toolName:t.toolName,input:t.payload}):c.enqueuePending(e,{kind:`permission`,agentSessionId:i??null,toolCallId:t.toolCallId,toolName:t.toolName,toolInput:t.payload}),ns().isCompacting(e)||c.updateWorkspaceFromEvent(e,{status:`awaiting-user`}),!Zo){let n=c.workspaces.find(t=>t.id===e)?.name??``,r=t.requestKind===`question`?X(`notification.agentQuestion`,{name:n}):X(`notification.agentPermissionRequest`,{name:n}),i=oo().global;Io(r,void 0,e,t.requestKind===`question`?i.audioQuestionSound:void 0,t.requestKind===`question`?i.audioQuestionVolume:void 0,i.audioQuestionNotifications)}return}if(t.kind===`subagent:progress`){c.upsertSubagent(e,{toolUseId:t.toolCallId,threadIds:t.threadIds,taskId:t.taskId,sessionId:i,status:t.status,phase:t.phase,ambient:t.ambient,description:t.description,taskType:t.taskType,lastToolName:t.lastToolName,totalTokens:t.totalTokens,toolUses:t.toolUses,durationMs:t.durationMs});return}if(!es(e,t)){if(t.kind===`tool:call`&&t.name===`Bash`){let n=t.input,r=`${n?.command??``} ${n?.description??``}`;/\bgit\b|commit|push|pull|merge|rebase|checkout|branch/i.test(r)&&c.triggerGitRefresh(),/\bgit\s+branch\s+-m\b/i.test(r)&&setTimeout(()=>{c.resyncWorkspaceBranch(e).catch(e=>{console.error(`[websocket] Branch resync failed:`,e)})},2500),/\bgh\s+pr\s+create\b/i.test(r)&&setTimeout(()=>c.triggerGitRefresh(),3e3)}if(t.kind!==`session:started`){if(t.kind===`turn:completed`){i&&c.markAgentTurnSettled(e,i);return}if(t.kind===`session:ended`){i&&c.clearPendingForSession(e,i);let n=c.activeAgentSessionIds[e];if(t.superseded===!0||typeof i==`string`&&i.length>0&&n!==void 0&&i!==n){si(c)||c.cancelQueuedMessage(e,i),i&&(c.clearActiveAgentSession(e,i),c.finalizeRunningSubagents(e,i));return}Zo||a.setCompacting(e,!1),i?c.clearActiveAgentSession(e,i):c.clearActiveAgentSessionOwner(e);let r=c.workspaces.find(t=>t.id===e)?.status===`quota`?`quota`:t.reason===`completed`?`completed`:t.reason===`error`?`error`:`idle`;c.updateWorkspaceFromEvent(e,{status:r}),i&&t.reason===`completed`&&!si(c)&&c.flushQueuedMessage(e,i),c.finalizeRunningSubagents(e),c.fetchWorkspaces(),!Zo&&t.reason!==`killed`&&t.reason!==`error`&&c.autoLoopStates[e]?.auto_loop!==!0&&Io(X(`notification.agentFinished`,{name:c.workspaces.find(t=>t.id===e)?.name??``}),void 0,e);return}if(t.kind===`error`&&(t.category===`quota`&&(c.updateWorkspaceFromEvent(e,{status:`quota`}),c.fetchWorkspaces()),!Zo)){let t=oo().global;Io(X(`notification.agentError`,{name:c.workspaces.find(t=>t.id===e)?.name??``}),void 0,e,t.audioAgentErrorSound,t.audioAgentErrorVolume,t.audioAgentErrorNotifications)}}}}var ns=Me(`websocket`,{state:()=>({connected:!1,reconnecting:!1,reconnectAttempt:0,lastEventId:null,pendingSyncRequests:[],_replaying:!1,_drainInProgress:!1,_refreshAfterSync:!1,_workspacesToRefreshAfterDrain:new Set}),actions:{connect(){if(Z)return;if(Yo=!0,Xo||(Xo=!0,window.addEventListener(`online`,()=>{Yo&&this.connect()}),window.addEventListener(`offline`,()=>{this.connected=!1,this.reconnecting=Yo,this.pendingSyncRequests=[],Ho.disconnect(X(`network.login.unreachable`));let e=Z;Z=null,e?.close(),qo&&=(clearTimeout(qo),null)})),!navigator.onLine){this.connected=!1,this.reconnecting=!0,this.pendingSyncRequests=[];return}let e=$r(`${window.location.protocol===`https:`?`wss:`:`ws:`}//${window.location.host}/ws`,Xr()),t=new WebSocket(e);Z=t,t.addEventListener(`open`,()=>{if(Z!==t)return;this.connected=!0,fo().refreshSnapshot(),this.reconnecting=!1,Jo=0,this.reconnectAttempt=0;let e=Y().workspaces.map(e=>e.id);for(let t of e)this._send({type:`subscribe`,payload:{workspaceId:t}});this._refreshAfterSync=!0,this.lastEventId?this._send({type:`sync:request`,payload:{lastEventId:this.lastEventId,workspaceIds:e}}):(this._refreshAfterSync=!1,this.refreshLiveState())}),t.addEventListener(`message`,e=>{if(Z===t)try{let t=JSON.parse(e.data);this._routeMessage(t)}catch{}}),t.addEventListener(`close`,()=>{Z===t&&(Ho.disconnect(X(`network.login.unreachable`)),this.connected=!1,this.pendingSyncRequests=[],Z=null,Yo&&this._scheduleReconnect())}),t.addEventListener(`error`,()=>{})},async refreshLiveState(){let e=Y(),t=new Set(e.workspaces.map(e=>e.id));if(await e.fetchWorkspacesInfo(),!this.connected)return;for(let n of e.workspaces)t.has(n.id)||(this._refreshAfterSync=!0,this.subscribe(n.id));let n=Vo(),r=new Set(Object.keys(n.statuses));e.selectedWorkspaceId&&r.add(e.selectedWorkspaceId);let i=new Set(Object.keys(e.autoLoopMessages));e.selectedWorkspaceId&&i.add(e.selectedWorkspaceId);let a=fa(),o=new Set(Object.keys(a.current));e.selectedWorkspaceId&&o.add(e.selectedWorkspaceId),await Promise.allSettled([e.fetchAutoLoopStates(),...[...o].map(e=>a.refresh(e)),...[...i].map(t=>e.fetchAutoLoopMessages(t)),...[...r].map(e=>n.fetchStatus(e))])},disconnect(){Ho.disconnect(X(`network.login.unreachable`)),Yo=!1,this.pendingSyncRequests=[],qo&&=(clearTimeout(qo),null),Z&&=(Z.close(),null),this.connected=!1,this.reconnecting=!1,this.reconnectAttempt=0},subscribe(e){this._drainInProgress&&this._workspacesToRefreshAfterDrain.add(e),this._send({type:`subscribe`,payload:{workspaceId:e}}),this._send({type:`sync:request`,payload:{workspaceIds:[e]}})},unsubscribe(e){this._send({type:`unsubscribe`,payload:{workspaceId:e}})},subscribeChannel(e){this._send({type:`subscribe`,payload:{workspaceId:e}})},isCompacting(e){let t=Y();return(t.workspaces.find(t=>t.id===e)??t.archivedWorkspaces.find(t=>t.id===e))?.status===`compacting`||Li().isCompacting(e)},sendChatMessage(e,t,n,r,i=!1,a){if(this.isCompacting(e)||!this._send({type:`chat:message`,payload:{workspaceId:e,content:t,sessionId:n,agentPermissionModeOverride:r,force:i,clientMessageId:a}}))return!1;let o=Y(),s=o.workspaces.find(t=>t.id===e);return s&&(s.status===`completed`||s.status===`idle`||s.status===`error`||s.status===`quota`)&&o.updateWorkspaceFromEvent(e,{status:`executing`}),!0},sendChatMessageConfirmed(e,t,n){let r=`${Array.from(crypto.getRandomValues(new Uint32Array(4)),e=>e.toString(16)).join(`-`)}-${++Uo}`,i=Ho.wait(e,r,X(`network.login.unreachable`));return this.sendChatMessage(e,t,n,void 0,!1,r)||Ho.settle(e,r,Error(X(`network.login.unreachable`))),i},_send(e){if(Z&&Z.readyState===WebSocket.OPEN&&navigator.onLine){try{Z.send(JSON.stringify(e))}catch{return!1}if(e.type===`sync:request`){let t=e.payload;this.pendingSyncRequests.push([...t?.workspaceIds??Y().workspaces.map(e=>e.id)])}return!0}return!1},isSyncPending(e){return this.pendingSyncRequests.some(t=>t.includes(e))},isConnected(){return Z!==null&&Z.readyState===WebSocket.OPEN},_scheduleReconnect(){if(qo)return;if(!Yo||!navigator.onLine){this.reconnecting=Yo;return}let e=Math.min(1e3*2**Jo,3e4),t=Math.round(e*(.8+Math.random()*.4));Jo++,this.reconnecting=!0,this.reconnectAttempt=Jo,Jo===4&&Xr()&&ti(),qo=setTimeout(()=>{qo=null,this.connect()},t)},_routeMessage(e){let t=Y();e.replayable!==!1&&e.id?this.lastEventId=e.id:e.replayable!==!1&&e.eventId&&(this.lastEventId=e.eventId);let n=e.payload??{},r=e.workspaceId??n.workspaceId??``,i=mo(e.type);if(i){let n=ho(i.event),a=e.createdAt??new Date().toISOString(),o=X(`chat.hookScript`,{event:i.event}),s=i.kind===`output`?e.payload?.text??``:i.kind===`complete`?e.payload?.hadOutput===!1?X(`chat.scriptDone`):X(`chat.scriptComplete`,{phase:o}):X(`chat.scriptError`,{phase:o,message:e.payload?.message??X(`chat.unknownError`)});t.addActivityItem(r,{id:e.id??`${n}-${i.kind}-${Date.now()}`,type:`text`,content:s,timestamp:a,meta:{sender:n}});return}switch(e.type){case`workspace:handoff`:{if(!r||this._replaying)break;let e=n.handoff;e?.workspaceId===r&&typeof e.id==`string`&&typeof e.state==`string`&&fa().apply(e);break}case`kobo:update-checked`:fo().applySnapshot(n);break;case`workspace:configuration`:if(!r||this._replaying||typeof n.engine!=`string`||typeof n.model!=`string`||typeof n.reasoningEffort!=`string`||![`plan`,`bypass`,`strict`,`interactive`].includes(n.agentPermissionMode))break;t.updateWorkspaceFromEvent(r,{engine:n.engine,model:n.model,reasoningEffort:n.reasoningEffort,agentPermissionMode:n.agentPermissionMode});break;case`workspace:status`:{if(!r||this._replaying||typeof n.status!=`string`)break;let e=t.activeAgentSessionIds[r];if(e&&typeof n.sessionId==`string`&&e!==n.sessionId)break;t.updateWorkspaceFromEvent(r,{status:n.status});break}case`chat:accepted`:{if(typeof n.clientMessageId==`string`){r&&Ho.settle(r,n.clientMessageId);break}let e=typeof n.sessionId==`string`?n.sessionId:void 0;r&&e&&t.cancelQueuedMessage(r,e);break}case`chat:rejected`:{if(typeof n.clientMessageId==`string`){r&&Ho.settle(r,n.clientMessageId,Error(typeof n.message==`string`?n.message:X(`network.login.unreachable`)));break}let e=typeof n.sessionId==`string`?n.sessionId:void 0,i=typeof n.content==`string`?n.content:void 0,a=typeof n.message==`string`?n.message:X(`network.login.unreachable`);if(r&&i){let n=(t.activityFeeds[r]??[]).find(e=>e.meta?.sender===`user`&&e.meta?.pending&&e.content===i);n&&t.removeActivityItem(r,n.id),e&&t.queueMessage(r,i,e)}ki.create({type:`negative`,message:a,position:`top`,timeout:6e3});break}case`agent:event`:{if(!r)break;let t=e.createdAt;ts(r,n,t,e.id??e.eventId,e.sessionId??null);break}case`agent:progress`:n.tasks&&Array.isArray(n.tasks)&&(t.tasks=n.tasks);break;case`user:message`:if(r&&typeof n.clientMessageId==`string`&&Ho.settle(r,n.clientMessageId),r&&n.content){let i=n.content,a=n.sender??`user`,o=zo(n.source),s=e.sessionId,c=e.id??e.eventId??`user-${Date.now()}`,l=typeof e.createdAt==`string`?e.createdAt:void 0,u=l??new Date().toISOString(),d=t.activityFeeds[r]??[];if(!o&&a===`user`&&d.some(e=>e.meta?.sender===`user`&&e.content===i&&e.meta?.pending)){let e=d.findIndex(e=>e.meta?.sender===`user`&&e.content===i&&e.meta?.pending);e>=0&&(d[e]={...d[e],id:c,sessionId:s,...l?{timestamp:l}:{}})}else t.addActivityItem(r,{id:c,type:`text`,content:i,timestamp:u,sessionId:s,meta:{sender:a,...o?{source:o}:{}}})}break;case`sync:empty`:case`sync:error`:this.pendingSyncRequests.shift();break;case`sync:response`:{let e=this.pendingSyncRequests[0];this._replaying=!0,Qo(!0);try{let e=n.events??[],r=n.mode===`delta`?`delta`:`snapshot`,i=new Map;for(let t of e)if(t.type!==`sync:response`){if(t.type===`agent:event`&&t.workspaceId){let e=i.get(t.workspaceId)??{events:[],timestamps:[],sessionIds:[],eventIds:[],oldestId:void 0};e.events.push(t.payload),e.timestamps.push(t.createdAt),e.sessionIds.push(t.sessionId??null),e.eventIds.push(t.id??null),e.oldestId||=t.id,i.set(t.workspaceId,e);continue}this._routeMessage(t)}if(i.size>0){let e=Li();for(let[t,{events:n,timestamps:a,sessionIds:o,eventIds:s,oldestId:c}]of i){let i=r===`delta`?e.merge(t,n,a,{sessionIds:o,eventIds:s}):n.map((e,t)=>t);r===`snapshot`&&e.reset(t,n,a,{oldestId:c,hasMoreOlder:!0,sessionIds:o,eventIds:s}),r===`snapshot`&&Y().updateAgentTodos(t,[]);for(let e of i){let r=n[e];if(!r)continue;let i=o[e]??null;if(r.kind===`session:user-input-requested`){r.requestKind===`question`?Y().enqueuePending(t,{kind:`question`,agentSessionId:i,toolCallId:r.toolCallId,toolName:r.toolName,input:r.payload}):Y().enqueuePending(t,{kind:`permission`,agentSessionId:i,toolCallId:r.toolCallId,toolName:r.toolName,toolInput:r.payload});continue}if(r.kind===`session:started`){if(i){let e=Y();e.setActiveAgentSession(t,i);let n=e.peekPending(t);n&&n.agentSessionId===i&&e.dequeuePending(t)}continue}if(r.kind===`session:ended`){let e=Y();i?(e.clearPendingForSession(t,i),si(e)||e.cancelQueuedMessage(t,i),e.clearActiveAgentSession(t,i),e.finalizeRunningSubagents(t,i)):r.superseded!==!0&&(e.clearActiveAgentSessionOwner(t),e.finalizeRunningSubagents(t));continue}if(r.kind===`subagent:progress`){Y().upsertSubagent(t,{toolUseId:r.toolCallId,threadIds:r.threadIds,taskId:r.taskId,sessionId:i,status:r.status,phase:r.phase,ambient:r.ambient,description:r.description,taskType:r.taskType,lastToolName:r.lastToolName,totalTokens:r.totalTokens,toolUses:r.toolUses,durationMs:r.durationMs});continue}es(t,r)}}}let a=this.lastEventId,o=e.findLast(e=>e.replayable!==!1&&typeof e.id==`string`);if(o&&(this.lastEventId=o.id),n.truncated===!0&&o&&this.lastEventId!==a)this._drainInProgress=!0,this._send({type:`sync:request`,payload:{lastEventId:this.lastEventId,workspaceIds:t.workspaces.map(e=>e.id)}});else if(this._drainInProgress&&(this._drainInProgress=!1,this._workspacesToRefreshAfterDrain.size>0)){let e=[...this._workspacesToRefreshAfterDrain];this._workspacesToRefreshAfterDrain.clear(),this._send({type:`sync:request`,payload:{lastEventId:this.lastEventId,workspaceIds:e}})}}finally{if(this._replaying=!1,Qo(!1),e){let t=this.pendingSyncRequests.indexOf(e);t!==-1&&this.pendingSyncRequests.splice(t,1)}this._refreshAfterSync&&this.pendingSyncRequests.length===0&&(this._refreshAfterSync=!1,this.refreshLiveState())}break}case`usage:snapshot`:{let e=n;e.providerId&&e.snapshot&&t.applyUsageSnapshot({providerId:e.providerId,snapshot:e.snapshot});break}case`devserver:status`:{let e=Vo();r&&e.updateFromWsEvent(r,n);break}case`task:updated`:r&&t.fetchWorkspaceDetails(r);break;case`setup:output`:t.addActivityItem(r,{id:e.id??`setup-${Date.now()}`,type:`text`,content:e.payload?.text??``,timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`setup`}});break;case`setup:complete`:t.addActivityItem(r,{id:e.id??`setup-complete-${Date.now()}`,type:`text`,content:e.payload?.hadOutput===!1?X(`chat.scriptDone`):X(`chat.scriptComplete`,{phase:`setup`}),timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`setup`}});break;case`setup:error`:t.addActivityItem(r,{id:e.id??`setup-error-${Date.now()}`,type:`text`,content:X(`chat.scriptError`,{phase:`setup`,message:e.payload?.message??X(`chat.unknownError`)}),timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`setup`}});break;case`cleanup:output`:t.addActivityItem(r,{id:e.id??`cleanup-${Date.now()}`,type:`text`,content:e.payload?.text??``,timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`cleanup`}});break;case`cleanup:complete`:t.addActivityItem(r,{id:e.id??`cleanup-complete-${Date.now()}`,type:`text`,content:e.payload?.hadOutput===!1?X(`chat.scriptDone`):X(`chat.scriptComplete`,{phase:`cleanup`}),timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`cleanup`}});break;case`cleanup:error`:t.addActivityItem(r,{id:e.id??`cleanup-error-${Date.now()}`,type:`text`,content:X(`chat.scriptError`,{phase:`cleanup`,message:e.payload?.message??X(`chat.unknownError`)}),timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`cleanup`}});break;case`archive:output`:t.addActivityItem(r,{id:e.id??`archive-${Date.now()}`,type:`text`,content:e.payload?.text??``,timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`archive`}});break;case`archive:complete`:t.addActivityItem(r,{id:e.id??`archive-complete-${Date.now()}`,type:`text`,content:e.payload?.hadOutput===!1?X(`chat.scriptDone`):X(`chat.scriptComplete`,{phase:`archive`}),timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`archive`}});break;case`archive:error`:t.addActivityItem(r,{id:e.id??`archive-error-${Date.now()}`,type:`text`,content:X(`chat.scriptError`,{phase:`archive`,message:e.payload?.message??X(`chat.unknownError`)}),timestamp:e.createdAt??new Date().toISOString(),meta:{sender:`archive`}});break;case`workspace:unread`:if(r){let e=n.hasUnread??!1;t.updateWorkspaceFromEvent(r,{hasUnread:e})}break;case`workspace:awaiting-reminder`:{let e=n;if(!e.workspaceId)break;let t=oo().global,r=X(`notification.awaitingReminder`,{name:e.workspaceName??``,minutes:e.waitingMinutes??0});if(Io(r,void 0,e.workspaceId,t.audioQuestionSound,t.audioQuestionVolume,t.audioQuestionNotifications),document.hasFocus()){let t=e.workspaceId;ki.create({type:`info`,position:`top`,timeout:1e4,message:r,actions:[{label:X(`common.open`),color:`white`,handler:()=>{window.location.hash=`#/workspace/${t}`}}]})}break}case`workspace:pr-attention-dismissed`:if(r){let e=n.kind,i=n.prUpdatedAt;e&&i&&t.updateWorkspaceFromEvent(r,e===`changes-requested`?{prChangesDismissedAt:i}:{prCiFailureDismissedAt:i})}break;case`workspace:description-updated`:{if(!r)break;let e=n.description??null;t.updateWorkspaceFromEvent(r,{description:e});break}case`workspace:agent-description-updated`:{if(!r)break;let e=n.agentDescription??null;t.updateWorkspaceFromEvent(r,{agentDescription:e});break}case`cron:created`:{if(!r)break;let e=n.cron;if(!e)break;let i=t.crons[r]??[];i.some(t=>t.id===e.id)||(t.crons[r]=[...i,e]);let a=t.autoLoopStates[r];a&&(a.crons_count=t.crons[r].length);break}case`cron:fired`:{if(!r)break;let e=n,i=t.crons[r]??[];t.crons[r]=i.map(t=>t.id===e.id?{...t,nextFireAt:e.nextFireAt??t.nextFireAt,lastFiredAt:e.lastFiredAt??new Date().toISOString()}:t);break}case`cron:cancelled`:{if(!r)break;let e=n.id;if(!e)break;t.crons[r]=(t.crons[r]??[]).filter(t=>t.id!==e);let i=t.autoLoopStates[r];i&&(i.crons_count=t.crons[r].length);break}case`cron:updated`:{if(!r)break;let e=n.crons;if(Array.isArray(e)){t.crons[r]=e;let n=t.autoLoopStates[r];n&&(n.crons_count=e.length)}break}case`workspace:archived`:case`workspace:unarchived`:case`workspace:worktree-restored`:case`workspace:worktree-purged`:{let i=n.workspace;e.type===`workspace:worktree-restored`&&i&&i.id===r?t.applyRestoredWorkspace(i):t.invalidateWorkspaceLifecycleReads(r),(e.type===`workspace:archived`||e.type===`workspace:worktree-purged`)&&r&&Fi(r),e.type===`workspace:archived`&&r&&t.selectedWorkspaceId===r&&(t.selectedWorkspaceId=null),t.fetchWorkspaces(),t.archivedLoaded&&t.fetchArchivedWorkspaces();break}case`workspace:deleted`:t.invalidateWorkspaceLifecycleReads(r),r&&Fi(r),r&&t.selectedWorkspaceId===r&&(t.selectedWorkspaceId=null),t.fetchWorkspaces(),t.archivedLoaded&&t.fetchArchivedWorkspaces();break;case`pr:base-changed`:{if(!r)break;let e=n,i=e.oldBase??``,a=e.newBase??``;t.updateWorkspaceFromEvent(r,{sourceBranch:a}),ki.create({type:`info`,position:`top`,timeout:_o,message:X(`pr.baseChanged`,{oldBase:i,newBase:a}),actions:Ko(r,e.prUrl)}),Io(X(`pr.baseChanged`,{oldBase:i,newBase:a}),void 0,r);break}case`pr:ci-failed`:case`pr:ci-recovered`:case`pr:merge-conflict`:case`pr:merged`:{if(!r)break;let i=e.type,a=n,o=a.prNumber??0,s={"pr:ci-failed":{key:`toast.prCiFailed`,type:`negative`,timeout:4e3},"pr:ci-recovered":{key:`toast.prCiRecovered`,type:`positive`,timeout:5e3},"pr:merge-conflict":{key:`toast.prMergeConflict`,type:`warning`,timeout:_o},"pr:merged":{key:`toast.prMerged`,type:`positive`,timeout:5e3}}[i],c=X(s.key,{n:o});ki.create({type:s.type,position:`top`,timeout:s.timeout,message:c,actions:Ko(r,a.prUrl)}),Go(c,r,i),i!==`pr:merged`&&t.refreshPrSnapshot(r);break}case`pr:changes-requested`:{if(!r)break;let e=n,i=X(`toast.prChangesRequested`,{n:e.prNumber??0});ki.create({type:`warning`,position:`top`,timeout:_o,message:i,actions:Ko(r,e.prUrl)}),Go(i,r,`pr:changes-requested`),t.refreshPrSnapshot(r);break}case`pr:approved`:{if(!r)break;let e=n,i=X(`toast.prApproved`,{n:e.prNumber??0});ki.create({type:`positive`,position:`top`,timeout:5e3,message:i,actions:Ko(r,e.prUrl)}),Go(i,r,`pr:approved`),t.refreshPrSnapshot(r);break}case`pr:ready-to-merge`:{if(!r)break;let e=n,i=X(`toast.prReadyToMerge`,{n:e.prNumber??0});ki.create({type:`positive`,position:`top`,timeout:5e3,message:i,actions:Ko(r,e.prUrl)}),Go(i,r,`pr:ready-to-merge`),t.refreshPrSnapshot(r);break}case`wakeup:scheduled`:if(r){let e=n;typeof e.targetAt==`string`&&t.setPendingWakeup(r,{targetAt:e.targetAt,reason:e.reason})}break;case`wakeup:cancelled`:case`wakeup:fired`:case`wakeup:skipped`:r&&t.clearPendingWakeup(r);break;case`agent:quota-recovered`:r&&(t.clearPendingQuotaBackoff(r),t.updateWorkspaceFromEvent(r,{status:`executing`}));break;case`agent:quota-backoff`:{if(!r)break;let e=n;typeof e.targetAt==`string`&&typeof e.source==`string`&&t.setPendingQuotaBackoff(r,{targetAt:e.targetAt,resetsAt:e.resetsAt??null,source:e.source,reason:e.reason===`transient`?`transient`:`quota`});break}case`agent:quota-backoff-cancelled`:r&&(t.clearPendingQuotaBackoff(r),n.reason===`completed`&&t.fetchWorkspaces());break;case`autoloop:messages`:r&&t.fetchAutoLoopMessages(r).catch(()=>{});break;case`autoloop:state`:case`autoloop:enabled`:case`autoloop:iteration-started`:case`autoloop:ready-flipped`:t.fetchAutoLoopStates();break;case`autoloop:permission-overridden`:r&&Io(X(`notification.autoLoopPermissionOverridden`,{name:t.workspaces.find(e=>e.id===r)?.name??``}),void 0,r);break;case`autoloop:waiting-for-slot`:{if(!r)break;let e=n,i=t.workspaces.find(e=>e.id===r)?.name??``;ki.create({type:`info`,position:`top`,timeout:6e3,message:X(`notification.autoLoopWaitingForSlot`,{name:i,running:e.running??0,limit:e.limit??0})});break}case`autoloop:disabled`:if(t.fetchAutoLoopStates(),r){let e=n?.reason,i=t.workspaces.find(e=>e.id===r)?.name??``,a=e===`error`?`notification.autoLoopError`:e===`stall`?`notification.autoLoopStalled`:e===`completed`?`notification.autoLoopCompleted`:e===`awaiting-clarification`?`notification.autoLoopAwaitingClarification`:null;a&&Io(X(a,{name:i}),void 0,r)}break;case`workspace:create-progress`:{let e=typeof n.step==`string`?n.step:``,r=typeof n.creationId==`string`?n.creationId:``;r&&e&&t.setCreationProgress({creationId:r,step:e,index:typeof n.index==`number`?n.index:0,total:typeof n.total==`number`?n.total:0});break}case`workspace:create-failed`:{let e=typeof n.creationId==`string`?n.creationId:``,r=typeof n.step==`string`?n.step:``;e&&r&&t.setCreationProgress({creationId:e,step:r,index:-1,total:0});break}case`migration:progress`:case`migration:error`:zn().update(n)}}}}),rs=k({__name:`App`,setup(e){let t=ns(),n=di(),r=Y(),i=vo?window.parent.koboWorkspaceQueues:void 0,a;if(i)a=ui(r,i);else{let e=li(r);window.koboWorkspaceQueues=e,a=()=>{e.dispose(),delete window.koboWorkspaceQueues}}return h(()=>{t.connect(),n.fetchTemplates(),jo()}),l(()=>{a?.(),t.disconnect()}),(e,t)=>{let n=v(`router-view`);return d(),D(ee,null,[b(n),b(Kn),b(ai)],64)}}}),is=e=>e,as=is,os=is,ss=is(()=>Re()),cs={true:`inset`,item:`item-inset`,"item-thumbnail":`item-thumbnail-inset`},ls={xs:2,sm:4,md:8,lg:16,xl:24},us=R({name:`QSeparator`,props:{...Ne,spaced:[Boolean,String],inset:[Boolean,String],vertical:Boolean,color:String,size:String},setup(e){let t=I(),n=Fe(e,t),r=E(()=>e.vertical?`vertical`:`horizontal`),i=E(()=>` q-separator--${r.value}`),a=E(()=>e.inset?`${i.value}-${cs[e.inset]}`:``),o=E(()=>`q-separator${i.value}${a.value}`+(e.color===void 0?``:` bg-${e.color}`)+(n()?` q-separator--dark`:``)),s=E(()=>{let t={};if(e.size!==void 0&&(t[e.vertical?`width`:`height`]=e.size),e.spaced){let n=e.spaced===!0?`${ls.md}px`:e.spaced in ls?`${ls[e.spaced]}px`:e.spaced,r=e.vertical?[`Left`,`Right`]:[`Top`,`Bottom`];t[`margin${r[0]}`]=t[`margin${r[1]}`]=n}return t});return()=>c(`hr`,{class:o.value,style:s.value,"aria-orientation":r.value})}}),ds=()=>c(`svg`,{key:`svg`,class:`q-radio__bg absolute non-selectable`,viewBox:`0 0 24 24`},[c(`path`,{d:`M12,22a10,10 0 0 1 -10,-10a10,10 0 0 1 10,-10a10,10 0 0 1 10,10a10,10 0 0 1 -10,10m0,-22a12,12 0 0 0 -12,12a12,12 0 0 0 12,12a12,12 0 0 0 12,-12a12,12 0 0 0 -12,-12`}),c(`path`,{class:`q-radio__check`,d:`M12,6a6,6 0 0 0 -6,6a6,6 0 0 0 6,6a6,6 0 0 0 6,-6a6,6 0 0 0 -6,-6`})]);function fs(e){(e.keyCode===13||e.keyCode===32)&&De(e)}var ps=R({name:`QRadio`,props:{...Ne,...ge,...it,modelValue:{required:!0},val:{required:!0},label:String,leftLabel:Boolean,checkedIcon:String,uncheckedIcon:String,color:String,keepColor:Boolean,dense:Boolean,disable:Boolean,tabindex:[String,Number]},emits:[`update:modelValue`],setup(t,{slots:r,emit:i}){let{proxy:a}=x(),o=I(),s=Fe(t,o),l=n(null),{refocusTargetEl:u,refocusTarget:d}=st(t,l),f=E(()=>e(t.modelValue)===e(t.val)),p=E(()=>`q-radio cursor-pointer no-outline row inline no-wrap items-center`+(t.disable?` disabled`:``)+(s()?` q-radio--dark`:``)+(t.dense?` q-radio--dense`:``)+(t.leftLabel?` reverse`:``)),m=E(()=>{let e=t.color!==void 0&&(t.keepColor||f.value)?` text-${t.color}`:``;return`q-radio__inner relative-position q-radio__inner--${f.value?`truthy`:`falsy`}${e}`}),h=E(()=>(f.value?t.checkedIcon:t.uncheckedIcon)||null),g=E(()=>t.disable?-1:t.tabindex||0),_=at(()=>{let e={type:`radio`};return t.name!==void 0&&Object.assign(e,{".checked":f.value,"^checked":f.value?`checked`:void 0,name:t.name,value:t.val}),e});function v(e){e!==void 0&&(De(e),d(e)),!t.disable&&!f.value&&i(`update:modelValue`,t.val,e)}function y(e){(e.keyCode===13||e.keyCode===32)&&v(e)}Object.assign(a,{set:v});let b=ds();return()=>{let e=h.value===null?[b]:[c(`div`,{key:`icon`,class:`q-radio__icon-container absolute-full flex flex-center no-wrap`},[c(ve,{class:`q-radio__icon`,name:h.value})])];t.disable||_(e,`unshift`,` q-radio__native q-ma-none q-pa-none`);let n=[c(`div`,{class:m.value,style:ct(t.size),"aria-hidden":`true`},e)];u.value!==null&&n.push(u.value);let i=t.label===void 0?j(r.default):Ae(r.default,[t.label]);return i!==void 0&&n.push(c(`div`,{class:`q-radio__label q-anchor--skip`},i)),c(`div`,{ref:l,class:p.value,tabindex:g.value,role:`radio`,"aria-label":t.label,"aria-checked":f.value?`true`:`false`,"aria-disabled":t.disable?`true`:void 0,onClick:v,onKeydown:fs,onKeyup:y},n)}}}),ms=()=>c(`div`,{key:`svg`,class:`q-checkbox__bg absolute`},[c(`svg`,{class:`q-checkbox__svg fit absolute-full`,viewBox:`0 0 24 24`},[c(`path`,{class:`q-checkbox__truthy`,fill:`none`,d:`M1.73,12.91 8.1,19.28 22.79,4.59`}),c(`path`,{class:`q-checkbox__indet`,d:`M4,14H20V10H4`})])]),hs=R({name:`QCheckbox`,props:ut,emits:lt,setup(e){let t=ms();function n(n,r){let i=E(()=>(n.value?e.checkedIcon:r.value?e.indeterminateIcon:e.uncheckedIcon)||null);return()=>i.value===null?[t]:[c(`div`,{key:`icon`,class:`q-checkbox__icon-container absolute-full flex flex-center no-wrap`},[c(ve,{class:`q-checkbox__icon`,name:i.value})])]}return dt(`checkbox`,n)}}),gs=R({name:`QToggle`,props:{...ut,icon:String,iconColor:String},emits:lt,setup(e){function t(t,n){let r=E(()=>(t.value?e.checkedIcon:n.value?e.indeterminateIcon:e.uncheckedIcon)||e.icon),i=E(()=>t.value?e.iconColor:null);return()=>[c(`div`,{class:`q-toggle__track`}),c(`div`,{class:`q-toggle__thumb absolute flex flex-center no-wrap`},r.value===void 0?void 0:[c(ve,{name:r.value,color:i.value})])]}return dt(`toggle`,t)}}),_s={radio:ps,checkbox:hs,toggle:gs},vs=Object.keys(_s);function ys(e,t){if(typeof e==`function`)return e;let n=e===void 0?t:e;return e=>e[n]}var bs=R({name:`QOptionGroup`,props:{...Ne,modelValue:{required:!0},options:{type:Array,validator:e=>e.every(K),default:()=>[]},optionValue:[Function,String],optionLabel:[Function,String],optionDisable:[Function,String],name:String,type:{type:String,default:`radio`,validator:e=>vs.includes(e)},color:String,keepColor:Boolean,dense:Boolean,size:String,leftLabel:Boolean,inline:Boolean,disable:Boolean},emits:[`update:modelValue`],setup(t,{emit:r,slots:i}){let a=I(),o=Array.isArray(t.modelValue);t.type===`radio`?o&&console.error(`q-option-group: model should not be array`):o||console.error(`q-option-group: model should be array in your case`);let s=Fe(t,a),l=E(()=>_s[t.type]),u=n(null),d=E(()=>ys(t.optionValue,`value`)),f=E(()=>ys(t.optionLabel,`label`)),p=E(()=>ys(t.optionDisable,`disable`)),m=E(()=>t.options.map(e=>({val:d.value(e),name:e.name===void 0?t.name:e.name,disable:t.disable||p.value(e),leftLabel:e.leftLabel===void 0?t.leftLabel:e.leftLabel,color:e.color===void 0?t.color:e.color,checkedIcon:e.checkedIcon,uncheckedIcon:e.uncheckedIcon,dark:e.dark===void 0?s():e.dark,size:e.size===void 0?t.size:e.size,dense:t.dense,keepColor:e.keepColor===void 0?t.keepColor:e.keepColor}))),h=E(()=>{let n=e(t.modelValue),r=m.value,i=r.findIndex(t=>!t.disable&&e(t.val)===n);return i===-1?r.findIndex(e=>!e.disable):i}),g=E(()=>`q-option-group q-gutter-x-sm`+(t.inline?` q-option-group--inline`:``)),_=E(()=>{let e={role:t.type===`radio`?`radiogroup`:`group`};return t.disable&&(e[`aria-disabled`]=`true`),e});function v(e){r(`update:modelValue`,e)}function y(n){let i=n.keyCode===37||n.keyCode===38?-1:+(n.keyCode===39||n.keyCode===40);if(i===0)return;let o=u.value.getElementsByClassName(`q-radio`),s=Array.prototype.indexOf.call(o,n.target);if(s===-1)return;De(n);let c=(n.keyCode===37||n.keyCode===39)&&a.lang.rtl===!0?-i:i,l=m.value,d=l.length,f=s;do f=(f+c+d)%d;while(f!==s&&l[f].disable);f!==s&&(o[f].focus(),e(l[f].val)!==e(t.modelValue)&&r(`update:modelValue`,l[f].val))}return()=>c(`div`,{ref:u,class:g.value,..._.value,onKeydown:t.type===`radio`?y:void 0},t.options.map((e,n)=>{let r=i[`label-`+n]===void 0?i.label===void 0?void 0:()=>i.label(e):()=>i[`label-`+n](e);return c(`div`,[c(l.value,{label:r===void 0?f.value(e):null,modelValue:t.modelValue,"onUpdate:modelValue":v,...m.value[n],tabindex:t.type===`radio`?n===h.value?0:-1:void 0},r)])}))}}),xs=()=>!0;function Ss(e){let t={};return e.forEach(e=>{t[e]=xs}),t}function Cs(e){return e===void 0?`programmatic`:e.type.indexOf(`key`)===0?`escape`:`backdrop`}function ws(){let{emit:e,proxy:t}=x(),r=n(null),i=null;function a(){i=null,r.value.show()}function o(){r.value.hide()}function s(t){e(`ok`,t),o()}function c(){i=`cancel`,o()}function l(t){e(`hide`,i===null?Cs(t):i)}return Object.assign(t,{show:a,hide:o}),{dialogRef:r,onDialogHide:l,onDialogOK:s,onDialogCancel:c}}var Ts=[`ok`,`hide`];ws.emits=Ts,ws.emitsObject=Ss(Ts);var Es=R({name:`DialogPluginComponent`,props:{...Ne,title:String,message:String,prompt:Object,options:Object,progress:[Boolean,Object],html:Boolean,ok:{type:[String,Object,Boolean],default:!0},cancel:[String,Object,Boolean],focus:{type:String,default:`ok`,validator:e=>[`ok`,`cancel`,`none`].includes(e)},stackButtons:Boolean,color:String,cardClass:[String,Array,Object],cardStyle:[String,Array,Object]},emits:[`ok`,`hide`],setup(t){let n=I(),r=Fe(t,n),{dialogRef:i,onDialogHide:a,onDialogOK:o,onDialogCancel:l}=ws(),d=s(t.prompt===void 0?t.options===void 0?void 0:t.options.model:t.prompt.model),f=E(()=>`q-dialog-plugin`+(r()?` q-dialog-plugin--dark q-dark`:``)+(t.progress===!1?``:` q-dialog-plugin--progress`)),p=E(()=>t.color||(r()?`amber`:`primary`)),m=E(()=>t.progress===!1?null:K(t.progress)?{component:t.progress.spinner||se,props:{color:t.progress.color||p.value}}:{component:se,props:{color:p.value}}),h=E(()=>t.prompt!==void 0||t.options!==void 0),g=E(()=>{if(!h.value)return{};let{model:e,isValid:n,items:r,...i}=t.prompt===void 0?t.options:t.prompt;return i}),_=E(()=>K(t.ok)||t.ok===!0?n.lang.label.ok:t.ok),v=E(()=>K(t.cancel)||t.cancel===!0?n.lang.label.cancel:t.cancel),y=E(()=>t.prompt===void 0?t.options!==void 0&&t.options.isValid!==void 0&&!t.options.isValid(d.value):t.prompt.isValid!==void 0&&!t.prompt.isValid(d.value)),b=E(()=>({color:p.value,label:_.value,ripple:!1,disable:y.value,...K(t.ok)?t.ok:{flat:!0},"data-autofocus":t.focus===`ok`&&!h.value||void 0,onClick:S})),x=E(()=>({color:p.value,label:v.value,ripple:!1,...K(t.cancel)?t.cancel:{flat:!0},"data-autofocus":t.focus===`cancel`&&!h.value||void 0,onClick:l}));u(()=>t.prompt&&t.prompt.model,C),u(()=>t.options&&t.options.model,C);function S(){o(e(d.value))}function C(e){d.value=e}function w(e){!y.value&&t.prompt.type!==`textarea`&&te(e,13)&&S()}function T(e,n){return t.html?c(qt,{class:e,innerHTML:n}):c(qt,{class:e},()=>n)}function D(){return[c(qr,{color:p.value,dense:!0,autofocus:!0,dark:r(),...g.value,modelValue:d.value,"onUpdate:modelValue":C,onKeyup:w})]}function ee(){return[c(bs,{color:p.value,options:t.options.items,dark:r(),...g.value,modelValue:d.value,"onUpdate:modelValue":C})]}function O(){let e=[];return t.cancel&&e.push(c(Ee,x.value)),t.ok&&e.push(c(Ee,b.value)),c(Jr,{class:t.stackButtons?`items-end`:``,vertical:t.stackButtons,align:`right`},()=>e)}function k(){let e=[];return t.title&&e.push(T(`q-dialog__title`,t.title)),t.progress!==!1&&e.push(c(qt,{class:`q-dialog__progress`},()=>c(m.value.component,m.value.props))),t.message&&e.push(T(`q-dialog__message`,t.message)),t.prompt===void 0?t.options!==void 0&&e.push(c(us,{dark:r()}),c(qt,{class:`scroll q-dialog-plugin__form`},ee),c(us,{dark:r()})):e.push(c(qt,{class:`scroll q-dialog-plugin__form`},D)),(t.ok||t.cancel)&&e.push(O()),e}function A(){return[c(Zt,{class:[f.value,t.cardClass],style:t.cardStyle,dark:r()},k)]}return()=>c(Rn,{ref:i,onHide:a},A)}});function Ds(e,t){for(let n in t)n!==`spinner`&&Object(t[n])===t[n]&&!Array.isArray(t[n])?(e[n]=Object(e[n])===e[n]?{...e[n]}:{},Ds(e[n],t[n])):e[n]=t[n]}function Os(e,t,r){return i=>{let a,o,s=t&&i.component!==void 0;if(s){let{component:e,componentProps:t}=i;a=typeof e==`string`?r.component(e):e,o=t||{}}else{let{class:t,style:n,...r}=i;a=e,o=r,t!==void 0&&(r.cardClass=t),n!==void 0&&(r.cardStyle=n)}let l,u=!1,d=n(null),f=Se(!1,`dialog`),p=e=>{if(d.value?.[e]!==void 0){d.value[e]();return}let t=l.$.subTree?.component;for(;t;){if(typeof t.proxy?.[e]==`function`){t.proxy[e]();return}t=t.subTree?.component}console.error(`[Quasar] Incorrectly defined Dialog component`)},h=[],g=[],_={onOk(e){return h.push(e),_},onCancel(e){return g.push(e),_},onDismiss(e){return h.push(e),g.push(e),_},hide(){return p(`hide`),_},update(e){if(l!==null){if(s)Object.assign(o,e);else{let{class:t,style:n,...r}=e;t!==void 0&&(r.cardClass=t),n!==void 0&&(r.cardStyle=n),Ds(o,r)}l.$forceUpdate()}return _}},v=e=>{u=!0,h.forEach(t=>{t(e)})},y=e=>{b.unmount(f),be(f),b=null,l=null,u||g.forEach(t=>{t(e)})},b=Ut({name:`QGlobalDialog`,setup:()=>()=>c(a,{...o,ref:d,onOk:v,onHide:y,onVnodeMounted(...e){typeof o.onVnodeMounted==`function`&&o.onVnodeMounted(...e),m(()=>p(`show`))}})},r);return l=b.mount(f),_}}var ks={install({$q:e,parentApp:t}){e.dialog=this.create=Os(Es,!0,t)}},As=new Map;function js(e,t){As.set(e,t)}function Ms(e){As.delete(e)}function Ns(){let e=[];for(let[t,n]of As)try{n()&&e.push(t)}catch{}return e}function Ps(){return Ns().length>0}var Fs=e=>e.startsWith(`/`);function Is(e){return typeof e==`object`||`displayName`in e||`props`in e||`__vccOpts`in e}function Ls(e){return e.__esModule||e[Symbol.toStringTag]===`Module`||e.default&&Is(e.default)}var Q=Object.assign;function Rs(e,t){let n={};for(let r in t){let i=t[r];n[r]=$(i)?i.map(e):e(i)}return n}var zs=()=>{},$=Array.isArray;function Bs(e,t){let n={};for(let r in e)n[r]=r in t?t[r]:e[r];return n}var Vs=Symbol(``),Hs=function(e){return e[e.aborted=4]=`aborted`,e[e.cancelled=8]=`cancelled`,e[e.duplicated=16]=`duplicated`,e}({});function Us(e,t){return Q(Error(),{type:e,[Vs]:!0},t)}function Ws(e,t){return e instanceof Error&&Vs in e&&(t==null||!!(e.type&t))}var Gs=Symbol(``),Ks=Symbol(``),qs=Symbol(``),Js=Symbol(``),Ys=Symbol(``);function Xs(){return _(qs)}function Zs(e){return _(Js)}var Qs=typeof document<`u`,$s=/#/g,ec=/&/g,tc=/\//g,nc=/=/g,rc=/\?/g,ic=/\+/g,ac=/%5B/g,oc=/%5D/g,sc=/%5E/g,cc=/%60/g,lc=/%7B/g,uc=/%7C/g,dc=/%7D/g,fc=/%20/g;function pc(e){return e==null?``:encodeURI(``+e).replace(uc,`|`).replace(ac,`[`).replace(oc,`]`)}function mc(e){return pc(e).replace(lc,`{`).replace(dc,`}`).replace(sc,`^`)}function hc(e){return pc(e).replace(ic,`%2B`).replace(fc,`+`).replace($s,`%23`).replace(ec,`%26`).replace(cc,"`").replace(lc,`{`).replace(dc,`}`).replace(sc,`^`)}function gc(e){return hc(e).replace(nc,`%3D`)}function _c(e){return pc(e).replace($s,`%23`).replace(rc,`%3F`)}function vc(e){return _c(e).replace(tc,`%2F`)}function yc(e){if(e==null)return null;try{return decodeURIComponent(``+e)}catch{}return``+e}var bc=/\/$/,xc=e=>e.replace(bc,``);function Sc(e,t,n=`/`){let r,i={},a=``,o=``,s=t.indexOf(`#`),c=t.indexOf(`?`);return c=s>=0&&c>s?-1:c,c>=0&&(r=t.slice(0,c),a=t.slice(c,s>0?s:t.length),i=e(a.slice(1))),s>=0&&(r||=t.slice(0,s),o=t.slice(s,t.length)),r=Ac(r??t,n),{fullPath:r+a+o,path:r,query:i,hash:yc(o)}}function Cc(e,t){let n=t.query?e(t.query):``;return t.path+(n&&`?`)+n+(t.hash||``)}function wc(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||`/`}function Tc(e,t,n){let r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&Ec(t.matched[r],n.matched[i])&&Dc(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Ec(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function Dc(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!Oc(e[n],t[n]))return!1;return!0}function Oc(e,t){return $(e)?kc(e,t):$(t)?kc(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function kc(e,t){return $(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e.length===1&&e[0]===t}function Ac(e,t){if(Fs(e))return e;if(!e)return t;let n=t.split(`/`),r=e.split(`/`),i=r[r.length-1];(i===`..`||i===`.`)&&r.push(``);let a=n.length-1,o,s;for(o=0;o<r.length;o++)if(s=r[o],s!==`.`){if(s===`..`)a>1&&a--;else break}return n.slice(0,a).join(`/`)+`/`+r.slice(o).join(`/`)}var jc={path:`/`,name:void 0,params:{},query:{},hash:``,fullPath:`/`,matched:[],meta:{},redirectedFrom:void 0};function Mc(e){if(!e){if(Qs){let t=document.querySelector(`base`);e=t&&t.getAttribute(`href`)||`/`,e=e.replace(/^\w+:\/\/[^/]+/,``)}else e=`/`}return e[0]!==`/`&&e[0]!==`#`&&(e=`/`+e),xc(e)}var Nc=/^[^#]+#/;function Pc(e,t){return e.replace(Nc,`#`)+t}function Fc(e,t){let n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}var Ic=()=>history.scrollRestoration===`manual`?{left:window.scrollX,top:window.scrollY}:null;function Lc(e){let t;if(`el`in e){let n=e.el,r=typeof n==`string`&&n.startsWith(`#`),i=typeof n==`string`?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=Fc(i,e)}else t=e;`scrollBehavior`in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left==null?window.scrollX:t.left,t.top==null?window.scrollY:t.top)}function Rc(e,t){return(history.state?history.state.position-t:-1)+e}var zc=new Map;function Bc(e){zc.set(e,Ic())}function Vc(e){let t=zc.get(e);return zc.delete(e),t}function Hc(e){return typeof e==`string`||e&&typeof e==`object`}function Uc(e){return typeof e==`string`||typeof e==`symbol`}function Wc(e){let t={};if(e===``||e===`?`)return t;let n=(e[0]===`?`?e.slice(1):e).split(`&`);for(let e=0;e<n.length;++e){let r=n[e].replace(ic,` `),i=r.indexOf(`=`),a=yc(i<0?r:r.slice(0,i)),o=i<0?null:yc(r.slice(i+1));if(a in t){let e=t[a];$(e)||(e=t[a]=[e]),e.push(o)}else t[a]=o}return t}function Gc(e){let t=``;for(let n in e){let r=e[n];if(n=gc(n),r==null){r!==void 0&&(t+=(t.length?`&`:``)+n);continue}($(r)?r.map(e=>e&&hc(e)):[r&&hc(r)]).forEach(e=>{e!==void 0&&(t+=(t.length?`&`:``)+n,e!=null&&(t+=`=`+e))})}return t}function Kc(e){let t={};for(let n in e){let r=e[n];r!==void 0&&(t[n]=$(r)?r.map(e=>e==null?null:``+e):r==null?r:``+r)}return t}function qc(){let e=[];function t(t){return e.push(t),()=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Jc(e,t,n,r,i,a=e=>e()){let o=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,c)=>{let l=e=>{e===!1?c(Us(4,{from:n,to:t})):e instanceof Error?c(e):Hc(e)?c(Us(2,{from:t,to:e})):(o&&r.enterCallbacks[i]===o&&typeof e==`function`&&o.push(e),s())},u=a(()=>e.call(r&&r.instances[i],t,n,l)),d=Promise.resolve(u);e.length<3&&(d=d.then(l)),d.catch(e=>c(e))})}function Yc(e,t,n,r,i=e=>e()){let a=[];for(let o of e)for(let e in o.components){let s=o.components[e];if(t===`beforeRouteEnter`||o.instances[e]){if(Is(s)){let c=(s.__vccOpts||s)[t];c&&a.push(Jc(c,n,r,o,e,i))}else{let c=s();a.push(()=>c.then(a=>{if(!a)throw Error(`Couldn't resolve component "${e}" at "${o.path}"`);let s=Ls(a)?a.default:a;o.mods[e]=a,o.components[e]=s;let c=(s.__vccOpts||s)[t];return c&&Jc(c,n,r,o,e,i)()}))}}}return a}function Xc(e,t){let n=[],r=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let o=0;o<a;o++){let a=t.matched[o];a&&(e.matched.find(e=>Ec(e,a))?r.push(a):n.push(a));let s=e.matched[o];s&&(t.matched.find(e=>Ec(e,s))||i.push(s))}return[n,r,i]}var Zc=()=>location.protocol+`//`+location.host;function Qc(e,t){let{pathname:n,search:r,hash:i}=t,a=e.indexOf(`#`);if(a>-1){let t=i.includes(e.slice(a))?e.slice(a).length:1,n=i.slice(t);return n[0]!==`/`&&(n=`/`+n),wc(n,``)}return wc(n,e)+r+i}function $c(e,t,n,r){let i=[],a=[],o=null,s=({state:a})=>{let s=Qc(e,location),c=n.value,l=t.value,u=0;if(a){if(n.value=s,t.value=a,o&&o===c){o=null;return}u=l?a.position-l.position:0}else r(s);i.forEach(e=>{e(n.value,c,{delta:u,type:`pop`,direction:u?u>0?`forward`:`back`:``})})};function c(){o=n.value}function l(e){i.push(e);let t=()=>{let t=i.indexOf(e);t>-1&&i.splice(t,1)};return a.push(t),t}function u(){let{history:e}=window;e.state&&e.replaceState(Q({},e.state,{scroll:Ic()}),``)}function d(){for(let e of a)e();a=[],window.removeEventListener(`popstate`,s),window.removeEventListener(`pagehide`,u)}return window.addEventListener(`popstate`,s),window.addEventListener(`pagehide`,u),{pauseListeners:c,listen:l,destroy:d}}function el(e,t,n,r=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:null}}function tl(e){let{history:t,location:n}=window,r={value:Qc(e,n)},i={value:t.state};i.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(r,a,o){let s=e.indexOf(`#`),c=s>-1?(n.host&&document.querySelector(`base`)?e:e.slice(s))+r:Zc()+e+r;try{t[o?`replaceState`:`pushState`](a,``,c),i.value=a}catch(e){console.error(e),n[o?`replace`:`assign`](c)}}function o(e,n){a(e,Q({},t.state,el(i.value.back,e,i.value.forward,!0),n,{position:i.value.position}),!0),r.value=e}function s(e,n){let o=Q({},i.value,t.state,{forward:e,scroll:Ic()});a(o.current,o,!0),a(e,Q({},el(r.value,e,null),{position:o.position+1},n),!1),r.value=e}return{location:r,state:i,push:s,replace:o}}function nl(e){e=Mc(e);let t=tl(e),n=$c(e,t.state,t.location,t.replace);function r(e,t=!0){t||n.pauseListeners(),history.go(e)}let i=Q({location:``,base:e,go:r,createHref:Pc.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function rl(e){return e=location.host?e||location.pathname+location.search:``,e.includes(`#`)||(e+=`#`),nl(e)}var il={type:0,value:``},al=/[a-zA-Z0-9_]/;function ol(e){if(!e)return[[]];if(e===`/`)return[[il]];if(!Fs(e))throw Error(`Invalid path "${e}"`);function t(e){throw Error(`ERR (${n})/"${l}": ${e}`)}let n=0,r=n,i=[],a;function o(){a&&i.push(a),a=[]}let s=0,c,l=``,u=``;function d(){l&&=(n===0?a.push({type:0,value:l}):n===1||n===2||n===3?(a.length>1&&(c===`*`||c===`+`)&&t(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:l,regexp:u,repeatable:c===`*`||c===`+`,optional:c===`*`||c===`?`})):t(`Invalid state to consume buffer`),``)}function f(){l+=c}for(;s<e.length;)switch(c=e[s++],n){case 0:c===`\\`?(r=n,n=4):c===`/`?(l&&d(),o()):c===`:`?(d(),n=1):f();break;case 4:f(),n=r;break;case 1:c===`(`?n=2:al.test(c)?f():(d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--);break;case 2:c===`)`?u[u.length-1]==`\\`?u=u.slice(0,-1)+c:n=3:u+=c;break;case 3:d(),n=0,c!==`*`&&c!==`?`&&c!==`+`&&s--,u=``;break;default:t(`Unknown state`)}return n===2&&t(`Unfinished custom RegExp for param "${l}"`),d(),o(),i}var sl=`[^/]+?`,cl={sensitive:!1,strict:!1,start:!0,end:!0},ll=/[.+*?^${}()[\]/\\]/g;function ul(e,t){let n=Q({},cl,t),r=[],i=n.start?`^`:``,a=[];for(let t of e){let e=t.length?[]:[90];n.strict&&!t.length&&(i+=`/`);for(let r=0;r<t.length;r++){let o=t[r],s=40+(n.sensitive?.25:0);if(o.type===0)r||(i+=`/`),i+=o.value.replace(ll,`\\$&`),s+=40;else if(o.type===1){let{value:e,repeatable:n,optional:c,regexp:l}=o;a.push({name:e,repeatable:n,optional:c});let u=l||sl;if(u!==sl){s+=10;try{RegExp(`(${u})`)}catch(t){throw Error(`Invalid custom RegExp for param "${e}" (${u}): `+t.message)}}let d=n?`((?:${u})(?:/(?:${u}))*)`:`(${u})`;r||(d=c&&t.length<2?`(?:/${d})`:`/`+d),c&&(d+=`?`),i+=d,s+=20,c&&(s+=-8),n&&(s+=-20),u===`.*`&&(s+=-50)}e.push(s)}r.push(e)}if(n.strict&&n.end){let e=r.length-1;r[e][r[e].length-1]+=.7000000000000001}n.strict||(i+=`/?`),n.end?i+=`$`:n.strict&&!i.endsWith(`/`)&&(i+=`(?:/|$)`);let o=new RegExp(i,n.sensitive?``:`i`);function s(e){let t=e.match(o),n={};if(!t)return null;for(let e=1;e<t.length;e++){let r=t[e]||``,i=a[e-1];n[i.name]=r&&i.repeatable?r.split(`/`):r}return n}function c(t){let n=``,r=!1;for(let i of e){(!r||!n.endsWith(`/`))&&(n+=`/`),r=!1;for(let e of i)if(e.type===0)n+=e.value;else if(e.type===1){let{value:a,repeatable:o,optional:s}=e,c=a in t?t[a]:``;if($(c)&&!o)throw Error(`Provided param "${a}" is an array but it is not repeatable (* or + modifiers)`);let l=$(c)?c.join(`/`):c;if(!l){if(s)i.length<2&&(n.endsWith(`/`)?n=n.slice(0,-1):r=!0);else throw Error(`Missing required param "${a}"`)}n+=l}}return n||`/`}return{re:o,score:r,keys:a,parse:s,stringify:c}}function dl(e,t){let n=0;for(;n<e.length&&n<t.length;){let r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function fl(e,t){let n=0,r=e.score,i=t.score;for(;n<r.length&&n<i.length;){let e=dl(r[n],i[n]);if(e)return e;n++}if(Math.abs(i.length-r.length)===1){if(pl(r))return 1;if(pl(i))return-1}return i.length-r.length}function pl(e){let t=e[e.length-1];return e.length>0&&t[t.length-1]<0}var ml={strict:!1,end:!0,sensitive:!1};function hl(e,t,n){let r=Q(ul(ol(e.path),n),{record:e,parent:t,children:[],alias:[]});return t&&!r.record.aliasOf==!t.record.aliasOf&&t.children.push(r),r}function gl(e,t){let n=[],r=new Map;t=Bs(ml,t);function i(e){return r.get(e)}function a(e,n,r){let i=!r,s=vl(e);s.aliasOf=r&&r.record;let l=Bs(t,e),u=[s];if(`alias`in e){let t=typeof e.alias==`string`?[e.alias]:e.alias;for(let e of t)u.push(vl(Q({},s,{components:r?r.record.components:s.components,path:e,aliasOf:r?r.record:s})))}let d,f;for(let t of u){let{path:u}=t;if(n&&!Fs(u)){let e=n.record.path,r=e[e.length-1]===`/`?``:`/`;t.path=n.record.path+(u&&r+u)}if(d=hl(t,n,l),r?r.alias.push(d):(f||=d,f!==d&&f.alias.push(d),i&&e.name&&!bl(d)&&o(e.name)),wl(d)&&c(d),s.children){let e=s.children;for(let t=0;t<e.length;t++)a(e[t],d,r&&r.children[t])}r||=d}return f?()=>{o(f)}:zs}function o(e){if(Uc(e)){let t=r.get(e);t&&(r.delete(e),n.splice(n.indexOf(t),1),t.children.forEach(o),t.alias.forEach(o))}else{let t=n.indexOf(e);t>-1&&(n.splice(t,1),e.record.name&&r.delete(e.record.name),e.children.forEach(o),e.alias.forEach(o))}}function s(){return n}function c(e){let t=Sl(e,n);n.splice(t,0,e),e.record.name&&!bl(e)&&r.set(e.record.name,e)}function l(e,t){let i,a={},o,s;if(`name`in e&&e.name){if(i=r.get(e.name),!i)throw Us(1,{location:e});s=i.record.name,a=Q(_l(t.params,i.keys.filter(e=>!e.optional).concat(i.parent?i.parent.keys.filter(e=>e.optional):[]).map(e=>e.name)),e.params&&_l(e.params,i.keys.map(e=>e.name))),o=i.stringify(a)}else if(e.path!=null)o=e.path,i=n.find(e=>e.re.test(o)),i&&(a=i.parse(o),s=i.record.name,i.keys.forEach(e=>{e.optional&&!a[e.name]&&delete a[e.name]}));else{if(i=t.name?r.get(t.name):n.find(e=>e.re.test(t.path)),!i)throw Us(1,{location:e,currentLocation:t});s=i.record.name,a=Q({},t.params,e.params),o=i.stringify(a)}let c=[],l=i;for(;l;)c.unshift(l.record),l=l.parent;return{name:s,path:o,params:a,matched:c,meta:xl(c)}}e.forEach(e=>a(e));function u(){n.length=0,r.clear()}return{addRoute:a,resolve:l,removeRoute:o,clearRoutes:u,getRoutes:s,getRecordMatcher:i}}function _l(e,t){let n={};for(let r of t)r in e&&(n[r]=e[r]);return n}function vl(e){let t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:yl(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:`components`in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function yl(e){let t={},n=e.props||!1;if(`component`in e)t.default=n;else for(let r in e.components)t[r]=typeof n==`object`?n[r]:n;return t}function bl(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function xl(e){return e.reduce((e,t)=>Q(e,t.meta),{})}function Sl(e,t){let n=0,r=t.length;for(;n!==r;){let i=n+r>>1;fl(e,t[i])<0?r=i:n=i+1}let i=Cl(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Cl(e){let t=e;for(;t=t.parent;)if(wl(t)&&fl(e,t)===0)return t}function wl({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function Tl(e){let n=_(qs),r=_(Js),i=E(()=>{let r=t(e.to);return n.resolve(r)}),a=E(()=>{let{matched:e}=i.value,{length:t}=e,n=e[t-1],a=r.matched;if(!n||!a.length)return-1;let o=a.findIndex(Ec.bind(null,n));if(o>-1)return o;let s=Al(e[t-2]);return t>1&&Al(n)===s&&a[a.length-1].path!==s?a.findIndex(Ec.bind(null,e[t-2])):o}),o=E(()=>a.value>-1&&kl(r.params,i.value.params)),s=E(()=>a.value>-1&&a.value===r.matched.length-1&&Dc(r.params,i.value.params));function c(r={}){if(Ol(r)){let r=n[t(e.replace)?`replace`:`push`](t(e.to)).catch(zs);return e.viewTransition&&typeof document<`u`&&`startViewTransition`in document&&document.startViewTransition(()=>r),r}return Promise.resolve()}return{route:i,href:E(()=>i.value.href),isActive:o,isExactActive:s,navigate:c}}function El(e){return e.length===1?e[0]:e}var Dl=k({name:`RouterLink`,compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:`page`},viewTransition:Boolean},useLink:Tl,setup(e,{slots:t}){let n=o(Tl(e)),{options:r}=_(qs),i=E(()=>({[jl(e.activeClass,r.linkActiveClass,`router-link-active`)]:n.isActive,[jl(e.exactActiveClass,r.linkExactActiveClass,`router-link-exact-active`)]:n.isExactActive}));return()=>{let r=t.default&&El(t.default(n));return e.custom?r:c(`a`,{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},r)}}});function Ol(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(e.button===void 0||e.button===0)){if(e.currentTarget&&e.currentTarget.getAttribute){let t=e.currentTarget.getAttribute(`target`);if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function kl(e,t){for(let n in t){let r=t[n],i=e[n];if($(r)){if(!$(i)||i.length!==r.length||r.some((e,t)=>e.valueOf()!==i[t].valueOf()))return!1}else if(r!==i)return!1}return!0}function Al(e){return e?e.aliasOf?e.aliasOf.path:e.path:``}var jl=(e,t,n)=>e??t??n,Ml=k({name:`RouterView`,inheritAttrs:!1,props:{name:{type:String,default:`default`},route:Object},compatConfig:{MODE:3},setup(e,{attrs:n,slots:r}){let i=_(Ys),a=E(()=>e.route||i.value),o=_(Ks,0),l=E(()=>{let e=t(o),{matched:n}=a.value,r;for(;(r=n[e])&&!r.components;)e++;return e}),d=E(()=>a.value.matched[l.value]);g(Ks,E(()=>l.value+1)),g(Gs,d),g(Ys,a);let f=s();return u(()=>[f.value,d.value,e.name],([e,t,n],[r,i,a])=>{t&&(t.instances[n]=e,i&&i!==t&&e&&e===r&&(t.leaveGuards.size||(t.leaveGuards=i.leaveGuards),t.updateGuards.size||(t.updateGuards=i.updateGuards))),e&&t&&(!i||!Ec(t,i)||!r)&&(t.enterCallbacks[n]||[]).forEach(t=>t(e))},{flush:`post`}),()=>{let t=a.value,i=e.name,o=d.value,s=o&&o.components[i];if(!s)return Nl(r.default,{Component:s,route:t});let l=o.props[i],u=l?l===!0?t.params:typeof l==`function`?l(t):l:null,p=c(s,Q({},u,n,{onVnodeUnmounted:e=>{e.component.isUnmounted&&(o.instances[i]=null)},ref:f}));return Nl(r.default,{Component:p,route:t})||p}}});function Nl(e,t){if(!e)return null;let n=e(t);return n.length===1?n[0]:n}var Pl=Ml;function Fl(e){let i=gl(e.routes,e),a=e.parseQuery||Wc,o=e.stringifyQuery||Gc,s=e.history,c=qc(),l=qc(),u=qc(),d=n(jc),f=n(0),p=jc;Qs&&e.scrollBehavior&&`scrollRestoration`in history&&(history.scrollRestoration=`manual`);let h=Rs.bind(null,e=>``+e),g=Rs.bind(null,vc),_=Rs.bind(null,yc);function v(e,t){let n,r;Uc(e)?(n=i.getRecordMatcher(e),r=t):r=e;let a=i.addRoute(r,n);return f.value++,()=>{a(),f.value++}}function y(e){let t=i.getRecordMatcher(e);t&&(i.removeRoute(t),f.value++)}function b(){i.clearRoutes(),f.value++}function x(){return i.getRoutes().map(e=>e.record)}function S(e){return!!i.getRecordMatcher(e)}function C(e,t){if(f.value,typeof e==`string`){t||=e.startsWith(`/`)?jc:d.value;let n=Sc(a,e,t.path),r=i.resolve({path:n.path},t),o=s.createHref(n.fullPath);return Q(n,r,{params:_(r.params),redirectedFrom:void 0,href:o})}t=Q({},t||(e.path!=null&&e.path.startsWith(`/`)&&!(`name`in e&&e.name)?jc:d.value));let n;if(e.path!=null)n=Q({},e,{path:Sc(a,e.path,t.path).path});else{let r=Q({},e.params);for(let e in r)r[e]??delete r[e];n=Q({},e,{params:g(r)}),t.params=g(t.params)}let r=i.resolve(n,t),c=e.hash||``;r.params=h(_(r.params));let l=Cc(o,Q({},e,{hash:mc(c),path:r.path})),u=s.createHref(l);return Q({fullPath:l,hash:c,query:o===Gc?Kc(e.query):e.query||{}},r,{redirectedFrom:void 0,href:u})}function w(e){return typeof e==`string`?Sc(a,e,d.value.path):Q({},e)}function T(e,t){if(p!==e)return Us(8,{from:t,to:e})}function E(e){return O(e)}function D(e){return E(Q(w(e),{replace:!0}))}function ee(e,t){let n=e.matched[e.matched.length-1];if(n&&n.redirect){let{redirect:r}=n,i=typeof r==`function`?r(e,t):r;return typeof i==`string`&&(i=i.includes(`?`)||i.includes(`#`)?i=w(i):{path:i},i.params={}),Q({query:e.query,hash:e.hash,params:i.path==null?e.params:{}},i)}}function O(e,t){let n=p=C(e),r=d.value,i=e.state,a=e.force,s=e.replace===!0,c=ee(n,r);if(c)return O(Q(w(c),{state:typeof c==`object`?Q({},i,c.state):i,force:a,replace:s}),t||n);let l=n;l.redirectedFrom=t;let u;return!a&&Tc(o,r,n)&&(u=Us(16,{to:l,from:r}),le(r,r,!0,!1)),(u?Promise.resolve(u):j(l,r)).catch(e=>Ws(e)?Ws(e,2)?e:ce(e):oe(e,l,r)).then(e=>{if(e){if(Ws(e,2))return O(Q({replace:s},w(e.to),{state:typeof e.to==`object`?Q({},i,e.to.state):i,force:a}),t||l)}else e=te(l,r,!0,s,i);return M(l,r,e),e})}function k(e,t){let n=T(e,t);return n?Promise.reject(n):Promise.resolve()}function A(e){let t=ue.values().next().value;return t&&typeof t.runWithContext==`function`?t.runWithContext(e):e()}function j(e,t){let n,[r,i,a]=Xc(e,t);n=Yc(r.reverse(),`beforeRouteLeave`,e,t);for(let i of r)i.leaveGuards.forEach(r=>{n.push(Jc(r,e,t))});let o=k.bind(null,e,t);return n.push(o),L(n).then(()=>{n=[];for(let r of c.list())n.push(Jc(r,e,t));return n.push(o),L(n)}).then(()=>{n=Yc(i,`beforeRouteUpdate`,e,t);for(let r of i)r.updateGuards.forEach(r=>{n.push(Jc(r,e,t))});return n.push(o),L(n)}).then(()=>{n=[];for(let r of a)if(r.beforeEnter){if($(r.beforeEnter))for(let i of r.beforeEnter)n.push(Jc(i,e,t));else n.push(Jc(r.beforeEnter,e,t))}return n.push(o),L(n)}).then(()=>(e.matched.forEach(e=>e.enterCallbacks={}),n=Yc(a,`beforeRouteEnter`,e,t,A),n.push(o),L(n))).then(()=>{n=[];for(let r of l.list())n.push(Jc(r,e,t));return n.push(o),L(n)}).catch(e=>Ws(e,8)?e:Promise.reject(e))}function M(e,t,n){u.list().forEach(r=>A(()=>r(e,t,n)))}function te(e,t,n,r,i){let a=T(e,t);if(a)return a;let o=t===jc,c=Qs?history.state:{};n&&(r||o?s.replace(e.fullPath,Q({scroll:o&&c&&c.scroll},i)):s.push(e.fullPath,i)),d.value=e,le(e,t,n,o),ce()}let ne;function re(){ne||=s.listen((e,t,n)=>{if(!I.listening)return;let r=C(e),i=ee(r,I.currentRoute.value);if(i){O(Q(i,{replace:!0,force:!0}),r).catch(zs);return}p=r;let a=d.value;Qs&&n.delta&&Bc(Rc(a.fullPath,n.delta)),j(r,a).catch(e=>Ws(e,12)?e:Ws(e,2)?(O(Q(w(e.to),{force:!0}),r).then(e=>{Ws(e,20)&&!n.delta&&n.type===`pop`&&s.go(-1,!1)}).catch(zs),Promise.reject()):(n.delta&&s.go(-n.delta,!1),oe(e,r,a))).then(e=>{e||=te(r,a,!1),e&&(n.delta&&!Ws(e,8)?s.go(-n.delta,!1):n.type===`pop`&&Ws(e,20)&&s.go(-1,!1)),M(r,a,e)}).catch(zs)})}let ie=qc(),ae=qc(),N;function oe(e,t,n){ce(e);let r=ae.list();return r.length?r.forEach(r=>r(e,t,n)):console.error(e),Promise.reject(e)}function se(){return N&&d.value!==jc?Promise.resolve():new Promise((e,t)=>{ie.add([e,t])})}function ce(e){return N||(N=!e,re(),ie.list().forEach(([t,n])=>e?n(e):t()),ie.reset()),e}function le(t,n,r,i){let{scrollBehavior:a}=e;if(!Qs||!a)return Promise.resolve();let o=!r&&Vc(Rc(t.fullPath,0))||(i||!r)&&history.state&&history.state.scroll||null;return m().then(()=>a(t,n,o)).then(e=>t===d.value&&e&&Lc(e)).catch(e=>t===d.value&&oe(e,t,n))}let P=e=>s.go(e),F,ue=new Set,I={currentRoute:d,listening:!0,addRoute:v,removeRoute:y,clearRoutes:b,hasRoute:S,getRoutes:x,resolve:C,options:e,push:E,replace:D,go:P,back:()=>P(-1),forward:()=>P(1),beforeEach:c.add,beforeResolve:l.add,afterEach:u.add,onError:ae.add,isReady:se,install(e){e.component(`RouterLink`,Dl),e.component(`RouterView`,Pl),e.config.globalProperties.$router=I,Object.defineProperty(e.config.globalProperties,"$route",{enumerable:!0,get:()=>t(d)}),Qs&&!F&&d.value===jc&&(F=!0,E(s.location).catch(e=>{}));let n={};for(let e in jc)Object.defineProperty(n,e,{get:()=>d.value[e],enumerable:!0});e.provide(qs,I),e.provide(Js,r(n)),e.provide(Ys,d);let i=e.unmount;ue.add(e),e.unmount=function(){ue.delete(e),ue.size<1&&(p=jc,ne&&ne(),ne=null,d.value=jc,F=!1,N=!1),i()}}};function L(e){return e.reduce((e,t)=>e.then(()=>A(t)),Promise.resolve())}return I}var Il=[{path:`/`,component:()=>W(()=>import(`./MainLayout-fRVZ01LN.js`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45])),children:[{path:``,redirect:{name:`workspace`}},{path:`dashboard`,name:`dashboard`,component:()=>W(()=>import(`./DashboardPage-BKCrV6u0.js`),__vite__mapDeps([46,1,2,3,4,5,6,7,47,13,8,14,17,27,28,29,32,39,41,48]))},{path:`workspace/:id?`,name:`workspace`,component:()=>W(()=>import(`./WorkspacePage-B0wCQdev.js`).then(e=>e.t),__vite__mapDeps([49,1,2,3,4,5,6,7,50,9,10,8,11,12,13,14,15,35,36,20,17,21,18,22,23,24,25,26,51,32,28,39,52,53,54,43,34,31,37,38,30,33,40,41,42,44,55]))},{path:`split`,name:`split`,component:()=>W(()=>import(`./SplitWorkspacePage-DwWsD7f5.js`),__vite__mapDeps([56,1,2,3,4,5,6,7,8,10,11,12,13,14,15,31,39,43,57]))},{path:`create`,name:`create`,component:()=>W(()=>import(`./CreatePage-6_AP5zso.js`),__vite__mapDeps([58,1,2,3,4,5,6,7,50,9,10,8,11,12,13,14,15,35,36,17,22,59,38,25,26,32,33,39,40,24,41,52,53,42,60]))},{path:`settings`,name:`settings`,component:()=>W(()=>import(`./SettingsPage-DCMZL7GO.js`),__vite__mapDeps([34,1,2,3,4,5,6,7,11,9,10,8,12,13,14,15,35,36,31,17,23,24,25,37,38,30,32,33,39,40,41,42,43,44]))},{path:`search`,name:`search`,component:()=>W(()=>import(`./SearchPage-CnT0-Hpe.js`),__vite__mapDeps([61,1,2,3,6,7,13,4,5,8,14,22,28,39,40,17,24,41,54,62]))},{path:`health`,name:`health`,component:()=>W(()=>import(`./HealthPage-DWotmfkh.js`),__vite__mapDeps([63,1,2,3,4,5,6,7,9,12,13,8,14,22,39,40,17,24,41,64]))},{path:`changelog`,name:`changelog`,component:()=>W(()=>import(`./ChangelogPage-BXNz7PGb.js`),__vite__mapDeps([65,1,2,3,4,5,6,7,13,8,14,18,15,39,40,17,24,41,66]))}]},{path:`/:catchAll(.*)*`,redirect:`/`}],Ll=os(()=>{let e=Fl({scrollBehavior:()=>({left:0,top:0}),routes:Il,history:rl()});e.beforeEach((e,t)=>{if(Co(e,t)||e.fullPath===t.fullPath||!Ps())return!0;let n=rt.global.t;return new Promise(e=>{ks.create({title:n(`unsaved.title`),message:n(`unsaved.message`),dark:!0,cancel:{flat:!0,label:n(`unsaved.stay`),color:`grey-5`},ok:{flat:!0,label:n(`unsaved.leave`),color:`negative`}}).onOk(()=>e(!0)).onCancel(()=>e(!1))})});let t=()=>{let e=Y();return To(Ps(),si(e)?{}:e.queuedMessages)};return window.addEventListener(`beforeunload`,e=>{t()&&(e.preventDefault(),e.returnValue=``)}),vo&&(window.koboPane={hasUnsavedWork:t,ready:()=>e.currentRoute.value.name!=null,navigate:t=>e.push({name:`workspace`,params:{id:t}}),workspaceId:()=>typeof e.currentRoute.value.params.id==`string`?e.currentRoute.value.params.id:void 0}),e});async function Rl(e,t){let n=e(rs);n.use(Kt,t);let r=typeof ss==`function`?await ss({}):ss;n.use(r);let i=a(typeof Ll==`function`?await Ll({store:r}):Ll);return r.use(({store:e})=>{e.router=i}),{app:n,store:r,router:i}}var zl={config:{dark:!0,brand:{primary:`#6c63ff`,secondary:`#26a69a`,accent:`#9c27b0`,dark:`#1a1a2e`,"dark-page":`#1a1a2e`,positive:`#21ba45`,negative:`#c10015`,info:`#31ccec`,warning:`#f2c037`}},plugins:{Notify:ki,Dialog:ks}},Bl=function(){return!!(window.location.hostname===`localhost`||window.location.hostname===`[::1]`||window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/))},Vl;typeof window<`u`&&(Vl=typeof Promise<`u`?new Promise(function(e){return window.addEventListener(`load`,e)}):{then:function(e){return window.addEventListener(`load`,e)}});function Hl(e,t){t===void 0&&(t={});var n=t.registrationOptions;n===void 0&&(n={}),delete t.registrationOptions;var r=function(e){for(var n=[],r=arguments.length-1;r-->0;)n[r]=arguments[r+1];t&&t[e]&&t[e].apply(t,n)};`serviceWorker`in navigator&&Vl.then(function(){Bl()?(Gl(e,r,n),navigator.serviceWorker.ready.then(function(e){r(`ready`,e)}).catch(function(e){return Ul(r,e)})):(Wl(e,r,n),navigator.serviceWorker.ready.then(function(e){r(`ready`,e)}).catch(function(e){return Ul(r,e)}))})}function Ul(e,t){navigator.onLine||e(`offline`),e(`error`,t)}function Wl(e,t,n){navigator.serviceWorker.register(e,n).then(function(e){if(t(`registered`,e),e.waiting){t(`updated`,e);return}e.onupdatefound=function(){t(`updatefound`,e);var n=e.installing;n.onstatechange=function(){n.state===`installed`&&(navigator.serviceWorker.controller?t(`updated`,e):t(`cached`,e))}}}).catch(function(e){return Ul(t,e)})}function Gl(e,t,n){fetch(e).then(function(r){r.status===404?(t(`error`,Error(`Service worker not found at `+e)),Kl()):r.headers.get(`content-type`).indexOf(`javascript`)===-1?(t(`error`,Error(`Expected `+e+` to have javascript content-type, but received `+r.headers.get(`content-type`))),Kl()):Wl(e,t,n)}).catch(function(e){return Ul(t,e)})}function Kl(){`serviceWorker`in navigator&&navigator.serviceWorker.ready.then(function(e){e.unregister()}).catch(function(e){return Ul(emit,e)})}Hl(`/sw.js`);var ql=`/`;async function Jl({app:e,router:t,store:n},r){let i=!1,a=e=>{try{return t.resolve(e).href}catch{}return Object(e)===e?null:e},o=e=>{if(i=!0,typeof e==`string`&&/^https?:\/\//.test(e)){window.location.href=e;return}let t=a(e);t!==null&&(window.location.href=t,window.location.reload())},s=window.location.hash.slice(1)||`/`;for(let a=0;i===!1&&a<r.length;a++)try{await r[a]({app:e,router:t,store:n,ssrContext:null,redirect:o,urlPath:s,publicPath:ql})}catch(e){i||console.error(`[Quasar] boot error:`,e);return}i||(e.use(t),e.mount(`#q-app`))}Rl(fe,zl).then(e=>{let[t,n]=Promise.allSettled===void 0?[`all`,e=>e.map(e=>e.default)]:[`allSettled`,e=>e.map(e=>{if(e.status===`rejected`){console.error(`[Quasar] boot error:`,e.reason);return}return e.value.default})];return Promise[t]([W(()=>import(`./i18n-DtmbeJu8.js`),__vite__mapDeps([67,6,1,2,7])),W(()=>import(`./network-auth-CSx0jS5X.js`),[]),W(()=>import(`./notify-theme-uhSG2r09.js`),[])]).then(t=>{Jl(e,n(t).filter(e=>typeof e==`function`))})});export{xa as $,io as A,Yn as At,Ca as B,rn as Bt,wo as C,qr as Ct,so as D,pr as Dt,fo as E,Dr as Et,Za as F,Tn as Ft,Ia as G,Qt as Gt,Ea as H,dn as Ht,Ba as I,En as It,ja as J,qt as Jt,Ra as K,Zt as Kt,wa as L,an as Lt,Xa as M,Nn as Mt,Ya as N,Pn as Nt,oo as O,fr as Ot,$a as P,An as Pt,_a as Q,Oa as R,nn as Rt,xo as S,Jr as St,go as T,dr as Tt,Ma as U,un as Ut,Da as V,en as Vt,Na as W,$t as Wt,za as X,Bt as Xt,Aa as Y,Lt as Yt,ga as Z,K as Zt,Lo as _,ti as _t,js as a,qi as at,vo as b,Zr as bt,gs as c,Li as ct,us as d,Fi as dt,fa as et,as as f,ji as ft,zo as g,di as gt,Ro as h,fi as ht,Xs as i,Gi as it,eo as j,Rn as jt,to as k,mr as kt,hs as l,Ni as lt,Vo as m,ki as mt,Ws as n,Y as nt,Ms as o,zi as ot,ns as p,Mi as pt,Fa as q,Xt as qt,Zs as r,Ui as rt,bs as s,Bi as st,Hs as t,Yi as tt,ps as u,Pi as ut,Fo as v,$r as vt,_o as w,Kr as wt,bo as x,Qr as xt,yo as y,Xr as yt,Ta as z,pn as zt};
|