@kabmo-labs/kabmo 0.46.0 → 0.46.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/client/index.html +1 -1
  2. package/dist/client/index.js +1 -1
  3. package/dist/client/static/js/{CsvGrid-br4j001k.js → CsvGrid-qdkmv8bj.js} +1 -1
  4. package/dist/client/static/js/{DocxView-kmtkbmmw.js → DocxView-k84ns803.js} +1 -1
  5. package/dist/client/static/js/{DrawioView-3df0g3jr.js → DrawioView-r1n717f7.js} +1 -1
  6. package/dist/client/static/js/{ImageView-2r8p5z3y.js → ImageView-jkrdrq8v.js} +1 -1
  7. package/dist/client/static/js/{LayoutWrapper-rq3d2a4e.js → LayoutWrapper-sh634350.js} +2 -2
  8. package/dist/client/static/js/{Modal-tmxhxd6q.js → Modal-xe6h99jn.js} +1 -1
  9. package/dist/client/static/js/{PdfView-p5z7c7eg.js → PdfView-ffg4mccg.js} +1 -1
  10. package/dist/client/static/js/{SessionsView-t06h6zfx.js → SessionsView-cdcbsee9.js} +1 -1
  11. package/dist/client/static/js/{SheetView-agw459v2.js → SheetView-89sscpz6.js} +1 -1
  12. package/dist/client/static/js/{SvgPreview-b9rfy1h6.js → SvgPreview-68c0ccbv.js} +1 -1
  13. package/dist/client/static/js/{abnfDiagram-O67JEVCF-wbnhzcnj.js → abnfDiagram-O67JEVCF-h3a5s259.js} +1 -1
  14. package/dist/client/static/js/{architectureDiagram-NJMV4G6O-t2sgevea.js → architectureDiagram-NJMV4G6O-983p0jgn.js} +1 -1
  15. package/dist/client/static/js/{blockDiagram-BEXU5L5S-v2nzp54a.js → blockDiagram-BEXU5L5S-16pse5mh.js} +1 -1
  16. package/dist/client/static/js/{c4Diagram-YGBWAQC7-7h03146b.js → c4Diagram-YGBWAQC7-mvnb00zt.js} +1 -1
  17. package/dist/client/static/js/{classDiagram-v2-NBCMYWYE-m57e9kp1.js → classDiagram-v2-NBCMYWYE-kmpd91xb.js} +1 -1
  18. package/dist/client/static/js/{cose-bilkent-JH36ORCC-c4tnh4mg.js → cose-bilkent-JH36ORCC-3ek5r5se.js} +1 -1
  19. package/dist/client/static/js/{cynefinDiagram-VND7K2PF-mjf6njey.js → cynefinDiagram-VND7K2PF-jkbh84zn.js} +1 -1
  20. package/dist/client/static/js/{dagre-6A5THRUB-6yma9ch3.js → dagre-6A5THRUB-4fdc0sgn.js} +1 -1
  21. package/dist/client/static/js/{diagram-22UHCM2B-1q4ce2gb.js → diagram-22UHCM2B-hbk61nq9.js} +1 -1
  22. package/dist/client/static/js/{diagram-3UASUU5V-0ttps29p.js → diagram-3UASUU5V-hfpbr9qh.js} +1 -1
  23. package/dist/client/static/js/{diagram-ATOU4E4O-1mzexgv1.js → diagram-ATOU4E4O-fn0nt71a.js} +1 -1
  24. package/dist/client/static/js/{diagram-CDSNMT55-4ae89t23.js → diagram-CDSNMT55-ssswxjeb.js} +1 -1
  25. package/dist/client/static/js/{diagram-MLGK6HIB-057jaqvh.js → diagram-MLGK6HIB-whnzxv6f.js} +1 -1
  26. package/dist/client/static/js/{diagram-MPIPVDR6-p6yyq5sx.js → diagram-MPIPVDR6-hk1chzxk.js} +1 -1
  27. package/dist/client/static/js/{dockerfile-00hqsk9c.js → dockerfile-zmsj8r4g.js} +1 -1
  28. package/dist/client/static/js/{ebnfDiagram-ZINNZB2B-bsk7dvm4.js → ebnfDiagram-ZINNZB2B-q1vkg5mr.js} +1 -1
  29. package/dist/client/static/js/{elk-276RUBZZ-dsq91er5.js → elk-276RUBZZ-kt98vg8j.js} +1 -1
  30. package/dist/client/static/js/{erDiagram-OPXOYQCR-p7p13mbh.js → erDiagram-OPXOYQCR-ey3avsn9.js} +1 -1
  31. package/dist/client/static/js/flowDiagram-KWPJA3E3-7gvtpn3d.js +1 -0
  32. package/dist/client/static/js/{ganttDiagram-FUAMR5RP-bwgnttyk.js → ganttDiagram-FUAMR5RP-a9k1at43.js} +1 -1
  33. package/dist/client/static/js/{gitGraphDiagram-X574FWY7-ca0gj5am.js → gitGraphDiagram-X574FWY7-gnekjfym.js} +1 -1
  34. package/dist/client/static/js/{index-jkay7aw7.js → index-1ax52p0q.js} +1 -1
  35. package/dist/client/static/js/{index-064vdkrs.js → index-2a6qp9y6.js} +1 -1
  36. package/dist/client/static/js/{index-j718pxb3.js → index-3x7h2eqj.js} +1 -1
  37. package/dist/client/static/js/{index-amys498v.js → index-4cag7w6k.js} +131 -131
  38. package/dist/client/static/js/{index-ta6gpcpw.js → index-5ka2tyf9.js} +2 -2
  39. package/dist/client/static/js/{index-x1fqhhpp.js → index-60v30k5h.js} +2 -2
  40. package/dist/client/static/js/{index-5gf52a6d.js → index-65afr75v.js} +1 -1
  41. package/dist/client/static/js/{index-4bqssvt6.js → index-83rkg916.js} +1 -1
  42. package/dist/client/static/js/{index-aagt3382.js → index-84fyq5a6.js} +1 -1
  43. package/dist/client/static/js/{index-dr5hca5b.js → index-8g7q8mz4.js} +1 -1
  44. package/dist/client/static/js/{index-bjv5ga2e.js → index-9vv7wr1n.js} +1 -1
  45. package/dist/client/static/js/{index-pwe6chtp.js → index-amsa0tfs.js} +1 -1
  46. package/dist/client/static/js/{index-red856x6.js → index-atq9q1s7.js} +1 -1
  47. package/dist/client/static/js/{index-f7te27n5.js → index-b2e5pwx7.js} +1 -1
  48. package/dist/client/static/js/{index-ex5dtdx2.js → index-b5dfvget.js} +1 -1
  49. package/dist/client/static/js/{index-zedt16w7.js → index-bsr7wmj2.js} +1 -1
  50. package/dist/client/static/js/{index-k5zfzgez.js → index-c9e417cs.js} +1 -1
  51. package/dist/client/static/js/{index-3bf7r7z4.js → index-dt6q3rws.js} +4 -4
  52. package/dist/client/static/js/{index-29npynva.js → index-e9cxje00.js} +1 -1
  53. package/dist/client/static/js/{index-zq0qxb17.js → index-fzngzhww.js} +1 -1
  54. package/dist/client/static/js/{index-16sd19f0.js → index-hgzntg2j.js} +1 -1
  55. package/dist/client/static/js/{index-bafe7hmd.js → index-kb14dhrx.js} +1 -1
  56. package/dist/client/static/js/{index-qn200x1b.js → index-kbhrvep8.js} +6 -6
  57. package/dist/client/static/js/{index-eqhjs1yv.js → index-m4k054wz.js} +3 -3
  58. package/dist/client/static/js/{index-8pksqzwq.js → index-pavvxrsz.js} +1 -1
  59. package/dist/client/static/js/{index-95kese1h.js → index-q9ytjey8.js} +1 -1
  60. package/dist/client/static/js/{index-3qnjdjg2.js → index-vkqb4dnt.js} +1 -1
  61. package/dist/client/static/js/{index-7055hdx1.js → index-wrcdc9vz.js} +1 -1
  62. package/dist/client/static/js/{index-ncpwteyt.js → index-x9r7zfp4.js} +1 -1
  63. package/dist/client/static/js/{index-y2z8nsvw.js → index-xq5f3nxa.js} +1 -1
  64. package/dist/client/static/js/{index-gq5w5w8x.js → index-xwjbq003.js} +1 -1
  65. package/dist/client/static/js/{index-twsbv1yn.js → index-yf93db65.js} +1 -1
  66. package/dist/client/static/js/{index-9d3n04vb.js → index-ykm7a3cp.js} +2 -2
  67. package/dist/client/static/js/{index-5h8y54t6.js → index-z25ss7xj.js} +1 -1
  68. package/dist/client/static/js/{infoDiagram-VRGFBTTK-7q58qdf1.js → infoDiagram-VRGFBTTK-r1p25738.js} +1 -1
  69. package/dist/client/static/js/{ishikawaDiagram-OU5B5YK6-9jmeszag.js → ishikawaDiagram-OU5B5YK6-afgrqdrt.js} +1 -1
  70. package/dist/client/static/js/{journeyDiagram-ZHPQQLJL-0d7xe845.js → journeyDiagram-ZHPQQLJL-hepa4wk7.js} +1 -1
  71. package/dist/client/static/js/{kanban-definition-PNTS6WVX-7p83rwdn.js → kanban-definition-PNTS6WVX-jysft8ya.js} +1 -1
  72. package/dist/client/static/js/{mermaid.core-hwhzw0wv.js → mermaid.core-0m90b0s8.js} +2 -2
  73. package/dist/client/static/js/{mindmap-definition-NLK3R4M7-hy0rtr7t.js → mindmap-definition-NLK3R4M7-x2rrzpvr.js} +1 -1
  74. package/dist/client/static/js/one-dark-pro-09d8p5vy.js +1 -0
  75. package/dist/client/static/js/one-light-g3ednt6p.js +1 -0
  76. package/dist/client/static/js/{pegDiagram-GJSIUBJH-kd8t53tx.js → pegDiagram-GJSIUBJH-z7vb7f1z.js} +1 -1
  77. package/dist/client/static/js/{pieDiagram-5QR66LMP-h3x03f80.js → pieDiagram-5QR66LMP-jqv6v4e6.js} +1 -1
  78. package/dist/client/static/js/{quadrantDiagram-O4NWA36T-y2b1ncbg.js → quadrantDiagram-O4NWA36T-w2h8yxrv.js} +1 -1
  79. package/dist/client/static/js/{railroadDiagram-XR7U4H2S-x188rcxf.js → railroadDiagram-XR7U4H2S-nd09yac3.js} +1 -1
  80. package/dist/client/static/js/{requirementDiagram-PLB6GJNP-g5e9fk17.js → requirementDiagram-PLB6GJNP-t61zxh5v.js} +1 -1
  81. package/dist/client/static/js/{rust-1v8xbxn9.js → rust-avnkhh0p.js} +1 -1
  82. package/dist/client/static/js/{sankeyDiagram-IPEJSGJF-y9ht91gf.js → sankeyDiagram-IPEJSGJF-2f7h2cmw.js} +1 -1
  83. package/dist/client/static/js/{sequenceDiagram-PO4LG4MO-pp8s63rt.js → sequenceDiagram-PO4LG4MO-kfb5d7zd.js} +1 -1
  84. package/dist/client/static/js/{sizeCapture-INFHLROL-k6dhfxex.js → sizeCapture-INFHLROL-amfg19se.js} +1 -1
  85. package/dist/client/static/js/{stateDiagram-v2-GCMORJYK-y3akpsm4.js → stateDiagram-v2-GCMORJYK-k5hx7btx.js} +1 -1
  86. package/dist/client/static/js/{swimlanes-2SLR337P-89081dr3.js → swimlanes-2SLR337P-wv3rp8kk.js} +1 -1
  87. package/dist/client/static/js/{swimlanesDiagram-TC7HE7FX-3q2a15wc.js → swimlanesDiagram-TC7HE7FX-6y8zdbm4.js} +1 -1
  88. package/dist/client/static/js/{timeline-definition-EJHVYXUP-tz6r8g3q.js → timeline-definition-EJHVYXUP-0re95wtn.js} +1 -1
  89. package/dist/client/static/js/{usecaseDiagram-POWQR4AR-yq2y1b09.js → usecaseDiagram-POWQR4AR-yrje14qp.js} +1 -1
  90. package/dist/client/static/js/{vennDiagram-UO4OBE2U-qdmjf6x3.js → vennDiagram-UO4OBE2U-jxkmrfy5.js} +1 -1
  91. package/dist/client/static/js/{wardleyDiagram-VNRHLVJA-3n2sm7rj.js → wardleyDiagram-VNRHLVJA-d3v2m9b1.js} +1 -1
  92. package/dist/client/static/js/{xychartDiagram-PMCCYNJV-d7n2av2t.js → xychartDiagram-PMCCYNJV-9a1s1rjt.js} +1 -1
  93. package/package.json +1 -1
  94. package/src/client/components/layout/desktop-layout/LeftColumn.tsx +2 -1
  95. package/src/client/components/layout/desktop-layout/RightColumn.test.tsx +204 -0
  96. package/src/client/components/layout/desktop-layout/RightColumn.tsx +37 -16
  97. package/src/client/components/mobile/RightSidebar.tsx +10 -8
  98. package/src/client/components/mobile/mobile-session-sidebar/use-drawer-tabs.ts +2 -1
  99. package/src/client/components/workspace/chat-timeline/MessageList.test.ts +11 -0
  100. package/src/client/components/workspace/chat-timeline/MessageList.tsx +29 -21
  101. package/src/client/hooks/chat/timeline/row-measure.ts +75 -0
  102. package/src/client/hooks/chat/timeline/row-window.test.ts +41 -21
  103. package/src/client/hooks/chat/timeline/row-window.ts +6 -24
  104. package/src/client/hooks/workspace/panel-tabs-reveal.test.tsx +20 -17
  105. package/src/client/hooks/workspace/panel-tabs-reveal.ts +29 -17
  106. package/src/client/hooks/workspace/panel-tabs.ts +3 -2
  107. package/src/client/hooks/workspace/session-state/index.test.tsx +145 -0
  108. package/src/client/hooks/workspace/session-state/index.ts +28 -16
  109. package/dist/client/static/js/flowDiagram-KWPJA3E3-7b4w6phx.js +0 -1
  110. package/dist/client/static/js/one-dark-pro-4b8er03c.js +0 -1
  111. package/dist/client/static/js/one-light-e6r3vsz4.js +0 -1
@@ -1,2 +1,2 @@
1
- import{t}from"./index-x1fqhhpp.js";var Ii=class{constructor(i){this.init=i,this.records=this.init()}static{t(this,"ImperativeState")}reset(){this.records=this.init()}};
1
+ import{t}from"./index-60v30k5h.js";var Ii=class{constructor(i){this.init=i,this.records=this.init()}static{t(this,"ImperativeState")}reset(){this.records=this.init()}};
2
2
  export{Ii};
@@ -1,2 +1,2 @@
1
- import{n,o,s,R,ea,kc,Ig,_g,bh,wm}from"./index-amys498v.js";var Rd="omp:editor-theme-changed";function a(){if(typeof window>"u")return kc;return R("editorTheme")??kc}var p={theme:null,vars:{},themes:_g(null)};function Ci(){let[e,t]=n(a);if(o(()=>{let i=(d)=>{let E=d.detail;t(E||a())};return window.addEventListener(Rd,i),()=>window.removeEventListener(Rd,i)},[]),o(()=>{wm(e)},[e]),e===ea)return p;let r=Ig(e);return{theme:r,vars:bh(r),themes:_g(e)}}var m={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]},mt=s(m);var Fd="omp:editor-indent-changed",Ld=[2,4,8],fu={width:2,insertSpaces:!0};function Md(){if(typeof window>"u")return fu;let e=R("editorIndentWidth"),t=R("editorInsertSpaces");return{width:typeof e==="number"&&Ld.includes(e)?e:fu.width,insertSpaces:typeof t==="boolean"?t:fu.insertSpaces}}function gu(e){return e.insertSpaces?" ".repeat(e.width):"\t"}function Au(){let[e,t]=n(Md);return o(()=>{let r=(i)=>{let d=i.detail;t(d??Md())};return window.addEventListener(Fd,r),()=>window.removeEventListener(Fd,r)},[]),e}var Pd="omp:editor-typing-changed",Dl={autoCloseBrackets:!0,autocomplete:!0};function hu(){if(typeof window>"u")return Dl;let e=R("editorAutoCloseBrackets"),t=R("editorAutocomplete");return{autoCloseBrackets:typeof e==="boolean"?e:Dl.autoCloseBrackets,autocomplete:typeof t==="boolean"?t:Dl.autocomplete}}function bu(){let[e,t]=n(hu);return o(()=>{let r=(i)=>{let d=i.detail;t(d??hu())};return window.addEventListener(Pd,r),()=>window.removeEventListener(Pd,r)},[]),e}var Is="omp:editor-blame-changed",Nl={enabled:!0,inline:!1};function Ei(){if(typeof window>"u")return Nl;let e=R("editorBlame"),t=R("editorBlameInline");return{enabled:typeof e==="boolean"?e:Nl.enabled,inline:typeof t==="boolean"?t:Nl.inline}}function Od(){let[e,t]=n(Ei);return o(()=>{let r=(i)=>{let d=i.detail;t(d??Ei())};return window.addEventListener(Is,r),()=>window.removeEventListener(Is,r)},[]),e}
1
+ import{n,o,s,R,ea,kc,Ig,_g,bh,wm}from"./index-4cag7w6k.js";var Rd="omp:editor-theme-changed";function a(){if(typeof window>"u")return kc;return R("editorTheme")??kc}var p={theme:null,vars:{},themes:_g(null)};function Ci(){let[e,t]=n(a);if(o(()=>{let i=(d)=>{let E=d.detail;t(E||a())};return window.addEventListener(Rd,i),()=>window.removeEventListener(Rd,i)},[]),o(()=>{wm(e)},[e]),e===ea)return p;let r=Ig(e);return{theme:r,vars:bh(r),themes:_g(e)}}var m={name:"save",size:24,node:[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]},mt=s(m);var Fd="omp:editor-indent-changed",Ld=[2,4,8],fu={width:2,insertSpaces:!0};function Md(){if(typeof window>"u")return fu;let e=R("editorIndentWidth"),t=R("editorInsertSpaces");return{width:typeof e==="number"&&Ld.includes(e)?e:fu.width,insertSpaces:typeof t==="boolean"?t:fu.insertSpaces}}function gu(e){return e.insertSpaces?" ".repeat(e.width):"\t"}function Au(){let[e,t]=n(Md);return o(()=>{let r=(i)=>{let d=i.detail;t(d??Md())};return window.addEventListener(Fd,r),()=>window.removeEventListener(Fd,r)},[]),e}var Pd="omp:editor-typing-changed",Dl={autoCloseBrackets:!0,autocomplete:!0};function hu(){if(typeof window>"u")return Dl;let e=R("editorAutoCloseBrackets"),t=R("editorAutocomplete");return{autoCloseBrackets:typeof e==="boolean"?e:Dl.autoCloseBrackets,autocomplete:typeof t==="boolean"?t:Dl.autocomplete}}function bu(){let[e,t]=n(hu);return o(()=>{let r=(i)=>{let d=i.detail;t(d??hu())};return window.addEventListener(Pd,r),()=>window.removeEventListener(Pd,r)},[]),e}var Is="omp:editor-blame-changed",Nl={enabled:!0,inline:!1};function Ei(){if(typeof window>"u")return Nl;let e=R("editorBlame"),t=R("editorBlameInline");return{enabled:typeof e==="boolean"?e:Nl.enabled,inline:typeof t==="boolean"?t:Nl.inline}}function Od(){let[e,t]=n(Ei);return o(()=>{let r=(i)=>{let d=i.detail;t(d??Ei())};return window.addEventListener(Is,r),()=>window.removeEventListener(Is,r)},[]),e}
2
2
  export{mt,Rd,Ci,Fd,Ld,fu,Md,gu,Au,Pd,Dl,hu,bu,Is,Nl,Ei,Od};
@@ -1 +1 @@
1
- import{d,n,o,i,u,a,le,e,s,f,B,se,vo,re,ce,b,Gp,Ie,S,bt,Wa,st,ue,lt,IA,mi}from"./index-amys498v.js";var ae={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]},F=s(ae);function O(l,r,c=1e6){return{sessionId:l,sessionTitle:r,modelId:"",modelName:"",timestamp:"",contextUsed:0,contextLimit:c,contextPercent:0,messagesCount:0,userCount:0,assistantCount:0,totalCost:0,costFormatted:"$0.00",cacheHitAverage:0,costBreakdown:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},lastMessage:{input:0,output:0,reasoning:0,cacheRead:0,cacheWrite:0,cacheHitPercent:0},distribution:{userTokens:0,userPercent:0,assistantTokens:0,assistantPercent:0,toolTokens:0,toolPercent:0,otherTokens:0,otherPercent:100},rawMessages:[]}}function J({used:l,limit:r,percent:c}){let h=l.toLocaleString(),x=r.toLocaleString(),m=Math.min(100,Math.max(0,c));return e("div",{className:"bg-canvas border border-ink/10 rounded-xl p-4 transition-all",children:[e("div",{className:"flex items-center justify-between text-xs mb-2",children:[e("span",{className:"font-semibold text-ink/80",children:"Context"}),e("span",{className:"font-mono text-ink/70 text-[11px]",children:[h," / ",x]})]}),e("div",{className:"w-full h-1.5 bg-ink/10 rounded-full overflow-hidden mb-2",children:e("div",{className:"h-full bg-ink/70 rounded-full transition-all duration-500 ease-out",style:{width:`${m}%`}})}),e("div",{className:"text-[11px] font-mono text-ink/50 text-left",children:[m.toFixed(1),"% used"]})]})}function L(l){return l<0.01?"$0.01":`$${l.toFixed(6).replace(/0+$/,"").replace(/\.$/,"")}`}function Z({open:l,onClose:r,breakdown:c,costFormatted:h}){let x=i(null);if(ue(x,r),!l)return null;let m=c?[{label:"Total Cost",value:L(c.total),strong:!0},{label:"Input (cache miss)",value:L(c.input)},{label:"Output",value:L(c.output)},{label:"Cache Read (cache hit)",value:L(c.cacheRead)},{label:"Cache Write",value:L(c.cacheWrite)}]:[{label:"Total Cost",value:h??"$0.01",strong:!0}];return e("div",{ref:x,className:"glass-popover absolute top-full right-0 mt-1.5 z-50 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg p-3",role:"dialog","aria-modal":"false",children:[e("div",{className:"flex items-center justify-between mb-2.5",children:[e("span",{className:"text-xs font-semibold text-ink tracking-tight",children:"Cost Breakdown"}),e("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors","aria-label":"Close cost breakdown",children:e(b,{size:14})})]}),e("div",{className:"space-y-1.5",children:m.map((t)=>e("div",{className:"flex items-center justify-between text-[11px] font-mono border-b border-ink/5 last:border-0 pb-1.5 last:pb-0",children:[e("span",{className:"text-ink/60",children:t.label}),e("span",{className:`${t.strong?"font-semibold text-ink":"text-ink/80"}`,children:t.value})]},t.label))})]})}function V({messagesCount:l,userCount:r,assistantCount:c,costFormatted:h,cacheHitAverage:x,costBreakdown:m}){let[t,v]=n(!1);return e(d,{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Session Stats"})}),e("div",{className:"flex gap-2 flex-wrap",children:[e(lt,{variant:"compact",label:"Messages",value:l}),e(lt,{variant:"compact",label:"User",value:r}),e(lt,{variant:"compact",label:"Assistant",value:c}),e(lt,{variant:"compact",label:"Cache Hit",value:x!==void 0?`${x.toFixed(1)}%`:"–"}),e("div",{className:"relative bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[e("span",{className:"text-[10px] font-medium text-ink/50 flex items-center gap-1",children:["Cost",e("button",{type:"button",onClick:()=>v(!0),className:"p-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors","aria-label":"Show cost breakdown",title:"Cost breakdown",children:e(ce,{size:11})})]}),e("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:h}),e(Z,{open:t,onClose:()=>v(!1),breakdown:m,costFormatted:h})]})]})]})}function z({input:l,output:r,reasoning:c,cacheRead:h,cacheWrite:x,cacheHitPercent:m}){return e(d,{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Last Assistant Message"})}),e("div",{className:"flex gap-2 flex-wrap",children:[e(lt,{variant:"compact",label:"In",value:l.toLocaleString()}),e(lt,{variant:"compact",label:"Out",value:r.toLocaleString()}),e(lt,{variant:"compact",label:"Reason",value:c.toLocaleString()}),e(lt,{variant:"compact",label:"Cache",value:`${h.toLocaleString()}/${x.toLocaleString()}`}),e(lt,{variant:"compact",label:"Hit",value:`${m.toFixed(1)}%`})]})]})}function Q({userPercent:l,assistantPercent:r,toolPercent:c,otherPercent:h}){return e("div",{className:"space-y-2.5",children:[e("div",{className:"w-full h-1.5 rounded-full overflow-hidden flex bg-ink/10",children:[e("div",{className:"h-full bg-emerald-500 transition-all duration-300",style:{width:`${l}%`},title:`User: ${l}%`}),e("div",{className:"h-full bg-sky-500 transition-all duration-300",style:{width:`${r}%`},title:`Assistant: ${r}%`}),e("div",{className:"h-full bg-amber-500 transition-all duration-300",style:{width:`${c}%`},title:`Tool Calls: ${c}%`}),e("div",{className:"h-full bg-slate-400 transition-all duration-300",style:{width:`${h}%`},title:`Other: ${h}%`})]}),e("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-ink/70",children:[e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-emerald-500 flex-shrink-0"}),e("span",{children:["User ",l,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-sky-500 flex-shrink-0"}),e("span",{children:["Assistant ",r,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-amber-500 flex-shrink-0"}),e("span",{children:["Tool Calls ",c,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-slate-400 flex-shrink-0"}),e("span",{children:["Other ",h,"%"]})]})]})]})}function G({data:l}){mi();let[r,c]=n(!1),h=i(null),x=i(null),m=JSON.stringify(l,null,2),t=IA(m),v=a((C)=>{let g=x.current;if(!g)return;g.scrollLeft=C.currentTarget.scrollLeft,g.scrollTop=C.currentTarget.scrollTop},[]),y=a(async(C)=>{C.stopPropagation();try{await navigator.clipboard.writeText(m)}catch{let g=document.createElement("textarea");g.value=m,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),document.body.removeChild(g)}c(!0),setTimeout(()=>c(!1),2000)},[m]);return e("div",{className:"relative my-1.5 rounded-lg bg-paper/80 border border-ink/10 overflow-hidden",children:[e("div",{className:"flex items-center justify-between px-2.5 py-1.5 bg-ink/[0.04] border-b border-ink/10",children:[e("span",{className:"text-[10px] font-mono text-ink/50 select-none",children:[Object.keys(l).length," keys · ",m.length," chars"]}),e("button",{type:"button",onClick:y,className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas hover:bg-paper text-ink/70 hover:text-ink border border-ink/10 text-[10px] transition-colors shadow-xs",title:"Copy Pretty JSON",children:r?e(d,{children:[e(f,{size:11,className:"text-success"}),e("span",{className:"text-success font-sans font-medium",children:"Copied"})]}):e(d,{children:[e(re,{size:11}),e("span",{className:"font-sans",children:"Copy JSON"})]})})]}),e("div",{className:"relative",children:[e("pre",{ref:x,"aria-hidden":!0,className:"absolute inset-0 p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre pointer-events-none",dangerouslySetInnerHTML:{__html:t}}),e("pre",{ref:h,onScroll:v,className:"relative p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre select-text selection:bg-ink selection:text-canvas",children:e("code",{className:"text-transparent",children:m})})]})]})}var D=["bg-emerald-500","bg-sky-500","bg-amber-500","bg-violet-500","bg-rose-500","bg-teal-500","bg-indigo-500","bg-fuchsia-500","bg-lime-500","bg-cyan-500","bg-orange-500","bg-pink-500","bg-yellow-500","bg-purple-500","bg-red-500","bg-blue-500","bg-green-500","bg-cyan-600","bg-violet-600","bg-amber-600"],_=20;function K(l){let r=0;for(let c=0;c<l.length;c++)r=r*31+l.charCodeAt(c)|0;return Math.abs(r)}function q(l){let r=l.indexOf("/"),c=r>0?l.slice(0,r):l,h=r>0?l.slice(r+1):"";return h?`${c} · ${h}`:c}function Y(l,r){if(r<=7)return Array.from({length:r},(t,v)=>v+1);let c=new Set([1,r,l,l-1,l+1]);if(l<=3)[2,3,4].forEach((t)=>c.add(t));if(l>=r-2)[r-3,r-2,r-1].forEach((t)=>c.add(t));let h=[...c].filter((t)=>t>=1&&t<=r).sort((t,v)=>t-v),x=[],m=0;for(let t of h){if(t-m>1)x.push("…");x.push(t),m=t}return x}function X({sessionId:l,refreshKey:r=0}){let[c,h]=S("context.rawExpandedIds",{}),[x,m]=S("context.rawFilterRole","all"),[t,v]=n(1),[y,C]=n([]),[g,I]=n(0),[W,R]=n(!1),w=i(0),E=i(!1),j=a((p)=>{if(typeof window>"u")return;let k=++w.current;if(!p?.silent)R(!0);let P=new URLSearchParams({page:String(t),pageSize:String(_),role:x});if(l)P.set("sessionId",l);fetch(`/api/telemetry/raw-messages?${P.toString()}`).then((N)=>N.ok?N.json():null).then((N)=>{if(E.current||k!==w.current)return;C(N&&Array.isArray(N.items)?N.items:[]),I(N&&Number.isFinite(N.filteredTotal)?N.filteredTotal:0)}).catch(()=>{if(E.current||k!==w.current)return;C([]),I(0)}).finally(()=>{if(!p?.silent&&k===w.current)R(!1)})},[l,t,x]);o(()=>(E.current=!1,j(),()=>{E.current=!0}),[j,r]);let T=Math.max(1,Math.ceil(g/_)),M=Math.min(t,T),U=(p)=>v(Math.min(Math.max(1,p),T)),ee=(p)=>{h((k)=>({...k,[p]:!k[p]}))},te=()=>{if(y.every((k)=>c[k.id]))h({});else{let k={};y.forEach((P)=>{k[P.id]=!0}),h(k)}},H=u(()=>{let p=[];for(let k of y){let P=k.info.modelID;if(!P||p.includes(P))continue;p.push(P)}return p},[y]),A=(p)=>p?D[K(p)%D.length]:"bg-ink/20";return e("div",{className:"space-y-3",children:[H.length>0&&e("div",{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Legend"})}),e("div",{className:"bg-canvas border border-ink/10 rounded-xl px-3 py-2",children:e("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-mono text-ink/60",children:H.map((p)=>e("span",{className:"flex items-center gap-1.5",children:[e("span",{className:`w-2 h-2 rounded-full ${A(p)}`}),e("span",{children:q(p)})]},p))})})]}),e("div",{className:"flex items-center justify-between",children:[e("div",{className:"flex items-center space-x-2",children:[e("span",{className:"text-xs font-semibold text-ink/80",children:"Raw Messages"}),e("span",{className:"text-[10px] font-mono text-ink/50 bg-ink/5 px-1.5 py-0.5 rounded-full border border-ink/10",children:g})]}),e("div",{className:"flex items-center space-x-1",children:[e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-lg p-0.5 text-[10px]",children:[e("button",{type:"button",onClick:()=>{m("all"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="all"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"All"}),e("button",{type:"button",onClick:()=>{m("assistant"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="assistant"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"AI"}),e("button",{type:"button",onClick:()=>{m("user"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="user"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"User"})]}),e("button",{type:"button",onClick:te,className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors text-[10px] flex items-center",title:"Expand / Collapse All",children:e(F,{size:14})})]})]}),e("div",{className:"space-y-1.5",children:!W&&y.length===0?e("div",{className:"p-4 text-center text-xs text-ink/40 italic bg-canvas rounded-xl border border-ink/10",children:"No raw messages recorded yet."}):y.map((p)=>{let k=Boolean(c[p.id]);return e("div",{className:`bg-canvas border border-ink/10 rounded-xl overflow-hidden transition-all duration-200 ${W?"opacity-50":""}`,children:[e("button",{type:"button",onClick:()=>ee(p.id),className:"w-full text-left px-3.5 py-2.5 flex items-center justify-between hover:bg-ink/5 transition-colors cursor-pointer",children:[e("div",{className:"flex items-center space-x-2 min-w-0 flex-1 mr-2",children:[e("span",{className:"text-ink/40 flex-shrink-0",children:k?e(B,{size:14}):e(se,{size:14})}),e("span",{className:"text-xs font-mono text-ink/90 truncate",children:p.badgeLabel})]}),e("div",{className:"flex items-center space-x-3 text-[11px] font-mono text-ink/50 flex-shrink-0",children:[p.tokenSummary&&e("span",{className:"text-ink/60",children:p.tokenSummary}),e("span",{className:"flex items-center gap-1.5",children:[e("span",{className:`w-2 h-2 rounded-full ${A(p.info.modelID)}`}),e("span",{children:p.timestamp})]})]})]}),k&&e("div",{className:"px-3.5 pb-3 pt-1 border-t border-ink/5 bg-canvas/60",children:e(G,{data:p.rawPayload})})]},p.id)})}),T>1&&e("div",{className:"flex items-center justify-between pt-1",children:[e("span",{className:"text-[10px] font-mono text-ink/50",children:[(M-1)*_+1,"–",Math.min(M*_,g)," of ",g]}),e("div",{className:"flex items-center gap-0.5",children:[e("button",{type:"button",disabled:M<=1,onClick:()=>U(M-1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Previous page",children:e(vo,{size:14})}),Y(M,T).map((p,k)=>p==="…"?e("span",{className:"px-1 text-[10px] font-mono text-ink/40 select-none",children:"…"},`gap-${k}`):e("button",{type:"button",onClick:()=>U(p),className:`min-w-[22px] h-[22px] px-1 rounded text-[10px] font-mono transition-colors ${p===M?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:p},p)),e("button",{type:"button",disabled:M>=T,onClick:()=>U(M+1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Next page",children:e(se,{size:14})})]})]})]})}function mt({className:l="",enabled:r=!0,refreshKey:c=0,tabsMode:h=!1}){let[x]=le(),m=x.get("sessionId"),[t,v]=n(()=>O(m||"default","Session not started")),y=i(!1),C=a(()=>{if(typeof window>"u")return;let R=m?`?sessionId=${encodeURIComponent(m)}`:"";fetch(`/api/telemetry/context${R}`).then((w)=>w.ok?w.json():null).then((w)=>{if(!y.current&&w&&w.telemetry)v(w.telemetry)}).catch((w)=>{if(!y.current)console.warn("Failed to fetch context telemetry:",w)})},[m]);o(()=>{if(y.current=!1,!r)return;return C(),()=>{y.current=!0}},[r,c,C]);let g=Ie(m?Gp(m):null,{enabled:r}),[I,W]=n(0);if(o(()=>{if(g.data)v(g.data),W((R)=>R+1)},[g.data]),!r)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${l}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});if(t.messagesCount===0)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${l}`,children:e("span",{className:"text-xs font-mono",children:"Session not started"})});return e("div",{className:`flex flex-col h-full bg-paper text-ink overflow-hidden select-none ${l}`,children:[e(bt,{left:e(d,{children:[e(Wa,{id:"context",tabsMode:h,children:e("h2",{className:"text-xs font-medium text-ink tracking-tight truncate",children:t.sessionTitle})}),e("span",{className:"text-[11px] text-ink/50 truncate font-mono",children:t.timestamp})]}),right:e(st,{label:"Refresh context telemetry",onClick:()=>{g.refresh(),C()},busy:g.refreshing,disabled:!r})}),e("div",{className:"flex-1 scrollbar-overlay-container p-4 space-y-4",children:[e(J,{used:t.contextUsed,limit:t.contextLimit,percent:t.contextPercent}),e(V,{messagesCount:t.messagesCount,userCount:t.userCount,assistantCount:t.assistantCount,costFormatted:t.costFormatted,cacheHitAverage:t.cacheHitAverage,costBreakdown:t.costBreakdown}),e(z,{input:t.lastMessage.input,output:t.lastMessage.output,reasoning:t.lastMessage.reasoning,cacheRead:t.lastMessage.cacheRead,cacheWrite:t.lastMessage.cacheWrite,cacheHitPercent:t.lastMessage.cacheHitPercent}),e(Q,{userPercent:t.distribution.userPercent,assistantPercent:t.distribution.assistantPercent,toolPercent:t.distribution.toolPercent,otherPercent:t.distribution.otherPercent}),e(X,{sessionId:m,refreshKey:c+I})]})]})}export{mt as ContextPanel};
1
+ import{d,n,o,i,u,a,le,e,s,f,B,se,vo,re,ce,b,Gp,Ie,S,bt,Wa,st,ue,lt,IA,mi}from"./index-4cag7w6k.js";var ae={name:"chevrons-up-down",size:24,node:[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]},F=s(ae);function O(l,r,c=1e6){return{sessionId:l,sessionTitle:r,modelId:"",modelName:"",timestamp:"",contextUsed:0,contextLimit:c,contextPercent:0,messagesCount:0,userCount:0,assistantCount:0,totalCost:0,costFormatted:"$0.00",cacheHitAverage:0,costBreakdown:{input:0,output:0,cacheRead:0,cacheWrite:0,total:0},lastMessage:{input:0,output:0,reasoning:0,cacheRead:0,cacheWrite:0,cacheHitPercent:0},distribution:{userTokens:0,userPercent:0,assistantTokens:0,assistantPercent:0,toolTokens:0,toolPercent:0,otherTokens:0,otherPercent:100},rawMessages:[]}}function J({used:l,limit:r,percent:c}){let h=l.toLocaleString(),x=r.toLocaleString(),m=Math.min(100,Math.max(0,c));return e("div",{className:"bg-canvas border border-ink/10 rounded-xl p-4 transition-all",children:[e("div",{className:"flex items-center justify-between text-xs mb-2",children:[e("span",{className:"font-semibold text-ink/80",children:"Context"}),e("span",{className:"font-mono text-ink/70 text-[11px]",children:[h," / ",x]})]}),e("div",{className:"w-full h-1.5 bg-ink/10 rounded-full overflow-hidden mb-2",children:e("div",{className:"h-full bg-ink/70 rounded-full transition-all duration-500 ease-out",style:{width:`${m}%`}})}),e("div",{className:"text-[11px] font-mono text-ink/50 text-left",children:[m.toFixed(1),"% used"]})]})}function L(l){return l<0.01?"$0.01":`$${l.toFixed(6).replace(/0+$/,"").replace(/\.$/,"")}`}function Z({open:l,onClose:r,breakdown:c,costFormatted:h}){let x=i(null);if(ue(x,r),!l)return null;let m=c?[{label:"Total Cost",value:L(c.total),strong:!0},{label:"Input (cache miss)",value:L(c.input)},{label:"Output",value:L(c.output)},{label:"Cache Read (cache hit)",value:L(c.cacheRead)},{label:"Cache Write",value:L(c.cacheWrite)}]:[{label:"Total Cost",value:h??"$0.01",strong:!0}];return e("div",{ref:x,className:"glass-popover absolute top-full right-0 mt-1.5 z-50 w-64 bg-paper border border-ink/10 rounded-lg shadow-lg p-3",role:"dialog","aria-modal":"false",children:[e("div",{className:"flex items-center justify-between mb-2.5",children:[e("span",{className:"text-xs font-semibold text-ink tracking-tight",children:"Cost Breakdown"}),e("button",{type:"button",onClick:r,className:"p-1 rounded hover:bg-ink/5 text-ink/60 hover:text-ink transition-colors","aria-label":"Close cost breakdown",children:e(b,{size:14})})]}),e("div",{className:"space-y-1.5",children:m.map((t)=>e("div",{className:"flex items-center justify-between text-[11px] font-mono border-b border-ink/5 last:border-0 pb-1.5 last:pb-0",children:[e("span",{className:"text-ink/60",children:t.label}),e("span",{className:`${t.strong?"font-semibold text-ink":"text-ink/80"}`,children:t.value})]},t.label))})]})}function V({messagesCount:l,userCount:r,assistantCount:c,costFormatted:h,cacheHitAverage:x,costBreakdown:m}){let[t,v]=n(!1);return e(d,{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Session Stats"})}),e("div",{className:"flex gap-2 flex-wrap",children:[e(lt,{variant:"compact",label:"Messages",value:l}),e(lt,{variant:"compact",label:"User",value:r}),e(lt,{variant:"compact",label:"Assistant",value:c}),e(lt,{variant:"compact",label:"Cache Hit",value:x!==void 0?`${x.toFixed(1)}%`:"–"}),e("div",{className:"relative bg-canvas border border-ink/10 rounded-lg px-2.5 py-1.5 flex flex-col gap-0.5 flex-1 min-w-0",children:[e("span",{className:"text-[10px] font-medium text-ink/50 flex items-center gap-1",children:["Cost",e("button",{type:"button",onClick:()=>v(!0),className:"p-0.5 rounded text-ink/40 hover:text-ink hover:bg-ink/5 transition-colors","aria-label":"Show cost breakdown",title:"Cost breakdown",children:e(ce,{size:11})})]}),e("span",{className:"text-xs font-semibold font-mono text-ink truncate",children:h}),e(Z,{open:t,onClose:()=>v(!1),breakdown:m,costFormatted:h})]})]})]})}function z({input:l,output:r,reasoning:c,cacheRead:h,cacheWrite:x,cacheHitPercent:m}){return e(d,{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Last Assistant Message"})}),e("div",{className:"flex gap-2 flex-wrap",children:[e(lt,{variant:"compact",label:"In",value:l.toLocaleString()}),e(lt,{variant:"compact",label:"Out",value:r.toLocaleString()}),e(lt,{variant:"compact",label:"Reason",value:c.toLocaleString()}),e(lt,{variant:"compact",label:"Cache",value:`${h.toLocaleString()}/${x.toLocaleString()}`}),e(lt,{variant:"compact",label:"Hit",value:`${m.toFixed(1)}%`})]})]})}function Q({userPercent:l,assistantPercent:r,toolPercent:c,otherPercent:h}){return e("div",{className:"space-y-2.5",children:[e("div",{className:"w-full h-1.5 rounded-full overflow-hidden flex bg-ink/10",children:[e("div",{className:"h-full bg-emerald-500 transition-all duration-300",style:{width:`${l}%`},title:`User: ${l}%`}),e("div",{className:"h-full bg-sky-500 transition-all duration-300",style:{width:`${r}%`},title:`Assistant: ${r}%`}),e("div",{className:"h-full bg-amber-500 transition-all duration-300",style:{width:`${c}%`},title:`Tool Calls: ${c}%`}),e("div",{className:"h-full bg-slate-400 transition-all duration-300",style:{width:`${h}%`},title:`Other: ${h}%`})]}),e("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-[11px] text-ink/70",children:[e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-emerald-500 flex-shrink-0"}),e("span",{children:["User ",l,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-sky-500 flex-shrink-0"}),e("span",{children:["Assistant ",r,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-amber-500 flex-shrink-0"}),e("span",{children:["Tool Calls ",c,"%"]})]}),e("div",{className:"flex items-center space-x-1.5",children:[e("span",{className:"w-2 h-2 rounded-full bg-slate-400 flex-shrink-0"}),e("span",{children:["Other ",h,"%"]})]})]})]})}function G({data:l}){mi();let[r,c]=n(!1),h=i(null),x=i(null),m=JSON.stringify(l,null,2),t=IA(m),v=a((C)=>{let g=x.current;if(!g)return;g.scrollLeft=C.currentTarget.scrollLeft,g.scrollTop=C.currentTarget.scrollTop},[]),y=a(async(C)=>{C.stopPropagation();try{await navigator.clipboard.writeText(m)}catch{let g=document.createElement("textarea");g.value=m,g.style.position="fixed",g.style.opacity="0",document.body.appendChild(g),g.select(),document.execCommand("copy"),document.body.removeChild(g)}c(!0),setTimeout(()=>c(!1),2000)},[m]);return e("div",{className:"relative my-1.5 rounded-lg bg-paper/80 border border-ink/10 overflow-hidden",children:[e("div",{className:"flex items-center justify-between px-2.5 py-1.5 bg-ink/[0.04] border-b border-ink/10",children:[e("span",{className:"text-[10px] font-mono text-ink/50 select-none",children:[Object.keys(l).length," keys · ",m.length," chars"]}),e("button",{type:"button",onClick:y,className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas hover:bg-paper text-ink/70 hover:text-ink border border-ink/10 text-[10px] transition-colors shadow-xs",title:"Copy Pretty JSON",children:r?e(d,{children:[e(f,{size:11,className:"text-success"}),e("span",{className:"text-success font-sans font-medium",children:"Copied"})]}):e(d,{children:[e(re,{size:11}),e("span",{className:"font-sans",children:"Copy JSON"})]})})]}),e("div",{className:"relative",children:[e("pre",{ref:x,"aria-hidden":!0,className:"absolute inset-0 p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre pointer-events-none",dangerouslySetInnerHTML:{__html:t}}),e("pre",{ref:h,onScroll:v,className:"relative p-2.5 m-0 font-mono text-[11px] leading-5 overflow-x-auto overflow-y-auto whitespace-pre select-text selection:bg-ink selection:text-canvas",children:e("code",{className:"text-transparent",children:m})})]})]})}var D=["bg-emerald-500","bg-sky-500","bg-amber-500","bg-violet-500","bg-rose-500","bg-teal-500","bg-indigo-500","bg-fuchsia-500","bg-lime-500","bg-cyan-500","bg-orange-500","bg-pink-500","bg-yellow-500","bg-purple-500","bg-red-500","bg-blue-500","bg-green-500","bg-cyan-600","bg-violet-600","bg-amber-600"],_=20;function K(l){let r=0;for(let c=0;c<l.length;c++)r=r*31+l.charCodeAt(c)|0;return Math.abs(r)}function q(l){let r=l.indexOf("/"),c=r>0?l.slice(0,r):l,h=r>0?l.slice(r+1):"";return h?`${c} · ${h}`:c}function Y(l,r){if(r<=7)return Array.from({length:r},(t,v)=>v+1);let c=new Set([1,r,l,l-1,l+1]);if(l<=3)[2,3,4].forEach((t)=>c.add(t));if(l>=r-2)[r-3,r-2,r-1].forEach((t)=>c.add(t));let h=[...c].filter((t)=>t>=1&&t<=r).sort((t,v)=>t-v),x=[],m=0;for(let t of h){if(t-m>1)x.push("…");x.push(t),m=t}return x}function X({sessionId:l,refreshKey:r=0}){let[c,h]=S("context.rawExpandedIds",{}),[x,m]=S("context.rawFilterRole","all"),[t,v]=n(1),[y,C]=n([]),[g,I]=n(0),[W,R]=n(!1),w=i(0),E=i(!1),j=a((p)=>{if(typeof window>"u")return;let k=++w.current;if(!p?.silent)R(!0);let P=new URLSearchParams({page:String(t),pageSize:String(_),role:x});if(l)P.set("sessionId",l);fetch(`/api/telemetry/raw-messages?${P.toString()}`).then((N)=>N.ok?N.json():null).then((N)=>{if(E.current||k!==w.current)return;C(N&&Array.isArray(N.items)?N.items:[]),I(N&&Number.isFinite(N.filteredTotal)?N.filteredTotal:0)}).catch(()=>{if(E.current||k!==w.current)return;C([]),I(0)}).finally(()=>{if(!p?.silent&&k===w.current)R(!1)})},[l,t,x]);o(()=>(E.current=!1,j(),()=>{E.current=!0}),[j,r]);let T=Math.max(1,Math.ceil(g/_)),M=Math.min(t,T),U=(p)=>v(Math.min(Math.max(1,p),T)),ee=(p)=>{h((k)=>({...k,[p]:!k[p]}))},te=()=>{if(y.every((k)=>c[k.id]))h({});else{let k={};y.forEach((P)=>{k[P.id]=!0}),h(k)}},H=u(()=>{let p=[];for(let k of y){let P=k.info.modelID;if(!P||p.includes(P))continue;p.push(P)}return p},[y]),A=(p)=>p?D[K(p)%D.length]:"bg-ink/20";return e("div",{className:"space-y-3",children:[H.length>0&&e("div",{children:[e("div",{className:"mb-1.5",children:e("span",{className:"text-xs font-semibold text-ink/80",children:"Legend"})}),e("div",{className:"bg-canvas border border-ink/10 rounded-xl px-3 py-2",children:e("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1 text-[10px] font-mono text-ink/60",children:H.map((p)=>e("span",{className:"flex items-center gap-1.5",children:[e("span",{className:`w-2 h-2 rounded-full ${A(p)}`}),e("span",{children:q(p)})]},p))})})]}),e("div",{className:"flex items-center justify-between",children:[e("div",{className:"flex items-center space-x-2",children:[e("span",{className:"text-xs font-semibold text-ink/80",children:"Raw Messages"}),e("span",{className:"text-[10px] font-mono text-ink/50 bg-ink/5 px-1.5 py-0.5 rounded-full border border-ink/10",children:g})]}),e("div",{className:"flex items-center space-x-1",children:[e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-lg p-0.5 text-[10px]",children:[e("button",{type:"button",onClick:()=>{m("all"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="all"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"All"}),e("button",{type:"button",onClick:()=>{m("assistant"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="assistant"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"AI"}),e("button",{type:"button",onClick:()=>{m("user"),v(1)},className:`px-1.5 py-0.5 rounded ${x==="user"?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink"}`,children:"User"})]}),e("button",{type:"button",onClick:te,className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 transition-colors text-[10px] flex items-center",title:"Expand / Collapse All",children:e(F,{size:14})})]})]}),e("div",{className:"space-y-1.5",children:!W&&y.length===0?e("div",{className:"p-4 text-center text-xs text-ink/40 italic bg-canvas rounded-xl border border-ink/10",children:"No raw messages recorded yet."}):y.map((p)=>{let k=Boolean(c[p.id]);return e("div",{className:`bg-canvas border border-ink/10 rounded-xl overflow-hidden transition-all duration-200 ${W?"opacity-50":""}`,children:[e("button",{type:"button",onClick:()=>ee(p.id),className:"w-full text-left px-3.5 py-2.5 flex items-center justify-between hover:bg-ink/5 transition-colors cursor-pointer",children:[e("div",{className:"flex items-center space-x-2 min-w-0 flex-1 mr-2",children:[e("span",{className:"text-ink/40 flex-shrink-0",children:k?e(B,{size:14}):e(se,{size:14})}),e("span",{className:"text-xs font-mono text-ink/90 truncate",children:p.badgeLabel})]}),e("div",{className:"flex items-center space-x-3 text-[11px] font-mono text-ink/50 flex-shrink-0",children:[p.tokenSummary&&e("span",{className:"text-ink/60",children:p.tokenSummary}),e("span",{className:"flex items-center gap-1.5",children:[e("span",{className:`w-2 h-2 rounded-full ${A(p.info.modelID)}`}),e("span",{children:p.timestamp})]})]})]}),k&&e("div",{className:"px-3.5 pb-3 pt-1 border-t border-ink/5 bg-canvas/60",children:e(G,{data:p.rawPayload})})]},p.id)})}),T>1&&e("div",{className:"flex items-center justify-between pt-1",children:[e("span",{className:"text-[10px] font-mono text-ink/50",children:[(M-1)*_+1,"–",Math.min(M*_,g)," of ",g]}),e("div",{className:"flex items-center gap-0.5",children:[e("button",{type:"button",disabled:M<=1,onClick:()=>U(M-1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Previous page",children:e(vo,{size:14})}),Y(M,T).map((p,k)=>p==="…"?e("span",{className:"px-1 text-[10px] font-mono text-ink/40 select-none",children:"…"},`gap-${k}`):e("button",{type:"button",onClick:()=>U(p),className:`min-w-[22px] h-[22px] px-1 rounded text-[10px] font-mono transition-colors ${p===M?"bg-ink text-canvas font-medium":"text-ink/60 hover:text-ink hover:bg-ink/5"}`,children:p},p)),e("button",{type:"button",disabled:M>=T,onClick:()=>U(M+1),className:"p-1 rounded text-ink/60 hover:text-ink hover:bg-ink/5 disabled:opacity-30 disabled:hover:bg-transparent transition-colors",title:"Next page",children:e(se,{size:14})})]})]})]})}function mt({className:l="",enabled:r=!0,refreshKey:c=0,tabsMode:h=!1}){let[x]=le(),m=x.get("sessionId"),[t,v]=n(()=>O(m||"default","Session not started")),y=i(!1),C=a(()=>{if(typeof window>"u")return;let R=m?`?sessionId=${encodeURIComponent(m)}`:"";fetch(`/api/telemetry/context${R}`).then((w)=>w.ok?w.json():null).then((w)=>{if(!y.current&&w&&w.telemetry)v(w.telemetry)}).catch((w)=>{if(!y.current)console.warn("Failed to fetch context telemetry:",w)})},[m]);o(()=>{if(y.current=!1,!r)return;return C(),()=>{y.current=!0}},[r,c,C]);let g=Ie(m?Gp(m):null,{enabled:r}),[I,W]=n(0);if(o(()=>{if(g.data)v(g.data),W((R)=>R+1)},[g.data]),!r)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${l}`,children:e("span",{className:"text-xs font-mono text-muted",children:"No session selected"})});if(t.messagesCount===0)return e("div",{className:`flex flex-col h-full bg-paper items-center justify-center text-ink/40 ${l}`,children:e("span",{className:"text-xs font-mono",children:"Session not started"})});return e("div",{className:`flex flex-col h-full bg-paper text-ink overflow-hidden select-none ${l}`,children:[e(bt,{left:e(d,{children:[e(Wa,{id:"context",tabsMode:h,children:e("h2",{className:"text-xs font-medium text-ink tracking-tight truncate",children:t.sessionTitle})}),e("span",{className:"text-[11px] text-ink/50 truncate font-mono",children:t.timestamp})]}),right:e(st,{label:"Refresh context telemetry",onClick:()=>{g.refresh(),C()},busy:g.refreshing,disabled:!r})}),e("div",{className:"flex-1 scrollbar-overlay-container p-4 space-y-4",children:[e(J,{used:t.contextUsed,limit:t.contextLimit,percent:t.contextPercent}),e(V,{messagesCount:t.messagesCount,userCount:t.userCount,assistantCount:t.assistantCount,costFormatted:t.costFormatted,cacheHitAverage:t.cacheHitAverage,costBreakdown:t.costBreakdown}),e(z,{input:t.lastMessage.input,output:t.lastMessage.output,reasoning:t.lastMessage.reasoning,cacheRead:t.lastMessage.cacheRead,cacheWrite:t.lastMessage.cacheWrite,cacheHitPercent:t.lastMessage.cacheHitPercent}),e(Q,{userPercent:t.distribution.userPercent,assistantPercent:t.distribution.assistantPercent,toolPercent:t.distribution.toolPercent,otherPercent:t.distribution.otherPercent}),e(X,{sessionId:m,refreshKey:c+I})]})]})}export{mt as ContextPanel};
@@ -1,3 +1,3 @@
1
- import{n,o,i,u,a,e,s,wr,Cr,ja,xo,Vr,Hi,Wi,Co,Zr}from"./index-amys498v.js";var Le={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]},M=s(Le);var Ee={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]},I=s(Ee);var ze={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]},D=s(ze);var Ze={name:"component",size:24,node:[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]},T=s(Ze);var Oe={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]},N=s(Oe);var ve={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]},C=s(ve);var Ue={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},q=s(Ue);var Me={name:"variable",size:24,node:[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]},P=s(Me);var Ie=450,K=8,De=700;function Ku({enabled:c,onLongPress:l}){let r=i(null),p=i(null),t=i(0),m=i(l);m.current=l;let d=a(()=>{if(r.current!==null)clearTimeout(r.current),r.current=null;p.current=null},[]);return o(()=>d,[d]),{onTouchStart:(h)=>{if(!c)return;let k=h.touches[0];if(!k)return;d(),p.current={x:k.clientX,y:k.clientY},r.current=setTimeout(()=>{r.current=null;let f=p.current;if(p.current=null,!f)return;t.current=Date.now(),m.current(f.x,f.y)},Ie)},onTouchMove:(h)=>{let k=p.current,f=h.touches[0];if(!k||!f)return;if(Math.abs(f.clientX-k.x)>K||Math.abs(f.clientY-k.y)>K)d()},onTouchEnd:d,onTouchCancel:d,consume:()=>{if(t.current===0)return!1;let h=Date.now()-t.current<De;return t.current=0,h}}}var H={class:{Icon:Cr,label:"Class"},interface:{Icon:Co,label:"Interface"},type:{Icon:Zr,label:"Type"},enum:{Icon:Vr,label:"Enum"},function:{Icon:M,label:"Function"},method:{Icon:T,label:"Method"},constant:{Icon:ja,label:"Constant"},variable:{Icon:P,label:"Variable"},struct:{Icon:D,label:"Struct"},trait:{Icon:Wi,label:"Trait"},impl:{Icon:I,label:"Impl"},module:{Icon:Hi,label:"Module"},heading:{Icon:N,label:"Heading"},selector:{Icon:C,label:"Selector"},key:{Icon:xo,label:"Key"},tag:{Icon:q,label:"Tag"},macro:{Icon:wr,label:"Macro"}};function Vu({kind:c,size:l=12}){let{Icon:r}=H[c];return e(r,{size:l,className:"flex-shrink-0 text-ink/45",strokeWidth:1.8})}function ei(c){return H[c].label}var Te={c:{line:["//"],block:["/*","*/"],quotes:["'",'"'],template:!0},css:{line:[],block:["/*","*/"],quotes:["'",'"']},python:{line:["#"],quotes:["'",'"'],triple:!0},hash:{line:["#"],quotes:["'",'"']},dash:{line:["--"],quotes:["'",'"']},lua:{line:["--"],block:["--[[","]]"],quotes:["'",'"']},sql:{line:["--"],block:["/*","*/"],quotes:["'",'"']},ml:{line:[],block:["(*","*)"],quotes:['"']},hcl:{line:["#","//"],block:["/*","*/"],quotes:[]},percent:{line:["%"],quotes:["'",'"']},lisp:{line:[";"],block:["#|","|#"],quotes:['"']},none:{line:[],quotes:['"',"'"]},raw:{line:[],quotes:[]}};function A(c,l){let r=Te[l],[p,t]=r.block??["",""],m=[],d="code",h="";for(let k of c){let f="";for(let b=0;b<k.length;b+=1){let y=k[b],g=k[b+1];if(d==="line"){f+=" ";continue}if(d==="block"){if(t&&y===t[0]&&k.startsWith(t,b)){d="code",f+=" ".repeat(t.length),b+=t.length-1;continue}f+=" ";continue}if(d==="quoted"||d==="template"||d==="triple"){if(y==="\\"){f+=" ",b+=1;continue}if(d==="triple"){if(y===h&&k.startsWith(h.repeat(3),b)){d="code",f+=" ",b+=2;continue}f+=" ";continue}if(f+=" ",y===h)d="code";continue}let S=r.line.find((Ae)=>k.startsWith(Ae,b));if(S){d="line",f+=" ".repeat(S.length),b+=S.length-1;continue}if(p&&k.startsWith(p,b)){d="block",f+=" ".repeat(p.length),b+=p.length-1;continue}if(r.triple&&y===(g??"")&&y===k[b+2]&&(y==="'"||y==='"')){d="triple",h=y,f+=" ",b+=2;continue}if(r.template&&y==="`"){d="template",h="`",f+=" ";continue}if(r.quotes?.includes(y)){d="quoted",h=y,f+=" ";continue}f+=y}if(d==="line"||d==="quoted")d="code";m.push(f)}return m}function Z(c){let l=0;for(let r of c)if(r==="{")l+=1;else if(r==="}")l-=1;return l}var L=[{kind:"class",re:/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d},{kind:"constant",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*[:=]/d}],$e=/^(?:(?:public|private|protected|static|async|readonly|override|abstract|declare|get|set)\s+)*(?:\*|#)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d,Ne=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d,Ce=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d,E=[{kind:"method",re:$e},{kind:"method",re:Ne},{kind:"variable",re:Ce}];function B(c,l){let r=A(c,l.mask),p=[],t=0,m=[];for(let d=0;d<r.length;d+=1){let h=r[d].trim(),k=m.length>0&&t===m[m.length-1].depth?m[m.length-1]:null;if(h&&(t===0||k)){let f=r[d].length-r[d].trimStart().length,b=k&&l.members?Ke(l.memberRules??[],h):null;if(b)p.push({name:b.name,kind:b.kind,line:d+1,column:f+b.column+1,depth:1});else{let y=k!==null&&qe.has(k.kind),g=O(l.rules,h,y);if(g){if(p.push({name:g.name,kind:y&&g.kind==="function"?"method":g.kind,line:d+1,column:f+g.column+1,depth:k?1:0}),!y&&(l.scopes??[]).includes(g.kind))m.push({depth:t+1,kind:g.kind})}}}if(t+=Z(r[d]),t<=0)t=0,m.length=0;else while(m.length>0&&t<m[m.length-1].depth)m.pop()}return p}var qe=new Set(["class","interface","struct","trait","impl","enum"]);function O(c,l,r){for(let p of c){if(r&&Pe.has(p.kind))continue;let t=p.re.exec(l),m=t?.[1]?.trim();if(!t||!m)continue;return{name:m,kind:p.kind,column:t.indices?.[1]?.[0]??0}}return null}var Pe=new Set(["class","interface","enum","type","struct","trait","impl","module"]);function Ke(c,l){for(let r of c){let p=r.re.exec(l),t=p?.[1]?.trim();if(!p||!t||He.has(t))continue;return{name:t,kind:r.kind,column:p.indices?.[1]?.[0]??0}}return null}var He=new Set(["if","for","while","switch","catch","return","throw","new","typeof","await","yield","super","this","delete","void","function","constructor","else","do","try","with"]);function j(c,l){let r=A(c,l.mask),p=[],t=[];for(let m=0;m<r.length;m+=1){let d=r[m],h=d.trim();if(!h)continue;let k=d.length-d.trimStart().length;while(t.length>0&&k<=t[t.length-1])t.pop();let f=O(l.rules,h,!1);if(!f)continue;if(t.length>1){t.push(k);continue}let b=t.length===1;p.push({name:f.name,kind:b&&f.kind==="function"?"method":f.kind,line:m+1,column:k+f.column+1,depth:b?1:0}),t.push(k)}return p}function F(c,l){let r=A(c,l.mask),p=[];for(let t=0;t<r.length;t+=1){let m=r[t],d=m.trim();if(!d)continue;let h=O(l.rules,d,!1);if(!h)continue;let k=p[p.length-1];if(l.dedupe&&k&&k.name===h.name&&k.kind===h.kind)continue;p.push({name:h.name,kind:h.kind,line:t+1,column:m.length-m.trimStart().length+h.column+1,depth:0})}return p}function W(c){let l=[],r=null;for(let p=0;p<c.length;p+=1){let t=c[p],m=/^\s*(```+|~~~+)/.exec(t);if(m){if(r===null)r=m[1][0];else if(m[1][0]===r)r=null;continue}if(r!==null)continue;let d=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(t);if(!d)continue;l.push({name:d[2],kind:"heading",line:p+1,column:d[1].length+2,depth:Math.min(d[1].length-1,2)})}return l}function Y(c){let l=A(c,"raw"),r=[],p=0;for(let t=0;t<l.length;t+=1){let m=l[t].trim();if(p===1){let d=/^"([^"]+)"\s*:/.exec(m);if(d)r.push({name:d[1],kind:"key",line:t+1,column:l[t].length-l[t].trimStart().length+1,depth:0})}if(p+=Z(l[t]),p<0)p=0}return r}var w=[{kind:"class",re:/^(?:(?:public|private|protected|internal|static|final|abstract|sealed|open|data|partial|export|declare)\s+)*(?:class|record|object)\s+([A-Za-z_$][\w$]*)/d},{kind:"struct",re:/^(?:(?:public|private|protected|internal|export|packed)\s+)*(?:struct|union)\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:(?:public|private|protected|internal|static|abstract|sealed)\s+)*interface\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:(?:public|private|protected|internal|static)\s+)*(?:enum|@interface)\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:(?:public|private|protected|internal|export)\s+)*(?:typedef|using)\b[^;=]*?\b([A-Za-z_]\w*)\s*(?:=|;|\{)/d},{kind:"trait",re:/^(?:(?:public|private|protected)\s+)*trait\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:(?:public|internal|export)\s+)*(?:namespace|package)\s+([A-Za-z_$][\w$.]*)/d},{kind:"function",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|export)\s+)*(?:fun|func|function|def|void|int|long|float|double|boolean|bool|char|byte|short|string|String|object|dynamic|var|auto|val|[A-Z][\w$<>[\],.? ]*)\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d},{kind:"macro",re:/^#\s*(?:define|import)\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:static\s+)?(?:const|constexpr|let|var|val)\s+([A-Za-z_$][\w$]*)/d}],X=[{kind:"method",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|readonly)\s+)*(?:<[^>]*>\s*)?([A-Za-z_$][\w$]*)\s*\(/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|override|volatile|transient|val|var|let|const)\s+)*([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|volatile|transient)\s+)*[A-Za-z_$][\w$<>[\],.?]*\s+([A-Za-z_$][\w$]*)\s*(?:=|;)/d}],G=[{kind:"function",re:/^func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/d},{kind:"struct",re:/^type\s+([A-Za-z_]\w*)\s+struct\b/d},{kind:"interface",re:/^type\s+([A-Za-z_]\w*)\s+interface\b/d},{kind:"type",re:/^type\s+([A-Za-z_]\w*)\s+/d},{kind:"constant",re:/^(?:var|const)\s+([A-Za-z_]\w*)/d}],V=[{kind:"function",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^(?:pub(?:\([^)]*\))?\s+)?enum\s+([A-Za-z_]\w*)/d},{kind:"trait",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:unsafe\s+)?trait\s+([A-Za-z_]\w*)/d},{kind:"module",re:/^(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)/d},{kind:"impl",re:/^(?:pub\s+)?impl(?:<[^>]*>)?\s+(?:[A-Za-z_][\w:<>]*\s+for\s+)?([A-Za-z_]\w*)/d},{kind:"macro",re:/^(?:pub\s+)?macro_rules!\s*([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/d}],J=[{kind:"class",re:/^class\s+([A-Z][\w:]*)/d},{kind:"module",re:/^module\s+([A-Z][\w:]*)/d},{kind:"function",re:/^def\s+(?:self\.)?([A-Za-z_]\w*[?!=]?)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*=/d}],Q=[{kind:"class",re:/^(?:(?:final|abstract|readonly)\s+)*(?:class|enum|trait)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:(?:public|private|protected|static|final|abstract)\s+)*function\s+&?([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:const|define\s*\(\s*['"])([A-Za-z_]\w*)/d}],ee=[{kind:"function",re:/^(?:local\s+)?function\s+([A-Za-z_][\w.:]*)/d},{kind:"variable",re:/^local\s+([A-Za-z_]\w*)\s*=/d}],ne=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:async\s+)?def\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*(?::[^=]+)?=/d}],te=[{kind:"function",re:/^(?:function\s+)?([A-Za-z_][\w-]*)\s*\(\s*\)/d},{kind:"function",re:/^function\s+([A-Za-z_][\w-]*)/d},{kind:"variable",re:/^(?:export\s+|declare\s+(?:-\w+\s+)*|readonly\s+)?([A-Za-z_]\w*)=/d}],re=[{kind:"module",re:/^defmodule\s+([A-Z][\w.]*)/d},{kind:"function",re:/^defp?\s+([a-z_]\w*[?!]?)/d},{kind:"macro",re:/^defmacro\s+([a-z_]\w*[?!]?)/d},{kind:"variable",re:/^@([a-z_]\w*)/d}],se=[{kind:"module",re:/^-module\(([a-z_]\w*)\)/d},{kind:"function",re:/^([a-z_]\w*)\s*\([^)]*\)\s*(?:when\s+.*)?->/d},{kind:"macro",re:/^-define\(([A-Za-z_]\w*)/d}],oe=[{kind:"module",re:/^module\s+([A-Z][\w.]*)/d},{kind:"type",re:/^(?:data|newtype|type|type alias)\s+([A-Z][\w]*)/d},{kind:"class",re:/^class\s+(?:\([^)]*\)\s*=>\s*)?([A-Z][\w]*)/d},{kind:"function",re:/^([a-z_][\w']*)\s*(?:::|[^=]*=)/d}],ie=[{kind:"module",re:/^module\s+(?:type\s+)?([A-Z][\w]*)/d},{kind:"type",re:/^type\s+(?:'[\w]+\s+)*([a-z_]\w*)/d},{kind:"class",re:/^class\s+(?:virtual\s+)?([a-z_]\w*)/d},{kind:"function",re:/^(?:let\s+rec\s+|let\s+|and\s+)([a-z_]\w*)/d}],z=[{kind:"function",re:/^\(defn-?\s+([^\s()]+)/d},{kind:"macro",re:/^\(defmacro\s+([^\s()]+)/d},{kind:"variable",re:/^\(def\s+([^\s()]+)/d},{kind:"module",re:/^\((?:ns|module|define-module|library)\s+\(?([^\s()]+)/d},{kind:"function",re:/^\(define\s+\(([^\s()]+)/d},{kind:"type",re:/^\(defrecord\s+([^\s()]+)/d},{kind:"class",re:/^\(defclass\s+([^\s()]+)/d}],ae=[{kind:"function",re:/^(?:pub\s+)?(?:export\s+)?(?:inline\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:extern\s+)?(?:packed\s+)?struct/d},{kind:"enum",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:packed\s+)?enum/d},{kind:"constant",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:pub\s+)?var\s+([A-Za-z_]\w*)/d}],le=[{kind:"module",re:/^(?:baremodule|module)\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:mutable\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^abstract\s+type\s+([A-Za-z_]\w*)/d},{kind:"macro",re:/^macro\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^function\s+([A-Za-z_]\w*[!?]?)/d},{kind:"function",re:/^([A-Za-z_]\w*[!?]?)\s*\([^)]*\)\s*(?:::[^=]+)?=/d},{kind:"constant",re:/^const\s+([A-Za-z_]\w*)/d}],ce=[{kind:"function",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)\s*function/d},{kind:"variable",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)/d}],ue=[{kind:"class",re:/^create\s+(?:or\s+replace\s+)?(?:table|view)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"function",re:/^create\s+(?:or\s+replace\s+)?(?:function|procedure)\s+["`]?([\w.]+)/id},{kind:"type",re:/^create\s+(?:or\s+replace\s+)?(?:type|domain|index)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"constant",re:/^create\s+(?:or\s+replace\s+)?(?:sequence|schema)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id}],v=[{kind:"class",re:/^(?:message|type|input|object)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^(?:interface|service|union|scalar)\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:query|mutation|subscription)\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:rpc\s+)?([A-Za-z_]\w*)\s*\([^)]*\)\s*(?::|returns|;)/d}],de=[{kind:"module",re:/^(?:resource|data|module|provider|variable|output|locals|terraform)\s+"([^"]+)"/d},{kind:"function",re:/^([A-Za-z_]\w*)\s*=\s*\{/d}],pe=[{kind:"function",re:/^([A-Za-z0-9_./-]+)\s*:(?!=)/d},{kind:"variable",re:/^(?:export\s+)?([A-Za-z_]\w*)\s*[:?+]?=/d}],me=[{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?\S+\s+[Aa][Ss]\s+(\S+)/d},{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?(\S+)/id},{kind:"variable",re:/^(?:ARG|ENV)\s+([A-Za-z_]\w*)/d}],fe=[{kind:"function",re:/^([A-Za-z_][\w'-]*)\s*=\s*(?:pkgs\.)?(?:lib\.)?(?:callPackage|\{)/d},{kind:"variable",re:/^([A-Za-z_][\w'-]*)\s*=/d}],x=[{kind:"macro",re:/^(@(?:mixin|function|keyframes)\s+[\w-]+)/d},{kind:"selector",re:/^(@(?:media|supports|layer|container)\s+[^{]+)/d},{kind:"selector",re:/^([.#&:][^{};]*(?:\s*,\s*[^{};]+)*)\s*\{/d},{kind:"variable",re:/^(--[\w-]+|@[\w-]+|\$[\w-]+)\s*:/d}],ke=[{kind:"module",re:/^package\s+([\w:]+)/d},{kind:"function",re:/^sub\s+([A-Za-z_]\w*)/d}],he=[{kind:"class",re:/^(?:abstract\s+)?(?:contract|library)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|modifier|constructor|fallback|receive)\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:event|error)\s+([A-Za-z_]\w*)/d}],be=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|filter|workflow)\s+([A-Za-z_][\w-]*)/d}],R=[{kind:"tag",re:/^\s*<([A-Z][\w.]*)/d},{kind:"tag",re:/^\s*<[a-z][\w-]*\b[^>]*\bid=["']([^"']+)["']/d}];var _={mask:"c",nesting:"braces",scopes:["class","module","interface","struct","trait","enum"],members:!0,memberRules:X},ye={typescript:{..._,rules:L,memberRules:E,scopes:["class"]},tsx:{..._,rules:L,memberRules:E,scopes:["class"]},javascript:{..._,rules:L,memberRules:E,scopes:["class"]},jsx:{..._,rules:L,memberRules:E,scopes:["class"]},java:{..._,rules:w},c:{..._,rules:w},cpp:{..._,rules:w},csharp:{..._,rules:w},"objective-c":{..._,rules:w},kotlin:{..._,rules:w},swift:{..._,rules:w},scala:{..._,rules:w},dart:{..._,rules:w},groovy:{..._,rules:w},solidity:{..._,rules:he},php:{mask:"c",nesting:"braces",rules:Q,scopes:["class","interface","trait"],members:!0},go:{mask:"c",nesting:"braces",rules:G},rust:{mask:"c",nesting:"braces",rules:V,scopes:["impl","trait"],members:!0},zig:{mask:"c",nesting:"braces",rules:ae,scopes:["struct","enum"],members:!0},hcl:{mask:"hcl",nesting:"braces",rules:de},protobuf:{mask:"c",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},graphql:{mask:"hash",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},css:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},less:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},scss:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},sass:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},stylus:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},ruby:{mask:"hash",nesting:"flat",rules:J},lua:{mask:"lua",nesting:"flat",rules:ee},elixir:{mask:"hash",nesting:"flat",rules:re},erlang:{mask:"percent",nesting:"flat",rules:se},haskell:{mask:"hash",nesting:"flat",rules:oe,dedupe:!0},ocaml:{mask:"ml",nesting:"flat",rules:ie},julia:{mask:"hash",nesting:"flat",rules:le},r:{mask:"hash",nesting:"flat",rules:ce},clojure:{mask:"lisp",nesting:"flat",rules:z},scheme:{mask:"lisp",nesting:"flat",rules:z},racket:{mask:"lisp",nesting:"flat",rules:z},perl:{mask:"hash",nesting:"flat",rules:ke},powershell:{mask:"hash",nesting:"flat",rules:be},bash:{mask:"hash",nesting:"flat",rules:te},sql:{mask:"sql",nesting:"flat",rules:ue},makefile:{mask:"hash",nesting:"flat",rules:pe},dockerfile:{mask:"hash",nesting:"flat",rules:me},nix:{mask:"hash",nesting:"flat",rules:fe},python:{mask:"python",nesting:"indent",rules:ne},yaml:{mask:"hash",nesting:"indent",rules:[{kind:"key",re:/^([A-Za-z_$][\w$.-]*)\s*:/d}]},toml:{mask:"hash",nesting:"flat",rules:[{kind:"module",re:/^\[\[?([^\]]+)\]\]?/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*=/d}]},ini:{mask:"none",nesting:"flat",rules:[{kind:"module",re:/^\[([^\]]+)\]/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},properties:{mask:"none",nesting:"flat",rules:[{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},json:{mask:"raw",nesting:"json",rules:[]},json5:{mask:"raw",nesting:"json",rules:[]},html:{mask:"raw",nesting:"flat",rules:R},xml:{mask:"raw",nesting:"flat",rules:R},svg:{mask:"raw",nesting:"flat",rules:R},vue:{mask:"raw",nesting:"flat",rules:R},svelte:{mask:"raw",nesting:"flat",rules:R},astro:{mask:"raw",nesting:"flat",rules:R},markdown:{mask:"none",nesting:"markdown",rules:[]},diff:{mask:"none",nesting:"flat",rules:[]}};function U(c,l){let r=ye[l];if(!c||!r)return[];let p=c.split(`
1
+ import{n,o,i,u,a,e,s,wr,Cr,ja,xo,Vr,Hi,Wi,Co,Zr}from"./index-4cag7w6k.js";var Le={name:"square-function",size:24,node:[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["path",{d:"M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3",key:"m1af9g"}],["path",{d:"M9 11.2h5.7",key:"3zgcl2"}]],aliases:["function-square"]},M=s(Le);var Ee={name:"blocks",size:24,node:[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]]},I=s(Ee);var ze={name:"box",size:24,node:[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]},D=s(ze);var Ze={name:"component",size:24,node:[["path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1uwlt4"}],["path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z",key:"10291m"}],["path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z",key:"1tqoq1"}],["path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z",key:"1x6lto"}]]},T=s(Ze);var Oe={name:"heading",size:24,node:[["path",{d:"M6 12h12",key:"8npq4p"}],["path",{d:"M6 20V4",key:"1w1bmo"}],["path",{d:"M18 20V4",key:"o2hl4u"}]]},N=s(Oe);var ve={name:"paintbrush",size:24,node:[["path",{d:"m14.622 17.897-10.68-2.913",key:"vj2p1u"}],["path",{d:"M18.376 2.622a1 1 0 1 1 3.002 3.002L17.36 9.643a.5.5 0 0 0 0 .707l.944.944a2.41 2.41 0 0 1 0 3.408l-.944.944a.5.5 0 0 1-.707 0L8.354 7.348a.5.5 0 0 1 0-.707l.944-.944a2.41 2.41 0 0 1 3.408 0l.944.944a.5.5 0 0 0 .707 0z",key:"18tc5c"}],["path",{d:"M9 8c-1.804 2.71-3.97 3.46-6.583 3.948a.507.507 0 0 0-.302.819l7.32 8.883a1 1 0 0 0 1.185.204C12.735 20.405 16 16.792 16 15",key:"ytzfxy"}]]},C=s(ve);var Ue={name:"tag",size:24,node:[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]},q=s(Ue);var Me={name:"variable",size:24,node:[["path",{d:"M8 21s-4-3-4-9 4-9 4-9",key:"uto9ud"}],["path",{d:"M16 3s4 3 4 9-4 9-4 9",key:"4w2vsq"}],["line",{x1:"15",x2:"9",y1:"9",y2:"15",key:"f7djnv"}],["line",{x1:"9",x2:"15",y1:"9",y2:"15",key:"1shsy8"}]]},P=s(Me);var Ie=450,K=8,De=700;function Ku({enabled:c,onLongPress:l}){let r=i(null),p=i(null),t=i(0),m=i(l);m.current=l;let d=a(()=>{if(r.current!==null)clearTimeout(r.current),r.current=null;p.current=null},[]);return o(()=>d,[d]),{onTouchStart:(h)=>{if(!c)return;let k=h.touches[0];if(!k)return;d(),p.current={x:k.clientX,y:k.clientY},r.current=setTimeout(()=>{r.current=null;let f=p.current;if(p.current=null,!f)return;t.current=Date.now(),m.current(f.x,f.y)},Ie)},onTouchMove:(h)=>{let k=p.current,f=h.touches[0];if(!k||!f)return;if(Math.abs(f.clientX-k.x)>K||Math.abs(f.clientY-k.y)>K)d()},onTouchEnd:d,onTouchCancel:d,consume:()=>{if(t.current===0)return!1;let h=Date.now()-t.current<De;return t.current=0,h}}}var H={class:{Icon:Cr,label:"Class"},interface:{Icon:Co,label:"Interface"},type:{Icon:Zr,label:"Type"},enum:{Icon:Vr,label:"Enum"},function:{Icon:M,label:"Function"},method:{Icon:T,label:"Method"},constant:{Icon:ja,label:"Constant"},variable:{Icon:P,label:"Variable"},struct:{Icon:D,label:"Struct"},trait:{Icon:Wi,label:"Trait"},impl:{Icon:I,label:"Impl"},module:{Icon:Hi,label:"Module"},heading:{Icon:N,label:"Heading"},selector:{Icon:C,label:"Selector"},key:{Icon:xo,label:"Key"},tag:{Icon:q,label:"Tag"},macro:{Icon:wr,label:"Macro"}};function Vu({kind:c,size:l=12}){let{Icon:r}=H[c];return e(r,{size:l,className:"flex-shrink-0 text-ink/45",strokeWidth:1.8})}function ei(c){return H[c].label}var Te={c:{line:["//"],block:["/*","*/"],quotes:["'",'"'],template:!0},css:{line:[],block:["/*","*/"],quotes:["'",'"']},python:{line:["#"],quotes:["'",'"'],triple:!0},hash:{line:["#"],quotes:["'",'"']},dash:{line:["--"],quotes:["'",'"']},lua:{line:["--"],block:["--[[","]]"],quotes:["'",'"']},sql:{line:["--"],block:["/*","*/"],quotes:["'",'"']},ml:{line:[],block:["(*","*)"],quotes:['"']},hcl:{line:["#","//"],block:["/*","*/"],quotes:[]},percent:{line:["%"],quotes:["'",'"']},lisp:{line:[";"],block:["#|","|#"],quotes:['"']},none:{line:[],quotes:['"',"'"]},raw:{line:[],quotes:[]}};function A(c,l){let r=Te[l],[p,t]=r.block??["",""],m=[],d="code",h="";for(let k of c){let f="";for(let b=0;b<k.length;b+=1){let y=k[b],g=k[b+1];if(d==="line"){f+=" ";continue}if(d==="block"){if(t&&y===t[0]&&k.startsWith(t,b)){d="code",f+=" ".repeat(t.length),b+=t.length-1;continue}f+=" ";continue}if(d==="quoted"||d==="template"||d==="triple"){if(y==="\\"){f+=" ",b+=1;continue}if(d==="triple"){if(y===h&&k.startsWith(h.repeat(3),b)){d="code",f+=" ",b+=2;continue}f+=" ";continue}if(f+=" ",y===h)d="code";continue}let S=r.line.find((Ae)=>k.startsWith(Ae,b));if(S){d="line",f+=" ".repeat(S.length),b+=S.length-1;continue}if(p&&k.startsWith(p,b)){d="block",f+=" ".repeat(p.length),b+=p.length-1;continue}if(r.triple&&y===(g??"")&&y===k[b+2]&&(y==="'"||y==='"')){d="triple",h=y,f+=" ",b+=2;continue}if(r.template&&y==="`"){d="template",h="`",f+=" ";continue}if(r.quotes?.includes(y)){d="quoted",h=y,f+=" ";continue}f+=y}if(d==="line"||d==="quoted")d="code";m.push(f)}return m}function Z(c){let l=0;for(let r of c)if(r==="{")l+=1;else if(r==="}")l-=1;return l}var L=[{kind:"class",re:/^(?:export\s+)?(?:default\s+)?(?:abstract\s+)?(?:declare\s+)?class\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:export\s+)?(?:declare\s+)?interface\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:export\s+)?(?:declare\s+)?type\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:export\s+)?(?:declare\s+)?(?:const\s+)?enum\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:export\s+)?(?:declare\s+)?(?:namespace|module)\s+([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:default\s+)?(?:async\s+)?function\s*\*?\s*([A-Za-z_$][\w$]*)/d},{kind:"function",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d},{kind:"constant",re:/^(?:export\s+)?(?:const|let|var)\s+([A-Za-z_$][\w$]*)\s*[:=]/d}],$e=/^(?:(?:public|private|protected|static|async|readonly|override|abstract|declare|get|set)\s+)*(?:\*|#)?([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d,Ne=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=]+)?=\s*(?:async\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*(?::[^=]+)?=>/d,Ce=/^(?:(?:public|private|protected|static|readonly|override|declare)\s+)*(?:#)?([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d,E=[{kind:"method",re:$e},{kind:"method",re:Ne},{kind:"variable",re:Ce}];function B(c,l){let r=A(c,l.mask),p=[],t=0,m=[];for(let d=0;d<r.length;d+=1){let h=r[d].trim(),k=m.length>0&&t===m[m.length-1].depth?m[m.length-1]:null;if(h&&(t===0||k)){let f=r[d].length-r[d].trimStart().length,b=k&&l.members?Ke(l.memberRules??[],h):null;if(b)p.push({name:b.name,kind:b.kind,line:d+1,column:f+b.column+1,depth:1});else{let y=k!==null&&qe.has(k.kind),g=O(l.rules,h,y);if(g){if(p.push({name:g.name,kind:y&&g.kind==="function"?"method":g.kind,line:d+1,column:f+g.column+1,depth:k?1:0}),!y&&(l.scopes??[]).includes(g.kind))m.push({depth:t+1,kind:g.kind})}}}if(t+=Z(r[d]),t<=0)t=0,m.length=0;else while(m.length>0&&t<m[m.length-1].depth)m.pop()}return p}var qe=new Set(["class","interface","struct","trait","impl","enum"]);function O(c,l,r){for(let p of c){if(r&&Pe.has(p.kind))continue;let t=p.re.exec(l),m=t?.[1]?.trim();if(!t||!m)continue;return{name:m,kind:p.kind,column:t.indices?.[1]?.[0]??0}}return null}var Pe=new Set(["class","interface","enum","type","struct","trait","impl","module"]);function Ke(c,l){for(let r of c){let p=r.re.exec(l),t=p?.[1]?.trim();if(!p||!t||He.has(t))continue;return{name:t,kind:r.kind,column:p.indices?.[1]?.[0]??0}}return null}var He=new Set(["if","for","while","switch","catch","return","throw","new","typeof","await","yield","super","this","delete","void","function","constructor","else","do","try","with"]);function j(c,l){let r=A(c,l.mask),p=[],t=[];for(let m=0;m<r.length;m+=1){let d=r[m],h=d.trim();if(!h)continue;let k=d.length-d.trimStart().length;while(t.length>0&&k<=t[t.length-1])t.pop();let f=O(l.rules,h,!1);if(!f)continue;if(t.length>1){t.push(k);continue}let b=t.length===1;p.push({name:f.name,kind:b&&f.kind==="function"?"method":f.kind,line:m+1,column:k+f.column+1,depth:b?1:0}),t.push(k)}return p}function F(c,l){let r=A(c,l.mask),p=[];for(let t=0;t<r.length;t+=1){let m=r[t],d=m.trim();if(!d)continue;let h=O(l.rules,d,!1);if(!h)continue;let k=p[p.length-1];if(l.dedupe&&k&&k.name===h.name&&k.kind===h.kind)continue;p.push({name:h.name,kind:h.kind,line:t+1,column:m.length-m.trimStart().length+h.column+1,depth:0})}return p}function W(c){let l=[],r=null;for(let p=0;p<c.length;p+=1){let t=c[p],m=/^\s*(```+|~~~+)/.exec(t);if(m){if(r===null)r=m[1][0];else if(m[1][0]===r)r=null;continue}if(r!==null)continue;let d=/^(#{1,6})\s+(.+?)\s*#*\s*$/.exec(t);if(!d)continue;l.push({name:d[2],kind:"heading",line:p+1,column:d[1].length+2,depth:Math.min(d[1].length-1,2)})}return l}function Y(c){let l=A(c,"raw"),r=[],p=0;for(let t=0;t<l.length;t+=1){let m=l[t].trim();if(p===1){let d=/^"([^"]+)"\s*:/.exec(m);if(d)r.push({name:d[1],kind:"key",line:t+1,column:l[t].length-l[t].trimStart().length+1,depth:0})}if(p+=Z(l[t]),p<0)p=0}return r}var w=[{kind:"class",re:/^(?:(?:public|private|protected|internal|static|final|abstract|sealed|open|data|partial|export|declare)\s+)*(?:class|record|object)\s+([A-Za-z_$][\w$]*)/d},{kind:"struct",re:/^(?:(?:public|private|protected|internal|export|packed)\s+)*(?:struct|union)\s+([A-Za-z_$][\w$]*)/d},{kind:"interface",re:/^(?:(?:public|private|protected|internal|static|abstract|sealed)\s+)*interface\s+([A-Za-z_$][\w$]*)/d},{kind:"enum",re:/^(?:(?:public|private|protected|internal|static)\s+)*(?:enum|@interface)\s+([A-Za-z_$][\w$]*)/d},{kind:"type",re:/^(?:(?:public|private|protected|internal|export)\s+)*(?:typedef|using)\b[^;=]*?\b([A-Za-z_]\w*)\s*(?:=|;|\{)/d},{kind:"trait",re:/^(?:(?:public|private|protected)\s+)*trait\s+([A-Za-z_$][\w$]*)/d},{kind:"module",re:/^(?:(?:public|internal|export)\s+)*(?:namespace|package)\s+([A-Za-z_$][\w$.]*)/d},{kind:"function",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|export)\s+)*(?:fun|func|function|def|void|int|long|float|double|boolean|bool|char|byte|short|string|String|object|dynamic|var|auto|val|[A-Z][\w$<>[\],.? ]*)\s+([A-Za-z_$][\w$]*)\s*(?:<[^>]*>)?\s*\(/d},{kind:"macro",re:/^#\s*(?:define|import)\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:static\s+)?(?:const|constexpr|let|var|val)\s+([A-Za-z_$][\w$]*)/d}],X=[{kind:"method",re:/^(?:(?:public|private|protected|internal|static|final|abstract|synchronized|override|open|suspend|inline|async|extern|unsafe|virtual|sealed|readonly)\s+)*(?:<[^>]*>\s*)?([A-Za-z_$][\w$]*)\s*\(/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|override|volatile|transient|val|var|let|const)\s+)*([A-Za-z_$][\w$]*)\s*(?::[^=;]+)?(?:=[^>]|;)/d},{kind:"variable",re:/^(?:(?:public|private|protected|internal|static|final|readonly|volatile|transient)\s+)*[A-Za-z_$][\w$<>[\],.?]*\s+([A-Za-z_$][\w$]*)\s*(?:=|;)/d}],G=[{kind:"function",re:/^func\s+(?:\([^)]*\)\s*)?([A-Za-z_]\w*)/d},{kind:"struct",re:/^type\s+([A-Za-z_]\w*)\s+struct\b/d},{kind:"interface",re:/^type\s+([A-Za-z_]\w*)\s+interface\b/d},{kind:"type",re:/^type\s+([A-Za-z_]\w*)\s+/d},{kind:"constant",re:/^(?:var|const)\s+([A-Za-z_]\w*)/d}],V=[{kind:"function",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:async\s+)?(?:const\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub(?:\([^)]*\))?\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^(?:pub(?:\([^)]*\))?\s+)?enum\s+([A-Za-z_]\w*)/d},{kind:"trait",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:unsafe\s+)?trait\s+([A-Za-z_]\w*)/d},{kind:"module",re:/^(?:pub(?:\([^)]*\))?\s+)?mod\s+([A-Za-z_]\w*)/d},{kind:"impl",re:/^(?:pub\s+)?impl(?:<[^>]*>)?\s+(?:[A-Za-z_][\w:<>]*\s+for\s+)?([A-Za-z_]\w*)/d},{kind:"macro",re:/^(?:pub\s+)?macro_rules!\s*([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:pub(?:\([^)]*\))?\s+)?(?:const|static)\s+([A-Za-z_]\w*)/d}],J=[{kind:"class",re:/^class\s+([A-Z][\w:]*)/d},{kind:"module",re:/^module\s+([A-Z][\w:]*)/d},{kind:"function",re:/^def\s+(?:self\.)?([A-Za-z_]\w*[?!=]?)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*=/d}],Q=[{kind:"class",re:/^(?:(?:final|abstract|readonly)\s+)*(?:class|enum|trait)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:(?:public|private|protected|static|final|abstract)\s+)*function\s+&?([A-Za-z_]\w*)/d},{kind:"constant",re:/^(?:const|define\s*\(\s*['"])([A-Za-z_]\w*)/d}],ee=[{kind:"function",re:/^(?:local\s+)?function\s+([A-Za-z_][\w.:]*)/d},{kind:"variable",re:/^local\s+([A-Za-z_]\w*)\s*=/d}],ne=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:async\s+)?def\s+([A-Za-z_]\w*)/d},{kind:"constant",re:/^([A-Z][A-Z0-9_]*)\s*(?::[^=]+)?=/d}],te=[{kind:"function",re:/^(?:function\s+)?([A-Za-z_][\w-]*)\s*\(\s*\)/d},{kind:"function",re:/^function\s+([A-Za-z_][\w-]*)/d},{kind:"variable",re:/^(?:export\s+|declare\s+(?:-\w+\s+)*|readonly\s+)?([A-Za-z_]\w*)=/d}],re=[{kind:"module",re:/^defmodule\s+([A-Z][\w.]*)/d},{kind:"function",re:/^defp?\s+([a-z_]\w*[?!]?)/d},{kind:"macro",re:/^defmacro\s+([a-z_]\w*[?!]?)/d},{kind:"variable",re:/^@([a-z_]\w*)/d}],se=[{kind:"module",re:/^-module\(([a-z_]\w*)\)/d},{kind:"function",re:/^([a-z_]\w*)\s*\([^)]*\)\s*(?:when\s+.*)?->/d},{kind:"macro",re:/^-define\(([A-Za-z_]\w*)/d}],oe=[{kind:"module",re:/^module\s+([A-Z][\w.]*)/d},{kind:"type",re:/^(?:data|newtype|type|type alias)\s+([A-Z][\w]*)/d},{kind:"class",re:/^class\s+(?:\([^)]*\)\s*=>\s*)?([A-Z][\w]*)/d},{kind:"function",re:/^([a-z_][\w']*)\s*(?:::|[^=]*=)/d}],ie=[{kind:"module",re:/^module\s+(?:type\s+)?([A-Z][\w]*)/d},{kind:"type",re:/^type\s+(?:'[\w]+\s+)*([a-z_]\w*)/d},{kind:"class",re:/^class\s+(?:virtual\s+)?([a-z_]\w*)/d},{kind:"function",re:/^(?:let\s+rec\s+|let\s+|and\s+)([a-z_]\w*)/d}],z=[{kind:"function",re:/^\(defn-?\s+([^\s()]+)/d},{kind:"macro",re:/^\(defmacro\s+([^\s()]+)/d},{kind:"variable",re:/^\(def\s+([^\s()]+)/d},{kind:"module",re:/^\((?:ns|module|define-module|library)\s+\(?([^\s()]+)/d},{kind:"function",re:/^\(define\s+\(([^\s()]+)/d},{kind:"type",re:/^\(defrecord\s+([^\s()]+)/d},{kind:"class",re:/^\(defclass\s+([^\s()]+)/d}],ae=[{kind:"function",re:/^(?:pub\s+)?(?:export\s+)?(?:inline\s+)?fn\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:extern\s+)?(?:packed\s+)?struct/d},{kind:"enum",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)\s*=\s*(?:packed\s+)?enum/d},{kind:"constant",re:/^(?:pub\s+)?const\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:pub\s+)?var\s+([A-Za-z_]\w*)/d}],le=[{kind:"module",re:/^(?:baremodule|module)\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^(?:mutable\s+)?struct\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^abstract\s+type\s+([A-Za-z_]\w*)/d},{kind:"macro",re:/^macro\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^function\s+([A-Za-z_]\w*[!?]?)/d},{kind:"function",re:/^([A-Za-z_]\w*[!?]?)\s*\([^)]*\)\s*(?:::[^=]+)?=/d},{kind:"constant",re:/^const\s+([A-Za-z_]\w*)/d}],ce=[{kind:"function",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)\s*function/d},{kind:"variable",re:/^([A-Za-z._][\w.]*)\s*(?:<-|=)/d}],ue=[{kind:"class",re:/^create\s+(?:or\s+replace\s+)?(?:table|view)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"function",re:/^create\s+(?:or\s+replace\s+)?(?:function|procedure)\s+["`]?([\w.]+)/id},{kind:"type",re:/^create\s+(?:or\s+replace\s+)?(?:type|domain|index)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id},{kind:"constant",re:/^create\s+(?:or\s+replace\s+)?(?:sequence|schema)\s+(?:if\s+not\s+exists\s+)?["`]?([\w.]+)/id}],v=[{kind:"class",re:/^(?:message|type|input|object)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^(?:interface|service|union|scalar)\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:query|mutation|subscription)\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:rpc\s+)?([A-Za-z_]\w*)\s*\([^)]*\)\s*(?::|returns|;)/d}],de=[{kind:"module",re:/^(?:resource|data|module|provider|variable|output|locals|terraform)\s+"([^"]+)"/d},{kind:"function",re:/^([A-Za-z_]\w*)\s*=\s*\{/d}],pe=[{kind:"function",re:/^([A-Za-z0-9_./-]+)\s*:(?!=)/d},{kind:"variable",re:/^(?:export\s+)?([A-Za-z_]\w*)\s*[:?+]?=/d}],me=[{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?\S+\s+[Aa][Ss]\s+(\S+)/d},{kind:"module",re:/^FROM\s+(?:--platform=\S+\s+)?(\S+)/id},{kind:"variable",re:/^(?:ARG|ENV)\s+([A-Za-z_]\w*)/d}],fe=[{kind:"function",re:/^([A-Za-z_][\w'-]*)\s*=\s*(?:pkgs\.)?(?:lib\.)?(?:callPackage|\{)/d},{kind:"variable",re:/^([A-Za-z_][\w'-]*)\s*=/d}],x=[{kind:"macro",re:/^(@(?:mixin|function|keyframes)\s+[\w-]+)/d},{kind:"selector",re:/^(@(?:media|supports|layer|container)\s+[^{]+)/d},{kind:"selector",re:/^([.#&:][^{};]*(?:\s*,\s*[^{};]+)*)\s*\{/d},{kind:"variable",re:/^(--[\w-]+|@[\w-]+|\$[\w-]+)\s*:/d}],ke=[{kind:"module",re:/^package\s+([\w:]+)/d},{kind:"function",re:/^sub\s+([A-Za-z_]\w*)/d}],he=[{kind:"class",re:/^(?:abstract\s+)?(?:contract|library)\s+([A-Za-z_]\w*)/d},{kind:"interface",re:/^interface\s+([A-Za-z_]\w*)/d},{kind:"struct",re:/^struct\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|modifier|constructor|fallback|receive)\s+([A-Za-z_]\w*)/d},{kind:"variable",re:/^(?:event|error)\s+([A-Za-z_]\w*)/d}],be=[{kind:"class",re:/^class\s+([A-Za-z_]\w*)/d},{kind:"enum",re:/^enum\s+([A-Za-z_]\w*)/d},{kind:"function",re:/^(?:function|filter|workflow)\s+([A-Za-z_][\w-]*)/d}],R=[{kind:"tag",re:/^\s*<([A-Z][\w.]*)/d},{kind:"tag",re:/^\s*<[a-z][\w-]*\b[^>]*\bid=["']([^"']+)["']/d}];var _={mask:"c",nesting:"braces",scopes:["class","module","interface","struct","trait","enum"],members:!0,memberRules:X},ye={typescript:{..._,rules:L,memberRules:E,scopes:["class"]},tsx:{..._,rules:L,memberRules:E,scopes:["class"]},javascript:{..._,rules:L,memberRules:E,scopes:["class"]},jsx:{..._,rules:L,memberRules:E,scopes:["class"]},java:{..._,rules:w},c:{..._,rules:w},cpp:{..._,rules:w},csharp:{..._,rules:w},"objective-c":{..._,rules:w},kotlin:{..._,rules:w},swift:{..._,rules:w},scala:{..._,rules:w},dart:{..._,rules:w},groovy:{..._,rules:w},solidity:{..._,rules:he},php:{mask:"c",nesting:"braces",rules:Q,scopes:["class","interface","trait"],members:!0},go:{mask:"c",nesting:"braces",rules:G},rust:{mask:"c",nesting:"braces",rules:V,scopes:["impl","trait"],members:!0},zig:{mask:"c",nesting:"braces",rules:ae,scopes:["struct","enum"],members:!0},hcl:{mask:"hcl",nesting:"braces",rules:de},protobuf:{mask:"c",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},graphql:{mask:"hash",nesting:"braces",rules:v,scopes:["class","interface"],members:!0},css:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},less:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},scss:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},sass:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},stylus:{mask:"css",nesting:"braces",rules:x,scopes:["selector"]},ruby:{mask:"hash",nesting:"flat",rules:J},lua:{mask:"lua",nesting:"flat",rules:ee},elixir:{mask:"hash",nesting:"flat",rules:re},erlang:{mask:"percent",nesting:"flat",rules:se},haskell:{mask:"hash",nesting:"flat",rules:oe,dedupe:!0},ocaml:{mask:"ml",nesting:"flat",rules:ie},julia:{mask:"hash",nesting:"flat",rules:le},r:{mask:"hash",nesting:"flat",rules:ce},clojure:{mask:"lisp",nesting:"flat",rules:z},scheme:{mask:"lisp",nesting:"flat",rules:z},racket:{mask:"lisp",nesting:"flat",rules:z},perl:{mask:"hash",nesting:"flat",rules:ke},powershell:{mask:"hash",nesting:"flat",rules:be},bash:{mask:"hash",nesting:"flat",rules:te},sql:{mask:"sql",nesting:"flat",rules:ue},makefile:{mask:"hash",nesting:"flat",rules:pe},dockerfile:{mask:"hash",nesting:"flat",rules:me},nix:{mask:"hash",nesting:"flat",rules:fe},python:{mask:"python",nesting:"indent",rules:ne},yaml:{mask:"hash",nesting:"indent",rules:[{kind:"key",re:/^([A-Za-z_$][\w$.-]*)\s*:/d}]},toml:{mask:"hash",nesting:"flat",rules:[{kind:"module",re:/^\[\[?([^\]]+)\]\]?/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*=/d}]},ini:{mask:"none",nesting:"flat",rules:[{kind:"module",re:/^\[([^\]]+)\]/d},{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},properties:{mask:"none",nesting:"flat",rules:[{kind:"key",re:/^([A-Za-z_][\w.-]*)\s*[=:]/d}]},json:{mask:"raw",nesting:"json",rules:[]},json5:{mask:"raw",nesting:"json",rules:[]},html:{mask:"raw",nesting:"flat",rules:R},xml:{mask:"raw",nesting:"flat",rules:R},svg:{mask:"raw",nesting:"flat",rules:R},vue:{mask:"raw",nesting:"flat",rules:R},svelte:{mask:"raw",nesting:"flat",rules:R},astro:{mask:"raw",nesting:"flat",rules:R},markdown:{mask:"none",nesting:"markdown",rules:[]},diff:{mask:"none",nesting:"flat",rules:[]}};function U(c,l){let r=ye[l];if(!c||!r)return[];let p=c.split(`
2
2
  `);if(r.nesting==="markdown")return W(p);if(r.nesting==="json")return Y(p);if(r.nesting==="indent")return j(p,r);if(r.nesting==="flat")return F(p,r);return B(p,r)}function _e(c,l){return U(c,l)}var Be={idle:"No file open in the editor.",loading:"Reading the file…",error:"Could not read this file.","not-a-document":"This tab has no outline.",diff:"Diff tabs have no outline.",ready:"No symbols found."};function ge(c,l){return l??Be[c]}var Se=8388608;function we(c){let l=c.length;if(l<=500)return{rows:c,total:l,truncated:!1};return{rows:c.slice(0,500),total:l,truncated:!0}}function Yu(c){return`Showing the first ${500 .toLocaleString()} of ${c.toLocaleString()} symbols.`}function Re(c){if(c<=8388608)return null;return`This file is ${(c/1048576).toFixed(1)} MB — too large to outline.`}var je=300;function xe(c){return c.length>Se}function Ju({content:c,language:l,state:r,note:p,path:t}){let[m,d]=n({content:c,language:l,path:t}),h=i(t);o(()=>{let y=t!==h.current;if(h.current=t,y||xe(c)){d((S)=>S.content===c&&S.language===l?S:{content:c,language:l,path:t});return}let g=window.setTimeout(()=>{d((S)=>S.content===c&&S.language===l?S:{content:c,language:l,path:t})},je);return()=>window.clearTimeout(g)},[t,c,l]);let k=u(()=>{if(r!=="ready"||xe(m.content))return[];return _e(m.content,m.language)},[r,m]),f=u(()=>we(k),[k]),b=r==="ready"?Re(c.length):null;return{symbols:f.rows,total:f.total,truncated:f.truncated,notice:b??ge(r,p)}}
3
3
  export{Ku,Vu,ei,Yu,Ju};
@@ -1,2 +1,2 @@
1
- import{d,n,K,i,e,s,f,B,re,Be,qa,xa,wt,Ea,fr,Et,Qt}from"./index-amys498v.js";import{Ra,Fa,Wo}from"./index-zq0qxb17.js";var Q={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]},w=s(Q);var Y={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]},O=s(Y);var j={name:"ratio",size:24,node:[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]},C=s(j);var ee={name:"tablet",size:24,node:[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]},N=s(ee);var g=[{id:"responsive",label:"Responsive (100% Fluid)",category:"responsive",icon:xa},{id:"desktop-16-9",label:"Desktop 16:9 (Auto H:W)",category:"responsive",icon:C},{id:"laptop",label:"Laptop (1024 × 768)",category:"responsive",icon:O},{id:"tablet",label:"Tablet (768 × 1024)",category:"mobile",icon:N},{id:"mobile",label:"Mobile Phone (375 × 667)",category:"mobile",icon:fr},{id:"mobile-lg",label:"Mobile Large (414 × 896)",category:"mobile",icon:fr}];function oe(t){switch(t){case"desktop-16-9":return"Desktop 16:9";case"laptop":return"Laptop 1024p";case"tablet":return"Tablet 768p";case"mobile":return"Mobile 375p";case"mobile-lg":return"Mobile Lg 414p";case"responsive":default:return"Responsive"}}function P({viewportMode:t,onChangeViewport:a,zoomLevel:r=100,onSetZoom:l}){let[p,c]=n(null);return e("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[e("div",{className:"hidden sm:flex items-center bg-canvas border border-ink/10 rounded-md p-0.5",children:[e("button",{type:"button",onClick:()=>a("responsive"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="responsive"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Responsive (100% Fluid)",children:e(xa,{size:12})}),e("button",{type:"button",onClick:()=>a("desktop-16-9"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="desktop-16-9"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Desktop 16:9 (Auto Height following Width)",children:e(C,{size:12})}),e("button",{type:"button",onClick:()=>a("tablet"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="tablet"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Tablet (768px)",children:e(N,{size:12})}),e("button",{type:"button",onClick:()=>a("mobile"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="mobile"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Mobile (375px)",children:e(fr,{size:12})})]}),e("button",{type:"button","aria-haspopup":"menu","aria-expanded":p!==null,onClick:(o)=>c(p?null:Et(o.currentTarget)),className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas border border-ink/15 hover:border-ink/30 text-ink text-[11px] font-mono transition-colors cursor-pointer",title:"Device & Responsive Testing Menu",children:[e("span",{className:"hidden md:inline text-[10px] font-medium",children:oe(t)}),e(B,{size:11,className:"text-ink/60"})]}),e(Qt,{anchor:p,ariaLabel:"Device & Responsive Testing Menu",className:"w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs font-mono",onClose:()=>c(null),children:[e("div",{className:"px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Responsive Testing"}),g.filter((o)=>o.category==="responsive").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{a(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Mobile Testing"}),g.filter((o)=>o.category==="mobile").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{a(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),l&&e(d,{children:[e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:["Zoom Scale (",r,"%)"]}),e("div",{className:"grid grid-cols-3 gap-1 px-2 py-1",children:[50,75,100,125,150,200].map((o)=>e("button",{type:"button",onClick:()=>{l(o),c(null)},className:`px-1.5 py-1 text-center rounded text-[11px] font-mono cursor-pointer transition-colors ${r===o?"bg-ink text-canvas font-semibold":"bg-canvas border border-ink/10 text-ink/75 hover:bg-ink/5"}`,children:[o,"%"]},o))})]})]})]})}function A({zoomLevel:t,onZoomIn:a,onZoomOut:r,onResetZoom:l}){return e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 text-xs font-mono",children:[e("button",{type:"button",onClick:r,disabled:t<=50,"aria-label":"Perkecil tampilan",title:"Zoom Out (-10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Fa,{size:12})}),e("button",{type:"button",onClick:l,className:"px-1 text-[10px] font-medium text-ink/75 hover:text-ink hover:underline cursor-pointer select-none",title:"Reset Zoom (100%)",children:[t,"%"]}),e("button",{type:"button",onClick:a,disabled:t>=200,"aria-label":"Perbesar tampilan",title:"Zoom In (+10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Ra,{size:12})})]})}var h="p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed";function V(t){let a=[],{url:r,zoomLevel:l,copied:p,included:c}=t;if(t.viewportMode&&t.onChangeViewport){let{viewportMode:o,onChangeViewport:u,onSetZoom:b}=t;a.push({id:"viewport",actions:g.map((x)=>({label:x.label,icon:x.icon,onSelect:()=>u(x.id),active:o===x.id})),children:e(P,{viewportMode:o,onChangeViewport:u,zoomLevel:l,onSetZoom:b})})}if(a.push({id:"zoom",actions:[{label:"Zoom in (+10%)",icon:Ra,onSelect:t.onZoomIn,disabled:l>=200},{label:"Zoom out (-10%)",icon:Fa,onSelect:t.onZoomOut,disabled:l<=50},{label:"Reset zoom (100%)",icon:wt,onSelect:t.onResetZoom,active:l===100}],children:e(A,{zoomLevel:l,onZoomIn:t.onZoomIn,onZoomOut:t.onZoomOut,onResetZoom:t.onResetZoom})}),a.push({id:"include",actions:[{label:c?"Page context added to the draft":"Include this page in the chat draft",icon:qa,onSelect:t.onIncludeInChat,disabled:!r}],children:e("button",{type:"button",onClick:t.onIncludeInChat,disabled:!r,"aria-label":"Include this page in the chat draft",title:c?"Page context added to the draft":"Include this page in the chat draft",className:h,children:c?e(f,{size:14,className:"text-success"}):e(qa,{size:14})})}),t.annotate){let o=t.annotate;a.push({id:"annotate",actions:[{label:o.count>0?`${o.active?"Tutup mode anotasi":"Buka mode anotasi"} (${o.count})`:"Mark a part of the page, then send it to the chat",icon:w,onSelect:o.onToggle,active:o.active,disabled:!r}],children:e("button",{type:"button",onClick:o.onToggle,disabled:!r,"aria-label":"Page annotation mode","aria-pressed":o.active,title:o.active?"Tutup mode anotasi":o.count>0?`Anotasi (${o.count}) — buka lagi`:"Mark a part of the page, then send it to the chat",className:`${h} relative ${o.active?"bg-ink/10 text-ink":""}`,children:[e(w,{size:14}),o.count>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-0.5 rounded-full bg-error text-paper text-[10px] leading-[13px] font-mono text-center",children:o.count})]})})}if(a.push({id:"copy",actions:[{label:p?"Copied URL!":"Copy URL",icon:re,onSelect:t.onCopy,disabled:!r}],children:e("button",{type:"button",onClick:t.onCopy,disabled:!r,"aria-label":"Salin URL",title:p?"Copied URL!":"Copy URL",className:h,children:p?e(f,{size:14,className:"text-success"}):e(re,{size:14})})}),t.onReconnect){let o=t.onReconnect;a.push({id:"reconnect",actions:[{label:"Sambungkan ulang live view",icon:Ea,onSelect:o}],children:e("button",{type:"button",onClick:o,"aria-label":"Sambungkan ulang live view",title:"Reconnect live view",className:h,children:e(Ea,{size:14})})})}return a.push({id:"open-external",actions:[{label:t.openExternalLabel,icon:Be,onSelect:t.onOpenExternal,disabled:!r}],children:e("button",{type:"button",onClick:t.onOpenExternal,disabled:!r,"aria-label":t.openExternalLabel,title:t.openExternalTitle,className:h,children:e(Be,{size:14})})}),a}var E=108,te=280,ne=18,ie=140,ae=36;function Nu({url:t,statusDotClass:a,statusLabel:r,viewportMode:l,zoomLevel:p,onChangeViewport:c,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:x,annotate:D,onIncludeInChat:_,onOpenExternal:U,onReconnect:W,openExternalLabel:H,openExternalTitle:X,twoRows:k=!1,children:q}){let[F,T]=n(!1),[G,R]=n(!1),y=i(null),[m,I]=n(0),S=V({url:t,zoomLevel:p,copied:F,included:G,viewportMode:l,onChangeViewport:c,annotate:D,onReconnect:W,onIncludeInChat:()=>{_(),R(!0),setTimeout(()=>R(!1),2500)},onCopy:()=>{if(!t)return;navigator.clipboard.writeText(t).then(()=>{T(!0),setTimeout(()=>T(!1),2000)}).catch(()=>{})},onOpenExternal:U,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:x,openExternalLabel:H,openExternalTitle:X});K(()=>{let v=y.current;if(!v)return;I(v.clientWidth)}),K(()=>{let v=y.current;if(!v||typeof ResizeObserver>"u")return;let L=new ResizeObserver(()=>I(v.clientWidth));return L.observe(v),()=>L.disconnect()},[]);let M=m===0||m>=te,Z=M?m>0?Math.min(E,m*0.25):E:ne,z=k?m>0?m:void 0:m>0?Math.max(0,m-Z-ie-ae):void 0,J=e("div",{className:"flex items-center space-x-1.5 flex-shrink-0 min-w-0",style:{maxWidth:`${Z}px`},title:r,children:[e("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${a}`}),M&&e("span",{className:"text-[10px] font-mono uppercase tracking-wide text-ink/60 truncate",children:r})]});return e("div",{ref:y,"data-browser-toolbar":"",className:`px-2.5 border-b border-ink/10 bg-paper flex flex-col gap-y-1 flex-shrink-0 select-none ${k?"py-1":"h-10 justify-center"}`,children:[e("div",{"data-toolbar-band":"address",className:"flex items-center gap-x-2 min-w-0",children:[J,e("div",{className:"flex flex-1 min-w-0 items-center",children:q}),!k&&e(Wo,{clusters:S,available:z})]}),k&&e("div",{"data-toolbar-band":"controls",className:"flex items-center min-w-0",children:e(Wo,{clusters:S,available:z})})]})}
1
+ import{d,n,K,i,e,s,f,B,re,Be,qa,xa,wt,Ea,fr,Et,Qt}from"./index-4cag7w6k.js";import{Ra,Fa,Wo}from"./index-fzngzhww.js";var Q={name:"square-pen",size:24,node:[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],aliases:["pen-box","edit","pen-square"]},w=s(Q);var Y={name:"laptop",size:24,node:[["path",{d:"M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z",key:"1pdavp"}],["path",{d:"M20.054 15.987H3.946",key:"14rxg9"}]]},O=s(Y);var j={name:"ratio",size:24,node:[["rect",{width:"12",height:"20",x:"6",y:"2",rx:"2",key:"1oxtiu"}],["rect",{width:"20",height:"12",x:"2",y:"6",rx:"2",key:"9lu3g6"}]]},C=s(j);var ee={name:"tablet",size:24,node:[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["line",{x1:"12",x2:"12.01",y1:"18",y2:"18",key:"1dp563"}]]},N=s(ee);var g=[{id:"responsive",label:"Responsive (100% Fluid)",category:"responsive",icon:xa},{id:"desktop-16-9",label:"Desktop 16:9 (Auto H:W)",category:"responsive",icon:C},{id:"laptop",label:"Laptop (1024 × 768)",category:"responsive",icon:O},{id:"tablet",label:"Tablet (768 × 1024)",category:"mobile",icon:N},{id:"mobile",label:"Mobile Phone (375 × 667)",category:"mobile",icon:fr},{id:"mobile-lg",label:"Mobile Large (414 × 896)",category:"mobile",icon:fr}];function oe(t){switch(t){case"desktop-16-9":return"Desktop 16:9";case"laptop":return"Laptop 1024p";case"tablet":return"Tablet 768p";case"mobile":return"Mobile 375p";case"mobile-lg":return"Mobile Lg 414p";case"responsive":default:return"Responsive"}}function P({viewportMode:t,onChangeViewport:a,zoomLevel:r=100,onSetZoom:l}){let[p,c]=n(null);return e("div",{className:"flex items-center space-x-1.5 flex-shrink-0",children:[e("div",{className:"hidden sm:flex items-center bg-canvas border border-ink/10 rounded-md p-0.5",children:[e("button",{type:"button",onClick:()=>a("responsive"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="responsive"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Responsive (100% Fluid)",children:e(xa,{size:12})}),e("button",{type:"button",onClick:()=>a("desktop-16-9"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="desktop-16-9"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Desktop 16:9 (Auto Height following Width)",children:e(C,{size:12})}),e("button",{type:"button",onClick:()=>a("tablet"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="tablet"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Tablet (768px)",children:e(N,{size:12})}),e("button",{type:"button",onClick:()=>a("mobile"),className:`p-1 rounded text-xs transition-colors cursor-pointer ${t==="mobile"?"bg-ink text-canvas font-medium":"text-ink/50 hover:text-ink"}`,title:"Mobile (375px)",children:e(fr,{size:12})})]}),e("button",{type:"button","aria-haspopup":"menu","aria-expanded":p!==null,onClick:(o)=>c(p?null:Et(o.currentTarget)),className:"flex items-center space-x-1 px-2 py-1 rounded bg-canvas border border-ink/15 hover:border-ink/30 text-ink text-[11px] font-mono transition-colors cursor-pointer",title:"Device & Responsive Testing Menu",children:[e("span",{className:"hidden md:inline text-[10px] font-medium",children:oe(t)}),e(B,{size:11,className:"text-ink/60"})]}),e(Qt,{anchor:p,ariaLabel:"Device & Responsive Testing Menu",className:"w-56 bg-paper border border-ink/15 rounded-lg shadow-xl py-1 text-xs font-mono",onClose:()=>c(null),children:[e("div",{className:"px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Responsive Testing"}),g.filter((o)=>o.category==="responsive").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{a(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:"Mobile Testing"}),g.filter((o)=>o.category==="mobile").map((o)=>{let u=o.icon,b=t===o.id;return e("button",{type:"button",onClick:()=>{a(o.id),c(null)},className:`w-full px-2.5 py-1.5 flex items-center justify-between text-left hover:bg-ink/5 cursor-pointer ${b?"bg-ink/10 font-semibold text-ink":"text-ink/75"}`,children:[e("div",{className:"flex items-center space-x-2",children:[e(u,{size:13,className:"text-ink/60"}),e("span",{children:o.label})]}),b&&e(f,{size:12,className:"text-success"})]},o.id)}),l&&e(d,{children:[e("div",{className:"mt-1 pt-1 border-t border-ink/10 px-2.5 py-1 text-[10px] text-ink/40 uppercase tracking-wider font-semibold",children:["Zoom Scale (",r,"%)"]}),e("div",{className:"grid grid-cols-3 gap-1 px-2 py-1",children:[50,75,100,125,150,200].map((o)=>e("button",{type:"button",onClick:()=>{l(o),c(null)},className:`px-1.5 py-1 text-center rounded text-[11px] font-mono cursor-pointer transition-colors ${r===o?"bg-ink text-canvas font-semibold":"bg-canvas border border-ink/10 text-ink/75 hover:bg-ink/5"}`,children:[o,"%"]},o))})]})]})]})}function A({zoomLevel:t,onZoomIn:a,onZoomOut:r,onResetZoom:l}){return e("div",{className:"flex items-center bg-canvas border border-ink/10 rounded-md p-0.5 space-x-0.5 text-xs font-mono",children:[e("button",{type:"button",onClick:r,disabled:t<=50,"aria-label":"Perkecil tampilan",title:"Zoom Out (-10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Fa,{size:12})}),e("button",{type:"button",onClick:l,className:"px-1 text-[10px] font-medium text-ink/75 hover:text-ink hover:underline cursor-pointer select-none",title:"Reset Zoom (100%)",children:[t,"%"]}),e("button",{type:"button",onClick:a,disabled:t>=200,"aria-label":"Perbesar tampilan",title:"Zoom In (+10%)",className:"p-1 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink cursor-pointer disabled:cursor-not-allowed transition-colors",children:e(Ra,{size:12})})]})}var h="p-1.5 rounded hover:bg-ink/5 disabled:opacity-25 disabled:hover:bg-transparent text-ink/70 hover:text-ink transition-colors cursor-pointer disabled:cursor-not-allowed";function V(t){let a=[],{url:r,zoomLevel:l,copied:p,included:c}=t;if(t.viewportMode&&t.onChangeViewport){let{viewportMode:o,onChangeViewport:u,onSetZoom:b}=t;a.push({id:"viewport",actions:g.map((x)=>({label:x.label,icon:x.icon,onSelect:()=>u(x.id),active:o===x.id})),children:e(P,{viewportMode:o,onChangeViewport:u,zoomLevel:l,onSetZoom:b})})}if(a.push({id:"zoom",actions:[{label:"Zoom in (+10%)",icon:Ra,onSelect:t.onZoomIn,disabled:l>=200},{label:"Zoom out (-10%)",icon:Fa,onSelect:t.onZoomOut,disabled:l<=50},{label:"Reset zoom (100%)",icon:wt,onSelect:t.onResetZoom,active:l===100}],children:e(A,{zoomLevel:l,onZoomIn:t.onZoomIn,onZoomOut:t.onZoomOut,onResetZoom:t.onResetZoom})}),a.push({id:"include",actions:[{label:c?"Page context added to the draft":"Include this page in the chat draft",icon:qa,onSelect:t.onIncludeInChat,disabled:!r}],children:e("button",{type:"button",onClick:t.onIncludeInChat,disabled:!r,"aria-label":"Include this page in the chat draft",title:c?"Page context added to the draft":"Include this page in the chat draft",className:h,children:c?e(f,{size:14,className:"text-success"}):e(qa,{size:14})})}),t.annotate){let o=t.annotate;a.push({id:"annotate",actions:[{label:o.count>0?`${o.active?"Tutup mode anotasi":"Buka mode anotasi"} (${o.count})`:"Mark a part of the page, then send it to the chat",icon:w,onSelect:o.onToggle,active:o.active,disabled:!r}],children:e("button",{type:"button",onClick:o.onToggle,disabled:!r,"aria-label":"Page annotation mode","aria-pressed":o.active,title:o.active?"Tutup mode anotasi":o.count>0?`Anotasi (${o.count}) — buka lagi`:"Mark a part of the page, then send it to the chat",className:`${h} relative ${o.active?"bg-ink/10 text-ink":""}`,children:[e(w,{size:14}),o.count>0&&e("span",{className:"absolute -top-0.5 -right-0.5 min-w-[13px] h-[13px] px-0.5 rounded-full bg-error text-paper text-[10px] leading-[13px] font-mono text-center",children:o.count})]})})}if(a.push({id:"copy",actions:[{label:p?"Copied URL!":"Copy URL",icon:re,onSelect:t.onCopy,disabled:!r}],children:e("button",{type:"button",onClick:t.onCopy,disabled:!r,"aria-label":"Salin URL",title:p?"Copied URL!":"Copy URL",className:h,children:p?e(f,{size:14,className:"text-success"}):e(re,{size:14})})}),t.onReconnect){let o=t.onReconnect;a.push({id:"reconnect",actions:[{label:"Sambungkan ulang live view",icon:Ea,onSelect:o}],children:e("button",{type:"button",onClick:o,"aria-label":"Sambungkan ulang live view",title:"Reconnect live view",className:h,children:e(Ea,{size:14})})})}return a.push({id:"open-external",actions:[{label:t.openExternalLabel,icon:Be,onSelect:t.onOpenExternal,disabled:!r}],children:e("button",{type:"button",onClick:t.onOpenExternal,disabled:!r,"aria-label":t.openExternalLabel,title:t.openExternalTitle,className:h,children:e(Be,{size:14})})}),a}var E=108,te=280,ne=18,ie=140,ae=36;function Nu({url:t,statusDotClass:a,statusLabel:r,viewportMode:l,zoomLevel:p,onChangeViewport:c,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:x,annotate:D,onIncludeInChat:_,onOpenExternal:U,onReconnect:W,openExternalLabel:H,openExternalTitle:X,twoRows:k=!1,children:q}){let[F,T]=n(!1),[G,R]=n(!1),y=i(null),[m,I]=n(0),S=V({url:t,zoomLevel:p,copied:F,included:G,viewportMode:l,onChangeViewport:c,annotate:D,onReconnect:W,onIncludeInChat:()=>{_(),R(!0),setTimeout(()=>R(!1),2500)},onCopy:()=>{if(!t)return;navigator.clipboard.writeText(t).then(()=>{T(!0),setTimeout(()=>T(!1),2000)}).catch(()=>{})},onOpenExternal:U,onZoomIn:o,onZoomOut:u,onResetZoom:b,onSetZoom:x,openExternalLabel:H,openExternalTitle:X});K(()=>{let v=y.current;if(!v)return;I(v.clientWidth)}),K(()=>{let v=y.current;if(!v||typeof ResizeObserver>"u")return;let L=new ResizeObserver(()=>I(v.clientWidth));return L.observe(v),()=>L.disconnect()},[]);let M=m===0||m>=te,Z=M?m>0?Math.min(E,m*0.25):E:ne,z=k?m>0?m:void 0:m>0?Math.max(0,m-Z-ie-ae):void 0,J=e("div",{className:"flex items-center space-x-1.5 flex-shrink-0 min-w-0",style:{maxWidth:`${Z}px`},title:r,children:[e("span",{className:`w-1.5 h-1.5 rounded-full flex-shrink-0 ${a}`}),M&&e("span",{className:"text-[10px] font-mono uppercase tracking-wide text-ink/60 truncate",children:r})]});return e("div",{ref:y,"data-browser-toolbar":"",className:`px-2.5 border-b border-ink/10 bg-paper flex flex-col gap-y-1 flex-shrink-0 select-none ${k?"py-1":"h-10 justify-center"}`,children:[e("div",{"data-toolbar-band":"address",className:"flex items-center gap-x-2 min-w-0",children:[J,e("div",{className:"flex flex-1 min-w-0 items-center",children:q}),!k&&e(Wo,{clusters:S,available:z})]}),k&&e("div",{"data-toolbar-band":"controls",className:"flex items-center min-w-0",children:e(Wo,{clusters:S,available:z})})]})}
2
2
  export{Nu};
@@ -1,2 +1,2 @@
1
- import{t}from"./index-x1fqhhpp.js";function ye(c,e){if(c.accDescr)e.setAccDescription?.(c.accDescr);if(c.accTitle)e.setAccTitle?.(c.accTitle);if(c.title)e.setDiagramTitle?.(c.title)}t(ye,"populateCommonDb");
1
+ import{t}from"./index-60v30k5h.js";function ye(c,e){if(c.accDescr)e.setAccDescription?.(c.accDescr);if(c.accTitle)e.setAccTitle?.(c.accTitle);if(c.title)e.setDiagramTitle?.(c.title)}t(ye,"populateCommonDb");
2
2
  export{ye};