@huynle/hub 0.8.3 → 0.8.5

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.
Files changed (99) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +40 -3
  3. package/package.json +1 -1
  4. package/packages/claude-code/package.json +1 -1
  5. package/packages/cli/dist/hub-cli.js +5288 -4415
  6. package/packages/cli/package.json +1 -1
  7. package/packages/cli/src/bootstrap/PHASE2-CONTRACT.md +87 -0
  8. package/packages/cli/src/bootstrap/adapters/claude/node.ts +11 -43
  9. package/packages/cli/src/bootstrap/adapters/codex/verify.ts +19 -12
  10. package/packages/cli/src/bootstrap/adapters/opencode/README.md +42 -6
  11. package/packages/cli/src/bootstrap/adapters/opencode/apply.ts +18 -7
  12. package/packages/cli/src/bootstrap/adapters/opencode/archive.ts +36 -19
  13. package/packages/cli/src/bootstrap/adapters/opencode/config.ts +19 -3
  14. package/packages/cli/src/bootstrap/adapters/opencode/index.ts +2 -5
  15. package/packages/cli/src/bootstrap/adapters/opencode/plan.ts +37 -6
  16. package/packages/cli/src/bootstrap/adapters/opencode/verify.ts +49 -26
  17. package/packages/cli/src/bootstrap/adapters/process-tree.ts +263 -0
  18. package/packages/cli/src/bootstrap/contracts/paths.ts +7 -4
  19. package/packages/cli/src/bootstrap/contracts/platform.ts +9 -5
  20. package/packages/cli/src/bootstrap/contracts/validate.ts +20 -4
  21. package/packages/cli/src/bootstrap/discovery/discover.ts +3 -1
  22. package/packages/cli/src/bootstrap/discovery/executables.ts +49 -14
  23. package/packages/cli/src/bootstrap/discovery/host.ts +16 -8
  24. package/packages/cli/src/bootstrap/discovery/node-probe.ts +41 -5
  25. package/packages/cli/src/bootstrap/discovery/probe.ts +7 -3
  26. package/packages/cli/src/bootstrap/discovery/util.ts +42 -5
  27. package/packages/cli/src/bootstrap/enrollment/store.ts +13 -6
  28. package/packages/cli/src/bootstrap/preview/plan.ts +3 -0
  29. package/packages/cli/src/bootstrap/profiles/desired.ts +10 -3
  30. package/packages/cli/src/bootstrap/release/README.md +63 -9
  31. package/packages/cli/src/bootstrap/release/cli.ts +94 -16
  32. package/packages/cli/src/bootstrap/release/harness-pins.pending.json +24 -0
  33. package/packages/cli/src/bootstrap/release/manifest.ts +3 -0
  34. package/packages/cli/src/bootstrap/release/pins.ts +60 -9
  35. package/packages/cli/src/bootstrap/transaction/builtin.ts +18 -6
  36. package/packages/cli/src/bootstrap/transaction/engine.ts +166 -12
  37. package/packages/cli/src/bootstrap/transaction/executor.ts +5 -0
  38. package/packages/cli/src/bootstrap/transaction/fs.ts +142 -3
  39. package/packages/cli/src/bootstrap/transaction/shim.ts +31 -0
  40. package/packages/cli/src/bootstrap/transaction/state.ts +11 -6
  41. package/packages/cli/src/credentials.ts +5 -2
  42. package/packages/cli/src/main.ts +3 -2
  43. package/packages/cli/src/setup/commands.ts +96 -18
  44. package/packages/cli/src/setup/contributors.ts +45 -10
  45. package/packages/cli/src/setup/runtime.ts +25 -6
  46. package/packages/cli/src/setup/self-aside.ts +130 -0
  47. package/packages/codex/package.json +1 -1
  48. package/packages/node/package.json +1 -1
  49. package/packages/node/src/opencode-warm.ts +12 -4
  50. package/packages/preset/package.json +1 -1
  51. package/packages/protocol/package.json +1 -1
  52. package/packages/protocol/src/index.ts +7 -2
  53. package/packages/runtime-openshell/package.json +1 -1
  54. package/packages/runtime-sdk/package.json +1 -1
  55. package/packages/sdk/package.json +1 -1
  56. package/packages/spoke-sdk/package.json +1 -1
  57. package/src/central/config.ts +12 -0
  58. package/src/central/http.ts +10 -0
  59. package/src/central/install/CONTRACT.md +66 -0
  60. package/src/central/install/install.ps1 +349 -0
  61. package/src/central/install/install.sh +266 -0
  62. package/src/central/install/render.ts +146 -0
  63. package/src/central/install/templates.ts +6 -0
  64. package/src/central/install/text-assets.d.ts +9 -0
  65. package/src/central/registry.ts +93 -22
  66. package/src/config.ts +12 -7
  67. package/src/index.ts +28 -0
  68. package/src/spoke/env-inject.ts +17 -2
  69. package/src/spoke/launchers.ts +145 -9
  70. package/src/spoke/spoke.ts +150 -10
  71. package/src/status.ts +70 -14
  72. package/src/win-acl.ts +154 -0
  73. package/web/dist/assets/ArtifactPage-Dq7VW-bU.js +1 -0
  74. package/web/dist/assets/{ArtifactPane-DPHjiWce.js → ArtifactPane-DKwbMTX9.js} +1 -1
  75. package/web/dist/assets/ArtifactWorkbench-vrgIfncX.js +6 -0
  76. package/web/dist/assets/Library-D6-Go6Cu.js +2 -0
  77. package/web/dist/assets/{ProfilesDestination-GriuOpiZ.js → ProfilesDestination-BOML2Dgf.js} +1 -1
  78. package/web/dist/assets/{TeamsPage-C-5lYeeM.js → TeamsPage-CNBTE8gB.js} +1 -1
  79. package/web/dist/assets/Watchtower-Dor1Ubjy.js +2 -0
  80. package/web/dist/assets/Watchtower-RphjcL0_.css +1 -0
  81. package/web/dist/assets/hub-CrbItiwP.js +13 -0
  82. package/web/dist/assets/index-82Ce0IAf.css +1 -0
  83. package/web/dist/assets/index-D9SP3_0z.js +22 -0
  84. package/web/dist/assets/{live-CDWcyavI.js → live-BNJgy0vg.js} +3 -3
  85. package/web/dist/assets/{pane-layout-Csk-vPNe.js → pane-layout-EdR1kRrG.js} +1 -1
  86. package/web/dist/assets/preload-helper-DqrJTq0t.js +1 -0
  87. package/web/dist/assets/{renderer2d-CNFdTDTr.js → renderer2d-CYag1CnR.js} +1 -1
  88. package/web/dist/assets/{renderer3d-C45jPvYX.js → renderer3d-BRB6rgDJ.js} +1 -1
  89. package/web/dist/assets/{safe-area-sA9a8vYJ.js → safe-area-fOy0AOuG.js} +1 -1
  90. package/web/dist/assets/{source-BFLJQ43_.js → source-Wbq35qGp.js} +1 -1
  91. package/web/dist/assets/{ui-Qo2Pd9-O.js → ui-j5FFk90B.js} +1 -1
  92. package/web/dist/index.html +6 -4
  93. package/web/dist/assets/ArtifactPage-CSotAWob.js +0 -1
  94. package/web/dist/assets/ArtifactWorkbench-CkmWnP6L.js +0 -6
  95. package/web/dist/assets/Library-DTLEyekn.js +0 -2
  96. package/web/dist/assets/Watchtower-CTgqHk5g.css +0 -1
  97. package/web/dist/assets/Watchtower-DOlPsiIy.js +0 -2
  98. package/web/dist/assets/index-6mdQ7eUY.js +0 -34
  99. package/web/dist/assets/index-C5OmwA1y.css +0 -1
@@ -1 +1 @@
1
- import{E as e}from"./live-CDWcyavI.js";var t=`watchtower.layout`,n=1e3,r=[`--accent`,`--blue`,`--violet`,`--orange`,`--ok`,`--warn`];function i(e,t=0){let n=110+26*Math.sqrt(Math.max(1,e))+7*Math.sqrt(Math.max(0,t)),r=Math.PI*(3-Math.sqrt(5));return Array.from({length:e},(t,i)=>{let a=e===1?0:1-i/(e-1)*2,o=Math.sqrt(1-a*a),s=i*r;return[l(Math.cos(s)*o*n),l(a*n*.55),l(Math.sin(s)*o*n)]})}function a(t){let n=new Set(t.nodes.map(e=>e.id)),a=i(t.groups.length,t.groups.reduce((e,t)=>e+t.sections.reduce((e,t)=>e+t.members.length,0),0));return t.groups.map((t,i)=>{let o=[];n.has(t.id)&&o.push(t.id);for(let e of t.sections)e.id!==void 0&&n.has(e.id)&&o.push(e.id),o.push(...e.members);let s=t.machine===void 0?r[i%r.length]:e[t.machine%e.length];return{id:t.id,label:t.label,color:s,center:a[i],members:o}})}function o(e){let t=new Map;for(let n of e.links)n.kind!==`structure`&&n.kind!==`policy`&&(t.set(n.source,(t.get(n.source)??0)+n.count),t.set(n.target,(t.get(n.target)??0)+n.count));return t}function s(e,t){let n=new Set,r=new Set(e.groups.map(e=>e.id));for(let t of e.nodes)(t.kind===`hub`||t.kind===`user`||t.kind===`app`||t.kind===`role`||r.has(t.id)||t.match)&&n.add(t.id);let i=o(e),a=e.nodes.filter(e=>!n.has(e.id)&&e.kind!==`role`);a.sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||(e.id<t.id?-1:+(e.id>t.id)));for(let e of a.slice(0,Math.max(0,t.max)))n.add(e.id);for(let e of t.extra??[])n.add(e);return n}var c=e=>e.kind===`role`&&e.vacant?`${e.label} · vacant`:e.label,l=e=>Math.round(e*10)/10,u=e=>typeof e==`number`&&Number.isFinite(e);function d(e){let t=new Map;if(!e)return t;let n;try{n=JSON.parse(e)}catch{return t}if(typeof n!=`object`||!n||Array.isArray(n))return t;let{v:r,p:i}=n;if(r!==1||typeof i!=`object`||!i||Array.isArray(i))return t;for(let[e,n]of Object.entries(i)){if(t.size>=1e3)break;if(!Array.isArray(n)||n.length!==3)continue;let[r,i,a]=n;u(r)&&u(i)&&u(a)&&t.set(e,[r,i,a])}return t}function f(e,t,r=n){let i={},a=0;for(let n of[e,t])for(let[e,t]of n){if(a>=r)break;e in i||!t.every(u)||(i[e]=[l(t[0]),l(t[1]),l(t[2])],a++)}return JSON.stringify({v:1,p:i})}function p(e,t){let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=(n>>>0)%1e3/1e3,i=(Math.imul(n,2654435761)>>>0)%1e3/1e3,a=r*Math.PI*2,o=i*2-1,s=Math.sqrt(1-o*o),c=t*(.6+.4*r);return[Math.cos(a)*s*c,o*c,Math.sin(a)*s*c]}function m(e,t){let n=new Map,r=new Set,i=new Map;for(let t of a(e))for(let e of t.members)i.set(e,t);let o=new Map,s=new Map;for(let t of e.links)t.kind===`structure`&&(o.get(t.target)??o.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.target)??s.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.source)??s.set(t.source,[]).get(t.source)).push(t.target);n.set(`hub`,[0,0,0]);for(let r of e.nodes){if(r.id===`hub`)continue;let e=t.get(r.id);e&&n.set(r.id,e)}let c=new Set(e.groups.map(e=>e.id)),u=[...e.nodes.filter(e=>c.has(e.id)),...e.nodes.filter(e=>!c.has(e.id))];for(let e of u){if(n.has(e.id))continue;r.add(e.id);let t=[...o.get(e.id)??[],...s.get(e.id)??[]].find(e=>e!==`hub`&&n.has(e)),a=i.get(e.id),c=t===void 0?a?.center:n.get(t),u=p(e.id,t===void 0?a?24:40:14),d=c??[0,0,0];n.set(e.id,[l(d[0]+u[0]),l(d[1]+u[1]),l(d[2]+u[2])])}return{positions:n,fresh:r}}function h(e,t){let n=new Map,r=[],i=e=>r.some(t=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h),a=[...e.filter(e=>e.pinned),...e.filter(e=>!e.pinned)];for(let e of a)for(let a of e.texts){let o=t(a,e),s={x:e.x-o/2,y:e.y,w:o,h:e.h};if(e.pinned||!i(s)){r.push(s),n.set(e.id,{text:a,box:s});break}}return n}var g=8,_=900;function v(e){let t={top:0,right:0,bottom:0,left:0},n=e.closest(`.wt-stage`);if(!n)return t;let r=e.getBoundingClientRect();if(!r.height)return t;let i=n.querySelector(`.wt-dock`)?.getBoundingClientRect(),a=n.querySelector(`.wt-chips`)?.getBoundingClientRect(),o=r.width>=_?n.querySelector(`.wt-pop-legend`)?.getBoundingClientRect():void 0,s=o&&o.width?Math.max(0,o.right-r.left+g):0,c=i&&i.height?Math.max(0,r.bottom-i.top+g):0,l=a&&a.height?Math.max(0,a.bottom-r.top+g):0;return{top:Math.min(l,r.height/3),right:0,bottom:Math.min(c,r.height/3),left:Math.min(s,r.width/3)}}export{c as a,a as c,s as i,m as l,t as n,d as o,o as r,h as s,v as t,f as u};
1
+ import{E as e}from"./live-BNJgy0vg.js";var t=`watchtower.layout`,n=1e3,r=[`--accent`,`--blue`,`--violet`,`--orange`,`--ok`,`--warn`];function i(e,t=0){let n=110+26*Math.sqrt(Math.max(1,e))+7*Math.sqrt(Math.max(0,t)),r=Math.PI*(3-Math.sqrt(5));return Array.from({length:e},(t,i)=>{let a=e===1?0:1-i/(e-1)*2,o=Math.sqrt(1-a*a),s=i*r;return[l(Math.cos(s)*o*n),l(a*n*.55),l(Math.sin(s)*o*n)]})}function a(t){let n=new Set(t.nodes.map(e=>e.id)),a=i(t.groups.length,t.groups.reduce((e,t)=>e+t.sections.reduce((e,t)=>e+t.members.length,0),0));return t.groups.map((t,i)=>{let o=[];n.has(t.id)&&o.push(t.id);for(let e of t.sections)e.id!==void 0&&n.has(e.id)&&o.push(e.id),o.push(...e.members);let s=t.machine===void 0?r[i%r.length]:e[t.machine%e.length];return{id:t.id,label:t.label,color:s,center:a[i],members:o}})}function o(e){let t=new Map;for(let n of e.links)n.kind!==`structure`&&n.kind!==`policy`&&(t.set(n.source,(t.get(n.source)??0)+n.count),t.set(n.target,(t.get(n.target)??0)+n.count));return t}function s(e,t){let n=new Set,r=new Set(e.groups.map(e=>e.id));for(let t of e.nodes)(t.kind===`hub`||t.kind===`user`||t.kind===`app`||t.kind===`role`||r.has(t.id)||t.match)&&n.add(t.id);let i=o(e),a=e.nodes.filter(e=>!n.has(e.id)&&e.kind!==`role`);a.sort((e,t)=>(i.get(t.id)??0)-(i.get(e.id)??0)||(e.id<t.id?-1:+(e.id>t.id)));for(let e of a.slice(0,Math.max(0,t.max)))n.add(e.id);for(let e of t.extra??[])n.add(e);return n}var c=e=>e.kind===`role`&&e.vacant?`${e.label} · vacant`:e.label,l=e=>Math.round(e*10)/10,u=e=>typeof e==`number`&&Number.isFinite(e);function d(e){let t=new Map;if(!e)return t;let n;try{n=JSON.parse(e)}catch{return t}if(typeof n!=`object`||!n||Array.isArray(n))return t;let{v:r,p:i}=n;if(r!==1||typeof i!=`object`||!i||Array.isArray(i))return t;for(let[e,n]of Object.entries(i)){if(t.size>=1e3)break;if(!Array.isArray(n)||n.length!==3)continue;let[r,i,a]=n;u(r)&&u(i)&&u(a)&&t.set(e,[r,i,a])}return t}function f(e,t,r=n){let i={},a=0;for(let n of[e,t])for(let[e,t]of n){if(a>=r)break;e in i||!t.every(u)||(i[e]=[l(t[0]),l(t[1]),l(t[2])],a++)}return JSON.stringify({v:1,p:i})}function p(e,t){let n=2166136261;for(let t=0;t<e.length;t++)n=Math.imul(n^e.charCodeAt(t),16777619);let r=(n>>>0)%1e3/1e3,i=(Math.imul(n,2654435761)>>>0)%1e3/1e3,a=r*Math.PI*2,o=i*2-1,s=Math.sqrt(1-o*o),c=t*(.6+.4*r);return[Math.cos(a)*s*c,o*c,Math.sin(a)*s*c]}function m(e,t){let n=new Map,r=new Set,i=new Map;for(let t of a(e))for(let e of t.members)i.set(e,t);let o=new Map,s=new Map;for(let t of e.links)t.kind===`structure`&&(o.get(t.target)??o.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.target)??s.set(t.target,[]).get(t.target)).push(t.source),(s.get(t.source)??s.set(t.source,[]).get(t.source)).push(t.target);n.set(`hub`,[0,0,0]);for(let r of e.nodes){if(r.id===`hub`)continue;let e=t.get(r.id);e&&n.set(r.id,e)}let c=new Set(e.groups.map(e=>e.id)),u=[...e.nodes.filter(e=>c.has(e.id)),...e.nodes.filter(e=>!c.has(e.id))];for(let e of u){if(n.has(e.id))continue;r.add(e.id);let t=[...o.get(e.id)??[],...s.get(e.id)??[]].find(e=>e!==`hub`&&n.has(e)),a=i.get(e.id),c=t===void 0?a?.center:n.get(t),u=p(e.id,t===void 0?a?24:40:14),d=c??[0,0,0];n.set(e.id,[l(d[0]+u[0]),l(d[1]+u[1]),l(d[2]+u[2])])}return{positions:n,fresh:r}}function h(e,t){let n=new Map,r=[],i=e=>r.some(t=>e.x<t.x+t.w&&t.x<e.x+e.w&&e.y<t.y+t.h&&t.y<e.y+e.h),a=[...e.filter(e=>e.pinned),...e.filter(e=>!e.pinned)];for(let e of a)for(let a of e.texts){let o=t(a,e),s={x:e.x-o/2,y:e.y,w:o,h:e.h};if(e.pinned||!i(s)){r.push(s),n.set(e.id,{text:a,box:s});break}}return n}var g=8,_=900;function v(e){let t={top:0,right:0,bottom:0,left:0},n=e.closest(`.wt-stage`);if(!n)return t;let r=e.getBoundingClientRect();if(!r.height)return t;let i=n.querySelector(`.wt-dock`)?.getBoundingClientRect(),a=n.querySelector(`.wt-chips`)?.getBoundingClientRect(),o=r.width>=_?n.querySelector(`.wt-pop-legend`)?.getBoundingClientRect():void 0,s=o&&o.width?Math.max(0,o.right-r.left+g):0,c=i&&i.height?Math.max(0,r.bottom-i.top+g):0,l=a&&a.height?Math.max(0,a.bottom-r.top+g):0;return{top:Math.min(l,r.height/3),right:0,bottom:Math.min(c,r.height/3),left:Math.min(s,r.width/3)}}export{c as a,a as c,s as i,m as l,t as n,d as o,o as r,h as s,v as t,f as u};
@@ -1 +1 @@
1
- import{G as e,Q as t,it as n}from"./ui-Qo2Pd9-O.js";var r={artifactsPerUser:5e3,revisionsPerArtifact:500,blobBytes:26214400,userBlobBytes:2147483648,bundleFiles:200,chunkBytes:1048576,aiJobsPerUser:8,aiJobsPerArtifact:2,aiInstructionChars:8e3},i=[`markdown`,`code`,`image`,`table`,`chart`,`dashboard`,`html`,`app`,`file`],a=[`html`,`app`],o=[`text/markdown`,`text/plain`,`text/csv`,`text/html`,`text/css`,`text/javascript`,`application/json`,`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`],s=e=>typeof e==`string`&&/^sha256:[0-9a-f]{64}$/.test(e);function c(e){if(!t(e))return`blob must be an object`;if(!s(e.hash))return`hash must be sha256:<64 hex>`;if(typeof e.bytes!=`number`||!Number.isSafeInteger(e.bytes)||e.bytes<0||e.bytes>r.blobBytes)return`bytes must be 0–${r.blobBytes}`;if(!o.includes(e.mediaType))return`mediaType is not allowed`;if(e.path!==void 0&&(typeof e.path!=`string`||!/^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[A-Za-z0-9._/-]{1,200}$/.test(e.path)))return`path must be a relative path without . or .. segments`}var l=`/api/agent/artifacts`,u={workspace:``,type:``},d=e=>typeof e==`string`&&i.includes(e);function f(t){let n=typeof t==`string`?new URLSearchParams(t):t,r=n.get(`workspace`)??``,i=n.get(`type`)??``;return{workspace:r===`none`||e(`workspace`,r)?r:``,type:d(i)?i:``}}function p(e){let t=new URLSearchParams;e.workspace&&t.set(`workspace`,e.workspace),e.type&&t.set(`type`,e.type);let n=t.toString();return n?`?${n}`:``}var m=e=>e.workspace&&e.workspace!==`none`?e.workspace:``;function h(e,t){let n=new URLSearchParams({state:`active`,limit:`50`}),r=m(e);return r&&n.set(`workspace`,r),t&&n.set(`cursor`,t),`${l}?${n}`}var g=e=>typeof e==`string`&&e.length>0;function _(e){if(!e||typeof e!=`object`)return;let t=e;if(g(t.id)&&typeof t.title==`string`&&d(t.kind)&&typeof t.updatedAt==`number`)return{id:t.id,title:t.title,kind:t.kind,visibility:t.visibility===`workspace`?`workspace`:`private`,...g(t.workspaceID)?{workspaceID:t.workspaceID}:{},...g(t.description)?{description:t.description}:{},updatedAt:t.updatedAt}}function v(e){let t=e&&typeof e==`object`?e:{};return{items:Array.isArray(t.items)?t.items.flatMap(e=>_(e)??[]):[],...g(t.cursor)?{cursor:t.cursor}:{}}}function y(e,t){return e.filter(e=>(t.type===``||e.kind===t.type)&&(t.workspace===``||(t.workspace===`none`?!e.workspaceID:e.workspaceID===t.workspace)))}function b(e){return e.status===422||e.code===`unsupported`?{kind:`unsupported`,text:`Artifacts aren't supported on this hub yet.`}:e.status===404?{kind:`unavailable`,text:`This hub doesn't have artifacts.`}:e.status===403||e.status===401?{kind:`forbidden`,text:`This device isn't allowed to read artifacts.`}:{kind:`error`,text:e.message?`Could not load artifacts: ${e.message}`:`Could not load artifacts (HTTP ${e.status}).`}}function x(e){let t=e&&typeof e==`object`?e:{};return{status:typeof t.status==`number`?t.status:0,...typeof t.code==`string`?{code:t.code}:{},message:typeof t.message==`string`?t.message:String(e)}}function S(e,t){return t?`None of the artifacts loaded so far match. Load more to keep looking.`:e.workspace===``&&e.type===``?`No artifacts yet. Artifacts that your sessions create show up here.`:`No artifacts match these filters.`}var C=(e,t)=>t.get(e)??`Workspace ${e.slice(0,12)}…`,w=e=>`/artifacts/${encodeURIComponent(e)}`;function T(e,t){let n=u,r,i=0,a=[],o,s={status:`loading`},c=()=>s.status===`ready`?{status:`ready`,items:y(a,n),total:a.length,more:o!==void 0,loadingMore:s.loadingMore,...s.moreError?{moreError:s.moreError}:{}}:s,l=e=>{s=e,t(c())};function d(u){n=u;let d=m(u);if(d===r&&s.status===`ready`){t(c());return}r=d;let f=++i;a=[],o=void 0,l({status:`loading`}),e.list(u).then(e=>{f===i&&(a=[...e.items],o=e.cursor,l({status:`ready`,loadingMore:!1}))},e=>f===i&&l({status:`error`,error:b(x(e))}))}function f(){if(s.status!==`ready`||s.loadingMore||o===void 0)return;let t=i;l({status:`ready`,loadingMore:!0}),e.list(n,o).then(e=>{if(t!==i)return;let n=new Set(a.map(e=>e.id));a=[...a,...e.items.filter(e=>!n.has(e.id))],o=e.cursor,l({status:`ready`,loadingMore:!1})},e=>t===i&&l({status:`ready`,loadingMore:!1,moreError:b(x(e)).text}))}function p(){r=void 0,d(n)}return{load:d,more:f,reload:p,view:c}}var E={list:async(e,t)=>v(await n(h(e,t)))};async function D(){try{return((await n(`/api/agent/workspaces?state=active&limit=200`)).items??[]).flatMap(e=>typeof e.id==`string`&&typeof e.title==`string`?[{id:e.id,title:e.title}]:[])}catch{return[]}}export{S as a,C as c,a as d,c as f,T as i,i as l,D as n,p as o,w as r,f as s,E as t,r as u};
1
+ import{G as e,Q as t,it as n}from"./ui-j5FFk90B.js";var r={artifactsPerUser:5e3,revisionsPerArtifact:500,blobBytes:26214400,userBlobBytes:2147483648,bundleFiles:200,chunkBytes:1048576,aiJobsPerUser:8,aiJobsPerArtifact:2,aiInstructionChars:8e3},i=[`markdown`,`code`,`image`,`table`,`chart`,`dashboard`,`html`,`app`,`file`],a=[`html`,`app`],o=[`text/markdown`,`text/plain`,`text/csv`,`text/html`,`text/css`,`text/javascript`,`application/json`,`application/pdf`,`image/png`,`image/jpeg`,`image/gif`,`image/webp`,`image/svg+xml`],s=e=>typeof e==`string`&&/^sha256:[0-9a-f]{64}$/.test(e);function c(e){if(!t(e))return`blob must be an object`;if(!s(e.hash))return`hash must be sha256:<64 hex>`;if(typeof e.bytes!=`number`||!Number.isSafeInteger(e.bytes)||e.bytes<0||e.bytes>r.blobBytes)return`bytes must be 0–${r.blobBytes}`;if(!o.includes(e.mediaType))return`mediaType is not allowed`;if(e.path!==void 0&&(typeof e.path!=`string`||!/^(?!\/)(?!.*(?:^|\/)\.\.?(?:\/|$))[A-Za-z0-9._/-]{1,200}$/.test(e.path)))return`path must be a relative path without . or .. segments`}var l=`/api/agent/artifacts`,u={workspace:``,type:``},d=e=>typeof e==`string`&&i.includes(e);function f(t){let n=typeof t==`string`?new URLSearchParams(t):t,r=n.get(`workspace`)??``,i=n.get(`type`)??``;return{workspace:r===`none`||e(`workspace`,r)?r:``,type:d(i)?i:``}}function p(e){let t=new URLSearchParams;e.workspace&&t.set(`workspace`,e.workspace),e.type&&t.set(`type`,e.type);let n=t.toString();return n?`?${n}`:``}var m=e=>e.workspace&&e.workspace!==`none`?e.workspace:``;function h(e,t){let n=new URLSearchParams({state:`active`,limit:`50`}),r=m(e);return r&&n.set(`workspace`,r),t&&n.set(`cursor`,t),`${l}?${n}`}var g=e=>typeof e==`string`&&e.length>0;function _(e){if(!e||typeof e!=`object`)return;let t=e;if(g(t.id)&&typeof t.title==`string`&&d(t.kind)&&typeof t.updatedAt==`number`)return{id:t.id,title:t.title,kind:t.kind,visibility:t.visibility===`workspace`?`workspace`:`private`,...g(t.workspaceID)?{workspaceID:t.workspaceID}:{},...g(t.description)?{description:t.description}:{},updatedAt:t.updatedAt}}function v(e){let t=e&&typeof e==`object`?e:{};return{items:Array.isArray(t.items)?t.items.flatMap(e=>_(e)??[]):[],...g(t.cursor)?{cursor:t.cursor}:{}}}function y(e,t){return e.filter(e=>(t.type===``||e.kind===t.type)&&(t.workspace===``||(t.workspace===`none`?!e.workspaceID:e.workspaceID===t.workspace)))}function b(e){return e.status===422||e.code===`unsupported`?{kind:`unsupported`,text:`Artifacts aren't supported on this hub yet.`}:e.status===404?{kind:`unavailable`,text:`This hub doesn't have artifacts.`}:e.status===403||e.status===401?{kind:`forbidden`,text:`This device isn't allowed to read artifacts.`}:{kind:`error`,text:e.message?`Could not load artifacts: ${e.message}`:`Could not load artifacts (HTTP ${e.status}).`}}function x(e){let t=e&&typeof e==`object`?e:{};return{status:typeof t.status==`number`?t.status:0,...typeof t.code==`string`?{code:t.code}:{},message:typeof t.message==`string`?t.message:String(e)}}function S(e,t){return t?`None of the artifacts loaded so far match. Load more to keep looking.`:e.workspace===``&&e.type===``?`No artifacts yet. Artifacts that your sessions create show up here.`:`No artifacts match these filters.`}var C=(e,t)=>t.get(e)??`Workspace ${e.slice(0,12)}…`,w=e=>`/artifacts/${encodeURIComponent(e)}`;function T(e,t){let n=u,r,i=0,a=[],o,s={status:`loading`},c=()=>s.status===`ready`?{status:`ready`,items:y(a,n),total:a.length,more:o!==void 0,loadingMore:s.loadingMore,...s.moreError?{moreError:s.moreError}:{}}:s,l=e=>{s=e,t(c())};function d(u){n=u;let d=m(u);if(d===r&&s.status===`ready`){t(c());return}r=d;let f=++i;a=[],o=void 0,l({status:`loading`}),e.list(u).then(e=>{f===i&&(a=[...e.items],o=e.cursor,l({status:`ready`,loadingMore:!1}))},e=>f===i&&l({status:`error`,error:b(x(e))}))}function f(){if(s.status!==`ready`||s.loadingMore||o===void 0)return;let t=i;l({status:`ready`,loadingMore:!0}),e.list(n,o).then(e=>{if(t!==i)return;let n=new Set(a.map(e=>e.id));a=[...a,...e.items.filter(e=>!n.has(e.id))],o=e.cursor,l({status:`ready`,loadingMore:!1})},e=>t===i&&l({status:`ready`,loadingMore:!1,moreError:b(x(e)).text}))}function p(){r=void 0,d(n)}return{load:d,more:f,reload:p,view:c}}var E={list:async(e,t)=>v(await n(h(e,t)))};async function D(){try{return((await n(`/api/agent/workspaces?state=active&limit=200`)).items??[]).flatMap(e=>typeof e.id==`string`&&typeof e.title==`string`?[{id:e.id,title:e.title}]:[])}catch{return[]}}export{S as a,C as c,a as d,c as f,T as i,i as l,D as n,p as o,w as r,f as s,E as t,r as u};
@@ -1,3 +1,3 @@
1
- var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ge,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p={},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>L(o)));m=o,g=null;try{return F(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){M(N(e,t,!0,u))}function S(e,t,n){M(N(e,t,!1,u))}function C(e,t,n){l=_e;let r=N(e,t,!1,u),i=j&&le(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):M(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,M(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=p,l=null,u=!1,d=!1,f=`initialValue`in o,_=typeof i==`function`&&w(i),v=new Set,[y,b]=(o.storage||x)(o.initialValue),[S,C]=x(void 0),[ne,re]=x(void 0,{equals:!1}),[ie,E]=x(f?`ready`:`unresolved`);m&&D(()=>{for(let e of v.keys())e.decrement();v.clear(),h&&s&&h.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=p,h&&e&&u?(h.promises.delete(e),u=!1,F(()=>{h.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){F(()=>{t===void 0&&b(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),C(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function oe(){let e=j&&le(j),t=y(),n=S();if(n!==void 0&&!s)throw n;return g&&!g.user&&e&&ee(()=>{ne(),s&&(e.resolved&&h&&u?h.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function A(e=!0){if(e!==!1&&d)return;d=!1;let t=_?_():i;if(u=h&&h.running,t==null||t===!1){O(s,T(y));return}h&&s&&h.promises.delete(s);let n,r=c===p?T(()=>{try{return a(t,{value:y(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0)O(s,void 0,R(n),t);else return te(r)?(s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,R(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),F(()=>{E(f?`refreshing`:`pending`),re()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,R(e),t)))):(O(s,r,void 0,t),r)}Object.defineProperties(oe,{state:{get:()=>ie()},error:{get:()=>S()},loading:{get(){let e=ie();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return oe();let e=S();if(e&&!s)throw e;return y()}}});let se=m;return _?ee(()=>(se=m,A(!1))):A(!1),[oe,{refetch:e=>ae(se,()=>A(e)),mutate:b}]}function re(e){return F(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function E(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return g}function k(){return m}function ae(e,t){let n=m,r=g;m=e,g=null;try{return F(t,!0)}catch(e){z(e)}finally{m=n,g=r}}var[oe,A]=x(!1);function se(e){v.push.apply(v,e),e.length=0}function ce(e,t){let n=Symbol(`context`);return{id:n,Provider:Se(n),defaultValue:e}}function le(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function ue(e){let t=w(e),n=w(()=>xe(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function de(){return j||=ce()}function fe(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)M(this);else{let e=_;_=null,F(()=>I(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function M(e){if(!e.fn)return;L(e);let t=y;me(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{F(()=>{h&&(h.running=!0),g=m=e,me(e,e.tValue,t),g=m=null},!1)})}function me(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,z(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==f&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function P(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return I(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===u)M(e);else if((t?e.tState:e.state)===d){let t=_;_=null,F(()=>I(e,n[0]),!1),_=t}}}function F(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return he(n),t}catch(e){n||(v=null),_=null,z(e)}}function he(e){if(_&&=(ge(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,F(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,A(!0);return}}let n=v;v=null,n.length&&F(()=>l(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)P(e[t])}function _e(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function I(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<y)&&P(i):e===d&&I(i,t)}}}function ve(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?_.push(r):v.push(r),r.observers&&ve(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function R(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function be(e,t,n){try{for(let n of t)n(e)}catch(e){z(e,n&&n.owner||null)}}function z(e,t=m){let n=c&&t&&t.context&&t.context[c],r=R(e);if(!n)throw r;v?v.push({fn(){be(r,n,t)},state:u}):be(r,n,t)}function xe(e){if(typeof e==`function`&&!e.length)return xe(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=xe(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Se(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},ue(()=>t.children))),void 0),n}}var Ce=Symbol(`fallback`);function B(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return D(()=>B(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,y;if(u===0)s!==0&&(B(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Te(e,t,n={}){let r=[],i=[],a=[],s=[],c=0,l;return D(()=>B(a)),()=>{let u=e()||[],d=u.length;return u[o],T(()=>{if(d===0)return c!==0&&(B(a),a=[],r=[],i=[],c=0,s=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===Ce&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(i[l]=b(f));for(;l<r.length;l++)a[l]();return c=s.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=x(u[l]);return s[l]=r,t(n,l)}}}function V(e,t){return T(()=>e(t||{}))}function H(){return!0}var Ee={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:H,deleteProperty:H,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:H,deleteProperty:H}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function Ae(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Ee)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function je(t){let r,i,a=()=>{if(!i){let e=i=t();e.then(e=>{r=()=>e.default},()=>{i===e&&(i=void 0)})}return i},o=t=>{let i=e.context;if(i){let[t,o]=x();e.count||=0,e.count++,a().then(t=>{!e.done&&n(i),e.count--,o(()=>t.default),n()},t=>{!e.done&&n(i),e.count--,o(()=>()=>{throw t}),n()}),r=t}else if(!r){let[e]=ne(()=>a().then(e=>e.default));r=e,D(()=>r=void 0)}let o;return w(()=>(o=r?.())?T(()=>{if(!i||e.done)return o(t);let r=e.context;n(i);let a=o(t);return n(r),a}):``)};return o.preload=()=>a(),o}var Me=0;function Ne(){return e.context?e.getNextContextId():`cl-${Me++}`}var Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(we(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(Te(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Le(e){let t=ue(()=>e.children),n=w(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=w(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:w(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return w(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function Re(e){return e}var ze=ce();function Be(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=de(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=k();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=le(ze);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),V(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,se(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}var Ve=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),He=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ue=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),We=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ge(e,t){let n=We[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ke=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),qe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Je={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ye=e=>w(()=>e());function Xe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ze=`_$DX_DELEGATE`;function Qe(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():Y(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function G(e,t=window.document){let n=t[Ze]||(t[Ze]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function K(e,t,n){X(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){X(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){X(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function q(e,t){X(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function tt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function nt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(lt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(lt(e,i,!0),n[i]=o)}return n}function rt(e,t,n){if(!t)return n?K(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function it(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function at(e,t={},n,r){let i={};return r||S(()=>i.children=Z(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&J(t.ref,e)),S(()=>ot(e,t,n,!0,i,!0)),i}function J(e,t,n){return T(()=>e(t,n))}function Y(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Z(e,t,r,n);S(r=>Z(e,t(),r,n),r)}function ot(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ut(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Z(e,t.children);continue}let s=t[o];i[o]=ut(e,o,s,i[o],n,a,t)}}function st(t){let n,r;return!X()||!(n=e.registry.get(r=mt()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function X(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ct(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function lt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ut(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return rt(e,n,r);if(t===`classList`)return nt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ke.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(tt(e,i,n,a),a&&G([i]))}else if(t.slice(0,5)===`attr:`)K(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=He.has(t))||!i&&((u=Ge(t,e.tagName))||(c=Ve.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(X(e))return n;t===`class`||t===`className`?q(e,n):s&&!c&&!l?e[ct(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Je[t.split(`:`)[0]];r?$e(e,r,t,n):K(e,Ue[t]||t,n)}return n}function dt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Z(e,t,n,r,i){let a=X(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Q(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Z(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return S(()=>n=Z(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Q(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Xe(e,n,o):(n&&Q(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Q(e,n,r,t);Q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function mt(){return e.getNextContextId()}var ht=`http://www.w3.org/2000/svg`;function gt(e,t=!1,n=void 0){return t?document.createElementNS(ht,e):document.createElement(e,{is:n})}function _t(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=k(),o,s=!!e.context;return C(()=>{s&&(k().user=s=!1),o||=ae(a,()=>w(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=x(!1);b(n=>Y(e,()=>t()?n():o(),null)),D(()=>n(!0))}else{let i=gt(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),Y(a,o),e.appendChild(i),t.ref&&t.ref(i),D(()=>e.contains(i)&&e.removeChild(i))}},void 0,{render:!s}),r}function vt(t,n){let r=w(t);return w(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=qe.has(t),i=e.context?st():gt(t,r,T(()=>n.is));return at(i,n,r),i}})}function yt(e){let[,t]=Ae(e,[`component`]);return vt(()=>e.component,t)}var bt=class extends Error{status;code;field;hint;details;constructor(e,t){super(t),this.status=e}},xt=class extends Error{cause;name=`NetworkError`;constructor(e){super(`Can't reach the hub: the connection dropped. Check your network and try again.`),this.cause=e}},St;function Ct(e){St=e}async function wt(e,{method:t=`GET`,json:n,body:r,headers:i={},signal:a,keepalive:o}={}){let s={method:t,credentials:`same-origin`,headers:{...i},signal:a,keepalive:o};n===void 0?r!==void 0&&(s.body=r):(s.headers[`content-type`]=`application/json`,s.body=JSON.stringify(n));let c;try{c=await fetch(e,s)}catch(e){throw e instanceof TypeError?new xt(e):e}if(!c.ok){let e=await c.json().catch(()=>({}));c.status===401&&St?.();let t=e.error&&typeof e.error==`object`?e.error:e,n=typeof e.error==`string`?e.error:typeof t.message==`string`?t.message:``,r=new bt(c.status,n||`HTTP ${c.status}`);throw typeof t.field==`string`&&(r.field=t.field),typeof t.code==`string`&&(r.code=t.code),typeof t.hint==`string`&&(r.hint=t.hint),e.error&&typeof e.error==`object`&&(r.details=t),r}return c}var Tt=async e=>(await wt(e)).json(),Et=encodeURIComponent,Dt=e=>`/api/sessions/${Et(e)}`,Ot=e=>e instanceof Error?e.message:String(e),kt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),At=/^[A-Za-z0-9_.:@/+~-]{1,300}$/,jt=/[\p{Cc}\p{Cf}\u2028\u2029]/u,Mt={workspace:`ws`,binding:`wsb`,member:`wsm`,assignment:`asg`,supervision:`sup`,checkpoint:`chk`,sideChat:`chat`,profile:`prof`,artifact:`art`,revision:`rev`,blob:`blob`,aiJob:`job`,team:`team`,staffing:`stf`,intake:`itk`},Nt=/^[A-Za-z0-9]{16,32}$/;function Pt(e,t){if(typeof t!=`string`)return!1;let n=`${Mt[e]}_`;return t.startsWith(n)&&Nt.test(t.slice(n.length))}var Ft=/^[a-z0-9-]{2,40}$/,It=e=>typeof e==`string`&&Ft.test(e),Lt=(e,t=120)=>typeof e==`string`&&e.trim().length>0&&e.length<=t&&!jt.test(e),Rt=4e3,zt=/[\u0000-\u0009\u000b-\u001f\u007f\u2028\u2029\u200b-\u200f\u202a-\u202e\u2066-\u2069]/,Bt=(e,t=Rt)=>typeof e==`string`&&e.length<=t&&!zt.test(e);function Vt(e){if(e!==void 0){if(!Array.isArray(e)||e.length>32)return`tags must be a list of at most 32`;if(!e.every(It))return`each tag must be 2–40 lowercase letters, digits or dashes`;if(new Set(e).size!==e.length)return`tags must be unique`}}function Ht(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))return`metadata must be an object`;let t=Object.entries(e);if(t.length>32)return`metadata has more than 32 keys`;for(let[e,n]of t){if(!It(e))return`metadata key ${JSON.stringify(String(e).slice(0,50))} must be a slug`;if(!Lt(n,200))return`metadata.${e} must be 1–200 characters of text`}}var $=e=>e.signedIn,Ut=[{id:`sessions`,label:`All sessions`,icon:`home`,route:`/`,order:10,available:e=>$(e)?!0:`hidden`},{id:`concierge`,label:`Concierge`,icon:`spark`,route:`/concierge`,order:15,available:e=>$(e)&&e.concierge!==void 0&&e.concierge!==`disabled`?!0:`hidden`},{id:`artifacts`,label:`Artifacts`,icon:`file`,route:`/artifacts`,order:20,available:e=>$(e)?!0:`hidden`},{id:`teams`,label:`Teams`,icon:`team`,route:`/teams`,order:25,available:e=>$(e)?!0:`hidden`},{id:`watchtower`,label:`Watchtower`,icon:`watchtower`,route:`/watchtower`,order:30,available:e=>$(e)?!0:`hidden`},{id:`profiles`,label:`Agent profiles`,icon:`settings`,route:`/profiles`,order:40,available:e=>$(e)?!0:`hidden`}],Wt={"/birds-eye":`/watchtower`};function Gt(e,t=``,n=``){for(let[r,i]of Object.entries(Wt))if(e===r||e.startsWith(`${r}/`))return`${i}${e.slice(r.length)}${t}${n}`}function Kt(e,t){try{return e.available(t)}catch{return`hidden`}}function qt(e,t=Ut){return[...t].sort((e,t)=>e.order-t.order).flatMap(t=>{let n=Kt(t,e);return n===`hidden`?[]:[{dest:t,enabled:n===!0}]})}var Jt=(e,t)=>Kt(e,t)===!0?`ok`:`unavailable`;function Yt(e,t=Ut){for(let n of t)if(n.route!==`/`&&(e===n.route||e.startsWith(`${n.route}/`)))try{return{dest:n,rest:e.slice(n.route.length).split(`/`).filter(Boolean).map(decodeURIComponent)}}catch{return}}function Xt(e,t=Ut){return e===`/`?t.find(e=>e.route===`/`)?.id:Yt(e,t)?.dest.id}function Zt(e){return e.supported?e.permission===`denied`?{state:`blocked`,message:`Notifications are blocked for this site. Allow them in the browser's site settings, then reload.`,action:`none`,warn:!0}:e.permission==="default"?{state:`off`,message:`Notifications are off on this device.`,action:`enable`,warn:!0}:!e.worker||!e.endpoint||!e.hubSubscribed?{state:`repair`,message:`Allowed, but this device is not subscribed on this hub, so nothing will arrive (this happens after the hub moves to a new address). Enable again to fix it.`,action:`enable`,warn:!0}:{state:`on`,message:`On for this device.`,action:`disable`,warn:!1}:{state:`unsupported`,message:`This browser can't get notifications here. On iPhone, add the app to the Home Screen first (iOS 16.4+); everywhere else the hub must be on https.`,action:`none`,warn:!0}}var Qt=e=>e.supported&&e.permission===`granted`&&(!e.endpoint||!e.hubSubscribed);function $t(e){if(e.subscriptions===0)return{ok:!1,text:`This device is not subscribed; enable notifications first`};if(e.sent>0)return{ok:!0,text:e.sent===1?`Test notification sent to this device`:`Test notification sent (${e.sent} subscriptions)`};let t=e.failed[0];return t?{ok:!1,text:`Test failed: ${t.host} ${t.status===void 0?`did not answer`:`answered ${t.status}`}`}:{ok:!1,text:`Test failed`}}var en=[1,2,5,10,15,30,60],tn=[{title:`Needs you`,kinds:[{key:`question`,label:`Question`,description:`A session or subagent asks you something.`},{key:`permission`,label:`Needs permission`,description:`A tool call waits for your OK (answer from the notification).`},{key:`decision`,label:`Decision`,description:`A session asks you to decide (hub ask @me), with options and a recommendation.`},{key:`message`,label:`Message`,description:`Agent messaging needs you: a message to you, an unanswered ask, or sessions looping.`},{key:`concierge`,label:`Concierge`,description:`Your Concierge needs you or has news: its questions, permissions, decisions, messages and spoken replies.`}]},{title:`Session`,kinds:[{key:`done`,label:`All done`,description:`The session and all its subagents and scripts finished; nothing waits on you. Once per run.`},{key:`failed`,label:`Failed`,description:`The session's run failed (provider or tool error), with the reason.`},{key:`providerError`,label:`Model provider error`,description:`Quota, budget, auth or model-routing errors of the session or a subagent; once per run.`},{key:`turn`,label:`Turn finished`,description:`Every reply of the main session, also the short ones between subagents. Noisy.`},{key:`stopped`,label:`Stopped`,description:`A run stopped without you asking (OpenCode shut down, inactivity).`},{key:`retry`,label:`Retrying`,description:`The provider failed and OpenCode is retrying the request.`}]},{title:`Subagents`,kinds:[{key:`subagentDone`,label:`Subagent finished`,description:`Each subagent that finishes, by name.`},{key:`subagentFailed`,label:`Subagent failed`,description:`Each subagent that fails, with the reason.`}]},{title:`Scripts and tools`,kinds:[{key:`jobDone`,label:`Script finished`,description:`A background shell or terminal exited 0.`},{key:`jobFailed`,label:`Script failed`,description:`A background shell or terminal exited non-zero, was killed or timed out.`},{key:`longTool`,label:`Long tool finished`,description:`A tool call that ran 30 seconds or more ended.`}]},{title:`Voice`,kinds:[{key:`say`,label:`Spoken reply`,description:`Voice mode replies while no device shows the session.`},{key:`handoff`,label:`Hand-off`,description:`A session sent to this device from the terminal (ignores quiet hours).`}]},{title:`Activity digest`,kinds:[{key:`activity`,label:`Activity`,description:`One quiet, self-replacing summary per session: subagents, long tools, scripts, idle.`}]}],nn=tn.flatMap(e=>e.kinds);function rn(e){let t=nn.filter(t=>e[t.key]).map(e=>e.label);return t.length?`You'll get: ${t.join(`, `)}.`:`You'll get no notifications on this device.`}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var on=[{id:`general`,label:`General`,description:`Account, theme, text size and the Hub app`},{id:`notifications`,label:`Notifications`,description:`This device's notifications, what to notify about, quiet hours`},{id:`voice`,label:`Voice & speech`,description:`Voice mode, mic sensitivity, speech-to-text and text-to-speech`},{id:`machines`,label:`Machines & devices`,description:`Connected machines, approvals, signed-in browsers and apps`},{id:`agents`,label:`Agents & access`,description:`App tokens, acting switches, grants and agent activity`},{id:`concierge`,label:`Concierge`,description:`Your hub-managed assistant: machine, directory, model and its grant`},{id:`teams`,label:`Teams`,description:`Team isolation: what team members see`},{id:`admin`,label:`Admin`,description:`Users, all machines, approvals and the audit log`,admin:!0}],sn=e=>on.filter(t=>e||!t.admin);function cn(e){if(e!==`/settings`&&!e.startsWith(`/settings/`))return;let t=e.slice(10).split(`/`)[0]??``;if(!t)return{};try{return{section:decodeURIComponent(t)}}catch{return{section:t}}}function ln(e,t){return e===void 0?t.phone?`list`:`general`:sn(t.admin).find(t=>t.id===e)?.id}var un={account:`general`,appearance:`general`,notifications:`notifications`,voice:`voice`,speech:`voice`,machines:`machines`,devices:`machines`,agents:`agents`,admin:`admin`};function dn(e){let t=e.replace(/^#/,``);if(!t)return;let n=un[t];if(n)return`/settings/${n}#${t}`;if(on.some(e=>e.id===t))return`/settings/${t}`}var fn=[{id:`account`,section:`general`,label:`Account`,description:`Who you are signed in as; sign out of this device`,keywords:`sign out logout user email`},{id:`set-theme`,section:`general`,label:`Color theme`,description:`Light, dark or the system's theme`,keywords:`appearance light dark system mode`},{id:`set-text-size`,section:`general`,label:`Text size`,description:`How big text is on this device`,keywords:`appearance font scale zoom`},{id:`add-app`,section:`general`,label:`Add the Hub app`,description:`Link the Hub app on a phone or tablet with a QR code`,keywords:`mobile android ios install pair link`},{id:`notifications`,section:`notifications`,label:`Notifications on this device`,description:`Enable or turn off push notifications here; permission and subscription status`,keywords:`push enable subscribe permission service worker`},{id:`notify-test`,section:`notifications`,label:`Send test notification`,description:`Check that notifications reach this device`,keywords:`push try`},{id:`quiet-hours`,section:`notifications`,label:`Quiet hours`,description:`No notifications at night (hand-offs still come through)`,keywords:`do not disturb night sleep time`},{id:`set-voice-speed`,section:`voice`,label:`Voice speed`,description:`How fast replies are spoken`,keywords:`rate tts`},{id:`set-sensitivity`,section:`voice`,label:`Mic sensitivity`,description:`How sure Voice mode must be that you are speaking to it`,keywords:`microphone noise vad`},{id:`set-cues`,section:`voice`,label:`Progress cues`,description:`Tones and short acknowledgements while the agent works`,keywords:`sounds acknowledgement`},{id:`set-background`,section:`voice`,label:`Keep listening when the screen is off`,description:`Lock-screen controls and listening with the screen off`,keywords:`background lock screen`},{id:`recording`,section:`voice`,label:`Record voice conversations (developer)`,description:`Saves your voice segments, transcripts, replies, timing and Concierge actions on this hub, for 7 days; export or delete them`,keywords:`record debug developer training audio export delete`},{id:`speech`,section:`voice`,label:`Speech`,description:`Speech-to-text and text-to-speech provider, model, voice and API keys`,keywords:`stt tts transcription openrouter openai key`},{id:`machines`,section:`machines`,label:`Machines`,description:`Computers running OpenCode connected to this hub; approve or revoke them`,keywords:`computer approve enrollment revoke opencode`},{id:`devices`,section:`machines`,label:`Devices`,description:`Browsers and the Hub app signed in to your account; revoke them`,keywords:`browser phone sessions revoke sign out`},{id:`agents`,section:`agents`,label:`Acting switch`,description:`Whether sessions and apps may act for you at all`,keywords:`pause kill switch acting`},{id:`app-tokens`,section:`agents`,label:`App tokens`,description:`Tokens for MCP gateways, CLIs and other apps, with their scopes`,keywords:`api key token scopes mcp cli`},{id:`grants`,section:`agents`,label:`Grants`,description:`What sessions and apps may approve, deny, answer, prompt or stop for you`,keywords:`permissions delegate allow`},{id:`agent-activity`,section:`agents`,label:`Agent activity`,description:`What agents did for you (the agent audit)`,keywords:`audit log history`},{id:`concierge`,section:`concierge`,label:`Concierge`,description:`Turn the Concierge on or off, pick its machine and directory, restart it`,keywords:`assistant butler watch sessions`},{id:`concierge-grant`,section:`concierge`,label:`Concierge grant`,description:`What the Concierge may do for you without asking; renew or remove it`,keywords:`permissions approve deny preset`},{id:`team-isolation`,section:`teams`,label:`Team isolation`,description:`Team members see only their teams' sessions, not your other sessions`,keywords:`teams privacy hide members`}],pn=[{id:`admin`,section:`admin`,label:`Users`,description:`Everyone on this hub: roles, disable, remove`,keywords:`admin accounts people`},{id:`admin-machines`,section:`admin`,label:`All machines`,description:`Every machine connected to this hub, by owner`,keywords:`admin revoke`},{id:`admin-audit`,section:`admin`,label:`Audit log`,description:`Who changed what on this hub`,keywords:`admin history`}],mn=(e,t)=>({id:`pref-${e.key}`,section:`notifications`,label:e.label,description:e.description,keywords:`notify ${t}`});function hn(e){return[...fn,...tn.flatMap(e=>e.kinds.map(t=>mn(t,e.title))),...e?pn:[]]}var gn=e=>on.find(t=>t.id===e)?.label??e;function _n(e,t){let n=e.trim().toLowerCase();if(!n)return[];let r=n.split(/\s+/),i=e=>{let t=e.label.toLowerCase();return t.startsWith(n)?0:t.includes(n)?1:r.every(e=>t.includes(e))?2:3};return t.filter(e=>{let t=`${e.label} ${e.description} ${e.keywords??``} ${gn(e.section)}`.toLowerCase();return r.every(e=>t.includes(e))}).map((e,t)=>({e,i:t,r:i(e)})).sort((e,t)=>e.r-t.r||e.i-t.i).map(e=>e.e)}function vn(e,t){let n=e.filter(e=>e.key in t);if(!n.length)return``;let r=n.filter(e=>t[e.key]);return r.length===n.length?`All on`:r.length?`${r.length} of ${n.length} on: ${r.map(e=>e.label).join(`, `)}`:`All off`}var yn=e=>e&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)?e:`/`;function bn(e){let t=e.pathname,n=e.searchParams;if(t===`/pair`)return{name:`pair`,next:yn(n.get(`next`)),error:n.get(`error`)??``};if(t===`/approve`)return{name:`approve`,code:n.get(`code`)??``};if(t===`/new`)return{name:`new`,machine:n.get(`machine`)??void 0,dir:n.get(`dir`)??void 0,key:n.get(`key`)??void 0};if(t===`/panes`)return{name:`panes`};if(t===`/concierge`||t.startsWith(`/concierge/`))return{name:`concierge`};let r=cn(t);if(r)return{name:`settings`,...r};let i=Yt(t);if(i)return{name:`feature`,id:i.dest.id,rest:i.rest};let a=/^\/s\/([^/]+)$/.exec(t);if(a)try{return{name:`session`,id:decodeURIComponent(a[1])}}catch{return{name:`home`}}return{name:`home`}}function xn(){let e=(location.pathname===`/settings`?dn(location.hash):void 0)??Gt(location.pathname,location.search,location.hash);return e&&history.replaceState(history.state,``,e),new URL(location.href)}var[Sn,Cn]=x(xn()),wn=Sn,Tn=()=>bn(Sn()),En=0;function Dn(e,{replace:t=!1}={}){let n=new URL(e,location.origin);n.pathname+n.search+n.hash!==location.pathname+location.search+location.hash&&(history[t?`replaceState`:`pushState`]({},``,n.pathname+n.search+n.hash),t||En++),Cn(xn())}function On(e=`/`){En>0?history.back():Dn(e)}window.addEventListener(`popstate`,()=>{En=Math.max(0,En-1),Cn(xn())}),document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[href]`);if(!t||t.target||t.hasAttribute(`download`)||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=t.getAttribute(`href`)??``;!n.startsWith(`/`)||n.startsWith(`//`)||n.startsWith(`/auth/`)||n.startsWith(`/api/`)||(e.preventDefault(),Dn(n))});var kn=()=>new Set;function An(e){kn=e}var jn=e=>kn().has(e),Mn=e=>kn().has(e)?`/concierge`:`/s/${encodeURIComponent(e)}`,[Nn,Pn]=x(),Fn=Nn,In=0,Ln;function Rn(e,t=``,n){let r=++In;Pn({id:r,text:e,kind:t,action:n}),clearTimeout(Ln),Ln=setTimeout(()=>Nn()?.id===r&&Pn(void 0),n||t?8e3:4e3)}var zn=()=>Pn(void 0);function Bn(e){let t=[];return{ask(n){return new Promise(r=>{t.push({request:n,resolve:r}),t.length===1&&e(n)})},current:()=>t[0]?.request,settle(n){let r=t.shift();r&&(r.resolve(n),e(t[0]?.request))}}}function Vn(e){let t=e.trim(),n=t.indexOf(`
1
+ var e={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return t(this.context.count)},getNextContextId(){return t(this.context.count++)}};function t(t){let n=String(t),r=n.length-1;return e.context.id+(r?String.fromCharCode(96+r):``)+n}function n(t){e.context=t}var r=(e,t)=>e===t,i=Symbol(`solid-proxy`),a=typeof Proxy==`function`,o=Symbol(`solid-track`),s={equals:r},c=null,l=ge,u=1,d=2,f={owned:null,cleanups:null,context:null,owner:null},p={},m=null,h=null,g=null,_=null,v=null,y=0;function b(e,t){let n=g,r=m,i=e.length===0,a=t===void 0?r:t,o=i?f:{owned:null,cleanups:null,context:a?a.context:null,owner:a},s=i?e:()=>e(()=>T(()=>L(o)));m=o,g=null;try{return F(s,!0)}finally{g=n,m=r}}function x(e,t){t=t?Object.assign({},s,t):s;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0};return[fe.bind(n),e=>(typeof e==`function`&&(e=h&&h.running&&h.sources.has(n)?e(n.tValue):e(n.value)),pe(n,e))]}function ee(e,t,n){M(N(e,t,!0,u))}function S(e,t,n){M(N(e,t,!1,u))}function C(e,t,n){l=_e;let r=N(e,t,!1,u),i=j&&le(j);i&&(r.suspense=i),(!n||!n.render)&&(r.user=!0),v?v.push(r):M(r)}function w(e,t,n){n=n?Object.assign({},s,n):s;let r=N(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,M(r),fe.bind(r)}function te(e){return e&&typeof e==`object`&&`then`in e}function ne(t,n,r){let i,a,o;typeof n==`function`?(i=t,a=n,o=r||{}):(i=!0,a=t,o=n||{});let s=null,c=p,l=null,u=!1,d=!1,f=`initialValue`in o,_=typeof i==`function`&&w(i),v=new Set,[y,b]=(o.storage||x)(o.initialValue),[S,C]=x(void 0),[ne,re]=x(void 0,{equals:!1}),[ie,E]=x(f?`ready`:`unresolved`);m&&D(()=>{for(let e of v.keys())e.decrement();v.clear(),h&&s&&h.promises.delete(s),s=null}),e.context&&(l=e.getNextContextId(),o.ssrLoadFrom===`initial`?c=o.initialValue:e.load&&e.has(l)&&(c=e.load(l)));function O(e,t,n,r){return s===e&&(s=null,r!==void 0&&(f=!0),(e===c||t===c)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(r,{value:t})),c=p,h&&e&&u?(h.promises.delete(e),u=!1,F(()=>{h.running=!0,k(t,n)},!1)):k(t,n)),t}function k(e,t){F(()=>{t===void 0&&b(()=>e),E(t===void 0?f?`ready`:`unresolved`:`errored`),C(t);for(let e of v.keys())e.decrement();v.clear()},!1)}function oe(){let e=j&&le(j),t=y(),n=S();if(n!==void 0&&!s)throw n;return g&&!g.user&&e&&ee(()=>{ne(),s&&(e.resolved&&h&&u?h.promises.add(s):v.has(e)||(e.increment(),v.add(e)))}),t}function A(e=!0){if(e!==!1&&d)return;d=!1;let t=_?_():i;if(u=h&&h.running,t==null||t===!1){O(s,T(y));return}h&&s&&h.promises.delete(s);let n,r=c===p?T(()=>{try{return a(t,{value:y(),refetching:e})}catch(e){n=e}}):c;if(n!==void 0)O(s,void 0,R(n),t);else return te(r)?(s=r,`v`in r?(r.s===1?O(s,r.v,void 0,t):O(s,void 0,R(r.v),t),r):(d=!0,queueMicrotask(()=>d=!1),F(()=>{E(f?`refreshing`:`pending`),re()},!1),r.then(e=>O(r,e,void 0,t),e=>O(r,void 0,R(e),t)))):(O(s,r,void 0,t),r)}Object.defineProperties(oe,{state:{get:()=>ie()},error:{get:()=>S()},loading:{get(){let e=ie();return e===`pending`||e===`refreshing`}},latest:{get(){if(!f)return oe();let e=S();if(e&&!s)throw e;return y()}}});let se=m;return _?ee(()=>(se=m,A(!1))):A(!1),[oe,{refetch:e=>ae(se,()=>A(e)),mutate:b}]}function re(e){return F(e,!1)}function T(e){if(g===null)return e();let t=g;g=null;try{return e()}finally{g=t}}function ie(e,t,n){let r=Array.isArray(e),i,a=n&&n.defer;return n=>{let o;if(r){o=Array(e.length);for(let t=0;t<e.length;t++)o[t]=e[t]()}else o=e();if(a)return a=!1,n;let s=T(()=>t(o,i,n));return i=o,s}}function E(e){C(()=>T(e))}function D(e){return m===null||(m.cleanups===null?m.cleanups=[e]:m.cleanups.push(e)),e}function O(){return g}function k(){return m}function ae(e,t){let n=m,r=g;m=e,g=null;try{return F(t,!0)}catch(e){z(e)}finally{m=n,g=r}}var[oe,A]=x(!1);function se(e){v.push.apply(v,e),e.length=0}function ce(e,t){let n=Symbol(`context`);return{id:n,Provider:Se(n),defaultValue:e}}function le(e){let t;return m&&m.context&&(t=m.context[e.id])!==void 0?t:e.defaultValue}function ue(e){let t=w(e),n=w(()=>xe(t()));return n.toArray=()=>{let e=n();return Array.isArray(e)?e:e==null?[]:[e]},n}var j;function de(){return j||=ce()}function fe(){let e=h&&h.running;if(this.sources&&(e?this.tState:this.state)){if((e?this.tState:this.state)===u)M(this);else{let e=_;_=null,F(()=>I(this),!1),_=e}}if(g){let e=this.observers;if(!e||e[e.length-1]!==g){let t=e?e.length:0;g.sources?(g.sources.push(this),g.sourceSlots.push(t)):(g.sources=[this],g.sourceSlots=[t]),e?(e.push(g),this.observerSlots.push(g.sources.length-1)):(this.observers=[g],this.observerSlots=[g.sources.length-1])}}return e&&h.sources.has(this)?this.tValue:this.value}function pe(e,t,n){let r=h&&h.running&&h.sources.has(e)?e.tValue:e.value;if(!e.comparator||!e.comparator(r,t)){if(h){let r=h.running;(r||!n&&h.sources.has(e))&&(h.sources.add(e),e.tValue=t),r||(e.value=t)}else e.value=t;e.observers&&e.observers.length&&F(()=>{for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t],r=h&&h.running;r&&h.disposed.has(n)||((r?!n.tState:!n.state)&&(n.pure?_.push(n):v.push(n),n.observers&&ve(n)),r?n.tState=u:n.state=u)}if(_.length>1e6)throw _=[],Error()},!1)}return t}function M(e){if(!e.fn)return;L(e);let t=y;me(e,h&&h.running&&h.sources.has(e)?e.tValue:e.value,t),h&&!h.running&&h.sources.has(e)&&queueMicrotask(()=>{F(()=>{h&&(h.running=!0),g=m=e,me(e,e.tValue,t),g=m=null},!1)})}function me(e,t,n){let r,i=m,a=g;g=m=e;try{r=e.fn(t)}catch(t){return e.pure&&(h&&h.running?(e.tState=u,e.tOwned&&e.tOwned.forEach(L),e.tOwned=void 0):(e.state=u,e.owned&&e.owned.forEach(L),e.owned=null)),e.updatedAt=n+1,z(t)}finally{g=a,m=i}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&`observers`in e?pe(e,r,!0):h&&h.running&&e.pure?(h.sources.has(e)||(e.value=r),h.sources.add(e),e.tValue=r):e.value=r,e.updatedAt=n)}function N(e,t,n,r=u,i){let a={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:m,context:m?m.context:null,pure:n};return h&&h.running&&(a.state=0,a.tState=r),m===null||m!==f&&(h&&h.running&&m.pure?m.tOwned?m.tOwned.push(a):m.tOwned=[a]:m.owned?m.owned.push(a):m.owned=[a]),a}function P(e){let t=h&&h.running;if((t?e.tState:e.state)===0)return;if((t?e.tState:e.state)===d)return I(e);if(e.suspense&&T(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<y);){if(t&&h.disposed.has(e))return;(t?e.tState:e.state)&&n.push(e)}for(let r=n.length-1;r>=0;r--){if(e=n[r],t){let t=e,i=n[r+1];for(;(t=t.owner)&&t!==i;)if(h.disposed.has(t))return}if((t?e.tState:e.state)===u)M(e);else if((t?e.tState:e.state)===d){let t=_;_=null,F(()=>I(e,n[0]),!1),_=t}}}function F(e,t){if(_)return e();let n=!1;t||(_=[]),v?n=!0:v=[],y++;try{let t=e();return he(n),t}catch(e){n||(v=null),_=null,z(e)}}function he(e){if(_&&=(ge(_),null),e)return;let t;if(h){if(!h.promises.size&&!h.queue.size){let e=h.sources,n=h.disposed;v.push.apply(v,h.effects),t=h.resolve;for(let e of v)`tState`in e&&(e.state=e.tState),delete e.tState;h=null,F(()=>{for(let e of n)L(e);for(let t of e){if(t.value=t.tValue,t.owned)for(let e=0,n=t.owned.length;e<n;e++)L(t.owned[e]);t.tOwned&&(t.owned=t.tOwned),delete t.tValue,delete t.tOwned,t.tState=0}A(!1)},!1)}else if(h.running){h.running=!1,h.effects.push.apply(h.effects,v),v=null,A(!0);return}}let n=v;v=null,n.length&&F(()=>l(n),!1),t&&t()}function ge(e){for(let t=0;t<e.length;t++)P(e[t])}function _e(t){let r,i=0;for(r=0;r<t.length;r++){let e=t[r];e.user?t[i++]=e:P(e)}if(e.context){if(e.count){e.effects||=[],e.effects.push(...t.slice(0,i));return}n()}for(e.effects&&(e.done||!e.count)&&(t=[...e.effects,...t],i+=e.effects.length,delete e.effects),r=0;r<i;r++)P(t[r])}function I(e,t){let n=h&&h.running;n?e.tState=0:e.state=0;for(let r=0;r<e.sources.length;r+=1){let i=e.sources[r];if(i.sources){let e=n?i.tState:i.state;e===u?i!==t&&(!i.updatedAt||i.updatedAt<y)&&P(i):e===d&&I(i,t)}}}function ve(e){let t=h&&h.running;for(let n=0;n<e.observers.length;n+=1){let r=e.observers[n];(t?!r.tState:!r.state)&&(t?r.tState=d:r.state=d,r.pure?_.push(r):v.push(r),r.observers&&ve(r))}}function L(e){let t;if(e.sources)for(;e.sources.length;){let t=e.sources.pop(),n=e.sourceSlots.pop(),r=t.observers;if(r&&r.length){let e=r.pop(),i=t.observerSlots.pop();n<r.length&&(e.sourceSlots[i]=n,r[n]=e,t.observerSlots[n]=i)}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)L(e.tOwned[t]);delete e.tOwned}if(h&&h.running&&e.pure)ye(e,!0);else if(e.owned){for(t=e.owned.length-1;t>=0;t--)L(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}h&&h.running?e.tState=0:e.state=0}function ye(e,t){if(t||(e.tState=0,h.disposed.add(e)),e.owned)for(let t=0;t<e.owned.length;t++)ye(e.owned[t])}function R(e){return e instanceof Error?e:Error(typeof e==`string`?e:`Unknown error`,{cause:e})}function be(e,t,n){try{for(let n of t)n(e)}catch(e){z(e,n&&n.owner||null)}}function z(e,t=m){let n=c&&t&&t.context&&t.context[c],r=R(e);if(!n)throw r;v?v.push({fn(){be(r,n,t)},state:u}):be(r,n,t)}function xe(e){if(typeof e==`function`&&!e.length)return xe(e());if(Array.isArray(e)){let t=[];for(let n=0;n<e.length;n++){let r=xe(e[n]);if(Array.isArray(r)){if(r.length<32768)t.push.apply(t,r);else for(let e=0;e<r.length;e++)t.push(r[e])}else t.push(r)}return t}return e}function Se(e,t){return function(t){let n;return S(()=>n=T(()=>(m.context={...m.context,[e]:t.value},ue(()=>t.children))),void 0),n}}var Ce=Symbol(`fallback`);function B(e){for(let t=0;t<e.length;t++)e[t]()}function we(e,t,n={}){let r=[],i=[],a=[],s=0,c=t.length>1?[]:null;return D(()=>B(a)),()=>{let l=e()||[],u=l.length,d,f;return l[o],T(()=>{let e,t,o,m,h,g,_,v,y;if(u===0)s!==0&&(B(a),a=[],r=[],i=[],s=0,c&&=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),s=1);else if(s===0){for(i=Array(u),f=0;f<u;f++)r[f]=l[f],i[f]=b(p);s=u}else{for(o=Array(u),m=Array(u),c&&(h=Array(u)),g=0,_=Math.min(s,u);g<_&&r[g]===l[g];g++);for(_=s-1,v=u-1;_>=g&&v>=g&&r[_]===l[v];_--,v--)o[v]=i[_],m[v]=a[_],c&&(h[v]=c[_]);for(e=new Map,t=Array(v+1),f=v;f>=g;f--)y=l[f],d=e.get(y),t[f]=d===void 0?-1:d,e.set(y,f);for(d=g;d<=_;d++)y=r[d],f=e.get(y),f!==void 0&&f!==-1?(o[f]=i[d],m[f]=a[d],c&&(h[f]=c[d]),f=t[f],e.set(y,f)):a[d]();for(f=g;f<u;f++)f in o?(i[f]=o[f],a[f]=m[f],c&&(c[f]=h[f],c[f](f))):i[f]=b(p);i=i.slice(0,s=u),r=l.slice(0)}return i});function p(e){if(a[f]=e,c){let[e,n]=x(f);return c[f]=n,t(l[f],e)}return t(l[f])}}}function Te(e,t,n={}){let r=[],i=[],a=[],s=[],c=0,l;return D(()=>B(a)),()=>{let u=e()||[],d=u.length;return u[o],T(()=>{if(d===0)return c!==0&&(B(a),a=[],r=[],i=[],c=0,s=[]),n.fallback&&(r=[Ce],i[0]=b(e=>(a[0]=e,n.fallback())),c=1),i;for(r[0]===Ce&&(a[0](),a=[],r=[],i=[],c=0),l=0;l<d;l++)l<r.length&&r[l]!==u[l]?s[l](()=>u[l]):l>=r.length&&(i[l]=b(f));for(;l<r.length;l++)a[l]();return c=s.length=a.length=d,r=u.slice(0),i=i.slice(0,c)});function f(e){a[l]=e;let[n,r]=x(u[l]);return s[l]=r,t(n,l)}}}function V(e,t){return T(()=>e(t||{}))}function H(){return!0}var Ee={get(e,t,n){return t===i?n:e.get(t)},has(e,t){return t===i||e.has(t)},set:H,deleteProperty:H,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:H,deleteProperty:H}},ownKeys(e){return e.keys()}};function De(e){return(e=typeof e==`function`?e():e)?e:{}}function Oe(){for(let e=0,t=this.length;e<t;++e){let t=this[e]();if(t!==void 0)return t}}function ke(...e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];t||=!!r&&i in r,e[n]=typeof r==`function`?(t=!0,w(r)):r}if(a&&t)return new Proxy({get(t){for(let n=e.length-1;n>=0;n--){let r=De(e[n])[t];if(r!==void 0)return r}},has(t){for(let n=e.length-1;n>=0;n--)if(t in De(e[n]))return!0;return!1},keys(){let t=[];for(let n=0;n<e.length;n++)t.push(...Object.keys(De(e[n])));return[...new Set(t)]}},Ee);let n={},r=Object.create(null);for(let t=e.length-1;t>=0;t--){let i=e[t];if(!i)continue;let a=Object.getOwnPropertyNames(i);for(let e=a.length-1;e>=0;e--){let t=a[e];if(t===`__proto__`||t===`constructor`)continue;let o=Object.getOwnPropertyDescriptor(i,t);if(!r[t])r[t]=o.get?{enumerable:!0,configurable:!0,get:Oe.bind(n[t]=[o.get.bind(i)])}:o.value===void 0?void 0:o;else{let e=n[t];e&&(o.get?e.push(o.get.bind(i)):o.value!==void 0&&e.push(()=>o.value))}}}let o={},s=Object.keys(r);for(let e=s.length-1;e>=0;e--){let t=s[e],n=r[t];n&&n.get?Object.defineProperty(o,t,n):o[t]=n?n.value:void 0}return o}function Ae(e,...t){let n=t.length;if(a&&i in e){let r=n>1?t.flat():t[0],i=new Set,a=t.map(t=>{let n=t.filter(e=>!i.has(e)&&(i.add(e),!0));return new Proxy({get(t){return n.includes(t)?e[t]:void 0},has(t){return n.includes(t)&&t in e},keys(){return n.filter(t=>t in e)}},Ee)});return a.push(new Proxy({get(t){return r.includes(t)?void 0:e[t]},has(t){return!r.includes(t)&&t in e},keys(){return Object.keys(e).filter(e=>!r.includes(e))}},Ee)),a}let r=[];for(let e=0;e<=n;e++)r[e]={};for(let i of Object.getOwnPropertyNames(e)){let a=n;for(let e=0;e<t.length;e++)if(t[e].includes(i)){a=e;break}let o=Object.getOwnPropertyDescriptor(e,i);!o.get&&!o.set&&o.enumerable&&o.writable&&o.configurable?r[a][i]=o.value:Object.defineProperty(r[a],i,o)}return r}function je(t){let r,i,a=()=>{if(!i){let e=i=t();e.then(e=>{r=()=>e.default},()=>{i===e&&(i=void 0)})}return i},o=t=>{let i=e.context;if(i){let[t,o]=x();e.count||=0,e.count++,a().then(t=>{!e.done&&n(i),e.count--,o(()=>t.default),n()},t=>{!e.done&&n(i),e.count--,o(()=>()=>{throw t}),n()}),r=t}else if(!r){let[e]=ne(()=>a().then(e=>e.default));r=e,D(()=>r=void 0)}let o;return w(()=>(o=r?.())?T(()=>{if(!i||e.done)return o(t);let r=e.context;n(i);let a=o(t);return n(r),a}):``)};return o.preload=()=>a(),o}var Me=0;function Ne(){return e.context?e.getNextContextId():`cl-${Me++}`}var Pe=e=>`Stale read from <${e}>.`;function Fe(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(we(()=>e.each,e.children,t||void 0))}function Ie(e){let t=`fallback`in e&&{fallback:()=>e.fallback};return w(Te(()=>e.each,e.children,t||void 0))}function U(e){let t=e.keyed,n=w(()=>e.when,void 0,void 0),r=t?n:w(n,void 0,{equals:(e,t)=>!e==!t});return w(()=>{let i=r();if(i){let a=e.children;return typeof a==`function`&&a.length>0?T(()=>a(t?i:()=>{if(!T(r))throw Pe(`Show`);return n()})):a}return e.fallback},void 0,void 0)}function Le(e){let t=ue(()=>e.children),n=w(()=>{let e=t(),n=Array.isArray(e)?e:[e],r=()=>void 0;for(let e=0;e<n.length;e++){let t=e,i=n[e],a=r,o=w(()=>a()?void 0:i.when,void 0,void 0),s=i.keyed?o:w(o,void 0,{equals:(e,t)=>!e==!t});r=()=>a()||(s()?[t,o,i]:void 0)}return r});return w(()=>{let t=n()();if(!t)return e.fallback;let[r,i,a]=t,o=a.children;return typeof o==`function`&&o.length>0?T(()=>o(a.keyed?i():()=>{if(T(n)()?.[0]!==r)throw Pe(`Match`);return i()})):o},void 0,void 0)}function Re(e){return e}var ze=ce();function Be(t){let r=0,i,a,o,s,c,[l,u]=x(!1),d=de(),f={increment:()=>{++r===1&&u(!0)},decrement:()=>{--r===0&&u(!1)},inFallback:l,effects:[],resolved:!1},p=k();if(e.context&&e.load){let t=e.getContextId(),r=e.load(t);if(r&&(typeof r!=`object`||r.s!==1?o=r:e.gather(t)),o&&o!==`$$f`){let[r,i]=x(void 0,{equals:!1});s=r,o.then(()=>{if(e.done)return i();e.gather(t),n(a),i(),n()},e=>{c=e,i()})}}let m=le(ze);m&&(i=m.register(f.inFallback));let h;return D(()=>h&&h()),V(d.Provider,{value:f,get children(){return w(()=>{if(c)throw c;if(a=e.context,s){s(),s=void 0;return}a&&o===`$$f`&&n();let r=w(()=>t.children);return w(e=>{let s=f.inFallback(),{showContent:c=!0,showFallback:l=!0}=i?i():{};if((!s||o&&o!==`$$f`)&&c)return f.resolved=!0,h&&h(),h=a=o=void 0,se(f.effects),r();if(l)return h?e:b(e=>(h=e,a&&=(n({id:a.id+`F`,count:0}),void 0),t.fallback),p)})})}})}var Ve=new Set([`className`,`value`,`readOnly`,`noValidate`,`formNoValidate`,`isMap`,`noModule`,`playsInline`,`adAuctionHeaders`,`allowFullscreen`,`browsingTopics`,`defaultChecked`,`defaultMuted`,`defaultSelected`,`disablePictureInPicture`,`disableRemotePlayback`,`preservesPitch`,`shadowRootClonable`,`shadowRootCustomElementRegistry`,`shadowRootDelegatesFocus`,`shadowRootSerializable`,`sharedStorageWritable`,...`allowfullscreen.async.alpha.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.hidden.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.adauctionheaders.browsingtopics.credentialless.defaultchecked.defaultmuted.defaultselected.defer.disablepictureinpicture.disableremoteplayback.preservespitch.shadowrootclonable.shadowrootcustomelementregistry.shadowrootdelegatesfocus.shadowrootserializable.sharedstoragewritable`.split(`.`)]),He=new Set([`innerHTML`,`textContent`,`innerText`,`children`]),Ue=Object.assign(Object.create(null),{className:`class`,htmlFor:`for`}),We=Object.assign(Object.create(null),{class:`className`,novalidate:{$:`noValidate`,FORM:1},formnovalidate:{$:`formNoValidate`,BUTTON:1,INPUT:1},ismap:{$:`isMap`,IMG:1},nomodule:{$:`noModule`,SCRIPT:1},playsinline:{$:`playsInline`,VIDEO:1},readonly:{$:`readOnly`,INPUT:1,TEXTAREA:1},adauctionheaders:{$:`adAuctionHeaders`,IFRAME:1},allowfullscreen:{$:`allowFullscreen`,IFRAME:1},browsingtopics:{$:`browsingTopics`,IMG:1},defaultchecked:{$:`defaultChecked`,INPUT:1},defaultmuted:{$:`defaultMuted`,AUDIO:1,VIDEO:1},defaultselected:{$:`defaultSelected`,OPTION:1},disablepictureinpicture:{$:`disablePictureInPicture`,VIDEO:1},disableremoteplayback:{$:`disableRemotePlayback`,AUDIO:1,VIDEO:1},preservespitch:{$:`preservesPitch`,AUDIO:1,VIDEO:1},shadowrootclonable:{$:`shadowRootClonable`,TEMPLATE:1},shadowrootdelegatesfocus:{$:`shadowRootDelegatesFocus`,TEMPLATE:1},shadowrootserializable:{$:`shadowRootSerializable`,TEMPLATE:1},sharedstoragewritable:{$:`sharedStorageWritable`,IFRAME:1,IMG:1}});function Ge(e,t){let n=We[e];return typeof n==`object`?n[t]?n.$:void 0:n}var Ke=new Set([`beforeinput`,`click`,`dblclick`,`contextmenu`,`focusin`,`focusout`,`input`,`keydown`,`keyup`,`mousedown`,`mousemove`,`mouseout`,`mouseover`,`mouseup`,`pointerdown`,`pointermove`,`pointerout`,`pointerover`,`pointerup`,`touchend`,`touchmove`,`touchstart`]),qe=new Set(`altGlyph.altGlyphDef.altGlyphItem.animate.animateColor.animateMotion.animateTransform.circle.clipPath.color-profile.cursor.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.font.font-face.font-face-format.font-face-name.font-face-src.font-face-uri.foreignObject.g.glyph.glyphRef.hkern.image.line.linearGradient.marker.mask.metadata.missing-glyph.mpath.path.pattern.polygon.polyline.radialGradient.rect.set.stop.svg.switch.symbol.text.textPath.tref.tspan.use.view.vkern`.split(`.`)),Je={xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`},Ye=e=>w(()=>e());function Xe(e,t,n){let r=n.length,i=t.length,a=r,o=0,s=0,c=t[i-1].nextSibling,l=null;for(;o<i||s<a;)if(t[o]===n[s])o++,s++;else{for(;t[i-1]===n[a-1];)i--,a--;if(i===o){let t=a<r?s?n[s-1].nextSibling:n[a-s]:c;for(;s<a;)e.insertBefore(n[s++],t)}else if(a===s)for(;o<i;)(!l||!l.has(t[o]))&&t[o].remove(),o++;else if(t[o]===n[a-1]&&n[s]===t[i-1]){let r=t[--i].nextSibling;e.insertBefore(n[s++],t[o++].nextSibling),e.insertBefore(n[--a],r),t[i]=n[a]}else{if(!l){l=new Map;let e=s;for(;e<a;)l.set(n[e],e++)}let r=l.get(t[o]);if(r!=null){if(s<r&&r<a){let c=o,u=1,d;for(;++c<i&&c<a&&(d=l.get(t[c]))!=null&&d===r+u;)u++;if(u>r-s){let i=t[o];for(;s<r;)e.insertBefore(n[s++],i)}else e.replaceChild(n[s++],t[o++])}else o++}else t[o++].remove()}}}var Ze=`_$DX_DELEGATE`;function Qe(e,t,n,r={}){let i;return b(r=>{i=r,t===document?e():Y(t,e(),!n&&t.firstChild?null:void 0,n)},r.owner),()=>{i(),t.textContent=``}}function W(e,t,n,r){let i,a=()=>{let t=r?document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`template`):document.createElement(`template`);return t.innerHTML=e,n?t.content.firstChild.firstChild:r?t.firstChild:t.content.firstChild},o=t?()=>T(()=>document.importNode(i||=a(),!0)):()=>(i||=a()).cloneNode(!0);return o.cloneNode=o,o}function G(e,t=window.document){let n=t[Ze]||(t[Ze]=new Set);for(let r=0,i=e.length;r<i;r++){let i=e[r];n.has(i)||(n.add(i),t.addEventListener(i,dt))}}function K(e,t,n){X(e)||(n==null?e.removeAttribute(t):e.setAttribute(t,n))}function $e(e,t,n,r){X(e)||(r==null?e.removeAttributeNS(t,n):e.setAttributeNS(t,n,r))}function et(e,t,n){X(e)||(n?e.setAttribute(t,``):e.removeAttribute(t))}function q(e,t){X(e)||(t==null?e.removeAttribute(`class`):e.className=t)}function tt(e,t,n,r){if(r)Array.isArray(n)?(e[`$$${t}`]=n[0],e[`$$${t}Data`]=n[1]):e[`$$${t}`]=n;else if(Array.isArray(n)){let r=n[0];e.addEventListener(t,n[0]=t=>r.call(e,n[1],t))}else e.addEventListener(t,n,typeof n!=`function`&&n)}function nt(e,t,n={}){let r=Object.keys(t||{}),i=Object.keys(n),a,o;for(a=0,o=i.length;a<o;a++){let r=i[a];r&&r!==`undefined`&&!t[r]&&(lt(e,r,!1),delete n[r])}for(a=0,o=r.length;a<o;a++){let i=r[a],o=!!t[i];i&&i!==`undefined`&&n[i]!==o&&o&&(lt(e,i,!0),n[i]=o)}return n}function rt(e,t,n){if(!t)return n?K(e,`style`):t;let r=e.style;if(typeof t==`string`)return r.cssText=t;typeof n==`string`&&(r.cssText=n=void 0),n||={},t||={};let i,a;for(a in n)t[a]??r.removeProperty(a),delete n[a];for(a in t)i=t[a],i!==n[a]&&(r.setProperty(a,i),n[a]=i);return n}function it(e,t,n){n==null?e.style.removeProperty(t):e.style.setProperty(t,n)}function at(e,t={},n,r){let i={};return r||S(()=>i.children=Z(e,t.children,i.children)),S(()=>typeof t.ref==`function`&&J(t.ref,e)),S(()=>ot(e,t,n,!0,i,!0)),i}function J(e,t,n){return T(()=>e(t,n))}function Y(e,t,n,r){if(n!==void 0&&!r&&(r=[]),typeof t!=`function`)return Z(e,t,r,n);S(r=>Z(e,t(),r,n),r)}function ot(e,t,n,r,i={},a=!1){t||={};for(let r in i)if(!(r in t)){if(r===`children`)continue;i[r]=ut(e,r,null,i[r],n,a,t)}for(let o in t){if(o===`children`){r||Z(e,t.children);continue}let s=t[o];i[o]=ut(e,o,s,i[o],n,a,t)}}function st(t){let n,r;return!X()||!(n=e.registry.get(r=mt()))?t():(e.completed&&e.completed.add(n),e.registry.delete(r),n)}function X(t){return!!e.context&&!e.done&&(!t||t.isConnected)}function ct(e){return e.toLowerCase().replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function lt(e,t,n){let r=t.trim().split(/\s+/);for(let t=0,i=r.length;t<i;t++)e.classList.toggle(r[t],n)}function ut(e,t,n,r,i,a,o){let s,c,l,u,d;if(t===`style`)return rt(e,n,r);if(t===`classList`)return nt(e,n,r);if(n===r)return r;if(t===`ref`)a||n(e);else if(t.slice(0,3)===`on:`){let i=t.slice(3);r&&e.removeEventListener(i,r,typeof r!=`function`&&r),n&&e.addEventListener(i,n,typeof n!=`function`&&n)}else if(t.slice(0,10)===`oncapture:`){let i=t.slice(10);r&&e.removeEventListener(i,r,!0),n&&e.addEventListener(i,n,!0)}else if(t.slice(0,2)===`on`){let i=t.slice(2).toLowerCase(),a=Ke.has(i);if(!a&&r){let t=Array.isArray(r)?r[0]:r;e.removeEventListener(i,t)}(a||n)&&(tt(e,i,n,a),a&&G([i]))}else if(t.slice(0,5)===`attr:`)K(e,t.slice(5),n);else if(t.slice(0,5)===`bool:`)et(e,t.slice(5),n);else if((d=t.slice(0,5)===`prop:`)||(l=He.has(t))||!i&&((u=Ge(t,e.tagName))||(c=Ve.has(t)))||(s=e.nodeName.includes(`-`)||`is`in o)){if(d)t=t.slice(5),c=!0;else if(X(e))return n;t===`class`||t===`className`?q(e,n):s&&!c&&!l?e[ct(t)]=n:(t===`value`||t===`defaultValue`)&&(e.nodeName===`INPUT`||e.nodeName===`TEXTAREA`)?e[u||t]=n??``:e[u||t]=n}else{let r=i&&t.indexOf(`:`)>-1&&Je[t.split(`:`)[0]];r?$e(e,r,t,n):K(e,Ue[t]||t,n)}return n}function dt(t){if(e.registry&&e.events&&e.events.find(([e,n])=>n===t))return;let n=t.target,r=`$$${t.type}`,i=t.target,a=t.currentTarget,o=e=>Object.defineProperty(t,"target",{configurable:!0,value:e}),s=()=>{let e=n[r];if(e&&!n.disabled){let i=n[`${r}Data`];if(i===void 0?e.call(n,t):e.call(n,i,t),t.cancelBubble)return}return n.host&&typeof n.host!=`string`&&!n.host._$host&&n.contains(t.target)&&o(n.host),!0},c=()=>{for(;s()&&(n=n._$host||n.parentNode||n.host););};Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return n||document}}),e.registry&&!e.done&&(e.done=_$HY.done=!0);try{if(t.composedPath){let e=t.composedPath();o(e[0]);for(let t=0;t<e.length-2&&(n=e[t],s());t++){if(n._$host){n=n._$host,c();break}if(n.parentNode===a)break}}else c();o(i)}finally{t=n=null}}function Z(e,t,n,r,i){let a=X(e);if(a){!n&&(n=[...e.childNodes]);let t=[];for(let e=0;e<n.length;e++){let r=n[e];r.nodeType===8&&r.data.slice(0,2)===`!$`?r.remove():t.push(r)}n=t}for(;typeof n==`function`;)n=n();if(t===n)return n;let o=typeof t,s=r!==void 0;if(e=s&&n[0]&&n[0].parentNode||e,o===`string`||o===`number`){if(a||o===`number`&&(t=t.toString(),t===n))return n;if(s){let i=n[0];i&&i.nodeType===3?i.data!==t&&(i.data=t):i=document.createTextNode(t),n=Q(e,n,r,i)}else n=n!==``&&typeof n==`string`?e.firstChild.data=t:e.textContent=t}else if(t==null||o===`boolean`){if(a)return n;n=Q(e,n,r)}else if(o===`function`)return S(()=>{let i=t();for(;typeof i==`function`;)i=i();n=Z(e,i,n,r)}),()=>n;else if(Array.isArray(t)){let o=[],c=n&&Array.isArray(n);if(ft(o,t,n,i))return S(()=>n=Z(e,o,n,r,!0)),()=>n;if(a){if(!o.length)return n;if(r===void 0)return n=[...e.childNodes];let t=o[0];if(t.parentNode!==e)return n;let i=[t];for(;(t=t.nextSibling)!==r;)i.push(t);return n=i}if(o.length===0){if(n=Q(e,n,r),s)return n}else c?n.length===0?pt(e,o,r):Xe(e,n,o):(n&&Q(e),pt(e,o));n=o}else if(t.nodeType){if(a&&t.parentNode)return n=s?[t]:t;if(Array.isArray(n)){if(s)return n=Q(e,n,r,t);Q(e,n,null,t)}else n==null||n===``||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}return n}function ft(e,t,n,r){let i=!1;for(let a=0,o=t.length;a<o;a++){let o=t[a],s=n&&n[e.length],c;if(o!=null&&o!==!0&&o!==!1){if((c=typeof o)==`object`&&o.nodeType)e.push(o);else if(Array.isArray(o))i=ft(e,o,s)||i;else if(c===`function`){if(r){for(;typeof o==`function`;)o=o();i=ft(e,Array.isArray(o)?o:[o],Array.isArray(s)?s:[s])||i}else e.push(o),i=!0}else{let t=String(o);s&&s.nodeType===3&&s.data===t?e.push(s):e.push(document.createTextNode(t))}}}return i}function pt(e,t,n=null){for(let r=0,i=t.length;r<i;r++)e.insertBefore(t[r],n)}function Q(e,t,n,r){if(n===void 0)return e.textContent=``;let i=r||document.createTextNode(``);if(t.length){let r=!1;for(let a=t.length-1;a>=0;a--){let o=t[a];if(i!==o){let t=o.parentNode===e;!r&&!a?t?e.replaceChild(i,o):e.insertBefore(i,n):t&&o.remove()}else r=!0}}else e.insertBefore(i,n);return[i]}function mt(){return e.getNextContextId()}var ht=`http://www.w3.org/2000/svg`;function gt(e,t=!1,n=void 0){return t?document.createElementNS(ht,e):document.createElement(e,{is:n})}function _t(t){let{useShadow:n}=t,r=document.createTextNode(``),i=()=>t.mount||document.body,a=k(),o,s=!!e.context;return C(()=>{s&&(k().user=s=!1),o||=ae(a,()=>w(()=>t.children));let e=i();if(e instanceof HTMLHeadElement){let[t,n]=x(!1);b(n=>Y(e,()=>t()?n():o(),null)),D(()=>n(!0))}else{let i=gt(t.isSVG?`g`:`div`,t.isSVG),a=n&&i.attachShadow?i.attachShadow({mode:`open`}):i;Object.defineProperty(i,"_$host",{get(){return r.parentNode},configurable:!0}),Y(a,o),e.appendChild(i),t.ref&&t.ref(i),D(()=>e.contains(i)&&e.removeChild(i))}},void 0,{render:!s}),r}function vt(t,n){let r=w(t);return w(()=>{let t=r();switch(typeof t){case`function`:return T(()=>t(n));case`string`:let r=qe.has(t),i=e.context?st():gt(t,r,T(()=>n.is));return at(i,n,r),i}})}function yt(e){let[,t]=Ae(e,[`component`]);return vt(()=>e.component,t)}var bt=class extends Error{status;code;field;hint;details;constructor(e,t){super(t),this.status=e}},xt=class extends Error{cause;name=`NetworkError`;constructor(e){super(`Can't reach the hub: the connection dropped. Check your network and try again.`),this.cause=e}},St;function Ct(e){St=e}async function wt(e,{method:t=`GET`,json:n,body:r,headers:i={},signal:a,keepalive:o}={}){let s={method:t,credentials:`same-origin`,headers:{...i},signal:a,keepalive:o};n===void 0?r!==void 0&&(s.body=r):(s.headers[`content-type`]=`application/json`,s.body=JSON.stringify(n));let c;try{c=await fetch(e,s)}catch(e){throw e instanceof TypeError?new xt(e):e}if(!c.ok){let e=await c.json().catch(()=>({}));c.status===401&&St?.();let t=e.error&&typeof e.error==`object`?e.error:e,n=typeof e.error==`string`?e.error:typeof t.message==`string`?t.message:``,r=new bt(c.status,n||`HTTP ${c.status}`);throw typeof t.field==`string`&&(r.field=t.field),typeof t.code==`string`&&(r.code=t.code),typeof t.hint==`string`&&(r.hint=t.hint),e.error&&typeof e.error==`object`&&(r.details=t),r}return c}var Tt=async e=>(await wt(e)).json(),Et=encodeURIComponent,Dt=e=>`/api/sessions/${Et(e)}`,Ot=e=>e instanceof Error?e.message:String(e),kt=e=>typeof e==`object`&&!!e&&!Array.isArray(e),At=/^[A-Za-z0-9_.:@/+~-]{1,300}$/,jt=/[\p{Cc}\p{Cf}\u2028\u2029]/u,Mt={workspace:`ws`,binding:`wsb`,member:`wsm`,assignment:`asg`,supervision:`sup`,checkpoint:`chk`,sideChat:`chat`,profile:`prof`,artifact:`art`,revision:`rev`,blob:`blob`,aiJob:`job`,team:`team`,staffing:`stf`,intake:`itk`},Nt=/^[A-Za-z0-9]{16,32}$/;function Pt(e,t){if(typeof t!=`string`)return!1;let n=`${Mt[e]}_`;return t.startsWith(n)&&Nt.test(t.slice(n.length))}var Ft=/^[a-z0-9-]{2,40}$/,It=e=>typeof e==`string`&&Ft.test(e),Lt=(e,t=120)=>typeof e==`string`&&e.trim().length>0&&e.length<=t&&!jt.test(e),Rt=4e3,zt=/[\u0000-\u0009\u000b-\u001f\u007f\u2028\u2029\u200b-\u200f\u202a-\u202e\u2066-\u2069]/,Bt=(e,t=Rt)=>typeof e==`string`&&e.length<=t&&!zt.test(e);function Vt(e){if(e!==void 0){if(!Array.isArray(e)||e.length>32)return`tags must be a list of at most 32`;if(!e.every(It))return`each tag must be 2–40 lowercase letters, digits or dashes`;if(new Set(e).size!==e.length)return`tags must be unique`}}function Ht(e){if(e===void 0)return;if(typeof e!=`object`||!e||Array.isArray(e))return`metadata must be an object`;let t=Object.entries(e);if(t.length>32)return`metadata has more than 32 keys`;for(let[e,n]of t){if(!It(e))return`metadata key ${JSON.stringify(String(e).slice(0,50))} must be a slug`;if(!Lt(n,200))return`metadata.${e} must be 1–200 characters of text`}}var $=e=>e.signedIn,Ut=[{id:`sessions`,label:`All sessions`,icon:`home`,route:`/`,order:10,available:e=>$(e)?!0:`hidden`},{id:`concierge`,label:`Concierge`,icon:`spark`,route:`/concierge`,order:15,available:e=>$(e)&&e.concierge!==void 0&&e.concierge!==`disabled`?!0:`hidden`},{id:`artifacts`,label:`Artifacts`,icon:`file`,route:`/artifacts`,order:20,available:e=>$(e)?!0:`hidden`},{id:`teams`,label:`Teams`,icon:`team`,route:`/teams`,order:25,available:e=>$(e)?!0:`hidden`},{id:`watchtower`,label:`Watchtower`,icon:`watchtower`,route:`/watchtower`,order:30,available:e=>$(e)?!0:`hidden`},{id:`profiles`,label:`Agent profiles`,icon:`settings`,route:`/profiles`,order:40,available:e=>$(e)?!0:`hidden`}],Wt={"/birds-eye":`/watchtower`};function Gt(e,t=``,n=``){for(let[r,i]of Object.entries(Wt))if(e===r||e.startsWith(`${r}/`))return`${i}${e.slice(r.length)}${t}${n}`}function Kt(e,t){try{return e.available(t)}catch{return`hidden`}}function qt(e,t=Ut){return[...t].sort((e,t)=>e.order-t.order).flatMap(t=>{let n=Kt(t,e);return n===`hidden`?[]:[{dest:t,enabled:n===!0}]})}var Jt=(e,t)=>Kt(e,t)===!0?`ok`:`unavailable`;function Yt(e,t=Ut){for(let n of t)if(n.route!==`/`&&(e===n.route||e.startsWith(`${n.route}/`)))try{return{dest:n,rest:e.slice(n.route.length).split(`/`).filter(Boolean).map(decodeURIComponent)}}catch{return}}function Xt(e,t=Ut){return e===`/`?t.find(e=>e.route===`/`)?.id:Yt(e,t)?.dest.id}function Zt(e){return e.supported?e.permission===`denied`?{state:`blocked`,message:`Notifications are blocked for this site. Allow them in the browser's site settings, then reload.`,action:`none`,warn:!0}:e.permission==="default"?{state:`off`,message:`Notifications are off on this device.`,action:`enable`,warn:!0}:!e.worker||!e.endpoint||!e.hubSubscribed?{state:`repair`,message:`Allowed, but this device is not subscribed on this hub, so nothing will arrive (this happens after the hub moves to a new address). Enable again to fix it.`,action:`enable`,warn:!0}:{state:`on`,message:`On for this device.`,action:`disable`,warn:!1}:{state:`unsupported`,message:`This browser can't get notifications here. On iPhone, add the app to the Home Screen first (iOS 16.4+); everywhere else the hub must be on https.`,action:`none`,warn:!0}}var Qt=e=>e.supported&&e.permission===`granted`&&(!e.endpoint||!e.hubSubscribed);function $t(e){if(e.subscriptions===0)return{ok:!1,text:`This device is not subscribed; enable notifications first`};if(e.sent>0)return{ok:!0,text:e.sent===1?`Test notification sent to this device`:`Test notification sent (${e.sent} subscriptions)`};let t=e.failed[0];return t?{ok:!1,text:`Test failed: ${t.host} ${t.status===void 0?`did not answer`:`answered ${t.status}`}`}:{ok:!1,text:`Test failed`}}var en=[1,2,5,10,15,30,60],tn=[{title:`Needs you`,kinds:[{key:`question`,label:`Question`,description:`A session or subagent asks you something.`},{key:`permission`,label:`Needs permission`,description:`A tool call waits for your OK (answer from the notification).`},{key:`decision`,label:`Decision`,description:`A session asks you to decide (hub ask @me), with options and a recommendation.`},{key:`message`,label:`Message`,description:`Agent messaging needs you: a message to you, an unanswered ask, or sessions looping.`},{key:`concierge`,label:`Concierge`,description:`Your Concierge needs you or has news: its questions, permissions, decisions, messages and spoken replies.`}]},{title:`Session`,kinds:[{key:`done`,label:`All done`,description:`The session and all its subagents and scripts finished; nothing waits on you. Once per run.`},{key:`failed`,label:`Failed`,description:`The session's run failed (provider or tool error), with the reason.`},{key:`providerError`,label:`Model provider error`,description:`Quota, budget, auth or model-routing errors of the session or a subagent; once per run.`},{key:`turn`,label:`Turn finished`,description:`Every reply of the main session, also the short ones between subagents. Noisy.`},{key:`stopped`,label:`Stopped`,description:`A run stopped without you asking (OpenCode shut down, inactivity).`},{key:`retry`,label:`Retrying`,description:`The provider failed and OpenCode is retrying the request.`}]},{title:`Subagents`,kinds:[{key:`subagentDone`,label:`Subagent finished`,description:`Each subagent that finishes, by name.`},{key:`subagentFailed`,label:`Subagent failed`,description:`Each subagent that fails, with the reason.`}]},{title:`Scripts and tools`,kinds:[{key:`jobDone`,label:`Script finished`,description:`A background shell or terminal exited 0.`},{key:`jobFailed`,label:`Script failed`,description:`A background shell or terminal exited non-zero, was killed or timed out.`},{key:`longTool`,label:`Long tool finished`,description:`A tool call that ran 30 seconds or more ended.`}]},{title:`Voice`,kinds:[{key:`say`,label:`Spoken reply`,description:`Voice mode replies while no device shows the session.`},{key:`handoff`,label:`Hand-off`,description:`A session sent to this device from the terminal (ignores quiet hours).`}]},{title:`Activity digest`,kinds:[{key:`activity`,label:`Activity`,description:`One quiet, self-replacing summary per session: subagents, long tools, scripts, idle.`}]}],nn=tn.flatMap(e=>e.kinds);function rn(e){let t=nn.filter(t=>e[t.key]).map(e=>e.label);return t.length?`You'll get: ${t.join(`, `)}.`:`You'll get no notifications on this device.`}function an(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||`UTC`}catch{return`UTC`}}var on=[{id:`general`,label:`General`,description:`Account, theme, text size and the Hub app`},{id:`notifications`,label:`Notifications`,description:`This device's notifications, what to notify about, quiet hours`},{id:`voice`,label:`Voice & speech`,description:`Voice mode, mic sensitivity, speech-to-text and text-to-speech`},{id:`machines`,label:`Machines & devices`,description:`Connected machines, approvals, signed-in browsers and apps`},{id:`agents`,label:`Agents & access`,description:`App tokens, acting switches, grants and agent activity`},{id:`concierge`,label:`Concierge`,description:`Your hub-managed assistant: machine, directory, model and its grant`},{id:`teams`,label:`Teams`,description:`Team isolation: what team members see`},{id:`admin`,label:`Admin`,description:`Users, all machines, approvals and the audit log`,admin:!0}],sn=e=>on.filter(t=>e||!t.admin);function cn(e){if(e!==`/settings`&&!e.startsWith(`/settings/`))return;let t=e.slice(10).split(`/`)[0]??``;if(!t)return{};try{return{section:decodeURIComponent(t)}}catch{return{section:t}}}function ln(e,t){return e===void 0?t.phone?`list`:`general`:sn(t.admin).find(t=>t.id===e)?.id}var un={account:`general`,appearance:`general`,notifications:`notifications`,voice:`voice`,speech:`voice`,machines:`machines`,devices:`machines`,agents:`agents`,admin:`admin`};function dn(e){let t=e.replace(/^#/,``);if(!t)return;let n=un[t];if(n)return`/settings/${n}#${t}`;if(on.some(e=>e.id===t))return`/settings/${t}`}var fn=[{id:`account`,section:`general`,label:`Account`,description:`Who you are signed in as; sign out of this device`,keywords:`sign out logout user email`},{id:`set-theme`,section:`general`,label:`Color theme`,description:`Light, dark or the system's theme`,keywords:`appearance light dark system mode`},{id:`set-text-size`,section:`general`,label:`Text size`,description:`How big text is on this device`,keywords:`appearance font scale zoom`},{id:`add-app`,section:`general`,label:`Add the Hub app`,description:`Link the Hub app on a phone or tablet with a QR code`,keywords:`mobile android ios install pair link`},{id:`notifications`,section:`notifications`,label:`Notifications on this device`,description:`Enable or turn off push notifications here; permission and subscription status`,keywords:`push enable subscribe permission service worker`},{id:`notify-test`,section:`notifications`,label:`Send test notification`,description:`Check that notifications reach this device`,keywords:`push try`},{id:`quiet-hours`,section:`notifications`,label:`Quiet hours`,description:`No notifications at night (hand-offs still come through)`,keywords:`do not disturb night sleep time`},{id:`set-voice-speed`,section:`voice`,label:`Voice speed`,description:`How fast replies are spoken`,keywords:`rate tts`},{id:`set-sensitivity`,section:`voice`,label:`Mic sensitivity`,description:`How sure Voice mode must be that you are speaking to it`,keywords:`microphone noise vad`},{id:`set-cues`,section:`voice`,label:`Progress cues`,description:`Tones and short acknowledgements while the agent works`,keywords:`sounds acknowledgement`},{id:`set-background`,section:`voice`,label:`Keep listening when the screen is off`,description:`Lock-screen controls and listening with the screen off`,keywords:`background lock screen`},{id:`recording`,section:`voice`,label:`Record voice conversations (developer)`,description:`Saves your voice segments, transcripts, replies, timing and Concierge actions on this hub, for 7 days; export or delete them`,keywords:`record debug developer training audio export delete`},{id:`speech`,section:`voice`,label:`Speech`,description:`Speech-to-text and text-to-speech provider, model, voice and API keys`,keywords:`stt tts transcription openrouter openai key`},{id:`machines`,section:`machines`,label:`Machines`,description:`Computers running OpenCode connected to this hub; approve or revoke them`,keywords:`computer approve enrollment revoke opencode`},{id:`setup-machine`,section:`machines`,label:`Set up Hub on a machine`,description:`A one-line installer for macOS, Linux or Windows that connects a computer to this hub`,keywords:`setup install connect add new computer server laptop hubctl curl powershell windows linux macos enroll`},{id:`devices`,section:`machines`,label:`Devices`,description:`Browsers and the Hub app signed in to your account; revoke them`,keywords:`browser phone sessions revoke sign out`},{id:`agents`,section:`agents`,label:`Acting switch`,description:`Whether sessions and apps may act for you at all`,keywords:`pause kill switch acting`},{id:`app-tokens`,section:`agents`,label:`App tokens`,description:`Tokens for MCP gateways, CLIs and other apps, with their scopes`,keywords:`api key token scopes mcp cli`},{id:`grants`,section:`agents`,label:`Grants`,description:`What sessions and apps may approve, deny, answer, prompt or stop for you`,keywords:`permissions delegate allow`},{id:`agent-activity`,section:`agents`,label:`Agent activity`,description:`What agents did for you (the agent audit)`,keywords:`audit log history`},{id:`concierge`,section:`concierge`,label:`Concierge`,description:`Turn the Concierge on or off, pick its machine and directory, restart it`,keywords:`assistant butler watch sessions`},{id:`concierge-grant`,section:`concierge`,label:`Concierge grant`,description:`What the Concierge may do for you without asking; renew or remove it`,keywords:`permissions approve deny preset`},{id:`team-isolation`,section:`teams`,label:`Team isolation`,description:`Team members see only their teams' sessions, not your other sessions`,keywords:`teams privacy hide members`}],pn=[{id:`admin`,section:`admin`,label:`Users`,description:`Everyone on this hub: roles, disable, remove`,keywords:`admin accounts people`},{id:`admin-machines`,section:`admin`,label:`All machines`,description:`Every machine connected to this hub, by owner`,keywords:`admin revoke`},{id:`admin-audit`,section:`admin`,label:`Audit log`,description:`Who changed what on this hub`,keywords:`admin history`}],mn=(e,t)=>({id:`pref-${e.key}`,section:`notifications`,label:e.label,description:e.description,keywords:`notify ${t}`});function hn(e){return[...fn,...tn.flatMap(e=>e.kinds.map(t=>mn(t,e.title))),...e?pn:[]]}var gn=e=>on.find(t=>t.id===e)?.label??e;function _n(e,t){let n=e.trim().toLowerCase();if(!n)return[];let r=n.split(/\s+/),i=e=>{let t=e.label.toLowerCase();return t.startsWith(n)?0:t.includes(n)?1:r.every(e=>t.includes(e))?2:3};return t.filter(e=>{let t=`${e.label} ${e.description} ${e.keywords??``} ${gn(e.section)}`.toLowerCase();return r.every(e=>t.includes(e))}).map((e,t)=>({e,i:t,r:i(e)})).sort((e,t)=>e.r-t.r||e.i-t.i).map(e=>e.e)}function vn(e,t){let n=e.filter(e=>e.key in t);if(!n.length)return``;let r=n.filter(e=>t[e.key]);return r.length===n.length?`All on`:r.length?`${r.length} of ${n.length} on: ${r.map(e=>e.label).join(`, `)}`:`All off`}var yn=e=>e&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.includes(`\\`)?e:`/`;function bn(e){let t=e.pathname,n=e.searchParams;if(t===`/pair`)return{name:`pair`,next:yn(n.get(`next`)),error:n.get(`error`)??``};if(t===`/approve`)return{name:`approve`,code:n.get(`code`)??``};if(t===`/new`)return{name:`new`,machine:n.get(`machine`)??void 0,dir:n.get(`dir`)??void 0,key:n.get(`key`)??void 0};if(t===`/panes`)return{name:`panes`};if(t===`/concierge`||t.startsWith(`/concierge/`))return{name:`concierge`};let r=cn(t);if(r)return{name:`settings`,...r};let i=Yt(t);if(i)return{name:`feature`,id:i.dest.id,rest:i.rest};let a=/^\/s\/([^/]+)$/.exec(t);if(a)try{return{name:`session`,id:decodeURIComponent(a[1])}}catch{return{name:`home`}}return{name:`home`}}function xn(){let e=(location.pathname===`/settings`?dn(location.hash):void 0)??Gt(location.pathname,location.search,location.hash);return e&&history.replaceState(history.state,``,e),new URL(location.href)}var[Sn,Cn]=x(xn()),wn=Sn,Tn=()=>bn(Sn()),En=0;function Dn(e,{replace:t=!1}={}){let n=new URL(e,location.origin);n.pathname+n.search+n.hash!==location.pathname+location.search+location.hash&&(history[t?`replaceState`:`pushState`]({},``,n.pathname+n.search+n.hash),t||En++),Cn(xn())}function On(e=`/`){En>0?history.back():Dn(e)}window.addEventListener(`popstate`,()=>{En=Math.max(0,En-1),Cn(xn())}),document.addEventListener(`click`,e=>{let t=e.target?.closest?.(`a[href]`);if(!t||t.target||t.hasAttribute(`download`)||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let n=t.getAttribute(`href`)??``;!n.startsWith(`/`)||n.startsWith(`//`)||n.startsWith(`/auth/`)||n.startsWith(`/api/`)||(e.preventDefault(),Dn(n))});var kn=()=>new Set;function An(e){kn=e}var jn=e=>kn().has(e),Mn=e=>kn().has(e)?`/concierge`:`/s/${encodeURIComponent(e)}`,[Nn,Pn]=x(),Fn=Nn,In=0,Ln;function Rn(e,t=``,n){let r=++In;Pn({id:r,text:e,kind:t,action:n}),clearTimeout(Ln),Ln=setTimeout(()=>Nn()?.id===r&&Pn(void 0),n||t?8e3:4e3)}var zn=()=>Pn(void 0);function Bn(e){let t=[];return{ask(n){return new Promise(r=>{t.push({request:n,resolve:r}),t.length===1&&e(n)})},current:()=>t[0]?.request,settle(n){let r=t.shift();r&&(r.resolve(n),e(t[0]?.request))}}}function Vn(e){let t=e.trim(),n=t.indexOf(`
2
2
 
3
3
  `);if(n>=0)return{title:t.slice(0,n).trim(),message:t.slice(n+2).trim()};let r=/\?\s/.exec(t);return r?{title:t.slice(0,r.index+1),message:t.slice(r.index+1).trim()}:{title:t,message:``}}var Hn=e=>e.danger?`cancel`:`primary`,Un=e=>e.repeat&&(e.key===`Enter`||e.key===` `);function Wn(e,t){return Array.from(e.querySelectorAll(`dialog:modal`)).some(e=>!t||!e.contains(t))}var Gn=W(`<dialog class="dialog confirm-dialog"role=alertdialog aria-modal=true aria-labelledby=confirm-dialog-title data-confirm-dialog>`),Kn=W(`<p id=confirm-dialog-message class=confirm-message>`),qn=W(`<form method=dialog><div class=dialog-head><h2 id=confirm-dialog-title></h2></div><div class=dialog-body><div class=dialog-actions><button type=button class=btn data-confirm-cancel></button><button type=submit data-confirm-primary>`),[Jn,Yn]=x(),Xn=Bn(Yn);function Zn(e){return Xn.ask(e)}var Qn=e=>Wn(document,e??void 0);function $n(e,t,n={}){let{title:r,message:i}=Vn(e);return Zn({title:r,message:i,confirm:t,...n})}var er=`button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])`;function tr(){let e,t,n,r=null;C(()=>{let i=Jn();e&&(i&&!e.open?(r=document.activeElement,e.showModal()):!i&&e.open&&(e.close(),r?.isConnected&&r.focus(),r=null),i&&queueMicrotask(()=>(Hn(i)===`cancel`?n:t)?.focus()))});let i=e=>Xn.settle(e);return(()=>{var r=Gn();r.$$keydown=t=>{if(Un(t)){t.preventDefault();return}if(t.key!==`Tab`||!e)return;let n=[...e.querySelectorAll(er)];if(!n.length)return;let r=n[0],i=n[n.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),i.focus()):!t.shiftKey&&document.activeElement===i&&(t.preventDefault(),r.focus())},r.$$click=t=>t.target===e&&i(!1),r.addEventListener(`cancel`,e=>{e.preventDefault(),i(!1)});var a=e;return typeof a==`function`?J(a,r):e=r,Y(r,V(U,{get when(){return Jn()},children:e=>(()=>{var r=qn(),a=r.firstChild,o=a.firstChild,s=a.nextSibling,c=s.firstChild,l=c.firstChild,u=l.nextSibling;r.addEventListener(`submit`,e=>{e.preventDefault(),i(!0)}),Y(o,()=>e().title),Y(s,V(U,{get when(){return e().message},get children(){var t=Kn();return Y(t,()=>e().message),t}}),c),l.$$click=()=>i(!1);var d=n;typeof d==`function`?J(d,l):n=l,Y(l,()=>e().cancel??`Cancel`);var f=t;return typeof f==`function`?J(f,u):t=u,Y(u,()=>e().confirm),S(()=>q(u,`btn primary${e().danger?` danger`:``}`)),r})()})),S(()=>K(r,`aria-describedby`,Jn()?.message?`confirm-dialog-message`:void 0)),r})()}G([`click`,`keydown`]);var nr=W(`<svg viewBox="0 0 24 24"aria-hidden=true>`),rr=W(`<svg><path></svg>`,!1,!0,!1),ir=W(`<span class=voice-dot role=img aria-label="Voice mode on"title="Voice mode on">`),ar=W(`<span class=spinner>`),or=W(`<span role=img>`),sr=W(`<span class=status-dot>`),cr=W(`<button type=button>`),lr=W(`<button type=button aria-haspopup=menu>`),ur=W(`<div class=menu role=menu>`),dr=W(`<div class=menu-sep role=separator>`),fr=W(`<div class=menu-section>`),pr=W(`<span class=menu-hint>`),mr=W(`<kbd class=menu-key>`),hr=W(`<button type=button><span class=menu-check></span><span class=menu-label>`),gr=W(`<div class=dialog-head><h2>`),_r=W(`<div class=dialog-body>`),vr=W(`<dialog>`),yr=W(`<span class=error-badge role=img>!`),br={menu:[`M4 6h16`,`M4 12h16`,`M4 18h16`],sidebar:[`M4 5h16v14H4z`,`M9 5v14`],rail:[`M4 5h16v14H4z`,`M15 5v14`],plus:[`M12 5v14`,`M5 12h14`],file:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`],more:[`M5 12h.01`,`M12 12h.01`,`M19 12h.01`],search:[`M11 4a7 7 0 1 0 0 14a7 7 0 0 0 0-14z`,`M20 20l-4-4`],mic:[`M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z`,`M5 11a7 7 0 0 0 14 0`,`M12 18v3`],wave:[`M3 12h2`,`M7 8v8`,`M11 5v14`,`M15 8v8`,`M19 11v2`],stop:[`M7 7h10v10H7z`],send:[`M12 19V5`,`M5 12l7-7 7 7`],chevron:[`M9 6l6 6-6 6`],down:[`M6 9l6 6 6-6`],close:[`M6 6l12 12`,`M18 6L6 18`],back:[`M15 5l-7 7 7 7`],settings:[`M4 7h10M18 7h2M4 17h4M12 17h8`,`M16 5v4`,`M10 15v4`],branch:[`M6 3v12`,`M18 9a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M6 21a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M18 9a9 9 0 0 1-9 9`],server:[`M4 5h16v6H4z`,`M4 13h16v6H4z`,`M8 8h.01`,`M8 16h.01`],diff:[`M12 3v6`,`M9 6h6`,`M9 18h6`,`M5 3h14v18H5z`],pin:[`M12 17v5`,`M8 3h8l-1 6 3 3H6l3-3z`],muted:[`M12 3a3 3 0 0 1 3 3v6a3 3 0 0 1-6 0V6a3 3 0 0 1 3-3z`,`M5 11a7 7 0 0 0 14 0`,`M4 4l16 16`],home:[`M4 11l8-7 8 7`,`M6 10v10h12V10`],cloud:[`M7 18h10a4 4 0 0 0 .5-7.97A6 6 0 0 0 6.1 9.1A4.5 4.5 0 0 0 7 18z`],folder:[`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`],bell:[`M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9`,`M10.3 21a1.94 1.94 0 0 0 3.4 0`],watchtower:[`M6 7l6-4 6 4`,`M8 7h8v4H8z`,`M9 11l-2 10`,`M15 11l2 10`,`M8.2 15h7.6`],copy:[`M9 9h11v11H9z`,`M5 15H4V4h11v1`],fork:[`M6 3v5a6 6 0 0 0 6 6`,`M18 3v5a6 6 0 0 1-6 6v7`,`M4 5l2-2 2 2`,`M16 5l2-2 2 2`],undo:[`M9 14L4 9l5-5`,`M4 9h11a5 5 0 0 1 0 10h-3`],download:[`M12 4v11`,`M7 10l5 5 5-5`,`M5 20h14`],edit:[`M4 20h4L19 9l-4-4L4 16z`,`M13 7l4 4`],info:[`M12 3a9 9 0 1 0 0 18a9 9 0 0 0 0-18z`,`M12 11v5`,`M12 8h.01`],check:[`M5 12l5 5 9-10`],spark:[`M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z`,`M19 16l.7 1.8 1.8.7-1.8.7L19 21l-.7-1.8-1.8-.7 1.8-.7z`],split:[`M4 5h16v14H4z`,`M12 5v14`],expand:[`M14 4h6v6`,`M20 4l-7 7`,`M10 20H4v-6`,`M4 20l7-7`],archive:[`M4 5h16v4H4z`,`M6 9v10h12V9`,`M10 13h4`],wrap:[`M4 6h16`,`M4 12h13a3 3 0 0 1 0 6h-4`,`M15 16l-2 2 2 2`,`M4 18h5`],lock:[`M6 11h12v9H6z`,`M8 11V8a4 4 0 0 1 8 0v3`],code:[`M9 8l-4 4 4 4`,`M15 8l4 4-4 4`],image:[`M4 5h16v14H4z`,`M4 16l5-5 4 4 2-2 5 5`,`M15 9h.01`],table:[`M4 5h16v14H4z`,`M4 10h16`,`M4 15h16`,`M10 5v14`],chart:[`M4 20h16`,`M7 16v-5`,`M12 16V7`,`M17 16v-8`],grid:[`M4 4h7v7H4z`,`M13 4h7v7h-7z`,`M4 13h7v7H4z`,`M13 13h7v7h-7z`],stack:[`M4 5h16v14H4z`,`M4 12h16`],grip:[`M9 6h.01`,`M15 6h.01`,`M9 12h.01`,`M15 12h.01`,`M9 18h.01`,`M15 18h.01`],app:[`M4 5h16v14H4z`,`M4 9h16`,`M7 7h.01`,`M10 7h.01`],doc:[`M6 3h8l4 4v14H6z`,`M14 3v4h4`,`M9 12h6`,`M9 16h6`],team:[`M9 11a3 3 0 1 0 0-6a3 3 0 0 0 0 6z`,`M3 20a6 6 0 0 1 12 0`,`M16 11a2.5 2.5 0 1 0 0-5`,`M17 14.2a5 5 0 0 1 4 4.8`]};function xr(e){return(()=>{var t=nr();return Y(t,V(Fe,{get each(){return[...br[e.name]]},children:e=>(()=>{var t=rr();return K(t,`d`,e),t})()})),S(()=>K(t,`class`,`icon ${e.class??``}`)),t})()}var Sr={idle:`Idle`,working:`Running`,blocked:`Needs you`,error:`Error`};function Cr(){return ir()}function wr(e){return(()=>{var t=or();return Y(t,V(U,{get when(){return e.state===`working`},get fallback(){return sr()},get children(){return ar()}})),S(n=>{var r=`status ${e.state} ${e.class??``}`,i=Sr[e.state],a=Sr[e.state];return r!==n.e&&q(t,n.e=r),i!==n.t&&K(t,`aria-label`,n.t=i),a!==n.a&&K(t,`title`,n.a=a),n},{e:void 0,t:void 0,a:void 0}),t})()}function Tr(e){let[t,n]=Ae(e,[`icon`,`label`,`class`]);return(()=>{var e=cr();return at(e,ke({get class(){return`icon-btn ${t.class??``}`},get"aria-label"(){return t.label},get title(){return t.label}},n),!1,!0),Y(e,V(xr,{get name(){return t.icon}})),e})()}function Er(e){let[t,n]=x(!1),r,i,[a,o]=x({top:0,left:0,right:0,bottom:0}),s=()=>{let e=r.getBoundingClientRect();o({top:e.bottom+4,left:e.left,right:window.innerWidth-e.right,bottom:window.innerHeight-e.top+4})},c=()=>n(!1),l=e=>{if(!t())return;let n=e.target;!r.contains(n)&&!i?.contains(n)&&c()},u=n=>{if(t()){if(n.key===`Escape`){if(Qn(i??r))return;c(),r.focus()}else if(/^[1-9]$/.test(n.key)&&!(n.target instanceof HTMLInputElement||n.target instanceof HTMLTextAreaElement)){let t=e.items().filter(e=>typeof e==`object`&&`run`in e&&!e.disabled)[Number(n.key)-1];t&&(n.preventDefault(),c(),t.run())}}};E(()=>{document.addEventListener(`mousedown`,l),document.addEventListener(`keydown`,u)}),D(()=>{document.removeEventListener(`mousedown`,l),document.removeEventListener(`keydown`,u)});let d=()=>{let t=0;return e.items().map(e=>({item:e,index:typeof e==`object`&&`run`in e&&!e.disabled?++t:0}))};return[(()=>{var i=lr();i.$$click=e=>{e.stopPropagation(),e.preventDefault(),s(),n(!t())};var a=r;return typeof a==`function`?J(a,i):r=i,Y(i,()=>e.text??V(xr,{get name(){return e.icon??`more`}})),S(n=>{var r=e.class??`icon-btn`,a=e.label,o=e.label,s=t();return r!==n.e&&q(i,n.e=r),a!==n.t&&K(i,`aria-label`,n.t=a),o!==n.a&&K(i,`title`,n.a=o),s!==n.o&&K(i,`aria-expanded`,n.o=s),n},{e:void 0,t:void 0,a:void 0,o:void 0}),i})(),V(U,{get when(){return t()},get children(){return V(_t,{get children(){var t=ur(),n=i;return typeof n==`function`?J(n,t):i=t,Y(t,V(Fe,{get each(){return d()},children:({item:e,index:t})=>e===`sep`?dr():`section`in e?(()=>{var t=fr();return Y(t,()=>e.section),t})():(()=>{var n=hr(),r=n.firstChild,i=r.nextSibling;return n.$$click=t=>{t.stopPropagation(),c(),e.run()},Y(r,()=>e.checked?`✓`:``),Y(i,()=>e.label),Y(n,V(U,{get when(){return e.hint},get children(){var t=pr();return Y(t,()=>e.hint),t}}),null),Y(n,V(U,{when:t>0&&t<10,get children(){var e=mr();return Y(e,t),e}}),null),S(t=>{var r=e.checked===void 0?`menuitem`:`menuitemradio`,i=e.checked,a=`menu-item${e.danger?` danger`:``}`,o=e.disabled;return r!==t.e&&K(n,`role`,t.e=r),i!==t.t&&K(n,`aria-checked`,t.t=i),a!==t.a&&q(n,t.a=a),o!==t.o&&(n.disabled=t.o=o),t},{e:void 0,t:void 0,a:void 0,o:void 0}),n})()})),S(n=>rt(t,{...e.up?{bottom:`${a().bottom}px`}:{top:`${a().top}px`},...e.align===`left`?{left:`${a().left}px`}:{right:`${a().right}px`}},n)),t}})}})]}function Dr(e){let t;return C(()=>{let n=e.open;t&&(n&&!t.open?t.showModal():!n&&t.open&&t.close())}),(()=>{var n=vr();n.$$click=n=>n.target===t&&e.onClose(),n.addEventListener(`close`,()=>e.onClose());var r=t;return typeof r==`function`?J(r,n):t=n,Y(n,V(U,{get when(){return e.open},get children(){return[(()=>{var t=gr(),n=t.firstChild;return Y(n,()=>e.title),Y(t,V(Tr,{icon:`close`,label:`Close`,onClick:()=>e.onClose()}),null),t})(),(()=>{var t=_r();return Y(t,()=>e.children),t})()]}})),S(t=>{var r=`dialog${e.wide?` wide`:``} ${e.class??``}`,i=e.title;return r!==t.e&&q(n,t.e=r),i!==t.t&&K(n,`aria-label`,t.t=i),t},{e:void 0,t:void 0}),n})()}var[Or,kr]=x(Date.now());setInterval(()=>kr(Date.now()),3e4);var Ar=Or,[jr,Mr]=x(Date.now());setInterval(()=>Mr(Date.now()),1e3);var Nr=jr;function Pr(e){return(()=>{var t=yr();return S(n=>{var r=`Error: ${e.text}`,i=e.text;return r!==n.e&&K(t,`aria-label`,n.e=r),i!==n.t&&K(t,`title`,n.t=i),n},{e:void 0,t:void 0}),t})()}function Fr(e,t=Or()){if(!e)return``;let n=Math.max(0,Math.round((t-e)/1e3));return n<45?`just now`:n<3600?`${Math.round(n/60)}m ago`:n<86400?`${Math.round(n/3600)}h ago`:`${Math.round(n/86400)}d ago`}var Ir=e=>String(e??``).replace(/[\\/]+$/,``).split(/[\\/]/).pop()||e||``,Lr={herdr:`Herdr`,tui:`TUI`,background:`Background`};G([`click`]);export{bt as $,hn as A,V as At,Ut as B,je as Bt,Dn as C,Fe as Ct,vn as D,Be as Dt,An as E,U as Et,$t as F,ne as Ft,Pt as G,T as Gt,qt as H,ie as Ht,an as I,b as It,Bt as J,Lt as K,Zt as L,x as Lt,en as M,C as Mt,tn as N,w as Nt,ln as O,Le as Ot,nn as P,S as Pt,kt as Q,rn as R,Ne as Rt,wn as S,o as St,Mn as T,Re as Tt,Jt as U,D as Ut,Xt as V,ke as Vt,Rt as W,E as Wt,Vt as X,Ht as Y,At as Z,Fn as _,at as _t,Er as a,Dt as at,On as b,J as bt,wr as c,_t as ct,Ir as d,G as dt,xt as et,Ar as f,Y as ft,Qn as g,it as gt,$n as h,K as ht,Tr as i,Tt as it,sn as j,ee as jt,_n as k,re as kt,Cr as l,tt as lt,tr as m,Qe as mt,Pr as n,Et as nt,Lr as o,Ct as ot,Nr as p,Ye as pt,It as q,xr as r,Ot as rt,Sr as s,yt as st,Dr as t,wt as tt,Fr as u,q as ut,zn as v,rt as vt,Tn as w,Ie as wt,jn as x,i as xt,Rn as y,W as yt,Qt as z,O as zt};
@@ -17,11 +17,13 @@
17
17
  <link rel="icon" href="/icon.svg" type="image/svg+xml" />
18
18
  <link rel="icon" href="/icon-192.png" type="image/png" sizes="192x192" />
19
19
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
20
- <script type="module" crossorigin src="/assets/index-6mdQ7eUY.js"></script>
21
- <link rel="modulepreload" crossorigin href="/assets/ui-Qo2Pd9-O.js">
22
- <link rel="modulepreload" crossorigin href="/assets/pane-layout-Csk-vPNe.js">
20
+ <script type="module" crossorigin src="/assets/index-D9SP3_0z.js"></script>
21
+ <link rel="modulepreload" crossorigin href="/assets/ui-j5FFk90B.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/pane-layout-EdR1kRrG.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/hub-CrbItiwP.js">
23
24
  <link rel="modulepreload" crossorigin href="/assets/plural-Bspvoqfq.js">
24
- <link rel="stylesheet" crossorigin href="/assets/index-C5OmwA1y.css">
25
+ <link rel="modulepreload" crossorigin href="/assets/preload-helper-DqrJTq0t.js">
26
+ <link rel="stylesheet" crossorigin href="/assets/index-82Ce0IAf.css">
25
27
  </head>
26
28
  <body>
27
29
  <div id="root"></div>
@@ -1 +0,0 @@
1
- import{At as e,Et as t,ft as n,i as r,r as i,yt as a}from"./ui-Qo2Pd9-O.js";import{L as o,R as s,z as c}from"./index-6mdQ7eUY.js";import{t as l}from"./ArtifactWorkbench-CkmWnP6L.js";var u=a(`<div class="feature-page av-page">`),d=a(`<a class="icon-btn av-back"href=/artifacts aria-label="All artifacts"title="All artifacts">`);function f(a){return(()=>{var f=u();return n(f,e(l,{get id(){return a.id},layout:`page`,get lead(){return[e(t,{get when(){return o()},get children(){return e(r,{icon:`menu`,label:`Open sidebar`,onClick:s})}}),(()=>{var t=d();return n(t,e(i,{name:`back`})),t})()]},get actions(){return e(r,{class:`av-wide`,icon:`split`,label:`Open in pane`,onClick:()=>c(a.id)})}})),f})()}export{f as default};