sessiongraph 1.0.15 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/PRIVACY.md +15 -61
- package/README.md +35 -55
- package/bin/sessiongraph.mjs +14 -8
- package/dist/assets/index-C0jATzD9.css +1 -0
- package/dist/assets/{index-D4P4hbvc.js → index-CFlNwG9H.js} +1 -1
- package/dist/assets/index-D24Hz9MJ.js +180 -0
- package/dist/assets/{index-Kotmn42s.js → index-D7udGrT1.js} +1 -1
- package/dist/assets/{index-BLM-0yG6.js → index-U9QGDl1t.js} +1 -1
- package/dist/assets/katagami-sans-DMv8PCo8.woff2 +0 -0
- package/dist/assets/licenses/hugeicons.txt +21 -0
- package/dist/assets/licenses/katagami.txt +93 -0
- package/dist/assets/public-viewer-CyDoUT6s.css +1 -0
- package/dist/assets/public-viewer-iQBchlbq.js +24 -0
- package/dist/assets/scene-DmT4K5Nj.js +248 -0
- package/dist/assets/share-DrezE0sG.js +7 -0
- package/dist/assets/{three-D_1Qt16u.js → three-DDiuFd7k.js} +21 -21
- package/dist/assets/{worker-C10U_apJ.js → worker-B9mWJfQ6.js} +1 -1
- package/dist/index.html +2 -2
- package/dist-server/cli.mjs +48449 -15768
- package/dist-server/install-cli.mjs +204 -0
- package/dist-server/server.mjs +1081 -376
- package/docs/cli.md +293 -190
- package/docs/guide.md +15 -8
- package/docs/import-coverage.md +73 -5
- package/docs/performance.md +164 -0
- package/docs/releases.md +6 -0
- package/package.json +18 -10
- package/dist/assets/external-links-BmBkCsrt.js +0 -1
- package/dist/assets/geist-cyrillic-ext-wght-normal-DjL33-gN.woff2 +0 -0
- package/dist/assets/geist-cyrillic-wght-normal-BEAKL7Jp.woff2 +0 -0
- package/dist/assets/geist-latin-ext-wght-normal-DC-KSUi6.woff2 +0 -0
- package/dist/assets/geist-latin-wght-normal-BgDaEnEv.woff2 +0 -0
- package/dist/assets/geist-vietnamese-wght-normal-6IgcOCM7.woff2 +0 -0
- package/dist/assets/index-B1kyvo41.js +0 -175
- package/dist/assets/index-Du0_nVjH.css +0 -1
- package/dist/assets/publishing-CEvQPkO1.css +0 -1
- package/dist/assets/publishing-D9CqkbeB.js +0 -23
- package/dist/assets/scene-CTHyYtma.js +0 -139
- package/dist/assets/share-Cw1E-ED9.js +0 -7
- package/docs/importer-comparison.md +0 -48
- package/docs/session-artifacts-audit.md +0 -176
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/public-viewer-iQBchlbq.js","assets/scene-DmT4K5Nj.js","assets/three-DDiuFd7k.js","assets/public-viewer-CyDoUT6s.css","assets/share-DrezE0sG.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&s(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();const yd="modulepreload",vd=function(e){return"/"+e},_i={},mr=function(t,n,s){let r=Promise.resolve();if(n&&n.length>0){let c=function(l){return Promise.all(l.map(h=>Promise.resolve(h).then(u=>({status:"fulfilled",value:u}),u=>({status:"rejected",reason:u}))))};document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),a=i?.nonce||i?.getAttribute("nonce");r=c(n.map(l=>{if(l=vd(l),l in _i)return;_i[l]=!0;const h=l.endsWith(".css"),u=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${u}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":yd,h||(g.as="script"),g.crossOrigin="",g.href=l,a&&g.setAttribute("nonce",a),document.head.appendChild(g),h)return new Promise((p,f)=>{g.addEventListener("load",p),g.addEventListener("error",()=>f(new Error(`Unable to preload CSS for ${l}`)))})}))}function o(i){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=i,window.dispatchEvent(a),!a.defaultPrevented)throw i}return r.then(i=>{for(const a of i||[])a.status==="rejected"&&o(a.reason);return t().catch(o)})},bd=[["path",{d:"M12 5.75C12 3.75 13.5 1.75 15.5 1.75C15.5 3.75 14 5.75 12 5.75Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12.5 8.09001C11.9851 8.09001 11.5867 7.92646 11.1414 7.74368C10.5776 7.51225 9.93875 7.25 8.89334 7.25C7.02235 7.25 4 8.74945 4 12.7495C4 17.4016 7.10471 22.25 9.10471 22.25C9.77426 22.25 10.3775 21.9871 10.954 21.7359C11.4815 21.5059 11.9868 21.2857 12.5 21.2857C13.0132 21.2857 13.5185 21.5059 14.046 21.7359C14.6225 21.9871 15.2257 22.25 15.8953 22.25C17.2879 22.25 18.9573 19.8992 20 16.9008C18.3793 16.2202 17.338 14.618 17.338 12.75C17.338 11.121 18.2036 10.0398 19.5 9.25C18.5 7.75 17.0134 7.25 15.9447 7.25C14.8993 7.25 14.2604 7.51225 13.6966 7.74368C13.2514 7.92646 13.0149 8.09001 12.5 8.09001Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],wd=[["path",{d:"M18 9.00005C18 9.00005 13.5811 15 12 15C10.4188 15 6 9 6 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],kd=[["path",{d:"M12 16V3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M6 21H18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M7 12C7 12 10.6824 17 12 17C13.3176 17 17 12 17 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Cd=[["path",{d:"M15 6C15 6 9.00001 10.4189 9 12C8.99999 13.5812 15 18 15 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ed=[["path",{d:"M5.5 12.002H19",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10.9999 18.002C10.9999 18.002 4.99998 13.583 4.99997 12.0019C4.99996 10.4208 11 6.00195 11 6.00195",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Sd=[["path",{d:"M9.00005 6C9.00005 6 15 10.4189 15 12C15 13.5812 9 18 9 18",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],xd=[["path",{d:"M18.5 12L4.99997 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 18C13 18 19 13.5811 19 12C19 10.4188 13 6 13 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],$d=[["path",{d:"M9 6.65032C9 6.65032 15.9383 6.10759 16.9154 7.08463C17.8924 8.06167 17.3496 15 17.3496 15M16.5 7.5L6.5 17.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Ld=[["path",{d:"M13 7H11C8.19108 7 6.78661 7 5.77772 7.67412C5.34096 7.96596 4.96596 8.34096 4.67412 8.77772C4 9.78661 4 11.1911 4 14C4 16.8089 4 18.2134 4.67412 19.2223C4.96596 19.659 5.34096 20.034 5.77772 20.3259C6.78661 21 8.19108 21 11 21H13C15.8089 21 17.2134 21 18.2223 20.3259C18.659 20.034 19.034 19.659 19.3259 19.2223C20 18.2134 20 16.8089 20 14C20 11.1911 20 9.78661 19.3259 8.77772C19.034 8.34096 18.659 7.96596 18.2223 7.67412C17.2134 7 15.8089 7 13 7Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M4 14H2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M10 17H14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M22 14H20",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M15 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M9 11V13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 7C12 5.11438 12 4.17157 11.4142 3.58579C10.8284 3 9.88562 3 8 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],Id=[["path",{d:"M16 2V6M8 2V6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13 4H11C7.22876 4 5.34315 4 4.17157 5.17157C3 6.34315 3 8.22876 3 12V14C3 17.7712 3 19.6569 4.17157 20.8284C5.34315 22 7.22876 22 11 22H13C16.7712 22 18.6569 22 19.8284 20.8284C21 19.6569 21 17.7712 21 14V12C21 8.22876 21 6.34315 19.8284 5.17157C18.6569 4 16.7712 4 13 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M3 10H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M12.1258 14H12.0008M12.1258 18H12.0008M7.625 14H7.5M7.625 18H7.5M16.625 14H16.5M12.2508 14C12.2508 14.1381 12.1389 14.25 12.0008 14.25C11.8628 14.25 11.7508 14.1381 11.7508 14C11.7508 13.8619 11.8628 13.75 12.0008 13.75C12.1389 13.75 12.2508 13.8619 12.2508 14ZM12.2508 18C12.2508 18.1381 12.1389 18.25 12.0008 18.25C11.8628 18.25 11.7508 18.1381 11.7508 18C11.7508 17.8619 11.8628 17.75 12.0008 17.75C12.1389 17.75 12.2508 17.8619 12.2508 18ZM7.75 14C7.75 14.1381 7.63807 14.25 7.5 14.25C7.36193 14.25 7.25 14.1381 7.25 14C7.25 13.8619 7.36193 13.75 7.5 13.75C7.63807 13.75 7.75 13.8619 7.75 14ZM7.75 18C7.75 18.1381 7.63807 18.25 7.5 18.25C7.36193 18.25 7.25 18.1381 7.25 18C7.25 17.8619 7.36193 17.75 7.5 17.75C7.63807 17.75 7.75 17.8619 7.75 18ZM16.75 14C16.75 14.1381 16.6381 14.25 16.5 14.25C16.3619 14.25 16.25 14.1381 16.25 14C16.25 13.8619 16.3619 13.75 16.5 13.75C16.6381 13.75 16.75 13.8619 16.75 14Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],Td=[["path",{d:"M18.9991 19L5 5.00098",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 5L5.00092 18.999",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Md=[["path",{d:"M9.13432 2.5C6.46805 2.56075 4.9107 2.81456 3.84664 3.87493C2.91537 4.80297 2.60406 6.10756 2.5 8.2M14.8657 2.5C17.532 2.56075 19.0893 2.81456 20.1534 3.87493C21.0846 4.80297 21.3959 6.10756 21.5 8.2M14.8657 21.5C17.532 21.4392 19.0893 21.1854 20.1534 20.1251C21.0846 19.197 21.3959 17.8924 21.5 15.8M9.13432 21.5C6.46805 21.4392 4.9107 21.1854 3.84664 20.1251C2.91537 19.197 2.60406 17.8924 2.5 15.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M16 12C16 14.2091 14.2091 16 12 16C9.79086 16 8 14.2091 8 12C8 9.79086 9.79086 8 12 8C14.2091 8 16 9.79086 16 12Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Ad=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 8V12L14 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Od=[["ellipse",{cx:"15.5",cy:"11",rx:"6.5",ry:"2",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M22 15.5C22 16.6046 19.0899 17.5 15.5 17.5C11.9101 17.5 9 16.6046 9 15.5",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M22 11V19.8C22 21.015 19.0899 22 15.5 22C11.9101 22 9 21.015 9 19.8V11",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["ellipse",{cx:"8.5",cy:"4",rx:"6.5",ry:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["path",{d:"M6 11C4.10819 10.7698 2.36991 10.1745 2 9M6 16C4.10819 15.7698 2.36991 15.1745 2 14",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M6 21C4.10819 20.7698 2.36991 20.1745 2 19V4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M15 6V4",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}]],Dd=[["path",{d:"M7.5 7.5L8.72654 8.55719C9.24218 9.00163 9.5 9.22386 9.5 9.5C9.5 9.77614 9.24218 9.99836 8.72654 10.4428L7.5 11.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M11.5 12.5H15.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12 21C15.7497 21 17.6246 21 18.9389 20.0451C19.3634 19.7367 19.7367 19.3634 20.0451 18.9389C21 17.6246 21 15.7497 21 12C21 8.25027 21 6.3754 20.0451 5.06107C19.7367 4.6366 19.3634 4.26331 18.9389 3.95491C17.6246 3 15.7497 3 12 3C8.25027 3 6.3754 3 5.06107 3.95491C4.6366 4.26331 4.26331 4.6366 3.95491 5.06107C3 6.3754 3 8.25027 3 12C3 15.7497 3 17.6246 3.95491 18.9389C4.26331 19.3634 4.6366 19.7367 5.06107 20.0451C6.3754 21 8.25027 21 12 21Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Pd=[["path",{d:"M7.5 14.5C7.5 11.2002 7.5 9.55025 8.52513 8.52513C9.55025 7.5 11.2002 7.5 14.5 7.5C17.7998 7.5 19.4497 7.5 20.4749 8.52513C21.5 9.55025 21.5 11.2002 21.5 14.5C21.5 17.7998 21.5 19.4497 20.4749 20.4749C19.4497 21.5 17.7998 21.5 14.5 21.5C11.2002 21.5 9.55025 21.5 8.52513 20.4749C7.5 19.4497 7.5 17.7998 7.5 14.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7.5 16.5C6.10355 16.5 5.40533 16.5 4.84402 16.3036C3.83866 15.9518 3.0482 15.1613 2.69641 14.156C2.5 13.5947 2.5 12.8964 2.5 11.5V9.5C2.5 6.20017 2.5 4.55025 3.52513 3.52513C4.55025 2.5 6.20017 2.5 9.5 2.5H11.5C12.8964 2.5 13.5947 2.5 14.156 2.69641C15.1613 3.0482 15.9518 3.83866 16.3036 4.84402C16.5 5.40533 16.5 6.10355 16.5 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Rd=[["path",{d:"M4 12C4 8.22876 4 6.34315 5.17157 5.17157C6.34315 4 8.22876 4 12 4C15.7712 4 17.6569 4 18.8284 5.17157C20 6.34315 20 8.22876 20 12C20 15.7712 20 17.6569 18.8284 18.8284C17.6569 20 15.7712 20 12 20C8.22876 20 6.34315 20 5.17157 18.8284C4 17.6569 4 15.7712 4 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 2V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M14.5 2V4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M9.5 20V22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M14.5 20V22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M13 9L9 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M15 13L13 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M22 14.5L20 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"7"}],["path",{d:"M4 9.5L2 9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"8"}],["path",{d:"M4 14.5L2 14.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"9"}],["path",{d:"M22 9.5L20 9.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"10"}]],Vd=[["path",{d:"M3 12C3 7.75736 3 5.63604 4.31802 4.31802C5.63604 3 7.75736 3 12 3C16.2426 3 18.364 3 19.682 4.31802C21 5.63604 21 7.75736 21 12C21 16.2426 21 18.364 19.682 19.682C18.364 21 16.2426 21 12 21C7.75736 21 5.63604 21 4.31802 19.682C3 18.364 3 16.2426 3 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M3 12H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M11 7.5L17 7.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M7.125 7.5H7M7.25 7.5C7.25 7.63807 7.13807 7.75 7 7.75C6.86193 7.75 6.75 7.63807 6.75 7.5C6.75 7.36193 6.86193 7.25 7 7.25C7.13807 7.25 7.25 7.36193 7.25 7.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M11 16.5L17 16.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.125 16.5H7M7.25 16.5C7.25 16.6381 7.13807 16.75 7 16.75C6.86193 16.75 6.75 16.6381 6.75 16.5C6.75 16.3619 6.86193 16.25 7 16.25C7.13807 16.25 7.25 16.3619 7.25 16.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],Nd=[["path",{d:"M6 15.5C6 17.433 7.567 19 9.5 19H14.5C16.433 19 18 17.433 18 15.5C18 13.567 16.433 12 14.5 12H9.5C7.567 12 6 10.433 6 8.5C6 6.567 7.567 5 9.5 5H14.5C16.433 5 18 6.567 18 8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 2.5V21.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Fd=[["path",{d:"M10 18C10 18 7.50004 16.1588 7.50003 15.5C7.50003 14.8412 10 13 10 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 18C14 18 16.5 16.1588 16.5 15.5C16.5 14.8412 14 13 14 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M13 2.5V3C13 5.82843 13 7.24264 13.8787 8.12132C14.7574 9 16.1716 9 19 9H19.5M20 10.6569V14C20 17.7712 20 19.6569 18.8284 20.8284C17.6569 22 15.7712 22 12 22C8.22876 22 6.34315 22 5.17157 20.8284C4 19.6569 4 17.7712 4 14V9.45584C4 6.21082 4 4.58831 4.88607 3.48933C5.06508 3.26731 5.26731 3.06508 5.48933 2.88607C6.58831 2 8.21082 2 11.4558 2C12.1614 2 12.5141 2 12.8372 2.11401C12.9044 2.13772 12.9702 2.165 13.0345 2.19575C13.3436 2.34355 13.593 2.593 14.0919 3.09188L18.8284 7.82843C19.4065 8.40649 19.6955 8.69552 19.8478 9.06306C20 9.4306 20 9.83935 20 10.6569Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Hd=[["path",{d:"M8.85746 12.5061C6.36901 10.6456 4.59564 8.59915 3.62734 7.44867C3.3276 7.09253 3.22938 6.8319 3.17033 6.3728C2.96811 4.8008 2.86701 4.0148 3.32795 3.5074C3.7889 3 4.60404 3 6.23433 3H17.7657C19.396 3 20.2111 3 20.672 3.5074C21.133 4.0148 21.0319 4.8008 20.8297 6.37281C20.7706 6.83191 20.6724 7.09254 20.3726 7.44867C19.403 8.60062 17.6261 10.6507 15.1326 12.5135C14.907 12.6821 14.7583 12.9567 14.7307 13.2614C14.4837 15.992 14.2559 17.4876 14.1141 18.2442C13.8853 19.4657 12.1532 20.2006 11.226 20.8563C10.6741 21.2466 10.0043 20.782 9.93278 20.1778C9.79643 19.0261 9.53961 16.6864 9.25927 13.2614C9.23409 12.9539 9.08486 12.6761 8.85746 12.5061Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Wd=[["path",{d:"M13.6656 6.49446H16C18.8284 6.49446 20.2426 6.49446 21.1213 7.37314C22 8.25182 22 9.66603 22 12.4945V14.5C22 17.3284 22 18.7426 21.1213 19.6213C20.2426 20.5 18.8284 20.5 16 20.5H8C5.17157 20.5 3.75736 20.5 2.87868 19.6213C2 18.7426 2 17.3284 2 14.5V8.99183C2 6.65409 2 5.48521 2.61604 4.67881C2.7778 4.46706 2.96706 4.2778 3.17881 4.11604C3.98521 3.5 5.15409 3.5 7.49183 3.5C8.16633 3.5 8.50358 3.5 8.81392 3.60442C8.8976 3.63257 8.97932 3.66623 9.05854 3.70518C9.35239 3.84965 9.59179 4.08719 10.0706 4.56227L10.8483 5.33389C11.4254 5.9066 11.714 6.19295 12.08 6.3437C12.446 6.49446 12.8525 6.49446 13.6656 6.49446Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],jd=[["path",{d:"M7 19H13C15.8284 19 17.2426 19 18.1213 18.1213C19 17.2426 19 15.8284 19 13V10M19 10C19.7002 10 21.0085 11.9943 21.5 12.5M19 10C18.2998 10 16.9915 11.9943 16.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M5 7L5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"5",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["circle",{cx:"19",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["circle",{cx:"5",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"4"}]],_d=[["circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 12H3M15 12H21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Bd=[["path",{d:"M6 8C7.10457 8 8 7.10457 8 6C8 4.89543 7.10457 4 6 4C4.89543 4 4 4.89543 4 6C4 7.10457 4.89543 8 6 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 20C13.1046 20 14 19.1046 14 18C14 16.8954 13.1046 16 12 16C10.8954 16 10 16.8954 10 18C10 19.1046 10.8954 20 12 20Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M18 8C19.1046 8 20 7.10457 20 6C20 4.89543 19.1046 4 18 4C16.8954 4 16 4.89543 16 6C16 7.10457 16.8954 8 18 8Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M6.01734 8.74067C6.01734 10.4142 5.77537 12.1995 9.22051 11.9855H12.0053M17.9929 8.57617C18.1259 11.9855 16.9199 11.7648 15.7861 11.9855H12.0053M12.0053 15.7001V11.9855",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],Ud=[["path",{d:"M10 20.5675C6.57143 21.7248 3.71429 20.5675 2 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M10 22V18.7579C10 18.1596 10.1839 17.6396 10.4804 17.1699C10.6838 16.8476 10.5445 16.3904 10.1771 16.2894C7.13394 15.4528 5 14.1077 5 9.64606C5 8.48611 5.38005 7.39556 6.04811 6.4464C6.21437 6.21018 6.29749 6.09208 6.31748 5.9851C6.33746 5.87813 6.30272 5.73852 6.23322 5.45932C5.95038 4.32292 5.96871 3.11619 6.39322 2.02823C6.39322 2.02823 7.27042 1.74242 9.26698 2.98969C9.72282 3.27447 9.95075 3.41686 10.1515 3.44871C10.3522 3.48056 10.6206 3.41384 11.1573 3.28041C11.8913 3.09795 12.6476 3 13.5 3C14.3524 3 15.1087 3.09795 15.8427 3.28041C16.3794 3.41384 16.6478 3.48056 16.8485 3.44871C17.0493 3.41686 17.2772 3.27447 17.733 2.98969C19.7296 1.74242 20.6068 2.02823 20.6068 2.02823C21.0313 3.11619 21.0496 4.32292 20.7668 5.45932C20.6973 5.73852 20.6625 5.87813 20.6825 5.9851C20.7025 6.09207 20.7856 6.21019 20.9519 6.4464C21.6199 7.39556 22 8.48611 22 9.64606C22 14.1077 19.8661 15.4528 16.8229 16.2894C16.4555 16.3904 16.3162 16.8476 16.5196 17.1699C16.8161 17.6396 17 18.1596 17 18.7579V22",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],qd=[["circle",{cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M9.5 9.5C9.5 8.11929 10.6193 7 12 7C13.3807 7 14.5 8.11929 14.5 9.5C14.5 10.3569 14.0689 11.1131 13.4117 11.5636C12.7283 12.0319 12 12.6716 12 13.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M12.125 16.75H12M12.25 16.75C12.25 16.8881 12.1381 17 12 17C11.8619 17 11.75 16.8881 11.75 16.75C11.75 16.6119 11.8619 16.5 12 16.5C12.1381 16.5 12.25 16.6119 12.25 16.75Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],Gd=[["path",{d:"M9.89128 7.55559C9.34109 7.8715 7.89853 8.51654 8.77715 9.32371C9.20634 9.71801 9.68436 10 10.2853 10H13.7147C14.3156 10 14.7937 9.71801 15.2229 9.32371C16.1015 8.51654 14.6589 7.8715 14.1087 7.55559C12.8185 6.8148 11.1815 6.8148 9.89128 7.55559Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13.5 3.5C13.5 4.32843 12.8284 5 12 5C11.1716 5 10.5 4.32843 10.5 3.5C10.5 2.67157 11.1716 2 12 2C12.8284 2 13.5 2.67157 13.5 3.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M16.3913 19.5556C15.8411 19.8715 14.3985 20.5165 15.2771 21.3237C15.7063 21.718 16.1844 22 16.7853 22H20.2147C20.8156 22 21.2937 21.718 21.7229 21.3237C22.6015 20.5165 21.1589 19.8715 20.6087 19.5556C19.3185 18.8148 17.6815 18.8148 16.3913 19.5556Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M20 15.5C20 16.3284 19.3284 17 18.5 17C17.6716 17 17 16.3284 17 15.5C17 14.6716 17.6716 14 18.5 14C19.3284 14 20 14.6716 20 15.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"3"}],["path",{d:"M3.39128 19.5556C2.84109 19.8715 1.39853 20.5165 2.27715 21.3237C2.70634 21.718 3.18436 22 3.78534 22H7.21466C7.81564 22 8.29366 21.718 8.72285 21.3237C9.60147 20.5165 8.15891 19.8715 7.60872 19.5556C6.31854 18.8148 4.68146 18.8148 3.39128 19.5556Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7 15.5C7 16.3284 6.32843 17 5.5 17C4.67157 17 4 16.3284 4 15.5C4 14.6716 4.67157 14 5.5 14C6.32843 14 7 14.6716 7 15.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"5"}],["path",{d:"M12 13V15.5M12 15.5L14.5 17M12 15.5L9.5 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"6"}]],Yd=[["path",{d:"M14.5 7H9.5C6.21252 7 4.56878 7 3.46243 7.90796C3.25989 8.07418 3.07418 8.25989 2.90796 8.46243C2 9.56878 2 11.2125 2 14.5C2 17.7875 2 19.4312 2.90796 20.5376C3.07418 20.7401 3.25989 20.9258 3.46243 21.092C4.56878 22 6.21252 22 9.5 22H14.5C17.7875 22 19.4312 22 20.5376 21.092C20.7401 20.9258 20.9258 20.7401 21.092 20.5376C22 19.4312 22 17.7875 22 14.5C22 11.2125 22 9.56878 21.092 8.46243C20.9258 8.25989 20.7401 8.07418 20.5376 7.90796C19.4312 7 17.7875 7 14.5 7Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 7V5C12 4.44772 12.4477 4 13 4C13.5523 4 14 3.55228 14 3V2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M7 12L8 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M11.5 12L12.5 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M16 12L17 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7 17L17 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"5"}]],Kd=[["path",{d:"M12 3V6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M12 18V21",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 12L18 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M6 12L3 12",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"3"}],["path",{d:"M18.3635 5.63672L16.2422 7.75804",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"4"}],["path",{d:"M7.75804 16.2422L5.63672 18.3635",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"5"}],["path",{d:"M18.3635 18.3635L16.2422 16.2422",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"6"}],["path",{d:"M7.75804 7.75804L5.63672 5.63672",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"7"}]],Zd=[["path",{d:"M16.4964 9V6.5C16.4964 4.01472 14.4817 2 11.9964 2C9.51112 2 7.4964 4.01472 7.4964 6.5V9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M13.4958 9H10.4964C8.16158 9 6.99417 9 6.11049 9.47237C5.41275 9.84535 4.84128 10.4169 4.46837 11.1146C3.99608 11.9984 3.99619 13.1658 3.99641 15.5006C3.99662 17.835 3.99673 19.0023 4.46907 19.8858C4.84203 20.5835 5.41347 21.1548 6.11115 21.5277C6.99475 22 8.16197 22 10.4964 22H13.4958C15.8304 22 16.9978 22 17.8814 21.5277C18.5791 21.1548 19.1506 20.5833 19.5235 19.8856C19.9958 19.0019 19.9958 17.8346 19.9958 15.5C19.9958 13.1654 19.9958 11.9981 19.5235 11.1144C19.1506 10.4167 18.5791 9.84525 17.8814 9.47231C16.9978 9 15.8304 9 13.4958 9Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}],["circle",{cx:"11.9964",cy:"15.5",r:"2",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],zd=[["path",{d:"M21.9598 12.9919C21.6856 17.2342 18.3536 20.6134 14.1706 20.8915C13.4574 20.9389 12.7285 21.001 12 21.001C10.4054 21.001 8.95127 20.8637 7.44544 20.2902C7.44544 20.2902 5.56108 21.7589 3.69962 21.4587C3.31009 21.3959 3.11532 21.3644 3.00091 21.1343C2.8865 20.9042 3.00788 20.6756 3.25063 20.2185C3.65964 19.4483 3.92248 18.6737 3.80076 17.8306C3.73703 17.3892 3.50433 16.9974 3.27644 16.6136L3.26529 16.5948C2.62637 15.5188 2.12462 14.2975 2.04024 12.9919C1.98659 12.1617 1.98659 11.3019 2.04024 10.4717C2.31441 6.22935 5.64639 2.85011 9.8294 2.57205C11.2536 2.47738 12.7435 2.47719 14.1706 2.57205C18.3536 2.85011 21.6856 6.22935 21.9598 10.4717C22.0134 11.3019 22.0134 12.1617 21.9598 12.9919Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.75 14.501H15.25M8.75 9.50098H12.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],Jd=[["path",{d:"M13.5 15.5C13.5 14.5572 13.5 14.0858 13.7929 13.7929C14.0858 13.5 14.5572 13.5 15.5 13.5H20C20.9428 13.5 21.4142 13.5 21.7071 13.7929C22 14.0858 22 14.5572 22 15.5V20C22 20.9428 22 21.4142 21.7071 21.7071C21.4142 22 20.9428 22 20 22H15.5C14.5572 22 14.0858 22 13.7929 21.7071C13.5 21.4142 13.5 20.9428 13.5 20V15.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M2 4C2 3.05719 2 2.58579 2.29289 2.29289C2.58579 2 3.05719 2 4 2H8.5C9.44281 2 9.91421 2 10.2071 2.29289C10.5 2.58579 10.5 3.05719 10.5 4V8.5C10.5 9.44281 10.5 9.91421 10.2071 10.2071C9.91421 10.5 9.44281 10.5 8.5 10.5H4C3.05719 10.5 2.58579 10.5 2.29289 10.2071C2 9.91421 2 9.44281 2 8.5V4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M2 15.5C2 14.5572 2 14.0858 2.29289 13.7929C2.58579 13.5 3.05719 13.5 4 13.5H8.5C9.44281 13.5 9.91421 13.5 10.2071 13.7929C10.5 14.0858 10.5 14.5572 10.5 15.5V20C10.5 20.9428 10.5 21.4142 10.2071 21.7071C9.91421 22 9.44281 22 8.5 22H4C3.05719 22 2.58579 22 2.29289 21.7071C2 21.4142 2 20.9428 2 20V15.5Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M13.5 4C13.5 3.05719 13.5 2.58579 13.7929 2.29289C14.0858 2 14.5572 2 15.5 2H20C20.9428 2 21.4142 2 21.7071 2.29289C22 2.58579 22 3.05719 22 4V8.5C22 9.44281 22 9.91421 21.7071 10.2071C21.4142 10.5 20.9428 10.5 20 10.5H15.5C14.5572 10.5 14.0858 10.5 13.7929 10.2071C13.5 9.91421 13.5 9.44281 13.5 8.5V4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],Xd=[["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7C14.7614 7 17 9.23858 17 12Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M18.6461 4.52795C18.2489 4.89346 18 5.41766 18 6C18 7.10457 18.8954 8 20 8C20.3793 8 20.7339 7.89441 21.0361 7.71103C21.6139 7.36038 22 6.72527 22 6C22 4.89543 21.1046 4 20 4C19.4778 4 19.0023 4.20016 18.6461 4.52795ZM18.6461 4.52795C16.8794 2.95541 14.5513 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 11.6625 21.9833 11.3289 21.9506 11",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],Qd=[["path",{d:"M12 22C11.1818 22 10.4002 21.6698 8.83693 21.0095C4.94564 19.3657 3 18.5438 3 17.1613C3 16.7742 3 10.0645 3 7M12 22C12.8182 22 13.5998 21.6698 15.1631 21.0095C19.0544 19.3657 21 18.5438 21 17.1613V7M12 22L12 11.3548",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M8.32592 9.69138L5.40472 8.27785C3.80157 7.5021 3 7.11423 3 6.5C3 5.88577 3.80157 5.4979 5.40472 4.72215L8.32592 3.30862C10.1288 2.43621 11.0303 2 12 2C12.9697 2 13.8712 2.4362 15.6741 3.30862L18.5953 4.72215C20.1984 5.4979 21 5.88577 21 6.5C21 7.11423 20.1984 7.5021 18.5953 8.27785L15.6741 9.69138C13.8712 10.5638 12.9697 11 12 11C11.0303 11 10.1288 10.5638 8.32592 9.69138Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M6 12L8 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M17 4L7 9",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],eu=[["path",{d:"M13 3H11C7.22876 3 5.34315 3 4.17157 4.17157C3 5.34315 3 7.22876 3 11V13C3 16.7712 3 18.6569 4.17157 19.8284C5.34315 21 7.22876 21 11 21H13C16.7712 21 18.6569 21 19.8284 19.8284C21 18.6569 21 16.7712 21 13V11C21 7.22876 21 5.34315 19.8284 4.17157C18.6569 3 16.7712 3 13 3Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M15 3V21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],tu=[["path",{d:"M2.49219 12C2.49219 7.52166 2.49219 5.28249 3.88343 3.89124C5.27467 2.5 7.51384 2.5 11.9922 2.5C16.4705 2.5 18.7097 2.5 20.1009 3.89124C21.4922 5.28249 21.4922 7.52166 21.4922 12C21.4922 16.4783 21.4922 18.7175 20.1009 20.1088C18.7097 21.5 16.4705 21.5 11.9922 21.5C7.51384 21.5 5.27467 21.5 3.88343 20.1088C2.49219 18.7175 2.49219 16.4783 2.49219 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M2.49219 9H21.4922",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M7.99219 21.5V9",stroke:"currentColor",strokeWidth:"1.5",key:"2"}]],nu=[["path",{d:"M4 7C4 5.58579 4 4.87868 4.43934 4.43934C4.87868 4 5.58579 4 7 4C8.41421 4 9.12132 4 9.56066 4.43934C10 4.87868 10 5.58579 10 7V17C10 18.4142 10 19.1213 9.56066 19.5607C9.12132 20 8.41421 20 7 20C5.58579 20 4.87868 20 4.43934 19.5607C4 19.1213 4 18.4142 4 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M14 7C14 5.58579 14 4.87868 14.4393 4.43934C14.8787 4 15.5858 4 17 4C18.4142 4 19.1213 4 19.5607 4.43934C20 4.87868 20 5.58579 20 7V17C20 18.4142 20 19.1213 19.5607 19.5607C19.1213 20 18.4142 20 17 20C15.5858 20 14.8787 20 14.4393 19.5607C14 19.1213 14 18.4142 14 17V7Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}]],su=[["path",{d:"M18.8906 12.846C18.5371 14.189 16.8667 15.138 13.5257 17.0361C10.296 18.8709 8.6812 19.7884 7.37983 19.4196C6.8418 19.2671 6.35159 18.9776 5.95624 18.5787C5 17.6139 5 15.7426 5 12C5 8.2574 5 6.3861 5.95624 5.42132C6.35159 5.02245 6.8418 4.73288 7.37983 4.58042C8.6812 4.21165 10.296 5.12907 13.5257 6.96393C16.8667 8.86197 18.5371 9.811 18.8906 11.154C19.0365 11.7084 19.0365 12.2916 18.8906 12.846Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],Bi=[["path",{d:"M20.0092 2V5.13219C20.0092 5.42605 19.6418 5.55908 19.4537 5.33333C17.6226 3.2875 14.9617 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],ru=[["path",{d:"M17 17L21 21",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M19 11C19 6.58172 15.4183 3 11 3C6.58172 3 3 6.58172 3 11C3 15.4183 6.58172 19 11 19C15.4183 19 19 15.4183 19 11Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],ou=[["path",{d:"M15.5 12C15.5 13.933 13.933 15.5 12 15.5C10.067 15.5 8.5 13.933 8.5 12C8.5 10.067 10.067 8.5 12 8.5C13.933 8.5 15.5 10.067 15.5 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M21.011 14.0965C21.5329 13.9558 21.7939 13.8854 21.8969 13.7508C22 13.6163 22 13.3998 22 12.9669V11.0332C22 10.6003 22 10.3838 21.8969 10.2493C21.7938 10.1147 21.5329 10.0443 21.011 9.90358C19.0606 9.37759 17.8399 7.33851 18.3433 5.40087C18.4817 4.86799 18.5509 4.60156 18.4848 4.44529C18.4187 4.28902 18.2291 4.18134 17.8497 3.96596L16.125 2.98673C15.7528 2.77539 15.5667 2.66972 15.3997 2.69222C15.2326 2.71472 15.0442 2.90273 14.6672 3.27873C13.208 4.73448 10.7936 4.73442 9.33434 3.27864C8.95743 2.90263 8.76898 2.71463 8.60193 2.69212C8.43489 2.66962 8.24877 2.77529 7.87653 2.98663L6.15184 3.96587C5.77253 4.18123 5.58287 4.28891 5.51678 4.44515C5.45068 4.6014 5.51987 4.86787 5.65825 5.4008C6.16137 7.3385 4.93972 9.37763 2.98902 9.9036C2.46712 10.0443 2.20617 10.1147 2.10308 10.2492C2 10.3838 2 10.6003 2 11.0332V12.9669C2 13.3998 2 13.6163 2.10308 13.7508C2.20615 13.8854 2.46711 13.9558 2.98902 14.0965C4.9394 14.6225 6.16008 16.6616 5.65672 18.5992C5.51829 19.1321 5.44907 19.3985 5.51516 19.5548C5.58126 19.7111 5.77092 19.8188 6.15025 20.0341L7.87495 21.0134C8.24721 21.2247 8.43334 21.3304 8.6004 21.3079C8.76746 21.2854 8.95588 21.0973 9.33271 20.7213C10.7927 19.2644 13.2088 19.2643 14.6689 20.7212C15.0457 21.0973 15.2341 21.2853 15.4012 21.3078C15.5682 21.3303 15.7544 21.2246 16.1266 21.0133L17.8513 20.034C18.2307 19.8187 18.4204 19.711 18.4864 19.5547C18.5525 19.3984 18.4833 19.132 18.3448 18.5991C17.8412 16.6616 19.0609 14.6226 21.011 14.0965Z",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"1"}]],iu=[["path",{d:"M21 6.5C21 8.15685 19.6569 9.5 18 9.5C16.3431 9.5 15 8.15685 15 6.5C15 4.84315 16.3431 3.5 18 3.5C19.6569 3.5 21 4.84315 21 6.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"0"}],["path",{d:"M9 12C9 13.6569 7.65685 15 6 15C4.34315 15 3 13.6569 3 12C3 10.3431 4.34315 9 6 9C7.65685 9 9 10.3431 9 12Z",stroke:"currentColor",strokeWidth:"1.5",key:"1"}],["path",{d:"M21 17.5C21 19.1569 19.6569 20.5 18 20.5C16.3431 20.5 15 19.1569 15 17.5C15 15.8431 16.3431 14.5 18 14.5C19.6569 14.5 21 15.8431 21 17.5Z",stroke:"currentColor",strokeWidth:"1.5",key:"2"}],["path",{d:"M8.72852 10.7495L15.2285 7.75M8.72852 13.25L15.2285 16.2495",stroke:"currentColor",strokeWidth:"1.5",key:"3"}]],au=[["path",{d:"M15 2L15.5387 4.39157C15.9957 6.42015 17.5798 8.00431 19.6084 8.46127L22 9L19.6084 9.53873C17.5798 9.99569 15.9957 11.5798 15.5387 13.6084L15 16L14.4613 13.6084C14.0043 11.5798 12.4202 9.99569 10.3916 9.53873L8 9L10.3916 8.46127C12.4201 8.00431 14.0043 6.42015 14.4613 4.39158L15 2Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M7 12L7.38481 13.7083C7.71121 15.1572 8.84275 16.2888 10.2917 16.6152L12 17L10.2917 17.3848C8.84275 17.7112 7.71121 18.8427 7.38481 20.2917L7 22L6.61519 20.2917C6.28879 18.8427 5.15725 17.7112 3.70827 17.3848L2 17L3.70827 16.6152C5.15725 16.2888 6.28879 15.1573 6.61519 13.7083L7 12Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],cu=[["path",{d:"M15.1312 2.5C14.1462 2.17555 13.0936 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22C17.5228 22 22 17.5228 22 12C22 10.9548 21.8396 9.94704 21.5422 9",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 12C17 14.7614 14.7614 17 12 17C9.23858 17 7 14.7614 7 12C7 9.23858 9.23858 7 12 7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M19.5 4.5L12 12M19.5 4.5V2M19.5 4.5H22",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.5",key:"2"}]],lu=[["path",{d:"M5 14L8.5 17.5L19 6.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}]],du=[["path",{d:"M20 21.0001C19.713 17.269 16.7289 14.3151 12.995 14.0662L12 13.9999C11.6446 14.0096 11.3134 14.0225 11.0008 14.0378C7.3 14.2192 4.28417 17.3057 4 21.0001",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["circle",{cx:"12",cy:"6.99988",r:"4",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}]],uu=[["path",{d:"M14 14.8135V9.18646C14 6.04126 14 4.46866 13.0747 4.0773C12.1494 3.68593 11.0603 4.79793 8.88232 7.02192C7.75439 8.17365 7.11085 8.42869 5.50604 8.42869C4.10257 8.42869 3.40084 8.42869 2.89675 8.77262C1.85035 9.48655 2.00852 10.882 2.00852 12C2.00852 13.118 1.85035 14.5134 2.89675 15.2274C3.40084 15.5713 4.10257 15.5713 5.50604 15.5713C7.11085 15.5713 7.75439 15.8264 8.88232 16.9781C11.0603 19.2021 12.1494 20.3141 13.0747 19.9227C14 19.5313 14 17.9587 14 14.8135Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 9C17.6254 9.81968 18 10.8634 18 12C18 13.1366 17.6254 14.1803 17 15",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 7C21.2508 8.36613 22 10.1057 22 12C22 13.8943 21.2508 15.6339 20 17",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}]],hu=[["path",{d:"M22 22L2 2",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"0"}],["path",{d:"M17 10C17.6296 10.7667 18 11.7054 18 12.7195C18 13.1635 17.929 13.593 17.7963 14",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"1"}],["path",{d:"M20 8C21.2508 9.22951 22 10.7952 22 12.5C22 13.9164 21.4829 15.2367 20.5906 16.348",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"2"}],["path",{d:"M14 14C14 17.1452 14 19.5313 13.074 19.9227C12.1481 20.3141 11.0583 19.2021 8.8787 16.9781C7.7499 15.8264 7.106 15.5713 5.5 15.5713C4.3879 15.5713 3.02749 15.7187 2.33706 14.6643C2 14.1496 2 13.4331 2 12C2 10.5669 2 9.85038 2.33706 9.33566C3.02749 8.28131 4.3879 8.42869 5.5 8.42869C6.60725 8.42869 7.3569 8.43869 7.96 7.96M14 9.5C14 6.3548 14.026 4.46866 13.1 4.0773C12.3292 3.75147 11.5323 4.46765 10 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",key:"3"}]],fu={apple:bd,windows:Jd,github:Ud,search:ru,"chevron-down":wd,"chevron-left":Cd,"chevron-right":Sd,"arrow-down":kd,"arrow-left":Ed,"arrow-right":xd,"arrow-up-right":$d,bot:Ld,calendar:Id,x:Td,clock:Ad,coins:Od,terminal:Dd,copy:Pd,cpu:Rd,database:Vd,"dollar-sign":Nd,"file-code-2":Fd,"sliders-horizontal":Hd,folder:Wd,"git-branch":jd,"git-commit":_d,"git-fork":Bd,"circle-help":qd,network:Gd,keyboard:Yd,"loader-circle":Kd,lock:Zd,message:zd,orbit:Xd,box:Qd,"panel-right":eu,panels:tu,pause:nu,play:su,"refresh-cw":Bi,"rotate-ccw":Bi,"settings-2":ou,"share-2":iu,sparkles:au,crosshair:cu,"center-focus":Md,check:lu,user:du,"volume-2":uu,"volume-x":hu},lt=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]);function W(e,t=""){const n=fu[e].map(([s,r])=>`<${s}${Object.entries(r).filter(([o])=>o!=="key").map(([o,i])=>` ${o.replace(/[A-Z]/g,a=>`-${a.toLowerCase()}`)}="${lt(String(i))}"`).join("")}></${s}>`).join("");return`<svg class="ui-icon${t?` ${lt(t)}`:""}" viewBox="0 0 24 24" width="24" height="24" fill="none" aria-hidden="true" focusable="false">${n}</svg>`}function yo(e){const t=document.createElement("template");return t.innerHTML=W(e),t.content.firstElementChild}function pu(e,t="",n=!0){return`<details class="session-info graph-session-info"${n?" open":""}><summary>Session info ${W("chevron-down")}</summary><dl>
|
|
3
|
+
${e.map(([s,r,o])=>`<div><dt>${W(s)}${lt(r)}</dt><dd>${lt(o)}</dd></div>`).join("")}
|
|
4
|
+
</dl>${t}</details>`}function rt(e,t,n={},s=t,r=""){const o=Object.entries(n).flatMap(([i,a])=>a===!1?[]:[a===!0?i:`${i}="${lt(a)}"`]);return`<button type="button" class="graph-button${r?" graph-button-labeled":""}" aria-label="${lt(t)}" title="${lt(s)}" ${o.join(" ")}>${W(e)}${r?`<span>${lt(r)}</span>`:""}</button>`}const lc={search:["search","/","Search"],fit:["center-focus","F","Fit view"],panels:["panels","H","Panels"],clear:["x","Esc","Clear selection"]};function gu(e,t){return`<aside class="graph-shortcuts ${lt(t)}" aria-label="Keyboard shortcuts">${e.map(n=>{const[s,r,o]=lc[n];return`<span>${W(s)}<kbd>${r}</kbd>${o}</span>`}).join("")}</aside>`}function mu(e){return{glyph:e?"volume-x":"volume-2",label:e?"Unmute sound":"Mute sound"}}function yu(e,t,n=""){const s=t.map(r=>lc[r]);return`<dialog class="graph-help" id="${e}" aria-labelledby="${e}-title">${rt("x","Close help",{"data-close-help":!0})}<h2 id="${e}-title">Explore the map</h2>
|
|
5
|
+
<div class="graph-help-rows"><div><span>Orbit</span><kbd>Drag</kbd></div><div><span>Zoom</span><kbd>Scroll / pinch</kbd></div><div><span>Pan</span><kbd>Right-drag</kbd></div>
|
|
6
|
+
${s.map(([r,o,i])=>`<div><span>${W(r)}${i}</span><kbd>${o}</kbd></div>`).join("")}</div>
|
|
7
|
+
<p>Time runs left to right. Select a session to inspect its details, or click empty space to clear the selection.</p>${n}</dialog>`}const Ui=["#b0e9d6","#8eaff4","#d7a1f1","#eac594","#8cdbdf","#e7a3b8","#a8ca91"];function Pn(e){let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return t=Math.imul(t^t>>>16,2246822507),t=Math.imul(t^t>>>13,3266489909),t^=t>>>16,(t>>>0)/4294967295}function xt(e){return ts(e).split("/").at(-1)||"/"}const ts=e=>(/^(?:[a-z]:[\\/]|\\\\)/i.test(e)?e.replace(/\\/g,"/"):e).replace(/\/+$/,"")||(e.startsWith("/")?"/":""),vu=e=>e.directory?JSON.stringify(["directory",ts(e.directory)]):JSON.stringify(["project",e.source||"opencode",e.projectID||e.id]),Gt=e=>Math.max(e.created,e.activity?.lastMessageAt||e.created),vo=(e,t)=>{const n=t.timeFrame||t;return(e-n.start)/Math.max(1,n.end-n.start)*300-150},Xy=(e,t)=>vo(t.start+(t.end-t.start)*e,t),Jo=(e,t)=>[t,e.position[1],e.position[2]],bu=(e,t)=>Jo(e,Math.max(e.startPosition[0],Math.min(t,e.position[0]))),Qy=(e,t,n,s=0,r=[1,0,0])=>{const o=bu(e,t);return[o[0]+r[0]*(n+s),o[1]+r[1]*(n+s),o[2]+r[2]*(n+s)]},ev=(e,t)=>[Jo(e,Math.max(e.startPosition[0],Math.min(t.startPosition[0],e.position[0]))),t.startPosition];function dc(e,t,n,s){if(!e.length)return{nodes:[],edges:[],lanes:[],start:0,end:0};const r=w=>{if(!s)return vu(w);const S=s==="repository"?w.checkout?.repository:w.checkout?.worktree;return S?JSON.stringify([s,S]):w.directory?JSON.stringify(["directory",ts(w.directory)]):JSON.stringify([s,null])},o=[...e].sort((w,S)=>w.created-S.created||w.id.localeCompare(S.id)),i=o[0].created,a=o.reduce((w,S)=>Math.max(w,Gt(S)),i+36e5),c=n?.nodes.length?n.timeFrame||{start:n.start,end:n.end}:{start:i,end:a},l=new Map;for(const w of o){const S=r(w),b=l.get(S)||[];b.push(w),l.set(S,b)}const h=[...l].sort((w,S)=>S[1].length-w[1].length||w[0].localeCompare(S[0])),u=new Map(n?.lanes.map((w,S)=>[w.key,w.slot??S]));let g=Math.max(-1,...u.values())+1;for(const[w]of h)u.has(w)||u.set(w,g++);h.sort((w,S)=>u.get(w[0])-u.get(S[0]));const p=[],f=[],d=new Set(t.flatMap(w=>w.worktrees.map(ts)));h.forEach(([w,S])=>{const b=u.get(w),E=b*2.399963,C=b===0?0:15+Math.sqrt(b)*14,x=Math.cos(E)*C,y=Math.sin(E)*C*.7,M=Ui[b%Ui.length],D=t.find(F=>F.id===S[0].projectID),H=S[0].directory,P={key:w,slot:b,color:M,label:s==="repository"?S[0].checkout?.repositoryLabel||(H?xt(H):"Unknown repository"):s==="worktree"?S[0].checkout?xt(S[0].checkout.worktree):H?xt(H):"Unknown worktree":H?xt(H):D?.name||S[0].projectID||"Unknown directory",kind:s==="worktree"&&S[0].checkout||!s&&H&&d.has(ts(H))?"worktree":"directory",y:x,z:y,nodes:[]};for(const F of S){const B=vo(Gt(F),c),j=vo(F.created,c),q=Pn(F.id),Ie=!!(F.parentID||F.forkID)?12:6,Nt=Math.sin((j+150)/65+b*.7)*3.5,je=typeof F.tokens=="number"&&Number.isFinite(F.tokens)?Math.max(0,F.tokens):0,Ae={session:F,position:[B,x+Nt+(q-.5)*Ie,y+(Pn(F.id+"z")-.5)*Ie],startPosition:[j,0,0],color:M,radius:.35+Math.min(1.05,Math.cbrt(je/1e5)*.3)};f.push(Ae),P.nodes.push(Ae)}p.push(P)});const m=new Set(o.map(w=>w.id)),v=[];for(const w of o)w.forkID&&m.has(w.forkID)?v.push({from:w.forkID,to:w.id,kind:"fork"}):w.parentID&&m.has(w.parentID)&&v.push({from:w.parentID,to:w.id,kind:"child"});const k=new Map(f.map(w=>[w.session.id,w])),L=new Set;for(const w of n?.lanes||[])for(const S of w.nodes){const b=k.get(S.session.id);b&&r(b.session)===w.key&&(b.position[1]=S.position[1],b.position[2]=S.position[2],L.add(b.session.id))}function O(w){const S=[],b=new Set;let E=w;for(;E&&!L.has(E.session.id)&&!b.has(E.session.id);){b.add(E.session.id);const C=E.session.forkID||E.session.parentID,x=C?k.get(C):void 0,y=x&&r(x.session)===r(E.session)?x:void 0;S.push({node:E,parent:y}),E=y}for(const{node:C,parent:x}of S.reverse()){const y=C.session.id;if(x){const M=Pn(y+"branch")>.5?1:-1;C.position[1]=x.position[1]+M*(9+Pn(y)*15),C.position[2]=x.position[2]+(Pn(y+"depth")-.5)*18}L.add(y)}}return o.forEach(w=>O(k.get(w.id))),f.forEach(w=>{w.startPosition=Jo(w,w.startPosition[0])}),{nodes:f,edges:v,lanes:p,start:i,end:a,timeFrame:c}}const wu=2,qi=e=>JSON.stringify([wu,e.importVersion,e.revision,e.updated,e.created,e.projectID,e.directory]),yn=e=>e.normalize("NFKD").replace(new RegExp("\\p{M}","gu"),"").toLowerCase(),Xo=e=>yn(e).match(/[\p{L}\p{N}]+/gu)||[],ku=e=>Xo(e).join(" ");function Cu(e){const t={text:"",terms:[],phrases:[],filters:[]},n=[];for(const s of e.slice(0,300).match(/(?:[^\s"]+|"[^"]*")+/g)||[]){const r=/^(source|project|dir|model|is|after|before|in):(.+)$/i.exec(s);if(r){const i=r[1].toLowerCase(),a=yn(r[2].replace(/^"|"$/g,""));if(i==="in"){const c={title:["title"],files:["files"],messages:["body"],tools:["tools"]};t.fields=c[a],t.fields||(t.error="Use in:title, in:files, in:messages, or in:tools.")}else i==="is"&&!["fork","child","root","archived"].includes(a)?t.error="Use is:fork, is:child, is:root, or is:archived.":["after","before"].includes(i)&&(!/^\d{4}-\d{2}-\d{2}$/.test(a)||!Number.isFinite(Date.parse(a))||new Date(a).toISOString().slice(0,10)!==a)?t.error="Use a valid date in YYYY-MM-DD format.":t.filters.push([i,a]);continue}const o=s.replace(/^"|"$/g,"");s.startsWith('"')&&s.endsWith('"')&&t.phrases.push(ku(o)),n.push(o)}return t.text=n.join(" "),t.terms=Xo(t.text).slice(0,12),t.text=t.terms.join(" "),t}function Eu(e,t,n=220){const s=yn(e),r=t.reduce((i,a)=>{const c=s.indexOf(a);return c<0?i:Math.min(i,c)},1/0),o=Number.isFinite(r)?Math.max(0,r-55):0;return`${o?"…":""}${e.slice(o,o+n).replace(/\s+/g," ").trim()}${e.length>o+n?"…":""}`}const yr={opencode:{name:"OpenCode",icon:"opencode"},"claude-code":{name:"Claude Code",icon:"claude"},codex:{name:"Codex",icon:"openai"},"t3-code":{name:"T3 Code",icon:"t3"},cursor:{name:"Cursor",icon:"cursor"},gemini:{name:"Gemini CLI",icon:"gemini"},"qwen-code":{name:"Qwen Code",icon:"qwen"},pi:{name:"Pi",icon:"pi"},copilot:{name:"GitHub Copilot CLI",icon:"copilot"},"copilot-chat":{name:"GitHub Copilot Chat (VS Code)",icon:"copilot"},cline:{name:"Cline",icon:"cline"},"roo-code":{name:"Roo Code",icon:"roo"},"kilo-code":{name:"Kilo Code",icon:"kilo"},continue:{name:"Continue",icon:"continue"},"prime-agent":{name:"Prime Agent",icon:"prime"},omp:{name:"Oh My Pi",icon:"pi"},senpi:{name:"Senpi / OmO Native",icon:"senpi"},kimchi:{name:"Kimchi",icon:"kimchi"},gajae:{name:"Gajae-Code",icon:"gajae"},openclaw:{name:"OpenClaw",icon:"openclaw"},hermes:{name:"Hermes Agent",icon:"hermes"},amp:{name:"Amp",icon:"amp"},droid:{name:"Factory Droid",icon:"droid"},codebuff:{name:"Codebuff",icon:"codebuff"},freebuff:{name:"Freebuff",icon:"freebuff"},kimi:{name:"Kimi CLI / Code",icon:"kimi"},grok:{name:"Grok Build",icon:"grok"},jcode:{name:"Jcode",icon:"jcode"},"cherry-studio":{name:"Cherry Studio",icon:"cherry"},"command-code":{name:"Command Code",icon:"commandcode"},zcode:{name:"ZCode",icon:"zcode"},codebuddy:{name:"CodeBuddy",icon:"codebuddy"},workbuddy:{name:"WorkBuddy",icon:"codebuddy"},proma:{name:"Proma",icon:"proma"},"deepseek-harness":{name:"DeepSeek Harness",icon:"deepseek"},aside:{name:"Aside",icon:"aside"},vibe:{name:"Mistral Vibe",icon:"mistral"},muse:{name:"Muse Code",icon:"muse"},junie:{name:"Junie",icon:"junie"},augment:{name:"Augment Code",icon:"augment"},fx:{name:"Fx",icon:"fx"},"minimax-code":{name:"MiniMax Code",icon:"minimax"},opencodereview:{name:"OpenCodeReview",icon:"opencode"},goose:{name:"Goose",icon:"goose"},zed:{name:"Zed Agent",icon:"zed"},devin:{name:"Devin CLI",icon:"devin"},"devin-desktop":{name:"Devin Desktop",icon:"devin"},crush:{name:"Crush",icon:"crush"},octofriend:{name:"Octofriend",icon:"octofriend"},"kilo-cli":{name:"Kilo CLI",icon:"kilo"},"mimo-code":{name:"MiMo Code",icon:"mimo"},"mimo-desktop":{name:"Xiaomi MiMo AI",icon:"mimo"},unsloth:{name:"Unsloth Studio",icon:"unsloth"},kiro:{name:"Kiro",icon:"kiro"},mux:{name:"Mux",icon:"mux"},antigravity:{name:"Antigravity",icon:"antigravity"},"antigravity-cli":{name:"Antigravity CLI",icon:"antigravity"},"antigravity-extension":{name:"Antigravity IDE Extension",icon:"antigravity"}},Ne=e=>yr[e||"opencode"]?.name||e||"Unknown",Su=e=>typeof e=="string"&&Object.hasOwn(yr,e),vn=e=>{const t=yr[e||""]?.icon||"generic";return`<span class="source-icon source-icon-${t}" aria-hidden="true" style="--source-icon:url('/sources/${t}.svg')"></span>`};function xu(e,t="/sources"){const n=yr[e||""]?.icon||"generic",s=document.createElement("span");return s.className=`source-icon source-icon-${n}`,s.setAttribute("aria-hidden","true"),s.style.setProperty("--source-icon",`url('${t}/${n}.svg')`),s}const uc=e=>[...e].sort((t,n)=>Number(n.selected||n.available||n.sessions>0)-Number(t.selected||t.available||t.sessions>0)||t.name.localeCompare(n.name)),Ht=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]);function hc(e,{checked:t=e.selected,disabled:n=!1,settings:s=!1}={}){const r=e.available?"Detected":"Not detected",o=e.capabilities.history?"":"Metadata only",i=[e.description,e.lastImport?`Last import ${new Date(e.lastImport).toLocaleString()}`:"Not imported yet",e.error].filter(Boolean).join(" · ");return`<label class="import-source" data-source="${Ht(e.id)}" title="${Ht(i)}"><input ${s?'class="settings-source"':""} type="checkbox" value="${Ht(e.id)}" aria-label="${Ht(e.name)}" aria-description="${Ht(`${r}. ${e.sessions.toLocaleString()} saved sessions. ${i}`)}" ${t?"checked":""} ${n?"disabled":""}/><span class="source-symbol">${vn(e.id)}</span><span class="source-copy"><strong>${Ht(e.name)}</strong><small class="source-meta"><span class="source-detected ${e.available?"detected":""}">${r}</span><span>${e.sessions.toLocaleString()} saved</span>${o?`<span>${o}</span>`:""}</small>${e.error?`<small class="source-error">${Ht(e.error)}</small>`:""}</span></label>`}const De=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]);function Rn(e,t){const n=new Set(t.map(yn));let s=0,r="";for(const o of e.matchAll(/[\p{L}\p{N}]+/gu)){r+=De(e.slice(s,o.index));const i=yn(o[0]),a=[...n].some(c=>i.startsWith(c));r+=a?`<mark>${De(o[0])}</mark>`:De(o[0]),s=o.index+o[0].length}return r+De(e.slice(s))}function $u(e,t=()=>{},n){const s=new Worker(new URL("/assets/worker-B9mWJfQ6.js",import.meta.url),{type:"module"}),r=new AbortController,o={signal:r.signal},i=document.createElement("dialog");i.className="search-dialog",i.setAttribute("aria-label","Search sessions"),i.innerHTML=`
|
|
8
|
+
<div class="search-command"><span class="search-command-icon" aria-hidden="true">${W("search")}</span><input id="session-query" type="search" placeholder="Search sessions, messages, files…" autocomplete="off" spellcheck="false" role="combobox" aria-label="Search all sessions" aria-autocomplete="list" aria-expanded="true" aria-controls="search-results"/><button class="icon-button search-close" aria-label="Close search" title="Close (Esc)">${W("x")}</button></div>
|
|
9
|
+
<div class="search-options"><select id="search-scope" aria-label="Search scope" title="Switch scope (Alt+S)"><option value="all">All history</option><option value="view">Current view</option></select><button id="search-conversations" class="search-chip" aria-label="Index conversations" aria-pressed="true" title="Pause or resume background indexing. Indexed messages, tools, and files remain searchable.">Conversations</button><span id="search-index-state" role="status">Loading index…</span></div>
|
|
10
|
+
<div class="search-body"><div id="search-results" class="search-results" role="listbox" aria-label="Matching sessions"><div class="search-results-inner"></div></div><aside id="search-preview" class="search-preview" aria-label="Session preview"></aside></div>
|
|
11
|
+
<div class="search-footer"><span id="search-result-status" role="status">Loading sessions…</span><button id="search-more" hidden>More results</button><details class="search-syntax"><summary title="Search filters and cache">Filters</summary><div><code>project:sessiongraph</code><code>model:claude</code><code>in:files package.json</code><code>is:fork</code><code>after:2026-09-01</code><code>"exact phrase"</code><button id="search-clear-cache" title="Clear saved search text and pause indexing. Titles remain searchable; enable Conversations to rebuild.">Clear saved index</button></div></details><span class="search-keys"><kbd>↑↓</kbd> navigate <kbd>↵</kbd> open</span></div>`,document.body.append(i);const a=N=>i.querySelector(N),c=a("#session-query"),l=a("#search-results"),h=a(".search-results-inner"),u=a("#search-preview"),g=a("#search-scope");let p=new Map,f=new Map,d,m=[],v=0,k=0,L=0,O=80,w=0,S=0,b=0,E=!1,C=!1,x=!0,y,M=null,D,H=0,P="",F="",B=!1;const j=new Map,q=86,Ce=new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}),Ie=new Map;let Nt,je=0;const Ae=N=>s.postMessage(N);function Dn(){if(!y)return;const N=a("#search-index-state");N.textContent=y.storage==="restoring"?"Restoring saved index…":y.complete===y.total&&y.total?`Conversations ready${y.storage==="local"?" · saved locally":""}`:`${y.indexed.toLocaleString()} / ${y.total.toLocaleString()} conversations${x?y.active?" · indexing":" · partial":" · paused"}`,N.title=`Titles and metadata cover all ${y.total.toLocaleString()} imported sessions. ${y.complete.toLocaleString()} conversations have all supported text indexed. ${y.failed?`${y.failed} unavailable; toggle Conversations to retry. `:""}${y.limited?"Large histories are sampled; missing matches may be in unindexed text. ":""}${y.storage==="memory"?"Saving unavailable; search continues in memory.":`Saved in local SQLite. ${y.restored.toLocaleString()} conversations restored; unchanged pages are reused. Clear saved index under Filters. Imported sessions remain saved.`}`}function _e(){if(cancelAnimationFrame(je),je=0,Nt!==m&&(Ie.clear(),h.replaceChildren(),Nt=m),h.style.height=`${m.length*q}px`,!m.length){h.innerHTML=`<div class="search-empty">${De(F||(E?"Searching…":c.value?"No matching sessions":"No sessions available"))}</div>`,c.removeAttribute("aria-activedescendant");return}const N=Math.max(0,Math.floor(l.scrollTop/q)-3),_=Math.min(m.length,N+Math.ceil(l.clientHeight/q)+7);for(const[K,te]of Ie)(K<N||K>=_)&&(te.remove(),Ie.delete(K));for(let K=N;K<_;K++){let te=Ie.get(K);if(!te){const ne=m[K],oe=p.get(ne.id);if(!oe)continue;const Be=`${Ne(oe.source)} · ${f.get(oe.projectID)||oe.directory.split("/").at(-1)||"Global"} · ${Ce.format(oe.updated)}`,Ge=document.createElement("template");Ge.innerHTML=`<div id="search-hit-${K}" class="search-result" role="option" aria-posinset="${K+1}" aria-setsize="${k}" data-result-index="${K}" style="top:${K*q}px"><div class="search-result-title">${Rn(oe.title,ne.terms)}</div><div class="search-result-meta"><span>${vn(oe.source)}${De(Be)}</span><span class="match-kind">${De(ne.source)}</span></div>${ne.excerpt?`<div class="search-result-excerpt">${Rn(ne.excerpt,ne.terms)}</div>`:`<div class="search-result-excerpt">${De(oe.model)}</div>`}</div>`,te=Ge.content.firstElementChild,Ie.set(K,te);const ve=[...Ie.keys()].filter(Ye=>Ye>K).sort((Ye,nn)=>Ye-nn)[0];h.insertBefore(te,Ie.get(ve)??null)}const ae=String(K===v);te.getAttribute("aria-selected")!==ae&&(te.classList.toggle("active",K===v),te.setAttribute("aria-selected",ae))}v>=N&&v<_?c.setAttribute("aria-activedescendant",`search-hit-${v}`):c.removeAttribute("aria-activedescendant")}function Ft(){je||(je=requestAnimationFrame(_e))}function tt(N,_=!1,K=!1){const te=m[v],ae=te&&p.get(te.id);if(!ae){u.innerHTML="";return}const ne=te.terms.length?te.terms:Xo(Cu(c.value).text),oe=N?.fragments.filter(ve=>{const Ye=yn(ve.text);return ne.length&&ne.every(nn=>Ye.includes(nn))}).slice(0,4)||[],Be=N?.fragments.filter(ve=>["You","Assistant"].includes(ve.kind)).slice(0,5).reverse()||[],Ge=oe.length?oe:Be;if(u.innerHTML=`<div class="search-preview-heading"><span>${De(f.get(ae.projectID)||"Session")}</span><h2>${Rn(ae.title,ne)}</h2><p>${De(ae.model)} · ${new Date(ae.created).toLocaleDateString()}</p><button class="secondary-button search-open">Explore session <span aria-hidden="true">↗</span></button></div>${te.excerpt?`<section class="search-preview-section"><h3>Matching passage</h3><p>${Rn(te.excerpt,ne)}</p></section>`:""}<section class="search-preview-section"><h3>${oe.length?"Matching context":"Recent conversation"}</h3>${_?'<p class="preview-loading">Loading preview…</p>':K?'<p>Preview unavailable.</p><button class="text-button preview-retry">Retry</button>':Ge.length?Ge.map(ve=>`<article><span>${De(ve.kind)}</span><p>${Rn(Eu(ve.text,ne,360),ne)}</p></article>`).join(""):"<p>No conversation text in this batch.</p>"}${N&&(N.nextCursor||N.truncated)?'<p class="preview-coverage">Recent messages · partial preview</p>':""}</section>`,u.querySelector(".search-open")?.addEventListener("click",z,o),n){const ve=document.createElement("button");ve.className="text-button search-launch",ve.innerHTML=`${vn(ae.source)}Open in ${De(Ne(ae.source))}${W("arrow-up-right")}`,ve.addEventListener("click",()=>n(ae),o),u.querySelector(".search-preview-heading")?.append(ve)}u.querySelector(".preview-retry")?.addEventListener("click",()=>{P="",tn()},o)}function tn(){const N=m[v],_=N&&p.get(N.id),K=_?`${_.id}:${qi(_)}:${c.value}`:"";if(K===P)return;if(P=K,window.clearTimeout(H),D?.abort(),!_){tt();return}const te=`${_.id}:${qi(_)}`,ae=j.get(te);if(ae){tt(ae);return}tt(void 0,!0),H=window.setTimeout(async()=>{const ne=new AbortController;D=ne;try{const oe=await fetch(`/api/sessiongraph/session/${encodeURIComponent(_.id)}/content?updated=${_.updated}`,{signal:ne.signal});if(!oe.ok)throw new Error("Preview unavailable");const Be=await oe.json();if(ne.signal.aborted||K!==P)return;j.size>=25&&j.delete(j.keys().next().value),j.set(te,Be),tt(Be)}catch{!ne.signal.aborted&&K===P&&tt(void 0,!1,!0)}},90)}function A(){cancelAnimationFrame(w),E=!0,c.setAttribute("aria-busy","true");const N=++L;S=performance.now(),w=requestAnimationFrame(()=>Ae({type:"query",request:N,text:c.value,viewOnly:g.value==="view",limit:O}))}function $(){v=0,B=!1,O=80,l.scrollTop=0,P="",A()}function T(N){if(!m.length)return;B=!0,v=Math.max(0,Math.min(m.length-1,v+N));const _=v*q;_<l.scrollTop?l.scrollTop=_:_+q>l.scrollTop+l.clientHeight&&(l.scrollTop=_+q-l.clientHeight),_e(),tn()}function R(){i.close(),t(!1),D?.abort(),window.clearTimeout(H),P="",M?.focus({preventScroll:!0})}function z(){const N=m[v];!N||E||(R(),e(N.id))}function de(){i.open||(M=document.activeElement,i.showModal()),t(!0),c.focus({preventScroll:!0}),c.select(),A(),x&&Ae({type:"warm",enabled:!0})}s.onmessage=N=>{const _=N.data;if(_.type==="status"){y=_.status,Dn();return}if(_.type==="error"){F=_.message,E=!1,c.setAttribute("aria-busy","false"),_e();return}if(_.request!==L)return;const K=m[v]?.id;b=E?performance.now()-S:b,E=!1,c.setAttribute("aria-busy","false"),m=_.hits,k=_.total,F=_.error||"",v=Math.max(0,Math.min(m.length-1,B&&K?m.findIndex(te=>te.id===K):0)),a("#search-result-status").textContent=F||`${k.toLocaleString()} ${c.value?"matches":"sessions"} · ${Math.round(_.elapsed)} ms`,a("#search-more").hidden=m.length>=k||O>=250,i.open&&(_e(),tn())},s.onerror=()=>{F="Search could not start. Reload to retry.",E=!1,_e()},c.addEventListener("input",()=>{C||$()},o),c.addEventListener("compositionstart",()=>{C=!0},o),c.addEventListener("compositionend",()=>{C=!1,$()},o),g.addEventListener("change",$,o),l.addEventListener("scroll",Ft,{...o,passive:!0}),l.addEventListener("click",N=>{const _=N.target.closest("[data-result-index]");_&&(v=Number(_.dataset.resultIndex),B=!0,_e(),tn(),c.focus())},o),l.addEventListener("dblclick",z,o),a("#search-more").addEventListener("click",()=>{O=Math.min(250,O+80),A()},o),a("#search-conversations").addEventListener("click",()=>{x=!x,a("#search-conversations").setAttribute("aria-pressed",String(x)),Ae({type:"warm",enabled:x}),Dn()},o),a("#search-clear-cache").addEventListener("click",()=>{x=!1,a("#search-conversations").setAttribute("aria-pressed","false"),j.clear(),P="",D?.abort(),window.clearTimeout(H),a(".search-syntax").open=!1,Ae({type:"clear-cache"}),c.focus()},o),a(".search-close").addEventListener("click",R,o),i.addEventListener("cancel",N=>{N.preventDefault(),R()},o),i.addEventListener("keydown",N=>{N.stopPropagation(),!(C||N.isComposing)&&((N.key==="ArrowDown"||N.key==="ArrowUp")&&(N.preventDefault(),T(N.key==="ArrowDown"?1:-1)),(N.key==="PageDown"||N.key==="PageUp")&&(N.preventDefault(),T((N.key==="PageDown"?1:-1)*Math.max(1,Math.floor(l.clientHeight/q)))),N.key==="Enter"&&N.target===c&&(N.preventDefault(),z()),N.key==="Escape"&&(N.preventDefault(),R()),N.key.toLowerCase()==="s"&&N.altKey&&(N.preventDefault(),g.value=g.value==="view"?"all":"view",g.dispatchEvent(new Event("change",{bubbles:!0}))))},o),document.addEventListener("keydown",N=>{if(i.open||document.querySelector("dialog[open]"))return;const _=N.target,K=_.isContentEditable||_.closest('input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), textarea, select');(N.key==="/"&&!K&&!N.ctrlKey&&!N.metaKey&&!N.altKey||N.key.toLowerCase()==="k"&&(N.metaKey||N.ctrlKey))&&(N.preventDefault(),de())},o);const ue=new ResizeObserver(()=>{i.open&&Ft()});return ue.observe(l),{open:de,setData(N){d!==N.sourceID&&(j.clear(),P="",D?.abort(),window.clearTimeout(H)),d=N.sourceID,p=new Map(N.sessions.map(_=>[_.id,_])),f=new Map(N.projects.map(_=>[_.id,_.name])),Nt=void 0,Ae({type:"data",sessions:N.sessions,projects:N.projects,sourceID:d})},setScope(N){Ae({type:"scope",ids:N})},diagnostics:()=>({open:i.open,query:c.value,matches:k,renderedRows:h.querySelectorAll('[role="option"]').length,roundTripMs:b,pending:E,index:y}),dispose(){s.terminate(),r.abort(),ue.disconnect(),D?.abort(),window.clearTimeout(H),cancelAnimationFrame(w),cancelAnimationFrame(je),i.remove()}}}class Fr{values;tree;constructor(t){this.values=Float64Array.from(t),this.tree=new Float64Array(t.length+1);for(let n=1;n<this.tree.length;n++){this.tree[n]+=this.values[n-1];const s=n+(n&-n);s<this.tree.length&&(this.tree[s]+=this.tree[n])}}get length(){return this.values.length}offset(t){let n=0;for(let s=Math.min(t,this.length);s>0;s-=s&-s)n+=this.tree[s];return n}set(t,n){const s=n-this.values[t];if(Math.abs(s)<.1)return!1;this.values[t]=n;for(let r=t+1;r<this.tree.length;r+=r&-r)this.tree[r]+=s;return!0}indexAt(t){let n=0,s=0;for(let r=2**Math.floor(Math.log2(this.length||1));r;r=Math.floor(r/2)){const o=n+r;o<=this.length&&s+this.tree[o]<=t&&(n=o,s+=this.tree[o])}return Math.min(n,Math.max(0,this.length-1))}}class Lu{constructor(t,n){this.viewport=t,this.options=n,this.content.className="virtual-list-content",this.content.style.cssText="position:relative;overflow-anchor:none",t.replaceChildren(this.content),t.addEventListener("scroll",this.schedule,{passive:!0,signal:this.events.signal}),t.addEventListener("focusout",this.schedule,{signal:this.events.signal}),this.observer=new ResizeObserver(()=>{const s=t.clientWidth;s&&this.width&&s!==this.width&&this.resetHeights(),s&&(this.width=s),this.schedule()}),this.observer.observe(t)}viewport;options;items=[];heights=new Fr([]);sizes=new Map;mounted=new Map;content=document.createElement("div");observer;frame=0;width=0;pendingIndex;events=new AbortController;setItems(t,n=!1){const s=this.heights.indexAt(this.viewport.scrollTop),r=this.items[s]===void 0?void 0:this.options.key(this.items[s]),o=this.viewport.scrollTop-this.heights.offset(s);if(this.clearRows(),this.content.parentElement!==this.viewport&&this.viewport.replaceChildren(this.content),!n)this.sizes.clear();else{const i=new Set(t.map(this.options.key));for(const a of this.sizes.keys())i.has(a)||this.sizes.delete(a)}if(this.items=t,this.heights=new Fr(t.map(i=>this.sizes.get(this.options.key(i))??this.options.estimate(i))),this.pendingIndex=void 0,this.content.style.height=`${this.heights.offset(t.length)}px`,!n)this.viewport.scrollTop=0;else if(r!==void 0){const i=t.findIndex(a=>this.options.key(a)===r);i>=0&&(this.viewport.scrollTop=this.heights.offset(i)+o)}this.render()}getElement(t){return this.mounted.get(t)?.element}scrollToIndex(t){t<0||t>=this.items.length||(this.pendingIndex=t,this.render())}resetHeights(){const t=this.heights.indexAt(this.viewport.scrollTop),n=this.viewport.scrollTop-this.heights.offset(t);this.sizes.clear(),this.heights=new Fr(this.items.map(this.options.estimate)),this.content.style.height=`${this.heights.offset(this.items.length)}px`,this.viewport.scrollTop=this.heights.offset(t)+n,this.schedule()}schedule=()=>{this.frame||(this.frame=requestAnimationFrame(()=>{this.frame=0,this.render()}))};reveal(t){const n=this.heights.offset(t),s=this.heights.offset(t+1);n<this.viewport.scrollTop?this.viewport.scrollTop=n:s>this.viewport.scrollTop+this.viewport.clientHeight&&(this.viewport.scrollTop=s-this.viewport.clientHeight)}render(){if(this.content.style.height=`${this.heights.offset(this.items.length)}px`,!this.items.length||!this.viewport.clientHeight)return;this.pendingIndex!==void 0&&this.reveal(this.pendingIndex);const t=this.viewport.scrollTop,n=this.heights.indexAt(t),s=this.options.overscan??4,r=Math.max(0,n-s),o=Math.min(this.items.length,this.heights.indexAt(t+this.viewport.clientHeight)+s+1);for(const[l,h]of this.mounted)(l<r||l>=o)&&!h.wrapper.contains(document.activeElement)&&(this.observer.unobserve(h.wrapper),h.wrapper.remove(),this.mounted.delete(l));for(let l=r;l<o;l++)if(!this.mounted.has(l)){const h=this.options.render(this.items[l],l),u=document.createElement("div");u.style.cssText="position:absolute;top:0;left:0;width:100%;display:flow-root",u.className="virtual-list-row",u.append(h),this.mounted.set(l,{wrapper:u,element:h});const g=[...this.mounted.keys()].filter(p=>p>l).sort((p,f)=>p-f)[0];this.content.insertBefore(u,this.mounted.get(g)?.wrapper??null),this.observer.observe(u)}const i=[...this.mounted].map(([l,h])=>[l,h.wrapper.getBoundingClientRect().height]),a=this.heights.offset(n);let c=!1;for(const[l,h]of i)h>0&&(this.sizes.set(this.options.key(this.items[l]),h),c=this.heights.set(l,h)||c);for(const[l,h]of this.mounted){const u=`translateY(${this.heights.offset(l)}px)`;h.wrapper.style.transform!==u&&(h.wrapper.style.transform=u)}this.content.style.height=`${this.heights.offset(this.items.length)}px`,c&&(this.viewport.scrollTop+=this.heights.offset(n)-a),this.pendingIndex!==void 0&&(this.reveal(this.pendingIndex),this.pendingIndex=void 0),c&&this.schedule()}clearRows(){for(const t of this.mounted.values())this.observer.unobserve(t.wrapper);this.mounted.clear(),this.content.replaceChildren()}dispose(){cancelAnimationFrame(this.frame),this.events.abort(),this.observer.disconnect(),this.content.remove()}}const Yn=[{id:"opencode",name:"OpenCode",command:"opencode"},{id:"claude-code",name:"Claude Code",command:"claude"},{id:"codex",name:"Codex",command:"codex"},{id:"cursor",name:"Cursor Agent",command:"cursor-agent"},{id:"gemini",name:"Gemini CLI",command:"gemini"},{id:"qwen-code",name:"Qwen Code",command:"qwen"},{id:"pi",name:"Pi",command:"pi"},{id:"copilot",name:"GitHub Copilot CLI",command:"copilot"}],Hr=e=>Yn.some(t=>t.id===e),fc=e=>/^ses[a-zA-Z0-9_-]+$/.test(e);function Iu(e,t){if(!fc(t))throw new Error("Invalid session ID.");const n=new URL(e);if(!["http:","https:"].includes(n.protocol)||n.username||n.password)throw new Error("Invalid OpenCode URL.");const s=btoa(String.fromCharCode(...new TextEncoder().encode(n.origin))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");return`${n.origin}/server/${s}/session/${encodeURIComponent(t)}`}var un=(e,t=[])=>({parts:(...n)=>{if(Tu(t))return un(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>un(e,[...t,...n]),omit:(...n)=>un(e,t.filter(s=>!n.includes(s))),rename:n=>un(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,s)=>Object.assign(n,{[s]:{selector:[`&[data-scope="${sn(e)}"][data-part="${sn(s)}"]`,`& [data-scope="${sn(e)}"][data-part="${sn(s)}"]`].join(", "),attrs:{"data-scope":sn(e),"data-part":sn(s)}}}),{})}),sn=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),Tu=e=>e.length===0,Mu=un("select").parts("label","positioner","trigger","indicator","clearTrigger","item","itemText","itemIndicator","itemGroup","itemGroupLabel","list","content","root","control","valueText"),Ee=Mu.build(),Au=Object.defineProperty,Ou=(e,t,n)=>t in e?Au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,U=(e,t,n)=>Ou(e,typeof t!="symbol"?t+"":t,n);function Du(e){return e==null?[]:Array.isArray(e)?e:[e]}var Pu=e=>e[e.length-1],Ru=(e,t)=>e.indexOf(t)!==-1,Vu=(e,...t)=>e.concat(t),Nu=(e,...t)=>e.filter(n=>!t.includes(n)),Gi=(e,t)=>Ru(e,t)?Nu(e,t):Vu(e,t);function Yi(e,t){return e.reduce((n,s,r)=>(r%t===0?n.push([s]):Pu(n)?.push(s),n),[])}var Ki=e=>e?.constructor.name==="Array",Fu=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!$n(e[n],t[n]))return!1;return!0},$n=(e,t)=>{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof e?.isEqual=="function"&&typeof t?.isEqual=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(Ki(e)&&Ki(t))return Fu(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),s=n.length;if(Object.keys(e).length!==s)return!1;for(let r=0;r<s;r++)if(!Reflect.has(e,n[r]))return!1;for(let r=0;r<s;r++){const o=n[r];if(!$n(e[o],t[o]))return!1}return!0},Hu=e=>Array.isArray(e),pc=e=>e!=null&&typeof e=="object",Wr=e=>pc(e)&&!Hu(e),Wu=e=>typeof e=="string",it=e=>typeof e=="function",ju=e=>e==null,Ws=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),_u=e=>Object.prototype.toString.call(e),gc=Function.prototype.toString,Bu=gc.call(Object),Kn=e=>{if(!pc(e)||_u(e)!="[object Object]"||Gu(e))return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Ws(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&gc.call(n)==Bu},Uu=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,qu=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Gu=e=>Uu(e)||qu(e),Zi=(e,...t)=>(typeof e=="function"?e(...t):e)??void 0,Yu=e=>e(),mc=()=>{},Xs=(...e)=>(...t)=>{e.forEach(function(n){n?.(...t)})};function bo(e,t,...n){if(e in t){const r=t[e];return it(r)?r(...n):r}const s=new Error(`No matching key: ${JSON.stringify(e)} in ${JSON.stringify(Object.keys(t))}`);throw Error.captureStackTrace?.(s,bo),s}var{min:Ku,max:Zu}=Math,zu=e=>Number.isNaN(e),yc=e=>zu(e)?0:e,jr=(e,t,n)=>{const s=yc(e),r=t==null||s>=t,o=n==null||s<=n;return r&&o},Ju=(e,t,n)=>Ku(Zu(yc(e),t),n);function Qo(e){if(!Kn(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(s=>typeof s=="string"),n={};for(const s of t){const r=e[s];r!==void 0&&(n[s]=Qo(r))}return n}function vc(e,t){if(!t)return e;const n={...e},s=t;for(const r in s){const o=s[r];o!==void 0&&(n[r]=o)}return n}function js(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function zi(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function vr(e,t){if(e==null)throw new Error(t())}var _s={itemToValue(e){return typeof e=="string"?e:Wr(e)&&Ws(e,"value")?e.value:""},itemToString(e){return typeof e=="string"?e:Wr(e)&&Ws(e,"label")?e.label:_s.itemToValue(e)},isItemDisabled(e){return Wr(e)&&Ws(e,"disabled")?!!e.disabled:!1}},bc=class wc{constructor(t){U(this,"options",t),U(this,"items"),U(this,"indexMap",null),U(this,"copy",n=>new wc({...this.options,items:n??[...this.items]})),U(this,"isEqual",n=>$n(this.items,n.items)),U(this,"setItems",n=>this.copy(n)),U(this,"getValues",(n=this.items)=>{const s=[];for(const r of n){const o=this.getItemValue(r);o!=null&&s.push(o)}return s}),U(this,"find",n=>{if(n==null)return null;const s=this.indexOf(n);return s!==-1?this.at(s):null}),U(this,"findMany",n=>{const s=[];for(const r of n){const o=this.find(r);o!=null&&s.push(o)}return s}),U(this,"at",n=>{if(!this.options.groupBy&&!this.options.groupSort)return this.items[n]??null;let s=0;const r=this.group();for(const[,o]of r)for(const i of o){if(s===n)return i;s++}return null}),U(this,"sortFn",(n,s)=>{const r=this.indexOf(n),o=this.indexOf(s);return(r??0)-(o??0)}),U(this,"sort",n=>[...n].sort(this.sortFn.bind(this))),U(this,"getItemValue",n=>n==null?null:this.options.itemToValue?.(n)??_s.itemToValue(n)),U(this,"getItemDisabled",n=>n==null?!1:this.options.isItemDisabled?.(n)??_s.isItemDisabled(n)),U(this,"stringifyItem",n=>n==null?null:this.options.itemToString?.(n)??_s.itemToString(n)),U(this,"stringify",n=>n==null?null:this.stringifyItem(this.find(n))),U(this,"stringifyItems",(n,s=", ")=>{const r=[];for(const o of n){const i=this.stringifyItem(o);i!=null&&r.push(i)}return r.join(s)}),U(this,"stringifyMany",(n,s)=>this.stringifyItems(this.findMany(n),s)),U(this,"has",n=>this.indexOf(n)!==-1),U(this,"hasItem",n=>n==null?!1:this.has(this.getItemValue(n))),U(this,"group",()=>{const{groupBy:n,groupSort:s}=this.options;if(!n)return[["",[...this.items]]];const r=new Map;this.items.forEach((i,a)=>{const c=n(i,a);r.has(c)||r.set(c,[]),r.get(c).push(i)});let o=Array.from(r.entries());return s&&o.sort(([i],[a])=>{if(typeof s=="function")return s(i,a);if(Array.isArray(s)){const c=s.indexOf(i),l=s.indexOf(a);return c===-1?1:l===-1?-1:c-l}return s==="asc"?i.localeCompare(a):s==="desc"?a.localeCompare(i):0}),o}),U(this,"getNextValue",(n,s=1,r=!1)=>{let o=this.indexOf(n);if(o===-1)return null;for(o=r?Math.min(o+s,this.size-1):o+s;o<=this.size&&this.getItemDisabled(this.at(o));)o++;return this.getItemValue(this.at(o))}),U(this,"getPreviousValue",(n,s=1,r=!1)=>{let o=this.indexOf(n);if(o===-1)return null;for(o=r?Math.max(o-s,0):o-s;o>=0&&this.getItemDisabled(this.at(o));)o--;return this.getItemValue(this.at(o))}),U(this,"indexOf",n=>{if(n==null)return-1;if(!this.options.groupBy&&!this.options.groupSort)return this.items.findIndex(s=>this.getItemValue(s)===n);if(!this.indexMap){this.indexMap=new Map;let s=0;const r=this.group();for(const[,o]of r)for(const i of o){const a=this.getItemValue(i);a!=null&&this.indexMap.set(a,s),s++}}return this.indexMap.get(n)??-1}),U(this,"getByText",(n,s)=>{const r=s!=null?this.indexOf(s):-1,o=n.length===1;for(let i=0;i<this.items.length;i++){const a=this.items[(r+i+1)%this.items.length];if(!(o&&this.getItemValue(a)===s)&&!this.getItemDisabled(a)&&Xu(this.stringifyItem(a),n))return a}}),U(this,"search",(n,s)=>{const{state:r,currentValue:o,timeout:i=350}=s,a=r.keysSoFar+n,l=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a,h=this.getByText(l,o),u=this.getItemValue(h);function g(){clearTimeout(r.timer),r.timer=-1}function p(f){r.keysSoFar=f,g(),f!==""&&(r.timer=+setTimeout(()=>{p(""),g()},i))}return p(a),u}),U(this,"update",(n,s)=>{let r=this.indexOf(n);return r===-1?this:this.copy([...this.items.slice(0,r),s,...this.items.slice(r+1)])}),U(this,"upsert",(n,s,r="append")=>{let o=this.indexOf(n);return o===-1?(r==="append"?this.append:this.prepend)(s):this.copy([...this.items.slice(0,o),s,...this.items.slice(o+1)])}),U(this,"insert",(n,...s)=>this.copy(Vn(this.items,n,...s))),U(this,"insertBefore",(n,...s)=>{let r=this.indexOf(n);if(r===-1)if(this.items.length===0)r=0;else return this;return this.copy(Vn(this.items,r,...s))}),U(this,"insertAfter",(n,...s)=>{let r=this.indexOf(n);if(r===-1)if(this.items.length===0)r=0;else return this;return this.copy(Vn(this.items,r+1,...s))}),U(this,"prepend",(...n)=>this.copy(Vn(this.items,0,...n))),U(this,"append",(...n)=>this.copy(Vn(this.items,this.items.length,...n))),U(this,"filter",n=>{const s=this.items.filter((r,o)=>n(this.stringifyItem(r),o,r));return this.copy(s)}),U(this,"remove",(...n)=>{const s=n.map(r=>typeof r=="string"?r:this.getItemValue(r));return this.copy(this.items.filter(r=>{const o=this.getItemValue(r);return o==null?!1:!s.includes(o)}))}),U(this,"move",(n,s)=>{const r=this.indexOf(n);return r===-1?this:this.copy(Cs(this.items,[r],s))}),U(this,"moveBefore",(n,...s)=>{let r=this.items.findIndex(i=>this.getItemValue(i)===n);if(r===-1)return this;let o=s.map(i=>this.items.findIndex(a=>this.getItemValue(a)===i)).sort((i,a)=>i-a);return this.copy(Cs(this.items,o,r))}),U(this,"moveAfter",(n,...s)=>{let r=this.items.findIndex(i=>this.getItemValue(i)===n);if(r===-1)return this;let o=s.map(i=>this.items.findIndex(a=>this.getItemValue(a)===i)).sort((i,a)=>i-a);return this.copy(Cs(this.items,o,r+1))}),U(this,"reorder",(n,s)=>this.copy(Cs(this.items,[n],s))),U(this,"compareValue",(n,s)=>{const r=this.indexOf(n),o=this.indexOf(s);return r<o?-1:r>o?1:0}),U(this,"range",(n,s)=>{let r=[],o=n;for(;o!=null;){if(this.find(o)&&r.push(o),o===s)return r;o=this.getNextValue(o)}return[]}),U(this,"getValueRange",(n,s)=>n&&s?this.compareValue(n,s)<=0?this.range(n,s):this.range(s,n):[]),U(this,"toString",()=>{let n="";for(const s of this.items){const r=this.getItemValue(s),o=this.stringifyItem(s),i=this.getItemDisabled(s),a=[r,o,i].filter(Boolean).join(":");n+=a+","}return n}),U(this,"toJSON",()=>({size:this.size,first:this.firstValue,last:this.lastValue})),this.items=[...t.items]}get size(){return this.items.length}get firstValue(){let t=0;for(;this.getItemDisabled(this.at(t));)t++;return this.getItemValue(this.at(t))}get lastValue(){let t=this.size-1;for(;this.getItemDisabled(this.at(t));)t--;return this.getItemValue(this.at(t))}*[Symbol.iterator](){yield*this.items}},Xu=(e,t)=>!!e?.toLowerCase().startsWith(t.toLowerCase());function Vn(e,t,...n){return[...e.slice(0,t),...n,...e.slice(t)]}function Cs(e,t,n){t=[...t].sort((r,o)=>r-o);const s=t.map(r=>e[r]);for(let r=t.length-1;r>=0;r--)e=[...e.slice(0,t[r]),...e.slice(t[r]+1)];return n=Math.max(0,n-t.filter(r=>r<n).length),[...e.slice(0,n),...s,...e.slice(n)]}function kc({values:e,collection:t,selectedItemMap:n}){const s=[];for(const r of e){const o=t.find(r)??n.get(r);o!=null&&s.push(o)}return s}function Cc({selectedItemMap:e,values:t,selectedItems:n,collection:s}){const r=new Map(e);for(const i of n){const a=s.getItemValue(i);a!=null&&r.set(a,i)}const o=new Set(t);for(const i of r.keys())o.has(i)||r.delete(i);return r}function Es({values:e,collection:t,selectedItemMap:n}){const s=kc({values:e,collection:t,selectedItemMap:n}),r=Cc({selectedItemMap:n,values:e,selectedItems:s,collection:t});return{selectedItems:s,nextSelectedItemMap:r}}function Qu({selectedItems:e,collection:t}){return Cc({selectedItemMap:new Map,values:e.map(n=>t.getItemValue(n)).filter(Boolean),selectedItems:e,collection:t})}var Qs=e=>new bc(e);Qs.empty=()=>new bc({items:[]});var eh=Object.defineProperty,th=(e,t,n)=>t in e?eh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_r=(e,t,n)=>th(e,typeof t!="symbol"?t+"":t,n),nh=(e,t)=>e.map((n,s)=>e[(Math.max(t,0)+s)%e.length]),er=()=>{},br=e=>typeof e=="object"&&e!==null,V=e=>e?"":void 0,be=e=>e?"true":void 0,sh=1,rh=9,oh=11,ye=e=>br(e)&&e.nodeType===sh&&typeof e.nodeName=="string",ei=e=>br(e)&&e.nodeType===rh,ih=e=>br(e)&&e===e.window,Ec=e=>ye(e)?e.localName||"":"#document";function ah(e){return["html","body","#document"].includes(Ec(e))}var Sc=e=>br(e)&&e.nodeType!==void 0,bn=e=>Sc(e)&&e.nodeType===oh&&"host"in e,xc=e=>ye(e)&&e.localName==="input",ch=e=>ye(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1;function wo(e){if(!e)return!1;const t=e.getRootNode();return wr(t)===e}var lh=/(textarea|select)/;function dh(e){if(e==null||!ye(e))return!1;try{return xc(e)&&e.selectionStart!=null||lh.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function wn(e,t){if(!e||!t||!ye(e)||!Sc(t))return!1;if(ye(t)&&e===t||e.contains(t))return!0;const n=t.getRootNode?.();if(n&&bn(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function We(e){return ei(e)?e:ih(e)?e.document:e?.ownerDocument??document}function uh(e){return We(e).documentElement}function ke(e){return bn(e)?ke(e.host):ei(e)?e.defaultView??window:ye(e)?e.ownerDocument?.defaultView??window:window}function wr(e){let t=e.activeElement;for(;t?.shadowRoot;){const n=t.shadowRoot.activeElement;if(!n||n===t)break;t=n}return t}function Ji(e,t){return!e||e===We(e).body?!1:!t.some(n=>wn(n,e))}function hh(e){if(Ec(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bn(e)&&e.host||uh(e);return bn(t)?t.host:t}function fh(e){let t;try{if(t=e.getRootNode({composed:!0}),ei(t)||bn(t))return t}catch{}return e.ownerDocument??document}var Br=new WeakMap;function $c(e){return Br.has(e)||Br.set(e,ke(e).getComputedStyle(e)),Br.get(e)}var ti=()=>typeof document<"u";function ph(){return navigator.userAgentData?.platform??navigator.platform}function gh(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var ni=e=>ti()&&e.test(ph()),mh=e=>ti()&&e.test(gh()),yh=/^iPhone/i,vh=/^iPad/i,bh=/^Mac/i,wh=/Android/i,Xi=()=>ti()&&!!navigator.maxTouchPoints,kh=()=>ni(yh),Ch=()=>ni(vh)||si()&&navigator.maxTouchPoints>1,Lc=()=>kh()||Ch(),si=()=>ni(bh),Eh=()=>mh(wh),Sh=new Set(["menu","listbox","dialog","grid","tree","region","application"]),xh=e=>Sh.has(e),$h=e=>e.getAttribute("aria-controls")?.split(" ")||[];function Lh(e,t){const n=new Set,s=fh(e),r=o=>{const i=o.querySelectorAll("[aria-controls]");for(const a of i){if(a.getAttribute("aria-expanded")!=="true")continue;const c=$h(a);for(const l of c){if(!l||n.has(l))continue;n.add(l);const h=s.getElementById(l);if(h){const u=h.getAttribute("role"),g=h.getAttribute("aria-modal")==="true";if(u&&xh(u)&&!g&&(h===t||h.contains(t)||r(h)))return!0}}}return!1};return r(e)}function Ih(e){return e.composedPath?.()??e.nativeEvent?.composedPath?.()}function yt(e){return Ih(e)?.[0]??e.target}function Th(e){return ri(e).isComposing||e.keyCode===229}function Mh(e){return e.pointerType===""&&e.isTrusted?!0:Eh()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}var Ah=e=>e.button===2||si()&&e.ctrlKey&&e.button===0,Oh={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},Qi={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function ko(e,t={}){const{dir:n="ltr",orientation:s="horizontal"}=t;let r=e.key;return r=Oh[r]??r,n==="rtl"&&s==="horizontal"&&r in Qi&&(r=Qi[r]),r}function ri(e){return e.nativeEvent??e}var Bs=(e,t,n,s)=>{const r=typeof e=="function"?e():e;return r?.addEventListener(t,n,s),()=>{r?.removeEventListener(t,n,s)}};function Dh(e,t){const{type:n="HTMLInputElement",property:s="value"}=t,r=ke(e)[n].prototype;return Object.getOwnPropertyDescriptor(r,s)??{}}function Ph(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function Ss(e,t,n="value"){if(!e)return;const s=Ph(e);s&&Dh(e,{type:s,property:n}).set?.call(e,t),e.setAttribute(n,t)}function Rh(e){return e.matches("textarea, input, select, button")}function Vh(e,t){if(!e)return;const n=Rh(e)?e.form:e.closest("form"),s=r=>{r.defaultPrevented||t()};return n?.addEventListener("reset",s,{passive:!0}),()=>n?.removeEventListener("reset",s)}function Nh(e,t){const n=e?.closest("fieldset");if(!n)return;t(n.disabled);const s=ke(n),r=new s.MutationObserver(()=>t(n.disabled));return r.observe(n,{attributes:!0,attributeFilter:["disabled"]}),()=>r.disconnect()}function Fh(e,t){if(!e)return;const{onFieldsetDisabledChange:n,onFormReset:s}=t,r=[Vh(e,s),Nh(e,n)];return()=>r.forEach(o=>o?.())}var Ic=Symbol.for("zag.changeEvent");function Tc(e){return Object.prototype.hasOwnProperty.call(e,Ic)}function Hh(e){return Tc(e)||Object.defineProperty(e,Ic,{value:!0}),e}var Wh=e=>ye(e)&&e.tagName==="IFRAME";function jh(e){const t=e.getAttribute("tabindex");return t?parseInt(t,10):NaN}var _h=e=>jh(e)<0;function Bh(e){return xc(e)&&e.type==="radio"}function Uh(e){if(!Bh(e)||!e.name||e.checked)return!0;const t=`input[type="radio"][name="${CSS.escape(e.name)}"]`,n=e.form??e.ownerDocument,s=Array.from(n.querySelectorAll(t)).filter(o=>o.form===e.form&&kr(o)),r=s.find(o=>o.checked);return r?r===e:s[0]===e}function qh(e,t){if(!t)return null;if(t===!0)return e.shadowRoot||null;const n=t(e);return(n===!0?e.shadowRoot:n)||null}function Gh(e,t,n){const s=[...e],r=[...e],o=new Set,i=new Map;e.forEach((c,l)=>i.set(c,l));let a=0;for(;a<r.length;){const c=r[a++];if(!c||o.has(c))continue;o.add(c);const l=qh(c,t);if(l){const h=Array.from(l.querySelectorAll(oi)).filter(n),u=i.get(c);if(u!==void 0){const g=u+1;s.splice(g,0,...h),h.forEach((p,f)=>{i.set(p,g+f)});for(let p=g+h.length;p<s.length;p++)i.set(s[p],p)}else{const g=s.length;s.push(...h),h.forEach((p,f)=>{i.set(p,g+f)})}r.push(...h)}}return s}var oi="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type";function kr(e){return!ye(e)||e.closest("[inert]")?!1:e.matches(oi)&&ch(e)}function ii(e,t={}){if(!e)return[];const{includeContainer:n,getShadowRoot:s}=t,r=Array.from(e.querySelectorAll(oi));n&&Ur(e)&&r.unshift(e);const o=[];for(const i of r)if(Ur(i)){if(Wh(i)&&i.contentDocument){const a=i.contentDocument.body;o.push(...ii(a,{getShadowRoot:s}));continue}o.push(i)}if(s){const i=Gh(o,s,Ur);return!i.length&&n?r:i}return!o.length&&n?r:o}function Ur(e){return ye(e)&&e.tabIndex>0?!0:!kr(e)||_h(e)?!1:Uh(e)}function Yh(e,t={}){const n=ii(e,t),s=n[0]||null,r=n[n.length-1]||null;return[s,r]}function Kh(e){const{root:t,getInitialEl:n,filter:s,enabled:r=!0}=e;if(!r)return!1;let o=typeof n=="function"?n():n;return o===!1?!1:(o||(o=t?.matches("[data-autofocus],[autofocus]")?t:t?.querySelector("[data-autofocus],[autofocus]")),o||(o=ii(t).filter(a=>s?s(a):!0).find(a=>!a.hasAttribute("data-no-autofocus"))),o||t||void 0)}function Zh(e){const t=e.currentTarget;if(!t)return!1;const[n,s]=Yh(t);return!(wo(n)&&e.shiftKey||wo(s)&&!e.shiftKey||!n&&!s)}var Mc=class Ac{constructor(){_r(this,"id",null),_r(this,"fn_cleanup"),_r(this,"cleanup",()=>{this.cancel()})}static create(){return new Ac}request(t){this.cancel(),this.id=globalThis.requestAnimationFrame(()=>{this.id=null,this.fn_cleanup=t?.()})}cancel(){this.id!==null&&(globalThis.cancelAnimationFrame(this.id),this.id=null),this.fn_cleanup?.(),this.fn_cleanup=void 0}isActive(){return this.id!==null}};function we(e){const t=Mc.create();return t.request(e),t.cleanup}function Oc(e){const t=new Set;function n(s){const r=globalThis.requestAnimationFrame(s);t.add(()=>globalThis.cancelAnimationFrame(r))}return n(()=>n(e)),function(){t.forEach(r=>r())}}var qr=new WeakMap;function zh(e){const t={childList:!0,subtree:!0,attributes:e.attributes??(e.attributeOldValue!==void 0||e.attributeFilter!==void 0),characterData:e.characterData??e.characterDataOldValue!==void 0,attributeOldValue:!!e.attributeOldValue,characterDataOldValue:!!e.characterDataOldValue};return e.attributeFilter!==void 0&&(t.attributeFilter=[...new Set(e.attributeFilter)].sort()),t}function Jh(e){const t=zh(e),n=JSON.stringify(t);return{observe(s,r){const o=ke(s);if(typeof o.MutationObserver!="function")return er;const i=qr.get(s)??new Map;let a=i.get(n);if(!a){const l=new Set,h=new o.MutationObserver(u=>{for(const g of[...l])if(l.has(g))try{g(u)}catch(p){o.queueMicrotask(()=>{throw p})}});h.observe(s,t),a={observer:h,listeners:l},i.set(n,a),qr.set(s,i)}const c=l=>r(l);return a.listeners.add(c),()=>{!a.listeners.delete(c)||a.listeners.size>0||(a.observer.disconnect(),i.delete(n),i.size===0&&qr.delete(s))}}}}function Xh(e,t){if(!e)return;const{attributes:n,callback:s}=t,r=e.ownerDocument.defaultView||window,o=new r.MutationObserver(i=>{for(const a of i)a.type==="attributes"&&a.attributeName&&n.includes(a.attributeName)&&s(a)});return o.observe(e,{attributes:!0,attributeFilter:n}),()=>o.disconnect()}function Qh(e,t){const n=we,s=[];return s.push(n(()=>{const r=typeof e=="function"?e():e;s.push(Xh(r,t))})),()=>{s.forEach(r=>r?.())}}function Co(e){const t=hh(e);return ah(t)?We(t).body:ye(t)&&nf(t)?t:Co(t)}var ef=/auto|scroll|overlay|hidden|clip/,tf=new Set(["inline","contents"]);function nf(e){const t=ke(e),{overflow:n,overflowX:s,overflowY:r,display:o}=t.getComputedStyle(e);return ef.test(n+r+s)&&!tf.has(o)}var ea=/auto|scroll|overlay|hidden/;function sf(e,t={}){const{axis:n}=t,{overflowX:s,overflowY:r}=ke(e).getComputedStyle(e),o=n!=="y"&&ea.test(s)&&e.scrollWidth>e.clientWidth,i=n!=="x"&&ea.test(r)&&e.scrollHeight>e.clientHeight;return o||i}var hn="default",Eo="",Us=new WeakMap;function rf(e={}){const{target:t,doc:n}=e,s=n??document,r=s.documentElement;return Lc()?(hn==="default"&&(Eo=r.style.webkitUserSelect,r.style.webkitUserSelect="none"),hn="disabled"):t&&(Us.set(t,t.style.userSelect),t.style.userSelect="none"),()=>Dc({target:t,doc:s})}function Dc(e={}){const{target:t,doc:n}=e,r=(n??document).documentElement;if(Lc()){if(hn!=="disabled")return;hn="restoring",setTimeout(()=>{Oc(()=>{hn==="restoring"&&(r.style.webkitUserSelect==="none"&&(r.style.webkitUserSelect=Eo||""),Eo="",hn="default")})},300)}else if(t&&Us.has(t)){const o=Us.get(t);t.style.userSelect==="none"&&(t.style.userSelect=o??""),t.getAttribute("style")===""&&t.removeAttribute("style"),Us.delete(t)}}function of(e={}){const{defer:t,target:n,...s}=e,r=t?we:i=>i(),o=[];return o.push(r(()=>{const i=typeof n=="function"?n():n;o.push(rf({...s,target:i}))})),()=>{o.forEach(i=>i?.())}}function af(e,t){return Array.from(e?.querySelectorAll(t)??[])}function cf(e,t){return e?.querySelector(t)??null}var ai=e=>e.id;function lf(e,t,n=ai){return e.find(s=>n(s)===t)}function df(e,t,n=ai){const s=lf(e,t,n);return s?e.indexOf(s):-1}function uf(e,t){const{rootEl:n,...s}=t||{};!e||!n||sf(n)&&e.scrollIntoView(s)}var ta,hf=()=>ta??(ta=new Intl.Collator(void 0,{usage:"search",sensitivity:"base"})),ff=e=>e.normalize("NFC").trim(),pf=e=>ff(e.dataset?.valuetext??e.textContent??""),gf=(e,t)=>{const n=t.normalize("NFC");return hf().compare(e.slice(0,n.length),n)===0};function mf(e,t,n,s=ai){const r=n?df(e,n,s):-1;let o=n?nh(e,r):e;return t.length===1&&(o=o.filter(a=>s(a)!==n)),o.find(a=>gf(pf(a),t))}function yf(e,t){if(!e)return er;const n=Object.keys(t).reduce((s,r)=>(s[r]=e.style.getPropertyValue(r),s),{});return vf(n,t)?er:(Object.assign(e.style,t),()=>{Object.assign(e.style,n),e.style.length===0&&e.removeAttribute("style")})}function vf(e,t){return Object.keys(e).every(n=>e[n]===t[n])}function bf(e,t){const{state:n,activeId:s,key:r,timeout:o=350,itemToId:i}=t,a=n.keysSoFar+r,l=a.length>1&&Array.from(a).every(f=>f===a[0])?a[0]:a;let h=e.slice();const u=mf(h,l,s,i);function g(){clearTimeout(n.timer),n.timer=-1}function p(f){n.keysSoFar=f,g(),f!==""&&(n.timer=+setTimeout(()=>{p(""),g()},o))}return p(a),u}var So=Object.assign(bf,{defaultOptions:{keysSoFar:"",timer:-1},isValidEvent:wf});function wf(e){return e.key.length===1&&!e.ctrlKey&&!e.metaKey}var kf={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function Cf(e,t,n){const{signal:s}=t;return[new Promise((i,a)=>{const c=setTimeout(()=>{a(new Error(`Timeout of ${n}ms exceeded`))},n);s.addEventListener("abort",()=>{clearTimeout(c),a(new DOMException("Promise aborted","AbortError"))}),e.then(l=>{s.aborted||(clearTimeout(c),i(l))}).catch(l=>{s.aborted||(clearTimeout(c),a(l))})}),()=>t.abort()]}function Ef(e,t){const{timeout:n,rootNode:s}=t,r=ke(s),o=We(s),i=new r.AbortController;let a;const c=Cf(new Promise(h=>{const u=e();if(u){h(u);return}a=new r.MutationObserver(()=>{const g=e();g&&g.isConnected&&(a?.disconnect(),h(g))}),a.observe(o.body,{childList:!0,subtree:!0})}),i,n),l=()=>a?.disconnect();return c[0].then(l,l),c}var Sf=Jh({});function xf(e,t,n={}){const{defer:s,onMissing:r,getRootNode:o}=n,i=()=>typeof e=="function"?e():e,a=[],c=l=>{if(!l)return r?.();a.push(t(l))};if(!s)c(i());else{let l=!1;a.push(()=>{l=!0}),queueMicrotask(()=>{if(l)return;const h=i();if(h){c(h);return}let u=!1;const g=m=>{l||u||(u=!0,f(),d(),c(m))},p=o?.(),f=p?Sf.observe(p,()=>{const m=i();m&&g(m)}):er,d=we(()=>g(i()));a.push(f,d)})}return()=>{a.forEach(l=>l?.())}}function $f(e){return!(e.metaKey||!si()&&e.altKey||e.ctrlKey||e.key==="Control"||e.key==="Shift"||e.key==="Meta")}var Lf=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]),If=["a[href]","audio[controls]","button","details","embed","iframe","img[controls]","img[usemap]","input","select","textarea","video[controls]"].join(",");function Tf(e,t,n){const s=n?yt(n):null,r=We(s),o=ke(s),i=wr(r);return e=e||i instanceof o.HTMLInputElement&&!Lf.has(i?.type)||i instanceof o.HTMLTextAreaElement||i instanceof o.HTMLElement&&i.isContentEditable,!(e&&t==="keyboard"&&n instanceof o.KeyboardEvent&&!Reflect.has(Af,n.key))}var vt=null,xo=new Set,tr=new Map,Yt=!1,$t=null,$o=!1,Gr=null,Mf=!1,Af={Tab:!0,Escape:!0};function Cr(e,t){for(let n of xo)n(e,t)}function nr(e){$t=null,Yt=!0,$f(e)&&(vt="keyboard",Cr("keyboard",e))}function Pe(e){(e.type==="pointermove"||e.type==="mousemove")&&e.isTrusted&&Gr?.x===e.clientX&&Gr?.y===e.clientY||(Gr={x:e.clientX,y:e.clientY},vt="pointer",(e.type==="mousedown"||e.type==="pointerdown")&&($t=null,Yt=!0,Cr("pointer",e)))}function Pc(e){if(Mh(e)){$t=null,Yt=!0,vt="virtual";return}$t=null;const t=yt(e),n=t?.closest("label"),s=n?.control;if(!n||!s||s.matches(":disabled"))return;const r=t?.closest(If);r&&n.contains(r)&&r!==s||s!==wr(n.ownerDocument)&&($t=s)}function Rc(e){const t=yt(e),n=t===$t;t===ke(t)||t===We(t)||Mf||!e.isTrusted||(!Yt&&!n&&!$o&&(vt="virtual",Cr("virtual",e)),Yt=!1,$t=null,$o=!1)}function Vc(){Yt=!1,$t=null,$o=!0}function Of(e){try{return e.focus}catch{return}}function Df(e){const t=e.HTMLElement.prototype;try{let s=function(){Yt=!0,(r??i.call(this)).apply(this,arguments)};var n=s;const r=Of(t),o=r?void 0:Object.getOwnPropertyDescriptor(t,"focus"),i=o?.get;return!r&&!i?{focus:void 0}:(Object.defineProperty(e.HTMLElement.prototype,"focus",{configurable:!0,writable:!0,value:s}),{focus:r,descriptor:o})}catch{return{focus:void 0}}}function Pf(e){if(typeof window>"u"||tr.get(ke(e)))return;const t=ke(e),n=We(e),s=Df(t);n.addEventListener("keydown",nr,!0),n.addEventListener("keyup",nr,!0),n.addEventListener("click",Pc,!0),t.addEventListener("focus",Rc,!0),t.addEventListener("blur",Vc,!1),typeof t.PointerEvent<"u"?(n.addEventListener("pointerdown",Pe,!0),n.addEventListener("pointermove",Pe,!0),n.addEventListener("pointerup",Pe,!0)):(n.addEventListener("mousedown",Pe,!0),n.addEventListener("mousemove",Pe,!0),n.addEventListener("mouseup",Pe,!0)),t.addEventListener("beforeunload",()=>{Rf(e)},{once:!0}),tr.set(t,s)}var Rf=(e,t)=>{const n=ke(e),s=We(e),r=tr.get(n);if(r){if(r.focus||r.descriptor)try{Object.defineProperty(n.HTMLElement.prototype,"focus",r.descriptor??{configurable:!0,writable:!0,value:r.focus})}catch{}s.removeEventListener("keydown",nr,!0),s.removeEventListener("keyup",nr,!0),s.removeEventListener("click",Pc,!0),n.removeEventListener("focus",Rc,!0),n.removeEventListener("blur",Vc,!1),typeof n.PointerEvent<"u"?(s.removeEventListener("pointerdown",Pe,!0),s.removeEventListener("pointermove",Pe,!0),s.removeEventListener("pointerup",Pe,!0)):(s.removeEventListener("mousedown",Pe,!0),s.removeEventListener("mousemove",Pe,!0),s.removeEventListener("mouseup",Pe,!0)),tr.delete(n)}};function Lo(){return vt}function Vf(e){vt=e,Cr(e,null)}function na(){return vt==="keyboard"||vt==="virtual"}function Nf(e={}){const{isTextInput:t,autoFocus:n,onChange:s,root:r}=e;Pf(r),s?.({isFocusVisible:n||na(),modality:vt});const o=(i,a)=>{Tf(!!t,i,a)&&s?.({isFocusVisible:na(),modality:i})};return xo.add(o),()=>{xo.delete(o)}}const Ff=["top","right","bottom","left"],It=Math.min,ft=Math.max,sr=Math.round,xs=Math.floor,pt=e=>({x:e,y:e}),Hf={left:"right",right:"left",bottom:"top",top:"bottom"};function Nc(e,t,n){return ft(e,It(t,n))}function bt(e,t){return typeof e=="function"?e(t):e}function Tt(e){return e.split("-")[0]}function Ln(e){return e.split("-")[1]}function ci(e){return e==="x"?"y":"x"}function li(e){return e==="y"?"height":"width"}function Ze(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function di(e){return ci(Ze(e))}function Wf(e,t,n){n===void 0&&(n=!1);const s=Ln(e),r=di(e),o=li(r);let i=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=rr(i)),[i,rr(i)]}function jf(e){const t=rr(e);return[Io(e),t,Io(t)]}function Io(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const sa=["left","right"],ra=["right","left"],_f=["top","bottom"],Bf=["bottom","top"];function Uf(e,t,n){switch(e){case"top":case"bottom":return n?t?ra:sa:t?sa:ra;case"left":case"right":return t?_f:Bf;default:return[]}}function qf(e,t,n,s){const r=Ln(e);let o=Uf(Tt(e),n==="start",s);return r&&(o=o.map(i=>i+"-"+r),t&&(o=o.concat(o.map(Io)))),o}function rr(e){const t=Tt(e);return Hf[t]+e.slice(t.length)}function Gf(e){var t,n,s,r;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(s=e.bottom)!=null?s:0,left:(r=e.left)!=null?r:0}}function Fc(e){return typeof e!="number"?Gf(e):{top:e,right:e,bottom:e,left:e}}function or(e){const{x:t,y:n,width:s,height:r}=e;return{width:s,height:r,top:n,left:t,right:t+s,bottom:n+r,x:t,y:n}}function oa(e,t,n){let{reference:s,floating:r}=e;const o=Ze(t),i=di(t),a=li(i),c=Tt(t),l=o==="y",h=s.x+s.width/2-r.width/2,u=s.y+s.height/2-r.height/2,g=s[a]/2-r[a]/2;let p;switch(c){case"top":p={x:h,y:s.y-r.height};break;case"bottom":p={x:h,y:s.y+s.height};break;case"right":p={x:s.x+s.width,y:u};break;case"left":p={x:s.x-r.width,y:u};break;default:p={x:s.x,y:s.y}}const f=Ln(t);return f&&(p[i]+=g*(f==="end"?1:-1)*(n&&l?-1:1)),p}async function Yf(e,t){var n;t===void 0&&(t={});const{x:s,y:r,platform:o,rects:i,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:h="viewport",elementContext:u="floating",altBoundary:g=!1,padding:p=0}=bt(t,e),f=Fc(p),m=a[g?u==="floating"?"reference":"floating":u],v=or(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(a.floating)),boundary:l,rootBoundary:h,strategy:c})),k=u==="floating"?{x:s,y:r,width:i.floating.width,height:i.floating.height}:i.reference,L=await(o.getOffsetParent==null?void 0:o.getOffsetParent(a.floating)),O=await(o.isElement==null?void 0:o.isElement(L))&&await(o.getScale==null?void 0:o.getScale(L))||{x:1,y:1},w=or(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:k,offsetParent:L,strategy:c}):k);return{top:(v.top-w.top+f.top)/O.y,bottom:(w.bottom-v.bottom+f.bottom)/O.y,left:(v.left-w.left+f.left)/O.x,right:(w.right-v.right+f.right)/O.x}}const Kf=50,Zf=async(e,t,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:o=[],platform:i}=n,a=i.detectOverflow?i:{...i,detectOverflow:Yf},c=await(i.isRTL==null?void 0:i.isRTL(t));let l=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:h,y:u}=oa(l,s,c),g=s,p=0;const f={};for(let d=0;d<o.length;d++){const m=o[d];if(!m)continue;const{name:v,fn:k}=m,{x:L,y:O,data:w,reset:S}=await k({x:h,y:u,initialPlacement:s,placement:g,strategy:r,middlewareData:f,rects:l,platform:a,elements:{reference:e,floating:t}});h=L??h,u=O??u,f[v]={...f[v],...w},S&&p<Kf&&(p++,typeof S=="object"&&(S.placement&&(g=S.placement),S.rects&&(l=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):S.rects),{x:h,y:u}=oa(l,g,c)),d=-1)}return{x:h,y:u,placement:g,strategy:r,middlewareData:f}},zf=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:s,placement:r,rects:o,platform:i,elements:a,middlewareData:c}=t,{element:l,padding:h=0}=bt(e,t)||{};if(l==null)return{};const u=Fc(h),g={x:n,y:s},p=di(r),f=li(p),d=await i.getDimensions(l),m=p==="y",v=m?"top":"left",k=m?"bottom":"right",L=m?"clientHeight":"clientWidth",O=o.reference[f]+o.reference[p]-g[p]-o.floating[f],w=g[p]-o.reference[p],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l));let b=S?S[L]:0;(!b||!await(i.isElement==null?void 0:i.isElement(S)))&&(b=a.floating[L]||o.floating[f]);const E=O/2-w/2,C=b/2-d[f]/2-1,x=It(u[v],C),y=It(u[k],C),M=b-d[f]-y,D=b/2-d[f]/2+E,H=Nc(x,D,M),P=!c.arrow&&Ln(r)!=null&&D!==H&&o.reference[f]/2-(D<x?x:y)-d[f]/2<0,F=P?D<x?D-x:D-M:0;return{[p]:g[p]+F,data:{[p]:H,centerOffset:D-H-F,...P&&{alignmentOffset:F}},reset:P}}}),Jf=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:r,middlewareData:o,rects:i,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:h=!0,crossAxis:u=!0,fallbackPlacements:g,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:d=!0,...m}=bt(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const v=Tt(r),k=Ze(a),L=Tt(a)===a,O=await(c.isRTL==null?void 0:c.isRTL(l.floating)),w=g||(L||!d?[rr(a)]:jf(a)),S=f!=="none";!g&&S&&w.push(...qf(a,d,f,O));const b=[a,...w],E=await c.detectOverflow(t,m),C=[];let x=((s=o.flip)==null?void 0:s.overflows)||[];if(h&&C.push(E[v]),u){const H=Wf(r,i,O);C.push(E[H[0]],E[H[1]])}if(x=[...x,{placement:r,overflows:C}],!C.every(H=>H<=0)){var y,M;const H=(((y=o.flip)==null?void 0:y.index)||0)+1,P=b[H];if(P&&(!(u==="alignment"?k!==Ze(P):!1)||x.every(j=>Ze(j.placement)===k?j.overflows[0]>0:!0)))return{data:{index:H,overflows:x},reset:{placement:P}};let F=(M=x.filter(B=>B.overflows[0]<=0).sort((B,j)=>B.overflows[1]-j.overflows[1])[0])==null?void 0:M.placement;if(!F)switch(p){case"bestFit":{var D;const B=(D=x.filter(j=>{if(S){const q=Ze(j.placement);return q===k||q==="y"}return!0}).map(j=>[j.placement,j.overflows.filter(q=>q>0).reduce((q,Ce)=>q+Ce,0)]).sort((j,q)=>j[1]-q[1])[0])==null?void 0:D[0];B&&(F=B);break}case"initialPlacement":F=a;break}if(r!==F)return{reset:{placement:F}}}return{}}}};function ia(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function aa(e){return Ff.some(t=>e[t]>=0)}const Xf=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:s}=t,{strategy:r="referenceHidden",...o}=bt(e,t);switch(r){case"referenceHidden":{const i=await s.detectOverflow(t,{...o,elementContext:"reference"}),a=ia(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:aa(a)}}}case"escaped":{const i=await s.detectOverflow(t,{...o,altBoundary:!0}),a=ia(i,n.floating);return{data:{escapedOffsets:a,escaped:aa(a)}}}default:return{}}}}},Hc=new Set(["left","top"]);async function Qf(e,t){const{placement:n,platform:s,elements:r}=e,o=await(s.isRTL==null?void 0:s.isRTL(r.floating)),i=Tt(n),a=Ln(n),c=Ze(n)==="y",l=Hc.has(i)?-1:1,h=o&&c?-1:1,u=bt(t,e);let{mainAxis:g,crossAxis:p,alignmentAxis:f}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&typeof f=="number"&&(p=a==="end"?f*-1:f),c?{x:p*h,y:g*l}:{x:g*l,y:p*h}}const ep=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:r,y:o,placement:i,middlewareData:a}=t,c=await Qf(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:o+c.y,data:{...c,placement:i}}}}},tp=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:r,platform:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:k=>{let{x:L,y:O}=k;return{x:L,y:O}}},...l}=bt(e,t),h={x:n,y:s},u=await o.detectOverflow(t,l),g=Ze(r),p=ci(g);let f=h[p],d=h[g];const m=(k,L)=>Nc(L+u[k==="y"?"top":"left"],L,L-u[k==="y"?"bottom":"right"]);i&&(f=m(p,f)),a&&(d=m(g,d));const v=c.fn({...t,[p]:f,[g]:d});return{...v,data:{x:v.x-n,y:v.y-s,enabled:{[p]:i,[g]:a}}}}}},np=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,s;const{x:r,y:o,placement:i,rects:a,middlewareData:c}=t,{offset:l=0,mainAxis:h=!0,crossAxis:u=!0}=bt(e,t),g={x:r,y:o},p=Ze(i),f=ci(p);let d=g[f],m=g[p];const v=bt(l,t),k=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(s=v.crossAxis)!=null?s:0};if(h){const w=f==="y"?"height":"width",S=a.reference[f]-a.floating[w]+k.mainAxis,b=a.reference[f]+a.reference[w]-k.mainAxis;d<S?d=S:d>b&&(d=b)}if(u){var L,O;const w=f==="y"?"width":"height",S=Hc.has(Tt(i)),b=a.reference[p]-a.floating[w]+(S&&((L=c.offset)==null?void 0:L[p])||0)+(S?0:k.crossAxis),E=a.reference[p]+a.reference[w]+(S?0:((O=c.offset)==null?void 0:O[p])||0)-(S?k.crossAxis:0);m<b?m=b:m>E&&(m=E)}return{[f]:d,[p]:m}}}},sp=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:s,platform:r,elements:o}=t,{apply:i=()=>{},...a}=bt(e,t),c=await r.detectOverflow(t,a),l=Tt(n),h=Ln(n),u=Ze(n)==="y",{width:g,height:p}=s.floating;let f,d;l==="top"||l==="bottom"?(f=l,d=h===(await(r.isRTL==null?void 0:r.isRTL(o.floating))?"start":"end")?"left":"right"):(d=l,f=h==="end"?"top":"bottom");const m=p-c.top-c.bottom,v=g-c.left-c.right,k=It(p-c[f],m),L=It(g-c[d],v),O=t.middlewareData.shift,w=!O;let S=k,b=L;O!=null&&O.enabled.x&&(b=v),O!=null&&O.enabled.y&&(S=m),w&&!h&&(u?b=g-2*ft(c.left,c.right):S=p-2*ft(c.top,c.bottom)),await i({...t,availableWidth:b,availableHeight:S});const E=await r.getDimensions(o.floating);return g!==E.width||p!==E.height?{reset:{rects:!0}}:{}}}};function Er(){return typeof window<"u"}function In(e){return Wc(e)?(e.nodeName||"").toLowerCase():"#document"}function Le(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ct(e){var t;return(t=(Wc(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Wc(e){return Er()?e instanceof Node||e instanceof Le(e).Node:!1}function Qe(e){return Er()?e instanceof Element||e instanceof Le(e).Element:!1}function Dt(e){return Er()?e instanceof HTMLElement||e instanceof Le(e).HTMLElement:!1}function ca(e){return!Er()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Le(e).ShadowRoot}function Sr(e){const{overflow:t,overflowX:n,overflowY:s,display:r}=et(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&r!=="inline"&&r!=="contents"}function rp(e){return/^(table|td|th)$/.test(In(e))}function xr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const op=/transform|translate|scale|rotate|perspective|filter/,ip=/paint|layout|strict|content/,Wt=e=>!!e&&e!=="none";let Yr;function ui(e){const t=Qe(e)?et(e):e;return Wt(t.transform)||Wt(t.translate)||Wt(t.scale)||Wt(t.rotate)||Wt(t.perspective)||!hi()&&(Wt(t.backdropFilter)||Wt(t.filter))||op.test(t.willChange||"")||ip.test(t.contain||"")}function ap(e){let t=Kt(e);for(;Dt(t)&&!cs(t);){if(ui(t))return t;if(xr(t))return null;t=Kt(t)}return null}function hi(){return Yr==null&&(Yr=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Yr}function cs(e){return/^(html|body|#document)$/.test(In(e))}function et(e){return Le(e).getComputedStyle(e)}function $r(e){return Qe(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Kt(e){if(In(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ca(e)&&e.host||Ct(e);return ca(t)?t.host:t}function jc(e){const t=Kt(e);return cs(t)?(e.ownerDocument||e).body:Dt(t)&&Sr(t)?t:jc(t)}function ls(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=jc(e),o=r===((s=e.ownerDocument)==null?void 0:s.body),i=Le(r);if(o){const a=To(i);return t.concat(i,i.visualViewport||[],Sr(r)?r:[],a&&n?ls(a):[])}else return t.concat(r,ls(r,[],n))}function To(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _c(e){const t=et(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const r=Dt(e),o=r?e.offsetWidth:n,i=r?e.offsetHeight:s,a=sr(n)!==o||sr(s)!==i;return a&&(n=o,s=i),{width:n,height:s,$:a}}function fi(e){return Qe(e)?e:e.contextElement}function pn(e){const t=fi(e);if(!Dt(t))return pt(1);const n=t.getBoundingClientRect(),{width:s,height:r,$:o}=_c(t);let i=(o?sr(n.width):n.width)/s,a=(o?sr(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const cp=pt(0);function Bc(e){const t=Le(e);return!hi()||!t.visualViewport?cp:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lp(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Le(e)}function Zt(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=fi(e);let i=pt(1);t&&(s?Qe(s)&&(i=pn(s)):i=pn(e));const a=lp(o,n,s)?Bc(o):pt(0);let c=(r.left+a.x)/i.x,l=(r.top+a.y)/i.y,h=r.width/i.x,u=r.height/i.y;if(o&&s){const g=Le(o),p=Qe(s)?Le(s):s;let f=g,d=To(f);for(;d&&p!==f;){const m=pn(d),v=d.getBoundingClientRect(),k=et(d),L=v.left+(d.clientLeft+parseFloat(k.paddingLeft))*m.x,O=v.top+(d.clientTop+parseFloat(k.paddingTop))*m.y;c*=m.x,l*=m.y,h*=m.x,u*=m.y,c+=L,l+=O,f=Le(d),d=To(f)}}return or({width:h,height:u,x:c,y:l})}function Lr(e,t){const n=$r(e).scrollLeft;return t?t.left+n:Zt(Ct(e)).left+n}function Uc(e,t){const n=e.getBoundingClientRect(),s=n.left+t.scrollLeft-Lr(e,n),r=n.top+t.scrollTop;return{x:s,y:r}}function dp(e){let{elements:t,rect:n,offsetParent:s,strategy:r}=e;const o=r==="fixed",i=Ct(s),a=t?xr(t.floating):!1;if(s===i||a&&o)return n;let c={scrollLeft:0,scrollTop:0},l=pt(1);const h=pt(0),u=Dt(s);if((u||!o)&&((In(s)!=="body"||Sr(i))&&(c=$r(s)),u)){const p=Zt(s);l=pn(s),h.x=p.x+s.clientLeft,h.y=p.y+s.clientTop}const g=i&&!u&&!o?Uc(i,c):pt(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+h.x+g.x,y:n.y*l.y-c.scrollTop*l.y+h.y+g.y}}function up(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function hp(e){const t=$r(e),n=e.ownerDocument.body,s=ft(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=ft(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-t.scrollLeft+Lr(e);const i=-t.scrollTop;return et(n).direction==="rtl"&&(o+=ft(e.clientWidth,n.clientWidth)-s),{width:s,height:r,x:o,y:i}}const fp=25;function pp(e,t,n){n===void 0&&(n="viewport");const s=n==="layoutViewport",r=Le(e),o=Ct(e),i=r.visualViewport;let a=o.clientWidth,c=o.clientHeight,l=0,h=0;if(i){const g=!hi()||t==="fixed";s?g||(l=-i.offsetLeft,h=-i.offsetTop):(a=i.width,c=i.height,g&&(l=i.offsetLeft,h=i.offsetTop))}if(Lr(o)<=0){const g=o.ownerDocument,p=g.body,f=getComputedStyle(p),d=g.compatMode==="CSS1Compat"&&parseFloat(f.marginLeft)+parseFloat(f.marginRight)||0,m=Math.abs(o.clientWidth-p.clientWidth-d),v=getComputedStyle(o).scrollbarGutter==="stable both-edges"?m/2:m;v<=fp&&(a-=v)}return{width:a,height:c,x:l,y:h}}function gp(e,t){const n=Zt(e,!0,t==="fixed"),s=n.top+e.clientTop,r=n.left+e.clientLeft,o=pn(e),i=e.clientWidth*o.x,a=e.clientHeight*o.y,c=r*o.x,l=s*o.y;return{width:i,height:a,x:c,y:l}}function la(e,t,n){let s;if(t==="viewport"||t==="layoutViewport")s=pp(e,n,t);else if(t==="document")s=hp(Ct(e));else if(Qe(t))s=gp(t,n);else{const r=Bc(e);s={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return or(s)}function mp(e,t){const n=t.get(e);if(n)return n;let s=ls(e,[],!1).filter(a=>Qe(a)&&In(a)!=="body"),r=null;const o=et(e).position==="fixed";let i=o?Kt(e):e;for(;Qe(i)&&!cs(i);){const a=et(i),c=ui(i),l=r?r.position:o?"fixed":"";!c&&(l==="fixed"||l==="absolute"&&a.position==="static")?s=s.filter(u=>u!==i):r=a,i=Kt(i)}return t.set(e,s),s}function yp(e){let{element:t,boundary:n,rootBoundary:s,strategy:r}=e;const i=[...n==="clippingAncestors"?xr(t)?[]:mp(t,this._c):[].concat(n),s],a=la(t,i[0],r);let c=a.top,l=a.right,h=a.bottom,u=a.left;for(let g=1;g<i.length;g++){const p=la(t,i[g],r);c=ft(p.top,c),l=It(p.right,l),h=It(p.bottom,h),u=ft(p.left,u)}return{width:l-u,height:h-c,x:u,y:c}}function vp(e){const{width:t,height:n}=_c(e);return{width:t,height:n}}function bp(e,t,n){const s=Dt(t),r=Ct(t),o=n==="fixed",i=Zt(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const c=pt(0);if((s||!o)&&((In(t)!=="body"||Sr(r))&&(a=$r(t)),s)){const g=Zt(t,!0,o,t);c.x=g.x+t.clientLeft,c.y=g.y+t.clientTop}!s&&r&&(c.x=Lr(r));const l=r&&!s&&!o?Uc(r,a):pt(0),h=i.left+a.scrollLeft-c.x-l.x,u=i.top+a.scrollTop-c.y-l.y;return{x:h,y:u,width:i.width,height:i.height}}function Kr(e){return et(e).position==="static"}function da(e,t){if(!Dt(e)||et(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ct(e)===n&&(n=n.ownerDocument.body),n}function qc(e,t){const n=Le(e);if(xr(e))return n;if(!Dt(e)){let r=Kt(e);for(;r&&!cs(r);){if(Qe(r)&&!Kr(r))return r;r=Kt(r)}return n}let s=da(e,t);for(;s&&rp(s)&&Kr(s);)s=da(s,t);return s&&cs(s)&&Kr(s)&&!ui(s)?n:s||ap(e)||n}const wp=async function(e){const t=this.getOffsetParent||qc,n=this.getDimensions,s=await n(e.floating);return{reference:bp(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function kp(e){return et(e).direction==="rtl"}const Cp={convertOffsetParentRelativeRectToViewportRelativeRect:dp,getDocumentElement:Ct,getClippingRect:yp,getOffsetParent:qc,getElementRects:wp,getClientRects:up,getDimensions:vp,getScale:pn,isElement:Qe,isRTL:kp};function Gc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ep(e,t,n){let s=null,r;const o=Ct(e);function i(){var h;clearTimeout(r),(h=s)==null||h.disconnect(),s=null}function a(h,u){h===void 0&&(h=!1),u===void 0&&(u=1),i();const g=e.getBoundingClientRect(),{left:p,top:f,width:d,height:m}=g;if(h||t(),!d||!m)return;const v=xs(f),k=xs(o.clientWidth-(p+d)),L=xs(o.clientHeight-(f+m)),O=xs(p),S={rootMargin:-v+"px "+-k+"px "+-L+"px "+-O+"px",threshold:ft(0,It(1,u))||1};let b=!0;function E(C){const x=C[0].intersectionRatio;if(!Gc(g,e.getBoundingClientRect()))return a();if(x!==u){if(!b)return a();x?a(!1,x):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b=!1}try{s=new IntersectionObserver(E,{...S,root:o.ownerDocument})}catch{s=new IntersectionObserver(E,S)}s.observe(e)}const c=Le(e),l=()=>a(n);return c.addEventListener("resize",l),a(!0),()=>{c.removeEventListener("resize",l),i()}}function Sp(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,l=fi(e),h=r||o?[...l?ls(l):[],...t?ls(t):[]]:[];h.forEach(v=>{r&&v.addEventListener("scroll",n),o&&v.addEventListener("resize",n)});const u=l&&a?Ep(l,n,o):null;let g=-1,p=null;i&&(p=new ResizeObserver(v=>{let[k]=v;k&&k.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var L;(L=p)==null||L.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let f,d=c?Zt(e):null;c&&m();function m(){const v=Zt(e);d&&!Gc(d,v)&&n(),d=v,f=requestAnimationFrame(m)}return n(),()=>{var v;h.forEach(k=>{r&&k.removeEventListener("scroll",n),o&&k.removeEventListener("resize",n)}),u?.(),(v=p)==null||v.disconnect(),p=null,c&&cancelAnimationFrame(f)}}const xp=ep,$p=tp,Lp=Jf,Ip=sp,Tp=Xf,Mp=zf,Ap=np,Op=(e,t,n)=>{const s=new Map,r=n??{},o={...Cp,...r.platform,_c:s};return Zf(e,t,{...r,platform:o})};function ua(e=0,t=0,n=0,s=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,s);const r={x:e,y:t,width:n,height:s,top:t,right:e+n,bottom:t+s,left:e};return{...r,toJSON:()=>r}}function Dp(e){if(!e)return ua();const{x:t,y:n,width:s,height:r}=e;return ua(t,n,s,r)}function Pp(e,t){return{contextElement:ye(e)?e:e?.contextElement,getBoundingClientRect:()=>{const n=e,s=t?.(n);return s||!n?Dp(s):n.getBoundingClientRect()}}}var Nn=e=>({variable:e,reference:`var(${e})`}),at={arrowSize:Nn("--arrow-size"),arrowSizeHalf:Nn("--arrow-size-half"),arrowBg:Nn("--arrow-background"),transformOrigin:Nn("--transform-origin"),arrowOffset:Nn("--arrow-offset")},Rp=e=>e==="top"||e==="bottom"?"y":"x";function Vp(e,t){return{name:"transformOrigin",fn(n){const{elements:s,middlewareData:r,placement:o,rects:i,y:a}=n,c=o.split("-")[0],l=Rp(c),h=r.arrow?.x||0,u=r.arrow?.y||0,g=t?.clientWidth||0,p=t?.clientHeight||0,f=h+g/2,d=u+p/2,m=Math.abs(r.shift?.y||0),v=i.reference.height/2,k=p/2,L=e.offset?.mainAxis??e.gutter,O=typeof L=="number"?L+k:L??k,w=m>O,S={top:`${f}px calc(100% + ${O}px)`,bottom:`${f}px ${-O}px`,left:`calc(100% + ${O}px) ${d}px`,right:`${-O}px ${d}px`}[c],b=`${f}px ${i.reference.y+v-a}px`,E=!!e.overlap&&l==="y"&&w;return s.floating.style.setProperty(at.transformOrigin.variable,E?b:S),{data:{transformOrigin:E?b:S}}}}}var Np={name:"rects",fn({rects:e}){return{data:e}}},Fp=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:s,y:r}=n.arrow,o=t.split("-")[0];return Object.assign(e.style,{left:s!=null?`${s}px`:"",top:r!=null?`${r}px`:"",[o]:`calc(100% + ${at.arrowOffset.reference})`}),{}}}};function Hp(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}function Yc(e){return e.split("-")[0]}var Wp={strategy:"absolute",placement:"bottom",listeners:!0,restoreStyles:!1,applyStyles:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function ha(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function fn(e,t){return e!=null&&Math.abs(e-t)<.5}function Ir(e){return typeof e=="function"?e():e==="clipping-ancestors"?"clippingAncestors":e}function jp(e,t,n){const s=e||t.createElement("div");return Mp({element:s,padding:n.arrowPadding})}function _p(e,t){if(!ju(t.offset??t.gutter))return xp(({placement:n})=>{const s=(e?.clientHeight||0)/2,r=t.offset?.mainAxis??t.gutter,o=typeof r=="number"?r+s:r??s,{hasAlign:i}=Hp(n),a=i?void 0:t.shift,c=t.offset?.crossAxis??a;return Qo({crossAxis:c,mainAxis:o,alignmentAxis:t.shift})})}function Bp(e){if(e.flip)return Lp(()=>{const t=Ir(e.boundary);return{...t?{boundary:t}:void 0,padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip}})}function Up(e){if(!(!e.slide&&!e.overlap))return $p(()=>{const t=Ir(e.boundary);return{...t?{boundary:t}:void 0,mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:Ap()}})}function qp(e){if(e.sizeMiddleware===!1&&!e.sameWidth&&!e.fitViewport)return;let t,n,s,r;return Ip(()=>{const o=Ir(e.boundary);return{padding:e.overflowPadding,...o?{boundary:o}:void 0,apply({elements:i,rects:a,availableHeight:c,availableWidth:l}){const h=i.floating,u=Math.round(a.reference.width),g=Math.round(a.reference.height);l=Math.floor(l),c=Math.floor(c),fn(t,u)||(h.style.setProperty("--reference-width",`${u}px`),t=u),fn(n,g)||(h.style.setProperty("--reference-height",`${g}px`),n=g),fn(s,l)||(h.style.setProperty("--available-width",`${l}px`),s=l),fn(r,c)||(h.style.setProperty("--available-height",`${c}px`),r=c)}}})}function Gp(e){if(e.hideWhenDetached)return Tp(()=>({strategy:"referenceHidden",boundary:Ir(e.boundary)??"clippingAncestors"}))}function Yp(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}var Kp=["transform","visibility","pointer-events","--x","--y","--z-index","z-index","--reference-width","--reference-height","--available-width","--available-height","--transform-origin"],Zp=["top","right","bottom","left"],Zn=new WeakSet;function zp(e,t){const n=e.style.getPropertyValue("z-index"),s=Zn.has(e),r=s&&n==="var(--z-index)";s&&!r&&Zn.delete(e);const o=$c(t).zIndex;if(o==="auto"){r&&(e.style.removeProperty("z-index"),Zn.delete(e));return}n&&!r||(e.style.setProperty("--z-index",o),e.style.setProperty("z-index","var(--z-index)"),Zn.add(e))}function fa(e,t){if(!e)return mc;const n=new Map(t.map(s=>[s,e.style.getPropertyValue(s)]));return()=>{n.forEach((s,r)=>{s?e.style.setProperty(r,s):e.style.removeProperty(r)}),e.style.length===0&&e.removeAttribute("style")}}function pa(e){return e==null?null:ye(e)?e:typeof e=="object"&&e&&"contextElement"in e&&e.contextElement?e.contextElement:e}function Jp(e,t,n={}){const s=()=>(typeof t=="function"?t():t)??null,r=()=>{const x=typeof e=="function"?e():e;return n.getAnchorElement?.()??x},o=()=>{const x=r();return!x&&!n.getAnchorRect?null:Pp(x,n.getAnchorRect)},i=Object.assign({},Wp,n);let a=[],c=null,l,h;function u(x){if(l?.(),h?.(),c=x,i.restoreStyles){const M=fa(x,Kp);l=()=>{M(),Zn.delete(x)}}else l=void 0;const y=x.querySelector("[data-part=arrow]");h=i.restoreStyles?fa(y,Zp):void 0,a=[_p(y,i),Bp(i),Up(i),jp(y,x.ownerDocument,i),Fp(y),Vp({gutter:i.gutter,offset:i.offset,overlap:i.overlap},y),qp(i),Gp(i),Np]}const{placement:g,strategy:p,onComplete:f,onPositioned:d}=i;let m,v,k=!1,L,O,w=mc;const S=Yp(i.listeners);function b(){if(!i.listeners)return;const x=r(),y=o(),M=s();if(!y||!M)return;(pa(x)!==pa(L)||M!==O)&&(w(),L=x,O=M,w=Sp(y,M,C,S))}async function E(){b();const x=s();if(!x)return;x!==c&&(u(x),k=!1);const y=o();if(!y)return;const M=await Op(y,x,{placement:g,middleware:a,strategy:p}),D=ke(x),H=ha(D,M.x),P=ha(D,M.y);if(f?.({...M,x:H,y:P}),i.applyStyles!==!1&&(fn(m,H)||(x.style.setProperty("--x",`${H}px`),m=H),fn(v,P)||(x.style.setProperty("--y",`${P}px`),v=P),i.hideWhenDetached&&(M.middlewareData.hide?.referenceHidden?(x.style.setProperty("visibility","hidden"),x.style.setProperty("pointer-events","none")):(x.style.removeProperty("visibility"),x.style.removeProperty("pointer-events"))),!k)){const F=x.firstElementChild;F&&(zp(x,F),k=!0)}}async function C(){n.updatePosition?(await n.updatePosition({updatePosition:E,floatingElement:s()}),d?.({placed:!0})):await E()}return C(),()=>{w(),h?.(),l?.(),d?.({placed:!1})}}function Mo(e,t,n={}){const{defer:s,...r}=n,o=s?we:a=>a(),i=[];return i.push(o(()=>{i.push(Jp(e,t,r))})),()=>{i.forEach(a=>a?.())}}var Xp={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function Kc(e={}){const{placement:t,sameWidth:n,fitViewport:s,strategy:r="absolute",applyStyles:o=!0}=e;return{arrow:{position:"absolute",width:at.arrowSize.reference,height:at.arrowSize.reference,[at.arrowSizeHalf.variable]:`calc(${at.arrowSize.reference} / 2)`,[at.arrowOffset.variable]:`calc(${at.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?Xp[t.split("-")[0]]:void 0,background:at.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:r,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:s?"var(--available-width)":void 0,maxHeight:s?"var(--available-height)":void 0,pointerEvents:t?void 0:"none",top:"0px",left:"0px",transform:t?"translate3d(var(--x, 0), var(--y, -100vh), 0)":"translate3d(0, -100vh, 0)",zIndex:o===!1?"var(--z-index)":void 0}}}var Qp=e=>e.ids?.root??`select:${e.id}`,Ao=e=>e.ids?.content??`select:${e.id}:content`,Oo=e=>e.ids?.trigger??`select:${e.id}:trigger`,Zc=e=>e.ids?.clearTrigger??`select:${e.id}:clear-trigger`,$s=e=>e.ids?.label??`select:${e.id}:label`,e1=e=>e.ids?.control??`select:${e.id}:control`,Do=(e,t)=>e.ids?.item?.(t)??`select:${e.id}:option:${t}`,Po=e=>e.ids?.hiddenSelect??`select:${e.id}:select`,zc=e=>e.ids?.positioner??`select:${e.id}:positioner`,t1=(e,t)=>e.ids?.itemGroup?.(t)??`select:${e.id}:optgroup:${t}`,ga=(e,t)=>e.ids?.itemGroupLabel?.(t)??`select:${e.id}:optgroup-label:${t}`,Zr=e=>e.getById(Po(e)),Fn=e=>e.getById(Ao(e)),Ut=e=>e.getById(Oo(e)),n1=e=>e.getById(Zc(e)),zr=e=>e.getById(zc(e)),Jr=(e,t)=>t==null?null:e.getById(Do(e,t)),s1={clearTriggerLabel:"Clear value"};function r1(e,t){const{context:n,prop:s,scope:r,state:o,computed:i,send:a}=e,c=vc(s1,s("translations")),l=s("disabled")||n.get("fieldsetDisabled"),h=!!s("invalid"),u=!!s("required"),g=!!s("readOnly"),p=s("composite"),f=s("collection"),d=o.hasTag("open"),m=o.matches("focused"),v=n.get("highlightedValue"),k=n.get("highlightedItem"),L=i("selectedItems"),O=n.get("currentPlacement"),w=O?Yc(O):void 0,S=i("isTypingAhead"),b=i("isInteractive"),E=v?Do(r,v):void 0;function C(y){const M=f.getItemDisabled(y.item),D=f.getItemValue(y.item);return vr(D,()=>`[zag-js] No value found for item ${JSON.stringify(y.item)}`),{value:D,disabled:!!(l||M),highlighted:v===D,selected:n.get("value").includes(D)}}const x=Kc({...s("positioning"),placement:O});return{open:d,focused:m,empty:n.get("value").length===0,highlightedItem:k,highlightedValue:v,selectedItems:L,hasSelectedItems:i("hasSelectedItems"),value:n.get("value"),valueAsString:i("valueAsString"),collection:f,multiple:!!s("multiple"),disabled:!!l,reposition(y={}){a({type:"POSITIONING.SET",options:y})},focus(){Ut(r)?.focus({preventScroll:!0})},setOpen(y){a({type:y?"OPEN":"CLOSE",replaces:"open"})},selectValue(y){a({type:"ITEM.SELECT",value:y})},setValue(y){a({type:"VALUE.SET",value:y})},selectAll(){a({type:"VALUE.SET",value:f.getValues()})},setHighlightValue(y){a({type:"HIGHLIGHTED_VALUE.SET",value:y})},clearHighlightValue(){a({type:"HIGHLIGHTED_VALUE.CLEAR"})},clearValue(y){a(y?{type:"ITEM.CLEAR",value:y}:{type:"VALUE.CLEAR"})},getItemState:C,getRootProps(){return t.element({...Ee.root.attrs,dir:s("dir"),id:Qp(r),"data-invalid":V(h),"data-readonly":V(g)})},getLabelProps(){return t.label({dir:s("dir"),id:$s(r),...Ee.label.attrs,"data-disabled":V(l),"data-invalid":V(h),"data-readonly":V(g),"data-required":V(u),htmlFor:Po(r),onClick(y){y.defaultPrevented||l||Ut(r)?.focus({preventScroll:!0})}})},getControlProps(){return t.element({...Ee.control.attrs,dir:s("dir"),id:e1(r),"data-state":d?"open":"closed","data-focus":V(m),"data-disabled":V(l),"data-invalid":V(h)})},getValueTextProps(){return t.element({...Ee.valueText.attrs,dir:s("dir"),"data-disabled":V(l),"data-invalid":V(h),"data-focus":V(m)})},getTriggerProps(){return t.button({id:Oo(r),disabled:l,dir:s("dir"),type:"button",role:"combobox","aria-controls":Ao(r),"aria-expanded":d,"aria-haspopup":"listbox","data-state":d?"open":"closed","aria-invalid":h,"aria-required":u,"aria-labelledby":$s(r),...Ee.trigger.attrs,"data-disabled":V(l),"data-invalid":V(h),"data-readonly":V(g),"data-placement":O,"data-side":w,"data-placeholder-shown":V(!i("hasSelectedItems")),onClick(y){b&&(y.defaultPrevented||a({type:"TRIGGER.CLICK"}))},onFocus(){a({type:"TRIGGER.FOCUS"})},onBlur(){a({type:"TRIGGER.BLUR"})},onKeyDown(y){if(y.defaultPrevented||!b)return;const D={ArrowUp(){a({type:"TRIGGER.ARROW_UP"})},ArrowDown(H){a({type:H.altKey?"OPEN":"TRIGGER.ARROW_DOWN"})},ArrowLeft(){a({type:"TRIGGER.ARROW_LEFT"})},ArrowRight(){a({type:"TRIGGER.ARROW_RIGHT"})},Home(){a({type:"TRIGGER.HOME"})},End(){a({type:"TRIGGER.END"})},Enter(){a({type:"TRIGGER.ENTER"})},Space(H){a(S?{type:"TRIGGER.TYPEAHEAD",key:H.key}:{type:"TRIGGER.ENTER"})}}[ko(y,{dir:s("dir"),orientation:"vertical"})];if(D){D(y),y.preventDefault();return}So.isValidEvent(y)&&(a({type:"TRIGGER.TYPEAHEAD",key:y.key}),y.preventDefault())}})},getIndicatorProps(){return t.element({...Ee.indicator.attrs,dir:s("dir"),"aria-hidden":!0,"data-state":d?"open":"closed","data-disabled":V(l),"data-invalid":V(h),"data-readonly":V(g)})},getItemProps(y){const M=C(y);return t.element({id:Do(r,M.value),role:"option",...Ee.item.attrs,dir:s("dir"),"data-value":M.value,"aria-selected":M.selected,"data-state":M.selected?"checked":"unchecked","data-highlighted":V(M.highlighted),"data-disabled":V(M.disabled),"aria-disabled":be(M.disabled),onPointerMove(D){M.disabled||D.pointerType!=="mouse"||Lo()==="pointer"&&M.value!==v&&a({type:"ITEM.POINTER_MOVE",value:M.value})},onClick(D){D.defaultPrevented||M.disabled||a({type:"ITEM.CLICK",src:"pointerup",value:M.value})},onPointerLeave(D){M.disabled||y.persistFocus||D.pointerType==="mouse"&&Lo()==="pointer"&&a({type:"ITEM.POINTER_LEAVE"})}})},getItemTextProps(y){const M=C(y);return t.element({...Ee.itemText.attrs,"data-state":M.selected?"checked":"unchecked","data-disabled":V(M.disabled),"data-highlighted":V(M.highlighted)})},getItemIndicatorProps(y){const M=C(y);return t.element({"aria-hidden":!0,...Ee.itemIndicator.attrs,"data-state":M.selected?"checked":"unchecked",hidden:!M.selected})},getItemGroupLabelProps(y){const{htmlFor:M}=y;return t.element({...Ee.itemGroupLabel.attrs,id:ga(r,M),dir:s("dir"),role:"presentation"})},getItemGroupProps(y){const{id:M}=y;return t.element({...Ee.itemGroup.attrs,"data-disabled":V(l),id:t1(r,M),"aria-labelledby":ga(r,M),role:"group",dir:s("dir")})},getClearTriggerProps(){return t.button({...Ee.clearTrigger.attrs,id:Zc(r),type:"button","aria-label":c.clearTriggerLabel,"data-invalid":V(h),disabled:l,hidden:!i("hasSelectedItems"),dir:s("dir"),onClick(y){y.defaultPrevented||a({type:"CLEAR.CLICK"})}})},getHiddenSelectProps(){const y=n.get("value"),M=s("multiple")?y:y?.[0],D=H=>{const P=ri(H);Tc(P)||a({type:"VALUE.SET",value:o1(H.currentTarget)})};return t.select({name:s("name"),form:s("form"),disabled:l,multiple:s("multiple"),required:s("required"),"aria-hidden":!0,id:Po(r),defaultValue:M,style:kf,tabIndex:-1,autoComplete:s("autoComplete"),onChange:D,onInput:D,onFocus(){Ut(r)?.focus({preventScroll:!0})},"aria-labelledby":$s(r)})},getPositionerProps(){return t.element({...Ee.positioner.attrs,dir:s("dir"),id:zc(r),style:x.floating})},getContentProps(){return t.element({hidden:!d,dir:s("dir"),id:Ao(r),role:p?"listbox":"dialog",...Ee.content.attrs,"data-state":d?"open":"closed","data-placement":O,"data-side":w,"data-activedescendant":E,"aria-activedescendant":p?E:void 0,"aria-multiselectable":s("multiple")&&p?!0:void 0,"aria-labelledby":$s(r),tabIndex:0,onKeyDown(y){if(!b||!wn(y.currentTarget,yt(y)))return;if(y.key==="Tab"&&!Zh(y)){y.preventDefault();return}const M={ArrowUp(){a({type:"CONTENT.ARROW_UP"})},ArrowDown(){a({type:"CONTENT.ARROW_DOWN"})},Home(){a({type:"CONTENT.HOME"})},End(){a({type:"CONTENT.END"})},Enter(){a({type:"ITEM.CLICK",src:"keydown.enter"})},Space(P){S?a({type:"CONTENT.TYPEAHEAD",key:P.key}):M.Enter?.()}},D=M[ko(y)];if(D){D(y),y.preventDefault();return}const H=yt(y);dh(H)||So.isValidEvent(y)&&(a({type:"CONTENT.TYPEAHEAD",key:y.key}),y.preventDefault())}})},getListProps(){return t.element({...Ee.list.attrs,tabIndex:0,role:p?void 0:"listbox","aria-labelledby":Oo(r),"aria-activedescendant":p?void 0:E,"aria-multiselectable":!p&&s("multiple")?!0:void 0})}}}var o1=e=>e.multiple?Array.from(e.selectedOptions,t=>t.value):e.value?[e.value]:[];function i1(e,t,n){let s=[],r;return o=>{const i=e(o);return(i.length!==s.length||i.some((c,l)=>!$n(s[l],c)))&&(s=i,r=t(i,o)),r}}function a1(){const e=new Map;return{claim(t){const n=Symbol(t);return e.set(t,n),n},isReplaced(t,n){return e.get(t)!==n}}}var Pt=".",Jc="#",ma=new WeakMap,Xc=new WeakMap;function Ro(e){return e.join(Pt)}function c1(e){return e.includes(Pt)}function Qc(e){return e.startsWith(Jc)}function l1(e){return e.startsWith(Pt)}function d1(e){return Qc(e)?e.slice(Jc.length):e}function Vo(e,t){return e?`${e}${Pt}${t}`:t}function u1(e){const t=new Map,n=new Map,s=(r,o)=>{t.set(r,o);const i=o.id;i&&(n.has(i)&&zi(`[zag-js] Duplicate state id: "${i}"`),n.set(i,r));const a=o.states;if(a){vr(o.initial,()=>`[zag-js] Compound state "${r}" has child states but no "initial" property`),o.initial in a||zi(`[zag-js] Compound state "${r}" has initial "${String(o.initial)}" which is not a child state`);for(const[c,l]of Object.entries(a)){if(!l)continue;const h=Vo(r,c);s(h,l)}}};for(const[r,o]of Object.entries(e.states))o&&s(r,o);return{index:t,idIndex:n}}function ys(e){const t=ma.get(e);if(t)return t;const{index:n,idIndex:s}=u1(e);return ma.set(e,n),Xc.set(e,s),n}function h1(e,t){return ys(e),Xc.get(e)?.get(t)}function pi(e){return e?String(e).split(Pt).filter(Boolean):[]}function ir(e,t){if(!t)return[];const n=ys(e),s=pi(t),r=[],o=[];for(const i of s){o.push(i);const a=Ro(o),c=n.get(a);if(!c)break;r.push({path:a,state:c})}return r}function Hn(e,t){const n=ys(e),s=pi(t);if(!s.length)return t;const r=[];for(const a of s){r.push(a);const c=Ro(r);if(!n.has(c))return t}let o=Ro(r),i=n.get(o);for(;i?.initial;){const a=`${o}${Pt}${i.initial}`,c=n.get(a);if(!c)break;o=a,i=c}return o}function ya(e,t){return ys(e).has(t)}function va(e,t,n){const s=String(t);if(Qc(s)){const r=d1(s),o=h1(e,r);return vr(o,()=>`[zag-js] Unknown state id: "${r}"`),Hn(e,o)}if(l1(s)&&n){const r=Vo(n,s.slice(1));return Hn(e,r)}if(!c1(s)&&n){const r=pi(n);for(let o=r.length-1;o>=1;o--){const i=r.slice(0,o).join(Pt),a=Vo(i,s);if(ya(e,a))return Hn(e,a)}if(ya(e,s))return Hn(e,s)}return Hn(e,s)}function f1(e,t,n){const s=ir(e,t);for(let o=s.length-1;o>=0;o--){const a=s[o]?.state.on?.[n];if(a)return{transitions:a,source:s[o]?.path}}return{transitions:e.on?.[n],source:void 0}}function p1(e,t,n,s){const r=t?ir(e,t):[],o=ir(e,n);let i=0;for(;i<r.length&&i<o.length&&r[i]?.path===o[i]?.path;)i+=1;let a=r.slice(i).reverse(),c=o.slice(i);const l=r[r.length-1]?.path===o[o.length-1]?.path;return s&&l&&(a=r.slice().reverse(),c=o),{exiting:a,entering:c}}function g1(e,t){return e?e===t||e.startsWith(`${t}${Pt}`):!1}function m1(e,t,n){return ir(e,t).some(s=>s.state.tags?.includes(n))}function el(){return{and:(...e)=>function(n){return e.every(s=>n.guard(s))},or:(...e)=>function(n){return e.some(s=>n.guard(s))},not:e=>function(n){return!n.guard(e)}}}function tl(e){return ys(e),e}var zn=(e=>(e.NotStarted="Not Started",e.Started="Started",e.Stopped="Stopped",e))(zn||{}),Ls="__init__";function y1(e){const t=()=>e.getRootNode?.()??document,n=()=>We(t());return{...e,getRootNode:t,getDoc:n,getWin:()=>n().defaultView??window,getActiveElement:()=>wr(t()),isActiveElement:wo,getById:i=>t().getElementById(i)}}function v1(e){const t={each(n){for(let s=0;s<e.frames?.length;s+=1){const r=e.frames[s];r&&n(r)}},addEventListener(n,s,r){return t.each(o=>{try{o.document.addEventListener(n,s,r)}catch{}}),()=>{try{t.removeEventListener(n,s,r)}catch{}}},removeEventListener(n,s,r){t.each(o=>{try{o.document.removeEventListener(n,s,r)}catch{}})}};return t}function b1(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,s,r)=>{try{t?.addEventListener(n,s,r)}catch{}return()=>{try{t?.removeEventListener(n,s,r)}catch{}}},removeEventListener:(n,s,r)=>{try{t?.removeEventListener(n,s,r)}catch{}}}}var ba="pointerdown.outside",wa="focus.outside";function w1(e){for(const t of e)if(ye(t)&&kr(t))return!0;return!1}var nl=e=>"clientY"in e;function k1(e,t){if(!nl(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function C1(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function ka(e,t){if(!t||!nl(e))return!1;const n=t.scrollHeight>t.clientHeight,s=n&&e.clientX>t.offsetLeft+t.clientWidth,r=t.scrollWidth>t.clientWidth,o=r&&e.clientY>t.offsetTop+t.clientHeight,i={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(r?16:0)},a={x:e.clientX,y:e.clientY};return C1(i,a)?s||o:!1}function E1(e,t){const{exclude:n,onFocusOutside:s,onPointerDownOutside:r,onInteractOutside:o,defer:i,followControlledElements:a=!0}=t;if(!e)return;const c=We(e),l=ke(e),h=v1(l),u=b1(l);function g(w,S){if(!ye(S)||!S.isConnected||wn(e,S)||k1(e,w)||a&&Lh(e,S))return!1;const b=c.querySelector(`[aria-controls="${e.id}"]`);if(b){const C=Co(b);if(ka(w,C))return!1}const E=Co(e);return ka(w,E)?!1:!n?.(S)}const p=new Set,f=bn(e?.getRootNode());let d=!1;function m(w){d=!0;const S=()=>{d=!1};c.addEventListener("pointerup",S,{once:!0}),l.addEventListener("pointerup",S,{once:!0});function b(E){const C=i&&!Xi()?we:M=>M(),x=E??w,y=x?.composedPath?.()??[x?.target];C(()=>{const M=f?y[0]:yt(w);if(!(!e||!g(w,M))){if(r||o){const D=Xs(r,o);e.addEventListener(ba,D,{once:!0})}Ca(e,ba,{bubbles:!1,cancelable:!0,detail:{originalEvent:x,contextmenu:Ah(x),focusable:w1(y),target:M}})}})}w.pointerType==="touch"?(p.forEach(E=>E()),p.add(Bs(c,"click",b,{once:!0})),p.add(u.addEventListener("click",b,{once:!0})),p.add(h.addEventListener("click",b,{once:!0}))):b()}const v=new Set,k=setTimeout(()=>{v.add(Bs(c,"pointerdown",m,!0)),v.add(u.addEventListener("pointerdown",m,!0)),v.add(h.addEventListener("pointerdown",m,!0))},0),L=Mc.create();function O(w){if(d)return;(i?b=>L.request(b):b=>b())(()=>{const b=w?.composedPath?.()??[w?.target],E=f?b[0]:yt(w);if(!(!e||!g(w,E))){if(s||o){const C=Xs(s,o);e.addEventListener(wa,C,{once:!0})}Ca(e,wa,{bubbles:!1,cancelable:!0,detail:{originalEvent:w,contextmenu:!1,focusable:kr(E),target:E}})}})}return Xi()||(v.add(Bs(c,"focusin",O,!0)),v.add(u.addEventListener("focusin",O,!0)),v.add(h.addEventListener("focusin",O,!0))),()=>{clearTimeout(k),L.cancel(),p.forEach(w=>w()),v.forEach(w=>w())}}function S1(e,t){const{defer:n}=t,s=n?we:o=>o(),r=[];return r.push(s(()=>{const o=typeof e=="function"?e():e;r.push(E1(o,t))})),()=>{r.forEach(o=>o?.())}}function Ca(e,t,n){const s=e.ownerDocument.defaultView||window,r=new s.CustomEvent(t,n);return e.dispatchEvent(r)}function x1(e,t){const n=s=>{s.key==="Escape"&&(s.isComposing||t?.(s))};return Bs(We(e),"keydown",n,{capture:!0})}var Ea="layer:request-dismiss",$e={layers:[],branches:[],recentlyRemoved:new Set,count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf(this.topMostPointerBlockingLayer()?.node):-1;return t<n},isTopMost(e){return this.layers[this.count()-1]?.node===e},getNestedLayers(e){return Array.from(this.layers).slice(this.indexOf(e)+1)},getLayersByType(e){return this.layers.filter(t=>t.type===e)},getNestedLayersByType(e,t){const n=this.indexOf(e);return n===-1?[]:this.layers.slice(n+1).filter(s=>s.type===t)},getParentLayerOfType(e,t){const n=this.indexOf(e);if(!(n<=0))return this.layers.slice(0,n).reverse().find(s=>s.type===t)},countNestedLayersOfType(e,t){return this.getNestedLayersByType(e,t).length},isInNestedLayer(e,t){return!!(this.getNestedLayers(e).some(s=>wn(s.node,t))||this.recentlyRemoved.size>0)},isInBranch(e){return Array.from(this.branches).some(t=>wn(t,e))},add(e){const t=this.indexOf(e.node);t!==-1&&this.layers.splice(t,1),this.layers.push(e),this.syncLayers()},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);if(t<0)return;this.layers[t].styleTargets?.forEach(s=>{const r=s();r&&$1(r)}),this.recentlyRemoved.add(e),Oc(()=>this.recentlyRemoved.delete(e)),t<this.count()-1&&this.getNestedLayers(e).forEach(r=>$e.dismiss(r.node,e)),this.layers.splice(t,1),this.syncLayers()},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},syncLayers(){this.layers.forEach((e,t)=>{Sa(e,t,e.node),e.styleTargets?.forEach(n=>{const s=n();if(!s||s===e.node)return;Sa(e,t,s);const{zIndex:r}=$c(e.node);s.style.setProperty("--z-index",r)})})},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e,t){const n=this.indexOf(e);if(n===-1)return;const s=this.layers[n];I1(e,Ea,r=>{s.requestDismiss?.(r),r.defaultPrevented||s?.dismiss()}),L1(e,Ea,{originalLayer:e,targetLayer:t,originalIndex:n,targetIndex:t?this.indexOf(t):-1}),this.syncLayers()},clear(){this.remove(this.layers[0].node)}};function Sa(e,t,n){n.style.setProperty("--layer-index",`${t}`),n.removeAttribute("data-nested"),n.removeAttribute("data-has-nested"),$e.getParentLayerOfType(e.node,e.type)&&n.setAttribute("data-nested",e.type);const r=$e.countNestedLayersOfType(e.node,e.type);r>0&&n.setAttribute("data-has-nested",e.type),n.style.setProperty("--nested-layer-count",`${r}`)}function $1(e){e.style.removeProperty("--layer-index"),e.style.removeProperty("--nested-layer-count"),e.removeAttribute("data-nested"),e.removeAttribute("data-has-nested")}function L1(e,t,n){const s=e.ownerDocument.defaultView||window,r=new s.CustomEvent(t,{cancelable:!0,bubbles:!0,detail:n});return e.dispatchEvent(r)}function I1(e,t,n){e.addEventListener(t,n,{once:!0})}var Xr=new WeakMap,ns=new WeakMap;function T1(e){return $e.isBelowPointerBlockingLayer(e)?"none":"auto"}function sl(e){const t=T1(e);e.style.pointerEvents!==t&&(e.style.pointerEvents=t)}function M1(e){if(ns.has(e))return;const t=ke(e);if(typeof t.MutationObserver>"u")return;const n=new t.MutationObserver(()=>{ns.has(e)&&sl(e)});n.observe(e,{attributes:!0,attributeFilter:["style"]}),ns.set(e,n)}function xa(){$e.layers.forEach(({node:e})=>{sl(e),M1(e)})}function A1(e){const t=ns.get(e);t&&(t.disconnect(),ns.delete(e)),e.style.pointerEvents=""}function O1(e,t){const n=We(e),s=[];return $e.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Xr.set(n.body,n.body.style.pointerEvents),queueMicrotask(()=>{const r=n.body;r&&(r.style.pointerEvents="none",r.setAttribute("data-inert",""))})),t?.forEach(r=>{const[o,i]=Ef(()=>{const a=r();return ye(a)?a:null},{timeout:1e3});o.then(a=>s.push(yf(a,{pointerEvents:"auto"}))),s.push(i)}),()=>{$e.hasPointerBlockingLayer()||(queueMicrotask(()=>{const r=n.body;if(!r)return;const o=Xr.get(r);o!==void 0&&(r.style.pointerEvents=o,Xr.delete(r)),r.removeAttribute("data-inert"),r.style.length===0&&r.removeAttribute("style")}),s.forEach(r=>r()))}}function D1(e,t){const{onDismiss:n,onRequestDismiss:s,pointerBlocking:r,exclude:o,debug:i,type:a="dialog",layerStyleTargets:c}=t,l={dismiss:n,node:e,type:a,pointerBlocking:r,requestDismiss:s,styleTargets:c};$e.add(l),xa();function h(d){const m=yt(d.detail.originalEvent);$e.isBelowPointerBlockingLayer(e)||$e.isInBranch(m)||(t.onPointerDownOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&(i&&console.log("onPointerDownOutside:",d.detail.originalEvent),n?.(d)))}function u(d){const m=yt(d.detail.originalEvent);$e.isInBranch(m)||(t.onFocusOutside?.(d),t.onInteractOutside?.(d),!d.defaultPrevented&&(i&&console.log("onFocusOutside:",d.detail.originalEvent),n?.(d)))}function g(d){$e.isTopMost(e)&&(t.onEscapeKeyDown?.(d),!d.defaultPrevented&&n&&(d.preventDefault(),n(d)))}function p(d){const m=typeof o=="function"?o():o,v=Array.isArray(m)?m:[m],k=t.persistentElements?.map(L=>L()).filter(ye);return k&&v.push(...k),v.some(L=>wn(L,d))||$e.isInNestedLayer(e,d)}const f=[r?O1(e,t.persistentElements):void 0,x1(e,g),S1(e,{exclude:p,onFocusOutside:u,onPointerDownOutside:h,defer:t.defer})];return()=>{$e.remove(e),xa(),A1(e),f.forEach(d=>d?.())}}function rl(e,t){const{warnOnMissingNode:n=!0}=t;return xf(e,s=>D1(s,t),{defer:t.defer,getRootNode:t.getRootNode,onMissing:n?()=>js("[@zag-js/dismissable] node is `null` or `undefined`"):void 0})}var{and:Wn,not:jt,or:P1}=el(),R1=tl({props({props:e}){return{loopFocus:!1,closeOnSelect:!e.multiple,composite:!0,defaultValue:[],...e,collection:e.collection??Qs.empty(),positioning:{placement:"bottom-start",gutter:8,...e.positioning}}},context({prop:e,bindable:t,getContext:n}){const s=e("value")??e("defaultValue")??[],r=e("collection").findMany(s);return{value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:$n,onChange(o){const i=n(),a=e("collection"),c=i.get("selectedItemMap"),l=Es({values:o,collection:a,selectedItemMap:c}),h=e("value")??o,u=h===o?l:Es({values:h,collection:a,selectedItemMap:l.nextSelectedItemMap});return i.set("selectedItemMap",u.nextSelectedItemMap),e("onValueChange")?.({value:o,items:l.selectedItems})}})),highlightedValue:t(()=>({defaultValue:e("defaultHighlightedValue")||null,value:e("highlightedValue"),onChange(o){e("onHighlightChange")?.({highlightedValue:o,highlightedItem:e("collection").find(o),highlightedIndex:e("collection").indexOf(o)})}})),currentPlacement:t(()=>({defaultValue:void 0})),fieldsetDisabled:t(()=>({defaultValue:!1})),highlightedItem:t(()=>({defaultValue:null})),selectedItemMap:t(()=>({defaultValue:Qu({selectedItems:r,collection:e("collection")})}))}},refs(){return{typeahead:{...So.defaultOptions}}},computed:{hasSelectedItems:({context:e})=>e.get("value").length>0,isTypingAhead:({refs:e})=>e.get("typeahead").keysSoFar!=="",isDisabled:({prop:e,context:t})=>!!e("disabled")||!!t.get("fieldsetDisabled"),isInteractive:({prop:e})=>!(e("disabled")||e("readOnly")),selectedItems:({context:e,prop:t})=>kc({values:e.get("value"),collection:t("collection"),selectedItemMap:e.get("selectedItemMap")}),valueAsString:({computed:e,prop:t})=>t("collection").stringifyItems(e("selectedItems"))},initialState({prop:e}){return e("open")||e("defaultOpen")?"open":"idle"},entry:["syncSelectElement"],watch({context:e,prop:t,track:n,action:s}){n([()=>e.get("value").toString()],()=>{s(["syncSelectedItems","syncSelectElement","dispatchChangeEvent"])}),n([()=>t("open")],()=>{s(["toggleVisibility"])}),n([()=>e.get("highlightedValue")],()=>{s(["syncHighlightedItem"])}),n([()=>t("collection").toString()],()=>{s(["syncCollection"])})},on:{"HIGHLIGHTED_VALUE.SET":{actions:["setHighlightedItem"]},"HIGHLIGHTED_VALUE.CLEAR":{actions:["clearHighlightedItem"]},"ITEM.SELECT":{actions:["selectItem"]},"ITEM.CLEAR":{actions:["clearItem"]},"VALUE.SET":{actions:["setSelectedItems"]},"VALUE.CLEAR":{actions:["clearSelectedItems"]},"CLEAR.CLICK":{actions:["clearSelectedItems","focusTriggerEl"]}},effects:["trackFormControlState"],states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{target:"open",actions:["setInitialFocus"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen","setInitialFocus","highlightFirstSelectedItem"]}],"TRIGGER.FOCUS":{target:"focused"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":[{guard:"isTriggerClickEvent",target:"open",actions:["setInitialFocus","highlightFirstSelectedItem"]},{guard:"isTriggerArrowUpEvent",target:"open",actions:["setInitialFocus","highlightComputedLastItem"]},{guard:P1("isTriggerArrowDownEvent","isTriggerEnterEvent"),target:"open",actions:["setInitialFocus","highlightComputedFirstItem"]},{target:"open",actions:["setInitialFocus"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen"]}],"TRIGGER.BLUR":{target:"idle"},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightFirstSelectedItem"]}],"TRIGGER.ENTER":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_UP":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedLastItem"]}],"TRIGGER.ARROW_DOWN":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["setInitialFocus","invokeOnOpen","highlightComputedFirstItem"]}],"TRIGGER.ARROW_LEFT":[{guard:Wn(jt("multiple"),"hasSelectedItems"),actions:["selectPreviousItem"]},{guard:jt("multiple"),actions:["selectLastItem"]}],"TRIGGER.ARROW_RIGHT":[{guard:Wn(jt("multiple"),"hasSelectedItems"),actions:["selectNextItem"]},{guard:jt("multiple"),actions:["selectFirstItem"]}],"TRIGGER.HOME":{guard:jt("multiple"),actions:["selectFirstItem"]},"TRIGGER.END":{guard:jt("multiple"),actions:["selectLastItem"]},"TRIGGER.TYPEAHEAD":{guard:jt("multiple"),actions:["selectMatchingItem"]}}},open:{tags:["open"],exit:["scrollContentToTop"],effects:["trackDismissableElement","trackFocusVisible","computePlacement","scrollToHighlightedItem"],on:{"CONTROLLED.CLOSE":[{guard:"restoreFocus",target:"focused",actions:["focusTriggerEl","clearHighlightedItem"]},{target:"idle",actions:["clearHighlightedItem"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{guard:"restoreFocus",target:"focused",actions:["invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{target:"idle",actions:["invokeOnClose","clearHighlightedItem"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose","clearHighlightedItem"]}],"ITEM.CLICK":[{guard:Wn("closeOnSelect","isOpenControlled"),actions:["selectHighlightedItem","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectHighlightedItem","invokeOnClose","focusTriggerEl","clearHighlightedItem"]},{actions:["selectHighlightedItem"]}],"CONTENT.HOME":{actions:["highlightFirstItem"]},"CONTENT.END":{actions:["highlightLastItem"]},"CONTENT.ARROW_DOWN":[{guard:Wn("hasHighlightedItem","loop","isLastItemHighlighted"),actions:["highlightFirstItem"]},{guard:"hasHighlightedItem",actions:["highlightNextItem"]},{actions:["highlightFirstItem"]}],"CONTENT.ARROW_UP":[{guard:Wn("hasHighlightedItem","loop","isFirstItemHighlighted"),actions:["highlightLastItem"]},{guard:"hasHighlightedItem",actions:["highlightPreviousItem"]},{actions:["highlightLastItem"]}],"CONTENT.TYPEAHEAD":{actions:["highlightMatchingItem"]},"ITEM.POINTER_MOVE":{actions:["highlightItem"]},"ITEM.POINTER_LEAVE":{actions:["clearHighlightedItem"]},"POSITIONING.SET":{actions:["reposition"]}}}},implementations:{guards:{loop:({prop:e})=>!!e("loopFocus"),multiple:({prop:e})=>!!e("multiple"),hasSelectedItems:({computed:e})=>!!e("hasSelectedItems"),hasHighlightedItem:({context:e})=>e.get("highlightedValue")!=null,isFirstItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").firstValue,isLastItemHighlighted:({context:e,prop:t})=>e.get("highlightedValue")===t("collection").lastValue,closeOnSelect:({prop:e,event:t})=>!!(t.closeOnSelect??e("closeOnSelect")),restoreFocus:({event:e})=>$a(e),isOpenControlled:({prop:e})=>e("open")!==void 0,isTriggerClickEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.CLICK",isTriggerEnterEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.ENTER",isTriggerArrowUpEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.ARROW_UP",isTriggerArrowDownEvent:({event:e})=>e.previousEvent?.type==="TRIGGER.ARROW_DOWN"},effects:{trackFocusVisible({scope:e}){return Nf({root:e.getRootNode?.()})},trackFormControlState({context:e,scope:t}){return Fh(Zr(t),{onFieldsetDisabledChange(n){e.set("fieldsetDisabled",n)},onFormReset(){const n=e.initial("value");e.set("value",n)}})},trackDismissableElement({scope:e,send:t,prop:n}){const s=()=>Fn(e);let r=!0;return rl(s,{type:"listbox",defer:!0,getRootNode:e.getRootNode,layerStyleTargets:[()=>zr(e)],exclude:[Ut(e),n1(e)],onFocusOutside:n("onFocusOutside"),onPointerDownOutside:n("onPointerDownOutside"),onInteractOutside(o){n("onInteractOutside")?.(o),r=!(o.detail.focusable||o.detail.contextmenu)},onDismiss(o){t({type:"CLOSE",src:"interact-outside",restoreFocus:r,focusVisible:o?.type==="keydown"})}})},computePlacement({context:e,prop:t,scope:n}){const s=t("positioning");return e.set("currentPlacement",s.placement),Mo(()=>Ut(n),()=>zr(n),{defer:!0,...s,onComplete(i){e.set("currentPlacement",i.placement)}})},scrollToHighlightedItem({context:e,prop:t,scope:n}){const s=a=>{const c=e.get("highlightedValue");if(c==null||Lo()==="pointer")return;const h=Fn(n),u=t("scrollToIndexFn");if(u){const p=t("collection").indexOf(c);u?.({index:p,immediate:a,getElement:()=>Jr(n,c)});return}const g=Jr(n,c);uf(g,{rootEl:h,block:"nearest"})},r=we(()=>{Vf("virtual"),s(!0)}),i=Qh(()=>Fn(n),{attributes:["data-activedescendant"],callback(){s(!1)}});return()=>{r(),i()}}},actions:{reposition({context:e,prop:t,scope:n,event:s}){const r=()=>zr(n);Mo(Ut(n),r,{...t("positioning"),...s.options,defer:!0,listeners:!1,onComplete(o){e.set("currentPlacement",o.placement)}})},toggleVisibility({send:e,prop:t,event:n}){e({type:t("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:n})},highlightPreviousItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const s=t("collection").getPreviousValue(n,1,t("loopFocus"));s!=null&&e.set("highlightedValue",s)},highlightNextItem({context:e,prop:t}){const n=e.get("highlightedValue");if(n==null)return;const s=t("collection").getNextValue(n,1,t("loopFocus"));s!=null&&e.set("highlightedValue",s)},highlightFirstItem({context:e,prop:t}){const n=t("collection").firstValue;e.set("highlightedValue",n)},highlightLastItem({context:e,prop:t}){const n=t("collection").lastValue;e.set("highlightedValue",n)},setInitialFocus({scope:e}){we(()=>{const t=Kh({root:Fn(e)});t&&t.focus({preventScroll:!0})})},focusTriggerEl({event:e,scope:t}){if(!$a(e))return;const n=V1(e);we(()=>{Ut(t)?.focus(n)})},selectHighlightedItem({context:e,prop:t,event:n}){let s=n.value??e.get("highlightedValue");if(s==null||!t("collection").has(s))return;t("onSelect")?.({value:s}),s=t("deselectable")&&!t("multiple")&&e.get("value").includes(s)?null:s,e.set("value",o=>s==null?[]:t("multiple")?Gi(o,s):[s])},highlightComputedFirstItem({context:e,prop:t,computed:n}){const s=t("collection"),r=n("hasSelectedItems")?s.sort(e.get("value"))[0]:s.firstValue;e.set("highlightedValue",r)},highlightComputedLastItem({context:e,prop:t,computed:n}){const s=t("collection"),r=n("hasSelectedItems")?s.sort(e.get("value"))[0]:s.lastValue;e.set("highlightedValue",r)},highlightFirstSelectedItem({context:e,prop:t,computed:n}){if(!n("hasSelectedItems"))return;const s=t("collection").sort(e.get("value"))[0];e.set("highlightedValue",s)},highlightItem({context:e,event:t}){e.set("highlightedValue",t.value)},highlightMatchingItem({context:e,prop:t,event:n,refs:s}){const r=t("collection").search(n.key,{state:s.get("typeahead"),currentValue:e.get("highlightedValue")});r!=null&&e.set("highlightedValue",r)},setHighlightedItem({context:e,event:t}){e.set("highlightedValue",t.value)},clearHighlightedItem({context:e}){e.set("highlightedValue",null)},selectItem({context:e,prop:t,event:n}){t("onSelect")?.({value:n.value});const r=t("deselectable")&&!t("multiple")&&e.get("value").includes(n.value)?null:n.value;e.set("value",o=>r==null?[]:t("multiple")?Gi(o,r):[r])},clearItem({context:e,event:t}){e.set("value",n=>n.filter(s=>s!==t.value))},setSelectedItems({context:e,event:t}){e.set("value",t.value)},clearSelectedItems({context:e}){e.set("value",[])},selectPreviousItem({context:e,prop:t}){const[n]=e.get("value"),s=t("collection").getPreviousValue(n);s&&e.set("value",[s])},selectNextItem({context:e,prop:t}){const[n]=e.get("value"),s=t("collection").getNextValue(n);s&&e.set("value",[s])},selectFirstItem({context:e,prop:t}){const n=t("collection").firstValue;n&&e.set("value",[n])},selectLastItem({context:e,prop:t}){const n=t("collection").lastValue;n&&e.set("value",[n])},selectMatchingItem({context:e,prop:t,event:n,refs:s}){const r=t("collection").search(n.key,{state:s.get("typeahead"),currentValue:e.get("value")[0]});r!=null&&e.set("value",[r])},scrollContentToTop({prop:e,scope:t}){if(e("scrollToIndexFn")){const n=e("collection").firstValue;e("scrollToIndexFn")?.({index:0,immediate:!0,getElement:()=>Jr(t,n)})}else Fn(t)?.scrollTo(0,0)},invokeOnOpen({prop:e,context:t}){e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("onOpenChange")?.({open:!1,value:t.get("value")})},syncSelectElement({context:e,prop:t,scope:n}){const s=Zr(n);if(s){if(e.get("value").length===0&&!t("multiple")){s.selectedIndex=-1;return}for(const r of s.options)r.selected=e.get("value").includes(r.value)}},syncCollection({context:e,prop:t}){const n=t("collection"),s=n.find(e.get("highlightedValue"));s&&e.set("highlightedItem",s);const r=Es({values:e.get("value"),collection:n,selectedItemMap:e.get("selectedItemMap")});e.set("selectedItemMap",r.nextSelectedItemMap)},syncSelectedItems({context:e,prop:t}){const n=Es({values:e.get("value"),collection:t("collection"),selectedItemMap:e.get("selectedItemMap")});e.set("selectedItemMap",n.nextSelectedItemMap)},syncHighlightedItem({context:e,prop:t}){const n=t("collection"),s=e.get("highlightedValue"),r=s?n.find(s):null;e.set("highlightedItem",r)},dispatchChangeEvent({scope:e}){queueMicrotask(()=>{const t=Zr(e);if(!t)return;const n=e.getWin(),s=new n.Event("change",{bubbles:!0,composed:!0});t.dispatchEvent(Hh(s))})}}}});function $a(e){const t=e.restoreFocus??e.previousEvent?.restoreFocus;return t==null||!!t}function V1(e){return e.focusVisible??e.previousEvent?.focusVisible?{preventScroll:!0,focusVisible:!0}:{preventScroll:!0}}function N1(e){return new Proxy({},{get(t,n){return n==="style"?s=>e({style:s}).style:e}})}var F1=Object.defineProperty,H1=(e,t,n)=>t in e?F1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>H1(e,typeof t!="symbol"?t+"":t,n),La={onFocus:"onFocusin",onBlur:"onFocusout",onChange:"onInput",onDoubleClick:"onDblclick",htmlFor:"for",className:"class",defaultValue:"value",defaultChecked:"checked"},W1=new Set(["viewBox","preserveAspectRatio"]),ol=N1(e=>Object.entries(e).reduce((t,[n,s])=>{if(s===void 0)return t;n in La&&(n=La[n]);const r=W1.has(n)?n:n.toLowerCase();return t[r]=s,t},{})),Is=new WeakMap,Ia=new Set(["value","checked","selected"]),j1=new Set(["viewBox","preserveAspectRatio","clipPath","clipRule","fillRule","strokeWidth","strokeLinecap","strokeLinejoin","strokeDasharray","strokeDashoffset","strokeMiterlimit"]),_1=e=>e.tagName==="svg"||e.namespaceURI==="http://www.w3.org/2000/svg",Ts=(e,t)=>_1(e)&&j1.has(t)?t:t.toLowerCase(),Qr=e=>e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ta=(e,t,n)=>{if(typeof n=="string"){e.setAttribute("style",n);return}if(n==null&&typeof t=="string"){e.removeAttribute("style");return}const s=e.style;if(s!=null){for(const r in t)n?.[r]==null&&s.removeProperty(Qr(r));for(const r in n){const o=n[r];o==null?s.removeProperty(Qr(r)):s.setProperty(Qr(r),String(o))}}};function ie(e,t,n){const s="default";let r=Is.get(e);r||(r=new Map,Is.set(e,r));const o=r.get(s)||{},i=Object.keys(t),a=(d,m)=>{e.addEventListener(d.toLowerCase(),m)},c=(d,m)=>{e.removeEventListener(d.toLowerCase(),m)},l=d=>d.startsWith("on"),h=d=>!d.startsWith("on"),u=d=>a(d.substring(2),t[d]),g=d=>c(d.substring(2),t[d]),p=d=>{const m=t[d],v=o[d];if(m!==v){if(d==="class"){e.className=m??"";return}if(d==="style"){Ta(e,v,m);return}if(Ia.has(d)){e[d]=m??"";return}if(typeof m=="boolean"&&!d.includes("aria-")){e.toggleAttribute(Ts(e,d),m);return}if(d==="children"){e.innerHTML=m;return}if(m!=null){e.setAttribute(Ts(e,d),m);return}e.removeAttribute(Ts(e,d))}};for(const d in o)t[d]==null&&(d==="class"?e.className="":d==="style"?Ta(e,o[d],void 0):Ia.has(d)?e[d]="":e.removeAttribute(Ts(e,d)));return Object.keys(o).filter(l).forEach(d=>{c(d.substring(2),o[d])}),i.filter(l).forEach(u),i.filter(h).forEach(p),r.set(s,t),function(){i.filter(l).forEach(g);const m=Is.get(e);m&&(m.delete(s),m.size===0&&Is.delete(e))}}function B1(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function il(e,t){const n=B1();return n?(n[e]||(n[e]=t()),n[e]):t()}var qs=il("__zag__refSet",()=>new WeakSet),U1=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,q1=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,G1=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",Y1=e=>U1(e)||q1(e)||G1(e),No=e=>e!==null&&typeof e=="object",Ma=e=>No(e)&&!qs.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!Y1(e)&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise)&&!(e instanceof File)&&!(e instanceof Blob)&&!(e instanceof AbortController);const K1=Symbol(),Aa=Object.getPrototypeOf,Fo=new WeakMap,Z1=e=>e&&(Fo.has(e)?Fo.get(e):Aa(e)===Object.prototype||Aa(e)===Array.prototype),z1=e=>Z1(e)&&e[K1]||null,Oa=(e,t=!0)=>{Fo.set(e,t)};var Bt=il("__zag__proxyStateMap",()=>new WeakMap),J1=(e=Object.is,t=(a,c)=>new Proxy(a,c),n=new WeakMap,s=(a,c)=>{const l=n.get(a);if(l?.[0]===c)return l[1];const h=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a));return Oa(h,!0),n.set(a,[c,h]),Reflect.ownKeys(a).forEach(u=>{const g=Reflect.get(a,u);qs.has(g)?(Oa(g,!1),h[u]=g):Bt.has(g)?h[u]=Q1(g):h[u]=g}),Object.freeze(h)},r=new WeakMap,o=[1,1],i=a=>{if(!No(a))throw new Error("object required");const c=r.get(a);if(c)return c;let l=o[0];const h=new Set,u=(b,E=++o[0])=>{l!==E&&(l=E,h.forEach(C=>C(b,E)))};let g=o[1];const p=(b=++o[1])=>(g!==b&&!h.size&&(g=b,d.forEach(([E])=>{const C=E[1](b);C>l&&(l=C)})),l),f=b=>(E,C)=>{const x=[...E];x[1]=[b,...x[1]],u(x,C)},d=new Map,m=(b,E)=>{if(h.size){const C=E[3](f(b));d.set(b,[E,C])}else d.set(b,[E])},v=b=>{const E=d.get(b);E&&(d.delete(b),E[1]?.())},k=b=>(h.add(b),h.size===1&&d.forEach(([C,x],y)=>{const M=C[3](f(y));d.set(y,[C,M])}),()=>{h.delete(b),h.size===0&&d.forEach(([C,x],y)=>{x&&(x(),d.set(y,[C]))})}),L=Array.isArray(a)?[]:Object.create(Object.getPrototypeOf(a)),w=t(L,{deleteProperty(b,E){const C=Reflect.get(b,E);v(E);const x=Reflect.deleteProperty(b,E);return x&&u(["delete",[E],C]),x},set(b,E,C,x){const y=Reflect.has(b,E),M=Reflect.get(b,E,x);if(y&&(e(M,C)||r.has(C)&&e(M,r.get(C))))return!0;v(E),No(C)&&(C=z1(C)||C);let D=C;if(!Object.getOwnPropertyDescriptor(b,E)?.set){!Bt.has(C)&&Ma(C)&&(D=al(C));const H=!qs.has(D)&&Bt.get(D);H&&m(E,H)}return Reflect.set(b,E,D,x),u(["set",[E],C,M]),!0}});r.set(a,w);const S=[L,p,s,k];return Bt.set(w,S),Reflect.ownKeys(a).forEach(b=>{const E=Object.getOwnPropertyDescriptor(a,b);E.get||E.set?Object.defineProperty(L,b,E):w[b]=a[b]}),w})=>[i,Bt,qs,e,t,Ma,n,s,r,o],[X1]=J1();function al(e={}){return X1(e)}function Da(e,t,n){const s=Bt.get(e);let r;const o=[],i=s[3];let a=!1;const l=i(h=>{o.push(h),r||(r=Promise.resolve().then(()=>{r=void 0,a&&t(o.splice(0))}))});return a=!0,()=>{a=!1,l()}}function Q1(e){const t=Bt.get(e),[n,s,r]=t;return r(n,s())}function ar(e){const t=e().value??e().defaultValue;e().debug&&console.log(`[bindable > ${e().debug}] initial`,t);const n=e().isEqual??Object.is,s=al({value:t}),r=()=>e().value!==void 0;return{initial:t,ref:s,get(){return r()?e().value:s.value},set(o){const i=r()?e().value:s.value,a=it(o)?o(i):o;e().debug&&console.log(`[bindable > ${e().debug}] setValue`,{next:a,prev:i}),r()||(s.value=a),n(a,i)||e().onChange?.(a,i)},invoke(o,i){e().onChange?.(o,i)},hash(o){return e().hash?.(o)??String(o)}}}ar.cleanup=e=>{};ar.ref=e=>{let t=e;return{get:()=>t,set:n=>{t=n}}};function eg(e){const t={current:e};return{get(n){return t.current[n]},set(n,s){t.current[n]=s}}}var{defineProperty:tg,getOwnPropertyDescriptor:ng,getOwnPropertyDescriptors:Pa}=Object;function Jn(e,t){if(Object.is(e,t))return e;if(!Kn(e)||!Kn(t))return t===void 0?e:t;let n=e;const s=(r,o)=>{n===e&&(n=Object.defineProperties({},Pa(e))),tg(n,r,o)};for(const[r,o]of Object.entries(Pa(t))){if(!o.enumerable)continue;if(o.get){s(r,o);continue}const i=o.value;if(i===void 0)continue;const a=!!ng(e,r)?.get,c=e[r],l=Kn(c)&&Kn(i)?Jn(c,i):i;!a&&Object.is(c,l)||s(r,{value:l,writable:!0,enumerable:!0,configurable:!0})}return n}var cl=class{constructor(e,t={}){J(this,"machine",e),J(this,"scope"),J(this,"context"),J(this,"prop"),J(this,"state"),J(this,"refs"),J(this,"computed"),J(this,"event",{type:""}),J(this,"previousEvent",{type:""}),J(this,"effects",new Map),J(this,"replaceTracker",a1()),J(this,"transition",null),J(this,"cleanups",[]),J(this,"subscriptions",[]),J(this,"userProps"),J(this,"userPropsSources",[]),J(this,"getUserProps",()=>{let u=this.userProps;for(const g of this.userPropsSources){const p=Zi(g);u=u?Jn(u,p):p}return u}),J(this,"getEvent",()=>({...this.event,current:()=>this.event,previous:()=>this.previousEvent})),J(this,"getState",()=>({...this.state,matches:(...u)=>u.some(g=>g1(this.state.get(),g)),hasTag:u=>m1(this.machine,this.state.get(),u)})),J(this,"debug",(...u)=>{this.machine.debug&&console.log(...u)}),J(this,"notify",()=>{this.publish()}),J(this,"send",u=>{if(this.status!==zn.Started)return;const g=u?.replaces,p=g?this.replaceTracker.claim(g):void 0;queueMicrotask(()=>{if(!u||g&&p&&this.replaceTracker.isReplaced(g,p))return;this.previousEvent=this.event,this.event=u,this.debug("send",u);let f=this.state.get();const d=u.type,{transitions:m,source:v}=f1(this.machine,f,d),k=this.choose(m);if(!k)return;this.transition=k;const L=va(this.machine,k.target??f,v);this.debug("transition",k),L!==f?this.state.set(L):k.reenter?this.state.invoke(f,f):this.action(k.actions)})}),J(this,"action",u=>{const g=it(u)?u(this.getParams()):u;if(!g)return;const p=g.map(f=>{const d=this.machine.implementations?.actions?.[f];return d||js(`[zag-js] No implementation found for action "${JSON.stringify(f)}"`),d});for(const f of p)f?.(this.getParams())}),J(this,"guard",u=>{if(it(u))return u(this.getParams());const g=this.machine.implementations?.guards?.[u];return g||js(`[zag-js] No implementation found for guard "${JSON.stringify(u)}"`),g?.(this.getParams())}),J(this,"effect",u=>{const g=it(u)?u(this.getParams()):u;if(!g)return;const p=g.map(d=>{const m=this.machine.implementations?.effects?.[d];return m||js(`[zag-js] No implementation found for effect "${JSON.stringify(d)}"`),m}),f=[];for(const d of p){const m=d?.(this.getParams());m&&f.push(m)}return()=>f.forEach(d=>d?.())}),J(this,"choose",u=>Du(u).find(g=>{let p=!g.guard;return Wu(g.guard)?p=!!this.guard(g.guard):it(g.guard)&&(p=g.guard(this.getParams())),p})),J(this,"subscribe",u=>(this.subscriptions.push(u),()=>{const g=this.subscriptions.indexOf(u);g>-1&&this.subscriptions.splice(g,1)})),J(this,"status",zn.NotStarted),J(this,"publish",()=>{this.callTrackers(),this.subscriptions.forEach(u=>u(this.service))}),J(this,"trackers",[]),J(this,"setupTrackers",()=>{this.machine.watch?.(this.getParams())}),J(this,"callTrackers",()=>{this.trackers.forEach(({deps:u,fn:g})=>{const p=u.map(f=>f());$n(g.prev,p)||(g(),g.prev=p)})}),J(this,"getParams",()=>({state:this.getState(),context:this.context,event:this.getEvent(),prop:this.prop,send:this.send,action:this.action,guard:this.guard,track:(u,g)=>{g.prev=u.map(p=>p()),this.trackers.push({deps:u,fn:g})},refs:this.refs,computed:this.computed,flush:Yu,scope:this.scope,choose:this.choose})),it(t)?this.userPropsSources.push(t):this.userProps=t;const{id:n,ids:s,getRootNode:r}=Zi(t);this.scope=y1({id:n,ids:s,getRootNode:r});const o=u=>{const g=this.getUserProps();return(e.props?.({props:Qo(g),scope:this.scope})??g)[u]};this.prop=o;const i=e.context?.({prop:o,bindable:ar,scope:this.scope,flush(u){queueMicrotask(u)},getContext(){return a},getComputed(){return c},getRefs(){return l},getEvent:this.getEvent.bind(this)});i&&Object.values(i).forEach(u=>{const g=Da(u.ref,()=>this.notify());this.cleanups.push(g)});const a={get(u){return i?.[u].get()},set(u,g){i?.[u].set(g)},initial(u){return i?.[u].initial},hash(u){const g=i?.[u].get();return i?.[u].hash(g)}};this.context=a;const c=u=>(vr(e.computed,()=>"[zag-js] No computed object found on machine"),e.computed[u]({context:a,event:this.getEvent(),prop:o,refs:this.refs,scope:this.scope,computed:c}));this.computed=c;const l=eg(e.refs?.({prop:o,context:a})??{});this.refs=l;const h=ar(()=>({defaultValue:va(e,e.initialState({prop:o})),onChange:(u,g)=>{const{exiting:p,entering:f}=p1(this.machine,g,u,this.transition?.reenter);if(p.forEach(d=>{this.effects.get(d.path)?.(),this.effects.delete(d.path)}),p.forEach(d=>{this.action(d.state?.exit)}),this.action(this.transition?.actions),f.forEach(d=>{const m=this.effect(d.state?.effects);if(m){const v=this.effects.get(d.path);this.effects.set(d.path,v?Xs(v,m):m)}}),g===Ls){this.action(e.entry);const d=this.effect(e.effects);if(d){const m=this.effects.get(Ls);this.effects.set(Ls,m?Xs(m,d):d)}}f.forEach(d=>{this.action(d.state?.entry)})}}));this.state=h,this.cleanups.push(Da(this.state.ref,()=>this.notify()))}updateProps(e){const t=this.userPropsSources;if(it(e))t.push(e);else if(t.length===0)this.userProps=Jn(this.userProps,e);else{const n=t.length-1,s=t[n];if(it(s)){const r=Jn({},e);r&&Object.keys(r).length>0&&t.push(r)}else t[n]=Jn(s,e)}this.notify()}start(){this.status=zn.Started,this.debug("initializing..."),this.state.invoke(this.state.initial,Ls),this.setupTrackers()}stop(){this.effects.forEach(e=>e?.()),this.effects.clear(),this.transition=null,this.action(this.machine.exit),this.cleanups.forEach(e=>e()),this.cleanups=[],this.subscriptions=[],this.status=zn.Stopped,this.debug("unmounting...")}get service(){return{state:this.getState(),send:this.send,context:this.context,prop:this.prop,scope:this.scope,refs:this.refs,computed:this.computed,event:this.getEvent(),getStatus:()=>this.status}}};const sg=W("chevron-down"),Et=new Map;let rg=0;function og(e){const t=document.createElement("span");t.className="ui-select",t.innerHTML=`<button type="button" class="ui-select-trigger"><span></span>${sg}</button><div class="ui-select-positioner" popover="manual"><div class="ui-select-menu"></div></div>`,e.after(t),e.hidden=!0;const n=t.querySelector("button"),s=n.querySelector("span"),r=e.dataset.sourceIcons,o=k=>k?xu(k,r):yo("terminal");let i;r&&t.classList.add("ui-select-with-source");const a=t.querySelector(".ui-select-positioner"),c=t.querySelector(".ui-select-menu");let l=[],h="",u=e.value,g=e.disabled;const p=new cl(R1,{id:`select-${++rg}`,collection:Qs({items:l}),defaultValue:[u],disabled:g,positioning:{placement:"bottom-start",strategy:"fixed",sameWidth:!0,gutter:6},onValueChange({value:k}){e.value!==k[0]&&(u=e.value=k[0]??"",e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))}}),f=()=>r1(p.service,ol);function d(){const k=f();ie(t,k.getRootProps()),ie(n,{...k.getTriggerProps(),"aria-label":e.getAttribute("aria-label")||e.labels?.[0]?.textContent?.trim(),"aria-labelledby":void 0}),ie(a,k.getPositionerProps()),ie(c,{...k.getContentProps(),"aria-label":e.getAttribute("aria-label"),"aria-labelledby":void 0});const L=e.selectedOptions[0]?.textContent||"Choose…";if(s.textContent!==L&&(s.textContent=L),r&&i!==e.value){n.querySelector(".ui-select-source")?.remove();const O=o(e.value);O.classList.add("ui-select-source"),n.prepend(O),i=e.value}l.forEach((O,w)=>{const S=c.children[w];ie(S,k.getItemProps({item:O}))}),a.hidden=!k.open,k.open&&!a.matches(":popover-open")&&a.showPopover?.(),!k.open&&a.matches(":popover-open")&&a.hidePopover?.()}function m(){const k=Array.from(e.options,O=>({value:O.value,label:O.text,disabled:O.disabled})),L=JSON.stringify(k);L!==h&&(h=L,l=k,c.replaceChildren(...l.map(O=>{const w=document.createElement("div");if(w.className="ui-select-option",r){const b=o(O.value);b.classList.add("ui-select-source"),w.append(b)}const S=document.createElement("span");return S.textContent=O.label,w.append(S,yo("check")),w})),p.updateProps({collection:Qs({items:l})})),u!==e.value&&(u=e.value,f().setValue([u])),g!==e.disabled&&(g=e.disabled,p.updateProps({disabled:g})),d()}t.addEventListener("keydown",k=>k.stopPropagation()),e.addEventListener("change",m);const v=p.subscribe(d);return p.start(),m(),{sync:m,focus:()=>n.focus(),dispose(){e.removeEventListener("change",m),v(),p.stop(),t.remove(),e.hidden=!1}}}function ds(e=document){for(const[t,n]of Et)t.isConnected||(n.dispose(),Et.delete(t));for(const t of e.querySelectorAll("select:not([data-native])"))Et.has(t)?Et.get(t).sync():Et.set(t,og(t))}function ig(e){ds(e.parentElement),Et.get(e)?.focus()}function ag(e=document.body){const t=new MutationObserver(n=>{n.some(s=>s.target instanceof Element&&(s.target.matches("select, option")||[...s.addedNodes,...s.removedNodes].some(r=>r instanceof Element&&(r.matches("select")||r.querySelector("select")))))&&ds(e)});return t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["disabled"]}),ds(e),()=>{t.disconnect();for(const[n,s]of Et)(e.contains(n)||!n.isConnected)&&(s.dispose(),Et.delete(n))}}function cg(e){const t=document.createElement("dialog");t.className="launch-dialog",t.setAttribute("aria-labelledby","launch-heading"),t.innerHTML=`
|
|
12
|
+
<button class="icon-button dialog-close" aria-label="Close open session">${W("x")}</button>
|
|
13
|
+
<h2 id="launch-heading">Open session</h2><p class="launch-title"></p>
|
|
14
|
+
<label class="launch-destination">Open in<select aria-label="Open in">
|
|
15
|
+
${Yn.map(y=>`<option value="${y.id}">${y.name}</option>`).join("")}
|
|
16
|
+
<option value="web">OpenCode · Web browser</option>
|
|
17
|
+
</select></label>
|
|
18
|
+
<section class="launch-web" hidden>
|
|
19
|
+
<a class="primary-button launch-web-link" target="_blank" rel="noopener noreferrer" hidden>Open in browser ${W("arrow-up-right")}</a>
|
|
20
|
+
<details class="launch-pairing"><summary>First time connecting?</summary><p>Run <code>opencode pair</code> in your terminal and open its pairing link once. Then open this session again.</p><button class="text-button launch-copy-pair">Copy pairing command</button></details>
|
|
21
|
+
</section>
|
|
22
|
+
<section class="launch-cli">
|
|
23
|
+
<label class="launch-directory-label">Working directory<input class="launch-directory" aria-label="Working directory" spellcheck="false" autocomplete="off"/></label>
|
|
24
|
+
<div class="launch-summary" hidden><strong class="launch-mode"></strong><p class="launch-hint"></p>
|
|
25
|
+
<details class="launch-context" hidden><summary>Saved context</summary><p class="launch-coverage"></p><code class="launch-context-path"></code></details>
|
|
26
|
+
</div>
|
|
27
|
+
<input class="launch-command" aria-label="CLI command" readonly spellcheck="false" placeholder="Preparing command…"/>
|
|
28
|
+
<div class="launch-actions"><button class="primary-button launch-terminal" disabled>Open Terminal ${W("arrow-up-right")}</button><button class="secondary-button launch-copy" disabled>Copy command ${W("copy")}</button></div>
|
|
29
|
+
<p class="launch-availability"></p>
|
|
30
|
+
</section>
|
|
31
|
+
<p class="launch-status" role="status"></p>`,document.body.append(t);const n=new AbortController,s={signal:n.signal},r=y=>t.querySelector(y),o=r("select"),i=r(".launch-directory"),a=r(".launch-web-link"),c=r(".launch-command"),l=r(".launch-terminal"),h=r(".launch-copy"),u=r(".launch-status");let g,p=0,f=0,d,m,v,k,L,O=null;function w(){f++,m?.abort(),clearTimeout(L),v=void 0,c.value="",l.disabled=h.disabled=!0,r(".launch-summary").hidden=!0,r(".launch-availability").textContent=""}function S(){t.close(),p++,d?.abort(),w(),e(),O?.focus({preventScroll:!0})}async function b(y){try{await navigator.clipboard.writeText(y),u.textContent="Command copied."}catch{u.textContent=`Copy this command: ${y}`,y===c.value&&(c.focus(),c.select())}}function E(){if(a.hidden=!0,a.removeAttribute("href"),g&&k?.webBaseUrl)try{a.href=Iu(k.webBaseUrl,g.nativeID||g.id),a.hidden=!1}catch{}u.textContent=k?a.hidden?"OpenCode is unavailable. Choose another app to use the saved conversation.":"":"Finding OpenCode…"}function C(y){const M=Yn.find(D=>D.id===o.value)?.name||Ne(o.value);c.value=y.command,h.disabled=!1,l.disabled=!y.terminalAvailable,l.textContent=`${y.mode==="resume"?"Resume in":"Open in"} ${M}`,l.insertAdjacentHTML("beforeend",W("arrow-up-right")),r(".launch-summary").hidden=!1,r(".launch-mode").textContent=y.mode==="resume"?"Resume original session":"New session · saved context",r(".launch-hint").textContent=y.mode==="resume"?`Continue this conversation in ${M}.`:`Start in ${M} with the saved conversation.`,r(".launch-context").hidden=!y.context,r(".launch-coverage").textContent=y.context?`${y.context.messages.toLocaleString()} / ${y.context.totalMessages.toLocaleString()} messages${y.context.partial?" · Partial history":""}`:"",r(".launch-context-path").textContent=y.context?.path||"",r(".launch-availability").textContent=y.targetAvailable?y.terminalAvailable?"":"Automatic terminal opening is unavailable. Run the copied command in your terminal.":`${M} CLI was not found. Install it, then run the copied command.`,u.textContent=""}async function x(){if(w(),!g||!t.open)return;const y=o.value==="web";if(r(".launch-web").hidden=!y,r(".launch-cli").hidden=y,y){E();return}if(!Hr(o.value))return;const M=f;m=new AbortController,u.textContent="Preparing command…";try{const D=await fetch(`/api/sessiongraph/session/${encodeURIComponent(g.id)}/prepare-launch`,{method:"POST",signal:m.signal,headers:{"Content-Type":"application/json","X-SessionGraph-Action":"prepare-launch"},body:JSON.stringify({target:o.value,directory:i.value})}),H=await D.json();if(!D.ok)throw new Error(H.error||"Could not prepare this session.");if(f!==M)return;v=H,C(v)}catch(D){f===M&&(c.placeholder="Command unavailable",u.textContent=D instanceof Error?D.message:"Could not prepare this session.")}}return o.addEventListener("change",()=>{try{localStorage.setItem("sessiongraph.open-target",o.value)}catch{}x()},s),i.addEventListener("input",()=>{w(),u.textContent="Checking working directory…",L=setTimeout(()=>{x()},300)},s),i.addEventListener("change",()=>{x()},s),r(".dialog-close").addEventListener("click",S,s),t.addEventListener("cancel",y=>{y.preventDefault(),S()},s),t.addEventListener("keydown",y=>{y.stopPropagation()},s),h.addEventListener("click",()=>{v&&b(v.command)},s),r(".launch-copy-pair").addEventListener("click",()=>{b("opencode pair")},s),l.addEventListener("click",async()=>{if(!g||!v||l.disabled)return;const y=p;l.disabled=o.disabled=i.disabled=!0,u.textContent="Opening Terminal…";try{const M=await fetch(`/api/sessiongraph/session/${encodeURIComponent(g.id)}/open-terminal`,{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"open-terminal"},body:JSON.stringify({target:o.value,directory:v.directory})}),D=await M.json();if(!M.ok)throw new Error(D.error||"Could not open Terminal.");p===y&&(u.textContent="Session sent to Terminal.")}catch(M){p===y&&(u.textContent=M instanceof Error?M.message:"Could not open Terminal. Copy the command instead.")}finally{p===y&&(o.disabled=i.disabled=!1,l.disabled=!v?.terminalAvailable)}},s),{async open(y){g=y;const M=++p;d?.abort(),d=new AbortController,k=void 0,w(),t.open||(O=document.activeElement),r(".launch-title").textContent=`${Ne(y.source)} · ${y.title}`,i.value=y.directory,i.disabled=o.disabled=!1,o.value=Hr(y.source)?y.source:"opencode";const D=(!y.source||y.source==="opencode")&&fc(y.nativeID||y.id);o.querySelector('[value="web"]').disabled=!D;for(const H of Yn)o.querySelector(`[value="${H.id}"]`).textContent=H.name;try{const H=localStorage.getItem("sessiongraph.open-target")||localStorage.getItem("session-atlas.open-target")||localStorage.getItem("atlas.open-target");(Hr(H)||H==="web"&&D)&&(o.value=H)}catch{}c.placeholder="Preparing command…",r(".launch-context").open=!1,t.open||t.showModal(),e(),ig(o),x();try{const H=await fetch(`/api/sessiongraph/session/${encodeURIComponent(y.id)}/connection`,{signal:d.signal});if(!H.ok)throw new Error("Connection unavailable");const P=await H.json();if(p!==M)return;k=P;for(const F of Yn){const B=P.targets.some(j=>j.id===F.id&&j.available);o.querySelector(`[value="${F.id}"]`).textContent=`${F.name}${B?"":" · CLI not found"}`}o.value==="web"&&E()}catch{p===M&&o.value==="web"&&(u.textContent="OpenCode is unavailable. Choose another app to use the saved conversation.")}},dispose(){p++,d?.abort(),w(),n.abort(),t.remove()}}}const lg=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]);function dg(e,t,n){const s=document.createElement("dialog");s.className="imports-dialog",s.setAttribute("aria-labelledby","imports-heading"),s.innerHTML=`<button class="icon-button dialog-close" aria-label="Close sources">${W("x")}</button><span class="eyebrow">SessionGraph</span><h2 id="imports-heading">Explore & visualize all your LLM sessions</h2><p class="imports-intro">Your history stays local. Choose the apps to read; import, search, and visualization run on this computer. No account, cloud sync, or telemetry.</p><details class="privacy-disclosure"><summary>Local data & network access</summary><p>Imports are read-only and never start an AI agent. Desktop update checks contact GitHub without session content. Explicitly continuing a session opens another harness, which may contact its model provider.</p><p>Saved history and handoff files are not encrypted by SessionGraph. Your device permissions and backups affect who can access them.</p></details><div class="import-sources"></div><div class="imports-progress" role="status"></div><details class="imports-notes" hidden><summary>Import details</summary><div></div></details><footer><span>Saved locally in SQLite</span><button class="primary-button import-start">Import sessions <span>↗</span></button></footer>`,document.body.append(s);const r=C=>s.querySelector(C);let o=!1,i=0,a=!1,c=null,l=!1,h=!1,u=!1;const g=new AbortController;let p=!1,f=0,d=!1,m=!1,v=!1;function k(){const C=s.querySelectorAll("input:checked").length;r(".import-start").disabled=o||l||d,r(".import-start").textContent=o||l?"Importing…":d?"Finding sources…":m?p?C?"Import & continue →":"Continue without importing →":"Import updates ↗":"Try again",s.querySelectorAll("input").forEach(x=>{x.disabled=o||l})}async function L(C,x){const y=await fetch(`/api/sessiongraph/${C}`,{...x,signal:AbortSignal.any([g.signal,AbortSignal.timeout(3e4)])}),M=await y.json();if(y.status===409&&C==="import"&&x?.method==="POST")return L("import");if(!y.ok)throw new Error(M.error||"Import unavailable.");return M}function O(C){o=C.running,k(),r(".imports-progress").textContent=o?`${C.source?Ne(C.source):"Importing"} · ${C.imported.toLocaleString()} imported · ${C.unchanged.toLocaleString()} unchanged${C.discovered?` / ${C.discovered.toLocaleString()} found`:" · discovering…"}`:`${C.imported.toLocaleString()} imported · ${C.unchanged.toLocaleString()} already up to date${C.failed?` · ${C.failed} unavailable`:""}`;const x=[...C.errors,...C.warnings||[]];r(".imports-notes").hidden=!x.length,r(".imports-notes div").innerHTML=x.map(y=>`<p>${lg(y)}</p>`).join(""),document.dispatchEvent(new CustomEvent("sessiongraph-import-status",{detail:C}))}async function w(){if(!(a||h)){i=0,h=!0;try{const C=await L("import");if(a)return;if(O(C),C.running)i=window.setTimeout(w,1e3);else{const x=v;v=!1,await e(u),!a&&x&&n(C.failed?"Import finished with some unavailable history. Open Manage sources for details or to retry.":C.imported+C.unchanged?"Your sessions are ready to explore.":"No conversations found. You can choose other sources in Manage sources.")}}catch(C){S(C)}finally{h=!1}}}function S(C){if(a)return;v=!1;const x=C instanceof Error?C.message:"Import unavailable.";O({running:!1,discovered:0,imported:0,unchanged:0,failed:1,errors:[x]}),r(".imports-progress").textContent=x,s.open||n(`${x} Open Manage sources to retry.`)}async function b(C,x=!1){if(a||x&&s.open)return;if(o||l||h||i){!x&&!s.open&&E();return}l=!0,u=x,o=!0,k();const y=p&&s.open&&C!==void 0,M=f;try{const D=await L("import",{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"import"},body:JSON.stringify(x?{automatic:!0}:{sources:C})});if(a||(O(D),y&&(v=!!C?.length,f===M&&s.open&&s.close(),C?.length&&n("Import started. You can explore the map as soon as your sessions are ready."),await e(!0)),a))return;window.clearTimeout(i),i=window.setTimeout(w,100)}catch(D){S(D)}finally{l=!1,a||k()}}async function E(C=!1){p=C;const x=++f;d=!0,m=!1,c=document.activeElement,r("#imports-heading").textContent=C?"Explore & visualize all your LLM sessions":"Your session sources.",r("footer > span").textContent=C?"You can change sources later.":"Saved locally in SQLite",C&&(r(".imports-progress").textContent="Detected conversation sources are selected for you.",r(".imports-notes").hidden=!0),k(),s.open||s.showModal(),t(),r(".import-sources").textContent="Finding local session sources…";try{const y=await L("sources");if(a||x!==f)return;r(".import-sources").innerHTML=uc(y.sources).map(D=>hc(D,{checked:D.selected||C&&D.available&&D.capabilities.history,disabled:o})).join(""),m=!0,C&&!s.querySelector("input:checked")&&(r(".imports-progress").textContent="No conversation sources selected. You can choose sources now or add them later.");const M=await L("import");if(a||x!==f)return;M.running?(O(M),window.clearTimeout(i),i=window.setTimeout(w,1e3)):C||O(M)}catch(y){!a&&x===f&&(m=!1,r(".import-sources").textContent=y instanceof Error?y.message:"Could not detect sources.")}finally{!a&&x===f&&(d=!1,k())}}return r(".import-sources").addEventListener("change",k),r(".import-start").addEventListener("click",()=>{m?b([...s.querySelectorAll("input:checked")].map(C=>C.value)):E(p)}),r(".dialog-close").addEventListener("click",()=>s.close()),s.addEventListener("close",()=>{f++,d=!1,t(),c?.focus()}),s.addEventListener("keydown",C=>C.stopPropagation()),{open:E,sources:async()=>(await L("sources")).sources,select:C=>b(C),get busy(){return o||l||h||!!i},refresh:(C=!1)=>b(void 0,C),resume:()=>{u=!0,o=!0,window.clearTimeout(i),w()},dispose:()=>{a=!0,g.abort(),window.clearTimeout(i),s.remove()}}}const ug=6e4,hg=3e4;class fg{constructor(t,n=Date.now){this.options=t,this.now=n}options;now;lastActivity=-1/0;checking=!1;disposed=!1;activity(){this.lastActivity=this.now()}async check(){if(!(this.disposed||this.checking||!this.options.eligible()||this.options.busy()||this.now()-this.lastActivity<hg)){this.checking=!0,this.activity();try{await this.options.refresh()}finally{this.checking=!1}}}dispose(){this.disposed=!0}}class pg{constructor(t,n){this.write=t,this.changed=n}write;changed;revision=0;state="saved";queued;task;disposed=!1;get pending(){return!!(this.queued||this.task)}set(t){this.state=t,this.disposed||this.changed(t)}save(t){this.disposed||(this.revision++,this.queued={...this.queued,...t},this.set("saving"),this.flush())}flush(){if(this.task)return this.task;if(this.disposed||!this.queued)return Promise.resolve();const t=this.queued;return this.queued=void 0,this.set("saving"),this.task=Promise.resolve().then(()=>this.write(t)).then(()=>{if(this.task=void 0,this.queued)return this.flush();this.set("saved")},()=>{this.queued={...t,...this.queued},this.task=void 0,this.set("error")}),this.task}dispose(){this.disposed=!0}}const gi=Object.freeze({sourceID:"",projectID:"",directory:"",days:"ytd",fromDate:"",toDate:"",includeChildren:!0,includeArchived:!1}),gg=e=>typeof e=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(e)&&Number.isFinite(Date.parse(e))&&new Date(e).toISOString().slice(0,10)===e;function mg(e){const t={...gi};if(!e||typeof e!="object"||Array.isArray(e))return t;const n=e;for(const s of["sourceID","projectID","directory"])typeof n[s]=="string"&&n[s].length<=4096&&(t[s]=n[s]);(n.days==="ytd"||[0,7,30,90].includes(n.days))&&(t.days=n.days);for(const s of["includeChildren","includeArchived"])typeof n[s]=="boolean"&&(t[s]=n[s]);for(const s of["fromDate","toDate"])gg(n[s])&&(t[s]=n[s]);return t.fromDate&&t.toDate&&t.fromDate>t.toDate&&(t.fromDate="",t.toDate=""),t}function ll(e,t=Date.now()){const n=new Date(t),s=e.days==="ytd"?new Date(n.getFullYear(),0,1).getTime():e.days?t-e.days*864e5:0,r=e.days==="ytd"?new Date(n.getFullYear(),n.getMonth(),n.getDate(),23,59,59,999).getTime():1/0;return{min:e.fromDate?new Date(`${e.fromDate}T00:00:00`).getTime():s,max:e.toDate?new Date(`${e.toDate}T23:59:59.999`).getTime():r}}const yg=e=>typeof e=="number"&&Number.isSafeInteger(e)&&e>=0;function dl(e,t={}){const n=e.filter(a=>yg(a.tokens)),s=n.filter(a=>Number.isFinite(a.activity?.lastMessageAt)&&a.activity.lastMessageAt>0).sort((a,c)=>Math.max(a.created,a.activity.lastMessageAt)-Math.max(c.created,c.activity.lastMessageAt)),r=[],o=[0];for(const a of s)r.push(Math.max(a.created,a.activity.lastMessageAt)),o.push(o.at(-1)+a.tokens);const i=n.reduce((a,c)=>a+c.tokens,0);return{recorded:n.length,missing:e.length-n.length,partial:n.filter(a=>a.usage?.partial).length,untimed:n.length-s.length,at(a,c=!1){if(c)return{tokens:i,sessions:n.length};let l=0,h=r.length;for(;l<h;){const u=l+h>>>1;r[u]<=a?l=u+1:h=u}return{tokens:o[l],sessions:l}}}}const mi=15e3,us=5e3,ul=1e3,yi=30,Ho=mi/1e3*yi,tv=(mi+us+ul)/1e3*yi,nv=e=>Math.min(1,e/(Ho-1)),sv=e=>e<Ho?null:Math.min(1,(e-Ho+1)/(us/1e3*yi));function rv(e,t=0){const n=Math.max(0,Math.min(1,e)),s=.2,r=.34,o=Math.max(0,Math.min(1,t*us/1e3)),i=(1-o*s/2)/(1-(s+r)/2),a=c=>c**3-c**4/2;return n<s?o*n+(i-o)*s*a(n/s):n>1-r?1-i*r*a((1-n)/r):i*(n-s/2)+o*s/2}const vg=new Intl.DateTimeFormat("en",{month:"short",year:"numeric"}),bg=new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"}),wg=(e,t)=>(t>=90*864e5?vg:bg).format(e);function kg(e,t,n,s=70){const r=new Array(s).fill(0),o=Math.max(1,n-t);for(const i of e)r[Math.max(0,Math.min(s-1,Math.floor((i-t)/o*s)))]++;return r}function hl(e){const t=e.map(n=>n.created).sort((n,s)=>n-s);return(n,s=!1)=>{if(s)return t.length;let r=0,o=t.length;for(;r<o;){const i=r+o>>>1;t[i]<=n?r=i+1:o=i}return r}}function Cg(e,t={},{showCoverage:n=!0}={}){const s=o=>`data-playback="${o}"${t[o]?` id="${t[o]}"`:""}`,r=W("play");return`<div class="timeline-top">${e}</div>
|
|
32
|
+
<div class="timeline-track"><button type="button" class="play-button" ${s("play")} aria-label="Play timeline">${r}</button><div class="histogram-wrap"><div class="histogram" ${s("histogram")} aria-hidden="true"></div><input ${s("scrubber")} type="range" min="0" max="1000" value="1000" aria-label="Timeline playback position"><div class="timeline-cursor" ${s("cursor")}></div></div><output class="playback-date" ${s("date")}>—</output></div>
|
|
33
|
+
<div class="playback-period" ${s("period")} aria-label="Playback position">—</div>
|
|
34
|
+
<div class="playback-summary" ${s("summary")} hidden><span><strong ${s("sessions")}>0</strong><span>Sessions</span></span><span data-token-total><strong ${s("tokens")}>—</strong><span>Burnt tokens</span></span>${n?`<small ${s("coverage")}></small>`:""}</div>`}function Eg(e,t){return!t||e.source===t||!!(e.source==="t3-code"&&e.linkedSessionIDs?.some(n=>n.startsWith(`${t}:`)))}const Tr=Object.freeze({autoImport:!1,muted:!1,clickSounds:!0,clickVolume:35,motion:"system",grouping:"worktree",density:"comfortable",panelOpacity:90,quality:"balanced",bloom:32,stars:!0,labels:!0,nodeScale:100,focusDimming:!0,trails:"all",trailOpacity:34,trailFlow:!1,trailSpeed:25,relationships:!0,messageDots:!0,playbackSpeed:1}),vi="sessiongraph.preferences",Ra={motion:["system","on","off"],grouping:["repository","worktree"],density:["comfortable","compact"],quality:["performance","balanced","high"],trails:["all","selected","off"]},Va={clickVolume:[0,100],panelOpacity:[55,100],bloom:[0,75],nodeScale:[60,180],trailOpacity:[0,100],trailSpeed:[10,100],playbackSpeed:[.25,3]};function Mr(e){const t={...Tr};if(!e||typeof e!="object"||Array.isArray(e))return t;const n=e;for(const s of Object.keys(t)){const r=n[s];if(s in Ra)Ra[s].includes(r)&&Object.assign(t,{[s]:r});else if(s in Va){const[o,i]=Va[s];typeof r=="number"&&Number.isFinite(r)&&Object.assign(t,{[s]:Math.max(o,Math.min(i,r))})}else typeof r=="boolean"&&Object.assign(t,{[s]:r})}return t}function fl(e){try{const t=JSON.parse(e.getItem(vi)||e.getItem("session-atlas.preferences")||"null");return Mr(t?.version===1?t.values:void 0)}catch{return{...Tr}}}function pl(e,t){try{return e.setItem(vi,JSON.stringify({version:1,values:Mr(t)})),!0}catch{return!1}}const Sg=(e,t)=>e.motion==="on"||e.motion==="system"&&!t,nt=[["interface","Interface","panels"],["sources","Sources","database"],["audio","Sound","volume-2"],["graphics","Graphics","sparkles"],["trails","Trails & playback","orbit"],["privacy","Privacy","lock"]],st=(e,t,n)=>`<label class="setting-row"><span><strong>${t}</strong><small>${n}</small></span><input type="checkbox" role="switch" data-pref="${e}" aria-label="${t}"/></label>`,_t=(e,t,n,s,r,o="%",i=1)=>`<label class="setting-row setting-range"><span><strong>${t}</strong><small>${n}</small></span><span class="setting-slider"><input type="range" data-pref="${e}" aria-label="${t}" min="${s}" max="${r}" step="${i}"/><output data-output="${e}" data-unit="${o}"></output></span></label>`,jn=(e,t,n,s)=>`<label class="setting-row"><span><strong>${t}</strong><small>${n}</small></span><select data-pref="${e}" aria-label="${t}">${s.map(([r,o])=>`<option value="${r}">${o}</option>`).join("")}</select></label>`;function xg(e){const t=document.createElement("dialog");t.className="settings-dialog",t.setAttribute("aria-labelledby","settings-title"),t.innerHTML=`<header class="settings-heading"><div><h2 id="settings-title">Settings</h2><p>Import, appearance, and playback preferences.</p></div><button class="icon-button settings-close" aria-label="Close settings">${W("x")}</button></header>
|
|
35
|
+
<div class="settings-layout"><nav class="settings-tabs" role="tablist" aria-label="Settings categories">${nt.map(([f,d,m],v)=>`<button role="tab" id="settings-tab-${f}" aria-controls="settings-${f}" aria-selected="${!v}" tabindex="${v?-1:0}" data-tab="${f}">${W(m)}${d}</button>`).join("")}</nav>
|
|
36
|
+
<div class="settings-content">
|
|
37
|
+
<section id="settings-interface" role="tabpanel" aria-labelledby="settings-tab-interface"><h3>Interface</h3><p class="settings-description">View preferences and filters are saved with your library.</p>
|
|
38
|
+
${jn("grouping","Cluster sessions by","Worktree keeps checkouts separate. Repository combines them. Both use the session directory when Git metadata is unavailable.",[["worktree","Worktree / Directory"],["repository","Repository"]])}
|
|
39
|
+
${jn("motion","Motion","Camera transitions, reveals, and ambient movement.",[["system","Follow system"],["on","On"],["off","Off"]])}
|
|
40
|
+
${jn("density","Session list","Adjust spacing between sessions.",[["comfortable","Comfortable"],["compact","Compact"]])}
|
|
41
|
+
<label class="setting-row"><span><strong>Show archived sessions</strong><small>Include archived history in the map and session list.</small></span><input class="settings-archived" type="checkbox" role="switch" aria-label="Show archived sessions"/></label>
|
|
42
|
+
${_t("panelOpacity","Panel opacity","Adjust panel background transparency.",55,100)}
|
|
43
|
+
</section>
|
|
44
|
+
<section id="settings-sources" role="tabpanel" aria-labelledby="settings-tab-sources" hidden><h3>Sources</h3><p class="settings-description">Choose the local apps to import. Importing is read-only.</p>
|
|
45
|
+
${st("autoImport","Auto-import sessions","Check selected sources on startup, on return, and every minute while visible.")}
|
|
46
|
+
<div class="settings-sources-list import-sources"></div>
|
|
47
|
+
<div class="settings-import-progress" role="status"></div>
|
|
48
|
+
<div class="settings-note"><span>Source changes apply when you import. Previously saved history is kept.</span><button class="secondary-button settings-import" disabled>Import selected sources</button></div>
|
|
49
|
+
</section>
|
|
50
|
+
<section id="settings-audio" role="tabpanel" aria-labelledby="settings-tab-audio" hidden><h3>Sound</h3><p class="settings-description">Interaction sounds are synthesized locally.</p>
|
|
51
|
+
${st("muted","Mute all sound","Silence everything. Your volume levels are kept.")}
|
|
52
|
+
${st("clickSounds","Interaction sounds","A soft tick for controls; a chime for sessions.")}
|
|
53
|
+
${_t("clickVolume","Interaction volume","Adjust interaction sound volume.",0,100)}
|
|
54
|
+
<div class="settings-note"><span class="settings-audio-status" role="status">Sound starts after your first interaction.</span><button class="secondary-button settings-preview" data-sound="none">Preview chime</button></div>
|
|
55
|
+
<p class="settings-footnote">Audio pauses while this tab is hidden. The speaker button on the map is a quick mute.</p>
|
|
56
|
+
</section>
|
|
57
|
+
<section id="settings-graphics" role="tabpanel" aria-labelledby="settings-tab-graphics" hidden><h3>Graphics</h3><p class="settings-description">Adjust rendering quality and map appearance.</p>
|
|
58
|
+
${jn("quality","Render quality","Performance uses 1× resolution and skips post-process effects.",[["performance","Performance"],["balanced","Balanced"],["high","High fidelity"]])}
|
|
59
|
+
${_t("bloom","Glow strength","Soft light around bright nodes; disabled in Performance.",0,75)}
|
|
60
|
+
${_t("nodeScale","Node size","Scale the lights without changing their positions.",60,180)}
|
|
61
|
+
${st("stars","Starfield","A faint field of stars behind the timeline.")}
|
|
62
|
+
${st("labels","Map labels","Month labels, cluster names, and the selected session title.")}
|
|
63
|
+
${st("focusDimming","Focus dimming","Dim surrounding nodes when a session is selected.")}
|
|
64
|
+
</section>
|
|
65
|
+
<section id="settings-trails" role="tabpanel" aria-labelledby="settings-tab-trails" hidden><h3>Trails & playback</h3><p class="settings-description">Trails start at creation and end at the latest recorded message.</p>
|
|
66
|
+
${jn("trails","Session trails","Choose how much history to draw on the map.",[["all","All sessions"],["selected","Selected session"],["off","Hidden"]])}
|
|
67
|
+
${_t("trailOpacity","Trail brightness","Fade lifetime trails into the background.",0,100)}
|
|
68
|
+
${st("trailFlow","Flowing trails","A decorative pulse along each lifetime; respects Motion.")}
|
|
69
|
+
${_t("trailSpeed","Flow speed","How quickly the light travels along the trails.",10,100)}
|
|
70
|
+
${st("relationships","Relationship links","Show recorded fork and child connections.")}
|
|
71
|
+
${st("messageDots","Message dots","User and assistant messages, colored to match the selected session.")}
|
|
72
|
+
${_t("playbackSpeed","Playback speed","1× plays the full timeline in 15 seconds.",.25,3,"×",.25)}
|
|
73
|
+
<p class="settings-footnote">Flow is decorative. Message dots reflect saved timestamps; visual settings never alter your history.</p>
|
|
74
|
+
</section>
|
|
75
|
+
<section id="settings-privacy" role="tabpanel" aria-labelledby="settings-tab-privacy" hidden><h3>Privacy</h3><p class="settings-description">Local storage and network access.</p>
|
|
76
|
+
<div class="settings-note"><span><strong>Public profile</strong><br>Choose which usage fields to share. Nothing uploads until you review a preview and publish.</span><button class="secondary-button settings-publishing">Publishing settings</button></div>
|
|
77
|
+
<div class="setting-row"><span><strong>Processed on this computer</strong><small>Importing, indexing, search, and visualization run locally. Imports read your selected sources without changing them or starting an AI agent.</small></span></div>
|
|
78
|
+
<div class="setting-row"><span><strong>Update checks use the internet</strong><small>Desktop update checks and downloads contact GitHub without session content. npm installation contacts its registry. These services receive ordinary connection metadata, including your public IP address.</small></span></div>
|
|
79
|
+
<div class="setting-row"><span><strong>Continuing a session is your choice</strong><small>Explicitly launching another harness lets it read the selected context. It may contact its model provider under its own privacy settings.</small></span></div>
|
|
80
|
+
<div class="setting-row"><span><strong>Local storage is not encrypted by SessionGraph</strong><small>Saved conversations, search text, and handoff files rely on your device's access controls. Disk encryption and backup or sync settings affect confidentiality. Deselecting a source keeps previously imported history.</small></span></div>
|
|
81
|
+
</section>
|
|
82
|
+
</div></div><footer class="settings-footer"><span class="settings-save-status" role="status">Changes save automatically on this device.</span><button class="text-button settings-reset">Restore defaults</button><button class="primary-button settings-done">Done</button></footer>`,document.body.append(t);const n=new AbortController,s={signal:n.signal},r=t.querySelector(".settings-archived");r.addEventListener("change",()=>e.changeArchived(r.checked),s);let o=null,i=0,a=!1,c=!1,l="interface";const h=()=>{t.querySelectorAll(".settings-source, .settings-import").forEach(f=>{f.disabled=a||c}),t.querySelector(".settings-source")||(t.querySelector(".settings-import").disabled=!0)};async function u(){const f=++i;a=!0,h();const d=t.querySelector(".settings-sources-list");d.textContent="Finding local session sources…";try{const m=await e.getSources();if(n.signal.aborted||f!==i)return;d.innerHTML=uc(m).map(v=>hc(v,{settings:!0})).join("")}catch(m){if(n.signal.aborted||f!==i)return;d.textContent=m instanceof Error?m.message:"Could not detect sources.";const v=document.createElement("button");v.className="secondary-button",v.textContent="Retry",v.addEventListener("click",()=>{u()},s),d.append(v)}finally{f===i&&!n.signal.aborted&&(a=!1,h(),t.querySelector(".settings-import").disabled||=!d.querySelector("input"))}}t.querySelector(".settings-import").addEventListener("click",async()=>{const f=[...t.querySelectorAll(".settings-source:checked")].map(d=>d.value);c=!0,h(),t.querySelector(".settings-import-progress").textContent="Starting import…";try{await e.importSources(f)}catch(d){c=!1,h(),t.querySelector(".settings-import-progress").textContent=d instanceof Error?d.message:"Import unavailable."}},s);const g=()=>t.close();t.querySelector(".settings-publishing").addEventListener("click",()=>{t.close(),e.publishing()},s);for(const f of[".settings-close",".settings-done"])t.querySelector(f).addEventListener("click",g,s);t.addEventListener("close",()=>{e.visibility(),o?.focus({preventScroll:!0})},s),t.addEventListener("keydown",f=>{f.stopPropagation()},s);function p(f){l=f;for(const[d]of nt){const m=t.querySelector(`[data-tab="${d}"]`);m.setAttribute("aria-selected",String(d===f)),m.tabIndex=d===f?0:-1,t.querySelector(`#settings-${d}`).hidden=d!==f}t.querySelector(".settings-content").scrollTop=0,t.open&&l==="sources"&&u()}for(const f of t.querySelectorAll("[data-tab]"))f.addEventListener("click",()=>p(f.dataset.tab),s),f.addEventListener("keydown",d=>{const m=nt.findIndex(([k])=>k===f.dataset.tab),v=d.key==="Home"?0:d.key==="End"?nt.length-1:["ArrowRight","ArrowDown"].includes(d.key)?(m+1)%nt.length:["ArrowLeft","ArrowUp"].includes(d.key)?(m+nt.length-1)%nt.length:-1;v<0||(d.preventDefault(),p(nt[v][0]),t.querySelector(`[data-tab="${nt[v][0]}"]`).focus())},s);return t.addEventListener("input",f=>{const d=f.target,m=d.dataset.pref;if(!m)return;const v=d.type==="checkbox"?d.checked:d.type==="range"?Number(d.value):d.value;e.change({[m]:v})},s),t.querySelector(".settings-preview").addEventListener("click",e.previewSound,s),t.querySelector(".settings-reset").addEventListener("click",()=>{e.changeArchived(!1),e.change({...Tr})},s),{open(f){t.open&&!f||(f&&p(f),t.open||(r.checked=e.getArchived(),o=document.activeElement,t.showModal(),e.visibility(),l==="sources"&&u()),t.querySelector('[aria-selected="true"]').focus())},importStatus(f){const d=c;c=f.running,h(),t.querySelector(".settings-import-progress").textContent=f.running?`Importing · ${f.imported.toLocaleString()} saved`:`${f.imported.toLocaleString()} imported · ${f.unchanged.toLocaleString()} unchanged${f.failed?` · ${f.failed} unavailable`:""}${f.errors.length?` · ${f.errors[0]}`:""}`,d&&!f.running&&t.open&&l==="sources"&&u()},render(f,d,m="saved"){r.checked=e.getArchived();for(const v of t.querySelectorAll("[data-pref]")){const k=v.dataset.pref;v.type==="checkbox"?v.checked=!!f[k]:v.value=String(f[k]);const L=t.querySelector(`[data-output="${k}"]`);L&&(L.value=`${f[k]}${L.dataset.unit}`),v.disabled=k==="bloom"&&f.quality==="performance"||k==="trailSpeed"&&(!f.trailFlow||f.trails==="off"||f.motion==="off")}t.querySelector(".settings-save-status").textContent=m==="saving"?"Saving preferences…":m==="error"?"Changes applied; could not save to the local library.":d?"Saved on this device · changes apply live.":"Applied for this visit; storage is unavailable.",t.querySelector(".settings-preview").disabled=f.muted||!f.clickSounds||!f.clickVolume,ds(t)},audioStatus(f){t.querySelector(".settings-audio-status").textContent=f},dispose(){n.abort(),t.remove()}}}class $g{constructor(t,n,s=document){this.preferences=t,this.status=n;const r={signal:this.events.signal},o=i=>s!==document||!i.target?.closest?.("[data-graph-audio]");s.addEventListener("click",i=>{if(!i.isTrusted||!o(i))return;const a=i.target?.closest('button, a[href], summary, input[type="checkbox"], [role="option"]');!a||a.matches(":disabled")||a.closest('[data-sound="none"]')||this.play(a.matches('[data-session], [data-related], [role="option"]')?"select":"click")},r),s.addEventListener("change",i=>{i.isTrusted&&o(i)&&i.target?.matches('select, input[type="range"]')&&this.play("click")},r),s.addEventListener("pointerdown",i=>{i.isTrusted&&o(i)&&(this.interacted=!0,this.unlock())},{...r,passive:!0}),s.addEventListener("keydown",i=>{const{repeat:a,key:c}=i;i.isTrusted&&o(i)&&!a&&["Enter"," ","ArrowUp","ArrowDown"].includes(c)&&(this.interacted=!0,this.unlock())},r),document.addEventListener("visibilitychange",()=>this.sync(),r),window.addEventListener("pagehide",()=>{this.active=!1,this.sync()},r),window.addEventListener("pageshow",()=>{this.active=!0,this.sync()},r)}preferences;status;context;master;analyser;voices=new Set;events=new AbortController;disposed=!1;unavailable=!1;clicks=0;lastClick=0;suspendTimer;active=!0;interacted=!1;enabled(){return!this.preferences.muted&&this.preferences.clickSounds&&this.preferences.clickVolume>0}async unlock(){if(!(this.disposed||document.hidden||!this.active||!this.enabled()))try{if(!this.context){this.context=new AudioContext,this.master=this.context.createGain(),this.master.gain.value=0;const t=this.context.createDynamicsCompressor();t.threshold.value=-12,t.ratio.value=6,this.analyser=this.context.createAnalyser(),this.analyser.fftSize=256,this.master.connect(t).connect(this.analyser).connect(this.context.destination),this.context.addEventListener("statechange",()=>this.report(),{signal:this.events.signal})}this.context.state==="suspended"&&await this.context.resume(),this.disposed||this.sync()}catch{this.unavailable=!0,this.report()}}ramp(t,n,s=.15){const r=this.context.currentTime;t.cancelScheduledValues(r),t.setTargetAtTime(n,r,s)}cleanup(t){t.nodes.forEach(n=>n.disconnect()),this.voices.delete(t)}sync(){clearTimeout(this.suspendTimer);const t=this.context;if(!t||this.disposed){this.report();return}const n=this.enabled()&&!document.hidden&&this.active;if(n&&t.state==="suspended"&&t.resume().catch(()=>{this.unavailable=!0,this.report()}),this.ramp(this.master.gain,n?.7:0,.035),!n){const s=()=>{for(const r of this.voices)r.sources.forEach(o=>{try{o.stop()}catch{}}),this.cleanup(r);t.suspend().catch(()=>{})};document.hidden||!this.active?s():this.suspendTimer=setTimeout(s,180)}this.report()}report(){this.status(this.unavailable?"Audio is unavailable in this browser.":this.preferences.muted?"All sound is muted.":document.hidden||!this.active?"Audio paused while the app is hidden.":this.context?.state==="running"?"Audio is ready · pauses automatically in the background.":"Click a control or preview to start audio.")}configure(t){this.preferences=t,this.sync(),!this.context&&this.interacted&&this.unlock()}async play(t="click"){await this.unlock();const n=this.context;if(this.disposed||!n||n.state!=="running"||document.hidden||!this.active||this.preferences.muted||!this.preferences.clickSounds||!this.preferences.clickVolume||performance.now()-this.lastClick<45)return;this.lastClick=performance.now(),this.clicks++;const s=n.createGain(),r=n.createOscillator(),o=n.currentTime;r.type="sine",r.frequency.setValueAtTime(t==="select"?660:900,o),r.frequency.exponentialRampToValueAtTime(t==="select"?990:420,o+.065),s.gain.setValueAtTime(0,o),s.gain.linearRampToValueAtTime(this.preferences.clickVolume/100*.12,o+.004),s.gain.exponentialRampToValueAtTime(1e-4,o+(t==="select"?.19:.065)),r.connect(s).connect(this.master);const i={gain:s,sources:[r],nodes:[r,s]};this.voices.add(i),r.onended=()=>this.cleanup(i),r.start(),r.stop(o+.22)}diagnostics(){const t=new Float32Array(256);return this.analyser?.getFloatTimeDomainData(t),{state:this.context?.state||"unstarted",muted:this.preferences.muted,voices:this.voices.size,clicks:this.clicks,rms:Math.sqrt(t.reduce((n,s)=>n+s*s,0)/t.length)}}dispose(){this.disposed=!0,this.events.abort(),clearTimeout(this.suspendTimer);for(const t of this.voices)t.sources.forEach(n=>{try{n.stop()}catch{}}),this.cleanup(t);this.context?.close().catch(()=>{})}}const ov=e=>e.kind==="message"&&(e.role==="user"||e.role==="assistant"),gl=e=>e.kind==="commit"?"#ffd580":e.kind==="message"?e.role==="user"?"#b0e9d6":"#9bbcff":e.kind.startsWith("tool_")?"#eac594":"#d7a1f1",ml=e=>e.kind==="message"?e.role==="user"?"You":e.role==="assistant"?"Assistant":"Message":{tool_call:"Tool call",tool_result:"Tool result",reasoning:"Reasoning",compaction:"Compaction",file_change:"File change",error:"Error",event:"Event",commit:"Commit"}[e.kind],xe=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]),Lg=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"medium"}),Na=e=>e===null?"Time not recorded":Lg.format(e),Fa=e=>`<span class="event-badge" style="--event-color:${gl(e)}">${ml(e)}</span>`;function Ig(e,t,n){const s=document.createElement("aside");s.className="event-panel glass",s.id="message-panel",s.hidden=!0,s.setAttribute("aria-labelledby","event-title"),s.innerHTML=`<header class="event-heading"><h2 id="event-title">Messages</h2><button class="icon-button event-close" aria-label="Close message details">${W("x")}</button></header>
|
|
83
|
+
<div class="event-detail-nav"><button class="secondary-button" data-step="previous" aria-label="Previous message" title="Previous message (← / ↑)">← Previous</button><span class="event-position" role="status"></span><button class="secondary-button" data-step="next" aria-label="Next message" title="Next message (→ / ↓)">Next →</button></div>
|
|
84
|
+
<div class="event-scroll"><article class="event-content" aria-label="Message details" tabindex="0"></article>
|
|
85
|
+
<details class="event-browser"><summary>Browse messages <span class="event-count"></span></summary>
|
|
86
|
+
<nav class="event-list" aria-label="Session messages"></nav><div class="event-pagination"><button class="secondary-button" data-page="previous">← Earlier page</button><button class="secondary-button" data-page="next">Later page →</button></div>
|
|
87
|
+
</details>
|
|
88
|
+
</div><footer class="event-footer"><span class="event-coverage"></span><button class="text-button event-reload">Reload</button></footer>`,e.append(s);const r=b=>s.querySelector(b),o=new AbortController;let i,a,c,l,h="messages",u=!1,g,p,f={};const d=(b,E)=>`<button class="event-row" data-event="${xe(b.id)}" aria-current="${c?.selected?.id===b.id?"true":"false"}"><span class="event-row-top">${Fa(b)}<small>#${c.offset+E+1}</small></span><span class="event-preview">${xe(b.preview||"No text recorded")}</span><time>${Na(b.time)}</time></button>`;function m(){!c||!r(".event-browser").open||(r(".event-list").innerHTML=c.items.map(d).join("")||'<p class="event-empty">No saved messages.</p>')}function v(){if(!c)return;r(".event-count").textContent=`${c.total.toLocaleString()} ${h==="tools"?"tool events":"messages"}${c.partial?" · partial coverage":""}`,m();for(const E of["previous","next"])r(`[data-page="${E}"]`).disabled=!c[`${E}Cursor`];r(".event-coverage").textContent=c.partial?"Partial history":"Saved locally";const b=c.selected;r(".event-position").textContent=b?`${c.offset+c.items.findIndex(E=>E.id===b.id)+1} / ${c.total}`:"No messages";for(const E of["previous","next"])r(`[data-step="${E}"]`).disabled=!c[`${E}Item`];if(!b){r(".event-content").innerHTML='<div class="event-empty"><h3>No messages yet.</h3><p>Refresh the source to import saved user and assistant messages.</p></div>',n.select(null);return}n.select(b),r(".event-content").innerHTML=`<div class="event-detail-heading">${Fa(b)}<h3>${xe(b.name)}</h3><p>${Na(b.time)}</p></div>
|
|
89
|
+
${b.partial?'<p class="event-warning">Partial message</p>':""}
|
|
90
|
+
${b.text?`<section class="event-payload"><pre>${xe(b.text)}</pre></section>`:""}
|
|
91
|
+
${b.input?`<section class="event-payload"><h4>Input</h4><pre>${xe(b.input)}</pre></section>`:""}
|
|
92
|
+
${b.output?`<section class="event-payload"><h4>Result</h4><pre>${xe(b.output)}</pre></section>`:""}
|
|
93
|
+
${b.cwd?`<p>Execution directory: <code>${xe(b.cwd)}</code></p>`:""}${b.exitCode!==void 0?`<p>Exit code: ${b.exitCode}</p>`:""}
|
|
94
|
+
${c.related.length?`<section><h4>Related execution events</h4>${c.related.map(E=>`<button class="event-row" data-event="${xe(E.id)}">${xe(E.name)} · ${xe(E.preview)}</button>`).join("")}</section>`:""}
|
|
95
|
+
<details class="event-provenance"><summary>Source details</summary><dl><dt>Source</dt><dd>${xe(Ne(a?.source))}</dd><dt>Message ID</dt><dd>${xe(b.messageID)}</dd><dt>Timestamp source</dt><dd>${xe(b.timeSource)}</dd></dl></details>`}async function k(b={}){if(!a)return;clearTimeout(p),i?.abort();const E=new AbortController;i=E,f=b,u=!0,s.setAttribute("aria-busy","true"),r(".event-position").textContent="Loading…";for(const D of s.querySelectorAll("[data-step], [data-page]"))D.disabled=!0;const C=r(".event-list").scrollTop,x=c?.offset,y=document.activeElement,M=y instanceof HTMLElement?y.dataset:void 0;try{const D=await t.read(a.id,{filter:h,...b,...l?{revision:l}:{}},E.signal);if(E.signal.aborted)return;c=D,l=c.revision,v(),r(".event-list").scrollTop=c.offset===x?C:0,r(".event-scroll").scrollTop=0;const H=M?.event?`[data-event="${M.event}"]`:"";H&&(document.activeElement===y||!y?.isConnected&&document.activeElement===document.body)&&s.querySelector(H)?.focus({preventScroll:!0}),clearTimeout(p),p=setTimeout(()=>{g?.abort(),g=new AbortController;for(const P of[c?.previousItem,c?.nextItem])P&&t.read(a.id,{item:P,filter:h,revision:l},g.signal).catch(()=>{})},60)}catch(D){if(E.signal.aborted)return;c=void 0,r(".event-position").textContent="Unavailable",r(".event-content").innerHTML=`<div class="event-empty"><h3>Could not load this history.</h3><p>${xe(D instanceof Error?D.message:"Please retry.")}</p><button class="secondary-button" data-retry>Retry</button> <button class="secondary-button" data-reload>Reload current history</button></div>`}finally{i===E&&(u=!1,s.removeAttribute("aria-busy"))}}const L=()=>{t.clear(),l=void 0,c=void 0,k()},O=()=>!s.hidden&&!e.hidden,w=()=>{clearTimeout(p),g?.abort(),i?.abort(),i=void 0,u=!1,c=void 0,s.hidden=!0,s.removeAttribute("aria-busy"),e.classList.remove("has-events"),n.select(null)},S=b=>{if(u)return;const E=b==="next"?c?.nextItem:c?.previousItem;E&&k({item:E})};return s.addEventListener("click",b=>{const E=b.target.closest("button");if(E){if(E.dataset.event&&k({item:E.dataset.event}),E.dataset.step&&S(E.dataset.step==="next"?"next":"previous"),E.dataset.page){const C=E.dataset.page==="next"?c?.nextCursor:c?.previousCursor;C&&k({cursor:C})}E.hasAttribute("data-retry")&&k(f),(E.hasAttribute("data-reload")||E.classList.contains("event-reload"))&&L(),E.classList.contains("event-close")&&(w(),document.querySelector("#scene canvas")?.focus({preventScroll:!0}))}},{signal:o.signal}),r(".event-browser").addEventListener("toggle",m,{signal:o.signal}),{close:w,handleKey(b){return!O()||b.defaultPrevented||b.metaKey||b.ctrlKey||b.altKey||b.shiftKey||document.querySelector("dialog[open]")||b.target.closest('input, select, textarea, [contenteditable="true"], #explorer')?!1:b.key==="Escape"?(b.preventDefault(),w(),document.querySelector("#scene canvas")?.focus({preventScroll:!0}),!0):["ArrowLeft","ArrowUp","ArrowRight","ArrowDown"].includes(b.key)?(b.preventDefault(),S(b.key==="ArrowLeft"||b.key==="ArrowUp"?"previous":"next"),!0):!1},open(b,E,C,x="messages"){clearTimeout(p),g?.abort();const y=a?.id===b.id;a=b,l=C,c=void 0,h=x,r("#event-title").textContent=`${Ne(b.source)} ${h==="tools"?"execution evidence":"messages"}`,r(".event-browser summary").firstChild.textContent=h==="tools"?"Browse tool events ":"Browse messages ",r(".event-list").replaceChildren(),r(".event-content").innerHTML='<p class="event-empty">Loading saved history…</p>',r(".event-coverage").textContent="Loading coverage…",y||(r(".event-browser").open=!1),s.hidden=!1,e.classList.add("has-events"),k(E?{item:E}:{})},dispose(){clearTimeout(p),g?.abort(),i?.abort(),o.abort(),s.remove()}}}function Tg(e,t,n){const s=new Map;let r,o,i,a,c=0,l=0,h=1;const u=document.createElement("strong"),g=document.createElement("pre"),p=document.createElement("span"),f=()=>{clearTimeout(i),o?.abort(),o=void 0,r=void 0,a=void 0,e.hidden=!0,e.classList.remove("message-tooltip")};function d(v,k){if(!a)return;const L=`${ml(a)} · ${a.name}`,O=v||"No text recorded.",w=[k,h>1?`${h} nearby items`:"","Click to focus and read · ← / → to navigate"].filter(Boolean).join(" · ");u.textContent!==L&&(u.textContent=L),g.textContent!==O&&(g.textContent=O),p.textContent!==w&&(p.textContent=w),u.parentElement!==e&&e.replaceChildren(u,g,p),e.classList.add("message-tooltip"),e.hidden=!1,e.style.setProperty("--event-color",gl(a));const S=e.offsetWidth,b=e.offsetHeight,E=t.getBoundingClientRect(),C=[...document.querySelectorAll(".floating-panel:not([hidden]), .app-header, .map-controls")].map(M=>M.getBoundingClientRect()),y=[l+18,l-b-18].flatMap(M=>[c+18,c-S-18].map(D=>{D=Math.max(8,Math.min(D,t.clientWidth-S-8)),M=Math.max(8,Math.min(M,t.clientHeight-b-8));const H=E.left+D,P=E.top+M,F=C.reduce((B,j)=>B+Math.max(0,Math.min(H+S,j.right+8)-Math.max(H,j.left-8))*Math.max(0,Math.min(P+b,j.bottom+8)-Math.max(P,j.top-8)),0);return{left:D,top:M,overlap:F}})).reduce((M,D)=>D.overlap<M.overlap?D:M);e.style.left=`${y.left}px`,e.style.top=`${y.top}px`}function m(v){const k=[v.text,v.input?`Input
|
|
96
|
+
${v.input}`:"",v.output?`Output
|
|
97
|
+
${v.output}`:""].filter(Boolean).join(`
|
|
98
|
+
|
|
99
|
+
`);return{text:k.slice(0,1800),shortened:k.length>1800||!!v.partial}}return{clear:f,show(v,k,L,O,w,S){const b=`${k}:${L}:${v.id}`,E=r!==b;E&&f(),r=b,a=v,c=w,l=S,h=O;const C=s.get(b);d(C?.text||v.preview,C?C.shortened?"Content preview":"":"Loading message…"),!(!E||C)&&(i=setTimeout(async()=>{const x=new AbortController;o=x;try{const y=await n.read(k,{item:v.id,revision:L,filter:v.kind==="commit"?"tools":"messages"},x.signal);if(x.signal.aborted||r!==b||y.selected?.id!==v.id)return;const M=m(y.selected);s.set(b,M),s.size>20&&s.delete(s.keys().next().value),d(M.text,M.shortened?"Content preview":"")}catch{!x.signal.aborted&&r===b&&d(v.preview,"Saved excerpt · open for details")}},120))},dispose(){f(),s.clear()}}}const Mg=e=>e.length!==40&&e.length!==64;function Ag(e,t,n){const s=new AbortController,r=document.createElement("div");r.className="section-label",r.textContent="Commits";const o=document.createElement("span");r.append(o);const i=document.createElement("p");i.className="coverage-note commit-coverage",i.textContent="Loading commits…";const a=document.createElement("div"),c=document.createElement("button");c.className="load-more",c.hidden=!0,e.replaceChildren(r,i,a,c);let l,h;async function u(){c.disabled=!0;try{const g=new URLSearchParams({limit:"30",...l?{cursor:l}:{}}),p=await fetch(`/api/sessiongraph/session/${encodeURIComponent(t)}/commits?${g}`,{signal:s.signal}),f=await p.json();if(!p.ok)throw new Error(f.error||"Commit index unavailable.");if(s.signal.aborted)return;h=f.revision,o.textContent=f.total?f.total.toLocaleString():"",i.hidden=f.total>0,i.textContent=f.coverage.state==="pending"?"Commit indexing pending.":f.coverage.state==="unavailable"?"Commit history unavailable.":"No commits found.";for(const d of f.items){const m=document.createElement("button");m.className="relation";const v=document.createElement("span"),k=document.createElement("strong"),L=document.createElement("small");k.textContent=`${d.sha.slice(0,12)} · ${d.operation}`,L.textContent=`${d.occurredAt===null?"Time not recorded":new Date(d.occurredAt).toLocaleString()} · ${d.repositoryPath}`,m.title=`${d.sha}${Mg(d.sha)?" (abbreviated)":""} — inspect execution evidence`,v.append(k,L),m.append(v),m.addEventListener("click",()=>n(d.evidenceEventID,h),{signal:s.signal}),a.append(m)}l=f.nextCursor||void 0,c.hidden=!l,c.textContent="Load more commits"}catch(g){if(s.signal.aborted)return;o.textContent="",i.hidden=!1,i.textContent=g instanceof Error?g.message:"Commit index unavailable.",l=void 0,a.replaceChildren(),c.hidden=!1,c.textContent="Reload commits"}finally{c.disabled=!1}}return c.addEventListener("click",()=>{u()},{signal:s.signal}),u(),()=>s.abort()}function he(e,t,n,s){if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?s:n==="a"?s.call(e):s?s.value:t.get(e)}function ln(e,t,n,s,r){if(typeof t=="function"?e!==t||!0:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var Ms,rn,Oe,on,As,eo,Os;const Ha="__TAURI_TO_IPC_KEY__";function Og(e,t=!1){return window.__TAURI_INTERNALS__.transformCallback(e,t)}class iv{constructor(t){Ms.add(this),rn.set(this,void 0),Oe.set(this,0),on.set(this,[]),As.set(this,void 0),ln(this,rn,t||(()=>{})),this.id=Og(n=>{const s=n.index;if("end"in n){s==he(this,Oe,"f")?this.cleanupCallback():ln(this,As,s);return}const r=n.message;if(s==he(this,Oe,"f")){for(he(this,Ms,"m",eo).call(this,r),ln(this,Oe,he(this,Oe,"f")+1);he(this,Oe,"f")in he(this,on,"f");){const o=he(this,on,"f")[he(this,Oe,"f")];he(this,Ms,"m",eo).call(this,o),delete he(this,on,"f")[he(this,Oe,"f")],ln(this,Oe,he(this,Oe,"f")+1)}he(this,Oe,"f")===he(this,As,"f")&&this.cleanupCallback()}else he(this,on,"f")[s]=r})}cleanupCallback(){window.__TAURI_INTERNALS__.unregisterCallback(this.id)}set onmessage(t){ln(this,rn,t)}get onmessage(){return he(this,rn,"f")}[(rn=new WeakMap,Oe=new WeakMap,on=new WeakMap,As=new WeakMap,Ms=new WeakSet,eo=function(n){try{he(this,rn,"f").call(this,n)}catch(s){queueMicrotask(()=>{throw s})}},Ha)](){return`__CHANNEL__:${this.id}`}toJSON(){return this[Ha]()}}async function bi(e,t={},n){return window.__TAURI_INTERNALS__.invoke(e,t,n)}class av{get rid(){return he(this,Os,"f")}constructor(t){Os.set(this,void 0),ln(this,Os,t)}async close(){return bi("plugin:resources|close",{rid:this.rid})}async[(Os=new WeakMap,Symbol.asyncDispose)](){await this.close()}}function ss(){return!!(globalThis||window).isTauri}async function Dg(e,t){await bi("plugin:opener|open_url",{url:e,with:t})}function yl(e){const t=new URL(e);if(!["https:","http:"].includes(t.protocol)||t.username||t.password)throw new Error("Choose a valid web link.");return t.href}async function vl(e,t=Dg){await t(yl(e))}class Pg{constructor(t=(...n)=>fetch(...n)){this.request=t}request;pages=new Map;pending=new Map;characters=0;generation=0;clear(){this.generation++,this.pages.clear(),this.characters=0;for(const t of this.pending.values())t.controller.abort();this.pending.clear()}read(t,n={},s){if(s?.aborted)return Promise.reject(s.reason);const r=n.filter||"all",o=JSON.stringify([t,n.revision,r,n.item,n.cursor]),i=n.revision?this.pages.get(o):void 0;if(i)return this.pages.delete(o),this.pages.set(o,i),Promise.resolve(i.page);let a=this.pending.get(o);if(!a){const l=new AbortController,h=this.generation,u=new URLSearchParams({filter:r,...n}),g=this.request(`/api/sessiongraph/session/${encodeURIComponent(t)}/events?${u}`,{signal:AbortSignal.any([l.signal,AbortSignal.timeout(3e4)])}).then(async d=>{const m=await d.json();if(!d.ok)throw d.status===409&&this.clear(),new Error(m.error||"Could not load events.");if(l.signal.aborted||h!==this.generation)throw new DOMException("Request cancelled","AbortError");if(m.sessionID!==t||n.revision&&m.revision!==n.revision)throw new Error("Saved history changed. Reload the event explorer.");const v=JSON.stringify([t,m.revision,r,n.item,n.cursor]),k=JSON.stringify(m).length;for(this.characters-=this.pages.get(v)?.characters||0,this.pages.delete(v),this.pages.set(v,{page:m,characters:k}),this.characters+=k;this.pages.size>20||this.characters>2e6;){const L=this.pages.keys().next().value;this.characters-=this.pages.get(L).characters,this.pages.delete(L)}return m});a={controller:l,promise:g,readers:0},this.pending.set(o,a);const p=a,f=()=>{this.pending.get(o)===p&&this.pending.delete(o)};g.then(f,f)}const c=a;return c.readers++,new Promise((l,h)=>{const u=()=>{p(),h(s.reason)};let g=!1;const p=()=>{g||(g=!0,s?.removeEventListener("abort",u),--c.readers===0&&this.pending.get(o)===c&&(this.pending.delete(o),c.controller.abort()))};s?.addEventListener("abort",u,{once:!0}),c.promise.then(f=>{g||(p(),l(f))},f=>{g||(p(),h(f))})})}}async function Rg(){await bi("plugin:process|restart")}class Vg{constructor(t,n,s=Date.now){this.backend=t,this.changed=n,this.now=s}backend;changed;now;state={phase:"hidden"};release;busy=!1;disposed=!1;downloaded=!1;installed=!1;lastCheck=-1/0;set(t){this.disposed||(this.state=t,this.changed(t))}async close(){const t=this.release;this.release=void 0,await t?.close().catch(()=>{})}async check(){if(!(this.disposed||this.busy||this.release||this.now()-this.lastCheck<5*6e4)){this.busy=!0,this.lastCheck=this.now();try{this.release=await this.backend.check()||void 0,this.release&&this.set({phase:"available",version:this.release.version})}catch{}finally{this.busy=!1,this.disposed&&await this.close()}}}async activate(){if(this.disposed||this.busy||!this.release)return;this.busy=!0;const{version:t}=this.release;let n=this.installed?"restart":this.downloaded?"install":"download";try{if(!this.downloaded){let s,r=0;this.set({phase:"downloading",version:t}),await this.release.download(o=>{o.event==="Started"&&(s=o.data.contentLength,r=0),o.event==="Progress"&&(r+=o.data.chunkLength),this.set({phase:"downloading",version:t,progress:s&&s>0?Math.min(99,Math.floor(r/s*100)):void 0})}),this.downloaded=!0,this.set({phase:"ready",version:t});return}if(this.installed||(this.set({phase:"installing",version:t}),await this.release.install(),this.installed=!0),this.disposed)return;n="restart",this.set({phase:"restarting",version:t}),await this.backend.restart()}catch(s){this.set({phase:"error",version:t,retry:n,error:String(s instanceof Error?s.message:s).slice(0,300)})}finally{this.busy=!1,this.disposed&&await this.close()}}dispose(){this.disposed=!0,this.busy||this.close()}}const Ng=W("arrow-down"),Fg=W("refresh-cw");function Hg(e){const t=document.createElement("button");t.className="desktop-update glass",t.hidden=!0,t.type="button";const n=document.createElement("span");n.className="sr-only",n.role="status",n.setAttribute("aria-live","polite"),document.querySelector("#app").append(t,n);let s="";const r=l=>{const h=["downloading","installing","restarting"].includes(l.phase),u=l.phase==="ready"||l.phase==="error"&&l.retry!=="download",g=l.phase==="downloading"?l.progress===void 0?"Downloading":`${l.progress}%`:l.phase==="installing"?"Installing":l.phase==="restarting"?"Restarting":u?"Restart":l.phase==="error"?"Retry update":"Update",p=l.phase==="error"?`${l.retry==="restart"?"Could not restart SessionGraph.":`Could not ${l.retry==="download"?"download or verify":"install"} the update.`} ${l.error||""} Click to try again.`:l.phase==="restarting"?`Restarting SessionGraph ${l.version}`:u?`Restart to install SessionGraph ${l.version}`:`Update to SessionGraph ${l.version}`;t.hidden=l.phase==="hidden",t.disabled=h,t.dataset.phase=l.phase,t.setAttribute("aria-busy",String(h)),t.setAttribute("aria-label",p),t.title=p;const f=`${u||l.phase==="restarting"?Fg:Ng}<span>${g}</span>`;t.innerHTML!==f&&(t.innerHTML=f);const d=l.phase==="hidden"?"":l.phase==="downloading"?`Downloading SessionGraph ${l.version}`:p;d!==s&&(n.textContent=d,s=d)},o=new Vg(e,r);t.addEventListener("click",()=>{o.activate()});const i=()=>{document.visibilityState==="visible"&&navigator.onLine&&o.check()},a=window.setTimeout(i,1e4),c=window.setInterval(i,240*6e4);return document.addEventListener("visibilitychange",i),window.addEventListener("online",i),{check:()=>o.check(),dispose(){clearTimeout(a),clearInterval(c),o.dispose(),t.remove(),n.remove(),document.removeEventListener("visibilitychange",i),window.removeEventListener("online",i)}}}function Wg(){return ss()?Hg({async check(){const{check:e}=await mr(async()=>{const{check:n}=await import("./index-U9QGDl1t.js");return{check:n}},[]),t=await e({timeout:15e3});return t&&{version:t.version,download:n=>t.download(n,{timeout:10*6e4}),install:()=>t.install({restartAfterInstall:!0}),close:()=>t.close()}},async restart(){await Rg()}}):{dispose(){}}}var jg=un("date-picker").parts("clearTrigger","content","control","input","label","monthSelect","nextTrigger","positioner","presetTrigger","prevTrigger","rangeText","root","table","tableBody","tableCell","tableCellTrigger","tableHead","tableHeader","tableRow","trigger","view","viewControl","viewTrigger","yearSelect"),ee=jg.build();function to(e,t){return e-t*Math.floor(e/t)}const bl=1721426;function Ds(e,t,n,s){t=wi(e,t);let r=t-1,o=-2;return n<=2?o=0:Gs(t)&&(o=-1),bl-1+365*r+Math.floor(r/4)-Math.floor(r/100)+Math.floor(r/400)+Math.floor((367*n-362)/12+o+s)}function Gs(e){return e%4===0&&(e%100!==0||e%400===0)}function wi(e,t){return e==="BC"?1-t:t}function _g(e){let t="AD";return e<=0&&(t="BC",e=1-e),[t,e]}const Bg={standard:[31,28,31,30,31,30,31,31,30,31,30,31],leapyear:[31,29,31,30,31,30,31,31,30,31,30,31]};class kn{fromJulianDay(t){let n=t,s=n-bl,r=Math.floor(s/146097),o=to(s,146097),i=Math.floor(o/36524),a=to(o,36524),c=Math.floor(a/1461),l=to(a,1461),h=Math.floor(l/365),u=r*400+i*100+c*4+h+(i!==4&&h!==4?1:0),[g,p]=_g(u),f=n-Ds(g,p,1,1),d=2;n<Ds(g,p,3,1)?d=0:Gs(p)&&(d=1);let m=Math.floor(((f+d)*12+373)/367),v=n-Ds(g,p,m,1)+1;return new Ue(g,p,m,v)}toJulianDay(t){return Ds(t.era,t.year,t.month,t.day)}getDaysInMonth(t){return Bg[Gs(t.year)?"leapyear":"standard"][t.month-1]}getMonthsInYear(t){return 12}getDaysInYear(t){return Gs(t.year)?366:365}getMaximumMonthsInYear(){return 12}getMaximumDaysInMonth(){return 31}getYearsInEra(t){return 9999}getEras(){return["BC","AD"]}isInverseEra(t){return t.era==="BC"}balanceDate(t){t.year<=0&&(t.era=t.era==="BC"?"AD":"BC",t.year=1-t.year)}constructor(){this.identifier="gregory"}}const Ug={"001":1,AD:1,AE:6,AF:6,AI:1,AL:1,AM:1,AN:1,AR:1,AT:1,AU:1,AX:1,AZ:1,BA:1,BE:1,BG:1,BH:6,BM:1,BN:1,BY:1,CH:1,CL:1,CM:1,CN:1,CR:1,CY:1,CZ:1,DE:1,DJ:6,DK:1,DZ:6,EC:1,EE:1,EG:6,ES:1,FI:1,FJ:1,FO:1,FR:1,GB:1,GE:1,GF:1,GP:1,GR:1,HR:1,HU:1,IE:1,IQ:6,IR:6,IS:1,IT:1,JO:6,KG:1,KW:6,KZ:1,LB:1,LI:1,LK:1,LT:1,LU:1,LV:1,LY:6,MC:1,MD:1,ME:1,MK:1,MN:1,MQ:1,MV:5,MY:1,NL:1,NO:1,NZ:1,OM:6,PL:1,QA:6,RE:1,RO:1,RS:1,RU:1,SD:6,SE:1,SI:1,SK:1,SM:1,SY:6,TJ:1,TM:1,TR:1,UA:1,UY:1,UZ:1,VA:1,VN:1,XK:1};function Te(e,t){return t=me(t,e.calendar),e.era===t.era&&e.year===t.year&&e.month===t.month&&e.day===t.day}function qg(e,t){return t=me(t,e.calendar),e=dt(e),t=dt(t),e.era===t.era&&e.year===t.year&&e.month===t.month}function Gg(e,t){return t=me(t,e.calendar),e=hs(e),t=hs(t),e.era===t.era&&e.year===t.year}function Yg(e,t){return Ar(e.calendar,t.calendar)&&Te(e,t)}function _n(e,t){return Ar(e.calendar,t.calendar)&&qg(e,t)}function Bn(e,t){return Ar(e.calendar,t.calendar)&&Gg(e,t)}function Ar(e,t){return e.isEqual?.(t)??t.isEqual?.(e)??e.identifier===t.identifier}function Kg(e,t){return Te(e,Or(t))}const Zg={sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6};function wl(e,t,n){let s=e.calendar.toJulianDay(e),r=n?Zg[n]:Qg(t),o=Math.ceil(s+1-r)%7;return o<0&&(o+=7),o}function kl(e){return ut(Date.now(),e)}function Or(e){return qt(kl(e))}function Cl(e,t){return e.calendar.toJulianDay(e)-t.calendar.toJulianDay(t)}function zg(e,t){return Wa(e)-Wa(t)}function Wa(e){return e.hour*36e5+e.minute*6e4+e.second*1e3+e.millisecond}let no=null,Jg=!1;function ki(){return no==null&&(no=new Intl.DateTimeFormat().resolvedOptions().timeZone),no}function El(){return Jg}function dt(e){return e.subtract({days:e.day-1})}function Wo(e){return e.add({days:e.calendar.getDaysInMonth(e)-e.day})}function hs(e){return dt(e.subtract({months:e.month-1}))}function Xg(e){return Wo(e.add({months:e.calendar.getMonthsInYear(e)-e.month}))}function Lt(e,t,n){let s=wl(e,t,n);return e.subtract({days:s})}function ja(e,t,n){return Lt(e,t,n).add({days:6})}const _a=new Map,so=new Map;function Sl(e){if(Intl.Locale){let n=_a.get(e);return n||(n=new Intl.Locale(e).maximize().region,n&&_a.set(e,n)),n}let t=e.split("-")[1];return t==="u"?void 0:t}function Qg(e){let t=so.get(e);if(!t){if(Intl.Locale){let s=new Intl.Locale(e);if("getWeekInfo"in s&&(t=s.getWeekInfo(),t))return so.set(e,t),t.firstDay}let n=Sl(e);if(e.includes("-fw-")){let s=e.split("-fw-")[1].split("-")[0];s==="mon"?t={firstDay:1}:s==="tue"?t={firstDay:2}:s==="wed"?t={firstDay:3}:s==="thu"?t={firstDay:4}:s==="fri"?t={firstDay:5}:s==="sat"?t={firstDay:6}:t={firstDay:0}}else e.includes("-ca-iso8601")?t={firstDay:1}:t={firstDay:n&&Ug[n]||0};so.set(e,t)}return t.firstDay}function em(e,t,n){let s=e.calendar.getDaysInMonth(e);return Math.ceil((wl(dt(e),t,n)+s)/7)}function xl(e,t){return e&&t?e.compare(t)<=0?e:t:e||t}function $l(e,t){return e&&t?e.compare(t)>=0?e:t:e||t}const tm={AF:[4,5],AE:[5,6],BH:[5,6],DZ:[5,6],EG:[5,6],IL:[5,6],IQ:[5,6],IR:[5,5],JO:[5,6],KW:[5,6],LY:[5,6],OM:[5,6],QA:[5,6],SA:[5,6],SD:[5,6],SY:[5,6],YE:[5,6]};function nm(e,t){let n=e.calendar.toJulianDay(e),s=Math.ceil(n+1)%7;s<0&&(s+=7);let r=Sl(t),[o,i]=tm[r]||[6,0];return s===o||s===i}function Cn(e){e=me(e,new kn);let t=wi(e.era,e.year);return Ll(t,e.month,e.day,e.hour,e.minute,e.second,e.millisecond)}function Ll(e,t,n,s,r,o,i){let a=new Date;return a.setUTCHours(s,r,o,i),a.setUTCFullYear(e,t-1,n),a.getTime()}function jo(e,t){if(t==="UTC")return 0;if(e>0&&t===ki()&&!El())return new Date(e).getTimezoneOffset()*-6e4;let{year:n,month:s,day:r,hour:o,minute:i,second:a}=Il(e,t);return Ll(n,s,r,o,i,a,0)-Math.floor(e/1e3)*1e3}const Ba=new Map;function Il(e,t){let n=Ba.get(t);n||(n=new Intl.DateTimeFormat("en-US",{timeZone:t,hour12:!1,era:"short",year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}),Ba.set(t,n));let s=n.formatToParts(new Date(e)),r={};for(let o of s)o.type!=="literal"&&(r[o.type]=o.value);return{year:r.era==="BC"||r.era==="B"?-r.year+1:+r.year,month:+r.month,day:+r.day,hour:r.hour==="24"?0:+r.hour,minute:+r.minute,second:+r.second}}const Ua=864e5;function sm(e,t,n,s){return(n===s?[n]:[n,s]).filter(o=>rm(e,t,o))}function rm(e,t,n){let s=Il(n,t);return e.year===s.year&&e.month===s.month&&e.day===s.day&&e.hour===s.hour&&e.minute===s.minute&&e.second===s.second}function ct(e,t,n="compatible"){let s=Fe(e);if(t==="UTC")return Cn(s);if(t===ki()&&n==="compatible"&&!El()){s=me(s,new kn);let c=new Date,l=wi(s.era,s.year);return c.setFullYear(l,s.month-1,s.day),c.setHours(s.hour,s.minute,s.second,s.millisecond),c.getTime()}let r=Cn(s),o=jo(r-Ua,t),i=jo(r+Ua,t),a=sm(s,t,r-o,r-i);if(a.length===1)return a[0];if(a.length>1)switch(n){case"compatible":case"earlier":return a[0];case"later":return a[a.length-1];case"reject":throw new RangeError("Multiple possible absolute times found")}switch(n){case"earlier":return Math.min(r-o,r-i);case"compatible":case"later":return Math.max(r-o,r-i);case"reject":throw new RangeError("No such absolute time found")}}function Tl(e,t,n="compatible"){return new Date(ct(e,t,n))}function ut(e,t){let n=jo(e,t),s=new Date(e+n),r=s.getUTCFullYear(),o=s.getUTCMonth()+1,i=s.getUTCDate(),a=s.getUTCHours(),c=s.getUTCMinutes(),l=s.getUTCSeconds(),h=s.getUTCMilliseconds();return new fs(r<1?"BC":"AD",r<1?-r+1:r,o,i,t,n,a,c,l,h)}function qt(e){return new Ue(e.calendar,e.era,e.year,e.month,e.day)}function Fe(e,t){let n=0,s=0,r=0,o=0;if("timeZone"in e)({hour:n,minute:s,second:r,millisecond:o}=e);else if("hour"in e&&!t)return e;return t&&({hour:n,minute:s,second:r,millisecond:o}=t),new lr(e.calendar,e.era,e.year,e.month,e.day,n,s,r,o)}function me(e,t){if(Ar(e.calendar,t))return e;let n=t.fromJulianDay(e.calendar.toJulianDay(e)),s=e.copy();return s.calendar=t,s.era=n.era,s.year=n.year,s.month=n.month,s.day=n.day,zt(s),s}function Ml(e,t,n){if(e instanceof fs)return e.timeZone===t?e:im(e,t);let s=ct(e,t,n);return ut(s,t)}function om(e){let t=Cn(e)-e.offset;return new Date(t)}function im(e,t){let n=Cn(e)-e.offset;return me(ut(n,t),e.calendar)}const Un=36e5;function Dr(e,t){let n=e.copy(),s="hour"in n?dm(n,t):0;_o(n,t.years||0),n.calendar.balanceYearMonth&&n.calendar.balanceYearMonth(n,e),n.month+=t.months||0,Bo(n),Al(n),n.day+=(t.weeks||0)*7,n.day+=t.days||0,n.day+=s,am(n),n.calendar.balanceDate&&n.calendar.balanceDate(n),n.year<1&&(n.year=1,n.month=1,n.day=1);let r=n.calendar.getYearsInEra(n);if(n.year>r){let i=n.calendar.isInverseEra?.(n);n.year=r,n.month=i?1:n.calendar.getMonthsInYear(n),n.day=i?1:n.calendar.getDaysInMonth(n)}n.month<1&&(n.month=1,n.day=1);let o=n.calendar.getMonthsInYear(n);return n.month>o&&(n.month=o,n.day=n.calendar.getDaysInMonth(n)),n.day=Math.max(1,Math.min(n.calendar.getDaysInMonth(n),n.day)),n}function _o(e,t){e.calendar.isInverseEra?.(e)&&(t=-t),e.year+=t}function Bo(e){for(;e.month<1;)_o(e,-1),e.month+=e.calendar.getMonthsInYear(e);let t=0;for(;e.month>(t=e.calendar.getMonthsInYear(e));)e.month-=t,_o(e,1)}function am(e){for(;e.day<1;)e.month--,Bo(e),e.day+=e.calendar.getDaysInMonth(e);for(;e.day>e.calendar.getDaysInMonth(e);)e.day-=e.calendar.getDaysInMonth(e),e.month++,Bo(e)}function Al(e){e.month=Math.max(1,Math.min(e.calendar.getMonthsInYear(e),e.month)),e.day=Math.max(1,Math.min(e.calendar.getDaysInMonth(e),e.day))}function zt(e){e.calendar.constrainDate&&e.calendar.constrainDate(e),e.year=Math.max(1,Math.min(e.calendar.getYearsInEra(e),e.year)),Al(e)}function Ol(e){let t={};for(let n in e)typeof e[n]=="number"&&(t[n]=-e[n]);return t}function Dl(e,t){return Dr(e,Ol(t))}function Ci(e,t){let n=e.copy();return t.era!=null&&(n.era=t.era),t.year!=null&&(n.year=t.year),t.month!=null&&(n.month=t.month),t.day!=null&&(n.day=t.day),zt(n),n}function cr(e,t){let n=e.copy();return t.hour!=null&&(n.hour=t.hour),t.minute!=null&&(n.minute=t.minute),t.second!=null&&(n.second=t.second),t.millisecond!=null&&(n.millisecond=t.millisecond),lm(n),n}function cm(e){e.second+=Math.floor(e.millisecond/1e3),e.millisecond=Ps(e.millisecond,1e3),e.minute+=Math.floor(e.second/60),e.second=Ps(e.second,60),e.hour+=Math.floor(e.minute/60),e.minute=Ps(e.minute,60);let t=Math.floor(e.hour/24);return e.hour=Ps(e.hour,24),t}function lm(e){e.millisecond=Math.max(0,Math.min(e.millisecond,999)),e.second=Math.max(0,Math.min(e.second,59)),e.minute=Math.max(0,Math.min(e.minute,59)),e.hour=Math.max(0,Math.min(e.hour,23))}function Ps(e,t){let n=e%t;return n<0&&(n+=t),n}function dm(e,t){return e.hour+=t.hours||0,e.minute+=t.minutes||0,e.second+=t.seconds||0,e.millisecond+=t.milliseconds||0,cm(e)}function Ei(e,t,n,s){let r=e.copy();switch(t){case"era":{let o=e.calendar.getEras(),i=o.indexOf(e.era);if(i<0)throw new Error("Invalid era: "+e.era);i=ht(i,n,0,o.length-1,s?.round),r.era=o[i],zt(r);break}case"year":r.calendar.isInverseEra?.(r)&&(n=-n),r.year=ht(e.year,n,-1/0,9999,s?.round),r.year===-1/0&&(r.year=1),r.calendar.balanceYearMonth&&r.calendar.balanceYearMonth(r,e);break;case"month":r.month=ht(e.month,n,1,e.calendar.getMonthsInYear(e),s?.round);break;case"day":r.day=ht(e.day,n,1,e.calendar.getDaysInMonth(e),s?.round);break;default:throw new Error("Unsupported field "+t)}return e.calendar.balanceDate&&e.calendar.balanceDate(r),zt(r),r}function Pl(e,t,n,s){let r=e.copy();switch(t){case"hour":{let o=e.hour,i=0,a=23;if(s?.hourCycle===12){let c=o>=12;i=c?12:0,a=c?23:11}r.hour=ht(o,n,i,a,s?.round);break}case"minute":r.minute=ht(e.minute,n,0,59,s?.round);break;case"second":r.second=ht(e.second,n,0,59,s?.round);break;case"millisecond":r.millisecond=ht(e.millisecond,n,0,999,s?.round);break;default:throw new Error("Unsupported field "+t)}return r}function ht(e,t,n,s,r=!1){if(r){e+=Math.sign(t),e<n&&(e=s);let o=Math.abs(t);t>0?e=Math.ceil(e/o)*o:e=Math.floor(e/o)*o,e>s&&(e=n)}else e+=t,e<n?e=s-(n-e-1):e>s&&(e=n+(e-s-1));return e}function Rl(e,t){let n;if(t.years!=null&&t.years!==0||t.months!=null&&t.months!==0||t.weeks!=null&&t.weeks!==0||t.days!=null&&t.days!==0){let r=Dr(Fe(e),{years:t.years,months:t.months,weeks:t.weeks,days:t.days});n=ct(r,e.timeZone)}else n=Cn(e)-e.offset;n+=t.milliseconds||0,n+=(t.seconds||0)*1e3,n+=(t.minutes||0)*6e4,n+=(t.hours||0)*36e5;let s=ut(n,e.timeZone);return me(s,e.calendar)}function um(e,t){return Rl(e,Ol(t))}function hm(e,t,n,s){switch(t){case"hour":{let r=0,o=23;if(s?.hourCycle===12){let f=e.hour>=12;r=f?12:0,o=f?23:11}let i=Fe(e),a=me(cr(i,{hour:r}),new kn),c=[ct(a,e.timeZone,"earlier"),ct(a,e.timeZone,"later")].filter(f=>ut(f,e.timeZone).day===a.day)[0],l=me(cr(i,{hour:o}),new kn),h=[ct(l,e.timeZone,"earlier"),ct(l,e.timeZone,"later")].filter(f=>ut(f,e.timeZone).day===l.day).pop(),u=Cn(e)-e.offset,g=Math.floor(u/Un),p=u%Un;return u=ht(g,n,Math.floor(c/Un),Math.floor(h/Un),s?.round)*Un+p,me(ut(u,e.timeZone),e.calendar)}case"minute":case"second":case"millisecond":return Pl(e,t,n,s);case"era":case"year":case"month":case"day":{let r=Ei(Fe(e),t,n,s),o=ct(r,e.timeZone);return me(ut(o,e.timeZone),e.calendar)}default:throw new Error("Unsupported field "+t)}}function fm(e,t,n){let s=Fe(e),r=cr(Ci(s,t),t);if(r.compare(s)===0)return e;let o=ct(r,e.timeZone,n);return me(ut(o,e.timeZone),e.calendar)}const pm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})$/,gm=/^([+-]\d{6}|\d{4})-(\d{2})-(\d{2})(?:T(\d{2}))?(?::(\d{2}))?(?::(\d{2}))?(\.\d+)?(?:(?:([+-]\d{2})(?::?(\d{2}))?)|Z)$/;function mm(e){let t=e.match(pm);if(!t)throw gm.test(e)?new Error(`Invalid ISO 8601 date string: ${e}. Use parseAbsolute() instead.`):new Error("Invalid ISO 8601 date string: "+e);let n=new Ue(ro(t[1],0,9999),ro(t[2],1,12),1);return n.day=ro(t[3],1,n.calendar.getDaysInMonth(n)),n}function ro(e,t,n){let s=Number(e);if(s<t||s>n)throw new RangeError(`Value out of range: ${t} <= ${s} <= ${n}`);return s}function ym(e){return`${String(e.hour).padStart(2,"0")}:${String(e.minute).padStart(2,"0")}:${String(e.second).padStart(2,"0")}${e.millisecond?String(e.millisecond/1e3).slice(1):""}`}function Vl(e){let t=me(e,new kn),n;return t.era==="BC"?n=t.year===1?"0000":"-"+String(Math.abs(1-t.year)).padStart(6,"00"):n=String(t.year).padStart(4,"0"),`${n}-${String(t.month).padStart(2,"0")}-${String(t.day).padStart(2,"0")}`}function Nl(e){return`${Vl(e)}T${ym(e)}`}function vm(e){let t=Math.sign(e)<0?"-":"+";e=Math.abs(e);let n=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4),r=Math.floor(e%36e5%6e4/1e3),o=`${t}${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}`;return r!==0&&(o+=`:${String(r).padStart(2,"0")}`),o}function bm(e){return`${Nl(e)}${vm(e.offset)}[${e.timeZone}]`}function Si(e){let t=typeof e[0]=="object"?e.shift():new kn,n;if(typeof e[0]=="string")n=e.shift();else{let i=t.getEras();n=i[i.length-1]}let s=e.shift(),r=e.shift(),o=e.shift();return[t,n,s,r,o]}class Ue{#e;constructor(...t){let[n,s,r,o,i]=Si(t);this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,zt(this)}copy(){return this.era?new Ue(this.calendar,this.era,this.year,this.month,this.day):new Ue(this.calendar,this.year,this.month,this.day)}add(t){return Dr(this,t)}subtract(t){return Dl(this,t)}set(t){return Ci(this,t)}cycle(t,n,s){return Ei(this,t,n,s)}toDate(t){return Tl(this,t)}toString(){return Vl(this)}compare(t){return Cl(this,t)}}class lr{#e;constructor(...t){let[n,s,r,o,i]=Si(t);this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,zt(this)}copy(){return this.era?new lr(this.calendar,this.era,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond):new lr(this.calendar,this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond)}add(t){return Dr(this,t)}subtract(t){return Dl(this,t)}set(t){return Ci(cr(this,t),t)}cycle(t,n,s){switch(t){case"era":case"year":case"month":case"day":return Ei(this,t,n,s);default:return Pl(this,t,n,s)}}toDate(t,n){return Tl(this,t,n)}toString(){return Nl(this)}compare(t){let n=Cl(this,t);return n===0?zg(this,Fe(t)):n}}class fs{#e;constructor(...t){let[n,s,r,o,i]=Si(t),a=t.shift(),c=t.shift();this.calendar=n,this.era=s,this.year=r,this.month=o,this.day=i,this.timeZone=a,this.offset=c,this.hour=t.shift()||0,this.minute=t.shift()||0,this.second=t.shift()||0,this.millisecond=t.shift()||0,zt(this)}copy(){return this.era?new fs(this.calendar,this.era,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond):new fs(this.calendar,this.year,this.month,this.day,this.timeZone,this.offset,this.hour,this.minute,this.second,this.millisecond)}add(t){return Rl(this,t)}subtract(t){return um(this,t)}set(t,n){return fm(this,t,n)}cycle(t,n,s){return hm(this,t,n,s)}toDate(){return om(this)}toString(){return bm(this)}toAbsoluteString(){return this.toDate().toISOString()}compare(t){return this.toDate().getTime()-Ml(t,this.timeZone).toDate().getTime()}}let oo=new Map;class Ve{constructor(t,n={}){this.formatter=Fl(t,n),this.options=n}format(t){return this.formatter.format(t)}formatToParts(t){return this.formatter.formatToParts(t)}formatRange(t,n){if(typeof this.formatter.formatRange=="function")return this.formatter.formatRange(t,n);if(n<t)throw new RangeError("End date must be >= start date");return`${this.formatter.format(t)} – ${this.formatter.format(n)}`}formatRangeToParts(t,n){if(typeof this.formatter.formatRangeToParts=="function")return this.formatter.formatRangeToParts(t,n);if(n<t)throw new RangeError("End date must be >= start date");let s=this.formatter.formatToParts(t),r=this.formatter.formatToParts(n);return[...s.map(o=>({...o,source:"startRange"})),{type:"literal",value:" – ",source:"shared"},...r.map(o=>({...o,source:"endRange"}))]}resolvedOptions(){let t=this.formatter.resolvedOptions();return Cm()&&(this.resolvedHourCycle||(this.resolvedHourCycle=Em(t.locale,this.options)),t.hourCycle=this.resolvedHourCycle,t.hour12=this.resolvedHourCycle==="h11"||this.resolvedHourCycle==="h12"),t.calendar==="ethiopic-amete-alem"&&(t.calendar="ethioaa"),t}}const wm={true:{ja:"h11"},false:{}};function Fl(e,t={}){if(typeof t.hour12=="boolean"&&km()){t={...t};let r=wm[String(t.hour12)][e.split("-")[0]],o=t.hour12?"h12":"h23";t.hourCycle=r??o,delete t.hour12}let n=e+(t?Object.entries(t).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(oo.has(n))return oo.get(n);let s=new Intl.DateTimeFormat(e,t);return oo.set(n,s),s}let io=null;function km(){return io==null&&(io=new Intl.DateTimeFormat("en-US",{hour:"numeric",hour12:!1}).format(new Date(2020,2,3,0))==="24"),io}let ao=null;function Cm(){return ao==null&&(ao=new Intl.DateTimeFormat("fr",{hour:"numeric",hour12:!1}).resolvedOptions().hourCycle==="h12"),ao}function Em(e,t){if(!t.timeStyle&&!t.hour)return;e=e.replace(/(-u-)?-nu-[a-zA-Z0-9]+/,""),e+=(e.includes("-u-")?"":"-u")+"-nu-latn";let n=Fl(e,{...t,timeZone:void 0}),s=parseInt(n.formatToParts(new Date(2020,2,3,0)).find(o=>o.type==="hour").value,10),r=parseInt(n.formatToParts(new Date(2020,2,3,23)).find(o=>o.type==="hour").value,10);if(s===0&&r===23)return"h23";if(s===24&&r===23)return"h24";if(s===0&&r===11)return"h11";if(s===12&&r===11)return"h12";throw new Error("Unexpected hour cycle result")}function Sm(e,t,n,s,r){const o={};for(let a in t){const c=a,l=t[c];l!=null&&(o[c]=Math.floor(l/2),o[c]>0&&l%2===0&&o[c]--)}const i=en(e,t,n).subtract(o);return vs(e,i,t,n,s,r)}function en(e,t,n,s,r){let o=e;return t.years?o=hs(e):t.months?o=dt(e):t.weeks&&(o=Lt(e,n)),vs(e,o,t,n,s,r)}function xi(e,t,n,s,r){let o={...t};o.days?o.days--:o.weeks?o.weeks--:o.months?o.months--:o.years&&o.years--;let i=en(e,t,n).subtract(o);return vs(e,i,t,n,s,r)}function vs(e,t,n,s,r,o){return r&&e.compare(r)>=0&&(t=$l(t,en(qt(r),n,s))),o&&e.compare(o)<=0&&(t=xl(t,xi(qt(o),n,s))),t}function Re(e,t,n){const s=qt(e),r=t?qt(t):void 0,o=n?qt(n):void 0;let i=s;return r&&(i=$l(i,r)),o&&(i=xl(i,o)),i.compare(s)===0?e:"hour"in e?e.set({year:i.year,month:i.month,day:i.day}):i}function qa(e,t,n,s,r,o){switch(t){case"start":return en(e,n,s,r,o);case"end":return xi(e,n,s,r,o);default:return Sm(e,n,s,r,o)}}function St(e,t){return e==null||t==null?e===t:!("hour"in e)&&!("hour"in t)?Te(e,t):Fe(e).compare(Fe(t))===0}function Ga(e,t,n,s,r){return e?t?.(e,n)?!0:Ke(e,s,r):!1}function Ke(e,t,n){return t!=null&&e.compare(t)<0||n!=null&&e.compare(n)>0}function xm(e,t,n){const s=e.subtract({days:1});return Te(s,e)||Ke(s,t,n)}function $m(e,t,n){const s=e.add({days:1});return Te(s,e)||Ke(s,t,n)}function $i(e){let t={...e};for(let n in t)t[n]=1;return t}function Hl(e,t){let n={...t};return n.days?n.days--:n.days=-1,e.add(n)}function Wl(e){if(!e)return;const t=e.calendar.identifier;return t==="gregory"||t==="iso8601"?e.era==="BC"?"short":void 0:"short"}function jl(e,t,n){const s=n??Fe(Or(t));return new Ve(e,{weekday:"long",month:"long",year:"numeric",day:"numeric",era:Wl(s),calendar:s.calendar.identifier,timeZone:t})}function Ya(e,t,n){const s=n??Or(t);return new Ve(e,{month:"long",year:"numeric",era:Wl(s),calendar:s.calendar.identifier,timeZone:t})}function Lm(e,t,n,s,r){let o=n.formatRangeToParts(e.toDate(r),t.toDate(r)),i=-1;for(let l=0;l<o.length;l++){let h=o[l];if(h.source==="shared"&&h.type==="literal")i=l;else if(h.source==="endRange")break}let a="",c="";for(let l=0;l<o.length;l++)l<i?a+=o[l].value:l>i&&(c+=o[l].value);return s(a,c)}function Rs(e,t,n,s){if(!e)return"";let r=e,o=t??e,i=jl(n,s);return Te(r,o)?i.format(r.toDate(s)):Lm(r,o,i,(a,c)=>`${a} – ${c}`,s)}var Im=["sun","mon","tue","wed","thu","fri","sat"];function _l(e){return e!=null?Im[e]:void 0}function Bl(e,t,n){const s=_l(n);return Lt(e,t,s)}function Ul(e,t,n,s){const r=t.add({weeks:e}),o=[];let i=Bl(r,n,s);for(;o.length<7;){o.push(i);let a=i.add({days:1});if(Te(i,a))break;i=a}return o}function Tm(e,t,n,s){const r=_l(s),o=n??em(e,t,r);return[...new Array(o).keys()].map(a=>Ul(a,e,t,s))}function Mm(e,t){const n=new Ve(e,{weekday:"long",timeZone:t}),s=new Ve(e,{weekday:"short",timeZone:t}),r=new Ve(e,{weekday:"narrow",timeZone:t});return o=>{const i=o instanceof Date?o:o.toDate(t);return{value:o,short:s.format(i),long:n.format(i),narrow:r.format(i)}}}function Am(e,t,n,s){const r=Bl(e,s,t),o=[...new Array(7).keys()],i=Mm(s,n);return o.map(a=>i(r.add({days:a})))}function Om(e,t="long",n){if(!n||n.calendar.identifier==="gregory"||n.calendar.identifier==="iso8601"){const i=new Date(2021,0,1),a=[];for(let c=0;c<12;c++)a.push(i.toLocaleString(e,{month:t})),i.setMonth(i.getMonth()+1);return a}const s=n.calendar.getMonthsInYear(n),r=new Ve(e,{month:t,calendar:n.calendar.identifier}),o=[];for(let i=1;i<=s;i++){const a=n.set({month:i});o.push(r.format(a.toDate("UTC")))}return o}function Ka(e,t){const n=Lt(e,t,"mon"),s=n.year,r=n.set({month:1,day:4}),o=Lt(r,t,"mon"),i=n.calendar.toJulianDay(n),a=o.calendar.toJulianDay(o);if(i>=a)return 1+Math.floor((i-a)/7);const c=n.set({year:s-1,month:1,day:4}),l=Lt(c,t,"mon"),h=l.calendar.toJulianDay(l);return 1+Math.floor((i-h)/7)}function Dm(e){const t=[];for(let n=e.from;n<=e.to;n+=1)t.push(n);return t}var Pm=1900,Rm=2099;function Vm(e,t,n){const s=e.calendar,r=t?.year??me(new Ue(Pm,1,1),s).year,o=n?.year??me(new Ue(Rm,12,31),s).year;return{from:r,to:o}}var Nm=10;function Fm(e){if(e){if(e.length===3)return e.padEnd(4,"0");if(e.length===2){const t=new Date().getFullYear(),n=Math.floor(t/100)*100,s=parseInt(e.slice(-2),10),r=n+s;return r>t+Nm?(r-100).toString():r.toString()}return e}}function gn(e){const t=e-e%10,n=[];for(let s=0;s<10;s+=1){const r=t+s;n.push(r)}return n}function rs(e,t){const n=Or(e??ki());return t?me(n,t):n}function bs(e,t,n,s){return function(o){const{startDate:i,focusedDate:a}=o,c=Hl(i,e);return Ke(a,n,s)?{startDate:i,focusedDate:Re(a,n,s),endDate:c}:a.compare(i)<0?{startDate:xi(a,e,t,n,s),focusedDate:Re(a,n,s),endDate:c}:a.compare(c)>0?{startDate:en(a,e,t,n,s),endDate:c,focusedDate:Re(a,n,s)}:{startDate:i,endDate:c,focusedDate:Re(a,n,s)}}}function ql(e,t,n,s,r,o){const i=bs(n,s,r,o),a=t.add(n);return i({focusedDate:e.add(n),startDate:en(vs(e,a,n,s,r,o),n,s)})}function Gl(e,t,n,s,r,o){const i=bs(n,s,r,o);let a=t.subtract(n);return i({focusedDate:e.subtract(n),startDate:en(vs(e,a,n,s,r,o),n,s)})}function Hm(e,t,n,s,r,o,i){const a=bs(s,r,o,i);if(!n&&!s.days)return a({focusedDate:e.add($i(s)),startDate:t});if(s.days)return ql(e,t,s,r,o,i);if(s.weeks)return a({focusedDate:e.add({months:1}),startDate:t});if(s.months||s.years)return a({focusedDate:e.add({years:1}),startDate:t})}function Wm(e,t,n,s,r,o,i){const a=bs(s,r,o,i);if(!n&&!s.days)return a({focusedDate:e.subtract($i(s)),startDate:t});if(s.days)return Gl(e,t,s,r,o,i);if(s.weeks)return a({focusedDate:e.subtract({months:1}),startDate:t});if(s.months||s.years)return a({focusedDate:e.subtract({years:1}),startDate:t})}var Za=new Map;function jm(e){let t=Za.get(e);return t!=null||(t="0123456789"+new Intl.NumberFormat(e,{useGrouping:!1}).format(1234567890),Za.set(e,t)),t}var _m=(e,t)=>t?jm(t).includes(e):/\d/.test(e),Yl=(e,t,n)=>!e||e.length!==1?!0:_m(e,n)||t.includes(e),Bm=(e,t,n)=>e.split("").filter(s=>Yl(s,t,n)).join(""),za=new Map;function Um(e){let t=za.get(e);if(t!=null)return t;const s=new Intl.DateTimeFormat(e).formatToParts(new Date).find(r=>r.type==="literal");return t=s?s.value:"/",za.set(e,t),t}var Ja=e=>e!=null&&e.length===4,qm=e=>e!=null&&parseFloat(e)<=12,Gm=e=>e!=null&&parseFloat(e)<=31;function Ym(e,t,n){const s=Km(t,n);let{year:r,month:o,day:i}=Zm(s,e)??{};if(r!=null||o!=null||i!=null){const l=new Date;r||(r=l.getFullYear().toString()),o||(o=(l.getMonth()+1).toString()),i||(i=l.getDate().toString())}if(Ja(r)||(r=Fm(r)),Ja(r)&&qm(o)&&Gm(i))return new Ue(+r,+o,+i);const c=Date.parse(e);if(!isNaN(c)){const l=new Date(c);return new Ue(l.getFullYear(),l.getMonth()+1,l.getDate())}}function Km(e,t){return new Ve(e,{day:"numeric",month:"numeric",year:"numeric",timeZone:t}).formatToParts(new Date(2e3,11,25)).map(({type:r,value:o})=>r==="literal"?`${o}?`:`((?!=<${r}>)\\d+)?`).join("")}function Zm(e,t){const n=t.match(e);return e.toString().match(/<(.+?)>/g)?.map(s=>{const r=s.match(/<(.+)>/);return!r||r.length<=0?null:s.match(/<(.+)>/)?.[1]}).reduce((s,r,o)=>(r&&(n&&n.length>o?s[r]=n[o+1]:s[r]=null),s),{})}function Xa(e,t,n){const s=qt(kl(n));switch(e){case"thisWeek":return[Lt(s,t),ja(s,t)];case"thisMonth":return[dt(s),s];case"thisQuarter":return[dt(s).add({months:-((s.month-1)%3)}),s];case"thisYear":return[hs(s),s];case"last3Days":return[s.add({days:-2}),s];case"last7Days":return[s.add({days:-6}),s];case"last14Days":return[s.add({days:-13}),s];case"last30Days":return[s.add({days:-29}),s];case"last90Days":return[s.add({days:-89}),s];case"lastMonth":return[dt(s.add({months:-1})),Wo(s.add({months:-1}))];case"lastQuarter":return[dt(s.add({months:-((s.month-1)%3)-3})),Wo(s.add({months:-((s.month-1)%3)-1}))];case"lastWeek":return[Lt(s,t).add({weeks:-1}),ja(s,t).add({weeks:-1})];case"lastYear":return[hs(s.add({years:-1})),Xg(s.add({years:-1}))];default:throw new Error(`Invalid date range preset: ${e}`)}}var zm=(e,t)=>e.ids?.label?.(t)??`datepicker:${e.id}:label:${t}`,Jm=e=>e.ids?.root??`datepicker:${e.id}`,Xm=(e,t)=>e.ids?.table?.(t)??`datepicker:${e.id}:table:${t}`,Uo=e=>e.ids?.content??`datepicker:${e.id}:content`,co=(e,t)=>e.ids?.cellTrigger?.(t)??`datepicker:${e.id}:cell-trigger:${t}`,Qm=(e,t)=>e.ids?.prevTrigger?.(t)??`datepicker:${e.id}:prev:${t}`,ey=(e,t)=>e.ids?.nextTrigger?.(t)??`datepicker:${e.id}:next:${t}`,ty=(e,t)=>e.ids?.viewTrigger?.(t)??`datepicker:${e.id}:view:${t}`,Kl=e=>e.ids?.clearTrigger??`datepicker:${e.id}:clear`,Zl=e=>e.ids?.control??`datepicker:${e.id}:control`,Qa=(e,t)=>e.ids?.input?.(t)??`datepicker:${e.id}:input:${t}`,zl=e=>e.ids?.trigger??`datepicker:${e.id}:trigger`,Jl=e=>e.ids?.positioner??`datepicker:${e.id}:positioner`,Xl=e=>e.ids?.monthSelect??`datepicker:${e.id}:month-select`,Ql=e=>e.ids?.yearSelect??`datepicker:${e.id}:year-select`,ec=(e,t)=>cf(dn(e),`[data-part=table-cell-trigger][data-view=${t}][data-focus]:not([data-outside-range])`),Ys=e=>e.getById(zl(e)),dn=e=>e.getById(Uo(e)),Xn=e=>af(ed(e),"[data-part=input]"),ny=e=>e.getById(Ql(e)),sy=e=>e.getById(Xl(e)),ry=e=>e.getById(Kl(e)),tc=e=>e.getById(Jl(e)),ed=e=>e.getById(Zl(e)),nc=e=>{const t=Xn(e);if(t.length===0){Ys(e)?.focus({preventScroll:!0});return}const n=t.findLastIndex(o=>o.value!==""),s=Math.max(n,0),r=t[s];r?.focus({preventScroll:!0}),r?.setSelectionRange(r.value.length,r.value.length)};function Ks(e){const[t,n]=e;let s;return!t||!n?s=e:s=t.compare(n)<=0?e:[n,t],s}function an(e,t){const[n,s]=t;return!n||!s?!1:n.compare(e)<=0&&s.compare(e)>=0}function Vs(e){return e.slice().filter(t=>t!=null).sort((t,n)=>t.compare(n))}function oy(e,t){return new Ve(e).formatToParts(new Date).map(n=>t[n.type]??n.value).join("")}var sc=e=>!Number.isNaN(e.day)&&!Number.isNaN(e.month)&&!Number.isNaN(e.year),iy={dayCell(e){return e.unavailable?`Not available. ${e.valueText}`:e.firstInRange?`Starting range from ${e.valueText}`:e.lastInRange?`Range ending at ${e.valueText}`:e.inRange?`In range. ${e.valueText}`:e.selected?`Selected date. ${e.valueText}`:`Choose ${e.valueText}`},trigger(e){return e?"Close calendar":"Open calendar"},viewTrigger(e,t){return t?`Switch to ${t} view`:`${e} view`},presetTrigger(e){const[t="",n=""]=e;return`select ${t} to ${n}`},prevTrigger(e){return bo(e,{year:"Switch to previous decade",month:"Switch to previous year",day:"Switch to previous month"})},nextTrigger(e){return bo(e,{year:"Switch to next decade",month:"Switch to next year",day:"Switch to next month"})},placeholder(){return{day:"dd",month:"mm",year:"yyyy"}},content:"calendar",monthSelect:"Select month",yearSelect:"Select year",clearTrigger:"Clear selected dates",weekColumnHeader:"Wk",weekNumberCell(e){return`Week ${e}`}};function gt(e,t){return e?e==="day"?0:e==="month"?1:2:t||0}function Li(e){return e===0?"day":e===1?"month":"year"}function Ii(e,t,n){return Li(Ju(gt(e,0),gt(t,0),gt(n,2)))}function ay(e,t){return gt(e,0)>gt(t,0)}function cy(e,t){return gt(e,0)<gt(t,0)}function td(e,t,n){const s=gt(e,0)+1;return Ii(Li(s),t,n)}function ly(e,t,n){const s=gt(e,0)-1;return Ii(Li(s),t,n)}var dy=["day","month","year"];function uy(e){dy.forEach(t=>e(t))}var hy=i1(e=>[e.view,e.startValue.toString(),e.endValue.toString(),e.locale,e.timeZone,e.selectionMode],([e],t)=>{const{startValue:n,endValue:s,locale:r,timeZone:o,selectionMode:i}=t;if(e==="year"){const u=gn(n.year),g=u.at(0).toString(),p=u.at(-1).toString();return{start:g,end:p,formatted:`${g} - ${p}`}}if(e==="month"){const u=new Ve(r,{year:"numeric",timeZone:o,calendar:n.calendar.identifier}),g=u.format(n.toDate(o)),p=u.format(s.toDate(o)),f=i==="range"?`${g} - ${p}`:g;return{start:g,end:p,formatted:f}}const a=new Ve(r,{month:"long",year:"numeric",timeZone:o,calendar:n.calendar.identifier}),c=a.format(n.toDate(o)),l=a.format(s.toDate(o)),h=i==="range"?`${c} - ${l}`:c;return{start:c,end:l,formatted:h}});function fy(e,t){const{state:n,context:s,prop:r,send:o,computed:i,scope:a}=e,c=s.get("startValue"),l=i("endValue"),h=s.get("value"),u=s.get("focusedValue"),g=s.get("hoveredValue"),p=g?Ks([h[0],g]):[],f=!!r("disabled"),d=!!r("readOnly"),m=!!r("invalid"),v=i("isInteractive"),k=h.length===0,L=r("min"),O=r("max"),w=r("locale"),S=r("timeZone"),b=r("startOfWeek"),E=n.matches("focused"),C=n.matches("open"),x=r("selectionMode")==="range",y=r("selectionMode")==="multiple",M=r("isDateUnavailable"),D=r("maxSelectedDates"),H=y&&D!=null&&h.length>=D,P=s.get("currentPlacement"),F=P?Yc(P):void 0,B=Kc({...r("positioning"),placement:P}),j=Um(w),q=vc(iy,r("translations"));function Ce(A=c){const $=r("fixedWeeks")?6:void 0;return Tm(A,w,$,b)}function Ie(A={}){const{format:$}=A;return Om(w,$,u).map((T,R)=>{const z=R+1,de=u.set({month:z}),ue=Ke(de,L,O);return{label:T,value:z,disabled:ue}})}function Nt(){const A=Vm(u,L,O);return Dm(A).map(T=>({label:T.toString(),value:T,disabled:!jr(T,L?.year,O?.year)}))}function je(A){return Ga(A,M,w,L,O)}function Ae(A){const $=c??rs(S,u.calendar);o({type:"FOCUS.SET",value:$.set({month:A})})}function Dn(A){const $=c??rs(S,u.calendar);o({type:"FOCUS.SET",value:$.set({year:A})})}function _e(A){const{value:$,disabled:T}=A,R=u.set({year:$}),de=!gn(c.year).includes($),ue=jr($,L?.year,O?.year),N=x&&an(R,h),_=x&&h[0]&&Bn(R,h[0]),K=x&&h[1]&&Bn(R,h[1]),te=x&&p.length>0,ae=te&&an(R,p),ne=te&&p[0]&&Bn(R,p[0]),oe=te&&p[1]&&Bn(R,p[1]),Be={focused:u.year===A.value,selectable:ue,outsideRange:de,selected:!!h.find(Ge=>Ge&&Ge.year===$),valueText:$.toString(),inRange:N||ae,firstInRange:!!_,lastInRange:!!K,inHoveredRange:!!ae,firstInHoveredRange:!!ne,lastInHoveredRange:!!oe,value:R,get disabled(){return T||!Be.selectable}};return Be}function Ft(A){const{value:$,disabled:T}=A,R=u.set({month:$}),z=Ya(w,S,u),de=x&&an(R,h),ue=x&&h[0]&&_n(R,h[0]),N=x&&h[1]&&_n(R,h[1]),_=x&&p.length>0,K=_&&an(R,p),te=_&&p[0]&&_n(R,p[0]),ae=_&&p[1]&&_n(R,p[1]),ne={focused:u.month===A.value,selectable:!Ke(R,L,O),selected:!!h.find(oe=>oe&&oe.month===$&&oe.year===u.year),valueText:z.format(R.toDate(S)),inRange:de||K,firstInRange:!!ue,lastInRange:!!N,inHoveredRange:!!K,firstInHoveredRange:!!te,lastInHoveredRange:!!ae,outsideRange:!1,value:R,get disabled(){return T||!ne.selectable}};return ne}function tt(A){const{value:$,disabled:T,visibleRange:R=i("visibleRange")}=A,z=jl(w,S,u),de=$i(i("visibleDuration")),ue=r("outsideDaySelectable"),N=R.start.add(de).subtract({days:1}),_=Ke($,R.start,N),K=x&&an($,h),te=x&&h[0]&&Te($,h[0]),ae=x&&h[1]&&Te($,h[1]),ne=x&&p.length>0,oe=ne&&an($,p),Be=ne&&p[0]&&Te($,p[0]),Ge=ne&&p[1]&&Te($,p[1]),ve=h.some(nn=>nn!=null&&Te($,nn)),Ye={invalid:Ke($,L,O),disabled:T||!ue&&_||Ke($,L,O)||H&&!ve,selected:ve,unavailable:Ga($,M,w,L,O)&&!T,outsideRange:_,today:Kg($,S),weekend:nm($,w),value:$,valueText:z.format($.toDate(S)),get focused(){return u!=null&&Te($,u)&&(!Ye.outsideRange||ue)},get selectable(){return!Ye.disabled&&!Ye.unavailable},inRange:K||oe,firstInRange:te,lastInRange:ae,inHoveredRange:oe,firstInHoveredRange:Be,lastInHoveredRange:Ge};return Ye}function tn(A){const{view:$="day",id:T}=A;return[$,T].filter(Boolean).join(" ")}return{focused:E,open:C,disabled:f,invalid:m,readOnly:d,inline:!!r("inline"),numOfMonths:r("numOfMonths"),showWeekNumbers:!!r("showWeekNumbers"),selectionMode:r("selectionMode"),maxSelectedDates:D,isMaxSelected:H,view:s.get("view"),getRangePresetValue(A){return Xa(A,w,S)},getWeekNumber(A){const $=A[0];return $?Ka($,w):0},getDaysInWeek(A,$=c){return Ul(A,$,w,b)},getOffset(A){const $=c.add(A),T=l.add(A),R=Ya(w,S,u);return{visibleRange:{start:$,end:T},weeks:Ce($),visibleRangeText:{start:R.format($.toDate(S)),end:R.format(T.toDate(S))}}},getMonthWeeks:Ce,isUnavailable:je,weeks:Ce(),weekDays:Am(c,b,S,w),visibleRangeText:i("visibleRangeText"),value:h,valueAsDate:h.filter(A=>A!=null).map(A=>A.toDate(S)),valueAsString:i("valueAsString"),focusedValue:u,focusedValueAsDate:u?.toDate(S),focusedValueAsString:r("format")(u,{locale:w,timeZone:S}),visibleRange:i("visibleRange"),selectToday(){const A=Re(rs(S,u.calendar),L,O);o({type:"VALUE.SET",value:[A]})},setValue(A){const $=A.map(T=>Re(T,L,O));o({type:"VALUE.SET",value:$})},setTime(A,$=0){const T=Array.from(h);let R=T[$];R&&("hour"in R||(R=Fe(R)),R=R.set({hour:A.hour??("hour"in R?R.hour:0),minute:A.minute??("minute"in R?R.minute:0),second:A.second??("second"in R?R.second:0),millisecond:A.millisecond??("millisecond"in R?R.millisecond:0)}),T[$]=Re(R,L,O),o({type:"VALUE.SET",value:T}))},clearValue(A={}){const{focus:$=!0}=A;o({type:"VALUE.CLEAR",focus:$})},setFocusedValue(A){o({type:"FOCUS.SET",value:A})},setOpen(A){r("inline")||o({type:A?"OPEN":"CLOSE",replaces:"open"})},focusMonth:Ae,focusYear:Dn,getYears:Nt,getMonths:Ie,getYearsGrid(A={}){const{columns:$=1}=A,T=gn(c.year).map(R=>({label:R.toString(),value:R,disabled:!jr(R,L?.year,O?.year)}));return Yi(T,$)},getDecade(){const A=gn(c.year);return{start:A.at(0),end:A.at(-1)}},getMonthsGrid(A={}){const{columns:$=1,format:T}=A;return Yi(Ie({format:T}),$)},format(A,$={month:"long",year:"numeric"}){return new Ve(w,{...$,calendar:A.calendar.identifier}).format(A.toDate(S))},setView(A){o({type:"VIEW.SET",view:A})},goToNext(){o({type:"GOTO.NEXT",view:s.get("view")})},goToPrev(){o({type:"GOTO.PREV",view:s.get("view")})},getRootProps(){return t.element({...ee.root.attrs,dir:r("dir"),id:Jm(a),"data-state":C?"open":"closed","data-disabled":V(f),"data-readonly":V(d),"data-empty":V(k)})},getLabelProps(A={}){const{index:$=0}=A;return t.label({...ee.label.attrs,id:zm(a,$),dir:r("dir"),htmlFor:Qa(a,$),"data-state":C?"open":"closed","data-index":$,"data-disabled":V(f),"data-readonly":V(d),"data-invalid":V(m)})},getControlProps(){return t.element({...ee.control.attrs,dir:r("dir"),id:Zl(a),"data-disabled":V(f),"data-placeholder-shown":V(k),"data-invalid":V(m)})},getRangeTextProps(){return t.element({...ee.rangeText.attrs,dir:r("dir")})},getContentProps(){return t.element({...ee.content.attrs,hidden:!C,dir:r("dir"),"data-state":C?"open":"closed","data-placement":P,"data-side":F,"data-inline":V(r("inline")),id:Uo(a),tabIndex:-1,role:"application","aria-label":q.content})},getTableProps(A={}){const{view:$="day",columns:T=$==="day"?7:4}=A,R=tn(A);return t.element({...ee.table.attrs,role:"grid","data-columns":T,"aria-label":i("visibleRangeText").formatted,id:Xm(a,R),"aria-readonly":be(d),"aria-disabled":be(f),"aria-multiselectable":be(r("selectionMode")!=="single"),"data-view":$,dir:r("dir"),tabIndex:-1,onKeyDown(z){if(z.defaultPrevented||f)return;const de={Enter(){v&&($==="day"&&je(u)||$==="month"&&!Ft({value:u.month}).selectable||$==="year"&&!_e({value:u.year}).selectable||o({type:"TABLE.ENTER",view:$,columns:T,focus:!0}))},Space(N){de.Enter?.()},ArrowLeft(){o({type:"TABLE.ARROW_LEFT",view:$,columns:T,focus:!0})},ArrowRight(){o({type:"TABLE.ARROW_RIGHT",view:$,columns:T,focus:!0})},ArrowUp(){o({type:"TABLE.ARROW_UP",view:$,columns:T,focus:!0})},ArrowDown(){o({type:"TABLE.ARROW_DOWN",view:$,columns:T,focus:!0})},PageUp(N){o({type:"TABLE.PAGE_UP",larger:N.shiftKey,view:$,columns:T,focus:!0})},PageDown(N){o({type:"TABLE.PAGE_DOWN",larger:N.shiftKey,view:$,columns:T,focus:!0})},Home(){o({type:"TABLE.HOME",view:$,columns:T,focus:!0})},End(){o({type:"TABLE.END",view:$,columns:T,focus:!0})}},ue=de[ko(z,{dir:r("dir")})];ue&&(ue(z),z.preventDefault(),z.stopPropagation())},onPointerLeave(){o({type:"TABLE.POINTER_LEAVE"})},onPointerDown(){o({type:"TABLE.POINTER_DOWN",view:$})},onPointerUp(){o({type:"TABLE.POINTER_UP",view:$})}})},getTableHeadProps(A={}){const{view:$="day"}=A;return t.element({...ee.tableHead.attrs,"aria-hidden":!0,dir:r("dir"),"data-view":$,"data-disabled":V(f)})},getTableHeaderProps(A={}){const{view:$="day"}=A;return t.element({...ee.tableHeader.attrs,dir:r("dir"),"data-view":$,"data-disabled":V(f)})},getTableBodyProps(A={}){const{view:$="day"}=A;return t.element({...ee.tableBody.attrs,"data-view":$,"data-disabled":V(f)})},getTableRowProps(A={}){const{view:$="day"}=A;return t.element({...ee.tableRow.attrs,"aria-disabled":be(f),"data-disabled":V(f),"data-view":$})},getWeekNumberHeaderCellProps(A={}){const{view:$="day"}=A;return t.element({...ee.tableCell.attrs,scope:"col","aria-label":q.weekColumnHeader,"data-view":$,"data-type":"week-number","data-disabled":V(f)})},getWeekNumberCellProps(A){const{weekIndex:$,week:T}=A,R=T[0]?Ka(T[0],w):0;return t.element({...ee.tableCell.attrs,role:"rowheader","aria-label":q.weekNumberCell?.(R),"data-view":"day","data-week-index":$,"data-type":"week-number","data-disabled":V(f)})},getDayTableCellState:tt,getDayTableCellProps(A){const{value:$}=A,T=tt(A);return t.element({...ee.tableCell.attrs,role:"gridcell","aria-disabled":be(!T.selectable),"aria-selected":T.selected||T.inRange,"aria-invalid":be(T.invalid),"aria-current":T.today?"date":void 0,"data-value":$.toString()})},getDayTableCellTriggerProps(A){const{value:$}=A,T=tt(A);return t.element({...ee.tableCellTrigger.attrs,id:co(a,$.toString()),role:"button",dir:r("dir"),tabIndex:f?-1:T.focused?0:-1,"aria-label":q.dayCell(T),"aria-disabled":be(!T.selectable),"aria-invalid":be(T.invalid),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$.toString(),"data-view":"day","data-today":V(T.today),"data-focus":V(T.focused),"data-unavailable":V(T.unavailable),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-outside-range":V(T.outsideRange),"data-weekend":V(T.weekend),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"day",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&Yg($,g)||o({type:"CELL.POINTER_MOVE",cell:"day",value:$,focus:z,outsideRange:T.outsideRange})}:void 0})},getMonthTableCellState:Ft,getMonthTableCellProps(A){const{value:$,columns:T}=A,R=Ft(A);return t.element({...ee.tableCell.attrs,dir:r("dir"),colSpan:T,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":$})},getMonthTableCellTriggerProps(A){const{value:$}=A,T=Ft(A);return t.element({...ee.tableCellTrigger.attrs,id:co(a,$.toString()),role:"button",dir:r("dir"),tabIndex:f?-1:T.focused?0:-1,"aria-label":T.valueText,"aria-disabled":be(!T.selectable),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$,"data-view":"month","data-focus":V(T.focused),"data-outside-range":V(T.outsideRange),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"month",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable)return;const z=!a.isActiveElement(R.currentTarget);g&&T.value&&_n(T.value,g)||o({type:"CELL.POINTER_MOVE",cell:"month",value:T.value,focus:z})}:void 0})},getYearTableCellState:_e,getYearTableCellProps(A){const{value:$,columns:T}=A,R=_e(A);return t.element({...ee.tableCell.attrs,dir:r("dir"),colSpan:T,role:"gridcell","aria-selected":be(R.selected||R.inRange),"data-selected":V(R.selected),"aria-disabled":be(!R.selectable),"data-value":$})},getYearTableCellTriggerProps(A){const{value:$}=A,T=_e(A);return t.element({...ee.tableCellTrigger.attrs,id:co(a,$.toString()),role:"button",dir:r("dir"),tabIndex:f?-1:T.focused?0:-1,"aria-label":T.valueText,"aria-disabled":be(!T.selectable),"data-disabled":V(!T.selectable),"data-selectable":V(T.selectable),"data-selected":V(T.selected),"data-value":$,"data-view":"year","data-focus":V(T.focused),"data-outside-range":V(T.outsideRange),"data-range-start":V(T.firstInRange),"data-range-end":V(T.lastInRange),"data-in-range":V(T.inRange),"data-in-hover-range":V(T.inHoveredRange),"data-hover-range-start":V(T.firstInHoveredRange),"data-hover-range-end":V(T.lastInHoveredRange),onClick(R){R.defaultPrevented||v&&T.selectable&&o({type:"CELL.CLICK",cell:"year",value:$})},onPointerMove:x?R=>{if(R.pointerType==="touch"||!T.selectable||T.outsideRange)return;const z=!a.isActiveElement(R.currentTarget);g&&T.value&&Bn(T.value,g)||o({type:"CELL.POINTER_MOVE",cell:"year",value:T.value,focus:z})}:void 0})},getNextTriggerProps(A={}){const{view:$="day"}=A,T=f||!i("isNextVisibleRangeValid");return t.button({...ee.nextTrigger.attrs,dir:r("dir"),id:ey(a,$),type:"button","aria-label":q.nextTrigger($),disabled:T,"data-disabled":V(T),onClick(R){R.defaultPrevented||o({type:"GOTO.NEXT",view:$})}})},getPrevTriggerProps(A={}){const{view:$="day"}=A,T=f||!i("isPrevVisibleRangeValid");return t.button({...ee.prevTrigger.attrs,dir:r("dir"),id:Qm(a,$),type:"button","aria-label":q.prevTrigger($),disabled:T,"data-disabled":V(T),onClick(R){R.defaultPrevented||o({type:"GOTO.PREV",view:$})}})},getClearTriggerProps(){return t.button({...ee.clearTrigger.attrs,id:Kl(a),dir:r("dir"),type:"button","aria-label":q.clearTrigger,hidden:!h.length,onClick(A){A.defaultPrevented||v&&o({type:"VALUE.CLEAR"})}})},getTriggerProps(){return t.button({...ee.trigger.attrs,id:zl(a),dir:r("dir"),type:"button","data-placement":P,"data-side":F,"aria-label":q.trigger(C),"aria-controls":Uo(a),"aria-expanded":C,"data-state":C?"open":"closed","data-placeholder-shown":V(k),"aria-haspopup":"grid",disabled:f,onClick(A){A.defaultPrevented||v&&o({type:"TRIGGER.CLICK"})}})},getViewProps(A={}){const{view:$="day"}=A;return t.element({...ee.view.attrs,"data-view":$,hidden:s.get("view")!==$})},getViewTriggerProps(A={}){const{view:$="day"}=A,T=td($,r("minView"),r("maxView")),R=T!==$,z=f||!R;return t.button({...ee.viewTrigger.attrs,"data-view":$,dir:r("dir"),id:ty(a,$),type:"button",disabled:z,"data-disabled":V(z),"aria-label":q.viewTrigger($,R?T:void 0),onClick(de){de.defaultPrevented||v&&o({type:"VIEW.TOGGLE",src:"viewTrigger"})}})},getViewControlProps(A={}){const{view:$="day"}=A;return t.element({...ee.viewControl.attrs,"data-view":$,dir:r("dir")})},getInputProps(A={}){const{index:$=0,fixOnBlur:T=!0}=A;return t.input({...ee.input.attrs,id:Qa(a,$),autoComplete:"off",autoCorrect:"off",spellCheck:"false",dir:r("dir"),name:r("name"),"data-index":$,"data-state":C?"open":"closed","data-placeholder-shown":V(k),readOnly:d,disabled:f,required:r("required"),"aria-invalid":be(m),"data-invalid":V(m),placeholder:r("placeholder")||oy(w,q.placeholder(w)),defaultValue:i("valueAsString")[$],onBeforeInput(R){const{data:z}=ri(R);Yl(z,j,w)||R.preventDefault()},onClick(R){R.defaultPrevented||r("openOnClick")&&v&&o({type:"OPEN",src:"input.click"})},onFocus(){o({type:"INPUT.FOCUS",index:$})},onBlur(R){const z=R.currentTarget.value.trim();o({type:"INPUT.BLUR",value:z,index:$,fixOnBlur:T})},onKeyDown(R){if(R.defaultPrevented||!v)return;const de={Enter(ue){Th(ue)||je(u)||ue.currentTarget.value.trim()!==""&&o({type:"INPUT.ENTER",value:ue.currentTarget.value,index:$})}}[R.key];de&&(de(R),R.preventDefault())},onInput(R){const z=R.currentTarget.value;o({type:"INPUT.CHANGE",value:Bm(z,j,w),index:$})}})},getMonthSelectProps(){return t.select({...ee.monthSelect.attrs,id:Xl(a),"aria-label":q.monthSelect,disabled:f,dir:r("dir"),defaultValue:c.month,onChange(A){Ae(Number(A.currentTarget.value))}})},getYearSelectProps(){return t.select({...ee.yearSelect.attrs,id:Ql(a),disabled:f,"aria-label":q.yearSelect,dir:r("dir"),defaultValue:c.year,onChange(A){Dn(Number(A.currentTarget.value))}})},getPositionerProps(){return t.element({id:Jl(a),...ee.positioner.attrs,dir:r("dir"),style:B.floating})},getPresetTriggerProps(A){const $=Array.isArray(A.value)?A.value:Xa(A.value,w,S),T=$.filter(R=>R!=null).map(R=>R.toDate(S).toDateString());return t.button({...ee.presetTrigger.attrs,"aria-label":q.presetTrigger(T),type:"button",onClick(R){R.defaultPrevented||v&&o({type:"PRESET.CLICK",value:$})}})}}}var lo="__live-region-debug__",py="position:fixed;inset-inline:0;bottom:0;z-index:2147483647;padding:12px 16px;background:black;color:white;font-size:14px;line-height:20px;text-align:center;pointer-events:none;",gy=100,my=200,yy={border:"0",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0",position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"};function vy(e={}){const{level:t="polite",document:n=document,root:s,delay:r=0,debug:o=!1}=e,i=n.defaultView??window,a=()=>(typeof s=="function"?s():s)??n.body;let c;function l(){if(!o)return;let m=n.getElementById(lo);return m||(m=n.createElement("div"),m.id=lo,m.dataset.liveAnnouncerDebug="true",m.setAttribute("aria-hidden","true"),m.style.cssText=py,a().appendChild(m),m)}function h(){const m=n.createElement("span");return m.dataset.liveAnnouncer="true",m.setAttribute("aria-live",t),m.setAttribute("aria-atomic","true"),m.setAttribute("role",t==="assertive"?"alert":"status"),Object.assign(m.style,yy),a().appendChild(m),u=Date.now()+my,m}let u=0,g=h();function p(){i.clearTimeout(c),c=void 0}function f(m,v=r){p(),g?.isConnected||(g=h());const k=g;k.textContent="",c=i.setTimeout(()=>{c=void 0,k.textContent=m;const L=l();L&&(L.textContent=m)},Math.max(v,gy,u-Date.now()))}function d(){p(),g?.remove(),g=null,o&&n.getElementById(lo)?.remove()}return{announce:f,cancel:p,destroy:d,toJSON(){return"live-region"}}}var{and:Se}=el();function by(e,t){if(e?.length!==t?.length)return!1;const n=Math.max(e.length,t.length);for(let s=0;s<n;s++)if(!St(e[s],t[s]))return!1;return!0}function Ns(e,t){return e.map(n=>n==null?"":t("format")(n,{locale:t("locale"),timeZone:t("timeZone")}))}var wy=tl({props({props:e}){const t=e.locale||"en-US",n=e.timeZone||"UTC",s=e.selectionMode||"single",r=e.numOfMonths||1;let o;if(e.createCalendar){const f=new Intl.DateTimeFormat(t).resolvedOptions().calendar;f!=="gregory"&&f!=="iso8601"&&(o=e.createCalendar(f))}const i=p=>!o||p.calendar.identifier===o.identifier?p:me(p,o),a=e.defaultValue?Vs(e.defaultValue).map(p=>Re(i(p),e.min,e.max)):void 0,c=e.value?Vs(e.value).map(p=>Re(i(p),e.min,e.max)):void 0;let l=e.focusedValue||e.defaultFocusedValue||c?.[0]||a?.[0]||rs(n,o);l=Re(i(l),e.min,e.max);const h=e.minView||"day",u=e.maxView||"year",g=Ii(e.defaultView||e.view||h,h,u);return{locale:t,numOfMonths:r,timeZone:n,selectionMode:s,minView:h,maxView:u,outsideDaySelectable:!1,closeOnSelect:!0,format(p,{locale:f,timeZone:d}){return new Ve(f,{timeZone:d,day:"2-digit",month:"2-digit",year:"numeric",calendar:o?.identifier}).format(p.toDate(d))},parse(p,{locale:f,timeZone:d}){return Ym(p,f,d)},...e,focusedValue:typeof e.focusedValue>"u"?void 0:l,defaultFocusedValue:l,value:c,defaultValue:a??[],defaultView:g,positioning:{placement:"bottom",...e.positioning}}},initialState({prop:e}){return e("inline")||(e("open")??e("defaultOpen"))?"open":"idle"},refs(){return{announcer:void 0}},context({prop:e,bindable:t,getContext:n}){return{focusedValue:t(()=>({defaultValue:e("defaultFocusedValue"),value:e("focusedValue"),isEqual:St,hash:s=>s.toString(),sync:!0,onChange(s){const r=n(),o=r.get("view"),i=r.get("value"),a=Ns(i,e);e("onFocusChange")?.({value:i,valueAsString:a,view:o,focusedValue:s})}})),value:t(()=>({defaultValue:e("defaultValue"),value:e("value"),isEqual:by,hash:s=>s.map(r=>r?.toString()??"").join(","),onChange(s){const r=n(),o=Ns(s,e);e("onValueChange")?.({value:s,valueAsString:o,view:r.get("view")})}})),inputValue:t(()=>({defaultValue:""})),activeIndex:t(()=>({defaultValue:0,sync:!0})),hoveredValue:t(()=>({defaultValue:null,isEqual:St})),view:t(()=>({defaultValue:e("defaultView"),value:e("view"),onChange(s){e("onViewChange")?.({view:s})}})),startValue:t(()=>{const s=e("focusedValue")||e("defaultFocusedValue");return{defaultValue:qa(s,"start",{months:e("numOfMonths")},e("locale")),isEqual:St,hash:r=>r.toString()}}),currentPlacement:t(()=>({defaultValue:void 0})),restoreFocus:t(()=>({defaultValue:!1}))}},computed:{isInteractive:({prop:e})=>!e("disabled")&&!e("readOnly"),visibleDuration:({prop:e})=>({months:e("numOfMonths")}),endValue:({context:e,computed:t})=>Hl(e.get("startValue"),t("visibleDuration")),visibleRange:({context:e,computed:t})=>({start:e.get("startValue"),end:t("endValue")}),visibleRangeText:({context:e,prop:t,computed:n})=>hy({view:e.get("view"),startValue:e.get("startValue"),endValue:n("endValue"),locale:t("locale"),timeZone:t("timeZone"),selectionMode:t("selectionMode")}),isPrevVisibleRangeValid:({context:e,prop:t})=>!xm(e.get("startValue"),t("min"),t("max")),isNextVisibleRangeValid:({prop:e,computed:t})=>!$m(t("endValue"),e("min"),e("max")),valueAsString:({context:e,prop:t})=>Ns(e.get("value"),t)},effects:["setupLiveRegion"],watch({track:e,prop:t,context:n,action:s,computed:r}){e([()=>t("locale")],()=>{s(["setStartValue","syncInputElement"])}),e([()=>n.hash("focusedValue")],()=>{s(["setStartValue","focusActiveCellIfNeeded","setHoveredValueIfKeyboard"])}),e([()=>n.hash("startValue")],()=>{s(["syncMonthSelectElement","syncYearSelectElement","invokeOnVisibleRangeChange"])}),e([()=>n.get("inputValue")],()=>{s(["syncInputValue"])}),e([()=>n.hash("value")],()=>{s(["syncInputElement"])}),e([()=>r("valueAsString").toString()],()=>{s(["announceValueText"])}),e([()=>n.get("view")],()=>{s(["focusActiveCell"])}),e([()=>t("open")],()=>{s(["toggleVisibility"])})},on:{"VALUE.SET":{actions:["setDateValue","setFocusedDate"]},"VIEW.SET":{actions:["setView"]},"FOCUS.SET":{actions:["setFocusedDate"]},"VALUE.CLEAR":{actions:["clearDateValue","clearFocusedDate","setActiveIndexToStart","clearHoveredDate","focusFirstInputElement"]},"INPUT.CHANGE":[{guard:"isInputValueEmpty",actions:["setInputValue","clearDateValue","clearFocusedDate"]},{actions:["setInputValue","focusParsedDate"]}],"INPUT.ENTER":{actions:["focusParsedDate","selectFocusedDate"]},"INPUT.FOCUS":{actions:["setActiveIndex"]},"INPUT.BLUR":[{guard:"shouldFixOnBlur",actions:["setActiveIndexToStart","selectParsedDate"]},{actions:["setActiveIndexToStart"]}],"PRESET.CLICK":[{guard:"isOpenControlled",actions:["setDateValue","setFocusedDate","invokeOnClose"]},{target:"focused",actions:["setDateValue","setFocusedDate","focusInputElement"]}],"GOTO.NEXT":[{guard:"isYearView",actions:["focusNextDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusNextYear","announceVisibleRange"]},{actions:["focusNextPage"]}],"GOTO.PREV":[{guard:"isYearView",actions:["focusPreviousDecade","announceVisibleRange"]},{guard:"isMonthView",actions:["focusPreviousYear","announceVisibleRange"]},{actions:["focusPreviousPage"]}]},states:{idle:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},focused:{tags:["closed"],on:{"CONTROLLED.OPEN":{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell"]},"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}],OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["resetView","focusFirstSelectedDate","focusActiveCell","invokeOnOpen"]}]}},open:{tags:["open"],entry:["resumeRangeSelection"],effects:["trackDismissableElement","trackPositioning"],exit:["clearHoveredDate"],on:{"CONTROLLED.CLOSE":[{guard:Se("shouldRestoreFocus","isInteractOutsideEvent"),target:"focused",actions:["restoreFocusToTrigger"]},{guard:"shouldRestoreFocus",target:"focused",actions:["restoreFocusToInput"]},{target:"idle"}],"CELL.CLICK":[{guard:"isAboveMinView",actions:["setFocusedValueForView","setPreviousView"]},{guard:Se("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd"]},{guard:Se("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","setRestoreFocus"]},{guard:Se("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","restoreFocusToInput"]},{guard:Se("isRangePicker","isSelectingEndDate"),actions:["setFocusedDate","setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setFocusedDate","setSelectedDate","setActiveIndexToEnd"]},{guard:Se("isMultiPicker","canSelectDate"),actions:["setFocusedDate","toggleSelectedDate"]},{guard:"isMultiPicker",actions:["setFocusedDate"]},{guard:Se("closeOnSelect","isOpenControlled"),actions:["setFocusedDate","setSelectedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["setFocusedDate","setSelectedDate","invokeOnClose","restoreFocusToInput"]},{actions:["setFocusedDate","setSelectedDate"]}],"CELL.POINTER_MOVE":[{guard:Se("isRangePicker","isSelectingEndDate","isDayPointerMoveOutsideVisibleMonth"),actions:["setHoveredDate"]},{guard:Se("isRangePicker","isSelectingEndDate"),actions:["setHoveredDate","setFocusedDate"]}],"TABLE.POINTER_LEAVE":{guard:"isRangePicker",actions:["clearHoveredDate"]},"TABLE.POINTER_DOWN":{actions:["disableTextSelection"]},"TABLE.POINTER_UP":{actions:["enableTextSelection"]},"TABLE.ESCAPE":[{guard:"isOpenControlled",actions:["focusFirstSelectedDate","invokeOnClose"]},{target:"focused",actions:["focusFirstSelectedDate","invokeOnClose","restoreFocusToTrigger"]}],"TABLE.ENTER":[{guard:"isAboveMinView",actions:["setPreviousView"]},{guard:Se("isRangePicker","hasSelectedRange"),actions:["setActiveIndexToStart","resetSelection","setActiveIndexToEnd","focusNextDay"]},{guard:Se("isRangePicker","isSelectingEndDate","closeOnSelect","isOpenControlled"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose"]},{guard:Se("isRangePicker","isSelectingEndDate","closeOnSelect"),target:"focused",actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate","invokeOnClose","restoreFocusToInput"]},{guard:Se("isRangePicker","isSelectingEndDate"),actions:["setSelectedDate","setActiveIndexToStart","clearHoveredDate"]},{guard:"isRangePicker",actions:["setSelectedDate","setActiveIndexToEnd","focusNextDay"]},{guard:Se("isMultiPicker","canSelectDate"),actions:["toggleSelectedDate"]},{guard:"isMultiPicker"},{guard:Se("closeOnSelect","isOpenControlled"),actions:["selectFocusedDate","invokeOnClose"]},{guard:"closeOnSelect",target:"focused",actions:["selectFocusedDate","invokeOnClose","restoreFocusToInput"]},{actions:["selectFocusedDate"]}],"TABLE.ARROW_RIGHT":[{guard:"isMonthView",actions:["focusNextMonth"]},{guard:"isYearView",actions:["focusNextYear"]},{actions:["focusNextDay","setHoveredDate"]}],"TABLE.ARROW_LEFT":[{guard:"isMonthView",actions:["focusPreviousMonth"]},{guard:"isYearView",actions:["focusPreviousYear"]},{actions:["focusPreviousDay"]}],"TABLE.ARROW_UP":[{guard:"isMonthView",actions:["focusPreviousMonthColumn"]},{guard:"isYearView",actions:["focusPreviousYearColumn"]},{actions:["focusPreviousWeek"]}],"TABLE.ARROW_DOWN":[{guard:"isMonthView",actions:["focusNextMonthColumn"]},{guard:"isYearView",actions:["focusNextYearColumn"]},{actions:["focusNextWeek"]}],"TABLE.PAGE_UP":{actions:["focusPreviousSection"]},"TABLE.PAGE_DOWN":{actions:["focusNextSection"]},"TABLE.HOME":[{guard:"isMonthView",actions:["focusFirstMonth"]},{guard:"isYearView",actions:["focusFirstYear"]},{actions:["focusSectionStart"]}],"TABLE.END":[{guard:"isMonthView",actions:["focusLastMonth"]},{guard:"isYearView",actions:["focusLastYear"]},{actions:["focusSectionEnd"]}],"TRIGGER.CLICK":[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"focused",actions:["invokeOnClose"]}],"VIEW.TOGGLE":{actions:["setNextView"]},INTERACT_OUTSIDE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{guard:"shouldRestoreFocus",target:"focused",actions:["setActiveIndexToStart","invokeOnClose","restoreFocusToTrigger"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["setActiveIndexToStart","invokeOnClose"]},{target:"idle",actions:["setActiveIndexToStart","invokeOnClose"]}]}}},implementations:{guards:{isAboveMinView:({context:e,prop:t})=>ay(e.get("view"),t("minView")),isDayView:({context:e,event:t})=>(t.view||e.get("view"))==="day",isMonthView:({context:e,event:t})=>(t.view||e.get("view"))==="month",isYearView:({context:e,event:t})=>(t.view||e.get("view"))==="year",isRangePicker:({prop:e})=>e("selectionMode")==="range",hasSelectedRange:({context:e})=>e.get("value").length===2,isMultiPicker:({prop:e})=>e("selectionMode")==="multiple",canSelectDate:e=>{const{context:t,prop:n,event:s}=e,r=n("maxSelectedDates");if(r==null)return!0;const o=t.get("value"),i=Qn(e,s.value??t.get("focusedValue"));return o.some(c=>St(c,i))?!0:o.length<r},shouldRestoreFocus:({context:e})=>!!e.get("restoreFocus"),isSelectingEndDate:({context:e})=>e.get("activeIndex")===1,closeOnSelect:({prop:e})=>!!e("closeOnSelect"),isOpenControlled:({prop:e})=>e("open")!=null||!!e("inline"),isInteractOutsideEvent:({event:e})=>e.previousEvent?.type==="INTERACT_OUTSIDE",isInputValueEmpty:({event:e})=>e.value.trim()==="",shouldFixOnBlur:({event:e})=>!!e.fixOnBlur,isDayPointerMoveOutsideVisibleMonth:({event:e})=>e.cell==="day"&&e.outsideRange===!0},effects:{trackPositioning({context:e,prop:t,scope:n}){if(t("inline"))return;e.get("currentPlacement")||e.set("currentPlacement",t("positioning").placement);const s=ed(n);return Mo(s,()=>tc(n),{...t("positioning"),defer:!0,onComplete(o){e.set("currentPlacement",o.placement)}})},setupLiveRegion({scope:e,refs:t}){const n=e.getDoc();return t.set("announcer",vy({level:"assertive",document:n})),()=>t.get("announcer")?.destroy?.()},trackDismissableElement({scope:e,send:t,context:n,prop:s}){return s("inline")?void 0:rl(()=>dn(e),{type:"popover",defer:!0,getRootNode:e.getRootNode,layerStyleTargets:[()=>tc(e)],exclude:[...Xn(e),Ys(e),ry(e)],onInteractOutside(o){n.set("restoreFocus",!o.detail.focusable)},onDismiss(){t({type:"INTERACT_OUTSIDE"})},onEscapeKeyDown(o){o.preventDefault(),t({type:"TABLE.ESCAPE",src:"dismissable",focusVisible:!0})}})}},actions:{setNextView({context:e,prop:t}){const n=td(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setPreviousView({context:e,prop:t}){const n=ly(e.get("view"),t("minView"),t("maxView"));e.set("view",n)},setView({context:e,event:t}){e.set("view",t.view)},setRestoreFocus({context:e}){e.set("restoreFocus",!0)},announceValueText({context:e,prop:t,refs:n}){const s=e.get("value"),r=t("locale"),o=t("timeZone");let i;if(t("selectionMode")==="range"){const[a,c]=s;a&&c?i=Rs(a,c,r,o):a?i=Rs(a,null,r,o):c?i=Rs(c,null,r,o):i=""}else i=s.map(a=>Rs(a,null,r,o)).filter(Boolean).join(",");n.get("announcer")?.announce(i,3e3)},announceVisibleRange({computed:e,refs:t}){const{formatted:n}=e("visibleRangeText");t.get("announcer")?.announce(n)},disableTextSelection({scope:e}){of({target:dn(e),doc:e.getDoc()})},enableTextSelection({scope:e}){Dc({doc:e.getDoc(),target:dn(e)})},focusFirstSelectedDate(e){const{context:t}=e;t.get("value").length&&re(e,t.get("value")[0])},syncInputElement({scope:e,computed:t}){we(()=>{Xn(e).forEach((s,r)=>{Ss(s,t("valueAsString")[r]||"")})})},setFocusedDate(e){const{event:t}=e,n=Array.isArray(t.value)?t.value[0]:t.value;re(e,n)},setFocusedValueForView(e){const{context:t,event:n}=e;re(e,t.get("focusedValue").set({[t.get("view")]:n.value}))},focusNextMonth(e){const{context:t}=e;re(e,t.get("focusedValue").add({months:1}))},focusPreviousMonth(e){const{context:t}=e;re(e,t.get("focusedValue").subtract({months:1}))},setDateValue({context:e,event:t,prop:n}){if(!Array.isArray(t.value))return;const s=t.value.map(r=>Re(r,n("min"),n("max")));e.set("value",s)},clearDateValue({context:e}){e.set("value",[])},setSelectedDate(e){const{context:t,event:n}=e,s=Array.from(t.get("value")),r=t.get("activeIndex"),o=s[r],i=Qn(e,n.value??t.get("focusedValue"));s[r]=Fs(o,i),t.set("value",Ks(s))},resetSelection(e){const{context:t,event:n}=e,s=t.get("value")[0],r=Qn(e,n.value??t.get("focusedValue"));t.set("value",[Fs(s,r)])},toggleSelectedDate(e){const{context:t,event:n}=e,s=Qn(e,n.value??t.get("focusedValue")),r=t.get("value"),o=r.findIndex(i=>St(i,s));if(o===-1){const i=[...r,s];t.set("value",Vs(i))}else{const i=Array.from(r);i.splice(o,1),t.set("value",Vs(i))}},setHoveredDate({context:e,event:t}){e.set("hoveredValue",t.value)},clearHoveredDate({context:e}){e.set("hoveredValue",null)},selectFocusedDate({context:e,computed:t}){const n=Array.from(e.get("value")),s=e.get("activeIndex"),r=n[s],o=e.get("focusedValue").copy();n[s]=Fs(r,o),e.set("value",Ks(n));const i=t("valueAsString");e.set("inputValue",i[s])},focusPreviousDay(e){const{context:t}=e,n=t.get("focusedValue").subtract({days:1});re(e,n)},focusNextDay(e){const{context:t}=e,n=t.get("focusedValue").add({days:1});re(e,n)},focusPreviousWeek(e){const{context:t}=e,n=t.get("focusedValue").subtract({weeks:1});re(e,n)},focusNextWeek(e){const{context:t}=e,n=t.get("focusedValue").add({weeks:1});re(e,n)},focusNextPage(e){const{context:t,computed:n,prop:s}=e,r=ql(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));Hs(e,r)},focusPreviousPage(e){const{context:t,computed:n,prop:s}=e,r=Gl(t.get("focusedValue"),t.get("startValue"),n("visibleDuration"),s("locale"),s("min"),s("max"));Hs(e,r)},focusSectionStart(e){const{context:t}=e;re(e,t.get("startValue").copy())},focusSectionEnd(e){const{computed:t}=e;re(e,t("endValue").copy())},focusNextSection(e){const{context:t,event:n,computed:s,prop:r}=e,o=Hm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),r("locale"),r("min"),r("max"));o&&Hs(e,o)},focusPreviousSection(e){const{context:t,event:n,computed:s,prop:r}=e,o=Wm(t.get("focusedValue"),t.get("startValue"),n.larger,s("visibleDuration"),r("locale"),r("min"),r("max"));o&&Hs(e,o)},focusNextYear(e){const{context:t}=e,n=t.get("focusedValue").add({years:1});re(e,n)},focusPreviousYear(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:1});re(e,n)},focusNextDecade(e){const{context:t}=e,n=t.get("focusedValue").add({years:10});re(e,n)},focusPreviousDecade(e){const{context:t}=e,n=t.get("focusedValue").subtract({years:10});re(e,n)},clearFocusedDate(e){const{context:t,prop:n}=e,s=t.get("focusedValue").calendar;re(e,rs(n("timeZone"),s))},focusPreviousMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({months:n.columns});re(e,s)},focusNextMonthColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({months:n.columns});re(e,s)},focusPreviousYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").subtract({years:n.columns});re(e,s)},focusNextYearColumn(e){const{context:t,event:n}=e,s=t.get("focusedValue").add({years:n.columns});re(e,s)},focusFirstMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMinimumMonthInYear?.(n)??1;re(e,n.set({month:s}))},focusLastMonth(e){const{context:t}=e,n=t.get("focusedValue"),s=n.calendar.getMonthsInYear(n);re(e,n.set({month:s}))},focusFirstYear(e){const{context:t}=e,n=gn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[0]});re(e,s)},focusLastYear(e){const{context:t}=e,n=gn(t.get("focusedValue").year),s=t.get("focusedValue").set({year:n[n.length-1]});re(e,s)},setActiveIndex({context:e,event:t}){e.set("activeIndex",t.index)},setActiveIndexToEnd({context:e}){e.set("activeIndex",1)},setActiveIndexToStart({context:e}){e.set("activeIndex",0)},resumeRangeSelection({context:e,prop:t}){t("selectionMode")==="range"&&e.get("value").length===1&&e.set("activeIndex",1)},focusActiveCell({scope:e,context:t,event:n}){n.src!=="input.click"&&we(()=>{const s=t.get("view");ec(e,s)?.focus({preventScroll:!0})})},focusActiveCellIfNeeded({scope:e,context:t,event:n}){n.focus&&we(()=>{const s=t.get("view");ec(e,s)?.focus({preventScroll:!0})})},setHoveredValueIfKeyboard({context:e,event:t,prop:n}){!(t.type.startsWith("TABLE.ARROW")||["TABLE.ENTER","TABLE.HOME","TABLE.END","TABLE.PAGE_UP","TABLE.PAGE_DOWN"].includes(t.type))||n("selectionMode")!=="range"||e.get("activeIndex")===0||e.set("hoveredValue",e.get("focusedValue").copy())},restoreFocusToTrigger({scope:e,event:t}){const n=dn(e),s=ky(t);we(()=>{Ji(e.getActiveElement(),[n])||Ys(e)?.focus(s)})},focusFirstInputElement({scope:e,event:t}){t.focus!==!1&&we(()=>{const[n]=Xn(e);(n??Ys(e))?.focus({preventScroll:!0})})},focusInputElement({scope:e}){we(()=>nc(e))},restoreFocusToInput({scope:e}){const t=dn(e);we(()=>{Ji(e.getActiveElement(),[t])||nc(e)})},syncMonthSelectElement({scope:e,context:t}){const n=sy(e);Ss(n,t.get("startValue").month.toString())},syncYearSelectElement({scope:e,context:t}){const n=ny(e);Ss(n,t.get("startValue").year.toString())},setInputValue({context:e,event:t}){e.get("activeIndex")===t.index&&e.set("inputValue",t.value)},syncInputValue({scope:e,context:t,event:n}){queueMicrotask(()=>{const s=Xn(e),r=n.index??t.get("activeIndex");Ss(s[r],t.get("inputValue"))})},focusParsedDate(e){const{event:t,prop:n}=e;if(t.index==null)return;const r=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});!r||!sc(r)||re(e,r)},selectParsedDate({context:e,event:t,prop:n}){if(t.index==null)return;let r=n("parse")(t.value,{locale:n("locale"),timeZone:n("timeZone")});if((!r||!sc(r))&&t.value&&(r=e.get("focusedValue").copy()),!r)return;r=Re(r,n("min"),n("max"));const o=Array.from(e.get("value"));o[t.index]=Fs(o[t.index],r);const i=Ks(o);e.set("value",i);const a=Ns(i,n);e.set("inputValue",a[t.index])},resetView({context:e}){e.set("view",e.initial("view"))},setStartValue({context:e,computed:t,prop:n}){const s=e.get("focusedValue");if(!Ke(s,e.get("startValue"),t("endValue")))return;const o=qa(s,"start",{months:n("numOfMonths")},n("locale"));e.set("startValue",o)},invokeOnOpen({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!0,value:t.get("value")})},invokeOnClose({prop:e,context:t}){e("inline")||e("onOpenChange")?.({open:!1,value:t.get("value")})},invokeOnVisibleRangeChange({prop:e,context:t,computed:n}){e("onVisibleRangeChange")?.({view:t.get("view"),visibleRange:n("visibleRange")})},toggleVisibility({event:e,send:t,prop:n}){t({type:n("open")?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:e})}}}}),Qn=(e,t)=>{const{context:n,prop:s}=e,r=n.get("view");let o=typeof t=="number"?n.get("focusedValue").set({[r]:t}):t;return uy(i=>{cy(i,s("minView"))&&(o=o.set({[i]:i==="day"?1:0}))}),o},Fs=(e,t)=>{if(!e||!("hour"in e))return t;const n="timeZone"in e;let s=t;return"hour"in t||(n?s=Ml(Fe(t),e.timeZone):s=Fe(t)),s.set({hour:e.hour,minute:e.minute,second:e.second,millisecond:e.millisecond})};function re(e,t){const{context:n,prop:s,computed:r}=e;if(!t)return;const o=Qn(e,t);if(St(n.get("focusedValue"),o))return;const a=bs(r("visibleDuration"),s("locale"),s("min"),s("max"))({focusedDate:o,startDate:n.get("startValue")});n.set("startValue",a.startDate),n.set("focusedValue",a.focusedDate)}function Hs(e,t){const{context:n}=e;n.set("startValue",t.startDate);const s=n.get("focusedValue");St(s,t.focusedDate)||n.set("focusedValue",t.focusedDate)}function ky(e){return e.focusVisible??e.previousEvent?.focusVisible?{preventScroll:!0,focusVisible:!0}:{preventScroll:!0}}function nd(e){return Array.isArray(e)?e.map(t=>nd(t)):e instanceof Date?new Ue(e.getFullYear(),e.getMonth()+1,e.getDate()):mm(e)}const uo=e=>W(`chevron-${e}`),ho=e=>{try{return/^\d{4}-\d{2}-\d{2}$/.test(e)?nd(e):void 0}catch{return}};function Cy(e,t,n){e.innerHTML=`<div class="date-control"><button class="icon-button date-trigger" type="button" aria-label="Custom date range" title="Custom date range">${W("calendar")}</button></div>
|
|
100
|
+
<div class="date-positioner" popover="manual"><section class="date-popover">
|
|
101
|
+
<header class="date-heading"><div><span class="eyebrow">FOCUS YOUR TIMELINE</span><h2>Date range</h2></div><button type="button" class="icon-button date-close" aria-label="Close date range">${W("x")}</button></header>
|
|
102
|
+
<div class="date-fields"><label>From<input id="from-date" aria-label="From date" autocomplete="off" spellcheck="false" placeholder="YYYY-MM-DD"/></label><span aria-hidden="true">→</span><label>To<input id="to-date" aria-label="To date" autocomplete="off" spellcheck="false" placeholder="YYYY-MM-DD"/></label></div>
|
|
103
|
+
<div class="date-presets"><button type="button" data-preset="last7Days">Last 7 days</button><button type="button" data-preset="last30Days">Last 30 days</button><button type="button" data-preset="thisMonth">This month</button></div>
|
|
104
|
+
<div class="date-calendar"><div class="date-navigation"><button type="button" class="icon-button date-prev">${uo("left")}</button><button type="button" class="date-view"></button><button type="button" class="icon-button date-next">${uo("right")}</button></div><div class="date-grids"></div></div>
|
|
105
|
+
<footer class="date-footer"><span class="date-status" role="status"></span><button id="apply-dates" class="primary-button" type="button">Apply range ${uo("right")}</button></footer>
|
|
106
|
+
</section></div>`;const s=d=>e.querySelector(d),r=s(".date-trigger"),o=s(".date-positioner"),i=s(".date-popover"),a=[s("#from-date"),s("#to-date")],c=s("#apply-dates"),l=new cl(wy,{id:"timeline-dates",selectionMode:"range",closeOnSelect:!1,fixedWeeks:!0,outsideDaySelectable:!0,locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,format:d=>d.toString(),parse:ho,placeholder:"YYYY-MM-DD",positioning:{placement:"top-end",strategy:"fixed",gutter:12,slide:!0},onOpenChange({open:d}){d&&n()}}),h=()=>fy(l.service,ol),u=["day","month","year"].map(d=>{const m=document.createElement("table");m.dataset.calendarView=d;const v=m.createTHead(),k=v.insertRow();if(d==="day")for(let S=0;S<7;S++)k.append(document.createElement("th"));const L=m.createTBody(),O=d==="day"?6:4,w=d==="day"?7:3;for(let S=0;S<O;S++){const b=L.insertRow();for(let E=0;E<w;E++){const C=document.createElement("button");C.type="button",b.insertCell().append(C)}}return s(".date-grids").append(m),{view:d,table:m,head:v,body:L}});function g(){const d=a.map(k=>ho(k.value)),m=!!(d[0]&&d[1]&&d[0].compare(d[1])<=0);c.disabled=!m;for(const[k,L]of a.entries())L.setAttribute("aria-invalid",String(!!L.value&&!d[k]));const v=m?"Both dates included":"Choose a start and end date";s(".date-status").textContent!==v&&(s(".date-status").textContent=v)}function p(){const d=h();ie(e,d.getRootProps()),ie(s(".date-control"),d.getControlProps()),ie(r,{...d.getTriggerProps(),"aria-label":"Custom date range"}),ie(o,d.getPositionerProps()),ie(i,{...d.getContentProps(),"aria-label":"Custom date range"}),a.forEach((k,L)=>ie(k,{...d.getInputProps({index:L}),"aria-label":L?"To date":"From date"})),ie(s(".date-prev"),d.getPrevTriggerProps({view:d.view})),ie(s(".date-next"),d.getNextTriggerProps({view:d.view}));const m=d.view==="day"?d.visibleRangeText.start:d.view==="month"?String(d.visibleRange.start.year):`${d.getDecade().start} – ${d.getDecade().end}`,v=s(".date-view");ie(v,d.getViewTriggerProps({view:d.view})),v.textContent!==m&&(v.textContent=m);for(const{view:k,table:L,head:O,body:w}of u){L.hidden=d.view!==k,ie(L,d.getTableProps({view:k,columns:k==="day"?7:3})),ie(O,d.getTableHeaderProps({view:k})),ie(w,d.getTableBodyProps({view:k})),k==="day"&&d.weekDays.forEach((b,E)=>{const C=O.rows[0].cells[E];C.scope="col",C.setAttribute("aria-label",b.long),C.textContent!==b.short&&(C.textContent=b.short)});const S=k==="day"?d.weeks:k==="month"?d.getMonthsGrid({columns:3,format:"short"}):d.getYearsGrid({columns:3});Array.from(w.rows).forEach((b,E)=>{ie(b,d.getTableRowProps({view:k})),Array.from(b.cells).forEach((C,x)=>{const y=S[E]?.[x],M=C.firstElementChild;if(C.hidden=!y,!!y)if(k==="day"){const D=d.weeks[E][x];ie(C,d.getDayTableCellProps({value:D})),ie(M,d.getDayTableCellTriggerProps({value:D})),M.textContent!==String(D.day)&&(M.textContent=String(D.day))}else{const D=y;ie(C,k==="month"?d.getMonthTableCellProps({...D,columns:3}):d.getYearTableCellProps({...D,columns:3})),ie(M,k==="month"?d.getMonthTableCellTriggerProps({...D}):d.getYearTableCellTriggerProps({...D})),M.textContent!==D.label&&(M.textContent=D.label)}})})}o.hidden=!d.open,d.open&&!o.matches(":popover-open")&&o.showPopover?.(),!d.open&&o.matches(":popover-open")&&o.hidePopover?.(),r.classList.toggle("active",d.open),g()}s(".date-close").addEventListener("click",()=>h().setOpen(!1));for(const d of e.querySelectorAll("[data-preset]"))d.addEventListener("click",()=>{const m=h(),v=m.getRangePresetValue(d.dataset.preset);m.setValue(v),m.setFocusedValue(v[0]),m.setView("day")});c.addEventListener("click",()=>{g(),c.disabled||(t(a[0].value,a[1].value),h().setOpen(!1))}),i.addEventListener("input",g),e.addEventListener("keydown",d=>d.stopPropagation());const f=l.subscribe(p);return l.start(),p(),{setRange(d,m){const v=[d,m].map(ho).filter(k=>k!==void 0);h().setValue(v),v[0]&&h().setFocusedValue(v[0])},dispose(){f(),l.stop(),e.replaceChildren()}}}const Ey="Cosmic Wobbly Disco Sneaky Bouncy Galactic Crispy Dizzy Fuzzy Noodle Groovy Sleepy Spicy Jolly Loopy Squishy Turbo Giggly Velvet Soggy Zippy Fluffy Moonwalking Wiggly Fizzy Snazzy Goofy Jazzy Tiny Chunky Dapper Wacky".split(" "),Sy="Wombat Pickle Pancake Badger Potato Narwhal Noodle Goblin Otter Turnip Hamster Comet Dumpling Goose Biscuit Llama Muffin Squid Raccoon Toaster Waffle Penguin Yeti Pudding Walrus Taco Jellybean Platypus Sloth Cactus Donut Mongoose".split(" ");function xy(e,t){let n=5457746;const s=(()=>(n=Math.imul(n,1664525)+1013904223>>>0,n/2**32)),r=Ey.flatMap(o=>Sy.map(i=>`${o} ${i}`));for(let o=r.length-1;o>0;o--){const i=Math.floor(s()*(o+1));[r[o],r[i]]=[r[i],r[o]]}return Array.from({length:e},(o,i)=>`Project ${"Mega".repeat(Math.floor(i/r.length))}${r[i%r.length]}`)}const $y={tokens:"Tokens",timestamps:"Session times",messageCounts:"Message counts",messageTimestamps:"Message times",model:"Models",harness:"Harness"},dr={tokens:!0,timestamps:!0,messageCounts:!0,messageTimestamps:!0,model:!0,harness:!0};function Ly(e){const t={...dr};if(sd(e))for(const n of Object.keys(t))typeof e[n]=="boolean"&&(t[n]=e[n]);return(!t.timestamps||!t.messageCounts)&&(t.messageTimestamps=!1),t}function rc(e){return e.timestamps?Math.max(e.timestamps.created,e.timestamps.lastMessageAt??0):0}function cv(e,t){return rc(t)-rc(e)||t.id-e.id}const oc=1e4,Iy=2e6,Ty=1e5,My="Visible on your profile and in Explore. Names, messages, code, paths, and costs stay private.",Ay=/^(?:gpt-[3-6](?:\.[0-9])?(?:-(?:turbo|mini|nano|pro|codex|astra|instant|thinking|chat|latest|preview|[0-9]{4,8}))*|o[1-4](?:-(?:mini|pro|preview|[0-9]{4,8}))*|claude-(?:(?:sonnet|opus|haiku)-[3-5](?:[.-][0-9])?|[3-5](?:-[0-9])?-(?:sonnet|opus|haiku))(?:-(?:latest|thinking|[0-9]{8}))*|gemini-[1-4](?:\.[0-9])?-(?:pro|flash)(?:-(?:lite|preview|exp|latest|[0-9]{2,4}))*|deepseek-(?:chat|reasoner|v[3-4](?:\.[0-9])?|r1)|grok-[2-5](?:\.[0-9])?(?:-(?:fast|code|reasoning|non-reasoning|[0-9]))*|kimi-k[1-3](?:\.[0-9])?(?:-thinking)?|minimax-m[1-3](?:\.[0-9])?)$/i,Oy=e=>{const t=e.split("/").at(-1)||"";return t.length<=100&&Ay.test(t)?t.toLowerCase():null},sd=e=>!!e&&typeof e=="object"&&!Array.isArray(e),cn=(e,t)=>sd(e)&&Object.keys(e).length===t.length&&t.every(n=>Object.hasOwn(e,n)),ur=(e,t=Number.MAX_SAFE_INTEGER)=>Number.isSafeInteger(e)&&e>=0&&e<=t,fo=e=>ur(e,Date.UTC(2100,0,1)),po=e=>e===null||ur(e);function Dy(e){const t=()=>{throw new Error("Invalid anonymous graph. Reopen the publishing preview and try again.")};if(!cn(e,["version","settings","sessions"])||e.version!==1||!Array.isArray(e.sessions)||!cn(e.settings,Object.keys(dr))||Object.values(e.settings).some(a=>typeof a!="boolean"))return t();const n=e.settings;if(n.messageTimestamps&&(!n.timestamps||!n.messageCounts))return t();if(e.sessions.length<1||e.sessions.length>oc)throw new Error(`Choose between 1 and ${oc.toLocaleString("en")} sessions to publish.`);const s=["id","group","parent","fork",...n.timestamps?["timestamps"]:[],...n.tokens?["tokens"]:[],...n.messageCounts?["messages"]:[],...n.messageTimestamps?["messageTimes"]:[],...n.model?["model"]:[],...n.harness?["harness"]:[]];let r=0;for(let a=0;a<e.sessions.length;a++){const c=e.sessions[a];if(!cn(c,s)||c.id!==a||!ur(c.group,e.sessions.length-1))return t();for(const l of["parent","fork"])if(c[l]!==null&&(!ur(c[l],e.sessions.length-1)||c[l]===a))return t();if(n.timestamps&&(!cn(c.timestamps,["created","lastMessageAt"])||!fo(c.timestamps.created)||c.timestamps.lastMessageAt!==null&&!fo(c.timestamps.lastMessageAt))||n.tokens&&!po(c.tokens)||n.messageCounts&&(!cn(c.messages,["count","untimed","partial"])||!po(c.messages.count)||!po(c.messages.untimed)||typeof c.messages.partial!="boolean")||n.messageTimestamps&&(!cn(c.messageTimes,["values","limited"])||!Array.isArray(c.messageTimes.values)||c.messageTimes.values.length>2e3||typeof c.messageTimes.limited!="boolean"||c.messageTimes.values.some(l=>!fo(l))||(r+=c.messageTimes.values.length,r>Ty))||n.model&&c.model!==null&&(typeof c.model!="string"||Oy(c.model)!==c.model)||n.harness&&c.harness!==null&&(typeof c.harness!="string"||!Su(c.harness)))return t()}const o=e.sessions,i=new Uint8Array(o.length);for(let a=0;a<o.length;a++){if(i[a])continue;const c=[[a,!1]];for(;c.length;){const[l,h]=c.pop();if(h){i[l]=2;continue}if(i[l]===1)return t();if(i[l]!==2){i[l]=1,c.push([l,!0]);for(const u of[o[l].parent,o[l].fork])u!==null&&c.push([u,!1])}}}if(new TextEncoder().encode(JSON.stringify(e)).length>Iy)throw new Error("This graph is too large. Choose a smaller date range.");return e}function lv(e,t){const n=Dy(e),s=n.sessions.filter(a=>!t||t.has(a.id)).map(a=>({id:String(a.id),projectID:String(a.group),title:`Session ${a.id+1}`,directory:"",created:a.timestamps?.created??a.id*36e5,updated:a.timestamps?.created??a.id*36e5,tokens:a.tokens??null,cost:null,archived:!1,model:a.model??"",provider:"",agent:"",source:a.harness??void 0,activity:{firstMessageAt:null,lastMessageAt:a.timestamps?.lastMessageAt??null,userMessages:0,untimedUserMessages:0},...a.parent===null?{}:{parentID:String(a.parent)},...a.fork===null?{}:{forkID:String(a.fork)}})),r=xy(Math.max(...n.sessions.map(a=>a.group))+1),o=[...new Set(n.sessions.map(a=>a.group))].map(a=>({id:String(a),name:r[a],directory:"",worktrees:[]})),i=dc(s.map(a=>({...a,source:void 0})),o);i.calendarTime=n.settings.timestamps;for(const a of i.nodes)a.session.source=n.sessions[Number(a.session.id)].harness??void 0;return i}function Py(e,t,n){e.open&&(e.addEventListener("close",()=>n(t),{once:!0}),e.close())}function Ry(e,t,n){const s=document.createDocumentFragment(),r=document.createElement("header");r.className="sharing-header";const o=document.createElement("h2");o.id=`sharing-${t}-title`,o.textContent="Share",e.setAttribute("aria-labelledby",o.id);const i=document.createElement("button");i.type="button",i.className="text-button",i.textContent="Close",i.setAttribute("aria-label","Close sharing"),i.onclick=()=>e.close();const a=document.createElement("div");a.className="sharing-modes",a.setAttribute("role","group"),a.setAttribute("aria-label","Share method");for(const c of["publish","video"]){const l=document.createElement("button");l.type="button",l.dataset.shareMode=c,l.textContent=c==="publish"?"Publish":"Video",l.setAttribute("aria-pressed",String(c===t)),l.onclick=()=>{c!==t&&Py(e,c,n)},a.append(l)}return r.append(o,a,i),s.append(r),s}function Vy(e,t,n){const s=document.createElement("dialog");s.className="publishing-dialog",s.setAttribute("aria-labelledby","publishing-title"),s.innerHTML=`<div class="publishing-account"><span data-account hidden></span><span class="publishing-account-placeholder" role="status" hidden><span class="sr-only">Checking sign-in…</span></span><button class="text-button" data-account-retry hidden>Couldn’t check sign-in. Retry</button><button class="secondary-button" data-login hidden><span data-login-label>Sign in with GitHub</span></button></div>
|
|
107
|
+
<div class="publishing-connect" hidden><p>Confirm this code in your browser: <strong data-code></strong></p><a class="secondary-button" data-connect target="_blank" rel="noopener noreferrer">Continue in browser ↗</a><button class="text-button" data-check>Check login</button><label class="publishing-browser-link">Browser link<input type="text" data-connect-url readonly aria-label="Browser sign-in link"></label><button class="text-button" data-copy-link>Copy browser link</button></div>
|
|
108
|
+
<p class="publishing-disclosure"></p>
|
|
109
|
+
<details class="publishing-settings"><summary><span class="publishing-scope"></span><span>Shared details</span></summary><fieldset class="publishing-fields" aria-label="Shared details">${Object.entries($y).map(([P,F])=>`<label><input type="checkbox" data-field="${P}" checked><span>${F}</span></label>`).join("")}</fieldset><button class="text-button" data-json aria-pressed="false" aria-controls="publishing-json" disabled>View JSON</button></details>
|
|
110
|
+
<div class="publishing-error" hidden><p role="alert" data-preview-error></p><button class="secondary-button" data-retry>Retry preview</button></div>
|
|
111
|
+
<div class="publishing-preview"></div><pre class="publishing-json" id="publishing-json" tabindex="0" aria-label="Public graph JSON" hidden></pre>
|
|
112
|
+
<p role="status" class="publishing-status"></p>
|
|
113
|
+
<footer><a class="publishing-link text-button" target="_blank" rel="noopener noreferrer" hidden>View profile ↗</a><button class="text-button" data-remove hidden>Unpublish</button><button class="primary-button" data-publish disabled>Publish graph</button></footer>`,document.body.append(s),s.prepend(Ry(s,"publish",()=>t()));const r=P=>s.querySelector(P);r(".publishing-disclosure").textContent=My,r("[data-login]").prepend(yo("github"));let o=[],i={...dr},a,c,l=n.preloadedUsername,h=!1,u="checking",g=0,p=!1,f=!1,d=!1,m=0,v=!1,k=!1,L=0,O,w;const S=P=>{r(".publishing-status").textContent=P},b=async(P,F="GET",B,j)=>{const q=await fetch(`/api/sessiongraph/publishing/${P}`,{method:F,signal:j,headers:{"Content-Type":"application/json","x-sessiongraph-action":"1"},...B===void 0?{}:{body:JSON.stringify(B)}}),Ce=await q.json();if(!q.ok)throw Object.assign(new Error(Ce.error||"Please try again."),{status:q.status});return Ce};function E(){const P=u==="ready";r("[data-publish]").disabled=p||!c||!P||!l||d,r("[data-publish]").textContent=f?"Preparing…":d?"Published":h?"Update graph":"Publish graph",r("[data-publish]").title=P?l?c?"":"Waiting for a preview":"Sign in to publish":"Waiting for account status",r("[data-remove]").hidden=!h,r("[data-remove]").disabled=p||!P,r("[data-login]").hidden=!P||!!l||!!O,r("[data-login]").disabled=p||k,r("[data-login-label]").textContent=k?"Opening sign-in…":"Sign in with GitHub",r("[data-login]").setAttribute("aria-busy",String(k)),r("[data-account]").hidden=!l&&!O,r("[data-account]").textContent=l?`@${l}`:O?"Waiting for browser approval":"",r(".publishing-account-placeholder").hidden=u!=="checking"||!!l||!!O,r("[data-account-retry]").hidden=u!=="failed",r("[data-json]").disabled=!c,r("[data-retry]").disabled=p||f;for(const B of s.querySelectorAll("[data-field]")){const j=B.dataset.field;B.checked=i[j],B.disabled=p||j==="messageTimestamps"&&(!i.timestamps||!i.messageCounts),B.closest("label").title=j==="messageTimestamps"&&B.disabled&&!p?"Enable session times and message counts first":""}const F=r(".publishing-link");F.hidden=!l||!h,l&&(F.href=`https://sessiongraph.ai/@${l}`)}function C(P){r(".publishing-json").hidden=!P,r(".publishing-preview").hidden=P,r("[data-json]").textContent=P?"Back to graph":"View JSON",r("[data-json]").setAttribute("aria-pressed",String(P)),P&&(r(".publishing-json").textContent=c?JSON.stringify(c.graph,null,2):"",r(".publishing-json").focus())}function x(P){r(".publishing-error").hidden=!P,r("[data-preview-error]").textContent=P}async function y(){const P=++g;c=void 0,d=!1;const F=()=>s.open&&P===g;w?.abort();const B=new AbortController;if(w=B,f=!!o.length,x(""),C(!1),r(".publishing-json").textContent="",E(),r(".publishing-preview").setAttribute("aria-busy",String(f)),!o.length){r(".publishing-preview").textContent="Choose sessions on the map to share.";return}a||(r(".publishing-preview").textContent="Preparing preview…");try{const j=await b("preview","POST",{ids:o,settings:i},B.signal);if(!F())return;if(a)a.setData(j.graph);else{if(await new Promise(Ce=>requestAnimationFrame(()=>window.setTimeout(Ce,0))),!F())return;const{createPublicViewer:q}=await mr(async()=>{const{createPublicViewer:Ce}=await import("./public-viewer-iQBchlbq.js");return{createPublicViewer:Ce}},__vite__mapDeps([0,1,2,3]));if(!F())return;a=q(r(".publishing-preview"),j.graph)}c=j,i=j.graph.settings}catch(j){F()&&(c=void 0,a?.dispose(),a=void 0,r(".publishing-preview").textContent="",x(j.message))}finally{F()&&(f=!1,r(".publishing-preview").setAttribute("aria-busy","false"),E())}}async function M(){const P=L;u="checking",E();try{const F=await n.check();if(!s.open||P!==L)return;({username:l,published:h}=F),u="ready",l&&(O=void 0,r(".publishing-connect").hidden=!0,window.clearInterval(m),m=0)}catch{if(!s.open||P!==L)return;u="failed"}return E(),u==="ready"}async function D(){if(v||!s.open)return;const P=L;v=!0,r("[data-check]").disabled=!0;try{const F=await b("poll","POST",{});if(!s.open||P!==L)return;if(F.username){window.clearInterval(m),m=0,O=void 0,r(".publishing-connect").hidden=!0,l=F.username,E();const B=await M();s.open&&P===L&&S(B&&!l?"Sign-in expired. Please try again.":"Signed in.")}}catch(F){if(!s.open||P!==L)return;[400,401].includes(F.status)&&(window.clearInterval(m),m=0,O=void 0,r(".publishing-connect").hidden=!0,E()),S(F.message)}finally{v=!1,r("[data-check]").disabled=!1}}r("[data-login]").onclick=async()=>{if(u!=="ready"||l||k||O)return;const P=++L;k=!0,E(),S("Preparing browser sign-in…");let F=null;if(!ss())try{F=window.open("about:blank","_blank"),F&&(F.opener=null)}catch{F=null}try{const B=await b("login","POST",{});if(!s.open||P!==L){F?.close();return}const j=yl(B.url);if(new URL(j).origin!=="https://sessiongraph.ai"||typeof B.code!="string")throw new Error("Could not prepare browser sign-in. Please try again.");O=j,r("[data-code]").textContent=B.code,r("[data-connect]").href=j,r("[data-connect-url]").value=j,r(".publishing-connect").hidden=!1,window.clearInterval(m),m=window.setInterval(()=>{D()},4e3),r("[data-connect]").focus(),S("Continue in your browser to connect this app."),ss()?await H(r("[data-connect]")):F&&(F.location.replace(j),S("Sign in in the browser tab and confirm the matching code, then return here."))}catch(B){F?.close(),P===L&&S(B.message)}finally{P===L&&(k=!1,E())}};async function H(P){if(P.getAttribute("aria-busy")==="true")return;P.setAttribute("aria-busy","true");const F=L,B=P.hasAttribute("data-connect");try{await vl(P.href),B&&s.open&&F===L&&S("Browser opened. Sign in and confirm the matching code, then return here.")}catch{s.open&&F===L&&S(B?"Could not open your browser. Copy the browser link below and paste it into your browser to continue.":"Could not open your browser. Copy the link and open it in your browser.")}finally{P.removeAttribute("aria-busy")}}s.addEventListener("click",P=>{const F=P.target.closest('a[target="_blank"]');!F||!ss()||P.defaultPrevented||P.button!==0||(P.preventDefault(),H(F))}),r("[data-copy-link]").onclick=async()=>{const P=r("[data-connect-url]");try{await navigator.clipboard.writeText(P.value),S("Browser link copied. Paste it into your browser to sign in and confirm the code.")}catch{P.focus(),P.select(),S("Browser link selected. Copy it and paste it into your browser.")}},r("[data-account-retry]").onclick=()=>{M()},r("[data-check]").onclick=()=>{D()};for(const P of s.querySelectorAll("[data-field]"))P.onchange=()=>{i=Ly({...i,[P.dataset.field]:P.checked}),S(""),y()};return r("[data-retry]").onclick=()=>{S(""),y()},r("[data-publish]").onclick=async()=>{if(!(p||!c||u!=="ready"||!l||d)){p=!0,E(),S("Publishing…");try{await b("publish","POST",{id:c.id,confirmed:!0}),h=!0,d=!0,x(""),S("Published.")}catch(P){S(""),x(P.message),P.status===401&&(l=null,h=!1)}finally{p=!1,E()}}},r("[data-remove]").onclick=async()=>{if(!(p||u!=="ready"||!l||!h)){p=!0,E();try{await b("unpublish","POST",{}),h=!1,S("Unpublished."),await y()}catch(P){S(P.message),P.status===401&&(l=null,h=!1)}finally{p=!1,E()}}},r("[data-json]").onclick=()=>{c&&C(r(".publishing-json").hidden)},s.addEventListener("close",()=>{s.open||(g++,L++,k=!1,window.clearInterval(m),m=0,w?.abort(),a?.dispose(),a=void 0,c=void 0,e())}),{async open(P){if(s.open)return;g++,L++,window.clearInterval(m),m=0,a?.dispose(),a=void 0,i={...dr},r(".publishing-settings").open=!1,o=[...P],u="checking",c=void 0,d=!1,f=!0,k=!1,S(""),x(""),C(!1),r(".publishing-preview").textContent="Preparing preview…",r(".publishing-connect").hidden=!O,r(".publishing-scope").textContent=`${o.length.toLocaleString()} sessions selected`,E(),s.showModal(),e();const F=L,B=M().then(()=>{s.open&&F===L&&O&&!l&&!m&&(m=window.setInterval(()=>{D()},4e3),D())});await Promise.all([y(),B])},dispose(){g++,L++,w?.abort(),window.clearInterval(m),a?.dispose(),a=void 0,s.close(),s.remove()}}}const Ny=3e4;function Fy(e=fetch){let t,n,s=!1;async function r(){const i=await e("/api/sessiongraph/publishing/status",{signal:AbortSignal.timeout(3e4)});if(i.status===401)return{username:null,published:!1};if(!i.ok)throw new Error("Could not check sign-in.");const a=await i.json();if(a?.username===null)return{username:null,published:!1};if(typeof a?.username!="string"||!a.username)throw new Error("Could not check sign-in.");return{username:a.username,published:!!a.publication}}const o=()=>t??=r().finally(()=>{t=void 0});return o().then(i=>{s||(n={account:i,checkedAt:Date.now()})},()=>{}),{get preloadedUsername(){return n?.account.username??null},check(){s=!0;const i=n;return n=void 0,i&&Date.now()-i.checkedAt<Ny?Promise.resolve(i.account):o()}}}const Hy=Fy(),He=()=>ds(),I=e=>document.querySelector(e),X=e=>e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]),rd=e=>Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(e),le=e=>e.toLocaleString("en"),Wy=[new Intl.DateTimeFormat("en",{month:"short",day:"numeric"}),new Intl.DateTimeFormat("en",{month:"short",day:"numeric",year:"numeric"})],jy=new Intl.DateTimeFormat(void 0,{dateStyle:"medium",timeStyle:"short"}),_y=new Intl.DateTimeFormat(void 0,{hour:"2-digit",minute:"2-digit"}),ps=(e,t=!1)=>Wy[Number(t)].format(e),hr=e=>jy.format(e),ic=e=>{const t=new Date(e);return`${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,"0")}-${String(t.getDate()).padStart(2,"0")}`};let G,se={nodes:[],edges:[],lanes:[],start:0,end:0},fe=[],Ti=[],od=new Set,os=new Map,gs=new Map,id=new Map,Q,ad=!0,es,Y=new URLSearchParams(location.search).get("session"),ze,Me,Zs=0,wt="",En="",Je="",Jt=gi.days,Mt="",At="",Sn=!0,Xt=!1,zs=0,qo,Go,Mi=0,Ot=!1,ce=1,fr=0,is=0,ot=dl([]),Yo="",cd=hl([]),Js,go,ac,qn=0,Gn=!1,Z={...Tr},Qt=!0,Pr,mt,ms=!1,Ko="";try{Z=fl(localStorage)}catch{Qt=!1}const ld=matchMedia("(prefers-reduced-motion: reduce)");I("#app").innerHTML=`
|
|
114
|
+
<main class="map" aria-label="Session map">
|
|
115
|
+
<h1 class="sr-only">SessionGraph — Explore & visualize all your LLM sessions</h1>
|
|
116
|
+
<div id="scene"></div>
|
|
117
|
+
<div class="canvas-vignette"></div>
|
|
118
|
+
<div id="graph-message" class="graph-message"><div class="loading-orbit"><span></span><span></span><span></span></div><h3>Loading sessions…</h3></div>
|
|
119
|
+
<div id="tooltip" class="node-tooltip" hidden></div>
|
|
120
|
+
</main>
|
|
121
|
+
<header class="app-header glass">
|
|
122
|
+
<a class="brand" href="/" aria-label="SessionGraph home" title="Explore & visualize all your LLM sessions"><img src="/brand/mark.svg" alt=""/><span>SessionGraph</span></a>
|
|
123
|
+
<span class="connection" role="status" title="Connecting"><span class="status-dot"></span><span id="connection-label" class="sr-only">Connecting</span></span>
|
|
124
|
+
<span class="toolbar-divider"></span>
|
|
125
|
+
${rt("search","Toggle sessions",{id:"toggle-explorer","aria-controls":"explorer","aria-expanded":"true"},"Sessions","Sessions")}
|
|
126
|
+
</header>
|
|
127
|
+
<nav class="map-controls glass" aria-label="Map controls">
|
|
128
|
+
${rt("center-focus","Fit view",{id:"reset-camera"},"Fit view (F)")}
|
|
129
|
+
${rt("clock","Toggle timeline",{id:"toggle-timeline","aria-controls":"timeline","aria-expanded":"true"},"Timeline")}
|
|
130
|
+
${rt("panel-right","Toggle session details",{id:"toggle-inspector","aria-controls":"inspector","aria-expanded":"false",hidden:!0},"Session details")}
|
|
131
|
+
${rt("circle-help","Help",{id:"help","aria-haspopup":"dialog"})}
|
|
132
|
+
${rt("volume-2","Mute sound",{id:"mute-audio","aria-pressed":"false","data-sound":"none"})}
|
|
133
|
+
${rt("settings-2","Settings",{id:"open-settings","aria-haspopup":"dialog"})}
|
|
134
|
+
${rt("share-2","Share SessionGraph",{id:"open-publishing","aria-haspopup":"dialog"})}
|
|
135
|
+
</nav>
|
|
136
|
+
<aside class="sidebar floating-panel glass" id="explorer" aria-label="Sessions">
|
|
137
|
+
<div class="panel-heading"><h2 class="panel-title">Sessions <span class="small-badge" id="list-count">—</span></h2><button class="icon-button" id="refresh" aria-label="Refresh sessions" title="Refresh sessions">${W("refresh-cw")}</button><button class="icon-button" id="close-explorer" aria-label="Close sessions">${W("x")}</button></div>
|
|
138
|
+
<button class="search-box search-trigger" id="search" aria-label="Search all sessions">${W("search")}<span>Search everything…</span><kbd>/</kbd></button>
|
|
139
|
+
<div class="filters">
|
|
140
|
+
<div class="filter-row"><div class="select-wrap"><select id="source" data-source-icons="/sources" aria-label="Session source"><option value="">All sources</option></select>${W("chevron-down")}</div><button class="icon-button" id="manage-sources" aria-label="Manage sources" title="Import sources">${W("sliders-horizontal")}</button></div>
|
|
141
|
+
<div class="select-wrap">${W("folder")}<select id="project" aria-label="Project"><option value="">All projects</option></select>${W("chevron-down")}</div>
|
|
142
|
+
<div class="select-wrap">${W("git-branch")}<select id="directory" aria-label="Worktree or directory"><option value="">All directories</option></select>${W("chevron-down")}</div>
|
|
143
|
+
<div class="filter-toggles"><label><input type="checkbox" id="children" checked/><span>Subagent sessions</span></label></div>
|
|
144
|
+
</div>
|
|
145
|
+
<nav class="session-list" id="session-list" aria-label="Sessions"><div class="list-loading">${[0,1,2,3,4].map(()=>'<div class="skeleton"></div>').join("")}</div></nav>
|
|
146
|
+
</aside>
|
|
147
|
+
<div class="inspector-stack floating-panel" id="inspector" hidden><aside class="inspector glass" id="session-inspector" aria-label="Session details"></aside></div>
|
|
148
|
+
<div class="timeline-dock floating-panel" id="timeline">
|
|
149
|
+
<div class="playback-share"><button id="share-playback" class="primary-button" disabled>${W("share-2")}Share SessionGraph</button></div>
|
|
150
|
+
<section class="timeline-panel glass timeline-controls" aria-label="Timeline controls">
|
|
151
|
+
${Cg(`<span class="panel-title" id="date-label">Timeline</span><div class="range-buttons" role="group" aria-label="Date range"><button data-days="7">7D</button><button data-days="30">30D</button><button data-days="90">90D</button><button data-days="ytd" class="active" title="Year to date" aria-pressed="true">YTD</button><button data-days="0">All</button></div><div class="custom-dates"></div><button class="icon-button" id="close-timeline" aria-label="Close timeline">${W("x")}</button>`,{play:"play",histogram:"histogram",scrubber:"scrubber",cursor:"timeline-cursor",date:"playback-date",period:"playback-period",summary:"playback-summary",sessions:"playback-sessions",tokens:"playback-tokens"},{showCoverage:!1})}
|
|
152
|
+
</section>
|
|
153
|
+
</div>
|
|
154
|
+
${yu("help-dialog",["search","fit","panels","clear"],`
|
|
155
|
+
<div class="graph-legend"><span><i class="legend-node"></i>Session orb</span><span><i class="legend-node message"></i>Message</span><span><i class="legend-line lane"></i>Session lifetime</span><span><i class="legend-line fork"></i>Fork</span><span><i class="legend-line child"></i>Child</span><span id="file-legend" hidden><i class="legend-file"></i>File</span></div>
|
|
156
|
+
<p>Search also opens with ⌘/Ctrl K. Each trail follows a session to its latest saved message. Only fork and child links represent ancestry.</p>`)}
|
|
157
|
+
<div id="toast" class="toast" role="status" hidden></div>
|
|
158
|
+
${gu(["search","fit","panels","clear"],"shortcut-hints")}
|
|
159
|
+
`;He();const xn=new Lu(I("#session-list"),{key:e=>"session"in e?`session:${e.session.id}`:`date:${e.year}:${e.label}`,estimate:e=>"session"in e?Z.density==="compact"?66:76:42,render:e=>{const t=document.createElement("template");if("session"in e){const n=e.session,s=Gt(n);t.innerHTML=`<button class="session-card ${Y===n.id?"selected":""}" data-session="${X(n.id)}" aria-pressed="${Y===n.id}" title="${X(n.title)}"><span class="session-dot" style="--node-color:${id.get(n.id)}"></span><span class="session-card-body"><span class="session-title">${X(n.title)}</span><span class="session-meta">${n.forkID?W("git-fork"):n.parentID?W("network"):""}<span class="source-badge" data-source="${X(n.source||"opencode")}">${vn(n.source)}${X(Ne(n.source))}</span><span title="${n.activity?.lastMessageAt?"Latest saved message":"Session created; message time unavailable"}">${_y.format(s)}</span></span></span></button>`}else t.innerHTML=`<div class="list-date">${e.label}<span>${e.year}</span></div>`;return t.content.firstElementChild}});Wg();ag();const dd=Cy(I(".custom-dates"),(e,t)=>{Jt=0,Mt=e,At=t,qe(!0)},ge),Rt=()=>{const e=!!document.querySelector("dialog[open]");e&&Ot&&ge(),Q?.setSuspended(e)},Ai=new Pg,Xe=Tg(I("#tooltip"),I("#scene"),Ai);let Zo;const Tn=Ig(I("#inspector"),Ai,{select:e=>{const t=e?.sessionID===Y?e:null;Xe.clear(),Q?.selectEvent(t?.id||null),t&&!Ot&&(ce=1,An(),Q?.focusEvent(Me?.items.find(n=>n.id===t.id)||t))}});function Oi(e){const t=G?.sessions.find(n=>n.id===Y);t&&(Xe.clear(),ge(),pe("inspector",!0),Tn.open(t,e,e?Me?.revision:void 0,Me?.items.find(n=>n.id===e)?.kind==="commit"?"tools":"messages"))}const Mn=xg({publishing:Nr,change:ud,getArchived:()=>Xt,changeArchived:e=>{Xt=e,qe()},visibility:Rt,previewSound:()=>{pr.play("select")},getSources:()=>kt.sources(),importSources:e=>kt.select(e)}),pr=new $g(Z,Mn.audioStatus);function ws(){Q?.applyPreferences(Z),pr.configure(Z);const e=document.documentElement.dataset.density!==Z.density;document.documentElement.dataset.density=Z.density,e&&xn.resetHeights(),document.documentElement.dataset.motion=String(Sg(Z,ld.matches)),document.documentElement.style.setProperty("--panel-opacity",`${Z.panelOpacity}%`);const t=I("#mute-audio"),n=mu(Z.muted);t.setAttribute("aria-pressed",String(Z.muted)),t.setAttribute("aria-label",n.label),t.title=n.label,t.innerHTML=W(n.glyph),Mn.render(Z,Qt||ms,mt?.state||"saved"),He()}function ud(e){const t=e.autoImport!==void 0&&e.autoImport!==Z.autoImport;Z=Mr({...Z,...e});try{Qt=pl(localStorage,Z)}catch{Qt=!1}ws(),G&&Z.grouping!==mn&&qe(!0),Di({preferences:{...Z},...t?{autoImport:Z.autoImport}:{}})}function Di(e){mt?.save(e)}function zo(){return{sourceID:En,projectID:wt,directory:Je,days:Jt,fromDate:Mt,toDate:At,includeChildren:Sn,includeArchived:Xt}}I("#open-settings").addEventListener("click",()=>Mn.open());I("#mute-audio").addEventListener("click",()=>ud({muted:!Z.muted}));const By=()=>ws();ld.addEventListener("change",By);const Uy=e=>{if(e.key===vi)try{Z={...fl(localStorage),autoImport:Z.autoImport},ws(),G&&Z.grouping!==mn&&qe(!0)}catch{}};window.addEventListener("storage",Uy);ws();mt=new pg(async e=>{if(!(await fetch("/api/sessiongraph/settings",{method:"POST",headers:{"Content-Type":"application/json","X-SessionGraph-Action":"settings"},body:JSON.stringify(e),signal:AbortSignal.timeout(15e3),keepalive:!0})).ok)throw new Error("Could not save library settings.")},e=>{Mn.render(Z,Qt||ms,e),e==="error"&&Vt("Changes applied, but could not save to the local library. Retrying when you return."),e==="saved"&&Pr?.check()});const qy=cg(Rt),kt=dg(e=>Ni(e),Rt,Vt);Pr=new fg({eligible:()=>Z.autoImport&&!mt?.pending&&document.visibilityState==="visible"&&!!(G&&!G.onboarding&&G.sources?.some(e=>e.selected)),busy:()=>kt.busy||!!document.querySelector("dialog[open]"),refresh:()=>kt.refresh(!0)});const Rr=new AbortController,ks=()=>{document.visibilityState==="visible"&&(mt?.state==="error"&&mt.flush(),Pr?.check())};window.addEventListener("focus",ks,{signal:Rr.signal});document.addEventListener("visibilitychange",ks,{signal:Rr.signal});window.setInterval(ks,ug);I("#manage-sources").addEventListener("click",()=>Mn.open("sources"));document.addEventListener("sessiongraph-import-status",e=>{const t=e.detail;Pr?.activity(),Mn.importStatus(t),G&&(G.importing=t.running),fe.length||Vr(),I("#refresh").classList.toggle("spinning",t.running),I(".connection").title=t.running?`Importing ${Ne(t.source)} · ${t.imported} sessions saved`:t.failed?"Import unavailable · open Manage sources for details":"Local library · SQLite"},{signal:Rr.signal});const Pi=$u(On,Rt,e=>{qy.open(e)});I("#search").addEventListener("click",Pi.open);function pe(e,t){Ot&&(e==="timeline"?!t:t)&&ge();const n=I(`#${e}`);n.hidden=!t,I(`#toggle-${e}`).setAttribute("aria-expanded",String(t)),t&&innerWidth<760&&e!=="timeline"&&pe(e==="explorer"?"inspector":"explorer",!1)}pe("explorer",innerWidth>=760);let mo=[];for(const e of["explorer","timeline","inspector"])I(`#toggle-${e}`).addEventListener("click",()=>pe(e,I(`#${e}`).hidden));I("#close-explorer").addEventListener("click",()=>{pe("explorer",!1),I("#toggle-explorer").focus()});I("#close-timeline").addEventListener("click",()=>{ge(),pe("timeline",!1),I("#toggle-timeline").focus()});function Vt(e){I("#toast").textContent=e,I("#toast").hidden=!1,window.setTimeout(()=>{I("#toast").hidden=!0},3500)}function Ri(){Zo?.(),pe("inspector",!1),Tn.close(),Xe.clear(),I("#session-inspector").replaceChildren(),I("#toggle-inspector").hidden=!0}Ri();async function Gy(){try{const{TimelineScene:e}=await mr(async()=>{const{TimelineScene:t}=await import("./scene-DmT4K5Nj.js");return{TimelineScene:t}},__vite__mapDeps([1,2]));Q=new e(I("#scene"),{onSelect:t=>{t?(pr.play("select"),On(t)):Wi()},onPlaybackInterrupt:ge,onEvent:t=>{pr.play("select"),Oi(t)},onEventHover:(t,n,s,r)=>{es=void 0,t&&Y&&Me?Xe.show(t,Y,Me.revision,n,s,r):Xe.clear()},onHover:(t,n,s)=>{const r=I("#tooltip");r.classList.contains("message-tooltip")&&(Xe.clear(),es=void 0),r.hidden!==!t&&(r.hidden=!t),t&&(es!==t.session&&(es=t.session,r.innerHTML=`<strong>${X(t.session.title)}</strong><span>${X(Ne(t.session.source))} · ${t.session.activity?.lastMessageAt?`Last message ${hr(t.session.activity.lastMessageAt)}`:"Message time unavailable"}<br>Started ${hr(t.session.created)}</span>`),r.style.left=`${Math.min(n+18,I("#scene").clientWidth-280)}px`,r.style.top=`${Math.max(8,Math.min(s-32,I("#scene").clientHeight-110))}px`)}},{panels:[I("#explorer"),I("#inspector"),I("#timeline")]}),Q.applyPreferences(Z),Q.setSuspended(!!document.querySelector("dialog[open]")),G&&(Q.setGraph(se,!0),Y&&(Q.select(Y),Q.focus(Y)),ze&&Q.setFiles(ze.files),Me&&Q.setEvents(Me.items))}catch(e){console.error("[sessiongraph] Graphics initialization failed",e),Vt("3D requires WebGL. You can still browse sessions in the list.")}finally{ad=!1,G&&Vr()}}I("#scene").addEventListener("scene-error",e=>Vt(e.detail));async function Vi(e,t){const n=AbortSignal.timeout(18e4),s=await fetch(e,{signal:t?AbortSignal.any([t,n]):n}),r=await s.json();if(!s.ok)throw new Error(r.error||"Request failed.");return r}async function Ni(e=!1){const t=I("#refresh");t.disabled=!0,t.classList.add("spinning");try{const n=mt?.revision,s=await Vi("/api/sessiongraph"),r=G,o=Y?os.get(Y):void 0,i=!!(r&&se.nodes.length);if(G=s,!mt?.pending&&n===mt?.revision){Z={...Mr(s.preferences||Z),autoImport:s.autoImport===!0};try{Qt=pl(localStorage,Z)}catch{Qt=!1}if(!ms){const c=mg(s.viewState);({sourceID:En,projectID:wt,directory:Je,days:Jt,fromDate:Mt,toDate:At,includeChildren:Sn,includeArchived:Xt}=c),I("#children").checked=Sn,Ko=JSON.stringify(c),s.preferences||Di({preferences:{...Z}})}ws()}if(ms=!0,I("#connection-label").textContent="Local library",I(".connection").classList.add("connected"),I(".connection").title=`Connected · ${le(G.sessions.length)} sessions`,r&&Z.grouping===mn&&JSON.stringify(r.sessions)===JSON.stringify(s.sessions)&&JSON.stringify(r.projects)===JSON.stringify(s.projects)){Vr();return}Ai.clear(),os=new Map(G.sessions.map(c=>[c.id,c])),I("#source").innerHTML='<option value="">All sources</option>'+(G.sources||[]).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${c.sessions.toLocaleString()}</option>`).join(""),I("#source").value=En,Pi.setData(G);const a=new Map;if(G.sessions.forEach(c=>a.set(c.projectID,(a.get(c.projectID)||0)+1)),I("#project").innerHTML='<option value="">All projects</option>'+[...G.projects].filter(c=>a.has(c.id)).sort((c,l)=>(a.get(l.id)||0)-(a.get(c.id)||0)).map(c=>`<option value="${X(c.id)}">${X(c.name)} · ${le(a.get(c.id)||0)}</option>`).join(""),I("#project").value=wt,Fi(),Y&&!r){const c=G.sessions.find(u=>u.id===Y),{min:l,max:h}=ll(zo());c&&(c.created<l||c.created>h)&&(Jt=0,Mt="",At=""),c?.archived&&(Xt=!0)}if(qe(!i,i),Y&&!r)On(Y);else if(Y){const c=os.get(Y);if(c&&JSON.stringify(o)!==JSON.stringify(c)){const l=I(".detail-scroll")?.scrollTop||0;ze=void 0,Me=void 0,gd(c,!1),I(".detail-scroll").scrollTop=l,gr(c.id),ji(c)}}else Ri();!e&&G.warnings.length&&Vt(G.warnings.join(" ")),!e&&G.onboarding&&kt.open(!0)}catch(n){if(e&&G){I(".connection").title="Library refresh unavailable · retry with Refresh sessions";return}I("#connection-label").textContent="Connection unavailable",I(".connection").title="Connection unavailable",I(".connection").classList.remove("connected"),I("#graph-message").hidden=!1,I("#graph-message").innerHTML=`${W("terminal")}<h3>Local library unavailable</h3><p>${X(n instanceof Error?n.message:"Unable to connect.")}</p><button class="primary-button" id="retry">Retry ${W("arrow-right")}</button>`,I("#retry").addEventListener("click",()=>{Ni().then(ks)}),G||(I("#session-list").innerHTML='<p class="empty-list">Your sessions will appear here once connected.</p>',I("#list-count").textContent="Offline"),He()}finally{t.disabled=!1,t.classList.remove("spinning")}}function Fi(){const e=G?.sessions.filter(s=>!wt||s.projectID===wt)||[],t=[...new Set(e.map(s=>s.directory))].sort((s,r)=>xt(s).localeCompare(xt(r))),n=new Set(G?.projects.flatMap(s=>s.worktrees));I("#directory").innerHTML='<option value="">All directories</option>'+t.map(s=>`<option value="${X(s)}">${n.has(s)?"⑂ ":""}${X(xt(s))}</option>`).join(""),t.includes(Je)||(Je=""),I("#directory").value=Je}let mn;function qe(e=!1,t=!1){if(!G)return;mn!==Z.grouping&&(e=!0,t=!1),mn=Z.grouping,t||(ge(),ce=1);const n=document.activeElement?.closest("[data-session]")?.dataset.session,{min:s,max:r}=ll(zo());fe=G.sessions.filter(a=>Eg(a,En)&&(!wt||a.projectID===wt)&&(!Je||a.directory===Je)&&(Sn||!a.parentID||!!a.forkID)&&(Xt||!a.archived)&&a.created>=s&&a.created<=r),Ti=[...fe].sort((a,c)=>Gt(c)-Gt(a)),od=new Set(fe.map(a=>a.id)),Pi.setScope(fe.map(a=>a.id)),se=dc(fe,G.projects,t?se:void 0,mn),id=new Map(se.nodes.map(a=>[a.session.id,a.color])),Q?.setCutoff(ce),Q?.setGraph(se,e,t),Vr(),document.querySelectorAll("[data-days]").forEach(a=>{const c=!Mt&&!At&&a.dataset.days===String(Jt);a.classList.toggle("active",c),a.setAttribute("aria-pressed",String(c))}),Yy(t),t&&n&&xn.getElement(gs.get(n))?.focus({preventScroll:!0}),Ky(),Y&&!fe.some(a=>a.id===Y)?Wi():Y&&ze&&Q?.setFiles(ze.files),Y&&Me&&Q?.setEvents(Me.items),He();const o=zo(),i=JSON.stringify(o);ms&&i!==Ko&&(Ko=i,Di({viewState:o}))}function Vr(){Hi();const e=I("#graph-message");e.hidden=!!(fe.length&&Q),fe.length?Q||(e.innerHTML=ad?"<h3>Preparing the map…</h3>":`${W("box")}<h3>WebGL is unavailable.</h3><p>You can explore every session and its file details in the list.</p>`):e.innerHTML=G?.importing?'<div class="loading-orbit"><span></span><span></span><span></span></div><h3>Importing your sessions…</h3><p>Your map will appear when the import finishes.</p>':G&&!G.sessions.length?`${W("folder")}<h3>Your map starts here</h3><p>Choose a source with saved conversations to get started.</p><button class="primary-button" id="empty-sources">Choose sources ${W("arrow-right")}</button>`:`${W("search")}<h3>No matching sessions</h3><button class="text-button" id="clear-filters">Reset filters ${W("rotate-ccw")}</button>`,I("#clear-filters")?.addEventListener("click",()=>hd()),I("#empty-sources")?.addEventListener("click",()=>{kt.open()}),He()}function Hi(e=!1){const t=!!(fe.length&&Q);(e||!t)&&(window.clearTimeout(qn),qn=0,Gn=!1),I(".playback-share").classList.toggle("ready",Gn&&t),I("#share-playback").disabled=!Gn||!t,t&&!Gn&&!qn&&(qn=window.setTimeout(()=>{qn=0,Gn=!0,Hi()},1e3))}function hd(e){En="",I("#source").value="",wt="",Je="",Jt=e?0:gi.days,Mt="",At="",Sn=!0,Xt=e?.archived===!0,I("#project").value="",I("#children").checked=!0,dd.setRange("",""),Fi(),qe(!0)}function Yy(e=!1){I("#list-count").textContent=le(fe.length);const t=[];gs=new Map;let n="";for(const s of Ti){const r=Gt(s),o=ps(r,!0);o!==n&&t.push({label:ps(r),year:new Date(r).getFullYear()}),n=o,gs.set(s.id,t.length),t.push({session:s})}xn.setItems(t,e),I("#session-list").querySelector(".empty-list")?.remove(),t.length||I("#session-list").insertAdjacentHTML("beforeend",'<p class="empty-list">No sessions match your filters.</p>')}function fd(e){for(const t of[e,Y]){const n=t?xn.getElement(gs.get(t)):void 0;n&&(n.classList.toggle("selected",t===Y),n.setAttribute("aria-pressed",String(t===Y)))}}function Ky(){ot=dl(fe),cd=hl(fe),Yo="";const e=kg(fe.map(Gt),se.start,se.end),t=Math.max(...e,1);I("#histogram").innerHTML=e.map(n=>`<span style="height:${Math.max(4,n/t*100)}%;opacity:${n?.8:.15}" title="${n} session endpoints"></span>`).join(""),I("#date-label").textContent=se.start?`${ps(se.start,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear())} — ${ps(se.end,!0)}`:"No sessions",se.start&&dd.setRange(Mt||ic(se.start),At||ic(se.end)),An()}function An(e=!1){I("#scrubber").value=String(Math.round(ce*1e3)),I("#timeline-cursor").style.left=`${ce*100}%`,I("#histogram").style.setProperty("--progress",`${ce*100}%`);const t=se.start+(se.end-se.start)*ce;I("#playback-date").textContent=se.start?ps(t,new Date(se.start).getFullYear()!==new Date(se.end).getFullYear()):"—";const n=se.nodes.length?wg(t,se.end-se.start):"—";I("#playback-period").textContent!==n&&(I("#playback-period").textContent=n);const s=ot.at(t,ce>=1),r=cd(t,ce>=1),o=`${s.tokens}:${s.sessions}:${r}`;o!==Yo&&(Yo=o,I("#playback-summary").hidden=fe.length===0,I("#playback-sessions").textContent=le(r),I("#playback-tokens").textContent=ot.recorded?rd(s.tokens):"—",I("#playback-summary").title=`${le(r)} sessions started. ${ot.recorded?`${le(s.tokens)} burnt tokens`:"Token usage unavailable"}. Token totals are added at the latest saved message, including cache where reported. ${le(ot.missing)} sessions have no recorded total.${ot.partial?` ${le(ot.partial)} recorded totals are partial.`:""}${ot.untimed?` ${le(ot.untimed)} totals have no message timestamp and are included only at the end.`:""}`),Q?.setCutoff(ce,e)}function ge(){if(Ot=!1,is=0,I("#app").classList.remove("playback-mode"),Js){const e=Js;Js=void 0,pe("explorer",e.explorer),pe("inspector",e.inspector&&!!Y)}Q?.setPlaying(!1),cancelAnimationFrame(Mi),I("#play").innerHTML=W("play"),I("#play").setAttribute("aria-label","Play timeline"),He()}function pd(e){if(!Ot)return;const t=Math.max(0,e-fr);fr=e,document.hidden||(ce<1?ce=Math.min(1,ce+t*Z.playbackSpeed/mi):is+=t),An(),Q?.setPlaybackOutro(ce>=1?Math.min(1,is/us):null),ce>=1&&is>=us+ul?ge():Mi=requestAnimationFrame(pd)}function Wi(){const e=Y;qo?.abort(),Go?.abort(),I("#file-legend").hidden=!0,zs++,Zs++,Y=null,ze=void 0,Me=void 0,Q?.select(null),history.replaceState(null,"",location.pathname),Ri(),fd(e)}const as=3;function Zy(e,t,n){const s=t.forkID?[{id:t.forkID,label:"Forked from",kind:"git-fork"}]:t.parentID?[{id:t.parentID,label:"Parent",kind:"network"}]:[],r=G.sessions.filter(c=>c.forkID===t.id||!c.forkID&&c.parentID===t.id),o=[...s,...r.map(c=>({id:c.id,label:c.forkID?"Fork":"Child",kind:c.forkID?"git-fork":"network"}))];if(!o.length){e.hidden=!0;return}const i=c=>(c?o:o.slice(0,as)).map(l=>{const h=os.get(l.id);return`<button class="relation" data-related="${X(l.id)}" ${h?"":"disabled"}>${W(l.kind)}<span><small>${l.label}</small><strong>${X(h?.title||"Session no longer available")}</strong></span>${W("arrow-up-right")}</button>`}).join(""),a=c=>c?"Show fewer connections":`Show all ${le(o.length)} connections`;e.innerHTML=`<div class="section-label">Connections<span>${le(o.length)}</span></div><div id="connection-list">${i(n)}</div>
|
|
160
|
+
${o.length>as?`<button class="load-more" id="toggle-connections" type="button" aria-controls="connection-list" aria-expanded="${n}">${a(n)}</button>`:""}`,e.querySelector("#toggle-connections")?.addEventListener("click",c=>{const l=c.currentTarget,h=l.getAttribute("aria-expanded")!=="true";e.querySelector("#connection-list").innerHTML=i(h),l.setAttribute("aria-expanded",String(h)),l.textContent=a(h),h||l.scrollIntoView({block:"nearest"}),He()})}function gd(e,t=!0){const n=G.projects.find(c=>c.id===e.projectID),s=e.forkID?"Fork":e.parentID?"Child session":"Session",r=n?.worktrees.includes(e.directory),o=t?!0:I("#session-inspector").querySelector(".session-info")?.open??!0,i=!t&&I("#toggle-connections")?.getAttribute("aria-expanded")==="true",a=[["folder","Project",n?.name||"Unknown"],["cpu","Model",e.model],["bot","Agent",e.agent||"Unknown"],["coins",e.usage?.partial?"Recorded tokens (partial)":"Recorded tokens",e.tokens===null?"Not recorded":rd(e.tokens)],["dollar-sign",e.usage?.costEstimated?"Cost (harness estimate)":"Recorded cost",e.cost===null?"Not recorded":`$${e.cost.toFixed(2)}`]];I("#session-inspector").innerHTML=`
|
|
161
|
+
<div class="panel-heading"><span class="panel-title">${s}</span><button id="close-inspector" class="icon-button" aria-label="Close session details">${W("x")}</button></div>
|
|
162
|
+
<div class="detail-scroll">
|
|
163
|
+
<div class="detail-title"><span class="source-badge" data-source="${X(e.source||"opencode")}">${vn(e.source)}${X(Ne(e.source))}</span><h2>${X(e.title)}</h2><div class="detail-title-meta"><span class="detail-date">${hr(e.created)}</span><button id="focus-session" class="icon-button" title="Focus node" aria-label="Focus node">${W("crosshair")}</button></div></div>
|
|
164
|
+
<section id="message-detail" class="detail-section"></section>
|
|
165
|
+
${pu(a,`<div class="directory-card"><span>${W(r?"git-branch":"folder")}${r?"Worktree":"Directory"}</span><code>${X(e.directory)}</code></div>`,o)}
|
|
166
|
+
<section id="commit-detail" class="detail-section"></section>
|
|
167
|
+
<section id="pull-request-detail" class="detail-section" hidden></section>
|
|
168
|
+
${e.linkedSessionIDs?.length?`<section class="detail-section"><div class="section-label">Linked provider history</div>${e.linkedSessionIDs.map(c=>`<button class="relation" data-history="${X(c)}">${vn(c.split(":")[0])}<span>${X(Ne(c.split(":")[0]))}</span>${W("arrow-up-right")}</button>`).join("")}</section>`:""}
|
|
169
|
+
<div id="file-detail"><section class="detail-section"><div class="section-label">Changed files</div><div class="detail-loading">${W("loader-circle","spinning")}Loading changes…</div></section></div>
|
|
170
|
+
<section id="session-connections" class="detail-section"></section>
|
|
171
|
+
<div id="session-tools"></div>
|
|
172
|
+
</div>
|
|
173
|
+
`,I("#toggle-inspector").hidden=!1,t&&pe("inspector",!0),I("#close-inspector").addEventListener("click",()=>{pe("inspector",!1),I("#toggle-inspector").focus()}),I("#focus-session").addEventListener("click",()=>{ge(),Q?.focus(e.id)}),Zy(I("#session-connections"),e,i),md(),Zo?.(),Zo=Ag(I("#commit-detail"),e.id,(c,l)=>{Xe.clear(),ge(),Tn.open(e,c,l,"tools")}),He()}function md(e){const t=e?.items.filter(s=>s.kind==="commit").length??0,n=e?[`${le(e.total)} ${e.total===1?"message":"messages"}`,t?`${le(t)} ${t===1?"commit marker":"commit markers"}`:"",e.limited?"Map limit reached":""].filter(Boolean):["Loading messages…"];I("#message-detail").innerHTML=`<div class="section-label">Session timeline</div><div class="event-key"><span style="--event-color:#ffffff"><i></i>User & assistant messages</span></div><p class="coverage-note">${n.map(X).join(" · ")}</p><button class="secondary-button explore-events">Explore messages ${W("arrow-right")}</button>`,I(".explore-events").addEventListener("click",()=>Oi()),He()}async function ji(e,t=!1){const n=++Zs;Go?.abort();const s=new AbortController;Go=s;try{const r=await Vi(`/api/sessiongraph/session/${encodeURIComponent(e.id)}/event-markers`,s.signal);if(s.signal.aborted||n!==Zs||Y!==e.id)return;Me=r,Q?.setEvents(r.items,t),md(r)}catch{if(s.signal.aborted||n!==Zs||Y!==e.id)return;I("#message-detail").innerHTML='<div class="section-label">Session timeline</div><p class="coverage-note">Message timing unavailable.</p><button class="secondary-button explore-events">Explore messages</button><button class="load-more" id="retry-timeline">Retry message markers</button>',I(".explore-events").addEventListener("click",()=>Oi()),I("#retry-timeline").addEventListener("click",()=>{ji(e)})}}function zy(e,t){const n=new Map(e.files.map(r=>[r.path,{...r}]));for(const r of t.files){const o=n.get(r.path);n.set(r.path,{...r,steps:(o?.steps||0)+r.steps,source:o?.source==="snapshot"?"snapshot":r.source})}const s=new Map(e.tools.map(r=>[r.name,r.count]));return t.tools.forEach(r=>s.set(r.name,(s.get(r.name)||0)+r.count)),{...t,pullRequests:t.pullRequests??e.pullRequests,files:[...n.values()].sort((r,o)=>o.steps-r.steps||r.path.localeCompare(o.path)),tools:[...s].map(([r,o])=>({name:r,count:o})).sort((r,o)=>o.count-r.count),locations:[...e.locations,...t.locations],messagesScanned:e.messagesScanned+t.messagesScanned,snapshotSteps:e.snapshotSteps+t.snapshotSteps}}function cc(e){const t=I("#pull-request-detail"),n=e.pullRequests||[];t.hidden=!n.length,t.innerHTML=n.length?`<div class="section-label">Pull requests<span>${le(n.length)}</span></div>${n.map(l=>`<a class="relation" href="${X(l.url)}" target="_blank" rel="noopener noreferrer">${W("git-branch")}<span><small>${X(l.host)}</small><strong>${X(l.repository)} #${l.number}</strong></span>${W("arrow-up-right")}</a>`).join("")}`:"",ss()&&t.querySelectorAll("a").forEach(l=>l.addEventListener("click",h=>{h.preventDefault(),vl(l.href).catch(()=>Vt("Could not open the pull request in your browser."))}));const s=e.files,r=I("#file-detail"),o=I("#session-tools"),i=o.querySelector("details")?.open??!1,a=r.querySelector("#toggle-files")?.getAttribute("aria-expanded")==="true",c=l=>l.map(h=>`<li title="${X(h.path)} · ${h.source}">${W("file-code-2")}<div><strong>${X(xt(h.path))}</strong>${h.path.includes("/")?`<span>${X(h.path.slice(0,h.path.lastIndexOf("/")))}</span>`:""}</div><small>${h.steps}×</small></li>`).join("");I("#file-legend").hidden=!s.length,r.innerHTML=`
|
|
174
|
+
<section class="detail-section"><div class="section-label">Changed files<span>${le(s.length)}${e.partial?"+":""}</span></div>
|
|
175
|
+
${s.length?`<ul class="file-list" id="changed-file-list">${c(a?s:s.slice(0,as))}</ul>`:'<div class="no-files"><p>No file changes found.</p></div>'}
|
|
176
|
+
${s.length>as?`<button class="load-more" id="toggle-files" type="button" aria-controls="changed-file-list" aria-expanded="${a}">${a?"Show fewer files":`Show all ${le(s.length)} files`}</button>`:""}
|
|
177
|
+
${e.partial||!e.snapshotSteps||s.length>80?`<details class="file-coverage"><summary>File coverage</summary><p class="coverage-note">${[e.partial?"Some changes may be missing.":"",e.snapshotSteps?"":"Snapshots unavailable.",s.length>80?"80 files shown on the map.":""].filter(Boolean).join(" ")}</p></details>`:""}
|
|
178
|
+
${e.nextCursor?'<p class="coverage-note" id="history-loading" role="status">Loading full history…</p>':""}</section>
|
|
179
|
+
${e.locations.length?`<details class="more-details detail-section"><summary>Directory moves ${W("chevron-down")}</summary>${e.locations.map(l=>`<div class="location-entry"><span>${hr(l.time)}</span><code>${X(l.directory)}</code></div>`).join("")}</details>`:""}
|
|
180
|
+
`,o.innerHTML=e.tools.length?`<details class="more-details detail-section"${i?" open":""}><summary>Tools used <span>${le(e.tools.reduce((l,h)=>l+h.count,0))}</span>${W("chevron-down")}</summary><div class="tools-list">${e.tools.slice(0,12).map(l=>`<div><span>${X(l.name)}</span><strong>${l.count}</strong></div>`).join("")}</div></details>`:"",r.querySelector("#toggle-files")?.addEventListener("click",l=>{const h=l.currentTarget,u=h.getAttribute("aria-expanded")!=="true";I("#changed-file-list").innerHTML=c(u?s:s.slice(0,as)),h.setAttribute("aria-expanded",String(u)),h.textContent=u?"Show fewer files":`Show all ${le(s.length)} files`,u||h.scrollIntoView({block:"nearest"}),He()}),Q?.setFiles(s),He()}async function gr(e){const t=++zs;qo?.abort();const n=new AbortController;qo=n;let s,r;const o=new Set;try{do{const i=await Vi(`/api/sessiongraph/session/${encodeURIComponent(e)}${s?`?cursor=${encodeURIComponent(s)}`:""}`,n.signal);if(n.signal.aborted||t!==zs||Y!==e)return;if(r&&i.revision!==r.revision)throw new Error("History changed. Retry to load the latest version.");if(r=r?zy(r,i):i,ze=r,!s||!i.nextCursor?cc(r):I("#history-loading")&&(I("#history-loading").textContent=`Loading full history… ${le(r.messagesScanned)} messages`),s=i.nextCursor||void 0,s&&o.has(s))throw new Error("History could not be loaded. Please retry.");s&&o.add(s)}while(s)}catch(i){if(n.signal.aborted||t!==zs||Y!==e)return;if(ze){cc(ze);const a=I("#history-loading");a&&(a.innerHTML='History loading interrupted. <button class="text-button" id="retry-detail">Retry</button>'),I("#retry-detail")?.addEventListener("click",()=>{gr(e)})}else I("#file-detail").innerHTML=`<section class="detail-section"><div class="section-label">Changed files</div><p class="coverage-note">${X(i instanceof Error?i.message:"Details unavailable.")}</p><button class="load-more" id="retry-detail">Retry file details</button></section>`,I("#retry-detail").addEventListener("click",()=>gr(e))}}function On(e){const t=os.get(e);if(!t)return;const n=Y;Tn.close(),Xe.clear(),od.has(e)||hd(t),ge(),ce=1,An(),Y=e,ze=void 0,Me=void 0,I("#file-legend").hidden=!0,history.replaceState(null,"",`?session=${encodeURIComponent(e)}`),Q?.select(e),gd(t),Q?.focus(e),fd(n),gr(e),ji(t,!0)}I("#session-list").addEventListener("click",e=>{const t=e.target.closest("[data-session]");t?.dataset.session&&On(t.dataset.session)});I("#inspector").addEventListener("click",e=>{const t=e.target.closest("[data-history]")?.dataset.history;if(t){Xe.clear(),ge(),pe("inspector",!0),Tn.open({id:t,source:t.split(":")[0]});return}const n=e.target.closest("[data-related]");n?.dataset.related&&On(n.dataset.related)});I("#project").addEventListener("change",e=>{wt=e.target.value,Je="",Fi(),qe(!0)});I("#source").addEventListener("change",e=>{En=e.target.value,qe(!0)});I("#directory").addEventListener("change",e=>{Je=e.target.value,qe(!0)});I("#children").addEventListener("change",e=>{Sn=e.target.checked,qe()});document.querySelectorAll("[data-days]").forEach(e=>e.addEventListener("click",()=>{Jt=e.dataset.days==="ytd"?"ytd":Number(e.dataset.days),Mt="",At="",qe(!0)}));I("#reset-camera").addEventListener("click",()=>{ge(),Q?.reset()});I("#refresh").addEventListener("click",()=>{G?.onboarding?kt.open(!0):kt.refresh()});I("#scrubber").addEventListener("input",e=>{ge(),ce=Number(e.target.value)/1e3,An(!0)});I("#play").addEventListener("click",()=>{if(fe.length){if(Ot)return ge();ce>=1&&(ce=0),An(),Js={explorer:!I("#explorer").hidden,inspector:!I("#inspector").hidden},pe("explorer",!1),pe("inspector",!1),pe("timeline",!0),Xe.clear(),es=void 0,I("#app").classList.add("playback-mode"),Hi(!0),Ot=!0,is=0,Q?.setPlaying(!0),fr=performance.now(),I("#play").innerHTML=W("pause"),I("#play").setAttribute("aria-label","Pause timeline"),He(),Mi=requestAnimationFrame(pd)}});document.addEventListener("visibilitychange",()=>{fr=performance.now()},{signal:Rr.signal});async function Jy(){const e=I("#share-playback");e.disabled=!0;try{if(!go){const{createPlaybackShare:t}=await mr(async()=>{const{createPlaybackShare:n}=await import("./share-DrezE0sG.js");return{createPlaybackShare:n}},__vite__mapDeps([4,1,2]));go=t(Rt,()=>{Nr()})}se.nodes.length&&go.open(se,Z)}catch{Vt("Could not open video sharing. Please try again.")}finally{e.disabled=!fe.length||!Q}}async function Nr(){try{ac??=Vy(Rt,()=>{Jy()},Hy),await ac.open(fe.map(e=>e.id))}catch{Vt("Could not open publishing. Please try again.")}}I("#share-playback").addEventListener("click",Nr);I("#open-publishing").addEventListener("click",Nr);I("#help").addEventListener("click",()=>{I("#help-dialog").showModal(),Rt()});I("#help-dialog").addEventListener("close",Rt);I("#help-dialog [data-close-help]").addEventListener("click",()=>I("#help-dialog").close());document.addEventListener("keydown",e=>{if(!e.defaultPrevented&&!document.querySelector("dialog[open]")){if(Ot&&e.key==="Escape"){e.preventDefault(),ge();return}if(!Tn.handleKey(e)){if(e.key==="Escape"){Y?Wi():pe("explorer",!1);return}if(!(e.target.matches("input, select, textarea")||e.metaKey||e.ctrlKey||e.altKey)){if(["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(e.key)&&!e.target.closest('[contenteditable="true"]')){const t=e.target;if(t.matches("canvas, body, .session-card")||t.closest(".session-card")){const n=Ti,s=n.findIndex(i=>i.id===Y),r=e.key==="ArrowLeft"||e.key==="ArrowUp"?-1:1,o=n[Math.max(0,Math.min(n.length-1,s+r))];if(o&&(e.preventDefault(),On(o.id),t.closest(".session-card"))){const i=gs.get(o.id);xn.scrollToIndex(i),xn.getElement(i)?.focus({preventScroll:!0})}return}}if(e.key.toLowerCase()==="f"&&(ge(),Q?.reset()),e.key.toLowerCase()==="h"){ge();const t=["explorer","timeline","inspector"].filter(n=>!I(`#${n}`).hidden);t.length?(mo=t,t.forEach(n=>pe(n,!1))):(mo.length?mo:["explorer","timeline"]).forEach(n=>{(n!=="inspector"||Y)&&pe(n,!0)})}}}}});Ni().then(()=>{requestAnimationFrame(()=>{window.setTimeout(()=>{Gy()},0)}),G?.importing?kt.resume():ks()});export{mu as A,ag as B,iv as C,Tr as D,rc as E,cv as F,us as G,ul as H,$g as I,vo as J,Pn as K,ov as L,Xy as M,Sg as N,bu as O,mi as P,Qy as Q,av as R,tv as S,rv as T,ev as U,Lu as V,mr as _,yo as a,dl as b,hl as c,Gt as d,nv as e,yi as f,sv as g,wg as h,ss as i,bi as j,lv as k,rt as l,lt as m,W as n,vl as o,xy as p,Cg as q,gu as r,Ry as s,kg as t,yu as u,Dy as v,xu as w,Ne as x,pu as y,yg as z};
|