pmx-canvas 0.3.0 → 0.3.2

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 (161) hide show
  1. package/CHANGELOG.md +73 -0
  2. package/dist/canvas/index.js +65 -65
  3. package/dist/types/cli/agent.d.ts +9 -1
  4. package/dist/types/cli/daemon.d.ts +74 -0
  5. package/dist/types/cli/watch.d.ts +2 -2
  6. package/dist/types/client/canvas/CanvasViewport.d.ts +1 -1
  7. package/dist/types/client/canvas/CommandPalette.d.ts +1 -1
  8. package/dist/types/client/canvas/Minimap.d.ts +1 -1
  9. package/dist/types/client/nodes/ExtAppFrame.d.ts +9 -1
  10. package/dist/types/client/nodes/FileNode.d.ts +1 -1
  11. package/dist/types/client/nodes/ImageNode.d.ts +1 -1
  12. package/dist/types/client/nodes/InlineFormatBar.d.ts +1 -1
  13. package/dist/types/client/nodes/MarkdownNode.d.ts +1 -1
  14. package/dist/types/client/nodes/PromptNode.d.ts +1 -1
  15. package/dist/types/client/nodes/ResponseNode.d.ts +1 -1
  16. package/dist/types/server/canvas-schema.d.ts +1 -1
  17. package/dist/types/server/html-primitives.d.ts +1 -1
  18. package/dist/types/server/index.d.ts +4 -4
  19. package/dist/types/server/operations/index.d.ts +1 -1
  20. package/dist/types/server/operations/ops/ax-read.d.ts +2 -0
  21. package/dist/types/server/operations/ops/canvas-wire.d.ts +2 -0
  22. package/dist/types/server/operations/ops/ext-app.d.ts +2 -0
  23. package/dist/types/server/server.d.ts +8 -0
  24. package/docs/cli.md +10 -1
  25. package/docs/http-api.md +28 -0
  26. package/docs/plans/plan-009-tech-debt-backlog.md +5 -5
  27. package/docs/screenshot.png +0 -0
  28. package/docs/tech-debt-assessment-2026-07.md +2 -2
  29. package/package.json +5 -2
  30. package/skills/pmx-canvas/SKILL.md +15 -10
  31. package/skills/pmx-canvas/references/full-reference.md +17 -3
  32. package/src/cli/agent.ts +1951 -1571
  33. package/src/cli/daemon.ts +460 -0
  34. package/src/cli/index.ts +80 -323
  35. package/src/cli/watch.ts +2 -10
  36. package/src/client/App.tsx +48 -46
  37. package/src/client/canvas/AttentionHistory.tsx +11 -1
  38. package/src/client/canvas/CanvasNode.tsx +41 -29
  39. package/src/client/canvas/CanvasViewport.tsx +101 -66
  40. package/src/client/canvas/CommandPalette.tsx +61 -27
  41. package/src/client/canvas/ContextMenu.tsx +13 -20
  42. package/src/client/canvas/ContextPinBar.tsx +1 -5
  43. package/src/client/canvas/ContextPinHud.tsx +1 -6
  44. package/src/client/canvas/DockedNode.tsx +4 -4
  45. package/src/client/canvas/EdgeLayer.tsx +37 -36
  46. package/src/client/canvas/ExpandedNodeOverlay.tsx +69 -45
  47. package/src/client/canvas/FocusFieldLayer.tsx +20 -22
  48. package/src/client/canvas/IntentLayer.tsx +31 -14
  49. package/src/client/canvas/Minimap.tsx +11 -16
  50. package/src/client/canvas/SelectionBar.tsx +4 -11
  51. package/src/client/canvas/ShortcutOverlay.tsx +3 -1
  52. package/src/client/canvas/SnapshotPanel.tsx +77 -95
  53. package/src/client/canvas/auto-fit.ts +15 -14
  54. package/src/client/canvas/snap-guides.ts +12 -12
  55. package/src/client/canvas/use-node-resize.ts +1 -5
  56. package/src/client/canvas/use-pan-zoom.ts +25 -26
  57. package/src/client/ext-app/bridge.ts +3 -12
  58. package/src/client/icons.tsx +63 -20
  59. package/src/client/nodes/ContextNode.tsx +14 -25
  60. package/src/client/nodes/ExtAppFrame.tsx +194 -80
  61. package/src/client/nodes/FileNode.tsx +74 -62
  62. package/src/client/nodes/GroupNode.tsx +4 -6
  63. package/src/client/nodes/HtmlNode.tsx +76 -46
  64. package/src/client/nodes/ImageNode.tsx +18 -27
  65. package/src/client/nodes/InlineFormatBar.tsx +4 -21
  66. package/src/client/nodes/InlineMarkdownEditor.tsx +0 -1
  67. package/src/client/nodes/LedgerNode.tsx +10 -4
  68. package/src/client/nodes/MarkdownNode.tsx +3 -10
  69. package/src/client/nodes/McpAppNode.tsx +26 -22
  70. package/src/client/nodes/MdFormatBar.tsx +10 -7
  71. package/src/client/nodes/PromptNode.tsx +23 -51
  72. package/src/client/nodes/ResponseNode.tsx +3 -13
  73. package/src/client/nodes/StatusNode.tsx +5 -9
  74. package/src/client/nodes/StatusSummary.tsx +2 -8
  75. package/src/client/nodes/WebpageNode.tsx +20 -14
  76. package/src/client/nodes/iframe-document-url.ts +25 -16
  77. package/src/client/nodes/image-warnings.ts +1 -7
  78. package/src/client/nodes/md-format.ts +20 -5
  79. package/src/client/state/attention-bridge.ts +4 -9
  80. package/src/client/state/attention-store.ts +1 -7
  81. package/src/client/state/canvas-store.ts +52 -36
  82. package/src/client/state/intent-bridge.ts +176 -112
  83. package/src/client/state/intent-store.ts +4 -1
  84. package/src/client/state/sse-bridge.ts +53 -70
  85. package/src/json-render/catalog.ts +12 -16
  86. package/src/json-render/charts/components.tsx +16 -20
  87. package/src/json-render/charts/extra-components.tsx +8 -16
  88. package/src/json-render/charts/extra-definitions.ts +1 -2
  89. package/src/json-render/charts/tufte-components.tsx +37 -20
  90. package/src/json-render/charts/tufte-definitions.ts +8 -2
  91. package/src/json-render/renderer/index.tsx +42 -22
  92. package/src/json-render/schema.ts +6 -3
  93. package/src/json-render/server.ts +33 -39
  94. package/src/mcp/canvas-access.ts +35 -21
  95. package/src/mcp/server.ts +132 -70
  96. package/src/server/agent-context.ts +63 -36
  97. package/src/server/ax-context.ts +7 -5
  98. package/src/server/ax-interaction.ts +176 -43
  99. package/src/server/ax-state-manager.ts +182 -39
  100. package/src/server/ax-state.ts +142 -47
  101. package/src/server/canvas-db.ts +213 -95
  102. package/src/server/canvas-operations.ts +180 -123
  103. package/src/server/canvas-provenance.ts +1 -4
  104. package/src/server/canvas-schema.ts +454 -73
  105. package/src/server/canvas-serialization.ts +27 -35
  106. package/src/server/canvas-state.ts +150 -58
  107. package/src/server/chart-template.ts +4 -5
  108. package/src/server/code-graph.ts +19 -6
  109. package/src/server/diagram-presets.ts +28 -29
  110. package/src/server/ext-app-lookup.ts +3 -12
  111. package/src/server/html-node-summary.ts +19 -10
  112. package/src/server/html-primitives.ts +326 -97
  113. package/src/server/html-surface.ts +6 -9
  114. package/src/server/image-source.ts +6 -4
  115. package/src/server/index.ts +320 -217
  116. package/src/server/intent-registry.ts +2 -5
  117. package/src/server/mcp-app-candidate.ts +5 -10
  118. package/src/server/mcp-app-host.ts +14 -38
  119. package/src/server/mcp-app-runtime.ts +12 -20
  120. package/src/server/mutation-history.ts +15 -5
  121. package/src/server/operations/composites.ts +1 -3
  122. package/src/server/operations/http.ts +2 -3
  123. package/src/server/operations/index.ts +7 -1
  124. package/src/server/operations/invoker.ts +4 -3
  125. package/src/server/operations/mcp.ts +22 -30
  126. package/src/server/operations/ops/annotation.ts +122 -10
  127. package/src/server/operations/ops/app.ts +98 -73
  128. package/src/server/operations/ops/ax-await.ts +17 -10
  129. package/src/server/operations/ops/ax-read.ts +347 -0
  130. package/src/server/operations/ops/ax-shared.ts +2 -7
  131. package/src/server/operations/ops/ax-state.ts +32 -14
  132. package/src/server/operations/ops/ax-timeline.ts +32 -19
  133. package/src/server/operations/ops/ax-work.ts +54 -37
  134. package/src/server/operations/ops/batch.ts +41 -15
  135. package/src/server/operations/ops/canvas-wire.ts +91 -0
  136. package/src/server/operations/ops/edges.ts +37 -25
  137. package/src/server/operations/ops/ext-app.ts +346 -0
  138. package/src/server/operations/ops/groups.ts +49 -20
  139. package/src/server/operations/ops/intent.ts +18 -12
  140. package/src/server/operations/ops/json-render.ts +239 -98
  141. package/src/server/operations/ops/nodes.ts +298 -109
  142. package/src/server/operations/ops/query.ts +46 -28
  143. package/src/server/operations/ops/snapshots.ts +35 -26
  144. package/src/server/operations/ops/validate.ts +2 -1
  145. package/src/server/operations/ops/viewport.ts +60 -16
  146. package/src/server/operations/ops/webview.ts +44 -18
  147. package/src/server/operations/registry.ts +2 -3
  148. package/src/server/operations/types.ts +7 -5
  149. package/src/server/operations/webview-runner.ts +1 -3
  150. package/src/server/placement.ts +8 -18
  151. package/src/server/server.ts +122 -1028
  152. package/src/server/spatial-analysis.ts +39 -25
  153. package/src/server/trace-manager.ts +3 -8
  154. package/src/server/web-artifacts.ts +23 -27
  155. package/src/server/webpage-node.ts +5 -13
  156. package/src/shared/auto-arrange.ts +12 -5
  157. package/src/shared/content-height-reporter.ts +8 -6
  158. package/src/shared/ext-app-tool-result.ts +2 -6
  159. package/src/shared/placement.ts +1 -4
  160. package/src/shared/semantic-attention.ts +39 -37
  161. package/src/shared/surface.ts +8 -4
@@ -1,65 +1,65 @@
1
- var UP=Object.create;var{getPrototypeOf:gP,defineProperty:c0,getOwnPropertyNames:_P}=Object;var zP=Object.prototype.hasOwnProperty;function bP($){return this[$]}var JP,OP,GP=($,v,g)=>{var _=$!=null&&typeof $==="object";if(_){var U=v?JP??=new WeakMap:OP??=new WeakMap,z=U.get($);if(z)return z}g=$!=null?UP(gP($)):{};let b=v||!$||!$.__esModule?c0(g,"default",{value:$,enumerable:!0}):g;for(let J of _P($))if(!zP.call(b,J))c0(b,J,{get:bP.bind($,J),enumerable:!0});if(_)U.set($,b);return b};var KP=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var WP=($)=>$;function BP($,v){this[$]=WP.bind(null,v)}var ev=($,v)=>{for(var g in v)c0($,g,{get:v[g],enumerable:!0,configurable:!0,set:BP.bind(v,g)})};var r3=KP((N3)=>{Object.defineProperty(N3,"__esModule",{value:!0});var k3=/highlight-(?:text|source)-([a-z0-9]+)/;function H3($){$.addRule("highlightedCodeBlock",{filter:function(v){var g=v.firstChild;return v.nodeName==="DIV"&&k3.test(v.className)&&g&&g.nodeName==="PRE"},replacement:function(v,g,_){var U=g.className||"",z=(U.match(k3)||[null,""])[1];return`
1
+ var GP=Object.create;var{getPrototypeOf:KP,defineProperty:n0,getOwnPropertyNames:WP}=Object;var BP=Object.prototype.hasOwnProperty;function PP($){return this[$]}var kP,HP,IP=($,v,g)=>{var _=$!=null&&typeof $==="object";if(_){var U=v?kP??=new WeakMap:HP??=new WeakMap,z=U.get($);if(z)return z}g=$!=null?GP(KP($)):{};let J=v||!$||!$.__esModule?n0(g,"default",{value:$,enumerable:!0}):g;for(let b of WP($))if(!BP.call(J,b))n0(J,b,{get:PP.bind($,b),enumerable:!0});if(_)U.set($,J);return J};var LP=($,v)=>()=>(v||$((v={exports:{}}).exports,v),v.exports);var FP=($)=>$;function YP($,v){this[$]=FP.bind(null,v)}var v6=($,v)=>{for(var g in v)n0($,g,{get:v[g],enumerable:!0,configurable:!0,set:YP.bind(v,g)})};var jK=LP((TK)=>{Object.defineProperty(TK,"__esModule",{value:!0});var qK=/highlight-(?:text|source)-([a-z0-9]+)/;function AK($){$.addRule("highlightedCodeBlock",{filter:function(v){var g=v.firstChild;return v.nodeName==="DIV"&&qK.test(v.className)&&g&&g.nodeName==="PRE"},replacement:function(v,g,_){var U=g.className||"",z=(U.match(qK)||[null,""])[1];return`
2
2
 
3
3
  `+_.fence+z+`
4
4
  `+g.firstChild.textContent+`
5
5
  `+_.fence+`
6
6
 
7
- `}})}function L3($){$.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(v){return"~~"+v+"~~"}})}var jk=Array.prototype.indexOf,Vk=Array.prototype.every,w6={},Ck={left:":---",right:"---:",center:":---:"},q2=null,F3=null,I3=new WeakMap;function fk($){return $?($.getAttribute("align")||$.style.textAlign||"").toLowerCase():""}function Y3($){return $?Ck[$]:"---"}function A3($,v){var g={left:0,right:0,center:0,"":0},_="";for(var U=0;U<$.rows.length;++U){var z=$.rows[U];if(v<z.childNodes.length){var b=fk(z.childNodes[v]);if(++g[b],g[b]>g[_])_=b}}return _}w6.tableCell={filter:["th","td"],replacement:function($,v){if(w2(Z3(v)))return $;return q3($,v)}};w6.tableRow={filter:"tr",replacement:function($,v){let g=Z3(v);if(w2(g))return $;var _="";if(mk(v)){let b=S3(g);for(var U=0;U<b;U++){let J=U<v.childNodes.length?v.childNodes[U]:null;var z=Y3(A3(g,U));_+=q3(z,J,U)}}return`
7
+ `}})}function wK($){$.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(v){return"~~"+v+"~~"}})}var ik=Array.prototype.indexOf,lk=Array.prototype.every,M6={},hk={left:":---",right:"---:",center:":---:"},N2=null,ZK=null,XK=new WeakMap;function xk($){return $?($.getAttribute("align")||$.style.textAlign||"").toLowerCase():""}function SK($){return $?hk[$]:"---"}function MK($,v){var g={left:0,right:0,center:0,"":0},_="";for(var U=0;U<$.rows.length;++U){var z=$.rows[U];if(v<z.childNodes.length){var J=xk(z.childNodes[v]);if(++g[J],g[J]>g[_])_=J}}return _}M6.tableCell={filter:["th","td"],replacement:function($,v){if(u2(uK(v)))return $;return QK($,v)}};M6.tableRow={filter:"tr",replacement:function($,v){let g=uK(v);if(u2(g))return $;var _="";if(pk(v)){let J=yK(g);for(var U=0;U<J;U++){let b=U<v.childNodes.length?v.childNodes[U]:null;var z=SK(MK(g,U));_+=QK(z,b,U)}}return`
8
8
  `+$+(_?`
9
- `+_:"")}};w6.table={filter:function($,v){return $.nodeName==="TABLE"},replacement:function($,v){if(w3(v,F3)){let J=v.outerHTML,G=ik(v);if(G===null||!G.classList.contains("joplin-table-wrapper"))return`
9
+ `+_:"")}};M6.table={filter:function($,v){return $.nodeName==="TABLE"},replacement:function($,v){if(rK(v,ZK)){let b=v.outerHTML,G=tk(v);if(G===null||!G.classList.contains("joplin-table-wrapper"))return`
10
10
 
11
- <div class="joplin-table-wrapper">${J}</div>
11
+ <div class="joplin-table-wrapper">${b}</div>
12
12
 
13
- `;else return J}else{if(w2(v))return $;$=$.replace(/\n+/g,`
13
+ `;else return b}else{if(u2(v))return $;$=$.replace(/\n+/g,`
14
14
  `);var g=$.trim().split(`
15
- `);if(g.length>=2)g=g[1];var _=/\| :?---/.test(g),U=S3(v),z="";if(U&&!_){z="|"+" |".repeat(U)+`
16
- |`;for(var b=0;b<U;++b)z+=" "+Y3(A3(v,b))+" |"}let J=v.caption?v.caption.textContent||"":"",G=J?`${J}
15
+ `);if(g.length>=2)g=g[1];var _=/\| :?---/.test(g),U=yK(v),z="";if(U&&!_){z="|"+" |".repeat(U)+`
16
+ |`;for(var J=0;J<U;++J)z+=" "+SK(MK(v,J))+" |"}let b=v.caption?v.caption.textContent||"":"",G=b?`${b}
17
17
 
18
18
  `:"",K=`${z}${$}`.trimStart();return`
19
19
 
20
20
  ${G}${K}
21
21
 
22
- `}}};w6.tableCaption={filter:["caption"],replacement:()=>""};w6.tableColgroup={filter:["colgroup","col"],replacement:()=>""};w6.tableSection={filter:["thead","tbody","tfoot"],replacement:function($){return $}};function mk($){var v=$.parentNode;return v.nodeName==="THEAD"||v.firstChild===$&&(v.nodeName==="TABLE"||Ek(v))&&Vk.call($.childNodes,function(g){return g.nodeName==="TH"})}function Ek($){var v=$.previousSibling;return $.nodeName==="TBODY"&&(!v||v.nodeName==="THEAD"&&/^\s*$/i.test(v.textContent))}function q3($,v=null,g=null){if(g===null)g=jk.call(v.parentNode.childNodes,v);var _=" ";if(g===0)_="| ";let U=$.trim().replace(/\n\r/g,"<br>").replace(/\n/g,"<br>");U=U.replace(/\|+/g,"\\|");while(U.length<3)U+=" ";if(v)U=lk(U,v," ");return _+U+" |"}function X3($){if(!$.childNodes)return!1;for(let v=0;v<$.childNodes.length;v++){let g=$.childNodes[v];if(g.nodeName==="TABLE")return!0;if(X3(g))return!0}return!1}var X2=($,v)=>{if(!$.childNodes)return!1;for(let g=0;g<$.childNodes.length;g++){let _=$.childNodes[g];if(v==="code"&&q2&&q2(_))return!0;if(v.includes(_.nodeName))return!0;if(X2(_,v))return!0}return!1},w3=($,v)=>{let g=["UL","OL","H1","H2","H3","H4","H5","H6","HR","BLOCKQUOTE"];if(v.preserveNestedTables)g.push("TABLE");return X2($,"code")||X2($,g)};function w2($){let v=I3.get($);if(v!==void 0)return v;let g=ck($);return I3.set($,g),g}function ck($){if(!$)return!0;if(!$.rows)return!0;if($.rows.length===1&&$.rows[0].childNodes.length<=1)return!0;if(X3($))return!0;return!1}function ik($){let v=$.parentNode;while(v.nodeName!=="DIV")if(v=v.parentNode,!v)return null;return v}function Z3($){let v=$.parentNode;while(v.nodeName!=="TABLE")if(v=v.parentNode,!v)return null;return v}function lk($,v,g){let _=v.getAttribute("colspan")||1;for(let U=1;U<_;U++)$+=" | "+g.repeat(3);return $}function S3($){let v=0;for(let g=0;g<$.rows.length;g++){let U=$.rows[g].childNodes.length;if(U>v)v=U}return v}function M3($){q2=$.isCodeBlock,F3=$.options,$.keep(function(g){if(g.nodeName==="TABLE"&&w3(g,$.options))return!0;return!1});for(var v in w6)$.addRule(v,w6[v])}function Q3($){$.addRule("taskListItems",{filter:function(v){let g=v.parentNode,_=g.parentNode;return v.type==="checkbox"&&(g.nodeName==="LI"||g.nodeName==="LABEL"&&_&&_.nodeName==="LI")},replacement:function(v,g){return(g.checked?"[x]":"[ ]")+" "}})}function hk($){$.use([H3,L3,M3,Q3])}N3.gfm=hk;N3.highlightedCodeBlock=H3;N3.strikethrough=L3;N3.tables=M3;N3.taskListItems=Q3});var cg,k$,uG,x0,P6,MG,RG,yG,DG,p0,i0,l0,PP,fg={},mg=[],kP=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ig=Array.isArray;function $6($,v){for(var g in v)$[g]=v[g];return $}function o0($){$&&$.parentNode&&$.parentNode.removeChild($)}function IP($,v,g){var _,U,z,b={};for(z in v)z=="key"?_=v[z]:z=="ref"?U=v[z]:b[z]=v[z];if(arguments.length>2&&(b.children=arguments.length>3?cg.call(arguments,2):g),typeof $=="function"&&$.defaultProps!=null)for(z in $.defaultProps)b[z]===void 0&&(b[z]=$.defaultProps[z]);return Cg($,b,_,U,null)}function Cg($,v,g,_,U){var z={type:$,props:v,key:g,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:U==null?++uG:U,__i:-1,__u:0};return U==null&&k$.vnode!=null&&k$.vnode(z),z}function e$($){return $.children}function z4($,v){this.props=$,this.context=v}function b4($,v){if(v==null)return $.__?b4($.__,$.__i+1):null;for(var g;v<$.__k.length;v++)if((g=$.__k[v])!=null&&g.__e!=null)return g.__e;return typeof $.type=="function"?b4($):null}function HP($){if($.__P&&$.__d){var v=$.__v,g=v.__e,_=[],U=[],z=$6({},v);z.__v=v.__v+1,k$.vnode&&k$.vnode(z),n0($.__P,z,v,$.__n,$.__P.namespaceURI,32&v.__u?[g]:null,_,g==null?b4(v):g,!!(32&v.__u),U),z.__v=v.__v,z.__.__k[z.__i]=z,CG(_,z,U),v.__e=v.__=null,z.__e!=g&&TG(z)}}function TG($){if(($=$.__)!=null&&$.__c!=null)return $.__e=$.__c.base=null,$.__k.some(function(v){if(v!=null&&v.__e!=null)return $.__e=$.__c.base=v.__e}),TG($)}function QG($){(!$.__d&&($.__d=!0)&&P6.push($)&&!Eg.__r++||MG!=k$.debounceRendering)&&((MG=k$.debounceRendering)||RG)(Eg)}function Eg(){try{for(var $,v=1;P6.length;)P6.length>v&&P6.sort(yG),$=P6.shift(),v=P6.length,HP($)}finally{P6.length=Eg.__r=0}}function jG($,v,g,_,U,z,b,J,G,K,W){var B,k,P,A,H,I,F,Y=_&&_.__k||mg,X=v.length;for(G=LP(g,v,Y,G,X),B=0;B<X;B++)(P=g.__k[B])!=null&&(k=P.__i!=-1&&Y[P.__i]||fg,P.__i=B,I=n0($,P,k,U,z,b,J,G,K,W),A=P.__e,P.ref&&k.ref!=P.ref&&(k.ref&&t0(k.ref,null,P),W.push(P.ref,P.__c||A,P)),H==null&&A!=null&&(H=A),(F=!!(4&P.__u))||k.__k===P.__k?G=VG(P,G,$,F):typeof P.type=="function"&&I!==void 0?G=I:A&&(G=A.nextSibling),P.__u&=-7);return g.__e=H,G}function LP($,v,g,_,U){var z,b,J,G,K,W=g.length,B=W,k=0;for($.__k=Array(U),z=0;z<U;z++)(b=v[z])!=null&&typeof b!="boolean"&&typeof b!="function"?(typeof b=="string"||typeof b=="number"||typeof b=="bigint"||b.constructor==String?b=$.__k[z]=Cg(null,b,null,null,null):ig(b)?b=$.__k[z]=Cg(e$,{children:b},null,null,null):b.constructor===void 0&&b.__b>0?b=$.__k[z]=Cg(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):$.__k[z]=b,G=z+k,b.__=$,b.__b=$.__b+1,J=null,(K=b.__i=FP(b,g,G,B))!=-1&&(B--,(J=g[K])&&(J.__u|=2)),J==null||J.__v==null?(K==-1&&(U>W?k--:U<W&&k++),typeof b.type!="function"&&(b.__u|=4)):K!=G&&(K==G-1?k--:K==G+1?k++:(K>G?k--:k++,b.__u|=4))):$.__k[z]=null;if(B)for(z=0;z<W;z++)(J=g[z])!=null&&(2&J.__u)==0&&(J.__e==_&&(_=b4(J)),mG(J,J));return _}function VG($,v,g,_){var U,z;if(typeof $.type=="function"){for(U=$.__k,z=0;U&&z<U.length;z++)U[z]&&(U[z].__=$,v=VG(U[z],v,g,_));return v}$.__e!=v&&(_&&(v&&$.type&&!v.parentNode&&(v=b4($)),g.insertBefore($.__e,v||null)),v=$.__e);do v=v&&v.nextSibling;while(v!=null&&v.nodeType==8);return v}function FP($,v,g,_){var U,z,b,J=$.key,G=$.type,K=v[g],W=K!=null&&(2&K.__u)==0;if(K===null&&J==null||W&&J==K.key&&G==K.type)return g;if(_>(W?1:0)){for(U=g-1,z=g+1;U>=0||z<v.length;)if((K=v[b=U>=0?U--:z++])!=null&&(2&K.__u)==0&&J==K.key&&G==K.type)return b}return-1}function NG($,v,g){v[0]=="-"?$.setProperty(v,g==null?"":g):$[v]=g==null?"":typeof g!="number"||kP.test(v)?g:g+"px"}function Vg($,v,g,_,U){var z,b;$:if(v=="style")if(typeof g=="string")$.style.cssText=g;else{if(typeof _=="string"&&($.style.cssText=_=""),_)for(v in _)g&&v in g||NG($.style,v,"");if(g)for(v in g)_&&g[v]==_[v]||NG($.style,v,g[v])}else if(v[0]=="o"&&v[1]=="n")z=v!=(v=v.replace(DG,"$1")),b=v.toLowerCase(),v=b in $||v=="onFocusOut"||v=="onFocusIn"?b.slice(2):v.slice(2),$.l||($.l={}),$.l[v+z]=g,g?_?g.u=_.u:(g.u=p0,$.addEventListener(v,z?l0:i0,z)):$.removeEventListener(v,z?l0:i0,z);else{if(U=="http://www.w3.org/2000/svg")v=v.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(v!="width"&&v!="height"&&v!="href"&&v!="list"&&v!="form"&&v!="tabIndex"&&v!="download"&&v!="rowSpan"&&v!="colSpan"&&v!="role"&&v!="popover"&&v in $)try{$[v]=g==null?"":g;break $}catch(J){}typeof g=="function"||(g==null||g===!1&&v[4]!="-"?$.removeAttribute(v):$.setAttribute(v,v=="popover"&&g==1?"":g))}}function rG($){return function(v){if(this.l){var g=this.l[v.type+$];if(v.t==null)v.t=p0++;else if(v.t<g.u)return;return g(k$.event?k$.event(v):v)}}}function n0($,v,g,_,U,z,b,J,G,K){var W,B,k,P,A,H,I,F,Y,X,Q,u,E,M,n,t=v.type;if(v.constructor!==void 0)return null;128&g.__u&&(G=!!(32&g.__u),z=[J=v.__e=g.__e]),(W=k$.__b)&&W(v);$:if(typeof t=="function")try{if(F=v.props,Y=t.prototype&&t.prototype.render,X=(W=t.contextType)&&_[W.__c],Q=W?X?X.props.value:W.__:_,g.__c?I=(B=v.__c=g.__c).__=B.__E:(Y?v.__c=B=new t(F,Q):(v.__c=B=new z4(F,Q),B.constructor=t,B.render=AP),X&&X.sub(B),B.state||(B.state={}),B.__n=_,k=B.__d=!0,B.__h=[],B._sb=[]),Y&&B.__s==null&&(B.__s=B.state),Y&&t.getDerivedStateFromProps!=null&&(B.__s==B.state&&(B.__s=$6({},B.__s)),$6(B.__s,t.getDerivedStateFromProps(F,B.__s))),P=B.props,A=B.state,B.__v=v,k)Y&&t.getDerivedStateFromProps==null&&B.componentWillMount!=null&&B.componentWillMount(),Y&&B.componentDidMount!=null&&B.__h.push(B.componentDidMount);else{if(Y&&t.getDerivedStateFromProps==null&&F!==P&&B.componentWillReceiveProps!=null&&B.componentWillReceiveProps(F,Q),v.__v==g.__v||!B.__e&&B.shouldComponentUpdate!=null&&B.shouldComponentUpdate(F,B.__s,Q)===!1){v.__v!=g.__v&&(B.props=F,B.state=B.__s,B.__d=!1),v.__e=g.__e,v.__k=g.__k,v.__k.some(function(r){r&&(r.__=v)}),mg.push.apply(B.__h,B._sb),B._sb=[],B.__h.length&&b.push(B);break $}B.componentWillUpdate!=null&&B.componentWillUpdate(F,B.__s,Q),Y&&B.componentDidUpdate!=null&&B.__h.push(function(){B.componentDidUpdate(P,A,H)})}if(B.context=Q,B.props=F,B.__P=$,B.__e=!1,u=k$.__r,E=0,Y)B.state=B.__s,B.__d=!1,u&&u(v),W=B.render(B.props,B.state,B.context),mg.push.apply(B.__h,B._sb),B._sb=[];else do B.__d=!1,u&&u(v),W=B.render(B.props,B.state,B.context),B.state=B.__s;while(B.__d&&++E<25);B.state=B.__s,B.getChildContext!=null&&(_=$6($6({},_),B.getChildContext())),Y&&!k&&B.getSnapshotBeforeUpdate!=null&&(H=B.getSnapshotBeforeUpdate(P,A)),M=W!=null&&W.type===e$&&W.key==null?fG(W.props.children):W,J=jG($,ig(M)?M:[M],v,g,_,U,z,b,J,G,K),B.base=v.__e,v.__u&=-161,B.__h.length&&b.push(B),I&&(B.__E=B.__=null)}catch(r){if(v.__v=null,G||z!=null)if(r.then){for(v.__u|=G?160:128;J&&J.nodeType==8&&J.nextSibling;)J=J.nextSibling;z[z.indexOf(J)]=null,v.__e=J}else{for(n=z.length;n--;)o0(z[n]);h0(v)}else v.__e=g.__e,v.__k=g.__k,r.then||h0(v);k$.__e(r,v,g)}else z==null&&v.__v==g.__v?(v.__k=g.__k,v.__e=g.__e):J=v.__e=YP(g.__e,v,g,_,U,z,b,G,K);return(W=k$.diffed)&&W(v),128&v.__u?void 0:J}function h0($){$&&($.__c&&($.__c.__e=!0),$.__k&&$.__k.some(h0))}function CG($,v,g){for(var _=0;_<g.length;_++)t0(g[_],g[++_],g[++_]);k$.__c&&k$.__c(v,$),$.some(function(U){try{$=U.__h,U.__h=[],$.some(function(z){z.call(U)})}catch(z){k$.__e(z,U.__v)}})}function fG($){return typeof $!="object"||$==null||$.__b>0?$:ig($)?$.map(fG):$6({},$)}function YP($,v,g,_,U,z,b,J,G){var K,W,B,k,P,A,H,I=g.props||fg,F=v.props,Y=v.type;if(Y=="svg"?U="http://www.w3.org/2000/svg":Y=="math"?U="http://www.w3.org/1998/Math/MathML":U||(U="http://www.w3.org/1999/xhtml"),z!=null){for(K=0;K<z.length;K++)if((P=z[K])&&"setAttribute"in P==!!Y&&(Y?P.localName==Y:P.nodeType==3)){$=P,z[K]=null;break}}if($==null){if(Y==null)return document.createTextNode(F);$=document.createElementNS(U,Y,F.is&&F),J&&(k$.__m&&k$.__m(v,z),J=!1),z=null}if(Y==null)I===F||J&&$.data==F||($.data=F);else{if(z=z&&cg.call($.childNodes),!J&&z!=null)for(I={},K=0;K<$.attributes.length;K++)I[(P=$.attributes[K]).name]=P.value;for(K in I)P=I[K],K=="dangerouslySetInnerHTML"?B=P:K=="children"||(K in F)||K=="value"&&("defaultValue"in F)||K=="checked"&&("defaultChecked"in F)||Vg($,K,null,P,U);for(K in F)P=F[K],K=="children"?k=P:K=="dangerouslySetInnerHTML"?W=P:K=="value"?A=P:K=="checked"?H=P:J&&typeof P!="function"||I[K]===P||Vg($,K,P,I[K],U);if(W)J||B&&(W.__html==B.__html||W.__html==$.innerHTML)||($.innerHTML=W.__html),v.__k=[];else if(B&&($.innerHTML=""),jG(v.type=="template"?$.content:$,ig(k)?k:[k],v,g,_,Y=="foreignObject"?"http://www.w3.org/1999/xhtml":U,z,b,z?z[0]:g.__k&&b4(g,0),J,G),z!=null)for(K=z.length;K--;)o0(z[K]);J||(K="value",Y=="progress"&&A==null?$.removeAttribute("value"):A!=null&&(A!==$[K]||Y=="progress"&&!A||Y=="option"&&A!=I[K])&&Vg($,K,A,I[K],U),K="checked",H!=null&&H!=$[K]&&Vg($,K,H,I[K],U))}return $}function t0($,v,g){try{if(typeof $=="function"){var _=typeof $.__u=="function";_&&$.__u(),_&&v==null||($.__u=$(v))}else $.current=v}catch(U){k$.__e(U,g)}}function mG($,v,g){var _,U;if(k$.unmount&&k$.unmount($),(_=$.ref)&&(_.current&&_.current!=$.__e||t0(_,null,v)),(_=$.__c)!=null){if(_.componentWillUnmount)try{_.componentWillUnmount()}catch(z){k$.__e(z,v)}_.base=_.__P=null}if(_=$.__k)for(U=0;U<_.length;U++)_[U]&&mG(_[U],v,g||typeof $.type!="function");g||o0($.__e),$.__c=$.__=$.__e=void 0}function AP($,v,g){return this.constructor($,g)}function EG($,v,g){var _,U,z,b;v==document&&(v=document.documentElement),k$.__&&k$.__($,v),U=(_=typeof g=="function")?null:g&&g.__k||v.__k,z=[],b=[],n0(v,$=(!_&&g||v).__k=IP(e$,null,[$]),U||fg,fg,v.namespaceURI,!_&&g?[g]:U?null:v.firstChild?cg.call(v.childNodes):null,z,!_&&g?g:U?U.__e:v.firstChild,_,b),CG(z,$,b)}cg=mg.slice,k$={__e:function($,v,g,_){for(var U,z,b;v=v.__;)if((U=v.__c)&&!U.__)try{if((z=U.constructor)&&z.getDerivedStateFromError!=null&&(U.setState(z.getDerivedStateFromError($)),b=U.__d),U.componentDidCatch!=null&&(U.componentDidCatch($,_||{}),b=U.__d),b)return U.__E=U}catch(J){$=J}throw $}},uG=0,x0=function($){return $!=null&&$.constructor===void 0},z4.prototype.setState=function($,v){var g;g=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=$6({},this.state),typeof $=="function"&&($=$($6({},g),this.props)),$&&$6(g,$),$!=null&&this.__v&&(v&&this._sb.push(v),QG(this))},z4.prototype.forceUpdate=function($){this.__v&&(this.__e=!0,$&&this.__h.push($),QG(this))},z4.prototype.render=e$,P6=[],RG=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yG=function($,v){return $.__v.__b-v.__v.__b},Eg.__r=0,DG=/(PointerCapture)$|Capture$/i,p0=0,i0=rG(!1),l0=rG(!0),PP=0;var J4,f$,d0,cG,FU=0,tG=[],l$=k$,iG=l$.__b,lG=l$.__r,hG=l$.diffed,xG=l$.__c,pG=l$.unmount,oG=l$.__;function hg($,v){l$.__h&&l$.__h(f$,$,FU||v),FU=0;var g=f$.__H||(f$.__H={__:[],__h:[]});return $>=g.__.length&&g.__.push({}),g.__[$]}function x($){return FU=1,qP(dG,$)}function qP($,v,g){var _=hg(J4++,2);if(_.t=$,!_.__c&&(_.__=[g?g(v):dG(void 0,v),function(J){var G=_.__N?_.__N[0]:_.__[0],K=_.t(G,J);G!==K&&(_.__N=[K,_.__[1]],_.__c.setState({}))}],_.__c=f$,!f$.__f)){var U=function(J,G,K){if(!_.__c.__H)return!0;var W=_.__c.__H.__.filter(function(k){return k.__c});if(W.every(function(k){return!k.__N}))return!z||z.call(this,J,G,K);var B=_.__c.props!==J;return W.some(function(k){if(k.__N){var P=k.__[0];k.__=k.__N,k.__N=void 0,P!==k.__[0]&&(B=!0)}}),z&&z.call(this,J,G,K)||B};f$.__f=!0;var{shouldComponentUpdate:z,componentWillUpdate:b}=f$;f$.componentWillUpdate=function(J,G,K){if(this.__e){var W=z;z=void 0,U(J,G,K),z=W}b&&b.call(this,J,G,K)},f$.shouldComponentUpdate=U}return _.__N||_.__}function m($,v){var g=hg(J4++,3);!l$.__s&&s0(g.__H,v)&&(g.__=$,g.u=v,f$.__H.__h.push(g))}function xg($,v){var g=hg(J4++,4);!l$.__s&&s0(g.__H,v)&&(g.__=$,g.u=v,f$.__h.push(g))}function V($){return FU=5,t$(function(){return{current:$}},[])}function t$($,v){var g=hg(J4++,7);return s0(g.__H,v)&&(g.__=$(),g.__H=v,g.__h=$),g.__}function N($,v){return FU=8,t$(function(){return $},v)}function XP(){for(var $;$=tG.shift();){var v=$.__H;if($.__P&&v)try{v.__h.some(lg),v.__h.some(a0),v.__h=[]}catch(g){v.__h=[],l$.__e(g,$.__v)}}}l$.__b=function($){f$=null,iG&&iG($)},l$.__=function($,v){$&&v.__k&&v.__k.__m&&($.__m=v.__k.__m),oG&&oG($,v)},l$.__r=function($){lG&&lG($),J4=0;var v=(f$=$.__c).__H;v&&(d0===f$?(v.__h=[],f$.__h=[],v.__.some(function(g){g.__N&&(g.__=g.__N),g.u=g.__N=void 0})):(v.__h.some(lg),v.__h.some(a0),v.__h=[],J4=0)),d0=f$},l$.diffed=function($){hG&&hG($);var v=$.__c;v&&v.__H&&(v.__H.__h.length&&(tG.push(v)!==1&&cG===l$.requestAnimationFrame||((cG=l$.requestAnimationFrame)||wP)(XP)),v.__H.__.some(function(g){g.u&&(g.__H=g.u),g.u=void 0})),d0=f$=null},l$.__c=function($,v){v.some(function(g){try{g.__h.some(lg),g.__h=g.__h.filter(function(_){return!_.__||a0(_)})}catch(_){v.some(function(U){U.__h&&(U.__h=[])}),v=[],l$.__e(_,g.__v)}}),xG&&xG($,v)},l$.unmount=function($){pG&&pG($);var v,g=$.__c;g&&g.__H&&(g.__H.__.some(function(_){try{lg(_)}catch(U){v=U}}),g.__H=void 0,v&&l$.__e(v,g.__v))};var nG=typeof requestAnimationFrame=="function";function wP($){var v,g=function(){clearTimeout(_),nG&&cancelAnimationFrame(v),setTimeout($)},_=setTimeout(g,35);nG&&(v=requestAnimationFrame(g))}function lg($){var v=f$,g=$.__c;typeof g=="function"&&($.__c=void 0,g()),f$=v}function a0($){var v=f$;$.__c=$.__(),f$=v}function s0($,v){return!$||$.length!==v.length||v.some(function(g,_){return g!==$[_]})}function dG($,v){return typeof v=="function"?v($):v}var ZP=Symbol.for("preact-signals");function tg(){if(!(v6>1)){var $,v=!1;(function(){var U=og;og=void 0;while(U!==void 0){if(U.S.v===U.v)U.S.i=U.i;U=U.o}})();while(YU!==void 0){var g=YU;YU=void 0,pg++;while(g!==void 0){var _=g.u;if(g.u=void 0,g.f&=-3,!(8&g.f)&&eG(g))try{g.c()}catch(U){if(!v)$=U,v=!0}g=_}}if(pg=0,v6--,v)throw $}else v6--}function U6($){if(v6>0)return $();e0=++SP,v6++;try{return $()}finally{tg()}}var A$=void 0;function $2($){var v=A$;A$=void 0;try{return $()}finally{A$=v}}var aG,YU=void 0,v6=0,pg=0,SP=0,e0=0,og=void 0,ng=0;function sG($){if(A$!==void 0){var v=$.n;if(v===void 0||v.t!==A$){if(v={i:0,S:$,p:A$.s,n:void 0,t:A$,e:void 0,x:void 0,r:v},A$.s!==void 0)A$.s.n=v;if(A$.s=v,$.n=v,32&A$.f)$.S(v);return v}else if(v.i===-1){if(v.i=0,v.n!==void 0){if(v.n.p=v.p,v.p!==void 0)v.p.n=v.n;v.p=A$.s,v.n=void 0,A$.s.n=v,A$.s=v}return v}}}function n$($,v){this.v=$,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=v==null?void 0:v.watched,this.Z=v==null?void 0:v.unwatched,this.name=v==null?void 0:v.name}n$.prototype.brand=ZP;n$.prototype.h=function(){return!0};n$.prototype.S=function($){var v=this,g=this.t;if(g!==$&&$.e===void 0)if($.x=g,this.t=$,g!==void 0)g.e=$;else $2(function(){var _;(_=v.W)==null||_.call(v)})};n$.prototype.U=function($){var v=this;if(this.t!==void 0){var{e:g,x:_}=$;if(g!==void 0)g.x=_,$.e=void 0;if(_!==void 0)_.e=g,$.x=void 0;if($===this.t){if(this.t=_,_===void 0)$2(function(){var U;(U=v.Z)==null||U.call(v)})}}};n$.prototype.subscribe=function($){var v=this;return k6(function(){var g=v.value,_=A$;A$=void 0;try{$(g)}finally{A$=_}},{name:"sub"})};n$.prototype.valueOf=function(){return this.value};n$.prototype.toString=function(){return this.value+""};n$.prototype.toJSON=function(){return this.value};n$.prototype.peek=function(){var $=A$;A$=void 0;try{return this.value}finally{A$=$}};Object.defineProperty(n$.prototype,"value",{get:function(){var $=sG(this);if($!==void 0)$.i=this.i;return this.v},set:function($){if($!==this.v){if(pg>100)throw Error("Cycle detected");(function(g){if(v6!==0&&pg===0){if(g.l!==e0)g.l=e0,og={S:g,v:g.v,i:g.i,o:og}}})(this),this.v=$,this.i++,ng++,v6++;try{for(var v=this.t;v!==void 0;v=v.x)v.t.N()}finally{tg()}}}});function B$($,v){return new n$($,v)}function eG($){for(var v=$.s;v!==void 0;v=v.n)if(v.S.i!==v.i||!v.S.h()||v.S.i!==v.i)return!0;return!1}function $K($){for(var v=$.s;v!==void 0;v=v.n){var g=v.S.n;if(g!==void 0)v.r=g;if(v.S.n=v,v.i=-1,v.n===void 0){$.s=v;break}}}function vK($){var v=$.s,g=void 0;while(v!==void 0){var _=v.p;if(v.i===-1){if(v.S.U(v),_!==void 0)_.n=v.n;if(v.n!==void 0)v.n.p=_}else g=v;if(v.S.n=v.r,v.r!==void 0)v.r=void 0;v=_}$.s=g}function i6($,v){n$.call(this,void 0),this.x=$,this.s=void 0,this.g=ng-1,this.f=4,this.W=v==null?void 0:v.watched,this.Z=v==null?void 0:v.unwatched,this.name=v==null?void 0:v.name}i6.prototype=new n$;i6.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32)return!0;if(this.f&=-5,this.g===ng)return!0;if(this.g=ng,this.f|=1,this.i>0&&!eG(this))return this.f&=-2,!0;var $=A$;try{$K(this),A$=this;var v=this.x();if(16&this.f||this.v!==v||this.i===0)this.v=v,this.f&=-17,this.i++}catch(g){this.v=g,this.f|=16,this.i++}return A$=$,vK(this),this.f&=-2,!0};i6.prototype.S=function($){if(this.t===void 0){this.f|=36;for(var v=this.s;v!==void 0;v=v.n)v.S.S(v)}n$.prototype.S.call(this,$)};i6.prototype.U=function($){if(this.t!==void 0){if(n$.prototype.U.call(this,$),this.t===void 0){this.f&=-33;for(var v=this.s;v!==void 0;v=v.n)v.S.U(v)}}};i6.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var $=this.t;$!==void 0;$=$.x)$.t.N()}};Object.defineProperty(i6.prototype,"value",{get:function(){if(1&this.f)throw Error("Cycle detected");var $=sG(this);if(this.h(),$!==void 0)$.i=this.i;if(16&this.f)throw this.v;return this.v}});function l6($,v){return new i6($,v)}function UK($){var v=$.m;if($.m=void 0,typeof v=="function"){v6++;var g=A$;A$=void 0;try{v()}catch(_){throw $.f&=-2,$.f|=8,v2($),_}finally{A$=g,tg()}}}function v2($){for(var v=$.s;v!==void 0;v=v.n)v.S.U(v);$.x=void 0,$.s=void 0,UK($)}function MP($){if(A$!==this)throw Error("Out-of-order effect");if(vK(this),A$=$,this.f&=-2,8&this.f)v2(this);tg()}function O4($,v){if(this.x=$,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=v==null?void 0:v.name,aG)aG.push(this)}O4.prototype.c=function(){var $=this.S();try{if(8&this.f)return;if(this.x===void 0)return;var v=this.x();if(typeof v=="function")this.m=v}finally{$()}};O4.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,UK(this),$K(this),v6++;var $=A$;return A$=this,MP.bind(this,$)};O4.prototype.N=function(){if(!(2&this.f))this.f|=2,this.u=YU,YU=this};O4.prototype.d=function(){if(this.f|=8,!(1&this.f))v2(this)};O4.prototype.dispose=function(){this.d()};function k6($,v){var g=new O4($,v);try{g.c()}catch(U){throw g.d(),U}var _=g.d.bind(g);return _[Symbol.dispose]=_,_}var U2,g2,dg,QP=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,gK=[],_K=[];k6(function(){U2=this.N})();function G4($,v){k$[$]=v.bind(null,k$[$]||function(){})}function ag($){if(dg){var v=dg;dg=void 0,v()}dg=$&&$.S()}function zK($){var v=this,g=$.data,_=rP(g);_.value=g;var U=t$(function(){var J=v,G=v.__v;while(G=G.__)if(G.__c){G.__c.__$f|=4;break}var K=l6(function(){var P=_.value.value;return P===0?0:P===!0?"":P||""}),W=l6(function(){return!Array.isArray(K.value)&&!x0(K.value)}),B=k6(function(){if(this.N=bK,W.value){var P=K.value;if(J.__v&&J.__v.__e&&J.__v.__e.nodeType===3)J.__v.__e.data=P}}),k=v.__$u.d;return v.__$u.d=function(){B(),k.call(this)},[W,K]},[]),z=U[0],b=U[1];return z.value?b.peek():b.value}zK.displayName="ReactiveTextNode";Object.defineProperties(n$.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:zK},props:{configurable:!0,get:function(){var $=this;return{data:{get value(){return $.value}}}}},__b:{configurable:!0,value:1}});G4("__b",function($,v){if(typeof v.type=="string"){var g,_=v.props;for(var U in _)if(U!=="children"){var z=_[U];if(z instanceof n$){if(!g)v.__np=g={};g[U]=z,_[U]=z.peek()}}}$(v)});G4("__r",function($,v){if($(v),v.type!==e$){ag();var g,_=v.__c;if(_){if(_.__$f&=-2,(g=_.__$u)===void 0)_.__$u=g=function(U,z){var b;return k6(function(){b=this},{name:z}),b.c=U,b}(function(){var U;if(QP)(U=g.y)==null||U.call(g);_.__$f|=1,_.setState({})},typeof v.type=="function"?v.type.displayName||v.type.name:"")}g2=_,ag(g)}});G4("__e",function($,v,g,_){ag(),g2=void 0,$(v,g,_)});G4("diffed",function($,v){ag(),g2=void 0;var g;if(typeof v.type=="string"&&(g=v.__e)){var{__np:_,props:U}=v;if(_){var z=g.U;if(z)for(var b in z){var J=z[b];if(J!==void 0&&!(b in _))J.d(),z[b]=void 0}else z={},g.U=z;for(var G in _){var K=z[G],W=_[G];if(K===void 0)K=NP(g,G,W),z[G]=K;else K.o(W,U)}for(var B in _)U[B]=_[B]}}$(v)});function NP($,v,g,_){var U=v in $&&$.ownerSVGElement===void 0,z=B$(g),b=g.peek();return{o:function(J,G){z.value=J,b=J.peek()},d:k6(function(){this.N=bK;var J=z.value.value;if(b!==J)if(b=void 0,U)$[v]=J;else if(J!=null&&(J!==!1||v[4]==="-"))$.setAttribute(v,J);else $.removeAttribute(v);else b=void 0})}}G4("unmount",function($,v){if(typeof v.type=="string"){var g=v.__e;if(g){var _=g.U;if(_){g.U=void 0;for(var U in _){var z=_[U];if(z)z.d()}}}v.__np=void 0}else{var b=v.__c;if(b){var J=b.__$u;if(J)b.__$u=void 0,J.d()}}$(v)});G4("__h",function($,v,g,_){if(_<3||_===9)v.__$f|=2;$(v,g,_)});z4.prototype.shouldComponentUpdate=function($,v){if(this.__R)return!0;var g=this.__$u,_=g&&g.s!==void 0;for(var U in v)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var z=2&this.__$f;if(!(_||z||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(_||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var b in $)if(b!=="__source"&&$[b]!==this.props[b])return!0;for(var J in this.props)if(!(J in $))return!0;return!1};function rP($,v){return t$(function(){return B$($,v)},[])}var uP=typeof requestAnimationFrame>"u"?setTimeout:function($){var v=function(){clearTimeout(g),cancelAnimationFrame(_),$()},g=setTimeout(v,35),_=requestAnimationFrame(v)},RP=function($){queueMicrotask(function(){queueMicrotask($)})};function yP(){U6(function(){var $;while($=gK.shift())U2.call($)})}function DP(){if(gK.push(this)===1)(k$.requestAnimationFrame||uP)(yP)}function TP(){U6(function(){var $;while($=_K.shift())U2.call($)})}function bK(){if(_K.push(this)===1)(k$.requestAnimationFrame||RP)(TP)}function JK($,v){var g=V($);g.current=$,m(function(){return k6(function(){return this.N=DP,g.current()},v)},[])}var sg=B$(null),AU=B$([]),W4=B$(new Set),B4=B$(new Set),eg=B$([]),$_=B$(new Set),I6=B$(!1),K4=B$(0);function OK(){sg.value=null,AU.value=[],W4.value=new Set,B4.value=new Set,eg.value=[],$_.value=new Set,I6.value=!1,K4.value=0}function v_(){I6.value=!0,K4.value=0}function U_(){I6.value=!1}function GK($,v,g){W4.value=new Set($),B4.value=new Set(v),eg.value=g}function g_($){sg.value=$}function KK($,v=6){if(AU.value=[$,...AU.value].slice(0,v),!I6.value)K4.value=Math.min(99,K4.value+1)}function __($){$_.value=new Set($)}var $v={markdown:"MD","mcp-app":"APP",webpage:"WEB","json-render":"UI",graph:"GRAPH",prompt:"ASK",response:"ANS",status:"STATUS",context:"CONTEXT",ledger:"LOG",trace:"TRACE",file:"FILE",image:"IMG",html:"HTML",group:"GROUP"},z_=new Set(["markdown","mcp-app","webpage","json-render","graph","context","ledger","file","image","html"]);function WK($){return $.type==="mcp-app"&&$.data.mode==="ext-app"&&$.data.serverName==="Excalidraw"&&$.data.toolName==="create_view"}function BK($){if($.length===0)return null;let{POSITIVE_INFINITY:v,POSITIVE_INFINITY:g,NEGATIVE_INFINITY:_,NEGATIVE_INFINITY:U}=Number;for(let z of $)v=Math.min(v,z.position.x),g=Math.min(g,z.position.y),_=Math.max(_,z.position.x+z.size.width),U=Math.max(U,z.position.y+z.size.height);if(!Number.isFinite(v)||!Number.isFinite(g))return null;return{x:v-40,y:g-40-32,width:_-v+80,height:U-g+80+32}}function jP($){let v=$.filter((G)=>!G.pinned&&G.dockPosition===null),g=new Map(v.map((G)=>[G.id,G])),_=new Map,U=[],z=new Map;for(let G of v){if(G.type==="group")continue;let K=typeof G.data.parentGroup==="string"?G.data.parentGroup:"",W=K?g.get(K):void 0;if(!W||W.type!=="group")continue;if(!z.has(K))z.set(K,[]);z.get(K).push(G)}let b=v.filter((G)=>G.type==="group").sort((G,K)=>G.position.y-K.position.y||G.position.x-K.position.x);for(let G of b){let K=z.get(G.id)??[];if(K.length===0){let P=`unit:${G.id}`;U.push({id:P,memberIds:[G.id],origin:{...G.position},size:{...G.size},sortKey:{x:G.position.x,y:G.position.y}}),_.set(G.id,P);continue}let W=K.map((P)=>({position:P.position,size:P.size})),B=BK(W);if(!B)continue;let k=`group:${G.id}`;U.push({id:k,memberIds:K.map((P)=>P.id),origin:{x:B.x,y:B.y},size:{width:B.width,height:B.height},sortKey:{x:B.x,y:B.y},groupId:G.id}),_.set(G.id,k);for(let P of K)_.set(P.id,k)}let J=v.filter((G)=>!_.has(G.id)).sort((G,K)=>G.position.y-K.position.y||G.position.x-K.position.x);for(let G of J){let K=`unit:${G.id}`;U.push({id:K,memberIds:[G.id],origin:{...G.position},size:{...G.size},sortKey:{x:G.position.x,y:G.position.y}}),_.set(G.id,K)}return{units:U,nodesById:g,nodeToUnit:_}}function VP($,v,g){let _=new Map,U=new Map,z=new Map,b=new Map;for(let J of $)_.set(J.id,new Set),U.set(J.id,new Set),z.set(J.id,0),b.set(J.id,0);for(let J of g){let G=v.get(J.from),K=v.get(J.to);if(!G||!K||G===K)continue;if(!_.get(G).has(K))_.get(G).add(K),b.set(G,(b.get(G)??0)+1),z.set(K,(z.get(K)??0)+1);U.get(G).add(K),U.get(K).add(G)}return{outgoing:_,undirected:U,indegree:z,outdegree:b}}function CP($,v){let g=new Map($.map((z)=>[z.id,z])),_=new Set,U=[];for(let z of $){if(_.has(z.id))continue;let b=[z.id],J=[];_.add(z.id);while(b.length>0){let K=b.pop();J.push(K);for(let W of v.get(K)??[]){if(_.has(W))continue;_.add(W),b.push(W)}}let G=J.map((K)=>g.get(K)).filter((K)=>K!==void 0).sort((K,W)=>K.sortKey.y-W.sortKey.y||K.sortKey.x-W.sortKey.x);U.push(G)}return U.sort((z,b)=>z[0].sortKey.y-b[0].sortKey.y||z[0].sortKey.x-b[0].sortKey.x)}function fP($){let v=new Map,g=0,_=0,U=0,z=0,b=Math.max(900,Math.ceil(Math.sqrt($.reduce((J,G)=>J+G.size.width*G.size.height,0))));for(let J of $){if(g>0&&g+J.size.width>b)g=0,_+=U+72,U=0;v.set(J.id,{x:g,y:_}),g+=J.size.width+96,U=Math.max(U,J.size.height),z=Math.max(z,g-96)}return{positions:v,size:{width:Math.max(0,z),height:_+U},sortKey:$[0].sortKey}}function mP($,v,g,_,U){if($.length===1)return{positions:new Map([[$[0].id,{x:0,y:0}]]),size:{...$[0].size},sortKey:$[0].sortKey};let z=new Set($.map((Y)=>Y.id)),b=$.filter((Y)=>(_.get(Y.id)??0)===0&&(U.get(Y.id)??0)>0).sort((Y,X)=>Y.sortKey.x-X.sortKey.x||Y.sortKey.y-X.sortKey.y),J=b.length>0?b:[$.slice().sort((Y,X)=>Y.sortKey.x-X.sortKey.x||Y.sortKey.y-X.sortKey.y)[0]],G=new Map,K=J.map((Y)=>Y.id);for(let Y of J)G.set(Y.id,0);while(K.length>0){let Y=K.shift(),X=G.get(Y)??0;for(let Q of g.get(Y)??[]){if(!z.has(Q)||G.has(Q))continue;G.set(Q,X+1),K.push(Q)}}let W=0;for(let Y of $){if(G.has(Y.id))continue;G.set(Y.id,W),W+=1}let B=new Map;for(let Y of $){let X=G.get(Y.id)??0;if(!B.has(X))B.set(X,[]);B.get(X).push(Y)}let k=Array.from(B.keys()).sort((Y,X)=>Y-X);for(let Y of k)B.get(Y).sort((X,Q)=>X.sortKey.y-Q.sortKey.y||X.sortKey.x-Q.sortKey.x);let P=new Map,A=new Map,H=0;for(let Y of k){let X=B.get(Y),Q=X.reduce((E,M,n)=>E+M.size.height+(n>0?72:0),0),u=Math.max(...X.map((E)=>E.size.width));P.set(Y,Q),A.set(Y,u),H=Math.max(H,Q)}let I=new Map,F=0;for(let Y of k){let X=B.get(Y),Q=P.get(Y)??0,u=A.get(Y)??0,E=Math.max(0,(H-Q)/2);for(let M of X)I.set(M.id,{x:F,y:E}),E+=M.size.height+72;F+=u+96}return{positions:I,size:{width:Math.max(0,F-96),height:H},sortKey:$[0].sortKey}}function EP($){let v=new Map,g=40,_=80,U=0;for(let z of $){if(g>40&&g+z.size.width>3200)g=40,_+=U+180,U=0;for(let[b,J]of z.positions.entries())v.set(b,{x:g+J.x,y:_+J.y});g+=z.size.width+220,U=Math.max(U,z.size.height)}return v}function _2($,v,g){let{units:_,nodesById:U,nodeToUnit:z}=jP($),b=new Map,J=new Map;if(_.length===0)return{nodePositions:b,groupBounds:J};let{outgoing:G,undirected:K,indegree:W,outdegree:B}=VP(_,z,v),k=CP(_,K).map((A)=>g==="graph"?mP(A,G,K,W,B):fP(A)),P=EP(k);for(let A of _){let H=P.get(A.id);if(!H)continue;let I=H.x-A.origin.x,F=H.y-A.origin.y;if(A.groupId){let Q=[];for(let E of A.memberIds){let M=U.get(E);if(!M)continue;let n={x:M.position.x+I,y:M.position.y+F};b.set(E,n),Q.push({position:n,size:M.size})}let u=BK(Q);if(u)J.set(A.groupId,u);continue}let Y=A.memberIds[0],X=U.get(Y);if(!X)continue;b.set(Y,{x:X.position.x+I,y:X.position.y+F})}return{nodePositions:b,groupBounds:J}}function z2($,v){console.error(`[intent-bridge] ${$} failed`,v)}async function m$($,v,g,_){try{return await(await fetch(v,_)).json()}catch(U){return z2($,U),g}}async function cP($,v,g){try{return{ok:(await fetch(v,g)).ok}}catch(_){return z2($,_),{ok:!1}}}async function PK($,v,g){try{await fetch(v,g)}catch(_){z2($,_)}}async function kK($,v={}){return m$("sendIntent","/api/workbench/intent",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:$,payload:v})})}async function b2($){let g=`Veto: do not ${$.label?.trim()||`${$.kind} intent`}${$.reason?` — ${$.reason}`:""}.`;if((await m$("vetoGhostIntent",`/api/canvas/ax/intent/${encodeURIComponent($.id)}`,{ok:!1,cleared:!1},{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({vetoed:!0})})).cleared!==!0)return!1;return await PK("vetoGhostSteering","/api/canvas/ax/steer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:g,source:"browser"})}),!0}async function g6($){return(await m$("renderMarkdown","/api/render",{},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({markdown:$})})).html??""}async function qU($){return m$("fetchFile",`/api/file?path=${encodeURIComponent($)}`,{content:""})}async function IK($,v){return m$("saveFile","/api/file/save",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:$,content:v})})}async function b_($){return cP("openWorkbenchFile","/api/workbench/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:$})})}async function J_($){return m$("saveCanvasTheme","/api/canvas/theme",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:$})})}async function HK(){return[]}async function XU($,v,g,_,U){if(!$.trim())return{ok:!1,error:"Prompt text is required"};return m$("submitCanvasPrompt","/api/canvas/prompt",{ok:!1,error:"Network error"},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:$,...v?{position:v}:{},...g?{parentNodeId:g}:{},..._&&_.length>0?{contextNodeIds:_}:{},...U?{threadNodeId:U}:{}})})}async function LK($,v){return XU(v,void 0,void 0,void 0,$)}async function FK($,v={}){await PK("pushCanvasUpdate","/api/canvas/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:$,...v.recordHistory===!1?{recordHistory:!1}:{}})})}async function P4($,v,g,_){return m$("createEdgeFromClient","/api/canvas/edge",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:$,to:v,type:g,label:_})})}async function lv($){return m$("createNodeFromClient","/api/canvas/node",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})}async function wv($,v){return m$("updateNodeFromClient",`/api/canvas/node/${encodeURIComponent($)}`,{ok:!1},{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})}async function O_($,v){return m$("refreshWebpageNodeFromClient",`/api/canvas/node/${encodeURIComponent($)}/refresh`,{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v?{url:v}:{})})}async function G_($){return m$("removeNodeFromClient",`/api/canvas/node/${encodeURIComponent($)}`,{ok:!1},{method:"DELETE"})}async function YK(){return m$("fetchAxSurfaceState","/api/canvas/ax/surface-snapshot",null)}async function AK($,v){return m$("openNodeInSystemBrowserRequest","/api/canvas/open-external",{ok:!1,opened:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodeId:$,url:v})})}async function H6($){return m$("submitAxInteractionFromClient","/api/canvas/ax/interaction",{ok:!1,code:"request-failed",error:"Request failed"},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceSurface:"native-node",...$,source:"browser"})})}async function qK($,v={}){return m$("updateViewportFromClient","/api/canvas/viewport",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...$,...v.recordHistory===!1?{recordHistory:!1}:{}})})}async function K_($){return m$("createGroupFromClient","/api/canvas/group",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})}async function XK($){return m$("ungroupFromClient","/api/canvas/group/ungroup",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({groupId:$})})}async function wK(){return m$("listSnapshots","/api/canvas/snapshots?all=true",[])}async function ZK($){return m$("saveSnapshot","/api/canvas/snapshots",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$})})}async function SK($){return m$("restoreSnapshot",`/api/canvas/snapshots/${$}`,{ok:!1},{method:"POST"})}async function MK($){return m$("deleteSnapshot",`/api/canvas/snapshots/${$}`,{ok:!1},{method:"DELETE"})}function wU($,v){console.error(`[canvas-store] ${$} failed`,v)}var I$=B$({x:0,y:0,scale:1}),T=B$(new Map),c$=B$(new Map),I4=B$(new Map),y$=B$(null),h6=B$("connecting"),H4=B$(""),B_=B$(!1),T$=B$("dark"),x6=B$(!1),F6=B$(null),E$=B$(null),hv=B$(null),Zv=null,k4=void 0,QK=100,iP=2500,P_=B$(null),rv=B$(null),Y6=B$(null),h$=B$(new Set),D$=B$(new Set);function uK($,v){if(!$)return new Set;let g=new Set;for(let _ of v.values()){if(_.from===$)g.add(_.to);if(_.to===$)g.add(_.from)}return g}var RK=l6(()=>uK(y$.value,c$.value));function NK($,v){let g=new Set;for(let _ of $)if(v.has(_))g.add(_);return g}function rK($,v){if($.size!==v.size)return!1;for(let g of $)if(!v.has(g))return!1;return!0}function yK($){let v=new Set(h$.value);if(v.has($))v.delete($);else v.add($);h$.value=v}function DK($){h$.value=new Set($)}function jv(){if(h$.value.size===0)return;h$.value=new Set}function L4($){let v=new Set(D$.value);if(v.has($))v.delete($);else v.add($);D$.value=v,d$(),k_(v)}function TK($){let v=new Set(D$.value);for(let g of $)v.add(g);D$.value=v,d$(),k_(v)}function jK(){if(D$.value.size===0)return;D$.value=new Set,d$(),k_(new Set)}function VK($){D$.value=new Set($)}function CK(){let $=D$.value;if($.size===0)return[];return Array.from($).map((v)=>T.value.get(v)).filter((v)=>v!==void 0)}function k_($){fetch("/api/canvas/context-pins",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodeIds:Array.from($)})}).catch((v)=>{wU("syncContextPinsToServer",v)})}var W_=1;function _6($){U6(()=>{let v=new Map(T.value);if($.zIndex>=W_)W_=$.zIndex+1;v.set($.id,$),T.value=v,y$.value=$.id})}function Pv($,v){O2($,v)}function O2($,v,g={}){let _=T.value.get($);if(!_)return;let U=new Map(T.value);if(_.type==="group"&&v.position&&g.skipGroupChildTranslation!==!0){let b=v.position.x-_.position.x,J=v.position.y-_.position.y;if(b!==0||J!==0){let G=Array.isArray(_.data.children)?_.data.children.filter((K)=>typeof K==="string"):[];for(let K of G){let W=U.get(K);if(!W||W.type==="group")continue;U.set(K,{...W,position:{x:W.position.x+b,y:W.position.y+J}})}}}U.set($,{..._,...v}),T.value=U;let z=U.get($)?.data.appCheckpoint?.updatedAt;if(hv.value===$&&z!==void 0&&z!==k4)J2($)}function U$($,v){let g=T.value.get($);if(!g)return;Pv($,{data:{...g.data,...v}})}function F4($){lP($);let v=new Map(T.value);if(v.delete($),T.value=v,y$.value===$)y$.value=null;if(E$.value===$)E$.value=null;if(h$.value.has($)){let g=new Set(h$.value);g.delete($),h$.value=g}if(D$.value.has($)){let g=new Set(D$.value);g.delete($),D$.value=g,k_(g)}}function I_($){let v=new Map(c$.value);v.set($.id,$),c$.value=v}function fK($){let v=new Map(c$.value);v.delete($),c$.value=v}function lP($){let v=!1,g=new Map(c$.value);for(let[_,U]of g)if(U.from===$||U.to===$)g.delete(_),v=!0;if(v)c$.value=g}function hP($){let v=new Map(I4.value);if(!v.delete($))return;I4.value=v}async function G2($){try{return{ok:(await fetch("/api/canvas/annotation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})).ok}}catch(v){return wU("createAnnotationFromClient",v),{ok:!1}}}async function mK($){try{let v=await fetch(`/api/canvas/annotation/${encodeURIComponent($)}`,{method:"DELETE"});if(v.ok)hP($);return{ok:v.ok}}catch(v){return wU("removeAnnotationFromClient",v),{ok:!1}}}function Y4($,v){if(!T.value.get($))return;Pv($,{size:v})}function A6($){if(!T.value.get($))return;Pv($,{zIndex:W_++}),y$.value=$}function q6($){let v=T.value.get($);if(!v)return;Pv($,{collapsed:!v.collapsed})}function EK(){for(let $ of T.value.values())if($.type==="context"&&$.dockPosition==="right"&&!$.collapsed)Pv($.id,{collapsed:!0})}var H_=l6(()=>{for(let $ of T.value.values())if($.type==="context"&&$.dockPosition==="right"&&!$.collapsed)return!0;return!1});function K2($,v){if(!T.value.get($))return;Pv($,{dockPosition:v}),d$()}function A4($){let v=T.value.get($);if(!v)return;let g=I$.value,_=(window.innerWidth/2-g.x)/g.scale,U=(window.innerHeight/2-g.y)/g.scale;Pv($,{dockPosition:null,position:{x:_-v.size.width/2,y:U-v.size.height/2}}),d$()}function cK($){I$.value={...I$.value,...$}}function iK($){I$.value=$}function lK($){hK($)}function hK($,v={}){I$.value=$,d$(v),qK($,v)}function xK($,v={}){let g=new Map,_=1;for(let B of $.nodes)if(g.set(B.id,B),B.zIndex>=_)_=B.zIndex+1;let U=$.edges.filter((B)=>g.has(B.from)&&g.has(B.to)),z=new Map;for(let B of U)z.set(B.id,B);let b=new Map;for(let B of $.annotations??[])b.set(B.id,B);let J=y$.value!==null&&g.has(y$.value)?y$.value:null,G=E$.value!==null&&g.has(E$.value)?E$.value:null,K=NK(h$.value,g),W=NK(D$.value,g);U6(()=>{if(v.applyViewport===!0&&$.viewport)I$.value=$.viewport;if(W_=_,T.value=g,c$.value=z,I4.value=b,y$.value=J,E$.value=G,!rK(h$.value,K))h$.value=K;if(!rK(D$.value,W))D$.value=W})}var L6=null;function xP($){return 1-(1-$)**3}function xv($,v=300,g={}){if(L6!==null)cancelAnimationFrame(L6);let _={...I$.value},U=performance.now();function z(b){let J=b-U,G=Math.min(1,J/v),K=xP(G);if(I$.value={x:_.x+($.x-_.x)*K,y:_.y+($.y-_.y)*K,scale:_.scale+($.scale-_.scale)*K},G<1)L6=requestAnimationFrame(z);else L6=null,hK($,g)}L6=requestAnimationFrame(z)}function q4(){if(L6!==null)cancelAnimationFrame(L6),L6=null}var pK="pmx-canvas-layout";function d$($={}){try{let v=Array.from(T.value.values()),g=v.map((U)=>({id:U.id,position:U.position,size:U.size,collapsed:U.collapsed,dockPosition:U.dockPosition})),_={viewport:I$.value,nodes:v.map((U)=>({id:U.id,type:U.type,position:U.position,size:U.size,collapsed:U.collapsed,pinned:U.pinned,dockPosition:U.dockPosition})),edges:Array.from(c$.value.values()).map((U)=>({id:U.id,from:U.from,to:U.to,type:U.type,label:U.label,style:U.style,animated:U.animated})),contextPinnedNodeIds:Array.from(D$.value)};localStorage.setItem(pK,JSON.stringify(_)),FK(g,$)}catch(v){wU("persistLayout",v)}}function oK(){try{let $=localStorage.getItem(pK);if(!$)return null;let v=JSON.parse($),g=Array.isArray(v.nodes)?v.nodes:[];if(g.length===0)return null;let _=new Map;for(let U of g){if(typeof U.id!=="string"||U.id.length===0)continue;_.set(U.id,{...U.position?{position:U.position}:{},...U.size?{size:U.size}:{},...U.collapsed!==void 0?{collapsed:U.collapsed}:{},...U.pinned!==void 0?{pinned:U.pinned}:{},...U.dockPosition!==void 0?{dockPosition:U.dockPosition}:{}})}return _.size>0?_:null}catch($){return wU("restoreLayout",$),null}}function L_($,v){let g=Array.from(T.value.values());if(g.length===0)return;let{POSITIVE_INFINITY:_,POSITIVE_INFINITY:U,NEGATIVE_INFINITY:z,NEGATIVE_INFINITY:b}=Number;for(let P of g)_=Math.min(_,P.position.x),U=Math.min(U,P.position.y),z=Math.max(z,P.position.x+P.size.width),b=Math.max(b,P.position.y+P.size.height);let J=60,G=z-_+J*2,K=b-U+J*2,W=Math.min(1,Math.min($/G,v/K)),B=(_+z)/2,k=(U+b)/2;xv({x:$/2-B*W,y:v/2-k*W,scale:W})}function Fv($,v={}){let g=T.value.get($);if(!g)return;let _=I$.value,U=g.position.x+g.size.width/2,z=g.position.y+g.size.height/2;xv({x:window.innerWidth/2-U*_.scale,y:window.innerHeight/2-z*_.scale,scale:_.scale},300,v),A6($)}function nK($=1){let v=Array.from(T.value.keys());if(v.length===0)return;let _=((y$.value?v.indexOf(y$.value):-1)+$+v.length)%v.length,U=v[_];A6(U),Fv(U)}function tK($){let v=y$.value;if(!v)return;let g=T.value.get(v);if(!g)return;let _=uK(v,c$.value);if(_.size===0)return;let U=g.position.x+g.size.width/2,z=g.position.y+g.size.height/2,b=null,J=-1/0;for(let G of _){let K=T.value.get(G);if(!K)continue;let W=K.position.x+K.size.width/2,B=K.position.y+K.size.height/2,k=W-U,P=B-z,A=Math.sqrt(k*k+P*P);if(A<1)continue;let H;switch($){case"up":H=-P;break;case"down":H=P;break;case"left":H=-k;break;case"right":H=k;break}if(H<=0)continue;let I=H/A-A*0.001;if(I>J)J=I,b=G}if(b)Fv(b)}function z6($){if(!T.value.get($))return;if(Zv!==null)clearTimeout(Zv),Zv=null;hv.value=null,k4=void 0,A6($),E$.value=$}function J2($){if(Zv!==null)clearTimeout(Zv),Zv=null;if(E$.value===$)E$.value=null;if(hv.value===$)hv.value=null;k4=void 0}function p6(){let $=E$.value,v=$?T.value.get($):void 0;if($&&v&&WK(v)){let g=$,_=Date.now();if(hv.value=g,k4=v.data.appCheckpoint?.updatedAt,Zv!==null)clearTimeout(Zv);let U=()=>{let b=T.value.get(g)?.data.appCheckpoint?.updatedAt;if(b!==void 0&&b!==k4){J2(g);return}if(Date.now()-_>=iP){J2(g);return}Zv=setTimeout(U,QK)};Zv=setTimeout(U,QK);return}if(Zv!==null)clearTimeout(Zv),Zv=null;hv.value=null,k4=void 0,E$.value=null}function F_(){let $=_2(Array.from(T.value.values()),Array.from(c$.value.values()),"grid");if($.nodePositions.size===0&&$.groupBounds.size===0)return;U6(()=>{for(let[v,g]of $.nodePositions.entries())Pv(v,{position:g});for(let[v,g]of $.groupBounds.entries())O2(v,{position:{x:g.x,y:g.y},size:{width:g.width,height:g.height}},{skipGroupChildTranslation:!0})}),d$()}function Y_(){let $=_2(Array.from(T.value.values()),Array.from(c$.value.values()),"graph");if($.nodePositions.size===0&&$.groupBounds.size===0)return;U6(()=>{for(let[v,g]of $.nodePositions.entries())Pv(v,{position:g});for(let[v,g]of $.groupBounds.entries())O2(v,{position:{x:g.x,y:g.y},size:{width:g.width,height:g.height}},{skipGroupChildTranslation:!0})}),d$()}var pP=0;function O($,v,g,_,U,z){v||(v={});var b,J,G=v;if("ref"in G)for(J in G={},v)J=="ref"?b=v[J]:G[J]=v[J];var K={type:$,props:G,key:g,ref:b,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--pP,__i:-1,__u:0,__source:U,__self:z};if(typeof $=="function"&&(b=$.defaultProps))for(J in b)G[J]===void 0&&(G[J]=b[J]);return k$.vnode&&k$.vnode(K),K}function oP($){return new Date($).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function nP(){EK(),v_()}function dK(){let $=AU.value;if($.length===0)return null;let v=I6.value,g=K4.value;if(!v&&H_.value)return null;if(!v)return O("button",{type:"button",class:"attention-history-tab",onClick:nP,"aria-label":g>0?`Recent updates — ${g} new`:"Recent updates",title:g>0?`${g} new updates since last viewed`:"Recent updates",children:[O("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("circle",{cx:"4.5",cy:"8",r:"1.1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"6.5",x2:"12.5",y2:"6.5"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"8",x2:"11",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"9.5",x2:"12",y2:"9.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("span",{class:"attention-history-tab-label",children:"Updates"},void 0,!1,void 0,this),g>0&&O("span",{class:"attention-history-tab-badge","aria-hidden":"true",children:g>9?"9+":g},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("aside",{class:"attention-history","aria-label":"Recent semantic changes",children:[O("div",{class:"attention-history-header",children:[O("div",{class:"attention-history-header-text",children:[O("span",{class:"attention-history-title",children:"Recent Updates"},void 0,!1,void 0,this),O("span",{class:"attention-history-subtitle",children:"Focus and meaning shifts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("button",{type:"button",class:"attention-history-close",onClick:U_,"aria-label":"Collapse changes panel",title:"Collapse",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"attention-history-list",children:$.map((_)=>O("article",{class:`attention-history-entry attention-tone-${_.tone}`,children:[O("div",{class:"attention-history-meta",children:[O("span",{class:"attention-history-kind",children:_.title},void 0,!1,void 0,this),O("time",{class:"attention-history-time",dateTime:new Date(_.createdAt).toISOString(),children:oP(_.createdAt)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("p",{class:"attention-history-detail",children:_.detail},void 0,!1,void 0,this)]},_.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function aK(){let $=sg.value;if(!$)return null;return O("button",{type:"button",class:`attention-toast attention-tone-${$.tone}`,onClick:v_,"aria-label":`${$.title} — open change history`,title:$.detail||$.title,children:[O("span",{class:"attention-toast-dot","aria-hidden":"true"},void 0,!1,void 0,this),O("span",{class:"attention-toast-title",children:$.title},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var tP=700,dP=1600;function aP($){return $.replace(/\r\n?/g,`
22
+ `}}};M6.tableCaption={filter:["caption"],replacement:()=>""};M6.tableColgroup={filter:["colgroup","col"],replacement:()=>""};M6.tableSection={filter:["thead","tbody","tfoot"],replacement:function($){return $}};function pk($){var v=$.parentNode;return v.nodeName==="THEAD"||v.firstChild===$&&(v.nodeName==="TABLE"||ok(v))&&lk.call($.childNodes,function(g){return g.nodeName==="TH"})}function ok($){var v=$.previousSibling;return $.nodeName==="TBODY"&&(!v||v.nodeName==="THEAD"&&/^\s*$/i.test(v.textContent))}function QK($,v=null,g=null){if(g===null)g=ik.call(v.parentNode.childNodes,v);var _=" ";if(g===0)_="| ";let U=$.trim().replace(/\n\r/g,"<br>").replace(/\n/g,"<br>");U=U.replace(/\|+/g,"\\|");while(U.length<3)U+=" ";if(v)U=dk(U,v," ");return _+U+" |"}function NK($){if(!$.childNodes)return!1;for(let v=0;v<$.childNodes.length;v++){let g=$.childNodes[v];if(g.nodeName==="TABLE")return!0;if(NK(g))return!0}return!1}var r2=($,v)=>{if(!$.childNodes)return!1;for(let g=0;g<$.childNodes.length;g++){let _=$.childNodes[g];if(v==="code"&&N2&&N2(_))return!0;if(v.includes(_.nodeName))return!0;if(r2(_,v))return!0}return!1},rK=($,v)=>{let g=["UL","OL","H1","H2","H3","H4","H5","H6","HR","BLOCKQUOTE"];if(v.preserveNestedTables)g.push("TABLE");return r2($,"code")||r2($,g)};function u2($){let v=XK.get($);if(v!==void 0)return v;let g=nk($);return XK.set($,g),g}function nk($){if(!$)return!0;if(!$.rows)return!0;if($.rows.length===1&&$.rows[0].childNodes.length<=1)return!0;if(NK($))return!0;return!1}function tk($){let v=$.parentNode;while(v.nodeName!=="DIV")if(v=v.parentNode,!v)return null;return v}function uK($){let v=$.parentNode;while(v.nodeName!=="TABLE")if(v=v.parentNode,!v)return null;return v}function dk($,v,g){let _=v.getAttribute("colspan")||1;for(let U=1;U<_;U++)$+=" | "+g.repeat(3);return $}function yK($){let v=0;for(let g=0;g<$.rows.length;g++){let U=$.rows[g].childNodes.length;if(U>v)v=U}return v}function RK($){N2=$.isCodeBlock,ZK=$.options,$.keep(function(g){if(g.nodeName==="TABLE"&&rK(g,$.options))return!0;return!1});for(var v in M6)$.addRule(v,M6[v])}function DK($){$.addRule("taskListItems",{filter:function(v){let g=v.parentNode,_=g.parentNode;return v.type==="checkbox"&&(g.nodeName==="LI"||g.nodeName==="LABEL"&&_&&_.nodeName==="LI")},replacement:function(v,g){return(g.checked?"[x]":"[ ]")+" "}})}function ak($){$.use([AK,wK,RK,DK])}TK.gfm=ak;TK.highlightedCodeBlock=AK;TK.strikethrough=wK;TK.tables=RK;TK.taskListItems=DK});var ng,B$,VG,s0,I6,RG,CG,fG,EG,e0,t0,d0,qP,xg={},pg=[],XP=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,tg=Array.isArray;function U6($,v){for(var g in v)$[g]=v[g];return $}function $2($){$&&$.parentNode&&$.parentNode.removeChild($)}function AP($,v,g){var _,U,z,J={};for(z in v)z=="key"?_=v[z]:z=="ref"?U=v[z]:J[z]=v[z];if(arguments.length>2&&(J.children=arguments.length>3?ng.call(arguments,2):g),typeof $=="function"&&$.defaultProps!=null)for(z in $.defaultProps)J[z]===void 0&&(J[z]=$.defaultProps[z]);return hg($,J,_,U,null)}function hg($,v,g,_,U){var z={type:$,props:v,key:g,ref:_,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:U==null?++VG:U,__i:-1,__u:0};return U==null&&B$.vnode!=null&&B$.vnode(z),z}function s$($){return $.children}function K4($,v){this.props=$,this.context=v}function W4($,v){if(v==null)return $.__?W4($.__,$.__i+1):null;for(var g;v<$.__k.length;v++)if((g=$.__k[v])!=null&&g.__e!=null)return g.__e;return typeof $.type=="function"?W4($):null}function wP($){if($.__P&&$.__d){var v=$.__v,g=v.__e,_=[],U=[],z=U6({},v);z.__v=v.__v+1,B$.vnode&&B$.vnode(z),v2($.__P,z,v,$.__n,$.__P.namespaceURI,32&v.__u?[g]:null,_,g==null?W4(v):g,!!(32&v.__u),U),z.__v=v.__v,z.__.__k[z.__i]=z,lG(_,z,U),v.__e=v.__=null,z.__e!=g&&cG(z)}}function cG($){if(($=$.__)!=null&&$.__c!=null)return $.__e=$.__c.base=null,$.__k.some(function(v){if(v!=null&&v.__e!=null)return $.__e=$.__c.base=v.__e}),cG($)}function DG($){(!$.__d&&($.__d=!0)&&I6.push($)&&!og.__r++||RG!=B$.debounceRendering)&&((RG=B$.debounceRendering)||CG)(og)}function og(){try{for(var $,v=1;I6.length;)I6.length>v&&I6.sort(fG),$=I6.shift(),v=I6.length,wP($)}finally{I6.length=og.__r=0}}function mG($,v,g,_,U,z,J,b,G,K,W){var B,k,P,q,L,H,F,Y=_&&_.__k||pg,A=v.length;for(G=ZP(g,v,Y,G,A),B=0;B<A;B++)(P=g.__k[B])!=null&&(k=P.__i!=-1&&Y[P.__i]||xg,P.__i=B,H=v2($,P,k,U,z,J,b,G,K,W),q=P.__e,P.ref&&k.ref!=P.ref&&(k.ref&&U2(k.ref,null,P),W.push(P.ref,P.__c||q,P)),L==null&&q!=null&&(L=q),(F=!!(4&P.__u))||k.__k===P.__k?G=iG(P,G,$,F):typeof P.type=="function"&&H!==void 0?G=H:q&&(G=q.nextSibling),P.__u&=-7);return g.__e=L,G}function ZP($,v,g,_,U){var z,J,b,G,K,W=g.length,B=W,k=0;for($.__k=Array(U),z=0;z<U;z++)(J=v[z])!=null&&typeof J!="boolean"&&typeof J!="function"?(typeof J=="string"||typeof J=="number"||typeof J=="bigint"||J.constructor==String?J=$.__k[z]=hg(null,J,null,null,null):tg(J)?J=$.__k[z]=hg(s$,{children:J},null,null,null):J.constructor===void 0&&J.__b>0?J=$.__k[z]=hg(J.type,J.props,J.key,J.ref?J.ref:null,J.__v):$.__k[z]=J,G=z+k,J.__=$,J.__b=$.__b+1,b=null,(K=J.__i=SP(J,g,G,B))!=-1&&(B--,(b=g[K])&&(b.__u|=2)),b==null||b.__v==null?(K==-1&&(U>W?k--:U<W&&k++),typeof J.type!="function"&&(J.__u|=4)):K!=G&&(K==G-1?k--:K==G+1?k++:(K>G?k--:k++,J.__u|=4))):$.__k[z]=null;if(B)for(z=0;z<W;z++)(b=g[z])!=null&&(2&b.__u)==0&&(b.__e==_&&(_=W4(b)),xG(b,b));return _}function iG($,v,g,_){var U,z;if(typeof $.type=="function"){for(U=$.__k,z=0;U&&z<U.length;z++)U[z]&&(U[z].__=$,v=iG(U[z],v,g,_));return v}$.__e!=v&&(_&&(v&&$.type&&!v.parentNode&&(v=W4($)),g.insertBefore($.__e,v||null)),v=$.__e);do v=v&&v.nextSibling;while(v!=null&&v.nodeType==8);return v}function SP($,v,g,_){var U,z,J,b=$.key,G=$.type,K=v[g],W=K!=null&&(2&K.__u)==0;if(K===null&&b==null||W&&b==K.key&&G==K.type)return g;if(_>(W?1:0)){for(U=g-1,z=g+1;U>=0||z<v.length;)if((K=v[J=U>=0?U--:z++])!=null&&(2&K.__u)==0&&b==K.key&&G==K.type)return J}return-1}function TG($,v,g){v[0]=="-"?$.setProperty(v,g==null?"":g):$[v]=g==null?"":typeof g!="number"||XP.test(v)?g:g+"px"}function lg($,v,g,_,U){var z,J;$:if(v=="style")if(typeof g=="string")$.style.cssText=g;else{if(typeof _=="string"&&($.style.cssText=_=""),_)for(v in _)g&&v in g||TG($.style,v,"");if(g)for(v in g)_&&g[v]==_[v]||TG($.style,v,g[v])}else if(v[0]=="o"&&v[1]=="n")z=v!=(v=v.replace(EG,"$1")),J=v.toLowerCase(),v=J in $||v=="onFocusOut"||v=="onFocusIn"?J.slice(2):v.slice(2),$.l||($.l={}),$.l[v+z]=g,g?_?g.u=_.u:(g.u=e0,$.addEventListener(v,z?d0:t0,z)):$.removeEventListener(v,z?d0:t0,z);else{if(U=="http://www.w3.org/2000/svg")v=v.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(v!="width"&&v!="height"&&v!="href"&&v!="list"&&v!="form"&&v!="tabIndex"&&v!="download"&&v!="rowSpan"&&v!="colSpan"&&v!="role"&&v!="popover"&&v in $)try{$[v]=g==null?"":g;break $}catch(b){}typeof g=="function"||(g==null||g===!1&&v[4]!="-"?$.removeAttribute(v):$.setAttribute(v,v=="popover"&&g==1?"":g))}}function jG($){return function(v){if(this.l){var g=this.l[v.type+$];if(v.t==null)v.t=e0++;else if(v.t<g.u)return;return g(B$.event?B$.event(v):v)}}}function v2($,v,g,_,U,z,J,b,G,K){var W,B,k,P,q,L,H,F,Y,A,M,V,f,N,t,d=v.type;if(v.constructor!==void 0)return null;128&g.__u&&(G=!!(32&g.__u),z=[b=v.__e=g.__e]),(W=B$.__b)&&W(v);$:if(typeof d=="function")try{if(F=v.props,Y=d.prototype&&d.prototype.render,A=(W=d.contextType)&&_[W.__c],M=W?A?A.props.value:W.__:_,g.__c?H=(B=v.__c=g.__c).__=B.__E:(Y?v.__c=B=new d(F,M):(v.__c=B=new K4(F,M),B.constructor=d,B.render=QP),A&&A.sub(B),B.state||(B.state={}),B.__n=_,k=B.__d=!0,B.__h=[],B._sb=[]),Y&&B.__s==null&&(B.__s=B.state),Y&&d.getDerivedStateFromProps!=null&&(B.__s==B.state&&(B.__s=U6({},B.__s)),U6(B.__s,d.getDerivedStateFromProps(F,B.__s))),P=B.props,q=B.state,B.__v=v,k)Y&&d.getDerivedStateFromProps==null&&B.componentWillMount!=null&&B.componentWillMount(),Y&&B.componentDidMount!=null&&B.__h.push(B.componentDidMount);else{if(Y&&d.getDerivedStateFromProps==null&&F!==P&&B.componentWillReceiveProps!=null&&B.componentWillReceiveProps(F,M),v.__v==g.__v||!B.__e&&B.shouldComponentUpdate!=null&&B.shouldComponentUpdate(F,B.__s,M)===!1){v.__v!=g.__v&&(B.props=F,B.state=B.__s,B.__d=!1),v.__e=g.__e,v.__k=g.__k,v.__k.some(function(u){u&&(u.__=v)}),pg.push.apply(B.__h,B._sb),B._sb=[],B.__h.length&&J.push(B);break $}B.componentWillUpdate!=null&&B.componentWillUpdate(F,B.__s,M),Y&&B.componentDidUpdate!=null&&B.__h.push(function(){B.componentDidUpdate(P,q,L)})}if(B.context=M,B.props=F,B.__P=$,B.__e=!1,V=B$.__r,f=0,Y)B.state=B.__s,B.__d=!1,V&&V(v),W=B.render(B.props,B.state,B.context),pg.push.apply(B.__h,B._sb),B._sb=[];else do B.__d=!1,V&&V(v),W=B.render(B.props,B.state,B.context),B.state=B.__s;while(B.__d&&++f<25);B.state=B.__s,B.getChildContext!=null&&(_=U6(U6({},_),B.getChildContext())),Y&&!k&&B.getSnapshotBeforeUpdate!=null&&(L=B.getSnapshotBeforeUpdate(P,q)),N=W!=null&&W.type===s$&&W.key==null?hG(W.props.children):W,b=mG($,tg(N)?N:[N],v,g,_,U,z,J,b,G,K),B.base=v.__e,v.__u&=-161,B.__h.length&&J.push(B),H&&(B.__E=B.__=null)}catch(u){if(v.__v=null,G||z!=null)if(u.then){for(v.__u|=G?160:128;b&&b.nodeType==8&&b.nextSibling;)b=b.nextSibling;z[z.indexOf(b)]=null,v.__e=b}else{for(t=z.length;t--;)$2(z[t]);a0(v)}else v.__e=g.__e,v.__k=g.__k,u.then||a0(v);B$.__e(u,v,g)}else z==null&&v.__v==g.__v?(v.__k=g.__k,v.__e=g.__e):b=v.__e=MP(g.__e,v,g,_,U,z,J,G,K);return(W=B$.diffed)&&W(v),128&v.__u?void 0:b}function a0($){$&&($.__c&&($.__c.__e=!0),$.__k&&$.__k.some(a0))}function lG($,v,g){for(var _=0;_<g.length;_++)U2(g[_],g[++_],g[++_]);B$.__c&&B$.__c(v,$),$.some(function(U){try{$=U.__h,U.__h=[],$.some(function(z){z.call(U)})}catch(z){B$.__e(z,U.__v)}})}function hG($){return typeof $!="object"||$==null||$.__b>0?$:tg($)?$.map(hG):U6({},$)}function MP($,v,g,_,U,z,J,b,G){var K,W,B,k,P,q,L,H=g.props||xg,F=v.props,Y=v.type;if(Y=="svg"?U="http://www.w3.org/2000/svg":Y=="math"?U="http://www.w3.org/1998/Math/MathML":U||(U="http://www.w3.org/1999/xhtml"),z!=null){for(K=0;K<z.length;K++)if((P=z[K])&&"setAttribute"in P==!!Y&&(Y?P.localName==Y:P.nodeType==3)){$=P,z[K]=null;break}}if($==null){if(Y==null)return document.createTextNode(F);$=document.createElementNS(U,Y,F.is&&F),b&&(B$.__m&&B$.__m(v,z),b=!1),z=null}if(Y==null)H===F||b&&$.data==F||($.data=F);else{if(z=z&&ng.call($.childNodes),!b&&z!=null)for(H={},K=0;K<$.attributes.length;K++)H[(P=$.attributes[K]).name]=P.value;for(K in H)P=H[K],K=="dangerouslySetInnerHTML"?B=P:K=="children"||(K in F)||K=="value"&&("defaultValue"in F)||K=="checked"&&("defaultChecked"in F)||lg($,K,null,P,U);for(K in F)P=F[K],K=="children"?k=P:K=="dangerouslySetInnerHTML"?W=P:K=="value"?q=P:K=="checked"?L=P:b&&typeof P!="function"||H[K]===P||lg($,K,P,H[K],U);if(W)b||B&&(W.__html==B.__html||W.__html==$.innerHTML)||($.innerHTML=W.__html),v.__k=[];else if(B&&($.innerHTML=""),mG(v.type=="template"?$.content:$,tg(k)?k:[k],v,g,_,Y=="foreignObject"?"http://www.w3.org/1999/xhtml":U,z,J,z?z[0]:g.__k&&W4(g,0),b,G),z!=null)for(K=z.length;K--;)$2(z[K]);b||(K="value",Y=="progress"&&q==null?$.removeAttribute("value"):q!=null&&(q!==$[K]||Y=="progress"&&!q||Y=="option"&&q!=H[K])&&lg($,K,q,H[K],U),K="checked",L!=null&&L!=$[K]&&lg($,K,L,H[K],U))}return $}function U2($,v,g){try{if(typeof $=="function"){var _=typeof $.__u=="function";_&&$.__u(),_&&v==null||($.__u=$(v))}else $.current=v}catch(U){B$.__e(U,g)}}function xG($,v,g){var _,U;if(B$.unmount&&B$.unmount($),(_=$.ref)&&(_.current&&_.current!=$.__e||U2(_,null,v)),(_=$.__c)!=null){if(_.componentWillUnmount)try{_.componentWillUnmount()}catch(z){B$.__e(z,v)}_.base=_.__P=null}if(_=$.__k)for(U=0;U<_.length;U++)_[U]&&xG(_[U],v,g||typeof $.type!="function");g||$2($.__e),$.__c=$.__=$.__e=void 0}function QP($,v,g){return this.constructor($,g)}function pG($,v,g){var _,U,z,J;v==document&&(v=document.documentElement),B$.__&&B$.__($,v),U=(_=typeof g=="function")?null:g&&g.__k||v.__k,z=[],J=[],v2(v,$=(!_&&g||v).__k=AP(s$,null,[$]),U||xg,xg,v.namespaceURI,!_&&g?[g]:U?null:v.firstChild?ng.call(v.childNodes):null,z,!_&&g?g:U?U.__e:v.firstChild,_,J),lG(z,$,J)}ng=pg.slice,B$={__e:function($,v,g,_){for(var U,z,J;v=v.__;)if((U=v.__c)&&!U.__)try{if((z=U.constructor)&&z.getDerivedStateFromError!=null&&(U.setState(z.getDerivedStateFromError($)),J=U.__d),U.componentDidCatch!=null&&(U.componentDidCatch($,_||{}),J=U.__d),J)return U.__E=U}catch(b){$=b}throw $}},VG=0,s0=function($){return $!=null&&$.constructor===void 0},K4.prototype.setState=function($,v){var g;g=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=U6({},this.state),typeof $=="function"&&($=$(U6({},g),this.props)),$&&U6(g,$),$!=null&&this.__v&&(v&&this._sb.push(v),DG(this))},K4.prototype.forceUpdate=function($){this.__v&&(this.__e=!0,$&&this.__h.push($),DG(this))},K4.prototype.render=s$,I6=[],CG=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fG=function($,v){return $.__v.__b-v.__v.__b},og.__r=0,EG=/(PointerCapture)$|Capture$/i,e0=0,t0=jG(!1),d0=jG(!0),qP=0;var B4,E$,g2,oG,wU=0,v3=[],l$=B$,nG=l$.__b,tG=l$.__r,dG=l$.diffed,aG=l$.__c,sG=l$.unmount,eG=l$.__;function ag($,v){l$.__h&&l$.__h(E$,$,wU||v),wU=0;var g=E$.__H||(E$.__H={__:[],__h:[]});return $>=g.__.length&&g.__.push({}),g.__[$]}function x($){return wU=1,NP(U3,$)}function NP($,v,g){var _=ag(B4++,2);if(_.t=$,!_.__c&&(_.__=[g?g(v):U3(void 0,v),function(b){var G=_.__N?_.__N[0]:_.__[0],K=_.t(G,b);G!==K&&(_.__N=[K,_.__[1]],_.__c.setState({}))}],_.__c=E$,!E$.__f)){var U=function(b,G,K){if(!_.__c.__H)return!0;var W=_.__c.__H.__.filter(function(k){return k.__c});if(W.every(function(k){return!k.__N}))return!z||z.call(this,b,G,K);var B=_.__c.props!==b;return W.some(function(k){if(k.__N){var P=k.__[0];k.__=k.__N,k.__N=void 0,P!==k.__[0]&&(B=!0)}}),z&&z.call(this,b,G,K)||B};E$.__f=!0;var{shouldComponentUpdate:z,componentWillUpdate:J}=E$;E$.componentWillUpdate=function(b,G,K){if(this.__e){var W=z;z=void 0,U(b,G,K),z=W}J&&J.call(this,b,G,K)},E$.shouldComponentUpdate=U}return _.__N||_.__}function c($,v){var g=ag(B4++,3);!l$.__s&&z2(g.__H,v)&&(g.__=$,g.u=v,E$.__H.__h.push(g))}function sg($,v){var g=ag(B4++,4);!l$.__s&&z2(g.__H,v)&&(g.__=$,g.u=v,E$.__h.push(g))}function y($){return wU=5,t$(function(){return{current:$}},[])}function t$($,v){var g=ag(B4++,7);return z2(g.__H,v)&&(g.__=$(),g.__H=v,g.__h=$),g.__}function Q($,v){return wU=8,t$(function(){return $},v)}function rP(){for(var $;$=v3.shift();){var v=$.__H;if($.__P&&v)try{v.__h.some(dg),v.__h.some(_2),v.__h=[]}catch(g){v.__h=[],l$.__e(g,$.__v)}}}l$.__b=function($){E$=null,nG&&nG($)},l$.__=function($,v){$&&v.__k&&v.__k.__m&&($.__m=v.__k.__m),eG&&eG($,v)},l$.__r=function($){tG&&tG($),B4=0;var v=(E$=$.__c).__H;v&&(g2===E$?(v.__h=[],E$.__h=[],v.__.some(function(g){g.__N&&(g.__=g.__N),g.u=g.__N=void 0})):(v.__h.some(dg),v.__h.some(_2),v.__h=[],B4=0)),g2=E$},l$.diffed=function($){dG&&dG($);var v=$.__c;v&&v.__H&&(v.__H.__h.length&&(v3.push(v)!==1&&oG===l$.requestAnimationFrame||((oG=l$.requestAnimationFrame)||uP)(rP)),v.__H.__.some(function(g){g.u&&(g.__H=g.u),g.u=void 0})),g2=E$=null},l$.__c=function($,v){v.some(function(g){try{g.__h.some(dg),g.__h=g.__h.filter(function(_){return!_.__||_2(_)})}catch(_){v.some(function(U){U.__h&&(U.__h=[])}),v=[],l$.__e(_,g.__v)}}),aG&&aG($,v)},l$.unmount=function($){sG&&sG($);var v,g=$.__c;g&&g.__H&&(g.__H.__.some(function(_){try{dg(_)}catch(U){v=U}}),g.__H=void 0,v&&l$.__e(v,g.__v))};var $3=typeof requestAnimationFrame=="function";function uP($){var v,g=function(){clearTimeout(_),$3&&cancelAnimationFrame(v),setTimeout($)},_=setTimeout(g,35);$3&&(v=requestAnimationFrame(g))}function dg($){var v=E$,g=$.__c;typeof g=="function"&&($.__c=void 0,g()),E$=v}function _2($){var v=E$;$.__c=$.__(),E$=v}function z2($,v){return!$||$.length!==v.length||v.some(function(g,_){return g!==$[_]})}function U3($,v){return typeof v=="function"?v($):v}var yP=Symbol.for("preact-signals");function U_(){if(!(g6>1)){var $,v=!1;(function(){var U=$_;$_=void 0;while(U!==void 0){if(U.S.v===U.v)U.S.i=U.i;U=U.o}})();while(ZU!==void 0){var g=ZU;ZU=void 0,eg++;while(g!==void 0){var _=g.u;if(g.u=void 0,g.f&=-3,!(8&g.f)&&z3(g))try{g.c()}catch(U){if(!v)$=U,v=!0}g=_}}if(eg=0,g6--,v)throw $}else g6--}function _6($){if(g6>0)return $();J2=++RP,g6++;try{return $()}finally{U_()}}var q$=void 0;function b2($){var v=q$;q$=void 0;try{return $()}finally{q$=v}}var g3,ZU=void 0,g6=0,eg=0,RP=0,J2=0,$_=void 0,v_=0;function _3($){if(q$!==void 0){var v=$.n;if(v===void 0||v.t!==q$){if(v={i:0,S:$,p:q$.s,n:void 0,t:q$,e:void 0,x:void 0,r:v},q$.s!==void 0)q$.s.n=v;if(q$.s=v,$.n=v,32&q$.f)$.S(v);return v}else if(v.i===-1){if(v.i=0,v.n!==void 0){if(v.n.p=v.p,v.p!==void 0)v.p.n=v.n;v.p=q$.s,v.n=void 0,q$.s.n=v,q$.s=v}return v}}}function o$($,v){this.v=$,this.i=0,this.n=void 0,this.t=void 0,this.l=0,this.W=v==null?void 0:v.watched,this.Z=v==null?void 0:v.unwatched,this.name=v==null?void 0:v.name}o$.prototype.brand=yP;o$.prototype.h=function(){return!0};o$.prototype.S=function($){var v=this,g=this.t;if(g!==$&&$.e===void 0)if($.x=g,this.t=$,g!==void 0)g.e=$;else b2(function(){var _;(_=v.W)==null||_.call(v)})};o$.prototype.U=function($){var v=this;if(this.t!==void 0){var{e:g,x:_}=$;if(g!==void 0)g.x=_,$.e=void 0;if(_!==void 0)_.e=g,$.x=void 0;if($===this.t){if(this.t=_,_===void 0)b2(function(){var U;(U=v.Z)==null||U.call(v)})}}};o$.prototype.subscribe=function($){var v=this;return L6(function(){var g=v.value,_=q$;q$=void 0;try{$(g)}finally{q$=_}},{name:"sub"})};o$.prototype.valueOf=function(){return this.value};o$.prototype.toString=function(){return this.value+""};o$.prototype.toJSON=function(){return this.value};o$.prototype.peek=function(){var $=q$;q$=void 0;try{return this.value}finally{q$=$}};Object.defineProperty(o$.prototype,"value",{get:function(){var $=_3(this);if($!==void 0)$.i=this.i;return this.v},set:function($){if($!==this.v){if(eg>100)throw Error("Cycle detected");(function(g){if(g6!==0&&eg===0){if(g.l!==J2)g.l=J2,$_={S:g,v:g.v,i:g.i,o:$_}}})(this),this.v=$,this.i++,v_++,g6++;try{for(var v=this.t;v!==void 0;v=v.x)v.t.N()}finally{U_()}}}});function W$($,v){return new o$($,v)}function z3($){for(var v=$.s;v!==void 0;v=v.n)if(v.S.i!==v.i||!v.S.h()||v.S.i!==v.i)return!0;return!1}function J3($){for(var v=$.s;v!==void 0;v=v.n){var g=v.S.n;if(g!==void 0)v.r=g;if(v.S.n=v,v.i=-1,v.n===void 0){$.s=v;break}}}function b3($){var v=$.s,g=void 0;while(v!==void 0){var _=v.p;if(v.i===-1){if(v.S.U(v),_!==void 0)_.n=v.n;if(v.n!==void 0)v.n.p=_}else g=v;if(v.S.n=v.r,v.r!==void 0)v.r=void 0;v=_}$.s=g}function x6($,v){o$.call(this,void 0),this.x=$,this.s=void 0,this.g=v_-1,this.f=4,this.W=v==null?void 0:v.watched,this.Z=v==null?void 0:v.unwatched,this.name=v==null?void 0:v.name}x6.prototype=new o$;x6.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32)return!0;if(this.f&=-5,this.g===v_)return!0;if(this.g=v_,this.f|=1,this.i>0&&!z3(this))return this.f&=-2,!0;var $=q$;try{J3(this),q$=this;var v=this.x();if(16&this.f||this.v!==v||this.i===0)this.v=v,this.f&=-17,this.i++}catch(g){this.v=g,this.f|=16,this.i++}return q$=$,b3(this),this.f&=-2,!0};x6.prototype.S=function($){if(this.t===void 0){this.f|=36;for(var v=this.s;v!==void 0;v=v.n)v.S.S(v)}o$.prototype.S.call(this,$)};x6.prototype.U=function($){if(this.t!==void 0){if(o$.prototype.U.call(this,$),this.t===void 0){this.f&=-33;for(var v=this.s;v!==void 0;v=v.n)v.S.U(v)}}};x6.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var $=this.t;$!==void 0;$=$.x)$.t.N()}};Object.defineProperty(x6.prototype,"value",{get:function(){if(1&this.f)throw Error("Cycle detected");var $=_3(this);if(this.h(),$!==void 0)$.i=this.i;if(16&this.f)throw this.v;return this.v}});function p6($,v){return new x6($,v)}function O3($){var v=$.m;if($.m=void 0,typeof v=="function"){g6++;var g=q$;q$=void 0;try{v()}catch(_){throw $.f&=-2,$.f|=8,O2($),_}finally{q$=g,U_()}}}function O2($){for(var v=$.s;v!==void 0;v=v.n)v.S.U(v);$.x=void 0,$.s=void 0,O3($)}function DP($){if(q$!==this)throw Error("Out-of-order effect");if(b3(this),q$=$,this.f&=-2,8&this.f)O2(this);U_()}function P4($,v){if(this.x=$,this.m=void 0,this.s=void 0,this.u=void 0,this.f=32,this.name=v==null?void 0:v.name,g3)g3.push(this)}P4.prototype.c=function(){var $=this.S();try{if(8&this.f)return;if(this.x===void 0)return;var v=this.x();if(typeof v=="function")this.m=v}finally{$()}};P4.prototype.S=function(){if(1&this.f)throw Error("Cycle detected");this.f|=1,this.f&=-9,O3(this),J3(this),g6++;var $=q$;return q$=this,DP.bind(this,$)};P4.prototype.N=function(){if(!(2&this.f))this.f|=2,this.u=ZU,ZU=this};P4.prototype.d=function(){if(this.f|=8,!(1&this.f))O2(this)};P4.prototype.dispose=function(){this.d()};function L6($,v){var g=new P4($,v);try{g.c()}catch(U){throw g.d(),U}var _=g.d.bind(g);return _[Symbol.dispose]=_,_}var G2,K2,g_,TP=typeof window<"u"&&!!window.__PREACT_SIGNALS_DEVTOOLS__,G3=[],K3=[];L6(function(){G2=this.N})();function k4($,v){B$[$]=v.bind(null,B$[$]||function(){})}function __($){if(g_){var v=g_;g_=void 0,v()}g_=$&&$.S()}function W3($){var v=this,g=$.data,_=VP(g);_.value=g;var U=t$(function(){var b=v,G=v.__v;while(G=G.__)if(G.__c){G.__c.__$f|=4;break}var K=p6(function(){var P=_.value.value;return P===0?0:P===!0?"":P||""}),W=p6(function(){return!Array.isArray(K.value)&&!s0(K.value)}),B=L6(function(){if(this.N=B3,W.value){var P=K.value;if(b.__v&&b.__v.__e&&b.__v.__e.nodeType===3)b.__v.__e.data=P}}),k=v.__$u.d;return v.__$u.d=function(){B(),k.call(this)},[W,K]},[]),z=U[0],J=U[1];return z.value?J.peek():J.value}W3.displayName="ReactiveTextNode";Object.defineProperties(o$.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:W3},props:{configurable:!0,get:function(){var $=this;return{data:{get value(){return $.value}}}}},__b:{configurable:!0,value:1}});k4("__b",function($,v){if(typeof v.type=="string"){var g,_=v.props;for(var U in _)if(U!=="children"){var z=_[U];if(z instanceof o$){if(!g)v.__np=g={};g[U]=z,_[U]=z.peek()}}}$(v)});k4("__r",function($,v){if($(v),v.type!==s$){__();var g,_=v.__c;if(_){if(_.__$f&=-2,(g=_.__$u)===void 0)_.__$u=g=function(U,z){var J;return L6(function(){J=this},{name:z}),J.c=U,J}(function(){var U;if(TP)(U=g.y)==null||U.call(g);_.__$f|=1,_.setState({})},typeof v.type=="function"?v.type.displayName||v.type.name:"")}K2=_,__(g)}});k4("__e",function($,v,g,_){__(),K2=void 0,$(v,g,_)});k4("diffed",function($,v){__(),K2=void 0;var g;if(typeof v.type=="string"&&(g=v.__e)){var{__np:_,props:U}=v;if(_){var z=g.U;if(z)for(var J in z){var b=z[J];if(b!==void 0&&!(J in _))b.d(),z[J]=void 0}else z={},g.U=z;for(var G in _){var K=z[G],W=_[G];if(K===void 0)K=jP(g,G,W),z[G]=K;else K.o(W,U)}for(var B in _)U[B]=_[B]}}$(v)});function jP($,v,g,_){var U=v in $&&$.ownerSVGElement===void 0,z=W$(g),J=g.peek();return{o:function(b,G){z.value=b,J=b.peek()},d:L6(function(){this.N=B3;var b=z.value.value;if(J!==b)if(J=void 0,U)$[v]=b;else if(b!=null&&(b!==!1||v[4]==="-"))$.setAttribute(v,b);else $.removeAttribute(v);else J=void 0})}}k4("unmount",function($,v){if(typeof v.type=="string"){var g=v.__e;if(g){var _=g.U;if(_){g.U=void 0;for(var U in _){var z=_[U];if(z)z.d()}}}v.__np=void 0}else{var J=v.__c;if(J){var b=J.__$u;if(b)J.__$u=void 0,b.d()}}$(v)});k4("__h",function($,v,g,_){if(_<3||_===9)v.__$f|=2;$(v,g,_)});K4.prototype.shouldComponentUpdate=function($,v){if(this.__R)return!0;var g=this.__$u,_=g&&g.s!==void 0;for(var U in v)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var z=2&this.__$f;if(!(_||z||4&this.__$f))return!0;if(1&this.__$f)return!0}else{if(!(_||4&this.__$f))return!0;if(3&this.__$f)return!0}for(var J in $)if(J!=="__source"&&$[J]!==this.props[J])return!0;for(var b in this.props)if(!(b in $))return!0;return!1};function VP($,v){return t$(function(){return W$($,v)},[])}var CP=typeof requestAnimationFrame>"u"?setTimeout:function($){var v=function(){clearTimeout(g),cancelAnimationFrame(_),$()},g=setTimeout(v,35),_=requestAnimationFrame(v)},fP=function($){queueMicrotask(function(){queueMicrotask($)})};function EP(){_6(function(){var $;while($=G3.shift())G2.call($)})}function cP(){if(G3.push(this)===1)(B$.requestAnimationFrame||CP)(EP)}function mP(){_6(function(){var $;while($=K3.shift())G2.call($)})}function B3(){if(K3.push(this)===1)(B$.requestAnimationFrame||fP)(mP)}function P3($,v){var g=y($);g.current=$,c(function(){return L6(function(){return this.N=cP,g.current()},v)},[])}var z_=W$(null),SU=W$([]),I4=W$(new Set),L4=W$(new Set),J_=W$([]),b_=W$(new Set),F6=W$(!1),H4=W$(0);function k3(){z_.value=null,SU.value=[],I4.value=new Set,L4.value=new Set,J_.value=[],b_.value=new Set,F6.value=!1,H4.value=0}function O_(){F6.value=!0,H4.value=0}function G_(){F6.value=!1}function H3($,v,g){I4.value=new Set($),L4.value=new Set(v),J_.value=g}function K_($){z_.value=$}function I3($,v=6){if(SU.value=[$,...SU.value].slice(0,v),!F6.value)H4.value=Math.min(99,H4.value+1)}function W_($){b_.value=new Set($)}var e$={markdown:"MD","mcp-app":"APP",webpage:"WEB","json-render":"UI",graph:"GRAPH",prompt:"ASK",response:"ANS",status:"STATUS",context:"CONTEXT",ledger:"LOG",trace:"TRACE",file:"FILE",image:"IMG",html:"HTML",group:"GROUP"},B_=new Set(["markdown","mcp-app","webpage","json-render","graph","context","ledger","file","image","html"]);function L3($){return $.type==="mcp-app"&&$.data.mode==="ext-app"&&$.data.serverName==="Excalidraw"&&$.data.toolName==="create_view"}function F3($){if($.length===0)return null;let{POSITIVE_INFINITY:v,POSITIVE_INFINITY:g,NEGATIVE_INFINITY:_,NEGATIVE_INFINITY:U}=Number;for(let z of $)v=Math.min(v,z.position.x),g=Math.min(g,z.position.y),_=Math.max(_,z.position.x+z.size.width),U=Math.max(U,z.position.y+z.size.height);if(!Number.isFinite(v)||!Number.isFinite(g))return null;return{x:v-40,y:g-40-32,width:_-v+80,height:U-g+80+32}}function iP($){let v=$.filter((G)=>!G.pinned&&G.dockPosition===null),g=new Map(v.map((G)=>[G.id,G])),_=new Map,U=[],z=new Map;for(let G of v){if(G.type==="group")continue;let K=typeof G.data.parentGroup==="string"?G.data.parentGroup:"",W=K?g.get(K):void 0;if(!W||W.type!=="group")continue;if(!z.has(K))z.set(K,[]);z.get(K).push(G)}let J=v.filter((G)=>G.type==="group").sort((G,K)=>G.position.y-K.position.y||G.position.x-K.position.x);for(let G of J){let K=z.get(G.id)??[];if(K.length===0){let P=`unit:${G.id}`;U.push({id:P,memberIds:[G.id],origin:{...G.position},size:{...G.size},sortKey:{x:G.position.x,y:G.position.y}}),_.set(G.id,P);continue}let W=K.map((P)=>({position:P.position,size:P.size})),B=F3(W);if(!B)continue;let k=`group:${G.id}`;U.push({id:k,memberIds:K.map((P)=>P.id),origin:{x:B.x,y:B.y},size:{width:B.width,height:B.height},sortKey:{x:B.x,y:B.y},groupId:G.id}),_.set(G.id,k);for(let P of K)_.set(P.id,k)}let b=v.filter((G)=>!_.has(G.id)).sort((G,K)=>G.position.y-K.position.y||G.position.x-K.position.x);for(let G of b){let K=`unit:${G.id}`;U.push({id:K,memberIds:[G.id],origin:{...G.position},size:{...G.size},sortKey:{x:G.position.x,y:G.position.y}}),_.set(G.id,K)}return{units:U,nodesById:g,nodeToUnit:_}}function lP($,v,g){let _=new Map,U=new Map,z=new Map,J=new Map;for(let b of $)_.set(b.id,new Set),U.set(b.id,new Set),z.set(b.id,0),J.set(b.id,0);for(let b of g){let G=v.get(b.from),K=v.get(b.to);if(!G||!K||G===K)continue;if(!_.get(G).has(K))_.get(G).add(K),J.set(G,(J.get(G)??0)+1),z.set(K,(z.get(K)??0)+1);U.get(G).add(K),U.get(K).add(G)}return{outgoing:_,undirected:U,indegree:z,outdegree:J}}function hP($,v){let g=new Map($.map((z)=>[z.id,z])),_=new Set,U=[];for(let z of $){if(_.has(z.id))continue;let J=[z.id],b=[];_.add(z.id);while(J.length>0){let K=J.pop();b.push(K);for(let W of v.get(K)??[]){if(_.has(W))continue;_.add(W),J.push(W)}}let G=b.map((K)=>g.get(K)).filter((K)=>K!==void 0).sort((K,W)=>K.sortKey.y-W.sortKey.y||K.sortKey.x-W.sortKey.x);U.push(G)}return U.sort((z,J)=>z[0].sortKey.y-J[0].sortKey.y||z[0].sortKey.x-J[0].sortKey.x)}function xP($){let v=new Map,g=0,_=0,U=0,z=0,J=Math.max(900,Math.ceil(Math.sqrt($.reduce((b,G)=>b+G.size.width*G.size.height,0))));for(let b of $){if(g>0&&g+b.size.width>J)g=0,_+=U+72,U=0;v.set(b.id,{x:g,y:_}),g+=b.size.width+96,U=Math.max(U,b.size.height),z=Math.max(z,g-96)}return{positions:v,size:{width:Math.max(0,z),height:_+U},sortKey:$[0].sortKey}}function pP($,v,g,_,U){if($.length===1)return{positions:new Map([[$[0].id,{x:0,y:0}]]),size:{...$[0].size},sortKey:$[0].sortKey};let z=new Set($.map((Y)=>Y.id)),J=$.filter((Y)=>(_.get(Y.id)??0)===0&&(U.get(Y.id)??0)>0).sort((Y,A)=>Y.sortKey.x-A.sortKey.x||Y.sortKey.y-A.sortKey.y),b=J.length>0?J:[$.slice().sort((Y,A)=>Y.sortKey.x-A.sortKey.x||Y.sortKey.y-A.sortKey.y)[0]],G=new Map,K=b.map((Y)=>Y.id);for(let Y of b)G.set(Y.id,0);while(K.length>0){let Y=K.shift(),A=G.get(Y)??0;for(let M of g.get(Y)??[]){if(!z.has(M)||G.has(M))continue;G.set(M,A+1),K.push(M)}}let W=0;for(let Y of $){if(G.has(Y.id))continue;G.set(Y.id,W),W+=1}let B=new Map;for(let Y of $){let A=G.get(Y.id)??0;if(!B.has(A))B.set(A,[]);B.get(A).push(Y)}let k=Array.from(B.keys()).sort((Y,A)=>Y-A);for(let Y of k)B.get(Y).sort((A,M)=>A.sortKey.y-M.sortKey.y||A.sortKey.x-M.sortKey.x);let P=new Map,q=new Map,L=0;for(let Y of k){let A=B.get(Y),M=A.reduce((f,N,t)=>f+N.size.height+(t>0?72:0),0),V=Math.max(...A.map((f)=>f.size.width));P.set(Y,M),q.set(Y,V),L=Math.max(L,M)}let H=new Map,F=0;for(let Y of k){let A=B.get(Y),M=P.get(Y)??0,V=q.get(Y)??0,f=Math.max(0,(L-M)/2);for(let N of A)H.set(N.id,{x:F,y:f}),f+=N.size.height+72;F+=V+96}return{positions:H,size:{width:Math.max(0,F-96),height:L},sortKey:$[0].sortKey}}function oP($){let v=new Map,g=40,_=80,U=0;for(let z of $){if(g>40&&g+z.size.width>3200)g=40,_+=U+180,U=0;for(let[J,b]of z.positions.entries())v.set(J,{x:g+b.x,y:_+b.y});g+=z.size.width+220,U=Math.max(U,z.size.height)}return v}function W2($,v,g){let{units:_,nodesById:U,nodeToUnit:z}=iP($),J=new Map,b=new Map;if(_.length===0)return{nodePositions:J,groupBounds:b};let{outgoing:G,undirected:K,indegree:W,outdegree:B}=lP(_,z,v),k=hP(_,K).map((q)=>g==="graph"?pP(q,G,K,W,B):xP(q)),P=oP(k);for(let q of _){let L=P.get(q.id);if(!L)continue;let H=L.x-q.origin.x,F=L.y-q.origin.y;if(q.groupId){let M=[];for(let f of q.memberIds){let N=U.get(f);if(!N)continue;let t={x:N.position.x+H,y:N.position.y+F};J.set(f,t),M.push({position:t,size:N.size})}let V=F3(M);if(V)b.set(q.groupId,V);continue}let Y=q.memberIds[0],A=U.get(Y);if(!A)continue;J.set(Y,{x:A.position.x+H,y:A.position.y+F})}return{nodePositions:J,groupBounds:b}}function B2($,v){console.error(`[intent-bridge] ${$} failed`,v)}async function c$($,v,g,_){try{return await(await fetch(v,_)).json()}catch(U){return B2($,U),g}}async function nP($,v,g){try{return{ok:(await fetch(v,g)).ok}}catch(_){return B2($,_),{ok:!1}}}async function Y3($,v,g){try{await fetch(v,g)}catch(_){B2($,_)}}async function q3($,v={}){return c$("sendIntent","/api/workbench/intent",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:$,payload:v})})}async function P2($){let g=`Veto: do not ${$.label?.trim()||`${$.kind} intent`}${$.reason?` — ${$.reason}`:""}.`;if((await c$("vetoGhostIntent",`/api/canvas/ax/intent/${encodeURIComponent($.id)}`,{ok:!1,cleared:!1},{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({vetoed:!0})})).cleared!==!0)return!1;return await Y3("vetoGhostSteering","/api/canvas/ax/steer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:g,source:"browser"})}),!0}async function z6($){return(await c$("renderMarkdown","/api/render",{},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({markdown:$})})).html??""}async function MU($){return c$("fetchFile",`/api/file?path=${encodeURIComponent($)}`,{content:""})}async function X3($,v){return c$("saveFile","/api/file/save",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:$,content:v})})}async function P_($){return nP("openWorkbenchFile","/api/workbench/open",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:$})})}async function k_($){return c$("saveCanvasTheme","/api/canvas/theme",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({theme:$})})}async function A3(){return[]}async function QU($,v,g,_,U){if(!$.trim())return{ok:!1,error:"Prompt text is required"};return c$("submitCanvasPrompt","/api/canvas/prompt",{ok:!1,error:"Network error"},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:$,...v?{position:v}:{},...g?{parentNodeId:g}:{},..._&&_.length>0?{contextNodeIds:_}:{},...U?{threadNodeId:U}:{}})})}async function w3($,v){return QU(v,void 0,void 0,void 0,$)}async function Z3($,v={}){await Y3("pushCanvasUpdate","/api/canvas/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:$,...v.recordHistory===!1?{recordHistory:!1}:{}})})}async function F4($,v,g,_){return c$("createEdgeFromClient","/api/canvas/edge",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({from:$,to:v,type:g,label:_})})}async function hv($){return c$("createNodeFromClient","/api/canvas/node",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})}async function Zv($,v){return c$("updateNodeFromClient",`/api/canvas/node/${encodeURIComponent($)}`,{ok:!1},{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})}async function H_($,v){return c$("refreshWebpageNodeFromClient",`/api/canvas/node/${encodeURIComponent($)}/refresh`,{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v?{url:v}:{})})}async function I_($){return c$("removeNodeFromClient",`/api/canvas/node/${encodeURIComponent($)}`,{ok:!1},{method:"DELETE"})}async function S3(){return c$("fetchAxSurfaceState","/api/canvas/ax/surface-snapshot",null)}async function M3($,v){return c$("openNodeInSystemBrowserRequest","/api/canvas/open-external",{ok:!1,opened:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodeId:$,url:v})})}async function Y6($){return c$("submitAxInteractionFromClient","/api/canvas/ax/interaction",{ok:!1,code:"request-failed",error:"Request failed"},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sourceSurface:"native-node",...$,source:"browser"})})}async function Q3($,v={}){return c$("updateViewportFromClient","/api/canvas/viewport",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...$,...v.recordHistory===!1?{recordHistory:!1}:{}})})}async function L_($){return c$("createGroupFromClient","/api/canvas/group",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})}async function N3($){return c$("ungroupFromClient","/api/canvas/group/ungroup",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({groupId:$})})}async function r3(){return c$("listSnapshots","/api/canvas/snapshots?all=true",[])}async function u3($){return c$("saveSnapshot","/api/canvas/snapshots",{ok:!1},{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:$})})}async function y3($){return c$("restoreSnapshot",`/api/canvas/snapshots/${$}`,{ok:!1},{method:"POST"})}async function R3($){return c$("deleteSnapshot",`/api/canvas/snapshots/${$}`,{ok:!1},{method:"DELETE"})}function NU($,v){console.error(`[canvas-store] ${$} failed`,v)}var P$=W$({x:0,y:0,scale:1}),T=W$(new Map),m$=W$(new Map),q4=W$(new Map),R$=W$(null),o6=W$("connecting"),X4=W$(""),Y_=W$(!1),T$=W$("dark"),n6=W$(!1),X6=W$(null),V$=W$(null),xv=W$(null),Sv=null,Y4,D3=100,tP=2500,q_=W$(null),Rv=W$(null),A6=W$(null),h$=W$(new Set),D$=W$(new Set);function V3($,v){if(!$)return new Set;let g=new Set;for(let _ of v.values()){if(_.from===$)g.add(_.to);if(_.to===$)g.add(_.from)}return g}var C3=p6(()=>V3(R$.value,m$.value));function T3($,v){let g=new Set;for(let _ of $)if(v.has(_))g.add(_);return g}function j3($,v){if($.size!==v.size)return!1;for(let g of $)if(!v.has(g))return!1;return!0}function f3($){let v=new Set(h$.value);if(v.has($))v.delete($);else v.add($);h$.value=v}function E3($){h$.value=new Set($)}function fv(){if(h$.value.size===0)return;h$.value=new Set}function A4($){let v=new Set(D$.value);if(v.has($))v.delete($);else v.add($);D$.value=v,d$(),X_(v)}function c3($){let v=new Set(D$.value);for(let g of $)v.add(g);D$.value=v,d$(),X_(v)}function m3(){if(D$.value.size===0)return;D$.value=new Set,d$(),X_(new Set)}function i3($){D$.value=new Set($)}function l3(){let $=D$.value;if($.size===0)return[];return Array.from($).map((v)=>T.value.get(v)).filter((v)=>v!==void 0)}function X_($){fetch("/api/canvas/context-pins",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodeIds:Array.from($)})}).catch((v)=>{NU("syncContextPinsToServer",v)})}var F_=1;function J6($){_6(()=>{let v=new Map(T.value);if($.zIndex>=F_)F_=$.zIndex+1;v.set($.id,$),T.value=v,R$.value=$.id})}function Pv($,v){H2($,v)}function H2($,v,g={}){let _=T.value.get($);if(!_)return;let U=new Map(T.value);if(_.type==="group"&&v.position&&g.skipGroupChildTranslation!==!0){let J=v.position.x-_.position.x,b=v.position.y-_.position.y;if(J!==0||b!==0){let G=Array.isArray(_.data.children)?_.data.children.filter((K)=>typeof K==="string"):[];for(let K of G){let W=U.get(K);if(!W||W.type==="group")continue;U.set(K,{...W,position:{x:W.position.x+J,y:W.position.y+b}})}}}U.set($,{..._,...v}),T.value=U;let z=U.get($)?.data.appCheckpoint?.updatedAt;if(xv.value===$&&z!==void 0&&z!==Y4)k2($)}function U$($,v){let g=T.value.get($);if(!g)return;Pv($,{data:{...g.data,...v}})}function w4($){dP($);let v=new Map(T.value);if(v.delete($),T.value=v,R$.value===$)R$.value=null;if(V$.value===$)V$.value=null;if(h$.value.has($)){let g=new Set(h$.value);g.delete($),h$.value=g}if(D$.value.has($)){let g=new Set(D$.value);g.delete($),D$.value=g,X_(g)}}function A_($){let v=new Map(m$.value);v.set($.id,$),m$.value=v}function h3($){let v=new Map(m$.value);v.delete($),m$.value=v}function dP($){let v=!1,g=new Map(m$.value);for(let[_,U]of g)if(U.from===$||U.to===$)g.delete(_),v=!0;if(v)m$.value=g}function aP($){let v=new Map(q4.value);if(!v.delete($))return;q4.value=v}async function I2($){try{return{ok:(await fetch("/api/canvas/annotation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify($)})).ok}}catch(v){return NU("createAnnotationFromClient",v),{ok:!1}}}async function x3($){try{let v=await fetch(`/api/canvas/annotation/${encodeURIComponent($)}`,{method:"DELETE"});if(v.ok)aP($);return{ok:v.ok}}catch(v){return NU("removeAnnotationFromClient",v),{ok:!1}}}function Z4($,v){if(!T.value.get($))return;Pv($,{size:v})}function w6($){if(!T.value.get($))return;Pv($,{zIndex:F_++}),R$.value=$}function Z6($){let v=T.value.get($);if(!v)return;Pv($,{collapsed:!v.collapsed})}function p3(){for(let $ of T.value.values())if($.type==="context"&&$.dockPosition==="right"&&!$.collapsed)Pv($.id,{collapsed:!0})}var w_=p6(()=>{for(let $ of T.value.values())if($.type==="context"&&$.dockPosition==="right"&&!$.collapsed)return!0;return!1});function L2($,v){if(!T.value.get($))return;Pv($,{dockPosition:v}),d$()}function S4($){let v=T.value.get($);if(!v)return;let g=P$.value,_=(window.innerWidth/2-g.x)/g.scale,U=(window.innerHeight/2-g.y)/g.scale;Pv($,{dockPosition:null,position:{x:_-v.size.width/2,y:U-v.size.height/2}}),d$()}function o3($){P$.value={...P$.value,...$}}function n3($){P$.value=$}function t3($){d3($)}function d3($,v={}){P$.value=$,d$(v),Q3($,v)}function a3($,v={}){let g=new Map,_=1;for(let B of $.nodes)if(g.set(B.id,B),B.zIndex>=_)_=B.zIndex+1;let U=$.edges.filter((B)=>g.has(B.from)&&g.has(B.to)),z=new Map;for(let B of U)z.set(B.id,B);let J=new Map;for(let B of $.annotations??[])J.set(B.id,B);let b=R$.value!==null&&g.has(R$.value)?R$.value:null,G=V$.value!==null&&g.has(V$.value)?V$.value:null,K=T3(h$.value,g),W=T3(D$.value,g);_6(()=>{if(v.applyViewport===!0&&$.viewport)P$.value=$.viewport;if(F_=_,T.value=g,m$.value=z,q4.value=J,R$.value=b,V$.value=G,!j3(h$.value,K))h$.value=K;if(!j3(D$.value,W))D$.value=W})}var q6=null;function sP($){return 1-(1-$)**3}function pv($,v=300,g={}){if(q6!==null)cancelAnimationFrame(q6);let _={...P$.value},U=performance.now();function z(J){let b=J-U,G=Math.min(1,b/v),K=sP(G);if(P$.value={x:_.x+($.x-_.x)*K,y:_.y+($.y-_.y)*K,scale:_.scale+($.scale-_.scale)*K},G<1)q6=requestAnimationFrame(z);else q6=null,d3($,g)}q6=requestAnimationFrame(z)}function M4(){if(q6!==null)cancelAnimationFrame(q6),q6=null}var s3="pmx-canvas-layout";function d$($={}){try{let v=Array.from(T.value.values()),g=v.map((U)=>({id:U.id,position:U.position,size:U.size,collapsed:U.collapsed,dockPosition:U.dockPosition})),_={viewport:P$.value,nodes:v.map((U)=>({id:U.id,type:U.type,position:U.position,size:U.size,collapsed:U.collapsed,pinned:U.pinned,dockPosition:U.dockPosition})),edges:Array.from(m$.value.values()).map((U)=>({id:U.id,from:U.from,to:U.to,type:U.type,label:U.label,style:U.style,animated:U.animated})),contextPinnedNodeIds:Array.from(D$.value)};localStorage.setItem(s3,JSON.stringify(_)),Z3(g,$)}catch(v){NU("persistLayout",v)}}function e3(){try{let $=localStorage.getItem(s3);if(!$)return null;let v=JSON.parse($),g=Array.isArray(v.nodes)?v.nodes:[];if(g.length===0)return null;let _=new Map;for(let U of g){if(typeof U.id!=="string"||U.id.length===0)continue;_.set(U.id,{...U.position?{position:U.position}:{},...U.size?{size:U.size}:{},...U.collapsed!==void 0?{collapsed:U.collapsed}:{},...U.pinned!==void 0?{pinned:U.pinned}:{},...U.dockPosition!==void 0?{dockPosition:U.dockPosition}:{}})}return _.size>0?_:null}catch($){return NU("restoreLayout",$),null}}function Z_($,v){let g=Array.from(T.value.values());if(g.length===0)return;let{POSITIVE_INFINITY:_,POSITIVE_INFINITY:U,NEGATIVE_INFINITY:z,NEGATIVE_INFINITY:J}=Number;for(let P of g)_=Math.min(_,P.position.x),U=Math.min(U,P.position.y),z=Math.max(z,P.position.x+P.size.width),J=Math.max(J,P.position.y+P.size.height);let b=60,G=z-_+b*2,K=J-U+b*2,W=Math.min(1,Math.min($/G,v/K)),B=(_+z)/2,k=(U+J)/2;pv({x:$/2-B*W,y:v/2-k*W,scale:W})}function Fv($,v={}){let g=T.value.get($);if(!g)return;let _=P$.value,U=g.position.x+g.size.width/2,z=g.position.y+g.size.height/2;pv({x:window.innerWidth/2-U*_.scale,y:window.innerHeight/2-z*_.scale,scale:_.scale},300,v),w6($)}function $K($=1){let v=Array.from(T.value.keys());if(v.length===0)return;let _=((R$.value?v.indexOf(R$.value):-1)+$+v.length)%v.length,U=v[_];w6(U),Fv(U)}function vK($){let v=R$.value;if(!v)return;let g=T.value.get(v);if(!g)return;let _=V3(v,m$.value);if(_.size===0)return;let U=g.position.x+g.size.width/2,z=g.position.y+g.size.height/2,J=null,b=-1/0;for(let G of _){let K=T.value.get(G);if(!K)continue;let W=K.position.x+K.size.width/2,B=K.position.y+K.size.height/2,k=W-U,P=B-z,q=Math.sqrt(k*k+P*P);if(q<1)continue;let L;switch($){case"up":L=-P;break;case"down":L=P;break;case"left":L=-k;break;case"right":L=k;break}if(L<=0)continue;let H=L/q-q*0.001;if(H>b)b=H,J=G}if(J)Fv(J)}function b6($){if(!T.value.get($))return;if(Sv!==null)clearTimeout(Sv),Sv=null;xv.value=null,Y4=void 0,w6($),V$.value=$}function k2($){if(Sv!==null)clearTimeout(Sv),Sv=null;if(V$.value===$)V$.value=null;if(xv.value===$)xv.value=null;Y4=void 0}function t6(){let $=V$.value,v=$?T.value.get($):void 0;if($&&v&&L3(v)){let g=$,_=Date.now();if(xv.value=g,Y4=v.data.appCheckpoint?.updatedAt,Sv!==null)clearTimeout(Sv);let U=()=>{let J=T.value.get(g)?.data.appCheckpoint?.updatedAt;if(J!==void 0&&J!==Y4){k2(g);return}if(Date.now()-_>=tP){k2(g);return}Sv=setTimeout(U,D3)};Sv=setTimeout(U,D3);return}if(Sv!==null)clearTimeout(Sv),Sv=null;xv.value=null,Y4=void 0,V$.value=null}function S_(){let $=W2(Array.from(T.value.values()),Array.from(m$.value.values()),"grid");if($.nodePositions.size===0&&$.groupBounds.size===0)return;_6(()=>{for(let[v,g]of $.nodePositions.entries())Pv(v,{position:g});for(let[v,g]of $.groupBounds.entries())H2(v,{position:{x:g.x,y:g.y},size:{width:g.width,height:g.height}},{skipGroupChildTranslation:!0})}),d$()}function M_(){let $=W2(Array.from(T.value.values()),Array.from(m$.value.values()),"graph");if($.nodePositions.size===0&&$.groupBounds.size===0)return;_6(()=>{for(let[v,g]of $.nodePositions.entries())Pv(v,{position:g});for(let[v,g]of $.groupBounds.entries())H2(v,{position:{x:g.x,y:g.y},size:{width:g.width,height:g.height}},{skipGroupChildTranslation:!0})}),d$()}var eP=0;function O($,v,g,_,U,z){v||(v={});var J,b,G=v;if("ref"in G)for(b in G={},v)b=="ref"?J=v[b]:G[b]=v[b];var K={type:$,props:G,key:g,ref:J,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--eP,__i:-1,__u:0,__source:U,__self:z};if(typeof $=="function"&&(J=$.defaultProps))for(b in J)G[b]===void 0&&(G[b]=J[b]);return B$.vnode&&B$.vnode(K),K}function $k($){return new Date($).toLocaleTimeString([],{hour:"numeric",minute:"2-digit"})}function vk(){p3(),O_()}function UK(){let $=SU.value;if($.length===0)return null;let v=F6.value,g=H4.value;if(!v&&w_.value)return null;if(!v)return O("button",{type:"button",class:"attention-history-tab",onClick:vk,"aria-label":g>0?`Recent updates — ${g} new`:"Recent updates",title:g>0?`${g} new updates since last viewed`:"Recent updates",children:[O("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("circle",{cx:"4.5",cy:"8",r:"1.1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"6.5",x2:"12.5",y2:"6.5"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"8",x2:"11",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"9.5",x2:"12",y2:"9.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("span",{class:"attention-history-tab-label",children:"Updates"},void 0,!1,void 0,this),g>0&&O("span",{class:"attention-history-tab-badge","aria-hidden":"true",children:g>9?"9+":g},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("aside",{class:"attention-history","aria-label":"Recent semantic changes",children:[O("div",{class:"attention-history-header",children:[O("div",{class:"attention-history-header-text",children:[O("span",{class:"attention-history-title",children:"Recent Updates"},void 0,!1,void 0,this),O("span",{class:"attention-history-subtitle",children:"Focus and meaning shifts"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("button",{type:"button",class:"attention-history-close",onClick:G_,"aria-label":"Collapse changes panel",title:"Collapse",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"attention-history-list",children:$.map((_)=>O("article",{class:`attention-history-entry attention-tone-${_.tone}`,children:[O("div",{class:"attention-history-meta",children:[O("span",{class:"attention-history-kind",children:_.title},void 0,!1,void 0,this),O("time",{class:"attention-history-time",dateTime:new Date(_.createdAt).toISOString(),children:$k(_.createdAt)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("p",{class:"attention-history-detail",children:_.detail},void 0,!1,void 0,this)]},_.id,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function gK(){let $=z_.value;if(!$)return null;return O("button",{type:"button",class:`attention-toast attention-tone-${$.tone}`,onClick:O_,"aria-label":`${$.title} — open change history`,title:$.detail||$.title,children:[O("span",{class:"attention-toast-dot","aria-hidden":"true"},void 0,!1,void 0,this),O("span",{class:"attention-toast-title",children:$.title},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var Uk=700,gk=1600;function _k($){return $.replace(/\r\n?/g,`
23
23
  `).replace(/[ \t\f\v]+/g," ").replace(/\n\s+/g,`
24
24
  `).replace(/\s+\n/g,`
25
25
  `).replace(/\n{3,}/g,`
26
26
 
27
- `).trim()}function Yv($,v){if(v<=0)return"";let g=aP($);if(g.length<=v)return g;if(v<=1)return g.slice(0,v);return`${g.slice(0,Math.max(0,v-1)).trimEnd()}…`}function A_($,v){if(typeof $==="string")return Yv($,v);if($===null||$===void 0)return"";try{return Yv(JSON.stringify($),v)}catch{return""}}function sP($,v){let g=[],_=typeof $.url==="string"?$.url:"",U=typeof $.pageTitle==="string"?$.pageTitle:"",z=typeof $.description==="string"?$.description:"",b=typeof $.status==="string"?$.status:"",J=typeof $.statusCode==="number"?$.statusCode:null,G=typeof $.error==="string"?$.error:"",K=typeof $.content==="string"?$.content:typeof $.excerpt==="string"?$.excerpt:"";if(_)g.push(`URL: ${_}`);if(U)g.push(`Title: ${U}`);if(z)g.push(`Description: ${z}`);if(b||J!==null)g.push(`Fetch: ${b||"unknown"}${J!==null?` (${J})`:""}`);if(G)g.push(`Error: ${G}`);let W=g.join(`
27
+ `).trim()}function Yv($,v){if(v<=0)return"";let g=_k($);if(g.length<=v)return g;if(v<=1)return g.slice(0,v);return`${g.slice(0,Math.max(0,v-1)).trimEnd()}…`}function Q_($,v){if(typeof $==="string")return Yv($,v);if($===null||$===void 0)return"";try{return Yv(JSON.stringify($),v)}catch{return""}}function zk($,v){let g=[],_=typeof $.url==="string"?$.url:"",U=typeof $.pageTitle==="string"?$.pageTitle:"",z=typeof $.description==="string"?$.description:"",J=typeof $.status==="string"?$.status:"",b=typeof $.statusCode==="number"?$.statusCode:null,G=typeof $.error==="string"?$.error:"",K=typeof $.content==="string"?$.content:typeof $.excerpt==="string"?$.excerpt:"";if(_)g.push(`URL: ${_}`);if(U)g.push(`Title: ${U}`);if(z)g.push(`Description: ${z}`);if(J||b!==null)g.push(`Fetch: ${J||"unknown"}${b!==null?` (${b})`:""}`);if(G)g.push(`Error: ${G}`);let W=g.join(`
28
28
  `),B=Math.max(0,v-W.length-(W?2:0)),k=B>0?Yv(K,B):"";if(W&&k)return`${W}
29
29
 
30
- ${k}`;if(W)return Yv(W,v);return Yv(K,v)}function eP($){if($===null||$===void 0)return"";if(typeof $!=="object"||Array.isArray($))return"";let v=$.elements;if(Array.isArray(v))return`Diagram elements: ${v.length}`;let g=Object.keys($).sort();return g.length>0?`Input keys: ${g.join(", ")}`:""}function $k($,v){let g=[],_=typeof $.title==="string"?$.title:"",U=typeof $.mode==="string"?$.mode:"",z=typeof $.hostMode==="string"?$.hostMode:"",b=typeof $.serverName==="string"?$.serverName:"",J=typeof $.toolName==="string"?$.toolName:"",G=typeof $.resourceUri==="string"?$.resourceUri:"",K=typeof $.path==="string"?$.path:"",W=typeof $.url==="string"?$.url:"",B=typeof $.sessionStatus==="string"?$.sessionStatus:"",k=eP($.toolInput);if(_)g.push(`App: ${_}`);if(U||z)g.push(`Mode: ${[U,z].filter(Boolean).join(" / ")}`);if(b||J)g.push(`Source: ${[b,J].filter(Boolean).join(" / ")}`);if(G)g.push(`Resource: ${G}`);if(K)g.push(`Path: ${K}`);if(W)g.push(`URL: ${W}`);if(B)g.push(`Session: ${B}`);if(k)g.push(k);if(g.length===0)return"MCP App node";return Yv(g.join(`
31
- `),v)}function vk($,v){let g=[],_=typeof $.content==="string"?$.content:"",U=typeof $.title==="string"?$.title:"",z=typeof $.path==="string"?$.path:"",b=typeof $.url==="string"?$.url:"",J=typeof $.projectPath==="string"?$.projectPath:"",G=typeof $.artifactBytes==="number"?$.artifactBytes:null,K=typeof $.sourceFileCount==="number"?$.sourceFileCount:null,W=Array.isArray($.sourceFiles)?$.sourceFiles.filter((k)=>typeof k==="string"):[],B=Array.isArray($.deps)?$.deps.filter((k)=>typeof k==="string"):[];if(_)g.push(_);if(!_&&U)g.push(`Web artifact: ${U}`);if(W.length>0&&!_.includes("Source files:")){let k=K!==null?Math.max(0,K-W.length):0;g.push(`Source files: ${W.join(", ")}${k>0?`, +${k} more`:""}`)}if(G!==null&&!_.includes("Artifact bytes:"))g.push(`Artifact bytes: ${G}`);if(B.length>0&&!_.includes("Dependencies:"))g.push(`Dependencies: ${B.join(", ")}`);if(z)g.push(`Path: ${z}`);if(J)g.push(`Project: ${J}`);if(b)g.push(`URL: ${b}`);return g.length>0?Yv(g.join(`
32
- `),v):"Web artifact node"}function Uk($,v){let g=[],_=typeof $.htmlPrimitive==="string"?$.htmlPrimitive:"",U=typeof $.description==="string"?$.description:"",z=$.primitiveData;if(_)g.push(`HTML primitive: ${_}`);if(U)g.push(U);if(z!==void 0)g.push(`Data: ${A_(z,v)}`);return Yv(g.join(`
33
- `),v)}function sK($,v={}){let g=v.defaultTextLength??tP,_=v.webpageTextLength??dP;switch($.type){case"markdown":{let U=$.data.rendered||$.data.content||"";return Yv(U,g)}case"mcp-app":{if($.data.viewerType==="web-artifact")return vk($.data,g);let U=$.data.chartConfig;if(U){let z=U.title||"Untitled chart",b=U.type||"unknown",J=Array.isArray(U.labels)?U.labels.join(", "):"";return Yv(`Chart: ${z} (${b}). Labels: ${J}`,g)}return $k($.data,g)}case"webpage":return sP($.data,_);case"json-render":case"graph":{let U=$.data.graphConfig;if(U)return Yv(`Graph: ${JSON.stringify(U)}`,g);return A_($.data.spec??{},g)}case"html":{if(typeof $.data.agentSummary==="string")return Yv($.data.agentSummary,g);if(typeof $.data.htmlPrimitive==="string")return Uk($.data,g);return A_({title:$.data.title,description:$.data.description,summary:$.data.summary,contentSummary:$.data.contentSummary,embeddedNodeIds:$.data.embeddedNodeIds,embeddedUrls:$.data.embeddedUrls},g)}case"prompt":case"response":{let U=$.data.text||$.data.content||"";return Yv(U,g)}case"file":{let U=typeof $.data.path==="string"?$.data.path:"",z=typeof $.data.fileContent==="string"?$.data.fileContent:typeof $.data.content==="string"?$.data.content:"",b=U?`Path: ${U}
34
-
35
- `:"",J=Math.max(0,g-b.length);return`${b}${Yv(z,J)}`.trim()}default:return A_($.data,g)}}function gk($,v){let g=$.position.x+$.size.width/2,_=$.position.y+$.size.height/2,U=v.position.x+v.size.width/2,z=v.position.y+v.size.height/2;return Math.sqrt((g-U)**2+(_-z)**2)}function _k($,v){let g=$.position.x+$.size.width,_=$.position.y+$.size.height,U=v.position.x+v.size.width,z=v.position.y+v.size.height,b=Math.max(0,Math.max($.position.x,v.position.x)-Math.min(g,U)),J=Math.max(0,Math.max($.position.y,v.position.y)-Math.min(_,z));return Math.sqrt(b**2+J**2)}function zk($){let v=[...$],g=100;return v.sort((_,U)=>{let z=Math.floor(_.position.y/100),b=Math.floor(U.position.y/100);if(z!==b)return z-b;return _.position.x-U.position.x}),v}function bk($){let v=$.find((U)=>U.data.title&&typeof U.data.title==="string");if(v&&$.length<=3)return $.filter((z)=>z.data.title).map((z)=>z.data.title).slice(0,3).join(", ");let g={};for(let U of $)g[U.type]=(g[U.type]??0)+1;let _=Object.entries(g).map(([U,z])=>z===1?U:`${z} ${U}`);if(v)return`${v.data.title} + ${_.join(", ")}`;return _.join(", ")}function Jk($,v){return $.x<=v.x+v.width&&$.x+$.width>=v.x&&$.y<=v.y+v.height&&$.y+$.height>=v.y}function Ok($,v){let g=v.filter((U)=>Jk($.bounds,{x:U.position.x,y:U.position.y,width:U.size.width,height:U.size.height})),_=g.map((U)=>typeof U.data.title==="string"&&U.data.title.length>0?U.data.title:U.id);return{id:$.id,label:$.label??$.text??null,bounds:$.bounds,targetNodeIds:g.map((U)=>U.id),targetNodeTitles:_,target:_.length>0?_.join(", "):"empty canvas region"}}function Gk($,v=200){if($.length===0)return[];let g=new Map,_=(G)=>{while(g.get(G)!==G){let K=g.get(G);g.set(G,g.get(K)),G=K}return G},U=(G,K)=>{let W=_(G),B=_(K);if(W!==B)g.set(W,B)};for(let G of $)g.set(G.id,G.id);for(let G=0;G<$.length;G++)for(let K=G+1;K<$.length;K++)if(_k($[G],$[K])<=v)U($[G].id,$[K].id);let z=new Map;for(let G of $){let K=_(G.id);if(!z.has(K))z.set(K,[]);z.get(K).push(G)}let b=[],J=0;for(let[,G]of z){if(G.length<2)continue;let K=G.map((F)=>F.position.x),W=G.map((F)=>F.position.y),B=G.map((F)=>F.position.x+F.size.width),k=G.map((F)=>F.position.y+F.size.height),P=Math.min(...K),A=Math.min(...W),H=Math.max(...B),I=Math.max(...k);b.push({id:`cluster-${J++}`,nodeIds:G.map((F)=>F.id),label:bk(G),centroid:{x:Math.round((P+H)/2),y:Math.round((A+I)/2)},bounds:{x:P,y:A,width:H-P,height:I-A}})}return b.sort((G,K)=>{let W=Math.floor(G.centroid.y/200),B=Math.floor(K.centroid.y/200);if(W!==B)return W-B;return G.centroid.x-K.centroid.x}),b}function Kk($,v,g=5,_=600){let U=$.filter((b)=>v.has(b.id)),z=$.filter((b)=>!v.has(b.id));return U.map((b)=>{let J=z.map((G)=>({node:G,distance:gk(b,G)})).filter((G)=>G.distance<=_).sort((G,K)=>G.distance-K.distance).slice(0,g);return{pinnedNodeId:b.id,pinnedNodeTitle:b.data.title??null,neighbors:J.map((G)=>({id:G.node.id,type:G.node.type,title:G.node.data.title??null,distance:Math.round(G.distance)}))}})}function ZU($,v,g,_=[]){let U=Gk($),z=new Map;for(let K of U)for(let W of K.nodeIds)z.set(W,K.id);let J=zk($).map((K,W)=>({id:K.id,type:K.type,title:K.data.title??null,content:sK(K,{defaultTextLength:320,webpageTextLength:640})||null,clusterId:z.get(K.id)??null,readingOrder:W})),G=Kk($,g);return{totalNodes:$.length,clusters:U,nodesInReadingOrder:J,pinnedNeighborhoods:G,annotations:_.map((K)=>Ok(K,$))}}function X4($){if(!$)return null;let v=$.data.title;return typeof v==="string"&&v.trim().length>0?v.trim():null}function q_($,v){return{id:$?.id??v,title:X4($),nodeType:$?.type??"markdown"}}function eK($,v){return{id:$.id,edgeType:$.type,fromId:$.from,toId:$.to,fromTitle:X4(v.get($.from)),toTitle:X4(v.get($.to))}}function X_($){return new Map($.map((v)=>[v.id,v]))}function $3($){return new Map($.map((v)=>[v.id,v]))}function Vv($){return Array.from($).sort((v,g)=>v.localeCompare(g))}function W2($,v){if($.length!==v.length)return!1;for(let g=0;g<$.length;g++)if($[g]!==v[g])return!1;return!0}function B2($){if(!$||$.type!=="group")return[];let v=$.data.children;if(!Array.isArray(v))return[];return v.filter((g)=>typeof g==="string").sort((g,_)=>g.localeCompare(_))}function v3($){let v=new Map;for(let g of $.clusters){let _=[...g.nodeIds].sort((U,z)=>U.localeCompare(z));for(let U of _)v.set(U,_.filter((z)=>z!==U))}return v}function U3($){let v=new Map;for(let g of $.pinnedNeighborhoods)v.set(g.pinnedNodeId,g.neighbors.map((_)=>_.id).sort((_,U)=>_.localeCompare(U)));return v}function Wk($,v){let g=Vv(Array.from(v).filter((U)=>!$.has(U))),_=Vv(Array.from($).filter((U)=>!v.has(U)));return{added:g,removed:_}}function g3($){let v=$&&typeof $==="object"?$:{};return{timestamp:typeof v.timestamp==="string"?v.timestamp:void 0,sessionId:typeof v.sessionId==="string"?v.sessionId:void 0}}function Bk($,v,g){if(!$||!g)return{layout:$,pinnedNodeIds:[],primaryFocusNodeIds:[],secondaryFocusNodeIds:[],regions:[],spatial:g};let _=X_($.nodes),U=Vv(v).filter((G)=>_.has(G)),z=new Set(U),b=new Set,J=[];for(let G of g.pinnedNeighborhoods){if(!z.has(G.pinnedNodeId))continue;let K=Vv([G.pinnedNodeId,...G.neighbors.map((W)=>W.id)]).filter((W,B,k)=>k.indexOf(W)===B&&_.has(W));for(let W of K)if(!z.has(W))b.add(W);J.push({id:`region-${G.pinnedNodeId}`,primaryNodeId:G.pinnedNodeId,nodeIds:K})}if(J.length===0&&U.length>0)for(let G of U)J.push({id:`region-${G}`,primaryNodeId:G,nodeIds:[G]});return{layout:$,pinnedNodeIds:U,primaryFocusNodeIds:U,secondaryFocusNodeIds:Vv(b),regions:J,spatial:g}}class w_{currentLayout=null;currentPins=new Set;previousSpatial=null;setInitialPins($){this.currentPins=new Set($)}getAttentionSnapshot(){return Bk(this.currentLayout,this.currentPins,this.previousSpatial)}handleMessage($){if($.event==="context-pins-changed")return this.handleContextPinsChanged($.data);if($.event==="canvas-layout-update")return this.handleLayoutUpdate($.data);return[]}handleContextPinsChanged($){let v=$&&typeof $==="object"?$:{},g=Array.isArray(v.nodeIds)?v.nodeIds.filter((K)=>typeof K==="string"):[],_=g3($),U=new Set(g),{added:z,removed:b}=Wk(this.currentPins,U);if(this.currentPins=U,!this.currentLayout)return[];let J=X_(this.currentLayout.nodes),G={added:z.map((K)=>q_(J.get(K),K)),removed:b.map((K)=>q_(J.get(K),K))};if(this.previousSpatial=ZU(this.currentLayout.nodes,this.currentLayout.edges,this.currentPins,this.currentLayout.annotations??[]),G.added.length===0&&G.removed.length===0)return[];return[{type:"context-pin",..._,...G}]}handleLayoutUpdate($){let v=$&&typeof $==="object"?$:{},g=v.layout&&typeof v.layout==="object"?v.layout:null;if(!g)return[];let _=g3($);if(!this.currentLayout)return this.currentLayout=g,this.previousSpatial=ZU(g.nodes,g.edges,this.currentPins,g.annotations??[]),[];let U=this.currentLayout,z=this.previousSpatial??ZU(U.nodes,U.edges,this.currentPins,U.annotations??[]),b=ZU(g.nodes,g.edges,this.currentPins,g.annotations??[]),J=[],G=X_(U.nodes),K=X_(g.nodes),W=$3(U.edges),B=$3(g.edges),k=Vv(Array.from(B.keys()).filter((F)=>!W.has(F))).map((F)=>B.get(F)).filter((F)=>F!==void 0);if(k.length>0)J.push({type:"connect",..._,edges:k.map((F)=>eK(F,K))});let P=Vv(Array.from(G.keys()).filter((F)=>!K.has(F))),A=Vv(Array.from(W.keys()).filter((F)=>!B.has(F)));if(P.length>0||A.length>0)J.push({type:"remove",..._,nodes:P.map((F)=>q_(G.get(F),F)),edges:A.map((F)=>W.get(F)).filter((F)=>F!==void 0).map((F)=>eK(F,G))});let H=this.buildGroupEvent(G,K,_);if(H)J.push(H);let I=this.buildMoveEndEvent(U,g,G,K,z,b,_);if(I)J.push(I);return this.currentLayout=g,this.previousSpatial=b,J}buildGroupEvent($,v,g){let _=Vv(Array.from($.values()).filter((J)=>J.type==="group").map((J)=>J.id)),U=Vv(Array.from(v.values()).filter((J)=>J.type==="group").map((J)=>J.id)),z=U.filter((J)=>!_.includes(J)).map((J)=>{let G=v.get(J),K=B2(G);return{id:J,title:X4(G),childCount:K.length}}),b=[];for(let J of U.filter((G)=>_.includes(G))){let G=B2($.get(J)),K=B2(v.get(J));if(W2(G,K))continue;b.push({id:J,title:X4(v.get(J)),addedChildIds:K.filter((W)=>!G.includes(W)),removedChildIds:G.filter((W)=>!K.includes(W)),childCount:K.length})}if(z.length===0&&b.length===0)return null;return{type:"group",...g,created:z,updated:b}}buildMoveEndEvent($,v,g,_,U,z,b){let J=Vv(Array.from(_.keys()).filter((I)=>{let F=g.get(I),Y=_.get(I);if(!F||!Y)return!1;return F.position.x!==Y.position.x||F.position.y!==Y.position.y}));if(J.length===0)return null;let G=v3(U),K=v3(z),W=U3(U),B=U3(z),k=new Map,P=(I,F)=>{let Y=k.get(I)??new Set;Y.add(F),k.set(I,Y)};for(let I of J){let F=G.get(I)??[],Y=K.get(I)??[];if(!W2(F,Y))if(F.length===0&&Y.length>0)P(I,"joined cluster");else if(F.length>0&&Y.length===0)P(I,"left cluster");else P(I,"cluster changed")}let A=new Set([...W.keys(),...B.keys()]);for(let I of A){let F=W.get(I)??[],Y=B.get(I)??[];if(W2(F,Y))continue;let X=X4(_.get(I)??g.get(I))??I,Q=Y.filter((E)=>!F.includes(E)),u=F.filter((E)=>!Y.includes(E));for(let E of Q)if(J.includes(E))P(E,`entered pinned neighborhood of "${X}"`);for(let E of u)if(J.includes(E))P(E,`left pinned neighborhood of "${X}"`);if(J.includes(I))P(I,"pinned neighborhood changed")}let H=J.filter((I)=>(k.get(I)?.size??0)>0).map((I)=>{let F=_.get(I);return{...q_(F,I),reasons:Array.from(k.get(I)??[]).sort((Y,X)=>Y.localeCompare(X))}});if(H.length===0)return null;return{type:"move-end",...b,nodes:H}}}var H2=new w_,L2=[],SU=null,w4=null,P2="",k2=0;function z3($,v){return globalThis.setTimeout($,v)}function I2($){if($===null)return;globalThis.clearTimeout($)}function Pk($){if(typeof globalThis.requestAnimationFrame==="function"){globalThis.requestAnimationFrame(()=>$());return}$()}function X6($,v){return $&&$.trim().length>0?$.trim():v}function b6($,v=3){if($.length===0)return"";if($.length<=v)return $.join(", ");return`${$.slice(0,v).join(", ")} +${$.length-v}`}function kk($){return Array.from(new Set(Array.from($).filter((v)=>v.length>0)))}function Cv($,v,g,_,U=Date.now()){return{id:`${$}-${U}-${Math.random().toString(36).slice(2,8)}`,tone:$,title:v,detail:g,nodeIds:kk(_),createdAt:U}}function _3($){if($==="joined cluster")return"joined a nearby cluster";if($==="left cluster")return"moved away from its cluster";if($==="cluster changed")return"shifted into a different cluster";if($==="pinned neighborhood changed")return"changed the local focus field";let v=/^entered pinned neighborhood of "(.+)"$/.exec($);if(v)return`moved into focus around ${v[1]}`;let g=/^left pinned neighborhood of "(.+)"$/.exec($);if(g)return`moved out of focus around ${g[1]}`;return $}function Ik($){let v=$.added.map((U)=>X6(U.title,U.id)),g=$.removed.map((U)=>X6(U.title,U.id));if(v.length===0&&g.length===0)return null;let _="";if(v.length>0&&g.length===0)_=`Now in focus: ${b6(v)}`;else if(g.length>0&&v.length===0)_=`Removed from focus: ${b6(g)}`;else{let U=[];if(v.length>0)U.push(`${b6(v)} added`);if(g.length>0)U.push(`${b6(g)} removed`);_=U.join(" · ")}return Cv("context","Context updated",_,[...$.added.map((U)=>U.id),...$.removed.map((U)=>U.id)],$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}function Hk($){if($.edges.length===0)return null;if($.edges.length===1){let v=$.edges[0];return Cv("relationship","Relationship added",`${X6(v.fromTitle,v.fromId)} linked to ${X6(v.toTitle,v.toId)}`,[v.fromId,v.toId],$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}return Cv("relationship","Relationships added",`${$.edges.length} connections changed the board structure`,$.edges.flatMap((v)=>[v.fromId,v.toId]),$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}function Lk($){if($.nodes.length===0&&$.edges.length===0)return null;let v=$.nodes.map((_)=>X6(_.title,_.id)),g=[];if(v.length>0)g.push(b6(v));if($.edges.length>0)g.push(`${$.edges.length} relationship${$.edges.length===1?"":"s"}`);return Cv("remove","Items removed",g.join(" · "),[...$.nodes.map((_)=>_.id),...$.edges.flatMap((_)=>[_.fromId,_.toId])],$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}function Fk($){if($.created.length>0){let v=$.created.map((g)=>X6(g.title,g.id));return Cv("group",$.created.length===1?"Group created":"Groups created",$.created.length===1?`${v[0]} now frames ${$.created[0].childCount} items`:b6(v),$.created.map((g)=>g.id),$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}if($.updated.length>0){let v=$.updated.map((g)=>X6(g.title,g.id));return Cv("group",$.updated.length===1?"Group updated":"Groups updated",$.updated.length===1?`${v[0]} now holds ${$.updated[0].childCount} items`:b6(v),$.updated.map((g)=>g.id),$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}return null}function Yk($){if($.nodes.length===0)return null;let v=$.nodes.flatMap((z)=>z.reasons),g=$.nodes.map((z)=>X6(z.title,z.id)),_=$.timestamp?Date.parse($.timestamp)||Date.now():Date.now();if(v.some((z)=>z.includes("pinned neighborhood"))){if($.nodes.length===1)return Cv("neighborhood","Neighborhood changed",`${g[0]} ${_3($.nodes[0].reasons[0])}`,$.nodes.map((z)=>z.id),_);return Cv("neighborhood","Neighborhood changed",b6(g),$.nodes.map((z)=>z.id),_)}let U=v.filter((z)=>z.includes("cluster"));if(U.length>0){let z=U.every((b)=>b==="joined cluster");if($.nodes.length===1)return Cv("cluster",z?"Cluster formed":"Cluster changed",`${g[0]} ${_3($.nodes[0].reasons[0])}`,$.nodes.map((b)=>b.id),_);return Cv("cluster",z?"Cluster formed":"Cluster changed",b6(g),$.nodes.map((b)=>b.id),_)}return null}function Ak($){switch($.type){case"context-pin":return Ik($);case"connect":return Hk($);case"remove":return Lk($);case"group":return Fk($);case"move-end":return Yk($)}}function qk(){let $=H2.getAttentionSnapshot();GK($.primaryFocusNodeIds,$.secondaryFocusNodeIds,$.regions)}function b3(){if(SU!==null)return;let $=L2.shift()??null;if(!$){g_(null);return}g_($);let v=Math.max(1800,Math.min(2800,1600+$.detail.length*18));SU=z3(()=>{SU=null,g_(null),b3()},v)}function J3($){L2.push($),b3()}function uv($,v,g="",_=[]){J3(Cv($,v,g,_))}function Xk($){if(I2(w4),w4=null,__([]),$.length===0)return;Pk(()=>{__($),w4=z3(()=>{w4=null,__([])},900)})}function wk($){let v=`${$.tone}:${$.title}:${$.detail}`,g=$.createdAt;if(v===P2&&g-k2<1200)return!0;return P2=v,k2=g,!1}function O3(){I2(SU),I2(w4),SU=null,w4=null,L2=[],P2="",k2=0,H2=new w_,OK()}function F2($){let v=H2.handleMessage($).map((g)=>Ak(g)).filter((g)=>g!==null);qk();for(let g of v){if(wk(g))continue;KK(g),J3(g),Xk(g.nodeIds)}}async function Z_($,v,g,_){let U=await H6({type:v,sourceNodeId:$.id,sourceSurface:"native-node",...g?{payload:g}:{}});if(U.ok)uv("context",_,"",[$.id]);else uv("remove","AX action failed",U.error??U.code??"Unknown error",[$.id])}var G3={padding:"3px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer",flexShrink:0};function Zk($){let v=$.title||$.label||$.key||"Context",g=$.summary?.trim()||"Available in startup context.",_=$.pathDisplay||$.path||"",U=$.category==="profile"?"Operator":$.category==="planning"||$.category==="memory"?"Product":$.category?$.category.charAt(0).toUpperCase()+$.category.slice(1):void 0,z=$.sourceKind==="global"?"Global":"Workspace",b=$.state==="missing"?"Missing":$.state==="stale"?"Stale":$.state==="invalid"?"Invalid":"Loaded";return{title:v,summary:g,pathDisplay:_,category:U,sourceKind:z,status:b,required:$.required===!0}}function fv($){return typeof $==="string"?$.trim():""}function Sk($){return $.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}function Mk($){let v=fv($.title),g=fv($.content),_=Sk(fv($.rendered)),U=g||_,z=fv($.path);if(!v&&!U&&!z)return null;return{title:v||"Context",summary:U,path:z}}function Qk($){let v=fv($.data.title)||$.id,g=fv($.data.content)||fv($.data.excerpt)||fv($.data.description)||fv($.data.pageTitle)||"",_=fv($.data.path)||fv($.data.url);return{id:$.id,title:v,summary:g,kind:$v[$.type]??$.type,path:_}}function K3($){if($===null||!Number.isFinite($)||$<0)return"0";if($>=1e6)return`${($/1e6).toFixed(1)}m`;if($>=1000)return`${($/1000).toFixed(1)}k`;return`${Math.round($)}`}function Nk($){if($>=0.95)return"var(--c-danger)";if($>=0.85)return"var(--c-warn)";if($>=0.7)return"var(--c-warn)";return"var(--c-accent)"}function o6({node:$,expanded:v=!1,pinnedNodes:g=[]}){let _=$.data.cards??[],U=$.data.auxTabs??[],z=g.map(Qk),b=z.length>0,J=typeof $.data.currentTokens==="number"?$.data.currentTokens:null,G=typeof $.data.tokenLimit==="number"?$.data.tokenLimit:null,K=typeof $.data.utilization==="number"?$.data.utilization:null,W=typeof $.data.messagesLength==="number"?$.data.messagesLength:null,B=K!==null?Math.max(0,Math.min(100,Math.round(K*100))):null,k=Nk(K??0),P=!b&&_.length===0&&U.length===0?Mk($.data):null,A=async(H)=>{let I=typeof H.path==="string"?H.path.trim():"";if(!I)return;await b_(I)};return O("div",{style:{display:"flex",flexDirection:"column",gap:v?"10px":"6px",fontSize:v?"14px":"12px",maxWidth:v?"760px":void 0,margin:v?"0 auto":void 0,width:v?"100%":void 0,padding:v?"8px 0":void 0},children:[O("div",{style:{display:"flex",justifyContent:"flex-end"},children:O("button",{type:"button",class:"ax-node-action",title:"Point the agent at this node — sets it as the agent's current AX focus so the agent pulls it into context to work on next (a one-click alternative to manually pinning).",style:G3,onClick:(H)=>{H.stopPropagation(),Z_($,"ax.focus.set",void 0,"Focus set")},children:"Set focus"},void 0,!1,void 0,this)},void 0,!1,void 0,this),G!==null&&G>0&&O("div",{style:{marginBottom:"8px"},children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"},children:"Token Usage"},void 0,!1,void 0,this),O("div",{style:{height:"6px",background:"var(--c-surface-hover)",borderRadius:"3px",overflow:"hidden",marginBottom:"4px"},children:O("div",{style:{height:"100%",width:`${Math.min(100,(K??0)*100)}%`,background:k,borderRadius:"3px",transition:"width 0.3s ease"}},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{style:{fontSize:"11px",color:"var(--c-muted)"},children:[B,"% — ",K3(J)," / ",K3(G)," tokens",W!==null&&O(e$,{children:[" · ",W," messages"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),b&&O("div",{children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"},children:["Pinned Context (",z.length,")"]},void 0,!0,void 0,this),z.map((H)=>O("div",{style:{padding:"6px 8px",background:"var(--c-surface-subtle)",borderRadius:"6px",marginBottom:"4px",borderLeft:"2px solid var(--c-accent)"},children:[O("div",{style:{fontWeight:600,color:"var(--c-text)",marginBottom:"2px"},children:H.title},void 0,!1,void 0,this),H.summary&&O("div",{style:{color:"var(--c-muted)",fontSize:"10px",lineHeight:1.45,marginBottom:"4px",whiteSpace:"pre-wrap"},children:H.summary},void 0,!1,void 0,this),O("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"},children:O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-surface-hover)",color:"var(--c-text-soft)",borderRadius:"3px",display:"inline-block"},children:H.kind},void 0,!1,void 0,this)},void 0,!1,void 0,this),H.path&&O("div",{style:{marginTop:"6px"},children:[O("div",{style:{color:"var(--c-dim)",fontSize:"10px",wordBreak:"break-all",marginBottom:"6px"},children:H.path},void 0,!1,void 0,this),H.path.startsWith("/")&&O("button",{type:"button",onClick:()=>void b_(H.path),style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Open in canvas"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))]},void 0,!0,void 0,this),!b&&_.length>0&&O("div",{children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"},children:["Context (",_.length,")"]},void 0,!0,void 0,this),_.map((H)=>{let I=Zk(H);return O("div",{style:{padding:"6px 8px",background:"var(--c-surface-subtle)",borderRadius:"6px",marginBottom:"4px",borderLeft:"2px solid var(--c-accent)"},children:[O("div",{style:{fontWeight:600,color:"var(--c-text)",marginBottom:"2px"},children:I.title},void 0,!1,void 0,this),O("div",{style:{color:"var(--c-muted)",fontSize:"10px",lineHeight:1.45,marginBottom:"4px"},children:I.summary},void 0,!1,void 0,this),I.pathDisplay&&O("div",{style:{color:"var(--c-dim)",fontSize:"10px",wordBreak:"break-all"},children:I.pathDisplay},void 0,!1,void 0,this),O("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"},children:[O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-accent-10)",color:"var(--c-accent)",borderRadius:"3px",display:"inline-block"},children:I.status},void 0,!1,void 0,this),I.category&&O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-surface-hover)",color:"var(--c-text-soft)",borderRadius:"3px",display:"inline-block"},children:I.category},void 0,!1,void 0,this),O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-surface-hover)",color:"var(--c-text-soft)",borderRadius:"3px",display:"inline-block"},children:I.sourceKind},void 0,!1,void 0,this),I.required&&O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-warn-12)",color:"var(--c-warn-alt)",borderRadius:"3px",display:"inline-block"},children:"Required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H.path&&O("div",{style:{marginTop:"6px"},children:O("button",{type:"button",onClick:()=>void A(H),style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Open in canvas"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},H.key??I.pathDisplay??I.title,!0,void 0,this)})]},void 0,!0,void 0,this),!b&&U.length>0&&O("div",{children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px",marginTop:_.length>0?"8px":0},children:["References (",U.length,")"]},void 0,!0,void 0,this),U.map((H)=>O("a",{href:H.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",padding:"4px 8px",color:"var(--c-accent)",fontSize:"11px",textDecoration:"none",borderRadius:"4px",marginBottom:"2px",wordBreak:"break-all"},children:[H.url,H.reason&&O("span",{style:{color:"var(--c-dim)",fontSize:"10px",marginLeft:"6px"},children:["(",H.reason,")"]},void 0,!0,void 0,this)]},H.id,!0,void 0,this))]},void 0,!0,void 0,this),P&&O("div",{style:{padding:"8px 10px",background:"var(--c-surface-subtle)",borderRadius:"6px",borderLeft:"2px solid var(--c-accent)"},children:[O("div",{style:{fontWeight:600,color:"var(--c-text)",marginBottom:"4px"},children:P.title},void 0,!1,void 0,this),P.summary&&O("div",{style:{color:"var(--c-text-soft)",fontSize:"11px",lineHeight:1.5,whiteSpace:"pre-wrap"},children:P.summary},void 0,!1,void 0,this),P.path&&O("div",{style:{marginTop:"6px"},children:[O("div",{style:{color:"var(--c-dim)",fontSize:"10px",wordBreak:"break-all",marginBottom:"6px"},children:P.path},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>void b_(P.path),style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Open in canvas"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!b&&!P&&_.length===0&&U.length===0&&O("div",{style:{color:"var(--c-dim)",fontStyle:"italic"},children:"No context loaded"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function rk($){let v=$.split(".").pop()?.toLowerCase()??"";return{ts:"TypeScript",tsx:"TSX",js:"JavaScript",jsx:"JSX",py:"Python",rs:"Rust",go:"Go",rb:"Ruby",java:"Java",kt:"Kotlin",swift:"Swift",c:"C",cpp:"C++",h:"C/C++",css:"CSS",html:"HTML",json:"JSON",yaml:"YAML",yml:"YAML",md:"Markdown",toml:"TOML",sql:"SQL",sh:"Shell",bash:"Shell",xml:"XML",graphql:"GraphQL",proto:"Protobuf"}[v]??(v.toUpperCase()||"Text")}function S_({node:$,expanded:v=!1}){let g=$.data.path||$.data.content||"",_=$.data.title||g.split("/").pop()||"File",U=$.data.fileContent,z=$.data.updatedAt,b=$.data.lineCount,[J,G]=x(U??""),[K,W]=x(!U&&!!g),[B,k]=x(null);m(()=>{if(!g)return;if(U!==void 0){G(U),W(!1);return}let F=!1;return W(!0),k(null),qU(g).then(({content:Y})=>{if(F)return;if(!Y&&Y!==""){k("File not found"),W(!1);return}G(Y),W(!1);let X=Y.split(`
36
- `).length;U$($.id,{fileContent:Y,lineCount:X}),wv($.id,{data:{fileContent:Y,lineCount:X}})}).catch(()=>{if(!F)k("Failed to load file"),W(!1)}),()=>{F=!0}},[g,U]),m(()=>{if(U!==void 0&&U!==J)G(U)},[U]);let P=N(()=>{if(!g)return;W(!0),k(null),U$($.id,{fileContent:void 0}),wv($.id,{data:{fileContent:void 0}}),qU(g).then(({content:F})=>{G(F),W(!1);let Y=F.split(`
37
- `).length,X=new Date().toISOString();U$($.id,{fileContent:F,lineCount:Y,updatedAt:X}),wv($.id,{data:{fileContent:F,lineCount:Y,updatedAt:X}})}).catch(()=>{k("Failed to reload"),W(!1)})},[g,$.id]),A=rk(g),H=J.split(`
38
- `),I=`${String(H.length).length+1}ch`;if(!g)return O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"No file path set"},void 0,!1,void 0,this);return O("div",{style:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--mono)",fontSize:v?"13px":"11px"},children:[O("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 10px",borderBottom:"1px solid var(--c-line)",flexShrink:0},children:[O("span",{style:{fontSize:"9px",padding:"1px 5px",background:"var(--c-accent-12)",color:"var(--c-accent)",borderRadius:"3px",fontWeight:600},children:A},void 0,!1,void 0,this),O("span",{style:{color:"var(--c-text-soft)",fontSize:v?"12px":"10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},title:g,children:g},void 0,!1,void 0,this),b!==void 0&&O("span",{style:{color:"var(--c-dim)",fontSize:"10px",flexShrink:0},children:[b," lines"]},void 0,!0,void 0,this),z&&O("span",{style:{color:"var(--c-dim)",fontSize:"10px",flexShrink:0},children:new Date(z).toLocaleTimeString()},void 0,!1,void 0,this),O("button",{type:"button",class:"ax-node-action",title:"Mark this file as AX evidence",onClick:(F)=>{F.stopPropagation(),Z_($,"ax.evidence.add",{kind:"file",title:g.split("/").pop()||g,ref:g},"Marked as evidence")},style:{background:"none",border:"none",color:"var(--c-muted)",cursor:"pointer",padding:"2px 4px",fontSize:"12px",flexShrink:0},children:"⊕"},void 0,!1,void 0,this),O("button",{type:"button",onClick:P,title:"Reload file",style:{background:"none",border:"none",color:"var(--c-muted)",cursor:"pointer",padding:"2px 4px",fontSize:"12px",flexShrink:0},children:"↻"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{flex:1,overflow:"auto",padding:"8px 0",background:v?"var(--c-panel-soft)":void 0,borderRadius:v?"0 0 8px 8px":void 0},children:[K&&O("div",{style:{color:"var(--c-dim)",padding:"12px",fontStyle:"italic"},children:"Loading…"},void 0,!1,void 0,this),B&&O("div",{style:{color:"var(--c-danger)",padding:"12px"},children:B},void 0,!1,void 0,this),!K&&!B&&O("pre",{style:{margin:0,lineHeight:"1.55",tabSize:2},children:H.map((F,Y)=>O("div",{style:{display:"flex",minHeight:"1.55em"},children:[O("span",{style:{width:I,minWidth:I,textAlign:"right",color:"var(--c-dim)",paddingRight:"12px",paddingLeft:"10px",userSelect:"none",flexShrink:0,opacity:0.6},children:Y+1},void 0,!1,void 0,this),O("code",{style:{color:"var(--c-text)",whiteSpace:"pre",paddingRight:"10px"},children:F||`
39
- `},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var uk=new Set(["title","__type","content","strictSize","arrangeLocked"]);function Z4({node:$}){let v=$.data,_=(typeof v.content==="string"?v.content:"").split(/\r\n|\r|\n|\\n/).map((z)=>z.trimEnd()).filter((z)=>z.length>0),U=Object.entries(v).filter(([z])=>!uk.has(z));if(_.length===0&&U.length===0)return O("div",{style:{color:"var(--c-dim)",fontSize:"12px",fontStyle:"italic"},children:"No ledger data"},void 0,!1,void 0,this);return O("div",{style:{display:"flex",flexDirection:"column",gap:"4px",fontSize:"12px"},children:[_.length>0&&O("div",{style:{display:"flex",flexDirection:"column"},children:_.map((z,b)=>O("div",{style:{padding:"3px 0",borderBottom:b<_.length-1?"1px solid rgba(45,55,90,0.3)":"none",color:"var(--c-text)",fontFamily:"var(--mono)",fontSize:"11px",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:z},b,!1,void 0,this))},void 0,!1,void 0,this),U.map(([z,b])=>O("div",{style:{display:"flex",justifyContent:"space-between",gap:"8px",padding:"3px 0",borderBottom:"1px solid rgba(45,55,90,0.3)"},children:[O("span",{style:{color:"var(--c-muted)",fontSize:"11px",flexShrink:0},children:z.replace(/([A-Z])/g," $1").replace(/^./,(J)=>J.toUpperCase())},void 0,!1,void 0,this),O("span",{style:{color:"var(--c-text)",fontFamily:"var(--mono)",fontSize:"11px",textAlign:"right",wordBreak:"break-word"},children:typeof b==="object"?JSON.stringify(b):String(b??"—")},void 0,!1,void 0,this)]},z,!0,void 0,this))]},void 0,!0,void 0,this)}var Y2=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Sv=Y2?"⌘":"Ctrl";function M_($,v){let{selectionStart:g,selectionEnd:_,value:U}=$,z=U.slice(g,_),b=U.slice(Math.max(0,g-v.length),g),J=U.slice(_,_+v.length);if(b===v&&J===v){let G=U.slice(0,g-v.length)+z+U.slice(_+v.length);pv($,G,g-v.length,_-v.length);return}if(z){let G=U.slice(0,g)+v+z+v+U.slice(_);pv($,G,g+v.length,_+v.length)}else{let G=U.slice(0,g)+v+v+U.slice(_);pv($,G,g+v.length,g+v.length)}}function MU($,v){let{selectionStart:g,selectionEnd:_,value:U}=$,z=U.lastIndexOf(`
40
- `,g-1)+1,b=U.indexOf(`
41
- `,_),J=b===-1?U.length:b,G=U.slice(z,J);if(G.startsWith(v)){let W=U.slice(0,z)+G.slice(v.length)+U.slice(J);pv($,W,Math.max(z,g-v.length),Math.max(z,_-v.length));return}let K=U.slice(0,z)+v+U.slice(z);pv($,K,g+v.length,_+v.length)}function Rk($){let{selectionStart:v,selectionEnd:g,value:_}=$,U=_.slice(v,g);if(U){let z=_.slice(0,v)+`[${U}](url)`+_.slice(g),b=v+U.length+3;pv($,z,b,b+3)}else{let z=_.slice(0,v)+"[text](url)"+_.slice(g);pv($,z,v+1,v+5)}}function yk($){let{selectionStart:v,selectionEnd:g,value:_}=$,U=_.slice(v,g),z="```";if(U){let b=_.slice(0,v)+`\`\`\`
30
+ ${k}`;if(W)return Yv(W,v);return Yv(K,v)}function Jk($){if($===null||$===void 0)return"";if(typeof $!=="object"||Array.isArray($))return"";let v=$.elements;if(Array.isArray(v))return`Diagram elements: ${v.length}`;let g=Object.keys($).sort();return g.length>0?`Input keys: ${g.join(", ")}`:""}function bk($,v){let g=[],_=typeof $.title==="string"?$.title:"",U=typeof $.mode==="string"?$.mode:"",z=typeof $.hostMode==="string"?$.hostMode:"",J=typeof $.serverName==="string"?$.serverName:"",b=typeof $.toolName==="string"?$.toolName:"",G=typeof $.resourceUri==="string"?$.resourceUri:"",K=typeof $.path==="string"?$.path:"",W=typeof $.url==="string"?$.url:"",B=typeof $.sessionStatus==="string"?$.sessionStatus:"",k=Jk($.toolInput);if(_)g.push(`App: ${_}`);if(U||z)g.push(`Mode: ${[U,z].filter(Boolean).join(" / ")}`);if(J||b)g.push(`Source: ${[J,b].filter(Boolean).join(" / ")}`);if(G)g.push(`Resource: ${G}`);if(K)g.push(`Path: ${K}`);if(W)g.push(`URL: ${W}`);if(B)g.push(`Session: ${B}`);if(k)g.push(k);if(g.length===0)return"MCP App node";return Yv(g.join(`
31
+ `),v)}function Ok($,v){let g=[],_=typeof $.content==="string"?$.content:"",U=typeof $.title==="string"?$.title:"",z=typeof $.path==="string"?$.path:"",J=typeof $.url==="string"?$.url:"",b=typeof $.projectPath==="string"?$.projectPath:"",G=typeof $.artifactBytes==="number"?$.artifactBytes:null,K=typeof $.sourceFileCount==="number"?$.sourceFileCount:null,W=Array.isArray($.sourceFiles)?$.sourceFiles.filter((k)=>typeof k==="string"):[],B=Array.isArray($.deps)?$.deps.filter((k)=>typeof k==="string"):[];if(_)g.push(_);if(!_&&U)g.push(`Web artifact: ${U}`);if(W.length>0&&!_.includes("Source files:")){let k=K!==null?Math.max(0,K-W.length):0;g.push(`Source files: ${W.join(", ")}${k>0?`, +${k} more`:""}`)}if(G!==null&&!_.includes("Artifact bytes:"))g.push(`Artifact bytes: ${G}`);if(B.length>0&&!_.includes("Dependencies:"))g.push(`Dependencies: ${B.join(", ")}`);if(z)g.push(`Path: ${z}`);if(b)g.push(`Project: ${b}`);if(J)g.push(`URL: ${J}`);return g.length>0?Yv(g.join(`
32
+ `),v):"Web artifact node"}function Gk($,v){let g=[],_=typeof $.htmlPrimitive==="string"?$.htmlPrimitive:"",U=typeof $.description==="string"?$.description:"",z=$.primitiveData;if(_)g.push(`HTML primitive: ${_}`);if(U)g.push(U);if(z!==void 0)g.push(`Data: ${Q_(z,v)}`);return Yv(g.join(`
33
+ `),v)}function _K($,v={}){let g=v.defaultTextLength??Uk,_=v.webpageTextLength??gk;switch($.type){case"markdown":{let U=$.data.rendered||$.data.content||"";return Yv(U,g)}case"mcp-app":{if($.data.viewerType==="web-artifact")return Ok($.data,g);let U=$.data.chartConfig;if(U){let z=U.title||"Untitled chart",J=U.type||"unknown",b=Array.isArray(U.labels)?U.labels.join(", "):"";return Yv(`Chart: ${z} (${J}). Labels: ${b}`,g)}return bk($.data,g)}case"webpage":return zk($.data,_);case"json-render":case"graph":{let U=$.data.graphConfig;if(U)return Yv(`Graph: ${JSON.stringify(U)}`,g);return Q_($.data.spec??{},g)}case"html":{if(typeof $.data.agentSummary==="string")return Yv($.data.agentSummary,g);if(typeof $.data.htmlPrimitive==="string")return Gk($.data,g);return Q_({title:$.data.title,description:$.data.description,summary:$.data.summary,contentSummary:$.data.contentSummary,embeddedNodeIds:$.data.embeddedNodeIds,embeddedUrls:$.data.embeddedUrls},g)}case"prompt":case"response":{let U=$.data.text||$.data.content||"";return Yv(U,g)}case"file":{let U=typeof $.data.path==="string"?$.data.path:"",z=typeof $.data.fileContent==="string"?$.data.fileContent:typeof $.data.content==="string"?$.data.content:"",J=U?`Path: ${U}
34
+
35
+ `:"",b=Math.max(0,g-J.length);return`${J}${Yv(z,b)}`.trim()}default:return Q_($.data,g)}}function Kk($,v){let g=$.position.x+$.size.width/2,_=$.position.y+$.size.height/2,U=v.position.x+v.size.width/2,z=v.position.y+v.size.height/2;return Math.sqrt((g-U)**2+(_-z)**2)}function Wk($,v){let g=$.position.x+$.size.width,_=$.position.y+$.size.height,U=v.position.x+v.size.width,z=v.position.y+v.size.height,J=Math.max(0,Math.max($.position.x,v.position.x)-Math.min(g,U)),b=Math.max(0,Math.max($.position.y,v.position.y)-Math.min(_,z));return Math.sqrt(J**2+b**2)}function Bk($){let v=[...$],g=100;return v.sort((_,U)=>{let z=Math.floor(_.position.y/100),J=Math.floor(U.position.y/100);if(z!==J)return z-J;return _.position.x-U.position.x}),v}function Pk($){let v=$.find((U)=>U.data.title&&typeof U.data.title==="string");if(v&&$.length<=3)return $.filter((z)=>z.data.title).map((z)=>z.data.title).slice(0,3).join(", ");let g={};for(let U of $)g[U.type]=(g[U.type]??0)+1;let _=Object.entries(g).map(([U,z])=>z===1?U:`${z} ${U}`);if(v)return`${v.data.title} + ${_.join(", ")}`;return _.join(", ")}function kk($,v){return $.x<=v.x+v.width&&$.x+$.width>=v.x&&$.y<=v.y+v.height&&$.y+$.height>=v.y}function Hk($,v){let g=v.filter((U)=>kk($.bounds,{x:U.position.x,y:U.position.y,width:U.size.width,height:U.size.height})),_=g.map((U)=>typeof U.data.title==="string"&&U.data.title.length>0?U.data.title:U.id);return{id:$.id,label:$.label??$.text??null,bounds:$.bounds,targetNodeIds:g.map((U)=>U.id),targetNodeTitles:_,target:_.length>0?_.join(", "):"empty canvas region"}}function Ik($,v=200){if($.length===0)return[];let g=new Map,_=(G)=>{while(g.get(G)!==G){let K=g.get(G);g.set(G,g.get(K)),G=K}return G},U=(G,K)=>{let W=_(G),B=_(K);if(W!==B)g.set(W,B)};for(let G of $)g.set(G.id,G.id);for(let G=0;G<$.length;G++)for(let K=G+1;K<$.length;K++)if(Wk($[G],$[K])<=v)U($[G].id,$[K].id);let z=new Map;for(let G of $){let K=_(G.id);if(!z.has(K))z.set(K,[]);z.get(K).push(G)}let J=[],b=0;for(let[,G]of z){if(G.length<2)continue;let K=G.map((F)=>F.position.x),W=G.map((F)=>F.position.y),B=G.map((F)=>F.position.x+F.size.width),k=G.map((F)=>F.position.y+F.size.height),P=Math.min(...K),q=Math.min(...W),L=Math.max(...B),H=Math.max(...k);J.push({id:`cluster-${b++}`,nodeIds:G.map((F)=>F.id),label:Pk(G),centroid:{x:Math.round((P+L)/2),y:Math.round((q+H)/2)},bounds:{x:P,y:q,width:L-P,height:H-q}})}return J.sort((G,K)=>{let W=Math.floor(G.centroid.y/200),B=Math.floor(K.centroid.y/200);if(W!==B)return W-B;return G.centroid.x-K.centroid.x}),J}function Lk($,v,g=5,_=600){let U=$.filter((J)=>v.has(J.id)),z=$.filter((J)=>!v.has(J.id));return U.map((J)=>{let b=z.map((G)=>({node:G,distance:Kk(J,G)})).filter((G)=>G.distance<=_).sort((G,K)=>G.distance-K.distance).slice(0,g);return{pinnedNodeId:J.id,pinnedNodeTitle:J.data.title??null,neighbors:b.map((G)=>({id:G.node.id,type:G.node.type,title:G.node.data.title??null,distance:Math.round(G.distance)}))}})}function rU($,v,g,_=[]){let U=Ik($),z=new Map;for(let K of U)for(let W of K.nodeIds)z.set(W,K.id);let b=Bk($).map((K,W)=>({id:K.id,type:K.type,title:K.data.title??null,content:_K(K,{defaultTextLength:320,webpageTextLength:640})||null,clusterId:z.get(K.id)??null,readingOrder:W})),G=Lk($,g);return{totalNodes:$.length,clusters:U,nodesInReadingOrder:b,pinnedNeighborhoods:G,annotations:_.map((K)=>Hk(K,$))}}function Q4($){if(!$)return null;let v=$.data.title;return typeof v==="string"&&v.trim().length>0?v.trim():null}function N_($,v){return{id:$?.id??v,title:Q4($),nodeType:$?.type??"markdown"}}function zK($,v){return{id:$.id,edgeType:$.type,fromId:$.from,toId:$.to,fromTitle:Q4(v.get($.from)),toTitle:Q4(v.get($.to))}}function r_($){return new Map($.map((v)=>[v.id,v]))}function JK($){return new Map($.map((v)=>[v.id,v]))}function Ev($){return Array.from($).sort((v,g)=>v.localeCompare(g))}function F2($,v){if($.length!==v.length)return!1;for(let g=0;g<$.length;g++)if($[g]!==v[g])return!1;return!0}function Y2($){if(!$||$.type!=="group")return[];let v=$.data.children;if(!Array.isArray(v))return[];return v.filter((g)=>typeof g==="string").sort((g,_)=>g.localeCompare(_))}function bK($){let v=new Map;for(let g of $.clusters){let _=[...g.nodeIds].sort((U,z)=>U.localeCompare(z));for(let U of _)v.set(U,_.filter((z)=>z!==U))}return v}function OK($){let v=new Map;for(let g of $.pinnedNeighborhoods)v.set(g.pinnedNodeId,g.neighbors.map((_)=>_.id).sort((_,U)=>_.localeCompare(U)));return v}function Fk($,v){let g=Ev(Array.from(v).filter((U)=>!$.has(U))),_=Ev(Array.from($).filter((U)=>!v.has(U)));return{added:g,removed:_}}function GK($){let v=$&&typeof $==="object"?$:{};return{timestamp:typeof v.timestamp==="string"?v.timestamp:void 0,sessionId:typeof v.sessionId==="string"?v.sessionId:void 0}}function Yk($,v,g){if(!$||!g)return{layout:$,pinnedNodeIds:[],primaryFocusNodeIds:[],secondaryFocusNodeIds:[],regions:[],spatial:g};let _=r_($.nodes),U=Ev(v).filter((G)=>_.has(G)),z=new Set(U),J=new Set,b=[];for(let G of g.pinnedNeighborhoods){if(!z.has(G.pinnedNodeId))continue;let K=Ev([G.pinnedNodeId,...G.neighbors.map((W)=>W.id)]).filter((W,B,k)=>k.indexOf(W)===B&&_.has(W));for(let W of K)if(!z.has(W))J.add(W);b.push({id:`region-${G.pinnedNodeId}`,primaryNodeId:G.pinnedNodeId,nodeIds:K})}if(b.length===0&&U.length>0)for(let G of U)b.push({id:`region-${G}`,primaryNodeId:G,nodeIds:[G]});return{layout:$,pinnedNodeIds:U,primaryFocusNodeIds:U,secondaryFocusNodeIds:Ev(J),regions:b,spatial:g}}class u_{currentLayout=null;currentPins=new Set;previousSpatial=null;setInitialPins($){this.currentPins=new Set($)}getAttentionSnapshot(){return Yk(this.currentLayout,this.currentPins,this.previousSpatial)}handleMessage($){if($.event==="context-pins-changed")return this.handleContextPinsChanged($.data);if($.event==="canvas-layout-update")return this.handleLayoutUpdate($.data);return[]}handleContextPinsChanged($){let v=$&&typeof $==="object"?$:{},g=Array.isArray(v.nodeIds)?v.nodeIds.filter((K)=>typeof K==="string"):[],_=GK($),U=new Set(g),{added:z,removed:J}=Fk(this.currentPins,U);if(this.currentPins=U,!this.currentLayout)return[];let b=r_(this.currentLayout.nodes),G={added:z.map((K)=>N_(b.get(K),K)),removed:J.map((K)=>N_(b.get(K),K))};if(this.previousSpatial=rU(this.currentLayout.nodes,this.currentLayout.edges,this.currentPins,this.currentLayout.annotations??[]),G.added.length===0&&G.removed.length===0)return[];return[{type:"context-pin",..._,...G}]}handleLayoutUpdate($){let v=$&&typeof $==="object"?$:{},g=v.layout&&typeof v.layout==="object"?v.layout:null;if(!g)return[];let _=GK($);if(!this.currentLayout)return this.currentLayout=g,this.previousSpatial=rU(g.nodes,g.edges,this.currentPins,g.annotations??[]),[];let U=this.currentLayout,z=this.previousSpatial??rU(U.nodes,U.edges,this.currentPins,U.annotations??[]),J=rU(g.nodes,g.edges,this.currentPins,g.annotations??[]),b=[],G=r_(U.nodes),K=r_(g.nodes),W=JK(U.edges),B=JK(g.edges),k=Ev(Array.from(B.keys()).filter((F)=>!W.has(F))).map((F)=>B.get(F)).filter((F)=>F!==void 0);if(k.length>0)b.push({type:"connect",..._,edges:k.map((F)=>zK(F,K))});let P=Ev(Array.from(G.keys()).filter((F)=>!K.has(F))),q=Ev(Array.from(W.keys()).filter((F)=>!B.has(F)));if(P.length>0||q.length>0)b.push({type:"remove",..._,nodes:P.map((F)=>N_(G.get(F),F)),edges:q.map((F)=>W.get(F)).filter((F)=>F!==void 0).map((F)=>zK(F,G))});let L=this.buildGroupEvent(G,K,_);if(L)b.push(L);let H=this.buildMoveEndEvent(U,g,G,K,z,J,_);if(H)b.push(H);return this.currentLayout=g,this.previousSpatial=J,b}buildGroupEvent($,v,g){let _=Ev(Array.from($.values()).filter((b)=>b.type==="group").map((b)=>b.id)),U=Ev(Array.from(v.values()).filter((b)=>b.type==="group").map((b)=>b.id)),z=U.filter((b)=>!_.includes(b)).map((b)=>{let G=v.get(b),K=Y2(G);return{id:b,title:Q4(G),childCount:K.length}}),J=[];for(let b of U.filter((G)=>_.includes(G))){let G=Y2($.get(b)),K=Y2(v.get(b));if(F2(G,K))continue;J.push({id:b,title:Q4(v.get(b)),addedChildIds:K.filter((W)=>!G.includes(W)),removedChildIds:G.filter((W)=>!K.includes(W)),childCount:K.length})}if(z.length===0&&J.length===0)return null;return{type:"group",...g,created:z,updated:J}}buildMoveEndEvent($,v,g,_,U,z,J){let b=Ev(Array.from(_.keys()).filter((H)=>{let F=g.get(H),Y=_.get(H);if(!F||!Y)return!1;return F.position.x!==Y.position.x||F.position.y!==Y.position.y}));if(b.length===0)return null;let G=bK(U),K=bK(z),W=OK(U),B=OK(z),k=new Map,P=(H,F)=>{let Y=k.get(H)??new Set;Y.add(F),k.set(H,Y)};for(let H of b){let F=G.get(H)??[],Y=K.get(H)??[];if(!F2(F,Y))if(F.length===0&&Y.length>0)P(H,"joined cluster");else if(F.length>0&&Y.length===0)P(H,"left cluster");else P(H,"cluster changed")}let q=new Set([...W.keys(),...B.keys()]);for(let H of q){let F=W.get(H)??[],Y=B.get(H)??[];if(F2(F,Y))continue;let A=Q4(_.get(H)??g.get(H))??H,M=Y.filter((f)=>!F.includes(f)),V=F.filter((f)=>!Y.includes(f));for(let f of M)if(b.includes(f))P(f,`entered pinned neighborhood of "${A}"`);for(let f of V)if(b.includes(f))P(f,`left pinned neighborhood of "${A}"`);if(b.includes(H))P(H,"pinned neighborhood changed")}let L=b.filter((H)=>(k.get(H)?.size??0)>0).map((H)=>{let F=_.get(H);return{...N_(F,H),reasons:Array.from(k.get(H)??[]).sort((Y,A)=>Y.localeCompare(A))}});if(L.length===0)return null;return{type:"move-end",...J,nodes:L}}}var w2=new u_,Z2=[],uU=null,N4=null,q2="",X2=0;function WK($,v){return globalThis.setTimeout($,v)}function A2($){if($===null)return;globalThis.clearTimeout($)}function qk($){if(typeof globalThis.requestAnimationFrame==="function"){globalThis.requestAnimationFrame(()=>$());return}$()}function S6($,v){return $&&$.trim().length>0?$.trim():v}function O6($,v=3){if($.length===0)return"";if($.length<=v)return $.join(", ");return`${$.slice(0,v).join(", ")} +${$.length-v}`}function Xk($){return Array.from(new Set(Array.from($).filter((v)=>v.length>0)))}function cv($,v,g,_,U=Date.now()){return{id:`${$}-${U}-${Math.random().toString(36).slice(2,8)}`,tone:$,title:v,detail:g,nodeIds:Xk(_),createdAt:U}}function KK($){if($==="joined cluster")return"joined a nearby cluster";if($==="left cluster")return"moved away from its cluster";if($==="cluster changed")return"shifted into a different cluster";if($==="pinned neighborhood changed")return"changed the local focus field";let v=/^entered pinned neighborhood of "(.+)"$/.exec($);if(v)return`moved into focus around ${v[1]}`;let g=/^left pinned neighborhood of "(.+)"$/.exec($);if(g)return`moved out of focus around ${g[1]}`;return $}function Ak($){let v=$.added.map((U)=>S6(U.title,U.id)),g=$.removed.map((U)=>S6(U.title,U.id));if(v.length===0&&g.length===0)return null;let _="";if(v.length>0&&g.length===0)_=`Now in focus: ${O6(v)}`;else if(g.length>0&&v.length===0)_=`Removed from focus: ${O6(g)}`;else{let U=[];if(v.length>0)U.push(`${O6(v)} added`);if(g.length>0)U.push(`${O6(g)} removed`);_=U.join(" · ")}return cv("context","Context updated",_,[...$.added.map((U)=>U.id),...$.removed.map((U)=>U.id)],$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}function wk($){if($.edges.length===0)return null;if($.edges.length===1){let v=$.edges[0];return cv("relationship","Relationship added",`${S6(v.fromTitle,v.fromId)} linked to ${S6(v.toTitle,v.toId)}`,[v.fromId,v.toId],$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}return cv("relationship","Relationships added",`${$.edges.length} connections changed the board structure`,$.edges.flatMap((v)=>[v.fromId,v.toId]),$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}function Zk($){if($.nodes.length===0&&$.edges.length===0)return null;let v=$.nodes.map((_)=>S6(_.title,_.id)),g=[];if(v.length>0)g.push(O6(v));if($.edges.length>0)g.push(`${$.edges.length} relationship${$.edges.length===1?"":"s"}`);return cv("remove","Items removed",g.join(" · "),[...$.nodes.map((_)=>_.id),...$.edges.flatMap((_)=>[_.fromId,_.toId])],$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}function Sk($){if($.created.length>0){let v=$.created.map((g)=>S6(g.title,g.id));return cv("group",$.created.length===1?"Group created":"Groups created",$.created.length===1?`${v[0]} now frames ${$.created[0].childCount} items`:O6(v),$.created.map((g)=>g.id),$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}if($.updated.length>0){let v=$.updated.map((g)=>S6(g.title,g.id));return cv("group",$.updated.length===1?"Group updated":"Groups updated",$.updated.length===1?`${v[0]} now holds ${$.updated[0].childCount} items`:O6(v),$.updated.map((g)=>g.id),$.timestamp?Date.parse($.timestamp)||Date.now():Date.now())}return null}function Mk($){if($.nodes.length===0)return null;let v=$.nodes.flatMap((z)=>z.reasons),g=$.nodes.map((z)=>S6(z.title,z.id)),_=$.timestamp?Date.parse($.timestamp)||Date.now():Date.now();if(v.some((z)=>z.includes("pinned neighborhood"))){if($.nodes.length===1)return cv("neighborhood","Neighborhood changed",`${g[0]} ${KK($.nodes[0].reasons[0])}`,$.nodes.map((z)=>z.id),_);return cv("neighborhood","Neighborhood changed",O6(g),$.nodes.map((z)=>z.id),_)}let U=v.filter((z)=>z.includes("cluster"));if(U.length>0){let z=U.every((J)=>J==="joined cluster");if($.nodes.length===1)return cv("cluster",z?"Cluster formed":"Cluster changed",`${g[0]} ${KK($.nodes[0].reasons[0])}`,$.nodes.map((J)=>J.id),_);return cv("cluster",z?"Cluster formed":"Cluster changed",O6(g),$.nodes.map((J)=>J.id),_)}return null}function Qk($){switch($.type){case"context-pin":return Ak($);case"connect":return wk($);case"remove":return Zk($);case"group":return Sk($);case"move-end":return Mk($)}}function Nk(){let $=w2.getAttentionSnapshot();H3($.primaryFocusNodeIds,$.secondaryFocusNodeIds,$.regions)}function BK(){if(uU!==null)return;let $=Z2.shift()??null;if(!$){K_(null);return}K_($);let v=Math.max(1800,Math.min(2800,1600+$.detail.length*18));uU=WK(()=>{uU=null,K_(null),BK()},v)}function PK($){Z2.push($),BK()}function Dv($,v,g="",_=[]){PK(cv($,v,g,_))}function rk($){if(A2(N4),N4=null,W_([]),$.length===0)return;qk(()=>{W_($),N4=WK(()=>{N4=null,W_([])},900)})}function uk($){let v=`${$.tone}:${$.title}:${$.detail}`,g=$.createdAt;if(v===q2&&g-X2<1200)return!0;return q2=v,X2=g,!1}function kK(){A2(uU),A2(N4),uU=null,N4=null,Z2=[],q2="",X2=0,w2=new u_,k3()}function S2($){let v=w2.handleMessage($).map((g)=>Qk(g)).filter((g)=>g!==null);Nk();for(let g of v){if(uk(g))continue;I3(g),PK(g),rk(g.nodeIds)}}async function y_($,v,g,_){let U=await Y6({type:v,sourceNodeId:$.id,sourceSurface:"native-node",...g?{payload:g}:{}});if(U.ok)Dv("context",_,"",[$.id]);else Dv("remove","AX action failed",U.error??U.code??"Unknown error",[$.id])}var HK={padding:"3px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer",flexShrink:0};function yk($){let v=$.title||$.label||$.key||"Context",g=$.summary?.trim()||"Available in startup context.",_=$.pathDisplay||$.path||"",U=$.category==="profile"?"Operator":$.category==="planning"||$.category==="memory"?"Product":$.category?$.category.charAt(0).toUpperCase()+$.category.slice(1):void 0,z=$.sourceKind==="global"?"Global":"Workspace",J=$.state==="missing"?"Missing":$.state==="stale"?"Stale":$.state==="invalid"?"Invalid":"Loaded";return{title:v,summary:g,pathDisplay:_,category:U,sourceKind:z,status:J,required:$.required===!0}}function mv($){return typeof $==="string"?$.trim():""}function Rk($){return $.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim()}function Dk($){let v=mv($.title),g=mv($.content),_=Rk(mv($.rendered)),U=g||_,z=mv($.path);if(!v&&!U&&!z)return null;return{title:v||"Context",summary:U,path:z}}function Tk($){let v=mv($.data.title)||$.id,g=mv($.data.content)||mv($.data.excerpt)||mv($.data.description)||mv($.data.pageTitle)||"",_=mv($.data.path)||mv($.data.url);return{id:$.id,title:v,summary:g,kind:e$[$.type]??$.type,path:_}}function IK($){if($===null||!Number.isFinite($)||$<0)return"0";if($>=1e6)return`${($/1e6).toFixed(1)}m`;if($>=1000)return`${($/1000).toFixed(1)}k`;return`${Math.round($)}`}function jk($){if($>=0.95)return"var(--c-danger)";if($>=0.85)return"var(--c-warn)";if($>=0.7)return"var(--c-warn)";return"var(--c-accent)"}function d6({node:$,expanded:v=!1,pinnedNodes:g=[]}){let _=$.data.cards??[],U=$.data.auxTabs??[],z=g.map(Tk),J=z.length>0,b=typeof $.data.currentTokens==="number"?$.data.currentTokens:null,G=typeof $.data.tokenLimit==="number"?$.data.tokenLimit:null,K=typeof $.data.utilization==="number"?$.data.utilization:null,W=typeof $.data.messagesLength==="number"?$.data.messagesLength:null,B=K!==null?Math.max(0,Math.min(100,Math.round(K*100))):null,k=jk(K??0),P=!J&&_.length===0&&U.length===0?Dk($.data):null,q=async(L)=>{let H=typeof L.path==="string"?L.path.trim():"";if(!H)return;await P_(H)};return O("div",{style:{display:"flex",flexDirection:"column",gap:v?"10px":"6px",fontSize:v?"14px":"12px",maxWidth:v?"760px":void 0,margin:v?"0 auto":void 0,width:v?"100%":void 0,padding:v?"8px 0":void 0},children:[O("div",{style:{display:"flex",justifyContent:"flex-end"},children:O("button",{type:"button",class:"ax-node-action",title:"Point the agent at this node — sets it as the agent's current AX focus so the agent pulls it into context to work on next (a one-click alternative to manually pinning).",style:HK,onClick:(L)=>{L.stopPropagation(),y_($,"ax.focus.set",void 0,"Focus set")},children:"Set focus"},void 0,!1,void 0,this)},void 0,!1,void 0,this),G!==null&&G>0&&O("div",{style:{marginBottom:"8px"},children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"},children:"Token Usage"},void 0,!1,void 0,this),O("div",{style:{height:"6px",background:"var(--c-surface-hover)",borderRadius:"3px",overflow:"hidden",marginBottom:"4px"},children:O("div",{style:{height:"100%",width:`${Math.min(100,(K??0)*100)}%`,background:k,borderRadius:"3px",transition:"width 0.3s ease"}},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{style:{fontSize:"11px",color:"var(--c-muted)"},children:[B,"% — ",IK(b)," / ",IK(G)," tokens",W!==null&&O(s$,{children:[" · ",W," messages"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),J&&O("div",{children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"},children:["Pinned Context (",z.length,")"]},void 0,!0,void 0,this),z.map((L)=>O("div",{style:{padding:"6px 8px",background:"var(--c-surface-subtle)",borderRadius:"6px",marginBottom:"4px",borderLeft:"2px solid var(--c-accent)"},children:[O("div",{style:{fontWeight:600,color:"var(--c-text)",marginBottom:"2px"},children:L.title},void 0,!1,void 0,this),L.summary&&O("div",{style:{color:"var(--c-muted)",fontSize:"10px",lineHeight:1.45,marginBottom:"4px",whiteSpace:"pre-wrap"},children:L.summary},void 0,!1,void 0,this),O("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"},children:O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-surface-hover)",color:"var(--c-text-soft)",borderRadius:"3px",display:"inline-block"},children:L.kind},void 0,!1,void 0,this)},void 0,!1,void 0,this),L.path&&O("div",{style:{marginTop:"6px"},children:[O("div",{style:{color:"var(--c-dim)",fontSize:"10px",wordBreak:"break-all",marginBottom:"6px"},children:L.path},void 0,!1,void 0,this),L.path.startsWith("/")&&O("button",{type:"button",onClick:()=>void P_(L.path),style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Open in canvas"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},L.id,!0,void 0,this))]},void 0,!0,void 0,this),!J&&_.length>0&&O("div",{children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px"},children:["Context (",_.length,")"]},void 0,!0,void 0,this),_.map((L)=>{let H=yk(L);return O("div",{style:{padding:"6px 8px",background:"var(--c-surface-subtle)",borderRadius:"6px",marginBottom:"4px",borderLeft:"2px solid var(--c-accent)"},children:[O("div",{style:{fontWeight:600,color:"var(--c-text)",marginBottom:"2px"},children:H.title},void 0,!1,void 0,this),O("div",{style:{color:"var(--c-muted)",fontSize:"10px",lineHeight:1.45,marginBottom:"4px"},children:H.summary},void 0,!1,void 0,this),H.pathDisplay&&O("div",{style:{color:"var(--c-dim)",fontSize:"10px",wordBreak:"break-all"},children:H.pathDisplay},void 0,!1,void 0,this),O("div",{style:{display:"flex",gap:"4px",flexWrap:"wrap",marginTop:"4px"},children:[O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-accent-10)",color:"var(--c-accent)",borderRadius:"3px",display:"inline-block"},children:H.status},void 0,!1,void 0,this),H.category&&O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-surface-hover)",color:"var(--c-text-soft)",borderRadius:"3px",display:"inline-block"},children:H.category},void 0,!1,void 0,this),O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-surface-hover)",color:"var(--c-text-soft)",borderRadius:"3px",display:"inline-block"},children:H.sourceKind},void 0,!1,void 0,this),H.required&&O("span",{style:{fontSize:"9px",padding:"1px 4px",background:"var(--c-warn-12)",color:"var(--c-warn-alt)",borderRadius:"3px",display:"inline-block"},children:"Required"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),L.path&&O("div",{style:{marginTop:"6px"},children:O("button",{type:"button",onClick:()=>void q(L),style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Open in canvas"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},L.key??H.pathDisplay??H.title,!0,void 0,this)})]},void 0,!0,void 0,this),!J&&U.length>0&&O("div",{children:[O("div",{style:{fontSize:"10px",fontWeight:600,color:"var(--c-muted)",textTransform:"uppercase",letterSpacing:"0.04em",marginBottom:"6px",marginTop:_.length>0?"8px":0},children:["References (",U.length,")"]},void 0,!0,void 0,this),U.map((L)=>O("a",{href:L.url,target:"_blank",rel:"noopener noreferrer",style:{display:"block",padding:"4px 8px",color:"var(--c-accent)",fontSize:"11px",textDecoration:"none",borderRadius:"4px",marginBottom:"2px",wordBreak:"break-all"},children:[L.url,L.reason&&O("span",{style:{color:"var(--c-dim)",fontSize:"10px",marginLeft:"6px"},children:["(",L.reason,")"]},void 0,!0,void 0,this)]},L.id,!0,void 0,this))]},void 0,!0,void 0,this),P&&O("div",{style:{padding:"8px 10px",background:"var(--c-surface-subtle)",borderRadius:"6px",borderLeft:"2px solid var(--c-accent)"},children:[O("div",{style:{fontWeight:600,color:"var(--c-text)",marginBottom:"4px"},children:P.title},void 0,!1,void 0,this),P.summary&&O("div",{style:{color:"var(--c-text-soft)",fontSize:"11px",lineHeight:1.5,whiteSpace:"pre-wrap"},children:P.summary},void 0,!1,void 0,this),P.path&&O("div",{style:{marginTop:"6px"},children:[O("div",{style:{color:"var(--c-dim)",fontSize:"10px",wordBreak:"break-all",marginBottom:"6px"},children:P.path},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>void P_(P.path),style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-accent-12)",border:"1px solid var(--c-accent-25)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Open in canvas"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!J&&!P&&_.length===0&&U.length===0&&O("div",{style:{color:"var(--c-dim)",fontStyle:"italic"},children:"No context loaded"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Vk($){let v=$.split(".").pop()?.toLowerCase()??"";return{ts:"TypeScript",tsx:"TSX",js:"JavaScript",jsx:"JSX",py:"Python",rs:"Rust",go:"Go",rb:"Ruby",java:"Java",kt:"Kotlin",swift:"Swift",c:"C",cpp:"C++",h:"C/C++",css:"CSS",html:"HTML",json:"JSON",yaml:"YAML",yml:"YAML",md:"Markdown",toml:"TOML",sql:"SQL",sh:"Shell",bash:"Shell",xml:"XML",graphql:"GraphQL",proto:"Protobuf"}[v]??(v.toUpperCase()||"Text")}function R_({node:$,expanded:v=!1}){let g=$.data.path||$.data.content||"",_=$.data.title||g.split("/").pop()||"File",U=$.data.fileContent,z=$.data.updatedAt,J=$.data.lineCount,[b,G]=x(U??""),[K,W]=x(!U&&!!g),[B,k]=x(null);c(()=>{if(!g)return;if(U!==void 0){G(U),W(!1);return}let F=!1;return W(!0),k(null),MU(g).then(({content:Y})=>{if(F)return;if(!Y&&Y!==""){k("File not found"),W(!1);return}G(Y),W(!1);let A=Y.split(`
36
+ `).length;U$($.id,{fileContent:Y,lineCount:A}),Zv($.id,{data:{fileContent:Y,lineCount:A}})}).catch(()=>{if(!F)k("Failed to load file"),W(!1)}),()=>{F=!0}},[g,U]),c(()=>{if(U!==void 0&&U!==b)G(U)},[U]);let P=Q(()=>{if(!g)return;W(!0),k(null),U$($.id,{fileContent:void 0}),Zv($.id,{data:{fileContent:void 0}}),MU(g).then(({content:F})=>{G(F),W(!1);let Y=F.split(`
37
+ `).length,A=new Date().toISOString();U$($.id,{fileContent:F,lineCount:Y,updatedAt:A}),Zv($.id,{data:{fileContent:F,lineCount:Y,updatedAt:A}})}).catch(()=>{k("Failed to reload"),W(!1)})},[g,$.id]),q=Vk(g),L=b.split(`
38
+ `),H=`${String(L.length).length+1}ch`;if(!g)return O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"No file path set"},void 0,!1,void 0,this);return O("div",{style:{display:"flex",flexDirection:"column",height:"100%",fontFamily:"var(--mono)",fontSize:v?"13px":"11px"},children:[O("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 10px",borderBottom:"1px solid var(--c-line)",flexShrink:0},children:[O("span",{style:{fontSize:"9px",padding:"1px 5px",background:"var(--c-accent-12)",color:"var(--c-accent)",borderRadius:"3px",fontWeight:600},children:q},void 0,!1,void 0,this),O("span",{style:{color:"var(--c-text-soft)",fontSize:v?"12px":"10px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",flex:1},title:g,children:g},void 0,!1,void 0,this),J!==void 0&&O("span",{style:{color:"var(--c-dim)",fontSize:"10px",flexShrink:0},children:[J," lines"]},void 0,!0,void 0,this),z&&O("span",{style:{color:"var(--c-dim)",fontSize:"10px",flexShrink:0},children:new Date(z).toLocaleTimeString()},void 0,!1,void 0,this),O("button",{type:"button",class:"ax-node-action",title:"Mark this file as AX evidence",onClick:(F)=>{F.stopPropagation(),y_($,"ax.evidence.add",{kind:"file",title:g.split("/").pop()||g,ref:g},"Marked as evidence")},style:{background:"none",border:"none",color:"var(--c-muted)",cursor:"pointer",padding:"2px 4px",fontSize:"12px",flexShrink:0},children:"⊕"},void 0,!1,void 0,this),O("button",{type:"button",onClick:P,title:"Reload file",style:{background:"none",border:"none",color:"var(--c-muted)",cursor:"pointer",padding:"2px 4px",fontSize:"12px",flexShrink:0},children:"↻"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{flex:1,overflow:"auto",padding:"8px 0",background:v?"var(--c-panel-soft)":void 0,borderRadius:v?"0 0 8px 8px":void 0},children:[K&&O("div",{style:{color:"var(--c-dim)",padding:"12px",fontStyle:"italic"},children:"Loading…"},void 0,!1,void 0,this),B&&O("div",{style:{color:"var(--c-danger)",padding:"12px"},children:B},void 0,!1,void 0,this),!K&&!B&&O("pre",{style:{margin:0,lineHeight:"1.55",tabSize:2},children:L.map((F,Y)=>O("div",{style:{display:"flex",minHeight:"1.55em"},children:[O("span",{style:{width:H,minWidth:H,textAlign:"right",color:"var(--c-dim)",paddingRight:"12px",paddingLeft:"10px",userSelect:"none",flexShrink:0,opacity:0.6},children:Y+1},void 0,!1,void 0,this),O("code",{style:{color:"var(--c-text)",whiteSpace:"pre",paddingRight:"10px"},children:F||`
39
+ `},void 0,!1,void 0,this)]},Y,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}var Ck=new Set(["title","__type","content","strictSize","arrangeLocked"]);function r4({node:$}){let v=$.data,_=(typeof v.content==="string"?v.content:"").split(/\r\n|\r|\n|\\n/).map((z)=>z.trimEnd()).filter((z)=>z.length>0),U=Object.entries(v).filter(([z])=>!Ck.has(z));if(_.length===0&&U.length===0)return O("div",{style:{color:"var(--c-dim)",fontSize:"12px",fontStyle:"italic"},children:"No ledger data"},void 0,!1,void 0,this);return O("div",{style:{display:"flex",flexDirection:"column",gap:"4px",fontSize:"12px"},children:[_.length>0&&O("div",{style:{display:"flex",flexDirection:"column"},children:_.map((z,J)=>O("div",{style:{padding:"3px 0",borderBottom:J<_.length-1?"1px solid rgba(45,55,90,0.3)":"none",color:"var(--c-text)",fontFamily:"var(--mono)",fontSize:"11px",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:z},J,!1,void 0,this))},void 0,!1,void 0,this),U.map(([z,J])=>O("div",{style:{display:"flex",justifyContent:"space-between",gap:"8px",padding:"3px 0",borderBottom:"1px solid rgba(45,55,90,0.3)"},children:[O("span",{style:{color:"var(--c-muted)",fontSize:"11px",flexShrink:0},children:z.replace(/([A-Z])/g," $1").replace(/^./,(b)=>b.toUpperCase())},void 0,!1,void 0,this),O("span",{style:{color:"var(--c-text)",fontFamily:"var(--mono)",fontSize:"11px",textAlign:"right",wordBreak:"break-word"},children:typeof J==="object"?JSON.stringify(J):String(J??"—")},void 0,!1,void 0,this)]},z,!0,void 0,this))]},void 0,!0,void 0,this)}var M2=typeof navigator<"u"&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Mv=M2?"⌘":"Ctrl";function D_($,v){let{selectionStart:g,selectionEnd:_,value:U}=$,z=U.slice(g,_),J=U.slice(Math.max(0,g-v.length),g),b=U.slice(_,_+v.length);if(J===v&&b===v){let G=U.slice(0,g-v.length)+z+U.slice(_+v.length);ov($,G,g-v.length,_-v.length);return}if(z){let G=U.slice(0,g)+v+z+v+U.slice(_);ov($,G,g+v.length,_+v.length)}else{let G=U.slice(0,g)+v+v+U.slice(_);ov($,G,g+v.length,g+v.length)}}function yU($,v){let{selectionStart:g,selectionEnd:_,value:U}=$,z=U.lastIndexOf(`
40
+ `,g-1)+1,J=U.indexOf(`
41
+ `,_),b=J===-1?U.length:J,G=U.slice(z,b);if(G.startsWith(v)){let W=U.slice(0,z)+G.slice(v.length)+U.slice(b);ov($,W,Math.max(z,g-v.length),Math.max(z,_-v.length));return}let K=U.slice(0,z)+v+U.slice(z);ov($,K,g+v.length,_+v.length)}function fk($){let{selectionStart:v,selectionEnd:g,value:_}=$,U=_.slice(v,g);if(U){let z=_.slice(0,v)+`[${U}](url)`+_.slice(g),J=v+U.length+3;ov($,z,J,J+3)}else{let z=_.slice(0,v)+"[text](url)"+_.slice(g);ov($,z,v+1,v+5)}}function Ek($){let{selectionStart:v,selectionEnd:g,value:_}=$,U=_.slice(v,g),z="```";if(U){let J=_.slice(0,v)+`\`\`\`
42
42
  ${U}
43
- \`\`\``+_.slice(g);pv($,b,v+3+1,v+3+1+U.length)}else{let b=_.slice(0,v)+"```\n\n```"+_.slice(g);pv($,b,v+3+1,v+3+1)}}function W3($,v){let{selectionStart:g,selectionEnd:_,value:U}=$,z=U.lastIndexOf(`
44
- `,g-1)+1,b=U.indexOf(`
45
- `,_),J=b===-1?U.length:b,G=U.slice(z,J).split(`
46
- `),K=g,W=_,B=G.map((P,A)=>{if(v){if(P.startsWith(" ")){if(A===0)K=Math.max(z,K-2);return W-=2,P.slice(2)}else if(P.startsWith("\t")){if(A===0)K=Math.max(z,K-1);return W-=1,P.slice(1)}return P}else{if(A===0)K+=2;return W+=2," "+P}}),k=U.slice(0,z)+B.join(`
47
- `)+U.slice(J);pv($,k,K,W)}function pv($,v,g,_){let U=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;if(U)U.call($,v);else $.value=v;$.selectionStart=g,$.selectionEnd=_,$.dispatchEvent(new Event("input",{bubbles:!0}))}var Q_=[{key:"bold",label:"Bold",icon:"B",shortcut:"b",action:($)=>M_($,"**")},{key:"italic",label:"Italic",icon:"I",shortcut:"i",action:($)=>M_($,"_")},{key:"strike",label:"Strikethrough",icon:"S",shortcut:"u",action:($)=>M_($,"~~")},{key:"code",label:"Inline code",icon:"`",shortcut:"e",action:($)=>M_($,"`")},{key:"link",label:"Link",icon:"\uD83D\uDD17",shortcut:"k",action:Rk},{key:"h1",label:"Heading 1",icon:"H1",action:($)=>MU($,"# ")},{key:"h2",label:"Heading 2",icon:"H2",action:($)=>MU($,"## ")},{key:"quote",label:"Blockquote",icon:"❝",action:($)=>MU($,"> ")},{key:"ul",label:"Bullet list",icon:"•",action:($)=>MU($,"- ")},{key:"ol",label:"Numbered list",icon:"1.",action:($)=>MU($,"1. ")},{key:"codeblock",label:"Code block",icon:"{ }",action:yk}];function B3($,v){if(!($.metaKey||$.ctrlKey))return!1;let g=Q_.find((_)=>_.shortcut===$.key);if(!g)return!1;return $.preventDefault(),g.action(v),!0}function P3($){if($.selectionStart===$.selectionEnd)return null;let v=document.createElement("div"),g=getComputedStyle($),_=["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","wordSpacing","textIndent","whiteSpace","wordWrap","overflowWrap","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","boxSizing","width"];for(let W of _)v.style[W]=g[W];v.style.position="absolute",v.style.visibility="hidden",v.style.overflow="hidden",v.style.height="auto",v.style.top="0",v.style.left="0";let U=$.value,z=document.createTextNode(U.slice(0,$.selectionStart)),b=document.createElement("span");b.textContent=U.slice($.selectionStart,$.selectionEnd)||".",v.appendChild(z),v.appendChild(b),v.appendChild(document.createTextNode(U.slice($.selectionEnd))),document.body.appendChild(v);let J=b.getBoundingClientRect(),G=v.getBoundingClientRect(),K=$.getBoundingClientRect();return document.body.removeChild(v),{top:K.top+(J.top-G.top)-$.scrollTop,left:K.left+(J.left-G.left)-$.scrollLeft,width:J.width}}var Dk=Q_.filter(($)=>$.shortcut),Tk=Q_.filter(($)=>!$.shortcut);function A2({textareaRef:$}){let[v,g]=x(!1),[_,U]=x({top:0,left:0}),z=V(null),b=V(null),J=N(()=>{let W=$.current;if(!W||W.selectionStart===W.selectionEnd){g(!1);return}let B=P3(W);if(!B){g(!1);return}let k=380,P=Math.max(8,Math.min(B.left+B.width/2-k/2,window.innerWidth-k-8));U({top:B.top-40,left:P}),g(!0)},[$]);m(()=>{let W=$.current;if(!W)return;let B=()=>{if(b.current)clearTimeout(b.current);b.current=setTimeout(J,50)},k=()=>{b.current=setTimeout(()=>g(!1),200)},P=(A)=>{if(A.shiftKey||A.key.startsWith("Arrow"))B()};return W.addEventListener("select",B),W.addEventListener("mouseup",B),W.addEventListener("keyup",P),W.addEventListener("blur",k),()=>{if(W.removeEventListener("select",B),W.removeEventListener("mouseup",B),W.removeEventListener("keyup",P),W.removeEventListener("blur",k),b.current)clearTimeout(b.current)}},[$,J]);let G=N((W)=>{let B=$.current;if(B)W.action(B),B.focus()},[$]);if(!v)return null;let K=Y2?"⌘":"Ctrl";return O("div",{ref:z,class:"md-format-bar",style:{top:`${_.top}px`,left:`${_.left}px`},onMouseDown:(W)=>W.preventDefault(),children:[Dk.map((W)=>O("button",{type:"button",class:`md-format-btn md-format-btn-${W.key}`,title:`${W.label} (${K}+${W.shortcut.toUpperCase()})`,onClick:()=>G(W),children:W.icon},W.key,!1,void 0,this)),O("div",{class:"md-format-divider"},void 0,!1,void 0,this),Tk.map((W)=>O("button",{type:"button",class:`md-format-btn md-format-btn-${W.key}`,title:W.label,onClick:()=>G(W),children:W.icon},W.key,!1,void 0,this))]},void 0,!0,void 0,this)}var x3=GP(r3(),1);function dk($){for(var v=1;v<arguments.length;v++){var g=arguments[v];for(var _ in g)if(Object.prototype.hasOwnProperty.call(g,_))$[_]=g[_]}return $}function Q2($,v){return Array(v+1).join($)}function y3($){return $.replace(/^\n*/,"")}function D3($){var v=$.length;while(v>0&&$[v-1]===`
48
- `)v--;return $.substring(0,v)}function T3($){return D3(y3($))}var ak=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function N2($){return r2($,ak)}var j3=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function V3($){return r2($,j3)}function sk($){return f3($,j3)}var C3=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function ek($){return r2($,C3)}function $I($){return f3($,C3)}function r2($,v){return v.indexOf($.nodeName)>=0}function f3($,v){return $.getElementsByTagName&&v.some(function(g){return $.getElementsByTagName(g).length})}var vI=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function m3($){return vI.reduce(function(v,g){return v.replace(g[0],g[1])},$)}var Gv={};Gv.paragraph={filter:"p",replacement:function($){return`
43
+ \`\`\``+_.slice(g);ov($,J,v+3+1,v+3+1+U.length)}else{let J=_.slice(0,v)+"```\n\n```"+_.slice(g);ov($,J,v+3+1,v+3+1)}}function LK($,v){let{selectionStart:g,selectionEnd:_,value:U}=$,z=U.lastIndexOf(`
44
+ `,g-1)+1,J=U.indexOf(`
45
+ `,_),b=J===-1?U.length:J,G=U.slice(z,b).split(`
46
+ `),K=g,W=_,B=G.map((P,q)=>{if(v){if(P.startsWith(" ")){if(q===0)K=Math.max(z,K-2);return W-=2,P.slice(2)}else if(P.startsWith("\t")){if(q===0)K=Math.max(z,K-1);return W-=1,P.slice(1)}return P}else{if(q===0)K+=2;return W+=2," "+P}}),k=U.slice(0,z)+B.join(`
47
+ `)+U.slice(b);ov($,k,K,W)}function ov($,v,g,_){let U=Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype,"value")?.set;if(U)U.call($,v);else $.value=v;$.selectionStart=g,$.selectionEnd=_,$.dispatchEvent(new Event("input",{bubbles:!0}))}var T_=[{key:"bold",label:"Bold",icon:"B",shortcut:"b",action:($)=>D_($,"**")},{key:"italic",label:"Italic",icon:"I",shortcut:"i",action:($)=>D_($,"_")},{key:"strike",label:"Strikethrough",icon:"S",shortcut:"u",action:($)=>D_($,"~~")},{key:"code",label:"Inline code",icon:"`",shortcut:"e",action:($)=>D_($,"`")},{key:"link",label:"Link",icon:"\uD83D\uDD17",shortcut:"k",action:fk},{key:"h1",label:"Heading 1",icon:"H1",action:($)=>yU($,"# ")},{key:"h2",label:"Heading 2",icon:"H2",action:($)=>yU($,"## ")},{key:"quote",label:"Blockquote",icon:"❝",action:($)=>yU($,"> ")},{key:"ul",label:"Bullet list",icon:"•",action:($)=>yU($,"- ")},{key:"ol",label:"Numbered list",icon:"1.",action:($)=>yU($,"1. ")},{key:"codeblock",label:"Code block",icon:"{ }",action:Ek}];function FK($,v){if(!($.metaKey||$.ctrlKey))return!1;let g=T_.find((_)=>_.shortcut===$.key);if(!g)return!1;return $.preventDefault(),g.action(v),!0}function YK($){if($.selectionStart===$.selectionEnd)return null;let v=document.createElement("div"),g=getComputedStyle($),_=["fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","wordSpacing","textIndent","whiteSpace","wordWrap","overflowWrap","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","boxSizing","width"];for(let W of _)v.style[W]=g[W];v.style.position="absolute",v.style.visibility="hidden",v.style.overflow="hidden",v.style.height="auto",v.style.top="0",v.style.left="0";let U=$.value,z=document.createTextNode(U.slice(0,$.selectionStart)),J=document.createElement("span");J.textContent=U.slice($.selectionStart,$.selectionEnd)||".",v.appendChild(z),v.appendChild(J),v.appendChild(document.createTextNode(U.slice($.selectionEnd))),document.body.appendChild(v);let b=J.getBoundingClientRect(),G=v.getBoundingClientRect(),K=$.getBoundingClientRect();return document.body.removeChild(v),{top:K.top+(b.top-G.top)-$.scrollTop,left:K.left+(b.left-G.left)-$.scrollLeft,width:b.width}}var ck=T_.filter(($)=>$.shortcut),mk=T_.filter(($)=>!$.shortcut);function Q2({textareaRef:$}){let[v,g]=x(!1),[_,U]=x({top:0,left:0}),z=y(null),J=y(null),b=Q(()=>{let W=$.current;if(!W||W.selectionStart===W.selectionEnd){g(!1);return}let B=YK(W);if(!B){g(!1);return}let k=380,P=Math.max(8,Math.min(B.left+B.width/2-k/2,window.innerWidth-k-8));U({top:B.top-40,left:P}),g(!0)},[$]);c(()=>{let W=$.current;if(!W)return;let B=()=>{if(J.current)clearTimeout(J.current);J.current=setTimeout(b,50)},k=()=>{J.current=setTimeout(()=>g(!1),200)},P=(q)=>{if(q.shiftKey||q.key.startsWith("Arrow"))B()};return W.addEventListener("select",B),W.addEventListener("mouseup",B),W.addEventListener("keyup",P),W.addEventListener("blur",k),()=>{if(W.removeEventListener("select",B),W.removeEventListener("mouseup",B),W.removeEventListener("keyup",P),W.removeEventListener("blur",k),J.current)clearTimeout(J.current)}},[$,b]);let G=Q((W)=>{let B=$.current;if(B)W.action(B),B.focus()},[$]);if(!v)return null;let K=M2?"⌘":"Ctrl";return O("div",{ref:z,class:"md-format-bar",style:{top:`${_.top}px`,left:`${_.left}px`},onMouseDown:(W)=>W.preventDefault(),children:[ck.map((W)=>O("button",{type:"button",class:`md-format-btn md-format-btn-${W.key}`,title:`${W.label} (${K}+${W.shortcut.toUpperCase()})`,onClick:()=>G(W),children:W.icon},W.key,!1,void 0,this)),O("div",{class:"md-format-divider"},void 0,!1,void 0,this),mk.map((W)=>O("button",{type:"button",class:`md-format-btn md-format-btn-${W.key}`,title:W.label,onClick:()=>G(W),children:W.icon},W.key,!1,void 0,this))]},void 0,!0,void 0,this)}var aK=IP(jK(),1);function gH($){for(var v=1;v<arguments.length;v++){var g=arguments[v];for(var _ in g)if(Object.prototype.hasOwnProperty.call(g,_))$[_]=g[_]}return $}function T2($,v){return Array(v+1).join($)}function fK($){return $.replace(/^\n*/,"")}function EK($){var v=$.length;while(v>0&&$[v-1]===`
48
+ `)v--;return $.substring(0,v)}function cK($){return EK(fK($))}var _H=["ADDRESS","ARTICLE","ASIDE","AUDIO","BLOCKQUOTE","BODY","CANVAS","CENTER","DD","DIR","DIV","DL","DT","FIELDSET","FIGCAPTION","FIGURE","FOOTER","FORM","FRAMESET","H1","H2","H3","H4","H5","H6","HEADER","HGROUP","HR","HTML","ISINDEX","LI","MAIN","MENU","NAV","NOFRAMES","NOSCRIPT","OL","OUTPUT","P","PRE","SECTION","TABLE","TBODY","TD","TFOOT","TH","THEAD","TR","UL"];function j2($){return V2($,_H)}var mK=["AREA","BASE","BR","COL","COMMAND","EMBED","HR","IMG","INPUT","KEYGEN","LINK","META","PARAM","SOURCE","TRACK","WBR"];function iK($){return V2($,mK)}function zH($){return hK($,mK)}var lK=["A","TABLE","THEAD","TBODY","TFOOT","TH","TD","IFRAME","SCRIPT","AUDIO","VIDEO"];function JH($){return V2($,lK)}function bH($){return hK($,lK)}function V2($,v){return v.indexOf($.nodeName)>=0}function hK($,v){return $.getElementsByTagName&&v.some(function(g){return $.getElementsByTagName(g).length})}var OH=[[/\\/g,"\\\\"],[/\*/g,"\\*"],[/^-/g,"\\-"],[/^\+ /g,"\\+ "],[/^(=+)/g,"\\$1"],[/^(#{1,6}) /g,"\\$1 "],[/`/g,"\\`"],[/^~~~/g,"\\~~~"],[/\[/g,"\\["],[/\]/g,"\\]"],[/^>/g,"\\>"],[/_/g,"\\_"],[/^(\d+)\. /g,"$1\\. "]];function xK($){return OH.reduce(function(v,g){return v.replace(g[0],g[1])},$)}var Gv={};Gv.paragraph={filter:"p",replacement:function($){return`
49
49
 
50
50
  `+$+`
51
51
 
52
52
  `}};Gv.lineBreak={filter:"br",replacement:function($,v,g){return g.br+`
53
- `}};Gv.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function($,v,g){var _=Number(v.nodeName.charAt(1));if(g.headingStyle==="setext"&&_<3){var U=Q2(_===1?"=":"-",$.length);return`
53
+ `}};Gv.heading={filter:["h1","h2","h3","h4","h5","h6"],replacement:function($,v,g){var _=Number(v.nodeName.charAt(1));if(g.headingStyle==="setext"&&_<3){var U=T2(_===1?"=":"-",$.length);return`
54
54
 
55
55
  `+$+`
56
56
  `+U+`
57
57
 
58
58
  `}else return`
59
59
 
60
- `+Q2("#",_)+" "+$+`
60
+ `+T2("#",_)+" "+$+`
61
61
 
62
- `}};Gv.blockquote={filter:"blockquote",replacement:function($){return $=T3($).replace(/^/gm,"> "),`
62
+ `}};Gv.blockquote={filter:"blockquote",replacement:function($){return $=cK($).replace(/^/gm,"> "),`
63
63
 
64
64
  `+$+`
65
65
 
@@ -68,7 +68,7 @@ ${U}
68
68
 
69
69
  `+$+`
70
70
 
71
- `}};Gv.listItem={filter:"li",replacement:function($,v,g){var _=g.bulletListMarker+" ",U=v.parentNode;if(U.nodeName==="OL"){var z=U.getAttribute("start"),b=Array.prototype.indexOf.call(U.children,v);_=(z?Number(z)+b:b+1)+". "}var J=/\n$/.test($);return $=T3($)+(J?`
71
+ `}};Gv.listItem={filter:"li",replacement:function($,v,g){var _=g.bulletListMarker+" ",U=v.parentNode;if(U.nodeName==="OL"){var z=U.getAttribute("start"),J=Array.prototype.indexOf.call(U.children,v);_=(z?Number(z)+J:J+1)+". "}var b=/\n$/.test($);return $=cK($)+(b?`
72
72
  `:""),$=$.replace(/\n/gm,`
73
73
  `+" ".repeat(_.length)),_+$+(v.nextSibling?`
74
74
  `:"")}};Gv.indentedCodeBlock={filter:function($,v){return v.codeBlockStyle==="indented"&&$.nodeName==="PRE"&&$.firstChild&&$.firstChild.nodeName==="CODE"},replacement:function($,v,g){return`
@@ -76,7 +76,7 @@ ${U}
76
76
  `+v.firstChild.textContent.replace(/\n/g,`
77
77
  `)+`
78
78
 
79
- `}};Gv.fencedCodeBlock={filter:function($,v){return v.codeBlockStyle==="fenced"&&$.nodeName==="PRE"&&$.firstChild&&$.firstChild.nodeName==="CODE"},replacement:function($,v,g){var _=v.firstChild.getAttribute("class")||"",U=(_.match(/language-(\S+)/)||[null,""])[1],z=v.firstChild.textContent,b=g.fence.charAt(0),J=3,G=new RegExp("^"+b+"{3,}","gm"),K;while(K=G.exec(z))if(K[0].length>=J)J=K[0].length+1;var W=Q2(b,J);return`
79
+ `}};Gv.fencedCodeBlock={filter:function($,v){return v.codeBlockStyle==="fenced"&&$.nodeName==="PRE"&&$.firstChild&&$.firstChild.nodeName==="CODE"},replacement:function($,v,g){var _=v.firstChild.getAttribute("class")||"",U=(_.match(/language-(\S+)/)||[null,""])[1],z=v.firstChild.textContent,J=g.fence.charAt(0),b=3,G=new RegExp("^"+J+"{3,}","gm"),K;while(K=G.exec(z))if(K[0].length>=b)b=K[0].length+1;var W=T2(J,b);return`
80
80
 
81
81
  `+W+U+`
82
82
  `+z.replace(/\n$/,"")+`
@@ -86,13 +86,13 @@ ${U}
86
86
 
87
87
  `+g.hr+`
88
88
 
89
- `}};Gv.inlineLink={filter:function($,v){return v.linkStyle==="inlined"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,v){var g=u2(v.getAttribute("href")),_=R2(N_(v.getAttribute("title"))),U=_?' "'+_+'"':"";return"["+$+"]("+g+U+")"}};Gv.referenceLink={filter:function($,v){return v.linkStyle==="referenced"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,v,g){var _=u2(v.getAttribute("href")),U=N_(v.getAttribute("title"));if(U)U=' "'+R2(U)+'"';var z,b;switch(g.linkReferenceStyle){case"collapsed":z="["+$+"][]",b="["+$+"]: "+_+U;break;case"shortcut":z="["+$+"]",b="["+$+"]: "+_+U;break;default:var J=this.references.length+1;z="["+$+"]["+J+"]",b="["+J+"]: "+_+U}return this.references.push(b),z},references:[],append:function($){var v="";if(this.references.length)v=`
89
+ `}};Gv.inlineLink={filter:function($,v){return v.linkStyle==="inlined"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,v){var g=C2(v.getAttribute("href")),_=f2(j_(v.getAttribute("title"))),U=_?' "'+_+'"':"";return"["+$+"]("+g+U+")"}};Gv.referenceLink={filter:function($,v){return v.linkStyle==="referenced"&&$.nodeName==="A"&&$.getAttribute("href")},replacement:function($,v,g){var _=C2(v.getAttribute("href")),U=j_(v.getAttribute("title"));if(U)U=' "'+f2(U)+'"';var z,J;switch(g.linkReferenceStyle){case"collapsed":z="["+$+"][]",J="["+$+"]: "+_+U;break;case"shortcut":z="["+$+"]",J="["+$+"]: "+_+U;break;default:var b=this.references.length+1;z="["+$+"]["+b+"]",J="["+b+"]: "+_+U}return this.references.push(J),z},references:[],append:function($){var v="";if(this.references.length)v=`
90
90
 
91
91
  `+this.references.join(`
92
92
  `)+`
93
93
 
94
- `,this.references=[];return v}};Gv.emphasis={filter:["em","i"],replacement:function($,v,g){if(!$.trim())return"";return g.emDelimiter+$+g.emDelimiter}};Gv.strong={filter:["strong","b"],replacement:function($,v,g){if(!$.trim())return"";return g.strongDelimiter+$+g.strongDelimiter}};Gv.code={filter:function($){var v=$.previousSibling||$.nextSibling,g=$.parentNode.nodeName==="PRE"&&!v;return $.nodeName==="CODE"&&!g},replacement:function($){if(!$)return"";$=$.replace(/\r?\n|\r/g," ");var v=/^`|^ .*?[^ ].* $|`$/.test($)?" ":"",g="`",_=$.match(/`+/gm)||[];while(_.indexOf(g)!==-1)g=g+"`";return g+v+$+v+g}};Gv.image={filter:"img",replacement:function($,v){var g=m3(N_(v.getAttribute("alt"))),_=u2(v.getAttribute("src")||""),U=N_(v.getAttribute("title")),z=U?' "'+R2(U)+'"':"";return _?"!["+g+"]("+_+z+")":""}};function N_($){return $?$.replace(/(\n+\s*)+/g,`
95
- `):""}function u2($){var v=$.replace(/([<>()])/g,"\\$1");return v.indexOf(" ")>=0?"<"+v+">":v}function R2($){return $.replace(/"/g,"\\\"")}function E3($){this.options=$,this._keep=[],this._remove=[],this.blankRule={replacement:$.blankReplacement},this.keepReplacement=$.keepReplacement,this.defaultRule={replacement:$.defaultReplacement},this.array=[];for(var v in $.rules)this.array.push($.rules[v])}E3.prototype={add:function($,v){this.array.unshift(v)},keep:function($){this._keep.unshift({filter:$,replacement:this.keepReplacement})},remove:function($){this._remove.unshift({filter:$,replacement:function(){return""}})},forNode:function($){if($.isBlank)return this.blankRule;var v;if(v=Z2(this.array,$,this.options))return v;if(v=Z2(this._keep,$,this.options))return v;if(v=Z2(this._remove,$,this.options))return v;return this.defaultRule},forEach:function($){for(var v=0;v<this.array.length;v++)$(this.array[v],v)}};function Z2($,v,g){for(var _=0;_<$.length;_++){var U=$[_];if(UI(U,v,g))return U}return}function UI($,v,g){var _=$.filter;if(typeof _==="string"){if(_===v.nodeName.toLowerCase())return!0}else if(Array.isArray(_)){if(_.indexOf(v.nodeName.toLowerCase())>-1)return!0}else if(typeof _==="function"){if(_.call($,v,g))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}function gI($){var{element:v,isBlock:g,isVoid:_}=$,U=$.isPre||function(B){return B.nodeName==="PRE"};if(!v.firstChild||U(v))return;var z=null,b=!1,J=null,G=u3(J,v,U);while(G!==v){if(G.nodeType===3||G.nodeType===4){var K=G.data.replace(/[ \r\n\t]+/g," ");if((!z||/ $/.test(z.data))&&!b&&K[0]===" ")K=K.substr(1);if(!K){G=S2(G);continue}G.data=K,z=G}else if(G.nodeType===1){if(g(G)||G.nodeName==="BR"){if(z)z.data=z.data.replace(/ $/,"");z=null,b=!1}else if(_(G)||U(G))z=null,b=!0;else if(z)b=!1}else{G=S2(G);continue}var W=u3(J,G,U);J=G,G=W}if(z){if(z.data=z.data.replace(/ $/,""),!z.data)S2(z)}}function S2($){var v=$.nextSibling||$.parentNode;return $.parentNode.removeChild($),v}function u3($,v,g){if($&&$.parentNode===v||g(v))return v.nextSibling||v.parentNode;return v.firstChild||v.nextSibling||v.parentNode}var y2=typeof window<"u"?window:{};function _I(){var $=y2.DOMParser,v=!1;try{if(new $().parseFromString("","text/html"))v=!0}catch(g){}return v}function zI(){var $=function(){};if(bI())$.prototype.parseFromString=function(v){var g=new window.ActiveXObject("htmlfile");return g.designMode="on",g.open(),g.write(v),g.close(),g};else $.prototype.parseFromString=function(v){var g=document.implementation.createHTMLDocument("");return g.open(),g.write(v),g.close(),g};return $}function bI(){var $=!1;try{document.implementation.createHTMLDocument("").open()}catch(v){if(y2.ActiveXObject)$=!0}return $}var JI=_I()?y2.DOMParser:zI();function OI($,v){var g;if(typeof $==="string"){var _=GI().parseFromString('<x-turndown id="turndown-root">'+$+"</x-turndown>","text/html");g=_.getElementById("turndown-root")}else g=$.cloneNode(!0);return gI({element:g,isBlock:N2,isVoid:V3,isPre:v.preformattedCode?KI:null}),g}var M2;function GI(){return M2=M2||new JI,M2}function KI($){return $.nodeName==="PRE"||$.nodeName==="CODE"}function WI($,v){return $.isBlock=N2($),$.isCode=$.nodeName==="CODE"||$.parentNode.isCode,$.isBlank=BI($),$.flankingWhitespace=PI($,v),$}function BI($){return!V3($)&&!ek($)&&/^\s*$/i.test($.textContent)&&!sk($)&&!$I($)}function PI($,v){if($.isBlock||v.preformattedCode&&$.isCode)return{leading:"",trailing:""};var g=kI($.textContent);if(g.leadingAscii&&R3("left",$,v))g.leading=g.leadingNonAscii;if(g.trailingAscii&&R3("right",$,v))g.trailing=g.trailingNonAscii;return{leading:g.leading,trailing:g.trailing}}function kI($){var v=$.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:v[1],leadingAscii:v[2],leadingNonAscii:v[3],trailing:v[4],trailingNonAscii:v[5],trailingAscii:v[6]}}function R3($,v,g){var _,U,z;if($==="left")_=v.previousSibling,U=/ $/;else _=v.nextSibling,U=/^ /;if(_){if(_.nodeType===3)z=U.test(_.nodeValue);else if(g.preformattedCode&&_.nodeName==="CODE")z=!1;else if(_.nodeType===1&&!N2(_))z=U.test(_.textContent)}return z}var II=Array.prototype.reduce;function QU($){if(!(this instanceof QU))return new QU($);var v={rules:Gv,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(g,_){return _.isBlock?`
94
+ `,this.references=[];return v}};Gv.emphasis={filter:["em","i"],replacement:function($,v,g){if(!$.trim())return"";return g.emDelimiter+$+g.emDelimiter}};Gv.strong={filter:["strong","b"],replacement:function($,v,g){if(!$.trim())return"";return g.strongDelimiter+$+g.strongDelimiter}};Gv.code={filter:function($){var v=$.previousSibling||$.nextSibling,g=$.parentNode.nodeName==="PRE"&&!v;return $.nodeName==="CODE"&&!g},replacement:function($){if(!$)return"";$=$.replace(/\r?\n|\r/g," ");var v=/^`|^ .*?[^ ].* $|`$/.test($)?" ":"",g="`",_=$.match(/`+/gm)||[];while(_.indexOf(g)!==-1)g=g+"`";return g+v+$+v+g}};Gv.image={filter:"img",replacement:function($,v){var g=xK(j_(v.getAttribute("alt"))),_=C2(v.getAttribute("src")||""),U=j_(v.getAttribute("title")),z=U?' "'+f2(U)+'"':"";return _?"!["+g+"]("+_+z+")":""}};function j_($){return $?$.replace(/(\n+\s*)+/g,`
95
+ `):""}function C2($){var v=$.replace(/([<>()])/g,"\\$1");return v.indexOf(" ")>=0?"<"+v+">":v}function f2($){return $.replace(/"/g,"\\\"")}function pK($){this.options=$,this._keep=[],this._remove=[],this.blankRule={replacement:$.blankReplacement},this.keepReplacement=$.keepReplacement,this.defaultRule={replacement:$.defaultReplacement},this.array=[];for(var v in $.rules)this.array.push($.rules[v])}pK.prototype={add:function($,v){this.array.unshift(v)},keep:function($){this._keep.unshift({filter:$,replacement:this.keepReplacement})},remove:function($){this._remove.unshift({filter:$,replacement:function(){return""}})},forNode:function($){if($.isBlank)return this.blankRule;var v;if(v=y2(this.array,$,this.options))return v;if(v=y2(this._keep,$,this.options))return v;if(v=y2(this._remove,$,this.options))return v;return this.defaultRule},forEach:function($){for(var v=0;v<this.array.length;v++)$(this.array[v],v)}};function y2($,v,g){for(var _=0;_<$.length;_++){var U=$[_];if(GH(U,v,g))return U}return}function GH($,v,g){var _=$.filter;if(typeof _==="string"){if(_===v.nodeName.toLowerCase())return!0}else if(Array.isArray(_)){if(_.indexOf(v.nodeName.toLowerCase())>-1)return!0}else if(typeof _==="function"){if(_.call($,v,g))return!0}else throw TypeError("`filter` needs to be a string, array, or function")}function KH($){var{element:v,isBlock:g,isVoid:_}=$,U=$.isPre||function(B){return B.nodeName==="PRE"};if(!v.firstChild||U(v))return;var z=null,J=!1,b=null,G=VK(b,v,U);while(G!==v){if(G.nodeType===3||G.nodeType===4){var K=G.data.replace(/[ \r\n\t]+/g," ");if((!z||/ $/.test(z.data))&&!J&&K[0]===" ")K=K.substr(1);if(!K){G=R2(G);continue}G.data=K,z=G}else if(G.nodeType===1){if(g(G)||G.nodeName==="BR"){if(z)z.data=z.data.replace(/ $/,"");z=null,J=!1}else if(_(G)||U(G))z=null,J=!0;else if(z)J=!1}else{G=R2(G);continue}var W=VK(b,G,U);b=G,G=W}if(z){if(z.data=z.data.replace(/ $/,""),!z.data)R2(z)}}function R2($){var v=$.nextSibling||$.parentNode;return $.parentNode.removeChild($),v}function VK($,v,g){if($&&$.parentNode===v||g(v))return v.nextSibling||v.parentNode;return v.firstChild||v.nextSibling||v.parentNode}var E2=typeof window<"u"?window:{};function WH(){var $=E2.DOMParser,v=!1;try{if(new $().parseFromString("","text/html"))v=!0}catch(g){}return v}function BH(){var $=function(){};if(PH())$.prototype.parseFromString=function(v){var g=new window.ActiveXObject("htmlfile");return g.designMode="on",g.open(),g.write(v),g.close(),g};else $.prototype.parseFromString=function(v){var g=document.implementation.createHTMLDocument("");return g.open(),g.write(v),g.close(),g};return $}function PH(){var $=!1;try{document.implementation.createHTMLDocument("").open()}catch(v){if(E2.ActiveXObject)$=!0}return $}var kH=WH()?E2.DOMParser:BH();function HH($,v){var g;if(typeof $==="string"){var _=IH().parseFromString('<x-turndown id="turndown-root">'+$+"</x-turndown>","text/html");g=_.getElementById("turndown-root")}else g=$.cloneNode(!0);return KH({element:g,isBlock:j2,isVoid:iK,isPre:v.preformattedCode?LH:null}),g}var D2;function IH(){return D2=D2||new kH,D2}function LH($){return $.nodeName==="PRE"||$.nodeName==="CODE"}function FH($,v){return $.isBlock=j2($),$.isCode=$.nodeName==="CODE"||$.parentNode.isCode,$.isBlank=YH($),$.flankingWhitespace=qH($,v),$}function YH($){return!iK($)&&!JH($)&&/^\s*$/i.test($.textContent)&&!zH($)&&!bH($)}function qH($,v){if($.isBlock||v.preformattedCode&&$.isCode)return{leading:"",trailing:""};var g=XH($.textContent);if(g.leadingAscii&&CK("left",$,v))g.leading=g.leadingNonAscii;if(g.trailingAscii&&CK("right",$,v))g.trailing=g.trailingNonAscii;return{leading:g.leading,trailing:g.trailing}}function XH($){var v=$.match(/^(([ \t\r\n]*)(\s*))(?:(?=\S)[\s\S]*\S)?((\s*?)([ \t\r\n]*))$/);return{leading:v[1],leadingAscii:v[2],leadingNonAscii:v[3],trailing:v[4],trailingNonAscii:v[5],trailingAscii:v[6]}}function CK($,v,g){var _,U,z;if($==="left")_=v.previousSibling,U=/ $/;else _=v.nextSibling,U=/^ /;if(_){if(_.nodeType===3)z=U.test(_.nodeValue);else if(g.preformattedCode&&_.nodeName==="CODE")z=!1;else if(_.nodeType===1&&!j2(_))z=U.test(_.textContent)}return z}var AH=Array.prototype.reduce;function RU($){if(!(this instanceof RU))return new RU($);var v={rules:Gv,headingStyle:"setext",hr:"* * *",bulletListMarker:"*",codeBlockStyle:"indented",fence:"```",emDelimiter:"_",strongDelimiter:"**",linkStyle:"inlined",linkReferenceStyle:"full",br:" ",preformattedCode:!1,blankReplacement:function(g,_){return _.isBlock?`
96
96
 
97
97
  `:""},keepReplacement:function(g,_){return _.isBlock?`
98
98
 
@@ -102,54 +102,54 @@ ${U}
102
102
 
103
103
  `+g+`
104
104
 
105
- `:g}};this.options=dk({},v,$),this.rules=new E3(this.options)}QU.prototype={turndown:function($){if(!FI($))throw TypeError($+" is not a string, or an element/document/fragment node.");if($==="")return"";var v=c3.call(this,new OI($,this.options));return HI.call(this,v)},use:function($){if(Array.isArray($))for(var v=0;v<$.length;v++)this.use($[v]);else if(typeof $==="function")$(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function($,v){return this.rules.add($,v),this},keep:function($){return this.rules.keep($),this},remove:function($){return this.rules.remove($),this},escape:function($){return m3($)}};function c3($){var v=this;return II.call($.childNodes,function(g,_){_=new WI(_,v.options);var U="";if(_.nodeType===3)U=_.isCode?_.nodeValue:v.escape(_.nodeValue);else if(_.nodeType===1)U=LI.call(v,_);return i3(g,U)},"")}function HI($){var v=this;return this.rules.forEach(function(g){if(typeof g.append==="function")$=i3($,g.append(v.options))}),$.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function LI($){var v=this.rules.forNode($),g=c3.call(this,$),_=$.flankingWhitespace;if(_.leading||_.trailing)g=g.trim();return _.leading+v.replacement(g,$,this.options)+_.trailing}function i3($,v){var g=D3($),_=y3(v),U=Math.max($.length-g.length,v.length-_.length),z=`
105
+ `:g}};this.options=gH({},v,$),this.rules=new pK(this.options)}RU.prototype={turndown:function($){if(!SH($))throw TypeError($+" is not a string, or an element/document/fragment node.");if($==="")return"";var v=oK.call(this,new HH($,this.options));return wH.call(this,v)},use:function($){if(Array.isArray($))for(var v=0;v<$.length;v++)this.use($[v]);else if(typeof $==="function")$(this);else throw TypeError("plugin must be a Function or an Array of Functions");return this},addRule:function($,v){return this.rules.add($,v),this},keep:function($){return this.rules.keep($),this},remove:function($){return this.rules.remove($),this},escape:function($){return xK($)}};function oK($){var v=this;return AH.call($.childNodes,function(g,_){_=new FH(_,v.options);var U="";if(_.nodeType===3)U=_.isCode?_.nodeValue:v.escape(_.nodeValue);else if(_.nodeType===1)U=ZH.call(v,_);return nK(g,U)},"")}function wH($){var v=this;return this.rules.forEach(function(g){if(typeof g.append==="function")$=nK($,g.append(v.options))}),$.replace(/^[\t\r\n]+/,"").replace(/[\t\r\n\s]+$/,"")}function ZH($){var v=this.rules.forNode($),g=oK.call(this,$),_=$.flankingWhitespace;if(_.leading||_.trailing)g=g.trim();return _.leading+v.replacement(g,$,this.options)+_.trailing}function nK($,v){var g=EK($),_=fK(v),U=Math.max($.length-g.length,v.length-_.length),z=`
106
106
 
107
- `.substring(0,U);return g+z+_}function FI($){return $!=null&&(typeof $==="string"||$.nodeType&&($.nodeType===1||$.nodeType===9||$.nodeType===11))}function r_(){let $=window.prompt("Link URL:");if(!$)return;let v=$.trim().toLowerCase();if(v.startsWith("javascript:")||v.startsWith("data:"))return;document.execCommand("createLink",!1,$)}function l3(){let $=window.getSelection();if(!$||$.rangeCount===0)return;let v=$.getRangeAt(0);if(v.collapsed)return;let g=v.toString(),_=document.createElement("code");_.textContent=g,v.deleteContents(),v.insertNode(_);let U=document.createRange();U.setStartAfter(_),U.setEndAfter(_),$.removeAllRanges(),$.addRange(U)}var u_=8,YI=[{kind:"exec",command:"bold",icon:"B",title:"Bold (⌘B)"},{kind:"exec",command:"italic",icon:"I",title:"Italic (⌘I)"},{kind:"exec",command:"strikeThrough",icon:"S",title:"Strikethrough"},{kind:"code",icon:"{ }",title:"Inline code",dividerBefore:!0},{kind:"block",tag:"H1",icon:"H1",title:"Heading 1",dividerBefore:!0},{kind:"block",tag:"H2",icon:"H2",title:"Heading 2"},{kind:"block",tag:"H3",icon:"H3",title:"Heading 3"},{kind:"block",tag:"P",icon:"¶",title:"Paragraph"},{kind:"block",tag:"BLOCKQUOTE",icon:"❝",title:"Quote",dividerBefore:!0},{kind:"exec",command:"insertUnorderedList",icon:"•",title:"Bullet list"},{kind:"exec",command:"insertOrderedList",icon:"1.",title:"Numbered list"},{kind:"link",icon:"\uD83D\uDD17",title:"Link (⌘K)",dividerBefore:!0}];function AI($){switch($.kind){case"exec":document.execCommand($.command);return;case"block":document.execCommand("formatBlock",!1,$.tag);return;case"code":l3();return;case"link":r_();return}}function h3({hostRef:$,onChange:v}){let[g,_]=x(!1),[U,z]=x({top:0,left:0}),[b,J]=x(0),G=V(null),K=V(null),W=N(()=>{let P=$.current;if(!P){_(!1);return}let A=window.getSelection();if(!A||A.rangeCount===0||A.isCollapsed){_(!1);return}let H=A.getRangeAt(0);if(!P.contains(H.commonAncestorContainer)){_(!1);return}let I=H.getBoundingClientRect();if(I.width===0&&I.height===0){_(!1);return}let F=b||420,Y=Math.max(u_,Math.min(I.left+I.width/2-F/2,window.innerWidth-F-u_)),X=Math.max(u_,I.top-u_-36);z({top:X,left:Y}),_(!0)},[$,b]),B=N(()=>{if(K.current!==null)return;K.current=requestAnimationFrame(()=>{K.current=null,W()})},[W]);m(()=>{return document.addEventListener("selectionchange",B),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{if(document.removeEventListener("selectionchange",B),window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B),K.current!==null)cancelAnimationFrame(K.current)}},[B]),xg(()=>{if(!g)return;let P=G.current;if(!P)return;let A=P.getBoundingClientRect().width;if(A&&Math.abs(A-b)>1)J(A)},[g,b]);let k=N((P)=>{AI(P),v(),W()},[v,W]);if(!g)return null;return O("div",{ref:G,class:"md-inline-format-bar",style:{top:`${U.top}px`,left:`${U.left}px`},onMouseDown:(P)=>P.preventDefault(),children:YI.flatMap((P,A)=>{let H=O("button",{type:"button",class:"md-inline-format-btn",title:P.title,onClick:()=>k(P),children:P.icon},`btn-${A}`,!1,void 0,this);return P.dividerBefore?[O("span",{class:"md-inline-format-divider"},`div-${A}`,!1,void 0,this),H]:[H]})},void 0,!1,void 0,this)}var D2=null;function qI(){if(D2)return D2;let $=new QU({headingStyle:"atx",codeBlockStyle:"fenced",emDelimiter:"*",bulletListMarker:"-"});return $.use(x3.gfm),D2=$,$}function p3({initialHtml:$,className:v,onChange:g,onSave:_}){let U=V(null),z=V($);m(()=>{let B=U.current;if(!B)return;B.innerHTML=z.current},[]);let b=N(()=>{let B=U.current;if(!B)return"";return qI().turndown(B.innerHTML)},[]),J=N(()=>{g(b())},[g,b]),G=N(()=>{_?.(b())},[_,b]),K=N((B)=>{if(!(B.metaKey||B.ctrlKey))return;if(B.key==="s"){B.preventDefault(),G();return}if(B.key==="b"){B.preventDefault(),document.execCommand("bold"),J();return}if(B.key==="i"){B.preventDefault(),document.execCommand("italic"),J();return}if(B.key==="k")B.preventDefault(),r_(),J()},[J,G]),W=N((B)=>{let k=B.clipboardData?.getData("text/plain");if(k==null)return;B.preventDefault(),document.execCommand("insertText",!1,k),J()},[J]);return O(e$,{children:[O("div",{ref:U,class:v,contentEditable:!0,spellcheck:!1,onInput:J,onKeyDown:K,onPaste:W,onBlur:G},void 0,!1,void 0,this),O(h3,{hostRef:U,onChange:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function T2({html:$,className:v,style:g}){let _=V(null);return m(()=>{let U=_.current;if(!U)return;if(U.replaceChildren(),!$)return;let z=document.createElement("template");z.innerHTML=$,U.append(z.content.cloneNode(!0))},[$]),O("div",{ref:_,class:v,style:g},void 0,!1,void 0,this)}function R_({node:$,expanded:v=!1}){let g=$.data.path,[_,U]=x(""),[z,b]=x(""),[J,G]=x(!1),[K,W]=x(!1),[B,k]=x(!1),[P,A]=x(!1),H=V(null),I=V(null),F=V(""),Y=V(null),X=$.data.reviewActive;m(()=>{let R=!1;return(async()=>{let $$;if(g){let c=await qU(g);if(R)return;$$=c.content}else if($.data.content)$$=$.data.content;else{G(!0);return}U($$);let p=await g6($$);if(R)return;b(p),G(!0),U$($.id,{content:$$,rendered:p})})(),()=>{R=!0}},[g,$.id,$.data.content]);let Q=N(async(R)=>{let $$=R.target.value;U($$),A(!0);let p=await g6($$);b(p)},[]),u=N(async(R)=>{if(!g){let p=await g6(R);b(p),A(!1),U$($.id,{content:R,rendered:p}),await wv($.id,{content:R,data:{rendered:p}});return}k(!0);let $$=await IK(g,R);if(k(!1),$$.ok){let p=await g6(R);b(p),A(!1),U$($.id,{content:R,rendered:p,savedAt:$$.updatedAt}),await wv($.id,{content:R,data:{rendered:p,savedAt:$$.updatedAt}})}},[g,$.id]),E=N(async()=>{if(!P)return;await u(_)},[P,_,u]),M=N((R)=>{if((R.metaKey||R.ctrlKey)&&R.key==="s"){R.preventDefault(),E();return}let $$=H.current;if($$&&B3(R,$$))return;if($$&&R.key==="Tab")R.preventDefault(),W3($$,R.shiftKey)},[E]);Y.current=u;let n=N((R)=>{if(U(R),A(!0),F.current=R,I.current!==null)window.clearTimeout(I.current);I.current=window.setTimeout(()=>{I.current=null,u(R)},800)},[u]),t=N((R)=>{if(U(R),F.current=R,I.current!==null)window.clearTimeout(I.current),I.current=null;u(R)},[u]);m(()=>{return()=>{if(I.current===null)return;window.clearTimeout(I.current),I.current=null;let R=Y.current;if(R)R(F.current)}},[$.id]);let r=X?O("div",{style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-ok-10)",color:"var(--c-ok)",borderBottom:"1px solid var(--c-ok-20)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Review active"},void 0,!1,void 0,this):null;if(K&&v)return O("div",{class:"md-editor-expanded",onKeyDown:M,children:[O("div",{class:"md-editor-toolbar",children:[O("button",{type:"button",class:"md-toolbar-btn",onClick:()=>W(!1),children:"← Back to document"},void 0,!1,void 0,this),O("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[g&&O("span",{class:"md-toolbar-path",children:g.split("/").pop()},void 0,!1,void 0,this),O("button",{type:"button",class:`md-toolbar-btn${P?" md-toolbar-btn-primary":""}`,onClick:E,disabled:!P||B,children:B?"Saving…":P?"Save":"Saved"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"md-editor-split",children:[O("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[O("textarea",{ref:H,value:_,onInput:Q,spellcheck:!1},void 0,!1,void 0,this),O(A2,{textareaRef:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(T2,{html:z,className:"md-preview"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(K)return O("div",{class:"md-editor-split",style:{height:"100%"},onKeyDown:M,children:[O("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[O("textarea",{ref:H,value:_,onInput:Q,spellcheck:!1},void 0,!1,void 0,this),O(A2,{textareaRef:H},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(T2,{html:z,className:"md-preview"},void 0,!1,void 0,this),O("div",{style:{position:"absolute",bottom:"8px",right:"8px",display:"flex",gap:"6px"},children:[O("button",{type:"button",onClick:()=>W(!1),style:{padding:"4px 10px",fontSize:"11px",background:"var(--c-input-bg)",border:"1px solid var(--c-line)",borderRadius:"6px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Document"},void 0,!1,void 0,this),O("button",{type:"button",onClick:E,disabled:!P||B,style:{padding:"4px 10px",fontSize:"11px",background:P?"var(--c-accent-25)":"var(--c-input-bg)",border:`1px solid ${P?"var(--c-accent)":"var(--c-line)"}`,borderRadius:"6px",color:P?"var(--c-text)":"var(--c-dim)",cursor:P?"pointer":"default"},children:B?"Saving…":P?"Save":"Saved"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(v)return O("div",{style:{height:"100%",position:"relative"},children:[r,O("div",{class:"md-reader",children:J?O(p3,{initialHtml:z||"<p><br></p>",className:"md-reader-content md-reader-editable",onChange:n,onSave:t},$.id,!1,void 0,this):O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"24px"},children:"Loading…"},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("button",{type:"button",class:"md-edit-fab",onClick:()=>W(!0),children:"</> Source"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("div",{style:{height:"100%",position:"relative"},children:[r,O(T2,{html:z,style:{padding:z?"0":"12px",color:z?void 0:"var(--c-dim)"}},void 0,!1,void 0,this),!J&&O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"Loading…"},void 0,!1,void 0,this),J&&!z&&O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"Empty node"},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>z6($.id),style:{position:"absolute",top:"4px",right:"4px",padding:"3px 8px",fontSize:"10px",background:"var(--c-panel-overlay)",border:"1px solid var(--c-line)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer",opacity:0.7},onMouseEnter:(R)=>{R.target.style.opacity="1"},onMouseLeave:(R)=>{R.target.style.opacity="0.7"},children:"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var o3=37;function XI($){return $.type==="html"||$.type==="json-render"||$.type==="graph"||$.type==="mcp-app"||$.type==="webpage"}function wI($){if($.type==="html")return $.data.presentation!==!0;if($.type==="json-render"||$.type==="graph")return!0;if($.type==="mcp-app")return $.data.viewerType==="web-artifact";return!1}function n3($){return $.collapsed===!0||$.dockPosition!=null||$.data.strictSize===!0||$.data.userResized===!0||$.type==="group"}function j2($){return!n3($)&&!XI($)}function t3($,v){if(!j2($)||v<=0)return null;return Math.min(v+37,600)}function V2($){return wI($)&&!n3($)}function d3($,v){if(!V2($)||v<=0)return null;let g=Math.min(v+37+24,1400);return g>$.size.height+8?g:null}var L={};ev(L,{xor:()=>r7,xid:()=>$7,void:()=>S7,uuidv7:()=>p5,uuidv6:()=>x5,uuidv4:()=>h5,uuid:()=>l5,util:()=>j,url:()=>o5,uppercase:()=>C4,unknown:()=>Q$,union:()=>w$,undefined:()=>w7,ulid:()=>e5,uint64:()=>q7,uint32:()=>F7,tuple:()=>o9,trim:()=>l4,treeifyError:()=>n2,transform:()=>U0,toUpperCase:()=>x4,toLowerCase:()=>h4,toJSONSchema:()=>u1,templateLiteral:()=>E7,symbol:()=>X7,superRefine:()=>YO,success:()=>C7,stringbool:()=>o7,stringFormat:()=>W7,string:()=>S,strictObject:()=>N7,startsWith:()=>m4,slugify:()=>p4,size:()=>s6,setErrorMap:()=>pL,set:()=>D7,safeParseAsync:()=>S9,safeParse:()=>Z9,safeEncodeAsync:()=>y9,safeEncode:()=>u9,safeDecodeAsync:()=>D9,safeDecode:()=>R9,registry:()=>v1,regexes:()=>yv,regex:()=>j4,refine:()=>FO,record:()=>r$,readonly:()=>BO,property:()=>M1,promise:()=>c7,prettifyError:()=>t2,preprocess:()=>Wg,prefault:()=>zO,positive:()=>X1,pipe:()=>gg,partialRecord:()=>u7,parseAsync:()=>w9,parse:()=>X9,overwrite:()=>mv,optional:()=>R$,object:()=>h,number:()=>L$,nullish:()=>V7,nullable:()=>Ug,null:()=>vU,normalize:()=>i4,nonpositive:()=>Z1,nonoptional:()=>bO,nonnegative:()=>S1,never:()=>v0,negative:()=>w1,nativeEnum:()=>T7,nanoid:()=>d5,nan:()=>f7,multipleOf:()=>N6,minSize:()=>dv,minLength:()=>O6,mime:()=>c4,meta:()=>x7,maxSize:()=>r6,maxLength:()=>e6,map:()=>y7,mac:()=>g7,lte:()=>Qv,lt:()=>nv,lowercase:()=>V4,looseRecord:()=>R7,looseObject:()=>Uv,locales:()=>aU,literal:()=>o,length:()=>$4,lazy:()=>IO,ksuid:()=>v7,keyof:()=>Q7,jwt:()=>K7,json:()=>n7,iso:()=>D6,ipv6:()=>_7,ipv4:()=>U7,intersection:()=>UU,int64:()=>A7,int32:()=>L7,int:()=>V1,instanceof:()=>p7,includes:()=>f4,httpUrl:()=>n5,hostname:()=>B7,hex:()=>P7,hash:()=>k7,guid:()=>i5,gte:()=>Iv,gt:()=>tv,globalRegistry:()=>vv,getErrorMap:()=>oL,function:()=>i7,fromJSONSchema:()=>d7,formatError:()=>CU,float64:()=>H7,float32:()=>I7,flattenError:()=>VU,file:()=>j7,exactOptional:()=>$O,enum:()=>gv,endsWith:()=>E4,encodeAsync:()=>N9,encode:()=>M9,emoji:()=>t5,email:()=>c5,e164:()=>G7,discriminatedUnion:()=>Og,describe:()=>h7,decodeAsync:()=>r9,decode:()=>Q9,date:()=>M7,custom:()=>J0,cuid2:()=>s5,cuid:()=>a5,core:()=>G6,config:()=>x$,coerce:()=>qO,codec:()=>m7,clone:()=>kv,cidrv6:()=>b7,cidrv4:()=>z7,check:()=>l7,catch:()=>GO,boolean:()=>p$,bigint:()=>Y7,base64url:()=>O7,base64:()=>J7,array:()=>O$,any:()=>Z7,_function:()=>i7,_default:()=>gO,_ZodString:()=>C1,ZodXor:()=>l9,ZodXID:()=>h1,ZodVoid:()=>c9,ZodUnknown:()=>m9,ZodUnion:()=>Jg,ZodUndefined:()=>V9,ZodUUID:()=>av,ZodURL:()=>_g,ZodULID:()=>l1,ZodType:()=>_$,ZodTuple:()=>p9,ZodTransform:()=>s9,ZodTemplateLiteral:()=>PO,ZodSymbol:()=>j9,ZodSuccess:()=>JO,ZodStringFormat:()=>M$,ZodString:()=>d4,ZodSet:()=>t9,ZodRecord:()=>Gg,ZodRealError:()=>Xv,ZodReadonly:()=>WO,ZodPromise:()=>HO,ZodPrefault:()=>_O,ZodPipe:()=>z0,ZodOptional:()=>g0,ZodObject:()=>bg,ZodNumberFormat:()=>v4,ZodNumber:()=>s4,ZodNullable:()=>vO,ZodNull:()=>C9,ZodNonOptional:()=>_0,ZodNever:()=>E9,ZodNanoID:()=>E1,ZodNaN:()=>KO,ZodMap:()=>n9,ZodMAC:()=>T9,ZodLiteral:()=>d9,ZodLazy:()=>kO,ZodKSUID:()=>x1,ZodJWT:()=>e1,ZodIssueCode:()=>xL,ZodIntersection:()=>x9,ZodISOTime:()=>T1,ZodISODuration:()=>j1,ZodISODateTime:()=>y1,ZodISODate:()=>D1,ZodIPv6:()=>o1,ZodIPv4:()=>p1,ZodGUID:()=>vg,ZodFunction:()=>LO,ZodFirstPartyTypeKind:()=>AO,ZodFile:()=>a9,ZodExactOptional:()=>e9,ZodError:()=>lL,ZodEnum:()=>t4,ZodEmoji:()=>m1,ZodEmail:()=>f1,ZodE164:()=>s1,ZodDiscriminatedUnion:()=>h9,ZodDefault:()=>UO,ZodDate:()=>zg,ZodCustomStringFormat:()=>a4,ZodCustom:()=>Kg,ZodCodec:()=>b0,ZodCatch:()=>OO,ZodCUID2:()=>i1,ZodCUID:()=>c1,ZodCIDRv6:()=>t1,ZodCIDRv4:()=>n1,ZodBoolean:()=>e4,ZodBigIntFormat:()=>$0,ZodBigInt:()=>$U,ZodBase64URL:()=>a1,ZodBase64:()=>d1,ZodArray:()=>i9,ZodAny:()=>f9,TimePrecision:()=>aJ,NEVER:()=>C2,$output:()=>xJ,$input:()=>pJ,$brand:()=>f2});var G6={};ev(G6,{version:()=>iz,util:()=>j,treeifyError:()=>n2,toJSONSchema:()=>u1,toDotPath:()=>U5,safeParseAsync:()=>EU,safeParse:()=>R4,safeEncodeAsync:()=>G5,safeEncode:()=>J5,safeDecodeAsync:()=>K5,safeDecode:()=>O5,registry:()=>v1,regexes:()=>yv,process:()=>q$,prettifyError:()=>t2,parseAsync:()=>mU,parse:()=>fU,meta:()=>R8,locales:()=>aU,isValidJWT:()=>r5,isValidBase64URL:()=>N5,isValidBase64:()=>Kb,initializeContext:()=>u6,globalRegistry:()=>vv,globalConfig:()=>NU,formatError:()=>CU,flattenError:()=>VU,finalize:()=>y6,extractDefs:()=>R6,encodeAsync:()=>z5,encode:()=>g5,describe:()=>u8,decodeAsync:()=>b5,decode:()=>_5,createToJSONSchemaMethod:()=>D8,createStandardJSONSchemaMethod:()=>n4,config:()=>x$,clone:()=>kv,_xor:()=>YL,_xid:()=>B1,_void:()=>q8,_uuidv7:()=>b1,_uuidv6:()=>z1,_uuidv4:()=>_1,_uuid:()=>g1,_url:()=>eU,_uppercase:()=>C4,_unknown:()=>Y8,_union:()=>FL,_undefined:()=>H8,_ulid:()=>W1,_uint64:()=>k8,_uint32:()=>O8,_tuple:()=>XL,_trim:()=>l4,_transform:()=>rL,_toUpperCase:()=>x4,_toLowerCase:()=>h4,_templateLiteral:()=>fL,_symbol:()=>I8,_superRefine:()=>r8,_success:()=>TL,_stringbool:()=>y8,_stringFormat:()=>o4,_string:()=>nJ,_startsWith:()=>m4,_slugify:()=>p4,_size:()=>s6,_set:()=>SL,_safeParseAsync:()=>y4,_safeParse:()=>u4,_safeEncodeAsync:()=>E_,_safeEncode:()=>f_,_safeDecodeAsync:()=>c_,_safeDecode:()=>m_,_regex:()=>j4,_refine:()=>N8,_record:()=>wL,_readonly:()=>CL,_property:()=>M1,_promise:()=>EL,_positive:()=>X1,_pipe:()=>VL,_parseAsync:()=>r4,_parse:()=>N4,_overwrite:()=>mv,_optional:()=>uL,_number:()=>U8,_nullable:()=>RL,_null:()=>L8,_normalize:()=>i4,_nonpositive:()=>Z1,_nonoptional:()=>DL,_nonnegative:()=>S1,_never:()=>A8,_negative:()=>w1,_nativeEnum:()=>QL,_nanoid:()=>O1,_nan:()=>Z8,_multipleOf:()=>N6,_minSize:()=>dv,_minLength:()=>O6,_min:()=>Iv,_mime:()=>c4,_maxSize:()=>r6,_maxLength:()=>e6,_max:()=>Qv,_map:()=>ZL,_mac:()=>dJ,_lte:()=>Qv,_lt:()=>nv,_lowercase:()=>V4,_literal:()=>NL,_length:()=>$4,_lazy:()=>mL,_ksuid:()=>P1,_jwt:()=>q1,_isoTime:()=>$8,_isoDuration:()=>v8,_isoDateTime:()=>sJ,_isoDate:()=>eJ,_ipv6:()=>I1,_ipv4:()=>k1,_intersection:()=>qL,_int64:()=>P8,_int32:()=>J8,_int:()=>_8,_includes:()=>f4,_guid:()=>sU,_gte:()=>Iv,_gt:()=>tv,_float64:()=>b8,_float32:()=>z8,_file:()=>M8,_enum:()=>ML,_endsWith:()=>E4,_encodeAsync:()=>V_,_encode:()=>T_,_emoji:()=>J1,_email:()=>U1,_e164:()=>A1,_discriminatedUnion:()=>AL,_default:()=>yL,_decodeAsync:()=>C_,_decode:()=>j_,_date:()=>X8,_custom:()=>Q8,_cuid2:()=>K1,_cuid:()=>G1,_coercedString:()=>tJ,_coercedNumber:()=>g8,_coercedDate:()=>w8,_coercedBoolean:()=>K8,_coercedBigint:()=>B8,_cidrv6:()=>L1,_cidrv4:()=>H1,_check:()=>f5,_catch:()=>jL,_boolean:()=>G8,_bigint:()=>W8,_base64url:()=>Y1,_base64:()=>F1,_array:()=>S8,_any:()=>F8,TimePrecision:()=>aJ,NEVER:()=>C2,JSONSchemaGenerator:()=>L9,JSONSchema:()=>m5,Doc:()=>x_,$output:()=>xJ,$input:()=>pJ,$constructor:()=>q,$brand:()=>f2,$ZodXor:()=>Nb,$ZodXID:()=>ez,$ZodVoid:()=>Zb,$ZodUnknown:()=>Xb,$ZodUnion:()=>xU,$ZodUndefined:()=>Yb,$ZodUUID:()=>xz,$ZodURL:()=>oz,$ZodULID:()=>sz,$ZodType:()=>v$,$ZodTuple:()=>e_,$ZodTransform:()=>Cb,$ZodTemplateLiteral:()=>nb,$ZodSymbol:()=>Fb,$ZodSuccess:()=>lb,$ZodStringFormat:()=>S$,$ZodString:()=>a6,$ZodSet:()=>Db,$ZodRegistry:()=>oJ,$ZodRecord:()=>Rb,$ZodRealError:()=>qv,$ZodReadonly:()=>ob,$ZodPromise:()=>db,$ZodPrefault:()=>cb,$ZodPipe:()=>pb,$ZodOptional:()=>$1,$ZodObjectJIT:()=>Qb,$ZodObject:()=>y5,$ZodNumberFormat:()=>Hb,$ZodNumber:()=>a_,$ZodNullable:()=>mb,$ZodNull:()=>Ab,$ZodNonOptional:()=>ib,$ZodNever:()=>wb,$ZodNanoID:()=>tz,$ZodNaN:()=>xb,$ZodMap:()=>yb,$ZodMAC:()=>Jb,$ZodLiteral:()=>jb,$ZodLazy:()=>ab,$ZodKSUID:()=>$b,$ZodJWT:()=>kb,$ZodIntersection:()=>ub,$ZodISOTime:()=>gb,$ZodISODuration:()=>_b,$ZodISODateTime:()=>vb,$ZodISODate:()=>Ub,$ZodIPv6:()=>bb,$ZodIPv4:()=>zb,$ZodGUID:()=>hz,$ZodFunction:()=>tb,$ZodFile:()=>Vb,$ZodExactOptional:()=>fb,$ZodError:()=>jU,$ZodEnum:()=>Tb,$ZodEncodeError:()=>n6,$ZodEmoji:()=>nz,$ZodEmail:()=>pz,$ZodE164:()=>Pb,$ZodDiscriminatedUnion:()=>rb,$ZodDefault:()=>Eb,$ZodDate:()=>Sb,$ZodCustomStringFormat:()=>Ib,$ZodCustom:()=>sb,$ZodCodec:()=>pU,$ZodCheckUpperCase:()=>jz,$ZodCheckStringFormat:()=>D4,$ZodCheckStartsWith:()=>Cz,$ZodCheckSizeEquals:()=>rz,$ZodCheckRegex:()=>Dz,$ZodCheckProperty:()=>mz,$ZodCheckOverwrite:()=>cz,$ZodCheckNumberFormat:()=>Sz,$ZodCheckMultipleOf:()=>Zz,$ZodCheckMinSize:()=>Nz,$ZodCheckMinLength:()=>Rz,$ZodCheckMimeType:()=>Ez,$ZodCheckMaxSize:()=>Qz,$ZodCheckMaxLength:()=>uz,$ZodCheckLowerCase:()=>Tz,$ZodCheckLessThan:()=>l_,$ZodCheckLengthEquals:()=>yz,$ZodCheckIncludes:()=>Vz,$ZodCheckGreaterThan:()=>h_,$ZodCheckEndsWith:()=>fz,$ZodCheckBigIntFormat:()=>Mz,$ZodCheck:()=>N$,$ZodCatch:()=>hb,$ZodCUID2:()=>az,$ZodCUID:()=>dz,$ZodCIDRv6:()=>Gb,$ZodCIDRv4:()=>Ob,$ZodBoolean:()=>hU,$ZodBigIntFormat:()=>Lb,$ZodBigInt:()=>s_,$ZodBase64URL:()=>Bb,$ZodBase64:()=>Wb,$ZodAsyncError:()=>ov,$ZodArray:()=>Mb,$ZodAny:()=>qb});var C2=Object.freeze({status:"aborted"});function q($,v,g){function _(J,G){if(!J._zod)Object.defineProperty(J,"_zod",{value:{def:G,constr:b,traits:new Set},enumerable:!1});if(J._zod.traits.has($))return;J._zod.traits.add($),v(J,G);let K=b.prototype,W=Object.keys(K);for(let B=0;B<W.length;B++){let k=W[B];if(!(k in J))J[k]=K[k].bind(J)}}let U=g?.Parent??Object;class z extends U{}Object.defineProperty(z,"name",{value:$});function b(J){var G;let K=g?.Parent?new z:this;_(K,J),(G=K._zod).deferred??(G.deferred=[]);for(let W of K._zod.deferred)W();return K}return Object.defineProperty(b,"init",{value:_}),Object.defineProperty(b,Symbol.hasInstance,{value:(J)=>{if(g?.Parent&&J instanceof g.Parent)return!0;return J?._zod?.traits?.has($)}}),Object.defineProperty(b,"name",{value:$}),b}var f2=Symbol("zod_brand");class ov extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class n6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var NU={};function x$($){if($)Object.assign(NU,$);return NU}var j={};ev(j,{unwrapMessage:()=>rU,uint8ArrayToHex:()=>nI,uint8ArrayToBase64url:()=>pI,uint8ArrayToBase64:()=>e3,stringifyPrimitive:()=>y,slugify:()=>c2,shallowClone:()=>l2,safeExtend:()=>EI,required:()=>lI,randomString:()=>DI,propertyKeyTypes:()=>yU,promiseAllObject:()=>yI,primitiveTypes:()=>h2,prefixIssues:()=>Mv,pick:()=>CI,partial:()=>iI,parsedType:()=>D,optionalKeys:()=>x2,omit:()=>fI,objectClone:()=>rI,numKeys:()=>TI,nullish:()=>Z6,normalizeParams:()=>C,mergeDefs:()=>J6,merge:()=>cI,jsonStringifyReplacer:()=>S4,joinValues:()=>Z,issue:()=>Q4,isPlainObject:()=>M6,isObject:()=>t6,hexToUint8Array:()=>oI,getSizableOrigin:()=>DU,getParsedType:()=>jI,getLengthableOrigin:()=>TU,getEnumValues:()=>uU,getElementAtPath:()=>RI,floatSafeRemainder:()=>E2,finalizeIssue:()=>Av,extend:()=>mI,escapeRegex:()=>Rv,esc:()=>y_,defineLazy:()=>J$,createTransparentProxy:()=>VI,cloneDef:()=>uI,clone:()=>kv,cleanRegex:()=>RU,cleanEnum:()=>hI,captureStackTrace:()=>D_,cached:()=>M4,base64urlToUint8Array:()=>xI,base64ToUint8Array:()=>s3,assignProp:()=>S6,assertNotEqual:()=>SI,assertNever:()=>QI,assertIs:()=>MI,assertEqual:()=>ZI,assert:()=>NI,allowsEval:()=>i2,aborted:()=>Q6,NUMBER_FORMAT_RANGES:()=>p2,Class:()=>$5,BIGINT_FORMAT_RANGES:()=>o2});function ZI($){return $}function SI($){return $}function MI($){}function QI($){throw Error("Unexpected value in exhaustive check")}function NI($){}function uU($){let v=Object.values($).filter((_)=>typeof _==="number");return Object.entries($).filter(([_,U])=>v.indexOf(+_)===-1).map(([_,U])=>U)}function Z($,v="|"){return $.map((g)=>y(g)).join(v)}function S4($,v){if(typeof v==="bigint")return v.toString();return v}function M4($){return{get value(){{let g=$();return Object.defineProperty(this,"value",{value:g}),g}throw Error("cached value already set")}}}function Z6($){return $===null||$===void 0}function RU($){let v=$.startsWith("^")?1:0,g=$.endsWith("$")?$.length-1:$.length;return $.slice(v,g)}function E2($,v){let g=($.toString().split(".")[1]||"").length,_=v.toString(),U=(_.split(".")[1]||"").length;if(U===0&&/\d?e-\d?/.test(_)){let G=_.match(/\d?e-(\d?)/);if(G?.[1])U=Number.parseInt(G[1])}let z=g>U?g:U,b=Number.parseInt($.toFixed(z).replace(".","")),J=Number.parseInt(v.toFixed(z).replace(".",""));return b%J/10**z}var a3=Symbol("evaluating");function J$($,v,g){let _=void 0;Object.defineProperty($,v,{get(){if(_===a3)return;if(_===void 0)_=a3,_=g();return _},set(U){Object.defineProperty($,v,{value:U})},configurable:!0})}function rI($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function S6($,v,g){Object.defineProperty($,v,{value:g,writable:!0,enumerable:!0,configurable:!0})}function J6(...$){let v={};for(let g of $){let _=Object.getOwnPropertyDescriptors(g);Object.assign(v,_)}return Object.defineProperties({},v)}function uI($){return J6($._zod.def)}function RI($,v){if(!v)return $;return v.reduce((g,_)=>g?.[_],$)}function yI($){let v=Object.keys($),g=v.map((_)=>$[_]);return Promise.all(g).then((_)=>{let U={};for(let z=0;z<v.length;z++)U[v[z]]=_[z];return U})}function DI($=10){let g="";for(let _=0;_<$;_++)g+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return g}function y_($){return JSON.stringify($)}function c2($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var D_="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function t6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var i2=M4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function M6($){if(t6($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let g=v.prototype;if(t6(g)===!1)return!1;if(Object.prototype.hasOwnProperty.call(g,"isPrototypeOf")===!1)return!1;return!0}function l2($){if(M6($))return{...$};if(Array.isArray($))return[...$];return $}function TI($){let v=0;for(let g in $)if(Object.prototype.hasOwnProperty.call($,g))v++;return v}var jI=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},yU=new Set(["string","number","symbol"]),h2=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Rv($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kv($,v,g){let _=new $._zod.constr(v??$._zod.def);if(!v||g?.parent)_._zod.parent=$;return _}function C($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function VI($){let v;return new Proxy({},{get(g,_,U){return v??(v=$()),Reflect.get(v,_,U)},set(g,_,U,z){return v??(v=$()),Reflect.set(v,_,U,z)},has(g,_){return v??(v=$()),Reflect.has(v,_)},deleteProperty(g,_){return v??(v=$()),Reflect.deleteProperty(v,_)},ownKeys(g){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(g,_){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,_)},defineProperty(g,_,U){return v??(v=$()),Reflect.defineProperty(v,_,U)}})}function y($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function x2($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var p2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},o2={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function CI($,v){let g=$._zod.def,_=g.checks;if(_&&_.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let z=J6($._zod.def,{get shape(){let b={};for(let J in v){if(!(J in g.shape))throw Error(`Unrecognized key: "${J}"`);if(!v[J])continue;b[J]=g.shape[J]}return S6(this,"shape",b),b},checks:[]});return kv($,z)}function fI($,v){let g=$._zod.def,_=g.checks;if(_&&_.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let z=J6($._zod.def,{get shape(){let b={...$._zod.def.shape};for(let J in v){if(!(J in g.shape))throw Error(`Unrecognized key: "${J}"`);if(!v[J])continue;delete b[J]}return S6(this,"shape",b),b},checks:[]});return kv($,z)}function mI($,v){if(!M6(v))throw Error("Invalid input to extend: expected a plain object");let g=$._zod.def.checks;if(g&&g.length>0){let z=$._zod.def.shape;for(let b in v)if(Object.getOwnPropertyDescriptor(z,b)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=J6($._zod.def,{get shape(){let z={...$._zod.def.shape,...v};return S6(this,"shape",z),z}});return kv($,U)}function EI($,v){if(!M6(v))throw Error("Invalid input to safeExtend: expected a plain object");let g=J6($._zod.def,{get shape(){let _={...$._zod.def.shape,...v};return S6(this,"shape",_),_}});return kv($,g)}function cI($,v){let g=J6($._zod.def,{get shape(){let _={...$._zod.def.shape,...v._zod.def.shape};return S6(this,"shape",_),_},get catchall(){return v._zod.def.catchall},checks:[]});return kv($,g)}function iI($,v,g){let U=v._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let b=J6(v._zod.def,{get shape(){let J=v._zod.def.shape,G={...J};if(g)for(let K in g){if(!(K in J))throw Error(`Unrecognized key: "${K}"`);if(!g[K])continue;G[K]=$?new $({type:"optional",innerType:J[K]}):J[K]}else for(let K in J)G[K]=$?new $({type:"optional",innerType:J[K]}):J[K];return S6(this,"shape",G),G},checks:[]});return kv(v,b)}function lI($,v,g){let _=J6(v._zod.def,{get shape(){let U=v._zod.def.shape,z={...U};if(g)for(let b in g){if(!(b in z))throw Error(`Unrecognized key: "${b}"`);if(!g[b])continue;z[b]=new $({type:"nonoptional",innerType:U[b]})}else for(let b in U)z[b]=new $({type:"nonoptional",innerType:U[b]});return S6(this,"shape",z),z}});return kv(v,_)}function Q6($,v=0){if($.aborted===!0)return!0;for(let g=v;g<$.issues.length;g++)if($.issues[g]?.continue!==!0)return!0;return!1}function Mv($,v){return v.map((g)=>{var _;return(_=g).path??(_.path=[]),g.path.unshift($),g})}function rU($){return typeof $==="string"?$:$?.message}function Av($,v,g){let _={...$,path:$.path??[]};if(!$.message){let U=rU($.inst?._zod.def?.error?.($))??rU(v?.error?.($))??rU(g.customError?.($))??rU(g.localeError?.($))??"Invalid input";_.message=U}if(delete _.inst,delete _.continue,!v?.reportInput)delete _.input;return _}function DU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function TU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function D($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let g=$;if(g&&Object.getPrototypeOf(g)!==Object.prototype&&"constructor"in g&&g.constructor)return g.constructor.name}}return v}function Q4(...$){let[v,g,_]=$;if(typeof v==="string")return{message:v,code:"custom",input:g,inst:_};return{...v}}function hI($){return Object.entries($).filter(([v,g])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function s3($){let v=atob($),g=new Uint8Array(v.length);for(let _=0;_<v.length;_++)g[_]=v.charCodeAt(_);return g}function e3($){let v="";for(let g=0;g<$.length;g++)v+=String.fromCharCode($[g]);return btoa(v)}function xI($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),g="=".repeat((4-v.length%4)%4);return s3(v+g)}function pI($){return e3($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function oI($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let g=new Uint8Array(v.length/2);for(let _=0;_<v.length;_+=2)g[_/2]=Number.parseInt(v.slice(_,_+2),16);return g}function nI($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class $5{constructor(...$){}}var v5=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,S4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},jU=q("$ZodError",v5),qv=q("$ZodError",v5,{Parent:Error});function VU($,v=(g)=>g.message){let g={},_=[];for(let U of $.issues)if(U.path.length>0)g[U.path[0]]=g[U.path[0]]||[],g[U.path[0]].push(v(U));else _.push(v(U));return{formErrors:_,fieldErrors:g}}function CU($,v=(g)=>g.message){let g={_errors:[]},_=(U)=>{for(let z of U.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((b)=>_({issues:b}));else if(z.code==="invalid_key")_({issues:z.issues});else if(z.code==="invalid_element")_({issues:z.issues});else if(z.path.length===0)g._errors.push(v(z));else{let b=g,J=0;while(J<z.path.length){let G=z.path[J];if(J!==z.path.length-1)b[G]=b[G]||{_errors:[]};else b[G]=b[G]||{_errors:[]},b[G]._errors.push(v(z));b=b[G],J++}}};return _($),g}function n2($,v=(g)=>g.message){let g={errors:[]},_=(U,z=[])=>{var b,J;for(let G of U.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((K)=>_({issues:K},G.path));else if(G.code==="invalid_key")_({issues:G.issues},G.path);else if(G.code==="invalid_element")_({issues:G.issues},G.path);else{let K=[...z,...G.path];if(K.length===0){g.errors.push(v(G));continue}let W=g,B=0;while(B<K.length){let k=K[B],P=B===K.length-1;if(typeof k==="string")W.properties??(W.properties={}),(b=W.properties)[k]??(b[k]={errors:[]}),W=W.properties[k];else W.items??(W.items=[]),(J=W.items)[k]??(J[k]={errors:[]}),W=W.items[k];if(P)W.errors.push(v(G));B++}}};return _($),g}function U5($){let v=[],g=$.map((_)=>typeof _==="object"?_.key:_);for(let _ of g)if(typeof _==="number")v.push(`[${_}]`);else if(typeof _==="symbol")v.push(`[${JSON.stringify(String(_))}]`);else if(/[^\w$]/.test(_))v.push(`[${JSON.stringify(_)}]`);else{if(v.length)v.push(".");v.push(_)}return v.join("")}function t2($){let v=[],g=[...$.issues].sort((_,U)=>(_.path??[]).length-(U.path??[]).length);for(let _ of g)if(v.push(`✖ ${_.message}`),_.path?.length)v.push(` → at ${U5(_.path)}`);return v.join(`
108
- `)}var N4=($)=>(v,g,_,U)=>{let z=_?Object.assign(_,{async:!1}):{async:!1},b=v._zod.run({value:g,issues:[]},z);if(b instanceof Promise)throw new ov;if(b.issues.length){let J=new(U?.Err??$)(b.issues.map((G)=>Av(G,z,x$())));throw D_(J,U?.callee),J}return b.value},fU=N4(qv),r4=($)=>async(v,g,_,U)=>{let z=_?Object.assign(_,{async:!0}):{async:!0},b=v._zod.run({value:g,issues:[]},z);if(b instanceof Promise)b=await b;if(b.issues.length){let J=new(U?.Err??$)(b.issues.map((G)=>Av(G,z,x$())));throw D_(J,U?.callee),J}return b.value},mU=r4(qv),u4=($)=>(v,g,_)=>{let U=_?{..._,async:!1}:{async:!1},z=v._zod.run({value:g,issues:[]},U);if(z instanceof Promise)throw new ov;return z.issues.length?{success:!1,error:new($??jU)(z.issues.map((b)=>Av(b,U,x$())))}:{success:!0,data:z.value}},R4=u4(qv),y4=($)=>async(v,g,_)=>{let U=_?Object.assign(_,{async:!0}):{async:!0},z=v._zod.run({value:g,issues:[]},U);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((b)=>Av(b,U,x$())))}:{success:!0,data:z.value}},EU=y4(qv),T_=($)=>(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return N4($)(v,g,U)},g5=T_(qv),j_=($)=>(v,g,_)=>{return N4($)(v,g,_)},_5=j_(qv),V_=($)=>async(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return r4($)(v,g,U)},z5=V_(qv),C_=($)=>async(v,g,_)=>{return r4($)(v,g,_)},b5=C_(qv),f_=($)=>(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return u4($)(v,g,U)},J5=f_(qv),m_=($)=>(v,g,_)=>{return u4($)(v,g,_)},O5=m_(qv),E_=($)=>async(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return y4($)(v,g,U)},G5=E_(qv),c_=($)=>async(v,g,_)=>{return y4($)(v,g,_)},K5=c_(qv);var yv={};ev(yv,{xid:()=>e2,uuid7:()=>eI,uuid6:()=>sI,uuid4:()=>aI,uuid:()=>d6,uppercase:()=>wz,unicodeEmail:()=>W5,undefined:()=>qz,ulid:()=>s2,time:()=>kz,string:()=>Hz,sha512_hex:()=>AH,sha512_base64url:()=>XH,sha512_base64:()=>qH,sha384_hex:()=>LH,sha384_base64url:()=>YH,sha384_base64:()=>FH,sha256_hex:()=>kH,sha256_base64url:()=>HH,sha256_base64:()=>IH,sha1_hex:()=>WH,sha1_base64url:()=>PH,sha1_base64:()=>BH,rfc5322Email:()=>vH,number:()=>cU,null:()=>Az,nanoid:()=>vz,md5_hex:()=>OH,md5_base64url:()=>KH,md5_base64:()=>GH,mac:()=>Oz,lowercase:()=>Xz,ksuid:()=>$z,ipv6:()=>Jz,ipv4:()=>bz,integer:()=>Fz,idnEmail:()=>UH,html5Email:()=>$H,hostname:()=>zH,hex:()=>JH,guid:()=>gz,extendedDuration:()=>dI,emoji:()=>zz,email:()=>_z,e164:()=>Bz,duration:()=>Uz,domain:()=>bH,datetime:()=>Iz,date:()=>Pz,cuid2:()=>a2,cuid:()=>d2,cidrv6:()=>Kz,cidrv4:()=>Gz,browserEmail:()=>gH,boolean:()=>Yz,bigint:()=>Lz,base64url:()=>i_,base64:()=>Wz});var d2=/^[cC][^\s-]{8,}$/,a2=/^[0-9a-z]+$/,s2=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,e2=/^[0-9a-vA-V]{20}$/,$z=/^[A-Za-z0-9]{27}$/,vz=/^[a-zA-Z0-9_-]{21}$/,Uz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,dI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,gz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,d6=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},aI=d6(4),sI=d6(6),eI=d6(7),_z=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,$H=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,vH=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,W5=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,UH=W5,gH=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,_H="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function zz(){return new RegExp(_H,"u")}var bz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Oz=($)=>{let v=Rv($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},Gz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Kz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,i_=/^[A-Za-z0-9_-]*$/,zH=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,bH=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Bz=/^\+[1-9]\d{6,14}$/,B5="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Pz=new RegExp(`^${B5}$`);function P5($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function kz($){return new RegExp(`^${P5($)}$`)}function Iz($){let v=P5({precision:$.precision}),g=["Z"];if($.local)g.push("");if($.offset)g.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let _=`${v}(?:${g.join("|")})`;return new RegExp(`^${B5}T(?:${_})$`)}var Hz=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},Lz=/^-?\d+n?$/,Fz=/^-?\d+$/,cU=/^-?\d+(?:\.\d+)?$/,Yz=/^(?:true|false)$/i,Az=/^null$/i;var qz=/^undefined$/i;var Xz=/^[^A-Z]*$/,wz=/^[^a-z]*$/,JH=/^[0-9a-fA-F]*$/;function iU($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function lU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var OH=/^[0-9a-fA-F]{32}$/,GH=iU(22,"=="),KH=lU(22),WH=/^[0-9a-fA-F]{40}$/,BH=iU(27,"="),PH=lU(27),kH=/^[0-9a-fA-F]{64}$/,IH=iU(43,"="),HH=lU(43),LH=/^[0-9a-fA-F]{96}$/,FH=iU(64,""),YH=lU(64),AH=/^[0-9a-fA-F]{128}$/,qH=iU(86,"=="),XH=lU(86);var N$=q("$ZodCheck",($,v)=>{var g;$._zod??($._zod={}),$._zod.def=v,(g=$._zod).onattach??(g.onattach=[])}),I5={number:"number",bigint:"bigint",object:"date"},l_=q("$ZodCheckLessThan",($,v)=>{N$.init($,v);let g=I5[typeof v.value];$._zod.onattach.push((_)=>{let U=_._zod.bag,z=(v.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<z)if(v.inclusive)U.maximum=v.value;else U.exclusiveMaximum=v.value}),$._zod.check=(_)=>{if(v.inclusive?_.value<=v.value:_.value<v.value)return;_.issues.push({origin:g,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:_.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),h_=q("$ZodCheckGreaterThan",($,v)=>{N$.init($,v);let g=I5[typeof v.value];$._zod.onattach.push((_)=>{let U=_._zod.bag,z=(v.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>z)if(v.inclusive)U.minimum=v.value;else U.exclusiveMinimum=v.value}),$._zod.check=(_)=>{if(v.inclusive?_.value>=v.value:_.value>v.value)return;_.issues.push({origin:g,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:_.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),Zz=q("$ZodCheckMultipleOf",($,v)=>{N$.init($,v),$._zod.onattach.push((g)=>{var _;(_=g._zod.bag).multipleOf??(_.multipleOf=v.value)}),$._zod.check=(g)=>{if(typeof g.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof g.value==="bigint"?g.value%v.value===BigInt(0):E2(g.value,v.value)===0)return;g.issues.push({origin:typeof g.value,code:"not_multiple_of",divisor:v.value,input:g.value,inst:$,continue:!v.abort})}}),Sz=q("$ZodCheckNumberFormat",($,v)=>{N$.init($,v),v.format=v.format||"float64";let g=v.format?.includes("int"),_=g?"int":"number",[U,z]=p2[v.format];$._zod.onattach.push((b)=>{let J=b._zod.bag;if(J.format=v.format,J.minimum=U,J.maximum=z,g)J.pattern=Fz}),$._zod.check=(b)=>{let J=b.value;if(g){if(!Number.isInteger(J)){b.issues.push({expected:_,format:v.format,code:"invalid_type",continue:!1,input:J,inst:$});return}if(!Number.isSafeInteger(J)){if(J>0)b.issues.push({input:J,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:_,inclusive:!0,continue:!v.abort});else b.issues.push({input:J,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:_,inclusive:!0,continue:!v.abort});return}}if(J<U)b.issues.push({origin:"number",input:J,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(J>z)b.issues.push({origin:"number",input:J,code:"too_big",maximum:z,inclusive:!0,inst:$,continue:!v.abort})}}),Mz=q("$ZodCheckBigIntFormat",($,v)=>{N$.init($,v);let[g,_]=o2[v.format];$._zod.onattach.push((U)=>{let z=U._zod.bag;z.format=v.format,z.minimum=g,z.maximum=_}),$._zod.check=(U)=>{let z=U.value;if(z<g)U.issues.push({origin:"bigint",input:z,code:"too_small",minimum:g,inclusive:!0,inst:$,continue:!v.abort});if(z>_)U.issues.push({origin:"bigint",input:z,code:"too_big",maximum:_,inclusive:!0,inst:$,continue:!v.abort})}}),Qz=q("$ZodCheckMaxSize",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Z6(U)&&U.size!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)_._zod.bag.maximum=v.maximum}),$._zod.check=(_)=>{let U=_.value;if(U.size<=v.maximum)return;_.issues.push({origin:DU(U),code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),Nz=q("$ZodCheckMinSize",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Z6(U)&&U.size!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)_._zod.bag.minimum=v.minimum}),$._zod.check=(_)=>{let U=_.value;if(U.size>=v.minimum)return;_.issues.push({origin:DU(U),code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),rz=q("$ZodCheckSizeEquals",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Z6(U)&&U.size!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.minimum=v.size,U.maximum=v.size,U.size=v.size}),$._zod.check=(_)=>{let U=_.value,z=U.size;if(z===v.size)return;let b=z>v.size;_.issues.push({origin:DU(U),...b?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:_.value,inst:$,continue:!v.abort})}}),uz=q("$ZodCheckMaxLength",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Z6(U)&&U.length!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)_._zod.bag.maximum=v.maximum}),$._zod.check=(_)=>{let U=_.value;if(U.length<=v.maximum)return;let b=TU(U);_.issues.push({origin:b,code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),Rz=q("$ZodCheckMinLength",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Z6(U)&&U.length!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)_._zod.bag.minimum=v.minimum}),$._zod.check=(_)=>{let U=_.value;if(U.length>=v.minimum)return;let b=TU(U);_.issues.push({origin:b,code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),yz=q("$ZodCheckLengthEquals",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Z6(U)&&U.length!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.minimum=v.length,U.maximum=v.length,U.length=v.length}),$._zod.check=(_)=>{let U=_.value,z=U.length;if(z===v.length)return;let b=TU(U),J=z>v.length;_.issues.push({origin:b,...J?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:_.value,inst:$,continue:!v.abort})}}),D4=q("$ZodCheckStringFormat",($,v)=>{var g,_;if(N$.init($,v),$._zod.onattach.push((U)=>{let z=U._zod.bag;if(z.format=v.format,v.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(v.pattern)}),v.pattern)(g=$._zod).check??(g.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:v.format,input:U.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(_=$._zod).check??(_.check=()=>{})}),Dz=q("$ZodCheckRegex",($,v)=>{D4.init($,v),$._zod.check=(g)=>{if(v.pattern.lastIndex=0,v.pattern.test(g.value))return;g.issues.push({origin:"string",code:"invalid_format",format:"regex",input:g.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),Tz=q("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=Xz),D4.init($,v)}),jz=q("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=wz),D4.init($,v)}),Vz=q("$ZodCheckIncludes",($,v)=>{N$.init($,v);let g=Rv(v.includes),_=new RegExp(typeof v.position==="number"?`^.{${v.position}}${g}`:g);v.pattern=_,$._zod.onattach.push((U)=>{let z=U._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(_)}),$._zod.check=(U)=>{if(U.value.includes(v.includes,v.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:U.value,inst:$,continue:!v.abort})}}),Cz=q("$ZodCheckStartsWith",($,v)=>{N$.init($,v);let g=new RegExp(`^${Rv(v.prefix)}.*`);v.pattern??(v.pattern=g),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.startsWith(v.prefix))return;_.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:_.value,inst:$,continue:!v.abort})}}),fz=q("$ZodCheckEndsWith",($,v)=>{N$.init($,v);let g=new RegExp(`.*${Rv(v.suffix)}$`);v.pattern??(v.pattern=g),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.endsWith(v.suffix))return;_.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:_.value,inst:$,continue:!v.abort})}});function k5($,v,g){if($.issues.length)v.issues.push(...Mv(g,$.issues))}var mz=q("$ZodCheckProperty",($,v)=>{N$.init($,v),$._zod.check=(g)=>{let _=v.schema._zod.run({value:g.value[v.property],issues:[]},{});if(_ instanceof Promise)return _.then((U)=>k5(U,g,v.property));k5(_,g,v.property);return}}),Ez=q("$ZodCheckMimeType",($,v)=>{N$.init($,v);let g=new Set(v.mime);$._zod.onattach.push((_)=>{_._zod.bag.mime=v.mime}),$._zod.check=(_)=>{if(g.has(_.value.type))return;_.issues.push({code:"invalid_value",values:v.mime,input:_.value.type,inst:$,continue:!v.abort})}}),cz=q("$ZodCheckOverwrite",($,v)=>{N$.init($,v),$._zod.check=(g)=>{g.value=v.tx(g.value)}});class x_{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let g=$.split(`
107
+ `.substring(0,U);return g+z+_}function SH($){return $!=null&&(typeof $==="string"||$.nodeType&&($.nodeType===1||$.nodeType===9||$.nodeType===11))}function V_(){let $=window.prompt("Link URL:");if(!$)return;let v=$.trim().toLowerCase();if(v.startsWith("javascript:")||v.startsWith("data:"))return;document.execCommand("createLink",!1,$)}function tK(){let $=window.getSelection();if(!$||$.rangeCount===0)return;let v=$.getRangeAt(0);if(v.collapsed)return;let g=v.toString(),_=document.createElement("code");_.textContent=g,v.deleteContents(),v.insertNode(_);let U=document.createRange();U.setStartAfter(_),U.setEndAfter(_),$.removeAllRanges(),$.addRange(U)}var C_=8,MH=[{kind:"exec",command:"bold",icon:"B",title:"Bold (⌘B)"},{kind:"exec",command:"italic",icon:"I",title:"Italic (⌘I)"},{kind:"exec",command:"strikeThrough",icon:"S",title:"Strikethrough"},{kind:"code",icon:"{ }",title:"Inline code",dividerBefore:!0},{kind:"block",tag:"H1",icon:"H1",title:"Heading 1",dividerBefore:!0},{kind:"block",tag:"H2",icon:"H2",title:"Heading 2"},{kind:"block",tag:"H3",icon:"H3",title:"Heading 3"},{kind:"block",tag:"P",icon:"¶",title:"Paragraph"},{kind:"block",tag:"BLOCKQUOTE",icon:"❝",title:"Quote",dividerBefore:!0},{kind:"exec",command:"insertUnorderedList",icon:"•",title:"Bullet list"},{kind:"exec",command:"insertOrderedList",icon:"1.",title:"Numbered list"},{kind:"link",icon:"\uD83D\uDD17",title:"Link (⌘K)",dividerBefore:!0}];function QH($){switch($.kind){case"exec":document.execCommand($.command);return;case"block":document.execCommand("formatBlock",!1,$.tag);return;case"code":tK();return;case"link":V_();return}}function dK({hostRef:$,onChange:v}){let[g,_]=x(!1),[U,z]=x({top:0,left:0}),[J,b]=x(0),G=y(null),K=y(null),W=Q(()=>{let P=$.current;if(!P){_(!1);return}let q=window.getSelection();if(!q||q.rangeCount===0||q.isCollapsed){_(!1);return}let L=q.getRangeAt(0);if(!P.contains(L.commonAncestorContainer)){_(!1);return}let H=L.getBoundingClientRect();if(H.width===0&&H.height===0){_(!1);return}let F=J||420,Y=Math.max(C_,Math.min(H.left+H.width/2-F/2,window.innerWidth-F-C_)),A=Math.max(C_,H.top-C_-36);z({top:A,left:Y}),_(!0)},[$,J]),B=Q(()=>{if(K.current!==null)return;K.current=requestAnimationFrame(()=>{K.current=null,W()})},[W]);c(()=>{return document.addEventListener("selectionchange",B),window.addEventListener("scroll",B,!0),window.addEventListener("resize",B),()=>{if(document.removeEventListener("selectionchange",B),window.removeEventListener("scroll",B,!0),window.removeEventListener("resize",B),K.current!==null)cancelAnimationFrame(K.current)}},[B]),sg(()=>{if(!g)return;let P=G.current;if(!P)return;let q=P.getBoundingClientRect().width;if(q&&Math.abs(q-J)>1)b(q)},[g,J]);let k=Q((P)=>{QH(P),v(),W()},[v,W]);if(!g)return null;return O("div",{ref:G,class:"md-inline-format-bar",style:{top:`${U.top}px`,left:`${U.left}px`},onMouseDown:(P)=>P.preventDefault(),children:MH.flatMap((P,q)=>{let L=O("button",{type:"button",class:"md-inline-format-btn",title:P.title,onClick:()=>k(P),children:P.icon},`btn-${q}`,!1,void 0,this);return P.dividerBefore?[O("span",{class:"md-inline-format-divider"},`div-${q}`,!1,void 0,this),L]:[L]})},void 0,!1,void 0,this)}var c2=null;function NH(){if(c2)return c2;let $=new RU({headingStyle:"atx",codeBlockStyle:"fenced",emDelimiter:"*",bulletListMarker:"-"});return $.use(aK.gfm),c2=$,$}function sK({initialHtml:$,className:v,onChange:g,onSave:_}){let U=y(null),z=y($);c(()=>{let B=U.current;if(!B)return;B.innerHTML=z.current},[]);let J=Q(()=>{let B=U.current;if(!B)return"";return NH().turndown(B.innerHTML)},[]),b=Q(()=>{g(J())},[g,J]),G=Q(()=>{_?.(J())},[_,J]),K=Q((B)=>{if(!(B.metaKey||B.ctrlKey))return;if(B.key==="s"){B.preventDefault(),G();return}if(B.key==="b"){B.preventDefault(),document.execCommand("bold"),b();return}if(B.key==="i"){B.preventDefault(),document.execCommand("italic"),b();return}if(B.key==="k")B.preventDefault(),V_(),b()},[b,G]),W=Q((B)=>{let k=B.clipboardData?.getData("text/plain");if(k==null)return;B.preventDefault(),document.execCommand("insertText",!1,k),b()},[b]);return O(s$,{children:[O("div",{ref:U,class:v,contentEditable:!0,spellcheck:!1,onInput:b,onKeyDown:K,onPaste:W,onBlur:G},void 0,!1,void 0,this),O(dK,{hostRef:U,onChange:b},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function m2({html:$,className:v,style:g}){let _=y(null);return c(()=>{let U=_.current;if(!U)return;if(U.replaceChildren(),!$)return;let z=document.createElement("template");z.innerHTML=$,U.append(z.content.cloneNode(!0))},[$]),O("div",{ref:_,class:v,style:g},void 0,!1,void 0,this)}function f_({node:$,expanded:v=!1}){let g=$.data.path,[_,U]=x(""),[z,J]=x(""),[b,G]=x(!1),[K,W]=x(!1),[B,k]=x(!1),[P,q]=x(!1),L=y(null),H=y(null),F=y(""),Y=y(null),A=$.data.reviewActive;c(()=>{let r=!1;return(async()=>{let g$;if(g){let m=await MU(g);if(r)return;g$=m.content}else if($.data.content)g$=$.data.content;else{G(!0);return}U(g$);let p=await z6(g$);if(r)return;J(p),G(!0),U$($.id,{content:g$,rendered:p})})(),()=>{r=!0}},[g,$.id,$.data.content]);let M=Q(async(r)=>{let g$=r.target.value;U(g$),q(!0);let p=await z6(g$);J(p)},[]),V=Q(async(r)=>{if(!g){let p=await z6(r);J(p),q(!1),U$($.id,{content:r,rendered:p}),await Zv($.id,{content:r,data:{rendered:p}});return}k(!0);let g$=await X3(g,r);if(k(!1),g$.ok){let p=await z6(r);J(p),q(!1),U$($.id,{content:r,rendered:p,savedAt:g$.updatedAt}),await Zv($.id,{content:r,data:{rendered:p,savedAt:g$.updatedAt}})}},[g,$.id]),f=Q(async()=>{if(!P)return;await V(_)},[P,_,V]),N=Q((r)=>{if((r.metaKey||r.ctrlKey)&&r.key==="s"){r.preventDefault(),f();return}let g$=L.current;if(g$&&FK(r,g$))return;if(g$&&r.key==="Tab")r.preventDefault(),LK(g$,r.shiftKey)},[f]);Y.current=V;let t=Q((r)=>{if(U(r),q(!0),F.current=r,H.current!==null)window.clearTimeout(H.current);H.current=window.setTimeout(()=>{H.current=null,V(r)},800)},[V]),d=Q((r)=>{if(U(r),F.current=r,H.current!==null)window.clearTimeout(H.current),H.current=null;V(r)},[V]);c(()=>{return()=>{if(H.current===null)return;window.clearTimeout(H.current),H.current=null;let r=Y.current;if(r)r(F.current)}},[$.id]);let u=A?O("div",{style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-ok-10)",color:"var(--c-ok)",borderBottom:"1px solid var(--c-ok-20)",textTransform:"uppercase",letterSpacing:"0.05em",fontWeight:600},children:"Review active"},void 0,!1,void 0,this):null;if(K&&v)return O("div",{class:"md-editor-expanded",onKeyDown:N,children:[O("div",{class:"md-editor-toolbar",children:[O("button",{type:"button",class:"md-toolbar-btn",onClick:()=>W(!1),children:"← Back to document"},void 0,!1,void 0,this),O("div",{style:{display:"flex",gap:"6px",alignItems:"center"},children:[g&&O("span",{class:"md-toolbar-path",children:g.split("/").pop()},void 0,!1,void 0,this),O("button",{type:"button",class:`md-toolbar-btn${P?" md-toolbar-btn-primary":""}`,onClick:f,disabled:!P||B,children:B?"Saving…":P?"Save":"Saved"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"md-editor-split",children:[O("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[O("textarea",{ref:L,value:_,onInput:M,spellcheck:!1},void 0,!1,void 0,this),O(Q2,{textareaRef:L},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(m2,{html:z,className:"md-preview"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(K)return O("div",{class:"md-editor-split",style:{height:"100%"},onKeyDown:N,children:[O("div",{style:{flex:1,position:"relative",display:"flex",flexDirection:"column"},children:[O("textarea",{ref:L,value:_,onInput:M,spellcheck:!1},void 0,!1,void 0,this),O(Q2,{textareaRef:L},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(m2,{html:z,className:"md-preview"},void 0,!1,void 0,this),O("div",{style:{position:"absolute",bottom:"8px",right:"8px",display:"flex",gap:"6px"},children:[O("button",{type:"button",onClick:()=>W(!1),style:{padding:"4px 10px",fontSize:"11px",background:"var(--c-input-bg)",border:"1px solid var(--c-line)",borderRadius:"6px",color:"var(--c-text-soft)",cursor:"pointer"},children:"Document"},void 0,!1,void 0,this),O("button",{type:"button",onClick:f,disabled:!P||B,style:{padding:"4px 10px",fontSize:"11px",background:P?"var(--c-accent-25)":"var(--c-input-bg)",border:`1px solid ${P?"var(--c-accent)":"var(--c-line)"}`,borderRadius:"6px",color:P?"var(--c-text)":"var(--c-dim)",cursor:P?"pointer":"default"},children:B?"Saving…":P?"Save":"Saved"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(v)return O("div",{style:{height:"100%",position:"relative"},children:[u,O("div",{class:"md-reader",children:b?O(sK,{initialHtml:z||"<p><br></p>",className:"md-reader-content md-reader-editable",onChange:t,onSave:d},$.id,!1,void 0,this):O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"24px"},children:"Loading…"},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("button",{type:"button",class:"md-edit-fab",onClick:()=>W(!0),children:"</> Source"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("div",{style:{height:"100%",position:"relative"},children:[u,O(m2,{html:z,style:{padding:z?"0":"12px",color:z?void 0:"var(--c-dim)"}},void 0,!1,void 0,this),!b&&O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"Loading…"},void 0,!1,void 0,this),b&&!z&&O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"Empty node"},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>b6($.id),style:{position:"absolute",top:"4px",right:"4px",padding:"3px 8px",fontSize:"10px",background:"var(--c-panel-overlay)",border:"1px solid var(--c-line)",borderRadius:"4px",color:"var(--c-text-soft)",cursor:"pointer",opacity:0.7},onMouseEnter:(r)=>{r.target.style.opacity="1"},onMouseLeave:(r)=>{r.target.style.opacity="0.7"},children:"Edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var eK=37;function rH($){return $.type==="html"||$.type==="json-render"||$.type==="graph"||$.type==="mcp-app"||$.type==="webpage"}function uH($){if($.type==="html")return $.data.presentation!==!0;if($.type==="json-render"||$.type==="graph")return!0;if($.type==="mcp-app")return $.data.viewerType==="web-artifact";return!1}function $5($){return $.collapsed===!0||$.dockPosition!=null||$.data.strictSize===!0||$.data.userResized===!0||$.type==="group"}function i2($){return!$5($)&&!rH($)}function v5($,v){if(!i2($)||v<=0)return null;return Math.min(v+37,600)}function l2($){return uH($)&&!$5($)}function U5($,v){if(!l2($)||v<=0)return null;let g=Math.min(v+37+24,1400);return g>$.size.height+8?g:null}var I={};v6(I,{xor:()=>j7,xid:()=>J7,void:()=>y7,uuidv7:()=>s5,uuidv6:()=>a5,uuidv4:()=>d5,uuid:()=>t5,util:()=>j,url:()=>e5,uppercase:()=>i4,unknown:()=>Q$,union:()=>w$,undefined:()=>r7,ulid:()=>z7,uint64:()=>Q7,uint32:()=>Z7,tuple:()=>$O,trim:()=>n4,treeifyError:()=>vz,transform:()=>G0,toUpperCase:()=>d4,toLowerCase:()=>t4,toJSONSchema:()=>C1,templateLiteral:()=>p7,symbol:()=>N7,superRefine:()=>MO,success:()=>l7,stringbool:()=>e7,stringFormat:()=>L7,string:()=>Z,strictObject:()=>T7,startsWith:()=>h4,slugify:()=>a4,size:()=>v4,setErrorMap:()=>eL,set:()=>E7,safeParseAsync:()=>R9,safeParse:()=>y9,safeEncodeAsync:()=>E9,safeEncode:()=>C9,safeDecodeAsync:()=>c9,safeDecode:()=>f9,registry:()=>O1,regexes:()=>jv,regex:()=>c4,refine:()=>SO,record:()=>r$,readonly:()=>YO,property:()=>D1,promise:()=>o7,prettifyError:()=>Uz,preprocess:()=>Ig,prefault:()=>BO,positive:()=>r1,pipe:()=>Og,partialRecord:()=>V7,parseAsync:()=>u9,parse:()=>r9,overwrite:()=>iv,optional:()=>y$,object:()=>h,number:()=>I$,nullish:()=>i7,nullable:()=>bg,null:()=>JU,normalize:()=>o4,nonpositive:()=>y1,nonoptional:()=>PO,nonnegative:()=>R1,never:()=>O0,negative:()=>u1,nativeEnum:()=>c7,nanoid:()=>U7,nan:()=>h7,multipleOf:()=>y6,minSize:()=>av,minLength:()=>K6,mime:()=>p4,meta:()=>a7,maxSize:()=>R6,maxLength:()=>U4,map:()=>f7,mac:()=>G7,lte:()=>Nv,lt:()=>tv,lowercase:()=>m4,looseRecord:()=>C7,looseObject:()=>vv,locales:()=>Ug,literal:()=>o,length:()=>g4,lazy:()=>AO,ksuid:()=>b7,keyof:()=>D7,jwt:()=>I7,json:()=>$W,iso:()=>V6,ipv6:()=>K7,ipv4:()=>O7,intersection:()=>bU,int64:()=>M7,int32:()=>w7,int:()=>l1,instanceof:()=>s7,includes:()=>l4,httpUrl:()=>$7,hostname:()=>F7,hex:()=>Y7,hash:()=>q7,guid:()=>n5,gte:()=>Hv,gt:()=>dv,globalRegistry:()=>$v,getErrorMap:()=>$F,function:()=>n7,fromJSONSchema:()=>UW,formatError:()=>iU,float64:()=>A7,float32:()=>X7,flattenError:()=>mU,file:()=>m7,exactOptional:()=>bO,enum:()=>Uv,endsWith:()=>x4,encodeAsync:()=>j9,encode:()=>D9,emoji:()=>v7,email:()=>o5,e164:()=>H7,discriminatedUnion:()=>Pg,describe:()=>d7,decodeAsync:()=>V9,decode:()=>T9,date:()=>R7,custom:()=>k0,cuid2:()=>_7,cuid:()=>g7,core:()=>W6,config:()=>x$,coerce:()=>NO,codec:()=>x7,clone:()=>kv,cidrv6:()=>B7,cidrv4:()=>W7,check:()=>t7,catch:()=>IO,boolean:()=>p$,bigint:()=>S7,base64url:()=>k7,base64:()=>P7,array:()=>O$,any:()=>u7,_function:()=>n7,_default:()=>KO,_ZodString:()=>h1,ZodXor:()=>d9,ZodXID:()=>a1,ZodVoid:()=>n9,ZodUnknown:()=>p9,ZodUnion:()=>Bg,ZodUndefined:()=>l9,ZodUUID:()=>sv,ZodURL:()=>Gg,ZodULID:()=>d1,ZodType:()=>_$,ZodTuple:()=>e9,ZodTransform:()=>zO,ZodTemplateLiteral:()=>qO,ZodSymbol:()=>i9,ZodSuccess:()=>kO,ZodStringFormat:()=>M$,ZodString:()=>vU,ZodSet:()=>UO,ZodRecord:()=>kg,ZodRealError:()=>Av,ZodReadonly:()=>FO,ZodPromise:()=>wO,ZodPrefault:()=>WO,ZodPipe:()=>B0,ZodOptional:()=>K0,ZodObject:()=>Wg,ZodNumberFormat:()=>_4,ZodNumber:()=>gU,ZodNullable:()=>OO,ZodNull:()=>h9,ZodNonOptional:()=>W0,ZodNever:()=>o9,ZodNanoID:()=>o1,ZodNaN:()=>LO,ZodMap:()=>vO,ZodMAC:()=>m9,ZodLiteral:()=>gO,ZodLazy:()=>XO,ZodKSUID:()=>s1,ZodJWT:()=>J0,ZodIssueCode:()=>sL,ZodIntersection:()=>s9,ZodISOTime:()=>m1,ZodISODuration:()=>i1,ZodISODateTime:()=>E1,ZodISODate:()=>c1,ZodIPv6:()=>$0,ZodIPv4:()=>e1,ZodGUID:()=>Jg,ZodFunction:()=>ZO,ZodFirstPartyTypeKind:()=>QO,ZodFile:()=>_O,ZodExactOptional:()=>JO,ZodError:()=>dL,ZodEnum:()=>$U,ZodEmoji:()=>p1,ZodEmail:()=>x1,ZodE164:()=>z0,ZodDiscriminatedUnion:()=>a9,ZodDefault:()=>GO,ZodDate:()=>Kg,ZodCustomStringFormat:()=>UU,ZodCustom:()=>Hg,ZodCodec:()=>P0,ZodCatch:()=>HO,ZodCUID2:()=>t1,ZodCUID:()=>n1,ZodCIDRv6:()=>U0,ZodCIDRv4:()=>v0,ZodBoolean:()=>_U,ZodBigIntFormat:()=>b0,ZodBigInt:()=>zU,ZodBase64URL:()=>_0,ZodBase64:()=>g0,ZodArray:()=>t9,ZodAny:()=>x9,TimePrecision:()=>_8,NEVER:()=>h2,$output:()=>sb,$input:()=>eb,$brand:()=>x2});var W6={};v6(W6,{version:()=>tz,util:()=>j,treeifyError:()=>vz,toJSONSchema:()=>C1,toDotPath:()=>O5,safeParseAsync:()=>xU,safeParse:()=>V4,safeEncodeAsync:()=>H5,safeEncode:()=>P5,safeDecodeAsync:()=>I5,safeDecode:()=>k5,registry:()=>O1,regexes:()=>jv,process:()=>X$,prettifyError:()=>Uz,parseAsync:()=>hU,parse:()=>lU,meta:()=>f8,locales:()=>Ug,isValidJWT:()=>j5,isValidBase64URL:()=>T5,isValidBase64:()=>LJ,initializeContext:()=>D6,globalRegistry:()=>$v,globalConfig:()=>DU,formatError:()=>iU,flattenError:()=>mU,finalize:()=>j6,extractDefs:()=>T6,encodeAsync:()=>W5,encode:()=>G5,describe:()=>C8,decodeAsync:()=>B5,decode:()=>K5,createToJSONSchemaMethod:()=>c8,createStandardJSONSchemaMethod:()=>e4,config:()=>x$,clone:()=>kv,_xor:()=>ML,_xid:()=>Y1,_void:()=>N8,_uuidv7:()=>P1,_uuidv6:()=>B1,_uuidv4:()=>W1,_uuid:()=>K1,_url:()=>_g,_uppercase:()=>i4,_unknown:()=>M8,_union:()=>SL,_undefined:()=>w8,_ulid:()=>F1,_uint64:()=>X8,_uint32:()=>H8,_tuple:()=>rL,_trim:()=>n4,_transform:()=>VL,_toUpperCase:()=>d4,_toLowerCase:()=>t4,_templateLiteral:()=>xL,_symbol:()=>A8,_superRefine:()=>V8,_success:()=>mL,_stringbool:()=>E8,_stringFormat:()=>s4,_string:()=>v8,_startsWith:()=>h4,_slugify:()=>a4,_size:()=>v4,_set:()=>RL,_safeParseAsync:()=>C4,_safeParse:()=>j4,_safeEncodeAsync:()=>o_,_safeEncode:()=>x_,_safeDecodeAsync:()=>n_,_safeDecode:()=>p_,_regex:()=>c4,_refine:()=>j8,_record:()=>uL,_readonly:()=>hL,_property:()=>D1,_promise:()=>oL,_positive:()=>r1,_pipe:()=>lL,_parseAsync:()=>T4,_parse:()=>D4,_overwrite:()=>iv,_optional:()=>CL,_number:()=>G8,_nullable:()=>fL,_null:()=>Z8,_normalize:()=>o4,_nonpositive:()=>y1,_nonoptional:()=>cL,_nonnegative:()=>R1,_never:()=>Q8,_negative:()=>u1,_nativeEnum:()=>TL,_nanoid:()=>H1,_nan:()=>y8,_multipleOf:()=>y6,_minSize:()=>av,_minLength:()=>K6,_min:()=>Hv,_mime:()=>p4,_maxSize:()=>R6,_maxLength:()=>U4,_max:()=>Nv,_map:()=>yL,_mac:()=>g8,_lte:()=>Nv,_lt:()=>tv,_lowercase:()=>m4,_literal:()=>jL,_length:()=>g4,_lazy:()=>pL,_ksuid:()=>q1,_jwt:()=>N1,_isoTime:()=>b8,_isoDuration:()=>O8,_isoDateTime:()=>z8,_isoDate:()=>J8,_ipv6:()=>A1,_ipv4:()=>X1,_intersection:()=>NL,_int64:()=>q8,_int32:()=>k8,_int:()=>W8,_includes:()=>l4,_guid:()=>gg,_gte:()=>Hv,_gt:()=>dv,_float64:()=>P8,_float32:()=>B8,_file:()=>D8,_enum:()=>DL,_endsWith:()=>x4,_encodeAsync:()=>l_,_encode:()=>m_,_emoji:()=>k1,_email:()=>G1,_e164:()=>Q1,_discriminatedUnion:()=>QL,_default:()=>EL,_decodeAsync:()=>h_,_decode:()=>i_,_date:()=>r8,_custom:()=>T8,_cuid2:()=>L1,_cuid:()=>I1,_coercedString:()=>U8,_coercedNumber:()=>K8,_coercedDate:()=>u8,_coercedBoolean:()=>L8,_coercedBigint:()=>Y8,_cidrv6:()=>Z1,_cidrv4:()=>w1,_check:()=>h5,_catch:()=>iL,_boolean:()=>I8,_bigint:()=>F8,_base64url:()=>M1,_base64:()=>S1,_array:()=>R8,_any:()=>S8,TimePrecision:()=>_8,NEVER:()=>h2,JSONSchemaGenerator:()=>Z9,JSONSchema:()=>x5,Doc:()=>s_,$output:()=>sb,$input:()=>eb,$constructor:()=>X,$brand:()=>x2,$ZodXor:()=>jJ,$ZodXID:()=>JJ,$ZodVoid:()=>yJ,$ZodUnknown:()=>rJ,$ZodUnion:()=>dU,$ZodUndefined:()=>MJ,$ZodUUID:()=>sz,$ZodURL:()=>$J,$ZodULID:()=>zJ,$ZodType:()=>v$,$ZodTuple:()=>J1,$ZodTransform:()=>hJ,$ZodTemplateLiteral:()=>vb,$ZodSymbol:()=>SJ,$ZodSuccess:()=>dJ,$ZodStringFormat:()=>S$,$ZodString:()=>$4,$ZodSet:()=>cJ,$ZodRegistry:()=>$8,$ZodRecord:()=>fJ,$ZodRealError:()=>Xv,$ZodReadonly:()=>$b,$ZodPromise:()=>gb,$ZodPrefault:()=>nJ,$ZodPipe:()=>eJ,$ZodOptional:()=>b1,$ZodObjectJIT:()=>TJ,$ZodObject:()=>f5,$ZodNumberFormat:()=>wJ,$ZodNumber:()=>_1,$ZodNullable:()=>pJ,$ZodNull:()=>QJ,$ZodNonOptional:()=>tJ,$ZodNever:()=>uJ,$ZodNanoID:()=>UJ,$ZodNaN:()=>sJ,$ZodMap:()=>EJ,$ZodMAC:()=>kJ,$ZodLiteral:()=>iJ,$ZodLazy:()=>_b,$ZodKSUID:()=>bJ,$ZodJWT:()=>XJ,$ZodIntersection:()=>CJ,$ZodISOTime:()=>KJ,$ZodISODuration:()=>WJ,$ZodISODateTime:()=>OJ,$ZodISODate:()=>GJ,$ZodIPv6:()=>PJ,$ZodIPv4:()=>BJ,$ZodGUID:()=>az,$ZodFunction:()=>Ub,$ZodFile:()=>lJ,$ZodExactOptional:()=>xJ,$ZodError:()=>cU,$ZodEnum:()=>mJ,$ZodEncodeError:()=>a6,$ZodEmoji:()=>vJ,$ZodEmail:()=>ez,$ZodE164:()=>qJ,$ZodDiscriminatedUnion:()=>VJ,$ZodDefault:()=>oJ,$ZodDate:()=>RJ,$ZodCustomStringFormat:()=>AJ,$ZodCustom:()=>zb,$ZodCodec:()=>aU,$ZodCheckUpperCase:()=>iz,$ZodCheckStringFormat:()=>f4,$ZodCheckStartsWith:()=>hz,$ZodCheckSizeEquals:()=>Vz,$ZodCheckRegex:()=>cz,$ZodCheckProperty:()=>pz,$ZodCheckOverwrite:()=>nz,$ZodCheckNumberFormat:()=>Rz,$ZodCheckMultipleOf:()=>yz,$ZodCheckMinSize:()=>jz,$ZodCheckMinLength:()=>fz,$ZodCheckMimeType:()=>oz,$ZodCheckMaxSize:()=>Tz,$ZodCheckMaxLength:()=>Cz,$ZodCheckLowerCase:()=>mz,$ZodCheckLessThan:()=>d_,$ZodCheckLengthEquals:()=>Ez,$ZodCheckIncludes:()=>lz,$ZodCheckGreaterThan:()=>a_,$ZodCheckEndsWith:()=>xz,$ZodCheckBigIntFormat:()=>Dz,$ZodCheck:()=>N$,$ZodCatch:()=>aJ,$ZodCUID2:()=>_J,$ZodCUID:()=>gJ,$ZodCIDRv6:()=>IJ,$ZodCIDRv4:()=>HJ,$ZodBoolean:()=>tU,$ZodBigIntFormat:()=>ZJ,$ZodBigInt:()=>z1,$ZodBase64URL:()=>YJ,$ZodBase64:()=>FJ,$ZodAsyncError:()=>nv,$ZodArray:()=>DJ,$ZodAny:()=>NJ});var h2=Object.freeze({status:"aborted"});function X($,v,g){function _(b,G){if(!b._zod)Object.defineProperty(b,"_zod",{value:{def:G,constr:J,traits:new Set},enumerable:!1});if(b._zod.traits.has($))return;b._zod.traits.add($),v(b,G);let K=J.prototype,W=Object.keys(K);for(let B=0;B<W.length;B++){let k=W[B];if(!(k in b))b[k]=K[k].bind(b)}}let U=g?.Parent??Object;class z extends U{}Object.defineProperty(z,"name",{value:$});function J(b){var G;let K=g?.Parent?new z:this;_(K,b),(G=K._zod).deferred??(G.deferred=[]);for(let W of K._zod.deferred)W();return K}return Object.defineProperty(J,"init",{value:_}),Object.defineProperty(J,Symbol.hasInstance,{value:(b)=>{if(g?.Parent&&b instanceof g.Parent)return!0;return b?._zod?.traits?.has($)}}),Object.defineProperty(J,"name",{value:$}),J}var x2=Symbol("zod_brand");class nv extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class a6 extends Error{constructor($){super(`Encountered unidirectional transform during encode: ${$}`);this.name="ZodEncodeError"}}var DU={};function x$($){if($)Object.assign(DU,$);return DU}var j={};v6(j,{unwrapMessage:()=>TU,uint8ArrayToHex:()=>vI,uint8ArrayToBase64url:()=>eH,uint8ArrayToBase64:()=>z5,stringifyPrimitive:()=>R,slugify:()=>n2,shallowClone:()=>d2,safeExtend:()=>oH,required:()=>dH,randomString:()=>cH,propertyKeyTypes:()=>CU,promiseAllObject:()=>EH,primitiveTypes:()=>a2,prefixIssues:()=>Qv,pick:()=>hH,partial:()=>tH,parsedType:()=>D,optionalKeys:()=>s2,omit:()=>xH,objectClone:()=>VH,numKeys:()=>mH,nullish:()=>Q6,normalizeParams:()=>C,mergeDefs:()=>G6,merge:()=>nH,jsonStringifyReplacer:()=>u4,joinValues:()=>w,issue:()=>R4,isPlainObject:()=>r6,isObject:()=>s6,hexToUint8Array:()=>$I,getSizableOrigin:()=>fU,getParsedType:()=>iH,getLengthableOrigin:()=>EU,getEnumValues:()=>jU,getElementAtPath:()=>fH,floatSafeRemainder:()=>o2,finalizeIssue:()=>qv,extend:()=>pH,escapeRegex:()=>Tv,esc:()=>E_,defineLazy:()=>b$,createTransparentProxy:()=>lH,cloneDef:()=>CH,clone:()=>kv,cleanRegex:()=>VU,cleanEnum:()=>aH,captureStackTrace:()=>c_,cached:()=>y4,base64urlToUint8Array:()=>sH,base64ToUint8Array:()=>_5,assignProp:()=>N6,assertNotEqual:()=>RH,assertNever:()=>TH,assertIs:()=>DH,assertEqual:()=>yH,assert:()=>jH,allowsEval:()=>t2,aborted:()=>u6,NUMBER_FORMAT_RANGES:()=>e2,Class:()=>J5,BIGINT_FORMAT_RANGES:()=>$z});function yH($){return $}function RH($){return $}function DH($){}function TH($){throw Error("Unexpected value in exhaustive check")}function jH($){}function jU($){let v=Object.values($).filter((_)=>typeof _==="number");return Object.entries($).filter(([_,U])=>v.indexOf(+_)===-1).map(([_,U])=>U)}function w($,v="|"){return $.map((g)=>R(g)).join(v)}function u4($,v){if(typeof v==="bigint")return v.toString();return v}function y4($){return{get value(){{let g=$();return Object.defineProperty(this,"value",{value:g}),g}throw Error("cached value already set")}}}function Q6($){return $===null||$===void 0}function VU($){let v=$.startsWith("^")?1:0,g=$.endsWith("$")?$.length-1:$.length;return $.slice(v,g)}function o2($,v){let g=($.toString().split(".")[1]||"").length,_=v.toString(),U=(_.split(".")[1]||"").length;if(U===0&&/\d?e-\d?/.test(_)){let G=_.match(/\d?e-(\d?)/);if(G?.[1])U=Number.parseInt(G[1])}let z=g>U?g:U,J=Number.parseInt($.toFixed(z).replace(".","")),b=Number.parseInt(v.toFixed(z).replace(".",""));return J%b/10**z}var g5=Symbol("evaluating");function b$($,v,g){let _=void 0;Object.defineProperty($,v,{get(){if(_===g5)return;if(_===void 0)_=g5,_=g();return _},set(U){Object.defineProperty($,v,{value:U})},configurable:!0})}function VH($){return Object.create(Object.getPrototypeOf($),Object.getOwnPropertyDescriptors($))}function N6($,v,g){Object.defineProperty($,v,{value:g,writable:!0,enumerable:!0,configurable:!0})}function G6(...$){let v={};for(let g of $){let _=Object.getOwnPropertyDescriptors(g);Object.assign(v,_)}return Object.defineProperties({},v)}function CH($){return G6($._zod.def)}function fH($,v){if(!v)return $;return v.reduce((g,_)=>g?.[_],$)}function EH($){let v=Object.keys($),g=v.map((_)=>$[_]);return Promise.all(g).then((_)=>{let U={};for(let z=0;z<v.length;z++)U[v[z]]=_[z];return U})}function cH($=10){let g="";for(let _=0;_<$;_++)g+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return g}function E_($){return JSON.stringify($)}function n2($){return $.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var c_="captureStackTrace"in Error?Error.captureStackTrace:(...$)=>{};function s6($){return typeof $==="object"&&$!==null&&!Array.isArray($)}var t2=y4(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch($){return!1}});function r6($){if(s6($)===!1)return!1;let v=$.constructor;if(v===void 0)return!0;if(typeof v!=="function")return!0;let g=v.prototype;if(s6(g)===!1)return!1;if(Object.prototype.hasOwnProperty.call(g,"isPrototypeOf")===!1)return!1;return!0}function d2($){if(r6($))return{...$};if(Array.isArray($))return[...$];return $}function mH($){let v=0;for(let g in $)if(Object.prototype.hasOwnProperty.call($,g))v++;return v}var iH=($)=>{let v=typeof $;switch(v){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN($)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":if(Array.isArray($))return"array";if($===null)return"null";if($.then&&typeof $.then==="function"&&$.catch&&typeof $.catch==="function")return"promise";if(typeof Map<"u"&&$ instanceof Map)return"map";if(typeof Set<"u"&&$ instanceof Set)return"set";if(typeof Date<"u"&&$ instanceof Date)return"date";if(typeof File<"u"&&$ instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${v}`)}},CU=new Set(["string","number","symbol"]),a2=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Tv($){return $.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kv($,v,g){let _=new $._zod.constr(v??$._zod.def);if(!v||g?.parent)_._zod.parent=$;return _}function C($){let v=$;if(!v)return{};if(typeof v==="string")return{error:()=>v};if(v?.message!==void 0){if(v?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");v.error=v.message}if(delete v.message,typeof v.error==="string")return{...v,error:()=>v.error};return v}function lH($){let v;return new Proxy({},{get(g,_,U){return v??(v=$()),Reflect.get(v,_,U)},set(g,_,U,z){return v??(v=$()),Reflect.set(v,_,U,z)},has(g,_){return v??(v=$()),Reflect.has(v,_)},deleteProperty(g,_){return v??(v=$()),Reflect.deleteProperty(v,_)},ownKeys(g){return v??(v=$()),Reflect.ownKeys(v)},getOwnPropertyDescriptor(g,_){return v??(v=$()),Reflect.getOwnPropertyDescriptor(v,_)},defineProperty(g,_,U){return v??(v=$()),Reflect.defineProperty(v,_,U)}})}function R($){if(typeof $==="bigint")return $.toString()+"n";if(typeof $==="string")return`"${$}"`;return`${$}`}function s2($){return Object.keys($).filter((v)=>{return $[v]._zod.optin==="optional"&&$[v]._zod.optout==="optional"})}var e2={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},$z={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function hH($,v){let g=$._zod.def,_=g.checks;if(_&&_.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let z=G6($._zod.def,{get shape(){let J={};for(let b in v){if(!(b in g.shape))throw Error(`Unrecognized key: "${b}"`);if(!v[b])continue;J[b]=g.shape[b]}return N6(this,"shape",J),J},checks:[]});return kv($,z)}function xH($,v){let g=$._zod.def,_=g.checks;if(_&&_.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let z=G6($._zod.def,{get shape(){let J={...$._zod.def.shape};for(let b in v){if(!(b in g.shape))throw Error(`Unrecognized key: "${b}"`);if(!v[b])continue;delete J[b]}return N6(this,"shape",J),J},checks:[]});return kv($,z)}function pH($,v){if(!r6(v))throw Error("Invalid input to extend: expected a plain object");let g=$._zod.def.checks;if(g&&g.length>0){let z=$._zod.def.shape;for(let J in v)if(Object.getOwnPropertyDescriptor(z,J)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let U=G6($._zod.def,{get shape(){let z={...$._zod.def.shape,...v};return N6(this,"shape",z),z}});return kv($,U)}function oH($,v){if(!r6(v))throw Error("Invalid input to safeExtend: expected a plain object");let g=G6($._zod.def,{get shape(){let _={...$._zod.def.shape,...v};return N6(this,"shape",_),_}});return kv($,g)}function nH($,v){let g=G6($._zod.def,{get shape(){let _={...$._zod.def.shape,...v._zod.def.shape};return N6(this,"shape",_),_},get catchall(){return v._zod.def.catchall},checks:[]});return kv($,g)}function tH($,v,g){let U=v._zod.def.checks;if(U&&U.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let J=G6(v._zod.def,{get shape(){let b=v._zod.def.shape,G={...b};if(g)for(let K in g){if(!(K in b))throw Error(`Unrecognized key: "${K}"`);if(!g[K])continue;G[K]=$?new $({type:"optional",innerType:b[K]}):b[K]}else for(let K in b)G[K]=$?new $({type:"optional",innerType:b[K]}):b[K];return N6(this,"shape",G),G},checks:[]});return kv(v,J)}function dH($,v,g){let _=G6(v._zod.def,{get shape(){let U=v._zod.def.shape,z={...U};if(g)for(let J in g){if(!(J in z))throw Error(`Unrecognized key: "${J}"`);if(!g[J])continue;z[J]=new $({type:"nonoptional",innerType:U[J]})}else for(let J in U)z[J]=new $({type:"nonoptional",innerType:U[J]});return N6(this,"shape",z),z}});return kv(v,_)}function u6($,v=0){if($.aborted===!0)return!0;for(let g=v;g<$.issues.length;g++)if($.issues[g]?.continue!==!0)return!0;return!1}function Qv($,v){return v.map((g)=>{var _;return(_=g).path??(_.path=[]),g.path.unshift($),g})}function TU($){return typeof $==="string"?$:$?.message}function qv($,v,g){let _={...$,path:$.path??[]};if(!$.message){let U=TU($.inst?._zod.def?.error?.($))??TU(v?.error?.($))??TU(g.customError?.($))??TU(g.localeError?.($))??"Invalid input";_.message=U}if(delete _.inst,delete _.continue,!v?.reportInput)delete _.input;return _}function fU($){if($ instanceof Set)return"set";if($ instanceof Map)return"map";if($ instanceof File)return"file";return"unknown"}function EU($){if(Array.isArray($))return"array";if(typeof $==="string")return"string";return"unknown"}function D($){let v=typeof $;switch(v){case"number":return Number.isNaN($)?"nan":"number";case"object":{if($===null)return"null";if(Array.isArray($))return"array";let g=$;if(g&&Object.getPrototypeOf(g)!==Object.prototype&&"constructor"in g&&g.constructor)return g.constructor.name}}return v}function R4(...$){let[v,g,_]=$;if(typeof v==="string")return{message:v,code:"custom",input:g,inst:_};return{...v}}function aH($){return Object.entries($).filter(([v,g])=>{return Number.isNaN(Number.parseInt(v,10))}).map((v)=>v[1])}function _5($){let v=atob($),g=new Uint8Array(v.length);for(let _=0;_<v.length;_++)g[_]=v.charCodeAt(_);return g}function z5($){let v="";for(let g=0;g<$.length;g++)v+=String.fromCharCode($[g]);return btoa(v)}function sH($){let v=$.replace(/-/g,"+").replace(/_/g,"/"),g="=".repeat((4-v.length%4)%4);return _5(v+g)}function eH($){return z5($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function $I($){let v=$.replace(/^0x/,"");if(v.length%2!==0)throw Error("Invalid hex string length");let g=new Uint8Array(v.length/2);for(let _=0;_<v.length;_+=2)g[_/2]=Number.parseInt(v.slice(_,_+2),16);return g}function vI($){return Array.from($).map((v)=>v.toString(16).padStart(2,"0")).join("")}class J5{constructor(...$){}}var b5=($,v)=>{$.name="$ZodError",Object.defineProperty($,"_zod",{value:$._zod,enumerable:!1}),Object.defineProperty($,"issues",{value:v,enumerable:!1}),$.message=JSON.stringify(v,u4,2),Object.defineProperty($,"toString",{value:()=>$.message,enumerable:!1})},cU=X("$ZodError",b5),Xv=X("$ZodError",b5,{Parent:Error});function mU($,v=(g)=>g.message){let g={},_=[];for(let U of $.issues)if(U.path.length>0)g[U.path[0]]=g[U.path[0]]||[],g[U.path[0]].push(v(U));else _.push(v(U));return{formErrors:_,fieldErrors:g}}function iU($,v=(g)=>g.message){let g={_errors:[]},_=(U)=>{for(let z of U.issues)if(z.code==="invalid_union"&&z.errors.length)z.errors.map((J)=>_({issues:J}));else if(z.code==="invalid_key")_({issues:z.issues});else if(z.code==="invalid_element")_({issues:z.issues});else if(z.path.length===0)g._errors.push(v(z));else{let J=g,b=0;while(b<z.path.length){let G=z.path[b];if(b!==z.path.length-1)J[G]=J[G]||{_errors:[]};else J[G]=J[G]||{_errors:[]},J[G]._errors.push(v(z));J=J[G],b++}}};return _($),g}function vz($,v=(g)=>g.message){let g={errors:[]},_=(U,z=[])=>{var J,b;for(let G of U.issues)if(G.code==="invalid_union"&&G.errors.length)G.errors.map((K)=>_({issues:K},G.path));else if(G.code==="invalid_key")_({issues:G.issues},G.path);else if(G.code==="invalid_element")_({issues:G.issues},G.path);else{let K=[...z,...G.path];if(K.length===0){g.errors.push(v(G));continue}let W=g,B=0;while(B<K.length){let k=K[B],P=B===K.length-1;if(typeof k==="string")W.properties??(W.properties={}),(J=W.properties)[k]??(J[k]={errors:[]}),W=W.properties[k];else W.items??(W.items=[]),(b=W.items)[k]??(b[k]={errors:[]}),W=W.items[k];if(P)W.errors.push(v(G));B++}}};return _($),g}function O5($){let v=[],g=$.map((_)=>typeof _==="object"?_.key:_);for(let _ of g)if(typeof _==="number")v.push(`[${_}]`);else if(typeof _==="symbol")v.push(`[${JSON.stringify(String(_))}]`);else if(/[^\w$]/.test(_))v.push(`[${JSON.stringify(_)}]`);else{if(v.length)v.push(".");v.push(_)}return v.join("")}function Uz($){let v=[],g=[...$.issues].sort((_,U)=>(_.path??[]).length-(U.path??[]).length);for(let _ of g)if(v.push(`✖ ${_.message}`),_.path?.length)v.push(` → at ${O5(_.path)}`);return v.join(`
108
+ `)}var D4=($)=>(v,g,_,U)=>{let z=_?Object.assign(_,{async:!1}):{async:!1},J=v._zod.run({value:g,issues:[]},z);if(J instanceof Promise)throw new nv;if(J.issues.length){let b=new(U?.Err??$)(J.issues.map((G)=>qv(G,z,x$())));throw c_(b,U?.callee),b}return J.value},lU=D4(Xv),T4=($)=>async(v,g,_,U)=>{let z=_?Object.assign(_,{async:!0}):{async:!0},J=v._zod.run({value:g,issues:[]},z);if(J instanceof Promise)J=await J;if(J.issues.length){let b=new(U?.Err??$)(J.issues.map((G)=>qv(G,z,x$())));throw c_(b,U?.callee),b}return J.value},hU=T4(Xv),j4=($)=>(v,g,_)=>{let U=_?{..._,async:!1}:{async:!1},z=v._zod.run({value:g,issues:[]},U);if(z instanceof Promise)throw new nv;return z.issues.length?{success:!1,error:new($??cU)(z.issues.map((J)=>qv(J,U,x$())))}:{success:!0,data:z.value}},V4=j4(Xv),C4=($)=>async(v,g,_)=>{let U=_?Object.assign(_,{async:!0}):{async:!0},z=v._zod.run({value:g,issues:[]},U);if(z instanceof Promise)z=await z;return z.issues.length?{success:!1,error:new $(z.issues.map((J)=>qv(J,U,x$())))}:{success:!0,data:z.value}},xU=C4(Xv),m_=($)=>(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return D4($)(v,g,U)},G5=m_(Xv),i_=($)=>(v,g,_)=>{return D4($)(v,g,_)},K5=i_(Xv),l_=($)=>async(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return T4($)(v,g,U)},W5=l_(Xv),h_=($)=>async(v,g,_)=>{return T4($)(v,g,_)},B5=h_(Xv),x_=($)=>(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return j4($)(v,g,U)},P5=x_(Xv),p_=($)=>(v,g,_)=>{return j4($)(v,g,_)},k5=p_(Xv),o_=($)=>async(v,g,_)=>{let U=_?Object.assign(_,{direction:"backward"}):{direction:"backward"};return C4($)(v,g,U)},H5=o_(Xv),n_=($)=>async(v,g,_)=>{return C4($)(v,g,_)},I5=n_(Xv);var jv={};v6(jv,{xid:()=>Jz,uuid7:()=>JI,uuid6:()=>zI,uuid4:()=>_I,uuid:()=>e6,uppercase:()=>uz,unicodeEmail:()=>L5,undefined:()=>Nz,ulid:()=>zz,time:()=>Xz,string:()=>wz,sha512_hex:()=>QI,sha512_base64url:()=>rI,sha512_base64:()=>NI,sha384_hex:()=>ZI,sha384_base64url:()=>MI,sha384_base64:()=>SI,sha256_hex:()=>XI,sha256_base64url:()=>wI,sha256_base64:()=>AI,sha1_hex:()=>FI,sha1_base64url:()=>qI,sha1_base64:()=>YI,rfc5322Email:()=>OI,number:()=>pU,null:()=>Qz,nanoid:()=>Oz,md5_hex:()=>HI,md5_base64url:()=>LI,md5_base64:()=>II,mac:()=>Hz,lowercase:()=>rz,ksuid:()=>bz,ipv6:()=>kz,ipv4:()=>Pz,integer:()=>Sz,idnEmail:()=>GI,html5Email:()=>bI,hostname:()=>BI,hex:()=>kI,guid:()=>Kz,extendedDuration:()=>gI,emoji:()=>Bz,email:()=>Wz,e164:()=>Yz,duration:()=>Gz,domain:()=>PI,datetime:()=>Az,date:()=>qz,cuid2:()=>_z,cuid:()=>gz,cidrv6:()=>Lz,cidrv4:()=>Iz,browserEmail:()=>KI,boolean:()=>Mz,bigint:()=>Zz,base64url:()=>t_,base64:()=>Fz});var gz=/^[cC][^\s-]{8,}$/,_z=/^[0-9a-z]+$/,zz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Jz=/^[0-9a-vA-V]{20}$/,bz=/^[A-Za-z0-9]{27}$/,Oz=/^[a-zA-Z0-9_-]{21}$/,Gz=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,gI=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Kz=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,e6=($)=>{if(!$)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${$}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},_I=e6(4),zI=e6(6),JI=e6(7),Wz=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,OI=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,L5=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,GI=L5,KI=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,WI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Bz(){return new RegExp(WI,"u")}var Pz=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,kz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Hz=($)=>{let v=Tv($??":");return new RegExp(`^(?:[0-9A-F]{2}${v}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${v}){5}[0-9a-f]{2}$`)},Iz=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Lz=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fz=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,t_=/^[A-Za-z0-9_-]*$/,BI=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,PI=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Yz=/^\+[1-9]\d{6,14}$/,F5="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",qz=new RegExp(`^${F5}$`);function Y5($){return typeof $.precision==="number"?$.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":$.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${$.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function Xz($){return new RegExp(`^${Y5($)}$`)}function Az($){let v=Y5({precision:$.precision}),g=["Z"];if($.local)g.push("");if($.offset)g.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let _=`${v}(?:${g.join("|")})`;return new RegExp(`^${F5}T(?:${_})$`)}var wz=($)=>{let v=$?`[\\s\\S]{${$?.minimum??0},${$?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${v}$`)},Zz=/^-?\d+n?$/,Sz=/^-?\d+$/,pU=/^-?\d+(?:\.\d+)?$/,Mz=/^(?:true|false)$/i,Qz=/^null$/i;var Nz=/^undefined$/i;var rz=/^[^A-Z]*$/,uz=/^[^a-z]*$/,kI=/^[0-9a-fA-F]*$/;function oU($,v){return new RegExp(`^[A-Za-z0-9+/]{${$}}${v}$`)}function nU($){return new RegExp(`^[A-Za-z0-9_-]{${$}}$`)}var HI=/^[0-9a-fA-F]{32}$/,II=oU(22,"=="),LI=nU(22),FI=/^[0-9a-fA-F]{40}$/,YI=oU(27,"="),qI=nU(27),XI=/^[0-9a-fA-F]{64}$/,AI=oU(43,"="),wI=nU(43),ZI=/^[0-9a-fA-F]{96}$/,SI=oU(64,""),MI=nU(64),QI=/^[0-9a-fA-F]{128}$/,NI=oU(86,"=="),rI=nU(86);var N$=X("$ZodCheck",($,v)=>{var g;$._zod??($._zod={}),$._zod.def=v,(g=$._zod).onattach??(g.onattach=[])}),X5={number:"number",bigint:"bigint",object:"date"},d_=X("$ZodCheckLessThan",($,v)=>{N$.init($,v);let g=X5[typeof v.value];$._zod.onattach.push((_)=>{let U=_._zod.bag,z=(v.inclusive?U.maximum:U.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(v.value<z)if(v.inclusive)U.maximum=v.value;else U.exclusiveMaximum=v.value}),$._zod.check=(_)=>{if(v.inclusive?_.value<=v.value:_.value<v.value)return;_.issues.push({origin:g,code:"too_big",maximum:typeof v.value==="object"?v.value.getTime():v.value,input:_.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),a_=X("$ZodCheckGreaterThan",($,v)=>{N$.init($,v);let g=X5[typeof v.value];$._zod.onattach.push((_)=>{let U=_._zod.bag,z=(v.inclusive?U.minimum:U.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(v.value>z)if(v.inclusive)U.minimum=v.value;else U.exclusiveMinimum=v.value}),$._zod.check=(_)=>{if(v.inclusive?_.value>=v.value:_.value>v.value)return;_.issues.push({origin:g,code:"too_small",minimum:typeof v.value==="object"?v.value.getTime():v.value,input:_.value,inclusive:v.inclusive,inst:$,continue:!v.abort})}}),yz=X("$ZodCheckMultipleOf",($,v)=>{N$.init($,v),$._zod.onattach.push((g)=>{var _;(_=g._zod.bag).multipleOf??(_.multipleOf=v.value)}),$._zod.check=(g)=>{if(typeof g.value!==typeof v.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof g.value==="bigint"?g.value%v.value===BigInt(0):o2(g.value,v.value)===0)return;g.issues.push({origin:typeof g.value,code:"not_multiple_of",divisor:v.value,input:g.value,inst:$,continue:!v.abort})}}),Rz=X("$ZodCheckNumberFormat",($,v)=>{N$.init($,v),v.format=v.format||"float64";let g=v.format?.includes("int"),_=g?"int":"number",[U,z]=e2[v.format];$._zod.onattach.push((J)=>{let b=J._zod.bag;if(b.format=v.format,b.minimum=U,b.maximum=z,g)b.pattern=Sz}),$._zod.check=(J)=>{let b=J.value;if(g){if(!Number.isInteger(b)){J.issues.push({expected:_,format:v.format,code:"invalid_type",continue:!1,input:b,inst:$});return}if(!Number.isSafeInteger(b)){if(b>0)J.issues.push({input:b,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:_,inclusive:!0,continue:!v.abort});else J.issues.push({input:b,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:$,origin:_,inclusive:!0,continue:!v.abort});return}}if(b<U)J.issues.push({origin:"number",input:b,code:"too_small",minimum:U,inclusive:!0,inst:$,continue:!v.abort});if(b>z)J.issues.push({origin:"number",input:b,code:"too_big",maximum:z,inclusive:!0,inst:$,continue:!v.abort})}}),Dz=X("$ZodCheckBigIntFormat",($,v)=>{N$.init($,v);let[g,_]=$z[v.format];$._zod.onattach.push((U)=>{let z=U._zod.bag;z.format=v.format,z.minimum=g,z.maximum=_}),$._zod.check=(U)=>{let z=U.value;if(z<g)U.issues.push({origin:"bigint",input:z,code:"too_small",minimum:g,inclusive:!0,inst:$,continue:!v.abort});if(z>_)U.issues.push({origin:"bigint",input:z,code:"too_big",maximum:_,inclusive:!0,inst:$,continue:!v.abort})}}),Tz=X("$ZodCheckMaxSize",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Q6(U)&&U.size!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)_._zod.bag.maximum=v.maximum}),$._zod.check=(_)=>{let U=_.value;if(U.size<=v.maximum)return;_.issues.push({origin:fU(U),code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),jz=X("$ZodCheckMinSize",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Q6(U)&&U.size!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)_._zod.bag.minimum=v.minimum}),$._zod.check=(_)=>{let U=_.value;if(U.size>=v.minimum)return;_.issues.push({origin:fU(U),code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),Vz=X("$ZodCheckSizeEquals",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Q6(U)&&U.size!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.minimum=v.size,U.maximum=v.size,U.size=v.size}),$._zod.check=(_)=>{let U=_.value,z=U.size;if(z===v.size)return;let J=z>v.size;_.issues.push({origin:fU(U),...J?{code:"too_big",maximum:v.size}:{code:"too_small",minimum:v.size},inclusive:!0,exact:!0,input:_.value,inst:$,continue:!v.abort})}}),Cz=X("$ZodCheckMaxLength",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Q6(U)&&U.length!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.maximum??Number.POSITIVE_INFINITY;if(v.maximum<U)_._zod.bag.maximum=v.maximum}),$._zod.check=(_)=>{let U=_.value;if(U.length<=v.maximum)return;let J=EU(U);_.issues.push({origin:J,code:"too_big",maximum:v.maximum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),fz=X("$ZodCheckMinLength",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Q6(U)&&U.length!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(v.minimum>U)_._zod.bag.minimum=v.minimum}),$._zod.check=(_)=>{let U=_.value;if(U.length>=v.minimum)return;let J=EU(U);_.issues.push({origin:J,code:"too_small",minimum:v.minimum,inclusive:!0,input:U,inst:$,continue:!v.abort})}}),Ez=X("$ZodCheckLengthEquals",($,v)=>{var g;N$.init($,v),(g=$._zod.def).when??(g.when=(_)=>{let U=_.value;return!Q6(U)&&U.length!==void 0}),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.minimum=v.length,U.maximum=v.length,U.length=v.length}),$._zod.check=(_)=>{let U=_.value,z=U.length;if(z===v.length)return;let J=EU(U),b=z>v.length;_.issues.push({origin:J,...b?{code:"too_big",maximum:v.length}:{code:"too_small",minimum:v.length},inclusive:!0,exact:!0,input:_.value,inst:$,continue:!v.abort})}}),f4=X("$ZodCheckStringFormat",($,v)=>{var g,_;if(N$.init($,v),$._zod.onattach.push((U)=>{let z=U._zod.bag;if(z.format=v.format,v.pattern)z.patterns??(z.patterns=new Set),z.patterns.add(v.pattern)}),v.pattern)(g=$._zod).check??(g.check=(U)=>{if(v.pattern.lastIndex=0,v.pattern.test(U.value))return;U.issues.push({origin:"string",code:"invalid_format",format:v.format,input:U.value,...v.pattern?{pattern:v.pattern.toString()}:{},inst:$,continue:!v.abort})});else(_=$._zod).check??(_.check=()=>{})}),cz=X("$ZodCheckRegex",($,v)=>{f4.init($,v),$._zod.check=(g)=>{if(v.pattern.lastIndex=0,v.pattern.test(g.value))return;g.issues.push({origin:"string",code:"invalid_format",format:"regex",input:g.value,pattern:v.pattern.toString(),inst:$,continue:!v.abort})}}),mz=X("$ZodCheckLowerCase",($,v)=>{v.pattern??(v.pattern=rz),f4.init($,v)}),iz=X("$ZodCheckUpperCase",($,v)=>{v.pattern??(v.pattern=uz),f4.init($,v)}),lz=X("$ZodCheckIncludes",($,v)=>{N$.init($,v);let g=Tv(v.includes),_=new RegExp(typeof v.position==="number"?`^.{${v.position}}${g}`:g);v.pattern=_,$._zod.onattach.push((U)=>{let z=U._zod.bag;z.patterns??(z.patterns=new Set),z.patterns.add(_)}),$._zod.check=(U)=>{if(U.value.includes(v.includes,v.position))return;U.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:v.includes,input:U.value,inst:$,continue:!v.abort})}}),hz=X("$ZodCheckStartsWith",($,v)=>{N$.init($,v);let g=new RegExp(`^${Tv(v.prefix)}.*`);v.pattern??(v.pattern=g),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.startsWith(v.prefix))return;_.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:v.prefix,input:_.value,inst:$,continue:!v.abort})}}),xz=X("$ZodCheckEndsWith",($,v)=>{N$.init($,v);let g=new RegExp(`.*${Tv(v.suffix)}$`);v.pattern??(v.pattern=g),$._zod.onattach.push((_)=>{let U=_._zod.bag;U.patterns??(U.patterns=new Set),U.patterns.add(g)}),$._zod.check=(_)=>{if(_.value.endsWith(v.suffix))return;_.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:v.suffix,input:_.value,inst:$,continue:!v.abort})}});function q5($,v,g){if($.issues.length)v.issues.push(...Qv(g,$.issues))}var pz=X("$ZodCheckProperty",($,v)=>{N$.init($,v),$._zod.check=(g)=>{let _=v.schema._zod.run({value:g.value[v.property],issues:[]},{});if(_ instanceof Promise)return _.then((U)=>q5(U,g,v.property));q5(_,g,v.property);return}}),oz=X("$ZodCheckMimeType",($,v)=>{N$.init($,v);let g=new Set(v.mime);$._zod.onattach.push((_)=>{_._zod.bag.mime=v.mime}),$._zod.check=(_)=>{if(g.has(_.value.type))return;_.issues.push({code:"invalid_value",values:v.mime,input:_.value.type,inst:$,continue:!v.abort})}}),nz=X("$ZodCheckOverwrite",($,v)=>{N$.init($,v),$._zod.check=(g)=>{g.value=v.tx(g.value)}});class s_{constructor($=[]){if(this.content=[],this.indent=0,this)this.args=$}indented($){this.indent+=1,$(this),this.indent-=1}write($){if(typeof $==="function"){$(this,{execution:"sync"}),$(this,{execution:"async"});return}let g=$.split(`
109
109
  `).filter((z)=>z),_=Math.min(...g.map((z)=>z.length-z.trimStart().length)),U=g.map((z)=>z.slice(_)).map((z)=>" ".repeat(this.indent*2)+z);for(let z of U)this.content.push(z)}compile(){let $=Function,v=this?.args,_=[...(this?.content??[""]).map((U)=>` ${U}`)];return new $(...v,_.join(`
110
- `))}}var iz={major:4,minor:3,patch:6};var v$=q("$ZodType",($,v)=>{var g;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=iz;let _=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))_.unshift($);for(let U of _)for(let z of U._zod.onattach)z($);if(_.length===0)(g=$._zod).deferred??(g.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(b,J,G)=>{let K=Q6(b),W;for(let B of J){if(B._zod.def.when){if(!B._zod.def.when(b))continue}else if(K)continue;let k=b.issues.length,P=B._zod.check(b);if(P instanceof Promise&&G?.async===!1)throw new ov;if(W||P instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await P,b.issues.length===k)return;if(!K)K=Q6(b,k)});else{if(b.issues.length===k)continue;if(!K)K=Q6(b,k)}}if(W)return W.then(()=>{return b});return b},z=(b,J,G)=>{if(Q6(b))return b.aborted=!0,b;let K=U(J,_,G);if(K instanceof Promise){if(G.async===!1)throw new ov;return K.then((W)=>$._zod.parse(W,G))}return $._zod.parse(K,G)};$._zod.run=(b,J)=>{if(J.skipChecks)return $._zod.parse(b,J);if(J.direction==="backward"){let K=$._zod.parse({value:b.value,issues:[]},{...J,skipChecks:!0});if(K instanceof Promise)return K.then((W)=>{return z(W,b,J)});return z(K,b,J)}let G=$._zod.parse(b,J);if(G instanceof Promise){if(J.async===!1)throw new ov;return G.then((K)=>U(K,_,J))}return U(G,_,J)}}J$($,"~standard",()=>({validate:(U)=>{try{let z=R4($,U);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return EU($,U).then((b)=>b.success?{value:b.data}:{issues:b.error?.issues})}},vendor:"zod",version:1}))}),a6=q("$ZodString",($,v)=>{v$.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??Hz($._zod.bag),$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=String(g.value)}catch(U){}if(typeof g.value==="string")return g;return g.issues.push({expected:"string",code:"invalid_type",input:g.value,inst:$}),g}}),S$=q("$ZodStringFormat",($,v)=>{D4.init($,v),a6.init($,v)}),hz=q("$ZodGUID",($,v)=>{v.pattern??(v.pattern=gz),S$.init($,v)}),xz=q("$ZodUUID",($,v)=>{if(v.version){let _={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(_===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=d6(_))}else v.pattern??(v.pattern=d6());S$.init($,v)}),pz=q("$ZodEmail",($,v)=>{v.pattern??(v.pattern=_z),S$.init($,v)}),oz=q("$ZodURL",($,v)=>{S$.init($,v),$._zod.check=(g)=>{try{let _=g.value.trim(),U=new URL(_);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(U.hostname))g.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:g.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))g.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:g.value,inst:$,continue:!v.abort})}if(v.normalize)g.value=U.href;else g.value=_;return}catch(_){g.issues.push({code:"invalid_format",format:"url",input:g.value,inst:$,continue:!v.abort})}}}),nz=q("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=zz()),S$.init($,v)}),tz=q("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=vz),S$.init($,v)}),dz=q("$ZodCUID",($,v)=>{v.pattern??(v.pattern=d2),S$.init($,v)}),az=q("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=a2),S$.init($,v)}),sz=q("$ZodULID",($,v)=>{v.pattern??(v.pattern=s2),S$.init($,v)}),ez=q("$ZodXID",($,v)=>{v.pattern??(v.pattern=e2),S$.init($,v)}),$b=q("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=$z),S$.init($,v)}),vb=q("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=Iz(v)),S$.init($,v)}),Ub=q("$ZodISODate",($,v)=>{v.pattern??(v.pattern=Pz),S$.init($,v)}),gb=q("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=kz(v)),S$.init($,v)}),_b=q("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=Uz),S$.init($,v)}),zb=q("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=bz),S$.init($,v),$._zod.bag.format="ipv4"}),bb=q("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=Jz),S$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(g)=>{try{new URL(`http://[${g.value}]`)}catch{g.issues.push({code:"invalid_format",format:"ipv6",input:g.value,inst:$,continue:!v.abort})}}}),Jb=q("$ZodMAC",($,v)=>{v.pattern??(v.pattern=Oz(v.delimiter)),S$.init($,v),$._zod.bag.format="mac"}),Ob=q("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=Gz),S$.init($,v)}),Gb=q("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=Kz),S$.init($,v),$._zod.check=(g)=>{let _=g.value.split("/");try{if(_.length!==2)throw Error();let[U,z]=_;if(!z)throw Error();let b=Number(z);if(`${b}`!==z)throw Error();if(b<0||b>128)throw Error();new URL(`http://[${U}]`)}catch{g.issues.push({code:"invalid_format",format:"cidrv6",input:g.value,inst:$,continue:!v.abort})}}});function Kb($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var Wb=q("$ZodBase64",($,v)=>{v.pattern??(v.pattern=Wz),S$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(g)=>{if(Kb(g.value))return;g.issues.push({code:"invalid_format",format:"base64",input:g.value,inst:$,continue:!v.abort})}});function N5($){if(!i_.test($))return!1;let v=$.replace(/[-_]/g,(_)=>_==="-"?"+":"/"),g=v.padEnd(Math.ceil(v.length/4)*4,"=");return Kb(g)}var Bb=q("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=i_),S$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(g)=>{if(N5(g.value))return;g.issues.push({code:"invalid_format",format:"base64url",input:g.value,inst:$,continue:!v.abort})}}),Pb=q("$ZodE164",($,v)=>{v.pattern??(v.pattern=Bz),S$.init($,v)});function r5($,v=null){try{let g=$.split(".");if(g.length!==3)return!1;let[_]=g;if(!_)return!1;let U=JSON.parse(atob(_));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(v&&(!("alg"in U)||U.alg!==v))return!1;return!0}catch{return!1}}var kb=q("$ZodJWT",($,v)=>{S$.init($,v),$._zod.check=(g)=>{if(r5(g.value,v.alg))return;g.issues.push({code:"invalid_format",format:"jwt",input:g.value,inst:$,continue:!v.abort})}}),Ib=q("$ZodCustomStringFormat",($,v)=>{S$.init($,v),$._zod.check=(g)=>{if(v.fn(g.value))return;g.issues.push({code:"invalid_format",format:v.format,input:g.value,inst:$,continue:!v.abort})}}),a_=q("$ZodNumber",($,v)=>{v$.init($,v),$._zod.pattern=$._zod.bag.pattern??cU,$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=Number(g.value)}catch(b){}let U=g.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return g;let z=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return g.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...z?{received:z}:{}}),g}}),Hb=q("$ZodNumberFormat",($,v)=>{Sz.init($,v),a_.init($,v)}),hU=q("$ZodBoolean",($,v)=>{v$.init($,v),$._zod.pattern=Yz,$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=Boolean(g.value)}catch(z){}let U=g.value;if(typeof U==="boolean")return g;return g.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),g}}),s_=q("$ZodBigInt",($,v)=>{v$.init($,v),$._zod.pattern=Lz,$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=BigInt(g.value)}catch(U){}if(typeof g.value==="bigint")return g;return g.issues.push({expected:"bigint",code:"invalid_type",input:g.value,inst:$}),g}}),Lb=q("$ZodBigIntFormat",($,v)=>{Mz.init($,v),s_.init($,v)}),Fb=q("$ZodSymbol",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(typeof U==="symbol")return g;return g.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),g}}),Yb=q("$ZodUndefined",($,v)=>{v$.init($,v),$._zod.pattern=qz,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(g,_)=>{let U=g.value;if(typeof U>"u")return g;return g.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),g}}),Ab=q("$ZodNull",($,v)=>{v$.init($,v),$._zod.pattern=Az,$._zod.values=new Set([null]),$._zod.parse=(g,_)=>{let U=g.value;if(U===null)return g;return g.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),g}}),qb=q("$ZodAny",($,v)=>{v$.init($,v),$._zod.parse=(g)=>g}),Xb=q("$ZodUnknown",($,v)=>{v$.init($,v),$._zod.parse=(g)=>g}),wb=q("$ZodNever",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{return g.issues.push({expected:"never",code:"invalid_type",input:g.value,inst:$}),g}}),Zb=q("$ZodVoid",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(typeof U>"u")return g;return g.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),g}}),Sb=q("$ZodDate",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=new Date(g.value)}catch(J){}let U=g.value,z=U instanceof Date;if(z&&!Number.isNaN(U.getTime()))return g;return g.issues.push({expected:"date",code:"invalid_type",input:U,...z?{received:"Invalid Date"}:{},inst:$}),g}});function L5($,v,g){if($.issues.length)v.issues.push(...Mv(g,$.issues));v.value[g]=$.value}var Mb=q("$ZodArray",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!Array.isArray(U))return g.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),g;g.value=Array(U.length);let z=[];for(let b=0;b<U.length;b++){let J=U[b],G=v.element._zod.run({value:J,issues:[]},_);if(G instanceof Promise)z.push(G.then((K)=>L5(K,g,b)));else L5(G,g,b)}if(z.length)return Promise.all(z).then(()=>g);return g}});function d_($,v,g,_,U){if($.issues.length){if(U&&!(g in _))return;v.issues.push(...Mv(g,$.issues))}if($.value===void 0){if(g in _)v.value[g]=void 0}else v.value[g]=$.value}function u5($){let v=Object.keys($.shape);for(let _ of v)if(!$.shape?.[_]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${_}": expected a Zod schema`);let g=x2($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(g)}}function R5($,v,g,_,U,z){let b=[],J=U.keySet,G=U.catchall._zod,K=G.def.type,W=G.optout==="optional";for(let B in v){if(J.has(B))continue;if(K==="never"){b.push(B);continue}let k=G.run({value:v[B],issues:[]},_);if(k instanceof Promise)$.push(k.then((P)=>d_(P,g,B,v,W)));else d_(k,g,B,v,W)}if(b.length)g.issues.push({code:"unrecognized_keys",keys:b,input:v,inst:z});if(!$.length)return g;return Promise.all($).then(()=>{return g})}var y5=q("$ZodObject",($,v)=>{if(v$.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let J=v.shape;Object.defineProperty(v,"shape",{get:()=>{let G={...J};return Object.defineProperty(v,"shape",{value:G}),G}})}let _=M4(()=>u5(v));J$($._zod,"propValues",()=>{let J=v.shape,G={};for(let K in J){let W=J[K]._zod;if(W.values){G[K]??(G[K]=new Set);for(let B of W.values)G[K].add(B)}}return G});let U=t6,z=v.catchall,b;$._zod.parse=(J,G)=>{b??(b=_.value);let K=J.value;if(!U(K))return J.issues.push({expected:"object",code:"invalid_type",input:K,inst:$}),J;J.value={};let W=[],B=b.shape;for(let k of b.keys){let P=B[k],A=P._zod.optout==="optional",H=P._zod.run({value:K[k],issues:[]},G);if(H instanceof Promise)W.push(H.then((I)=>d_(I,J,k,K,A)));else d_(H,J,k,K,A)}if(!z)return W.length?Promise.all(W).then(()=>J):J;return R5(W,K,J,G,_.value,$)}}),Qb=q("$ZodObjectJIT",($,v)=>{y5.init($,v);let g=$._zod.parse,_=M4(()=>u5(v)),U=(k)=>{let P=new x_(["shape","payload","ctx"]),A=_.value,H=(X)=>{let Q=y_(X);return`shape[${Q}]._zod.run({ value: input[${Q}], issues: [] }, ctx)`};P.write("const input = payload.value;");let I=Object.create(null),F=0;for(let X of A.keys)I[X]=`key_${F++}`;P.write("const newResult = {};");for(let X of A.keys){let Q=I[X],u=y_(X),M=k[X]?._zod?.optout==="optional";if(P.write(`const ${Q} = ${H(X)};`),M)P.write(`
111
- if (${Q}.issues.length) {
112
- if (${u} in input) {
113
- payload.issues = payload.issues.concat(${Q}.issues.map(iss => ({
110
+ `))}}var tz={major:4,minor:3,patch:6};var v$=X("$ZodType",($,v)=>{var g;$??($={}),$._zod.def=v,$._zod.bag=$._zod.bag||{},$._zod.version=tz;let _=[...$._zod.def.checks??[]];if($._zod.traits.has("$ZodCheck"))_.unshift($);for(let U of _)for(let z of U._zod.onattach)z($);if(_.length===0)(g=$._zod).deferred??(g.deferred=[]),$._zod.deferred?.push(()=>{$._zod.run=$._zod.parse});else{let U=(J,b,G)=>{let K=u6(J),W;for(let B of b){if(B._zod.def.when){if(!B._zod.def.when(J))continue}else if(K)continue;let k=J.issues.length,P=B._zod.check(J);if(P instanceof Promise&&G?.async===!1)throw new nv;if(W||P instanceof Promise)W=(W??Promise.resolve()).then(async()=>{if(await P,J.issues.length===k)return;if(!K)K=u6(J,k)});else{if(J.issues.length===k)continue;if(!K)K=u6(J,k)}}if(W)return W.then(()=>{return J});return J},z=(J,b,G)=>{if(u6(J))return J.aborted=!0,J;let K=U(b,_,G);if(K instanceof Promise){if(G.async===!1)throw new nv;return K.then((W)=>$._zod.parse(W,G))}return $._zod.parse(K,G)};$._zod.run=(J,b)=>{if(b.skipChecks)return $._zod.parse(J,b);if(b.direction==="backward"){let K=$._zod.parse({value:J.value,issues:[]},{...b,skipChecks:!0});if(K instanceof Promise)return K.then((W)=>{return z(W,J,b)});return z(K,J,b)}let G=$._zod.parse(J,b);if(G instanceof Promise){if(b.async===!1)throw new nv;return G.then((K)=>U(K,_,b))}return U(G,_,b)}}b$($,"~standard",()=>({validate:(U)=>{try{let z=V4($,U);return z.success?{value:z.data}:{issues:z.error?.issues}}catch(z){return xU($,U).then((J)=>J.success?{value:J.data}:{issues:J.error?.issues})}},vendor:"zod",version:1}))}),$4=X("$ZodString",($,v)=>{v$.init($,v),$._zod.pattern=[...$?._zod.bag?.patterns??[]].pop()??wz($._zod.bag),$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=String(g.value)}catch(U){}if(typeof g.value==="string")return g;return g.issues.push({expected:"string",code:"invalid_type",input:g.value,inst:$}),g}}),S$=X("$ZodStringFormat",($,v)=>{f4.init($,v),$4.init($,v)}),az=X("$ZodGUID",($,v)=>{v.pattern??(v.pattern=Kz),S$.init($,v)}),sz=X("$ZodUUID",($,v)=>{if(v.version){let _={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[v.version];if(_===void 0)throw Error(`Invalid UUID version: "${v.version}"`);v.pattern??(v.pattern=e6(_))}else v.pattern??(v.pattern=e6());S$.init($,v)}),ez=X("$ZodEmail",($,v)=>{v.pattern??(v.pattern=Wz),S$.init($,v)}),$J=X("$ZodURL",($,v)=>{S$.init($,v),$._zod.check=(g)=>{try{let _=g.value.trim(),U=new URL(_);if(v.hostname){if(v.hostname.lastIndex=0,!v.hostname.test(U.hostname))g.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:v.hostname.source,input:g.value,inst:$,continue:!v.abort})}if(v.protocol){if(v.protocol.lastIndex=0,!v.protocol.test(U.protocol.endsWith(":")?U.protocol.slice(0,-1):U.protocol))g.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:v.protocol.source,input:g.value,inst:$,continue:!v.abort})}if(v.normalize)g.value=U.href;else g.value=_;return}catch(_){g.issues.push({code:"invalid_format",format:"url",input:g.value,inst:$,continue:!v.abort})}}}),vJ=X("$ZodEmoji",($,v)=>{v.pattern??(v.pattern=Bz()),S$.init($,v)}),UJ=X("$ZodNanoID",($,v)=>{v.pattern??(v.pattern=Oz),S$.init($,v)}),gJ=X("$ZodCUID",($,v)=>{v.pattern??(v.pattern=gz),S$.init($,v)}),_J=X("$ZodCUID2",($,v)=>{v.pattern??(v.pattern=_z),S$.init($,v)}),zJ=X("$ZodULID",($,v)=>{v.pattern??(v.pattern=zz),S$.init($,v)}),JJ=X("$ZodXID",($,v)=>{v.pattern??(v.pattern=Jz),S$.init($,v)}),bJ=X("$ZodKSUID",($,v)=>{v.pattern??(v.pattern=bz),S$.init($,v)}),OJ=X("$ZodISODateTime",($,v)=>{v.pattern??(v.pattern=Az(v)),S$.init($,v)}),GJ=X("$ZodISODate",($,v)=>{v.pattern??(v.pattern=qz),S$.init($,v)}),KJ=X("$ZodISOTime",($,v)=>{v.pattern??(v.pattern=Xz(v)),S$.init($,v)}),WJ=X("$ZodISODuration",($,v)=>{v.pattern??(v.pattern=Gz),S$.init($,v)}),BJ=X("$ZodIPv4",($,v)=>{v.pattern??(v.pattern=Pz),S$.init($,v),$._zod.bag.format="ipv4"}),PJ=X("$ZodIPv6",($,v)=>{v.pattern??(v.pattern=kz),S$.init($,v),$._zod.bag.format="ipv6",$._zod.check=(g)=>{try{new URL(`http://[${g.value}]`)}catch{g.issues.push({code:"invalid_format",format:"ipv6",input:g.value,inst:$,continue:!v.abort})}}}),kJ=X("$ZodMAC",($,v)=>{v.pattern??(v.pattern=Hz(v.delimiter)),S$.init($,v),$._zod.bag.format="mac"}),HJ=X("$ZodCIDRv4",($,v)=>{v.pattern??(v.pattern=Iz),S$.init($,v)}),IJ=X("$ZodCIDRv6",($,v)=>{v.pattern??(v.pattern=Lz),S$.init($,v),$._zod.check=(g)=>{let _=g.value.split("/");try{if(_.length!==2)throw Error();let[U,z]=_;if(!z)throw Error();let J=Number(z);if(`${J}`!==z)throw Error();if(J<0||J>128)throw Error();new URL(`http://[${U}]`)}catch{g.issues.push({code:"invalid_format",format:"cidrv6",input:g.value,inst:$,continue:!v.abort})}}});function LJ($){if($==="")return!0;if($.length%4!==0)return!1;try{return atob($),!0}catch{return!1}}var FJ=X("$ZodBase64",($,v)=>{v.pattern??(v.pattern=Fz),S$.init($,v),$._zod.bag.contentEncoding="base64",$._zod.check=(g)=>{if(LJ(g.value))return;g.issues.push({code:"invalid_format",format:"base64",input:g.value,inst:$,continue:!v.abort})}});function T5($){if(!t_.test($))return!1;let v=$.replace(/[-_]/g,(_)=>_==="-"?"+":"/"),g=v.padEnd(Math.ceil(v.length/4)*4,"=");return LJ(g)}var YJ=X("$ZodBase64URL",($,v)=>{v.pattern??(v.pattern=t_),S$.init($,v),$._zod.bag.contentEncoding="base64url",$._zod.check=(g)=>{if(T5(g.value))return;g.issues.push({code:"invalid_format",format:"base64url",input:g.value,inst:$,continue:!v.abort})}}),qJ=X("$ZodE164",($,v)=>{v.pattern??(v.pattern=Yz),S$.init($,v)});function j5($,v=null){try{let g=$.split(".");if(g.length!==3)return!1;let[_]=g;if(!_)return!1;let U=JSON.parse(atob(_));if("typ"in U&&U?.typ!=="JWT")return!1;if(!U.alg)return!1;if(v&&(!("alg"in U)||U.alg!==v))return!1;return!0}catch{return!1}}var XJ=X("$ZodJWT",($,v)=>{S$.init($,v),$._zod.check=(g)=>{if(j5(g.value,v.alg))return;g.issues.push({code:"invalid_format",format:"jwt",input:g.value,inst:$,continue:!v.abort})}}),AJ=X("$ZodCustomStringFormat",($,v)=>{S$.init($,v),$._zod.check=(g)=>{if(v.fn(g.value))return;g.issues.push({code:"invalid_format",format:v.format,input:g.value,inst:$,continue:!v.abort})}}),_1=X("$ZodNumber",($,v)=>{v$.init($,v),$._zod.pattern=$._zod.bag.pattern??pU,$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=Number(g.value)}catch(J){}let U=g.value;if(typeof U==="number"&&!Number.isNaN(U)&&Number.isFinite(U))return g;let z=typeof U==="number"?Number.isNaN(U)?"NaN":!Number.isFinite(U)?"Infinity":void 0:void 0;return g.issues.push({expected:"number",code:"invalid_type",input:U,inst:$,...z?{received:z}:{}}),g}}),wJ=X("$ZodNumberFormat",($,v)=>{Rz.init($,v),_1.init($,v)}),tU=X("$ZodBoolean",($,v)=>{v$.init($,v),$._zod.pattern=Mz,$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=Boolean(g.value)}catch(z){}let U=g.value;if(typeof U==="boolean")return g;return g.issues.push({expected:"boolean",code:"invalid_type",input:U,inst:$}),g}}),z1=X("$ZodBigInt",($,v)=>{v$.init($,v),$._zod.pattern=Zz,$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=BigInt(g.value)}catch(U){}if(typeof g.value==="bigint")return g;return g.issues.push({expected:"bigint",code:"invalid_type",input:g.value,inst:$}),g}}),ZJ=X("$ZodBigIntFormat",($,v)=>{Dz.init($,v),z1.init($,v)}),SJ=X("$ZodSymbol",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(typeof U==="symbol")return g;return g.issues.push({expected:"symbol",code:"invalid_type",input:U,inst:$}),g}}),MJ=X("$ZodUndefined",($,v)=>{v$.init($,v),$._zod.pattern=Nz,$._zod.values=new Set([void 0]),$._zod.optin="optional",$._zod.optout="optional",$._zod.parse=(g,_)=>{let U=g.value;if(typeof U>"u")return g;return g.issues.push({expected:"undefined",code:"invalid_type",input:U,inst:$}),g}}),QJ=X("$ZodNull",($,v)=>{v$.init($,v),$._zod.pattern=Qz,$._zod.values=new Set([null]),$._zod.parse=(g,_)=>{let U=g.value;if(U===null)return g;return g.issues.push({expected:"null",code:"invalid_type",input:U,inst:$}),g}}),NJ=X("$ZodAny",($,v)=>{v$.init($,v),$._zod.parse=(g)=>g}),rJ=X("$ZodUnknown",($,v)=>{v$.init($,v),$._zod.parse=(g)=>g}),uJ=X("$ZodNever",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{return g.issues.push({expected:"never",code:"invalid_type",input:g.value,inst:$}),g}}),yJ=X("$ZodVoid",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(typeof U>"u")return g;return g.issues.push({expected:"void",code:"invalid_type",input:U,inst:$}),g}}),RJ=X("$ZodDate",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(v.coerce)try{g.value=new Date(g.value)}catch(b){}let U=g.value,z=U instanceof Date;if(z&&!Number.isNaN(U.getTime()))return g;return g.issues.push({expected:"date",code:"invalid_type",input:U,...z?{received:"Invalid Date"}:{},inst:$}),g}});function w5($,v,g){if($.issues.length)v.issues.push(...Qv(g,$.issues));v.value[g]=$.value}var DJ=X("$ZodArray",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!Array.isArray(U))return g.issues.push({expected:"array",code:"invalid_type",input:U,inst:$}),g;g.value=Array(U.length);let z=[];for(let J=0;J<U.length;J++){let b=U[J],G=v.element._zod.run({value:b,issues:[]},_);if(G instanceof Promise)z.push(G.then((K)=>w5(K,g,J)));else w5(G,g,J)}if(z.length)return Promise.all(z).then(()=>g);return g}});function g1($,v,g,_,U){if($.issues.length){if(U&&!(g in _))return;v.issues.push(...Qv(g,$.issues))}if($.value===void 0){if(g in _)v.value[g]=void 0}else v.value[g]=$.value}function V5($){let v=Object.keys($.shape);for(let _ of v)if(!$.shape?.[_]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${_}": expected a Zod schema`);let g=s2($.shape);return{...$,keys:v,keySet:new Set(v),numKeys:v.length,optionalKeys:new Set(g)}}function C5($,v,g,_,U,z){let J=[],b=U.keySet,G=U.catchall._zod,K=G.def.type,W=G.optout==="optional";for(let B in v){if(b.has(B))continue;if(K==="never"){J.push(B);continue}let k=G.run({value:v[B],issues:[]},_);if(k instanceof Promise)$.push(k.then((P)=>g1(P,g,B,v,W)));else g1(k,g,B,v,W)}if(J.length)g.issues.push({code:"unrecognized_keys",keys:J,input:v,inst:z});if(!$.length)return g;return Promise.all($).then(()=>{return g})}var f5=X("$ZodObject",($,v)=>{if(v$.init($,v),!Object.getOwnPropertyDescriptor(v,"shape")?.get){let b=v.shape;Object.defineProperty(v,"shape",{get:()=>{let G={...b};return Object.defineProperty(v,"shape",{value:G}),G}})}let _=y4(()=>V5(v));b$($._zod,"propValues",()=>{let b=v.shape,G={};for(let K in b){let W=b[K]._zod;if(W.values){G[K]??(G[K]=new Set);for(let B of W.values)G[K].add(B)}}return G});let U=s6,z=v.catchall,J;$._zod.parse=(b,G)=>{J??(J=_.value);let K=b.value;if(!U(K))return b.issues.push({expected:"object",code:"invalid_type",input:K,inst:$}),b;b.value={};let W=[],B=J.shape;for(let k of J.keys){let P=B[k],q=P._zod.optout==="optional",L=P._zod.run({value:K[k],issues:[]},G);if(L instanceof Promise)W.push(L.then((H)=>g1(H,b,k,K,q)));else g1(L,b,k,K,q)}if(!z)return W.length?Promise.all(W).then(()=>b):b;return C5(W,K,b,G,_.value,$)}}),TJ=X("$ZodObjectJIT",($,v)=>{f5.init($,v);let g=$._zod.parse,_=y4(()=>V5(v)),U=(k)=>{let P=new s_(["shape","payload","ctx"]),q=_.value,L=(A)=>{let M=E_(A);return`shape[${M}]._zod.run({ value: input[${M}], issues: [] }, ctx)`};P.write("const input = payload.value;");let H=Object.create(null),F=0;for(let A of q.keys)H[A]=`key_${F++}`;P.write("const newResult = {};");for(let A of q.keys){let M=H[A],V=E_(A),N=k[A]?._zod?.optout==="optional";if(P.write(`const ${M} = ${L(A)};`),N)P.write(`
111
+ if (${M}.issues.length) {
112
+ if (${V} in input) {
113
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
114
114
  ...iss,
115
- path: iss.path ? [${u}, ...iss.path] : [${u}]
115
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
116
116
  })));
117
117
  }
118
118
  }
119
119
 
120
- if (${Q}.value === undefined) {
121
- if (${u} in input) {
122
- newResult[${u}] = undefined;
120
+ if (${M}.value === undefined) {
121
+ if (${V} in input) {
122
+ newResult[${V}] = undefined;
123
123
  }
124
124
  } else {
125
- newResult[${u}] = ${Q}.value;
125
+ newResult[${V}] = ${M}.value;
126
126
  }
127
127
 
128
128
  `);else P.write(`
129
- if (${Q}.issues.length) {
130
- payload.issues = payload.issues.concat(${Q}.issues.map(iss => ({
129
+ if (${M}.issues.length) {
130
+ payload.issues = payload.issues.concat(${M}.issues.map(iss => ({
131
131
  ...iss,
132
- path: iss.path ? [${u}, ...iss.path] : [${u}]
132
+ path: iss.path ? [${V}, ...iss.path] : [${V}]
133
133
  })));
134
134
  }
135
135
 
136
- if (${Q}.value === undefined) {
137
- if (${u} in input) {
138
- newResult[${u}] = undefined;
136
+ if (${M}.value === undefined) {
137
+ if (${V} in input) {
138
+ newResult[${V}] = undefined;
139
139
  }
140
140
  } else {
141
- newResult[${u}] = ${Q}.value;
141
+ newResult[${V}] = ${M}.value;
142
142
  }
143
143
 
144
- `)}P.write("payload.value = newResult;"),P.write("return payload;");let Y=P.compile();return(X,Q)=>Y(k,X,Q)},z,b=t6,J=!NU.jitless,K=J&&i2.value,W=v.catchall,B;$._zod.parse=(k,P)=>{B??(B=_.value);let A=k.value;if(!b(A))return k.issues.push({expected:"object",code:"invalid_type",input:A,inst:$}),k;if(J&&K&&P?.async===!1&&P.jitless!==!0){if(!z)z=U(v.shape);if(k=z(k,P),!W)return k;return R5([],A,k,P,B,$)}return g(k,P)}});function F5($,v,g,_){for(let z of $)if(z.issues.length===0)return v.value=z.value,v;let U=$.filter((z)=>!Q6(z));if(U.length===1)return v.value=U[0].value,U[0];return v.issues.push({code:"invalid_union",input:v.value,inst:g,errors:$.map((z)=>z.issues.map((b)=>Av(b,_,x$())))}),v}var xU=q("$ZodUnion",($,v)=>{v$.init($,v),J$($._zod,"optin",()=>v.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),J$($._zod,"optout",()=>v.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),J$($._zod,"values",()=>{if(v.options.every((U)=>U._zod.values))return new Set(v.options.flatMap((U)=>Array.from(U._zod.values)));return}),J$($._zod,"pattern",()=>{if(v.options.every((U)=>U._zod.pattern)){let U=v.options.map((z)=>z._zod.pattern);return new RegExp(`^(${U.map((z)=>RU(z.source)).join("|")})$`)}return});let g=v.options.length===1,_=v.options[0]._zod.run;$._zod.parse=(U,z)=>{if(g)return _(U,z);let b=!1,J=[];for(let G of v.options){let K=G._zod.run({value:U.value,issues:[]},z);if(K instanceof Promise)J.push(K),b=!0;else{if(K.issues.length===0)return K;J.push(K)}}if(!b)return F5(J,U,$,z);return Promise.all(J).then((G)=>{return F5(G,U,$,z)})}});function Y5($,v,g,_){let U=$.filter((z)=>z.issues.length===0);if(U.length===1)return v.value=U[0].value,v;if(U.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:g,errors:$.map((z)=>z.issues.map((b)=>Av(b,_,x$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:g,errors:[],inclusive:!1});return v}var Nb=q("$ZodXor",($,v)=>{xU.init($,v),v.inclusive=!1;let g=v.options.length===1,_=v.options[0]._zod.run;$._zod.parse=(U,z)=>{if(g)return _(U,z);let b=!1,J=[];for(let G of v.options){let K=G._zod.run({value:U.value,issues:[]},z);if(K instanceof Promise)J.push(K),b=!0;else J.push(K)}if(!b)return Y5(J,U,$,z);return Promise.all(J).then((G)=>{return Y5(G,U,$,z)})}}),rb=q("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,xU.init($,v);let g=$._zod.parse;J$($._zod,"propValues",()=>{let U={};for(let z of v.options){let b=z._zod.propValues;if(!b||Object.keys(b).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(z)}"`);for(let[J,G]of Object.entries(b)){if(!U[J])U[J]=new Set;for(let K of G)U[J].add(K)}}return U});let _=M4(()=>{let U=v.options,z=new Map;for(let b of U){let J=b._zod.propValues?.[v.discriminator];if(!J||J.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(b)}"`);for(let G of J){if(z.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);z.set(G,b)}}return z});$._zod.parse=(U,z)=>{let b=U.value;if(!t6(b))return U.issues.push({code:"invalid_type",expected:"object",input:b,inst:$}),U;let J=_.value.get(b?.[v.discriminator]);if(J)return J._zod.run(U,z);if(v.unionFallback)return g(U,z);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:b,path:[v.discriminator],inst:$}),U}}),ub=q("$ZodIntersection",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value,z=v.left._zod.run({value:U,issues:[]},_),b=v.right._zod.run({value:U,issues:[]},_);if(z instanceof Promise||b instanceof Promise)return Promise.all([z,b]).then(([G,K])=>{return A5(g,G,K)});return A5(g,z,b)}});function lz($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(M6($)&&M6(v)){let g=Object.keys(v),_=Object.keys($).filter((z)=>g.indexOf(z)!==-1),U={...$,...v};for(let z of _){let b=lz($[z],v[z]);if(!b.valid)return{valid:!1,mergeErrorPath:[z,...b.mergeErrorPath]};U[z]=b.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let g=[];for(let _=0;_<$.length;_++){let U=$[_],z=v[_],b=lz(U,z);if(!b.valid)return{valid:!1,mergeErrorPath:[_,...b.mergeErrorPath]};g.push(b.data)}return{valid:!0,data:g}}return{valid:!1,mergeErrorPath:[]}}function A5($,v,g){let _=new Map,U;for(let J of v.issues)if(J.code==="unrecognized_keys"){U??(U=J);for(let G of J.keys){if(!_.has(G))_.set(G,{});_.get(G).l=!0}}else $.issues.push(J);for(let J of g.issues)if(J.code==="unrecognized_keys")for(let G of J.keys){if(!_.has(G))_.set(G,{});_.get(G).r=!0}else $.issues.push(J);let z=[..._].filter(([,J])=>J.l&&J.r).map(([J])=>J);if(z.length&&U)$.issues.push({...U,keys:z});if(Q6($))return $;let b=lz(v.value,g.value);if(!b.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(b.mergeErrorPath)}`);return $.value=b.data,$}var e_=q("$ZodTuple",($,v)=>{v$.init($,v);let g=v.items;$._zod.parse=(_,U)=>{let z=_.value;if(!Array.isArray(z))return _.issues.push({input:z,inst:$,expected:"tuple",code:"invalid_type"}),_;_.value=[];let b=[],J=[...g].reverse().findIndex((W)=>W._zod.optin!=="optional"),G=J===-1?0:g.length-J;if(!v.rest){let W=z.length>g.length,B=z.length<G-1;if(W||B)return _.issues.push({...W?{code:"too_big",maximum:g.length,inclusive:!0}:{code:"too_small",minimum:g.length},input:z,inst:$,origin:"array"}),_}let K=-1;for(let W of g){if(K++,K>=z.length){if(K>=G)continue}let B=W._zod.run({value:z[K],issues:[]},U);if(B instanceof Promise)b.push(B.then((k)=>p_(k,_,K)));else p_(B,_,K)}if(v.rest){let W=z.slice(g.length);for(let B of W){K++;let k=v.rest._zod.run({value:B,issues:[]},U);if(k instanceof Promise)b.push(k.then((P)=>p_(P,_,K)));else p_(k,_,K)}}if(b.length)return Promise.all(b).then(()=>_);return _}});function p_($,v,g){if($.issues.length)v.issues.push(...Mv(g,$.issues));v.value[g]=$.value}var Rb=q("$ZodRecord",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!M6(U))return g.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),g;let z=[],b=v.keyType._zod.values;if(b){g.value={};let J=new Set;for(let K of b)if(typeof K==="string"||typeof K==="number"||typeof K==="symbol"){J.add(typeof K==="number"?K.toString():K);let W=v.valueType._zod.run({value:U[K],issues:[]},_);if(W instanceof Promise)z.push(W.then((B)=>{if(B.issues.length)g.issues.push(...Mv(K,B.issues));g.value[K]=B.value}));else{if(W.issues.length)g.issues.push(...Mv(K,W.issues));g.value[K]=W.value}}let G;for(let K in U)if(!J.has(K))G=G??[],G.push(K);if(G&&G.length>0)g.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:G})}else{g.value={};for(let J of Reflect.ownKeys(U)){if(J==="__proto__")continue;let G=v.keyType._zod.run({value:J,issues:[]},_);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof J==="string"&&cU.test(J)&&G.issues.length){let B=v.keyType._zod.run({value:Number(J),issues:[]},_);if(B instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(B.issues.length===0)G=B}if(G.issues.length){if(v.mode==="loose")g.value[J]=U[J];else g.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((B)=>Av(B,_,x$())),input:J,path:[J],inst:$});continue}let W=v.valueType._zod.run({value:U[J],issues:[]},_);if(W instanceof Promise)z.push(W.then((B)=>{if(B.issues.length)g.issues.push(...Mv(J,B.issues));g.value[G.value]=B.value}));else{if(W.issues.length)g.issues.push(...Mv(J,W.issues));g.value[G.value]=W.value}}}if(z.length)return Promise.all(z).then(()=>g);return g}}),yb=q("$ZodMap",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!(U instanceof Map))return g.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),g;let z=[];g.value=new Map;for(let[b,J]of U){let G=v.keyType._zod.run({value:b,issues:[]},_),K=v.valueType._zod.run({value:J,issues:[]},_);if(G instanceof Promise||K instanceof Promise)z.push(Promise.all([G,K]).then(([W,B])=>{q5(W,B,g,b,U,$,_)}));else q5(G,K,g,b,U,$,_)}if(z.length)return Promise.all(z).then(()=>g);return g}});function q5($,v,g,_,U,z,b){if($.issues.length)if(yU.has(typeof _))g.issues.push(...Mv(_,$.issues));else g.issues.push({code:"invalid_key",origin:"map",input:U,inst:z,issues:$.issues.map((J)=>Av(J,b,x$()))});if(v.issues.length)if(yU.has(typeof _))g.issues.push(...Mv(_,v.issues));else g.issues.push({origin:"map",code:"invalid_element",input:U,inst:z,key:_,issues:v.issues.map((J)=>Av(J,b,x$()))});g.value.set($.value,v.value)}var Db=q("$ZodSet",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!(U instanceof Set))return g.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),g;let z=[];g.value=new Set;for(let b of U){let J=v.valueType._zod.run({value:b,issues:[]},_);if(J instanceof Promise)z.push(J.then((G)=>X5(G,g)));else X5(J,g)}if(z.length)return Promise.all(z).then(()=>g);return g}});function X5($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var Tb=q("$ZodEnum",($,v)=>{v$.init($,v);let g=uU(v.entries),_=new Set(g);$._zod.values=_,$._zod.pattern=new RegExp(`^(${g.filter((U)=>yU.has(typeof U)).map((U)=>typeof U==="string"?Rv(U):U.toString()).join("|")})$`),$._zod.parse=(U,z)=>{let b=U.value;if(_.has(b))return U;return U.issues.push({code:"invalid_value",values:g,input:b,inst:$}),U}}),jb=q("$ZodLiteral",($,v)=>{if(v$.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let g=new Set(v.values);$._zod.values=g,$._zod.pattern=new RegExp(`^(${v.values.map((_)=>typeof _==="string"?Rv(_):_?Rv(_.toString()):String(_)).join("|")})$`),$._zod.parse=(_,U)=>{let z=_.value;if(g.has(z))return _;return _.issues.push({code:"invalid_value",values:v.values,input:z,inst:$}),_}}),Vb=q("$ZodFile",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(U instanceof File)return g;return g.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),g}}),Cb=q("$ZodTransform",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new n6($.constructor.name);let U=v.transform(g.value,g);if(_.async)return(U instanceof Promise?U:Promise.resolve(U)).then((b)=>{return g.value=b,g});if(U instanceof Promise)throw new ov;return g.value=U,g}});function w5($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}var $1=q("$ZodOptional",($,v)=>{v$.init($,v),$._zod.optin="optional",$._zod.optout="optional",J$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),J$($._zod,"pattern",()=>{let g=v.innerType._zod.pattern;return g?new RegExp(`^(${RU(g.source)})?$`):void 0}),$._zod.parse=(g,_)=>{if(v.innerType._zod.optin==="optional"){let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>w5(z,g.value));return w5(U,g.value)}if(g.value===void 0)return g;return v.innerType._zod.run(g,_)}}),fb=q("$ZodExactOptional",($,v)=>{$1.init($,v),J$($._zod,"values",()=>v.innerType._zod.values),J$($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(g,_)=>{return v.innerType._zod.run(g,_)}}),mb=q("$ZodNullable",($,v)=>{v$.init($,v),J$($._zod,"optin",()=>v.innerType._zod.optin),J$($._zod,"optout",()=>v.innerType._zod.optout),J$($._zod,"pattern",()=>{let g=v.innerType._zod.pattern;return g?new RegExp(`^(${RU(g.source)}|null)$`):void 0}),J$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(g,_)=>{if(g.value===null)return g;return v.innerType._zod.run(g,_)}}),Eb=q("$ZodDefault",($,v)=>{v$.init($,v),$._zod.optin="optional",J$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);if(g.value===void 0)return g.value=v.defaultValue,g;let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>Z5(z,v));return Z5(U,v)}});function Z5($,v){if($.value===void 0)$.value=v.defaultValue;return $}var cb=q("$ZodPrefault",($,v)=>{v$.init($,v),$._zod.optin="optional",J$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);if(g.value===void 0)g.value=v.defaultValue;return v.innerType._zod.run(g,_)}}),ib=q("$ZodNonOptional",($,v)=>{v$.init($,v),J$($._zod,"values",()=>{let g=v.innerType._zod.values;return g?new Set([...g].filter((_)=>_!==void 0)):void 0}),$._zod.parse=(g,_)=>{let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>S5(z,$));return S5(U,$)}});function S5($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var lb=q("$ZodSuccess",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new n6("ZodSuccess");let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>{return g.value=z.issues.length===0,g});return g.value=U.issues.length===0,g}}),hb=q("$ZodCatch",($,v)=>{v$.init($,v),J$($._zod,"optin",()=>v.innerType._zod.optin),J$($._zod,"optout",()=>v.innerType._zod.optout),J$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>{if(g.value=z.value,z.issues.length)g.value=v.catchValue({...g,error:{issues:z.issues.map((b)=>Av(b,_,x$()))},input:g.value}),g.issues=[];return g});if(g.value=U.value,U.issues.length)g.value=v.catchValue({...g,error:{issues:U.issues.map((z)=>Av(z,_,x$()))},input:g.value}),g.issues=[];return g}}),xb=q("$ZodNaN",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(typeof g.value!=="number"||!Number.isNaN(g.value))return g.issues.push({input:g.value,inst:$,expected:"nan",code:"invalid_type"}),g;return g}}),pb=q("$ZodPipe",($,v)=>{v$.init($,v),J$($._zod,"values",()=>v.in._zod.values),J$($._zod,"optin",()=>v.in._zod.optin),J$($._zod,"optout",()=>v.out._zod.optout),J$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(g,_)=>{if(_.direction==="backward"){let z=v.out._zod.run(g,_);if(z instanceof Promise)return z.then((b)=>o_(b,v.in,_));return o_(z,v.in,_)}let U=v.in._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>o_(z,v.out,_));return o_(U,v.out,_)}});function o_($,v,g){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},g)}var pU=q("$ZodCodec",($,v)=>{v$.init($,v),J$($._zod,"values",()=>v.in._zod.values),J$($._zod,"optin",()=>v.in._zod.optin),J$($._zod,"optout",()=>v.out._zod.optout),J$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(g,_)=>{if((_.direction||"forward")==="forward"){let z=v.in._zod.run(g,_);if(z instanceof Promise)return z.then((b)=>n_(b,v,_));return n_(z,v,_)}else{let z=v.out._zod.run(g,_);if(z instanceof Promise)return z.then((b)=>n_(b,v,_));return n_(z,v,_)}}});function n_($,v,g){if($.issues.length)return $.aborted=!0,$;if((g.direction||"forward")==="forward"){let U=v.transform($.value,$);if(U instanceof Promise)return U.then((z)=>t_($,z,v.out,g));return t_($,U,v.out,g)}else{let U=v.reverseTransform($.value,$);if(U instanceof Promise)return U.then((z)=>t_($,z,v.in,g));return t_($,U,v.in,g)}}function t_($,v,g,_){if($.issues.length)return $.aborted=!0,$;return g._zod.run({value:v,issues:$.issues},_)}var ob=q("$ZodReadonly",($,v)=>{v$.init($,v),J$($._zod,"propValues",()=>v.innerType._zod.propValues),J$($._zod,"values",()=>v.innerType._zod.values),J$($._zod,"optin",()=>v.innerType?._zod?.optin),J$($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then(M5);return M5(U)}});function M5($){return $.value=Object.freeze($.value),$}var nb=q("$ZodTemplateLiteral",($,v)=>{v$.init($,v);let g=[];for(let _ of v.parts)if(typeof _==="object"&&_!==null){if(!_._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[..._._zod.traits].shift()}`);let U=_._zod.pattern instanceof RegExp?_._zod.pattern.source:_._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${_._zod.traits}`);let z=U.startsWith("^")?1:0,b=U.endsWith("$")?U.length-1:U.length;g.push(U.slice(z,b))}else if(_===null||h2.has(typeof _))g.push(Rv(`${_}`));else throw Error(`Invalid template literal part: ${_}`);$._zod.pattern=new RegExp(`^${g.join("")}$`),$._zod.parse=(_,U)=>{if(typeof _.value!=="string")return _.issues.push({input:_.value,inst:$,expected:"string",code:"invalid_type"}),_;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(_.value))return _.issues.push({input:_.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),_;return _}}),tb=q("$ZodFunction",($,v)=>{return v$.init($,v),$._def=v,$._zod.def=v,$.implement=(g)=>{if(typeof g!=="function")throw Error("implement() must be called with a function");return function(..._){let U=$._def.input?fU($._def.input,_):_,z=Reflect.apply(g,this,U);if($._def.output)return fU($._def.output,z);return z}},$.implementAsync=(g)=>{if(typeof g!=="function")throw Error("implementAsync() must be called with a function");return async function(..._){let U=$._def.input?await mU($._def.input,_):_,z=await Reflect.apply(g,this,U);if($._def.output)return await mU($._def.output,z);return z}},$._zod.parse=(g,_)=>{if(typeof g.value!=="function")return g.issues.push({code:"invalid_type",expected:"function",input:g.value,inst:$}),g;if($._def.output&&$._def.output._zod.def.type==="promise")g.value=$.implementAsync(g.value);else g.value=$.implement(g.value);return g},$.input=(...g)=>{let _=$.constructor;if(Array.isArray(g[0]))return new _({type:"function",input:new e_({type:"tuple",items:g[0],rest:g[1]}),output:$._def.output});return new _({type:"function",input:g[0],output:$._def.output})},$.output=(g)=>{return new $.constructor({type:"function",input:$._def.input,output:g})},$}),db=q("$ZodPromise",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{return Promise.resolve(g.value).then((U)=>v.innerType._zod.run({value:U,issues:[]},_))}}),ab=q("$ZodLazy",($,v)=>{v$.init($,v),J$($._zod,"innerType",()=>v.getter()),J$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),J$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),J$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),J$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(g,_)=>{return $._zod.innerType._zod.run(g,_)}}),sb=q("$ZodCustom",($,v)=>{N$.init($,v),v$.init($,v),$._zod.parse=(g,_)=>{return g},$._zod.check=(g)=>{let _=g.value,U=v.fn(_);if(U instanceof Promise)return U.then((z)=>Q5(z,g,_,$));Q5(U,g,_,$);return}});function Q5($,v,g,_){if(!$){let U={code:"custom",input:g,inst:_,path:[..._._zod.def.path??[]],continue:!_._zod.def.abort};if(_._zod.def.params)U.params=_._zod.def.params;v.issues.push(Q4(U))}}var aU={};ev(aU,{zhTW:()=>lJ,zhCN:()=>iJ,yo:()=>hJ,vi:()=>cJ,uz:()=>EJ,ur:()=>mJ,uk:()=>dU,ua:()=>fJ,tr:()=>CJ,th:()=>VJ,ta:()=>jJ,sv:()=>TJ,sl:()=>DJ,ru:()=>yJ,pt:()=>RJ,ps:()=>rJ,pl:()=>uJ,ota:()=>NJ,no:()=>QJ,nl:()=>MJ,ms:()=>SJ,mk:()=>ZJ,lt:()=>wJ,ko:()=>XJ,km:()=>nU,kh:()=>qJ,ka:()=>AJ,ja:()=>YJ,it:()=>FJ,is:()=>LJ,id:()=>HJ,hy:()=>IJ,hu:()=>kJ,he:()=>PJ,frCA:()=>BJ,fr:()=>WJ,fi:()=>KJ,fa:()=>GJ,es:()=>OJ,eo:()=>JJ,en:()=>oU,de:()=>bJ,da:()=>zJ,cs:()=>_J,ca:()=>gJ,bg:()=>UJ,be:()=>vJ,az:()=>$J,ar:()=>eb});var ZH=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(U){return $[U]??null}let g={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${J}`;return`مدخلات غير مقبولة: يفترض إدخال ${z}، ولكن تم إدخال ${J}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${y(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()} ${b.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()} ${b.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${g[z.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${Z(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function eb(){return{localeError:ZH()}}var SH=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function v(U){return $[U]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${J}`;return`Yanlış dəyər: gözlənilən ${z}, daxil olan ${J}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${y(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()} ${b.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()} ${b.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${g[z.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function $J(){return{localeError:SH()}}function D5($,v,g,_){let U=Math.abs($),z=U%10,b=U%100;if(b>=11&&b<=19)return _;if(z===1)return v;if(z>=2&&z<=4)return g;return _}var MH=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function v(U){return $[U]??null}let g={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},_={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${J}`;return`Няправільны ўвод: чакаўся ${z}, атрымана ${J}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${y(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b){let J=Number(U.maximum),G=D5(J,b.unit.one,b.unit.few,b.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${b.verb} ${z}${U.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b){let J=Number(U.minimum),G=D5(J,b.unit.one,b.unit.few,b.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${b.verb} ${z}${U.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${g[z.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function vJ(){return{localeError:MH()}}var QH=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(U){return $[U]??null}let g={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},_={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${J}`;return`Невалиден вход: очакван ${z}, получен ${J}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${y(U.values[0])}`;return`Невалидна опция: очаквано едно от ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${z}${U.maximum.toString()} ${b.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Твърде малко: очаква се ${U.origin} да съдържа ${z}${U.minimum.toString()} ${b.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Невалиден низ: трябва да започва с "${z.prefix}"`;if(z.format==="ends_with")return`Невалиден низ: трябва да завършва с "${z.suffix}"`;if(z.format==="includes")return`Невалиден низ: трябва да включва "${z.includes}"`;if(z.format==="regex")return`Невалиден низ: трябва да съвпада с ${z.pattern}`;let b="Невалиден";if(z.format==="emoji")b="Невалидно";if(z.format==="datetime")b="Невалидно";if(z.format==="date")b="Невалидна";if(z.format==="time")b="Невалидно";if(z.format==="duration")b="Невалидна";return`${b} ${g[z.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function UJ(){return{localeError:QH()}}var NH=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(U){return $[U]??null}let g={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${J}`;return`Tipus invàlid: s'esperava ${z}, s'ha rebut ${J}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${y(U.values[0])}`;return`Opció invàlida: s'esperava una de ${Z(U.values," o ")}`;case"too_big":{let z=U.inclusive?"com a màxim":"menys de",b=v(U.origin);if(b)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${z} ${U.maximum.toString()} ${b.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"com a mínim":"més de",b=v(U.origin);if(b)return`Massa petit: s'esperava que ${U.origin} contingués ${z} ${U.minimum.toString()} ${b.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${g[z.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function gJ(){return{localeError:NH()}}var rH=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function v(U){return $[U]??null}let g={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},_={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${J}`;return`Neplatný vstup: očekáváno ${z}, obdrženo ${J}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${y(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${z}${U.maximum.toString()} ${b.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${z}${U.minimum.toString()} ${b.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${g[z.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${Z(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function _J(){return{localeError:rH()}}var uH=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(U){return $[U]??null}let g={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},_={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${J}`;return`Ugyldigt input: forventede ${z}, fik ${J}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${y(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin),J=_[U.origin]??U.origin;if(b)return`For stor: forventede ${J??"value"} ${b.verb} ${z} ${U.maximum.toString()} ${b.unit??"elementer"}`;return`For stor: forventede ${J??"value"} havde ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin),J=_[U.origin]??U.origin;if(b)return`For lille: forventede ${J} ${b.verb} ${z} ${U.minimum.toString()} ${b.unit}`;return`For lille: forventede ${J} havde ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: skal starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: skal ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: skal indeholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: skal matche mønsteret ${z.pattern}`;return`Ugyldig ${g[z.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function zJ(){return{localeError:uH()}}var RH=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(U){return $[U]??null}let g={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},_={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${J}`;return`Ungültige Eingabe: erwartet ${z}, erhalten ${J}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${y(U.values[0])}`;return`Ungültige Option: erwartet eine von ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ${b.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ist`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ${b.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ist`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${g[z.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function bJ(){return{localeError:RH()}}var yH=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function v(U){return $[U]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;return`Invalid input: expected ${z}, received ${J}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${y(U.values[0])}`;return`Invalid option: expected one of ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Too big: expected ${U.origin??"value"} to have ${z}${U.maximum.toString()} ${b.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Too small: expected ${U.origin} to have ${z}${U.minimum.toString()} ${b.unit}`;return`Too small: expected ${U.origin} to be ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Invalid string: must start with "${z.prefix}"`;if(z.format==="ends_with")return`Invalid string: must end with "${z.suffix}"`;if(z.format==="includes")return`Invalid string: must include "${z.includes}"`;if(z.format==="regex")return`Invalid string: must match pattern ${z.pattern}`;return`Invalid ${g[z.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function oU(){return{localeError:yH()}}var DH=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(U){return $[U]??null}let g={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},_={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${J}`;return`Nevalida enigo: atendiĝis ${z}, riceviĝis ${J}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${y(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()} ${b.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${z}${U.minimum.toString()} ${b.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${z.prefix}"`;if(z.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${z.suffix}"`;if(z.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${z.includes}"`;if(z.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${z.pattern}`;return`Nevalida ${g[z.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function JJ(){return{localeError:DH()}}var TH=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(U){return $[U]??null}let g={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${J}`;return`Entrada inválida: se esperaba ${z}, recibido ${J}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${y(U.values[0])}`;return`Opción inválida: se esperaba una de ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin),J=_[U.origin]??U.origin;if(b)return`Demasiado grande: se esperaba que ${J??"valor"} tuviera ${z}${U.maximum.toString()} ${b.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${J??"valor"} fuera ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin),J=_[U.origin]??U.origin;if(b)return`Demasiado pequeño: se esperaba que ${J} tuviera ${z}${U.minimum.toString()} ${b.unit}`;return`Demasiado pequeño: se esperaba que ${J} fuera ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Cadena inválida: debe comenzar con "${z.prefix}"`;if(z.format==="ends_with")return`Cadena inválida: debe terminar en "${z.suffix}"`;if(z.format==="includes")return`Cadena inválida: debe incluir "${z.includes}"`;if(z.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${z.pattern}`;return`Inválido ${g[z.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${_[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${_[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function OJ(){return{localeError:TH()}}var jH=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(U){return $[U]??null}let g={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},_={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: می‌بایست instanceof ${U.expected} می‌بود، ${J} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${z} می‌بود، ${J} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: می‌بایست ${y(U.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${Z(U.values,"|")} می‌بود`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} ${b.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} باشد`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} ${b.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} باشد`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${g[z.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${Z(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function GJ(){return{localeError:jH()}}var VH=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function v(U){return $[U]??null}let g={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${J}`;return`Virheellinen tyyppi: odotettiin ${z}, oli ${J}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${y(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Liian suuri: ${b.subject} täytyy olla ${z}${U.maximum.toString()} ${b.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Liian pieni: ${b.subject} täytyy olla ${z}${U.minimum.toString()} ${b.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${g[z.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Z(U.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function KJ(){return{localeError:VH()}}var CH=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(U){return $[U]??null}let g={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},_={nan:"NaN",number:"nombre",array:"tableau"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${J} reçu`;return`Entrée invalide : ${z} attendu, ${J} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${y(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${Z(U.values,"|")} attendue`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Trop grand : ${U.origin??"valeur"} doit ${b.verb} ${z}${U.maximum.toString()} ${b.unit??"élément(s)"}`;return`Trop grand : ${U.origin??"valeur"} doit être ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Trop petit : ${U.origin} doit ${b.verb} ${z}${U.minimum.toString()} ${b.unit}`;return`Trop petit : ${U.origin} doit être ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${g[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${Z(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function WJ(){return{localeError:CH()}}var fH=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(U){return $[U]??null}let g={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${J}`;return`Entrée invalide : attendu ${z}, reçu ${J}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${y(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"≤":"<",b=v(U.origin);if(b)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${z}${U.maximum.toString()} ${b.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"≥":">",b=v(U.origin);if(b)return`Trop petit : attendu que ${U.origin} ait ${z}${U.minimum.toString()} ${b.unit}`;return`Trop petit : attendu que ${U.origin} soit ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${g[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${Z(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function BJ(){return{localeError:fH()}}var mH=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},g=(K)=>K?$[K]:void 0,_=(K)=>{let W=g(K);if(W)return W.label;return K??$.unknown.label},U=(K)=>`ה${_(K)}`,z=(K)=>{return(g(K)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},b=(K)=>{if(!K)return null;return v[K]??null},J={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},G={nan:"NaN"};return(K)=>{switch(K.code){case"invalid_type":{let W=K.expected,B=G[W??""]??_(W),k=D(K.input),P=G[k]??$[k]?.label??k;if(/^[A-Z]/.test(K.expected))return`קלט לא תקין: צריך להיות instanceof ${K.expected}, התקבל ${P}`;return`קלט לא תקין: צריך להיות ${B}, התקבל ${P}`}case"invalid_value":{if(K.values.length===1)return`ערך לא תקין: הערך חייב להיות ${y(K.values[0])}`;let W=K.values.map((P)=>y(P));if(K.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${W[0]} או ${W[1]}`;let B=W[W.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${W.slice(0,-1).join(", ")} או ${B}`}case"too_big":{let W=b(K.origin),B=U(K.origin??"value");if(K.origin==="string")return`${W?.longLabel??"ארוך"} מדי: ${B} צריכה להכיל ${K.maximum.toString()} ${W?.unit??""} ${K.inclusive?"או פחות":"לכל היותר"}`.trim();if(K.origin==="number"){let A=K.inclusive?`קטן או שווה ל-${K.maximum}`:`קטן מ-${K.maximum}`;return`גדול מדי: ${B} צריך להיות ${A}`}if(K.origin==="array"||K.origin==="set"){let A=K.origin==="set"?"צריכה":"צריך",H=K.inclusive?`${K.maximum} ${W?.unit??""} או פחות`:`פחות מ-${K.maximum} ${W?.unit??""}`;return`גדול מדי: ${B} ${A} להכיל ${H}`.trim()}let k=K.inclusive?"<=":"<",P=z(K.origin??"value");if(W?.unit)return`${W.longLabel} מדי: ${B} ${P} ${k}${K.maximum.toString()} ${W.unit}`;return`${W?.longLabel??"גדול"} מדי: ${B} ${P} ${k}${K.maximum.toString()}`}case"too_small":{let W=b(K.origin),B=U(K.origin??"value");if(K.origin==="string")return`${W?.shortLabel??"קצר"} מדי: ${B} צריכה להכיל ${K.minimum.toString()} ${W?.unit??""} ${K.inclusive?"או יותר":"לפחות"}`.trim();if(K.origin==="number"){let A=K.inclusive?`גדול או שווה ל-${K.minimum}`:`גדול מ-${K.minimum}`;return`קטן מדי: ${B} צריך להיות ${A}`}if(K.origin==="array"||K.origin==="set"){let A=K.origin==="set"?"צריכה":"צריך";if(K.minimum===1&&K.inclusive){let I=K.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${B} ${A} להכיל ${I}`}let H=K.inclusive?`${K.minimum} ${W?.unit??""} או יותר`:`יותר מ-${K.minimum} ${W?.unit??""}`;return`קטן מדי: ${B} ${A} להכיל ${H}`.trim()}let k=K.inclusive?">=":">",P=z(K.origin??"value");if(W?.unit)return`${W.shortLabel} מדי: ${B} ${P} ${k}${K.minimum.toString()} ${W.unit}`;return`${W?.shortLabel??"קטן"} מדי: ${B} ${P} ${k}${K.minimum.toString()}`}case"invalid_format":{let W=K;if(W.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${W.prefix}"`;if(W.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${W.suffix}"`;if(W.format==="includes")return`המחרוזת חייבת לכלול "${W.includes}"`;if(W.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${W.pattern}`;let B=J[W.format],k=B?.label??W.format,A=(B?.gender??"m")==="f"?"תקינה":"תקין";return`${k} לא ${A}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${K.divisor}`;case"unrecognized_keys":return`מפתח${K.keys.length>1?"ות":""} לא מזוה${K.keys.length>1?"ים":"ה"}: ${Z(K.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(K.origin??"array")}`;default:return"קלט לא תקין"}}};function PJ(){return{localeError:mH()}}var EH=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(U){return $[U]??null}let g={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},_={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${J}`;return`Érvénytelen bemenet: a várt érték ${z}, a kapott érték ${J}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${y(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${z}${U.maximum.toString()} ${b.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${z}${U.minimum.toString()} ${b.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${g[z.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function kJ(){return{localeError:EH()}}function T5($,v,g){return Math.abs($)===1?v:g}function T4($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],g=$[$.length-1];return $+(v.includes(g)?"ն":"ը")}var cH=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(U){return $[U]??null}let g={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},_={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${J}`;return`Սխալ մուտքագրում․ սպասվում էր ${z}, ստացվել է ${J}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${y(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b){let J=Number(U.maximum),G=T5(J,b.unit.one,b.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${T4(U.origin??"արժեք")} կունենա ${z}${U.maximum.toString()} ${G}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${T4(U.origin??"արժեք")} լինի ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b){let J=Number(U.minimum),G=T5(J,b.unit.one,b.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${T4(U.origin)} կունենա ${z}${U.minimum.toString()} ${G}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${T4(U.origin)} լինի ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${z.prefix}"-ով`;if(z.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${z.suffix}"-ով`;if(z.format==="includes")return`Սխալ տող․ պետք է պարունակի "${z.includes}"`;if(z.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${z.pattern} ձևաչափին`;return`Սխալ ${g[z.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${Z(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${T4(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${T4(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function IJ(){return{localeError:cH()}}var iH=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(U){return $[U]??null}let g={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${J}`;return`Input tidak valid: diharapkan ${z}, diterima ${J}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${y(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${z}${U.maximum.toString()} ${b.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${z}${U.minimum.toString()} ${b.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${g[z.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function HJ(){return{localeError:iH()}}var lH=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function v(U){return $[U]??null}let g={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},_={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${J} þar sem á að vera ${z}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${y(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${z}${U.maximum.toString()} ${b.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${z}${U.minimum.toString()} ${b.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ógildur strengur: verður að byrja á "${z.prefix}"`;if(z.format==="ends_with")return`Ógildur strengur: verður að enda á "${z.suffix}"`;if(z.format==="includes")return`Ógildur strengur: verður að innihalda "${z.includes}"`;if(z.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${z.pattern}`;return`Rangt ${g[z.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function LJ(){return{localeError:lH()}}var hH=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(U){return $[U]??null}let g={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${J}`;return`Input non valido: atteso ${z}, ricevuto ${J}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${y(U.values[0])}`;return`Opzione non valida: atteso uno tra ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Troppo grande: ${U.origin??"valore"} deve avere ${z}${U.maximum.toString()} ${b.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Troppo piccolo: ${U.origin} deve avere ${z}${U.minimum.toString()} ${b.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Invalid ${g[z.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function FJ(){return{localeError:hH()}}var xH=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(U){return $[U]??null}let g={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},_={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${J}が入力されました`;return`無効な入力: ${z}が期待されましたが、${J}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${y(U.values[0])}が期待されました`;return`無効な選択: ${Z(U.values,"、")}のいずれかである必要があります`;case"too_big":{let z=U.inclusive?"以下である":"より小さい",b=v(U.origin);if(b)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${b.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${z}必要があります`}case"too_small":{let z=U.inclusive?"以上である":"より大きい",b=v(U.origin);if(b)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${b.unit}${z}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${g[z.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${Z(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function YJ(){return{localeError:xH()}}var pH=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(U){return $[U]??null}let g={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},_={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${J}`;return`არასწორი შეყვანა: მოსალოდნელი ${z}, მიღებული ${J}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${y(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${Z(U.values,"|")}-დან`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${b.verb} ${z}${U.maximum.toString()} ${b.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${b.verb} ${z}${U.minimum.toString()} ${b.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${z.prefix}"-ით`;if(z.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${z.suffix}"-ით`;if(z.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${z.includes}"-ს`;if(z.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${z.pattern}`;return`არასწორი ${g[z.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${Z(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function AJ(){return{localeError:pH()}}var oH=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(U){return $[U]??null}let g={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},_={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${J}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${z} ប៉ុន្តែទទួលបាន ${J}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${y(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()} ${b.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()} ${b.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${g[z.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${Z(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function nU(){return{localeError:oH()}}function qJ(){return nU()}var nH=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(U){return $[U]??null}let g={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${J}입니다`;return`잘못된 입력: 예상 타입은 ${z}, 받은 타입은 ${J}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${y(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${Z(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=U.inclusive?"이하":"미만",b=z==="미만"?"이어야 합니다":"여야 합니다",J=v(U.origin),G=J?.unit??"요소";if(J)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${G} ${z}${b}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${z}${b}`}case"too_small":{let z=U.inclusive?"이상":"초과",b=z==="이상"?"이어야 합니다":"여야 합니다",J=v(U.origin),G=J?.unit??"요소";if(J)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${G} ${z}${b}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${z}${b}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${g[z.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${Z(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function XJ(){return{localeError:nH()}}var tU=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function j5($){let v=Math.abs($),g=v%10,_=v%100;if(_>=11&&_<=19||g===0)return"many";if(g===1)return"one";return"few"}var tH=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function v(U,z,b,J){let G=$[U]??null;if(G===null)return G;return{unit:G.unit[z],verb:G.verb[J][b?"inclusive":"notInclusive"]}}let g={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},_={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${J}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${J}, o tikėtasi - ${z}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${y(U.values[0])}`;return`Privalo būti vienas iš ${Z(U.values,"|")} pasirinkimų`;case"too_big":{let z=_[U.origin]??U.origin,b=v(U.origin,j5(Number(U.maximum)),U.inclusive??!1,"smaller");if(b?.verb)return`${tU(z??U.origin??"reikšmė")} ${b.verb} ${U.maximum.toString()} ${b.unit??"elementų"}`;let J=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${tU(z??U.origin??"reikšmė")} turi būti ${J} ${U.maximum.toString()} ${b?.unit}`}case"too_small":{let z=_[U.origin]??U.origin,b=v(U.origin,j5(Number(U.minimum)),U.inclusive??!1,"bigger");if(b?.verb)return`${tU(z??U.origin??"reikšmė")} ${b.verb} ${U.minimum.toString()} ${b.unit??"elementų"}`;let J=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${tU(z??U.origin??"reikšmė")} turi būti ${J} ${U.minimum.toString()} ${b?.unit}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Eilutė privalo prasidėti "${z.prefix}"`;if(z.format==="ends_with")return`Eilutė privalo pasibaigti "${z.suffix}"`;if(z.format==="includes")return`Eilutė privalo įtraukti "${z.includes}"`;if(z.format==="regex")return`Eilutė privalo atitikti ${z.pattern}`;return`Neteisingas ${g[z.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${Z(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let z=_[U.origin]??U.origin;return`${tU(z??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function wJ(){return{localeError:tH()}}var dH=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(U){return $[U]??null}let g={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},_={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${J}`;return`Грешен внес: се очекува ${z}, примено ${J}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${y(U.values[0])}`;return`Грешана опција: се очекува една ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${z}${U.maximum.toString()} ${b.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Премногу мал: се очекува ${U.origin} да има ${z}${U.minimum.toString()} ${b.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${g[z.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function ZJ(){return{localeError:dH()}}var aH=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(U){return $[U]??null}let g={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${J}`;return`Input tidak sah: dijangka ${z}, diterima ${J}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${y(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${b.verb} ${z}${U.maximum.toString()} ${b.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Terlalu kecil: dijangka ${U.origin} ${b.verb} ${z}${U.minimum.toString()} ${b.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${g[z.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Z(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function SJ(){return{localeError:aH()}}var sH=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(U){return $[U]??null}let g={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},_={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${J}`;return`Ongeldige invoer: verwacht ${z}, ontving ${J}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${y(U.values[0])}`;return`Ongeldige optie: verwacht één van ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin),J=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(b)return`Te ${J}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} ${b.unit??"elementen"} ${b.verb}`;return`Te ${J}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} is`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin),J=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(b)return`Te ${J}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} ${b.unit} ${b.verb}`;return`Te ${J}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} is`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${g[z.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function MJ(){return{localeError:sH()}}var eH=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(U){return $[U]??null}let g={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${J}`;return`Ugyldig input: forventet ${z}, fikk ${J}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${y(U.values[0])}`;return`Ugyldig valg: forventet en av ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()} ${b.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()} ${b.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${g[z.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function QJ(){return{localeError:eH()}}var $L=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function v(U){return $[U]??null}let g={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},_={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${J}`;return`Fâsit giren: umulan ${z}, alınan ${J}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${y(U.values[0])}`;return`Fâsit tercih: mûteberler ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} ${b.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} olmalıydı.`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} ${b.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${g[z.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function NJ(){return{localeError:$L()}}var vL=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(U){return $[U]??null}let g={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},_={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${J} ترلاسه شو`;return`ناسم ورودي: باید ${z} وای, مګر ${J} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${y(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${Z(U.values,"|")} څخه وای`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} ${b.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} وي`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} ${b.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} وي`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${g[z.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function rJ(){return{localeError:vL()}}var UL=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function v(U){return $[U]??null}let g={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},_={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${J}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${z}, otrzymano ${J}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${y(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.maximum.toString()} ${b.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.minimum.toString()} ${b.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${g[z.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function uJ(){return{localeError:UL()}}var gL=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(U){return $[U]??null}let g={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${J}`;return`Tipo inválido: esperado ${z}, recebido ${J}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${y(U.values[0])}`;return`Opção inválida: esperada uma das ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${z}${U.maximum.toString()} ${b.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Muito pequeno: esperado que ${U.origin} tivesse ${z}${U.minimum.toString()} ${b.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${g[z.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function RJ(){return{localeError:gL()}}function V5($,v,g,_){let U=Math.abs($),z=U%10,b=U%100;if(b>=11&&b<=19)return _;if(z===1)return v;if(z>=2&&z<=4)return g;return _}var _L=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function v(U){return $[U]??null}let g={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},_={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${J}`;return`Неверный ввод: ожидалось ${z}, получено ${J}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${y(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b){let J=Number(U.maximum),G=V5(J,b.unit.one,b.unit.few,b.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${z}${U.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b){let J=Number(U.minimum),G=V5(J,b.unit.one,b.unit.few,b.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${z}${U.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${g[z.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function yJ(){return{localeError:_L()}}var zL=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(U){return $[U]??null}let g={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},_={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${J}`;return`Neveljaven vnos: pričakovano ${z}, prejeto ${J}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${y(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${z}${U.maximum.toString()} ${b.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${z}${U.minimum.toString()} ${b.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${g[z.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function DJ(){return{localeError:zL()}}var bL=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function v(U){return $[U]??null}let g={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},_={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${J}`;return`Ogiltig inmatning: förväntat ${z}, fick ${J}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${y(U.values[0])}`;return`Ogiltigt val: förväntade en av ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()} ${b.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()} ${b.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${g[z.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${Z(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function TJ(){return{localeError:bL()}}var JL=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(U){return $[U]??null}let g={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${J}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${z}, பெறப்பட்டது ${J}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${y(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${Z(U.values,"|")} இல் ஒன்று`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ${b.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ${b.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${g[z.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function jJ(){return{localeError:JL()}}var OL=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(U){return $[U]??null}let g={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},_={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${J}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${z} แต่ได้รับ ${J}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${y(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"ไม่เกิน":"น้อยกว่า",b=v(U.origin);if(b)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()} ${b.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"อย่างน้อย":"มากกว่า",b=v(U.origin);if(b)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()} ${b.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${g[z.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${Z(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function VJ(){return{localeError:OL()}}var GL=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(U){return $[U]??null}let g={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${J}`;return`Geçersiz değer: beklenen ${z}, alınan ${J}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${y(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()} ${b.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()} ${b.unit}`;return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Geçersiz metin: "${z.prefix}" ile başlamalı`;if(z.format==="ends_with")return`Geçersiz metin: "${z.suffix}" ile bitmeli`;if(z.format==="includes")return`Geçersiz metin: "${z.includes}" içermeli`;if(z.format==="regex")return`Geçersiz metin: ${z.pattern} desenine uymalı`;return`Geçersiz ${g[z.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function CJ(){return{localeError:GL()}}var KL=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(U){return $[U]??null}let g={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},_={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${J}`;return`Неправильні вхідні дані: очікується ${z}, отримано ${J}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${y(U.values[0])}`;return`Неправильна опція: очікується одне з ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Занадто велике: очікується, що ${U.origin??"значення"} ${b.verb} ${z}${U.maximum.toString()} ${b.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Занадто мале: очікується, що ${U.origin} ${b.verb} ${z}${U.minimum.toString()} ${b.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${g[z.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function dU(){return{localeError:KL()}}function fJ(){return dU()}var WL=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(U){return $[U]??null}let g={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},_={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${J} موصول ہوا`;return`غلط ان پٹ: ${z} متوقع تھا، ${J} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${y(U.values[0])} متوقع تھا`;return`غلط آپشن: ${Z(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${z}${U.maximum.toString()} ${b.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${z}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`بہت چھوٹا: ${U.origin} کے ${z}${U.minimum.toString()} ${b.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${z}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${g[z.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${Z(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function mJ(){return{localeError:WL()}}var BL=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function v(U){return $[U]??null}let g={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},_={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${J}`;return`Noto‘g‘ri kirish: kutilgan ${z}, qabul qilingan ${J}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${y(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()} ${b.unit} ${b.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()} ${b.unit} ${b.verb}`;return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Noto‘g‘ri satr: "${z.prefix}" bilan boshlanishi kerak`;if(z.format==="ends_with")return`Noto‘g‘ri satr: "${z.suffix}" bilan tugashi kerak`;if(z.format==="includes")return`Noto‘g‘ri satr: "${z.includes}" ni o‘z ichiga olishi kerak`;if(z.format==="regex")return`Noto‘g‘ri satr: ${z.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${g[z.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function EJ(){return{localeError:BL()}}var PL=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function v(U){return $[U]??null}let g={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},_={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${J}`;return`Đầu vào không hợp lệ: mong đợi ${z}, nhận được ${J}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${y(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${b.verb} ${z}${U.maximum.toString()} ${b.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Quá nhỏ: mong đợi ${U.origin} ${b.verb} ${z}${U.minimum.toString()} ${b.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${g[z.format]??U.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${Z(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function cJ(){return{localeError:PL()}}var kL=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(U){return $[U]??null}let g={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},_={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${J}`;return`无效输入:期望 ${z},实际接收 ${J}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${y(U.values[0])}`;return`无效选项:期望以下之一 ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()} ${b.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()} ${b.unit}`;return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${g[z.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${Z(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function iJ(){return{localeError:kL()}}var IL=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(U){return $[U]??null}let g={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${J}`;return`無效的輸入值:預期為 ${z},但收到 ${J}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${y(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()} ${b.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()} ${b.unit}`;return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${g[z.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${Z(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function lJ(){return{localeError:IL()}}var HL=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(U){return $[U]??null}let g={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},_={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,b=D(U.input),J=_[b]??b;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${J}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${z}, àmọ̀ a rí ${J}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${y(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${Z(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",b=v(U.origin);if(b)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${b.verb} ${z}${U.maximum} ${b.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${U.maximum}`}case"too_small":{let z=U.inclusive?">=":">",b=v(U.origin);if(b)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${b.verb} ${z}${U.minimum} ${b.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${U.minimum}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${g[z.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${Z(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function hJ(){return{localeError:HL()}}var C5,xJ=Symbol("ZodOutput"),pJ=Symbol("ZodInput");class oJ{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let g=v[0];if(this._map.set($,g),g&&typeof g==="object"&&"id"in g)this._idmap.set(g.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let g={...this.get(v)??{}};delete g.id;let _={...g,...this._map.get($)};return Object.keys(_).length?_:void 0}return this._map.get($)}has($){return this._map.has($)}}function v1(){return new oJ}(C5=globalThis).__zod_globalRegistry??(C5.__zod_globalRegistry=v1());var vv=globalThis.__zod_globalRegistry;function nJ($,v){return new $({type:"string",...C(v)})}function tJ($,v){return new $({type:"string",coerce:!0,...C(v)})}function U1($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...C(v)})}function sU($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...C(v)})}function g1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...C(v)})}function _1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(v)})}function z1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(v)})}function b1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(v)})}function eU($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...C(v)})}function J1($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...C(v)})}function O1($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(v)})}function G1($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...C(v)})}function K1($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(v)})}function W1($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...C(v)})}function B1($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...C(v)})}function P1($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(v)})}function k1($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(v)})}function I1($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(v)})}function dJ($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...C(v)})}function H1($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(v)})}function L1($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(v)})}function F1($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...C(v)})}function Y1($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...C(v)})}function A1($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...C(v)})}function q1($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...C(v)})}var aJ={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function sJ($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(v)})}function eJ($,v){return new $({type:"string",format:"date",check:"string_format",...C(v)})}function $8($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...C(v)})}function v8($,v){return new $({type:"string",format:"duration",check:"string_format",...C(v)})}function U8($,v){return new $({type:"number",checks:[],...C(v)})}function g8($,v){return new $({type:"number",coerce:!0,checks:[],...C(v)})}function _8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...C(v)})}function z8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...C(v)})}function b8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...C(v)})}function J8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...C(v)})}function O8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...C(v)})}function G8($,v){return new $({type:"boolean",...C(v)})}function K8($,v){return new $({type:"boolean",coerce:!0,...C(v)})}function W8($,v){return new $({type:"bigint",...C(v)})}function B8($,v){return new $({type:"bigint",coerce:!0,...C(v)})}function P8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(v)})}function k8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(v)})}function I8($,v){return new $({type:"symbol",...C(v)})}function H8($,v){return new $({type:"undefined",...C(v)})}function L8($,v){return new $({type:"null",...C(v)})}function F8($){return new $({type:"any"})}function Y8($){return new $({type:"unknown"})}function A8($,v){return new $({type:"never",...C(v)})}function q8($,v){return new $({type:"void",...C(v)})}function X8($,v){return new $({type:"date",...C(v)})}function w8($,v){return new $({type:"date",coerce:!0,...C(v)})}function Z8($,v){return new $({type:"nan",...C(v)})}function nv($,v){return new l_({check:"less_than",...C(v),value:$,inclusive:!1})}function Qv($,v){return new l_({check:"less_than",...C(v),value:$,inclusive:!0})}function tv($,v){return new h_({check:"greater_than",...C(v),value:$,inclusive:!1})}function Iv($,v){return new h_({check:"greater_than",...C(v),value:$,inclusive:!0})}function X1($){return tv(0,$)}function w1($){return nv(0,$)}function Z1($){return Qv(0,$)}function S1($){return Iv(0,$)}function N6($,v){return new Zz({check:"multiple_of",...C(v),value:$})}function r6($,v){return new Qz({check:"max_size",...C(v),maximum:$})}function dv($,v){return new Nz({check:"min_size",...C(v),minimum:$})}function s6($,v){return new rz({check:"size_equals",...C(v),size:$})}function e6($,v){return new uz({check:"max_length",...C(v),maximum:$})}function O6($,v){return new Rz({check:"min_length",...C(v),minimum:$})}function $4($,v){return new yz({check:"length_equals",...C(v),length:$})}function j4($,v){return new Dz({check:"string_format",format:"regex",...C(v),pattern:$})}function V4($){return new Tz({check:"string_format",format:"lowercase",...C($)})}function C4($){return new jz({check:"string_format",format:"uppercase",...C($)})}function f4($,v){return new Vz({check:"string_format",format:"includes",...C(v),includes:$})}function m4($,v){return new Cz({check:"string_format",format:"starts_with",...C(v),prefix:$})}function E4($,v){return new fz({check:"string_format",format:"ends_with",...C(v),suffix:$})}function M1($,v,g){return new mz({check:"property",property:$,schema:v,...C(g)})}function c4($,v){return new Ez({check:"mime_type",mime:$,...C(v)})}function mv($){return new cz({check:"overwrite",tx:$})}function i4($){return mv((v)=>v.normalize($))}function l4(){return mv(($)=>$.trim())}function h4(){return mv(($)=>$.toLowerCase())}function x4(){return mv(($)=>$.toUpperCase())}function p4(){return mv(($)=>c2($))}function S8($,v,g){return new $({type:"array",element:v,...C(g)})}function FL($,v,g){return new $({type:"union",options:v,...C(g)})}function YL($,v,g){return new $({type:"union",options:v,inclusive:!1,...C(g)})}function AL($,v,g,_){return new $({type:"union",options:g,discriminator:v,...C(_)})}function qL($,v,g){return new $({type:"intersection",left:v,right:g})}function XL($,v,g,_){let U=g instanceof v$;return new $({type:"tuple",items:v,rest:U?g:null,...C(U?_:g)})}function wL($,v,g,_){return new $({type:"record",keyType:v,valueType:g,...C(_)})}function ZL($,v,g,_){return new $({type:"map",keyType:v,valueType:g,...C(_)})}function SL($,v,g){return new $({type:"set",valueType:v,...C(g)})}function ML($,v,g){let _=Array.isArray(v)?Object.fromEntries(v.map((U)=>[U,U])):v;return new $({type:"enum",entries:_,...C(g)})}function QL($,v,g){return new $({type:"enum",entries:v,...C(g)})}function NL($,v,g){return new $({type:"literal",values:Array.isArray(v)?v:[v],...C(g)})}function M8($,v){return new $({type:"file",...C(v)})}function rL($,v){return new $({type:"transform",transform:v})}function uL($,v){return new $({type:"optional",innerType:v})}function RL($,v){return new $({type:"nullable",innerType:v})}function yL($,v,g){return new $({type:"default",innerType:v,get defaultValue(){return typeof g==="function"?g():l2(g)}})}function DL($,v,g){return new $({type:"nonoptional",innerType:v,...C(g)})}function TL($,v){return new $({type:"success",innerType:v})}function jL($,v,g){return new $({type:"catch",innerType:v,catchValue:typeof g==="function"?g:()=>g})}function VL($,v,g){return new $({type:"pipe",in:v,out:g})}function CL($,v){return new $({type:"readonly",innerType:v})}function fL($,v,g){return new $({type:"template_literal",parts:v,...C(g)})}function mL($,v){return new $({type:"lazy",getter:v})}function EL($,v){return new $({type:"promise",innerType:v})}function Q8($,v,g){let _=C(g);return _.abort??(_.abort=!0),new $({type:"custom",check:"custom",fn:v,..._})}function N8($,v,g){return new $({type:"custom",check:"custom",fn:v,...C(g)})}function r8($){let v=f5((g)=>{return g.addIssue=(_)=>{if(typeof _==="string")g.issues.push(Q4(_,g.value,v._zod.def));else{let U=_;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=g.value),U.inst??(U.inst=v),U.continue??(U.continue=!v._zod.def.abort),g.issues.push(Q4(U))}},$(g.value,g)});return v}function f5($,v){let g=new N$({check:"custom",...C(v)});return g._zod.check=$,g}function u8($){let v=new N$({check:"describe"});return v._zod.onattach=[(g)=>{let _=vv.get(g)??{};vv.add(g,{..._,description:$})}],v._zod.check=()=>{},v}function R8($){let v=new N$({check:"meta"});return v._zod.onattach=[(g)=>{let _=vv.get(g)??{};vv.add(g,{..._,...$})}],v._zod.check=()=>{},v}function y8($,v){let g=C(v),_=g.truthy??["true","1","yes","on","y","enabled"],U=g.falsy??["false","0","no","off","n","disabled"];if(g.case!=="sensitive")_=_.map((P)=>typeof P==="string"?P.toLowerCase():P),U=U.map((P)=>typeof P==="string"?P.toLowerCase():P);let z=new Set(_),b=new Set(U),J=$.Codec??pU,G=$.Boolean??hU,W=new($.String??a6)({type:"string",error:g.error}),B=new G({type:"boolean",error:g.error}),k=new J({type:"pipe",in:W,out:B,transform:(P,A)=>{let H=P;if(g.case!=="sensitive")H=H.toLowerCase();if(z.has(H))return!0;else if(b.has(H))return!1;else return A.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,...b],input:A.value,inst:k,continue:!1}),{}},reverseTransform:(P,A)=>{if(P===!0)return _[0]||"true";else return U[0]||"false"},error:g.error});return k}function o4($,v,g,_={}){let U=C(_),z={...C(_),check:"string_format",type:"string",format:v,fn:typeof g==="function"?g:(J)=>g.test(J),...U};if(g instanceof RegExp)z.pattern=g;return new $(z)}function u6($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??vv,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function q$($,v,g={path:[],schemaPath:[]}){var _;let U=$._zod.def,z=v.seen.get($);if(z){if(z.count++,g.schemaPath.includes($))z.cycle=g.path;return z.schema}let b={schema:{},count:1,cycle:void 0,path:g.path};v.seen.set($,b);let J=$._zod.toJSONSchema?.();if(J)b.schema=J;else{let W={...g,schemaPath:[...g.schemaPath,$],path:g.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,b.schema,W);else{let k=b.schema,P=v.processors[U.type];if(!P)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);P($,v,k,W)}let B=$._zod.parent;if(B){if(!b.ref)b.ref=B;q$(B,v,W),v.seen.get(B).isParent=!0}}let G=v.metadataRegistry.get($);if(G)Object.assign(b.schema,G);if(v.io==="input"&&Hv($))delete b.schema.examples,delete b.schema.default;if(v.io==="input"&&b.schema._prefault)(_=b.schema).default??(_.default=b.schema._prefault);return delete b.schema._prefault,v.seen.get($).schema}function R6($,v){let g=$.seen.get(v);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let _=new Map;for(let b of $.seen.entries()){let J=$.metadataRegistry.get(b[0])?.id;if(J){let G=_.get(J);if(G&&G!==b[0])throw Error(`Duplicate schema id "${J}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);_.set(J,b[0])}}let U=(b)=>{let J=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let B=$.external.registry.get(b[0])?.id,k=$.external.uri??((A)=>A);if(B)return{ref:k(B)};let P=b[1].defId??b[1].schema.id??`schema${$.counter++}`;return b[1].defId=P,{defId:P,ref:`${k("__shared")}#/${J}/${P}`}}if(b[1]===g)return{ref:"#"};let K=`${"#"}/${J}/`,W=b[1].schema.id??`__schema${$.counter++}`;return{defId:W,ref:K+W}},z=(b)=>{if(b[1].schema.$ref)return;let J=b[1],{ref:G,defId:K}=U(b);if(J.def={...J.schema},K)J.defId=K;let W=J.schema;for(let B in W)delete W[B];W.$ref=G};if($.cycles==="throw")for(let b of $.seen.entries()){let J=b[1];if(J.cycle)throw Error(`Cycle detected: #/${J.cycle?.join("/")}/<root>
144
+ `)}P.write("payload.value = newResult;"),P.write("return payload;");let Y=P.compile();return(A,M)=>Y(k,A,M)},z,J=s6,b=!DU.jitless,K=b&&t2.value,W=v.catchall,B;$._zod.parse=(k,P)=>{B??(B=_.value);let q=k.value;if(!J(q))return k.issues.push({expected:"object",code:"invalid_type",input:q,inst:$}),k;if(b&&K&&P?.async===!1&&P.jitless!==!0){if(!z)z=U(v.shape);if(k=z(k,P),!W)return k;return C5([],q,k,P,B,$)}return g(k,P)}});function Z5($,v,g,_){for(let z of $)if(z.issues.length===0)return v.value=z.value,v;let U=$.filter((z)=>!u6(z));if(U.length===1)return v.value=U[0].value,U[0];return v.issues.push({code:"invalid_union",input:v.value,inst:g,errors:$.map((z)=>z.issues.map((J)=>qv(J,_,x$())))}),v}var dU=X("$ZodUnion",($,v)=>{v$.init($,v),b$($._zod,"optin",()=>v.options.some((U)=>U._zod.optin==="optional")?"optional":void 0),b$($._zod,"optout",()=>v.options.some((U)=>U._zod.optout==="optional")?"optional":void 0),b$($._zod,"values",()=>{if(v.options.every((U)=>U._zod.values))return new Set(v.options.flatMap((U)=>Array.from(U._zod.values)));return}),b$($._zod,"pattern",()=>{if(v.options.every((U)=>U._zod.pattern)){let U=v.options.map((z)=>z._zod.pattern);return new RegExp(`^(${U.map((z)=>VU(z.source)).join("|")})$`)}return});let g=v.options.length===1,_=v.options[0]._zod.run;$._zod.parse=(U,z)=>{if(g)return _(U,z);let J=!1,b=[];for(let G of v.options){let K=G._zod.run({value:U.value,issues:[]},z);if(K instanceof Promise)b.push(K),J=!0;else{if(K.issues.length===0)return K;b.push(K)}}if(!J)return Z5(b,U,$,z);return Promise.all(b).then((G)=>{return Z5(G,U,$,z)})}});function S5($,v,g,_){let U=$.filter((z)=>z.issues.length===0);if(U.length===1)return v.value=U[0].value,v;if(U.length===0)v.issues.push({code:"invalid_union",input:v.value,inst:g,errors:$.map((z)=>z.issues.map((J)=>qv(J,_,x$())))});else v.issues.push({code:"invalid_union",input:v.value,inst:g,errors:[],inclusive:!1});return v}var jJ=X("$ZodXor",($,v)=>{dU.init($,v),v.inclusive=!1;let g=v.options.length===1,_=v.options[0]._zod.run;$._zod.parse=(U,z)=>{if(g)return _(U,z);let J=!1,b=[];for(let G of v.options){let K=G._zod.run({value:U.value,issues:[]},z);if(K instanceof Promise)b.push(K),J=!0;else b.push(K)}if(!J)return S5(b,U,$,z);return Promise.all(b).then((G)=>{return S5(G,U,$,z)})}}),VJ=X("$ZodDiscriminatedUnion",($,v)=>{v.inclusive=!1,dU.init($,v);let g=$._zod.parse;b$($._zod,"propValues",()=>{let U={};for(let z of v.options){let J=z._zod.propValues;if(!J||Object.keys(J).length===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(z)}"`);for(let[b,G]of Object.entries(J)){if(!U[b])U[b]=new Set;for(let K of G)U[b].add(K)}}return U});let _=y4(()=>{let U=v.options,z=new Map;for(let J of U){let b=J._zod.propValues?.[v.discriminator];if(!b||b.size===0)throw Error(`Invalid discriminated union option at index "${v.options.indexOf(J)}"`);for(let G of b){if(z.has(G))throw Error(`Duplicate discriminator value "${String(G)}"`);z.set(G,J)}}return z});$._zod.parse=(U,z)=>{let J=U.value;if(!s6(J))return U.issues.push({code:"invalid_type",expected:"object",input:J,inst:$}),U;let b=_.value.get(J?.[v.discriminator]);if(b)return b._zod.run(U,z);if(v.unionFallback)return g(U,z);return U.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:v.discriminator,input:J,path:[v.discriminator],inst:$}),U}}),CJ=X("$ZodIntersection",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value,z=v.left._zod.run({value:U,issues:[]},_),J=v.right._zod.run({value:U,issues:[]},_);if(z instanceof Promise||J instanceof Promise)return Promise.all([z,J]).then(([G,K])=>{return M5(g,G,K)});return M5(g,z,J)}});function dz($,v){if($===v)return{valid:!0,data:$};if($ instanceof Date&&v instanceof Date&&+$===+v)return{valid:!0,data:$};if(r6($)&&r6(v)){let g=Object.keys(v),_=Object.keys($).filter((z)=>g.indexOf(z)!==-1),U={...$,...v};for(let z of _){let J=dz($[z],v[z]);if(!J.valid)return{valid:!1,mergeErrorPath:[z,...J.mergeErrorPath]};U[z]=J.data}return{valid:!0,data:U}}if(Array.isArray($)&&Array.isArray(v)){if($.length!==v.length)return{valid:!1,mergeErrorPath:[]};let g=[];for(let _=0;_<$.length;_++){let U=$[_],z=v[_],J=dz(U,z);if(!J.valid)return{valid:!1,mergeErrorPath:[_,...J.mergeErrorPath]};g.push(J.data)}return{valid:!0,data:g}}return{valid:!1,mergeErrorPath:[]}}function M5($,v,g){let _=new Map,U;for(let b of v.issues)if(b.code==="unrecognized_keys"){U??(U=b);for(let G of b.keys){if(!_.has(G))_.set(G,{});_.get(G).l=!0}}else $.issues.push(b);for(let b of g.issues)if(b.code==="unrecognized_keys")for(let G of b.keys){if(!_.has(G))_.set(G,{});_.get(G).r=!0}else $.issues.push(b);let z=[..._].filter(([,b])=>b.l&&b.r).map(([b])=>b);if(z.length&&U)$.issues.push({...U,keys:z});if(u6($))return $;let J=dz(v.value,g.value);if(!J.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(J.mergeErrorPath)}`);return $.value=J.data,$}var J1=X("$ZodTuple",($,v)=>{v$.init($,v);let g=v.items;$._zod.parse=(_,U)=>{let z=_.value;if(!Array.isArray(z))return _.issues.push({input:z,inst:$,expected:"tuple",code:"invalid_type"}),_;_.value=[];let J=[],b=[...g].reverse().findIndex((W)=>W._zod.optin!=="optional"),G=b===-1?0:g.length-b;if(!v.rest){let W=z.length>g.length,B=z.length<G-1;if(W||B)return _.issues.push({...W?{code:"too_big",maximum:g.length,inclusive:!0}:{code:"too_small",minimum:g.length},input:z,inst:$,origin:"array"}),_}let K=-1;for(let W of g){if(K++,K>=z.length){if(K>=G)continue}let B=W._zod.run({value:z[K],issues:[]},U);if(B instanceof Promise)J.push(B.then((k)=>e_(k,_,K)));else e_(B,_,K)}if(v.rest){let W=z.slice(g.length);for(let B of W){K++;let k=v.rest._zod.run({value:B,issues:[]},U);if(k instanceof Promise)J.push(k.then((P)=>e_(P,_,K)));else e_(k,_,K)}}if(J.length)return Promise.all(J).then(()=>_);return _}});function e_($,v,g){if($.issues.length)v.issues.push(...Qv(g,$.issues));v.value[g]=$.value}var fJ=X("$ZodRecord",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!r6(U))return g.issues.push({expected:"record",code:"invalid_type",input:U,inst:$}),g;let z=[],J=v.keyType._zod.values;if(J){g.value={};let b=new Set;for(let K of J)if(typeof K==="string"||typeof K==="number"||typeof K==="symbol"){b.add(typeof K==="number"?K.toString():K);let W=v.valueType._zod.run({value:U[K],issues:[]},_);if(W instanceof Promise)z.push(W.then((B)=>{if(B.issues.length)g.issues.push(...Qv(K,B.issues));g.value[K]=B.value}));else{if(W.issues.length)g.issues.push(...Qv(K,W.issues));g.value[K]=W.value}}let G;for(let K in U)if(!b.has(K))G=G??[],G.push(K);if(G&&G.length>0)g.issues.push({code:"unrecognized_keys",input:U,inst:$,keys:G})}else{g.value={};for(let b of Reflect.ownKeys(U)){if(b==="__proto__")continue;let G=v.keyType._zod.run({value:b,issues:[]},_);if(G instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof b==="string"&&pU.test(b)&&G.issues.length){let B=v.keyType._zod.run({value:Number(b),issues:[]},_);if(B instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(B.issues.length===0)G=B}if(G.issues.length){if(v.mode==="loose")g.value[b]=U[b];else g.issues.push({code:"invalid_key",origin:"record",issues:G.issues.map((B)=>qv(B,_,x$())),input:b,path:[b],inst:$});continue}let W=v.valueType._zod.run({value:U[b],issues:[]},_);if(W instanceof Promise)z.push(W.then((B)=>{if(B.issues.length)g.issues.push(...Qv(b,B.issues));g.value[G.value]=B.value}));else{if(W.issues.length)g.issues.push(...Qv(b,W.issues));g.value[G.value]=W.value}}}if(z.length)return Promise.all(z).then(()=>g);return g}}),EJ=X("$ZodMap",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!(U instanceof Map))return g.issues.push({expected:"map",code:"invalid_type",input:U,inst:$}),g;let z=[];g.value=new Map;for(let[J,b]of U){let G=v.keyType._zod.run({value:J,issues:[]},_),K=v.valueType._zod.run({value:b,issues:[]},_);if(G instanceof Promise||K instanceof Promise)z.push(Promise.all([G,K]).then(([W,B])=>{Q5(W,B,g,J,U,$,_)}));else Q5(G,K,g,J,U,$,_)}if(z.length)return Promise.all(z).then(()=>g);return g}});function Q5($,v,g,_,U,z,J){if($.issues.length)if(CU.has(typeof _))g.issues.push(...Qv(_,$.issues));else g.issues.push({code:"invalid_key",origin:"map",input:U,inst:z,issues:$.issues.map((b)=>qv(b,J,x$()))});if(v.issues.length)if(CU.has(typeof _))g.issues.push(...Qv(_,v.issues));else g.issues.push({origin:"map",code:"invalid_element",input:U,inst:z,key:_,issues:v.issues.map((b)=>qv(b,J,x$()))});g.value.set($.value,v.value)}var cJ=X("$ZodSet",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(!(U instanceof Set))return g.issues.push({input:U,inst:$,expected:"set",code:"invalid_type"}),g;let z=[];g.value=new Set;for(let J of U){let b=v.valueType._zod.run({value:J,issues:[]},_);if(b instanceof Promise)z.push(b.then((G)=>N5(G,g)));else N5(b,g)}if(z.length)return Promise.all(z).then(()=>g);return g}});function N5($,v){if($.issues.length)v.issues.push(...$.issues);v.value.add($.value)}var mJ=X("$ZodEnum",($,v)=>{v$.init($,v);let g=jU(v.entries),_=new Set(g);$._zod.values=_,$._zod.pattern=new RegExp(`^(${g.filter((U)=>CU.has(typeof U)).map((U)=>typeof U==="string"?Tv(U):U.toString()).join("|")})$`),$._zod.parse=(U,z)=>{let J=U.value;if(_.has(J))return U;return U.issues.push({code:"invalid_value",values:g,input:J,inst:$}),U}}),iJ=X("$ZodLiteral",($,v)=>{if(v$.init($,v),v.values.length===0)throw Error("Cannot create literal schema with no valid values");let g=new Set(v.values);$._zod.values=g,$._zod.pattern=new RegExp(`^(${v.values.map((_)=>typeof _==="string"?Tv(_):_?Tv(_.toString()):String(_)).join("|")})$`),$._zod.parse=(_,U)=>{let z=_.value;if(g.has(z))return _;return _.issues.push({code:"invalid_value",values:v.values,input:z,inst:$}),_}}),lJ=X("$ZodFile",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{let U=g.value;if(U instanceof File)return g;return g.issues.push({expected:"file",code:"invalid_type",input:U,inst:$}),g}}),hJ=X("$ZodTransform",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new a6($.constructor.name);let U=v.transform(g.value,g);if(_.async)return(U instanceof Promise?U:Promise.resolve(U)).then((J)=>{return g.value=J,g});if(U instanceof Promise)throw new nv;return g.value=U,g}});function r5($,v){if($.issues.length&&v===void 0)return{issues:[],value:void 0};return $}var b1=X("$ZodOptional",($,v)=>{v$.init($,v),$._zod.optin="optional",$._zod.optout="optional",b$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,void 0]):void 0}),b$($._zod,"pattern",()=>{let g=v.innerType._zod.pattern;return g?new RegExp(`^(${VU(g.source)})?$`):void 0}),$._zod.parse=(g,_)=>{if(v.innerType._zod.optin==="optional"){let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>r5(z,g.value));return r5(U,g.value)}if(g.value===void 0)return g;return v.innerType._zod.run(g,_)}}),xJ=X("$ZodExactOptional",($,v)=>{b1.init($,v),b$($._zod,"values",()=>v.innerType._zod.values),b$($._zod,"pattern",()=>v.innerType._zod.pattern),$._zod.parse=(g,_)=>{return v.innerType._zod.run(g,_)}}),pJ=X("$ZodNullable",($,v)=>{v$.init($,v),b$($._zod,"optin",()=>v.innerType._zod.optin),b$($._zod,"optout",()=>v.innerType._zod.optout),b$($._zod,"pattern",()=>{let g=v.innerType._zod.pattern;return g?new RegExp(`^(${VU(g.source)}|null)$`):void 0}),b$($._zod,"values",()=>{return v.innerType._zod.values?new Set([...v.innerType._zod.values,null]):void 0}),$._zod.parse=(g,_)=>{if(g.value===null)return g;return v.innerType._zod.run(g,_)}}),oJ=X("$ZodDefault",($,v)=>{v$.init($,v),$._zod.optin="optional",b$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);if(g.value===void 0)return g.value=v.defaultValue,g;let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>u5(z,v));return u5(U,v)}});function u5($,v){if($.value===void 0)$.value=v.defaultValue;return $}var nJ=X("$ZodPrefault",($,v)=>{v$.init($,v),$._zod.optin="optional",b$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);if(g.value===void 0)g.value=v.defaultValue;return v.innerType._zod.run(g,_)}}),tJ=X("$ZodNonOptional",($,v)=>{v$.init($,v),b$($._zod,"values",()=>{let g=v.innerType._zod.values;return g?new Set([...g].filter((_)=>_!==void 0)):void 0}),$._zod.parse=(g,_)=>{let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>y5(z,$));return y5(U,$)}});function y5($,v){if(!$.issues.length&&$.value===void 0)$.issues.push({code:"invalid_type",expected:"nonoptional",input:$.value,inst:v});return $}var dJ=X("$ZodSuccess",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new a6("ZodSuccess");let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>{return g.value=z.issues.length===0,g});return g.value=U.issues.length===0,g}}),aJ=X("$ZodCatch",($,v)=>{v$.init($,v),b$($._zod,"optin",()=>v.innerType._zod.optin),b$($._zod,"optout",()=>v.innerType._zod.optout),b$($._zod,"values",()=>v.innerType._zod.values),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>{if(g.value=z.value,z.issues.length)g.value=v.catchValue({...g,error:{issues:z.issues.map((J)=>qv(J,_,x$()))},input:g.value}),g.issues=[];return g});if(g.value=U.value,U.issues.length)g.value=v.catchValue({...g,error:{issues:U.issues.map((z)=>qv(z,_,x$()))},input:g.value}),g.issues=[];return g}}),sJ=X("$ZodNaN",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{if(typeof g.value!=="number"||!Number.isNaN(g.value))return g.issues.push({input:g.value,inst:$,expected:"nan",code:"invalid_type"}),g;return g}}),eJ=X("$ZodPipe",($,v)=>{v$.init($,v),b$($._zod,"values",()=>v.in._zod.values),b$($._zod,"optin",()=>v.in._zod.optin),b$($._zod,"optout",()=>v.out._zod.optout),b$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(g,_)=>{if(_.direction==="backward"){let z=v.out._zod.run(g,_);if(z instanceof Promise)return z.then((J)=>$1(J,v.in,_));return $1(z,v.in,_)}let U=v.in._zod.run(g,_);if(U instanceof Promise)return U.then((z)=>$1(z,v.out,_));return $1(U,v.out,_)}});function $1($,v,g){if($.issues.length)return $.aborted=!0,$;return v._zod.run({value:$.value,issues:$.issues},g)}var aU=X("$ZodCodec",($,v)=>{v$.init($,v),b$($._zod,"values",()=>v.in._zod.values),b$($._zod,"optin",()=>v.in._zod.optin),b$($._zod,"optout",()=>v.out._zod.optout),b$($._zod,"propValues",()=>v.in._zod.propValues),$._zod.parse=(g,_)=>{if((_.direction||"forward")==="forward"){let z=v.in._zod.run(g,_);if(z instanceof Promise)return z.then((J)=>v1(J,v,_));return v1(z,v,_)}else{let z=v.out._zod.run(g,_);if(z instanceof Promise)return z.then((J)=>v1(J,v,_));return v1(z,v,_)}}});function v1($,v,g){if($.issues.length)return $.aborted=!0,$;if((g.direction||"forward")==="forward"){let U=v.transform($.value,$);if(U instanceof Promise)return U.then((z)=>U1($,z,v.out,g));return U1($,U,v.out,g)}else{let U=v.reverseTransform($.value,$);if(U instanceof Promise)return U.then((z)=>U1($,z,v.in,g));return U1($,U,v.in,g)}}function U1($,v,g,_){if($.issues.length)return $.aborted=!0,$;return g._zod.run({value:v,issues:$.issues},_)}var $b=X("$ZodReadonly",($,v)=>{v$.init($,v),b$($._zod,"propValues",()=>v.innerType._zod.propValues),b$($._zod,"values",()=>v.innerType._zod.values),b$($._zod,"optin",()=>v.innerType?._zod?.optin),b$($._zod,"optout",()=>v.innerType?._zod?.optout),$._zod.parse=(g,_)=>{if(_.direction==="backward")return v.innerType._zod.run(g,_);let U=v.innerType._zod.run(g,_);if(U instanceof Promise)return U.then(R5);return R5(U)}});function R5($){return $.value=Object.freeze($.value),$}var vb=X("$ZodTemplateLiteral",($,v)=>{v$.init($,v);let g=[];for(let _ of v.parts)if(typeof _==="object"&&_!==null){if(!_._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[..._._zod.traits].shift()}`);let U=_._zod.pattern instanceof RegExp?_._zod.pattern.source:_._zod.pattern;if(!U)throw Error(`Invalid template literal part: ${_._zod.traits}`);let z=U.startsWith("^")?1:0,J=U.endsWith("$")?U.length-1:U.length;g.push(U.slice(z,J))}else if(_===null||a2.has(typeof _))g.push(Tv(`${_}`));else throw Error(`Invalid template literal part: ${_}`);$._zod.pattern=new RegExp(`^${g.join("")}$`),$._zod.parse=(_,U)=>{if(typeof _.value!=="string")return _.issues.push({input:_.value,inst:$,expected:"string",code:"invalid_type"}),_;if($._zod.pattern.lastIndex=0,!$._zod.pattern.test(_.value))return _.issues.push({input:_.value,inst:$,code:"invalid_format",format:v.format??"template_literal",pattern:$._zod.pattern.source}),_;return _}}),Ub=X("$ZodFunction",($,v)=>{return v$.init($,v),$._def=v,$._zod.def=v,$.implement=(g)=>{if(typeof g!=="function")throw Error("implement() must be called with a function");return function(..._){let U=$._def.input?lU($._def.input,_):_,z=Reflect.apply(g,this,U);if($._def.output)return lU($._def.output,z);return z}},$.implementAsync=(g)=>{if(typeof g!=="function")throw Error("implementAsync() must be called with a function");return async function(..._){let U=$._def.input?await hU($._def.input,_):_,z=await Reflect.apply(g,this,U);if($._def.output)return await hU($._def.output,z);return z}},$._zod.parse=(g,_)=>{if(typeof g.value!=="function")return g.issues.push({code:"invalid_type",expected:"function",input:g.value,inst:$}),g;if($._def.output&&$._def.output._zod.def.type==="promise")g.value=$.implementAsync(g.value);else g.value=$.implement(g.value);return g},$.input=(...g)=>{let _=$.constructor;if(Array.isArray(g[0]))return new _({type:"function",input:new J1({type:"tuple",items:g[0],rest:g[1]}),output:$._def.output});return new _({type:"function",input:g[0],output:$._def.output})},$.output=(g)=>{return new $.constructor({type:"function",input:$._def.input,output:g})},$}),gb=X("$ZodPromise",($,v)=>{v$.init($,v),$._zod.parse=(g,_)=>{return Promise.resolve(g.value).then((U)=>v.innerType._zod.run({value:U,issues:[]},_))}}),_b=X("$ZodLazy",($,v)=>{v$.init($,v),b$($._zod,"innerType",()=>v.getter()),b$($._zod,"pattern",()=>$._zod.innerType?._zod?.pattern),b$($._zod,"propValues",()=>$._zod.innerType?._zod?.propValues),b$($._zod,"optin",()=>$._zod.innerType?._zod?.optin??void 0),b$($._zod,"optout",()=>$._zod.innerType?._zod?.optout??void 0),$._zod.parse=(g,_)=>{return $._zod.innerType._zod.run(g,_)}}),zb=X("$ZodCustom",($,v)=>{N$.init($,v),v$.init($,v),$._zod.parse=(g,_)=>{return g},$._zod.check=(g)=>{let _=g.value,U=v.fn(_);if(U instanceof Promise)return U.then((z)=>D5(z,g,_,$));D5(U,g,_,$);return}});function D5($,v,g,_){if(!$){let U={code:"custom",input:g,inst:_,path:[..._._zod.def.path??[]],continue:!_._zod.def.abort};if(_._zod.def.params)U.params=_._zod.def.params;v.issues.push(R4(U))}}var Ug={};v6(Ug,{zhTW:()=>db,zhCN:()=>tb,yo:()=>ab,vi:()=>nb,uz:()=>ob,ur:()=>pb,uk:()=>vg,ua:()=>xb,tr:()=>hb,th:()=>lb,ta:()=>ib,sv:()=>mb,sl:()=>cb,ru:()=>Eb,pt:()=>fb,ps:()=>Vb,pl:()=>Cb,ota:()=>jb,no:()=>Tb,nl:()=>Db,ms:()=>Rb,mk:()=>yb,lt:()=>ub,ko:()=>rb,km:()=>eU,kh:()=>Nb,ka:()=>Qb,ja:()=>Mb,it:()=>Sb,is:()=>Zb,id:()=>wb,hy:()=>Ab,hu:()=>Xb,he:()=>qb,frCA:()=>Yb,fr:()=>Fb,fi:()=>Lb,fa:()=>Ib,es:()=>Hb,eo:()=>kb,en:()=>sU,de:()=>Pb,da:()=>Bb,cs:()=>Wb,ca:()=>Kb,bg:()=>Gb,be:()=>Ob,az:()=>bb,ar:()=>Jb});var yI=()=>{let $={string:{unit:"حرف",verb:"أن يحوي"},file:{unit:"بايت",verb:"أن يحوي"},array:{unit:"عنصر",verb:"أن يحوي"},set:{unit:"عنصر",verb:"أن يحوي"}};function v(U){return $[U]??null}let g={regex:"مدخل",email:"بريد إلكتروني",url:"رابط",emoji:"إيموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاريخ ووقت بمعيار ISO",date:"تاريخ بمعيار ISO",time:"وقت بمعيار ISO",duration:"مدة بمعيار ISO",ipv4:"عنوان IPv4",ipv6:"عنوان IPv6",cidrv4:"مدى عناوين بصيغة IPv4",cidrv6:"مدى عناوين بصيغة IPv6",base64:"نَص بترميز base64-encoded",base64url:"نَص بترميز base64url-encoded",json_string:"نَص على هيئة JSON",e164:"رقم هاتف بمعيار E.164",jwt:"JWT",template_literal:"مدخل"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`مدخلات غير مقبولة: يفترض إدخال instanceof ${U.expected}، ولكن تم إدخال ${b}`;return`مدخلات غير مقبولة: يفترض إدخال ${z}، ولكن تم إدخال ${b}`}case"invalid_value":if(U.values.length===1)return`مدخلات غير مقبولة: يفترض إدخال ${R(U.values[0])}`;return`اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return` أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()} ${J.unit??"عنصر"}`;return`أكبر من اللازم: يفترض أن تكون ${U.origin??"القيمة"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()} ${J.unit}`;return`أصغر من اللازم: يفترض لـ ${U.origin} أن يكون ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`نَص غير مقبول: يجب أن يبدأ بـ "${U.prefix}"`;if(z.format==="ends_with")return`نَص غير مقبول: يجب أن ينتهي بـ "${z.suffix}"`;if(z.format==="includes")return`نَص غير مقبول: يجب أن يتضمَّن "${z.includes}"`;if(z.format==="regex")return`نَص غير مقبول: يجب أن يطابق النمط ${z.pattern}`;return`${g[z.format]??U.format} غير مقبول`}case"not_multiple_of":return`رقم غير مقبول: يجب أن يكون من مضاعفات ${U.divisor}`;case"unrecognized_keys":return`معرف${U.keys.length>1?"ات":""} غريب${U.keys.length>1?"ة":""}: ${w(U.keys,"، ")}`;case"invalid_key":return`معرف غير مقبول في ${U.origin}`;case"invalid_union":return"مدخل غير مقبول";case"invalid_element":return`مدخل غير مقبول في ${U.origin}`;default:return"مدخل غير مقبول"}}};function Jb(){return{localeError:yI()}}var RI=()=>{let $={string:{unit:"simvol",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"element",verb:"olmalıdır"},set:{unit:"element",verb:"olmalıdır"}};function v(U){return $[U]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Yanlış dəyər: gözlənilən instanceof ${U.expected}, daxil olan ${b}`;return`Yanlış dəyər: gözlənilən ${z}, daxil olan ${b}`}case"invalid_value":if(U.values.length===1)return`Yanlış dəyər: gözlənilən ${R(U.values[0])}`;return`Yanlış seçim: aşağıdakılardan biri olmalıdır: ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()} ${J.unit??"element"}`;return`Çox böyük: gözlənilən ${U.origin??"dəyər"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()} ${J.unit}`;return`Çox kiçik: gözlənilən ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Yanlış mətn: "${z.prefix}" ilə başlamalıdır`;if(z.format==="ends_with")return`Yanlış mətn: "${z.suffix}" ilə bitməlidir`;if(z.format==="includes")return`Yanlış mətn: "${z.includes}" daxil olmalıdır`;if(z.format==="regex")return`Yanlış mətn: ${z.pattern} şablonuna uyğun olmalıdır`;return`Yanlış ${g[z.format]??U.format}`}case"not_multiple_of":return`Yanlış ədəd: ${U.divisor} ilə bölünə bilən olmalıdır`;case"unrecognized_keys":return`Tanınmayan açar${U.keys.length>1?"lar":""}: ${w(U.keys,", ")}`;case"invalid_key":return`${U.origin} daxilində yanlış açar`;case"invalid_union":return"Yanlış dəyər";case"invalid_element":return`${U.origin} daxilində yanlış dəyər`;default:return"Yanlış dəyər"}}};function bb(){return{localeError:RI()}}function E5($,v,g,_){let U=Math.abs($),z=U%10,J=U%100;if(J>=11&&J<=19)return _;if(z===1)return v;if(z>=2&&z<=4)return g;return _}var DI=()=>{let $={string:{unit:{one:"сімвал",few:"сімвалы",many:"сімвалаў"},verb:"мець"},array:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},set:{unit:{one:"элемент",few:"элементы",many:"элементаў"},verb:"мець"},file:{unit:{one:"байт",few:"байты",many:"байтаў"},verb:"мець"}};function v(U){return $[U]??null}let g={regex:"увод",email:"email адрас",url:"URL",emoji:"эмодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата і час",date:"ISO дата",time:"ISO час",duration:"ISO працягласць",ipv4:"IPv4 адрас",ipv6:"IPv6 адрас",cidrv4:"IPv4 дыяпазон",cidrv6:"IPv6 дыяпазон",base64:"радок у фармаце base64",base64url:"радок у фармаце base64url",json_string:"JSON радок",e164:"нумар E.164",jwt:"JWT",template_literal:"увод"},_={nan:"NaN",number:"лік",array:"масіў"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Няправільны ўвод: чакаўся instanceof ${U.expected}, атрымана ${b}`;return`Няправільны ўвод: чакаўся ${z}, атрымана ${b}`}case"invalid_value":if(U.values.length===1)return`Няправільны ўвод: чакалася ${R(U.values[0])}`;return`Няправільны варыянт: чакаўся адзін з ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J){let b=Number(U.maximum),G=E5(b,J.unit.one,J.unit.few,J.unit.many);return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна ${J.verb} ${z}${U.maximum.toString()} ${G}`}return`Занадта вялікі: чакалася, што ${U.origin??"значэнне"} павінна быць ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J){let b=Number(U.minimum),G=E5(b,J.unit.one,J.unit.few,J.unit.many);return`Занадта малы: чакалася, што ${U.origin} павінна ${J.verb} ${z}${U.minimum.toString()} ${G}`}return`Занадта малы: чакалася, што ${U.origin} павінна быць ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Няправільны радок: павінен пачынацца з "${z.prefix}"`;if(z.format==="ends_with")return`Няправільны радок: павінен заканчвацца на "${z.suffix}"`;if(z.format==="includes")return`Няправільны радок: павінен змяшчаць "${z.includes}"`;if(z.format==="regex")return`Няправільны радок: павінен адпавядаць шаблону ${z.pattern}`;return`Няправільны ${g[z.format]??U.format}`}case"not_multiple_of":return`Няправільны лік: павінен быць кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспазнаны ${U.keys.length>1?"ключы":"ключ"}: ${w(U.keys,", ")}`;case"invalid_key":return`Няправільны ключ у ${U.origin}`;case"invalid_union":return"Няправільны ўвод";case"invalid_element":return`Няправільнае значэнне ў ${U.origin}`;default:return"Няправільны ўвод"}}};function Ob(){return{localeError:DI()}}var TI=()=>{let $={string:{unit:"символа",verb:"да съдържа"},file:{unit:"байта",verb:"да съдържа"},array:{unit:"елемента",verb:"да съдържа"},set:{unit:"елемента",verb:"да съдържа"}};function v(U){return $[U]??null}let g={regex:"вход",email:"имейл адрес",url:"URL",emoji:"емоджи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO време",date:"ISO дата",time:"ISO време",duration:"ISO продължителност",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"base64-кодиран низ",base64url:"base64url-кодиран низ",json_string:"JSON низ",e164:"E.164 номер",jwt:"JWT",template_literal:"вход"},_={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Невалиден вход: очакван instanceof ${U.expected}, получен ${b}`;return`Невалиден вход: очакван ${z}, получен ${b}`}case"invalid_value":if(U.values.length===1)return`Невалиден вход: очакван ${R(U.values[0])}`;return`Невалидна опция: очаквано едно от ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Твърде голямо: очаква се ${U.origin??"стойност"} да съдържа ${z}${U.maximum.toString()} ${J.unit??"елемента"}`;return`Твърде голямо: очаква се ${U.origin??"стойност"} да бъде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Твърде малко: очаква се ${U.origin} да съдържа ${z}${U.minimum.toString()} ${J.unit}`;return`Твърде малко: очаква се ${U.origin} да бъде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Невалиден низ: трябва да започва с "${z.prefix}"`;if(z.format==="ends_with")return`Невалиден низ: трябва да завършва с "${z.suffix}"`;if(z.format==="includes")return`Невалиден низ: трябва да включва "${z.includes}"`;if(z.format==="regex")return`Невалиден низ: трябва да съвпада с ${z.pattern}`;let J="Невалиден";if(z.format==="emoji")J="Невалидно";if(z.format==="datetime")J="Невалидно";if(z.format==="date")J="Невалидна";if(z.format==="time")J="Невалидно";if(z.format==="duration")J="Невалидна";return`${J} ${g[z.format]??U.format}`}case"not_multiple_of":return`Невалидно число: трябва да бъде кратно на ${U.divisor}`;case"unrecognized_keys":return`Неразпознат${U.keys.length>1?"и":""} ключ${U.keys.length>1?"ове":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Невалиден ключ в ${U.origin}`;case"invalid_union":return"Невалиден вход";case"invalid_element":return`Невалидна стойност в ${U.origin}`;default:return"Невалиден вход"}}};function Gb(){return{localeError:TI()}}var jI=()=>{let $={string:{unit:"caràcters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function v(U){return $[U]??null}let g={regex:"entrada",email:"adreça electrònica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adreça IPv4",ipv6:"adreça IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Tipus invàlid: s'esperava instanceof ${U.expected}, s'ha rebut ${b}`;return`Tipus invàlid: s'esperava ${z}, s'ha rebut ${b}`}case"invalid_value":if(U.values.length===1)return`Valor invàlid: s'esperava ${R(U.values[0])}`;return`Opció invàlida: s'esperava una de ${w(U.values," o ")}`;case"too_big":{let z=U.inclusive?"com a màxim":"menys de",J=v(U.origin);if(J)return`Massa gran: s'esperava que ${U.origin??"el valor"} contingués ${z} ${U.maximum.toString()} ${J.unit??"elements"}`;return`Massa gran: s'esperava que ${U.origin??"el valor"} fos ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"com a mínim":"més de",J=v(U.origin);if(J)return`Massa petit: s'esperava que ${U.origin} contingués ${z} ${U.minimum.toString()} ${J.unit}`;return`Massa petit: s'esperava que ${U.origin} fos ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Format invàlid: ha de començar amb "${z.prefix}"`;if(z.format==="ends_with")return`Format invàlid: ha d'acabar amb "${z.suffix}"`;if(z.format==="includes")return`Format invàlid: ha d'incloure "${z.includes}"`;if(z.format==="regex")return`Format invàlid: ha de coincidir amb el patró ${z.pattern}`;return`Format invàlid per a ${g[z.format]??U.format}`}case"not_multiple_of":return`Número invàlid: ha de ser múltiple de ${U.divisor}`;case"unrecognized_keys":return`Clau${U.keys.length>1?"s":""} no reconeguda${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Clau invàlida a ${U.origin}`;case"invalid_union":return"Entrada invàlida";case"invalid_element":return`Element invàlid a ${U.origin}`;default:return"Entrada invàlida"}}};function Kb(){return{localeError:jI()}}var VI=()=>{let $={string:{unit:"znaků",verb:"mít"},file:{unit:"bajtů",verb:"mít"},array:{unit:"prvků",verb:"mít"},set:{unit:"prvků",verb:"mít"}};function v(U){return $[U]??null}let g={regex:"regulární výraz",email:"e-mailová adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a čas ve formátu ISO",date:"datum ve formátu ISO",time:"čas ve formátu ISO",duration:"doba trvání ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"řetězec zakódovaný ve formátu base64",base64url:"řetězec zakódovaný ve formátu base64url",json_string:"řetězec ve formátu JSON",e164:"číslo E.164",jwt:"JWT",template_literal:"vstup"},_={nan:"NaN",number:"číslo",string:"řetězec",function:"funkce",array:"pole"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Neplatný vstup: očekáváno instanceof ${U.expected}, obdrženo ${b}`;return`Neplatný vstup: očekáváno ${z}, obdrženo ${b}`}case"invalid_value":if(U.values.length===1)return`Neplatný vstup: očekáváno ${R(U.values[0])}`;return`Neplatná možnost: očekávána jedna z hodnot ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí mít ${z}${U.maximum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš velká: ${U.origin??"hodnota"} musí být ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí mít ${z}${U.minimum.toString()} ${J.unit??"prvků"}`;return`Hodnota je příliš malá: ${U.origin??"hodnota"} musí být ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neplatný řetězec: musí začínat na "${z.prefix}"`;if(z.format==="ends_with")return`Neplatný řetězec: musí končit na "${z.suffix}"`;if(z.format==="includes")return`Neplatný řetězec: musí obsahovat "${z.includes}"`;if(z.format==="regex")return`Neplatný řetězec: musí odpovídat vzoru ${z.pattern}`;return`Neplatný formát ${g[z.format]??U.format}`}case"not_multiple_of":return`Neplatné číslo: musí být násobkem ${U.divisor}`;case"unrecognized_keys":return`Neznámé klíče: ${w(U.keys,", ")}`;case"invalid_key":return`Neplatný klíč v ${U.origin}`;case"invalid_union":return"Neplatný vstup";case"invalid_element":return`Neplatná hodnota v ${U.origin}`;default:return"Neplatný vstup"}}};function Wb(){return{localeError:VI()}}var CI=()=>{let $={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function v(U){return $[U]??null}let g={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslæt",date:"ISO-dato",time:"ISO-klokkeslæt",duration:"ISO-varighed",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},_={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"sæt",file:"fil"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Ugyldigt input: forventede instanceof ${U.expected}, fik ${b}`;return`Ugyldigt input: forventede ${z}, fik ${b}`}case"invalid_value":if(U.values.length===1)return`Ugyldig værdi: forventede ${R(U.values[0])}`;return`Ugyldigt valg: forventede en af følgende ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin),b=_[U.origin]??U.origin;if(J)return`For stor: forventede ${b??"value"} ${J.verb} ${z} ${U.maximum.toString()} ${J.unit??"elementer"}`;return`For stor: forventede ${b??"value"} havde ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin),b=_[U.origin]??U.origin;if(J)return`For lille: forventede ${b} ${J.verb} ${z} ${U.minimum.toString()} ${J.unit}`;return`For lille: forventede ${b} havde ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: skal starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: skal ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: skal indeholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: skal matche mønsteret ${z.pattern}`;return`Ugyldig ${g[z.format]??U.format}`}case"not_multiple_of":return`Ugyldigt tal: skal være deleligt med ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukendte nøgler":"Ukendt nøgle"}: ${w(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøgle i ${U.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig værdi i ${U.origin}`;default:return"Ugyldigt input"}}};function Bb(){return{localeError:CI()}}var fI=()=>{let $={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function v(U){return $[U]??null}let g={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},_={nan:"NaN",number:"Zahl",array:"Array"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Ungültige Eingabe: erwartet instanceof ${U.expected}, erhalten ${b}`;return`Ungültige Eingabe: erwartet ${z}, erhalten ${b}`}case"invalid_value":if(U.values.length===1)return`Ungültige Eingabe: erwartet ${R(U.values[0])}`;return`Ungültige Option: erwartet eine von ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ${J.unit??"Elemente"} hat`;return`Zu groß: erwartet, dass ${U.origin??"Wert"} ${z}${U.maximum.toString()} ist`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ${J.unit} hat`;return`Zu klein: erwartet, dass ${U.origin} ${z}${U.minimum.toString()} ist`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ungültiger String: muss mit "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ungültiger String: muss mit "${z.suffix}" enden`;if(z.format==="includes")return`Ungültiger String: muss "${z.includes}" enthalten`;if(z.format==="regex")return`Ungültiger String: muss dem Muster ${z.pattern} entsprechen`;return`Ungültig: ${g[z.format]??U.format}`}case"not_multiple_of":return`Ungültige Zahl: muss ein Vielfaches von ${U.divisor} sein`;case"unrecognized_keys":return`${U.keys.length>1?"Unbekannte Schlüssel":"Unbekannter Schlüssel"}: ${w(U.keys,", ")}`;case"invalid_key":return`Ungültiger Schlüssel in ${U.origin}`;case"invalid_union":return"Ungültige Eingabe";case"invalid_element":return`Ungültiger Wert in ${U.origin}`;default:return"Ungültige Eingabe"}}};function Pb(){return{localeError:fI()}}var EI=()=>{let $={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function v(U){return $[U]??null}let g={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;return`Invalid input: expected ${z}, received ${b}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${R(U.values[0])}`;return`Invalid option: expected one of ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Too big: expected ${U.origin??"value"} to have ${z}${U.maximum.toString()} ${J.unit??"elements"}`;return`Too big: expected ${U.origin??"value"} to be ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Too small: expected ${U.origin} to have ${z}${U.minimum.toString()} ${J.unit}`;return`Too small: expected ${U.origin} to be ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Invalid string: must start with "${z.prefix}"`;if(z.format==="ends_with")return`Invalid string: must end with "${z.suffix}"`;if(z.format==="includes")return`Invalid string: must include "${z.includes}"`;if(z.format==="regex")return`Invalid string: must match pattern ${z.pattern}`;return`Invalid ${g[z.format]??U.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${U.divisor}`;case"unrecognized_keys":return`Unrecognized key${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Invalid key in ${U.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${U.origin}`;default:return"Invalid input"}}};function sU(){return{localeError:EI()}}var cI=()=>{let $={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function v(U){return $[U]??null}let g={regex:"enigo",email:"retadreso",url:"URL",emoji:"emoĝio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-daŭro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},_={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Nevalida enigo: atendiĝis instanceof ${U.expected}, riceviĝis ${b}`;return`Nevalida enigo: atendiĝis ${z}, riceviĝis ${b}`}case"invalid_value":if(U.values.length===1)return`Nevalida enigo: atendiĝis ${R(U.values[0])}`;return`Nevalida opcio: atendiĝis unu el ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()} ${J.unit??"elementojn"}`;return`Tro granda: atendiĝis ke ${U.origin??"valoro"} havu ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Tro malgranda: atendiĝis ke ${U.origin} havu ${z}${U.minimum.toString()} ${J.unit}`;return`Tro malgranda: atendiĝis ke ${U.origin} estu ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nevalida karaktraro: devas komenciĝi per "${z.prefix}"`;if(z.format==="ends_with")return`Nevalida karaktraro: devas finiĝi per "${z.suffix}"`;if(z.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${z.includes}"`;if(z.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${z.pattern}`;return`Nevalida ${g[z.format]??U.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${U.divisor}`;case"unrecognized_keys":return`Nekonata${U.keys.length>1?"j":""} ŝlosilo${U.keys.length>1?"j":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Nevalida ŝlosilo en ${U.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${U.origin}`;default:return"Nevalida enigo"}}};function kb(){return{localeError:cI()}}var mI=()=>{let $={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function v(U){return $[U]??null}let g={regex:"entrada",email:"dirección de correo electrónico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duración ISO",ipv4:"dirección IPv4",ipv6:"dirección IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN",string:"texto",number:"número",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"número grande",symbol:"símbolo",undefined:"indefinido",null:"nulo",function:"función",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeración",union:"unión",literal:"literal",promise:"promesa",void:"vacío",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Entrada inválida: se esperaba instanceof ${U.expected}, recibido ${b}`;return`Entrada inválida: se esperaba ${z}, recibido ${b}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: se esperaba ${R(U.values[0])}`;return`Opción inválida: se esperaba una de ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin),b=_[U.origin]??U.origin;if(J)return`Demasiado grande: se esperaba que ${b??"valor"} tuviera ${z}${U.maximum.toString()} ${J.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${b??"valor"} fuera ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin),b=_[U.origin]??U.origin;if(J)return`Demasiado pequeño: se esperaba que ${b} tuviera ${z}${U.minimum.toString()} ${J.unit}`;return`Demasiado pequeño: se esperaba que ${b} fuera ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Cadena inválida: debe comenzar con "${z.prefix}"`;if(z.format==="ends_with")return`Cadena inválida: debe terminar en "${z.suffix}"`;if(z.format==="includes")return`Cadena inválida: debe incluir "${z.includes}"`;if(z.format==="regex")return`Cadena inválida: debe coincidir con el patrón ${z.pattern}`;return`Inválido ${g[z.format]??U.format}`}case"not_multiple_of":return`Número inválido: debe ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Llave${U.keys.length>1?"s":""} desconocida${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Llave inválida en ${_[U.origin]??U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido en ${_[U.origin]??U.origin}`;default:return"Entrada inválida"}}};function Hb(){return{localeError:mI()}}var iI=()=>{let $={string:{unit:"کاراکتر",verb:"داشته باشد"},file:{unit:"بایت",verb:"داشته باشد"},array:{unit:"آیتم",verb:"داشته باشد"},set:{unit:"آیتم",verb:"داشته باشد"}};function v(U){return $[U]??null}let g={regex:"ورودی",email:"آدرس ایمیل",url:"URL",emoji:"ایموجی",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"تاریخ و زمان ایزو",date:"تاریخ ایزو",time:"زمان ایزو",duration:"مدت زمان ایزو",ipv4:"IPv4 آدرس",ipv6:"IPv6 آدرس",cidrv4:"IPv4 دامنه",cidrv6:"IPv6 دامنه",base64:"base64-encoded رشته",base64url:"base64url-encoded رشته",json_string:"JSON رشته",e164:"E.164 عدد",jwt:"JWT",template_literal:"ورودی"},_={nan:"NaN",number:"عدد",array:"آرایه"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`ورودی نامعتبر: می‌بایست instanceof ${U.expected} می‌بود، ${b} دریافت شد`;return`ورودی نامعتبر: می‌بایست ${z} می‌بود، ${b} دریافت شد`}case"invalid_value":if(U.values.length===1)return`ورودی نامعتبر: می‌بایست ${R(U.values[0])} می‌بود`;return`گزینه نامعتبر: می‌بایست یکی از ${w(U.values,"|")} می‌بود`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} ${J.unit??"عنصر"} باشد`;return`خیلی بزرگ: ${U.origin??"مقدار"} باید ${z}${U.maximum.toString()} باشد`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} ${J.unit} باشد`;return`خیلی کوچک: ${U.origin} باید ${z}${U.minimum.toString()} باشد`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`رشته نامعتبر: باید با "${z.prefix}" شروع شود`;if(z.format==="ends_with")return`رشته نامعتبر: باید با "${z.suffix}" تمام شود`;if(z.format==="includes")return`رشته نامعتبر: باید شامل "${z.includes}" باشد`;if(z.format==="regex")return`رشته نامعتبر: باید با الگوی ${z.pattern} مطابقت داشته باشد`;return`${g[z.format]??U.format} نامعتبر`}case"not_multiple_of":return`عدد نامعتبر: باید مضرب ${U.divisor} باشد`;case"unrecognized_keys":return`کلید${U.keys.length>1?"های":""} ناشناس: ${w(U.keys,", ")}`;case"invalid_key":return`کلید ناشناس در ${U.origin}`;case"invalid_union":return"ورودی نامعتبر";case"invalid_element":return`مقدار نامعتبر در ${U.origin}`;default:return"ورودی نامعتبر"}}};function Ib(){return{localeError:iI()}}var lI=()=>{let $={string:{unit:"merkkiä",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"päivämäärän"}};function v(U){return $[U]??null}let g={regex:"säännöllinen lauseke",email:"sähköpostiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-päivämäärä",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Virheellinen tyyppi: odotettiin instanceof ${U.expected}, oli ${b}`;return`Virheellinen tyyppi: odotettiin ${z}, oli ${b}`}case"invalid_value":if(U.values.length===1)return`Virheellinen syöte: täytyy olla ${R(U.values[0])}`;return`Virheellinen valinta: täytyy olla yksi seuraavista: ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Liian suuri: ${J.subject} täytyy olla ${z}${U.maximum.toString()} ${J.unit}`.trim();return`Liian suuri: arvon täytyy olla ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Liian pieni: ${J.subject} täytyy olla ${z}${U.minimum.toString()} ${J.unit}`.trim();return`Liian pieni: arvon täytyy olla ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Virheellinen syöte: täytyy alkaa "${z.prefix}"`;if(z.format==="ends_with")return`Virheellinen syöte: täytyy loppua "${z.suffix}"`;if(z.format==="includes")return`Virheellinen syöte: täytyy sisältää "${z.includes}"`;if(z.format==="regex")return`Virheellinen syöte: täytyy vastata säännöllistä lauseketta ${z.pattern}`;return`Virheellinen ${g[z.format]??U.format}`}case"not_multiple_of":return`Virheellinen luku: täytyy olla luvun ${U.divisor} monikerta`;case"unrecognized_keys":return`${U.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${w(U.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen syöte"}}};function Lb(){return{localeError:lI()}}var hI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(U){return $[U]??null}let g={regex:"entrée",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},_={nan:"NaN",number:"nombre",array:"tableau"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : instanceof ${U.expected} attendu, ${b} reçu`;return`Entrée invalide : ${z} attendu, ${b} reçu`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : ${R(U.values[0])} attendu`;return`Option invalide : une valeur parmi ${w(U.values,"|")} attendue`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Trop grand : ${U.origin??"valeur"} doit ${J.verb} ${z}${U.maximum.toString()} ${J.unit??"élément(s)"}`;return`Trop grand : ${U.origin??"valeur"} doit être ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Trop petit : ${U.origin} doit ${J.verb} ${z}${U.minimum.toString()} ${J.unit}`;return`Trop petit : ${U.origin} doit être ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au modèle ${z.pattern}`;return`${g[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${w(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function Fb(){return{localeError:hI()}}var xI=()=>{let $={string:{unit:"caractères",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"éléments",verb:"avoir"},set:{unit:"éléments",verb:"avoir"}};function v(U){return $[U]??null}let g={regex:"entrée",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"durée ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"chaîne encodée en base64",base64url:"chaîne encodée en base64url",json_string:"chaîne JSON",e164:"numéro E.164",jwt:"JWT",template_literal:"entrée"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Entrée invalide : attendu instanceof ${U.expected}, reçu ${b}`;return`Entrée invalide : attendu ${z}, reçu ${b}`}case"invalid_value":if(U.values.length===1)return`Entrée invalide : attendu ${R(U.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"≤":"<",J=v(U.origin);if(J)return`Trop grand : attendu que ${U.origin??"la valeur"} ait ${z}${U.maximum.toString()} ${J.unit}`;return`Trop grand : attendu que ${U.origin??"la valeur"} soit ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"≥":">",J=v(U.origin);if(J)return`Trop petit : attendu que ${U.origin} ait ${z}${U.minimum.toString()} ${J.unit}`;return`Trop petit : attendu que ${U.origin} soit ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chaîne invalide : doit commencer par "${z.prefix}"`;if(z.format==="ends_with")return`Chaîne invalide : doit se terminer par "${z.suffix}"`;if(z.format==="includes")return`Chaîne invalide : doit inclure "${z.includes}"`;if(z.format==="regex")return`Chaîne invalide : doit correspondre au motif ${z.pattern}`;return`${g[z.format]??U.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit être un multiple de ${U.divisor}`;case"unrecognized_keys":return`Clé${U.keys.length>1?"s":""} non reconnue${U.keys.length>1?"s":""} : ${w(U.keys,", ")}`;case"invalid_key":return`Clé invalide dans ${U.origin}`;case"invalid_union":return"Entrée invalide";case"invalid_element":return`Valeur invalide dans ${U.origin}`;default:return"Entrée invalide"}}};function Yb(){return{localeError:xI()}}var pI=()=>{let $={string:{label:"מחרוזת",gender:"f"},number:{label:"מספר",gender:"m"},boolean:{label:"ערך בוליאני",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"תאריך",gender:"m"},array:{label:"מערך",gender:"m"},object:{label:"אובייקט",gender:"m"},null:{label:"ערך ריק (null)",gender:"m"},undefined:{label:"ערך לא מוגדר (undefined)",gender:"m"},symbol:{label:"סימבול (Symbol)",gender:"m"},function:{label:"פונקציה",gender:"f"},map:{label:"מפה (Map)",gender:"f"},set:{label:"קבוצה (Set)",gender:"f"},file:{label:"קובץ",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"ערך לא ידוע",gender:"m"},value:{label:"ערך",gender:"m"}},v={string:{unit:"תווים",shortLabel:"קצר",longLabel:"ארוך"},file:{unit:"בייטים",shortLabel:"קטן",longLabel:"גדול"},array:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},set:{unit:"פריטים",shortLabel:"קטן",longLabel:"גדול"},number:{unit:"",shortLabel:"קטן",longLabel:"גדול"}},g=(K)=>K?$[K]:void 0,_=(K)=>{let W=g(K);if(W)return W.label;return K??$.unknown.label},U=(K)=>`ה${_(K)}`,z=(K)=>{return(g(K)?.gender??"m")==="f"?"צריכה להיות":"צריך להיות"},J=(K)=>{if(!K)return null;return v[K]??null},b={regex:{label:"קלט",gender:"m"},email:{label:"כתובת אימייל",gender:"f"},url:{label:"כתובת רשת",gender:"f"},emoji:{label:"אימוג'י",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"תאריך וזמן ISO",gender:"m"},date:{label:"תאריך ISO",gender:"m"},time:{label:"זמן ISO",gender:"m"},duration:{label:"משך זמן ISO",gender:"m"},ipv4:{label:"כתובת IPv4",gender:"f"},ipv6:{label:"כתובת IPv6",gender:"f"},cidrv4:{label:"טווח IPv4",gender:"m"},cidrv6:{label:"טווח IPv6",gender:"m"},base64:{label:"מחרוזת בבסיס 64",gender:"f"},base64url:{label:"מחרוזת בבסיס 64 לכתובות רשת",gender:"f"},json_string:{label:"מחרוזת JSON",gender:"f"},e164:{label:"מספר E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"קלט",gender:"m"},includes:{label:"קלט",gender:"m"},lowercase:{label:"קלט",gender:"m"},starts_with:{label:"קלט",gender:"m"},uppercase:{label:"קלט",gender:"m"}},G={nan:"NaN"};return(K)=>{switch(K.code){case"invalid_type":{let W=K.expected,B=G[W??""]??_(W),k=D(K.input),P=G[k]??$[k]?.label??k;if(/^[A-Z]/.test(K.expected))return`קלט לא תקין: צריך להיות instanceof ${K.expected}, התקבל ${P}`;return`קלט לא תקין: צריך להיות ${B}, התקבל ${P}`}case"invalid_value":{if(K.values.length===1)return`ערך לא תקין: הערך חייב להיות ${R(K.values[0])}`;let W=K.values.map((P)=>R(P));if(K.values.length===2)return`ערך לא תקין: האפשרויות המתאימות הן ${W[0]} או ${W[1]}`;let B=W[W.length-1];return`ערך לא תקין: האפשרויות המתאימות הן ${W.slice(0,-1).join(", ")} או ${B}`}case"too_big":{let W=J(K.origin),B=U(K.origin??"value");if(K.origin==="string")return`${W?.longLabel??"ארוך"} מדי: ${B} צריכה להכיל ${K.maximum.toString()} ${W?.unit??""} ${K.inclusive?"או פחות":"לכל היותר"}`.trim();if(K.origin==="number"){let q=K.inclusive?`קטן או שווה ל-${K.maximum}`:`קטן מ-${K.maximum}`;return`גדול מדי: ${B} צריך להיות ${q}`}if(K.origin==="array"||K.origin==="set"){let q=K.origin==="set"?"צריכה":"צריך",L=K.inclusive?`${K.maximum} ${W?.unit??""} או פחות`:`פחות מ-${K.maximum} ${W?.unit??""}`;return`גדול מדי: ${B} ${q} להכיל ${L}`.trim()}let k=K.inclusive?"<=":"<",P=z(K.origin??"value");if(W?.unit)return`${W.longLabel} מדי: ${B} ${P} ${k}${K.maximum.toString()} ${W.unit}`;return`${W?.longLabel??"גדול"} מדי: ${B} ${P} ${k}${K.maximum.toString()}`}case"too_small":{let W=J(K.origin),B=U(K.origin??"value");if(K.origin==="string")return`${W?.shortLabel??"קצר"} מדי: ${B} צריכה להכיל ${K.minimum.toString()} ${W?.unit??""} ${K.inclusive?"או יותר":"לפחות"}`.trim();if(K.origin==="number"){let q=K.inclusive?`גדול או שווה ל-${K.minimum}`:`גדול מ-${K.minimum}`;return`קטן מדי: ${B} צריך להיות ${q}`}if(K.origin==="array"||K.origin==="set"){let q=K.origin==="set"?"צריכה":"צריך";if(K.minimum===1&&K.inclusive){let H=K.origin==="set"?"לפחות פריט אחד":"לפחות פריט אחד";return`קטן מדי: ${B} ${q} להכיל ${H}`}let L=K.inclusive?`${K.minimum} ${W?.unit??""} או יותר`:`יותר מ-${K.minimum} ${W?.unit??""}`;return`קטן מדי: ${B} ${q} להכיל ${L}`.trim()}let k=K.inclusive?">=":">",P=z(K.origin??"value");if(W?.unit)return`${W.shortLabel} מדי: ${B} ${P} ${k}${K.minimum.toString()} ${W.unit}`;return`${W?.shortLabel??"קטן"} מדי: ${B} ${P} ${k}${K.minimum.toString()}`}case"invalid_format":{let W=K;if(W.format==="starts_with")return`המחרוזת חייבת להתחיל ב "${W.prefix}"`;if(W.format==="ends_with")return`המחרוזת חייבת להסתיים ב "${W.suffix}"`;if(W.format==="includes")return`המחרוזת חייבת לכלול "${W.includes}"`;if(W.format==="regex")return`המחרוזת חייבת להתאים לתבנית ${W.pattern}`;let B=b[W.format],k=B?.label??W.format,q=(B?.gender??"m")==="f"?"תקינה":"תקין";return`${k} לא ${q}`}case"not_multiple_of":return`מספר לא תקין: חייב להיות מכפלה של ${K.divisor}`;case"unrecognized_keys":return`מפתח${K.keys.length>1?"ות":""} לא מזוה${K.keys.length>1?"ים":"ה"}: ${w(K.keys,", ")}`;case"invalid_key":return"שדה לא תקין באובייקט";case"invalid_union":return"קלט לא תקין";case"invalid_element":return`ערך לא תקין ב${U(K.origin??"array")}`;default:return"קלט לא תקין"}}};function qb(){return{localeError:pI()}}var oI=()=>{let $={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function v(U){return $[U]??null}let g={regex:"bemenet",email:"email cím",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO időbélyeg",date:"ISO dátum",time:"ISO idő",duration:"ISO időintervallum",ipv4:"IPv4 cím",ipv6:"IPv6 cím",cidrv4:"IPv4 tartomány",cidrv6:"IPv6 tartomány",base64:"base64-kódolt string",base64url:"base64url-kódolt string",json_string:"JSON string",e164:"E.164 szám",jwt:"JWT",template_literal:"bemenet"},_={nan:"NaN",number:"szám",array:"tömb"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Érvénytelen bemenet: a várt érték instanceof ${U.expected}, a kapott érték ${b}`;return`Érvénytelen bemenet: a várt érték ${z}, a kapott érték ${b}`}case"invalid_value":if(U.values.length===1)return`Érvénytelen bemenet: a várt érték ${R(U.values[0])}`;return`Érvénytelen opció: valamelyik érték várt ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Túl nagy: ${U.origin??"érték"} mérete túl nagy ${z}${U.maximum.toString()} ${J.unit??"elem"}`;return`Túl nagy: a bemeneti érték ${U.origin??"érték"} túl nagy: ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Túl kicsi: a bemeneti érték ${U.origin} mérete túl kicsi ${z}${U.minimum.toString()} ${J.unit}`;return`Túl kicsi: a bemeneti érték ${U.origin} túl kicsi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Érvénytelen string: "${z.prefix}" értékkel kell kezdődnie`;if(z.format==="ends_with")return`Érvénytelen string: "${z.suffix}" értékkel kell végződnie`;if(z.format==="includes")return`Érvénytelen string: "${z.includes}" értéket kell tartalmaznia`;if(z.format==="regex")return`Érvénytelen string: ${z.pattern} mintának kell megfelelnie`;return`Érvénytelen ${g[z.format]??U.format}`}case"not_multiple_of":return`Érvénytelen szám: ${U.divisor} többszörösének kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Érvénytelen kulcs ${U.origin}`;case"invalid_union":return"Érvénytelen bemenet";case"invalid_element":return`Érvénytelen érték: ${U.origin}`;default:return"Érvénytelen bemenet"}}};function Xb(){return{localeError:oI()}}function c5($,v,g){return Math.abs($)===1?v:g}function E4($){if(!$)return"";let v=["ա","ե","ը","ի","ո","ու","օ"],g=$[$.length-1];return $+(v.includes(g)?"ն":"ը")}var nI=()=>{let $={string:{unit:{one:"նշան",many:"նշաններ"},verb:"ունենալ"},file:{unit:{one:"բայթ",many:"բայթեր"},verb:"ունենալ"},array:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"},set:{unit:{one:"տարր",many:"տարրեր"},verb:"ունենալ"}};function v(U){return $[U]??null}let g={regex:"մուտք",email:"էլ. հասցե",url:"URL",emoji:"էմոջի",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO ամսաթիվ և ժամ",date:"ISO ամսաթիվ",time:"ISO ժամ",duration:"ISO տևողություն",ipv4:"IPv4 հասցե",ipv6:"IPv6 հասցե",cidrv4:"IPv4 միջակայք",cidrv6:"IPv6 միջակայք",base64:"base64 ձևաչափով տող",base64url:"base64url ձևաչափով տող",json_string:"JSON տող",e164:"E.164 համար",jwt:"JWT",template_literal:"մուտք"},_={nan:"NaN",number:"թիվ",array:"զանգված"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Սխալ մուտքագրում․ սպասվում էր instanceof ${U.expected}, ստացվել է ${b}`;return`Սխալ մուտքագրում․ սպասվում էր ${z}, ստացվել է ${b}`}case"invalid_value":if(U.values.length===1)return`Սխալ մուտքագրում․ սպասվում էր ${R(U.values[1])}`;return`Սխալ տարբերակ․ սպասվում էր հետևյալներից մեկը՝ ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J){let b=Number(U.maximum),G=c5(b,J.unit.one,J.unit.many);return`Չափազանց մեծ արժեք․ սպասվում է, որ ${E4(U.origin??"արժեք")} կունենա ${z}${U.maximum.toString()} ${G}`}return`Չափազանց մեծ արժեք․ սպասվում է, որ ${E4(U.origin??"արժեք")} լինի ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J){let b=Number(U.minimum),G=c5(b,J.unit.one,J.unit.many);return`Չափազանց փոքր արժեք․ սպասվում է, որ ${E4(U.origin)} կունենա ${z}${U.minimum.toString()} ${G}`}return`Չափազանց փոքր արժեք․ սպասվում է, որ ${E4(U.origin)} լինի ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Սխալ տող․ պետք է սկսվի "${z.prefix}"-ով`;if(z.format==="ends_with")return`Սխալ տող․ պետք է ավարտվի "${z.suffix}"-ով`;if(z.format==="includes")return`Սխալ տող․ պետք է պարունակի "${z.includes}"`;if(z.format==="regex")return`Սխալ տող․ պետք է համապատասխանի ${z.pattern} ձևաչափին`;return`Սխալ ${g[z.format]??U.format}`}case"not_multiple_of":return`Սխալ թիվ․ պետք է բազմապատիկ լինի ${U.divisor}-ի`;case"unrecognized_keys":return`Չճանաչված բանալի${U.keys.length>1?"ներ":""}. ${w(U.keys,", ")}`;case"invalid_key":return`Սխալ բանալի ${E4(U.origin)}-ում`;case"invalid_union":return"Սխալ մուտքագրում";case"invalid_element":return`Սխալ արժեք ${E4(U.origin)}-ում`;default:return"Սխալ մուտքագրում"}}};function Ab(){return{localeError:nI()}}var tI=()=>{let $={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function v(U){return $[U]??null}let g={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Input tidak valid: diharapkan instanceof ${U.expected}, diterima ${b}`;return`Input tidak valid: diharapkan ${z}, diterima ${b}`}case"invalid_value":if(U.values.length===1)return`Input tidak valid: diharapkan ${R(U.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Terlalu besar: diharapkan ${U.origin??"value"} memiliki ${z}${U.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: diharapkan ${U.origin??"value"} menjadi ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Terlalu kecil: diharapkan ${U.origin} memiliki ${z}${U.minimum.toString()} ${J.unit}`;return`Terlalu kecil: diharapkan ${U.origin} menjadi ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak valid: harus dimulai dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak valid: harus berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak valid: harus menyertakan "${z.includes}"`;if(z.format==="regex")return`String tidak valid: harus sesuai pola ${z.pattern}`;return`${g[z.format]??U.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${U.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${U.origin}`;default:return"Input tidak valid"}}};function wb(){return{localeError:tI()}}var dI=()=>{let $={string:{unit:"stafi",verb:"að hafa"},file:{unit:"bæti",verb:"að hafa"},array:{unit:"hluti",verb:"að hafa"},set:{unit:"hluti",verb:"að hafa"}};function v(U){return $[U]??null}let g={regex:"gildi",email:"netfang",url:"vefslóð",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og tími",date:"ISO dagsetning",time:"ISO tími",duration:"ISO tímalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 tölugildi",jwt:"JWT",template_literal:"gildi"},_={nan:"NaN",number:"númer",array:"fylki"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Rangt gildi: Þú slóst inn ${b} þar sem á að vera instanceof ${U.expected}`;return`Rangt gildi: Þú slóst inn ${b} þar sem á að vera ${z}`}case"invalid_value":if(U.values.length===1)return`Rangt gildi: gert ráð fyrir ${R(U.values[0])}`;return`Ógilt val: má vera eitt af eftirfarandi ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} hafi ${z}${U.maximum.toString()} ${J.unit??"hluti"}`;return`Of stórt: gert er ráð fyrir að ${U.origin??"gildi"} sé ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Of lítið: gert er ráð fyrir að ${U.origin} hafi ${z}${U.minimum.toString()} ${J.unit}`;return`Of lítið: gert er ráð fyrir að ${U.origin} sé ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ógildur strengur: verður að byrja á "${z.prefix}"`;if(z.format==="ends_with")return`Ógildur strengur: verður að enda á "${z.suffix}"`;if(z.format==="includes")return`Ógildur strengur: verður að innihalda "${z.includes}"`;if(z.format==="regex")return`Ógildur strengur: verður að fylgja mynstri ${z.pattern}`;return`Rangt ${g[z.format]??U.format}`}case"not_multiple_of":return`Röng tala: verður að vera margfeldi af ${U.divisor}`;case"unrecognized_keys":return`Óþekkt ${U.keys.length>1?"ir lyklar":"ur lykill"}: ${w(U.keys,", ")}`;case"invalid_key":return`Rangur lykill í ${U.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi í ${U.origin}`;default:return"Rangt gildi"}}};function Zb(){return{localeError:dI()}}var aI=()=>{let $={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function v(U){return $[U]??null}let g={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"numero",array:"vettore"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Input non valido: atteso instanceof ${U.expected}, ricevuto ${b}`;return`Input non valido: atteso ${z}, ricevuto ${b}`}case"invalid_value":if(U.values.length===1)return`Input non valido: atteso ${R(U.values[0])}`;return`Opzione non valida: atteso uno tra ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Troppo grande: ${U.origin??"valore"} deve avere ${z}${U.maximum.toString()} ${J.unit??"elementi"}`;return`Troppo grande: ${U.origin??"valore"} deve essere ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Troppo piccolo: ${U.origin} deve avere ${z}${U.minimum.toString()} ${J.unit}`;return`Troppo piccolo: ${U.origin} deve essere ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Stringa non valida: deve iniziare con "${z.prefix}"`;if(z.format==="ends_with")return`Stringa non valida: deve terminare con "${z.suffix}"`;if(z.format==="includes")return`Stringa non valida: deve includere "${z.includes}"`;if(z.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${z.pattern}`;return`Invalid ${g[z.format]??U.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${U.divisor}`;case"unrecognized_keys":return`Chiav${U.keys.length>1?"i":"e"} non riconosciut${U.keys.length>1?"e":"a"}: ${w(U.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${U.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${U.origin}`;default:return"Input non valido"}}};function Sb(){return{localeError:aI()}}var sI=()=>{let $={string:{unit:"文字",verb:"である"},file:{unit:"バイト",verb:"である"},array:{unit:"要素",verb:"である"},set:{unit:"要素",verb:"である"}};function v(U){return $[U]??null}let g={regex:"入力値",email:"メールアドレス",url:"URL",emoji:"絵文字",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日時",date:"ISO日付",time:"ISO時刻",duration:"ISO期間",ipv4:"IPv4アドレス",ipv6:"IPv6アドレス",cidrv4:"IPv4範囲",cidrv6:"IPv6範囲",base64:"base64エンコード文字列",base64url:"base64urlエンコード文字列",json_string:"JSON文字列",e164:"E.164番号",jwt:"JWT",template_literal:"入力値"},_={nan:"NaN",number:"数値",array:"配列"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`無効な入力: instanceof ${U.expected}が期待されましたが、${b}が入力されました`;return`無効な入力: ${z}が期待されましたが、${b}が入力されました`}case"invalid_value":if(U.values.length===1)return`無効な入力: ${R(U.values[0])}が期待されました`;return`無効な選択: ${w(U.values,"、")}のいずれかである必要があります`;case"too_big":{let z=U.inclusive?"以下である":"より小さい",J=v(U.origin);if(J)return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${J.unit??"要素"}${z}必要があります`;return`大きすぎる値: ${U.origin??"値"}は${U.maximum.toString()}${z}必要があります`}case"too_small":{let z=U.inclusive?"以上である":"より大きい",J=v(U.origin);if(J)return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${J.unit}${z}必要があります`;return`小さすぎる値: ${U.origin}は${U.minimum.toString()}${z}必要があります`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無効な文字列: "${z.prefix}"で始まる必要があります`;if(z.format==="ends_with")return`無効な文字列: "${z.suffix}"で終わる必要があります`;if(z.format==="includes")return`無効な文字列: "${z.includes}"を含む必要があります`;if(z.format==="regex")return`無効な文字列: パターン${z.pattern}に一致する必要があります`;return`無効な${g[z.format]??U.format}`}case"not_multiple_of":return`無効な数値: ${U.divisor}の倍数である必要があります`;case"unrecognized_keys":return`認識されていないキー${U.keys.length>1?"群":""}: ${w(U.keys,"、")}`;case"invalid_key":return`${U.origin}内の無効なキー`;case"invalid_union":return"無効な入力";case"invalid_element":return`${U.origin}内の無効な値`;default:return"無効な入力"}}};function Mb(){return{localeError:sI()}}var eI=()=>{let $={string:{unit:"სიმბოლო",verb:"უნდა შეიცავდეს"},file:{unit:"ბაიტი",verb:"უნდა შეიცავდეს"},array:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"},set:{unit:"ელემენტი",verb:"უნდა შეიცავდეს"}};function v(U){return $[U]??null}let g={regex:"შეყვანა",email:"ელ-ფოსტის მისამართი",url:"URL",emoji:"ემოჯი",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"თარიღი-დრო",date:"თარიღი",time:"დრო",duration:"ხანგრძლივობა",ipv4:"IPv4 მისამართი",ipv6:"IPv6 მისამართი",cidrv4:"IPv4 დიაპაზონი",cidrv6:"IPv6 დიაპაზონი",base64:"base64-კოდირებული სტრინგი",base64url:"base64url-კოდირებული სტრინგი",json_string:"JSON სტრინგი",e164:"E.164 ნომერი",jwt:"JWT",template_literal:"შეყვანა"},_={nan:"NaN",number:"რიცხვი",string:"სტრინგი",boolean:"ბულეანი",function:"ფუნქცია",array:"მასივი"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`არასწორი შეყვანა: მოსალოდნელი instanceof ${U.expected}, მიღებული ${b}`;return`არასწორი შეყვანა: მოსალოდნელი ${z}, მიღებული ${b}`}case"invalid_value":if(U.values.length===1)return`არასწორი შეყვანა: მოსალოდნელი ${R(U.values[0])}`;return`არასწორი ვარიანტი: მოსალოდნელია ერთ-ერთი ${w(U.values,"|")}-დან`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} ${J.verb} ${z}${U.maximum.toString()} ${J.unit}`;return`ზედმეტად დიდი: მოსალოდნელი ${U.origin??"მნიშვნელობა"} იყოს ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} ${J.verb} ${z}${U.minimum.toString()} ${J.unit}`;return`ზედმეტად პატარა: მოსალოდნელი ${U.origin} იყოს ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`არასწორი სტრინგი: უნდა იწყებოდეს "${z.prefix}"-ით`;if(z.format==="ends_with")return`არასწორი სტრინგი: უნდა მთავრდებოდეს "${z.suffix}"-ით`;if(z.format==="includes")return`არასწორი სტრინგი: უნდა შეიცავდეს "${z.includes}"-ს`;if(z.format==="regex")return`არასწორი სტრინგი: უნდა შეესაბამებოდეს შაბლონს ${z.pattern}`;return`არასწორი ${g[z.format]??U.format}`}case"not_multiple_of":return`არასწორი რიცხვი: უნდა იყოს ${U.divisor}-ის ჯერადი`;case"unrecognized_keys":return`უცნობი გასაღებ${U.keys.length>1?"ები":"ი"}: ${w(U.keys,", ")}`;case"invalid_key":return`არასწორი გასაღები ${U.origin}-ში`;case"invalid_union":return"არასწორი შეყვანა";case"invalid_element":return`არასწორი მნიშვნელობა ${U.origin}-ში`;default:return"არასწორი შეყვანა"}}};function Qb(){return{localeError:eI()}}var $L=()=>{let $={string:{unit:"តួអក្សរ",verb:"គួរមាន"},file:{unit:"បៃ",verb:"គួរមាន"},array:{unit:"ធាតុ",verb:"គួរមាន"},set:{unit:"ធាតុ",verb:"គួរមាន"}};function v(U){return $[U]??null}let g={regex:"ទិន្នន័យបញ្ចូល",email:"អាសយដ្ឋានអ៊ីមែល",url:"URL",emoji:"សញ្ញាអារម្មណ៍",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"កាលបរិច្ឆេទ និងម៉ោង ISO",date:"កាលបរិច្ឆេទ ISO",time:"ម៉ោង ISO",duration:"រយៈពេល ISO",ipv4:"អាសយដ្ឋាន IPv4",ipv6:"អាសយដ្ឋាន IPv6",cidrv4:"ដែនអាសយដ្ឋាន IPv4",cidrv6:"ដែនអាសយដ្ឋាន IPv6",base64:"ខ្សែអក្សរអ៊ិកូដ base64",base64url:"ខ្សែអក្សរអ៊ិកូដ base64url",json_string:"ខ្សែអក្សរ JSON",e164:"លេខ E.164",jwt:"JWT",template_literal:"ទិន្នន័យបញ្ចូល"},_={nan:"NaN",number:"លេខ",array:"អារេ (Array)",null:"គ្មានតម្លៃ (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ instanceof ${U.expected} ប៉ុន្តែទទួលបាន ${b}`;return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${z} ប៉ុន្តែទទួលបាន ${b}`}case"invalid_value":if(U.values.length===1)return`ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${R(U.values[0])}`;return`ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()} ${J.unit??"ធាតុ"}`;return`ធំពេក៖ ត្រូវការ ${U.origin??"តម្លៃ"} ${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()} ${J.unit}`;return`តូចពេក៖ ត្រូវការ ${U.origin} ${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវចាប់ផ្តើមដោយ "${z.prefix}"`;if(z.format==="ends_with")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវបញ្ចប់ដោយ "${z.suffix}"`;if(z.format==="includes")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវមាន "${z.includes}"`;if(z.format==="regex")return`ខ្សែអក្សរមិនត្រឹមត្រូវ៖ ត្រូវតែផ្គូផ្គងនឹងទម្រង់ដែលបានកំណត់ ${z.pattern}`;return`មិនត្រឹមត្រូវ៖ ${g[z.format]??U.format}`}case"not_multiple_of":return`លេខមិនត្រឹមត្រូវ៖ ត្រូវតែជាពហុគុណនៃ ${U.divisor}`;case"unrecognized_keys":return`រកឃើញសោមិនស្គាល់៖ ${w(U.keys,", ")}`;case"invalid_key":return`សោមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;case"invalid_union":return"ទិន្នន័យមិនត្រឹមត្រូវ";case"invalid_element":return`ទិន្នន័យមិនត្រឹមត្រូវនៅក្នុង ${U.origin}`;default:return"ទិន្នន័យមិនត្រឹមត្រូវ"}}};function eU(){return{localeError:$L()}}function Nb(){return eU()}var vL=()=>{let $={string:{unit:"문자",verb:"to have"},file:{unit:"바이트",verb:"to have"},array:{unit:"개",verb:"to have"},set:{unit:"개",verb:"to have"}};function v(U){return $[U]??null}let g={regex:"입력",email:"이메일 주소",url:"URL",emoji:"이모지",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 날짜시간",date:"ISO 날짜",time:"ISO 시간",duration:"ISO 기간",ipv4:"IPv4 주소",ipv6:"IPv6 주소",cidrv4:"IPv4 범위",cidrv6:"IPv6 범위",base64:"base64 인코딩 문자열",base64url:"base64url 인코딩 문자열",json_string:"JSON 문자열",e164:"E.164 번호",jwt:"JWT",template_literal:"입력"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`잘못된 입력: 예상 타입은 instanceof ${U.expected}, 받은 타입은 ${b}입니다`;return`잘못된 입력: 예상 타입은 ${z}, 받은 타입은 ${b}입니다`}case"invalid_value":if(U.values.length===1)return`잘못된 입력: 값은 ${R(U.values[0])} 이어야 합니다`;return`잘못된 옵션: ${w(U.values,"또는 ")} 중 하나여야 합니다`;case"too_big":{let z=U.inclusive?"이하":"미만",J=z==="미만"?"이어야 합니다":"여야 합니다",b=v(U.origin),G=b?.unit??"요소";if(b)return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()}${G} ${z}${J}`;return`${U.origin??"값"}이 너무 큽니다: ${U.maximum.toString()} ${z}${J}`}case"too_small":{let z=U.inclusive?"이상":"초과",J=z==="이상"?"이어야 합니다":"여야 합니다",b=v(U.origin),G=b?.unit??"요소";if(b)return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()}${G} ${z}${J}`;return`${U.origin??"값"}이 너무 작습니다: ${U.minimum.toString()} ${z}${J}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`잘못된 문자열: "${z.prefix}"(으)로 시작해야 합니다`;if(z.format==="ends_with")return`잘못된 문자열: "${z.suffix}"(으)로 끝나야 합니다`;if(z.format==="includes")return`잘못된 문자열: "${z.includes}"을(를) 포함해야 합니다`;if(z.format==="regex")return`잘못된 문자열: 정규식 ${z.pattern} 패턴과 일치해야 합니다`;return`잘못된 ${g[z.format]??U.format}`}case"not_multiple_of":return`잘못된 숫자: ${U.divisor}의 배수여야 합니다`;case"unrecognized_keys":return`인식할 수 없는 키: ${w(U.keys,", ")}`;case"invalid_key":return`잘못된 키: ${U.origin}`;case"invalid_union":return"잘못된 입력";case"invalid_element":return`잘못된 값: ${U.origin}`;default:return"잘못된 입력"}}};function rb(){return{localeError:vL()}}var $g=($)=>{return $.charAt(0).toUpperCase()+$.slice(1)};function m5($){let v=Math.abs($),g=v%10,_=v%100;if(_>=11&&_<=19||g===0)return"many";if(g===1)return"one";return"few"}var UL=()=>{let $={string:{unit:{one:"simbolis",few:"simboliai",many:"simbolių"},verb:{smaller:{inclusive:"turi būti ne ilgesnė kaip",notInclusive:"turi būti trumpesnė kaip"},bigger:{inclusive:"turi būti ne trumpesnė kaip",notInclusive:"turi būti ilgesnė kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"baitų"},verb:{smaller:{inclusive:"turi būti ne didesnis kaip",notInclusive:"turi būti mažesnis kaip"},bigger:{inclusive:"turi būti ne mažesnis kaip",notInclusive:"turi būti didesnis kaip"}}},array:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}},set:{unit:{one:"elementą",few:"elementus",many:"elementų"},verb:{smaller:{inclusive:"turi turėti ne daugiau kaip",notInclusive:"turi turėti mažiau kaip"},bigger:{inclusive:"turi turėti ne mažiau kaip",notInclusive:"turi turėti daugiau kaip"}}}};function v(U,z,J,b){let G=$[U]??null;if(G===null)return G;return{unit:G.unit[z],verb:G.verb[b][J?"inclusive":"notInclusive"]}}let g={regex:"įvestis",email:"el. pašto adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukmė",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 užkoduota eilutė",base64url:"base64url užkoduota eilutė",json_string:"JSON eilutė",e164:"E.164 numeris",jwt:"JWT",template_literal:"įvestis"},_={nan:"NaN",number:"skaičius",bigint:"sveikasis skaičius",string:"eilutė",boolean:"loginė reikšmė",undefined:"neapibrėžta reikšmė",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulinė reikšmė"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Gautas tipas ${b}, o tikėtasi - instanceof ${U.expected}`;return`Gautas tipas ${b}, o tikėtasi - ${z}`}case"invalid_value":if(U.values.length===1)return`Privalo būti ${R(U.values[0])}`;return`Privalo būti vienas iš ${w(U.values,"|")} pasirinkimų`;case"too_big":{let z=_[U.origin]??U.origin,J=v(U.origin,m5(Number(U.maximum)),U.inclusive??!1,"smaller");if(J?.verb)return`${$g(z??U.origin??"reikšmė")} ${J.verb} ${U.maximum.toString()} ${J.unit??"elementų"}`;let b=U.inclusive?"ne didesnis kaip":"mažesnis kaip";return`${$g(z??U.origin??"reikšmė")} turi būti ${b} ${U.maximum.toString()} ${J?.unit}`}case"too_small":{let z=_[U.origin]??U.origin,J=v(U.origin,m5(Number(U.minimum)),U.inclusive??!1,"bigger");if(J?.verb)return`${$g(z??U.origin??"reikšmė")} ${J.verb} ${U.minimum.toString()} ${J.unit??"elementų"}`;let b=U.inclusive?"ne mažesnis kaip":"didesnis kaip";return`${$g(z??U.origin??"reikšmė")} turi būti ${b} ${U.minimum.toString()} ${J?.unit}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Eilutė privalo prasidėti "${z.prefix}"`;if(z.format==="ends_with")return`Eilutė privalo pasibaigti "${z.suffix}"`;if(z.format==="includes")return`Eilutė privalo įtraukti "${z.includes}"`;if(z.format==="regex")return`Eilutė privalo atitikti ${z.pattern}`;return`Neteisingas ${g[z.format]??U.format}`}case"not_multiple_of":return`Skaičius privalo būti ${U.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpažint${U.keys.length>1?"i":"as"} rakt${U.keys.length>1?"ai":"as"}: ${w(U.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga įvestis";case"invalid_element":{let z=_[U.origin]??U.origin;return`${$g(z??U.origin??"reikšmė")} turi klaidingą įvestį`}default:return"Klaidinga įvestis"}}};function ub(){return{localeError:UL()}}var gL=()=>{let $={string:{unit:"знаци",verb:"да имаат"},file:{unit:"бајти",verb:"да имаат"},array:{unit:"ставки",verb:"да имаат"},set:{unit:"ставки",verb:"да имаат"}};function v(U){return $[U]??null}let g={regex:"внес",email:"адреса на е-пошта",url:"URL",emoji:"емоџи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO датум и време",date:"ISO датум",time:"ISO време",duration:"ISO времетраење",ipv4:"IPv4 адреса",ipv6:"IPv6 адреса",cidrv4:"IPv4 опсег",cidrv6:"IPv6 опсег",base64:"base64-енкодирана низа",base64url:"base64url-енкодирана низа",json_string:"JSON низа",e164:"E.164 број",jwt:"JWT",template_literal:"внес"},_={nan:"NaN",number:"број",array:"низа"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Грешен внес: се очекува instanceof ${U.expected}, примено ${b}`;return`Грешен внес: се очекува ${z}, примено ${b}`}case"invalid_value":if(U.values.length===1)return`Invalid input: expected ${R(U.values[0])}`;return`Грешана опција: се очекува една ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Премногу голем: се очекува ${U.origin??"вредноста"} да има ${z}${U.maximum.toString()} ${J.unit??"елементи"}`;return`Премногу голем: се очекува ${U.origin??"вредноста"} да биде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Премногу мал: се очекува ${U.origin} да има ${z}${U.minimum.toString()} ${J.unit}`;return`Премногу мал: се очекува ${U.origin} да биде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неважечка низа: мора да започнува со "${z.prefix}"`;if(z.format==="ends_with")return`Неважечка низа: мора да завршува со "${z.suffix}"`;if(z.format==="includes")return`Неважечка низа: мора да вклучува "${z.includes}"`;if(z.format==="regex")return`Неважечка низа: мора да одгоара на патернот ${z.pattern}`;return`Invalid ${g[z.format]??U.format}`}case"not_multiple_of":return`Грешен број: мора да биде делив со ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Непрепознаени клучеви":"Непрепознаен клуч"}: ${w(U.keys,", ")}`;case"invalid_key":return`Грешен клуч во ${U.origin}`;case"invalid_union":return"Грешен внес";case"invalid_element":return`Грешна вредност во ${U.origin}`;default:return"Грешен внес"}}};function yb(){return{localeError:gL()}}var _L=()=>{let $={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function v(U){return $[U]??null}let g={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"nombor"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Input tidak sah: dijangka instanceof ${U.expected}, diterima ${b}`;return`Input tidak sah: dijangka ${z}, diterima ${b}`}case"invalid_value":if(U.values.length===1)return`Input tidak sah: dijangka ${R(U.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Terlalu besar: dijangka ${U.origin??"nilai"} ${J.verb} ${z}${U.maximum.toString()} ${J.unit??"elemen"}`;return`Terlalu besar: dijangka ${U.origin??"nilai"} adalah ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Terlalu kecil: dijangka ${U.origin} ${J.verb} ${z}${U.minimum.toString()} ${J.unit}`;return`Terlalu kecil: dijangka ${U.origin} adalah ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`String tidak sah: mesti bermula dengan "${z.prefix}"`;if(z.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${z.suffix}"`;if(z.format==="includes")return`String tidak sah: mesti mengandungi "${z.includes}"`;if(z.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${z.pattern}`;return`${g[z.format]??U.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${U.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${w(U.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${U.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${U.origin}`;default:return"Input tidak sah"}}};function Rb(){return{localeError:_L()}}var zL=()=>{let $={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function v(U){return $[U]??null}let g={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},_={nan:"NaN",number:"getal"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Ongeldige invoer: verwacht instanceof ${U.expected}, ontving ${b}`;return`Ongeldige invoer: verwacht ${z}, ontving ${b}`}case"invalid_value":if(U.values.length===1)return`Ongeldige invoer: verwacht ${R(U.values[0])}`;return`Ongeldige optie: verwacht één van ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin),b=U.origin==="date"?"laat":U.origin==="string"?"lang":"groot";if(J)return`Te ${b}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} ${J.unit??"elementen"} ${J.verb}`;return`Te ${b}: verwacht dat ${U.origin??"waarde"} ${z}${U.maximum.toString()} is`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin),b=U.origin==="date"?"vroeg":U.origin==="string"?"kort":"klein";if(J)return`Te ${b}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} ${J.unit} ${J.verb}`;return`Te ${b}: verwacht dat ${U.origin} ${z}${U.minimum.toString()} is`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ongeldige tekst: moet met "${z.prefix}" beginnen`;if(z.format==="ends_with")return`Ongeldige tekst: moet op "${z.suffix}" eindigen`;if(z.format==="includes")return`Ongeldige tekst: moet "${z.includes}" bevatten`;if(z.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${z.pattern}`;return`Ongeldig: ${g[z.format]??U.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${U.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${U.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${U.origin}`;default:return"Ongeldige invoer"}}};function Db(){return{localeError:zL()}}var JL=()=>{let $={string:{unit:"tegn",verb:"å ha"},file:{unit:"bytes",verb:"å ha"},array:{unit:"elementer",verb:"å inneholde"},set:{unit:"elementer",verb:"å inneholde"}};function v(U){return $[U]??null}let g={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-område",ipv6:"IPv6-område",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"tall",array:"liste"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Ugyldig input: forventet instanceof ${U.expected}, fikk ${b}`;return`Ugyldig input: forventet ${z}, fikk ${b}`}case"invalid_value":if(U.values.length===1)return`Ugyldig verdi: forventet ${R(U.values[0])}`;return`Ugyldig valg: forventet en av ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()} ${J.unit??"elementer"}`;return`For stor(t): forventet ${U.origin??"value"} til å ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()} ${J.unit}`;return`For lite(n): forventet ${U.origin} til å ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ugyldig streng: må starte med "${z.prefix}"`;if(z.format==="ends_with")return`Ugyldig streng: må ende med "${z.suffix}"`;if(z.format==="includes")return`Ugyldig streng: må inneholde "${z.includes}"`;if(z.format==="regex")return`Ugyldig streng: må matche mønsteret ${z.pattern}`;return`Ugyldig ${g[z.format]??U.format}`}case"not_multiple_of":return`Ugyldig tall: må være et multiplum av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Ukjente nøkler":"Ukjent nøkkel"}: ${w(U.keys,", ")}`;case"invalid_key":return`Ugyldig nøkkel i ${U.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${U.origin}`;default:return"Ugyldig input"}}};function Tb(){return{localeError:JL()}}var bL=()=>{let $={string:{unit:"harf",verb:"olmalıdır"},file:{unit:"bayt",verb:"olmalıdır"},array:{unit:"unsur",verb:"olmalıdır"},set:{unit:"unsur",verb:"olmalıdır"}};function v(U){return $[U]??null}let g={regex:"giren",email:"epostagâh",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO hengâmı",date:"ISO tarihi",time:"ISO zamanı",duration:"ISO müddeti",ipv4:"IPv4 nişânı",ipv6:"IPv6 nişânı",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-şifreli metin",base64url:"base64url-şifreli metin",json_string:"JSON metin",e164:"E.164 sayısı",jwt:"JWT",template_literal:"giren"},_={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Fâsit giren: umulan instanceof ${U.expected}, alınan ${b}`;return`Fâsit giren: umulan ${z}, alınan ${b}`}case"invalid_value":if(U.values.length===1)return`Fâsit giren: umulan ${R(U.values[0])}`;return`Fâsit tercih: mûteberler ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} ${J.unit??"elements"} sahip olmalıydı.`;return`Fazla büyük: ${U.origin??"value"}, ${z}${U.maximum.toString()} olmalıydı.`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} ${J.unit} sahip olmalıydı.`;return`Fazla küçük: ${U.origin}, ${z}${U.minimum.toString()} olmalıydı.`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Fâsit metin: "${z.prefix}" ile başlamalı.`;if(z.format==="ends_with")return`Fâsit metin: "${z.suffix}" ile bitmeli.`;if(z.format==="includes")return`Fâsit metin: "${z.includes}" ihtivâ etmeli.`;if(z.format==="regex")return`Fâsit metin: ${z.pattern} nakşına uymalı.`;return`Fâsit ${g[z.format]??U.format}`}case"not_multiple_of":return`Fâsit sayı: ${U.divisor} katı olmalıydı.`;case"unrecognized_keys":return`Tanınmayan anahtar ${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`${U.origin} için tanınmayan anahtar var.`;case"invalid_union":return"Giren tanınamadı.";case"invalid_element":return`${U.origin} için tanınmayan kıymet var.`;default:return"Kıymet tanınamadı."}}};function jb(){return{localeError:bL()}}var OL=()=>{let $={string:{unit:"توکي",verb:"ولري"},file:{unit:"بایټس",verb:"ولري"},array:{unit:"توکي",verb:"ولري"},set:{unit:"توکي",verb:"ولري"}};function v(U){return $[U]??null}let g={regex:"ورودي",email:"بریښنالیک",url:"یو آر ال",emoji:"ایموجي",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"نیټه او وخت",date:"نېټه",time:"وخت",duration:"موده",ipv4:"د IPv4 پته",ipv6:"د IPv6 پته",cidrv4:"د IPv4 ساحه",cidrv6:"د IPv6 ساحه",base64:"base64-encoded متن",base64url:"base64url-encoded متن",json_string:"JSON متن",e164:"د E.164 شمېره",jwt:"JWT",template_literal:"ورودي"},_={nan:"NaN",number:"عدد",array:"ارې"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`ناسم ورودي: باید instanceof ${U.expected} وای, مګر ${b} ترلاسه شو`;return`ناسم ورودي: باید ${z} وای, مګر ${b} ترلاسه شو`}case"invalid_value":if(U.values.length===1)return`ناسم ورودي: باید ${R(U.values[0])} وای`;return`ناسم انتخاب: باید یو له ${w(U.values,"|")} څخه وای`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} ${J.unit??"عنصرونه"} ولري`;return`ډیر لوی: ${U.origin??"ارزښت"} باید ${z}${U.maximum.toString()} وي`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} ${J.unit} ولري`;return`ډیر کوچنی: ${U.origin} باید ${z}${U.minimum.toString()} وي`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`ناسم متن: باید د "${z.prefix}" سره پیل شي`;if(z.format==="ends_with")return`ناسم متن: باید د "${z.suffix}" سره پای ته ورسيږي`;if(z.format==="includes")return`ناسم متن: باید "${z.includes}" ولري`;if(z.format==="regex")return`ناسم متن: باید د ${z.pattern} سره مطابقت ولري`;return`${g[z.format]??U.format} ناسم دی`}case"not_multiple_of":return`ناسم عدد: باید د ${U.divisor} مضرب وي`;case"unrecognized_keys":return`ناسم ${U.keys.length>1?"کلیډونه":"کلیډ"}: ${w(U.keys,", ")}`;case"invalid_key":return`ناسم کلیډ په ${U.origin} کې`;case"invalid_union":return"ناسمه ورودي";case"invalid_element":return`ناسم عنصر په ${U.origin} کې`;default:return"ناسمه ورودي"}}};function Vb(){return{localeError:OL()}}var GL=()=>{let $={string:{unit:"znaków",verb:"mieć"},file:{unit:"bajtów",verb:"mieć"},array:{unit:"elementów",verb:"mieć"},set:{unit:"elementów",verb:"mieć"}};function v(U){return $[U]??null}let g={regex:"wyrażenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ciąg znaków zakodowany w formacie base64",base64url:"ciąg znaków zakodowany w formacie base64url",json_string:"ciąg znaków w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wejście"},_={nan:"NaN",number:"liczba",array:"tablica"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Nieprawidłowe dane wejściowe: oczekiwano instanceof ${U.expected}, otrzymano ${b}`;return`Nieprawidłowe dane wejściowe: oczekiwano ${z}, otrzymano ${b}`}case"invalid_value":if(U.values.length===1)return`Nieprawidłowe dane wejściowe: oczekiwano ${R(U.values[0])}`;return`Nieprawidłowa opcja: oczekiwano jednej z wartości ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Za duża wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.maximum.toString()} ${J.unit??"elementów"}`;return`Zbyt duż(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Za mała wartość: oczekiwano, że ${U.origin??"wartość"} będzie mieć ${z}${U.minimum.toString()} ${J.unit??"elementów"}`;return`Zbyt mał(y/a/e): oczekiwano, że ${U.origin??"wartość"} będzie wynosić ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Nieprawidłowy ciąg znaków: musi zaczynać się od "${z.prefix}"`;if(z.format==="ends_with")return`Nieprawidłowy ciąg znaków: musi kończyć się na "${z.suffix}"`;if(z.format==="includes")return`Nieprawidłowy ciąg znaków: musi zawierać "${z.includes}"`;if(z.format==="regex")return`Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${z.pattern}`;return`Nieprawidłow(y/a/e) ${g[z.format]??U.format}`}case"not_multiple_of":return`Nieprawidłowa liczba: musi być wielokrotnością ${U.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Nieprawidłowy klucz w ${U.origin}`;case"invalid_union":return"Nieprawidłowe dane wejściowe";case"invalid_element":return`Nieprawidłowa wartość w ${U.origin}`;default:return"Nieprawidłowe dane wejściowe"}}};function Cb(){return{localeError:GL()}}var KL=()=>{let $={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function v(U){return $[U]??null}let g={regex:"padrão",email:"endereço de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"duração ISO",ipv4:"endereço IPv4",ipv6:"endereço IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"número E.164",jwt:"JWT",template_literal:"entrada"},_={nan:"NaN",number:"número",null:"nulo"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Tipo inválido: esperado instanceof ${U.expected}, recebido ${b}`;return`Tipo inválido: esperado ${z}, recebido ${b}`}case"invalid_value":if(U.values.length===1)return`Entrada inválida: esperado ${R(U.values[0])}`;return`Opção inválida: esperada uma das ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Muito grande: esperado que ${U.origin??"valor"} tivesse ${z}${U.maximum.toString()} ${J.unit??"elementos"}`;return`Muito grande: esperado que ${U.origin??"valor"} fosse ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Muito pequeno: esperado que ${U.origin} tivesse ${z}${U.minimum.toString()} ${J.unit}`;return`Muito pequeno: esperado que ${U.origin} fosse ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Texto inválido: deve começar com "${z.prefix}"`;if(z.format==="ends_with")return`Texto inválido: deve terminar com "${z.suffix}"`;if(z.format==="includes")return`Texto inválido: deve incluir "${z.includes}"`;if(z.format==="regex")return`Texto inválido: deve corresponder ao padrão ${z.pattern}`;return`${g[z.format]??U.format} inválido`}case"not_multiple_of":return`Número inválido: deve ser múltiplo de ${U.divisor}`;case"unrecognized_keys":return`Chave${U.keys.length>1?"s":""} desconhecida${U.keys.length>1?"s":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Chave inválida em ${U.origin}`;case"invalid_union":return"Entrada inválida";case"invalid_element":return`Valor inválido em ${U.origin}`;default:return"Campo inválido"}}};function fb(){return{localeError:KL()}}function i5($,v,g,_){let U=Math.abs($),z=U%10,J=U%100;if(J>=11&&J<=19)return _;if(z===1)return v;if(z>=2&&z<=4)return g;return _}var WL=()=>{let $={string:{unit:{one:"символ",few:"символа",many:"символов"},verb:"иметь"},file:{unit:{one:"байт",few:"байта",many:"байт"},verb:"иметь"},array:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"},set:{unit:{one:"элемент",few:"элемента",many:"элементов"},verb:"иметь"}};function v(U){return $[U]??null}let g={regex:"ввод",email:"email адрес",url:"URL",emoji:"эмодзи",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO дата и время",date:"ISO дата",time:"ISO время",duration:"ISO длительность",ipv4:"IPv4 адрес",ipv6:"IPv6 адрес",cidrv4:"IPv4 диапазон",cidrv6:"IPv6 диапазон",base64:"строка в формате base64",base64url:"строка в формате base64url",json_string:"JSON строка",e164:"номер E.164",jwt:"JWT",template_literal:"ввод"},_={nan:"NaN",number:"число",array:"массив"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Неверный ввод: ожидалось instanceof ${U.expected}, получено ${b}`;return`Неверный ввод: ожидалось ${z}, получено ${b}`}case"invalid_value":if(U.values.length===1)return`Неверный ввод: ожидалось ${R(U.values[0])}`;return`Неверный вариант: ожидалось одно из ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J){let b=Number(U.maximum),G=i5(b,J.unit.one,J.unit.few,J.unit.many);return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет иметь ${z}${U.maximum.toString()} ${G}`}return`Слишком большое значение: ожидалось, что ${U.origin??"значение"} будет ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J){let b=Number(U.minimum),G=i5(b,J.unit.one,J.unit.few,J.unit.many);return`Слишком маленькое значение: ожидалось, что ${U.origin} будет иметь ${z}${U.minimum.toString()} ${G}`}return`Слишком маленькое значение: ожидалось, что ${U.origin} будет ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неверная строка: должна начинаться с "${z.prefix}"`;if(z.format==="ends_with")return`Неверная строка: должна заканчиваться на "${z.suffix}"`;if(z.format==="includes")return`Неверная строка: должна содержать "${z.includes}"`;if(z.format==="regex")return`Неверная строка: должна соответствовать шаблону ${z.pattern}`;return`Неверный ${g[z.format]??U.format}`}case"not_multiple_of":return`Неверное число: должно быть кратным ${U.divisor}`;case"unrecognized_keys":return`Нераспознанн${U.keys.length>1?"ые":"ый"} ключ${U.keys.length>1?"и":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Неверный ключ в ${U.origin}`;case"invalid_union":return"Неверные входные данные";case"invalid_element":return`Неверное значение в ${U.origin}`;default:return"Неверные входные данные"}}};function Eb(){return{localeError:WL()}}var BL=()=>{let $={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function v(U){return $[U]??null}let g={regex:"vnos",email:"e-poštni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in čas",date:"ISO datum",time:"ISO čas",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 številka",jwt:"JWT",template_literal:"vnos"},_={nan:"NaN",number:"število",array:"tabela"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Neveljaven vnos: pričakovano instanceof ${U.expected}, prejeto ${b}`;return`Neveljaven vnos: pričakovano ${z}, prejeto ${b}`}case"invalid_value":if(U.values.length===1)return`Neveljaven vnos: pričakovano ${R(U.values[0])}`;return`Neveljavna možnost: pričakovano eno izmed ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} imelo ${z}${U.maximum.toString()} ${J.unit??"elementov"}`;return`Preveliko: pričakovano, da bo ${U.origin??"vrednost"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Premajhno: pričakovano, da bo ${U.origin} imelo ${z}${U.minimum.toString()} ${J.unit}`;return`Premajhno: pričakovano, da bo ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Neveljaven niz: mora se začeti z "${z.prefix}"`;if(z.format==="ends_with")return`Neveljaven niz: mora se končati z "${z.suffix}"`;if(z.format==="includes")return`Neveljaven niz: mora vsebovati "${z.includes}"`;if(z.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${z.pattern}`;return`Neveljaven ${g[z.format]??U.format}`}case"not_multiple_of":return`Neveljavno število: mora biti večkratnik ${U.divisor}`;case"unrecognized_keys":return`Neprepoznan${U.keys.length>1?"i ključi":" ključ"}: ${w(U.keys,", ")}`;case"invalid_key":return`Neveljaven ključ v ${U.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${U.origin}`;default:return"Neveljaven vnos"}}};function cb(){return{localeError:BL()}}var PL=()=>{let $={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att innehålla"},set:{unit:"objekt",verb:"att innehålla"}};function v(U){return $[U]??null}let g={regex:"reguljärt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad sträng",base64url:"base64url-kodad sträng",json_string:"JSON-sträng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},_={nan:"NaN",number:"antal",array:"lista"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Ogiltig inmatning: förväntat instanceof ${U.expected}, fick ${b}`;return`Ogiltig inmatning: förväntat ${z}, fick ${b}`}case"invalid_value":if(U.values.length===1)return`Ogiltig inmatning: förväntat ${R(U.values[0])}`;return`Ogiltigt val: förväntade en av ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`För stor(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()} ${J.unit??"element"}`;return`För stor(t): förväntat ${U.origin??"värdet"} att ha ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()} ${J.unit}`;return`För lite(t): förväntade ${U.origin??"värdet"} att ha ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ogiltig sträng: måste börja med "${z.prefix}"`;if(z.format==="ends_with")return`Ogiltig sträng: måste sluta med "${z.suffix}"`;if(z.format==="includes")return`Ogiltig sträng: måste innehålla "${z.includes}"`;if(z.format==="regex")return`Ogiltig sträng: måste matcha mönstret "${z.pattern}"`;return`Ogiltig(t) ${g[z.format]??U.format}`}case"not_multiple_of":return`Ogiltigt tal: måste vara en multipel av ${U.divisor}`;case"unrecognized_keys":return`${U.keys.length>1?"Okända nycklar":"Okänd nyckel"}: ${w(U.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${U.origin??"värdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt värde i ${U.origin??"värdet"}`;default:return"Ogiltig input"}}};function mb(){return{localeError:PL()}}var kL=()=>{let $={string:{unit:"எழுத்துக்கள்",verb:"கொண்டிருக்க வேண்டும்"},file:{unit:"பைட்டுகள்",verb:"கொண்டிருக்க வேண்டும்"},array:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"},set:{unit:"உறுப்புகள்",verb:"கொண்டிருக்க வேண்டும்"}};function v(U){return $[U]??null}let g={regex:"உள்ளீடு",email:"மின்னஞ்சல் முகவரி",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO தேதி நேரம்",date:"ISO தேதி",time:"ISO நேரம்",duration:"ISO கால அளவு",ipv4:"IPv4 முகவரி",ipv6:"IPv6 முகவரி",cidrv4:"IPv4 வரம்பு",cidrv6:"IPv6 வரம்பு",base64:"base64-encoded சரம்",base64url:"base64url-encoded சரம்",json_string:"JSON சரம்",e164:"E.164 எண்",jwt:"JWT",template_literal:"input"},_={nan:"NaN",number:"எண்",array:"அணி",null:"வெறுமை"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது instanceof ${U.expected}, பெறப்பட்டது ${b}`;return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${z}, பெறப்பட்டது ${b}`}case"invalid_value":if(U.values.length===1)return`தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${R(U.values[0])}`;return`தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${w(U.values,"|")} இல் ஒன்று`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ${J.unit??"உறுப்புகள்"} ஆக இருக்க வேண்டும்`;return`மிக பெரியது: எதிர்பார்க்கப்பட்டது ${U.origin??"மதிப்பு"} ${z}${U.maximum.toString()} ஆக இருக்க வேண்டும்`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ${J.unit} ஆக இருக்க வேண்டும்`;return`மிகச் சிறியது: எதிர்பார்க்கப்பட்டது ${U.origin} ${z}${U.minimum.toString()} ஆக இருக்க வேண்டும்`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`தவறான சரம்: "${z.prefix}" இல் தொடங்க வேண்டும்`;if(z.format==="ends_with")return`தவறான சரம்: "${z.suffix}" இல் முடிவடைய வேண்டும்`;if(z.format==="includes")return`தவறான சரம்: "${z.includes}" ஐ உள்ளடக்க வேண்டும்`;if(z.format==="regex")return`தவறான சரம்: ${z.pattern} முறைபாட்டுடன் பொருந்த வேண்டும்`;return`தவறான ${g[z.format]??U.format}`}case"not_multiple_of":return`தவறான எண்: ${U.divisor} இன் பலமாக இருக்க வேண்டும்`;case"unrecognized_keys":return`அடையாளம் தெரியாத விசை${U.keys.length>1?"கள்":""}: ${w(U.keys,", ")}`;case"invalid_key":return`${U.origin} இல் தவறான விசை`;case"invalid_union":return"தவறான உள்ளீடு";case"invalid_element":return`${U.origin} இல் தவறான மதிப்பு`;default:return"தவறான உள்ளீடு"}}};function ib(){return{localeError:kL()}}var HL=()=>{let $={string:{unit:"ตัวอักษร",verb:"ควรมี"},file:{unit:"ไบต์",verb:"ควรมี"},array:{unit:"รายการ",verb:"ควรมี"},set:{unit:"รายการ",verb:"ควรมี"}};function v(U){return $[U]??null}let g={regex:"ข้อมูลที่ป้อน",email:"ที่อยู่อีเมล",url:"URL",emoji:"อิโมจิ",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"วันที่เวลาแบบ ISO",date:"วันที่แบบ ISO",time:"เวลาแบบ ISO",duration:"ช่วงเวลาแบบ ISO",ipv4:"ที่อยู่ IPv4",ipv6:"ที่อยู่ IPv6",cidrv4:"ช่วง IP แบบ IPv4",cidrv6:"ช่วง IP แบบ IPv6",base64:"ข้อความแบบ Base64",base64url:"ข้อความแบบ Base64 สำหรับ URL",json_string:"ข้อความแบบ JSON",e164:"เบอร์โทรศัพท์ระหว่างประเทศ (E.164)",jwt:"โทเคน JWT",template_literal:"ข้อมูลที่ป้อน"},_={nan:"NaN",number:"ตัวเลข",array:"อาร์เรย์ (Array)",null:"ไม่มีค่า (null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น instanceof ${U.expected} แต่ได้รับ ${b}`;return`ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${z} แต่ได้รับ ${b}`}case"invalid_value":if(U.values.length===1)return`ค่าไม่ถูกต้อง: ควรเป็น ${R(U.values[0])}`;return`ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"ไม่เกิน":"น้อยกว่า",J=v(U.origin);if(J)return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()} ${J.unit??"รายการ"}`;return`เกินกำหนด: ${U.origin??"ค่า"} ควรมี${z} ${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?"อย่างน้อย":"มากกว่า",J=v(U.origin);if(J)return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()} ${J.unit}`;return`น้อยกว่ากำหนด: ${U.origin} ควรมี${z} ${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องขึ้นต้นด้วย "${z.prefix}"`;if(z.format==="ends_with")return`รูปแบบไม่ถูกต้อง: ข้อความต้องลงท้ายด้วย "${z.suffix}"`;if(z.format==="includes")return`รูปแบบไม่ถูกต้อง: ข้อความต้องมี "${z.includes}" อยู่ในข้อความ`;if(z.format==="regex")return`รูปแบบไม่ถูกต้อง: ต้องตรงกับรูปแบบที่กำหนด ${z.pattern}`;return`รูปแบบไม่ถูกต้อง: ${g[z.format]??U.format}`}case"not_multiple_of":return`ตัวเลขไม่ถูกต้อง: ต้องเป็นจำนวนที่หารด้วย ${U.divisor} ได้ลงตัว`;case"unrecognized_keys":return`พบคีย์ที่ไม่รู้จัก: ${w(U.keys,", ")}`;case"invalid_key":return`คีย์ไม่ถูกต้องใน ${U.origin}`;case"invalid_union":return"ข้อมูลไม่ถูกต้อง: ไม่ตรงกับรูปแบบยูเนียนที่กำหนดไว้";case"invalid_element":return`ข้อมูลไม่ถูกต้องใน ${U.origin}`;default:return"ข้อมูลไม่ถูกต้อง"}}};function lb(){return{localeError:HL()}}var IL=()=>{let $={string:{unit:"karakter",verb:"olmalı"},file:{unit:"bayt",verb:"olmalı"},array:{unit:"öğe",verb:"olmalı"},set:{unit:"öğe",verb:"olmalı"}};function v(U){return $[U]??null}let g={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO süre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aralığı",cidrv6:"IPv6 aralığı",base64:"base64 ile şifrelenmiş metin",base64url:"base64url ile şifrelenmiş metin",json_string:"JSON dizesi",e164:"E.164 sayısı",jwt:"JWT",template_literal:"Şablon dizesi"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Geçersiz değer: beklenen instanceof ${U.expected}, alınan ${b}`;return`Geçersiz değer: beklenen ${z}, alınan ${b}`}case"invalid_value":if(U.values.length===1)return`Geçersiz değer: beklenen ${R(U.values[0])}`;return`Geçersiz seçenek: aşağıdakilerden biri olmalı: ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()} ${J.unit??"öğe"}`;return`Çok büyük: beklenen ${U.origin??"değer"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()} ${J.unit}`;return`Çok küçük: beklenen ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Geçersiz metin: "${z.prefix}" ile başlamalı`;if(z.format==="ends_with")return`Geçersiz metin: "${z.suffix}" ile bitmeli`;if(z.format==="includes")return`Geçersiz metin: "${z.includes}" içermeli`;if(z.format==="regex")return`Geçersiz metin: ${z.pattern} desenine uymalı`;return`Geçersiz ${g[z.format]??U.format}`}case"not_multiple_of":return`Geçersiz sayı: ${U.divisor} ile tam bölünebilmeli`;case"unrecognized_keys":return`Tanınmayan anahtar${U.keys.length>1?"lar":""}: ${w(U.keys,", ")}`;case"invalid_key":return`${U.origin} içinde geçersiz anahtar`;case"invalid_union":return"Geçersiz değer";case"invalid_element":return`${U.origin} içinde geçersiz değer`;default:return"Geçersiz değer"}}};function hb(){return{localeError:IL()}}var LL=()=>{let $={string:{unit:"символів",verb:"матиме"},file:{unit:"байтів",verb:"матиме"},array:{unit:"елементів",verb:"матиме"},set:{unit:"елементів",verb:"матиме"}};function v(U){return $[U]??null}let g={regex:"вхідні дані",email:"адреса електронної пошти",url:"URL",emoji:"емодзі",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"дата та час ISO",date:"дата ISO",time:"час ISO",duration:"тривалість ISO",ipv4:"адреса IPv4",ipv6:"адреса IPv6",cidrv4:"діапазон IPv4",cidrv6:"діапазон IPv6",base64:"рядок у кодуванні base64",base64url:"рядок у кодуванні base64url",json_string:"рядок JSON",e164:"номер E.164",jwt:"JWT",template_literal:"вхідні дані"},_={nan:"NaN",number:"число",array:"масив"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Неправильні вхідні дані: очікується instanceof ${U.expected}, отримано ${b}`;return`Неправильні вхідні дані: очікується ${z}, отримано ${b}`}case"invalid_value":if(U.values.length===1)return`Неправильні вхідні дані: очікується ${R(U.values[0])}`;return`Неправильна опція: очікується одне з ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Занадто велике: очікується, що ${U.origin??"значення"} ${J.verb} ${z}${U.maximum.toString()} ${J.unit??"елементів"}`;return`Занадто велике: очікується, що ${U.origin??"значення"} буде ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Занадто мале: очікується, що ${U.origin} ${J.verb} ${z}${U.minimum.toString()} ${J.unit}`;return`Занадто мале: очікується, що ${U.origin} буде ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Неправильний рядок: повинен починатися з "${z.prefix}"`;if(z.format==="ends_with")return`Неправильний рядок: повинен закінчуватися на "${z.suffix}"`;if(z.format==="includes")return`Неправильний рядок: повинен містити "${z.includes}"`;if(z.format==="regex")return`Неправильний рядок: повинен відповідати шаблону ${z.pattern}`;return`Неправильний ${g[z.format]??U.format}`}case"not_multiple_of":return`Неправильне число: повинно бути кратним ${U.divisor}`;case"unrecognized_keys":return`Нерозпізнаний ключ${U.keys.length>1?"і":""}: ${w(U.keys,", ")}`;case"invalid_key":return`Неправильний ключ у ${U.origin}`;case"invalid_union":return"Неправильні вхідні дані";case"invalid_element":return`Неправильне значення у ${U.origin}`;default:return"Неправильні вхідні дані"}}};function vg(){return{localeError:LL()}}function xb(){return vg()}var FL=()=>{let $={string:{unit:"حروف",verb:"ہونا"},file:{unit:"بائٹس",verb:"ہونا"},array:{unit:"آئٹمز",verb:"ہونا"},set:{unit:"آئٹمز",verb:"ہونا"}};function v(U){return $[U]??null}let g={regex:"ان پٹ",email:"ای میل ایڈریس",url:"یو آر ایل",emoji:"ایموجی",uuid:"یو یو آئی ڈی",uuidv4:"یو یو آئی ڈی وی 4",uuidv6:"یو یو آئی ڈی وی 6",nanoid:"نینو آئی ڈی",guid:"جی یو آئی ڈی",cuid:"سی یو آئی ڈی",cuid2:"سی یو آئی ڈی 2",ulid:"یو ایل آئی ڈی",xid:"ایکس آئی ڈی",ksuid:"کے ایس یو آئی ڈی",datetime:"آئی ایس او ڈیٹ ٹائم",date:"آئی ایس او تاریخ",time:"آئی ایس او وقت",duration:"آئی ایس او مدت",ipv4:"آئی پی وی 4 ایڈریس",ipv6:"آئی پی وی 6 ایڈریس",cidrv4:"آئی پی وی 4 رینج",cidrv6:"آئی پی وی 6 رینج",base64:"بیس 64 ان کوڈڈ سٹرنگ",base64url:"بیس 64 یو آر ایل ان کوڈڈ سٹرنگ",json_string:"جے ایس او این سٹرنگ",e164:"ای 164 نمبر",jwt:"جے ڈبلیو ٹی",template_literal:"ان پٹ"},_={nan:"NaN",number:"نمبر",array:"آرے",null:"نل"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`غلط ان پٹ: instanceof ${U.expected} متوقع تھا، ${b} موصول ہوا`;return`غلط ان پٹ: ${z} متوقع تھا، ${b} موصول ہوا`}case"invalid_value":if(U.values.length===1)return`غلط ان پٹ: ${R(U.values[0])} متوقع تھا`;return`غلط آپشن: ${w(U.values,"|")} میں سے ایک متوقع تھا`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`بہت بڑا: ${U.origin??"ویلیو"} کے ${z}${U.maximum.toString()} ${J.unit??"عناصر"} ہونے متوقع تھے`;return`بہت بڑا: ${U.origin??"ویلیو"} کا ${z}${U.maximum.toString()} ہونا متوقع تھا`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`بہت چھوٹا: ${U.origin} کے ${z}${U.minimum.toString()} ${J.unit} ہونے متوقع تھے`;return`بہت چھوٹا: ${U.origin} کا ${z}${U.minimum.toString()} ہونا متوقع تھا`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`غلط سٹرنگ: "${z.prefix}" سے شروع ہونا چاہیے`;if(z.format==="ends_with")return`غلط سٹرنگ: "${z.suffix}" پر ختم ہونا چاہیے`;if(z.format==="includes")return`غلط سٹرنگ: "${z.includes}" شامل ہونا چاہیے`;if(z.format==="regex")return`غلط سٹرنگ: پیٹرن ${z.pattern} سے میچ ہونا چاہیے`;return`غلط ${g[z.format]??U.format}`}case"not_multiple_of":return`غلط نمبر: ${U.divisor} کا مضاعف ہونا چاہیے`;case"unrecognized_keys":return`غیر تسلیم شدہ کی${U.keys.length>1?"ز":""}: ${w(U.keys,"، ")}`;case"invalid_key":return`${U.origin} میں غلط کی`;case"invalid_union":return"غلط ان پٹ";case"invalid_element":return`${U.origin} میں غلط ویلیو`;default:return"غلط ان پٹ"}}};function pb(){return{localeError:FL()}}var YL=()=>{let $={string:{unit:"belgi",verb:"bo‘lishi kerak"},file:{unit:"bayt",verb:"bo‘lishi kerak"},array:{unit:"element",verb:"bo‘lishi kerak"},set:{unit:"element",verb:"bo‘lishi kerak"}};function v(U){return $[U]??null}let g={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},_={nan:"NaN",number:"raqam",array:"massiv"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Noto‘g‘ri kirish: kutilgan instanceof ${U.expected}, qabul qilingan ${b}`;return`Noto‘g‘ri kirish: kutilgan ${z}, qabul qilingan ${b}`}case"invalid_value":if(U.values.length===1)return`Noto‘g‘ri kirish: kutilgan ${R(U.values[0])}`;return`Noto‘g‘ri variant: quyidagilardan biri kutilgan ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()} ${J.unit} ${J.verb}`;return`Juda katta: kutilgan ${U.origin??"qiymat"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()} ${J.unit} ${J.verb}`;return`Juda kichik: kutilgan ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Noto‘g‘ri satr: "${z.prefix}" bilan boshlanishi kerak`;if(z.format==="ends_with")return`Noto‘g‘ri satr: "${z.suffix}" bilan tugashi kerak`;if(z.format==="includes")return`Noto‘g‘ri satr: "${z.includes}" ni o‘z ichiga olishi kerak`;if(z.format==="regex")return`Noto‘g‘ri satr: ${z.pattern} shabloniga mos kelishi kerak`;return`Noto‘g‘ri ${g[z.format]??U.format}`}case"not_multiple_of":return`Noto‘g‘ri raqam: ${U.divisor} ning karralisi bo‘lishi kerak`;case"unrecognized_keys":return`Noma’lum kalit${U.keys.length>1?"lar":""}: ${w(U.keys,", ")}`;case"invalid_key":return`${U.origin} dagi kalit noto‘g‘ri`;case"invalid_union":return"Noto‘g‘ri kirish";case"invalid_element":return`${U.origin} da noto‘g‘ri qiymat`;default:return"Noto‘g‘ri kirish"}}};function ob(){return{localeError:YL()}}var qL=()=>{let $={string:{unit:"ký tự",verb:"có"},file:{unit:"byte",verb:"có"},array:{unit:"phần tử",verb:"có"},set:{unit:"phần tử",verb:"có"}};function v(U){return $[U]??null}let g={regex:"đầu vào",email:"địa chỉ email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ngày giờ ISO",date:"ngày ISO",time:"giờ ISO",duration:"khoảng thời gian ISO",ipv4:"địa chỉ IPv4",ipv6:"địa chỉ IPv6",cidrv4:"dải IPv4",cidrv6:"dải IPv6",base64:"chuỗi mã hóa base64",base64url:"chuỗi mã hóa base64url",json_string:"chuỗi JSON",e164:"số E.164",jwt:"JWT",template_literal:"đầu vào"},_={nan:"NaN",number:"số",array:"mảng"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Đầu vào không hợp lệ: mong đợi instanceof ${U.expected}, nhận được ${b}`;return`Đầu vào không hợp lệ: mong đợi ${z}, nhận được ${b}`}case"invalid_value":if(U.values.length===1)return`Đầu vào không hợp lệ: mong đợi ${R(U.values[0])}`;return`Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${J.verb} ${z}${U.maximum.toString()} ${J.unit??"phần tử"}`;return`Quá lớn: mong đợi ${U.origin??"giá trị"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Quá nhỏ: mong đợi ${U.origin} ${J.verb} ${z}${U.minimum.toString()} ${J.unit}`;return`Quá nhỏ: mong đợi ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Chuỗi không hợp lệ: phải bắt đầu bằng "${z.prefix}"`;if(z.format==="ends_with")return`Chuỗi không hợp lệ: phải kết thúc bằng "${z.suffix}"`;if(z.format==="includes")return`Chuỗi không hợp lệ: phải bao gồm "${z.includes}"`;if(z.format==="regex")return`Chuỗi không hợp lệ: phải khớp với mẫu ${z.pattern}`;return`${g[z.format]??U.format} không hợp lệ`}case"not_multiple_of":return`Số không hợp lệ: phải là bội số của ${U.divisor}`;case"unrecognized_keys":return`Khóa không được nhận dạng: ${w(U.keys,", ")}`;case"invalid_key":return`Khóa không hợp lệ trong ${U.origin}`;case"invalid_union":return"Đầu vào không hợp lệ";case"invalid_element":return`Giá trị không hợp lệ trong ${U.origin}`;default:return"Đầu vào không hợp lệ"}}};function nb(){return{localeError:qL()}}var XL=()=>{let $={string:{unit:"字符",verb:"包含"},file:{unit:"字节",verb:"包含"},array:{unit:"项",verb:"包含"},set:{unit:"项",verb:"包含"}};function v(U){return $[U]??null}let g={regex:"输入",email:"电子邮件",url:"URL",emoji:"表情符号",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO日期时间",date:"ISO日期",time:"ISO时间",duration:"ISO时长",ipv4:"IPv4地址",ipv6:"IPv6地址",cidrv4:"IPv4网段",cidrv6:"IPv6网段",base64:"base64编码字符串",base64url:"base64url编码字符串",json_string:"JSON字符串",e164:"E.164号码",jwt:"JWT",template_literal:"输入"},_={nan:"NaN",number:"数字",array:"数组",null:"空值(null)"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`无效输入:期望 instanceof ${U.expected},实际接收 ${b}`;return`无效输入:期望 ${z},实际接收 ${b}`}case"invalid_value":if(U.values.length===1)return`无效输入:期望 ${R(U.values[0])}`;return`无效选项:期望以下之一 ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()} ${J.unit??"个元素"}`;return`数值过大:期望 ${U.origin??"值"} ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()} ${J.unit}`;return`数值过小:期望 ${U.origin} ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`无效字符串:必须以 "${z.prefix}" 开头`;if(z.format==="ends_with")return`无效字符串:必须以 "${z.suffix}" 结尾`;if(z.format==="includes")return`无效字符串:必须包含 "${z.includes}"`;if(z.format==="regex")return`无效字符串:必须满足正则表达式 ${z.pattern}`;return`无效${g[z.format]??U.format}`}case"not_multiple_of":return`无效数字:必须是 ${U.divisor} 的倍数`;case"unrecognized_keys":return`出现未知的键(key): ${w(U.keys,", ")}`;case"invalid_key":return`${U.origin} 中的键(key)无效`;case"invalid_union":return"无效输入";case"invalid_element":return`${U.origin} 中包含无效值(value)`;default:return"无效输入"}}};function tb(){return{localeError:XL()}}var AL=()=>{let $={string:{unit:"字元",verb:"擁有"},file:{unit:"位元組",verb:"擁有"},array:{unit:"項目",verb:"擁有"},set:{unit:"項目",verb:"擁有"}};function v(U){return $[U]??null}let g={regex:"輸入",email:"郵件地址",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO 日期時間",date:"ISO 日期",time:"ISO 時間",duration:"ISO 期間",ipv4:"IPv4 位址",ipv6:"IPv6 位址",cidrv4:"IPv4 範圍",cidrv6:"IPv6 範圍",base64:"base64 編碼字串",base64url:"base64url 編碼字串",json_string:"JSON 字串",e164:"E.164 數值",jwt:"JWT",template_literal:"輸入"},_={nan:"NaN"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`無效的輸入值:預期為 instanceof ${U.expected},但收到 ${b}`;return`無效的輸入值:預期為 ${z},但收到 ${b}`}case"invalid_value":if(U.values.length===1)return`無效的輸入值:預期為 ${R(U.values[0])}`;return`無效的選項:預期為以下其中之一 ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()} ${J.unit??"個元素"}`;return`數值過大:預期 ${U.origin??"值"} 應為 ${z}${U.maximum.toString()}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()} ${J.unit}`;return`數值過小:預期 ${U.origin} 應為 ${z}${U.minimum.toString()}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`無效的字串:必須以 "${z.prefix}" 開頭`;if(z.format==="ends_with")return`無效的字串:必須以 "${z.suffix}" 結尾`;if(z.format==="includes")return`無效的字串:必須包含 "${z.includes}"`;if(z.format==="regex")return`無效的字串:必須符合格式 ${z.pattern}`;return`無效的 ${g[z.format]??U.format}`}case"not_multiple_of":return`無效的數字:必須為 ${U.divisor} 的倍數`;case"unrecognized_keys":return`無法識別的鍵值${U.keys.length>1?"們":""}:${w(U.keys,"、")}`;case"invalid_key":return`${U.origin} 中有無效的鍵值`;case"invalid_union":return"無效的輸入值";case"invalid_element":return`${U.origin} 中有無效的值`;default:return"無效的輸入值"}}};function db(){return{localeError:AL()}}var wL=()=>{let $={string:{unit:"àmi",verb:"ní"},file:{unit:"bytes",verb:"ní"},array:{unit:"nkan",verb:"ní"},set:{unit:"nkan",verb:"ní"}};function v(U){return $[U]??null}let g={regex:"ẹ̀rọ ìbáwọlé",email:"àdírẹ́sì ìmẹ́lì",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"àkókò ISO",date:"ọjọ́ ISO",time:"àkókò ISO",duration:"àkókò tó pé ISO",ipv4:"àdírẹ́sì IPv4",ipv6:"àdírẹ́sì IPv6",cidrv4:"àgbègbè IPv4",cidrv6:"àgbègbè IPv6",base64:"ọ̀rọ̀ tí a kọ́ ní base64",base64url:"ọ̀rọ̀ base64url",json_string:"ọ̀rọ̀ JSON",e164:"nọ́mbà E.164",jwt:"JWT",template_literal:"ẹ̀rọ ìbáwọlé"},_={nan:"NaN",number:"nọ́mbà",array:"akopọ"};return(U)=>{switch(U.code){case"invalid_type":{let z=_[U.expected]??U.expected,J=D(U.input),b=_[J]??J;if(/^[A-Z]/.test(U.expected))return`Ìbáwọlé aṣìṣe: a ní láti fi instanceof ${U.expected}, àmọ̀ a rí ${b}`;return`Ìbáwọlé aṣìṣe: a ní láti fi ${z}, àmọ̀ a rí ${b}`}case"invalid_value":if(U.values.length===1)return`Ìbáwọlé aṣìṣe: a ní láti fi ${R(U.values[0])}`;return`Àṣàyàn aṣìṣe: yan ọ̀kan lára ${w(U.values,"|")}`;case"too_big":{let z=U.inclusive?"<=":"<",J=v(U.origin);if(J)return`Tó pọ̀ jù: a ní láti jẹ́ pé ${U.origin??"iye"} ${J.verb} ${z}${U.maximum} ${J.unit}`;return`Tó pọ̀ jù: a ní láti jẹ́ ${z}${U.maximum}`}case"too_small":{let z=U.inclusive?">=":">",J=v(U.origin);if(J)return`Kéré ju: a ní láti jẹ́ pé ${U.origin} ${J.verb} ${z}${U.minimum} ${J.unit}`;return`Kéré ju: a ní láti jẹ́ ${z}${U.minimum}`}case"invalid_format":{let z=U;if(z.format==="starts_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bẹ̀rẹ̀ pẹ̀lú "${z.prefix}"`;if(z.format==="ends_with")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ parí pẹ̀lú "${z.suffix}"`;if(z.format==="includes")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ ní "${z.includes}"`;if(z.format==="regex")return`Ọ̀rọ̀ aṣìṣe: gbọ́dọ̀ bá àpẹẹrẹ mu ${z.pattern}`;return`Aṣìṣe: ${g[z.format]??U.format}`}case"not_multiple_of":return`Nọ́mbà aṣìṣe: gbọ́dọ̀ jẹ́ èyà pípín ti ${U.divisor}`;case"unrecognized_keys":return`Bọtìnì àìmọ̀: ${w(U.keys,", ")}`;case"invalid_key":return`Bọtìnì aṣìṣe nínú ${U.origin}`;case"invalid_union":return"Ìbáwọlé aṣìṣe";case"invalid_element":return`Iye aṣìṣe nínú ${U.origin}`;default:return"Ìbáwọlé aṣìṣe"}}};function ab(){return{localeError:wL()}}var l5,sb=Symbol("ZodOutput"),eb=Symbol("ZodInput");class $8{constructor(){this._map=new WeakMap,this._idmap=new Map}add($,...v){let g=v[0];if(this._map.set($,g),g&&typeof g==="object"&&"id"in g)this._idmap.set(g.id,$);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove($){let v=this._map.get($);if(v&&typeof v==="object"&&"id"in v)this._idmap.delete(v.id);return this._map.delete($),this}get($){let v=$._zod.parent;if(v){let g={...this.get(v)??{}};delete g.id;let _={...g,...this._map.get($)};return Object.keys(_).length?_:void 0}return this._map.get($)}has($){return this._map.has($)}}function O1(){return new $8}(l5=globalThis).__zod_globalRegistry??(l5.__zod_globalRegistry=O1());var $v=globalThis.__zod_globalRegistry;function v8($,v){return new $({type:"string",...C(v)})}function U8($,v){return new $({type:"string",coerce:!0,...C(v)})}function G1($,v){return new $({type:"string",format:"email",check:"string_format",abort:!1,...C(v)})}function gg($,v){return new $({type:"string",format:"guid",check:"string_format",abort:!1,...C(v)})}function K1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,...C(v)})}function W1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...C(v)})}function B1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...C(v)})}function P1($,v){return new $({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...C(v)})}function _g($,v){return new $({type:"string",format:"url",check:"string_format",abort:!1,...C(v)})}function k1($,v){return new $({type:"string",format:"emoji",check:"string_format",abort:!1,...C(v)})}function H1($,v){return new $({type:"string",format:"nanoid",check:"string_format",abort:!1,...C(v)})}function I1($,v){return new $({type:"string",format:"cuid",check:"string_format",abort:!1,...C(v)})}function L1($,v){return new $({type:"string",format:"cuid2",check:"string_format",abort:!1,...C(v)})}function F1($,v){return new $({type:"string",format:"ulid",check:"string_format",abort:!1,...C(v)})}function Y1($,v){return new $({type:"string",format:"xid",check:"string_format",abort:!1,...C(v)})}function q1($,v){return new $({type:"string",format:"ksuid",check:"string_format",abort:!1,...C(v)})}function X1($,v){return new $({type:"string",format:"ipv4",check:"string_format",abort:!1,...C(v)})}function A1($,v){return new $({type:"string",format:"ipv6",check:"string_format",abort:!1,...C(v)})}function g8($,v){return new $({type:"string",format:"mac",check:"string_format",abort:!1,...C(v)})}function w1($,v){return new $({type:"string",format:"cidrv4",check:"string_format",abort:!1,...C(v)})}function Z1($,v){return new $({type:"string",format:"cidrv6",check:"string_format",abort:!1,...C(v)})}function S1($,v){return new $({type:"string",format:"base64",check:"string_format",abort:!1,...C(v)})}function M1($,v){return new $({type:"string",format:"base64url",check:"string_format",abort:!1,...C(v)})}function Q1($,v){return new $({type:"string",format:"e164",check:"string_format",abort:!1,...C(v)})}function N1($,v){return new $({type:"string",format:"jwt",check:"string_format",abort:!1,...C(v)})}var _8={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function z8($,v){return new $({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...C(v)})}function J8($,v){return new $({type:"string",format:"date",check:"string_format",...C(v)})}function b8($,v){return new $({type:"string",format:"time",check:"string_format",precision:null,...C(v)})}function O8($,v){return new $({type:"string",format:"duration",check:"string_format",...C(v)})}function G8($,v){return new $({type:"number",checks:[],...C(v)})}function K8($,v){return new $({type:"number",coerce:!0,checks:[],...C(v)})}function W8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"safeint",...C(v)})}function B8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float32",...C(v)})}function P8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"float64",...C(v)})}function k8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"int32",...C(v)})}function H8($,v){return new $({type:"number",check:"number_format",abort:!1,format:"uint32",...C(v)})}function I8($,v){return new $({type:"boolean",...C(v)})}function L8($,v){return new $({type:"boolean",coerce:!0,...C(v)})}function F8($,v){return new $({type:"bigint",...C(v)})}function Y8($,v){return new $({type:"bigint",coerce:!0,...C(v)})}function q8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...C(v)})}function X8($,v){return new $({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...C(v)})}function A8($,v){return new $({type:"symbol",...C(v)})}function w8($,v){return new $({type:"undefined",...C(v)})}function Z8($,v){return new $({type:"null",...C(v)})}function S8($){return new $({type:"any"})}function M8($){return new $({type:"unknown"})}function Q8($,v){return new $({type:"never",...C(v)})}function N8($,v){return new $({type:"void",...C(v)})}function r8($,v){return new $({type:"date",...C(v)})}function u8($,v){return new $({type:"date",coerce:!0,...C(v)})}function y8($,v){return new $({type:"nan",...C(v)})}function tv($,v){return new d_({check:"less_than",...C(v),value:$,inclusive:!1})}function Nv($,v){return new d_({check:"less_than",...C(v),value:$,inclusive:!0})}function dv($,v){return new a_({check:"greater_than",...C(v),value:$,inclusive:!1})}function Hv($,v){return new a_({check:"greater_than",...C(v),value:$,inclusive:!0})}function r1($){return dv(0,$)}function u1($){return tv(0,$)}function y1($){return Nv(0,$)}function R1($){return Hv(0,$)}function y6($,v){return new yz({check:"multiple_of",...C(v),value:$})}function R6($,v){return new Tz({check:"max_size",...C(v),maximum:$})}function av($,v){return new jz({check:"min_size",...C(v),minimum:$})}function v4($,v){return new Vz({check:"size_equals",...C(v),size:$})}function U4($,v){return new Cz({check:"max_length",...C(v),maximum:$})}function K6($,v){return new fz({check:"min_length",...C(v),minimum:$})}function g4($,v){return new Ez({check:"length_equals",...C(v),length:$})}function c4($,v){return new cz({check:"string_format",format:"regex",...C(v),pattern:$})}function m4($){return new mz({check:"string_format",format:"lowercase",...C($)})}function i4($){return new iz({check:"string_format",format:"uppercase",...C($)})}function l4($,v){return new lz({check:"string_format",format:"includes",...C(v),includes:$})}function h4($,v){return new hz({check:"string_format",format:"starts_with",...C(v),prefix:$})}function x4($,v){return new xz({check:"string_format",format:"ends_with",...C(v),suffix:$})}function D1($,v,g){return new pz({check:"property",property:$,schema:v,...C(g)})}function p4($,v){return new oz({check:"mime_type",mime:$,...C(v)})}function iv($){return new nz({check:"overwrite",tx:$})}function o4($){return iv((v)=>v.normalize($))}function n4(){return iv(($)=>$.trim())}function t4(){return iv(($)=>$.toLowerCase())}function d4(){return iv(($)=>$.toUpperCase())}function a4(){return iv(($)=>n2($))}function R8($,v,g){return new $({type:"array",element:v,...C(g)})}function SL($,v,g){return new $({type:"union",options:v,...C(g)})}function ML($,v,g){return new $({type:"union",options:v,inclusive:!1,...C(g)})}function QL($,v,g,_){return new $({type:"union",options:g,discriminator:v,...C(_)})}function NL($,v,g){return new $({type:"intersection",left:v,right:g})}function rL($,v,g,_){let U=g instanceof v$;return new $({type:"tuple",items:v,rest:U?g:null,...C(U?_:g)})}function uL($,v,g,_){return new $({type:"record",keyType:v,valueType:g,...C(_)})}function yL($,v,g,_){return new $({type:"map",keyType:v,valueType:g,...C(_)})}function RL($,v,g){return new $({type:"set",valueType:v,...C(g)})}function DL($,v,g){let _=Array.isArray(v)?Object.fromEntries(v.map((U)=>[U,U])):v;return new $({type:"enum",entries:_,...C(g)})}function TL($,v,g){return new $({type:"enum",entries:v,...C(g)})}function jL($,v,g){return new $({type:"literal",values:Array.isArray(v)?v:[v],...C(g)})}function D8($,v){return new $({type:"file",...C(v)})}function VL($,v){return new $({type:"transform",transform:v})}function CL($,v){return new $({type:"optional",innerType:v})}function fL($,v){return new $({type:"nullable",innerType:v})}function EL($,v,g){return new $({type:"default",innerType:v,get defaultValue(){return typeof g==="function"?g():d2(g)}})}function cL($,v,g){return new $({type:"nonoptional",innerType:v,...C(g)})}function mL($,v){return new $({type:"success",innerType:v})}function iL($,v,g){return new $({type:"catch",innerType:v,catchValue:typeof g==="function"?g:()=>g})}function lL($,v,g){return new $({type:"pipe",in:v,out:g})}function hL($,v){return new $({type:"readonly",innerType:v})}function xL($,v,g){return new $({type:"template_literal",parts:v,...C(g)})}function pL($,v){return new $({type:"lazy",getter:v})}function oL($,v){return new $({type:"promise",innerType:v})}function T8($,v,g){let _=C(g);return _.abort??(_.abort=!0),new $({type:"custom",check:"custom",fn:v,..._})}function j8($,v,g){return new $({type:"custom",check:"custom",fn:v,...C(g)})}function V8($){let v=h5((g)=>{return g.addIssue=(_)=>{if(typeof _==="string")g.issues.push(R4(_,g.value,v._zod.def));else{let U=_;if(U.fatal)U.continue=!1;U.code??(U.code="custom"),U.input??(U.input=g.value),U.inst??(U.inst=v),U.continue??(U.continue=!v._zod.def.abort),g.issues.push(R4(U))}},$(g.value,g)});return v}function h5($,v){let g=new N$({check:"custom",...C(v)});return g._zod.check=$,g}function C8($){let v=new N$({check:"describe"});return v._zod.onattach=[(g)=>{let _=$v.get(g)??{};$v.add(g,{..._,description:$})}],v._zod.check=()=>{},v}function f8($){let v=new N$({check:"meta"});return v._zod.onattach=[(g)=>{let _=$v.get(g)??{};$v.add(g,{..._,...$})}],v._zod.check=()=>{},v}function E8($,v){let g=C(v),_=g.truthy??["true","1","yes","on","y","enabled"],U=g.falsy??["false","0","no","off","n","disabled"];if(g.case!=="sensitive")_=_.map((P)=>typeof P==="string"?P.toLowerCase():P),U=U.map((P)=>typeof P==="string"?P.toLowerCase():P);let z=new Set(_),J=new Set(U),b=$.Codec??aU,G=$.Boolean??tU,W=new($.String??$4)({type:"string",error:g.error}),B=new G({type:"boolean",error:g.error}),k=new b({type:"pipe",in:W,out:B,transform:(P,q)=>{let L=P;if(g.case!=="sensitive")L=L.toLowerCase();if(z.has(L))return!0;else if(J.has(L))return!1;else return q.issues.push({code:"invalid_value",expected:"stringbool",values:[...z,...J],input:q.value,inst:k,continue:!1}),{}},reverseTransform:(P,q)=>{if(P===!0)return _[0]||"true";else return U[0]||"false"},error:g.error});return k}function s4($,v,g,_={}){let U=C(_),z={...C(_),check:"string_format",type:"string",format:v,fn:typeof g==="function"?g:(b)=>g.test(b),...U};if(g instanceof RegExp)z.pattern=g;return new $(z)}function D6($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";return{processors:$.processors??{},metadataRegistry:$?.metadata??$v,target:v,unrepresentable:$?.unrepresentable??"throw",override:$?.override??(()=>{}),io:$?.io??"output",counter:0,seen:new Map,cycles:$?.cycles??"ref",reused:$?.reused??"inline",external:$?.external??void 0}}function X$($,v,g={path:[],schemaPath:[]}){var _;let U=$._zod.def,z=v.seen.get($);if(z){if(z.count++,g.schemaPath.includes($))z.cycle=g.path;return z.schema}let J={schema:{},count:1,cycle:void 0,path:g.path};v.seen.set($,J);let b=$._zod.toJSONSchema?.();if(b)J.schema=b;else{let W={...g,schemaPath:[...g.schemaPath,$],path:g.path};if($._zod.processJSONSchema)$._zod.processJSONSchema(v,J.schema,W);else{let k=J.schema,P=v.processors[U.type];if(!P)throw Error(`[toJSONSchema]: Non-representable type encountered: ${U.type}`);P($,v,k,W)}let B=$._zod.parent;if(B){if(!J.ref)J.ref=B;X$(B,v,W),v.seen.get(B).isParent=!0}}let G=v.metadataRegistry.get($);if(G)Object.assign(J.schema,G);if(v.io==="input"&&Iv($))delete J.schema.examples,delete J.schema.default;if(v.io==="input"&&J.schema._prefault)(_=J.schema).default??(_.default=J.schema._prefault);return delete J.schema._prefault,v.seen.get($).schema}function T6($,v){let g=$.seen.get(v);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let _=new Map;for(let J of $.seen.entries()){let b=$.metadataRegistry.get(J[0])?.id;if(b){let G=_.get(b);if(G&&G!==J[0])throw Error(`Duplicate schema id "${b}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);_.set(b,J[0])}}let U=(J)=>{let b=$.target==="draft-2020-12"?"$defs":"definitions";if($.external){let B=$.external.registry.get(J[0])?.id,k=$.external.uri??((q)=>q);if(B)return{ref:k(B)};let P=J[1].defId??J[1].schema.id??`schema${$.counter++}`;return J[1].defId=P,{defId:P,ref:`${k("__shared")}#/${b}/${P}`}}if(J[1]===g)return{ref:"#"};let K=`${"#"}/${b}/`,W=J[1].schema.id??`__schema${$.counter++}`;return{defId:W,ref:K+W}},z=(J)=>{if(J[1].schema.$ref)return;let b=J[1],{ref:G,defId:K}=U(J);if(b.def={...b.schema},K)b.defId=K;let W=b.schema;for(let B in W)delete W[B];W.$ref=G};if($.cycles==="throw")for(let J of $.seen.entries()){let b=J[1];if(b.cycle)throw Error(`Cycle detected: #/${b.cycle?.join("/")}/<root>
145
145
 
146
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let b of $.seen.entries()){let J=b[1];if(v===b[0]){z(b);continue}if($.external){let K=$.external.registry.get(b[0])?.id;if(v!==b[0]&&K){z(b);continue}}if($.metadataRegistry.get(b[0])?.id){z(b);continue}if(J.cycle){z(b);continue}if(J.count>1){if($.reused==="ref"){z(b);continue}}}}function y6($,v){let g=$.seen.get(v);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let _=(b)=>{let J=$.seen.get(b);if(J.ref===null)return;let G=J.def??J.schema,K={...G},W=J.ref;if(J.ref=null,W){_(W);let k=$.seen.get(W),P=k.schema;if(P.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(P);else Object.assign(G,P);if(Object.assign(G,K),b._zod.parent===W)for(let H in G){if(H==="$ref"||H==="allOf")continue;if(!(H in K))delete G[H]}if(P.$ref&&k.def)for(let H in G){if(H==="$ref"||H==="allOf")continue;if(H in k.def&&JSON.stringify(G[H])===JSON.stringify(k.def[H]))delete G[H]}}let B=b._zod.parent;if(B&&B!==W){_(B);let k=$.seen.get(B);if(k?.schema.$ref){if(G.$ref=k.schema.$ref,k.def)for(let P in G){if(P==="$ref"||P==="allOf")continue;if(P in k.def&&JSON.stringify(G[P])===JSON.stringify(k.def[P]))delete G[P]}}}$.override({zodSchema:b,jsonSchema:G,path:J.path??[]})};for(let b of[...$.seen.entries()].reverse())_(b[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let b=$.external.registry.get(v)?.id;if(!b)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(b)}Object.assign(U,g.def??g.schema);let z=$.external?.defs??{};for(let b of $.seen.entries()){let J=b[1];if(J.def&&J.defId)z[J.defId]=J.def}if($.external);else if(Object.keys(z).length>0)if($.target==="draft-2020-12")U.$defs=z;else U.definitions=z;try{let b=JSON.parse(JSON.stringify(U));return Object.defineProperty(b,"~standard",{value:{...v["~standard"],jsonSchema:{input:n4(v,"input",$.processors),output:n4(v,"output",$.processors)}},enumerable:!1,writable:!1}),b}catch(b){throw Error("Error converting schema to JSON.")}}function Hv($,v){let g=v??{seen:new Set};if(g.seen.has($))return!1;g.seen.add($);let _=$._zod.def;if(_.type==="transform")return!0;if(_.type==="array")return Hv(_.element,g);if(_.type==="set")return Hv(_.valueType,g);if(_.type==="lazy")return Hv(_.getter(),g);if(_.type==="promise"||_.type==="optional"||_.type==="nonoptional"||_.type==="nullable"||_.type==="readonly"||_.type==="default"||_.type==="prefault")return Hv(_.innerType,g);if(_.type==="intersection")return Hv(_.left,g)||Hv(_.right,g);if(_.type==="record"||_.type==="map")return Hv(_.keyType,g)||Hv(_.valueType,g);if(_.type==="pipe")return Hv(_.in,g)||Hv(_.out,g);if(_.type==="object"){for(let U in _.shape)if(Hv(_.shape[U],g))return!0;return!1}if(_.type==="union"){for(let U of _.options)if(Hv(U,g))return!0;return!1}if(_.type==="tuple"){for(let U of _.items)if(Hv(U,g))return!0;if(_.rest&&Hv(_.rest,g))return!0;return!1}return!1}var D8=($,v={})=>(g)=>{let _=u6({...g,processors:v});return q$($,_),R6(_,$),y6(_,$)},n4=($,v,g={})=>(_)=>{let{libraryOptions:U,target:z}=_??{},b=u6({...U??{},target:z,io:v,processors:g});return q$($,b),R6(b,$),y6(b,$)};var cL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},T8=($,v,g,_)=>{let U=g;U.type="string";let{minimum:z,maximum:b,format:J,patterns:G,contentEncoding:K}=$._zod.bag;if(typeof z==="number")U.minLength=z;if(typeof b==="number")U.maxLength=b;if(J){if(U.format=cL[J]??J,U.format==="")delete U.format;if(J==="time")delete U.format}if(K)U.contentEncoding=K;if(G&&G.size>0){let W=[...G];if(W.length===1)U.pattern=W[0].source;else if(W.length>1)U.allOf=[...W.map((B)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},j8=($,v,g,_)=>{let U=g,{minimum:z,maximum:b,format:J,multipleOf:G,exclusiveMaximum:K,exclusiveMinimum:W}=$._zod.bag;if(typeof J==="string"&&J.includes("int"))U.type="integer";else U.type="number";if(typeof W==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")U.minimum=W,U.exclusiveMinimum=!0;else U.exclusiveMinimum=W;if(typeof z==="number"){if(U.minimum=z,typeof W==="number"&&v.target!=="draft-04")if(W>=z)delete U.minimum;else delete U.exclusiveMinimum}if(typeof K==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")U.maximum=K,U.exclusiveMaximum=!0;else U.exclusiveMaximum=K;if(typeof b==="number"){if(U.maximum=b,typeof K==="number"&&v.target!=="draft-04")if(K<=b)delete U.maximum;else delete U.exclusiveMaximum}if(typeof G==="number")U.multipleOf=G},V8=($,v,g,_)=>{g.type="boolean"},C8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},f8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},m8=($,v,g,_)=>{if(v.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},E8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},c8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},i8=($,v,g,_)=>{g.not={}},l8=($,v,g,_)=>{},h8=($,v,g,_)=>{},x8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},p8=($,v,g,_)=>{let U=$._zod.def,z=uU(U.entries);if(z.every((b)=>typeof b==="number"))g.type="number";if(z.every((b)=>typeof b==="string"))g.type="string";g.enum=z},o8=($,v,g,_)=>{let U=$._zod.def,z=[];for(let b of U.values)if(b===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof b==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else z.push(Number(b));else z.push(b);if(z.length===0);else if(z.length===1){let b=z[0];if(g.type=b===null?"null":typeof b,v.target==="draft-04"||v.target==="openapi-3.0")g.enum=[b];else g.const=b}else{if(z.every((b)=>typeof b==="number"))g.type="number";if(z.every((b)=>typeof b==="string"))g.type="string";if(z.every((b)=>typeof b==="boolean"))g.type="boolean";if(z.every((b)=>b===null))g.type="null";g.enum=z}},n8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},t8=($,v,g,_)=>{let U=g,z=$._zod.pattern;if(!z)throw Error("Pattern not found in template literal");U.type="string",U.pattern=z.source},d8=($,v,g,_)=>{let U=g,z={type:"string",format:"binary",contentEncoding:"binary"},{minimum:b,maximum:J,mime:G}=$._zod.bag;if(b!==void 0)z.minLength=b;if(J!==void 0)z.maxLength=J;if(G)if(G.length===1)z.contentMediaType=G[0],Object.assign(U,z);else Object.assign(U,z),U.anyOf=G.map((K)=>({contentMediaType:K}));else Object.assign(U,z)},a8=($,v,g,_)=>{g.type="boolean"},s8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},e8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},$9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},v9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},U9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},g9=($,v,g,_)=>{let U=g,z=$._zod.def,{minimum:b,maximum:J}=$._zod.bag;if(typeof b==="number")U.minItems=b;if(typeof J==="number")U.maxItems=J;U.type="array",U.items=q$(z.element,v,{..._,path:[..._.path,"items"]})},_9=($,v,g,_)=>{let U=g,z=$._zod.def;U.type="object",U.properties={};let b=z.shape;for(let K in b)U.properties[K]=q$(b[K],v,{..._,path:[..._.path,"properties",K]});let J=new Set(Object.keys(b)),G=new Set([...J].filter((K)=>{let W=z.shape[K]._zod;if(v.io==="input")return W.optin===void 0;else return W.optout===void 0}));if(G.size>0)U.required=Array.from(G);if(z.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!z.catchall){if(v.io==="output")U.additionalProperties=!1}else if(z.catchall)U.additionalProperties=q$(z.catchall,v,{..._,path:[..._.path,"additionalProperties"]})},N1=($,v,g,_)=>{let U=$._zod.def,z=U.inclusive===!1,b=U.options.map((J,G)=>q$(J,v,{..._,path:[..._.path,z?"oneOf":"anyOf",G]}));if(z)g.oneOf=b;else g.anyOf=b},z9=($,v,g,_)=>{let U=$._zod.def,z=q$(U.left,v,{..._,path:[..._.path,"allOf",0]}),b=q$(U.right,v,{..._,path:[..._.path,"allOf",1]}),J=(K)=>("allOf"in K)&&Object.keys(K).length===1,G=[...J(z)?z.allOf:[z],...J(b)?b.allOf:[b]];g.allOf=G},b9=($,v,g,_)=>{let U=g,z=$._zod.def;U.type="array";let b=v.target==="draft-2020-12"?"prefixItems":"items",J=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",G=z.items.map((k,P)=>q$(k,v,{..._,path:[..._.path,b,P]})),K=z.rest?q$(z.rest,v,{..._,path:[..._.path,J,...v.target==="openapi-3.0"?[z.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(U.prefixItems=G,K)U.items=K}else if(v.target==="openapi-3.0"){if(U.items={anyOf:G},K)U.items.anyOf.push(K);if(U.minItems=G.length,!K)U.maxItems=G.length}else if(U.items=G,K)U.additionalItems=K;let{minimum:W,maximum:B}=$._zod.bag;if(typeof W==="number")U.minItems=W;if(typeof B==="number")U.maxItems=B},J9=($,v,g,_)=>{let U=g,z=$._zod.def;U.type="object";let b=z.keyType,G=b._zod.bag?.patterns;if(z.mode==="loose"&&G&&G.size>0){let W=q$(z.valueType,v,{..._,path:[..._.path,"patternProperties","*"]});U.patternProperties={};for(let B of G)U.patternProperties[B.source]=W}else{if(v.target==="draft-07"||v.target==="draft-2020-12")U.propertyNames=q$(z.keyType,v,{..._,path:[..._.path,"propertyNames"]});U.additionalProperties=q$(z.valueType,v,{..._,path:[..._.path,"additionalProperties"]})}let K=b._zod.values;if(K){let W=[...K].filter((B)=>typeof B==="string"||typeof B==="number");if(W.length>0)U.required=W}},O9=($,v,g,_)=>{let U=$._zod.def,z=q$(U.innerType,v,_),b=v.seen.get($);if(v.target==="openapi-3.0")b.ref=U.innerType,g.nullable=!0;else g.anyOf=[z,{type:"null"}]},G9=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType},K9=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType,g.default=JSON.parse(JSON.stringify(U.defaultValue))},W9=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);if(z.ref=U.innerType,v.io==="input")g._prefault=JSON.parse(JSON.stringify(U.defaultValue))},B9=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType;let b;try{b=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=b},P9=($,v,g,_)=>{let U=$._zod.def,z=v.io==="input"?U.in._zod.def.type==="transform"?U.out:U.in:U.out;q$(z,v,_);let b=v.seen.get($);b.ref=z},k9=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType,g.readOnly=!0},I9=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType},r1=($,v,g,_)=>{let U=$._zod.def;q$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType},H9=($,v,g,_)=>{let U=$._zod.innerType;q$(U,v,_);let z=v.seen.get($);z.ref=U},Q1={string:T8,number:j8,boolean:V8,bigint:C8,symbol:f8,null:m8,undefined:E8,void:c8,never:i8,any:l8,unknown:h8,date:x8,enum:p8,literal:o8,nan:n8,template_literal:t8,file:d8,success:a8,custom:s8,function:e8,transform:$9,map:v9,set:U9,array:g9,object:_9,union:N1,intersection:z9,tuple:b9,record:J9,nullable:O9,nonoptional:G9,default:K9,prefault:W9,catch:B9,pipe:P9,readonly:k9,promise:I9,optional:r1,lazy:H9};function u1($,v){if("_idmap"in $){let _=$,U=u6({...v,processors:Q1}),z={};for(let G of _._idmap.entries()){let[K,W]=G;q$(W,U)}let b={},J={registry:_,uri:v?.uri,defs:z};U.external=J;for(let G of _._idmap.entries()){let[K,W]=G;R6(U,W),b[K]=y6(U,W)}if(Object.keys(z).length>0){let G=U.target==="draft-2020-12"?"$defs":"definitions";b.__shared={[G]:z}}return{schemas:b}}let g=u6({...v,processors:Q1});return q$($,g),R6(g,$),y6(g,$)}class L9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=u6({processors:Q1,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return q$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}R6(this.ctx,$);let g=y6(this.ctx,$),{"~standard":_,...U}=g;return U}}var m5={};var $g={};ev($g,{xor:()=>r7,xid:()=>$7,void:()=>S7,uuidv7:()=>p5,uuidv6:()=>x5,uuidv4:()=>h5,uuid:()=>l5,url:()=>o5,unknown:()=>Q$,union:()=>w$,undefined:()=>w7,ulid:()=>e5,uint64:()=>q7,uint32:()=>F7,tuple:()=>o9,transform:()=>U0,templateLiteral:()=>E7,symbol:()=>X7,superRefine:()=>YO,success:()=>C7,stringbool:()=>o7,stringFormat:()=>W7,string:()=>S,strictObject:()=>N7,set:()=>D7,refine:()=>FO,record:()=>r$,readonly:()=>BO,promise:()=>c7,preprocess:()=>Wg,prefault:()=>zO,pipe:()=>gg,partialRecord:()=>u7,optional:()=>R$,object:()=>h,number:()=>L$,nullish:()=>V7,nullable:()=>Ug,null:()=>vU,nonoptional:()=>bO,never:()=>v0,nativeEnum:()=>T7,nanoid:()=>d5,nan:()=>f7,meta:()=>x7,map:()=>y7,mac:()=>g7,looseRecord:()=>R7,looseObject:()=>Uv,literal:()=>o,lazy:()=>IO,ksuid:()=>v7,keyof:()=>Q7,jwt:()=>K7,json:()=>n7,ipv6:()=>_7,ipv4:()=>U7,intersection:()=>UU,int64:()=>A7,int32:()=>L7,int:()=>V1,instanceof:()=>p7,httpUrl:()=>n5,hostname:()=>B7,hex:()=>P7,hash:()=>k7,guid:()=>i5,function:()=>i7,float64:()=>H7,float32:()=>I7,file:()=>j7,exactOptional:()=>$O,enum:()=>gv,emoji:()=>t5,email:()=>c5,e164:()=>G7,discriminatedUnion:()=>Og,describe:()=>h7,date:()=>M7,custom:()=>J0,cuid2:()=>s5,cuid:()=>a5,codec:()=>m7,cidrv6:()=>b7,cidrv4:()=>z7,check:()=>l7,catch:()=>GO,boolean:()=>p$,bigint:()=>Y7,base64url:()=>O7,base64:()=>J7,array:()=>O$,any:()=>Z7,_function:()=>i7,_default:()=>gO,_ZodString:()=>C1,ZodXor:()=>l9,ZodXID:()=>h1,ZodVoid:()=>c9,ZodUnknown:()=>m9,ZodUnion:()=>Jg,ZodUndefined:()=>V9,ZodUUID:()=>av,ZodURL:()=>_g,ZodULID:()=>l1,ZodType:()=>_$,ZodTuple:()=>p9,ZodTransform:()=>s9,ZodTemplateLiteral:()=>PO,ZodSymbol:()=>j9,ZodSuccess:()=>JO,ZodStringFormat:()=>M$,ZodString:()=>d4,ZodSet:()=>t9,ZodRecord:()=>Gg,ZodReadonly:()=>WO,ZodPromise:()=>HO,ZodPrefault:()=>_O,ZodPipe:()=>z0,ZodOptional:()=>g0,ZodObject:()=>bg,ZodNumberFormat:()=>v4,ZodNumber:()=>s4,ZodNullable:()=>vO,ZodNull:()=>C9,ZodNonOptional:()=>_0,ZodNever:()=>E9,ZodNanoID:()=>E1,ZodNaN:()=>KO,ZodMap:()=>n9,ZodMAC:()=>T9,ZodLiteral:()=>d9,ZodLazy:()=>kO,ZodKSUID:()=>x1,ZodJWT:()=>e1,ZodIntersection:()=>x9,ZodIPv6:()=>o1,ZodIPv4:()=>p1,ZodGUID:()=>vg,ZodFunction:()=>LO,ZodFile:()=>a9,ZodExactOptional:()=>e9,ZodEnum:()=>t4,ZodEmoji:()=>m1,ZodEmail:()=>f1,ZodE164:()=>s1,ZodDiscriminatedUnion:()=>h9,ZodDefault:()=>UO,ZodDate:()=>zg,ZodCustomStringFormat:()=>a4,ZodCustom:()=>Kg,ZodCodec:()=>b0,ZodCatch:()=>OO,ZodCUID2:()=>i1,ZodCUID:()=>c1,ZodCIDRv6:()=>t1,ZodCIDRv4:()=>n1,ZodBoolean:()=>e4,ZodBigIntFormat:()=>$0,ZodBigInt:()=>$U,ZodBase64URL:()=>a1,ZodBase64:()=>d1,ZodArray:()=>i9,ZodAny:()=>f9});var R1={};ev(R1,{uppercase:()=>C4,trim:()=>l4,toUpperCase:()=>x4,toLowerCase:()=>h4,startsWith:()=>m4,slugify:()=>p4,size:()=>s6,regex:()=>j4,property:()=>M1,positive:()=>X1,overwrite:()=>mv,normalize:()=>i4,nonpositive:()=>Z1,nonnegative:()=>S1,negative:()=>w1,multipleOf:()=>N6,minSize:()=>dv,minLength:()=>O6,mime:()=>c4,maxSize:()=>r6,maxLength:()=>e6,lte:()=>Qv,lt:()=>nv,lowercase:()=>V4,length:()=>$4,includes:()=>f4,gte:()=>Iv,gt:()=>tv,endsWith:()=>E4});var D6={};ev(D6,{time:()=>A9,duration:()=>q9,datetime:()=>F9,date:()=>Y9,ZodISOTime:()=>T1,ZodISODuration:()=>j1,ZodISODateTime:()=>y1,ZodISODate:()=>D1});var y1=q("ZodISODateTime",($,v)=>{vb.init($,v),M$.init($,v)});function F9($){return sJ(y1,$)}var D1=q("ZodISODate",($,v)=>{Ub.init($,v),M$.init($,v)});function Y9($){return eJ(D1,$)}var T1=q("ZodISOTime",($,v)=>{gb.init($,v),M$.init($,v)});function A9($){return $8(T1,$)}var j1=q("ZodISODuration",($,v)=>{_b.init($,v),M$.init($,v)});function q9($){return v8(j1,$)}var E5=($,v)=>{jU.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(g)=>CU($,g)},flatten:{value:(g)=>VU($,g)},addIssue:{value:(g)=>{$.issues.push(g),$.message=JSON.stringify($.issues,S4,2)}},addIssues:{value:(g)=>{$.issues.push(...g),$.message=JSON.stringify($.issues,S4,2)}},isEmpty:{get(){return $.issues.length===0}}})},lL=q("ZodError",E5),Xv=q("ZodError",E5,{Parent:Error});var X9=N4(Xv),w9=r4(Xv),Z9=u4(Xv),S9=y4(Xv),M9=T_(Xv),Q9=j_(Xv),N9=V_(Xv),r9=C_(Xv),u9=f_(Xv),R9=m_(Xv),y9=E_(Xv),D9=c_(Xv);var _$=q("ZodType",($,v)=>{return v$.init($,v),Object.assign($["~standard"],{jsonSchema:{input:n4($,"input"),output:n4($,"output")}}),$.toJSONSchema=D8($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...g)=>{return $.clone(j.mergeDefs(v,{checks:[...v.checks??[],...g.map((_)=>typeof _==="function"?{_zod:{check:_,def:{check:"custom"},onattach:[]}}:_)]}),{parent:!0})},$.with=$.check,$.clone=(g,_)=>kv($,g,_),$.brand=()=>$,$.register=(g,_)=>{return g.add($,_),$},$.parse=(g,_)=>X9($,g,_,{callee:$.parse}),$.safeParse=(g,_)=>Z9($,g,_),$.parseAsync=async(g,_)=>w9($,g,_,{callee:$.parseAsync}),$.safeParseAsync=async(g,_)=>S9($,g,_),$.spa=$.safeParseAsync,$.encode=(g,_)=>M9($,g,_),$.decode=(g,_)=>Q9($,g,_),$.encodeAsync=async(g,_)=>N9($,g,_),$.decodeAsync=async(g,_)=>r9($,g,_),$.safeEncode=(g,_)=>u9($,g,_),$.safeDecode=(g,_)=>R9($,g,_),$.safeEncodeAsync=async(g,_)=>y9($,g,_),$.safeDecodeAsync=async(g,_)=>D9($,g,_),$.refine=(g,_)=>$.check(FO(g,_)),$.superRefine=(g)=>$.check(YO(g)),$.overwrite=(g)=>$.check(mv(g)),$.optional=()=>R$($),$.exactOptional=()=>$O($),$.nullable=()=>Ug($),$.nullish=()=>R$(Ug($)),$.nonoptional=(g)=>bO($,g),$.array=()=>O$($),$.or=(g)=>w$([$,g]),$.and=(g)=>UU($,g),$.transform=(g)=>gg($,U0(g)),$.default=(g)=>gO($,g),$.prefault=(g)=>zO($,g),$.catch=(g)=>GO($,g),$.pipe=(g)=>gg($,g),$.readonly=()=>BO($),$.describe=(g)=>{let _=$.clone();return vv.add(_,{description:g}),_},Object.defineProperty($,"description",{get(){return vv.get($)?.description},configurable:!0}),$.meta=(...g)=>{if(g.length===0)return vv.get($);let _=$.clone();return vv.add(_,g[0]),_},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(g)=>g($),$}),C1=q("_ZodString",($,v)=>{a6.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>T8($,_,U,z);let g=$._zod.bag;$.format=g.format??null,$.minLength=g.minimum??null,$.maxLength=g.maximum??null,$.regex=(..._)=>$.check(j4(..._)),$.includes=(..._)=>$.check(f4(..._)),$.startsWith=(..._)=>$.check(m4(..._)),$.endsWith=(..._)=>$.check(E4(..._)),$.min=(..._)=>$.check(O6(..._)),$.max=(..._)=>$.check(e6(..._)),$.length=(..._)=>$.check($4(..._)),$.nonempty=(..._)=>$.check(O6(1,..._)),$.lowercase=(_)=>$.check(V4(_)),$.uppercase=(_)=>$.check(C4(_)),$.trim=()=>$.check(l4()),$.normalize=(..._)=>$.check(i4(..._)),$.toLowerCase=()=>$.check(h4()),$.toUpperCase=()=>$.check(x4()),$.slugify=()=>$.check(p4())}),d4=q("ZodString",($,v)=>{a6.init($,v),C1.init($,v),$.email=(g)=>$.check(U1(f1,g)),$.url=(g)=>$.check(eU(_g,g)),$.jwt=(g)=>$.check(q1(e1,g)),$.emoji=(g)=>$.check(J1(m1,g)),$.guid=(g)=>$.check(sU(vg,g)),$.uuid=(g)=>$.check(g1(av,g)),$.uuidv4=(g)=>$.check(_1(av,g)),$.uuidv6=(g)=>$.check(z1(av,g)),$.uuidv7=(g)=>$.check(b1(av,g)),$.nanoid=(g)=>$.check(O1(E1,g)),$.guid=(g)=>$.check(sU(vg,g)),$.cuid=(g)=>$.check(G1(c1,g)),$.cuid2=(g)=>$.check(K1(i1,g)),$.ulid=(g)=>$.check(W1(l1,g)),$.base64=(g)=>$.check(F1(d1,g)),$.base64url=(g)=>$.check(Y1(a1,g)),$.xid=(g)=>$.check(B1(h1,g)),$.ksuid=(g)=>$.check(P1(x1,g)),$.ipv4=(g)=>$.check(k1(p1,g)),$.ipv6=(g)=>$.check(I1(o1,g)),$.cidrv4=(g)=>$.check(H1(n1,g)),$.cidrv6=(g)=>$.check(L1(t1,g)),$.e164=(g)=>$.check(A1(s1,g)),$.datetime=(g)=>$.check(F9(g)),$.date=(g)=>$.check(Y9(g)),$.time=(g)=>$.check(A9(g)),$.duration=(g)=>$.check(q9(g))});function S($){return nJ(d4,$)}var M$=q("ZodStringFormat",($,v)=>{S$.init($,v),C1.init($,v)}),f1=q("ZodEmail",($,v)=>{pz.init($,v),M$.init($,v)});function c5($){return U1(f1,$)}var vg=q("ZodGUID",($,v)=>{hz.init($,v),M$.init($,v)});function i5($){return sU(vg,$)}var av=q("ZodUUID",($,v)=>{xz.init($,v),M$.init($,v)});function l5($){return g1(av,$)}function h5($){return _1(av,$)}function x5($){return z1(av,$)}function p5($){return b1(av,$)}var _g=q("ZodURL",($,v)=>{oz.init($,v),M$.init($,v)});function o5($){return eU(_g,$)}function n5($){return eU(_g,{protocol:/^https?$/,hostname:yv.domain,...j.normalizeParams($)})}var m1=q("ZodEmoji",($,v)=>{nz.init($,v),M$.init($,v)});function t5($){return J1(m1,$)}var E1=q("ZodNanoID",($,v)=>{tz.init($,v),M$.init($,v)});function d5($){return O1(E1,$)}var c1=q("ZodCUID",($,v)=>{dz.init($,v),M$.init($,v)});function a5($){return G1(c1,$)}var i1=q("ZodCUID2",($,v)=>{az.init($,v),M$.init($,v)});function s5($){return K1(i1,$)}var l1=q("ZodULID",($,v)=>{sz.init($,v),M$.init($,v)});function e5($){return W1(l1,$)}var h1=q("ZodXID",($,v)=>{ez.init($,v),M$.init($,v)});function $7($){return B1(h1,$)}var x1=q("ZodKSUID",($,v)=>{$b.init($,v),M$.init($,v)});function v7($){return P1(x1,$)}var p1=q("ZodIPv4",($,v)=>{zb.init($,v),M$.init($,v)});function U7($){return k1(p1,$)}var T9=q("ZodMAC",($,v)=>{Jb.init($,v),M$.init($,v)});function g7($){return dJ(T9,$)}var o1=q("ZodIPv6",($,v)=>{bb.init($,v),M$.init($,v)});function _7($){return I1(o1,$)}var n1=q("ZodCIDRv4",($,v)=>{Ob.init($,v),M$.init($,v)});function z7($){return H1(n1,$)}var t1=q("ZodCIDRv6",($,v)=>{Gb.init($,v),M$.init($,v)});function b7($){return L1(t1,$)}var d1=q("ZodBase64",($,v)=>{Wb.init($,v),M$.init($,v)});function J7($){return F1(d1,$)}var a1=q("ZodBase64URL",($,v)=>{Bb.init($,v),M$.init($,v)});function O7($){return Y1(a1,$)}var s1=q("ZodE164",($,v)=>{Pb.init($,v),M$.init($,v)});function G7($){return A1(s1,$)}var e1=q("ZodJWT",($,v)=>{kb.init($,v),M$.init($,v)});function K7($){return q1(e1,$)}var a4=q("ZodCustomStringFormat",($,v)=>{Ib.init($,v),M$.init($,v)});function W7($,v,g={}){return o4(a4,$,v,g)}function B7($){return o4(a4,"hostname",yv.hostname,$)}function P7($){return o4(a4,"hex",yv.hex,$)}function k7($,v){let g=v?.enc??"hex",_=`${$}_${g}`,U=yv[_];if(!U)throw Error(`Unrecognized hash format: ${_}`);return o4(a4,_,U,v)}var s4=q("ZodNumber",($,v)=>{a_.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>j8($,_,U,z),$.gt=(_,U)=>$.check(tv(_,U)),$.gte=(_,U)=>$.check(Iv(_,U)),$.min=(_,U)=>$.check(Iv(_,U)),$.lt=(_,U)=>$.check(nv(_,U)),$.lte=(_,U)=>$.check(Qv(_,U)),$.max=(_,U)=>$.check(Qv(_,U)),$.int=(_)=>$.check(V1(_)),$.safe=(_)=>$.check(V1(_)),$.positive=(_)=>$.check(tv(0,_)),$.nonnegative=(_)=>$.check(Iv(0,_)),$.negative=(_)=>$.check(nv(0,_)),$.nonpositive=(_)=>$.check(Qv(0,_)),$.multipleOf=(_,U)=>$.check(N6(_,U)),$.step=(_,U)=>$.check(N6(_,U)),$.finite=()=>$;let g=$._zod.bag;$.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),$.isFinite=!0,$.format=g.format??null});function L$($){return U8(s4,$)}var v4=q("ZodNumberFormat",($,v)=>{Hb.init($,v),s4.init($,v)});function V1($){return _8(v4,$)}function I7($){return z8(v4,$)}function H7($){return b8(v4,$)}function L7($){return J8(v4,$)}function F7($){return O8(v4,$)}var e4=q("ZodBoolean",($,v)=>{hU.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>V8($,g,_,U)});function p$($){return G8(e4,$)}var $U=q("ZodBigInt",($,v)=>{s_.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>C8($,_,U,z),$.gte=(_,U)=>$.check(Iv(_,U)),$.min=(_,U)=>$.check(Iv(_,U)),$.gt=(_,U)=>$.check(tv(_,U)),$.gte=(_,U)=>$.check(Iv(_,U)),$.min=(_,U)=>$.check(Iv(_,U)),$.lt=(_,U)=>$.check(nv(_,U)),$.lte=(_,U)=>$.check(Qv(_,U)),$.max=(_,U)=>$.check(Qv(_,U)),$.positive=(_)=>$.check(tv(BigInt(0),_)),$.negative=(_)=>$.check(nv(BigInt(0),_)),$.nonpositive=(_)=>$.check(Qv(BigInt(0),_)),$.nonnegative=(_)=>$.check(Iv(BigInt(0),_)),$.multipleOf=(_,U)=>$.check(N6(_,U));let g=$._zod.bag;$.minValue=g.minimum??null,$.maxValue=g.maximum??null,$.format=g.format??null});function Y7($){return W8($U,$)}var $0=q("ZodBigIntFormat",($,v)=>{Lb.init($,v),$U.init($,v)});function A7($){return P8($0,$)}function q7($){return k8($0,$)}var j9=q("ZodSymbol",($,v)=>{Fb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>f8($,g,_,U)});function X7($){return I8(j9,$)}var V9=q("ZodUndefined",($,v)=>{Yb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>E8($,g,_,U)});function w7($){return H8(V9,$)}var C9=q("ZodNull",($,v)=>{Ab.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>m8($,g,_,U)});function vU($){return L8(C9,$)}var f9=q("ZodAny",($,v)=>{qb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>l8($,g,_,U)});function Z7(){return F8(f9)}var m9=q("ZodUnknown",($,v)=>{Xb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>h8($,g,_,U)});function Q$(){return Y8(m9)}var E9=q("ZodNever",($,v)=>{wb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>i8($,g,_,U)});function v0($){return A8(E9,$)}var c9=q("ZodVoid",($,v)=>{Zb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>c8($,g,_,U)});function S7($){return q8(c9,$)}var zg=q("ZodDate",($,v)=>{Sb.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>x8($,_,U,z),$.min=(_,U)=>$.check(Iv(_,U)),$.max=(_,U)=>$.check(Qv(_,U));let g=$._zod.bag;$.minDate=g.minimum?new Date(g.minimum):null,$.maxDate=g.maximum?new Date(g.maximum):null});function M7($){return X8(zg,$)}var i9=q("ZodArray",($,v)=>{Mb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>g9($,g,_,U),$.element=v.element,$.min=(g,_)=>$.check(O6(g,_)),$.nonempty=(g)=>$.check(O6(1,g)),$.max=(g,_)=>$.check(e6(g,_)),$.length=(g,_)=>$.check($4(g,_)),$.unwrap=()=>$.element});function O$($,v){return S8(i9,$,v)}function Q7($){let v=$._zod.def.shape;return gv(Object.keys(v))}var bg=q("ZodObject",($,v)=>{Qb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>_9($,g,_,U),j.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>gv(Object.keys($._zod.def.shape)),$.catchall=(g)=>$.clone({...$._zod.def,catchall:g}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Q$()}),$.loose=()=>$.clone({...$._zod.def,catchall:Q$()}),$.strict=()=>$.clone({...$._zod.def,catchall:v0()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(g)=>{return j.extend($,g)},$.safeExtend=(g)=>{return j.safeExtend($,g)},$.merge=(g)=>j.merge($,g),$.pick=(g)=>j.pick($,g),$.omit=(g)=>j.omit($,g),$.partial=(...g)=>j.partial(g0,$,g[0]),$.required=(...g)=>j.required(_0,$,g[0])});function h($,v){let g={type:"object",shape:$??{},...j.normalizeParams(v)};return new bg(g)}function N7($,v){return new bg({type:"object",shape:$,catchall:v0(),...j.normalizeParams(v)})}function Uv($,v){return new bg({type:"object",shape:$,catchall:Q$(),...j.normalizeParams(v)})}var Jg=q("ZodUnion",($,v)=>{xU.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>N1($,g,_,U),$.options=v.options});function w$($,v){return new Jg({type:"union",options:$,...j.normalizeParams(v)})}var l9=q("ZodXor",($,v)=>{Jg.init($,v),Nb.init($,v),$._zod.processJSONSchema=(g,_,U)=>N1($,g,_,U),$.options=v.options});function r7($,v){return new l9({type:"union",options:$,inclusive:!1,...j.normalizeParams(v)})}var h9=q("ZodDiscriminatedUnion",($,v)=>{Jg.init($,v),rb.init($,v)});function Og($,v,g){return new h9({type:"union",options:v,discriminator:$,...j.normalizeParams(g)})}var x9=q("ZodIntersection",($,v)=>{ub.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>z9($,g,_,U)});function UU($,v){return new x9({type:"intersection",left:$,right:v})}var p9=q("ZodTuple",($,v)=>{e_.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>b9($,g,_,U),$.rest=(g)=>$.clone({...$._zod.def,rest:g})});function o9($,v,g){let _=v instanceof v$,U=_?g:v;return new p9({type:"tuple",items:$,rest:_?v:null,...j.normalizeParams(U)})}var Gg=q("ZodRecord",($,v)=>{Rb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>J9($,g,_,U),$.keyType=v.keyType,$.valueType=v.valueType});function r$($,v,g){return new Gg({type:"record",keyType:$,valueType:v,...j.normalizeParams(g)})}function u7($,v,g){let _=kv($);return _._zod.values=void 0,new Gg({type:"record",keyType:_,valueType:v,...j.normalizeParams(g)})}function R7($,v,g){return new Gg({type:"record",keyType:$,valueType:v,mode:"loose",...j.normalizeParams(g)})}var n9=q("ZodMap",($,v)=>{yb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>v9($,g,_,U),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...g)=>$.check(dv(...g)),$.nonempty=(g)=>$.check(dv(1,g)),$.max=(...g)=>$.check(r6(...g)),$.size=(...g)=>$.check(s6(...g))});function y7($,v,g){return new n9({type:"map",keyType:$,valueType:v,...j.normalizeParams(g)})}var t9=q("ZodSet",($,v)=>{Db.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>U9($,g,_,U),$.min=(...g)=>$.check(dv(...g)),$.nonempty=(g)=>$.check(dv(1,g)),$.max=(...g)=>$.check(r6(...g)),$.size=(...g)=>$.check(s6(...g))});function D7($,v){return new t9({type:"set",valueType:$,...j.normalizeParams(v)})}var t4=q("ZodEnum",($,v)=>{Tb.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>p8($,_,U,z),$.enum=v.entries,$.options=Object.values(v.entries);let g=new Set(Object.keys(v.entries));$.extract=(_,U)=>{let z={};for(let b of _)if(g.has(b))z[b]=v.entries[b];else throw Error(`Key ${b} not found in enum`);return new t4({...v,checks:[],...j.normalizeParams(U),entries:z})},$.exclude=(_,U)=>{let z={...v.entries};for(let b of _)if(g.has(b))delete z[b];else throw Error(`Key ${b} not found in enum`);return new t4({...v,checks:[],...j.normalizeParams(U),entries:z})}});function gv($,v){let g=Array.isArray($)?Object.fromEntries($.map((_)=>[_,_])):$;return new t4({type:"enum",entries:g,...j.normalizeParams(v)})}function T7($,v){return new t4({type:"enum",entries:$,...j.normalizeParams(v)})}var d9=q("ZodLiteral",($,v)=>{jb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>o8($,g,_,U),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function o($,v){return new d9({type:"literal",values:Array.isArray($)?$:[$],...j.normalizeParams(v)})}var a9=q("ZodFile",($,v)=>{Vb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>d8($,g,_,U),$.min=(g,_)=>$.check(dv(g,_)),$.max=(g,_)=>$.check(r6(g,_)),$.mime=(g,_)=>$.check(c4(Array.isArray(g)?g:[g],_))});function j7($){return M8(a9,$)}var s9=q("ZodTransform",($,v)=>{Cb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>$9($,g,_,U),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new n6($.constructor.name);g.addIssue=(z)=>{if(typeof z==="string")g.issues.push(j.issue(z,g.value,v));else{let b=z;if(b.fatal)b.continue=!1;b.code??(b.code="custom"),b.input??(b.input=g.value),b.inst??(b.inst=$),g.issues.push(j.issue(b))}};let U=v.transform(g.value,g);if(U instanceof Promise)return U.then((z)=>{return g.value=z,g});return g.value=U,g}});function U0($){return new s9({type:"transform",transform:$})}var g0=q("ZodOptional",($,v)=>{$1.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>r1($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function R$($){return new g0({type:"optional",innerType:$})}var e9=q("ZodExactOptional",($,v)=>{fb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>r1($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function $O($){return new e9({type:"optional",innerType:$})}var vO=q("ZodNullable",($,v)=>{mb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>O9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function Ug($){return new vO({type:"nullable",innerType:$})}function V7($){return R$(Ug($))}var UO=q("ZodDefault",($,v)=>{Eb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>K9($,g,_,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function gO($,v){return new UO({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():j.shallowClone(v)}})}var _O=q("ZodPrefault",($,v)=>{cb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>W9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function zO($,v){return new _O({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():j.shallowClone(v)}})}var _0=q("ZodNonOptional",($,v)=>{ib.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>G9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function bO($,v){return new _0({type:"nonoptional",innerType:$,...j.normalizeParams(v)})}var JO=q("ZodSuccess",($,v)=>{lb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>a8($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function C7($){return new JO({type:"success",innerType:$})}var OO=q("ZodCatch",($,v)=>{hb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>B9($,g,_,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function GO($,v){return new OO({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var KO=q("ZodNaN",($,v)=>{xb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>n8($,g,_,U)});function f7($){return Z8(KO,$)}var z0=q("ZodPipe",($,v)=>{pb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>P9($,g,_,U),$.in=v.in,$.out=v.out});function gg($,v){return new z0({type:"pipe",in:$,out:v})}var b0=q("ZodCodec",($,v)=>{z0.init($,v),pU.init($,v)});function m7($,v,g){return new b0({type:"pipe",in:$,out:v,transform:g.decode,reverseTransform:g.encode})}var WO=q("ZodReadonly",($,v)=>{ob.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>k9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function BO($){return new WO({type:"readonly",innerType:$})}var PO=q("ZodTemplateLiteral",($,v)=>{nb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>t8($,g,_,U)});function E7($,v){return new PO({type:"template_literal",parts:$,...j.normalizeParams(v)})}var kO=q("ZodLazy",($,v)=>{ab.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>H9($,g,_,U),$.unwrap=()=>$._zod.def.getter()});function IO($){return new kO({type:"lazy",getter:$})}var HO=q("ZodPromise",($,v)=>{db.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>I9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function c7($){return new HO({type:"promise",innerType:$})}var LO=q("ZodFunction",($,v)=>{tb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>e8($,g,_,U)});function i7($){return new LO({type:"function",input:Array.isArray($?.input)?o9($?.input):$?.input??O$(Q$()),output:$?.output??Q$()})}var Kg=q("ZodCustom",($,v)=>{sb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>s8($,g,_,U)});function l7($){let v=new N$({check:"custom"});return v._zod.check=$,v}function J0($,v){return Q8(Kg,$??(()=>!0),v)}function FO($,v={}){return N8(Kg,$,v)}function YO($){return r8($)}var h7=u8,x7=R8;function p7($,v={}){let g=new Kg({type:"custom",check:"custom",fn:(_)=>_ instanceof $,abort:!0,...j.normalizeParams(v)});return g._zod.bag.Class=$,g._zod.check=(_)=>{if(!(_.value instanceof $))_.issues.push({code:"invalid_type",expected:$.name,input:_.value,inst:g,path:[...g._zod.def.path??[]]})},g}var o7=(...$)=>y8({Codec:b0,Boolean:e4,String:d4},...$);function n7($){let v=IO(()=>{return w$([S($),L$(),p$(),vU(),O$(v),r$(S(),v)])});return v}function Wg($,v){return gg(U0($),v)}var xL={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function pL($){x$({customError:$})}function oL(){return x$().customError}var AO;(function($){})(AO||(AO={}));var i={...$g,...R1,iso:D6},nL=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function tL($,v){let g=$.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function dL($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=$.slice(1).split("/").filter(Boolean);if(g.length===0)return v.rootSchema;let _=v.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===_){let U=g[1];if(!U||!v.defs[U])throw Error(`Reference not found: ${$}`);return v.defs[U]}throw Error(`Reference not found: ${$}`)}function t7($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return i.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(v.refs.has(U))return v.refs.get(U);if(v.processing.has(U))return i.lazy(()=>{if(!v.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return v.refs.get(U)});v.processing.add(U);let z=dL(U,v),b=Kv(z,v);return v.refs.set(U,b),v.processing.delete(U),b}if($.enum!==void 0){let U=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return i.null();if(U.length===0)return i.never();if(U.length===1)return i.literal(U[0]);if(U.every((b)=>typeof b==="string"))return i.enum(U);let z=U.map((b)=>i.literal(b));if(z.length<2)return z[0];return i.union([z[0],z[1],...z.slice(2)])}if($.const!==void 0)return i.literal($.const);let g=$.type;if(Array.isArray(g)){let U=g.map((z)=>{let b={...$,type:z};return t7(b,v)});if(U.length===0)return i.never();if(U.length===1)return U[0];return i.union(U)}if(!g)return i.any();let _;switch(g){case"string":{let U=i.string();if($.format){let z=$.format;if(z==="email")U=U.check(i.email());else if(z==="uri"||z==="uri-reference")U=U.check(i.url());else if(z==="uuid"||z==="guid")U=U.check(i.uuid());else if(z==="date-time")U=U.check(i.iso.datetime());else if(z==="date")U=U.check(i.iso.date());else if(z==="time")U=U.check(i.iso.time());else if(z==="duration")U=U.check(i.iso.duration());else if(z==="ipv4")U=U.check(i.ipv4());else if(z==="ipv6")U=U.check(i.ipv6());else if(z==="mac")U=U.check(i.mac());else if(z==="cidr")U=U.check(i.cidrv4());else if(z==="cidr-v6")U=U.check(i.cidrv6());else if(z==="base64")U=U.check(i.base64());else if(z==="base64url")U=U.check(i.base64url());else if(z==="e164")U=U.check(i.e164());else if(z==="jwt")U=U.check(i.jwt());else if(z==="emoji")U=U.check(i.emoji());else if(z==="nanoid")U=U.check(i.nanoid());else if(z==="cuid")U=U.check(i.cuid());else if(z==="cuid2")U=U.check(i.cuid2());else if(z==="ulid")U=U.check(i.ulid());else if(z==="xid")U=U.check(i.xid());else if(z==="ksuid")U=U.check(i.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));_=U;break}case"number":case"integer":{let U=g==="integer"?i.number().int():i.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);_=U;break}case"boolean":{_=i.boolean();break}case"null":{_=i.null();break}case"object":{let U={},z=$.properties||{},b=new Set($.required||[]);for(let[G,K]of Object.entries(z)){let W=Kv(K,v);U[G]=b.has(G)?W:W.optional()}if($.propertyNames){let G=Kv($.propertyNames,v),K=$.additionalProperties&&typeof $.additionalProperties==="object"?Kv($.additionalProperties,v):i.any();if(Object.keys(U).length===0){_=i.record(G,K);break}let W=i.object(U).passthrough(),B=i.looseRecord(G,K);_=i.intersection(W,B);break}if($.patternProperties){let G=$.patternProperties,K=Object.keys(G),W=[];for(let k of K){let P=Kv(G[k],v),A=i.string().regex(new RegExp(k));W.push(i.looseRecord(A,P))}let B=[];if(Object.keys(U).length>0)B.push(i.object(U).passthrough());if(B.push(...W),B.length===0)_=i.object({}).passthrough();else if(B.length===1)_=B[0];else{let k=i.intersection(B[0],B[1]);for(let P=2;P<B.length;P++)k=i.intersection(k,B[P]);_=k}break}let J=i.object(U);if($.additionalProperties===!1)_=J.strict();else if(typeof $.additionalProperties==="object")_=J.catchall(Kv($.additionalProperties,v));else _=J.passthrough();break}case"array":{let{prefixItems:U,items:z}=$;if(U&&Array.isArray(U)){let b=U.map((G)=>Kv(G,v)),J=z&&typeof z==="object"&&!Array.isArray(z)?Kv(z,v):void 0;if(J)_=i.tuple(b).rest(J);else _=i.tuple(b);if(typeof $.minItems==="number")_=_.check(i.minLength($.minItems));if(typeof $.maxItems==="number")_=_.check(i.maxLength($.maxItems))}else if(Array.isArray(z)){let b=z.map((G)=>Kv(G,v)),J=$.additionalItems&&typeof $.additionalItems==="object"?Kv($.additionalItems,v):void 0;if(J)_=i.tuple(b).rest(J);else _=i.tuple(b);if(typeof $.minItems==="number")_=_.check(i.minLength($.minItems));if(typeof $.maxItems==="number")_=_.check(i.maxLength($.maxItems))}else if(z!==void 0){let b=Kv(z,v),J=i.array(b);if(typeof $.minItems==="number")J=J.min($.minItems);if(typeof $.maxItems==="number")J=J.max($.maxItems);_=J}else _=i.array(i.any());break}default:throw Error(`Unsupported type: ${g}`)}if($.description)_=_.describe($.description);if($.default!==void 0)_=_.default($.default);return _}function Kv($,v){if(typeof $==="boolean")return $?i.any():i.never();let g=t7($,v),_=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let J=$.anyOf.map((K)=>Kv(K,v)),G=i.union(J);g=_?i.intersection(g,G):G}if($.oneOf&&Array.isArray($.oneOf)){let J=$.oneOf.map((K)=>Kv(K,v)),G=i.xor(J);g=_?i.intersection(g,G):G}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)g=_?g:i.any();else{let J=_?g:Kv($.allOf[0],v),G=_?0:1;for(let K=G;K<$.allOf.length;K++)J=i.intersection(J,Kv($.allOf[K],v));g=J}if($.nullable===!0&&v.version==="openapi-3.0")g=i.nullable(g);if($.readOnly===!0)g=i.readonly(g);let U={},z=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let J of z)if(J in $)U[J]=$[J];let b=["contentEncoding","contentMediaType","contentSchema"];for(let J of b)if(J in $)U[J]=$[J];for(let J of Object.keys($))if(!nL.has(J))U[J]=$[J];if(Object.keys(U).length>0)v.registry.add(g,U);return g}function d7($,v){if(typeof $==="boolean")return $?i.any():i.never();let g=tL($,v?.defaultTarget),_=$.$defs||$.definitions||{},U={version:g,defs:_,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??vv};return Kv($,U)}var qO={};ev(qO,{string:()=>aL,number:()=>sL,date:()=>vF,boolean:()=>eL,bigint:()=>$F});function aL($){return tJ(d4,$)}function sL($){return g8(s4,$)}function eL($){return K8(e4,$)}function $F($){return B8($U,$)}function vF($){return w8(zg,$)}x$(oU());var T6="io.modelcontextprotocol/related-task",G0="2.0",_v=J0(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),a7=w$([S(),L$().int()]),s7=S(),LQ=Uv({ttl:w$([L$(),vU()]).optional(),pollInterval:L$().optional()}),UF=h({ttl:L$().optional()}),gF=h({taskId:S()}),XO=Uv({progressToken:a7.optional(),[T6]:gF.optional()}),Nv=h({_meta:XO.optional()}),Bg=Nv.extend({task:UF.optional()}),e7=($)=>Bg.safeParse($).success,zv=h({method:S(),params:Nv.loose().optional()}),Dv=h({_meta:XO.optional()}),Tv=h({method:S(),params:Dv.loose().optional()}),bv=Uv({_meta:XO.optional()}),_U=w$([S(),L$().int()]),$W=h({jsonrpc:o(G0),id:_U,...zv.shape}).strict(),wO=($)=>$W.safeParse($).success,vW=h({jsonrpc:o(G0),...Tv.shape}).strict(),UW=($)=>vW.safeParse($).success,ZO=h({jsonrpc:o(G0),id:_U,result:bv}).strict(),Pg=($)=>ZO.safeParse($).success;var X$;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(X$||(X$={}));var SO=h({jsonrpc:o(G0),id:_U.optional(),error:h({code:L$().int(),message:S(),data:Q$().optional()})}).strict();var gW=($)=>SO.safeParse($).success;var _W=w$([$W,vW,ZO,SO]),FQ=w$([ZO,SO]),K0=bv.strict(),_F=Dv.extend({requestId:_U.optional(),reason:S().optional()}),W0=Tv.extend({method:o("notifications/cancelled"),params:_F}),zF=h({src:S(),mimeType:S().optional(),sizes:O$(S()).optional(),theme:gv(["light","dark"]).optional()}),kg=h({icons:O$(zF).optional()}),gU=h({name:S(),title:S().optional()}),Ig=gU.extend({...gU.shape,...kg.shape,version:S(),websiteUrl:S().optional(),description:S().optional()}),bF=UU(h({applyDefaults:p$().optional()}),r$(S(),Q$())),JF=Wg(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},UU(h({form:bF.optional(),url:_v.optional()}),r$(S(),Q$()).optional())),OF=Uv({list:_v.optional(),cancel:_v.optional(),requests:Uv({sampling:Uv({createMessage:_v.optional()}).optional(),elicitation:Uv({create:_v.optional()}).optional()}).optional()}),GF=Uv({list:_v.optional(),cancel:_v.optional(),requests:Uv({tools:Uv({call:_v.optional()}).optional()}).optional()}),KF=h({experimental:r$(S(),_v).optional(),sampling:h({context:_v.optional(),tools:_v.optional()}).optional(),elicitation:JF.optional(),roots:h({listChanged:p$().optional()}).optional(),tasks:OF.optional()}),WF=Nv.extend({protocolVersion:S(),capabilities:KF,clientInfo:Ig}),BF=zv.extend({method:o("initialize"),params:WF});var PF=h({experimental:r$(S(),_v).optional(),logging:_v.optional(),completions:_v.optional(),prompts:h({listChanged:p$().optional()}).optional(),resources:h({subscribe:p$().optional(),listChanged:p$().optional()}).optional(),tools:h({listChanged:p$().optional()}).optional(),tasks:GF.optional()}),kF=bv.extend({protocolVersion:S(),capabilities:PF,serverInfo:Ig,instructions:S().optional()}),IF=Tv.extend({method:o("notifications/initialized"),params:Dv.optional()});var j6=zv.extend({method:o("ping"),params:Nv.optional()}),HF=h({progress:L$(),total:R$(L$()),message:R$(S())}),LF=h({...Dv.shape,...HF.shape,progressToken:a7}),B0=Tv.extend({method:o("notifications/progress"),params:LF}),FF=Nv.extend({cursor:s7.optional()}),Hg=zv.extend({params:FF.optional()}),Lg=bv.extend({nextCursor:s7.optional()}),YF=gv(["working","input_required","completed","failed","cancelled"]),Fg=h({taskId:S(),status:YF,ttl:w$([L$(),vU()]),createdAt:S(),lastUpdatedAt:S(),pollInterval:R$(L$()),statusMessage:R$(S())}),P0=bv.extend({task:Fg}),AF=Dv.merge(Fg),Yg=Tv.extend({method:o("notifications/tasks/status"),params:AF}),k0=zv.extend({method:o("tasks/get"),params:Nv.extend({taskId:S()})}),I0=bv.merge(Fg),H0=zv.extend({method:o("tasks/result"),params:Nv.extend({taskId:S()})}),YQ=bv.loose(),L0=Hg.extend({method:o("tasks/list")}),F0=Lg.extend({tasks:O$(Fg)}),Y0=zv.extend({method:o("tasks/cancel"),params:Nv.extend({taskId:S()})}),zW=bv.merge(Fg),bW=h({uri:S(),mimeType:R$(S()),_meta:r$(S(),Q$()).optional()}),JW=bW.extend({text:S()}),MO=S().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),OW=bW.extend({blob:MO}),Ag=gv(["user","assistant"]),zU=h({audience:O$(Ag).optional(),priority:L$().min(0).max(1).optional(),lastModified:D6.datetime({offset:!0}).optional()}),GW=h({...gU.shape,...kg.shape,uri:S(),description:R$(S()),mimeType:R$(S()),annotations:zU.optional(),_meta:R$(Uv({}))}),qF=h({...gU.shape,...kg.shape,uriTemplate:S(),description:R$(S()),mimeType:R$(S()),annotations:zU.optional(),_meta:R$(Uv({}))}),QO=Hg.extend({method:o("resources/list")}),qg=Lg.extend({resources:O$(GW)}),NO=Hg.extend({method:o("resources/templates/list")}),rO=Lg.extend({resourceTemplates:O$(qF)}),uO=Nv.extend({uri:S()}),XF=uO,RO=zv.extend({method:o("resources/read"),params:XF}),Xg=bv.extend({contents:O$(w$([JW,OW]))}),yO=Tv.extend({method:o("notifications/resources/list_changed"),params:Dv.optional()}),wF=uO,ZF=zv.extend({method:o("resources/subscribe"),params:wF}),SF=uO,MF=zv.extend({method:o("resources/unsubscribe"),params:SF}),QF=Dv.extend({uri:S()}),NF=Tv.extend({method:o("notifications/resources/updated"),params:QF}),rF=h({name:S(),description:R$(S()),required:R$(p$())}),uF=h({...gU.shape,...kg.shape,description:R$(S()),arguments:R$(O$(rF)),_meta:R$(Uv({}))}),DO=Hg.extend({method:o("prompts/list")}),TO=Lg.extend({prompts:O$(uF)}),RF=Nv.extend({name:S(),arguments:r$(S(),S()).optional()}),yF=zv.extend({method:o("prompts/get"),params:RF}),jO=h({type:o("text"),text:S(),annotations:zU.optional(),_meta:r$(S(),Q$()).optional()}),VO=h({type:o("image"),data:MO,mimeType:S(),annotations:zU.optional(),_meta:r$(S(),Q$()).optional()}),CO=h({type:o("audio"),data:MO,mimeType:S(),annotations:zU.optional(),_meta:r$(S(),Q$()).optional()}),DF=h({type:o("tool_use"),name:S(),id:S(),input:r$(S(),Q$()),_meta:r$(S(),Q$()).optional()}),fO=h({type:o("resource"),resource:w$([JW,OW]),annotations:zU.optional(),_meta:r$(S(),Q$()).optional()}),mO=GW.extend({type:o("resource_link")}),bU=w$([jO,VO,CO,mO,fO]),TF=h({role:Ag,content:bU}),jF=bv.extend({description:S().optional(),messages:O$(TF)}),EO=Tv.extend({method:o("notifications/prompts/list_changed"),params:Dv.optional()}),VF=h({title:S().optional(),readOnlyHint:p$().optional(),destructiveHint:p$().optional(),idempotentHint:p$().optional(),openWorldHint:p$().optional()}),CF=h({taskSupport:gv(["required","optional","forbidden"]).optional()}),A0=h({...gU.shape,...kg.shape,description:S().optional(),inputSchema:h({type:o("object"),properties:r$(S(),_v).optional(),required:O$(S()).optional()}).catchall(Q$()),outputSchema:h({type:o("object"),properties:r$(S(),_v).optional(),required:O$(S()).optional()}).catchall(Q$()).optional(),annotations:VF.optional(),execution:CF.optional(),_meta:r$(S(),Q$()).optional()}),wg=Hg.extend({method:o("tools/list")}),fF=Lg.extend({tools:O$(A0)}),V6=bv.extend({content:O$(bU).default([]),structuredContent:r$(S(),Q$()).optional(),isError:p$().optional()}),AQ=V6.or(bv.extend({toolResult:Q$()})),mF=Bg.extend({name:S(),arguments:r$(S(),Q$()).optional()}),Zg=zv.extend({method:o("tools/call"),params:mF}),cO=Tv.extend({method:o("notifications/tools/list_changed"),params:Dv.optional()}),qQ=h({autoRefresh:p$().default(!0),debounceMs:L$().int().nonnegative().default(300)}),KW=gv(["debug","info","notice","warning","error","critical","alert","emergency"]),EF=Nv.extend({level:KW}),cF=zv.extend({method:o("logging/setLevel"),params:EF}),iF=Dv.extend({level:KW,logger:S().optional(),data:Q$()}),iO=Tv.extend({method:o("notifications/message"),params:iF}),lF=h({name:S().optional()}),hF=h({hints:O$(lF).optional(),costPriority:L$().min(0).max(1).optional(),speedPriority:L$().min(0).max(1).optional(),intelligencePriority:L$().min(0).max(1).optional()}),xF=h({mode:gv(["auto","required","none"]).optional()}),pF=h({type:o("tool_result"),toolUseId:S().describe("The unique identifier for the corresponding tool call."),content:O$(bU).default([]),structuredContent:h({}).loose().optional(),isError:p$().optional(),_meta:r$(S(),Q$()).optional()}),oF=Og("type",[jO,VO,CO]),O0=Og("type",[jO,VO,CO,DF,pF]),nF=h({role:Ag,content:w$([O0,O$(O0)]),_meta:r$(S(),Q$()).optional()}),tF=Bg.extend({messages:O$(nF),modelPreferences:hF.optional(),systemPrompt:S().optional(),includeContext:gv(["none","thisServer","allServers"]).optional(),temperature:L$().optional(),maxTokens:L$().int(),stopSequences:O$(S()).optional(),metadata:_v.optional(),tools:O$(A0).optional(),toolChoice:xF.optional()}),dF=zv.extend({method:o("sampling/createMessage"),params:tF}),aF=bv.extend({model:S(),stopReason:R$(gv(["endTurn","stopSequence","maxTokens"]).or(S())),role:Ag,content:oF}),sF=bv.extend({model:S(),stopReason:R$(gv(["endTurn","stopSequence","maxTokens","toolUse"]).or(S())),role:Ag,content:w$([O0,O$(O0)])}),eF=h({type:o("boolean"),title:S().optional(),description:S().optional(),default:p$().optional()}),$Y=h({type:o("string"),title:S().optional(),description:S().optional(),minLength:L$().optional(),maxLength:L$().optional(),format:gv(["email","uri","date","date-time"]).optional(),default:S().optional()}),vY=h({type:gv(["number","integer"]),title:S().optional(),description:S().optional(),minimum:L$().optional(),maximum:L$().optional(),default:L$().optional()}),UY=h({type:o("string"),title:S().optional(),description:S().optional(),enum:O$(S()),default:S().optional()}),gY=h({type:o("string"),title:S().optional(),description:S().optional(),oneOf:O$(h({const:S(),title:S()})),default:S().optional()}),_Y=h({type:o("string"),title:S().optional(),description:S().optional(),enum:O$(S()),enumNames:O$(S()).optional(),default:S().optional()}),zY=w$([UY,gY]),bY=h({type:o("array"),title:S().optional(),description:S().optional(),minItems:L$().optional(),maxItems:L$().optional(),items:h({type:o("string"),enum:O$(S())}),default:O$(S()).optional()}),JY=h({type:o("array"),title:S().optional(),description:S().optional(),minItems:L$().optional(),maxItems:L$().optional(),items:h({anyOf:O$(h({const:S(),title:S()}))}),default:O$(S()).optional()}),OY=w$([bY,JY]),GY=w$([_Y,zY,OY]),KY=w$([GY,eF,$Y,vY]),WY=Bg.extend({mode:o("form").optional(),message:S(),requestedSchema:h({type:o("object"),properties:r$(S(),KY),required:O$(S()).optional()})}),BY=Bg.extend({mode:o("url"),message:S(),elicitationId:S(),url:S().url()}),PY=w$([WY,BY]),kY=zv.extend({method:o("elicitation/create"),params:PY}),IY=Dv.extend({elicitationId:S()}),HY=Tv.extend({method:o("notifications/elicitation/complete"),params:IY}),LY=bv.extend({action:gv(["accept","decline","cancel"]),content:Wg(($)=>$===null?void 0:$,r$(S(),w$([S(),L$(),p$(),O$(S())])).optional())}),FY=h({type:o("ref/resource"),uri:S()});var YY=h({type:o("ref/prompt"),name:S()}),AY=Nv.extend({ref:w$([YY,FY]),argument:h({name:S(),value:S()}),context:h({arguments:r$(S(),S()).optional()}).optional()}),qY=zv.extend({method:o("completion/complete"),params:AY});var XY=bv.extend({completion:Uv({values:O$(S()).max(100),total:R$(L$().int()),hasMore:R$(p$())})}),wY=h({uri:S().startsWith("file://"),name:S().optional(),_meta:r$(S(),Q$()).optional()}),ZY=zv.extend({method:o("roots/list"),params:Nv.optional()}),SY=bv.extend({roots:O$(wY)}),MY=Tv.extend({method:o("notifications/roots/list_changed"),params:Dv.optional()}),XQ=w$([j6,BF,qY,cF,yF,DO,QO,NO,RO,ZF,MF,Zg,wg,k0,H0,L0,Y0]),wQ=w$([W0,B0,IF,MY,Yg]),ZQ=w$([K0,aF,sF,LY,SY,I0,F0,P0]),SQ=w$([j6,dF,kY,ZY,k0,H0,L0,Y0]),MQ=w$([W0,B0,iO,NF,yO,cO,EO,Yg,HY]),QQ=w$([K0,kF,XY,jF,TO,qg,rO,Xg,V6,fF,I0,F0,P0]);class H$ extends Error{constructor($,v,g){super(`MCP error ${$}: ${v}`);this.code=$,this.data=g,this.name="McpError"}static fromError($,v,g){if($===X$.UrlElicitationRequired&&g){let _=g;if(_.elicitations)return new WW(_.elicitations,v)}return new H$($,v,g)}}class WW extends H${constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(X$.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function q0($){return!!$._zod}function X0($,v){if(q0($))return R4($,v);return $.safeParse(v)}function BW($){if(!$)return;let v;if(q0($))v=$._zod?.def?.shape;else v=$.shape;if(!v)return;if(typeof v==="function")try{return v()}catch{return}return v}function PW($){if(q0($)){let z=$._zod?.def;if(z){if(z.value!==void 0)return z.value;if(Array.isArray(z.values)&&z.values.length>0)return z.values[0]}}let g=$._def;if(g){if(g.value!==void 0)return g.value;if(Array.isArray(g.values)&&g.values.length>0)return g.values[0]}let _=$.value;if(_!==void 0)return _;return}function C6($){return $==="completed"||$==="failed"||$==="cancelled"}var QY=Symbol("Let zodToJsonSchema decide on which parser to use");var WN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function lO($){let g=BW($)?.method;if(!g)throw Error("Schema is missing a method literal");let _=PW(g);if(typeof _!=="string")throw Error("Schema method literal must be a string");return _}function hO($,v){let g=X0($,v);if(!g.success)throw g.error;return g.data}var DY=60000;class Mg{constructor($){if(this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(W0,(v)=>{this._oncancel(v)}),this.setNotificationHandler(B0,(v)=>{this._onprogress(v)}),this.setRequestHandler(j6,(v)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(k0,async(v,g)=>{let _=await this._taskStore.getTask(v.params.taskId,g.sessionId);if(!_)throw new H$(X$.InvalidParams,"Failed to retrieve task: Task not found");return{..._}}),this.setRequestHandler(H0,async(v,g)=>{let _=async()=>{let U=v.params.taskId;if(this._taskMessageQueue){let b;while(b=await this._taskMessageQueue.dequeue(U,g.sessionId)){if(b.type==="response"||b.type==="error"){let J=b.message,G=J.id,K=this._requestResolvers.get(G);if(K)if(this._requestResolvers.delete(G),b.type==="response")K(J);else{let W=J,B=new H$(W.error.code,W.error.message,W.error.data);K(B)}else{let W=b.type==="response"?"Response":"Error";this._onerror(Error(`${W} handler missing for request ${G}`))}continue}await this._transport?.send(b.message,{relatedRequestId:g.requestId})}}let z=await this._taskStore.getTask(U,g.sessionId);if(!z)throw new H$(X$.InvalidParams,`Task not found: ${U}`);if(!C6(z.status))return await this._waitForTaskUpdate(U,g.signal),await _();if(C6(z.status)){let b=await this._taskStore.getTaskResult(U,g.sessionId);return this._clearTaskQueue(U),{...b,_meta:{...b._meta,[T6]:{taskId:U}}}}return await _()};return await _()}),this.setRequestHandler(L0,async(v,g)=>{try{let{tasks:_,nextCursor:U}=await this._taskStore.listTasks(v.params?.cursor,g.sessionId);return{tasks:_,nextCursor:U,_meta:{}}}catch(_){throw new H$(X$.InvalidParams,`Failed to list tasks: ${_ instanceof Error?_.message:String(_)}`)}}),this.setRequestHandler(Y0,async(v,g)=>{try{let _=await this._taskStore.getTask(v.params.taskId,g.sessionId);if(!_)throw new H$(X$.InvalidParams,`Task not found: ${v.params.taskId}`);if(C6(_.status))throw new H$(X$.InvalidParams,`Cannot cancel task in terminal status: ${_.status}`);await this._taskStore.updateTaskStatus(v.params.taskId,"cancelled","Client cancelled task execution.",g.sessionId),this._clearTaskQueue(v.params.taskId);let U=await this._taskStore.getTask(v.params.taskId,g.sessionId);if(!U)throw new H$(X$.InvalidParams,`Task not found after cancellation: ${v.params.taskId}`);return{_meta:{},...U}}catch(_){if(_ instanceof H$)throw _;throw new H$(X$.InvalidRequest,`Failed to cancel task: ${_ instanceof Error?_.message:String(_)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,v,g,_,U=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(_,v),startTime:Date.now(),timeout:v,maxTotalTimeout:g,resetTimeoutOnProgress:U,onTimeout:_})}_resetTimeout($){let v=this._timeoutInfo.get($);if(!v)return!1;let g=Date.now()-v.startTime;if(v.maxTotalTimeout&&g>=v.maxTotalTimeout)throw this._timeoutInfo.delete($),H$.fromError(X$.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:g});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout($){let v=this._timeoutInfo.get($);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete($)}async connect($){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=$;let v=this.transport?.onclose;this._transport.onclose=()=>{v?.(),this._onclose()};let g=this.transport?.onerror;this._transport.onerror=(U)=>{g?.(U),this._onerror(U)};let _=this._transport?.onmessage;this._transport.onmessage=(U,z)=>{if(_?.(U,z),Pg(U)||gW(U))this._onresponse(U);else if(wO(U))this._onrequest(U,z);else if(UW(U))this._onnotification(U);else this._onerror(Error(`Unknown message type: ${JSON.stringify(U)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();for(let g of this._requestHandlerAbortControllers.values())g.abort();this._requestHandlerAbortControllers.clear();let v=H$.fromError(X$.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let g of $.values())g(v)}_onerror($){this.onerror?.($)}_onnotification($){let v=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(v===void 0)return;Promise.resolve().then(()=>v($)).catch((g)=>this._onerror(Error(`Uncaught error in notification handler: ${g}`)))}_onrequest($,v){let g=this._requestHandlers.get($.method)??this.fallbackRequestHandler,_=this._transport,U=$.params?._meta?.[T6]?.taskId;if(g===void 0){let K={jsonrpc:"2.0",id:$.id,error:{code:X$.MethodNotFound,message:"Method not found"}};if(U&&this._taskMessageQueue)this._enqueueTaskMessage(U,{type:"error",message:K,timestamp:Date.now()},_?.sessionId).catch((W)=>this._onerror(Error(`Failed to enqueue error response: ${W}`)));else _?.send(K).catch((W)=>this._onerror(Error(`Failed to send an error response: ${W}`)));return}let z=new AbortController;this._requestHandlerAbortControllers.set($.id,z);let b=e7($.params)?$.params.task:void 0,J=this._taskStore?this.requestTaskStore($,_?.sessionId):void 0,G={signal:z.signal,sessionId:_?.sessionId,_meta:$.params?._meta,sendNotification:async(K)=>{if(z.signal.aborted)return;let W={relatedRequestId:$.id};if(U)W.relatedTask={taskId:U};await this.notification(K,W)},sendRequest:async(K,W,B)=>{if(z.signal.aborted)throw new H$(X$.ConnectionClosed,"Request was cancelled");let k={...B,relatedRequestId:$.id};if(U&&!k.relatedTask)k.relatedTask={taskId:U};let P=k.relatedTask?.taskId??U;if(P&&J)await J.updateTaskStatus(P,"input_required");return await this.request(K,W,k)},authInfo:v?.authInfo,requestId:$.id,requestInfo:v?.requestInfo,taskId:U,taskStore:J,taskRequestedTtl:b?.ttl,closeSSEStream:v?.closeSSEStream,closeStandaloneSSEStream:v?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(b)this.assertTaskHandlerCapability($.method)}).then(()=>g($,G)).then(async(K)=>{if(z.signal.aborted)return;let W={result:K,jsonrpc:"2.0",id:$.id};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"response",message:W,timestamp:Date.now()},_?.sessionId);else await _?.send(W)},async(K)=>{if(z.signal.aborted)return;let W={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(K.code)?K.code:X$.InternalError,message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"error",message:W,timestamp:Date.now()},_?.sessionId);else await _?.send(W)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{if(this._requestHandlerAbortControllers.get($.id)===z)this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...g}=$.params,_=Number(v),U=this._progressHandlers.get(_);if(!U){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let z=this._responseHandlers.get(_),b=this._timeoutInfo.get(_);if(b&&z&&b.resetTimeoutOnProgress)try{this._resetTimeout(_)}catch(J){this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),z(J);return}U(g)}_onresponse($){let v=Number($.id),g=this._requestResolvers.get(v);if(g){if(this._requestResolvers.delete(v),Pg($))g($);else{let z=new H$($.error.code,$.error.message,$.error.data);g(z)}return}let _=this._responseHandlers.get(v);if(_===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(v),this._cleanupTimeout(v);let U=!1;if(Pg($)&&$.result&&typeof $.result==="object"){let z=$.result;if(z.task&&typeof z.task==="object"){let b=z.task;if(typeof b.taskId==="string")U=!0,this._taskProgressTokens.set(b.taskId,v)}}if(!U)this._progressHandlers.delete(v);if(Pg($))_($);else{let z=H$.fromError($.error.code,$.error.message,$.error.data);_(z)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,v,g){let{task:_}=g??{};if(!_){try{yield{type:"result",result:await this.request($,v,g)}}catch(z){yield{type:"error",error:z instanceof H$?z:new H$(X$.InternalError,String(z))}}return}let U;try{let z=await this.request($,P0,g);if(z.task)U=z.task.taskId,yield{type:"taskCreated",task:z.task};else throw new H$(X$.InternalError,"Task creation did not return a task");while(!0){let b=await this.getTask({taskId:U},g);if(yield{type:"taskStatus",task:b},C6(b.status)){if(b.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:U},v,g)};else if(b.status==="failed")yield{type:"error",error:new H$(X$.InternalError,`Task ${U} failed`)};else if(b.status==="cancelled")yield{type:"error",error:new H$(X$.InternalError,`Task ${U} was cancelled`)};return}if(b.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:U},v,g)};return}let J=b.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((G)=>setTimeout(G,J)),g?.signal?.throwIfAborted()}}catch(z){yield{type:"error",error:z instanceof H$?z:new H$(X$.InternalError,String(z))}}}request($,v,g){let{relatedRequestId:_,resumptionToken:U,onresumptiontoken:z,task:b,relatedTask:J}=g??{};return new Promise((G,K)=>{let W=(F)=>{K(F)};if(!this._transport){W(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),b)this.assertTaskCapability($.method)}catch(F){W(F);return}g?.signal?.throwIfAborted();let B=this._requestMessageId++,k={...$,jsonrpc:"2.0",id:B};if(g?.onprogress)this._progressHandlers.set(B,g.onprogress),k.params={...$.params,_meta:{...$.params?._meta||{},progressToken:B}};if(b)k.params={...k.params,task:b};if(J)k.params={...k.params,_meta:{...k.params?._meta||{},[T6]:J}};let P=(F)=>{this._responseHandlers.delete(B),this._progressHandlers.delete(B),this._cleanupTimeout(B),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:B,reason:String(F)}},{relatedRequestId:_,resumptionToken:U,onresumptiontoken:z}).catch((X)=>this._onerror(Error(`Failed to send cancellation: ${X}`)));let Y=F instanceof H$?F:new H$(X$.RequestTimeout,String(F));K(Y)};this._responseHandlers.set(B,(F)=>{if(g?.signal?.aborted)return;if(F instanceof Error)return K(F);try{let Y=X0(v,F.result);if(!Y.success)K(Y.error);else G(Y.data)}catch(Y){K(Y)}}),g?.signal?.addEventListener("abort",()=>{P(g?.signal?.reason)});let A=g?.timeout??DY,H=()=>P(H$.fromError(X$.RequestTimeout,"Request timed out",{timeout:A}));this._setupTimeout(B,A,g?.maxTotalTimeout,H,g?.resetTimeoutOnProgress??!1);let I=J?.taskId;if(I){let F=(Y)=>{let X=this._responseHandlers.get(B);if(X)X(Y);else this._onerror(Error(`Response handler missing for side-channeled request ${B}`))};this._requestResolvers.set(B,F),this._enqueueTaskMessage(I,{type:"request",message:k,timestamp:Date.now()}).catch((Y)=>{this._cleanupTimeout(B),K(Y)})}else this._transport.send(k,{relatedRequestId:_,resumptionToken:U,onresumptiontoken:z}).catch((F)=>{this._cleanupTimeout(B),K(F)})})}async getTask($,v){return this.request({method:"tasks/get",params:$},I0,v)}async getTaskResult($,v,g){return this.request({method:"tasks/result",params:$},v,g)}async listTasks($,v){return this.request({method:"tasks/list",params:$},F0,v)}async cancelTask($,v){return this.request({method:"tasks/cancel",params:$},zW,v)}async notification($,v){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let g=v?.relatedTask?.taskId;if(g){let b={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[T6]:v.relatedTask}}};await this._enqueueTaskMessage(g,{type:"notification",message:b,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!v?.relatedRequestId&&!v?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let b={...$,jsonrpc:"2.0"};if(v?.relatedTask)b={...b,params:{...b.params,_meta:{...b.params?._meta||{},[T6]:v.relatedTask}}};this._transport?.send(b,v).catch((J)=>this._onerror(J))});return}let z={...$,jsonrpc:"2.0"};if(v?.relatedTask)z={...z,params:{...z.params,_meta:{...z.params?._meta||{},[T6]:v.relatedTask}}};await this._transport.send(z,v)}setRequestHandler($,v){let g=lO($);this.assertRequestHandlerCapability(g),this._requestHandlers.set(g,(_,U)=>{let z=hO($,_);return Promise.resolve(v(z,U))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,v){let g=lO($);this._notificationHandlers.set(g,(_)=>{let U=hO($,_);return Promise.resolve(v(U))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let v=this._taskProgressTokens.get($);if(v!==void 0)this._progressHandlers.delete(v),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,v,g){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let _=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,v,g,_)}async _clearTaskQueue($,v){if(this._taskMessageQueue){let g=await this._taskMessageQueue.dequeueAll($,v);for(let _ of g)if(_.type==="request"&&wO(_.message)){let U=_.message.id,z=this._requestResolvers.get(U);if(z)z(new H$(X$.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(U);else this._onerror(Error(`Resolver missing for request ${U} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,v){let g=this._options?.defaultTaskPollInterval??1000;try{let _=await this._taskStore?.getTask($);if(_?.pollInterval)g=_.pollInterval}catch{}return new Promise((_,U)=>{if(v.aborted){U(new H$(X$.InvalidRequest,"Request cancelled"));return}let z=setTimeout(_,g);v.addEventListener("abort",()=>{clearTimeout(z),U(new H$(X$.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,v){let g=this._taskStore;if(!g)throw Error("No task store configured");return{createTask:async(_)=>{if(!$)throw Error("No request provided");return await g.createTask(_,$.id,{method:$.method,params:$.params},v)},getTask:async(_)=>{let U=await g.getTask(_,v);if(!U)throw new H$(X$.InvalidParams,"Failed to retrieve task: Task not found");return U},storeTaskResult:async(_,U,z)=>{await g.storeTaskResult(_,U,z,v);let b=await g.getTask(_,v);if(b){let J=Yg.parse({method:"notifications/tasks/status",params:b});if(await this.notification(J),C6(b.status))this._cleanupTaskProgressHandler(_)}},getTaskResult:(_)=>{return g.getTaskResult(_,v)},updateTaskStatus:async(_,U,z)=>{let b=await g.getTask(_,v);if(!b)throw new H$(X$.InvalidParams,`Task "${_}" not found - it may have been cleaned up`);if(C6(b.status))throw new H$(X$.InvalidParams,`Cannot update task "${_}" from terminal status "${b.status}" to "${U}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await g.updateTaskStatus(_,U,z,v);let J=await g.getTask(_,v);if(J){let G=Yg.parse({method:"notifications/tasks/status",params:J});if(await this.notification(G),C6(J.status))this._cleanupTaskProgressHandler(_)}},listTasks:(_)=>{return g.listTasks(_,v)}}}}var xO="2026-01-26";var TY="ui/notifications/tool-input-partial";var jY=L.union([L.literal("light"),L.literal("dark")]).describe("Color theme preference for the host environment."),Qg=L.union([L.literal("inline"),L.literal("fullscreen"),L.literal("pip")]).describe("Display mode for UI presentation."),VY=L.union([L.literal("--color-background-primary"),L.literal("--color-background-secondary"),L.literal("--color-background-tertiary"),L.literal("--color-background-inverse"),L.literal("--color-background-ghost"),L.literal("--color-background-info"),L.literal("--color-background-danger"),L.literal("--color-background-success"),L.literal("--color-background-warning"),L.literal("--color-background-disabled"),L.literal("--color-text-primary"),L.literal("--color-text-secondary"),L.literal("--color-text-tertiary"),L.literal("--color-text-inverse"),L.literal("--color-text-ghost"),L.literal("--color-text-info"),L.literal("--color-text-danger"),L.literal("--color-text-success"),L.literal("--color-text-warning"),L.literal("--color-text-disabled"),L.literal("--color-border-primary"),L.literal("--color-border-secondary"),L.literal("--color-border-tertiary"),L.literal("--color-border-inverse"),L.literal("--color-border-ghost"),L.literal("--color-border-info"),L.literal("--color-border-danger"),L.literal("--color-border-success"),L.literal("--color-border-warning"),L.literal("--color-border-disabled"),L.literal("--color-ring-primary"),L.literal("--color-ring-secondary"),L.literal("--color-ring-inverse"),L.literal("--color-ring-info"),L.literal("--color-ring-danger"),L.literal("--color-ring-success"),L.literal("--color-ring-warning"),L.literal("--font-sans"),L.literal("--font-mono"),L.literal("--font-weight-normal"),L.literal("--font-weight-medium"),L.literal("--font-weight-semibold"),L.literal("--font-weight-bold"),L.literal("--font-text-xs-size"),L.literal("--font-text-sm-size"),L.literal("--font-text-md-size"),L.literal("--font-text-lg-size"),L.literal("--font-heading-xs-size"),L.literal("--font-heading-sm-size"),L.literal("--font-heading-md-size"),L.literal("--font-heading-lg-size"),L.literal("--font-heading-xl-size"),L.literal("--font-heading-2xl-size"),L.literal("--font-heading-3xl-size"),L.literal("--font-text-xs-line-height"),L.literal("--font-text-sm-line-height"),L.literal("--font-text-md-line-height"),L.literal("--font-text-lg-line-height"),L.literal("--font-heading-xs-line-height"),L.literal("--font-heading-sm-line-height"),L.literal("--font-heading-md-line-height"),L.literal("--font-heading-lg-line-height"),L.literal("--font-heading-xl-line-height"),L.literal("--font-heading-2xl-line-height"),L.literal("--font-heading-3xl-line-height"),L.literal("--border-radius-xs"),L.literal("--border-radius-sm"),L.literal("--border-radius-md"),L.literal("--border-radius-lg"),L.literal("--border-radius-xl"),L.literal("--border-radius-full"),L.literal("--border-width-regular"),L.literal("--shadow-hairline"),L.literal("--shadow-sm"),L.literal("--shadow-md"),L.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),CY=L.record(VY.describe(`Style variables for theming MCP apps.
146
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let J of $.seen.entries()){let b=J[1];if(v===J[0]){z(J);continue}if($.external){let K=$.external.registry.get(J[0])?.id;if(v!==J[0]&&K){z(J);continue}}if($.metadataRegistry.get(J[0])?.id){z(J);continue}if(b.cycle){z(J);continue}if(b.count>1){if($.reused==="ref"){z(J);continue}}}}function j6($,v){let g=$.seen.get(v);if(!g)throw Error("Unprocessed schema. This is a bug in Zod.");let _=(J)=>{let b=$.seen.get(J);if(b.ref===null)return;let G=b.def??b.schema,K={...G},W=b.ref;if(b.ref=null,W){_(W);let k=$.seen.get(W),P=k.schema;if(P.$ref&&($.target==="draft-07"||$.target==="draft-04"||$.target==="openapi-3.0"))G.allOf=G.allOf??[],G.allOf.push(P);else Object.assign(G,P);if(Object.assign(G,K),J._zod.parent===W)for(let L in G){if(L==="$ref"||L==="allOf")continue;if(!(L in K))delete G[L]}if(P.$ref&&k.def)for(let L in G){if(L==="$ref"||L==="allOf")continue;if(L in k.def&&JSON.stringify(G[L])===JSON.stringify(k.def[L]))delete G[L]}}let B=J._zod.parent;if(B&&B!==W){_(B);let k=$.seen.get(B);if(k?.schema.$ref){if(G.$ref=k.schema.$ref,k.def)for(let P in G){if(P==="$ref"||P==="allOf")continue;if(P in k.def&&JSON.stringify(G[P])===JSON.stringify(k.def[P]))delete G[P]}}}$.override({zodSchema:J,jsonSchema:G,path:b.path??[]})};for(let J of[...$.seen.entries()].reverse())_(J[0]);let U={};if($.target==="draft-2020-12")U.$schema="https://json-schema.org/draft/2020-12/schema";else if($.target==="draft-07")U.$schema="http://json-schema.org/draft-07/schema#";else if($.target==="draft-04")U.$schema="http://json-schema.org/draft-04/schema#";else if($.target==="openapi-3.0");if($.external?.uri){let J=$.external.registry.get(v)?.id;if(!J)throw Error("Schema is missing an `id` property");U.$id=$.external.uri(J)}Object.assign(U,g.def??g.schema);let z=$.external?.defs??{};for(let J of $.seen.entries()){let b=J[1];if(b.def&&b.defId)z[b.defId]=b.def}if($.external);else if(Object.keys(z).length>0)if($.target==="draft-2020-12")U.$defs=z;else U.definitions=z;try{let J=JSON.parse(JSON.stringify(U));return Object.defineProperty(J,"~standard",{value:{...v["~standard"],jsonSchema:{input:e4(v,"input",$.processors),output:e4(v,"output",$.processors)}},enumerable:!1,writable:!1}),J}catch(J){throw Error("Error converting schema to JSON.")}}function Iv($,v){let g=v??{seen:new Set};if(g.seen.has($))return!1;g.seen.add($);let _=$._zod.def;if(_.type==="transform")return!0;if(_.type==="array")return Iv(_.element,g);if(_.type==="set")return Iv(_.valueType,g);if(_.type==="lazy")return Iv(_.getter(),g);if(_.type==="promise"||_.type==="optional"||_.type==="nonoptional"||_.type==="nullable"||_.type==="readonly"||_.type==="default"||_.type==="prefault")return Iv(_.innerType,g);if(_.type==="intersection")return Iv(_.left,g)||Iv(_.right,g);if(_.type==="record"||_.type==="map")return Iv(_.keyType,g)||Iv(_.valueType,g);if(_.type==="pipe")return Iv(_.in,g)||Iv(_.out,g);if(_.type==="object"){for(let U in _.shape)if(Iv(_.shape[U],g))return!0;return!1}if(_.type==="union"){for(let U of _.options)if(Iv(U,g))return!0;return!1}if(_.type==="tuple"){for(let U of _.items)if(Iv(U,g))return!0;if(_.rest&&Iv(_.rest,g))return!0;return!1}return!1}var c8=($,v={})=>(g)=>{let _=D6({...g,processors:v});return X$($,_),T6(_,$),j6(_,$)},e4=($,v,g={})=>(_)=>{let{libraryOptions:U,target:z}=_??{},J=D6({...U??{},target:z,io:v,processors:g});return X$($,J),T6(J,$),j6(J,$)};var nL={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},m8=($,v,g,_)=>{let U=g;U.type="string";let{minimum:z,maximum:J,format:b,patterns:G,contentEncoding:K}=$._zod.bag;if(typeof z==="number")U.minLength=z;if(typeof J==="number")U.maxLength=J;if(b){if(U.format=nL[b]??b,U.format==="")delete U.format;if(b==="time")delete U.format}if(K)U.contentEncoding=K;if(G&&G.size>0){let W=[...G];if(W.length===1)U.pattern=W[0].source;else if(W.length>1)U.allOf=[...W.map((B)=>({...v.target==="draft-07"||v.target==="draft-04"||v.target==="openapi-3.0"?{type:"string"}:{},pattern:B.source}))]}},i8=($,v,g,_)=>{let U=g,{minimum:z,maximum:J,format:b,multipleOf:G,exclusiveMaximum:K,exclusiveMinimum:W}=$._zod.bag;if(typeof b==="string"&&b.includes("int"))U.type="integer";else U.type="number";if(typeof W==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")U.minimum=W,U.exclusiveMinimum=!0;else U.exclusiveMinimum=W;if(typeof z==="number"){if(U.minimum=z,typeof W==="number"&&v.target!=="draft-04")if(W>=z)delete U.minimum;else delete U.exclusiveMinimum}if(typeof K==="number")if(v.target==="draft-04"||v.target==="openapi-3.0")U.maximum=K,U.exclusiveMaximum=!0;else U.exclusiveMaximum=K;if(typeof J==="number"){if(U.maximum=J,typeof K==="number"&&v.target!=="draft-04")if(K<=J)delete U.maximum;else delete U.exclusiveMaximum}if(typeof G==="number")U.multipleOf=G},l8=($,v,g,_)=>{g.type="boolean"},h8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},x8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},p8=($,v,g,_)=>{if(v.target==="openapi-3.0")g.type="string",g.nullable=!0,g.enum=[null];else g.type="null"},o8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},n8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},t8=($,v,g,_)=>{g.not={}},d8=($,v,g,_)=>{},a8=($,v,g,_)=>{},s8=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},e8=($,v,g,_)=>{let U=$._zod.def,z=jU(U.entries);if(z.every((J)=>typeof J==="number"))g.type="number";if(z.every((J)=>typeof J==="string"))g.type="string";g.enum=z},$9=($,v,g,_)=>{let U=$._zod.def,z=[];for(let J of U.values)if(J===void 0){if(v.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof J==="bigint")if(v.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else z.push(Number(J));else z.push(J);if(z.length===0);else if(z.length===1){let J=z[0];if(g.type=J===null?"null":typeof J,v.target==="draft-04"||v.target==="openapi-3.0")g.enum=[J];else g.const=J}else{if(z.every((J)=>typeof J==="number"))g.type="number";if(z.every((J)=>typeof J==="string"))g.type="string";if(z.every((J)=>typeof J==="boolean"))g.type="boolean";if(z.every((J)=>J===null))g.type="null";g.enum=z}},v9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},U9=($,v,g,_)=>{let U=g,z=$._zod.pattern;if(!z)throw Error("Pattern not found in template literal");U.type="string",U.pattern=z.source},g9=($,v,g,_)=>{let U=g,z={type:"string",format:"binary",contentEncoding:"binary"},{minimum:J,maximum:b,mime:G}=$._zod.bag;if(J!==void 0)z.minLength=J;if(b!==void 0)z.maxLength=b;if(G)if(G.length===1)z.contentMediaType=G[0],Object.assign(U,z);else Object.assign(U,z),U.anyOf=G.map((K)=>({contentMediaType:K}));else Object.assign(U,z)},_9=($,v,g,_)=>{g.type="boolean"},z9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},J9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},b9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},O9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},G9=($,v,g,_)=>{if(v.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},K9=($,v,g,_)=>{let U=g,z=$._zod.def,{minimum:J,maximum:b}=$._zod.bag;if(typeof J==="number")U.minItems=J;if(typeof b==="number")U.maxItems=b;U.type="array",U.items=X$(z.element,v,{..._,path:[..._.path,"items"]})},W9=($,v,g,_)=>{let U=g,z=$._zod.def;U.type="object",U.properties={};let J=z.shape;for(let K in J)U.properties[K]=X$(J[K],v,{..._,path:[..._.path,"properties",K]});let b=new Set(Object.keys(J)),G=new Set([...b].filter((K)=>{let W=z.shape[K]._zod;if(v.io==="input")return W.optin===void 0;else return W.optout===void 0}));if(G.size>0)U.required=Array.from(G);if(z.catchall?._zod.def.type==="never")U.additionalProperties=!1;else if(!z.catchall){if(v.io==="output")U.additionalProperties=!1}else if(z.catchall)U.additionalProperties=X$(z.catchall,v,{..._,path:[..._.path,"additionalProperties"]})},j1=($,v,g,_)=>{let U=$._zod.def,z=U.inclusive===!1,J=U.options.map((b,G)=>X$(b,v,{..._,path:[..._.path,z?"oneOf":"anyOf",G]}));if(z)g.oneOf=J;else g.anyOf=J},B9=($,v,g,_)=>{let U=$._zod.def,z=X$(U.left,v,{..._,path:[..._.path,"allOf",0]}),J=X$(U.right,v,{..._,path:[..._.path,"allOf",1]}),b=(K)=>("allOf"in K)&&Object.keys(K).length===1,G=[...b(z)?z.allOf:[z],...b(J)?J.allOf:[J]];g.allOf=G},P9=($,v,g,_)=>{let U=g,z=$._zod.def;U.type="array";let J=v.target==="draft-2020-12"?"prefixItems":"items",b=v.target==="draft-2020-12"?"items":v.target==="openapi-3.0"?"items":"additionalItems",G=z.items.map((k,P)=>X$(k,v,{..._,path:[..._.path,J,P]})),K=z.rest?X$(z.rest,v,{..._,path:[..._.path,b,...v.target==="openapi-3.0"?[z.items.length]:[]]}):null;if(v.target==="draft-2020-12"){if(U.prefixItems=G,K)U.items=K}else if(v.target==="openapi-3.0"){if(U.items={anyOf:G},K)U.items.anyOf.push(K);if(U.minItems=G.length,!K)U.maxItems=G.length}else if(U.items=G,K)U.additionalItems=K;let{minimum:W,maximum:B}=$._zod.bag;if(typeof W==="number")U.minItems=W;if(typeof B==="number")U.maxItems=B},k9=($,v,g,_)=>{let U=g,z=$._zod.def;U.type="object";let J=z.keyType,G=J._zod.bag?.patterns;if(z.mode==="loose"&&G&&G.size>0){let W=X$(z.valueType,v,{..._,path:[..._.path,"patternProperties","*"]});U.patternProperties={};for(let B of G)U.patternProperties[B.source]=W}else{if(v.target==="draft-07"||v.target==="draft-2020-12")U.propertyNames=X$(z.keyType,v,{..._,path:[..._.path,"propertyNames"]});U.additionalProperties=X$(z.valueType,v,{..._,path:[..._.path,"additionalProperties"]})}let K=J._zod.values;if(K){let W=[...K].filter((B)=>typeof B==="string"||typeof B==="number");if(W.length>0)U.required=W}},H9=($,v,g,_)=>{let U=$._zod.def,z=X$(U.innerType,v,_),J=v.seen.get($);if(v.target==="openapi-3.0")J.ref=U.innerType,g.nullable=!0;else g.anyOf=[z,{type:"null"}]},I9=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType},L9=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType,g.default=JSON.parse(JSON.stringify(U.defaultValue))},F9=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);if(z.ref=U.innerType,v.io==="input")g._prefault=JSON.parse(JSON.stringify(U.defaultValue))},Y9=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType;let J;try{J=U.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}g.default=J},q9=($,v,g,_)=>{let U=$._zod.def,z=v.io==="input"?U.in._zod.def.type==="transform"?U.out:U.in:U.out;X$(z,v,_);let J=v.seen.get($);J.ref=z},X9=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType,g.readOnly=!0},A9=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType},V1=($,v,g,_)=>{let U=$._zod.def;X$(U.innerType,v,_);let z=v.seen.get($);z.ref=U.innerType},w9=($,v,g,_)=>{let U=$._zod.innerType;X$(U,v,_);let z=v.seen.get($);z.ref=U},T1={string:m8,number:i8,boolean:l8,bigint:h8,symbol:x8,null:p8,undefined:o8,void:n8,never:t8,any:d8,unknown:a8,date:s8,enum:e8,literal:$9,nan:v9,template_literal:U9,file:g9,success:_9,custom:z9,function:J9,transform:b9,map:O9,set:G9,array:K9,object:W9,union:j1,intersection:B9,tuple:P9,record:k9,nullable:H9,nonoptional:I9,default:L9,prefault:F9,catch:Y9,pipe:q9,readonly:X9,promise:A9,optional:V1,lazy:w9};function C1($,v){if("_idmap"in $){let _=$,U=D6({...v,processors:T1}),z={};for(let G of _._idmap.entries()){let[K,W]=G;X$(W,U)}let J={},b={registry:_,uri:v?.uri,defs:z};U.external=b;for(let G of _._idmap.entries()){let[K,W]=G;T6(U,W),J[K]=j6(U,W)}if(Object.keys(z).length>0){let G=U.target==="draft-2020-12"?"$defs":"definitions";J.__shared={[G]:z}}return{schemas:J}}let g=D6({...v,processors:T1});return X$($,g),T6(g,$),j6(g,$)}class Z9{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter($){this.ctx.counter=$}get seen(){return this.ctx.seen}constructor($){let v=$?.target??"draft-2020-12";if(v==="draft-4")v="draft-04";if(v==="draft-7")v="draft-07";this.ctx=D6({processors:T1,target:v,...$?.metadata&&{metadata:$.metadata},...$?.unrepresentable&&{unrepresentable:$.unrepresentable},...$?.override&&{override:$.override},...$?.io&&{io:$.io}})}process($,v={path:[],schemaPath:[]}){return X$($,this.ctx,v)}emit($,v){if(v){if(v.cycles)this.ctx.cycles=v.cycles;if(v.reused)this.ctx.reused=v.reused;if(v.external)this.ctx.external=v.external}T6(this.ctx,$);let g=j6(this.ctx,$),{"~standard":_,...U}=g;return U}}var x5={};var zg={};v6(zg,{xor:()=>j7,xid:()=>J7,void:()=>y7,uuidv7:()=>s5,uuidv6:()=>a5,uuidv4:()=>d5,uuid:()=>t5,url:()=>e5,unknown:()=>Q$,union:()=>w$,undefined:()=>r7,ulid:()=>z7,uint64:()=>Q7,uint32:()=>Z7,tuple:()=>$O,transform:()=>G0,templateLiteral:()=>p7,symbol:()=>N7,superRefine:()=>MO,success:()=>l7,stringbool:()=>e7,stringFormat:()=>L7,string:()=>Z,strictObject:()=>T7,set:()=>E7,refine:()=>SO,record:()=>r$,readonly:()=>YO,promise:()=>o7,preprocess:()=>Ig,prefault:()=>BO,pipe:()=>Og,partialRecord:()=>V7,optional:()=>y$,object:()=>h,number:()=>I$,nullish:()=>i7,nullable:()=>bg,null:()=>JU,nonoptional:()=>PO,never:()=>O0,nativeEnum:()=>c7,nanoid:()=>U7,nan:()=>h7,meta:()=>a7,map:()=>f7,mac:()=>G7,looseRecord:()=>C7,looseObject:()=>vv,literal:()=>o,lazy:()=>AO,ksuid:()=>b7,keyof:()=>D7,jwt:()=>I7,json:()=>$W,ipv6:()=>K7,ipv4:()=>O7,intersection:()=>bU,int64:()=>M7,int32:()=>w7,int:()=>l1,instanceof:()=>s7,httpUrl:()=>$7,hostname:()=>F7,hex:()=>Y7,hash:()=>q7,guid:()=>n5,function:()=>n7,float64:()=>A7,float32:()=>X7,file:()=>m7,exactOptional:()=>bO,enum:()=>Uv,emoji:()=>v7,email:()=>o5,e164:()=>H7,discriminatedUnion:()=>Pg,describe:()=>d7,date:()=>R7,custom:()=>k0,cuid2:()=>_7,cuid:()=>g7,codec:()=>x7,cidrv6:()=>B7,cidrv4:()=>W7,check:()=>t7,catch:()=>IO,boolean:()=>p$,bigint:()=>S7,base64url:()=>k7,base64:()=>P7,array:()=>O$,any:()=>u7,_function:()=>n7,_default:()=>KO,_ZodString:()=>h1,ZodXor:()=>d9,ZodXID:()=>a1,ZodVoid:()=>n9,ZodUnknown:()=>p9,ZodUnion:()=>Bg,ZodUndefined:()=>l9,ZodUUID:()=>sv,ZodURL:()=>Gg,ZodULID:()=>d1,ZodType:()=>_$,ZodTuple:()=>e9,ZodTransform:()=>zO,ZodTemplateLiteral:()=>qO,ZodSymbol:()=>i9,ZodSuccess:()=>kO,ZodStringFormat:()=>M$,ZodString:()=>vU,ZodSet:()=>UO,ZodRecord:()=>kg,ZodReadonly:()=>FO,ZodPromise:()=>wO,ZodPrefault:()=>WO,ZodPipe:()=>B0,ZodOptional:()=>K0,ZodObject:()=>Wg,ZodNumberFormat:()=>_4,ZodNumber:()=>gU,ZodNullable:()=>OO,ZodNull:()=>h9,ZodNonOptional:()=>W0,ZodNever:()=>o9,ZodNanoID:()=>o1,ZodNaN:()=>LO,ZodMap:()=>vO,ZodMAC:()=>m9,ZodLiteral:()=>gO,ZodLazy:()=>XO,ZodKSUID:()=>s1,ZodJWT:()=>J0,ZodIntersection:()=>s9,ZodIPv6:()=>$0,ZodIPv4:()=>e1,ZodGUID:()=>Jg,ZodFunction:()=>ZO,ZodFile:()=>_O,ZodExactOptional:()=>JO,ZodEnum:()=>$U,ZodEmoji:()=>p1,ZodEmail:()=>x1,ZodE164:()=>z0,ZodDiscriminatedUnion:()=>a9,ZodDefault:()=>GO,ZodDate:()=>Kg,ZodCustomStringFormat:()=>UU,ZodCustom:()=>Hg,ZodCodec:()=>P0,ZodCatch:()=>HO,ZodCUID2:()=>t1,ZodCUID:()=>n1,ZodCIDRv6:()=>U0,ZodCIDRv4:()=>v0,ZodBoolean:()=>_U,ZodBigIntFormat:()=>b0,ZodBigInt:()=>zU,ZodBase64URL:()=>_0,ZodBase64:()=>g0,ZodArray:()=>t9,ZodAny:()=>x9});var f1={};v6(f1,{uppercase:()=>i4,trim:()=>n4,toUpperCase:()=>d4,toLowerCase:()=>t4,startsWith:()=>h4,slugify:()=>a4,size:()=>v4,regex:()=>c4,property:()=>D1,positive:()=>r1,overwrite:()=>iv,normalize:()=>o4,nonpositive:()=>y1,nonnegative:()=>R1,negative:()=>u1,multipleOf:()=>y6,minSize:()=>av,minLength:()=>K6,mime:()=>p4,maxSize:()=>R6,maxLength:()=>U4,lte:()=>Nv,lt:()=>tv,lowercase:()=>m4,length:()=>g4,includes:()=>l4,gte:()=>Hv,gt:()=>dv,endsWith:()=>x4});var V6={};v6(V6,{time:()=>Q9,duration:()=>N9,datetime:()=>S9,date:()=>M9,ZodISOTime:()=>m1,ZodISODuration:()=>i1,ZodISODateTime:()=>E1,ZodISODate:()=>c1});var E1=X("ZodISODateTime",($,v)=>{OJ.init($,v),M$.init($,v)});function S9($){return z8(E1,$)}var c1=X("ZodISODate",($,v)=>{GJ.init($,v),M$.init($,v)});function M9($){return J8(c1,$)}var m1=X("ZodISOTime",($,v)=>{KJ.init($,v),M$.init($,v)});function Q9($){return b8(m1,$)}var i1=X("ZodISODuration",($,v)=>{WJ.init($,v),M$.init($,v)});function N9($){return O8(i1,$)}var p5=($,v)=>{cU.init($,v),$.name="ZodError",Object.defineProperties($,{format:{value:(g)=>iU($,g)},flatten:{value:(g)=>mU($,g)},addIssue:{value:(g)=>{$.issues.push(g),$.message=JSON.stringify($.issues,u4,2)}},addIssues:{value:(g)=>{$.issues.push(...g),$.message=JSON.stringify($.issues,u4,2)}},isEmpty:{get(){return $.issues.length===0}}})},dL=X("ZodError",p5),Av=X("ZodError",p5,{Parent:Error});var r9=D4(Av),u9=T4(Av),y9=j4(Av),R9=C4(Av),D9=m_(Av),T9=i_(Av),j9=l_(Av),V9=h_(Av),C9=x_(Av),f9=p_(Av),E9=o_(Av),c9=n_(Av);var _$=X("ZodType",($,v)=>{return v$.init($,v),Object.assign($["~standard"],{jsonSchema:{input:e4($,"input"),output:e4($,"output")}}),$.toJSONSchema=c8($,{}),$.def=v,$.type=v.type,Object.defineProperty($,"_def",{value:v}),$.check=(...g)=>{return $.clone(j.mergeDefs(v,{checks:[...v.checks??[],...g.map((_)=>typeof _==="function"?{_zod:{check:_,def:{check:"custom"},onattach:[]}}:_)]}),{parent:!0})},$.with=$.check,$.clone=(g,_)=>kv($,g,_),$.brand=()=>$,$.register=(g,_)=>{return g.add($,_),$},$.parse=(g,_)=>r9($,g,_,{callee:$.parse}),$.safeParse=(g,_)=>y9($,g,_),$.parseAsync=async(g,_)=>u9($,g,_,{callee:$.parseAsync}),$.safeParseAsync=async(g,_)=>R9($,g,_),$.spa=$.safeParseAsync,$.encode=(g,_)=>D9($,g,_),$.decode=(g,_)=>T9($,g,_),$.encodeAsync=async(g,_)=>j9($,g,_),$.decodeAsync=async(g,_)=>V9($,g,_),$.safeEncode=(g,_)=>C9($,g,_),$.safeDecode=(g,_)=>f9($,g,_),$.safeEncodeAsync=async(g,_)=>E9($,g,_),$.safeDecodeAsync=async(g,_)=>c9($,g,_),$.refine=(g,_)=>$.check(SO(g,_)),$.superRefine=(g)=>$.check(MO(g)),$.overwrite=(g)=>$.check(iv(g)),$.optional=()=>y$($),$.exactOptional=()=>bO($),$.nullable=()=>bg($),$.nullish=()=>y$(bg($)),$.nonoptional=(g)=>PO($,g),$.array=()=>O$($),$.or=(g)=>w$([$,g]),$.and=(g)=>bU($,g),$.transform=(g)=>Og($,G0(g)),$.default=(g)=>KO($,g),$.prefault=(g)=>BO($,g),$.catch=(g)=>IO($,g),$.pipe=(g)=>Og($,g),$.readonly=()=>YO($),$.describe=(g)=>{let _=$.clone();return $v.add(_,{description:g}),_},Object.defineProperty($,"description",{get(){return $v.get($)?.description},configurable:!0}),$.meta=(...g)=>{if(g.length===0)return $v.get($);let _=$.clone();return $v.add(_,g[0]),_},$.isOptional=()=>$.safeParse(void 0).success,$.isNullable=()=>$.safeParse(null).success,$.apply=(g)=>g($),$}),h1=X("_ZodString",($,v)=>{$4.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>m8($,_,U,z);let g=$._zod.bag;$.format=g.format??null,$.minLength=g.minimum??null,$.maxLength=g.maximum??null,$.regex=(..._)=>$.check(c4(..._)),$.includes=(..._)=>$.check(l4(..._)),$.startsWith=(..._)=>$.check(h4(..._)),$.endsWith=(..._)=>$.check(x4(..._)),$.min=(..._)=>$.check(K6(..._)),$.max=(..._)=>$.check(U4(..._)),$.length=(..._)=>$.check(g4(..._)),$.nonempty=(..._)=>$.check(K6(1,..._)),$.lowercase=(_)=>$.check(m4(_)),$.uppercase=(_)=>$.check(i4(_)),$.trim=()=>$.check(n4()),$.normalize=(..._)=>$.check(o4(..._)),$.toLowerCase=()=>$.check(t4()),$.toUpperCase=()=>$.check(d4()),$.slugify=()=>$.check(a4())}),vU=X("ZodString",($,v)=>{$4.init($,v),h1.init($,v),$.email=(g)=>$.check(G1(x1,g)),$.url=(g)=>$.check(_g(Gg,g)),$.jwt=(g)=>$.check(N1(J0,g)),$.emoji=(g)=>$.check(k1(p1,g)),$.guid=(g)=>$.check(gg(Jg,g)),$.uuid=(g)=>$.check(K1(sv,g)),$.uuidv4=(g)=>$.check(W1(sv,g)),$.uuidv6=(g)=>$.check(B1(sv,g)),$.uuidv7=(g)=>$.check(P1(sv,g)),$.nanoid=(g)=>$.check(H1(o1,g)),$.guid=(g)=>$.check(gg(Jg,g)),$.cuid=(g)=>$.check(I1(n1,g)),$.cuid2=(g)=>$.check(L1(t1,g)),$.ulid=(g)=>$.check(F1(d1,g)),$.base64=(g)=>$.check(S1(g0,g)),$.base64url=(g)=>$.check(M1(_0,g)),$.xid=(g)=>$.check(Y1(a1,g)),$.ksuid=(g)=>$.check(q1(s1,g)),$.ipv4=(g)=>$.check(X1(e1,g)),$.ipv6=(g)=>$.check(A1($0,g)),$.cidrv4=(g)=>$.check(w1(v0,g)),$.cidrv6=(g)=>$.check(Z1(U0,g)),$.e164=(g)=>$.check(Q1(z0,g)),$.datetime=(g)=>$.check(S9(g)),$.date=(g)=>$.check(M9(g)),$.time=(g)=>$.check(Q9(g)),$.duration=(g)=>$.check(N9(g))});function Z($){return v8(vU,$)}var M$=X("ZodStringFormat",($,v)=>{S$.init($,v),h1.init($,v)}),x1=X("ZodEmail",($,v)=>{ez.init($,v),M$.init($,v)});function o5($){return G1(x1,$)}var Jg=X("ZodGUID",($,v)=>{az.init($,v),M$.init($,v)});function n5($){return gg(Jg,$)}var sv=X("ZodUUID",($,v)=>{sz.init($,v),M$.init($,v)});function t5($){return K1(sv,$)}function d5($){return W1(sv,$)}function a5($){return B1(sv,$)}function s5($){return P1(sv,$)}var Gg=X("ZodURL",($,v)=>{$J.init($,v),M$.init($,v)});function e5($){return _g(Gg,$)}function $7($){return _g(Gg,{protocol:/^https?$/,hostname:jv.domain,...j.normalizeParams($)})}var p1=X("ZodEmoji",($,v)=>{vJ.init($,v),M$.init($,v)});function v7($){return k1(p1,$)}var o1=X("ZodNanoID",($,v)=>{UJ.init($,v),M$.init($,v)});function U7($){return H1(o1,$)}var n1=X("ZodCUID",($,v)=>{gJ.init($,v),M$.init($,v)});function g7($){return I1(n1,$)}var t1=X("ZodCUID2",($,v)=>{_J.init($,v),M$.init($,v)});function _7($){return L1(t1,$)}var d1=X("ZodULID",($,v)=>{zJ.init($,v),M$.init($,v)});function z7($){return F1(d1,$)}var a1=X("ZodXID",($,v)=>{JJ.init($,v),M$.init($,v)});function J7($){return Y1(a1,$)}var s1=X("ZodKSUID",($,v)=>{bJ.init($,v),M$.init($,v)});function b7($){return q1(s1,$)}var e1=X("ZodIPv4",($,v)=>{BJ.init($,v),M$.init($,v)});function O7($){return X1(e1,$)}var m9=X("ZodMAC",($,v)=>{kJ.init($,v),M$.init($,v)});function G7($){return g8(m9,$)}var $0=X("ZodIPv6",($,v)=>{PJ.init($,v),M$.init($,v)});function K7($){return A1($0,$)}var v0=X("ZodCIDRv4",($,v)=>{HJ.init($,v),M$.init($,v)});function W7($){return w1(v0,$)}var U0=X("ZodCIDRv6",($,v)=>{IJ.init($,v),M$.init($,v)});function B7($){return Z1(U0,$)}var g0=X("ZodBase64",($,v)=>{FJ.init($,v),M$.init($,v)});function P7($){return S1(g0,$)}var _0=X("ZodBase64URL",($,v)=>{YJ.init($,v),M$.init($,v)});function k7($){return M1(_0,$)}var z0=X("ZodE164",($,v)=>{qJ.init($,v),M$.init($,v)});function H7($){return Q1(z0,$)}var J0=X("ZodJWT",($,v)=>{XJ.init($,v),M$.init($,v)});function I7($){return N1(J0,$)}var UU=X("ZodCustomStringFormat",($,v)=>{AJ.init($,v),M$.init($,v)});function L7($,v,g={}){return s4(UU,$,v,g)}function F7($){return s4(UU,"hostname",jv.hostname,$)}function Y7($){return s4(UU,"hex",jv.hex,$)}function q7($,v){let g=v?.enc??"hex",_=`${$}_${g}`,U=jv[_];if(!U)throw Error(`Unrecognized hash format: ${_}`);return s4(UU,_,U,v)}var gU=X("ZodNumber",($,v)=>{_1.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>i8($,_,U,z),$.gt=(_,U)=>$.check(dv(_,U)),$.gte=(_,U)=>$.check(Hv(_,U)),$.min=(_,U)=>$.check(Hv(_,U)),$.lt=(_,U)=>$.check(tv(_,U)),$.lte=(_,U)=>$.check(Nv(_,U)),$.max=(_,U)=>$.check(Nv(_,U)),$.int=(_)=>$.check(l1(_)),$.safe=(_)=>$.check(l1(_)),$.positive=(_)=>$.check(dv(0,_)),$.nonnegative=(_)=>$.check(Hv(0,_)),$.negative=(_)=>$.check(tv(0,_)),$.nonpositive=(_)=>$.check(Nv(0,_)),$.multipleOf=(_,U)=>$.check(y6(_,U)),$.step=(_,U)=>$.check(y6(_,U)),$.finite=()=>$;let g=$._zod.bag;$.minValue=Math.max(g.minimum??Number.NEGATIVE_INFINITY,g.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,$.maxValue=Math.min(g.maximum??Number.POSITIVE_INFINITY,g.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,$.isInt=(g.format??"").includes("int")||Number.isSafeInteger(g.multipleOf??0.5),$.isFinite=!0,$.format=g.format??null});function I$($){return G8(gU,$)}var _4=X("ZodNumberFormat",($,v)=>{wJ.init($,v),gU.init($,v)});function l1($){return W8(_4,$)}function X7($){return B8(_4,$)}function A7($){return P8(_4,$)}function w7($){return k8(_4,$)}function Z7($){return H8(_4,$)}var _U=X("ZodBoolean",($,v)=>{tU.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>l8($,g,_,U)});function p$($){return I8(_U,$)}var zU=X("ZodBigInt",($,v)=>{z1.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>h8($,_,U,z),$.gte=(_,U)=>$.check(Hv(_,U)),$.min=(_,U)=>$.check(Hv(_,U)),$.gt=(_,U)=>$.check(dv(_,U)),$.gte=(_,U)=>$.check(Hv(_,U)),$.min=(_,U)=>$.check(Hv(_,U)),$.lt=(_,U)=>$.check(tv(_,U)),$.lte=(_,U)=>$.check(Nv(_,U)),$.max=(_,U)=>$.check(Nv(_,U)),$.positive=(_)=>$.check(dv(BigInt(0),_)),$.negative=(_)=>$.check(tv(BigInt(0),_)),$.nonpositive=(_)=>$.check(Nv(BigInt(0),_)),$.nonnegative=(_)=>$.check(Hv(BigInt(0),_)),$.multipleOf=(_,U)=>$.check(y6(_,U));let g=$._zod.bag;$.minValue=g.minimum??null,$.maxValue=g.maximum??null,$.format=g.format??null});function S7($){return F8(zU,$)}var b0=X("ZodBigIntFormat",($,v)=>{ZJ.init($,v),zU.init($,v)});function M7($){return q8(b0,$)}function Q7($){return X8(b0,$)}var i9=X("ZodSymbol",($,v)=>{SJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>x8($,g,_,U)});function N7($){return A8(i9,$)}var l9=X("ZodUndefined",($,v)=>{MJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>o8($,g,_,U)});function r7($){return w8(l9,$)}var h9=X("ZodNull",($,v)=>{QJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>p8($,g,_,U)});function JU($){return Z8(h9,$)}var x9=X("ZodAny",($,v)=>{NJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>d8($,g,_,U)});function u7(){return S8(x9)}var p9=X("ZodUnknown",($,v)=>{rJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>a8($,g,_,U)});function Q$(){return M8(p9)}var o9=X("ZodNever",($,v)=>{uJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>t8($,g,_,U)});function O0($){return Q8(o9,$)}var n9=X("ZodVoid",($,v)=>{yJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>n8($,g,_,U)});function y7($){return N8(n9,$)}var Kg=X("ZodDate",($,v)=>{RJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>s8($,_,U,z),$.min=(_,U)=>$.check(Hv(_,U)),$.max=(_,U)=>$.check(Nv(_,U));let g=$._zod.bag;$.minDate=g.minimum?new Date(g.minimum):null,$.maxDate=g.maximum?new Date(g.maximum):null});function R7($){return r8(Kg,$)}var t9=X("ZodArray",($,v)=>{DJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>K9($,g,_,U),$.element=v.element,$.min=(g,_)=>$.check(K6(g,_)),$.nonempty=(g)=>$.check(K6(1,g)),$.max=(g,_)=>$.check(U4(g,_)),$.length=(g,_)=>$.check(g4(g,_)),$.unwrap=()=>$.element});function O$($,v){return R8(t9,$,v)}function D7($){let v=$._zod.def.shape;return Uv(Object.keys(v))}var Wg=X("ZodObject",($,v)=>{TJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>W9($,g,_,U),j.defineLazy($,"shape",()=>{return v.shape}),$.keyof=()=>Uv(Object.keys($._zod.def.shape)),$.catchall=(g)=>$.clone({...$._zod.def,catchall:g}),$.passthrough=()=>$.clone({...$._zod.def,catchall:Q$()}),$.loose=()=>$.clone({...$._zod.def,catchall:Q$()}),$.strict=()=>$.clone({...$._zod.def,catchall:O0()}),$.strip=()=>$.clone({...$._zod.def,catchall:void 0}),$.extend=(g)=>{return j.extend($,g)},$.safeExtend=(g)=>{return j.safeExtend($,g)},$.merge=(g)=>j.merge($,g),$.pick=(g)=>j.pick($,g),$.omit=(g)=>j.omit($,g),$.partial=(...g)=>j.partial(K0,$,g[0]),$.required=(...g)=>j.required(W0,$,g[0])});function h($,v){let g={type:"object",shape:$??{},...j.normalizeParams(v)};return new Wg(g)}function T7($,v){return new Wg({type:"object",shape:$,catchall:O0(),...j.normalizeParams(v)})}function vv($,v){return new Wg({type:"object",shape:$,catchall:Q$(),...j.normalizeParams(v)})}var Bg=X("ZodUnion",($,v)=>{dU.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>j1($,g,_,U),$.options=v.options});function w$($,v){return new Bg({type:"union",options:$,...j.normalizeParams(v)})}var d9=X("ZodXor",($,v)=>{Bg.init($,v),jJ.init($,v),$._zod.processJSONSchema=(g,_,U)=>j1($,g,_,U),$.options=v.options});function j7($,v){return new d9({type:"union",options:$,inclusive:!1,...j.normalizeParams(v)})}var a9=X("ZodDiscriminatedUnion",($,v)=>{Bg.init($,v),VJ.init($,v)});function Pg($,v,g){return new a9({type:"union",options:v,discriminator:$,...j.normalizeParams(g)})}var s9=X("ZodIntersection",($,v)=>{CJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>B9($,g,_,U)});function bU($,v){return new s9({type:"intersection",left:$,right:v})}var e9=X("ZodTuple",($,v)=>{J1.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>P9($,g,_,U),$.rest=(g)=>$.clone({...$._zod.def,rest:g})});function $O($,v,g){let _=v instanceof v$,U=_?g:v;return new e9({type:"tuple",items:$,rest:_?v:null,...j.normalizeParams(U)})}var kg=X("ZodRecord",($,v)=>{fJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>k9($,g,_,U),$.keyType=v.keyType,$.valueType=v.valueType});function r$($,v,g){return new kg({type:"record",keyType:$,valueType:v,...j.normalizeParams(g)})}function V7($,v,g){let _=kv($);return _._zod.values=void 0,new kg({type:"record",keyType:_,valueType:v,...j.normalizeParams(g)})}function C7($,v,g){return new kg({type:"record",keyType:$,valueType:v,mode:"loose",...j.normalizeParams(g)})}var vO=X("ZodMap",($,v)=>{EJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>O9($,g,_,U),$.keyType=v.keyType,$.valueType=v.valueType,$.min=(...g)=>$.check(av(...g)),$.nonempty=(g)=>$.check(av(1,g)),$.max=(...g)=>$.check(R6(...g)),$.size=(...g)=>$.check(v4(...g))});function f7($,v,g){return new vO({type:"map",keyType:$,valueType:v,...j.normalizeParams(g)})}var UO=X("ZodSet",($,v)=>{cJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>G9($,g,_,U),$.min=(...g)=>$.check(av(...g)),$.nonempty=(g)=>$.check(av(1,g)),$.max=(...g)=>$.check(R6(...g)),$.size=(...g)=>$.check(v4(...g))});function E7($,v){return new UO({type:"set",valueType:$,...j.normalizeParams(v)})}var $U=X("ZodEnum",($,v)=>{mJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(_,U,z)=>e8($,_,U,z),$.enum=v.entries,$.options=Object.values(v.entries);let g=new Set(Object.keys(v.entries));$.extract=(_,U)=>{let z={};for(let J of _)if(g.has(J))z[J]=v.entries[J];else throw Error(`Key ${J} not found in enum`);return new $U({...v,checks:[],...j.normalizeParams(U),entries:z})},$.exclude=(_,U)=>{let z={...v.entries};for(let J of _)if(g.has(J))delete z[J];else throw Error(`Key ${J} not found in enum`);return new $U({...v,checks:[],...j.normalizeParams(U),entries:z})}});function Uv($,v){let g=Array.isArray($)?Object.fromEntries($.map((_)=>[_,_])):$;return new $U({type:"enum",entries:g,...j.normalizeParams(v)})}function c7($,v){return new $U({type:"enum",entries:$,...j.normalizeParams(v)})}var gO=X("ZodLiteral",($,v)=>{iJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>$9($,g,_,U),$.values=new Set(v.values),Object.defineProperty($,"value",{get(){if(v.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return v.values[0]}})});function o($,v){return new gO({type:"literal",values:Array.isArray($)?$:[$],...j.normalizeParams(v)})}var _O=X("ZodFile",($,v)=>{lJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>g9($,g,_,U),$.min=(g,_)=>$.check(av(g,_)),$.max=(g,_)=>$.check(R6(g,_)),$.mime=(g,_)=>$.check(p4(Array.isArray(g)?g:[g],_))});function m7($){return D8(_O,$)}var zO=X("ZodTransform",($,v)=>{hJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>b9($,g,_,U),$._zod.parse=(g,_)=>{if(_.direction==="backward")throw new a6($.constructor.name);g.addIssue=(z)=>{if(typeof z==="string")g.issues.push(j.issue(z,g.value,v));else{let J=z;if(J.fatal)J.continue=!1;J.code??(J.code="custom"),J.input??(J.input=g.value),J.inst??(J.inst=$),g.issues.push(j.issue(J))}};let U=v.transform(g.value,g);if(U instanceof Promise)return U.then((z)=>{return g.value=z,g});return g.value=U,g}});function G0($){return new zO({type:"transform",transform:$})}var K0=X("ZodOptional",($,v)=>{b1.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>V1($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function y$($){return new K0({type:"optional",innerType:$})}var JO=X("ZodExactOptional",($,v)=>{xJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>V1($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function bO($){return new JO({type:"optional",innerType:$})}var OO=X("ZodNullable",($,v)=>{pJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>H9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function bg($){return new OO({type:"nullable",innerType:$})}function i7($){return y$(bg($))}var GO=X("ZodDefault",($,v)=>{oJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>L9($,g,_,U),$.unwrap=()=>$._zod.def.innerType,$.removeDefault=$.unwrap});function KO($,v){return new GO({type:"default",innerType:$,get defaultValue(){return typeof v==="function"?v():j.shallowClone(v)}})}var WO=X("ZodPrefault",($,v)=>{nJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>F9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function BO($,v){return new WO({type:"prefault",innerType:$,get defaultValue(){return typeof v==="function"?v():j.shallowClone(v)}})}var W0=X("ZodNonOptional",($,v)=>{tJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>I9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function PO($,v){return new W0({type:"nonoptional",innerType:$,...j.normalizeParams(v)})}var kO=X("ZodSuccess",($,v)=>{dJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>_9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function l7($){return new kO({type:"success",innerType:$})}var HO=X("ZodCatch",($,v)=>{aJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>Y9($,g,_,U),$.unwrap=()=>$._zod.def.innerType,$.removeCatch=$.unwrap});function IO($,v){return new HO({type:"catch",innerType:$,catchValue:typeof v==="function"?v:()=>v})}var LO=X("ZodNaN",($,v)=>{sJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>v9($,g,_,U)});function h7($){return y8(LO,$)}var B0=X("ZodPipe",($,v)=>{eJ.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>q9($,g,_,U),$.in=v.in,$.out=v.out});function Og($,v){return new B0({type:"pipe",in:$,out:v})}var P0=X("ZodCodec",($,v)=>{B0.init($,v),aU.init($,v)});function x7($,v,g){return new P0({type:"pipe",in:$,out:v,transform:g.decode,reverseTransform:g.encode})}var FO=X("ZodReadonly",($,v)=>{$b.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>X9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function YO($){return new FO({type:"readonly",innerType:$})}var qO=X("ZodTemplateLiteral",($,v)=>{vb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>U9($,g,_,U)});function p7($,v){return new qO({type:"template_literal",parts:$,...j.normalizeParams(v)})}var XO=X("ZodLazy",($,v)=>{_b.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>w9($,g,_,U),$.unwrap=()=>$._zod.def.getter()});function AO($){return new XO({type:"lazy",getter:$})}var wO=X("ZodPromise",($,v)=>{gb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>A9($,g,_,U),$.unwrap=()=>$._zod.def.innerType});function o7($){return new wO({type:"promise",innerType:$})}var ZO=X("ZodFunction",($,v)=>{Ub.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>J9($,g,_,U)});function n7($){return new ZO({type:"function",input:Array.isArray($?.input)?$O($?.input):$?.input??O$(Q$()),output:$?.output??Q$()})}var Hg=X("ZodCustom",($,v)=>{zb.init($,v),_$.init($,v),$._zod.processJSONSchema=(g,_,U)=>z9($,g,_,U)});function t7($){let v=new N$({check:"custom"});return v._zod.check=$,v}function k0($,v){return T8(Hg,$??(()=>!0),v)}function SO($,v={}){return j8(Hg,$,v)}function MO($){return V8($)}var d7=C8,a7=f8;function s7($,v={}){let g=new Hg({type:"custom",check:"custom",fn:(_)=>_ instanceof $,abort:!0,...j.normalizeParams(v)});return g._zod.bag.Class=$,g._zod.check=(_)=>{if(!(_.value instanceof $))_.issues.push({code:"invalid_type",expected:$.name,input:_.value,inst:g,path:[...g._zod.def.path??[]]})},g}var e7=(...$)=>E8({Codec:P0,Boolean:_U,String:vU},...$);function $W($){let v=AO(()=>{return w$([Z($),I$(),p$(),JU(),O$(v),r$(Z(),v)])});return v}function Ig($,v){return Og(G0($),v)}var sL={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function eL($){x$({customError:$})}function $F(){return x$().customError}var QO;(function($){})(QO||(QO={}));var l={...zg,...f1,iso:V6},vF=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function UF($,v){let g=$.$schema;if(g==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(g==="http://json-schema.org/draft-07/schema#")return"draft-7";if(g==="http://json-schema.org/draft-04/schema#")return"draft-4";return v??"draft-2020-12"}function gF($,v){if(!$.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let g=$.slice(1).split("/").filter(Boolean);if(g.length===0)return v.rootSchema;let _=v.version==="draft-2020-12"?"$defs":"definitions";if(g[0]===_){let U=g[1];if(!U||!v.defs[U])throw Error(`Reference not found: ${$}`);return v.defs[U]}throw Error(`Reference not found: ${$}`)}function vW($,v){if($.not!==void 0){if(typeof $.not==="object"&&Object.keys($.not).length===0)return l.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if($.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if($.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if($.if!==void 0||$.then!==void 0||$.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if($.dependentSchemas!==void 0||$.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if($.$ref){let U=$.$ref;if(v.refs.has(U))return v.refs.get(U);if(v.processing.has(U))return l.lazy(()=>{if(!v.refs.has(U))throw Error(`Circular reference not resolved: ${U}`);return v.refs.get(U)});v.processing.add(U);let z=gF(U,v),J=Kv(z,v);return v.refs.set(U,J),v.processing.delete(U),J}if($.enum!==void 0){let U=$.enum;if(v.version==="openapi-3.0"&&$.nullable===!0&&U.length===1&&U[0]===null)return l.null();if(U.length===0)return l.never();if(U.length===1)return l.literal(U[0]);if(U.every((J)=>typeof J==="string"))return l.enum(U);let z=U.map((J)=>l.literal(J));if(z.length<2)return z[0];return l.union([z[0],z[1],...z.slice(2)])}if($.const!==void 0)return l.literal($.const);let g=$.type;if(Array.isArray(g)){let U=g.map((z)=>{let J={...$,type:z};return vW(J,v)});if(U.length===0)return l.never();if(U.length===1)return U[0];return l.union(U)}if(!g)return l.any();let _;switch(g){case"string":{let U=l.string();if($.format){let z=$.format;if(z==="email")U=U.check(l.email());else if(z==="uri"||z==="uri-reference")U=U.check(l.url());else if(z==="uuid"||z==="guid")U=U.check(l.uuid());else if(z==="date-time")U=U.check(l.iso.datetime());else if(z==="date")U=U.check(l.iso.date());else if(z==="time")U=U.check(l.iso.time());else if(z==="duration")U=U.check(l.iso.duration());else if(z==="ipv4")U=U.check(l.ipv4());else if(z==="ipv6")U=U.check(l.ipv6());else if(z==="mac")U=U.check(l.mac());else if(z==="cidr")U=U.check(l.cidrv4());else if(z==="cidr-v6")U=U.check(l.cidrv6());else if(z==="base64")U=U.check(l.base64());else if(z==="base64url")U=U.check(l.base64url());else if(z==="e164")U=U.check(l.e164());else if(z==="jwt")U=U.check(l.jwt());else if(z==="emoji")U=U.check(l.emoji());else if(z==="nanoid")U=U.check(l.nanoid());else if(z==="cuid")U=U.check(l.cuid());else if(z==="cuid2")U=U.check(l.cuid2());else if(z==="ulid")U=U.check(l.ulid());else if(z==="xid")U=U.check(l.xid());else if(z==="ksuid")U=U.check(l.ksuid())}if(typeof $.minLength==="number")U=U.min($.minLength);if(typeof $.maxLength==="number")U=U.max($.maxLength);if($.pattern)U=U.regex(new RegExp($.pattern));_=U;break}case"number":case"integer":{let U=g==="integer"?l.number().int():l.number();if(typeof $.minimum==="number")U=U.min($.minimum);if(typeof $.maximum==="number")U=U.max($.maximum);if(typeof $.exclusiveMinimum==="number")U=U.gt($.exclusiveMinimum);else if($.exclusiveMinimum===!0&&typeof $.minimum==="number")U=U.gt($.minimum);if(typeof $.exclusiveMaximum==="number")U=U.lt($.exclusiveMaximum);else if($.exclusiveMaximum===!0&&typeof $.maximum==="number")U=U.lt($.maximum);if(typeof $.multipleOf==="number")U=U.multipleOf($.multipleOf);_=U;break}case"boolean":{_=l.boolean();break}case"null":{_=l.null();break}case"object":{let U={},z=$.properties||{},J=new Set($.required||[]);for(let[G,K]of Object.entries(z)){let W=Kv(K,v);U[G]=J.has(G)?W:W.optional()}if($.propertyNames){let G=Kv($.propertyNames,v),K=$.additionalProperties&&typeof $.additionalProperties==="object"?Kv($.additionalProperties,v):l.any();if(Object.keys(U).length===0){_=l.record(G,K);break}let W=l.object(U).passthrough(),B=l.looseRecord(G,K);_=l.intersection(W,B);break}if($.patternProperties){let G=$.patternProperties,K=Object.keys(G),W=[];for(let k of K){let P=Kv(G[k],v),q=l.string().regex(new RegExp(k));W.push(l.looseRecord(q,P))}let B=[];if(Object.keys(U).length>0)B.push(l.object(U).passthrough());if(B.push(...W),B.length===0)_=l.object({}).passthrough();else if(B.length===1)_=B[0];else{let k=l.intersection(B[0],B[1]);for(let P=2;P<B.length;P++)k=l.intersection(k,B[P]);_=k}break}let b=l.object(U);if($.additionalProperties===!1)_=b.strict();else if(typeof $.additionalProperties==="object")_=b.catchall(Kv($.additionalProperties,v));else _=b.passthrough();break}case"array":{let{prefixItems:U,items:z}=$;if(U&&Array.isArray(U)){let J=U.map((G)=>Kv(G,v)),b=z&&typeof z==="object"&&!Array.isArray(z)?Kv(z,v):void 0;if(b)_=l.tuple(J).rest(b);else _=l.tuple(J);if(typeof $.minItems==="number")_=_.check(l.minLength($.minItems));if(typeof $.maxItems==="number")_=_.check(l.maxLength($.maxItems))}else if(Array.isArray(z)){let J=z.map((G)=>Kv(G,v)),b=$.additionalItems&&typeof $.additionalItems==="object"?Kv($.additionalItems,v):void 0;if(b)_=l.tuple(J).rest(b);else _=l.tuple(J);if(typeof $.minItems==="number")_=_.check(l.minLength($.minItems));if(typeof $.maxItems==="number")_=_.check(l.maxLength($.maxItems))}else if(z!==void 0){let J=Kv(z,v),b=l.array(J);if(typeof $.minItems==="number")b=b.min($.minItems);if(typeof $.maxItems==="number")b=b.max($.maxItems);_=b}else _=l.array(l.any());break}default:throw Error(`Unsupported type: ${g}`)}if($.description)_=_.describe($.description);if($.default!==void 0)_=_.default($.default);return _}function Kv($,v){if(typeof $==="boolean")return $?l.any():l.never();let g=vW($,v),_=$.type||$.enum!==void 0||$.const!==void 0;if($.anyOf&&Array.isArray($.anyOf)){let b=$.anyOf.map((K)=>Kv(K,v)),G=l.union(b);g=_?l.intersection(g,G):G}if($.oneOf&&Array.isArray($.oneOf)){let b=$.oneOf.map((K)=>Kv(K,v)),G=l.xor(b);g=_?l.intersection(g,G):G}if($.allOf&&Array.isArray($.allOf))if($.allOf.length===0)g=_?g:l.any();else{let b=_?g:Kv($.allOf[0],v),G=_?0:1;for(let K=G;K<$.allOf.length;K++)b=l.intersection(b,Kv($.allOf[K],v));g=b}if($.nullable===!0&&v.version==="openapi-3.0")g=l.nullable(g);if($.readOnly===!0)g=l.readonly(g);let U={},z=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let b of z)if(b in $)U[b]=$[b];let J=["contentEncoding","contentMediaType","contentSchema"];for(let b of J)if(b in $)U[b]=$[b];for(let b of Object.keys($))if(!vF.has(b))U[b]=$[b];if(Object.keys(U).length>0)v.registry.add(g,U);return g}function UW($,v){if(typeof $==="boolean")return $?l.any():l.never();let g=UF($,v?.defaultTarget),_=$.$defs||$.definitions||{},U={version:g,defs:_,refs:new Map,processing:new Set,rootSchema:$,registry:v?.registry??$v};return Kv($,U)}var NO={};v6(NO,{string:()=>_F,number:()=>zF,date:()=>OF,boolean:()=>JF,bigint:()=>bF});function _F($){return U8(vU,$)}function zF($){return K8(gU,$)}function JF($){return L8(_U,$)}function bF($){return Y8(zU,$)}function OF($){return u8(Kg,$)}x$(sU());var C6="io.modelcontextprotocol/related-task",I0="2.0",gv=k0(($)=>$!==null&&(typeof $==="object"||typeof $==="function")),gW=w$([Z(),I$().int()]),_W=Z(),MQ=vv({ttl:w$([I$(),JU()]).optional(),pollInterval:I$().optional()}),GF=h({ttl:I$().optional()}),KF=h({taskId:Z()}),rO=vv({progressToken:gW.optional(),[C6]:KF.optional()}),rv=h({_meta:rO.optional()}),Lg=rv.extend({task:GF.optional()}),zW=($)=>Lg.safeParse($).success,_v=h({method:Z(),params:rv.loose().optional()}),Vv=h({_meta:rO.optional()}),Cv=h({method:Z(),params:Vv.loose().optional()}),zv=vv({_meta:rO.optional()}),GU=w$([Z(),I$().int()]),JW=h({jsonrpc:o(I0),id:GU,..._v.shape}).strict(),uO=($)=>JW.safeParse($).success,bW=h({jsonrpc:o(I0),...Cv.shape}).strict(),OW=($)=>bW.safeParse($).success,yO=h({jsonrpc:o(I0),id:GU,result:zv}).strict(),Fg=($)=>yO.safeParse($).success;var A$;(function($){$[$.ConnectionClosed=-32000]="ConnectionClosed",$[$.RequestTimeout=-32001]="RequestTimeout",$[$.ParseError=-32700]="ParseError",$[$.InvalidRequest=-32600]="InvalidRequest",$[$.MethodNotFound=-32601]="MethodNotFound",$[$.InvalidParams=-32602]="InvalidParams",$[$.InternalError=-32603]="InternalError",$[$.UrlElicitationRequired=-32042]="UrlElicitationRequired"})(A$||(A$={}));var RO=h({jsonrpc:o(I0),id:GU.optional(),error:h({code:I$().int(),message:Z(),data:Q$().optional()})}).strict();var GW=($)=>RO.safeParse($).success;var KW=w$([JW,bW,yO,RO]),QQ=w$([yO,RO]),L0=zv.strict(),WF=Vv.extend({requestId:GU.optional(),reason:Z().optional()}),F0=Cv.extend({method:o("notifications/cancelled"),params:WF}),BF=h({src:Z(),mimeType:Z().optional(),sizes:O$(Z()).optional(),theme:Uv(["light","dark"]).optional()}),Yg=h({icons:O$(BF).optional()}),OU=h({name:Z(),title:Z().optional()}),qg=OU.extend({...OU.shape,...Yg.shape,version:Z(),websiteUrl:Z().optional(),description:Z().optional()}),PF=bU(h({applyDefaults:p$().optional()}),r$(Z(),Q$())),kF=Ig(($)=>{if($&&typeof $==="object"&&!Array.isArray($)){if(Object.keys($).length===0)return{form:{}}}return $},bU(h({form:PF.optional(),url:gv.optional()}),r$(Z(),Q$()).optional())),HF=vv({list:gv.optional(),cancel:gv.optional(),requests:vv({sampling:vv({createMessage:gv.optional()}).optional(),elicitation:vv({create:gv.optional()}).optional()}).optional()}),IF=vv({list:gv.optional(),cancel:gv.optional(),requests:vv({tools:vv({call:gv.optional()}).optional()}).optional()}),LF=h({experimental:r$(Z(),gv).optional(),sampling:h({context:gv.optional(),tools:gv.optional()}).optional(),elicitation:kF.optional(),roots:h({listChanged:p$().optional()}).optional(),tasks:HF.optional()}),FF=rv.extend({protocolVersion:Z(),capabilities:LF,clientInfo:qg}),YF=_v.extend({method:o("initialize"),params:FF});var qF=h({experimental:r$(Z(),gv).optional(),logging:gv.optional(),completions:gv.optional(),prompts:h({listChanged:p$().optional()}).optional(),resources:h({subscribe:p$().optional(),listChanged:p$().optional()}).optional(),tools:h({listChanged:p$().optional()}).optional(),tasks:IF.optional()}),XF=zv.extend({protocolVersion:Z(),capabilities:qF,serverInfo:qg,instructions:Z().optional()}),AF=Cv.extend({method:o("notifications/initialized"),params:Vv.optional()});var f6=_v.extend({method:o("ping"),params:rv.optional()}),wF=h({progress:I$(),total:y$(I$()),message:y$(Z())}),ZF=h({...Vv.shape,...wF.shape,progressToken:gW}),Y0=Cv.extend({method:o("notifications/progress"),params:ZF}),SF=rv.extend({cursor:_W.optional()}),Xg=_v.extend({params:SF.optional()}),Ag=zv.extend({nextCursor:_W.optional()}),MF=Uv(["working","input_required","completed","failed","cancelled"]),wg=h({taskId:Z(),status:MF,ttl:w$([I$(),JU()]),createdAt:Z(),lastUpdatedAt:Z(),pollInterval:y$(I$()),statusMessage:y$(Z())}),q0=zv.extend({task:wg}),QF=Vv.merge(wg),Zg=Cv.extend({method:o("notifications/tasks/status"),params:QF}),X0=_v.extend({method:o("tasks/get"),params:rv.extend({taskId:Z()})}),A0=zv.merge(wg),w0=_v.extend({method:o("tasks/result"),params:rv.extend({taskId:Z()})}),NQ=zv.loose(),Z0=Xg.extend({method:o("tasks/list")}),S0=Ag.extend({tasks:O$(wg)}),M0=_v.extend({method:o("tasks/cancel"),params:rv.extend({taskId:Z()})}),WW=zv.merge(wg),BW=h({uri:Z(),mimeType:y$(Z()),_meta:r$(Z(),Q$()).optional()}),PW=BW.extend({text:Z()}),DO=Z().refine(($)=>{try{return atob($),!0}catch{return!1}},{message:"Invalid Base64 string"}),kW=BW.extend({blob:DO}),Sg=Uv(["user","assistant"]),KU=h({audience:O$(Sg).optional(),priority:I$().min(0).max(1).optional(),lastModified:V6.datetime({offset:!0}).optional()}),HW=h({...OU.shape,...Yg.shape,uri:Z(),description:y$(Z()),mimeType:y$(Z()),annotations:KU.optional(),_meta:y$(vv({}))}),NF=h({...OU.shape,...Yg.shape,uriTemplate:Z(),description:y$(Z()),mimeType:y$(Z()),annotations:KU.optional(),_meta:y$(vv({}))}),TO=Xg.extend({method:o("resources/list")}),Mg=Ag.extend({resources:O$(HW)}),jO=Xg.extend({method:o("resources/templates/list")}),VO=Ag.extend({resourceTemplates:O$(NF)}),CO=rv.extend({uri:Z()}),rF=CO,fO=_v.extend({method:o("resources/read"),params:rF}),Qg=zv.extend({contents:O$(w$([PW,kW]))}),EO=Cv.extend({method:o("notifications/resources/list_changed"),params:Vv.optional()}),uF=CO,yF=_v.extend({method:o("resources/subscribe"),params:uF}),RF=CO,DF=_v.extend({method:o("resources/unsubscribe"),params:RF}),TF=Vv.extend({uri:Z()}),jF=Cv.extend({method:o("notifications/resources/updated"),params:TF}),VF=h({name:Z(),description:y$(Z()),required:y$(p$())}),CF=h({...OU.shape,...Yg.shape,description:y$(Z()),arguments:y$(O$(VF)),_meta:y$(vv({}))}),cO=Xg.extend({method:o("prompts/list")}),mO=Ag.extend({prompts:O$(CF)}),fF=rv.extend({name:Z(),arguments:r$(Z(),Z()).optional()}),EF=_v.extend({method:o("prompts/get"),params:fF}),iO=h({type:o("text"),text:Z(),annotations:KU.optional(),_meta:r$(Z(),Q$()).optional()}),lO=h({type:o("image"),data:DO,mimeType:Z(),annotations:KU.optional(),_meta:r$(Z(),Q$()).optional()}),hO=h({type:o("audio"),data:DO,mimeType:Z(),annotations:KU.optional(),_meta:r$(Z(),Q$()).optional()}),cF=h({type:o("tool_use"),name:Z(),id:Z(),input:r$(Z(),Q$()),_meta:r$(Z(),Q$()).optional()}),xO=h({type:o("resource"),resource:w$([PW,kW]),annotations:KU.optional(),_meta:r$(Z(),Q$()).optional()}),pO=HW.extend({type:o("resource_link")}),WU=w$([iO,lO,hO,pO,xO]),mF=h({role:Sg,content:WU}),iF=zv.extend({description:Z().optional(),messages:O$(mF)}),oO=Cv.extend({method:o("notifications/prompts/list_changed"),params:Vv.optional()}),lF=h({title:Z().optional(),readOnlyHint:p$().optional(),destructiveHint:p$().optional(),idempotentHint:p$().optional(),openWorldHint:p$().optional()}),hF=h({taskSupport:Uv(["required","optional","forbidden"]).optional()}),Q0=h({...OU.shape,...Yg.shape,description:Z().optional(),inputSchema:h({type:o("object"),properties:r$(Z(),gv).optional(),required:O$(Z()).optional()}).catchall(Q$()),outputSchema:h({type:o("object"),properties:r$(Z(),gv).optional(),required:O$(Z()).optional()}).catchall(Q$()).optional(),annotations:lF.optional(),execution:hF.optional(),_meta:r$(Z(),Q$()).optional()}),Ng=Xg.extend({method:o("tools/list")}),xF=Ag.extend({tools:O$(Q0)}),E6=zv.extend({content:O$(WU).default([]),structuredContent:r$(Z(),Q$()).optional(),isError:p$().optional()}),rQ=E6.or(zv.extend({toolResult:Q$()})),pF=Lg.extend({name:Z(),arguments:r$(Z(),Q$()).optional()}),rg=_v.extend({method:o("tools/call"),params:pF}),nO=Cv.extend({method:o("notifications/tools/list_changed"),params:Vv.optional()}),uQ=h({autoRefresh:p$().default(!0),debounceMs:I$().int().nonnegative().default(300)}),IW=Uv(["debug","info","notice","warning","error","critical","alert","emergency"]),oF=rv.extend({level:IW}),nF=_v.extend({method:o("logging/setLevel"),params:oF}),tF=Vv.extend({level:IW,logger:Z().optional(),data:Q$()}),tO=Cv.extend({method:o("notifications/message"),params:tF}),dF=h({name:Z().optional()}),aF=h({hints:O$(dF).optional(),costPriority:I$().min(0).max(1).optional(),speedPriority:I$().min(0).max(1).optional(),intelligencePriority:I$().min(0).max(1).optional()}),sF=h({mode:Uv(["auto","required","none"]).optional()}),eF=h({type:o("tool_result"),toolUseId:Z().describe("The unique identifier for the corresponding tool call."),content:O$(WU).default([]),structuredContent:h({}).loose().optional(),isError:p$().optional(),_meta:r$(Z(),Q$()).optional()}),$Y=Pg("type",[iO,lO,hO]),H0=Pg("type",[iO,lO,hO,cF,eF]),vY=h({role:Sg,content:w$([H0,O$(H0)]),_meta:r$(Z(),Q$()).optional()}),UY=Lg.extend({messages:O$(vY),modelPreferences:aF.optional(),systemPrompt:Z().optional(),includeContext:Uv(["none","thisServer","allServers"]).optional(),temperature:I$().optional(),maxTokens:I$().int(),stopSequences:O$(Z()).optional(),metadata:gv.optional(),tools:O$(Q0).optional(),toolChoice:sF.optional()}),gY=_v.extend({method:o("sampling/createMessage"),params:UY}),_Y=zv.extend({model:Z(),stopReason:y$(Uv(["endTurn","stopSequence","maxTokens"]).or(Z())),role:Sg,content:$Y}),zY=zv.extend({model:Z(),stopReason:y$(Uv(["endTurn","stopSequence","maxTokens","toolUse"]).or(Z())),role:Sg,content:w$([H0,O$(H0)])}),JY=h({type:o("boolean"),title:Z().optional(),description:Z().optional(),default:p$().optional()}),bY=h({type:o("string"),title:Z().optional(),description:Z().optional(),minLength:I$().optional(),maxLength:I$().optional(),format:Uv(["email","uri","date","date-time"]).optional(),default:Z().optional()}),OY=h({type:Uv(["number","integer"]),title:Z().optional(),description:Z().optional(),minimum:I$().optional(),maximum:I$().optional(),default:I$().optional()}),GY=h({type:o("string"),title:Z().optional(),description:Z().optional(),enum:O$(Z()),default:Z().optional()}),KY=h({type:o("string"),title:Z().optional(),description:Z().optional(),oneOf:O$(h({const:Z(),title:Z()})),default:Z().optional()}),WY=h({type:o("string"),title:Z().optional(),description:Z().optional(),enum:O$(Z()),enumNames:O$(Z()).optional(),default:Z().optional()}),BY=w$([GY,KY]),PY=h({type:o("array"),title:Z().optional(),description:Z().optional(),minItems:I$().optional(),maxItems:I$().optional(),items:h({type:o("string"),enum:O$(Z())}),default:O$(Z()).optional()}),kY=h({type:o("array"),title:Z().optional(),description:Z().optional(),minItems:I$().optional(),maxItems:I$().optional(),items:h({anyOf:O$(h({const:Z(),title:Z()}))}),default:O$(Z()).optional()}),HY=w$([PY,kY]),IY=w$([WY,BY,HY]),LY=w$([IY,JY,bY,OY]),FY=Lg.extend({mode:o("form").optional(),message:Z(),requestedSchema:h({type:o("object"),properties:r$(Z(),LY),required:O$(Z()).optional()})}),YY=Lg.extend({mode:o("url"),message:Z(),elicitationId:Z(),url:Z().url()}),qY=w$([FY,YY]),XY=_v.extend({method:o("elicitation/create"),params:qY}),AY=Vv.extend({elicitationId:Z()}),wY=Cv.extend({method:o("notifications/elicitation/complete"),params:AY}),ZY=zv.extend({action:Uv(["accept","decline","cancel"]),content:Ig(($)=>$===null?void 0:$,r$(Z(),w$([Z(),I$(),p$(),O$(Z())])).optional())}),SY=h({type:o("ref/resource"),uri:Z()});var MY=h({type:o("ref/prompt"),name:Z()}),QY=rv.extend({ref:w$([MY,SY]),argument:h({name:Z(),value:Z()}),context:h({arguments:r$(Z(),Z()).optional()}).optional()}),NY=_v.extend({method:o("completion/complete"),params:QY});var rY=zv.extend({completion:vv({values:O$(Z()).max(100),total:y$(I$().int()),hasMore:y$(p$())})}),uY=h({uri:Z().startsWith("file://"),name:Z().optional(),_meta:r$(Z(),Q$()).optional()}),yY=_v.extend({method:o("roots/list"),params:rv.optional()}),RY=zv.extend({roots:O$(uY)}),DY=Cv.extend({method:o("notifications/roots/list_changed"),params:Vv.optional()}),yQ=w$([f6,YF,NY,nF,EF,cO,TO,jO,fO,yF,DF,rg,Ng,X0,w0,Z0,M0]),RQ=w$([F0,Y0,AF,DY,Zg]),DQ=w$([L0,_Y,zY,ZY,RY,A0,S0,q0]),TQ=w$([f6,gY,XY,yY,X0,w0,Z0,M0]),jQ=w$([F0,Y0,tO,jF,EO,nO,oO,Zg,wY]),VQ=w$([L0,XF,rY,iF,mO,Mg,VO,Qg,E6,xF,A0,S0,q0]);class k$ extends Error{constructor($,v,g){super(`MCP error ${$}: ${v}`);this.code=$,this.data=g,this.name="McpError"}static fromError($,v,g){if($===A$.UrlElicitationRequired&&g){let _=g;if(_.elicitations)return new LW(_.elicitations,v)}return new k$($,v,g)}}class LW extends k${constructor($,v=`URL elicitation${$.length>1?"s":""} required`){super(A$.UrlElicitationRequired,v,{elicitations:$})}get elicitations(){return this.data?.elicitations??[]}}function N0($){return!!$._zod}function r0($,v){if(N0($))return V4($,v);return $.safeParse(v)}function FW($){if(!$)return;let v;if(N0($))v=$._zod?.def?.shape;else v=$.shape;if(!v)return;if(typeof v==="function")try{return v()}catch{return}return v}function YW($){if(N0($)){let z=$._zod?.def;if(z){if(z.value!==void 0)return z.value;if(Array.isArray(z.values)&&z.values.length>0)return z.values[0]}}let g=$._def;if(g){if(g.value!==void 0)return g.value;if(Array.isArray(g.values)&&g.values.length>0)return g.values[0]}let _=$.value;if(_!==void 0)return _;return}function c6($){return $==="completed"||$==="failed"||$==="cancelled"}var TY=Symbol("Let zodToJsonSchema decide on which parser to use");var qN=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function dO($){let g=FW($)?.method;if(!g)throw Error("Schema is missing a method literal");let _=YW(g);if(typeof _!=="string")throw Error("Schema method literal must be a string");return _}function aO($,v){let g=r0($,v);if(!g.success)throw g.error;return g.data}var cY=60000;class yg{constructor($){if(this._options=$,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(F0,(v)=>{this._oncancel(v)}),this.setNotificationHandler(Y0,(v)=>{this._onprogress(v)}),this.setRequestHandler(f6,(v)=>({})),this._taskStore=$?.taskStore,this._taskMessageQueue=$?.taskMessageQueue,this._taskStore)this.setRequestHandler(X0,async(v,g)=>{let _=await this._taskStore.getTask(v.params.taskId,g.sessionId);if(!_)throw new k$(A$.InvalidParams,"Failed to retrieve task: Task not found");return{..._}}),this.setRequestHandler(w0,async(v,g)=>{let _=async()=>{let U=v.params.taskId;if(this._taskMessageQueue){let J;while(J=await this._taskMessageQueue.dequeue(U,g.sessionId)){if(J.type==="response"||J.type==="error"){let b=J.message,G=b.id,K=this._requestResolvers.get(G);if(K)if(this._requestResolvers.delete(G),J.type==="response")K(b);else{let W=b,B=new k$(W.error.code,W.error.message,W.error.data);K(B)}else{let W=J.type==="response"?"Response":"Error";this._onerror(Error(`${W} handler missing for request ${G}`))}continue}await this._transport?.send(J.message,{relatedRequestId:g.requestId})}}let z=await this._taskStore.getTask(U,g.sessionId);if(!z)throw new k$(A$.InvalidParams,`Task not found: ${U}`);if(!c6(z.status))return await this._waitForTaskUpdate(U,g.signal),await _();if(c6(z.status)){let J=await this._taskStore.getTaskResult(U,g.sessionId);return this._clearTaskQueue(U),{...J,_meta:{...J._meta,[C6]:{taskId:U}}}}return await _()};return await _()}),this.setRequestHandler(Z0,async(v,g)=>{try{let{tasks:_,nextCursor:U}=await this._taskStore.listTasks(v.params?.cursor,g.sessionId);return{tasks:_,nextCursor:U,_meta:{}}}catch(_){throw new k$(A$.InvalidParams,`Failed to list tasks: ${_ instanceof Error?_.message:String(_)}`)}}),this.setRequestHandler(M0,async(v,g)=>{try{let _=await this._taskStore.getTask(v.params.taskId,g.sessionId);if(!_)throw new k$(A$.InvalidParams,`Task not found: ${v.params.taskId}`);if(c6(_.status))throw new k$(A$.InvalidParams,`Cannot cancel task in terminal status: ${_.status}`);await this._taskStore.updateTaskStatus(v.params.taskId,"cancelled","Client cancelled task execution.",g.sessionId),this._clearTaskQueue(v.params.taskId);let U=await this._taskStore.getTask(v.params.taskId,g.sessionId);if(!U)throw new k$(A$.InvalidParams,`Task not found after cancellation: ${v.params.taskId}`);return{_meta:{},...U}}catch(_){if(_ instanceof k$)throw _;throw new k$(A$.InvalidRequest,`Failed to cancel task: ${_ instanceof Error?_.message:String(_)}`)}})}async _oncancel($){if(!$.params.requestId)return;this._requestHandlerAbortControllers.get($.params.requestId)?.abort($.params.reason)}_setupTimeout($,v,g,_,U=!1){this._timeoutInfo.set($,{timeoutId:setTimeout(_,v),startTime:Date.now(),timeout:v,maxTotalTimeout:g,resetTimeoutOnProgress:U,onTimeout:_})}_resetTimeout($){let v=this._timeoutInfo.get($);if(!v)return!1;let g=Date.now()-v.startTime;if(v.maxTotalTimeout&&g>=v.maxTotalTimeout)throw this._timeoutInfo.delete($),k$.fromError(A$.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:v.maxTotalTimeout,totalElapsed:g});return clearTimeout(v.timeoutId),v.timeoutId=setTimeout(v.onTimeout,v.timeout),!0}_cleanupTimeout($){let v=this._timeoutInfo.get($);if(v)clearTimeout(v.timeoutId),this._timeoutInfo.delete($)}async connect($){if(this._transport)throw Error("Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.");this._transport=$;let v=this.transport?.onclose;this._transport.onclose=()=>{v?.(),this._onclose()};let g=this.transport?.onerror;this._transport.onerror=(U)=>{g?.(U),this._onerror(U)};let _=this._transport?.onmessage;this._transport.onmessage=(U,z)=>{if(_?.(U,z),Fg(U)||GW(U))this._onresponse(U);else if(uO(U))this._onrequest(U,z);else if(OW(U))this._onnotification(U);else this._onerror(Error(`Unknown message type: ${JSON.stringify(U)}`))},await this._transport.start()}_onclose(){let $=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let g of this._timeoutInfo.values())clearTimeout(g.timeoutId);this._timeoutInfo.clear();for(let g of this._requestHandlerAbortControllers.values())g.abort();this._requestHandlerAbortControllers.clear();let v=k$.fromError(A$.ConnectionClosed,"Connection closed");this._transport=void 0,this.onclose?.();for(let g of $.values())g(v)}_onerror($){this.onerror?.($)}_onnotification($){let v=this._notificationHandlers.get($.method)??this.fallbackNotificationHandler;if(v===void 0)return;Promise.resolve().then(()=>v($)).catch((g)=>this._onerror(Error(`Uncaught error in notification handler: ${g}`)))}_onrequest($,v){let g=this._requestHandlers.get($.method)??this.fallbackRequestHandler,_=this._transport,U=$.params?._meta?.[C6]?.taskId;if(g===void 0){let K={jsonrpc:"2.0",id:$.id,error:{code:A$.MethodNotFound,message:"Method not found"}};if(U&&this._taskMessageQueue)this._enqueueTaskMessage(U,{type:"error",message:K,timestamp:Date.now()},_?.sessionId).catch((W)=>this._onerror(Error(`Failed to enqueue error response: ${W}`)));else _?.send(K).catch((W)=>this._onerror(Error(`Failed to send an error response: ${W}`)));return}let z=new AbortController;this._requestHandlerAbortControllers.set($.id,z);let J=zW($.params)?$.params.task:void 0,b=this._taskStore?this.requestTaskStore($,_?.sessionId):void 0,G={signal:z.signal,sessionId:_?.sessionId,_meta:$.params?._meta,sendNotification:async(K)=>{if(z.signal.aborted)return;let W={relatedRequestId:$.id};if(U)W.relatedTask={taskId:U};await this.notification(K,W)},sendRequest:async(K,W,B)=>{if(z.signal.aborted)throw new k$(A$.ConnectionClosed,"Request was cancelled");let k={...B,relatedRequestId:$.id};if(U&&!k.relatedTask)k.relatedTask={taskId:U};let P=k.relatedTask?.taskId??U;if(P&&b)await b.updateTaskStatus(P,"input_required");return await this.request(K,W,k)},authInfo:v?.authInfo,requestId:$.id,requestInfo:v?.requestInfo,taskId:U,taskStore:b,taskRequestedTtl:J?.ttl,closeSSEStream:v?.closeSSEStream,closeStandaloneSSEStream:v?.closeStandaloneSSEStream};Promise.resolve().then(()=>{if(J)this.assertTaskHandlerCapability($.method)}).then(()=>g($,G)).then(async(K)=>{if(z.signal.aborted)return;let W={result:K,jsonrpc:"2.0",id:$.id};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"response",message:W,timestamp:Date.now()},_?.sessionId);else await _?.send(W)},async(K)=>{if(z.signal.aborted)return;let W={jsonrpc:"2.0",id:$.id,error:{code:Number.isSafeInteger(K.code)?K.code:A$.InternalError,message:K.message??"Internal error",...K.data!==void 0&&{data:K.data}}};if(U&&this._taskMessageQueue)await this._enqueueTaskMessage(U,{type:"error",message:W,timestamp:Date.now()},_?.sessionId);else await _?.send(W)}).catch((K)=>this._onerror(Error(`Failed to send response: ${K}`))).finally(()=>{if(this._requestHandlerAbortControllers.get($.id)===z)this._requestHandlerAbortControllers.delete($.id)})}_onprogress($){let{progressToken:v,...g}=$.params,_=Number(v),U=this._progressHandlers.get(_);if(!U){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify($)}`));return}let z=this._responseHandlers.get(_),J=this._timeoutInfo.get(_);if(J&&z&&J.resetTimeoutOnProgress)try{this._resetTimeout(_)}catch(b){this._responseHandlers.delete(_),this._progressHandlers.delete(_),this._cleanupTimeout(_),z(b);return}U(g)}_onresponse($){let v=Number($.id),g=this._requestResolvers.get(v);if(g){if(this._requestResolvers.delete(v),Fg($))g($);else{let z=new k$($.error.code,$.error.message,$.error.data);g(z)}return}let _=this._responseHandlers.get(v);if(_===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify($)}`));return}this._responseHandlers.delete(v),this._cleanupTimeout(v);let U=!1;if(Fg($)&&$.result&&typeof $.result==="object"){let z=$.result;if(z.task&&typeof z.task==="object"){let J=z.task;if(typeof J.taskId==="string")U=!0,this._taskProgressTokens.set(J.taskId,v)}}if(!U)this._progressHandlers.delete(v);if(Fg($))_($);else{let z=k$.fromError($.error.code,$.error.message,$.error.data);_(z)}}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream($,v,g){let{task:_}=g??{};if(!_){try{yield{type:"result",result:await this.request($,v,g)}}catch(z){yield{type:"error",error:z instanceof k$?z:new k$(A$.InternalError,String(z))}}return}let U;try{let z=await this.request($,q0,g);if(z.task)U=z.task.taskId,yield{type:"taskCreated",task:z.task};else throw new k$(A$.InternalError,"Task creation did not return a task");while(!0){let J=await this.getTask({taskId:U},g);if(yield{type:"taskStatus",task:J},c6(J.status)){if(J.status==="completed")yield{type:"result",result:await this.getTaskResult({taskId:U},v,g)};else if(J.status==="failed")yield{type:"error",error:new k$(A$.InternalError,`Task ${U} failed`)};else if(J.status==="cancelled")yield{type:"error",error:new k$(A$.InternalError,`Task ${U} was cancelled`)};return}if(J.status==="input_required"){yield{type:"result",result:await this.getTaskResult({taskId:U},v,g)};return}let b=J.pollInterval??this._options?.defaultTaskPollInterval??1000;await new Promise((G)=>setTimeout(G,b)),g?.signal?.throwIfAborted()}}catch(z){yield{type:"error",error:z instanceof k$?z:new k$(A$.InternalError,String(z))}}}request($,v,g){let{relatedRequestId:_,resumptionToken:U,onresumptiontoken:z,task:J,relatedTask:b}=g??{};return new Promise((G,K)=>{let W=(F)=>{K(F)};if(!this._transport){W(Error("Not connected"));return}if(this._options?.enforceStrictCapabilities===!0)try{if(this.assertCapabilityForMethod($.method),J)this.assertTaskCapability($.method)}catch(F){W(F);return}g?.signal?.throwIfAborted();let B=this._requestMessageId++,k={...$,jsonrpc:"2.0",id:B};if(g?.onprogress)this._progressHandlers.set(B,g.onprogress),k.params={...$.params,_meta:{...$.params?._meta||{},progressToken:B}};if(J)k.params={...k.params,task:J};if(b)k.params={...k.params,_meta:{...k.params?._meta||{},[C6]:b}};let P=(F)=>{this._responseHandlers.delete(B),this._progressHandlers.delete(B),this._cleanupTimeout(B),this._transport?.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:B,reason:String(F)}},{relatedRequestId:_,resumptionToken:U,onresumptiontoken:z}).catch((A)=>this._onerror(Error(`Failed to send cancellation: ${A}`)));let Y=F instanceof k$?F:new k$(A$.RequestTimeout,String(F));K(Y)};this._responseHandlers.set(B,(F)=>{if(g?.signal?.aborted)return;if(F instanceof Error)return K(F);try{let Y=r0(v,F.result);if(!Y.success)K(Y.error);else G(Y.data)}catch(Y){K(Y)}}),g?.signal?.addEventListener("abort",()=>{P(g?.signal?.reason)});let q=g?.timeout??cY,L=()=>P(k$.fromError(A$.RequestTimeout,"Request timed out",{timeout:q}));this._setupTimeout(B,q,g?.maxTotalTimeout,L,g?.resetTimeoutOnProgress??!1);let H=b?.taskId;if(H){let F=(Y)=>{let A=this._responseHandlers.get(B);if(A)A(Y);else this._onerror(Error(`Response handler missing for side-channeled request ${B}`))};this._requestResolvers.set(B,F),this._enqueueTaskMessage(H,{type:"request",message:k,timestamp:Date.now()}).catch((Y)=>{this._cleanupTimeout(B),K(Y)})}else this._transport.send(k,{relatedRequestId:_,resumptionToken:U,onresumptiontoken:z}).catch((F)=>{this._cleanupTimeout(B),K(F)})})}async getTask($,v){return this.request({method:"tasks/get",params:$},A0,v)}async getTaskResult($,v,g){return this.request({method:"tasks/result",params:$},v,g)}async listTasks($,v){return this.request({method:"tasks/list",params:$},S0,v)}async cancelTask($,v){return this.request({method:"tasks/cancel",params:$},WW,v)}async notification($,v){if(!this._transport)throw Error("Not connected");this.assertNotificationCapability($.method);let g=v?.relatedTask?.taskId;if(g){let J={...$,jsonrpc:"2.0",params:{...$.params,_meta:{...$.params?._meta||{},[C6]:v.relatedTask}}};await this._enqueueTaskMessage(g,{type:"notification",message:J,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes($.method)&&!$.params&&!v?.relatedRequestId&&!v?.relatedTask){if(this._pendingDebouncedNotifications.has($.method))return;this._pendingDebouncedNotifications.add($.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete($.method),!this._transport)return;let J={...$,jsonrpc:"2.0"};if(v?.relatedTask)J={...J,params:{...J.params,_meta:{...J.params?._meta||{},[C6]:v.relatedTask}}};this._transport?.send(J,v).catch((b)=>this._onerror(b))});return}let z={...$,jsonrpc:"2.0"};if(v?.relatedTask)z={...z,params:{...z.params,_meta:{...z.params?._meta||{},[C6]:v.relatedTask}}};await this._transport.send(z,v)}setRequestHandler($,v){let g=dO($);this.assertRequestHandlerCapability(g),this._requestHandlers.set(g,(_,U)=>{let z=aO($,_);return Promise.resolve(v(z,U))})}removeRequestHandler($){this._requestHandlers.delete($)}assertCanSetRequestHandler($){if(this._requestHandlers.has($))throw Error(`A request handler for ${$} already exists, which would be overridden`)}setNotificationHandler($,v){let g=dO($);this._notificationHandlers.set(g,(_)=>{let U=aO($,_);return Promise.resolve(v(U))})}removeNotificationHandler($){this._notificationHandlers.delete($)}_cleanupTaskProgressHandler($){let v=this._taskProgressTokens.get($);if(v!==void 0)this._progressHandlers.delete(v),this._taskProgressTokens.delete($)}async _enqueueTaskMessage($,v,g){if(!this._taskStore||!this._taskMessageQueue)throw Error("Cannot enqueue task message: taskStore and taskMessageQueue are not configured");let _=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue($,v,g,_)}async _clearTaskQueue($,v){if(this._taskMessageQueue){let g=await this._taskMessageQueue.dequeueAll($,v);for(let _ of g)if(_.type==="request"&&uO(_.message)){let U=_.message.id,z=this._requestResolvers.get(U);if(z)z(new k$(A$.InternalError,"Task cancelled or completed")),this._requestResolvers.delete(U);else this._onerror(Error(`Resolver missing for request ${U} during task ${$} cleanup`))}}}async _waitForTaskUpdate($,v){let g=this._options?.defaultTaskPollInterval??1000;try{let _=await this._taskStore?.getTask($);if(_?.pollInterval)g=_.pollInterval}catch{}return new Promise((_,U)=>{if(v.aborted){U(new k$(A$.InvalidRequest,"Request cancelled"));return}let z=setTimeout(_,g);v.addEventListener("abort",()=>{clearTimeout(z),U(new k$(A$.InvalidRequest,"Request cancelled"))},{once:!0})})}requestTaskStore($,v){let g=this._taskStore;if(!g)throw Error("No task store configured");return{createTask:async(_)=>{if(!$)throw Error("No request provided");return await g.createTask(_,$.id,{method:$.method,params:$.params},v)},getTask:async(_)=>{let U=await g.getTask(_,v);if(!U)throw new k$(A$.InvalidParams,"Failed to retrieve task: Task not found");return U},storeTaskResult:async(_,U,z)=>{await g.storeTaskResult(_,U,z,v);let J=await g.getTask(_,v);if(J){let b=Zg.parse({method:"notifications/tasks/status",params:J});if(await this.notification(b),c6(J.status))this._cleanupTaskProgressHandler(_)}},getTaskResult:(_)=>{return g.getTaskResult(_,v)},updateTaskStatus:async(_,U,z)=>{let J=await g.getTask(_,v);if(!J)throw new k$(A$.InvalidParams,`Task "${_}" not found - it may have been cleaned up`);if(c6(J.status))throw new k$(A$.InvalidParams,`Cannot update task "${_}" from terminal status "${J.status}" to "${U}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await g.updateTaskStatus(_,U,z,v);let b=await g.getTask(_,v);if(b){let G=Zg.parse({method:"notifications/tasks/status",params:b});if(await this.notification(G),c6(b.status))this._cleanupTaskProgressHandler(_)}},listTasks:(_)=>{return g.listTasks(_,v)}}}}var sO="2026-01-26";var mY="ui/notifications/tool-input-partial";var iY=I.union([I.literal("light"),I.literal("dark")]).describe("Color theme preference for the host environment."),Rg=I.union([I.literal("inline"),I.literal("fullscreen"),I.literal("pip")]).describe("Display mode for UI presentation."),lY=I.union([I.literal("--color-background-primary"),I.literal("--color-background-secondary"),I.literal("--color-background-tertiary"),I.literal("--color-background-inverse"),I.literal("--color-background-ghost"),I.literal("--color-background-info"),I.literal("--color-background-danger"),I.literal("--color-background-success"),I.literal("--color-background-warning"),I.literal("--color-background-disabled"),I.literal("--color-text-primary"),I.literal("--color-text-secondary"),I.literal("--color-text-tertiary"),I.literal("--color-text-inverse"),I.literal("--color-text-ghost"),I.literal("--color-text-info"),I.literal("--color-text-danger"),I.literal("--color-text-success"),I.literal("--color-text-warning"),I.literal("--color-text-disabled"),I.literal("--color-border-primary"),I.literal("--color-border-secondary"),I.literal("--color-border-tertiary"),I.literal("--color-border-inverse"),I.literal("--color-border-ghost"),I.literal("--color-border-info"),I.literal("--color-border-danger"),I.literal("--color-border-success"),I.literal("--color-border-warning"),I.literal("--color-border-disabled"),I.literal("--color-ring-primary"),I.literal("--color-ring-secondary"),I.literal("--color-ring-inverse"),I.literal("--color-ring-info"),I.literal("--color-ring-danger"),I.literal("--color-ring-success"),I.literal("--color-ring-warning"),I.literal("--font-sans"),I.literal("--font-mono"),I.literal("--font-weight-normal"),I.literal("--font-weight-medium"),I.literal("--font-weight-semibold"),I.literal("--font-weight-bold"),I.literal("--font-text-xs-size"),I.literal("--font-text-sm-size"),I.literal("--font-text-md-size"),I.literal("--font-text-lg-size"),I.literal("--font-heading-xs-size"),I.literal("--font-heading-sm-size"),I.literal("--font-heading-md-size"),I.literal("--font-heading-lg-size"),I.literal("--font-heading-xl-size"),I.literal("--font-heading-2xl-size"),I.literal("--font-heading-3xl-size"),I.literal("--font-text-xs-line-height"),I.literal("--font-text-sm-line-height"),I.literal("--font-text-md-line-height"),I.literal("--font-text-lg-line-height"),I.literal("--font-heading-xs-line-height"),I.literal("--font-heading-sm-line-height"),I.literal("--font-heading-md-line-height"),I.literal("--font-heading-lg-line-height"),I.literal("--font-heading-xl-line-height"),I.literal("--font-heading-2xl-line-height"),I.literal("--font-heading-3xl-line-height"),I.literal("--border-radius-xs"),I.literal("--border-radius-sm"),I.literal("--border-radius-md"),I.literal("--border-radius-lg"),I.literal("--border-radius-xl"),I.literal("--border-radius-full"),I.literal("--border-width-regular"),I.literal("--shadow-hairline"),I.literal("--shadow-sm"),I.literal("--shadow-md"),I.literal("--shadow-lg")]).describe("CSS variable keys available to MCP apps for theming."),hY=I.record(lY.describe(`Style variables for theming MCP apps.
147
147
 
148
148
  Individual style keys are optional - hosts may provide any subset of these values.
149
149
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
150
150
 
151
151
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
152
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),L.union([L.string(),L.undefined()]).describe(`Style variables for theming MCP apps.
152
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),I.union([I.string(),I.undefined()]).describe(`Style variables for theming MCP apps.
153
153
 
154
154
  Individual style keys are optional - hosts may provide any subset of these values.
155
155
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
@@ -161,10 +161,10 @@ Individual style keys are optional - hosts may provide any subset of these value
161
161
  Values are strings containing CSS values (colors, sizes, font stacks, etc.).
162
162
 
163
163
  Note: This type uses \`Record<K, string | undefined>\` rather than \`Partial<Record<K, string>>\`
164
- for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),fY=L.object({method:L.literal("ui/open-link"),params:L.object({url:L.string().describe("URL to open in the host's browser")})}),mY=L.object({isError:L.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),EY=L.object({isError:L.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),cY=L.object({isError:L.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),iY=L.object({method:L.literal("ui/notifications/sandbox-proxy-ready"),params:L.object({})}),pO=L.object({connectDomains:L.array(L.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
164
+ for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),xY=I.object({method:I.literal("ui/open-link"),params:I.object({url:I.string().describe("URL to open in the host's browser")})}),pY=I.object({isError:I.boolean().optional().describe("True if the host failed to open the URL (e.g., due to security policy).")}).passthrough(),oY=I.object({isError:I.boolean().optional().describe("True if the download failed (e.g., user cancelled or host denied).")}).passthrough(),nY=I.object({isError:I.boolean().optional().describe("True if the host rejected or failed to deliver the message.")}).passthrough(),tY=I.object({method:I.literal("ui/notifications/sandbox-proxy-ready"),params:I.object({})}),eO=I.object({connectDomains:I.array(I.string()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket).
165
165
 
166
166
  - Maps to CSP \`connect-src\` directive
167
- - Empty or omitted → no network connections (secure default)`),resourceDomains:L.array(L.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:L.array(L.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:L.array(L.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),oO=L.object({camera:L.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:L.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:L.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:L.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),lY=L.object({method:L.literal("ui/notifications/size-changed"),params:L.object({width:L.number().optional().describe("New width in pixels."),height:L.number().optional().describe("New height in pixels.")})}),hY=L.object({method:L.literal("ui/notifications/tool-input"),params:L.object({arguments:L.record(L.string(),L.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),xY=L.object({method:L.literal("ui/notifications/tool-input-partial"),params:L.object({arguments:L.record(L.string(),L.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),pY=L.object({method:L.literal("ui/notifications/tool-cancelled"),params:L.object({reason:L.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),oY=L.object({fonts:L.string().optional()}),nY=L.object({variables:CY.optional().describe("CSS variables for theming the app."),css:oY.optional().describe("CSS blocks that apps can inject.")}),tY=L.object({method:L.literal("ui/resource-teardown"),params:L.object({})}),dY=L.record(L.string(),L.unknown()),kW=L.object({text:L.object({}).optional().describe("Host supports text content blocks."),image:L.object({}).optional().describe("Host supports image content blocks."),audio:L.object({}).optional().describe("Host supports audio content blocks."),resource:L.object({}).optional().describe("Host supports resource content blocks."),resourceLink:L.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:L.object({}).optional().describe("Host supports structured content.")}),aY=L.object({method:L.literal("ui/notifications/request-teardown"),params:L.object({}).optional()}),sY=L.object({experimental:L.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:L.object({}).optional().describe("Host supports opening external URLs."),downloadFile:L.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:L.object({listChanged:L.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:L.object({listChanged:L.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:L.object({}).optional().describe("Host accepts log messages."),sandbox:L.object({permissions:oO.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:pO.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:kW.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:kW.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),eY=L.object({experimental:L.object({}).optional().describe("Experimental features (structure TBD)."),tools:L.object({listChanged:L.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:L.array(Qg).optional().describe("Display modes the app supports.")}),$A=L.object({method:L.literal("ui/notifications/initialized"),params:L.object({}).optional()}),PR=L.object({csp:pO.optional().describe("Content Security Policy configuration for UI resources."),permissions:oO.optional().describe("Sandbox permissions requested by the UI resource."),domain:L.string().optional().describe(`Dedicated origin for view sandbox.
167
+ - Empty or omitted → no network connections (secure default)`),resourceDomains:I.array(I.string()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:I.array(I.string()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:I.array(I.string()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),$G=I.object({camera:I.object({}).optional().describe("Request camera access.\n\nMaps to Permission Policy `camera` feature."),microphone:I.object({}).optional().describe("Request microphone access.\n\nMaps to Permission Policy `microphone` feature."),geolocation:I.object({}).optional().describe("Request geolocation access.\n\nMaps to Permission Policy `geolocation` feature."),clipboardWrite:I.object({}).optional().describe("Request clipboard write access.\n\nMaps to Permission Policy `clipboard-write` feature.")}),dY=I.object({method:I.literal("ui/notifications/size-changed"),params:I.object({width:I.number().optional().describe("New width in pixels."),height:I.number().optional().describe("New height in pixels.")})}),aY=I.object({method:I.literal("ui/notifications/tool-input"),params:I.object({arguments:I.record(I.string(),I.unknown().describe("Complete tool call arguments as key-value pairs.")).optional().describe("Complete tool call arguments as key-value pairs.")})}),sY=I.object({method:I.literal("ui/notifications/tool-input-partial"),params:I.object({arguments:I.record(I.string(),I.unknown().describe("Partial tool call arguments (incomplete, may change).")).optional().describe("Partial tool call arguments (incomplete, may change).")})}),eY=I.object({method:I.literal("ui/notifications/tool-cancelled"),params:I.object({reason:I.string().optional().describe('Optional reason for the cancellation (e.g., "user action", "timeout").')})}),$q=I.object({fonts:I.string().optional()}),vq=I.object({variables:hY.optional().describe("CSS variables for theming the app."),css:$q.optional().describe("CSS blocks that apps can inject.")}),Uq=I.object({method:I.literal("ui/resource-teardown"),params:I.object({})}),gq=I.record(I.string(),I.unknown()),qW=I.object({text:I.object({}).optional().describe("Host supports text content blocks."),image:I.object({}).optional().describe("Host supports image content blocks."),audio:I.object({}).optional().describe("Host supports audio content blocks."),resource:I.object({}).optional().describe("Host supports resource content blocks."),resourceLink:I.object({}).optional().describe("Host supports resource link content blocks."),structuredContent:I.object({}).optional().describe("Host supports structured content.")}),_q=I.object({method:I.literal("ui/notifications/request-teardown"),params:I.object({}).optional()}),zq=I.object({experimental:I.object({}).optional().describe("Experimental features (structure TBD)."),openLinks:I.object({}).optional().describe("Host supports opening external URLs."),downloadFile:I.object({}).optional().describe("Host supports file downloads via ui/download-file."),serverTools:I.object({listChanged:I.boolean().optional().describe("Host supports tools/list_changed notifications.")}).optional().describe("Host can proxy tool calls to the MCP server."),serverResources:I.object({listChanged:I.boolean().optional().describe("Host supports resources/list_changed notifications.")}).optional().describe("Host can proxy resource reads to the MCP server."),logging:I.object({}).optional().describe("Host accepts log messages."),sandbox:I.object({permissions:$G.optional().describe("Permissions granted by the host (camera, microphone, geolocation)."),csp:eO.optional().describe("CSP domains approved by the host.")}).optional().describe("Sandbox configuration applied by the host."),updateModelContext:qW.optional().describe("Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns."),message:qW.optional().describe("Host supports receiving content messages (ui/message) from the view.")}),Jq=I.object({experimental:I.object({}).optional().describe("Experimental features (structure TBD)."),tools:I.object({listChanged:I.boolean().optional().describe("App supports tools/list_changed notifications.")}).optional().describe("App exposes MCP-style tools that the host can call."),availableDisplayModes:I.array(Rg).optional().describe("Display modes the app supports.")}),bq=I.object({method:I.literal("ui/notifications/initialized"),params:I.object({}).optional()}),Ay=I.object({csp:eO.optional().describe("Content Security Policy configuration for UI resources."),permissions:$G.optional().describe("Sandbox permissions requested by the UI resource."),domain:I.string().optional().describe(`Dedicated origin for view sandbox.
168
168
 
169
169
  Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists.
170
170
 
@@ -172,16 +172,16 @@ Useful when views need stable, dedicated origins for OAuth callbacks, CORS polic
172
172
  - Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`)
173
173
  - URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`)
174
174
 
175
- If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:L.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
175
+ If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:I.boolean().optional().describe(`Visual boundary preference - true if view prefers a visible border.
176
176
 
177
177
  Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary.
178
178
 
179
179
  - \`true\`: request visible border + background
180
180
  - \`false\`: request no visible border + background
181
- - omitted: host decides border`)}),IW=L.object({method:L.literal("ui/request-display-mode"),params:L.object({mode:Qg.describe("The display mode being requested.")})}),vA=L.object({mode:Qg.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),UA=L.union([L.literal("model"),L.literal("app")]).describe("Tool visibility scope - who can access the tool."),kR=L.object({resourceUri:L.string().optional(),visibility:L.array(UA).optional().describe(`Who can access this tool. Default: ["model", "app"]
181
+ - omitted: host decides border`)}),XW=I.object({method:I.literal("ui/request-display-mode"),params:I.object({mode:Rg.describe("The display mode being requested.")})}),Oq=I.object({mode:Rg.describe("The display mode that was actually set. May differ from requested if not supported.")}).passthrough(),Gq=I.union([I.literal("model"),I.literal("app")]).describe("Tool visibility scope - who can access the tool."),wy=I.object({resourceUri:I.string().optional(),visibility:I.array(Gq).optional().describe(`Who can access this tool. Default: ["model", "app"]
182
182
  - "model": Tool visible to and callable by the agent
183
- - "app": Tool callable by the app from this server only`)}),IR=L.object({mimeTypes:L.array(L.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),gA=L.object({method:L.literal("ui/download-file"),params:L.object({contents:L.array(L.union([fO,mO])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),_A=L.object({method:L.literal("ui/message"),params:L.object({role:L.literal("user").describe('Message role, currently only "user" is supported.'),content:L.array(bU).describe("Message content blocks (text, image, etc.).")})}),HR=L.object({method:L.literal("ui/notifications/sandbox-resource-ready"),params:L.object({html:L.string().describe("HTML content to load into the inner iframe."),sandbox:L.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:pO.optional().describe("CSP configuration from resource metadata."),permissions:oO.optional().describe("Sandbox permissions from resource metadata.")})}),zA=L.object({method:L.literal("ui/notifications/tool-result"),params:V6.describe("Standard MCP tool execution result.")}),HW=L.object({toolInfo:L.object({id:_U.optional().describe("JSON-RPC id of the tools/call request."),tool:A0.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:jY.optional().describe("Current color theme preference."),styles:nY.optional().describe("Style configuration for theming the app."),displayMode:Qg.optional().describe("How the UI is currently displayed."),availableDisplayModes:L.array(Qg).optional().describe("Display modes the host supports."),containerDimensions:L.union([L.object({height:L.number().describe("Fixed container height in pixels.")}),L.object({maxHeight:L.union([L.number(),L.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(L.union([L.object({width:L.number().describe("Fixed container width in pixels.")}),L.object({maxWidth:L.union([L.number(),L.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
184
- container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:L.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:L.string().optional().describe("User's timezone in IANA format."),userAgent:L.string().optional().describe("Host application identifier."),platform:L.union([L.literal("web"),L.literal("desktop"),L.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:L.object({touch:L.boolean().optional().describe("Whether the device supports touch input."),hover:L.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:L.object({top:L.number().describe("Top safe area inset in pixels."),right:L.number().describe("Right safe area inset in pixels."),bottom:L.number().describe("Bottom safe area inset in pixels."),left:L.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),bA=L.object({method:L.literal("ui/notifications/host-context-changed"),params:HW.describe("Partial context update containing only changed fields.")}),JA=L.object({method:L.literal("ui/update-model-context"),params:L.object({content:L.array(bU).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:L.record(L.string(),L.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),OA=L.object({method:L.literal("ui/initialize"),params:L.object({appInfo:Ig.describe("App identification (name and version)."),appCapabilities:eY.describe("Features and capabilities this app provides."),protocolVersion:L.string().describe("Protocol version this app supports.")})}),GA=L.object({protocolVersion:L.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:Ig.describe("Host application identification and version."),hostCapabilities:sY.describe("Features and capabilities provided by the host."),hostContext:HW.describe("Rich context about the host environment.")}).passthrough();class w0{eventTarget;eventSource;messageListener;constructor($=window.parent,v){this.eventTarget=$,this.eventSource=v,this.messageListener=(g)=>{if(v&&g.source!==this.eventSource){console.debug("Ignoring message from unknown source",g);return}let _=_W.safeParse(g.data);if(_.success)console.debug("Parsed message",_.data),this.onmessage?.(_.data);else if(g.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",_.error.message,g);else console.error("Failed to parse message",_.error.message,g),this.onerror?.(Error("Invalid JSON-RPC message received: "+_.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send($,v){if($.method!==TY)console.debug("Sending message",$);this.eventTarget.postMessage($,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}class KA extends Mg{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor($,v={},g={autoResize:!0}){super(g);this._appInfo=$,this._capabilities=v,this.options=g,this.setRequestHandler(j6,(_)=>{return console.log("Received ping:",_.params),{}}),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput($){this.setNotificationHandler(hY,(v)=>$(v.params))}set ontoolinputpartial($){this.setNotificationHandler(xY,(v)=>$(v.params))}set ontoolresult($){this.setNotificationHandler(zA,(v)=>$(v.params))}set ontoolcancelled($){this.setNotificationHandler(pY,(v)=>$(v.params))}set onhostcontextchanged($){this.setNotificationHandler(bA,(v)=>{this._hostContext={...this._hostContext,...v.params},$(v.params)})}set onteardown($){this.setRequestHandler(tY,(v,g)=>$(v.params,g))}set oncalltool($){this.setRequestHandler(Zg,(v,g)=>$(v.params,g))}set onlisttools($){this.setRequestHandler(wg,(v,g)=>$(v.params,g))}assertCapabilityForMethod($){}assertRequestHandlerCapability($){switch($){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${$})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${$} registered`)}}assertNotificationCapability($){}assertTaskCapability($){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability($){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool($,v){if(typeof $==="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${$}"). Did you mean: callServerTool({ name: "${$}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:$},V6,v)}async readServerResource($,v){return await this.request({method:"resources/read",params:$},Xg,v)}async listServerResources($,v){return await this.request({method:"resources/list",params:$},qg,v)}sendMessage($,v){return this.request({method:"ui/message",params:$},cY,v)}sendLog($){return this.notification({method:"notifications/message",params:$})}updateModelContext($,v){return this.request({method:"ui/update-model-context",params:$},K0,v)}openLink($,v){return this.request({method:"ui/open-link",params:$},mY,v)}sendOpenLink=this.openLink;downloadFile($,v){return this.request({method:"ui/download-file",params:$},EY,v)}requestTeardown($={}){return this.notification({method:"ui/notifications/request-teardown",params:$})}requestDisplayMode($,v){return this.request({method:"ui/request-display-mode",params:$},vA,v)}sendSizeChanged($){return this.notification({method:"ui/notifications/size-changed",params:$})}setupSizeChangedNotifications(){let $=!1,v=0,g=0,_=()=>{if($)return;$=!0,requestAnimationFrame(()=>{$=!1;let z=document.documentElement,b=z.style.width,J=z.style.height;z.style.width="fit-content",z.style.height="max-content";let G=z.getBoundingClientRect();z.style.width=b,z.style.height=J;let K=window.innerWidth-z.clientWidth,W=Math.ceil(G.width+K),B=Math.ceil(G.height);if(W!==v||B!==g)v=W,g=B,this.sendSizeChanged({width:W,height:B})})};_();let U=new ResizeObserver(_);return U.observe(document.documentElement),U.observe(document.body),()=>U.disconnect()}async connect($=new w0(window.parent,window.parent),v){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect($);try{let g=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:xO}},GA,v);if(g===void 0)throw Error(`Server sent invalid initialize result: ${g}`);if(this._hostCapabilities=g.hostCapabilities,this._hostInfo=g.hostInfo,this._hostContext=g.hostContext,await this.notification({method:"ui/notifications/initialized"}),this.options?.autoResize)this.setupSizeChangedNotifications()}catch(g){throw this.close(),g}}}function LW($){if(!$)return"";let v=[];if($.camera)v.push("camera");if($.microphone)v.push("microphone");if($.geolocation)v.push("geolocation");if($.clipboardWrite)v.push("clipboard-write");return v.join("; ")}var WA=[xO];class nO extends Mg{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;constructor($,v,g,_){super(_);this._client=$,this._hostInfo=v,this._capabilities=g,this._hostContext=_?.hostContext||{},this.setRequestHandler(OA,(U)=>this._oninitialize(U)),this.setRequestHandler(j6,(U,z)=>{return this.onping?.(U.params,z),{}}),this.setRequestHandler(IW,(U)=>{return{mode:this._hostContext.displayMode??"inline"}})}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;set onsizechange($){this.setNotificationHandler(lY,(v)=>$(v.params))}set onsandboxready($){this.setNotificationHandler(iY,(v)=>$(v.params))}set oninitialized($){this.setNotificationHandler($A,(v)=>$(v.params))}set onmessage($){this.setRequestHandler(_A,async(v,g)=>{return $(v.params,g)})}set onopenlink($){this.setRequestHandler(fY,async(v,g)=>{return $(v.params,g)})}set ondownloadfile($){this.setRequestHandler(gA,async(v,g)=>{return $(v.params,g)})}set onrequestteardown($){this.setNotificationHandler(aY,(v)=>$(v.params))}set onrequestdisplaymode($){this.setRequestHandler(IW,async(v,g)=>{return $(v.params,g)})}set onloggingmessage($){this.setNotificationHandler(iO,async(v)=>{$(v.params)})}set onupdatemodelcontext($){this.setRequestHandler(JA,async(v,g)=>{return $(v.params,g)})}set oncalltool($){this.setRequestHandler(Zg,async(v,g)=>{return $(v.params,g)})}sendToolListChanged($={}){return this.notification({method:"notifications/tools/list_changed",params:$})}set onlistresources($){this.setRequestHandler(QO,async(v,g)=>{return $(v.params,g)})}set onlistresourcetemplates($){this.setRequestHandler(NO,async(v,g)=>{return $(v.params,g)})}set onreadresource($){this.setRequestHandler(RO,async(v,g)=>{return $(v.params,g)})}sendResourceListChanged($={}){return this.notification({method:"notifications/resources/list_changed",params:$})}set onlistprompts($){this.setRequestHandler(DO,async(v,g)=>{return $(v.params,g)})}sendPromptListChanged($={}){return this.notification({method:"notifications/prompts/list_changed",params:$})}assertCapabilityForMethod($){}assertRequestHandlerCapability($){}assertNotificationCapability($){}assertTaskCapability($){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability($){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize($){let v=$.params.protocolVersion;return this._appCapabilities=$.params.appCapabilities,this._appInfo=$.params.appInfo,{protocolVersion:WA.includes(v)?v:xO,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext($){let v={},g=!1;for(let _ of Object.keys($)){let U=this._hostContext[_],z=$[_];if(BA(U,z))continue;v[_]=z,g=!0}if(g)this._hostContext=$,this.sendHostContextChange(v)}sendHostContextChange($){return this.notification({method:"ui/notifications/host-context-changed",params:$})}sendToolInput($){return this.notification({method:"ui/notifications/tool-input",params:$})}sendToolInputPartial($){return this.notification({method:"ui/notifications/tool-input-partial",params:$})}sendToolResult($){return this.notification({method:"ui/notifications/tool-result",params:$})}sendToolCancelled($){return this.notification({method:"ui/notifications/tool-cancelled",params:$})}sendSandboxResourceReady($){return this.notification({method:"ui/notifications/sandbox-resource-ready",params:$})}teardownResource($,v){return this.request({method:"ui/resource-teardown",params:$},dY,v)}sendResourceTeardown=this.teardownResource;async connect($){if(this.transport)throw Error("AppBridge is already connected. Call close() before connecting again.");if(this._client){let v=this._client.getServerCapabilities();if(!v)throw Error("Client server capabilities not available");if(v.tools){if(this.oncalltool=async(g,_)=>{return this._client.request({method:"tools/call",params:g},V6,{signal:_.signal})},v.tools.listChanged)this._client.setNotificationHandler(cO,(g)=>this.sendToolListChanged(g.params))}if(v.resources){if(this.onlistresources=async(g,_)=>{return this._client.request({method:"resources/list",params:g},qg,{signal:_.signal})},this.onlistresourcetemplates=async(g,_)=>{return this._client.request({method:"resources/templates/list",params:g},rO,{signal:_.signal})},this.onreadresource=async(g,_)=>{return this._client.request({method:"resources/read",params:g},Xg,{signal:_.signal})},v.resources.listChanged)this._client.setNotificationHandler(yO,(g)=>this.sendResourceListChanged(g.params))}if(v.prompts){if(this.onlistprompts=async(g,_)=>{return this._client.request({method:"prompts/list",params:g},TO,{signal:_.signal})},v.prompts.listChanged)this._client.setNotificationHandler(EO,(g)=>this.sendPromptListChanged(g.params))}}return super.connect($)}}function BA($,v){return JSON.stringify($)===JSON.stringify(v)}function tO($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function PA($){return tO($)&&Array.isArray($.content)&&$.content.every((v)=>tO(v)&&typeof v.type==="string")}function kA(...$){for(let v of $)if(typeof v==="string"){if(v.trim().length>0)return v}return}function IA($){if(typeof $==="string")return $;if($===void 0)return;try{return JSON.stringify($)}catch(v){return console.debug("[ext-app-tool-result] stringify failed",v),String($)}}function dO($){let v=$.success===!1;if(PA($.result))return{...$.result,isError:$.result.isError===!0||v};let g=tO($.result)?$.result:null,_=kA($.detailedContent,$.content,g?.detailedContent,g?.content,g?.textResultForLlm,g?.text,g?.message,typeof $.result==="string"?$.result:void 0,$.error)??IA($.result);return{content:_?[{type:"text",text:_}]:[],isError:v}}function FW($,v){if($===v)return!0;if($.isError!==v.isError)return!1;try{let g=JSON.stringify($),_=JSON.stringify(v);if(g===void 0||_===void 0)return!1;if(Math.abs(g.length-_.length)>2000000)return!1;return g===_}catch{return!1}}function YW($,v){switch($){case"html":return typeof v.html==="string"&&v.html.length>0||typeof v.content==="string"&&v.content.length>0;case"json-render":case"graph":return!0;case"mcp-app":return v.viewerType==="web-artifact"&&typeof v.path==="string"&&v.path.length>0||typeof v.url==="string"&&v.url.length>0;case"webpage":return typeof v.url==="string"&&v.url.length>0;default:return!1}}var aO="allow-scripts allow-popups allow-popups-to-escape-sandbox";function AW($){return Boolean($)&&typeof $==="object"&&$!==null&&!Array.isArray($)&&"ok"in $&&typeof $.ok==="boolean"}async function HA($,v){let g=await fetch("/api/canvas/frame-documents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:$,sandbox:v})}),_=await g.json();if(!g.ok||!AW(_)||!_.ok||typeof _.url!=="string"){let U=AW(_)&&_.error?_.error:`Frame document request failed with HTTP ${g.status}`;throw Error(U)}return _.url}function qW($,v){let[g,_]=x(null);return m(()=>{if(_(null),!$)return;let U=!1;return HA($,v).then((z)=>{if(!U)_(z)}).catch((z)=>{console.error("[iframe-document] failed to create frame document:",z)}),()=>{U=!0}},[$,v]),t$(()=>({attributes:g?{src:g}:{},ready:Boolean(g),key:g??""}),[g])}async function U4($,v){let _=await(await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})).json();if(!_.ok)throw Error(_.error??`Request failed: ${$}`);return _.result}function LA($){return/AppleWebKit/.test($)&&!/Chrome|Chromium|CriOS|Edg|Android/.test($)}var XW=0,sO=null;function FA(){let $=XW++;if(typeof window<"u"){if(sO)clearTimeout(sO);sO=setTimeout(()=>{XW=0},3000)}return $}function YA($,v){return v?$==="done":$==="ready"||$==="done"}function AA($,v){let g=typeof $.data.html==="string"?$.data.html:"",_=typeof $.data.serverName==="string"?$.data.serverName:"",U=typeof $.data.appSessionId==="string"?$.data.appSessionId:"",z=typeof $.data.sessionStatus==="string"?$.data.sessionStatus:"";return`${$.id}:${v}:${_}:${U}:${z}:${g}`}function qA($,v){if($==="fullscreen")return{nextMode:"fullscreen",shouldExpand:!v,shouldCollapse:!1};if($==="inline")return{nextMode:"inline",shouldExpand:!1,shouldCollapse:v};return{nextMode:$,shouldExpand:!1,shouldCollapse:!1}}async function wW($,v,g){if(await $.sendToolInput({arguments:v}),g)await $.sendToolResult(g)}function XA($){return typeof $==="string"&&$.trim().length>0?$.trim():aO}function wA($,v){return`<script data-pmx-canvas-ax-bridge>
183
+ - "app": Tool callable by the app from this server only`)}),Zy=I.object({mimeTypes:I.array(I.string()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Kq=I.object({method:I.literal("ui/download-file"),params:I.object({contents:I.array(I.union([xO,pO])).describe("Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.")})}),Wq=I.object({method:I.literal("ui/message"),params:I.object({role:I.literal("user").describe('Message role, currently only "user" is supported.'),content:I.array(WU).describe("Message content blocks (text, image, etc.).")})}),Sy=I.object({method:I.literal("ui/notifications/sandbox-resource-ready"),params:I.object({html:I.string().describe("HTML content to load into the inner iframe."),sandbox:I.string().optional().describe("Optional override for the inner iframe's sandbox attribute."),csp:eO.optional().describe("CSP configuration from resource metadata."),permissions:$G.optional().describe("Sandbox permissions from resource metadata.")})}),Bq=I.object({method:I.literal("ui/notifications/tool-result"),params:E6.describe("Standard MCP tool execution result.")}),AW=I.object({toolInfo:I.object({id:GU.optional().describe("JSON-RPC id of the tools/call request."),tool:Q0.describe("Tool definition including name, inputSchema, etc.")}).optional().describe("Metadata of the tool call that instantiated this App."),theme:iY.optional().describe("Current color theme preference."),styles:vq.optional().describe("Style configuration for theming the app."),displayMode:Rg.optional().describe("How the UI is currently displayed."),availableDisplayModes:I.array(Rg).optional().describe("Display modes the host supports."),containerDimensions:I.union([I.object({height:I.number().describe("Fixed container height in pixels.")}),I.object({maxHeight:I.union([I.number(),I.undefined()]).optional().describe("Maximum container height in pixels.")})]).and(I.union([I.object({width:I.number().describe("Fixed container width in pixels.")}),I.object({maxWidth:I.union([I.number(),I.undefined()]).optional().describe("Maximum container width in pixels.")})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other
184
+ container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:I.string().optional().describe("User's language and region preference in BCP 47 format."),timeZone:I.string().optional().describe("User's timezone in IANA format."),userAgent:I.string().optional().describe("Host application identifier."),platform:I.union([I.literal("web"),I.literal("desktop"),I.literal("mobile")]).optional().describe("Platform type for responsive design decisions."),deviceCapabilities:I.object({touch:I.boolean().optional().describe("Whether the device supports touch input."),hover:I.boolean().optional().describe("Whether the device supports hover interactions.")}).optional().describe("Device input capabilities."),safeAreaInsets:I.object({top:I.number().describe("Top safe area inset in pixels."),right:I.number().describe("Right safe area inset in pixels."),bottom:I.number().describe("Bottom safe area inset in pixels."),left:I.number().describe("Left safe area inset in pixels.")}).optional().describe("Mobile safe area boundaries in pixels.")}).passthrough(),Pq=I.object({method:I.literal("ui/notifications/host-context-changed"),params:AW.describe("Partial context update containing only changed fields.")}),kq=I.object({method:I.literal("ui/update-model-context"),params:I.object({content:I.array(WU).optional().describe("Context content blocks (text, image, etc.)."),structuredContent:I.record(I.string(),I.unknown().describe("Structured content for machine-readable context data.")).optional().describe("Structured content for machine-readable context data.")})}),Hq=I.object({method:I.literal("ui/initialize"),params:I.object({appInfo:qg.describe("App identification (name and version)."),appCapabilities:Jq.describe("Features and capabilities this app provides."),protocolVersion:I.string().describe("Protocol version this app supports.")})}),Iq=I.object({protocolVersion:I.string().describe('Negotiated protocol version string (e.g., "2025-11-21").'),hostInfo:qg.describe("Host application identification and version."),hostCapabilities:zq.describe("Features and capabilities provided by the host."),hostContext:AW.describe("Rich context about the host environment.")}).passthrough();class u0{eventTarget;eventSource;messageListener;constructor($=window.parent,v){this.eventTarget=$,this.eventSource=v,this.messageListener=(g)=>{if(v&&g.source!==this.eventSource){console.debug("Ignoring message from unknown source",g);return}let _=KW.safeParse(g.data);if(_.success)console.debug("Parsed message",_.data),this.onmessage?.(_.data);else if(g.data?.jsonrpc!=="2.0")console.debug("Ignoring non-JSON-RPC message",_.error.message,g);else console.error("Failed to parse message",_.error.message,g),this.onerror?.(Error("Invalid JSON-RPC message received: "+_.error.message))}}async start(){window.addEventListener("message",this.messageListener)}async send($,v){if($.method!==mY)console.debug("Sending message",$);this.eventTarget.postMessage($,"*")}async close(){window.removeEventListener("message",this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion}class Lq extends yg{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;constructor($,v={},g={autoResize:!0}){super(g);this._appInfo=$,this._capabilities=v,this.options=g,this.setRequestHandler(f6,(_)=>{return console.log("Received ping:",_.params),{}}),this.onhostcontextchanged=()=>{}}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}set ontoolinput($){this.setNotificationHandler(aY,(v)=>$(v.params))}set ontoolinputpartial($){this.setNotificationHandler(sY,(v)=>$(v.params))}set ontoolresult($){this.setNotificationHandler(Bq,(v)=>$(v.params))}set ontoolcancelled($){this.setNotificationHandler(eY,(v)=>$(v.params))}set onhostcontextchanged($){this.setNotificationHandler(Pq,(v)=>{this._hostContext={...this._hostContext,...v.params},$(v.params)})}set onteardown($){this.setRequestHandler(Uq,(v,g)=>$(v.params,g))}set oncalltool($){this.setRequestHandler(rg,(v,g)=>$(v.params,g))}set onlisttools($){this.setRequestHandler(Ng,(v,g)=>$(v.params,g))}assertCapabilityForMethod($){}assertRequestHandlerCapability($){switch($){case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Client does not support tool capability (required for ${$})`);return;case"ping":case"ui/resource-teardown":return;default:throw Error(`No handler for method ${$} registered`)}}assertNotificationCapability($){}assertTaskCapability($){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability($){throw Error("Task handlers are not supported in MCP Apps")}async callServerTool($,v){if(typeof $==="string")throw Error(`callServerTool() expects an object as its first argument, but received a string ("${$}"). Did you mean: callServerTool({ name: "${$}", arguments: { ... } })?`);return await this.request({method:"tools/call",params:$},E6,v)}async readServerResource($,v){return await this.request({method:"resources/read",params:$},Qg,v)}async listServerResources($,v){return await this.request({method:"resources/list",params:$},Mg,v)}sendMessage($,v){return this.request({method:"ui/message",params:$},nY,v)}sendLog($){return this.notification({method:"notifications/message",params:$})}updateModelContext($,v){return this.request({method:"ui/update-model-context",params:$},L0,v)}openLink($,v){return this.request({method:"ui/open-link",params:$},pY,v)}sendOpenLink=this.openLink;downloadFile($,v){return this.request({method:"ui/download-file",params:$},oY,v)}requestTeardown($={}){return this.notification({method:"ui/notifications/request-teardown",params:$})}requestDisplayMode($,v){return this.request({method:"ui/request-display-mode",params:$},Oq,v)}sendSizeChanged($){return this.notification({method:"ui/notifications/size-changed",params:$})}setupSizeChangedNotifications(){let $=!1,v=0,g=0,_=()=>{if($)return;$=!0,requestAnimationFrame(()=>{$=!1;let z=document.documentElement,J=z.style.width,b=z.style.height;z.style.width="fit-content",z.style.height="max-content";let G=z.getBoundingClientRect();z.style.width=J,z.style.height=b;let K=window.innerWidth-z.clientWidth,W=Math.ceil(G.width+K),B=Math.ceil(G.height);if(W!==v||B!==g)v=W,g=B,this.sendSizeChanged({width:W,height:B})})};_();let U=new ResizeObserver(_);return U.observe(document.documentElement),U.observe(document.body),()=>U.disconnect()}async connect($=new u0(window.parent,window.parent),v){if(this.transport)throw Error("App is already connected. Call close() before connecting again.");await super.connect($);try{let g=await this.request({method:"ui/initialize",params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:sO}},Iq,v);if(g===void 0)throw Error(`Server sent invalid initialize result: ${g}`);if(this._hostCapabilities=g.hostCapabilities,this._hostInfo=g.hostInfo,this._hostContext=g.hostContext,await this.notification({method:"ui/notifications/initialized"}),this.options?.autoResize)this.setupSizeChangedNotifications()}catch(g){throw this.close(),g}}}function wW($){if(!$)return"";let v=[];if($.camera)v.push("camera");if($.microphone)v.push("microphone");if($.geolocation)v.push("geolocation");if($.clipboardWrite)v.push("clipboard-write");return v.join("; ")}var Fq=[sO];class vG extends yg{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;constructor($,v,g,_){super(_);this._client=$,this._hostInfo=v,this._capabilities=g,this._hostContext=_?.hostContext||{},this.setRequestHandler(Hq,(U)=>this._oninitialize(U)),this.setRequestHandler(f6,(U,z)=>{return this.onping?.(U.params,z),{}}),this.setRequestHandler(XW,(U)=>{return{mode:this._hostContext.displayMode??"inline"}})}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;set onsizechange($){this.setNotificationHandler(dY,(v)=>$(v.params))}set onsandboxready($){this.setNotificationHandler(tY,(v)=>$(v.params))}set oninitialized($){this.setNotificationHandler(bq,(v)=>$(v.params))}set onmessage($){this.setRequestHandler(Wq,async(v,g)=>{return $(v.params,g)})}set onopenlink($){this.setRequestHandler(xY,async(v,g)=>{return $(v.params,g)})}set ondownloadfile($){this.setRequestHandler(Kq,async(v,g)=>{return $(v.params,g)})}set onrequestteardown($){this.setNotificationHandler(_q,(v)=>$(v.params))}set onrequestdisplaymode($){this.setRequestHandler(XW,async(v,g)=>{return $(v.params,g)})}set onloggingmessage($){this.setNotificationHandler(tO,async(v)=>{$(v.params)})}set onupdatemodelcontext($){this.setRequestHandler(kq,async(v,g)=>{return $(v.params,g)})}set oncalltool($){this.setRequestHandler(rg,async(v,g)=>{return $(v.params,g)})}sendToolListChanged($={}){return this.notification({method:"notifications/tools/list_changed",params:$})}set onlistresources($){this.setRequestHandler(TO,async(v,g)=>{return $(v.params,g)})}set onlistresourcetemplates($){this.setRequestHandler(jO,async(v,g)=>{return $(v.params,g)})}set onreadresource($){this.setRequestHandler(fO,async(v,g)=>{return $(v.params,g)})}sendResourceListChanged($={}){return this.notification({method:"notifications/resources/list_changed",params:$})}set onlistprompts($){this.setRequestHandler(cO,async(v,g)=>{return $(v.params,g)})}sendPromptListChanged($={}){return this.notification({method:"notifications/prompts/list_changed",params:$})}assertCapabilityForMethod($){}assertRequestHandlerCapability($){}assertNotificationCapability($){}assertTaskCapability($){throw Error("Tasks are not supported in MCP Apps")}assertTaskHandlerCapability($){throw Error("Task handlers are not supported in MCP Apps")}getCapabilities(){return this._capabilities}async _oninitialize($){let v=$.params.protocolVersion;return this._appCapabilities=$.params.appCapabilities,this._appInfo=$.params.appInfo,{protocolVersion:Fq.includes(v)?v:sO,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext($){let v={},g=!1;for(let _ of Object.keys($)){let U=this._hostContext[_],z=$[_];if(Yq(U,z))continue;v[_]=z,g=!0}if(g)this._hostContext=$,this.sendHostContextChange(v)}sendHostContextChange($){return this.notification({method:"ui/notifications/host-context-changed",params:$})}sendToolInput($){return this.notification({method:"ui/notifications/tool-input",params:$})}sendToolInputPartial($){return this.notification({method:"ui/notifications/tool-input-partial",params:$})}sendToolResult($){return this.notification({method:"ui/notifications/tool-result",params:$})}sendToolCancelled($){return this.notification({method:"ui/notifications/tool-cancelled",params:$})}sendSandboxResourceReady($){return this.notification({method:"ui/notifications/sandbox-resource-ready",params:$})}teardownResource($,v){return this.request({method:"ui/resource-teardown",params:$},gq,v)}sendResourceTeardown=this.teardownResource;async connect($){if(this.transport)throw Error("AppBridge is already connected. Call close() before connecting again.");if(this._client){let v=this._client.getServerCapabilities();if(!v)throw Error("Client server capabilities not available");if(v.tools){if(this.oncalltool=async(g,_)=>{return this._client.request({method:"tools/call",params:g},E6,{signal:_.signal})},v.tools.listChanged)this._client.setNotificationHandler(nO,(g)=>this.sendToolListChanged(g.params))}if(v.resources){if(this.onlistresources=async(g,_)=>{return this._client.request({method:"resources/list",params:g},Mg,{signal:_.signal})},this.onlistresourcetemplates=async(g,_)=>{return this._client.request({method:"resources/templates/list",params:g},VO,{signal:_.signal})},this.onreadresource=async(g,_)=>{return this._client.request({method:"resources/read",params:g},Qg,{signal:_.signal})},v.resources.listChanged)this._client.setNotificationHandler(EO,(g)=>this.sendResourceListChanged(g.params))}if(v.prompts){if(this.onlistprompts=async(g,_)=>{return this._client.request({method:"prompts/list",params:g},mO,{signal:_.signal})},v.prompts.listChanged)this._client.setNotificationHandler(oO,(g)=>this.sendPromptListChanged(g.params))}}return super.connect($)}}function Yq($,v){return JSON.stringify($)===JSON.stringify(v)}function UG($){return $!==null&&typeof $==="object"&&!Array.isArray($)}function qq($){return UG($)&&Array.isArray($.content)&&$.content.every((v)=>UG(v)&&typeof v.type==="string")}function Xq(...$){for(let v of $)if(typeof v==="string"){if(v.trim().length>0)return v}return}function Aq($){if(typeof $==="string")return $;if($===void 0)return;try{return JSON.stringify($)}catch(v){return console.debug("[ext-app-tool-result] stringify failed",v),String($)}}function gG($){let v=$.success===!1;if(qq($.result))return{...$.result,isError:$.result.isError===!0||v};let g=UG($.result)?$.result:null,_=Xq($.detailedContent,$.content,g?.detailedContent,g?.content,g?.textResultForLlm,g?.text,g?.message,typeof $.result==="string"?$.result:void 0,$.error)??Aq($.result);return{content:_?[{type:"text",text:_}]:[],isError:v}}function ZW($,v){if($===v)return!0;if($.isError!==v.isError)return!1;try{let g=JSON.stringify($),_=JSON.stringify(v);if(g===void 0||_===void 0)return!1;if(Math.abs(g.length-_.length)>2000000)return!1;return g===_}catch{return!1}}function SW($,v){switch($){case"html":return typeof v.html==="string"&&v.html.length>0||typeof v.content==="string"&&v.content.length>0;case"json-render":case"graph":return!0;case"mcp-app":return v.viewerType==="web-artifact"&&typeof v.path==="string"&&v.path.length>0||typeof v.url==="string"&&v.url.length>0;case"webpage":return typeof v.url==="string"&&v.url.length>0;default:return!1}}var _G="allow-scripts allow-popups allow-popups-to-escape-sandbox";function MW($){return Boolean($)&&typeof $==="object"&&$!==null&&!Array.isArray($)&&"ok"in $&&typeof $.ok==="boolean"}async function wq($,v){let g=await fetch("/api/canvas/frame-documents",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({html:$,sandbox:v})}),_=await g.json();if(!g.ok||!MW(_)||!_.ok||typeof _.url!=="string"){let U=MW(_)&&_.error?_.error:`Frame document request failed with HTTP ${g.status}`;throw Error(U)}return _.url}function QW($,v){let[g,_]=x(null);return c(()=>{if(_(null),!$)return;let U=!1;return wq($,v).then((z)=>{if(!U)_(z)}).catch((z)=>{console.error("[iframe-document] failed to create frame document:",z)}),()=>{U=!0}},[$,v]),t$(()=>({attributes:g?{src:g}:{},ready:Boolean(g),key:g??""}),[g])}async function z4($,v){let _=await(await fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)})).json();if(!_.ok)throw Error(_.error??`Request failed: ${$}`);return _.result}function NW($){return/AppleWebKit/.test($)&&!/Chrome|Chromium|CriOS|Edg|Android/.test($)}var Zq=1000,Sq=7000;function BU($,v){if(typeof window>"u")return;let g=window;if(g.__PMX_EXTAPP_LOG??=[],g.__PMX_EXTAPP_LOG.length<500)g.__PMX_EXTAPP_LOG.push({t:Date.now(),nodeId:$,event:v})}var rW=Promise.resolve();function Mq($){rW=rW.then(async()=>{if(!$.remount())return;await $.awaitBoot(),await new Promise((v)=>setTimeout(v,Zq))}).catch(()=>{})}function Qq($,v){return v?$==="done":$==="ready"||$==="done"}function Nq($,v){let g=typeof $.data.html==="string"?$.data.html:"",_=typeof $.data.serverName==="string"?$.data.serverName:"",U=typeof $.data.appSessionId==="string"?$.data.appSessionId:"",z=typeof $.data.sessionStatus==="string"?$.data.sessionStatus:"";return`${$.id}:${v}:${_}:${U}:${z}:${g}`}function rq($,v){if($==="fullscreen")return{nextMode:"fullscreen",shouldExpand:!v,shouldCollapse:!1};if($==="inline")return{nextMode:"inline",shouldExpand:!1,shouldCollapse:v};return{nextMode:$,shouldExpand:!1,shouldCollapse:!1}}async function uW($,v,g){if(await $.sendToolInput({arguments:v}),g)await $.sendToolResult(g)}function uq($){return typeof $==="string"&&$.trim().length>0?$.trim():_G}function yq($,v){return`<script data-pmx-canvas-ax-bridge>
185
185
  (function () {
186
186
  const PMX_AX_TOKEN = ${JSON.stringify($)};
187
187
  const PMX_AX_NODE_ID = ${JSON.stringify(v)};
@@ -222,5 +222,5 @@ container holding the app. Specify either width or maxWidth, and either height o
222
222
  try { window.dispatchEvent(new CustomEvent('pmx-ax-ack', { detail: { result: result, interaction: m.interaction || null } })); } catch (e) {}
223
223
  });
224
224
  })();
225
- </script>`}function ZA($,v){if(!v)return $;let g=/<head\b[^>]*>/i.exec($);if(g?.index!==void 0){let U=g.index+g[0].length;return`${$.slice(0,U)}${v}${$.slice(U)}`}let _=/<body\b[^>]*>/i.exec($);if(_?.index!==void 0){let U=_.index+_[0].length;return`${$.slice(0,U)}${v}${$.slice(U)}`}return`${v}${$}`}function JU($,v){if(Number.isFinite($)&&$>0)return Math.round($);if(Number.isFinite(v)&&v>0)return Math.round(v);return 1}function eO($,v){let g=$?.getBoundingClientRect();return{width:JU($?.clientWidth??0,JU(g?.width??0,v.width)),height:JU($?.clientHeight??0,JU(g?.height??0,v.height))}}function SA($,v){return typeof $==="number"&&Number.isFinite($)&&$>0&&!v}function MA($,v){return Math.max(JU($,1),JU(v,1))}function ZW({node:$,expanded:v=!1}){let g=V(null),_=V(null),U=V(null),z=V(null),b=V({}),J=V(void 0),G=V(!1),K=V(void 0),W=V(null),B=V(!1),k=V(null),P=V(!1),A=V(null),[H,I]=x("loading"),[F,Y]=x(null),[X,Q]=x(0),u=$.data.html,E=$.data.serverName,M=$.data.appSessionId,n=$.data.toolInput??{},t=$.data.toolResult,r=$.data.toolName??"ext-app",R=$.data.toolDefinition,$$=$.data.toolCallId,p=typeof $$==="string"||typeof $$==="number"?$$:void 0,c=$.data.resourceMeta,P$=$.data.sessionStatus,Z$=$.data.sessionError,i$=$.size.height,w=$.id,l=AA($,X),e=t!=null,s=XA(null),z$=$.data.axCapabilities?.enabled===!0&&typeof u==="string"&&u.length>0,a=t$(()=>`ax-${crypto.randomUUID()}`,[]),f=z$?wA(a,w):"",d=qW(ZA(u??"",f),s);m(()=>{if(!z$)return;function b$(K$){if(K$.source!==g.current?.contentWindow)return;let V$=K$.data;if(!V$||V$.source!=="pmx-canvas-ax"||V$.token!==a||V$.nodeId!==w)return;let C$=V$.interaction;if(!C$||typeof C$.type!=="string")return;let s$=C$.type;H6({type:s$,sourceNodeId:w,sourceSurface:"mcp-app",...C$.payload&&typeof C$.payload==="object"?{payload:C$.payload}:{}}).then((Wv)=>{if(Wv.ok)uv("context","AX interaction",s$,[w]);else uv("remove","AX interaction rejected",Wv.error??Wv.code??"",[w]);g.current?.contentWindow?.postMessage({source:"pmx-canvas-ax-ack",token:a,...V$.correlationId?{correlationId:V$.correlationId}:{},interaction:{type:s$},result:Wv},"*")})}return window.addEventListener("message",b$),()=>window.removeEventListener("message",b$)},[z$,a,w]),m(()=>{if(v||P.current)return;if(!YA(H,e))return;if(typeof navigator>"u"||typeof window>"u")return;if(!LA(navigator.userAgent))return;P.current=!0;let b$=250+FA()*450;A.current=window.setTimeout(()=>Q((K$)=>K$+1),b$)},[H,e]),m(()=>()=>{if(A.current!==null)window.clearTimeout(A.current)},[]);let G$=(b$)=>b$==="light"?"light":"dark",g$=v||E$.value===w;b.current=n,J.current=t;let j$=P$==="error"?Z$??"Saved app session is unavailable. Reopen the app to restore interactivity.":"Reconnecting saved app session...",o$=(b$)=>{let K$=J.current;if(!b$||!B.current||!K$)return null;if(K.current===K$)return null;if(K.current&&FW(K.current,K$))return K.current=K$,null;if(W.current)return W.current;let V$=b$.sendToolResult(K$).then(()=>{K.current=K$,G.current=!0,I("done")}).catch((C$)=>{let s$=C$ instanceof Error?C$.message:String(C$);throw Y(`Tool result delivery failed: ${s$}`),C$}).finally(()=>{W.current=null});return W.current=V$,V$};if(m(()=>{if(!u||!d.ready)return;let b$=g.current;if(!b$)return;let K$=!1,V$=null,C$=null,s$=null,Wv=null;G.current=!1,K.current=void 0,W.current=null,B.current=!1;let Ev=()=>{if(!V$)return;clearTimeout(V$),V$=null};return(async()=>{if(!u)return;let cv=b$.contentWindow;if(!cv)throw Error("Ext-app iframe window is unavailable");let E6=(F$=E$.value===w?"fullscreen":"inline")=>({theme:G$(T$.value),platform:"web",containerDimensions:eO(b$,{width:$.size.width,height:i$}),displayMode:F$,locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,...R?{toolInfo:{id:p,tool:R}}:{}}),vP=()=>{if(s$!==null)return;s$=requestAnimationFrame(()=>{if(s$=null,K$||!B.current)return;u$.setHostContext?.(E6())})},wG=()=>{if(Wv!==null)return;Wv=requestAnimationFrame(()=>{Wv=requestAnimationFrame(()=>{if(Wv=null,K$||!B.current)return;u$.sendHostContextChange?.(E6())})})},u$=new nO(null,{name:"PMX Canvas",version:"1.0.0"},{openLinks:{},serverTools:{listChanged:!1},serverResources:{listChanged:!1},logging:{},updateModelContext:{text:{},structuredContent:{}}},{hostContext:E6(g$?"fullscreen":"inline")});u$.onsizechange=async({height:F$})=>{if(SA(F$,E$.value===w)){let Bv=eO(b$.parentElement??b$,{width:$.size.width,height:i$}),iv=MA(F$,Bv.height);b$.style.height=`${iv}px`;let c6=T.value.get(w)?.size??$.size,SG=Math.max(c6.height,iv+o3);if(Math.abs(SG-c6.height)>8){if(Y4(w,{width:c6.width,height:SG}),z.current!==null)window.clearTimeout(z.current);z.current=window.setTimeout(()=>{d$({recordHistory:!1}),z.current=null},0)}}return{}},u$.onopenlink=async({url:F$})=>{return window.open(F$,"_blank","noopener"),{}},u$.onsandboxready=async()=>{await u$.sendSandboxResourceReady({html:u,sandbox:aO,...c?.csp?{csp:c.csp}:{},...c?.permissions?{permissions:c.permissions}:{}})},u$.onrequestdisplaymode=async({mode:F$})=>{let{nextMode:Bv,shouldExpand:iv,shouldCollapse:c6}=qA(F$,g$);if(iv)z6(w);else if(c6)p6();return{mode:Bv}},u$.oncalltool=async(F$)=>{if(!M)throw Error(j$);try{let Bv=await U4("/api/ext-app/call-tool",{sessionId:M,nodeId:w,serverName:E,toolName:F$.name,arguments:F$.arguments??{}});return Y(null),Bv}catch(Bv){let iv=Bv instanceof Error?Bv.message:String(Bv);throw Y(`Tool call failed: ${iv}`),Bv}},u$.setRequestHandler(wg,async()=>{if(!M)return{tools:[]};return U4("/api/ext-app/list-tools",{sessionId:M})}),u$.onlistresources=async()=>M?U4("/api/ext-app/list-resources",{sessionId:M}):{resources:[]},u$.onlistresourcetemplates=async()=>M?U4("/api/ext-app/list-resource-templates",{sessionId:M}):{resourceTemplates:[]},u$.onreadresource=async(F$)=>{if(!M)throw Error(j$);return U4("/api/ext-app/read-resource",{sessionId:M,uri:F$.uri})},u$.onlistprompts=async()=>M?U4("/api/ext-app/list-prompts",{sessionId:M}):{prompts:[]},u$.onupdatemodelcontext=async(F$)=>{if(!M)return{};return await U4("/api/ext-app/model-context",{nodeId:w,...Array.isArray(F$.content)?{content:F$.content}:{},...F$.structuredContent&&typeof F$.structuredContent==="object"?{structuredContent:F$.structuredContent}:{}}),{}};let E0=new w0(cv,cv);if(u$.oninitialized=()=>{if(K$)return;Ev(),B.current=!0,I("ready"),Y(null),Promise.resolve(u$.sendHostContextChange(E6(g$?"fullscreen":"inline"))).then(()=>wW(u$,b.current,void 0)).then(()=>o$(u$)).then(()=>wG()).catch((F$)=>{let Bv=F$ instanceof Error?F$.message:String(F$);Y(`Bridge bootstrap failed: ${Bv}`)})},V$=setTimeout(()=>{if(K$||B.current)return;let F$=J.current,Bv=E6(g$?"fullscreen":"inline");B.current=!0,u$.setHostContext?.(Bv),Promise.resolve(u$.sendHostContextChange(Bv)).then(()=>wW(u$,b.current,F$)).then(()=>{if(G.current=Boolean(F$),F$)K.current=F$;I(F$?"done":"ready"),Y(null),wG()}).catch((iv)=>{let c6=iv instanceof Error?iv.message:String(iv);Y(`Bridge bootstrap fallback failed: ${c6}`)})},1200),await u$.connect(E0),K$){Ev(),await E0.close();return}if(_.current=u$,U.current=E0,C$=new ResizeObserver(vP),C$.observe(b$),b$.parentElement)C$.observe(b$.parentElement);let ZG=!0;k.current=T$.subscribe((F$)=>{if(ZG){ZG=!1;return}if(K$)return;u$.setHostContext?.({...E6(),theme:G$(F$)}),u$.sendHostContextChange?.(E6())}),o$(u$)})().catch((cv)=>{Ev(),console.error("[ext-app] Bridge init failed:",cv),Y(cv?.message??"Bridge initialization failed")}),()=>{if(K$=!0,Ev(),C$?.disconnect(),C$=null,s$!==null)cancelAnimationFrame(s$),s$=null;if(Wv!==null)cancelAnimationFrame(Wv),Wv=null;if(B.current=!1,W.current=null,k.current?.(),k.current=null,z.current!==null)window.clearTimeout(z.current),z.current=null;if(_.current=null,U.current)U.current.close().catch((cv)=>{console.error("[ext-app] transport close failed:",cv)}),U.current=null}},[l,d.key]),m(()=>{if(t&&_.current&&(H==="ready"||H==="done"))o$(_.current)},[t,H]),m(()=>{let b$=_.current;if(g.current)g.current.style.height="100%";if(!b$||!B.current)return;let K$=null,V$=null;return K$=requestAnimationFrame(()=>{K$=null,V$=requestAnimationFrame(()=>{if(V$=null,!B.current)return;let C$={theme:G$(T$.value),platform:"web",containerDimensions:eO(g.current,{width:$.size.width,height:i$}),displayMode:g$?"fullscreen":"inline",locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};b$.setHostContext?.(C$),b$.sendHostContextChange?.(C$)})}),()=>{if(K$!==null)cancelAnimationFrame(K$);if(V$!==null)cancelAnimationFrame(V$)}},[g$,i$]),!u)return O("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--c-muted)",fontSize:"13px",flexDirection:"column",gap:"8px"},children:[O("div",{style:{opacity:0.6},children:["Loading ",r," viewer..."]},void 0,!0,void 0,this),O("div",{style:{width:"24px",height:"24px",border:"2px solid var(--c-line)",borderTopColor:"var(--c-muted)",borderRadius:"50%",animation:"spin 1s linear infinite"}},void 0,!1,void 0,this),O("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("div",{style:{flex:1,width:"100%",height:"100%",minWidth:0,minHeight:0,display:"flex",flexDirection:"column"},children:[P$&&P$!=="ready"&&O("div",{style:{padding:"6px 10px",fontSize:"11px",background:P$==="error"?"var(--c-danger-12)":"var(--c-warn-10)",color:P$==="error"?"var(--c-danger)":"var(--c-warn)",borderBottom:`1px solid ${P$==="error"?"var(--c-danger-12)":"var(--c-warn-15)"}`},children:j$},void 0,!1,void 0,this),F&&O("div",{style:{padding:"6px 10px",fontSize:"11px",background:"var(--c-danger-12)",color:"var(--c-danger)",borderBottom:"1px solid var(--c-danger-12)",display:"flex",alignItems:"center",gap:"6px"},children:[O("span",{children:"⚠"},void 0,!1,void 0,this),O("span",{style:{flex:1},children:F},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>{Y(null),I("loading"),Q((b$)=>b$+1)},style:{background:"var(--c-surface-hover)",border:"1px solid var(--c-danger-12)",borderRadius:"3px",color:"var(--c-danger)",cursor:"pointer",fontSize:"10px",padding:"1px 6px"},children:"Retry"},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>Y(null),style:{background:"none",border:"none",color:"var(--c-danger)",cursor:"pointer",fontSize:"13px",padding:"0 2px"},children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),H==="loading"&&O("div",{style:{padding:"8px",fontSize:"11px",color:"var(--c-muted)"},children:"Connecting to ext-app viewer..."},void 0,!1,void 0,this),O("div",{style:{flex:1,position:"relative",display:"flex",minHeight:0,height:"100%"},children:[O("iframe",{ref:g,...d.attributes,sandbox:s,allow:LW(c?.permissions),style:{flex:1,width:"100%",height:"100%",minHeight:0,border:"none",background:"var(--c-panel)",pointerEvents:g$&&H!=="loading"?"auto":"none"},title:`Ext App: ${r}`},l,!1,void 0,this),!g$&&O("button",{type:"button",onClick:(b$)=>{b$.stopPropagation(),z6(w)},class:"ext-app-preview-catcher",title:"Click to open",style:{position:"absolute",top:0,right:"56px",bottom:"56px",left:0,background:"transparent",border:"none",padding:0,margin:0,cursor:"zoom-in"},"aria-label":"Open full view to edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function Z0($,v,g){let _=V($);_.current=$;let U=V(null);m(()=>{if(!g)return;function z(b){if(b.source!==v.current?.contentWindow)return;let J=b.data;if(!J||J.source!=="pmx-canvas-frame"||J.type!=="content-height"||J.token!==g)return;let G=_.current,K=typeof J.height==="number"?J.height:0,W=d3(G,K);if(W===null)return;if(Y4(G.id,{width:G.size.width,height:W}),U.current!==null)window.clearTimeout(U.current);U.current=window.setTimeout(()=>{d$({recordHistory:!1}),U.current=null},300)}return window.addEventListener("message",z),()=>{if(window.removeEventListener("message",z),U.current!==null)window.clearTimeout(U.current),U.current=null}},[$.id,g])}function QA($,v,g,_,U,z,b){if(!$)return $;try{let J=new URL($,window.location.origin);if(J.searchParams.set("theme",T$.value==="light"?"light":"dark"),v)J.searchParams.set("display","expanded");if(typeof g==="number")J.searchParams.set("v",String(g));if(_)J.searchParams.set("axToken",_);if(U)J.searchParams.set("axNodeId",U);if(z)J.searchParams.set("frameToken",z);if(b)J.searchParams.set("fit","content");return J.toString()}catch{return $}}function NA($,v=window.location.origin){if(!$)return!1;try{let g=new URL(v).origin,_=new URL($,g);return _.origin===g&&_.pathname.startsWith("/api/canvas/frame-documents/")}catch{return!1}}function f6({node:$,expanded:v=!1}){if($.data.mode==="ext-app")return O(ZW,{node:$,expanded:v},void 0,!1,void 0,this);return O(rA,{node:$,expanded:v},void 0,!1,void 0,this)}function rA({node:$,expanded:v}){let g=V(null),_=$.type==="mcp-app"&&$.data.viewerType==="web-artifact",U=$.type==="json-render"||$.type==="graph",z=$.data.axCapabilities?.enabled,J=(U||_)&&(_?z===!0:z!==!1),G=_?"mcp-app":"json-render",K=t$(()=>J?`ax-${crypto.randomUUID()}`:"",[J]),W=V2($)&&!v,B=t$(()=>W?`frame-${crypto.randomUUID()}`:"",[W]);Z0($,g,B),m(()=>{if(!J||!K)return;function Q(u){if(u.source!==g.current?.contentWindow)return;let E=u.data;if(!E||E.source!=="pmx-canvas-ax"||E.token!==K||E.nodeId!==$.id)return;let M=E.interaction;if(!M||typeof M.type!=="string")return;let n=M.type;H6({type:n,sourceNodeId:$.id,sourceSurface:G,...M.payload&&typeof M.payload==="object"?{payload:M.payload}:{}}).then((t)=>{if(t.ok)uv("context","AX interaction",n,[$.id]);else uv("remove","AX interaction rejected",t.error??t.code??"",[$.id]);g.current?.contentWindow?.postMessage({source:"pmx-canvas-ax-ack",token:K,...E.correlationId?{correlationId:E.correlationId}:{},interaction:{type:n},result:t},"*")})}return window.addEventListener("message",Q),()=>window.removeEventListener("message",Q)},[J,K,$.id]);let k=F6.value,P=()=>{if(!J||!K||k==null)return;g.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"ax-update",token:K,state:k},"*")};m(P,[J,K,k]);let A=typeof $.data.specVersion==="number"?$.data.specVersion:void 0,H=QA($.data.url||"",v,A,K||void 0,J?$.id:void 0,B||void 0,W),I=$.data.sourceServer||"",F=$.data.hostMode||"hosted",Y=$.data.fallbackReason,X=$.data.trustedDomain===!0||NA(H);if(F==="fallback")return O("div",{style:{display:"flex",flexDirection:"column",gap:"8px",fontSize:"12px"},children:[O("div",{style:{color:"var(--c-warn)",display:"flex",alignItems:"center",gap:"6px"},children:[O("span",{children:"⚠"},void 0,!1,void 0,this),O("span",{children:"Cannot embed — opened externally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&O("div",{style:{color:"var(--c-muted)",fontSize:"11px"},children:["Reason: ",Y]},void 0,!0,void 0,this),O("a",{href:H,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--c-accent)",fontSize:"12px",wordBreak:"break-all"},children:H},void 0,!1,void 0,this),I&&O("div",{style:{color:"var(--c-dim)",fontSize:"10px"},children:["Source: ",I]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);return O("div",{style:{height:"100%",display:"flex",flexDirection:"column",...v?{flex:1,minHeight:0,width:"100%"}:{}},children:[!X&&O("div",{style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-warn-10)",color:"var(--c-warn)",borderBottom:"1px solid var(--c-warn-15)"},children:"Unverified domain"},void 0,!1,void 0,this),O("iframe",{ref:g,src:H,class:"mcp-app-frame",sandbox:"allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox",allow:"clipboard-read; clipboard-write",loading:"lazy",onLoad:P,style:{flex:1,minHeight:0,width:"100%"},title:`MCP App: ${I}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var Ng=null;function a$($){return getComputedStyle(document.documentElement).getPropertyValue($).trim()}function S0(){if(Ng)return Ng;return Ng={bg:a$("--c-bg"),panel:a$("--c-panel"),panelSoft:a$("--c-panel-soft"),line:a$("--c-line"),text:a$("--c-text"),textSoft:a$("--c-text-soft"),muted:a$("--c-muted"),dim:a$("--c-dim"),accent:a$("--c-accent"),ok:a$("--c-ok"),warn:a$("--c-warn"),warnAlt:a$("--c-warn-alt"),danger:a$("--c-danger"),purple:a$("--c-purple"),thinking:a$("--c-thinking"),subagent:a$("--c-subagent"),font:a$("--font"),mono:a$("--mono")},Ng}function OU(){Ng=null}var M0={idle:"var(--c-muted)",running:"var(--c-accent)",planning:"var(--c-thinking)",thinking:"var(--c-thinking)",drafting:"var(--c-accent)",tooling:"var(--c-accent)",review:"var(--c-ok)","waiting-approval":"var(--c-warn)",waiting:"var(--c-warn-alt)"};function $G($){let v=typeof $.data.phase==="string"&&$.data.phase.trim().length>0?$.data.phase.trim():"";if(v)return v;let g=typeof $.data.content==="string"&&$.data.content.trim().length>0?$.data.content.trim():"";if(g)return g;return(typeof $.data.status==="string"&&$.data.status.trim().length>0?$.data.status.trim():"")||"idle"}function GU({node:$}){let v=$G($),g=$.data.detail||"",_=$.data.message||"",U=$.data.level||"ok",z=$.data.activeTool,b=$.data.subagent,J=M0[v]??"var(--c-muted)",G=v!=="idle";return O("div",{style:{display:"flex",flexDirection:"column",gap:"8px",fontSize:"12px"},children:[O("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[O("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:J,boxShadow:G?`0 0 8px ${J}`:"none",animation:G?"pulse 1.5s infinite":"none",flexShrink:0}},void 0,!1,void 0,this),O("span",{style:{fontWeight:600,color:J,textTransform:"uppercase",letterSpacing:"0.05em"},children:v},void 0,!1,void 0,this),g&&O("span",{style:{color:"var(--c-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z&&O("div",{style:{display:"flex",alignItems:"center",gap:"6px",color:"var(--c-warn)"},children:[O("span",{style:{fontSize:"10px"},children:"⚙"},void 0,!1,void 0,this),O("span",{style:{fontFamily:"var(--mono)",fontSize:"11px"},children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&b.state!=="completed"&&O("div",{style:{display:"flex",alignItems:"center",gap:"6px",color:"var(--c-subagent)"},children:[O("span",{style:{fontSize:"10px"},children:"⠉"},void 0,!1,void 0,this),O("span",{children:b.name},void 0,!1,void 0,this),O("span",{style:{color:"var(--c-muted)",fontSize:"10px"},children:["(",b.state,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_&&O("div",{style:{color:U==="warn"?"var(--c-warn)":U==="error"?"var(--c-danger)":"var(--c-muted)",lineHeight:1.4},children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KU($){return typeof $==="string"&&$.trim().length>0?$.trim():null}function SW($){if(typeof $==="string"){let U=KU($);return U?{title:"Evidence warning",detail:U}:null}if(!$||typeof $!=="object")return null;let v=$,g=KU(v.title)??"Evidence warning",_=KU(v.detail);return _?{title:g,detail:_}:null}function uA($){let v=[],g=SW($.data.warning);if(g)v.push(g);let _=$.data.warnings;if(Array.isArray(_))for(let z of _){let b=SW(z);if(b)v.push(b)}let U=KU($.data.validationStatus)?.toLowerCase();if(U==="failed"||U==="invalid")v.push({title:"Image failed validation",detail:KU($.data.validationMessage)??"Review this image before using it as evidence."});return v}function RA($){let v=[$.data.title,$.data.caption,$.data.alt,$.data.src,$.data.path].map((g)=>KU(g)?.toLowerCase()??"").join(" ");if(v.length===0)return!1;return["login","log in","sign in","signin","password","2fa","mfa","authenticate","authentication","sso"].some((g)=>v.includes(g))}function MW($){let v=uA($);if(v.length>0)return v;if(RA($))return[{title:"Captured login page",detail:"This image looks like an auth screen. Treat it as environment context, not product evidence."}];return[]}function Q0({node:$,expanded:v=!1}){let g=$.data.src||"",_=$.data.alt||$.data.title||"Image",U=$.data.caption||"",z=MW($),b=g.startsWith("data:")||g.startsWith("http://")||g.startsWith("https://")?g:`/api/canvas/image/${$.id}`,[J,G]=x(!1),[K,W]=x(!1),[B,k]=x(1),[P,A]=x({x:0,y:0}),[H,I]=x({w:0,h:0}),F=V(null),Y=V(!1),X=V({x:0,y:0}),Q=N((p)=>{let c=p.target;I({w:c.naturalWidth,h:c.naturalHeight}),G(!0),W(!1)},[]),u=N(()=>{W(!0),G(!1)},[]);m(()=>{k(1),A({x:0,y:0})},[g]);let E=N((p)=>{p.preventDefault(),p.stopPropagation();let c=p.deltaY>0?0.9:1.1;k((P$)=>Math.max(0.25,Math.min(10,P$*c)))},[]),M=N((p)=>{if(B<=1)return;p.stopPropagation(),Y.current=!0,X.current={x:p.clientX,y:p.clientY},p.target.setPointerCapture(p.pointerId)},[B]),n=N((p)=>{if(!Y.current)return;let c=p.clientX-X.current.x,P$=p.clientY-X.current.y;X.current={x:p.clientX,y:p.clientY},A((Z$)=>({x:Z$.x+c,y:Z$.y+P$}))},[]),t=N(()=>{Y.current=!1},[]),r=N(()=>{k(1),A({x:0,y:0})},[]);if(!g)return O("div",{class:"image-node-empty",children:[O("div",{class:"image-node-empty-icon",children:"\uD83D\uDDBC"},void 0,!1,void 0,this),O("div",{class:"image-node-empty-text",children:"No image source"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let R=H.w>0?`${H.w}×${H.h}`:"",$$=Math.round(B*100);return O("div",{class:`image-node ${v?"image-node-expanded":""}`,ref:F,children:[z.length>0&&O("div",{class:"image-node-warning-stack",children:z.map((p)=>O("div",{class:"image-node-warning",children:[O("span",{class:"image-node-warning-title",children:p.title},void 0,!1,void 0,this),O("span",{class:"image-node-warning-detail",children:p.detail},void 0,!1,void 0,this)]},`${p.title}-${p.detail}`,!0,void 0,this))},void 0,!1,void 0,this),O("div",{class:"image-node-viewport",onWheel:E,onPointerDown:M,onPointerMove:n,onPointerUp:t,style:{cursor:B>1?"grab":"default"},children:[!J&&!K&&O("div",{class:"image-node-loading",children:"Loading…"},void 0,!1,void 0,this),K&&O("div",{class:"image-node-error",children:[O("div",{class:"image-node-error-icon",children:"⚠"},void 0,!1,void 0,this),O("div",{children:"Failed to load image"},void 0,!1,void 0,this),O("div",{class:"image-node-error-path",children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("img",{src:b,alt:_,onLoad:Q,onError:u,draggable:!1,style:{transform:`translate(${P.x}px, ${P.y}px) scale(${B})`,opacity:J?1:0,display:K?"none":"block"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(U||R||B!==1)&&O("div",{class:"image-node-footer",children:[U&&O("span",{class:"image-node-caption",children:U},void 0,!1,void 0,this),O("span",{class:"image-node-meta",children:[R&&O("span",{children:R},void 0,!1,void 0,this),B!==1&&O("button",{type:"button",class:"image-node-zoom-reset",onClick:r,title:"Reset zoom",children:[$$,"% ↺"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function QW({node:$}){let v=$.data.children??[],g=T.value,_=v.filter((J)=>g.has(J)),U=_.length,z={};for(let J of _){let G=g.get(J);if(G)z[G.type]=(z[G.type]??0)+1}let b=Object.entries(z).map(([J,G])=>`${G} ${J}`).join(", ");return O("div",{class:"group-node-body",children:[O("div",{class:"group-summary",children:[O("span",{class:"group-child-count",children:[U," node",U!==1?"s":""]},void 0,!0,void 0,this),b&&O("span",{class:"group-type-summary",children:b},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U===0&&O("div",{class:"group-empty-hint",children:"Drag nodes here or use the selection bar to group nodes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function yA($){try{return new URL($).host}catch{return $}}function DA($){if(!$)return null;let v=new Date($);return Number.isNaN(v.getTime())?null:v.toLocaleString()}function N0({node:$,expanded:v=!1}){let g=typeof $.data.url==="string"?$.data.url:"",_=typeof $.data.pageTitle==="string"?$.data.pageTitle:"",U=typeof $.data.description==="string"?$.data.description:"",z=typeof $.data.excerpt==="string"?$.data.excerpt:typeof $.data.content==="string"?$.data.content:"",b=typeof $.data.status==="string"?$.data.status:"idle",J=typeof $.data.error==="string"?$.data.error:"",G=DA(typeof $.data.fetchedAt==="string"?$.data.fetchedAt:void 0),K=typeof $.data.statusCode==="number"?$.data.statusCode:null,W=typeof $.data.imageUrl==="string"?$.data.imageUrl:"",B=$.data.frameBlocked===!0,k=typeof $.data.frameBlockedReason==="string"?$.data.frameBlockedReason:"",[P,A]=x(!1),[H,I]=x(v);m(()=>{if(v)I(!0)},[v]);let F=N(async()=>{if(!g||P)return;A(!0);try{await O_($.id)}finally{A(!1)}},[$.id,P,g]);if(!g)return O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"No webpage URL set"},void 0,!1,void 0,this);let Y=b==="ready"?"var(--c-ok)":b==="error"?"var(--c-danger)":"var(--c-warn)";return O("div",{style:{display:"flex",flexDirection:"column",gap:"12px",height:"100%"},children:[O("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[O("div",{style:{minWidth:0,flex:1},children:[O("div",{style:{fontSize:"12px",color:"var(--c-muted)"},children:yA(g)},void 0,!1,void 0,this),O("div",{style:{fontSize:v?"18px":"15px",fontWeight:700,color:"var(--c-text)"},children:_||$.data.title||g},void 0,!1,void 0,this),O("a",{href:g,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--c-accent)",fontSize:"12px",wordBreak:"break-all",textDecoration:"none"},children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"999px",background:"rgba(255,255,255,0.04)",color:Y,fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:[O("span",{style:{width:"7px",height:"7px",borderRadius:"999px",background:Y}},void 0,!1,void 0,this),b]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),(U||W)&&O("div",{style:{display:"grid",gridTemplateColumns:W&&v?"160px 1fr":"1fr",gap:"12px",alignItems:"start"},children:[W&&v&&O("img",{src:W,alt:_||"Webpage preview image",style:{width:"160px",height:"96px",objectFit:"cover",borderRadius:"10px",border:"1px solid var(--c-line)",background:"var(--c-panel-soft)"}},void 0,!1,void 0,this),U&&O("p",{style:{margin:0,color:"var(--c-text-soft)",lineHeight:1.5,fontSize:v?"14px":"12px"},children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[O("button",{type:"button",onClick:F,disabled:P,style:{border:"1px solid var(--c-line)",background:"var(--c-panel-soft)",color:"var(--c-text)",borderRadius:"8px",padding:"6px 10px",cursor:P?"progress":"pointer",fontSize:"12px"},children:P||b==="fetching"?"Refreshing…":"Refresh"},void 0,!1,void 0,this),v&&!B&&O("button",{type:"button",onClick:()=>I((X)=>!X),style:{border:"1px solid var(--c-line)",background:"var(--c-panel-soft)",color:"var(--c-text)",borderRadius:"8px",padding:"6px 10px",cursor:"pointer",fontSize:"12px"},children:H?"Hide live preview":"Show live preview"},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>window.open(g,"_blank","noopener"),style:{border:"1px solid var(--c-line)",background:"transparent",color:"var(--c-accent)",borderRadius:"8px",padding:"6px 10px",cursor:"pointer",fontSize:"12px"},children:"Open in browser"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v&&B&&O("div",{style:{border:"1px solid var(--c-line)",borderRadius:"12px",overflow:"hidden",background:"var(--c-panel-soft)"},children:[O("div",{style:{padding:"8px 12px",fontSize:"11px",color:"var(--c-muted)",borderBottom:"1px solid var(--c-line)",background:"rgba(255,255,255,0.03)"},children:"Live preview unavailable. This site refuses embedding, so PMX Canvas cannot show it inline."},void 0,!1,void 0,this),O("div",{style:{padding:"20px",color:"var(--c-text-soft)",lineHeight:1.6,fontSize:"13px"},children:k||"The remote site blocks iframe embedding."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v&&H&&!B&&O("div",{style:{border:"1px solid var(--c-line)",borderRadius:"12px",overflow:"hidden",background:"var(--c-panel-soft)"},children:[O("div",{style:{padding:"8px 12px",fontSize:"11px",color:"var(--c-muted)",borderBottom:"1px solid var(--c-line)",background:"rgba(255,255,255,0.03)"},children:"Live preview (best effort). If this stays blank, the site likely blocks framing. The cached text snapshot below still works."},void 0,!1,void 0,this),O("iframe",{class:"webpage-node-iframe",title:_||$.data.title||g,src:g,loading:"lazy",referrerPolicy:"no-referrer",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-presentation allow-scripts",style:{display:"block",width:"100%",height:v?"320px":"180px",border:"none",background:"#fff"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(G||K!==null)&&O("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap",color:"var(--c-muted)",fontSize:"11px"},children:[G&&O("span",{children:["Fetched ",G]},void 0,!0,void 0,this),K!==null&&O("span",{children:["HTTP ",K]},void 0,!0,void 0,this),B&&O("span",{children:"Preview blocked by site"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J&&O("div",{style:{color:"var(--c-danger)",fontSize:"12px",lineHeight:1.5},children:J},void 0,!1,void 0,this),O("div",{style:{flex:1,minHeight:0,overflow:"auto",border:"1px solid var(--c-line)",borderRadius:"10px",background:"var(--c-panel-soft)",padding:v?"14px":"10px"},children:z?O("div",{style:{whiteSpace:"pre-wrap",lineHeight:1.55,color:"var(--c-text)",fontSize:v?"14px":"12px"},children:z},void 0,!1,void 0,this):O("div",{style:{color:"var(--c-dim)",fontStyle:"italic"},children:b==="error"?"No cached page text available.":"Waiting for page text..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function NW($){let v=5381;for(let g=0;g<$.length;g+=1)v=(v<<5)+v+$.charCodeAt(g)|0;return(v>>>0).toString(36)}function vG($,v={}){let g=new URLSearchParams;if(g.set("theme",v.theme??T$.value),v.themeToken)g.set("themeToken",v.themeToken);if(v.present)g.set("present","1");if(v.presentToken)g.set("presentToken",v.presentToken);if(v.v)g.set("v",v.v);if(v.axToken)g.set("axToken",v.axToken);if(v.frameToken)g.set("frameToken",v.frameToken);return`/api/canvas/surface/${encodeURIComponent($)}?${g.toString()}`}function r0($){return YW($.type,$.data)}async function u0($){let v=vG($.id);if(!(await AK($.id,v)).opened)window.open(v,"_blank","noopener")}function rW($){return $.type==="html"&&$.data.presentation===!0}function rg({node:$,expanded:v=!1,presentation:g=!1,presentationExitToken:_,autoFocus:U=!1}){let z=V(null),b=T$.value,J=t$(()=>`theme-${crypto.randomUUID()}`,[]),G=t$(()=>`ax-${crypto.randomUUID()}`,[]),K=t$(()=>`frame-${crypto.randomUUID()}`,[]),W=typeof $.data.html==="string"?$.data.html:typeof $.data.content==="string"?$.data.content:"",B=t$(()=>NW(W),[W]),k=t$(()=>W?vG($.id,{theme:b,themeToken:J,present:g,presentToken:_,v:B,axToken:G,frameToken:K}):"",[W,g,_,J,B,$.id,G,K]);Z0($,z,v?"":K),m(()=>{function F(Y){if(Y.source!==z.current?.contentWindow)return;let X=Y.data;if(!X||X.source!=="pmx-canvas-ax"||X.token!==G||X.nodeId!==$.id)return;let Q=X.interaction;if(!Q||typeof Q.type!=="string")return;let u=Q.type;H6({type:u,sourceNodeId:$.id,sourceSurface:"html-node",...Q.payload&&typeof Q.payload==="object"?{payload:Q.payload}:{}}).then((E)=>{if(E.ok)uv("context","AX interaction",u,[$.id]);else uv("remove","AX interaction rejected",E.error??E.code??"",[$.id]);z.current?.contentWindow?.postMessage({source:"pmx-canvas-ax-ack",token:G,...X.correlationId?{correlationId:X.correlationId}:{},interaction:{type:u},result:E},"*")})}return window.addEventListener("message",F),()=>window.removeEventListener("message",F)},[G,$.id]),m(()=>{if(z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"theme-update",token:J,theme:b},"*"),U)z.current?.focus()},[b,J]);let P=$.data.axCapabilities,A=P?.enabled===!0&&(!Array.isArray(P.allowed)||P.allowed.length>0),H=F6.value;m(()=>{if(!A||H==null)return;z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"ax-update",token:G,state:H},"*")},[A,H,G]),m(()=>{if(!U)return;let F=window.setTimeout(()=>z.current?.focus(),0);return()=>window.clearTimeout(F)},[U,k]);let I=()=>{if(z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"theme-update",token:J,theme:b},"*"),A&&F6.value!=null)z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"ax-update",token:G,state:F6.value},"*");if(U)z.current?.focus()};if(!W)return O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"No HTML content set"},void 0,!1,void 0,this);return O("iframe",{ref:z,class:g?"html-node-frame html-node-frame-presentation":"html-node-frame",title:typeof $.data.title==="string"?$.data.title:"HTML node",sandbox:"allow-scripts",src:k,tabIndex:U?0:void 0,onLoad:I,style:{width:"100%",height:"100%",minHeight:g?0:v?"70vh":"300px",border:"none",background:"var(--c-bg)",borderRadius:g?0:"6px",display:"block"}},void 0,!1,void 0,this)}var UG=null;async function uW(){if(!UG)UG=await HK();return UG}function RW($,v){if(!$)return null;let g=$.toLowerCase(),_=v.find((z)=>z.name.toLowerCase()===g);if(_)return _.name;let U=v.filter((z)=>z.name.toLowerCase().startsWith(g));return U.length===1?U[0].name:null}function TA($){return $.replace(/<script[\s>][\s\S]*?<\/script>/gi,"").replace(/<iframe[\s>][\s\S]*?<\/iframe>/gi,"").replace(/<object[\s>][\s\S]*?<\/object>/gi,"").replace(/<embed[\s>][\s\S]*?(?:\/>|<\/embed>)/gi,"").replace(/<link[\s>][\s\S]*?(?:\/>|<\/link>)/gi,"").replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/href\s*=\s*"javascript:[^"]*"/gi,'href="#"').replace(/href\s*=\s*'javascript:[^']*'/gi,"href='#'")}function jA({html:$}){let v=V(null);return m(()=>{let g=v.current;if(!g)return;if(g.replaceChildren(),!$)return;let _=document.createElement("template");_.innerHTML=$,g.append(_.content.cloneNode(!0))},[$]),O("div",{ref:v},void 0,!1,void 0,this)}function VA($,v){return`${$.role}:${$.status??"none"}:${v}:${$.text}`}function yW({count:$}){if($===0)return null;return O("div",{style:{padding:"4px 8px",fontSize:"11px",color:"var(--c-accent)",background:"rgba(70,182,255,0.08)",borderRadius:"var(--radius-sm)",flexShrink:0},children:["✦"," ",$," context node",$!==1?"s":""," attached"]},void 0,!0,void 0,this)}function DW({message:$,onDismiss:v}){if(!$)return null;return O("div",{style:{padding:"4px 8px",fontSize:"11px",color:"var(--c-danger)",background:"rgba(255,80,80,0.08)",borderRadius:"var(--radius-sm)",display:"flex",alignItems:"center",gap:"6px",flexShrink:0},children:[O("span",{style:{flex:1},children:$},void 0,!1,void 0,this),O("button",{type:"button",onClick:v,style:{background:"none",border:"none",color:"var(--c-danger)",cursor:"pointer",fontSize:"13px",padding:"0 2px"},children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function R0({node:$,expanded:v=!1}){let g=Array.isArray($.data.turns)?$.data.turns:[],_=g.length===0,U=$.data.text||"",z=$.data.status||"draft",b=_?z:$.data.threadStatus||"draft",J=b==="draft",G=b==="pending"||b==="sending",K=b==="streaming",W=b==="answered",[B,k]=x(""),[P,A]=x(""),[H,I]=x(null),[F,Y]=x(new Map),X=V(null),Q=V(null),u=g[g.length-1],E=`${g.length}:${u?.role??""}:${u?.status??""}:${Math.floor((u?.text?.length??0)/200)}`;m(()=>{if(v&&J&&X.current)X.current.focus()},[v,J]),m(()=>{if(!E)return;if(Q.current)Q.current.scrollTo({top:Q.current.scrollHeight,behavior:"smooth"})},[E]);let M=V(null),n=V(g);n.current=g,m(()=>{let c=g.some((Z$)=>Z$.role==="assistant"&&Z$.status==="streaming"),P$=()=>{let Z$=!1,w=n.current.map((l,e)=>({turn:l,index:e})).filter(({turn:l})=>l.role==="assistant"&&l.text);if(w.length===0)return;return Promise.all(w.map(async({turn:l,index:e})=>{let s=await g6(l.text);return{index:e,html:TA(s)}})).then((l)=>{if(Z$)return;let e=new Map;for(let s of l)e.set(s.index,s.html);Y(e)}),()=>{Z$=!0}};if(!c){if(M.current)clearTimeout(M.current),M.current=null;return P$()}if(M.current)clearTimeout(M.current);return M.current=setTimeout(()=>{M.current=null,P$()},400),()=>{if(M.current)clearTimeout(M.current),M.current=null}},[g]);let t=N(async()=>{let c=B.trim();if(!c)return;let P$=B;I(null),U$($.id,{turns:[{role:"user",text:c,status:"pending"}],threadStatus:"pending",text:c}),k("");let Z$=Array.isArray($.data.contextNodeIds)?$.data.contextNodeIds:void 0;if(!(await XU(c,$.position,$.id,Z$,$.id)).ok)U$($.id,{turns:[],threadStatus:"draft",text:"",status:"draft"}),k(P$),I("Failed to send prompt. Your draft has been restored.")},[B,$.id,$.position,$.data.contextNodeIds]),r=N(async()=>{let c=P.trim();if(!c)return;let P$=P;I(null);let Z$=Array.isArray($.data.turns)?[...$.data.turns]:[];if(Z$.push({role:"user",text:c,status:"pending"}),U$($.id,{turns:Z$,threadStatus:"pending"}),A(""),!(await LK($.id,c)).ok)Z$.pop(),U$($.id,{turns:Z$,threadStatus:"answered"}),A(P$),I("Failed to send reply. Your draft has been restored.")},[P,$.id,$.data.turns]),R=N((c)=>{if(c.key==="Enter"&&(c.metaKey||c.ctrlKey)){c.preventDefault(),t();return}if(c.key==="Tab"&&B.startsWith("/")){c.preventDefault();let P$=B.slice(1).split(/\s/)[0];if(P$)uW().then((Z$)=>{let i$=RW(P$,Z$);if(i$)k(`/${i$}`)})}},[t,B]),$$=N((c)=>{if(c.key==="Enter"&&(c.metaKey||c.ctrlKey)){c.preventDefault(),r();return}if(c.key==="Tab"&&P.startsWith("/")){c.preventDefault();let P$=P.slice(1).split(/\s/)[0];if(P$)uW().then((Z$)=>{let i$=RW(P$,Z$);if(i$)A(`/${i$}`)})}},[r,P]),p=Array.isArray($.data.contextNodeIds)?$.data.contextNodeIds.length:0;if(J&&g.length===0)return O("div",{class:"prompt-node-inner",style:{display:"flex",flexDirection:"column",height:"100%",gap:"8px"},children:[O(yW,{count:p},void 0,!1,void 0,this),O(DW,{message:H,onDismiss:()=>I(null)},void 0,!1,void 0,this),O("textarea",{ref:X,value:B,onInput:(c)=>k(c.target.value),onKeyDown:R,placeholder:"Ask the agent something…",spellcheck:!1,style:{flex:1,resize:"none",background:"rgba(10,14,30,0.4)",border:"1px solid var(--c-line)",borderRadius:"var(--radius-sm)",color:"var(--c-text)",fontFamily:"var(--font)",fontSize:"13px",lineHeight:"1.5",padding:"8px 10px",outline:"none"}},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[O("span",{style:{fontSize:"10px",color:"var(--c-muted)"},children:["⌘","+Enter to send"]},void 0,!0,void 0,this),O("button",{type:"button",onClick:t,disabled:!B.trim(),style:{padding:"5px 14px",fontSize:"12px",fontWeight:600,background:B.trim()?"var(--c-accent)":"var(--c-line)",color:B.trim()?"var(--c-contrast-fg)":"var(--c-muted)",border:"none",borderRadius:"var(--radius-sm)",cursor:B.trim()?"pointer":"default"},children:"Send"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(_)return O("div",{class:"prompt-node-inner",style:{display:"flex",flexDirection:"column",height:"100%"},children:[O("div",{style:{flex:1,padding:"2px 0",fontSize:"13px",lineHeight:"1.55",color:"var(--c-text)",whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"auto"},children:U},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"6px",borderTop:"1px solid var(--c-line)",marginTop:"4px"},children:O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,color:G?"var(--c-warn)":W?"var(--c-ok)":"var(--c-muted)"},children:G?"Sending…":W?"Answered":z},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("div",{class:"prompt-node-inner",style:{display:"flex",flexDirection:"column",height:"100%"},children:[O(yW,{count:p},void 0,!1,void 0,this),O(DW,{message:H,onDismiss:()=>I(null)},void 0,!1,void 0,this),O("div",{ref:Q,style:{flex:1,overflow:"auto",minHeight:0},children:g.map((c,P$)=>O("div",{children:[P$>0&&O("div",{class:"thread-turn-divider"},void 0,!1,void 0,this),c.role==="user"?O("div",{class:"thread-turn-user",children:[O("div",{class:"thread-turn-role",children:[O("span",{class:"status-dot"},void 0,!1,void 0,this),"You"]},void 0,!0,void 0,this),O("div",{style:{fontSize:v?"15px":"13px",lineHeight:v?"1.7":"1.55",color:"var(--c-text)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:c.text},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O("div",{class:"thread-turn-assistant",children:[O("div",{class:"thread-turn-role",children:[O("span",{class:`status-dot${c.status==="streaming"?" pulsing":""}`},void 0,!1,void 0,this),"PMX"]},void 0,!0,void 0,this),c.status==="streaming"&&!c.text&&O("div",{style:{height:"2px",background:"linear-gradient(90deg, transparent, var(--c-ok), transparent)",animation:"response-stream-pulse 1.5s ease-in-out infinite",borderRadius:"1px",marginBottom:"4px"}},void 0,!1,void 0,this),O("div",{class:v?"md-reader-content":void 0,style:{fontSize:v?void 0:"13px",lineHeight:v?void 0:"1.55",opacity:c.text?1:0.4},children:F.get(P$)?O(e$,{children:[O(jA,{html:F.get(P$)??""},void 0,!1,void 0,this),c.status==="streaming"&&O("span",{class:"streaming-cursor"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O("div",{style:{color:"var(--c-muted)",fontStyle:"italic"},children:c.status==="streaming"?"Waiting for response…":c.text||"Empty response"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},VA(c,P$),!0,void 0,this))},void 0,!1,void 0,this),O("div",{style:{flexShrink:0,borderTop:"1px solid var(--c-line)",marginTop:"4px",paddingTop:"6px"},children:[O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:W?"6px":0},children:[O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,color:K?"var(--c-accent)":G?"var(--c-warn)":W?"var(--c-ok)":"var(--c-muted)"},children:K?"Streaming…":G?"Sending…":W?"Answered":b},void 0,!1,void 0,this),O("span",{style:{fontSize:"10px",color:"var(--c-muted)"},children:[g.length," turn",g.length!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&O("div",{class:"thread-reply-area",children:[O("textarea",{value:P,onInput:(c)=>A(c.target.value),onKeyDown:$$,placeholder:"Reply…",spellcheck:!1,rows:2,style:{width:"100%",resize:"none",background:"rgba(10,14,30,0.4)",border:"1px solid var(--c-line)",borderRadius:"var(--radius-sm)",color:"var(--c-text)",fontFamily:"var(--font)",fontSize:"12px",lineHeight:"1.5",padding:"6px 8px",outline:"none"}},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"4px"},children:[O("span",{style:{fontSize:"10px",color:"var(--c-muted)"},children:["⌘","+Enter"]},void 0,!0,void 0,this),O("button",{type:"button",onClick:r,disabled:!P.trim(),style:{padding:"3px 10px",fontSize:"11px",fontWeight:600,background:P.trim()?"var(--c-accent)":"var(--c-line)",color:P.trim()?"var(--c-contrast-fg)":"var(--c-muted)",border:"none",borderRadius:"var(--radius-sm)",cursor:P.trim()?"pointer":"default"},children:"Reply"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function CA($){return $.replace(/<script[\s>][\s\S]*?<\/script>/gi,"").replace(/<iframe[\s>][\s\S]*?<\/iframe>/gi,"").replace(/<object[\s>][\s\S]*?<\/object>/gi,"").replace(/<embed[\s>][\s\S]*?(?:\/>|<\/embed>)/gi,"").replace(/<link[\s>][\s\S]*?(?:\/>|<\/link>)/gi,"").replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/href\s*=\s*"javascript:[^"]*"/gi,'href="#"').replace(/href\s*=\s*'javascript:[^']*'/gi,"href='#'")}function fA({html:$}){let v=V(null);return m(()=>{let g=v.current;if(!g)return;if(g.replaceChildren(),!$)return;let _=document.createElement("template");_.innerHTML=$,g.append(_.content.cloneNode(!0))},[$]),O("div",{ref:v},void 0,!1,void 0,this)}function y0({node:$,expanded:v=!1}){let g=$.data.content||"",_=$.data.status||"streaming",[U,z]=x(""),b=_==="streaming",J=_==="complete";m(()=>{if(!g){z("");return}let K=!1;return g6(g).then((W)=>{if(!K)z(CA(W))}),()=>{K=!0}},[g]);let G=N(()=>{XU("",{x:$.position.x,y:$.position.y+$.size.height+24},$.id)},[$]);return O("div",{class:"response-node-inner",style:{display:"flex",flexDirection:"column",height:"100%"},children:[b&&O("div",{class:"response-streaming-bar",style:{height:"2px",background:"linear-gradient(90deg, transparent, var(--c-accent), transparent)",animation:"response-stream-pulse 1.5s ease-in-out infinite",borderRadius:"1px",marginBottom:"4px",flexShrink:0}},void 0,!1,void 0,this),O("div",{class:v?"md-reader":void 0,style:{flex:1,overflow:"auto",minHeight:0,opacity:g?1:0.4,transition:"opacity 0.2s ease"},children:U?O("div",{class:v?"md-reader-content":void 0,children:O(fA,{html:U},void 0,!1,void 0,this)},void 0,!1,void 0,this):O("div",{style:{color:"var(--c-muted)",fontStyle:"italic",fontSize:"13px"},children:b?"Waiting for response…":"Empty response"},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"6px",borderTop:"1px solid var(--c-line)",marginTop:"4px",flexShrink:0},children:[O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,color:b?"var(--c-accent)":J?"var(--c-ok)":"var(--c-muted)"},children:b?"Streaming…":J?"Complete":_},void 0,!1,void 0,this),J&&O("button",{type:"button",onClick:G,style:{padding:"3px 10px",fontSize:"11px",background:"rgba(70,182,255,0.1)",border:"1px solid rgba(70,182,255,0.3)",borderRadius:"var(--radius-sm)",color:"var(--c-accent)",cursor:"pointer"},children:"Reply"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function TW($){return{toolName:$.toolName||$.title||"unknown",category:$.category||"other",status:$.status||"running",duration:$.duration||"",resultSummary:$.resultSummary||$.content||"",error:$.error||""}}var jW={mcp:"var(--c-accent)",file:"var(--c-warn)",subagent:"var(--c-purple)",other:"var(--c-muted)"},mA={running:"⠋",success:"✓",failed:"✕"},EA={running:"var(--c-accent)",success:"var(--c-ok)",failed:"var(--c-danger)"};function D0({node:$}){let{toolName:v,category:g,status:_,duration:U,resultSummary:z,error:b}=TW($.data),J=jW[g]??jW.other,G=mA[_]??"◌",K=EA[_]??"var(--c-muted)",W=_==="running",B=b?b.slice(0,30):z.length>30?`${z.slice(0,28)}…`:z;return O("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 12px",height:"100%",overflow:"hidden"},children:[O("span",{style:{fontSize:"14px",color:K,flexShrink:0,animation:W?"pulse 1.5s infinite":"none"},children:G},void 0,!1,void 0,this),O("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[O("div",{style:{fontFamily:"var(--mono)",fontSize:"11px",fontWeight:600,color:J,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:v},void 0,!1,void 0,this),B&&O("div",{style:{fontSize:"10px",color:b?"var(--c-danger)":"var(--c-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3},children:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U&&O("span",{style:{fontSize:"9px",padding:"1px 5px",borderRadius:"3px",background:"rgba(255,255,255,0.06)",color:"var(--c-muted)",flexShrink:0,whiteSpace:"nowrap"},children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _G($){let v=T.value.get($);if(!v||v.dockPosition!==null)return null;return{left:v.position.x,top:v.position.y,width:v.size.width,height:v.size.height}}function cA($){let v=$.map((G)=>_G(G)).filter((G)=>G!==null);if(v.length===0)return null;let g=Math.min(...v.map((G)=>G.left)),_=Math.min(...v.map((G)=>G.top)),U=Math.max(...v.map((G)=>G.left+G.width)),z=Math.max(...v.map((G)=>G.top+G.height)),b=54,J=46;return{left:g-b,top:_-J,width:U-g+b*2,height:z-_+J*2}}function gG($,v){return{left:`${$.left}px`,top:`${$.top}px`,width:`${$.width}px`,height:`${$.height}px`,borderRadius:`${v}px`}}function VW(){let $=Array.from(W4.value),v=Array.from(B4.value),g=eg.value;if($.length===0&&v.length===0)return null;return O("div",{class:"attention-field-layer","aria-hidden":"true",children:[g.map((_)=>{let U=cA(_.nodeIds);if(!U)return null;return O("div",{class:"attention-field-region",style:gG(U,42)},_.id,!1,void 0,this)}),v.map((_)=>{let U=_G(_);if(!U)return null;return O("div",{class:"attention-field-node attention-field-secondary",style:gG({left:U.left-18,top:U.top-18,width:U.width+36,height:U.height+36},28)},`secondary-${_}`,!1,void 0,this)}),$.map((_)=>{let U=_G(_);if(!U)return null;return O("div",{class:"attention-field-node attention-field-primary",style:gG({left:U.left-24,top:U.top-24,width:U.width+48,height:U.height+48},30)},`primary-${_}`,!1,void 0,this)})]},void 0,!0,void 0,this)}var Lv=B$(new Map),WU=B$(null),iA=480,lA=320,ug=new Map,W6=null;function zG($){Lv.value=$,xA()}function bG($){let v=ug.get($);if(v)clearTimeout(v),ug.delete($)}function CW($){bG($.id);let v=new Map(Lv.value);v.set($.id,{...$,phase:"forming"}),zG(v)}function hA($){if(bG($),!Lv.value.has($))return;let v=new Map(Lv.value);v.delete($),zG(v)}function fW($,v,g,_){let U=Lv.value.get($);if(!U||U.phase===v)return;let z=new Map(Lv.value);z.set($,{...U,phase:v,..._?{settledNodeId:_}:{}}),zG(z),bG($),ug.set($,setTimeout(()=>hA($),g))}function mW($,v){fW($,"settling",iA,v)}function JG($){fW($,"dissolving",lA)}function EW(){for(let $ of ug.values())clearTimeout($);if(ug.clear(),W6)clearInterval(W6),W6=null;WU.value=null,Lv.value=new Map}function xA(){if(W6||Lv.value.size===0)return;W6=setInterval(()=>{let $=Date.now();for(let v of Lv.value.values())if(v.phase==="forming"&&v.expiresAt<=$)JG(v.id);if(Lv.value.size===0&&W6)clearInterval(W6),W6=null},1000),W6.unref?.()}var pA={fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function Y$({size:$=16,children:v,...g}){return O("svg",{width:$,height:$,viewBox:"0 0 16 16",...pA,...g,children:v},void 0,!1,void 0,this)}function lW($){return O(Y$,{...$,children:[O("polyline",{points:"1 5 1 1 5 1"},void 0,!1,void 0,this),O("polyline",{points:"11 1 15 1 15 5"},void 0,!1,void 0,this),O("polyline",{points:"15 11 15 15 11 15"},void 0,!1,void 0,this),O("polyline",{points:"5 15 1 15 1 11"},void 0,!1,void 0,this),O("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function hW($){return O(Y$,{...$,children:[O("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"4.5",x2:"8",y2:"6.5"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"9.5",x2:"8",y2:"11.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"8",x2:"6.5",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"9.5",y1:"8",x2:"11.5",y2:"8"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function xW($){return O(Y$,{...$,children:[O("circle",{cx:"7",cy:"7",r:"4.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"10.5",x2:"14.5",y2:"14.5"},void 0,!1,void 0,this),O("line",{x1:"5",y1:"7",x2:"9",y2:"7"},void 0,!1,void 0,this),O("line",{x1:"7",y1:"5",x2:"7",y2:"9"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function pW($){return O(Y$,{...$,children:[O("circle",{cx:"7",cy:"7",r:"4.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"10.5",x2:"14.5",y2:"14.5"},void 0,!1,void 0,this),O("line",{x1:"5",y1:"7",x2:"9",y2:"7"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function oW($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"4",x2:"9.5",y2:"4"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"12",x2:"9.5",y2:"12"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"6.5",x2:"4",y2:"9.5"},void 0,!1,void 0,this),O("line",{x1:"12",y1:"6.5",x2:"12",y2:"9.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nW($){return O(Y$,{...$,children:[O("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"},void 0,!1,void 0,this),O("rect",{x:"8",y:"7",width:"6",height:"6",rx:"1",fill:"currentColor","fill-opacity":"0.2"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function tW($){return O(Y$,{...$,children:[O("circle",{cx:"8",cy:"8",r:"3"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"1",x2:"8",y2:"3"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"13",x2:"8",y2:"15"},void 0,!1,void 0,this),O("line",{x1:"1",y1:"8",x2:"3",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"13",y1:"8",x2:"15",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"3.05",y1:"3.05",x2:"4.46",y2:"4.46"},void 0,!1,void 0,this),O("line",{x1:"11.54",y1:"11.54",x2:"12.95",y2:"12.95"},void 0,!1,void 0,this),O("line",{x1:"3.05",y1:"12.95",x2:"4.46",y2:"11.54"},void 0,!1,void 0,this),O("line",{x1:"11.54",y1:"4.46",x2:"12.95",y2:"3.05"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function dW($){return O(Y$,{...$,children:O("path",{d:"M13 9.5A5.5 5.5 0 1 1 6.5 3 4.5 4.5 0 0 0 13 9.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function aW($){return O(Y$,{...$,children:[O("path",{d:"M3 13l2.8-.7L13 5.1 10.9 3 3.7 10.2 3 13Z"},void 0,!1,void 0,this),O("path",{d:"M9.8 4.1l2.1 2.1"},void 0,!1,void 0,this),O("path",{d:"M2.5 14h11"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function sW($){return O(Y$,{...$,children:[O("path",{d:"M3 10.5 8.5 5a2 2 0 0 1 2.8 0l1.7 1.7a2 2 0 0 1 0 2.8L8.5 14H5.8L3 11.2Z"},void 0,!1,void 0,this),O("path",{d:"M7.5 6 12 10.5"},void 0,!1,void 0,this),O("path",{d:"M8.5 14H14"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function eW($){return O(Y$,{...$,children:[O("path",{d:"M3 4h10"},void 0,!1,void 0,this),O("path",{d:"M8 4v8"},void 0,!1,void 0,this),O("path",{d:"M6 12h4"},void 0,!1,void 0,this),O("path",{d:"M4.5 4 4 6"},void 0,!1,void 0,this),O("path",{d:"M11.5 4 12 6"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $B($){return O(Y$,{...$,children:[O("rect",{x:"1",y:"4",width:"14",height:"10",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M5.5 4 L6.5 2.5 H9.5 L10.5 4"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"9",r:"2.3"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function vB($){return O(Y$,{...$,children:[O("circle",{cx:"8",cy:"8",r:"6"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"3"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"0.8",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UB($){return O(Y$,{...$,children:[O("circle",{cx:"8",cy:"8",r:"6"},void 0,!1,void 0,this),O("line",{x1:"5.5",y1:"5.5",x2:"10.5",y2:"10.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"5.5",x2:"5.5",y2:"10.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function gB($){return O(Y$,{...$,children:[O("circle",{cx:"7",cy:"7",r:"4.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"10.5",x2:"14.5",y2:"14.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _B($){return O(Y$,{...$,children:[O("rect",{x:"1",y:"3",width:"14",height:"10",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"6",x2:"5",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"7.5",y1:"6",x2:"8.5",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"11",y1:"6",x2:"12",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"10",x2:"12",y2:"10"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function zB({size:$=22,class:v}){return O("svg",{width:$,height:$,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg",class:v,"aria-hidden":"true",children:[O("rect",{x:"8",y:"8",width:"48",height:"48",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"2.2",opacity:"0.35"},void 0,!1,void 0,this),O("rect",{x:"16",y:"16",width:"32",height:"32",rx:"5",fill:"none",stroke:"currentColor","stroke-width":"2.2",opacity:"0.6"},void 0,!1,void 0,this),O("rect",{x:"24",y:"24",width:"16",height:"16",rx:"3",fill:"none",stroke:"currentColor","stroke-width":"2.2"},void 0,!1,void 0,this),O("rect",{x:"29",y:"29",width:"6",height:"6",rx:"1",fill:"currentColor"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function cW($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"6",x2:"10",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"8.5",x2:"8",y2:"8.5"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"11",x2:"11",y2:"11"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function oA($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"9",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M4 13.5 L5.5 11.5 L8 11.5"},void 0,!1,void 0,this),O("polyline",{points:"5 6 7 8 5 10"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"10",x2:"11",y2:"10"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nA($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"9",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M12 13.5 L10.5 11.5 L8 11.5"},void 0,!1,void 0,this),O("circle",{cx:"5",cy:"7",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"7",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"11",cy:"7",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function tA($){return O(Y$,{...$,children:[O("path",{d:"M3 1.5h6l3.5 3.5v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2.5a1 1 0 0 1 1-1z"},void 0,!1,void 0,this),O("polyline",{points:"9 1.5 9 5 12.5 5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"8.5",x2:"10.5",y2:"8.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"11",x2:"9",y2:"11"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function dA($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("circle",{cx:"5.5",cy:"6.5",r:"1.2"},void 0,!1,void 0,this),O("path",{d:"M1.8 12 L6 8.5 L9 11 L11.5 9 L14.2 12"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function iW($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"1.5",y1:"5.5",x2:"14.5",y2:"5.5"},void 0,!1,void 0,this),O("circle",{cx:"3.3",cy:"4",r:"0.5",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"5",cy:"4",r:"0.5",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"6.7",cy:"4",r:"0.5",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"8",x2:"12",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"10",x2:"10",y2:"10"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function aA($){return O(Y$,{...$,children:[O("rect",{x:"2",y:"4",width:"12",height:"10",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"2",y1:"6.5",x2:"14",y2:"6.5"},void 0,!1,void 0,this),O("path",{d:"M11 1.5 L11 4"},void 0,!1,void 0,this),O("circle",{cx:"11",cy:"4",r:"1.6",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function sA($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"1.5","stroke-dasharray":"2 1.5"},void 0,!1,void 0,this),O("rect",{x:"4",y:"4",width:"3.5",height:"3.5",rx:"0.6"},void 0,!1,void 0,this),O("rect",{x:"8.5",y:"4",width:"3.5",height:"3.5",rx:"0.6"},void 0,!1,void 0,this),O("rect",{x:"6.25",y:"8.5",width:"3.5",height:"3.5",rx:"0.6"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function eA($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("circle",{cx:"4.5",cy:"8",r:"1.1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"6.5",x2:"12.5",y2:"6.5"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"8",x2:"11",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"9.5",x2:"12",y2:"9.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $q($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M3.5 10.5 L6 6.5 L8.5 9.5 L12.5 5"},void 0,!1,void 0,this),O("circle",{cx:"12.5",cy:"5",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function vq($){return O(Y$,{...$,children:[O("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"5.5",x2:"11.5",y2:"5.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"8",x2:"11.5",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"10.5",x2:"8",y2:"10.5"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"2",x2:"6.5",y2:"14",opacity:"0.45"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Uq($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2"},void 0,!1,void 0,this),O("path",{d:"M4 11 L4 6 L6 8.5 L8 6 L8 11"},void 0,!1,void 0,this),O("path",{d:"M10 11 L10 6 L12.5 11 L12.5 6"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function gq($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("polyline",{points:"10 5 13 5 13 8"},void 0,!1,void 0,this),O("line",{x1:"13",y1:"5",x2:"8",y2:"10"},void 0,!1,void 0,this),O("path",{d:"M6 6 L3.5 6 L3.5 11.5 L10 11.5 L10 9"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _q($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M7 5.5 C 5.5 5.5 5.5 8 4 8 C 5.5 8 5.5 10.5 7 10.5"},void 0,!1,void 0,this),O("path",{d:"M9 5.5 C 10.5 5.5 10.5 8 12 8 C 10.5 8 10.5 10.5 9 10.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function zq($){return O(Y$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"5.2",y1:"6",x2:"8",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"8",x2:"10.8",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"8",x2:"8",y2:"11"},void 0,!1,void 0,this),O("circle",{cx:"5.2",cy:"6",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"10.8",cy:"6",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"11",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Rg($){switch($){case"markdown":return cW;case"prompt":return oA;case"response":return nA;case"file":return tA;case"image":return dA;case"webpage":return iW;case"context":return aA;case"group":return sA;case"status":return eA;case"trace":return $q;case"ledger":return vq;case"mcp-app":return Uq;case"ext-app":return gq;case"json-render":return _q;case"graph":return zq;case"html":return iW;default:return cW}}var bB={width:260,height:150},bq={markdown:{width:300,height:170},status:{width:280,height:110},context:{width:300,height:200},trace:{width:220,height:64},file:{width:300,height:190},image:{width:260,height:200},webpage:{width:320,height:210},html:{width:320,height:210},group:{width:340,height:210},graph:{width:320,height:210},"json-render":{width:320,height:210},"mcp-app":{width:340,height:230}};function GG($){return!!$&&$ in $v}function B6($){if(!$)return null;let v=T.value.get($);if(!v||v.dockPosition!==null)return null;return{left:v.position.x,top:v.position.y,width:v.size.width,height:v.size.height}}function OG($){return{x:$.left+$.width/2,y:$.top+$.height/2}}function yg($){if(typeof $.confidence!=="number")return 0.82;return 0.4+Math.max(0,Math.min(1,$.confidence))*0.55}function JB($,v){let g=Math.max(40,Math.abs(v.x-$.x)/2);return`M ${$.x} ${$.y} C ${$.x+g} ${$.y}, ${v.x-g} ${v.y}, ${v.x} ${v.y}`}function KG({intent:$}){let v=GG($.nodeType)?Rg($.nodeType):null,g=$.label||$.kind,_=typeof $.confidence==="number"?`${Math.round($.confidence*100)}%`:null;return O("div",{class:"intent-info",onMouseEnter:()=>WU.value=$.id,onMouseLeave:()=>{if(WU.value===$.id)WU.value=null},children:[O("div",{class:"intent-chip",children:[typeof $.seq==="number"&&O("span",{class:"intent-seq",children:$.seq},void 0,!1,void 0,this),v&&O("span",{class:"intent-chip-icon","aria-hidden":"true",children:O(v,{size:12},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"intent-chip-label",children:g},void 0,!1,void 0,this),_&&O("span",{class:"intent-confidence",children:_},void 0,!1,void 0,this),$.phase==="forming"&&O("button",{type:"button",class:"intent-veto",title:"Veto this move (Esc)","aria-label":"Veto this move",onClick:(U)=>{U.stopPropagation(),b2($)},children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.reason&&O("div",{class:"intent-reason",children:$.reason},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function OB({intent:$,rect:v}){let g=GG($.nodeType)?Rg($.nodeType):null,_=GG($.nodeType)?$v[$.nodeType]:"Node";return O("div",{class:`intent-ghost intent-ghost-box is-${$.phase}`,"data-intent-id":$.id,style:{left:`${v.left}px`,top:`${v.top}px`,width:`${v.width}px`,height:`${v.height}px`,opacity:yg($)},children:[O("div",{class:"intent-ghost-titlebar",children:[O("span",{class:"intent-ghost-icon","aria-hidden":"true",children:g?O(g,{size:13},void 0,!1,void 0,this):"◇"},void 0,!1,void 0,this),O("span",{class:"intent-ghost-badge",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(KG,{intent:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GB({intent:$,rect:v,variant:g}){return O("div",{class:`intent-ghost intent-ghost-${g} is-${$.phase}`,"data-intent-id":$.id,style:{left:`${v.left}px`,top:`${v.top}px`,width:`${v.width}px`,height:`${v.height}px`,opacity:yg($)},children:[g==="edit"&&O("div",{class:"intent-edit-bar"},void 0,!1,void 0,this),O(KG,{intent:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Jq($){let v=$.phase==="settling"?B6($.settledNodeId):null;switch($.kind){case"create":{if(!$.position)return null;let g=$.nodeType&&bq[$.nodeType]||bB,_=v??{left:$.position.x,top:$.position.y,...g};return O(OB,{intent:$,rect:_},$.id,!1,void 0,this)}case"move":{if(!$.position)return null;let _=B6($.nodeId)??bB,U=v??{left:$.position.x,top:$.position.y,width:_.width,height:_.height};return O(OB,{intent:$,rect:U},$.id,!1,void 0,this)}case"remove":{let g=v??B6($.nodeId);if(!g)return null;return O(GB,{intent:$,rect:g,variant:"remove"},$.id,!1,void 0,this)}case"edit":{let g=v??B6($.nodeId);if(!g)return null;return O(GB,{intent:$,rect:g,variant:"edit"},$.id,!1,void 0,this)}case"connect":{if(!$.edge)return null;let g=B6($.edge.from),_=B6($.edge.to);if(!g||!_)return null;let U={x:(g.left+g.width/2+_.left+_.width/2)/2,y:(g.top+g.height/2+_.top+_.height/2)/2},z={left:U.x-110,top:U.y-18,width:220,height:36};return O("div",{class:`intent-ghost intent-ghost-connect is-${$.phase}`,"data-intent-id":$.id,style:{left:`${z.left}px`,top:`${z.top}px`,width:`${z.width}px`,opacity:yg($)},children:O(KG,{intent:$},void 0,!1,void 0,this)},$.id,!1,void 0,this)}default:return null}}function KB(){let $=Array.from(Lv.value.values());if(m(()=>{function v(g){if(g.key!=="Escape")return;let _=WU.value;if(!_)return;let U=Lv.value.get(_);if(!U||U.phase!=="forming")return;g.stopImmediatePropagation(),g.preventDefault(),b2(U)}return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[]),$.length===0)return null;return O("div",{class:"intent-layer",children:[O("svg",{class:"intent-line-layer",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[O("defs",{children:O("marker",{id:"intent-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:O("path",{d:"M0,0 L6,3 L0,6 Z",class:"intent-arrow-head"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.map((v)=>{if(v.kind==="connect"&&v.edge){let g=B6(v.edge.from),_=B6(v.edge.to);if(!g||!_)return null;return O("path",{d:JB(OG(g),OG(_)),class:`intent-edge type-${v.edge.type}`,style:{opacity:yg(v)}},`line-${v.id}`,!1,void 0,this)}if(v.kind==="move"&&v.position){let g=B6(v.nodeId);if(!g)return null;let _=g,U={x:v.position.x+_.width/2,y:v.position.y+_.height/2};return O("path",{d:JB(OG(g),U),class:"intent-trail",markerEnd:"url(#intent-arrow)",style:{opacity:yg(v)}},`line-${v.id}`,!1,void 0,this)}return null})]},void 0,!0,void 0,this),$.map(Jq)]},void 0,!0,void 0,this)}var BU=8,g4=B$(null),PU=[],kU=[],PB=null;function WB($){let v=$?.data.parentGroup;return typeof v==="string"&&v.length>0?v:null}function BB($){if(!$||!Array.isArray($.data.children))return[];return $.data.children.filter((v)=>typeof v==="string")}function Oq($,v){let g=new Map(v.map((J)=>[J.id,J])),_=new Set([$]),U=g.get($);if(!U)return _;let z=WB(U);while(z&&!_.has(z))_.add(z),z=WB(g.get(z));if(U.type!=="group")return _;let b=[...BB(U)];while(b.length>0){let J=b.pop();if(!J||_.has(J))continue;_.add(J);let G=g.get(J);if(G?.type==="group")b.push(...BB(G))}return _}function kB($,v){PU=[],kU=[],PB=$;let g=Array.from(v),_=Oq($,g);for(let U of g){if(_.has(U.id)||U.dockPosition!==null)continue;let z=U.position.x,b=U.position.x+U.size.width,J=U.position.x+U.size.width/2,G=U.position.y,K=U.position.y+U.size.height,W=U.position.y+U.size.height/2;PU.push({val:z,minY:G,maxY:K}),PU.push({val:b,minY:G,maxY:K}),PU.push({val:J,minY:G,maxY:K}),kU.push({val:G,minX:z,maxX:b}),kU.push({val:K,minX:z,maxX:b}),kU.push({val:W,minX:z,maxX:b})}}function IB(){PU=[],kU=[],PB=null}function HB($,v,g,_){let U=[$,$+g/2,$+g],z=[v,v+_/2,v+_],b=[0,g/2,g],J=[0,_/2,_],G=null,K=BU+1,W=null;for(let H=0;H<3;H++){let I=U[H];for(let F of PU){let Y=Math.abs(I-F.val);if(Y<K)K=Y,G=F.val-b[H],W={axis:"x",pos:F.val,from:Math.min(F.minY,v),to:Math.max(F.maxY,v+_)}}}let B=null,k=BU+1,P=null;for(let H=0;H<3;H++){let I=z[H];for(let F of kU){let Y=Math.abs(I-F.val);if(Y<k)k=Y,B=F.val-J[H],P={axis:"y",pos:F.val,from:Math.min(F.minX,$),to:Math.max(F.maxX,$+g)}}}let A=[];if(W&&K<=BU)A.push(W);if(P&&k<=BU)A.push(P);return{x:G!==null&&K<=BU?G:$,y:B!==null&&k<=BU?B:v,guides:A}}function LB({nodeId:$,viewport:v,onMove:g,onDragEnd:_}){let U=V(!1),z=V({x:0,y:0}),b=V({x:0,y:0});return N((G,K,W)=>{G.stopPropagation(),G.preventDefault(),U.current=!0,document.documentElement.classList.add("is-node-dragging"),window.getSelection()?.removeAllRanges(),z.current={x:G.clientX,y:G.clientY},b.current={x:K,y:W};let B=null,k=null,P=()=>{if(k=null,!U.current||!B)return;let I=B;B=null;let F=v.value.scale,Y=(I.x-z.current.x)/F,X=(I.y-z.current.y)/F;g($,b.current.x+Y,b.current.y+X)},A=(I)=>{if(!U.current)return;if(B={x:I.clientX,y:I.clientY},k!==null)return;k=window.requestAnimationFrame(P)},H=()=>{if(k!==null)window.cancelAnimationFrame(k),P();U.current=!1,document.documentElement.classList.remove("is-node-dragging"),document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),_()};document.addEventListener("pointermove",A),document.addEventListener("pointerup",H),document.addEventListener("pointercancel",H)},[$,v,g,_])}var Gq=200,Kq=100;function FB({nodeId:$,viewport:v,onResize:g,onResizeEnd:_}){let U=V(!1),z=V({x:0,y:0}),b=V({w:0,h:0});return N((G,K,W)=>{G.stopPropagation(),G.preventDefault(),U.current=!0,z.current={x:G.clientX,y:G.clientY},b.current={w:K,h:W},document.documentElement.classList.add("is-node-resizing");let B=null,k=null,P=()=>{if(k=null,!U.current||!B)return;let I=B;B=null;let F=v.value.scale,Y=(I.x-z.current.x)/F,X=(I.y-z.current.y)/F;g($,Math.max(Gq,b.current.w+Y),Math.max(Kq,b.current.h+X))},A=(I)=>{if(!U.current)return;if(B={x:I.clientX,y:I.clientY},k!==null)return;k=window.requestAnimationFrame(P)},H=()=>{if(k!==null)window.cancelAnimationFrame(k),P();U.current=!1,document.documentElement.classList.remove("is-node-resizing"),document.removeEventListener("pointermove",A),document.removeEventListener("pointerup",H),document.removeEventListener("pointercancel",H),_()};document.addEventListener("pointermove",A),document.addEventListener("pointerup",H),document.addEventListener("pointercancel",H)},[$,v,g,_])}function YB({node:$,children:v,onContextMenu:g}){let _=y$.value===$.id,U=h$.value.has($.id),z=D$.value.has($.id),b=W4.value.has($.id),J=!b&&B4.value.has($.id),G=$_.value.has($.id),K=!_&&RK.value.has($.id),W=Y6.value,B=W!==null&&W.has($.id),k=W!==null&&!W.has($.id),[P,A]=x(!1),H=V(null),I=N((f,d,G$)=>{let g$=HB(d,G$,$.size.width,$.size.height),j$=T.value.get(f);if(j$?.position.x===g$.x&&j$.position.y===g$.y){g4.value=g$.guides.length>0?g$.guides:null;return}Pv(f,{position:{x:g$.x,y:g$.y}}),g4.value=g$.guides.length>0?g$.guides:null},[$.size.width,$.size.height]),F=N(()=>{IB(),g4.value=null,d$()},[]),Y=LB({nodeId:$.id,viewport:I$,onMove:I,onDragEnd:F}),X=N((f,d,G$)=>{let g$=T.value.get(f);if(g$?.size.width===d&&g$.size.height===G$)return;Pv(f,{size:{width:d,height:G$}})},[]),Q=N(()=>{U$($.id,{userResized:!0}),wv($.id,{data:{userResized:!0}}),d$()},[$.id]),u=FB({nodeId:$.id,viewport:I$,onResize:X,onResizeEnd:Q}),E=N((f)=>{if(P)return;A6($.id),kB($.id,T.value.values()),Y(f,$.position.x,$.position.y)},[$.id,$.position.x,$.position.y,Y,P]),M=N((f)=>{if(f.stopPropagation(),f.shiftKey){yK($.id);return}A6($.id)},[$.id]),n=N((f)=>{if(g)g(f,$.id)},[g,$.id]),t=N((f)=>{f.stopPropagation(),A(!0),requestAnimationFrame(()=>H.current?.focus())},[]),r=$.data.title||$v[$.type],R=N((f)=>{let d=f.trim();if(d&&d!==r)U$($.id,{title:d}),wv($.id,{title:d});A(!1)},[$.id,r]),$$=V(null),p=V(!1),c=V(null);m(()=>{if(p.current||!j2($))return;let f=$$.current;if(!f)return;let d=new ResizeObserver(()=>{if(p.current){d.disconnect();return}let G$=f.scrollHeight,g$=t3($,G$);if(g$===null)return;if(Math.abs(g$-$.size.height)>8){if(Y4($.id,{width:$.size.width,height:g$}),c.current!==null)window.clearTimeout(c.current);c.current=window.setTimeout(()=>{d$({recordHistory:!1}),c.current=null},0)}p.current=!0,d.disconnect()});return d.observe(f),()=>{if(d.disconnect(),c.current!==null)window.clearTimeout(c.current),c.current=null}},[$.id,$.type,$.data.mode,$.data.strictSize,$.collapsed,$.dockPosition,$.size.width,$.size.height]);let P$=$.pinned,Z$=$.type==="trace",i$=Z$&&$.data.status==="running",w=$.type==="group",l=$.data.strictSize===!0,e=Math.max(I$.value.scale,0.01),s=e<1?Math.min(2.2,1/e):1,W$=w&&$.data.color?$.data.color:void 0,z$={left:`${$.position.x}px`,top:`${$.position.y}px`,width:`${$.size.width}px`,height:$.collapsed?"auto":`${$.size.height}px`,zIndex:$.zIndex,"--node-chrome-scale":s.toFixed(3),...W$?{"--group-color":W$}:{}},a=["canvas-node",_?"active":"",K?"neighbor":"",B?"search-match":"",k?"search-dimmed":"",U?"selected":"",z?"context-pinned":"",b?"attention-focus-primary":"",J?"attention-focus-secondary":"",G?"attention-pulse":"",P$?"pinned":"",Z$?"trace-node":"",i$?"trace-running":"",w?"group-node":"",l?"strict-size":""].filter(Boolean).join(" ");return O("div",{class:a,style:z$,onPointerDown:M,onContextMenu:n,children:[O("div",{class:"node-titlebar",onPointerDown:E,children:[O("span",{class:"node-type-icon","aria-hidden":"true",children:(()=>{let f=Rg($.type);return O(f,{size:Math.round(14*s)},void 0,!1,void 0,this)})()},void 0,!1,void 0,this),O("span",{class:"node-type-badge",children:$v[$.type]},void 0,!1,void 0,this),P?O("input",{ref:H,class:"node-title-input",value:r,onBlur:(f)=>R(f.target.value),onKeyDown:(f)=>{if(f.key==="Enter")R(f.target.value);if(f.key==="Escape")A(!1)},onClick:(f)=>f.stopPropagation()},void 0,!1,void 0,this):O("span",{class:"node-title",onDblClick:t,title:"Double-click to rename",children:r},void 0,!1,void 0,this),O("div",{class:"node-controls",children:[P$&&O("span",{class:"pin-indicator",title:"Pinned",children:"⊙"},void 0,!1,void 0,this),O("button",{type:"button",class:`ctx-pin-btn${z?" ctx-pin-active":""}`,onClick:(f)=>{f.stopPropagation(),L4($.id)},title:z?"Remove from context":"Add to context",children:"✦"},void 0,!1,void 0,this),r0($)&&O("button",{type:"button",onClick:(f)=>{f.stopPropagation(),u0($)},title:"Open as site",children:"↗"},void 0,!1,void 0,this),z_.has($.type)&&O("button",{type:"button",onClick:(f)=>{f.stopPropagation(),z6($.id)},title:"Expand (focus mode)",children:"⤢"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(f)=>{f.stopPropagation(),q6($.id)},title:$.collapsed?"Expand":"Collapse",children:$.collapsed?"▸":"▾"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(f)=>{f.stopPropagation(),F4($.id),G_($.id)},title:"Close",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!$.collapsed&&O("div",{ref:$$,class:"node-body",children:v},void 0,!1,void 0,this),!$.collapsed&&O("div",{class:"node-resize-handle",onPointerDown:(f)=>u(f,$.size.width,$.size.height)},void 0,!1,void 0,this),["top","right","bottom","left"].map((f)=>O("div",{class:`node-port node-port-${f}`,onPointerDown:(d)=>{d.stopPropagation(),d.preventDefault();let G$=$.position.x+$.size.width/2,g$=$.position.y+$.size.height/2,j$=$.size.width/2,o$=$.size.height/2,b$,K$;switch(f){case"top":b$=G$,K$=g$-o$;break;case"bottom":b$=G$,K$=g$+o$;break;case"left":b$=G$-j$,K$=g$;break;case"right":b$=G$+j$,K$=g$;break}rv.value={fromId:$.id,fromX:b$,fromY:K$,cursorX:b$,cursorY:K$}}},f,!1,void 0,this))]},void 0,!0,void 0,this)}var Wq={relation:"var(--c-muted)","depends-on":"var(--c-warn)",flow:"var(--c-accent)",references:"var(--c-dim)"},Bq=new Set(["depends-on","flow"]);function Pq($){if($.style==="dashed")return"8 4";if($.style==="dotted")return"3 3";if($.type==="references"&&!$.style)return"8 4";return}function AB($,v){let g=$.position.x+$.size.width/2,_=$.position.y+$.size.height/2,U=v.position.x+v.size.width/2,z=v.position.y+v.size.height/2,b=U-g,J=z-_,G=$.size.width/2,K=$.size.height/2,W=Math.abs(J/(b||0.001)),B=K/(G||0.001);if(W>B){let P=J>0?1:-1;return{x:g+K/W*(b>0?1:-1),y:_+K*P}}let k=b>0?1:-1;return{x:g+G*k,y:_+W*G*(J>0?1:-1)}}function kq($,v,g,_,U,z,b,J){return{x:0.125*$+0.375*g+0.375*U+0.125*b,y:0.125*v+0.375*_+0.375*z+0.125*J}}function Iq({edge:$,fromNode:v,toNode:g,focused:_,dimmed:U}){let z=AB(v,g),b=AB(g,v),J=b.x-z.x,G=b.y-z.y,K=Math.sqrt(J*J+G*G),W=Math.min(K*0.25,80),B=J/(K||1),k=G/(K||1),P=z.x+B*W,A=z.y+k*W,H=b.x-B*W,I=b.y-k*W,F=`M ${z.x} ${z.y} C ${P} ${A}, ${H} ${I}, ${b.x} ${b.y}`,Y=Wq[$.type],X=Bq.has($.type),Q=Pq($),u=$.label?kq(z.x,z.y,P,A,H,I,b.x,b.y):null,E=`edge-path-${$.id}`;return O("g",{children:[O("path",{d:F,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"}},void 0,!1,void 0,this),_&&O("path",{d:F,fill:"none",stroke:Y,"stroke-width":"6","stroke-dasharray":Q,opacity:"0.15",style:{filter:"blur(3px)"}},void 0,!1,void 0,this),O("path",{id:E,d:F,fill:"none",stroke:Y,"stroke-width":_?2.5:1.5,"stroke-dasharray":Q,"marker-end":X?"url(#edge-arrow)":void 0,opacity:U?0.2:_?1:0.75,style:{transition:"opacity 0.2s, stroke-width 0.2s"}},void 0,!1,void 0,this),$.animated&&O("circle",{r:"3",fill:Y,opacity:"0.9",children:O("animateMotion",{dur:"2s",repeatCount:"indefinite",children:O("mpath",{href:`#${E}`},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),u&&$.label&&O("g",{transform:`translate(${u.x}, ${u.y})`,children:[O("rect",{class:"edge-label-bg",x:-($.label.length*3.5+8),y:"-10",width:$.label.length*7+16,height:"20",rx:"4"},void 0,!1,void 0,this),O("text",{class:"edge-label","text-anchor":"middle","dominant-baseline":"central",fill:"var(--c-text)","font-size":"11",children:$.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function qB({nodes:$,edges:v}){let g=$.value,_=Array.from(v.value.values()),U=y$.value,z=U!==null,b=Y6.value,J=b!==null;if(_.length===0)return null;let G=96,K=Array.from(g.values()),W=Math.min(...K.map((I)=>I.position.x))-G,B=Math.min(...K.map((I)=>I.position.y))-G,k=Math.max(...K.map((I)=>I.position.x+I.size.width))+G,P=Math.max(...K.map((I)=>I.position.y+I.size.height))+G,A=Math.max(1,k-W),H=Math.max(1,P-B);return O("svg",{"aria-label":"Canvas connections",role:"img",viewBox:`${W} ${B} ${A} ${H}`,width:A,height:H,style:{position:"absolute",top:`${B}px`,left:`${W}px`,pointerEvents:"none",overflow:"visible"},children:[O("title",{children:"Canvas connections"},void 0,!1,void 0,this),O("defs",{children:O("marker",{id:"edge-arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:O("path",{d:"M 0 1 L 10 5 L 0 9 z",fill:"currentColor",opacity:"0.75"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),_.map((I)=>{let F=g.get(I.from),Y=g.get(I.to);if(!F||!Y)return null;let X=z&&(I.from===U||I.to===U),Q=J&&!(b.has(I.from)||b.has(I.to));return O(Iq,{edge:I,fromNode:F,toNode:Y,focused:X,dimmed:z&&!X||Q},I.id,!1,void 0,this)}),rv.value&&(()=>{let I=rv.value,F=I.cursorX-I.fromX,Y=I.cursorY-I.fromY,X=Math.sqrt(F*F+Y*Y),Q=Math.min(X*0.25,80),u=F/(X||1),E=Y/(X||1),M=`M ${I.fromX} ${I.fromY} C ${I.fromX+u*Q} ${I.fromY+E*Q}, ${I.cursorX-u*Q} ${I.cursorY-E*Q}, ${I.cursorX} ${I.cursorY}`;return O("g",{children:[O("path",{d:M,fill:"none",stroke:"var(--c-accent)","stroke-width":"6",opacity:"0.1",style:{filter:"blur(3px)"}},void 0,!1,void 0,this),O("path",{d:M,fill:"none",stroke:"var(--c-accent)","stroke-width":"2","stroke-dasharray":"6 4",opacity:"0.8"},void 0,!1,void 0,this),O("circle",{cx:I.cursorX,cy:I.cursorY,r:"5",fill:"var(--c-accent)",opacity:"0.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)})()]},void 0,!0,void 0,this)}function Hq($){let[v,...g]=$;if(!v)return"";return g.reduce((_,U)=>`${_} L ${U.x} ${U.y}`,`M ${v.x} ${v.y}`)}function WG({annotations:$}){if($.length===0)return null;return O("svg",{class:"annotation-layer","aria-hidden":"true",children:$.map((v)=>{let g=v.color==="currentColor"?"var(--c-annotation)":v.color;if(v.type==="text"){let _=v.points[0];if(!_||!v.text)return null;return O("text",{x:_.x,y:_.y,fill:g,"font-size":v.width,"font-family":"var(--font)","font-weight":"700",opacity:"0.95",children:v.text},v.id,!1,void 0,this)}return O("path",{d:Hq(v.points),fill:"none",stroke:g,"stroke-width":v.width,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.9"},v.id,!1,void 0,this)})},void 0,!1,void 0,this)}var Lq=0.1,Fq=4,XB=1;function wB($){return Math.min(Fq,Math.max(Lq,$))}function ZB({viewport:$,onViewportChange:v,onViewportCommit:g,disabled:_=!1}){let U=V(null),z=V(!1),b=V({x:0,y:0}),J=V(0),G=V(null),K=N((I)=>{if(G.current!==null)window.clearTimeout(G.current);G.current=window.setTimeout(()=>{G.current=null,g(I)},140)},[g]),W=N((I)=>{if(_)return;I.preventDefault();let F=$.value;if(I.ctrlKey||I.metaKey){let Y=U.current?.getBoundingClientRect();if(!Y)return;let X=I.clientX-Y.left,Q=I.clientY-Y.top,u=-I.deltaY*0.002,E=wB(F.scale*(1+u)),M=E/F.scale,n={x:X-M*(X-F.x),y:Q-M*(Q-F.y),scale:E};v(n),K(n)}else{let Y={x:F.x-I.deltaX*XB,y:F.y-I.deltaY*XB,scale:F.scale};v(Y),K(Y)}},[_,$,v,K]),B=N((I)=>{if(_)return;let F=U.current;if(!F||I.target!==F)return;z.current=!0,b.current={x:I.clientX,y:I.clientY},F.setPointerCapture(I.pointerId)},[_]),k=N((I)=>{if(!z.current)return;if(_)return;let F=I.clientX-b.current.x,Y=I.clientY-b.current.y;b.current={x:I.clientX,y:I.clientY};let X=$.value;v({x:X.x+F,y:X.y+Y,scale:X.scale})},[_,$,v]),P=N(()=>{if(z.current)g($.value);z.current=!1},[g,$]),A=N((I)=>{if(_)return;if(I.touches.length!==2){J.current=0;return}I.preventDefault();let F=I.touches[0],Y=I.touches[1],X=Math.hypot(Y.clientX-F.clientX,Y.clientY-F.clientY),Q=(F.clientX+Y.clientX)/2,u=(F.clientY+Y.clientY)/2;if(J.current>0){let E=$.value,M=U.current?.getBoundingClientRect();if(!M)return;let n=Q-M.left,t=u-M.top,r=X/J.current,R=wB(E.scale*r),$$=R/E.scale,p={x:n-$$*(n-E.x),y:t-$$*(t-E.y),scale:R};v(p),K(p)}J.current=X},[_,$,v,K]),H=N(()=>{if(G.current!==null)window.clearTimeout(G.current),G.current=null;g($.value),J.current=0},[g,$]);return m(()=>{let I=U.current;if(!I)return;return I.addEventListener("wheel",W,{passive:!1}),I.addEventListener("pointerdown",B),I.addEventListener("pointermove",k),I.addEventListener("pointerup",P),I.addEventListener("pointercancel",P),I.addEventListener("touchmove",A,{passive:!1}),I.addEventListener("touchend",H),()=>{if(G.current!==null)window.clearTimeout(G.current);I.removeEventListener("wheel",W),I.removeEventListener("pointerdown",B),I.removeEventListener("pointermove",k),I.removeEventListener("pointerup",P),I.removeEventListener("pointercancel",P),I.removeEventListener("touchmove",A),I.removeEventListener("touchend",H)}},[W,B,k,P,A,H]),U}function Yq($){switch($.type){case"markdown":return O(R_,{node:$},void 0,!1,void 0,this);case"mcp-app":return O(f6,{node:$},void 0,!1,void 0,this);case"webpage":return O(N0,{node:$},void 0,!1,void 0,this);case"json-render":return O(f6,{node:$},void 0,!1,void 0,this);case"graph":return O(f6,{node:$},void 0,!1,void 0,this);case"prompt":return O(R0,{node:$},void 0,!1,void 0,this);case"response":return O(y0,{node:$},void 0,!1,void 0,this);case"status":return O(GU,{node:$},void 0,!1,void 0,this);case"context":return O(o6,{node:$},void 0,!1,void 0,this);case"ledger":return O(Z4,{node:$},void 0,!1,void 0,this);case"trace":return O(D0,{node:$},void 0,!1,void 0,this);case"file":return O(S_,{node:$},void 0,!1,void 0,this);case"image":return O(Q0,{node:$},void 0,!1,void 0,this);case"html":return O(rg,{node:$},void 0,!1,void 0,this);case"group":return O(QW,{node:$},void 0,!1,void 0,this);default:return O("div",{children:"Unknown node type"},void 0,!1,void 0,this)}}function Aq($,v,g){let _=g.x-v.x,U=g.y-v.y,z=_*_+U*U;if(z===0)return Math.hypot($.x-v.x,$.y-v.y);let b=Math.max(0,Math.min(1,(($.x-v.x)*_+($.y-v.y)*U)/z));return Math.hypot($.x-(v.x+b*_),$.y-(v.y+b*U))}function qq($,v,g){for(let _=$.length-1;_>=0;_--){let U=$[_];if(!U)continue;let z=g+U.width;if(v.x<U.bounds.x-z||v.x>U.bounds.x+U.bounds.width+z||v.y<U.bounds.y-z||v.y>U.bounds.y+U.bounds.height+z)continue;if(U.type==="text")return U;for(let b=1;b<U.points.length;b++){let J=U.points[b-1],G=U.points[b];if(J&&G&&Aq(v,J,G)<=g+U.width/2)return U}}return null}var BG="currentColor",SB=4,MB=24,Xq=14,wq=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]),Zq=new Set(["md","mdx","markdown"]),QB={width:520,height:420};function Sq($){let v=$.trim();if(!v||/\s/.test(v))return null;let g=/^[a-z][a-z0-9+.-]*:/i.test(v)?v:`https://${v}`;try{let _=new URL(g);if(_.protocol!=="http:"&&_.protocol!=="https:")return null;return _.toString()}catch{return null}}function PG($){let v=$.trim();if(!v)return[];let g=v.includes(`
226
- `)?v.split(/\r?\n/):v.split(/\s+/),_=new Set,U=[];for(let z of g){let b=z.trim();if(!b||b.startsWith("#"))continue;let J=Sq(b);if(!J||_.has(J))continue;_.add(J),U.push(J)}return U}function Mq($){let v=PG($.getData("text/uri-list"));if(v.length>0)return v;return PG($.getData("text/plain"))}function Qq($){if(!$)return!1;return $.types.includes("text/uri-list")||$.types.includes("text/plain")}function NB($){if(!($ instanceof HTMLElement))return!1;return Boolean($.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]'))}function Nq($){let v=$.split(".").pop()?.toLowerCase()??"";if(wq.has(v))return"image";if(Zq.has(v))return"markdown";return"file"}function rq($,v){let g=[],_=0;for(let U of $){if(U.dockPosition!==null)continue;if(v&&U.id===v)continue;if(U.type==="group")g.splice(_++,0,U);else g.push(U)}return g}function rB({onNodeContextMenu:$,onCanvasContextMenu:v,annotationMode:g=!1,annotationTool:_=null}){let U=I$.value,z=V(!1),b=V(!1),J=V([]),[G,K]=x(null),[W,B]=x(null),[k,P]=x(null),A=V(null),[H,I]=x(!1),F=V(0),Y=V(null),X=ZB({viewport:I$,disabled:g,onViewportChange:(w)=>{if(z.current||g)return;q4(),cK(w)},onViewportCommit:(w)=>{if(z.current||g)return;q4(),lK(w)}}),Q=N((w)=>{A.current=w,P(w)},[]),u=N(async(w,l,e)=>{if(w.length===0)return;let{width:s,height:W$}=QB,z$=24,a=Math.ceil(Math.sqrt(w.length)),f=Math.ceil(w.length/a),d=a*s+Math.max(0,a-1)*z$,G$=f*W$+Math.max(0,f-1)*z$;for(let g$=0;g$<w.length;g$++){let j$=g$%a,o$=Math.floor(g$/a),b$=l-d/2+j$*(s+z$),K$=e-G$/2+o$*(W$+z$);await lv({type:"webpage",content:w[g$],x:b$,y:K$,width:s,height:W$})}},[]),E=N((w)=>{let l=X.current;if(!l)return;if(_==="eraser"){if((w.target instanceof Element?w.target:null)?.closest(".hud-layer, .snapshot-panel, .context-menu, .command-palette"))return;w.preventDefault(),w.stopPropagation();let f=l.getBoundingClientRect(),d=I$.value,G$={x:(w.clientX-f.left-d.x)/d.scale,y:(w.clientY-f.top-d.y)/d.scale},g$=qq(Array.from(I4.value.values()),G$,Xq/d.scale);if(g$)mK(g$.id);return}if(_==="text"){if((w.target instanceof Element?w.target:null)?.closest(".hud-layer, .snapshot-panel, .context-menu, .command-palette"))return;w.preventDefault(),w.stopPropagation(),y$.value=null,jv();let f=l.getBoundingClientRect(),d=I$.value;Q({x:(w.clientX-f.left-d.x)/d.scale,y:(w.clientY-f.top-d.y)/d.scale,value:""});return}if(_==="pen"){if((w.target instanceof Element?w.target:null)?.closest(".hud-layer, .snapshot-panel, .context-menu, .command-palette"))return;w.preventDefault(),w.stopPropagation(),y$.value=null,jv(),b.current=!0;let f=l.getBoundingClientRect(),d=I$.value,G$={x:(w.clientX-f.left-d.x)/d.scale,y:(w.clientY-f.top-d.y)/d.scale};J.current=[G$],B({id:"draft-annotation",type:"freehand",points:[G$],bounds:{x:0,y:0,width:0,height:0},color:BG,width:SB,createdAt:""}),l.setPointerCapture(w.pointerId);return}if(w.target!==l)return;if(!w.shiftKey){if(!Y.current)y$.value=null,jv();return}w.preventDefault(),w.stopPropagation(),z.current=!0;let e=l.getBoundingClientRect(),s=w.clientX-e.left,W$=w.clientY-e.top,z$={startX:s,startY:W$,currentX:s,currentY:W$};Y.current=z$,K(z$),l.setPointerCapture(w.pointerId)},[_,X]),M=N((w)=>{if(b.current){let s=X.current;if(!s)return;let W$=s.getBoundingClientRect(),z$=I$.value,a={x:(w.clientX-W$.left-z$.x)/z$.scale,y:(w.clientY-W$.top-z$.y)/z$.scale},f=J.current.at(-1);if(f&&Math.hypot(a.x-f.x,a.y-f.y)<2)return;J.current=[...J.current,a],B((d)=>d?{...d,points:J.current}:null);return}if(!z.current||!Y.current)return;let l=X.current?.getBoundingClientRect();if(!l)return;let e={...Y.current,currentX:w.clientX-l.left,currentY:w.clientY-l.top};Y.current=e,K(e)},[X]),n=N((w)=>{if(b.current){b.current=!1;let a=J.current;if(J.current=[],B(null),a.length>=2)G2({points:a,color:BG,width:SB});let f=X.current;if(f?.hasPointerCapture(w.pointerId))f.releasePointerCapture(w.pointerId);return}let l=Y.current;if(!z.current||!l)return;z.current=!1,Y.current=null;let e=Math.min(l.startX,l.currentX),s=Math.max(l.startX,l.currentX),W$=Math.min(l.startY,l.currentY),z$=Math.max(l.startY,l.currentY);if(s-e>5||z$-W$>5){let a=I$.value,f=(e-a.x)/a.scale,d=(s-a.x)/a.scale,G$=(W$-a.y)/a.scale,g$=(z$-a.y)/a.scale,j$=[];for(let o$ of T.value.values()){if(o$.dockPosition!==null)continue;let b$=o$.position.x,K$=o$.position.y;if(b$+o$.size.width>f&&b$<d&&K$+o$.size.height>G$&&K$<g$)j$.push(o$.id)}if(j$.length>0)DK(j$)}K(null)},[]);m(()=>{if(g)return;if(!b.current&&!W&&!k)return;b.current=!1,J.current=[],B(null),Q(null)},[g,W,Q,k]);let t=N(()=>{let w=A.current;if(!w)return;let l=w.value.trim();if(Q(null),!l)return;let e={x:w.x,y:w.y};G2({type:"text",points:[e],color:BG,width:MB,text:l})},[Q]);m(()=>{if(_!=="text"&&k)Q(null)},[_,Q,k]),m(()=>{function w(e){if(!rv.value)return;let s=X.current;if(!s)return;let W$=s.getBoundingClientRect(),z$=I$.value;rv.value={...rv.value,cursorX:(e.clientX-W$.left-z$.x)/z$.scale,cursorY:(e.clientY-W$.top-z$.y)/z$.scale}}function l(e){let s=rv.value;if(!s)return;rv.value=null;let W$=X.current;if(!W$)return;let z$=W$.getBoundingClientRect(),a=I$.value,f=(e.clientX-z$.left-a.x)/a.scale,d=(e.clientY-z$.top-a.y)/a.scale;for(let G$ of T.value.values()){if(G$.id===s.fromId||G$.dockPosition!==null)continue;if(f>=G$.position.x&&f<=G$.position.x+G$.size.width&&d>=G$.position.y&&d<=G$.position.y+G$.size.height){P4(s.fromId,G$.id,"relation");return}}}return document.addEventListener("pointermove",w),document.addEventListener("pointerup",l),()=>{document.removeEventListener("pointermove",w),document.removeEventListener("pointerup",l)}},[X]);let r=N((w)=>{if(g)return;let l=X.current;if(!l||w.target!==l)return;let e=l.getBoundingClientRect(),s=I$.value,W$=(w.clientX-e.left-s.x)/s.scale,z$=(w.clientY-e.top-s.y)/s.scale,a=520,f=360;lv({type:"markdown",title:"New note",x:W$-a/2,y:z$-f/2,width:a,height:f})},[g,X]),R=N((w)=>{if(g)return;if(!v)return;let l=X.current;if(!l)return;if((w.target instanceof Element?w.target:null)?.closest(".canvas-node"))return;let s=l.getBoundingClientRect(),W$=I$.value,z$=(w.clientX-s.left-W$.x)/W$.scale,a=(w.clientY-s.top-W$.y)/W$.scale;v(w,z$,a)},[g,X,v]),$$=N((w)=>{if(w.preventDefault(),F.current++,w.dataTransfer?.types.includes("Files")||Qq(w.dataTransfer))I(!0)},[]),p=N((w)=>{if(w.preventDefault(),w.dataTransfer)w.dataTransfer.dropEffect="copy"},[]),c=N((w)=>{if(w.preventDefault(),F.current--,F.current<=0)F.current=0,I(!1)},[]),P$=N(async(w)=>{w.preventDefault(),I(!1),F.current=0;let l=X.current;if(!l||!w.dataTransfer)return;let e=l.getBoundingClientRect(),s=I$.value,W$=(w.clientX-e.left-s.x)/s.scale,z$=(w.clientY-e.top-s.y)/s.scale,a=Array.from(w.dataTransfer.files);if(a.length===0){let j$=Mq(w.dataTransfer);await u(j$,W$,z$);return}let f=400,d=300,G$=20,g$=Math.ceil(Math.sqrt(a.length));for(let j$=0;j$<a.length;j$++){let o$=a[j$],b$=j$%g$,K$=Math.floor(j$/g$),V$=W$-g$*(f+G$)/2+b$*(f+G$),C$=z$-d/2+K$*(d+G$),s$=Nq(o$.name),Wv=o$.name;if(s$==="image"){let Ev=new FileReader,LU=await new Promise((cv)=>{Ev.onload=()=>cv(Ev.result),Ev.readAsDataURL(o$)});await lv({type:"image",title:Wv,content:LU,x:V$,y:C$,width:f,height:d})}else{let Ev=await o$.text(),LU=s$==="markdown"||s$==="file";await lv({type:s$,title:Wv,content:Ev,x:V$,y:C$,width:LU?720:f,height:LU?500:d})}}},[X,u]);m(()=>{let w=async(l)=>{if(l.defaultPrevented)return;if(NB(l.target instanceof Element?l.target:null))return;if(NB(document.activeElement))return;let e=l.clipboardData?.getData("text/plain")??"",s=PG(e);if(s.length===0)return;let W$=X.current;if(!W$)return;l.preventDefault();let z$=W$.getBoundingClientRect(),a=I$.value,f=(z$.width/2-a.x)/a.scale,d=(z$.height/2-a.y)/a.scale;await u(s,f,d)};return document.addEventListener("paste",w),()=>{document.removeEventListener("paste",w)}},[X,u]);let Z$=rq(T.value.values(),E$.value),i$=null;if(G){let w=Math.min(G.startX,G.currentX),l=Math.min(G.startY,G.currentY),e=Math.abs(G.currentX-G.startX),s=Math.abs(G.currentY-G.startY);i$={position:"absolute",left:`${w}px`,top:`${l}px`,width:`${e}px`,height:`${s}px`,pointerEvents:"none"}}return O("div",{class:"canvas-viewport",ref:X,tabIndex:0,onPointerDown:E,onPointerMove:M,onPointerUp:n,onContextMenu:R,onDblClick:r,onDragEnter:$$,onDragOver:p,onDragLeave:c,onDrop:P$,style:{width:"100%",height:"100%",position:"relative",overflow:"hidden",cursor:_==="eraser"?"cell":_==="text"?"text":g||rv.value||z.current?"crosshair":"grab"},children:[O("div",{style:{transform:`matrix(${U.scale}, 0, 0, ${U.scale}, ${U.x}, ${U.y})`,transformOrigin:"0 0",willChange:"transform",position:"absolute",top:0,left:0},children:[O(VW,{},void 0,!1,void 0,this),O(KB,{},void 0,!1,void 0,this),O(qB,{nodes:T,edges:c$},void 0,!1,void 0,this),O(WG,{annotations:Array.from(I4.value.values())},void 0,!1,void 0,this),W&&W.points.length>=2&&O(WG,{annotations:[W]},void 0,!1,void 0,this),Z$.map((w)=>O(YB,{node:w,onContextMenu:$,children:Yq(w)},w.id,!1,void 0,this)),g4.value&&O("svg",{class:"snap-guides-svg",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},children:g4.value.map((w,l)=>w.axis==="x"?O("line",{x1:w.pos,y1:w.from-20,x2:w.pos,y2:w.to+20,class:"snap-guide-line"},l,!1,void 0,this):O("line",{x1:w.from-20,y1:w.pos,x2:w.to+20,y2:w.pos,class:"snap-guide-line"},l,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g&&O("div",{class:`annotation-capture-layer${_==="eraser"?" erasing":""}${_==="text"?" text":""}`,"aria-hidden":"true"},void 0,!1,void 0,this),k&&O("input",{class:"annotation-text-input",value:k.value,autoFocus:!0,style:{left:`${k.x*U.scale+U.x}px`,top:`${k.y*U.scale+U.y}px`,fontSize:`${MB*U.scale}px`},onInput:(w)=>Q({...k,value:w.target.value}),onBlur:t,onPointerDown:(w)=>w.stopPropagation(),onKeyDown:(w)=>{if(w.key==="Enter")w.preventDefault(),t();if(w.key==="Escape")w.preventDefault(),Q(null)}},void 0,!1,void 0,this),i$&&O("div",{class:"lasso-rect",style:i$},void 0,!1,void 0,this),H&&O("div",{class:"drop-zone-overlay",children:O("div",{class:"drop-zone-indicator",children:[O("div",{class:"drop-zone-icon",children:"+"},void 0,!1,void 0,this),O("div",{class:"drop-zone-label",children:"Drop files or URLs to add to canvas"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function uq($,v){let g=$.toLowerCase(),_=v.toLowerCase(),U=[],z=0,b=0,J=-1;for(let G=0;G<_.length&&z<g.length;G++)if(_[G]===g[z]){if(U.push(G),b+=J===G-1?10:1,G===0||_[G-1]===" "||_[G-1]==="-"||_[G-1]==="_")b+=5;J=G,z++}return{match:z===g.length,score:b,indices:U}}function Rq($,v){if(v.length===0)return $;let g=[],_=0;for(let U of v){if(U>_)g.push($.slice(_,U));g.push(O("mark",{children:$[U]},U,!1,void 0,this)),_=U+1}if(_<$.length)g.push($.slice(_));return g}var kG={md:"markdown",app:"mcp-app",web:"webpage",ui:"json-render",chart:"graph",ctx:"context",log:"ledger"};function yq($){let v=$.toLowerCase().trim();if(v.startsWith("type:")){let g=v.slice(5).trim(),U=Object.keys($v).find((b)=>b.startsWith(g));if(U)return{typeFilter:U,remaining:""};let z=kG[g];if(z)return{typeFilter:z,remaining:""}}if(kG[v])return{typeFilter:kG[v],remaining:""};return{typeFilter:null,remaining:$}}function uB({onClose:$,onToggleMinimap:v}){let[g,_]=x(""),[U,z]=x(0),b=V(null),J=V(null);m(()=>{setTimeout(()=>b.current?.focus(),30)},[]);let G=N(()=>{let H=[];for(let F of T.value.values()){let Y=F.data.title||$v[F.type],X=F.data.content||F.data.path||"";H.push({id:`node:${F.id}`,kind:"node",label:Y,description:X.length>80?X.slice(0,80)+"...":X||void 0,badge:$v[F.type],nodeType:F.type,action:()=>{Fv(F.id),$()}})}let I=[{label:"New note (markdown node)",badge:"CREATE",action:()=>{lv({type:"markdown",title:"New note",width:520,height:360}),$()}},{label:"Fit all nodes",badge:"VIEW",action:()=>{L_(window.innerWidth,window.innerHeight),$()}},{label:"Auto-arrange (grid)",badge:"LAYOUT",action:()=>{F_(),$()}},{label:"Auto-arrange (graph-aware)",badge:"LAYOUT",action:()=>{Y_(),$()}},{label:"Toggle minimap",badge:"VIEW",action:()=>{v(),$()}},{label:"Toggle theme (dark/light)",badge:"THEME",action:()=>{let F=T$.value==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",F),OU(),T$.value=F,J_(F),$()}}];for(let F of I)H.push({id:`action:${F.label}`,kind:"action",label:F.label,badge:F.badge,badgeClass:"command-palette-badge--action",action:F.action});return H},[$,v]),{typeFilter:K,remaining:W}=yq(g),B=G(),k;if(!g.trim())k=B.map((H)=>({...H,score:0,indices:[]}));else{k=[];for(let H of B){if(K){if(H.kind!=="node"||H.nodeType!==K)continue;if(!W){k.push({...H,score:0,indices:[]});continue}}let I=uq(W||g,H.label);if(I.match)k.push({...H,score:I.score,indices:I.indices})}k.sort((H,I)=>I.score-H.score)}m(()=>{if(!g.trim()){Y6.value=null;return}let H=new Set;for(let I of k)if(I.kind==="node")H.add(I.id.slice(5));Y6.value=H.size>0?H:null},[g,k]),m(()=>{return()=>{Y6.value=null}},[]);let P=Math.min(U,Math.max(0,k.length-1)),A=N((H)=>{if(H.key==="ArrowDown")H.preventDefault(),z((I)=>Math.min(I+1,k.length-1));else if(H.key==="ArrowUp")H.preventDefault(),z((I)=>Math.max(I-1,0));else if(H.key==="Enter"){if(H.preventDefault(),k[P])k[P].action()}else if(H.key==="Escape")H.preventDefault(),H.stopPropagation(),$()},[k,P,$]);return m(()=>{let H=J.current;if(!H)return;H.children[P]?.scrollIntoView({block:"nearest"})},[P]),m(()=>{z(0)},[g]),O("div",{class:"command-palette-backdrop",onMouseDown:$,children:O("div",{class:"command-palette",onMouseDown:(H)=>H.stopPropagation(),children:[O("input",{ref:b,type:"text",class:"command-palette-input",value:g,onInput:(H)=>_(H.target.value),onKeyDown:A,placeholder:`Search nodes and actions... (${Sv}+K)`},void 0,!1,void 0,this),O("div",{class:"command-palette-hint",children:[O("span",{children:[O("kbd",{children:"↑"},void 0,!1,void 0,this),O("kbd",{children:"↓"},void 0,!1,void 0,this)," navigate"]},void 0,!0,void 0,this),O("span",{children:[O("kbd",{children:"↵"},void 0,!1,void 0,this)," select"]},void 0,!0,void 0,this),O("span",{children:[O("kbd",{children:"esc"},void 0,!1,void 0,this)," close"]},void 0,!0,void 0,this),O("span",{children:[O("kbd",{children:"type:"},void 0,!1,void 0,this)," filter by type"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"command-palette-results",ref:J,children:[k.length===0&&O("div",{class:"command-palette-empty",children:"No matching nodes or actions"},void 0,!1,void 0,this),k.map((H,I)=>O("button",{type:"button",class:`command-palette-item${I===P?" selected":""}`,onMouseEnter:()=>z(I),onClick:()=>H.action(),children:[O("span",{class:`command-palette-badge${H.badgeClass?` ${H.badgeClass}`:""}`,children:H.badge},void 0,!1,void 0,this),O("span",{class:"command-palette-label",children:H.indices.length>0?Rq(H.label,H.indices):H.label},void 0,!1,void 0,this),H.description&&O("span",{class:"command-palette-desc",children:H.description},void 0,!1,void 0,this)]},H.id,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function RB(){let[$,v]=x(null),g=N((z,b)=>{z.preventDefault(),z.stopPropagation(),v({kind:"node",x:z.clientX,y:z.clientY,nodeId:b})},[]),_=N((z,b,J)=>{z.preventDefault(),z.stopPropagation(),v({kind:"canvas",x:z.clientX,y:z.clientY,canvasX:b,canvasY:J})},[]),U=N(()=>v(null),[]);return m(()=>{if(!$)return;let z=()=>v(null),b=(J)=>{if(J.key==="Escape")v(null)};return document.addEventListener("click",z),document.addEventListener("keydown",b),()=>{document.removeEventListener("click",z),document.removeEventListener("keydown",b)}},[$]),{menu:$,openNodeMenu:g,openCanvasMenu:_,closeMenu:U}}var Dq="#4bbcFF",Tq=[{label:"Blue",value:"#3b82f6"},{label:"Green",value:"#22c55e"},{label:"Yellow",value:"#eab308"},{label:"Red",value:"#ef4444"},{label:"Gray",value:"#6b7280"},{label:"Purple",value:"#a855f7"}];function yB({menu:$,onClose:v}){let g;if($.kind==="node"){let J=T.value.get($.nodeId);if(!J)return null;g=Eq(J)}else g=mq($.canvasX,$.canvasY);let _=new Map,U=g.some((J)=>J.render)?g.length*32+168:g.length*32+8,z=Math.min($.x,Math.max(12,window.innerWidth-240)),b=Math.min($.y,Math.max(12,window.innerHeight-U));return O("div",{class:"context-menu",style:{position:"fixed",left:`${z}px`,top:`${b}px`,zIndex:1e4},onPointerDown:(J)=>J.stopPropagation(),onClick:(J)=>J.stopPropagation(),children:g.map((J)=>{let G=J.separator?"separator":J.render?"custom":`${J.label??"item"}:${J.shortcut??""}`,K=(_.get(G)??0)+1;_.set(G,K);let W=`${G}:${K}`;if(J.separator)return O("div",{class:"context-menu-separator"},W,!1,void 0,this);if(J.render)return O("div",{class:"context-menu-custom",children:J.render(v)},W,!1,void 0,this);return O("button",{type:"button",class:"context-menu-item",onClick:()=>{J.action?.(),v()},children:[O("span",{class:"context-menu-label",children:J.label},void 0,!1,void 0,this),J.shortcut&&O("span",{class:"context-menu-shortcut",children:J.shortcut},void 0,!1,void 0,this)]},W,!0,void 0,this)})},void 0,!1,void 0,this)}function jq($){return(typeof $.data.path==="string"?$.data.path.trim():"")||null}function T0($){let v=$.trim().toLowerCase(),g=v.match(/^#([0-9a-f]{3})$/);if(g){let[_,U,z]=g[1].split("");return`#${_}${_}${U}${U}${z}${z}`}return v}function DB($){if(typeof $.data.color!=="string"||!$.data.color.trim())return null;return T0($.data.color)}function Vq($){let v=DB($);return v&&/^#[0-9a-f]{6}$/.test(v)?v:T0(Dq)}function IG($,v){let g=v?T0(v):null;Pv($.id,{data:{...$.data,color:g}}),wv($.id,{data:{color:g}})}function Cq($,v){let g=DB($);return O("div",{class:"context-menu-section",children:[O("div",{class:"context-menu-section-header",children:[O("span",{class:"context-menu-section-label",children:"Group color"},void 0,!1,void 0,this),O("button",{type:"button",class:"context-menu-reset",onClick:()=>{IG($,null),v()},children:"Theme default"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"context-menu-color-grid",children:Tq.map((_)=>{let U=T0(_.value);return O("button",{type:"button",class:`context-menu-color-swatch${g===U?" active":""}`,"aria-label":`Set group color to ${_.label}`,title:_.label,style:{"--swatch-color":_.value},onClick:()=>{IG($,_.value),v()},children:[O("span",{class:"context-menu-color-dot",style:{"--swatch-color":_.value}},void 0,!1,void 0,this),O("span",{children:_.label},void 0,!1,void 0,this)]},_.value,!0,void 0,this)})},void 0,!1,void 0,this),O("label",{class:"context-menu-color-custom",children:[O("span",{children:"Custom"},void 0,!1,void 0,this),O("input",{type:"color",class:"context-menu-color-input","aria-label":"Custom group color",value:Vq($),onClick:(_)=>_.stopPropagation(),onInput:(_)=>{IG($,_.currentTarget.value),v()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function LG($,v,g,_){return{x:$-g/2,y:v-_/2}}function fq($,v){return $.trim().replace(/[?#].*$/,"").split("/").filter(Boolean).at(-1)||v}async function HG($){let v=window.prompt($.promptLabel,$.placeholder??"");if(!v)return;let g=v.trim();if(!g)return;let _=LG($.canvasX,$.canvasY,$.width,$.height);if(!(await lv({type:$.type,...$.type!=="webpage"?{title:fq(g,$.titleFallback)}:{},content:g,x:_.x,y:_.y,width:$.width,height:$.height})).ok)window.alert($.errorMessage)}function mq($,v){return[{label:"New note",action:()=>{let U=LG($,v,520,360);lv({type:"markdown",title:"New note",x:U.x,y:U.y,width:520,height:360})}},{label:"Open webpage...",action:()=>{HG({promptLabel:"Webpage URL:",type:"webpage",canvasX:$,canvasY:v,width:520,height:420,placeholder:"https://example.com",titleFallback:"Webpage",errorMessage:"Could not create webpage node. Enter a valid http(s) URL."})}},{label:"Open file...",action:()=>{HG({promptLabel:"Workspace path or absolute file path:",type:"file",canvasX:$,canvasY:v,width:720,height:500,placeholder:"src/server/server.ts",titleFallback:"File",errorMessage:"Could not create file node. Check the path and try again."})}},{label:"Open image...",action:()=>{HG({promptLabel:"Image path, URL, or data URI:",type:"image",canvasX:$,canvasY:v,width:480,height:360,placeholder:"artifacts/architecture.png",titleFallback:"Image",errorMessage:"Could not create image node. Check the image source and try again."})}},{separator:!0},{label:"New group",action:()=>{let U=LG($,v,600,400);K_({title:"Group",x:U.x,y:U.y,width:600,height:400})}}]}function Eq($){let v=[],g=jq($);if(v.push({label:"Focus",action:()=>Fv($.id)}),z_.has($.type))v.push({label:"Expand",shortcut:"⤢",action:()=>z6($.id)});v.push({label:$.collapsed?"Expand":"Collapse",action:()=>q6($.id)});let _=D$.value.has($.id);v.push({label:_?"Unpin from context":"Pin as context",action:()=>L4($.id)}),v.push({label:$.pinned?"Unlock position":"Lock position (no auto-arrange)",action:()=>{let b=!$.pinned;Pv($.id,{pinned:b}),wv($.id,{pinned:b}),d$()}});let U=P_.value;if(U&&U.from!==$.id){let b=T.value.get(U.from),J=b?(b.data.title||b.id).slice(0,20):U.from;v.push({label:`Connect from "${J}"`,action:()=>{P4(U.from,$.id,"relation"),P_.value=null}})}v.push({label:U?"Connect from here (replace)":"Connect from here",action:()=>{P_.value={from:$.id}}});let z=Array.from(c$.value.values()).filter((b)=>b.from===$.id||b.to===$.id).length;if(z>0)v.push({label:`${z} edge${z!==1?"s":""} connected`});if(v.push({separator:!0}),($.type==="markdown"||$.type==="file"||$.type==="image")&&g)v.push({label:"Open in browser",action:()=>{window.open(`/artifact?path=${encodeURIComponent(g)}`,"_blank","noopener")}}),v.push({label:"Copy path",action:()=>{navigator.clipboard.writeText(g)}});if($.type==="mcp-app"||$.type==="json-render"||$.type==="graph")if($.data.chartConfig){let b=$.data.chartConfig.title||"chart";v.push({label:"Copy chart data",action:()=>{navigator.clipboard.writeText(JSON.stringify($.data.chartConfig,null,2))}})}else{let b=$.data.url;if(v.push({label:"Open in browser",action:()=>{if(b)window.open(b,"_blank")}}),v.push({label:"Focus in TUI",action:()=>kK("mcp-app-focus",{url:b})}),$.type==="json-render"||$.type==="graph")v.push({label:"Copy spec",action:()=>{navigator.clipboard.writeText(JSON.stringify($.data.spec??$.data.graphConfig??{},null,2))}})}if($.type==="webpage"){let b=typeof $.data.url==="string"?$.data.url:"";v.push({label:"Refresh webpage",action:()=>{O_($.id)}}),v.push({label:"Open in browser",action:()=>{if(b)window.open(b,"_blank","noopener")}}),v.push({label:"Copy URL",action:()=>{if(b)navigator.clipboard.writeText(b)}})}if($.type==="group"){let b=$.data.children??[];if(v.push({separator:!0}),v.push({render:(J)=>Cq($,J)}),b.length>0)v.push({label:`Ungroup (${b.length} node${b.length!==1?"s":""})`,action:()=>XK($.id)})}if($.type==="status"||$.type==="ledger")if(v.push({separator:!0}),$.dockPosition!==null)v.push({label:"Undock to canvas",action:()=>A4($.id)});else v.push({label:"Dock left of toolbar",action:()=>K2($.id,"left")}),v.push({label:"Dock right of toolbar",action:()=>K2($.id,"right")});return v.push({separator:!0}),v.push({label:"Close",action:()=>{F4($.id),G_($.id)}}),v}function TB(){let $=D$.value.size;if($===0||I6.value||H_.value)return null;return O("div",{class:"context-pin-bar",children:[O("span",{class:"context-pin-bar-count",children:["✦"," ",$," node",$!==1?"s":""," in context"]},void 0,!0,void 0,this),O("button",{type:"button",class:"context-pin-bar-btn context-pin-bar-clear",onClick:jK,title:"Clear all context pins",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function jB({node:$}){let v=$G($),g=$.data.activeTool,_=$.data.subagent,U=M0[v]??"var(--c-muted)";return O("span",{style:{display:"flex",alignItems:"center",gap:"6px",flex:1,minWidth:0},children:[O("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:U,animation:v!=="idle"?"pulse 1.5s infinite":"none",flexShrink:0}},void 0,!1,void 0,this),O("span",{style:{color:U,fontSize:"10px",textTransform:"uppercase",fontWeight:600},children:v},void 0,!1,void 0,this),g&&O("span",{style:{color:"var(--c-warn)",fontSize:"10px",fontFamily:"var(--mono)"},children:["⚙ ",g]},void 0,!0,void 0,this),_&&_.state!=="completed"&&O("span",{style:{color:"var(--c-subagent)",fontSize:"10px"},children:["⠉ ",_.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function cq($){switch($.type){case"status":return O(GU,{node:$},void 0,!1,void 0,this);case"ledger":return O(Z4,{node:$},void 0,!1,void 0,this);case"context":return O(o6,{node:$},void 0,!1,void 0,this);default:return null}}function iq($){let v=Array.isArray($.data.cards)?$.data.cards:[],g=Array.isArray($.data.auxTabs)?$.data.auxTabs:[];return v.length+g.length}function lq({node:$}){let v=CK(),g=v.length>0?v.length:iq($),_=g>0,U=$.collapsed===!0,z=()=>{U_(),q6($.id)};if(U)return O("div",{class:"docked-node docked-node--collapsed","data-docked-node":"true",children:O("div",{class:"docked-node-header",children:[O("span",{class:"node-type-badge",children:"Context"},void 0,!1,void 0,this),_&&O("span",{class:"docked-node-count","aria-hidden":"true",children:g>99?"99+":g},void 0,!1,void 0,this),O("div",{class:"docked-node-controls",children:[O("button",{type:"button",onClick:(b)=>{b.stopPropagation(),z()},title:_?`${g} item${g===1?"":"s"} in agent context — expand`:"Expand agent context","aria-label":_?`Context — ${g} item${g===1?"":"s"}`:"Expand agent context",children:"▸"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(b)=>{b.stopPropagation(),A4($.id)},title:"Undock to canvas","aria-label":"Undock to canvas",children:"⊙"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return O("aside",{class:"context-dock-panel","data-docked-node":"true","aria-label":"Agent context",children:[O("div",{class:"context-dock-header",children:[O("div",{class:"context-dock-header-text",children:[O("span",{class:"context-dock-title",children:"Context"},void 0,!1,void 0,this),O("span",{class:"context-dock-subtitle",children:_?`${g} item${g===1?"":"s"} in agent context`:"Active agent context"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"context-dock-controls",children:[O("button",{type:"button",class:"context-dock-icon-button",onClick:(b)=>{b.stopPropagation(),A4($.id)},"aria-label":"Undock to canvas",title:"Undock to canvas",children:"⊙"},void 0,!1,void 0,this),O("button",{type:"button",class:"context-dock-icon-button",onClick:(b)=>{b.stopPropagation(),q6($.id)},"aria-label":"Collapse context panel",title:"Collapse",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"context-dock-body",children:O(o6,{node:$,pinnedNodes:v},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function FG({node:$}){if($.type==="context")return O(lq,{node:$},void 0,!1,void 0,this);return O("div",{class:`docked-node${$.collapsed?" docked-node--collapsed":""}`,"data-docked-node":"true",children:[O("div",{class:"docked-node-header",children:[O("span",{class:"node-type-badge",children:$v[$.type]??$.type},void 0,!1,void 0,this),$.type==="status"&&$.collapsed&&O(jB,{node:$},void 0,!1,void 0,this),O("div",{class:"docked-node-controls",children:[O("button",{type:"button",onClick:(v)=>{v.stopPropagation(),q6($.id)},title:$.collapsed?"Expand":"Collapse",children:$.collapsed?"▸":"▾"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(v)=>{v.stopPropagation(),A4($.id)},title:"Undock to canvas",children:"⊙"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!$.collapsed&&O("div",{class:"docked-node-body",children:cq($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function VB($,v){switch($.type){case"markdown":return O(R_,{node:$,expanded:v},void 0,!1,void 0,this);case"mcp-app":return O(f6,{node:$,expanded:v},void 0,!1,void 0,this);case"webpage":return O(N0,{node:$,expanded:v},void 0,!1,void 0,this);case"json-render":return O(f6,{node:$,expanded:v},void 0,!1,void 0,this);case"graph":return O(f6,{node:$,expanded:v},void 0,!1,void 0,this);case"prompt":return O(R0,{node:$},void 0,!1,void 0,this);case"response":return O(y0,{node:$,expanded:v},void 0,!1,void 0,this);case"status":return O(GU,{node:$},void 0,!1,void 0,this);case"context":return O(o6,{node:$,expanded:v},void 0,!1,void 0,this);case"ledger":return O(Z4,{node:$},void 0,!1,void 0,this);case"trace":return O(D0,{node:$},void 0,!1,void 0,this);case"file":return O(S_,{node:$,expanded:v},void 0,!1,void 0,this);case"image":return O(Q0,{node:$,expanded:v},void 0,!1,void 0,this);case"html":return O(rg,{node:$,expanded:v},void 0,!1,void 0,this);default:return O("div",{children:"Unknown node type"},void 0,!1,void 0,this)}}function CB($){switch($.type){case"markdown":return $.data.content||"";case"file":return $.data.fileContent||"";case"webpage":return $.data.content||"";case"html":return $.data.html||$.data.content||"";case"json-render":case"graph":return JSON.stringify($.data.spec??$.data.graphConfig??{},null,2);default:return""}}function hq($){if(!$)return 0;return $.split(/\s+/).filter(Boolean).length}function xq($,v){return $!==null&&typeof $==="object"&&$.source==="pmx-canvas-html-node"&&$.type==="presentation-exit"&&$.token===v}function pq($){return $==="ArrowRight"||$==="PageDown"||$===" "||$==="ArrowLeft"||$==="PageUp"||$==="Home"||$==="End"}function fB($){return $ instanceof HTMLElement&&Boolean($.closest(".html-presentation-exit"))}function mB(){let $=E$.value,v=$?T.value.get($):void 0,[g,_]=x(!1),[U,z]=x(!1),[b,J]=x(""),G=V(null),K=V(null),W=N(()=>{z(!1),p6()},[]),B=N(()=>{J(`presentation-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`),z(!0)},[]),k=N((r)=>{document.querySelector(".html-presentation-overlay iframe.html-node-frame-presentation")?.contentWindow?.postMessage({source:"pmx-canvas-html-node",token:b,...r},"*")},[b]),P=N(()=>{z(!1)},[]),A=N((r)=>{if(r.key==="Escape"){r.preventDefault(),r.stopPropagation(),z(!1);return}if(r.key==="Tab"&&!fB(r.target)){r.preventDefault(),r.stopPropagation(),K.current?.focus();return}if((r.key===" "||r.key==="Enter")&&fB(r.target))return;if(!pq(r.key))return;r.preventDefault(),r.stopPropagation(),k({type:"presentation-key",key:r.key})},[k]),H=N((r)=>{if(r.target.classList.contains("expanded-overlay-backdrop"))p6()},[]),I=N(()=>{if(!v)return;let r=CB(v);if(!r)return;navigator.clipboard.writeText(r).then(()=>{_(!0),setTimeout(()=>_(!1),1500)})},[v]),F=N(()=>{if(!$)return;L4($)},[$]);if(m(()=>{z(!1)},[$]),xg(()=>{if(!U)return;let r=()=>{let p=G.current;if(!p||p.contains(document.activeElement))return;p.focus()},R=[0,50,150].map((p)=>window.setTimeout(r,p)),$$=(p)=>{if(!xq(p.data,b))return;z(!1)};return document.addEventListener("keydown",A,!0),window.addEventListener("message",$$),()=>{R.forEach((p)=>window.clearTimeout(p)),document.removeEventListener("keydown",A,!0),window.removeEventListener("message",$$)}},[A,b,U]),!v)return null;let Y=v.data.title||v.data.path?.split("/").pop()||$v[v.type],X=CB(v),Q=hq(X),u=$?D$.value.has($):!1,E=X.length>0,M=hv.value===$,n=v.type==="mcp-app"||v.type==="webpage"||v.type==="json-render"||v.type==="graph",t=rW(v);return O("div",{class:"expanded-overlay-backdrop",onPointerDown:H,style:{position:"fixed",inset:0,zIndex:10001,background:"rgba(10,14,30,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"stretch",justifyContent:"center",padding:"32px",pointerEvents:M?"none":"auto"},children:O("div",{class:"expanded-overlay-panel",style:{flex:1,maxWidth:"1200px",display:"flex",flexDirection:"column",background:"var(--c-panel)",border:`1px solid ${u?"var(--c-warn)":"var(--c-accent)"}`,borderRadius:"var(--radius)",boxShadow:`0 0 0 1px ${u?"var(--c-warn)":"var(--c-accent)"}, 0 24px 80px rgba(0,0,0,0.6)`,overflow:"hidden"},children:[O("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",background:"var(--c-panel-glass)",borderBottom:"1px solid var(--c-line)",flexShrink:0},children:[O("span",{style:{fontSize:"10px",padding:"1px 6px",borderRadius:"4px",background:"var(--c-accent-12)",color:"var(--c-accent)",textTransform:"uppercase",letterSpacing:"0.04em"},children:$v[v.type]},void 0,!1,void 0,this),O("span",{style:{flex:1,fontSize:"13px",fontWeight:600,color:"var(--c-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Y},void 0,!1,void 0,this),O("div",{class:"expanded-actions",children:[O("button",{type:"button",class:`expanded-action-btn ${u?"expanded-action-active":""}`,onClick:F,title:u?"Remove from context":"Pin as context",children:u?"✦ In context":"✦ Pin as context"},void 0,!1,void 0,this),E&&O("button",{type:"button",class:"expanded-action-btn",onClick:I,title:"Copy content to clipboard",children:g?"Copied!":"Copy"},void 0,!1,void 0,this),r0(v)&&O("button",{type:"button",class:"expanded-action-btn",onClick:()=>void u0(v),title:"Open as a full-page site in the system browser",children:"Open as site"},void 0,!1,void 0,this),t&&O("button",{type:"button",class:"expanded-action-btn expanded-action-primary",onClick:B,title:"Present this HTML node fullscreen",children:"Present"},void 0,!1,void 0,this),Q>0&&O("span",{class:"expanded-meta",children:[Q.toLocaleString()," word",Q!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("span",{style:{fontSize:"10px",color:M?"var(--c-warn)":"var(--c-muted)"},children:M?"Saving edits...":"Esc to close"},void 0,!1,void 0,this),O("button",{type:"button",onClick:W,style:{background:"none",border:"none",color:"var(--c-muted)",cursor:"pointer",padding:"2px 6px",fontSize:"16px",lineHeight:1,borderRadius:"4px"},onMouseEnter:(r)=>{r.target.style.color="var(--c-text)"},onMouseLeave:(r)=>{r.target.style.color="var(--c-muted)"},title:"Close (Esc)",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{flex:1,overflow:"auto",padding:"16px",minHeight:0,...n?{display:"flex",flexDirection:"column"}:{}},children:n?O("div",{style:{flex:1,minHeight:0,display:"flex"},children:VB(v,!0)},void 0,!1,void 0,this):VB(v,!0)},void 0,!1,void 0,this),t&&U&&O("div",{ref:G,class:"html-presentation-overlay",role:"dialog","aria-modal":"true","aria-label":`Present ${Y}`,tabIndex:-1,onKeyDownCapture:A,children:[O("button",{ref:K,type:"button",class:"html-presentation-exit",onClick:P,title:"Exit presentation (Esc)","aria-label":"Exit presentation",children:"Exit presentation"},void 0,!1,void 0,this),O("div",{class:"html-presentation-stage",children:O(rg,{node:v,expanded:!0,presentation:!0,presentationExitToken:b},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var IU=180,HU=120,j0=20;function oq(){let $=S0();return{markdown:$.accent,"mcp-app":$.ok,webpage:$.warn,"json-render":$.ok,graph:$.purple,prompt:$.accent,response:$.ok,status:$.warn,context:$.muted,ledger:$.dim,trace:$.purple,file:$.accent,image:$.ok,html:$.warn,group:$.dim}}function nq(){let $=S0();return{relation:$.muted,"depends-on":$.warn,flow:$.accent,references:$.dim}}function EB($,v,g,_){let U=Array.from($.values()),z=0,b=0,J=1000,G=800;if(U.length>0){z=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,G=Number.NEGATIVE_INFINITY;for(let I of U)z=Math.min(z,I.position.x),b=Math.min(b,I.position.y),J=Math.max(J,I.position.x+I.size.width),G=Math.max(G,I.position.y+I.size.height)}let K=-v.x/v.scale,W=-v.y/v.scale,B=K+g/v.scale,k=W+_/v.scale,P={minX:Math.min(z,K)-j0,minY:Math.min(b,W)-j0,maxX:Math.max(J,B)+j0,maxY:Math.max(G,k)+j0},A=P.maxX-P.minX||1,H=P.maxY-P.minY||1;return{bounds:P,scale:Math.min(IU/A,HU/H)}}function cB({viewport:$,nodes:v,edges:g,onNavigate:_,containerWidth:U,containerHeight:z}){let b=V(null),J=V(!1),G=V(null),K=V(null),W=N(()=>{let H=b.current;if(!H)return;let I=H.getContext("2d");if(!I)return;let F=v.value,Y=g.value,X=$.value,Q=window.devicePixelRatio||1;H.width=IU*Q,H.height=HU*Q,I.scale(Q,Q),I.clearRect(0,0,IU,HU);let u=S0();I.fillStyle=u.panel+"d9",I.fillRect(0,0,IU,HU);let E=EB(F,X,U,z);G.current=E;let{bounds:M,scale:n}=E,t=(w)=>(w-M.minX)*n,r=(w)=>(w-M.minY)*n,R=Array.from(F.values()),$$=oq();for(let w of R)I.fillStyle=$$[w.type]??u.muted,I.globalAlpha=0.6,I.fillRect(t(w.position.x),r(w.position.y),Math.max(4,w.size.width*n),Math.max(3,w.size.height*n));let p=nq();for(let w of Y.values()){let l=F.get(w.from),e=F.get(w.to);if(!l||!e)continue;let s=t(l.position.x+l.size.width/2),W$=r(l.position.y+l.size.height/2),z$=t(e.position.x+e.size.width/2),a=r(e.position.y+e.size.height/2);I.beginPath(),I.moveTo(s,W$),I.lineTo(z$,a),I.strokeStyle=p[w.type]??u.muted,I.globalAlpha=0.3,I.lineWidth=0.5,I.stroke()}let c=-X.x/X.scale,P$=-X.y/X.scale,Z$=U/X.scale,i$=z/X.scale;I.globalAlpha=1,I.strokeStyle=u.accent,I.lineWidth=1.5,I.strokeRect(t(c),r(P$),Z$*n,i$*n)},[v,g,$,U,z]),B=V(W);B.current=W;let k=N(()=>{if(K.current!==null)return;K.current=window.requestAnimationFrame(()=>{K.current=null,B.current()})},[]);JK(()=>{T$.value,v.value,g.value,$.value,k()}),m(()=>{k()},[U,z,k]),m(()=>()=>{if(K.current!==null)window.cancelAnimationFrame(K.current),K.current=null},[]);let P=N((H)=>{let I=b.current;if(!I)return;let F=I.getBoundingClientRect(),Y=H.clientX-F.left,X=H.clientY-F.top,Q=G.current??EB(v.value,$.value,U,z);G.current=Q;let{bounds:u,scale:E}=Q,M=$.value,n=U/M.scale,t=z/M.scale,r=Y/E+u.minX,R=X/E+u.minY;_(-(r-n/2)*M.scale,-(R-t/2)*M.scale)},[v,$,U,z,_]),A=N((H)=>{H.stopPropagation(),J.current=!0,P(H);let I=(Y)=>{if(J.current)P(Y)},F=()=>{J.current=!1,document.removeEventListener("pointermove",I),document.removeEventListener("pointerup",F)};document.addEventListener("pointermove",I),document.addEventListener("pointerup",F)},[P]);return O("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9998,border:"1px solid var(--c-line)",borderRadius:"var(--radius-sm)",overflow:"hidden",boxShadow:"0 4px 16px var(--c-shadow)"},children:O("canvas",{ref:b,width:IU,height:HU,style:{width:`${IU}px`,height:`${HU}px`,display:"block",cursor:"pointer"},onPointerDown:A},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function iB(){let $=h$.value.size;if($===0)return null;let v=N(()=>{let U=Array.from(h$.value);if(U.length===0)return;TK(U),jv()},[]),g=N(()=>{let U=Array.from(h$.value);if(U.length===0)return;K_({title:"Group",childIds:U}),jv()},[]),_=N(()=>{let U=Array.from(h$.value);for(let z=0;z<U.length;z++)for(let b=z+1;b<U.length;b++)P4(U[z],U[b],"relation");jv()},[]);return O("div",{class:"selection-bar",children:[O("span",{class:"selection-bar-count",children:["✦"," ",$," node",$!==1?"s":""," selected"]},void 0,!0,void 0,this),O("button",{type:"button",class:"selection-bar-btn selection-bar-pin-ctx",onClick:v,children:"Pin as context"},void 0,!1,void 0,this),$>=2&&O("button",{type:"button",class:"selection-bar-btn",onClick:g,children:"Group"},void 0,!1,void 0,this),$>=2&&O("button",{type:"button",class:"selection-bar-btn",onClick:_,children:"Connect"},void 0,!1,void 0,this),O("button",{type:"button",class:"selection-bar-btn selection-bar-clear",onClick:jv,title:"Clear selection",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var tq=[{title:"Navigation",shortcuts:[{keys:`${Sv}+K`,desc:"Command palette — search nodes & actions"},{keys:"Tab / Shift+Tab",desc:"Cycle through nodes"},{keys:"← ↑ → ↓",desc:"Walk graph along edges (when node focused)"},{keys:`${Sv}+0`,desc:"Reset viewport to origin"},{keys:`${Sv}++ / ${Sv}+−`,desc:"Zoom in / out"}]},{title:"Creation",shortcuts:[{keys:"Double-click",desc:"Create new markdown note on canvas"},{keys:"Drag port → node",desc:"Connect two nodes (hover to reveal ports)"}]},{title:"Selection",shortcuts:[{keys:"Click",desc:"Focus node (highlights neighbors & edges)"},{keys:"Shift+Click",desc:"Toggle node in multi-selection"},{keys:"Shift+Drag",desc:"Lasso select multiple nodes"},{keys:"Esc",desc:"Clear selection / close overlay"}]},{title:"View",shortcuts:[{keys:"?",desc:"Toggle this shortcut overlay"},{keys:"Minimap",desc:"Click/drag to navigate (toggle in toolbar)"},{keys:"Right-click",desc:"Context menu — dock, focus, connect"}]}];function lB({onClose:$}){return O("div",{class:"shortcut-overlay-backdrop",onMouseDown:$,children:O("div",{class:"shortcut-overlay",onMouseDown:(v)=>v.stopPropagation(),children:[O("div",{class:"shortcut-overlay-header",children:[O("span",{class:"shortcut-overlay-title",children:"Keyboard Shortcuts"},void 0,!1,void 0,this),O("span",{class:"shortcut-overlay-hint",children:["Press ",O("kbd",{children:"?"},void 0,!1,void 0,this)," or ",O("kbd",{children:"Esc"},void 0,!1,void 0,this)," to close"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"shortcut-overlay-body",children:tq.map((v)=>O("div",{class:"shortcut-group",children:[O("div",{class:"shortcut-group-title",children:v.title},void 0,!1,void 0,this),v.shortcuts.map((g)=>O("div",{class:"shortcut-row",children:[O("kbd",{class:"shortcut-keys",children:g.keys},void 0,!1,void 0,this),O("span",{class:"shortcut-desc",children:g.desc},void 0,!1,void 0,this)]},g.keys,!0,void 0,this))]},v.title,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function dq($){let v=Date.now()-new Date($).getTime(),g=Math.floor(v/60000);if(g<1)return"just now";if(g<60)return`${g}m ago`;let _=Math.floor(g/60);if(_<24)return`${_}h ago`;return`${Math.floor(_/24)}d ago`}function hB({open:$,onClose:v,anchorRef:g}){let[_,U]=x([]),[z,b]=x(!1),[J,G]=x(!1),[K,W]=x(null),[B,k]=x(""),[P,A]=x(null),H=V(null),I=V(null);m(()=>{if(!$)return;b(!0),wK().then((M)=>{U(M),b(!1)})},[$]),m(()=>{if($)setTimeout(()=>I.current?.focus(),50)},[$]),m(()=>{if(!$)return;let M=(n)=>{let t=H.current,r=g.current;if(t&&!t.contains(n.target)&&r&&!r.contains(n.target))v()};return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[$,v]),m(()=>{if(!$)return;let M=(n)=>{if(n.key==="Escape")v()};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[$,v]);let F=N(async()=>{let M=B.trim();if(!M)return;G(!0);let n=await ZK(M);if(G(!1),n.ok&&n.snapshot)U((t)=>[n.snapshot,...t]),k("")},[B]),Y=N(async(M)=>{A(null),W(M);let n=await SK(M);if(W(null),n.ok)v()},[v]),X=N(async(M)=>{if((await MK(M)).ok)U((t)=>t.filter((r)=>r.id!==M));A(null)},[]);if(!$)return null;let Q=g.current?.getBoundingClientRect(),u=Q?Math.max(8,Q.left-120):100,E=Q?Q.bottom+8:48;return O("div",{ref:H,class:"snapshot-panel",style:{left:`${u}px`,top:`${E}px`},children:[O("div",{class:"snapshot-panel-header",children:[O("span",{class:"snapshot-panel-title",children:"Snapshots"},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-panel-close",onClick:v,title:"Close",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"snapshot-save-form",children:[O("input",{ref:I,type:"text",class:"snapshot-name-input",value:B,onInput:(M)=>k(M.target.value),onKeyDown:(M)=>{if(M.key==="Enter")F()},placeholder:"Snapshot name...",maxLength:80,disabled:J},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-save-btn",onClick:F,disabled:!B.trim()||J,children:J?"...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"snapshot-restore-note",children:"Restoring replaces the current canvas. You can undo it if needed."},void 0,!1,void 0,this),O("div",{class:"snapshot-list",children:[z&&O("div",{class:"snapshot-empty",children:"Loading..."},void 0,!1,void 0,this),!z&&_.length===0&&O("div",{class:"snapshot-empty",children:"No snapshots yet. Save one to capture the current canvas state."},void 0,!1,void 0,this),!z&&_.map((M)=>O("div",{class:"snapshot-item",children:[O("div",{class:"snapshot-item-info",children:[O("span",{class:"snapshot-item-name",children:M.name},void 0,!1,void 0,this),O("span",{class:"snapshot-item-meta",children:[M.nodeCount," node",M.nodeCount!==1?"s":"",M.edgeCount>0?` · ${M.edgeCount} edge${M.edgeCount!==1?"s":""}`:""," · ",dq(M.createdAt)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"snapshot-item-actions",children:P?.id===M.id?O(e$,{children:[O("button",{type:"button",class:`snapshot-action-btn ${P.action==="delete"?"snapshot-action-confirm":"snapshot-action-restore"}`,onClick:()=>P.action==="delete"?X(M.id):Y(M.id),title:P.action==="delete"?"Confirm delete":"Confirm restore",disabled:K!==null,children:P.action==="delete"?"Delete":K===M.id?"Restoring...":"Confirm"},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-action-btn",onClick:()=>A(null),title:"Cancel",disabled:K!==null,children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O(e$,{children:[O("button",{type:"button",class:"snapshot-action-btn snapshot-action-restore",onClick:()=>A({id:M.id,action:"restore"}),title:"Restore this snapshot",disabled:K!==null,children:K===M.id?"Restoring...":"Restore"},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-action-btn snapshot-action-delete",onClick:()=>A({id:M.id,action:"delete"}),title:"Delete this snapshot",disabled:K!==null,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},M.id,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function xB($,v,g,_,U){return $.x<_.position.x+_.size.width+U&&$.x+v+U>_.position.x&&$.y<_.position.y+_.size.height+U&&$.y+g+U>_.position.y}function aq($,v,g,_,U){return _.some((z)=>xB($,v,g,z,U))}function sq($,v,g,_,U){return _.find((z)=>xB($,v,g,z,U))}function V0($,v,g,_=24){if($.length===0)return{x:40,y:80};let U=$[$.length-1],z={x:U.position.x+U.size.width+_,y:U.position.y};if(!aq(z,v,g,$,_))return z;let b=40,J=80,G=3000,K=J;for(let B=0;B<20;B++){let k=b;while(k+v<G){let H=sq({x:k,y:K},v,g,$,_);if(!H)return{x:k,y:K};k=H.position.x+H.size.width+_}K=$.filter((H)=>H.position.y<=K+g+_&&H.position.y+H.size.height+_>K).reduce((H,I)=>Math.max(H,I.position.y+I.size.height),K)+_}let W=$.reduce((B,k)=>Math.max(B,k.position.y+k.size.height),0);return{x:b,y:W+_}}var Dg=null,AG=null,YG=0,m6=null,f0=new Map;function Tg($){let v=0;for(let g=0;g<$.length;g++)v=(v<<5)-v+$.charCodeAt(g)|0;return Math.abs(v).toString(36)}function m0($){if(!AG)return $;let v=AG.get($.id);if(!v)return $;return{...$,position:v.position??$.position,size:v.size??$.size,collapsed:v.collapsed??$.collapsed,pinned:v.pinned??$.pinned,dockPosition:v.dockPosition!==void 0?v.dockPosition:$.dockPosition}}var sv={status:{x:40,y:80,w:300,h:120},markdown:{x:380,y:80,w:720,h:600},context:{x:1130,y:80,w:320,h:400},"mcp-app":{x:380,y:720,w:960,h:600},webpage:{x:380,y:80,w:520,h:420},"json-render":{x:380,y:720,w:840,h:620},graph:{x:380,y:720,w:760,h:520},ledger:{x:1130,y:520,w:320,h:280},trace:{x:40,y:900,w:200,h:56},file:{x:380,y:80,w:720,h:600},image:{x:380,y:80,w:720,h:520},html:{x:380,y:80,w:720,h:640},group:{x:220,y:60,w:840,h:560},prompt:{x:380,y:1260,w:520,h:400},response:{x:380,y:1480,w:720,h:400}};function jg($,v,g,_=null){let U=sv[v];return m0({id:$,type:v,position:{x:U.x,y:U.y},size:{width:U.w,height:U.h},zIndex:v==="status"?0:1,collapsed:!1,pinned:!1,dockPosition:_,data:g})}function eq(){return V0([...T.value.values()],sv.markdown.w,sv.markdown.h)}function _4(){if(!T.value.has("status-main"))_6(jg("status-main","status",{phase:"idle",message:"",elapsed:0},"left"))}function $X($,v){let g=`md-${Tg($)}`;if(T.value.get(g))U$(g,{path:$,title:v}),y$.value=g;else{let U=eq(),z=jg(g,"markdown",{path:$,title:v,content:"",rendered:""});if(z.position=U,_6(z),!z.dockPosition)Fv(g)}}function vX($){if(T.value.get("context-main"))U$("context-main",{cards:$});else if($.length>0){let _=jg("context-main","context",{cards:$});_6(_)}}function UX($){let v=$.url,g=`mcp-${Tg(v)}`;if(T.value.get(g))U$(g,$);else _6(jg(g,"mcp-app",$)),Fv(g)}function gX($){let v=$.toolCallId,_=(typeof $.nodeId==="string"&&$.nodeId.length>0?$.nodeId:null)??(v.startsWith("ext-app-")?v:`ext-app-${v}`);if(T.value.get(_)){U$(_,$);return}let{serverName:z,toolName:b}=$;if(z&&b){for(let[I,F]of T.value.entries())if(F.type==="mcp-app"&&F.data.mode==="ext-app"&&F.data.serverName===z&&F.data.toolName===b&&!F.data.toolResult){U$(I,{...$});return}}let{_x:J,_y:G,_width:K,_height:W}=$,B=sv["mcp-app"],k=K??B.w,P=W??B.h,A=J===void 0||G===void 0?V0([...T.value.values()],k,P):null,H=m0({id:_,type:"mcp-app",position:{x:J??A?.x??B.x,y:G??A?.y??B.y},size:{width:k,height:P},zIndex:1,collapsed:!1,pinned:!1,dockPosition:null,data:{mode:"ext-app",...$}});if(_6(H),!H.dockPosition)Fv(_,{recordHistory:!1})}function _X($){let v=$.startsWith("ext-app-")?$:`ext-app-${$}`;if(T.value.has(v))return v;let g=`ext-app-${$}`;if(g!==v&&T.value.has(g))return g;for(let[_,U]of T.value.entries())if(U.type==="mcp-app"&&U.data.mode==="ext-app"&&U.data.toolCallId===$)return _;return null}function oB($){let v=typeof $.nodeId==="string"&&$.nodeId.length>0?$.nodeId:null;if(v&&T.value.has(v))return v;if(typeof $.toolCallId!=="string"||!$.toolCallId)return null;return _X($.toolCallId)}function nB($,v){if(typeof $!=="string"||!$)return null;if(typeof v!=="string"||!v)return null;let g=null;for(let[_,U]of T.value.entries())if(U.type==="mcp-app"&&U.data.mode==="ext-app"&&U.data.serverName===$&&U.data.toolName===v&&!U.data.toolResult){if(g)return null;g=_}return g}function tB($){if(T.value.get("ledger-main"))U$("ledger-main",$);else{let _=jg("ledger-main","ledger",$,"right");_.collapsed=!0,_6(_)}}function dB($){if(!($==="dark"||$==="light"||$==="high-contrast"))return;if(document.documentElement.setAttribute("data-theme",$),OU(),T$.value!==$)T$.value=$}function zX($){return $==="markdown"||$==="mcp-app"||$==="webpage"||$==="json-render"||$==="graph"||$==="prompt"||$==="response"||$==="status"||$==="context"||$==="ledger"||$==="trace"||$==="file"||$==="image"||$==="html"||$==="group"}function bX($){return $==="relation"||$==="depends-on"||$==="flow"||$==="references"}function qG($){if(!$||typeof $!=="object")return null;let v=$;if(typeof v.x!=="number"||typeof v.y!=="number")return null;return{x:v.x,y:v.y}}function aB($){if(!$||typeof $!=="object")return null;let v=$;if(typeof v.width!=="number"||typeof v.height!=="number")return null;return{width:v.width,height:v.height}}function JX($){let v=qG($),g=aB($);return v&&g?{...v,...g}:null}function OX($){if(typeof $.id!=="string"||!$.id)return null;if(!zX($.type))return null;let v=qG($.position),g=aB($.size);if(!v||!g)return null;let _=$.dockPosition==="left"||$.dockPosition==="right"?$.dockPosition:null,U=$.data&&typeof $.data==="object"?Object.fromEntries(Object.entries($.data)):{};return{id:$.id,type:$.type,position:v,size:g,zIndex:typeof $.zIndex==="number"?$.zIndex:1,collapsed:$.collapsed===!0,pinned:$.pinned===!0,dockPosition:_,data:U}}function GX($){if(typeof $.id!=="string"||!$.id)return null;if(typeof $.from!=="string"||!$.from)return null;if(typeof $.to!=="string"||!$.to)return null;if(!bX($.type))return null;return{id:$.id,from:$.from,to:$.to,type:$.type,...typeof $.label==="string"?{label:$.label}:{},...$.style==="solid"||$.style==="dashed"||$.style==="dotted"?{style:$.style}:{},...$.animated===!0?{animated:!0}:{}}}function KX($){if(typeof $.id!=="string"||!$.id)return null;if($.type!=="freehand"&&$.type!=="text")return null;if(!Array.isArray($.points))return null;let v=$.points.map((_)=>qG(_)).filter((_)=>_!==null),g=JX($.bounds);if(v.length<($.type==="text"?1:2)||!g)return null;return{id:$.id,type:$.type,points:v,bounds:g,color:typeof $.color==="string"?$.color:"#f97316",width:typeof $.width==="number"?$.width:4,...typeof $.text==="string"?{text:$.text}:{},...typeof $.label==="string"?{label:$.label}:{},createdAt:typeof $.createdAt==="string"?$.createdAt:""}}function WX($){if(H4.value=$.sessionId||"",h6.value="connected",typeof $.theme==="string")dB($.theme);if($.ledgerSummary)tB($.ledgerSummary)}function BX($){if(typeof $.path!=="string"||!$.path)return;let v=$.path,g=(typeof $.title==="string"?$.title:"")||v.split("/").pop()||"Untitled";if($X(v,g),$.ledgerSummary)tB($.ledgerSummary)}function PX($){_4(),U$("status-main",{message:typeof $.message==="string"?$.message:String($.message??""),level:$.level??"ok",source:$.source})}function kX($){_4(),U$("status-main",{phase:$.phase,detail:$.detail})}function IX($){let v=$.cards??[];vX(v)}function HX($){if(typeof $.url==="string"&&$.url)UX({url:$.url,sourceServer:$.sourceServer,sourceTool:$.sourceTool,inferredType:$.inferredType,trustedDomain:$.trustedDomain,hostMode:$.hostMode??"hosted"})}function LX($){let v=$.sessions??[];for(let g of v){let _=g.url;if(!_)continue;let U=`mcp-${Tg(_)}`;if(T.value.has(U))U$(U,{sessionState:g.state,lastSeenAt:g.lastSeenAt})}}function FX($){if(typeof $.url==="string"&&$.url){let v=`mcp-${Tg($.url)}`;if(T.value.has(v))U$(v,{hostMode:"fallback",fallbackReason:$.reasonCode})}}function YX($){let g=T.value.get("context-main");if(!g)return;let _=(g.data.auxTabs??[]).concat($);U$("context-main",{auxTabs:_})}function AX($){if(T.value.has("context-main"))if($.mode==="all")U$("context-main",{auxTabs:[]});else{let _=T.value.get("context-main");if(!_)return;let U=(_.data.auxTabs??[]).filter((z)=>z.id!==$.id);U$("context-main",{auxTabs:U})}}function qX($){_4(),U$("status-main",{phase:"idle",lastCompletion:{tokenCount:$.tokenCount,artifactCount:$.artifactCount}})}function XX($){_4(),U$("status-main",{phase:"tooling",detail:`${$.name}`,activeTool:$.name})}function wX($){_4(),U$("status-main",{activeTool:null})}function ZX($){if($.state==="active"&&$.path){let g=`md-${Tg($.path)}`;if(T.value.has(g))U$(g,{reviewActive:!0})}}function SX($){if(typeof $.toolCallId!=="string"||!$.toolCallId)return;gX({toolCallId:$.toolCallId,...typeof $.nodeId==="string"&&$.nodeId.length>0?{nodeId:$.nodeId}:{},title:$.title,html:$.html,toolInput:$.toolInput,serverName:$.serverName,toolName:$.toolName,appSessionId:$.appSessionId,resourceUri:$.resourceUri,toolDefinition:$.toolDefinition,resourceMeta:$.resourceMeta,hostMode:"hosted",trustedDomain:!0,...$.chartConfig?{chartConfig:$.chartConfig}:{},...typeof $.x==="number"&&{_x:$.x},...typeof $.y==="number"&&{_y:$.y},...typeof $.width==="number"&&{_width:$.width},...typeof $.height==="number"&&{_height:$.height}})}function MX($){if(typeof $.toolCallId!=="string"||!$.toolCallId)return;let v=oB($)??nB($.serverName,$.toolName);if(!v)return;if(T.value.has(v))U$(v,{html:$.html})}function QX($){if(typeof $.toolCallId!=="string"||!$.toolCallId)return;let v=oB($)??nB($.serverName,$.toolName);if(!v)return;if(T.value.has(v)){if($.success===!1){F4(v);return}U$(v,{toolResult:dO({result:$.result,success:typeof $.success==="boolean"?$.success:void 0,error:typeof $.error==="string"?$.error:void 0,content:typeof $.content==="string"?$.content:void 0,detailedContent:typeof $.detailedContent==="string"?$.detailedContent:void 0})})}}function NX($){_4(),U$("status-main",{subagent:{state:$.state,name:$.agentDisplayName??$.agentName}})}function rX($){let v=$.nodeId;if(!v)return;let g=$.text||"",_=$.position,U=$.parentNodeId,z=$.contextNodeIds;if($.threadNodeId&&T.value.has($.threadNodeId)){let b=$.threadNodeId,J=T.value.get(b);if(!J)return;let G=Array.isArray(J.data.turns)?[...J.data.turns]:[],K=G[G.length-1];if(!K||K.role!=="user"||K.text!==g)G.push({role:"user",text:g,status:"pending"});U$(b,{turns:G,threadStatus:"pending"});return}if(!T.value.has(v)){let b=_??sv.prompt;_6(m0({id:v,type:"prompt",position:{x:b.x,y:b.y},size:{width:sv.prompt.w,height:400},zIndex:1,collapsed:!1,pinned:!1,dockPosition:null,data:{text:g,turns:g?[{role:"user",text:g,status:"pending"}]:[],threadStatus:g?"pending":"draft",status:g?"pending":"draft",parentNodeId:U,contextNodeIds:z}})),Fv(v)}if(U&&T.value.has(U))I_({id:`edge-${U}-${v}`,from:U,to:v,type:"flow",style:"dashed"})}function uX($){let{nodeId:v,status:g}=$;if(v&&T.value.has(v))U$(v,{status:g})}function RX($){let{responseNodeId:v,promptNodeId:g}=$;if(!v)return;let _=g?T.value.get(g):void 0;if(_&&Array.isArray(_.data.turns)){f0.set(v,g);let z=[..._.data.turns];z.push({role:"assistant",text:"",status:"streaming"}),U$(g,{turns:z,threadStatus:"streaming",_activeResponseId:v}),Fv(g);return}let U=_?{x:_.position.x,y:_.position.y+_.size.height+24}:{x:sv.response.x,y:sv.response.y};if(!T.value.has(v))_6(m0({id:v,type:"response",position:U,size:{width:sv.response.w,height:sv.response.h},zIndex:1,collapsed:!1,pinned:!1,dockPosition:null,data:{content:"",status:"streaming",promptNodeId:g}}));if(g)I_({id:`edge-${g}-${v}`,from:g,to:v,type:"flow",animated:!0});Fv(v)}function yX($){let v=$.responseNodeId;if(!v)return;let g=f0.get(v);if(g){let _=T.value.get(g);if(_&&Array.isArray(_.data.turns)){let U=[..._.data.turns],z=U[U.length-1];if(z&&z.role==="assistant")z.text=$.content,z.status="streaming";U$(g,{turns:U,threadStatus:"streaming"})}return}if(!T.value.has(v))return;U$(v,{content:$.content,status:"streaming"})}function DX($){let v=$.responseNodeId;if(!v)return;let g=f0.get(v);if(g){let z=T.value.get(g);if(z&&Array.isArray(z.data.turns)){let b=[...z.data.turns],J=b[b.length-1];if(J&&J.role==="assistant")J.text=$.content,J.status="complete";U$(g,{turns:b,threadStatus:"answered",_activeResponseId:void 0})}f0.delete(v);return}if(!T.value.has(v))return;U$(v,{content:$.content,status:"complete"});let U=T.value.get(v)?.data.promptNodeId;if(U){let z=`edge-${U}-${v}`,b=c$.value.get(z);if(b)fK(z),I_({...b,animated:!1})}}function TX($){let v=$.layout;if(!v?.nodes)return;let g=!x6.value;x6.value=!0;let _=v.nodes.map(OX).filter((J)=>J!==null),U=Array.isArray(v.edges)?v.edges.map(GX).filter((J)=>J!==null):Array.from(c$.value.values()),z=Array.isArray(v.annotations)?v.annotations.map(KX).filter((J)=>J!==null):void 0,b=v.viewport?{x:typeof v.viewport.x==="number"?v.viewport.x:0,y:typeof v.viewport.y==="number"?v.viewport.y:0,scale:typeof v.viewport.scale==="number"?v.viewport.scale:1}:void 0;q4(),xK({...b?{viewport:b}:{},nodes:_,edges:U,...z?{annotations:z}:{}},{applyViewport:g}),F2({event:"canvas-layout-update",data:$})}function jX($){if($<=1)return 500;if($===2)return 1000;return Math.min(2500,1500+($-3)*500)}function VX($){let v=$.nodeId;if(v&&T.value.has(v)){if($.noPan===!0){A6(v);return}Fv(v)}}function CX($){let v=$.viewport;if(!v)return;let g=typeof v.x==="number"?v.x:0,_=typeof v.y==="number"?v.y:0,U=typeof v.scale==="number"?v.scale:1;q4(),iK({x:g,y:_,scale:U})}function fX($){if(T.value.get("context-main"))U$("context-main",{currentTokens:$.currentTokens,tokenLimit:$.tokenLimit,messagesLength:$.messagesLength,utilization:$.utilization,nearLimit:$.nearLimit})}function mX($){B_.value=$.enabled===!0}function EX($){if(typeof $.theme==="string")dB($.theme)}function cX($){let v=Array.isArray($.nodeIds)?$.nodeIds.filter((g)=>typeof g==="string"):[];VK(v),F2({event:"context-pins-changed",data:$})}var C0=null;function pB(){if(C0)clearTimeout(C0);C0=setTimeout(()=>{C0=null,YK().then(($)=>{F6.value=$})},150)}function iX($){let v=$.intent;if(!v||typeof v.id!=="string"||typeof v.kind!=="string"||typeof v.expiresAt!=="number")return;CW(v)}function lX($){let v=typeof $.id==="string"?$.id:"";if(!v)return;if($.settled===!0)mW(v,typeof $.nodeId==="string"?$.nodeId:void 0);else JG(v)}var hX={connected:WX,"workbench-open":BX,"canvas-status":PX,"execution-phase":kX,"context-cards":IX,"mcp-app-candidate":HX,"mcp-app-host-snapshot":LX,"mcp-app-host-fallback":FX,"aux-open":YX,"aux-close":AX,"assistant-complete":qX,"tool-start":XX,"tool-complete":wX,"review-state":ZX,"subagent-status":NX,"ext-app-open":SX,"ext-app-update":MX,"ext-app-result":QX,"context-pins-changed":cX,"canvas-layout-update":TX,"canvas-focus-node":VX,"canvas-viewport-update":CX,"context-usage":fX,"trace-state":mX,"theme-changed":EX,"canvas-prompt-created":rX,"canvas-prompt-status":uX,"canvas-response-start":RX,"canvas-response-delta":yX,"canvas-response-complete":DX,"ax-state-changed":pB,"ax-event-created":pB,"ax-intent":iX,"ax-intent-clear":lX};function XG(){if(AG=oK(),_4(),x6.value=!1,O3(),EW(),m6)clearTimeout(m6),m6=null;let $=H4.value,v=$?`/api/workbench/events?session=${$}`:"/api/workbench/events";h6.value="connecting";let g=new EventSource(v);Dg=g;for(let[_,U]of Object.entries(hX))g.addEventListener(_,(z)=>{try{U(JSON.parse(z.data))}catch(b){console.warn(`[sse-bridge] Failed to parse "${_}" event:`,b)}});return g.onopen=()=>{if(Dg!==g)return;YG=0,h6.value="connected"},g.onerror=()=>{if(Dg!==g)return;h6.value="disconnected",g.close(),Dg=null,YG+=1,m6=setTimeout(()=>{m6=null,XG()},jX(YG))},()=>{if(m6)clearTimeout(m6),m6=null;g.close(),Dg=null}}function xX($,v){console.error(`[app] ${$} failed`,v)}function sB($,v={}){fetch(`/api/workbench/intent?_ts=${Date.now()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:$,payload:v})}).catch((g)=>{xX("sendIntent",g)})}function Ov({label:$,detail:v,shortcut:g,align:_="center",children:U}){return O("span",{class:`toolbar-tooltip-anchor toolbar-tooltip-anchor-${_}`,children:[U,O("span",{class:"toolbar-tooltip",role:"tooltip",children:[O("span",{class:"toolbar-tooltip-label",children:$},void 0,!1,void 0,this),(v||g)&&O("span",{class:"toolbar-tooltip-meta",children:[v&&O("span",{children:v},void 0,!1,void 0,this),g&&O("kbd",{class:"toolbar-tooltip-shortcut",children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function pX({minimapVisible:$,onToggleMinimap:v,snapshotOpen:g,onToggleSnapshot:_,snapshotBtnRef:U,onOpenPalette:z,onOpenShortcuts:b,annotationTool:J,onToggleAnnotationMode:G,onToggleAnnotationEraser:K,onToggleTextAnnotation:W}){let B=h6.value,k=x6.value,P=I$.value,A=T.value.size,H=c$.value.size,I=B_.value,F=Array.from(T.value.values()).filter((u)=>u.type==="trace").length,Y=B==="connected"&&!k?"syncing":B,X=Y.charAt(0).toUpperCase()+Y.slice(1),Q=k?[`${A} node${A!==1?"s":""}`,...H>0?[`${H} edge${H!==1?"s":""}`]:[],...F>0?[`${F} trace${F!==1?"s":""}`]:I?["trace armed"]:[]].join(" · "):"Syncing canvas…";return O("div",{class:"toolbar-group",children:[O("div",{class:"canvas-toolbar",children:[O(Ov,{label:"PMX Canvas",detail:"Focus Field · spatial workbench for coding agents",align:"start",children:O("span",{class:"canvas-brand","aria-label":"PMX Canvas",children:O(zB,{size:22},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(Ov,{label:"Canvas status",detail:k?X:"Syncing canvas from server",align:"start",children:O("span",{class:`connection-dot ${B}`,"aria-label":`Canvas status: ${Y}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"hud-collapsible-text",style:{fontSize:"11px",color:"var(--c-muted)"},children:H4.value?H4.value.slice(0,12):"…"},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(Ov,{label:"Fit canvas",detail:"Frame every node on screen",children:O("button",{type:"button",onClick:()=>L_(window.innerWidth,window.innerHeight),"aria-label":"Fit canvas",children:O(lW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:"Reset view",shortcut:`${Sv}+0`,children:O("button",{type:"button",onClick:()=>xv({x:0,y:0,scale:1},250),"aria-label":"Reset view",children:O(hW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:"Zoom in",shortcut:`${Sv}++`,children:O("button",{type:"button",onClick:()=>xv({...P,scale:Math.min(4,P.scale*1.25)},150),"aria-label":"Zoom in",children:O(xW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:"Zoom out",shortcut:`${Sv}+-`,children:O("button",{type:"button",onClick:()=>xv({...P,scale:Math.max(0.1,P.scale/1.25)},150),"aria-label":"Zoom out",children:O(pW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"hud-collapsible-text",style:{fontSize:"10px",color:"var(--c-dim)",minWidth:"36px",textAlign:"center"},children:[Math.round(P.scale*100),"%"]},void 0,!0,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(Ov,{label:"Arrange layout",detail:H>0?"Graph-aware layout for connected nodes":"Grid layout for loose nodes",children:O("button",{type:"button",onClick:()=>H>0?Y_():F_(),"aria-label":"Arrange layout",children:O(oW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:$?"Hide minimap":"Show minimap",detail:"Quickly navigate large canvases",children:O("button",{type:"button",onClick:v,"aria-label":$?"Hide minimap":"Show minimap",style:{color:$?"var(--c-accent)":void 0},children:O(nW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:`Switch to ${T$.value==="dark"?"light":"dark"} theme`,detail:`Current theme: ${T$.value}`,children:O("button",{type:"button",onClick:()=>{let u=T$.value==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",u),OU(),T$.value=u,J_(u)},"aria-label":`Switch to ${T$.value==="dark"?"light":"dark"} theme`,children:T$.value==="dark"?O(tW,{},void 0,!1,void 0,this):O(dW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:"Snapshots",detail:"Capture and restore canvas states",align:"end",children:O("button",{ref:U,type:"button",onClick:_,"aria-label":"Snapshots",style:{color:g?"var(--c-accent)":void 0},children:O($B,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"canvas-toolbar",children:[O(Ov,{label:I?"Disable trace":"Enable trace",detail:I?"Stop collecting new trace nodes":"Capture agent execution on the canvas",children:O("button",{type:"button",onClick:()=>sB("trace-toggle",{enabled:!I}),"aria-label":I?"Disable trace":"Enable trace",style:{color:I?"var(--c-purple)":void 0},children:O(vB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),(I||F>0)&&O(Ov,{label:"Clear trace",detail:F>0?`Remove ${F} trace node${F===1?"":"s"}`:"Trace is enabled but still empty",children:O("button",{type:"button",onClick:()=>sB("trace-clear"),"aria-label":"Clear trace",children:O(UB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(Ov,{label:J==="pen"?"Stop annotating":"Annotate canvas",detail:"Draw directly on the canvas for human-visible markup",children:O("button",{type:"button",onClick:G,"aria-label":J==="pen"?"Stop annotating":"Annotate canvas","aria-pressed":J==="pen",style:{color:J==="pen"?"var(--c-accent)":void 0},children:O(aW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:J==="eraser"?"Stop erasing":"Erase annotations",detail:"Click a drawn annotation to remove it",children:O("button",{type:"button",onClick:K,"aria-label":J==="eraser"?"Stop erasing":"Erase annotations","aria-pressed":J==="eraser",style:{color:J==="eraser"?"var(--c-accent)":void 0},children:O(sW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:J==="text"?"Stop text annotations":"Text annotations",detail:"Click anywhere to type an intent note",children:O("button",{type:"button",onClick:W,"aria-label":J==="text"?"Stop text annotations":"Text annotations","aria-pressed":J==="text",style:{color:J==="text"?"var(--c-accent)":void 0},children:O(eW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(Ov,{label:"Search nodes and actions",shortcut:`${Sv}+K`,children:O("button",{type:"button",onClick:z,"aria-label":"Search nodes and actions",children:O(gB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(Ov,{label:"Keyboard shortcuts",shortcut:"?",align:"end",children:O("button",{type:"button",onClick:b,"aria-label":"Keyboard shortcuts",children:O(_B,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"hud-collapsible-text",style:{fontSize:"10px",color:"var(--c-dim)"},children:Q},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function oX({onOpenPalette:$}){return O("div",{class:"welcome-card",children:[O("div",{class:"welcome-icon",children:"◇"},void 0,!1,void 0,this),O("div",{class:"welcome-title",children:"Shape What The Agent Sees"},void 0,!1,void 0,this),O("div",{class:"welcome-subtitle",children:"Lay out notes, files, and evidence. Bring related nodes together. Pin what matters. The board will reflect the active focus."},void 0,!1,void 0,this),O("div",{class:"welcome-hints",children:[O("button",{type:"button",class:"welcome-hint",onClick:$,children:[O("kbd",{children:[Sv,"+K"]},void 0,!0,void 0,this),O("span",{children:"Create a note"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-hint",children:[O("kbd",{children:"Drop files"},void 0,!1,void 0,this),O("span",{children:"Add evidence to the board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-hint",children:[O("kbd",{children:"✦"},void 0,!1,void 0,this),O("span",{children:"Pin important nodes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-hint",children:[O("kbd",{children:"Move nearby"},void 0,!1,void 0,this),O("span",{children:"Shape the focus field"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-footer",children:"The canvas is a shared attention surface, not just an editor."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function eB(){let[$,v]=x(!0),[g,_]=x(!1),[U,z]=x(!1),[b,J]=x(!1),[G,K]=x(null),W=V(null),{menu:B,openNodeMenu:k,openCanvasMenu:P,closeMenu:A}=RB(),H=x6.value,I=N(()=>v((r)=>!r),[]),F=N(()=>_((r)=>!r),[]),Y=N(()=>_(!1),[]),X=N(()=>K((r)=>r==="pen"?null:"pen"),[]),Q=N(()=>K((r)=>r==="eraser"?null:"eraser"),[]),u=N(()=>K((r)=>r==="text"?null:"text"),[]),E=N((r,R)=>{xv({x:r,y:R,scale:I$.value.scale},200)},[]);m(()=>{return XG()},[]),m(()=>{let r=(R)=>{let $$=R.metaKey||R.ctrlKey;if($$&&R.key==="k"){R.preventDefault(),z((c)=>!c);return}if(R.key==="Escape"&&G){R.preventDefault(),K(null);return}if(R.key==="Escape"&&E$.value&&!hv.value){R.preventDefault(),p6();return}if(R.key==="Escape"&&U){R.preventDefault(),z(!1);return}if(R.key==="Escape"&&b){R.preventDefault(),J(!1);return}let p=R.target?.tagName;if(p==="INPUT"||p==="TEXTAREA")return;if(R.key==="?"||R.key==="/"&&R.shiftKey){R.preventDefault(),J((c)=>!c);return}if($$&&R.key==="0")R.preventDefault(),xv({x:0,y:0,scale:1},250);else if($$&&(R.key==="="||R.key==="+")){R.preventDefault();let c=I$.value;xv({...c,scale:Math.min(4,c.scale*1.25)},150)}else if($$&&R.key==="-"){R.preventDefault();let c=I$.value;xv({...c,scale:Math.max(0.1,c.scale/1.25)},150)}else if(R.key==="Escape"){if(h$.value.size>0){jv();return}y$.value=null,A()}else if(R.key==="Tab")R.preventDefault(),nK(R.shiftKey?-1:1);else if(y$.value&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(R.key)){R.preventDefault();let c=R.key.replace("Arrow","").toLowerCase();tK(c)}};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[G,A,U,b]),m(()=>{if(!H)return;let r=window.__pmxCanvasBootstrapReady;if(typeof r==="function")r()},[H]);let M=Array.from(T.value.values()),n=M.filter((r)=>r.dockPosition==="left"),t=M.filter((r)=>r.dockPosition==="right").sort((r,R)=>{let $$={context:0,ledger:1};return($$[r.type]??2)-($$[R.type]??2)});return O("div",{style:{width:"100%",height:"100%",position:"relative"},children:[O("div",{class:"hud-layer",children:[O("div",{class:"hud-left",children:n.map((r)=>O(FG,{node:r},r.id,!1,void 0,this))},void 0,!1,void 0,this),O(pX,{minimapVisible:$,onToggleMinimap:I,snapshotOpen:g,onToggleSnapshot:F,snapshotBtnRef:W,onOpenPalette:()=>z(!0),onOpenShortcuts:()=>J((r)=>!r),annotationTool:G,onToggleAnnotationMode:X,onToggleAnnotationEraser:Q,onToggleTextAnnotation:u},void 0,!1,void 0,this),O("div",{class:"hud-right",children:t.map((r)=>O(FG,{node:r},r.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(aK,{},void 0,!1,void 0,this),O(dK,{},void 0,!1,void 0,this),O(rB,{onNodeContextMenu:k,onCanvasContextMenu:P,annotationMode:G!==null,annotationTool:G},void 0,!1,void 0,this),H&&M.filter((r)=>!r.dockPosition).length===0&&Lv.value.size===0&&O(oX,{onOpenPalette:()=>z(!0)},void 0,!1,void 0,this),h$.value.size>0&&O(iB,{},void 0,!1,void 0,this),D$.value.size>0&&O(TB,{},void 0,!1,void 0,this),E$.value&&O(mB,{},void 0,!1,void 0,this),O(hB,{open:g,onClose:Y,anchorRef:W},void 0,!1,void 0,this),$&&O(cB,{viewport:I$,nodes:T,edges:c$,onNavigate:E,containerWidth:window.innerWidth,containerHeight:window.innerHeight},void 0,!1,void 0,this),B&&O(yB,{menu:B,onClose:A},void 0,!1,void 0,this),U&&O(uB,{onClose:()=>z(!1),onToggleMinimap:I},void 0,!1,void 0,this),b&&O(lB,{onClose:()=>J(!1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var $P=document.getElementById("app");if($P)EG(O(eB,{},void 0,!1,void 0,this),$P);
225
+ </script>`}function Rq($,v){if(!v)return $;let g=/<head\b[^>]*>/i.exec($);if(g?.index!==void 0){let U=g.index+g[0].length;return`${$.slice(0,U)}${v}${$.slice(U)}`}let _=/<body\b[^>]*>/i.exec($);if(_?.index!==void 0){let U=_.index+_[0].length;return`${$.slice(0,U)}${v}${$.slice(U)}`}return`${v}${$}`}function PU($,v){if(Number.isFinite($)&&$>0)return Math.round($);if(Number.isFinite(v)&&v>0)return Math.round(v);return 1}function zG($,v){let g=$?.getBoundingClientRect();return{width:PU($?.clientWidth??0,PU(g?.width??0,v.width)),height:PU($?.clientHeight??0,PU(g?.height??0,v.height))}}function Dq($,v){return typeof $==="number"&&Number.isFinite($)&&$>0&&!v}function Tq($,v){return Math.max(PU($,1),PU(v,1))}function yW({node:$,expanded:v=!1}){let g=y(null),_=y(null),U=y(null),z=y(null),J=y({}),b=y(void 0),G=y(!1),K=y(void 0),W=y(null),B=y(!1),k=y(null),P=y(!1),q=y(0),L=y(!1),H=y([]),F=y(!1),Y=y(!1),[A,M]=x("loading"),[V,f]=x(null),[N,t]=x(0),d=$.data.html,u=$.data.serverName,r=$.data.appSessionId,g$=$.data.toolInput??{},p=$.data.toolResult,m=$.data.toolName??"ext-app",L$=$.data.toolDefinition,Y$=$.data.toolCallId,n$=typeof Y$==="string"||typeof Y$==="number"?Y$:void 0,S=$.data.resourceMeta,i=$.data.sessionStatus,$$=$.data.sessionError,a=$.size.height,n=$.id,z$=Nq($,N),s=p!=null,E=uq(null),G$=$.data.axCapabilities?.enabled===!0&&typeof d==="string"&&d.length>0,J$=t$(()=>`ax-${crypto.randomUUID()}`,[]),i$=G$?yq(J$,n):"",C$=QW(Rq(d??"",i$),E);c(()=>{if(!G$)return;function K$(Z$){if(Z$.source!==g.current?.contentWindow)return;let f$=Z$.data;if(!f$||f$.source!=="pmx-canvas-ax"||f$.token!==J$||f$.nodeId!==n)return;let j$=f$.interaction;if(!j$||typeof j$.type!=="string")return;let uv=j$.type;Y6({type:uv,sourceNodeId:n,sourceSurface:"mcp-app",...j$.payload&&typeof j$.payload==="object"?{payload:j$.payload}:{}}).then((yv)=>{if(yv.ok)Dv("context","AX interaction",uv,[n]);else Dv("remove","AX interaction rejected",yv.error??yv.code??"",[n]);g.current?.contentWindow?.postMessage({source:"pmx-canvas-ax-ack",token:J$,...f$.correlationId?{correlationId:f$.correlationId}:{},interaction:{type:uv},result:yv},"*")})}return window.addEventListener("message",K$),()=>window.removeEventListener("message",K$)},[G$,J$,n]);let Wv=3,Ov=(K$)=>{if(q.current>=Wv){BU(n,`remount-cap-hit (${K$})`);return}if(F.current)return;q.current+=1,F.current=!0,BU(n,`remount-queued #${q.current} (${K$})`),Mq({remount:()=>{if(F.current=!1,Y.current||V$.value===n)return BU(n,"remount-skipped"),!1;return BU(n,`remount-run #${q.current}`),t((Z$)=>Z$+1),!0},awaitBoot:()=>new Promise((Z$)=>{let f$=window.setTimeout(j$,Sq);function j$(){window.clearTimeout(f$),Z$()}H.current.push(j$)})})};c(()=>{if(v||P.current)return;if(!Qq(A,s))return;if(typeof navigator>"u"||typeof window>"u")return;if(!NW(navigator.userAgent))return;P.current=!0,Ov("post-boot-repaint")},[A,s]);let mg=6000;c(()=>{if(v)return;if(typeof navigator>"u"||typeof window>"u")return;if(!NW(navigator.userAgent))return;if(!C$.ready)return;let K$=window.setTimeout(()=>{if(L.current||Y.current)return;Ov("boot-watchdog")},mg);return()=>window.clearTimeout(K$)},[z$,C$.ready,v]),c(()=>()=>{Y.current=!0;for(let K$ of H.current.splice(0))K$()},[]);let O4=(K$)=>K$==="light"?"light":"dark",wv=v||V$.value===n;J.current=g$,b.current=p;let G4=i==="error"?$$??"Saved app session is unavailable. Reopen the app to restore interactivity.":"Reconnecting saved app session...",$6=(K$)=>{let Z$=b.current;if(!K$||!B.current||!Z$)return null;if(K.current===Z$)return null;if(K.current&&ZW(K.current,Z$))return K.current=Z$,null;if(W.current)return W.current;let f$=K$.sendToolResult(Z$).then(()=>{K.current=Z$,G.current=!0,M("done")}).catch((j$)=>{let uv=j$ instanceof Error?j$.message:String(j$);throw f(`Tool result delivery failed: ${uv}`),j$}).finally(()=>{W.current=null});return W.current=f$,f$};if(c(()=>{if(!d||!C$.ready)return;let K$=g.current;if(!K$)return;let Z$=!1,f$=null,j$=null,uv=null,yv=null;G.current=!1,K.current=void 0,W.current=null,B.current=!1,L.current=!1;let ig=()=>{if(!f$)return;clearTimeout(f$),f$=null};return(async()=>{if(!d)return;let H6=K$.contentWindow;if(!H6)throw Error("Ext-app iframe window is unavailable");let l6=(H$=V$.value===n?"fullscreen":"inline")=>({theme:O4(T$.value),platform:"web",containerDimensions:zG(K$,{width:$.size.width,height:a}),displayMode:H$,locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,...L$?{toolInfo:{id:n$,tool:L$}}:{}}),OP=()=>{if(uv!==null)return;uv=requestAnimationFrame(()=>{if(uv=null,Z$||!B.current)return;u$.setHostContext?.(l6())})},rG=()=>{if(yv!==null)return;yv=requestAnimationFrame(()=>{yv=requestAnimationFrame(()=>{if(yv=null,Z$||!B.current)return;u$.sendHostContextChange?.(l6())})})},u$=new vG(null,{name:"PMX Canvas",version:"1.0.0"},{openLinks:{},serverTools:{listChanged:!1},serverResources:{listChanged:!1},logging:{},updateModelContext:{text:{},structuredContent:{}}},{hostContext:l6(wv?"fullscreen":"inline")});u$.onsizechange=async({height:H$})=>{if(Dq(H$,V$.value===n)){let Bv=zG(K$.parentElement??K$,{width:$.size.width,height:a}),lv=Tq(H$,Bv.height);K$.style.height=`${lv}px`;let h6=T.value.get(n)?.size??$.size,yG=Math.max(h6.height,lv+eK);if(Math.abs(yG-h6.height)>8){if(Z4(n,{width:h6.width,height:yG}),z.current!==null)window.clearTimeout(z.current);z.current=window.setTimeout(()=>{d$({recordHistory:!1}),z.current=null},0)}}return{}},u$.onopenlink=async({url:H$})=>{return window.open(H$,"_blank","noopener"),{}},u$.onsandboxready=async()=>{await u$.sendSandboxResourceReady({html:d,sandbox:_G,...S?.csp?{csp:S.csp}:{},...S?.permissions?{permissions:S.permissions}:{}})},u$.onrequestdisplaymode=async({mode:H$})=>{let{nextMode:Bv,shouldExpand:lv,shouldCollapse:h6}=rq(H$,wv);if(lv)b6(n);else if(h6)t6();return{mode:Bv}},u$.oncalltool=async(H$)=>{if(!r)throw Error(G4);try{let Bv=await z4("/api/ext-app/call-tool",{sessionId:r,nodeId:n,serverName:u,toolName:H$.name,arguments:H$.arguments??{}});return f(null),Bv}catch(Bv){let lv=Bv instanceof Error?Bv.message:String(Bv);throw f(`Tool call failed: ${lv}`),Bv}},u$.setRequestHandler(Ng,async()=>{if(!r)return{tools:[]};return z4("/api/ext-app/list-tools",{sessionId:r})}),u$.onlistresources=async()=>r?z4("/api/ext-app/list-resources",{sessionId:r}):{resources:[]},u$.onlistresourcetemplates=async()=>r?z4("/api/ext-app/list-resource-templates",{sessionId:r}):{resourceTemplates:[]},u$.onreadresource=async(H$)=>{if(!r)throw Error(G4);return z4("/api/ext-app/read-resource",{sessionId:r,uri:H$.uri})},u$.onlistprompts=async()=>r?z4("/api/ext-app/list-prompts",{sessionId:r}):{prompts:[]},u$.onupdatemodelcontext=async(H$)=>{if(!r)return{};return await z4("/api/ext-app/model-context",{nodeId:n,...Array.isArray(H$.content)?{content:H$.content}:{},...H$.structuredContent&&typeof H$.structuredContent==="object"?{structuredContent:H$.structuredContent}:{}}),{}};let o0=new u0(H6,H6);if(u$.oninitialized=()=>{if(Z$)return;ig(),B.current=!0,L.current=!0,BU(n,"initialized"),M("ready"),f(null),Promise.resolve(u$.sendHostContextChange(l6(wv?"fullscreen":"inline"))).then(()=>uW(u$,J.current,void 0)).then(()=>$6(u$)).then(()=>{BU(n,"settled");for(let H$ of H.current.splice(0))H$();rG()}).catch((H$)=>{let Bv=H$ instanceof Error?H$.message:String(H$);f(`Bridge bootstrap failed: ${Bv}`)})},f$=setTimeout(()=>{if(Z$||B.current)return;let H$=b.current,Bv=l6(wv?"fullscreen":"inline");B.current=!0,u$.setHostContext?.(Bv),Promise.resolve(u$.sendHostContextChange(Bv)).then(()=>uW(u$,J.current,H$)).then(()=>{if(G.current=Boolean(H$),H$)K.current=H$;M(H$?"done":"ready"),f(null),rG()}).catch((lv)=>{let h6=lv instanceof Error?lv.message:String(lv);f(`Bridge bootstrap fallback failed: ${h6}`)})},1200),await u$.connect(o0),Z$){ig(),await o0.close();return}if(_.current=u$,U.current=o0,j$=new ResizeObserver(OP),j$.observe(K$),K$.parentElement)j$.observe(K$.parentElement);let uG=!0;k.current=T$.subscribe((H$)=>{if(uG){uG=!1;return}if(Z$)return;u$.setHostContext?.({...l6(),theme:O4(H$)}),u$.sendHostContextChange?.(l6())}),$6(u$)})().catch((H6)=>{ig(),console.error("[ext-app] Bridge init failed:",H6),f(H6?.message??"Bridge initialization failed")}),()=>{if(Z$=!0,ig(),j$?.disconnect(),j$=null,uv!==null)cancelAnimationFrame(uv),uv=null;if(yv!==null)cancelAnimationFrame(yv),yv=null;if(B.current=!1,W.current=null,k.current?.(),k.current=null,z.current!==null)window.clearTimeout(z.current),z.current=null;if(_.current=null,U.current)U.current.close().catch((H6)=>{console.error("[ext-app] transport close failed:",H6)}),U.current=null}},[z$,C$.key]),c(()=>{if(p&&_.current&&(A==="ready"||A==="done"))$6(_.current)},[p,A]),c(()=>{let K$=_.current;if(g.current)g.current.style.height="100%";if(!K$||!B.current)return;let Z$=null,f$=null;return Z$=requestAnimationFrame(()=>{Z$=null,f$=requestAnimationFrame(()=>{if(f$=null,!B.current)return;let j$={theme:O4(T$.value),platform:"web",containerDimensions:zG(g.current,{width:$.size.width,height:a}),displayMode:wv?"fullscreen":"inline",locale:navigator.language,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};K$.setHostContext?.(j$),K$.sendHostContextChange?.(j$)})}),()=>{if(Z$!==null)cancelAnimationFrame(Z$);if(f$!==null)cancelAnimationFrame(f$)}},[wv,a]),!d)return O("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",color:"var(--c-muted)",fontSize:"13px",flexDirection:"column",gap:"8px"},children:[O("div",{style:{opacity:0.6},children:["Loading ",m," viewer..."]},void 0,!0,void 0,this),O("div",{style:{width:"24px",height:"24px",border:"2px solid var(--c-line)",borderTopColor:"var(--c-muted)",borderRadius:"50%",animation:"spin 1s linear infinite"}},void 0,!1,void 0,this),O("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("div",{style:{flex:1,width:"100%",height:"100%",minWidth:0,minHeight:0,display:"flex",flexDirection:"column"},children:[i&&i!=="ready"&&O("div",{style:{padding:"6px 10px",fontSize:"11px",background:i==="error"?"var(--c-danger-12)":"var(--c-warn-10)",color:i==="error"?"var(--c-danger)":"var(--c-warn)",borderBottom:`1px solid ${i==="error"?"var(--c-danger-12)":"var(--c-warn-15)"}`},children:G4},void 0,!1,void 0,this),V&&O("div",{style:{padding:"6px 10px",fontSize:"11px",background:"var(--c-danger-12)",color:"var(--c-danger)",borderBottom:"1px solid var(--c-danger-12)",display:"flex",alignItems:"center",gap:"6px"},children:[O("span",{children:"⚠"},void 0,!1,void 0,this),O("span",{style:{flex:1},children:V},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>{f(null),M("loading"),t((K$)=>K$+1)},style:{background:"var(--c-surface-hover)",border:"1px solid var(--c-danger-12)",borderRadius:"3px",color:"var(--c-danger)",cursor:"pointer",fontSize:"10px",padding:"1px 6px"},children:"Retry"},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>f(null),style:{background:"none",border:"none",color:"var(--c-danger)",cursor:"pointer",fontSize:"13px",padding:"0 2px"},children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),A==="loading"&&O("div",{style:{padding:"8px",fontSize:"11px",color:"var(--c-muted)"},children:"Connecting to ext-app viewer..."},void 0,!1,void 0,this),O("div",{style:{flex:1,position:"relative",display:"flex",minHeight:0,height:"100%"},children:[O("iframe",{ref:g,...C$.attributes,sandbox:E,allow:wW(S?.permissions),style:{flex:1,width:"100%",height:"100%",minHeight:0,border:"none",background:"var(--c-panel)",pointerEvents:wv&&A!=="loading"?"auto":"none"},title:`Ext App: ${m}`},z$,!1,void 0,this),!wv&&O("button",{type:"button",onClick:(K$)=>{K$.stopPropagation(),b6(n)},class:"ext-app-preview-catcher",title:"Click to open",style:{position:"absolute",top:0,right:"56px",bottom:"56px",left:0,background:"transparent",border:"none",padding:0,margin:0,cursor:"zoom-in"},"aria-label":"Open full view to edit"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function y0($,v,g){let _=y($);_.current=$;let U=y(null);c(()=>{if(!g)return;function z(J){if(J.source!==v.current?.contentWindow)return;let b=J.data;if(!b||b.source!=="pmx-canvas-frame"||b.type!=="content-height"||b.token!==g)return;let G=_.current,K=typeof b.height==="number"?b.height:0,W=U5(G,K);if(W===null)return;if(Z4(G.id,{width:G.size.width,height:W}),U.current!==null)window.clearTimeout(U.current);U.current=window.setTimeout(()=>{d$({recordHistory:!1}),U.current=null},300)}return window.addEventListener("message",z),()=>{if(window.removeEventListener("message",z),U.current!==null)window.clearTimeout(U.current),U.current=null}},[$.id,g])}function jq($,v,g,_,U,z,J){if(!$)return $;try{let b=new URL($,window.location.origin);if(b.searchParams.set("theme",T$.value==="light"?"light":"dark"),v)b.searchParams.set("display","expanded");if(typeof g==="number")b.searchParams.set("v",String(g));if(_)b.searchParams.set("axToken",_);if(U)b.searchParams.set("axNodeId",U);if(z)b.searchParams.set("frameToken",z);if(J)b.searchParams.set("fit","content");return b.toString()}catch{return $}}function Vq($,v=window.location.origin){if(!$)return!1;try{let g=new URL(v).origin,_=new URL($,g);return _.origin===g&&_.pathname.startsWith("/api/canvas/frame-documents/")}catch{return!1}}function m6({node:$,expanded:v=!1}){if($.data.mode==="ext-app")return O(yW,{node:$,expanded:v},void 0,!1,void 0,this);return O(Cq,{node:$,expanded:v},void 0,!1,void 0,this)}function Cq({node:$,expanded:v}){let g=y(null),_=$.type==="mcp-app"&&$.data.viewerType==="web-artifact",U=$.type==="json-render"||$.type==="graph",z=$.data.axCapabilities?.enabled,b=(U||_)&&(_?z===!0:z!==!1),G=_?"mcp-app":"json-render",K=t$(()=>b?`ax-${crypto.randomUUID()}`:"",[b]),W=l2($)&&!v,B=t$(()=>W?`frame-${crypto.randomUUID()}`:"",[W]);y0($,g,B),c(()=>{if(!b||!K)return;function M(V){if(V.source!==g.current?.contentWindow)return;let f=V.data;if(!f||f.source!=="pmx-canvas-ax"||f.token!==K||f.nodeId!==$.id)return;let N=f.interaction;if(!N||typeof N.type!=="string")return;let t=N.type;Y6({type:t,sourceNodeId:$.id,sourceSurface:G,...N.payload&&typeof N.payload==="object"?{payload:N.payload}:{}}).then((d)=>{if(d.ok)Dv("context","AX interaction",t,[$.id]);else Dv("remove","AX interaction rejected",d.error??d.code??"",[$.id]);g.current?.contentWindow?.postMessage({source:"pmx-canvas-ax-ack",token:K,...f.correlationId?{correlationId:f.correlationId}:{},interaction:{type:t},result:d},"*")})}return window.addEventListener("message",M),()=>window.removeEventListener("message",M)},[b,K,$.id]);let k=X6.value,P=()=>{if(!b||!K||k==null)return;g.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"ax-update",token:K,state:k},"*")};c(P,[b,K,k]);let q=typeof $.data.specVersion==="number"?$.data.specVersion:void 0,L=jq($.data.url||"",v,q,K||void 0,b?$.id:void 0,B||void 0,W),H=$.data.sourceServer||"",F=$.data.hostMode||"hosted",Y=$.data.fallbackReason,A=$.data.trustedDomain===!0||Vq(L);if(F==="fallback")return O("div",{style:{display:"flex",flexDirection:"column",gap:"8px",fontSize:"12px"},children:[O("div",{style:{color:"var(--c-warn)",display:"flex",alignItems:"center",gap:"6px"},children:[O("span",{children:"⚠"},void 0,!1,void 0,this),O("span",{children:"Cannot embed — opened externally"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),Y&&O("div",{style:{color:"var(--c-muted)",fontSize:"11px"},children:["Reason: ",Y]},void 0,!0,void 0,this),O("a",{href:L,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--c-accent)",fontSize:"12px",wordBreak:"break-all"},children:L},void 0,!1,void 0,this),H&&O("div",{style:{color:"var(--c-dim)",fontSize:"10px"},children:["Source: ",H]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);return O("div",{style:{height:"100%",display:"flex",flexDirection:"column",...v?{flex:1,minHeight:0,width:"100%"}:{}},children:[!A&&O("div",{style:{padding:"4px 8px",fontSize:"10px",background:"var(--c-warn-10)",color:"var(--c-warn)",borderBottom:"1px solid var(--c-warn-15)"},children:"Unverified domain"},void 0,!1,void 0,this),O("iframe",{ref:g,src:L,class:"mcp-app-frame",sandbox:"allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox",allow:"clipboard-read; clipboard-write",loading:"lazy",onLoad:P,style:{flex:1,minHeight:0,width:"100%"},title:`MCP App: ${H}`},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var Dg=null;function a$($){return getComputedStyle(document.documentElement).getPropertyValue($).trim()}function R0(){if(Dg)return Dg;return Dg={bg:a$("--c-bg"),panel:a$("--c-panel"),panelSoft:a$("--c-panel-soft"),line:a$("--c-line"),text:a$("--c-text"),textSoft:a$("--c-text-soft"),muted:a$("--c-muted"),dim:a$("--c-dim"),accent:a$("--c-accent"),ok:a$("--c-ok"),warn:a$("--c-warn"),warnAlt:a$("--c-warn-alt"),danger:a$("--c-danger"),purple:a$("--c-purple"),thinking:a$("--c-thinking"),subagent:a$("--c-subagent"),font:a$("--font"),mono:a$("--mono")},Dg}function kU(){Dg=null}var D0={idle:"var(--c-muted)",running:"var(--c-accent)",planning:"var(--c-thinking)",thinking:"var(--c-thinking)",drafting:"var(--c-accent)",tooling:"var(--c-accent)",review:"var(--c-ok)","waiting-approval":"var(--c-warn)",waiting:"var(--c-warn-alt)"};function JG($){let v=typeof $.data.phase==="string"&&$.data.phase.trim().length>0?$.data.phase.trim():"";if(v)return v;let g=typeof $.data.content==="string"&&$.data.content.trim().length>0?$.data.content.trim():"";if(g)return g;return(typeof $.data.status==="string"&&$.data.status.trim().length>0?$.data.status.trim():"")||"idle"}function HU({node:$}){let v=JG($),g=$.data.detail||"",_=$.data.message||"",U=$.data.level||"ok",z=$.data.activeTool,J=$.data.subagent,b=D0[v]??"var(--c-muted)",G=v!=="idle";return O("div",{style:{display:"flex",flexDirection:"column",gap:"8px",fontSize:"12px"},children:[O("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[O("div",{style:{width:"8px",height:"8px",borderRadius:"50%",background:b,boxShadow:G?`0 0 8px ${b}`:"none",animation:G?"pulse 1.5s infinite":"none",flexShrink:0}},void 0,!1,void 0,this),O("span",{style:{fontWeight:600,color:b,textTransform:"uppercase",letterSpacing:"0.05em"},children:v},void 0,!1,void 0,this),g&&O("span",{style:{color:"var(--c-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this),z&&O("div",{style:{display:"flex",alignItems:"center",gap:"6px",color:"var(--c-warn)"},children:[O("span",{style:{fontSize:"10px"},children:"⚙"},void 0,!1,void 0,this),O("span",{style:{fontFamily:"var(--mono)",fontSize:"11px"},children:z},void 0,!1,void 0,this)]},void 0,!0,void 0,this),J&&J.state!=="completed"&&O("div",{style:{display:"flex",alignItems:"center",gap:"6px",color:"var(--c-subagent)"},children:[O("span",{style:{fontSize:"10px"},children:"⠉"},void 0,!1,void 0,this),O("span",{children:J.name},void 0,!1,void 0,this),O("span",{style:{color:"var(--c-muted)",fontSize:"10px"},children:["(",J.state,")"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),_&&O("div",{style:{color:U==="warn"?"var(--c-warn)":U==="error"?"var(--c-danger)":"var(--c-muted)",lineHeight:1.4},children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function IU($){return typeof $==="string"&&$.trim().length>0?$.trim():null}function RW($){if(typeof $==="string"){let U=IU($);return U?{title:"Evidence warning",detail:U}:null}if(!$||typeof $!=="object")return null;let v=$,g=IU(v.title)??"Evidence warning",_=IU(v.detail);return _?{title:g,detail:_}:null}function fq($){let v=[],g=RW($.data.warning);if(g)v.push(g);let _=$.data.warnings;if(Array.isArray(_))for(let z of _){let J=RW(z);if(J)v.push(J)}let U=IU($.data.validationStatus)?.toLowerCase();if(U==="failed"||U==="invalid")v.push({title:"Image failed validation",detail:IU($.data.validationMessage)??"Review this image before using it as evidence."});return v}function Eq($){let v=[$.data.title,$.data.caption,$.data.alt,$.data.src,$.data.path].map((g)=>IU(g)?.toLowerCase()??"").join(" ");if(v.length===0)return!1;return["login","log in","sign in","signin","password","2fa","mfa","authenticate","authentication","sso"].some((g)=>v.includes(g))}function DW($){let v=fq($);if(v.length>0)return v;if(Eq($))return[{title:"Captured login page",detail:"This image looks like an auth screen. Treat it as environment context, not product evidence."}];return[]}function T0({node:$,expanded:v=!1}){let g=$.data.src||"",_=$.data.alt||$.data.title||"Image",U=$.data.caption||"",z=DW($),J=g.startsWith("data:")||g.startsWith("http://")||g.startsWith("https://")?g:`/api/canvas/image/${$.id}`,[b,G]=x(!1),[K,W]=x(!1),[B,k]=x(1),[P,q]=x({x:0,y:0}),[L,H]=x({w:0,h:0}),F=y(null),Y=y(!1),A=y({x:0,y:0}),M=Q((p)=>{let m=p.target;H({w:m.naturalWidth,h:m.naturalHeight}),G(!0),W(!1)},[]),V=Q(()=>{W(!0),G(!1)},[]);c(()=>{k(1),q({x:0,y:0})},[g]);let f=Q((p)=>{p.preventDefault(),p.stopPropagation();let m=p.deltaY>0?0.9:1.1;k((L$)=>Math.max(0.25,Math.min(10,L$*m)))},[]),N=Q((p)=>{if(B<=1)return;p.stopPropagation(),Y.current=!0,A.current={x:p.clientX,y:p.clientY},p.target.setPointerCapture(p.pointerId)},[B]),t=Q((p)=>{if(!Y.current)return;let m=p.clientX-A.current.x,L$=p.clientY-A.current.y;A.current={x:p.clientX,y:p.clientY},q((Y$)=>({x:Y$.x+m,y:Y$.y+L$}))},[]),d=Q(()=>{Y.current=!1},[]),u=Q(()=>{k(1),q({x:0,y:0})},[]);if(!g)return O("div",{class:"image-node-empty",children:[O("div",{class:"image-node-empty-icon",children:"\uD83D\uDDBC"},void 0,!1,void 0,this),O("div",{class:"image-node-empty-text",children:"No image source"},void 0,!1,void 0,this)]},void 0,!0,void 0,this);let r=L.w>0?`${L.w}×${L.h}`:"",g$=Math.round(B*100);return O("div",{class:`image-node ${v?"image-node-expanded":""}`,ref:F,children:[z.length>0&&O("div",{class:"image-node-warning-stack",children:z.map((p)=>O("div",{class:"image-node-warning",children:[O("span",{class:"image-node-warning-title",children:p.title},void 0,!1,void 0,this),O("span",{class:"image-node-warning-detail",children:p.detail},void 0,!1,void 0,this)]},`${p.title}-${p.detail}`,!0,void 0,this))},void 0,!1,void 0,this),O("div",{class:"image-node-viewport",onWheel:f,onPointerDown:N,onPointerMove:t,onPointerUp:d,style:{cursor:B>1?"grab":"default"},children:[!b&&!K&&O("div",{class:"image-node-loading",children:"Loading…"},void 0,!1,void 0,this),K&&O("div",{class:"image-node-error",children:[O("div",{class:"image-node-error-icon",children:"⚠"},void 0,!1,void 0,this),O("div",{children:"Failed to load image"},void 0,!1,void 0,this),O("div",{class:"image-node-error-path",children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("img",{src:J,alt:_,onLoad:M,onError:V,draggable:!1,style:{transform:`translate(${P.x}px, ${P.y}px) scale(${B})`,opacity:b?1:0,display:K?"none":"block"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(U||r||B!==1)&&O("div",{class:"image-node-footer",children:[U&&O("span",{class:"image-node-caption",children:U},void 0,!1,void 0,this),O("span",{class:"image-node-meta",children:[r&&O("span",{children:r},void 0,!1,void 0,this),B!==1&&O("button",{type:"button",class:"image-node-zoom-reset",onClick:u,title:"Reset zoom",children:[g$,"% ↺"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function TW({node:$}){let v=$.data.children??[],g=T.value,_=v.filter((b)=>g.has(b)),U=_.length,z={};for(let b of _){let G=g.get(b);if(G)z[G.type]=(z[G.type]??0)+1}let J=Object.entries(z).map(([b,G])=>`${G} ${b}`).join(", ");return O("div",{class:"group-node-body",children:[O("div",{class:"group-summary",children:[O("span",{class:"group-child-count",children:[U," node",U!==1?"s":""]},void 0,!0,void 0,this),J&&O("span",{class:"group-type-summary",children:J},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U===0&&O("div",{class:"group-empty-hint",children:"Drag nodes here or use the selection bar to group nodes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function cq($){try{return new URL($).host}catch{return $}}function mq($){if(!$)return null;let v=new Date($);return Number.isNaN(v.getTime())?null:v.toLocaleString()}function j0({node:$,expanded:v=!1}){let g=typeof $.data.url==="string"?$.data.url:"",_=typeof $.data.pageTitle==="string"?$.data.pageTitle:"",U=typeof $.data.description==="string"?$.data.description:"",z=typeof $.data.excerpt==="string"?$.data.excerpt:typeof $.data.content==="string"?$.data.content:"",J=typeof $.data.status==="string"?$.data.status:"idle",b=typeof $.data.error==="string"?$.data.error:"",G=mq(typeof $.data.fetchedAt==="string"?$.data.fetchedAt:void 0),K=typeof $.data.statusCode==="number"?$.data.statusCode:null,W=typeof $.data.imageUrl==="string"?$.data.imageUrl:"",B=$.data.frameBlocked===!0,k=typeof $.data.frameBlockedReason==="string"?$.data.frameBlockedReason:"",[P,q]=x(!1),[L,H]=x(v);c(()=>{if(v)H(!0)},[v]);let F=Q(async()=>{if(!g||P)return;q(!0);try{await H_($.id)}finally{q(!1)}},[$.id,P,g]);if(!g)return O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"No webpage URL set"},void 0,!1,void 0,this);let Y=J==="ready"?"var(--c-ok)":J==="error"?"var(--c-danger)":"var(--c-warn)";return O("div",{style:{display:"flex",flexDirection:"column",gap:"12px",height:"100%"},children:[O("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:"12px"},children:[O("div",{style:{minWidth:0,flex:1},children:[O("div",{style:{fontSize:"12px",color:"var(--c-muted)"},children:cq(g)},void 0,!1,void 0,this),O("div",{style:{fontSize:v?"18px":"15px",fontWeight:700,color:"var(--c-text)"},children:_||$.data.title||g},void 0,!1,void 0,this),O("a",{href:g,target:"_blank",rel:"noopener noreferrer",style:{color:"var(--c-accent)",fontSize:"12px",wordBreak:"break-all",textDecoration:"none"},children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px",padding:"4px 8px",borderRadius:"999px",background:"rgba(255,255,255,0.04)",color:Y,fontSize:"11px",textTransform:"uppercase",letterSpacing:"0.04em",flexShrink:0},children:[O("span",{style:{width:"7px",height:"7px",borderRadius:"999px",background:Y}},void 0,!1,void 0,this),J]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),(U||W)&&O("div",{style:{display:"grid",gridTemplateColumns:W&&v?"160px 1fr":"1fr",gap:"12px",alignItems:"start"},children:[W&&v&&O("img",{src:W,alt:_||"Webpage preview image",style:{width:"160px",height:"96px",objectFit:"cover",borderRadius:"10px",border:"1px solid var(--c-line)",background:"var(--c-panel-soft)"}},void 0,!1,void 0,this),U&&O("p",{style:{margin:0,color:"var(--c-text-soft)",lineHeight:1.5,fontSize:v?"14px":"12px"},children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:[O("button",{type:"button",onClick:F,disabled:P,style:{border:"1px solid var(--c-line)",background:"var(--c-panel-soft)",color:"var(--c-text)",borderRadius:"8px",padding:"6px 10px",cursor:P?"progress":"pointer",fontSize:"12px"},children:P||J==="fetching"?"Refreshing…":"Refresh"},void 0,!1,void 0,this),v&&!B&&O("button",{type:"button",onClick:()=>H((A)=>!A),style:{border:"1px solid var(--c-line)",background:"var(--c-panel-soft)",color:"var(--c-text)",borderRadius:"8px",padding:"6px 10px",cursor:"pointer",fontSize:"12px"},children:L?"Hide live preview":"Show live preview"},void 0,!1,void 0,this),O("button",{type:"button",onClick:()=>window.open(g,"_blank","noopener"),style:{border:"1px solid var(--c-line)",background:"transparent",color:"var(--c-accent)",borderRadius:"8px",padding:"6px 10px",cursor:"pointer",fontSize:"12px"},children:"Open in browser"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v&&B&&O("div",{style:{border:"1px solid var(--c-line)",borderRadius:"12px",overflow:"hidden",background:"var(--c-panel-soft)"},children:[O("div",{style:{padding:"8px 12px",fontSize:"11px",color:"var(--c-muted)",borderBottom:"1px solid var(--c-line)",background:"rgba(255,255,255,0.03)"},children:"Live preview unavailable. This site refuses embedding, so PMX Canvas cannot show it inline."},void 0,!1,void 0,this),O("div",{style:{padding:"20px",color:"var(--c-text-soft)",lineHeight:1.6,fontSize:"13px"},children:k||"The remote site blocks iframe embedding."},void 0,!1,void 0,this)]},void 0,!0,void 0,this),v&&L&&!B&&O("div",{style:{border:"1px solid var(--c-line)",borderRadius:"12px",overflow:"hidden",background:"var(--c-panel-soft)"},children:[O("div",{style:{padding:"8px 12px",fontSize:"11px",color:"var(--c-muted)",borderBottom:"1px solid var(--c-line)",background:"rgba(255,255,255,0.03)"},children:"Live preview (best effort). If this stays blank, the site likely blocks framing. The cached text snapshot below still works."},void 0,!1,void 0,this),O("iframe",{class:"webpage-node-iframe",title:_||$.data.title||g,src:g,loading:"lazy",referrerPolicy:"no-referrer",sandbox:"allow-downloads allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-presentation allow-scripts",style:{display:"block",width:"100%",height:v?"320px":"180px",border:"none",background:"#fff"}},void 0,!1,void 0,this)]},void 0,!0,void 0,this),(G||K!==null)&&O("div",{style:{display:"flex",gap:"12px",flexWrap:"wrap",color:"var(--c-muted)",fontSize:"11px"},children:[G&&O("span",{children:["Fetched ",G]},void 0,!0,void 0,this),K!==null&&O("span",{children:["HTTP ",K]},void 0,!0,void 0,this),B&&O("span",{children:"Preview blocked by site"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),b&&O("div",{style:{color:"var(--c-danger)",fontSize:"12px",lineHeight:1.5},children:b},void 0,!1,void 0,this),O("div",{style:{flex:1,minHeight:0,overflow:"auto",border:"1px solid var(--c-line)",borderRadius:"10px",background:"var(--c-panel-soft)",padding:v?"14px":"10px"},children:z?O("div",{style:{whiteSpace:"pre-wrap",lineHeight:1.55,color:"var(--c-text)",fontSize:v?"14px":"12px"},children:z},void 0,!1,void 0,this):O("div",{style:{color:"var(--c-dim)",fontStyle:"italic"},children:J==="error"?"No cached page text available.":"Waiting for page text..."},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function jW($){let v=5381;for(let g=0;g<$.length;g+=1)v=(v<<5)+v+$.charCodeAt(g)|0;return(v>>>0).toString(36)}function bG($,v={}){let g=new URLSearchParams;if(g.set("theme",v.theme??T$.value),v.themeToken)g.set("themeToken",v.themeToken);if(v.present)g.set("present","1");if(v.presentToken)g.set("presentToken",v.presentToken);if(v.v)g.set("v",v.v);if(v.axToken)g.set("axToken",v.axToken);if(v.frameToken)g.set("frameToken",v.frameToken);return`/api/canvas/surface/${encodeURIComponent($)}?${g.toString()}`}function V0($){return SW($.type,$.data)}async function C0($){let v=bG($.id);if(!(await M3($.id,v)).opened)window.open(v,"_blank","noopener")}function VW($){return $.type==="html"&&$.data.presentation===!0}function Tg({node:$,expanded:v=!1,presentation:g=!1,presentationExitToken:_,autoFocus:U=!1}){let z=y(null),J=T$.value,b=t$(()=>`theme-${crypto.randomUUID()}`,[]),G=t$(()=>`ax-${crypto.randomUUID()}`,[]),K=t$(()=>`frame-${crypto.randomUUID()}`,[]),W=typeof $.data.html==="string"?$.data.html:typeof $.data.content==="string"?$.data.content:"",B=t$(()=>jW(W),[W]),k=t$(()=>W?bG($.id,{theme:J,themeToken:b,present:g,presentToken:_,v:B,axToken:G,frameToken:K}):"",[W,g,_,b,B,$.id,G,K]);y0($,z,v?"":K),c(()=>{function F(Y){if(Y.source!==z.current?.contentWindow)return;let A=Y.data;if(!A||A.source!=="pmx-canvas-ax"||A.token!==G||A.nodeId!==$.id)return;let M=A.interaction;if(!M||typeof M.type!=="string")return;let V=M.type;Y6({type:V,sourceNodeId:$.id,sourceSurface:"html-node",...M.payload&&typeof M.payload==="object"?{payload:M.payload}:{}}).then((f)=>{if(f.ok)Dv("context","AX interaction",V,[$.id]);else Dv("remove","AX interaction rejected",f.error??f.code??"",[$.id]);z.current?.contentWindow?.postMessage({source:"pmx-canvas-ax-ack",token:G,...A.correlationId?{correlationId:A.correlationId}:{},interaction:{type:V},result:f},"*")})}return window.addEventListener("message",F),()=>window.removeEventListener("message",F)},[G,$.id]),c(()=>{if(z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"theme-update",token:b,theme:J},"*"),U)z.current?.focus()},[J,b]);let P=$.data.axCapabilities,q=P?.enabled===!0&&(!Array.isArray(P.allowed)||P.allowed.length>0),L=X6.value;c(()=>{if(!q||L==null)return;z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"ax-update",token:G,state:L},"*")},[q,L,G]),c(()=>{if(!U)return;let F=window.setTimeout(()=>z.current?.focus(),0);return()=>window.clearTimeout(F)},[U,k]);let H=()=>{if(z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"theme-update",token:b,theme:J},"*"),q&&X6.value!=null)z.current?.contentWindow?.postMessage({source:"pmx-canvas-html-node",type:"ax-update",token:G,state:X6.value},"*");if(U)z.current?.focus()};if(!W)return O("div",{style:{color:"var(--c-dim)",fontStyle:"italic",padding:"12px"},children:"No HTML content set"},void 0,!1,void 0,this);return O("iframe",{ref:z,class:g?"html-node-frame html-node-frame-presentation":"html-node-frame",title:typeof $.data.title==="string"?$.data.title:"HTML node",sandbox:"allow-scripts",src:k,tabIndex:U?0:void 0,onLoad:H,style:{width:"100%",height:"100%",minHeight:g?0:v?"70vh":"300px",border:"none",background:"var(--c-bg)",borderRadius:g?0:"6px",display:"block"}},void 0,!1,void 0,this)}var OG=null;async function CW(){if(!OG)OG=await A3();return OG}function fW($,v){if(!$)return null;let g=$.toLowerCase(),_=v.find((z)=>z.name.toLowerCase()===g);if(_)return _.name;let U=v.filter((z)=>z.name.toLowerCase().startsWith(g));return U.length===1?U[0].name:null}function iq($){return $.replace(/<script[\s>][\s\S]*?<\/script>/gi,"").replace(/<iframe[\s>][\s\S]*?<\/iframe>/gi,"").replace(/<object[\s>][\s\S]*?<\/object>/gi,"").replace(/<embed[\s>][\s\S]*?(?:\/>|<\/embed>)/gi,"").replace(/<link[\s>][\s\S]*?(?:\/>|<\/link>)/gi,"").replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/href\s*=\s*"javascript:[^"]*"/gi,'href="#"').replace(/href\s*=\s*'javascript:[^']*'/gi,"href='#'")}function lq({html:$}){let v=y(null);return c(()=>{let g=v.current;if(!g)return;if(g.replaceChildren(),!$)return;let _=document.createElement("template");_.innerHTML=$,g.append(_.content.cloneNode(!0))},[$]),O("div",{ref:v},void 0,!1,void 0,this)}function hq($,v){return`${$.role}:${$.status??"none"}:${v}:${$.text}`}function EW({count:$}){if($===0)return null;return O("div",{style:{padding:"4px 8px",fontSize:"11px",color:"var(--c-accent)",background:"rgba(70,182,255,0.08)",borderRadius:"var(--radius-sm)",flexShrink:0},children:["✦"," ",$," context node",$!==1?"s":""," attached"]},void 0,!0,void 0,this)}function cW({message:$,onDismiss:v}){if(!$)return null;return O("div",{style:{padding:"4px 8px",fontSize:"11px",color:"var(--c-danger)",background:"rgba(255,80,80,0.08)",borderRadius:"var(--radius-sm)",display:"flex",alignItems:"center",gap:"6px",flexShrink:0},children:[O("span",{style:{flex:1},children:$},void 0,!1,void 0,this),O("button",{type:"button",onClick:v,style:{background:"none",border:"none",color:"var(--c-danger)",cursor:"pointer",fontSize:"13px",padding:"0 2px"},children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function f0({node:$,expanded:v=!1}){let g=Array.isArray($.data.turns)?$.data.turns:[],_=g.length===0,U=$.data.text||"",z=$.data.status||"draft",J=_?z:$.data.threadStatus||"draft",b=J==="draft",G=J==="pending"||J==="sending",K=J==="streaming",W=J==="answered",[B,k]=x(""),[P,q]=x(""),[L,H]=x(null),[F,Y]=x(new Map),A=y(null),M=y(null),V=g[g.length-1],f=`${g.length}:${V?.role??""}:${V?.status??""}:${Math.floor((V?.text?.length??0)/200)}`;c(()=>{if(v&&b&&A.current)A.current.focus()},[v,b]),c(()=>{if(!f)return;if(M.current)M.current.scrollTo({top:M.current.scrollHeight,behavior:"smooth"})},[f]);let N=y(null),t=y(g);t.current=g,c(()=>{let m=g.some((Y$)=>Y$.role==="assistant"&&Y$.status==="streaming"),L$=()=>{let Y$=!1,S=t.current.map((i,$$)=>({turn:i,index:$$})).filter(({turn:i})=>i.role==="assistant"&&i.text);if(S.length===0)return;return Promise.all(S.map(async({turn:i,index:$$})=>{let a=await z6(i.text);return{index:$$,html:iq(a)}})).then((i)=>{if(Y$)return;let $$=new Map;for(let a of i)$$.set(a.index,a.html);Y($$)}),()=>{Y$=!0}};if(!m){if(N.current)clearTimeout(N.current),N.current=null;return L$()}if(N.current)clearTimeout(N.current);return N.current=setTimeout(()=>{N.current=null,L$()},400),()=>{if(N.current)clearTimeout(N.current),N.current=null}},[g]);let d=Q(async()=>{let m=B.trim();if(!m)return;let L$=B;H(null),U$($.id,{turns:[{role:"user",text:m,status:"pending"}],threadStatus:"pending",text:m}),k("");let Y$=Array.isArray($.data.contextNodeIds)?$.data.contextNodeIds:void 0;if(!(await QU(m,$.position,$.id,Y$,$.id)).ok)U$($.id,{turns:[],threadStatus:"draft",text:"",status:"draft"}),k(L$),H("Failed to send prompt. Your draft has been restored.")},[B,$.id,$.position,$.data.contextNodeIds]),u=Q(async()=>{let m=P.trim();if(!m)return;let L$=P;H(null);let Y$=Array.isArray($.data.turns)?[...$.data.turns]:[];if(Y$.push({role:"user",text:m,status:"pending"}),U$($.id,{turns:Y$,threadStatus:"pending"}),q(""),!(await w3($.id,m)).ok)Y$.pop(),U$($.id,{turns:Y$,threadStatus:"answered"}),q(L$),H("Failed to send reply. Your draft has been restored.")},[P,$.id,$.data.turns]),r=Q((m)=>{if(m.key==="Enter"&&(m.metaKey||m.ctrlKey)){m.preventDefault(),d();return}if(m.key==="Tab"&&B.startsWith("/")){m.preventDefault();let L$=B.slice(1).split(/\s/)[0];if(L$)CW().then((Y$)=>{let n$=fW(L$,Y$);if(n$)k(`/${n$}`)})}},[d,B]),g$=Q((m)=>{if(m.key==="Enter"&&(m.metaKey||m.ctrlKey)){m.preventDefault(),u();return}if(m.key==="Tab"&&P.startsWith("/")){m.preventDefault();let L$=P.slice(1).split(/\s/)[0];if(L$)CW().then((Y$)=>{let n$=fW(L$,Y$);if(n$)q(`/${n$}`)})}},[u,P]),p=Array.isArray($.data.contextNodeIds)?$.data.contextNodeIds.length:0;if(b&&g.length===0)return O("div",{class:"prompt-node-inner",style:{display:"flex",flexDirection:"column",height:"100%",gap:"8px"},children:[O(EW,{count:p},void 0,!1,void 0,this),O(cW,{message:L,onDismiss:()=>H(null)},void 0,!1,void 0,this),O("textarea",{ref:A,value:B,onInput:(m)=>k(m.target.value),onKeyDown:r,placeholder:"Ask the agent something…",spellcheck:!1,style:{flex:1,resize:"none",background:"rgba(10,14,30,0.4)",border:"1px solid var(--c-line)",borderRadius:"var(--radius-sm)",color:"var(--c-text)",fontFamily:"var(--font)",fontSize:"13px",lineHeight:"1.5",padding:"8px 10px",outline:"none"}},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[O("span",{style:{fontSize:"10px",color:"var(--c-muted)"},children:["⌘","+Enter to send"]},void 0,!0,void 0,this),O("button",{type:"button",onClick:d,disabled:!B.trim(),style:{padding:"5px 14px",fontSize:"12px",fontWeight:600,background:B.trim()?"var(--c-accent)":"var(--c-line)",color:B.trim()?"var(--c-contrast-fg)":"var(--c-muted)",border:"none",borderRadius:"var(--radius-sm)",cursor:B.trim()?"pointer":"default"},children:"Send"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this);if(_)return O("div",{class:"prompt-node-inner",style:{display:"flex",flexDirection:"column",height:"100%"},children:[O("div",{style:{flex:1,padding:"2px 0",fontSize:"13px",lineHeight:"1.55",color:"var(--c-text)",whiteSpace:"pre-wrap",wordBreak:"break-word",overflow:"auto"},children:U},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"6px",borderTop:"1px solid var(--c-line)",marginTop:"4px"},children:O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,color:G?"var(--c-warn)":W?"var(--c-ok)":"var(--c-muted)"},children:G?"Sending…":W?"Answered":z},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this);return O("div",{class:"prompt-node-inner",style:{display:"flex",flexDirection:"column",height:"100%"},children:[O(EW,{count:p},void 0,!1,void 0,this),O(cW,{message:L,onDismiss:()=>H(null)},void 0,!1,void 0,this),O("div",{ref:M,style:{flex:1,overflow:"auto",minHeight:0},children:g.map((m,L$)=>O("div",{children:[L$>0&&O("div",{class:"thread-turn-divider"},void 0,!1,void 0,this),m.role==="user"?O("div",{class:"thread-turn-user",children:[O("div",{class:"thread-turn-role",children:[O("span",{class:"status-dot"},void 0,!1,void 0,this),"You"]},void 0,!0,void 0,this),O("div",{style:{fontSize:v?"15px":"13px",lineHeight:v?"1.7":"1.55",color:"var(--c-text)",whiteSpace:"pre-wrap",wordBreak:"break-word"},children:m.text},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O("div",{class:"thread-turn-assistant",children:[O("div",{class:"thread-turn-role",children:[O("span",{class:`status-dot${m.status==="streaming"?" pulsing":""}`},void 0,!1,void 0,this),"PMX"]},void 0,!0,void 0,this),m.status==="streaming"&&!m.text&&O("div",{style:{height:"2px",background:"linear-gradient(90deg, transparent, var(--c-ok), transparent)",animation:"response-stream-pulse 1.5s ease-in-out infinite",borderRadius:"1px",marginBottom:"4px"}},void 0,!1,void 0,this),O("div",{class:v?"md-reader-content":void 0,style:{fontSize:v?void 0:"13px",lineHeight:v?void 0:"1.55",opacity:m.text?1:0.4},children:F.get(L$)?O(s$,{children:[O(lq,{html:F.get(L$)??""},void 0,!1,void 0,this),m.status==="streaming"&&O("span",{class:"streaming-cursor"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O("div",{style:{color:"var(--c-muted)",fontStyle:"italic"},children:m.status==="streaming"?"Waiting for response…":m.text||"Empty response"},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},hq(m,L$),!0,void 0,this))},void 0,!1,void 0,this),O("div",{style:{flexShrink:0,borderTop:"1px solid var(--c-line)",marginTop:"4px",paddingTop:"6px"},children:[O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:W?"6px":0},children:[O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,color:K?"var(--c-accent)":G?"var(--c-warn)":W?"var(--c-ok)":"var(--c-muted)"},children:K?"Streaming…":G?"Sending…":W?"Answered":J},void 0,!1,void 0,this),O("span",{style:{fontSize:"10px",color:"var(--c-muted)"},children:[g.length," turn",g.length!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),W&&O("div",{class:"thread-reply-area",children:[O("textarea",{value:P,onInput:(m)=>q(m.target.value),onKeyDown:g$,placeholder:"Reply…",spellcheck:!1,rows:2,style:{width:"100%",resize:"none",background:"rgba(10,14,30,0.4)",border:"1px solid var(--c-line)",borderRadius:"var(--radius-sm)",color:"var(--c-text)",fontFamily:"var(--font)",fontSize:"12px",lineHeight:"1.5",padding:"6px 8px",outline:"none"}},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"4px"},children:[O("span",{style:{fontSize:"10px",color:"var(--c-muted)"},children:["⌘","+Enter"]},void 0,!0,void 0,this),O("button",{type:"button",onClick:u,disabled:!P.trim(),style:{padding:"3px 10px",fontSize:"11px",fontWeight:600,background:P.trim()?"var(--c-accent)":"var(--c-line)",color:P.trim()?"var(--c-contrast-fg)":"var(--c-muted)",border:"none",borderRadius:"var(--radius-sm)",cursor:P.trim()?"pointer":"default"},children:"Reply"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function xq($){return $.replace(/<script[\s>][\s\S]*?<\/script>/gi,"").replace(/<iframe[\s>][\s\S]*?<\/iframe>/gi,"").replace(/<object[\s>][\s\S]*?<\/object>/gi,"").replace(/<embed[\s>][\s\S]*?(?:\/>|<\/embed>)/gi,"").replace(/<link[\s>][\s\S]*?(?:\/>|<\/link>)/gi,"").replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,"").replace(/href\s*=\s*"javascript:[^"]*"/gi,'href="#"').replace(/href\s*=\s*'javascript:[^']*'/gi,"href='#'")}function pq({html:$}){let v=y(null);return c(()=>{let g=v.current;if(!g)return;if(g.replaceChildren(),!$)return;let _=document.createElement("template");_.innerHTML=$,g.append(_.content.cloneNode(!0))},[$]),O("div",{ref:v},void 0,!1,void 0,this)}function E0({node:$,expanded:v=!1}){let g=$.data.content||"",_=$.data.status||"streaming",[U,z]=x(""),J=_==="streaming",b=_==="complete";c(()=>{if(!g){z("");return}let K=!1;return z6(g).then((W)=>{if(!K)z(xq(W))}),()=>{K=!0}},[g]);let G=Q(()=>{QU("",{x:$.position.x,y:$.position.y+$.size.height+24},$.id)},[$]);return O("div",{class:"response-node-inner",style:{display:"flex",flexDirection:"column",height:"100%"},children:[J&&O("div",{class:"response-streaming-bar",style:{height:"2px",background:"linear-gradient(90deg, transparent, var(--c-accent), transparent)",animation:"response-stream-pulse 1.5s ease-in-out infinite",borderRadius:"1px",marginBottom:"4px",flexShrink:0}},void 0,!1,void 0,this),O("div",{class:v?"md-reader":void 0,style:{flex:1,overflow:"auto",minHeight:0,opacity:g?1:0.4,transition:"opacity 0.2s ease"},children:U?O("div",{class:v?"md-reader-content":void 0,children:O(pq,{html:U},void 0,!1,void 0,this)},void 0,!1,void 0,this):O("div",{style:{color:"var(--c-muted)",fontStyle:"italic",fontSize:"13px"},children:J?"Waiting for response…":"Empty response"},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",paddingTop:"6px",borderTop:"1px solid var(--c-line)",marginTop:"4px",flexShrink:0},children:[O("span",{style:{fontSize:"10px",textTransform:"uppercase",fontWeight:600,color:J?"var(--c-accent)":b?"var(--c-ok)":"var(--c-muted)"},children:J?"Streaming…":b?"Complete":_},void 0,!1,void 0,this),b&&O("button",{type:"button",onClick:G,style:{padding:"3px 10px",fontSize:"11px",background:"rgba(70,182,255,0.1)",border:"1px solid rgba(70,182,255,0.3)",borderRadius:"var(--radius-sm)",color:"var(--c-accent)",cursor:"pointer"},children:"Reply"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function mW($){return{toolName:$.toolName||$.title||"unknown",category:$.category||"other",status:$.status||"running",duration:$.duration||"",resultSummary:$.resultSummary||$.content||"",error:$.error||""}}var iW={mcp:"var(--c-accent)",file:"var(--c-warn)",subagent:"var(--c-purple)",other:"var(--c-muted)"},oq={running:"⠋",success:"✓",failed:"✕"},nq={running:"var(--c-accent)",success:"var(--c-ok)",failed:"var(--c-danger)"};function c0({node:$}){let{toolName:v,category:g,status:_,duration:U,resultSummary:z,error:J}=mW($.data),b=iW[g]??iW.other,G=oq[_]??"◌",K=nq[_]??"var(--c-muted)",W=_==="running",B=J?J.slice(0,30):z.length>30?`${z.slice(0,28)}…`:z;return O("div",{style:{display:"flex",alignItems:"center",gap:"8px",padding:"0 12px",height:"100%",overflow:"hidden"},children:[O("span",{style:{fontSize:"14px",color:K,flexShrink:0,animation:W?"pulse 1.5s infinite":"none"},children:G},void 0,!1,void 0,this),O("div",{style:{flex:1,minWidth:0,overflow:"hidden"},children:[O("div",{style:{fontFamily:"var(--mono)",fontSize:"11px",fontWeight:600,color:b,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:v},void 0,!1,void 0,this),B&&O("div",{style:{fontSize:"10px",color:J?"var(--c-danger)":"var(--c-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",lineHeight:1.3},children:B},void 0,!1,void 0,this)]},void 0,!0,void 0,this),U&&O("span",{style:{fontSize:"9px",padding:"1px 5px",borderRadius:"3px",background:"rgba(255,255,255,0.06)",color:"var(--c-muted)",flexShrink:0,whiteSpace:"nowrap"},children:U},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KG($){let v=T.value.get($);if(!v||v.dockPosition!==null)return null;return{left:v.position.x,top:v.position.y,width:v.size.width,height:v.size.height}}function tq($){let v=$.map((G)=>KG(G)).filter((G)=>G!==null);if(v.length===0)return null;let g=Math.min(...v.map((G)=>G.left)),_=Math.min(...v.map((G)=>G.top)),U=Math.max(...v.map((G)=>G.left+G.width)),z=Math.max(...v.map((G)=>G.top+G.height)),J=54,b=46;return{left:g-J,top:_-b,width:U-g+J*2,height:z-_+b*2}}function GG($,v){return{left:`${$.left}px`,top:`${$.top}px`,width:`${$.width}px`,height:`${$.height}px`,borderRadius:`${v}px`}}function lW(){let $=Array.from(I4.value),v=Array.from(L4.value),g=J_.value;if($.length===0&&v.length===0)return null;return O("div",{class:"attention-field-layer","aria-hidden":"true",children:[g.map((_)=>{let U=tq(_.nodeIds);if(!U)return null;return O("div",{class:"attention-field-region",style:GG(U,42)},_.id,!1,void 0,this)}),v.map((_)=>{let U=KG(_);if(!U)return null;return O("div",{class:"attention-field-node attention-field-secondary",style:GG({left:U.left-18,top:U.top-18,width:U.width+36,height:U.height+36},28)},`secondary-${_}`,!1,void 0,this)}),$.map((_)=>{let U=KG(_);if(!U)return null;return O("div",{class:"attention-field-node attention-field-primary",style:GG({left:U.left-24,top:U.top-24,width:U.width+48,height:U.height+48},30)},`primary-${_}`,!1,void 0,this)})]},void 0,!0,void 0,this)}var Lv=W$(new Map),LU=W$(null),dq=480,aq=320,jg=new Map,P6=null;function WG($){Lv.value=$,eq()}function BG($){let v=jg.get($);if(v)clearTimeout(v),jg.delete($)}function hW($){BG($.id);let v=new Map(Lv.value);v.set($.id,{...$,phase:"forming"}),WG(v)}function sq($){if(BG($),!Lv.value.has($))return;let v=new Map(Lv.value);v.delete($),WG(v)}function xW($,v,g,_){let U=Lv.value.get($);if(!U||U.phase===v)return;let z=new Map(Lv.value);z.set($,{...U,phase:v,..._?{settledNodeId:_}:{}}),WG(z),BG($),jg.set($,setTimeout(()=>sq($),g))}function pW($,v){xW($,"settling",dq,v)}function PG($){xW($,"dissolving",aq)}function oW(){for(let $ of jg.values())clearTimeout($);if(jg.clear(),P6)clearInterval(P6),P6=null;LU.value=null,Lv.value=new Map}function eq(){if(P6||Lv.value.size===0)return;P6=setInterval(()=>{let $=Date.now();for(let v of Lv.value.values())if(v.phase==="forming"&&v.expiresAt<=$)PG(v.id);if(Lv.value.size===0&&P6)clearInterval(P6),P6=null},1000),P6.unref?.()}var $X={fill:"none",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"};function F$({size:$=16,children:v,...g}){return O("svg",{width:$,height:$,viewBox:"0 0 16 16",...$X,...g,children:v},void 0,!1,void 0,this)}function dW($){return O(F$,{...$,children:[O("polyline",{points:"1 5 1 1 5 1"},void 0,!1,void 0,this),O("polyline",{points:"11 1 15 1 15 5"},void 0,!1,void 0,this),O("polyline",{points:"15 11 15 15 11 15"},void 0,!1,void 0,this),O("polyline",{points:"5 15 1 15 1 11"},void 0,!1,void 0,this),O("rect",{x:"4",y:"4",width:"8",height:"8",rx:"1"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function aW($){return O(F$,{...$,children:[O("rect",{x:"2",y:"2",width:"12",height:"12",rx:"2"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"4.5",x2:"8",y2:"6.5"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"9.5",x2:"8",y2:"11.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"8",x2:"6.5",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"9.5",y1:"8",x2:"11.5",y2:"8"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function sW($){return O(F$,{...$,children:[O("circle",{cx:"7",cy:"7",r:"4.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"10.5",x2:"14.5",y2:"14.5"},void 0,!1,void 0,this),O("line",{x1:"5",y1:"7",x2:"9",y2:"7"},void 0,!1,void 0,this),O("line",{x1:"7",y1:"5",x2:"7",y2:"9"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function eW($){return O(F$,{...$,children:[O("circle",{cx:"7",cy:"7",r:"4.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"10.5",x2:"14.5",y2:"14.5"},void 0,!1,void 0,this),O("line",{x1:"5",y1:"7",x2:"9",y2:"7"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function $B($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"4",x2:"9.5",y2:"4"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"12",x2:"9.5",y2:"12"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"6.5",x2:"4",y2:"9.5"},void 0,!1,void 0,this),O("line",{x1:"12",y1:"6.5",x2:"12",y2:"9.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function vB($){return O(F$,{...$,children:[O("rect",{x:"1",y:"2",width:"14",height:"12",rx:"1.5"},void 0,!1,void 0,this),O("rect",{x:"8",y:"7",width:"6",height:"6",rx:"1",fill:"currentColor","fill-opacity":"0.2"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UB($){return O(F$,{...$,children:[O("circle",{cx:"8",cy:"8",r:"3"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"1",x2:"8",y2:"3"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"13",x2:"8",y2:"15"},void 0,!1,void 0,this),O("line",{x1:"1",y1:"8",x2:"3",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"13",y1:"8",x2:"15",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"3.05",y1:"3.05",x2:"4.46",y2:"4.46"},void 0,!1,void 0,this),O("line",{x1:"11.54",y1:"11.54",x2:"12.95",y2:"12.95"},void 0,!1,void 0,this),O("line",{x1:"3.05",y1:"12.95",x2:"4.46",y2:"11.54"},void 0,!1,void 0,this),O("line",{x1:"11.54",y1:"4.46",x2:"12.95",y2:"3.05"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function gB($){return O(F$,{...$,children:O("path",{d:"M13 9.5A5.5 5.5 0 1 1 6.5 3 4.5 4.5 0 0 0 13 9.5Z"},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function _B($){return O(F$,{...$,children:[O("path",{d:"M3 13l2.8-.7L13 5.1 10.9 3 3.7 10.2 3 13Z"},void 0,!1,void 0,this),O("path",{d:"M9.8 4.1l2.1 2.1"},void 0,!1,void 0,this),O("path",{d:"M2.5 14h11"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function zB($){return O(F$,{...$,children:[O("path",{d:"M3 10.5 8.5 5a2 2 0 0 1 2.8 0l1.7 1.7a2 2 0 0 1 0 2.8L8.5 14H5.8L3 11.2Z"},void 0,!1,void 0,this),O("path",{d:"M7.5 6 12 10.5"},void 0,!1,void 0,this),O("path",{d:"M8.5 14H14"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JB($){return O(F$,{...$,children:[O("path",{d:"M3 4h10"},void 0,!1,void 0,this),O("path",{d:"M8 4v8"},void 0,!1,void 0,this),O("path",{d:"M6 12h4"},void 0,!1,void 0,this),O("path",{d:"M4.5 4 4 6"},void 0,!1,void 0,this),O("path",{d:"M11.5 4 12 6"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function bB($){return O(F$,{...$,children:[O("rect",{x:"1",y:"4",width:"14",height:"10",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M5.5 4 L6.5 2.5 H9.5 L10.5 4"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"9",r:"2.3"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function OB($){return O(F$,{...$,children:[O("circle",{cx:"8",cy:"8",r:"6"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"3"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"0.8",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GB($){return O(F$,{...$,children:[O("circle",{cx:"8",cy:"8",r:"6"},void 0,!1,void 0,this),O("line",{x1:"5.5",y1:"5.5",x2:"10.5",y2:"10.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"5.5",x2:"5.5",y2:"10.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KB($){return O(F$,{...$,children:[O("circle",{cx:"7",cy:"7",r:"4.5"},void 0,!1,void 0,this),O("line",{x1:"10.5",y1:"10.5",x2:"14.5",y2:"14.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function WB($){return O(F$,{...$,children:[O("rect",{x:"1",y:"3",width:"14",height:"10",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"6",x2:"5",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"7.5",y1:"6",x2:"8.5",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"11",y1:"6",x2:"12",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"10",x2:"12",y2:"10"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BB({size:$=22,class:v}){return O("svg",{width:$,height:$,viewBox:"0 0 64 64",xmlns:"http://www.w3.org/2000/svg",class:v,"aria-hidden":"true",children:[O("rect",{x:"8",y:"8",width:"48",height:"48",rx:"7",fill:"none",stroke:"currentColor","stroke-width":"2.2",opacity:"0.35"},void 0,!1,void 0,this),O("rect",{x:"16",y:"16",width:"32",height:"32",rx:"5",fill:"none",stroke:"currentColor","stroke-width":"2.2",opacity:"0.6"},void 0,!1,void 0,this),O("rect",{x:"24",y:"24",width:"16",height:"16",rx:"3",fill:"none",stroke:"currentColor","stroke-width":"2.2"},void 0,!1,void 0,this),O("rect",{x:"29",y:"29",width:"6",height:"6",rx:"1",fill:"currentColor"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function nW($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"6",x2:"10",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"8.5",x2:"8",y2:"8.5"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"11",x2:"11",y2:"11"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function vX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"9",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M4 13.5 L5.5 11.5 L8 11.5"},void 0,!1,void 0,this),O("polyline",{points:"5 6 7 8 5 10"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"10",x2:"11",y2:"10"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function UX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"9",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M12 13.5 L10.5 11.5 L8 11.5"},void 0,!1,void 0,this),O("circle",{cx:"5",cy:"7",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"7",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"11",cy:"7",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function gX($){return O(F$,{...$,children:[O("path",{d:"M3 1.5h6l3.5 3.5v8a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V2.5a1 1 0 0 1 1-1z"},void 0,!1,void 0,this),O("polyline",{points:"9 1.5 9 5 12.5 5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"8.5",x2:"10.5",y2:"8.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"11",x2:"9",y2:"11"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function _X($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("circle",{cx:"5.5",cy:"6.5",r:"1.2"},void 0,!1,void 0,this),O("path",{d:"M1.8 12 L6 8.5 L9 11 L11.5 9 L14.2 12"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function tW($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"1.5",y1:"5.5",x2:"14.5",y2:"5.5"},void 0,!1,void 0,this),O("circle",{cx:"3.3",cy:"4",r:"0.5",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"5",cy:"4",r:"0.5",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"6.7",cy:"4",r:"0.5",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"8",x2:"12",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"4",y1:"10",x2:"10",y2:"10"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function zX($){return O(F$,{...$,children:[O("rect",{x:"2",y:"4",width:"12",height:"10",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"2",y1:"6.5",x2:"14",y2:"6.5"},void 0,!1,void 0,this),O("path",{d:"M11 1.5 L11 4"},void 0,!1,void 0,this),O("circle",{cx:"11",cy:"4",r:"1.6",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"1.5","stroke-dasharray":"2 1.5"},void 0,!1,void 0,this),O("rect",{x:"4",y:"4",width:"3.5",height:"3.5",rx:"0.6"},void 0,!1,void 0,this),O("rect",{x:"8.5",y:"4",width:"3.5",height:"3.5",rx:"0.6"},void 0,!1,void 0,this),O("rect",{x:"6.25",y:"8.5",width:"3.5",height:"3.5",rx:"0.6"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function bX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("circle",{cx:"4.5",cy:"8",r:"1.1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"6.5",x2:"12.5",y2:"6.5"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"8",x2:"11",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"9.5",x2:"12",y2:"9.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function OX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M3.5 10.5 L6 6.5 L8.5 9.5 L12.5 5"},void 0,!1,void 0,this),O("circle",{cx:"12.5",cy:"5",r:"0.9",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function GX($){return O(F$,{...$,children:[O("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"5.5",x2:"11.5",y2:"5.5"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"8",x2:"11.5",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"4.5",y1:"10.5",x2:"8",y2:"10.5"},void 0,!1,void 0,this),O("line",{x1:"6.5",y1:"2",x2:"6.5",y2:"14",opacity:"0.45"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function KX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"1.5",width:"13",height:"13",rx:"2"},void 0,!1,void 0,this),O("path",{d:"M4 11 L4 6 L6 8.5 L8 6 L8 11"},void 0,!1,void 0,this),O("path",{d:"M10 11 L10 6 L12.5 11 L12.5 6"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function WX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("polyline",{points:"10 5 13 5 13 8"},void 0,!1,void 0,this),O("line",{x1:"13",y1:"5",x2:"8",y2:"10"},void 0,!1,void 0,this),O("path",{d:"M6 6 L3.5 6 L3.5 11.5 L10 11.5 L10 9"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function BX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("path",{d:"M7 5.5 C 5.5 5.5 5.5 8 4 8 C 5.5 8 5.5 10.5 7 10.5"},void 0,!1,void 0,this),O("path",{d:"M9 5.5 C 10.5 5.5 10.5 8 12 8 C 10.5 8 10.5 10.5 9 10.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function PX($){return O(F$,{...$,children:[O("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1.5"},void 0,!1,void 0,this),O("line",{x1:"5.2",y1:"6",x2:"8",y2:"8"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"8",x2:"10.8",y2:"6"},void 0,!1,void 0,this),O("line",{x1:"8",y1:"8",x2:"8",y2:"11"},void 0,!1,void 0,this),O("circle",{cx:"5.2",cy:"6",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"10.8",cy:"6",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"8",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this),O("circle",{cx:"8",cy:"11",r:"1",fill:"currentColor",stroke:"none"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function Vg($){switch($){case"markdown":return nW;case"prompt":return vX;case"response":return UX;case"file":return gX;case"image":return _X;case"webpage":return tW;case"context":return zX;case"group":return JX;case"status":return bX;case"trace":return OX;case"ledger":return GX;case"mcp-app":return KX;case"ext-app":return WX;case"json-render":return BX;case"graph":return PX;case"html":return tW;default:return nW}}var PB={width:260,height:150},kX={markdown:{width:300,height:170},status:{width:280,height:110},context:{width:300,height:200},trace:{width:220,height:64},file:{width:300,height:190},image:{width:260,height:200},webpage:{width:320,height:210},html:{width:320,height:210},group:{width:340,height:210},graph:{width:320,height:210},"json-render":{width:320,height:210},"mcp-app":{width:340,height:230}};function HG($){return!!$&&$ in e$}function k6($){if(!$)return null;let v=T.value.get($);if(!v||v.dockPosition!==null)return null;return{left:v.position.x,top:v.position.y,width:v.size.width,height:v.size.height}}function kG($){return{x:$.left+$.width/2,y:$.top+$.height/2}}function Cg($){if(typeof $.confidence!=="number")return 0.82;return 0.4+Math.max(0,Math.min(1,$.confidence))*0.55}function kB($,v){let g=Math.max(40,Math.abs(v.x-$.x)/2);return`M ${$.x} ${$.y} C ${$.x+g} ${$.y}, ${v.x-g} ${v.y}, ${v.x} ${v.y}`}function IG({intent:$}){let v=HG($.nodeType)?Vg($.nodeType):null,g=$.label||$.kind,_=typeof $.confidence==="number"?`${Math.round($.confidence*100)}%`:null;return O("div",{class:"intent-info",onMouseEnter:()=>LU.value=$.id,onMouseLeave:()=>{if(LU.value===$.id)LU.value=null},children:[O("div",{class:"intent-chip",children:[typeof $.seq==="number"&&O("span",{class:"intent-seq",children:$.seq},void 0,!1,void 0,this),v&&O("span",{class:"intent-chip-icon","aria-hidden":"true",children:O(v,{size:12},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"intent-chip-label",children:g},void 0,!1,void 0,this),_&&O("span",{class:"intent-confidence",children:_},void 0,!1,void 0,this),$.phase==="forming"&&O("button",{type:"button",class:"intent-veto",title:"Veto this move (Esc)","aria-label":"Veto this move",onClick:(U)=>{U.stopPropagation(),P2($)},children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),$.reason&&O("div",{class:"intent-reason",children:$.reason},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function HB({intent:$,rect:v}){let g=HG($.nodeType)?Vg($.nodeType):null,_=HG($.nodeType)?e$[$.nodeType]:"Node";return O("div",{class:`intent-ghost intent-ghost-box is-${$.phase}`,"data-intent-id":$.id,style:{left:`${v.left}px`,top:`${v.top}px`,width:`${v.width}px`,height:`${v.height}px`,opacity:Cg($)},children:[O("div",{class:"intent-ghost-titlebar",children:[O("span",{class:"intent-ghost-icon","aria-hidden":"true",children:g?O(g,{size:13},void 0,!1,void 0,this):"◇"},void 0,!1,void 0,this),O("span",{class:"intent-ghost-badge",children:_},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(IG,{intent:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function IB({intent:$,rect:v,variant:g}){return O("div",{class:`intent-ghost intent-ghost-${g} is-${$.phase}`,"data-intent-id":$.id,style:{left:`${v.left}px`,top:`${v.top}px`,width:`${v.width}px`,height:`${v.height}px`,opacity:Cg($)},children:[g==="edit"&&O("div",{class:"intent-edit-bar"},void 0,!1,void 0,this),O(IG,{intent:$},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function HX($){let v=$.phase==="settling"?k6($.settledNodeId):null;switch($.kind){case"create":{if(!$.position)return null;let g=$.nodeType&&kX[$.nodeType]||PB,_=v??{left:$.position.x,top:$.position.y,...g};return O(HB,{intent:$,rect:_},$.id,!1,void 0,this)}case"move":{if(!$.position)return null;let _=k6($.nodeId)??PB,U=v??{left:$.position.x,top:$.position.y,width:_.width,height:_.height};return O(HB,{intent:$,rect:U},$.id,!1,void 0,this)}case"remove":{let g=v??k6($.nodeId);if(!g)return null;return O(IB,{intent:$,rect:g,variant:"remove"},$.id,!1,void 0,this)}case"edit":{let g=v??k6($.nodeId);if(!g)return null;return O(IB,{intent:$,rect:g,variant:"edit"},$.id,!1,void 0,this)}case"connect":{if(!$.edge)return null;let g=k6($.edge.from),_=k6($.edge.to);if(!g||!_)return null;let U={x:(g.left+g.width/2+_.left+_.width/2)/2,y:(g.top+g.height/2+_.top+_.height/2)/2},z={left:U.x-110,top:U.y-18,width:220,height:36};return O("div",{class:`intent-ghost intent-ghost-connect is-${$.phase}`,"data-intent-id":$.id,style:{left:`${z.left}px`,top:`${z.top}px`,width:`${z.width}px`,opacity:Cg($)},children:O(IG,{intent:$},void 0,!1,void 0,this)},$.id,!1,void 0,this)}default:return null}}function LB(){let $=Array.from(Lv.value.values());if(c(()=>{function v(g){if(g.key!=="Escape")return;let _=LU.value;if(!_)return;let U=Lv.value.get(_);if(!U||U.phase!=="forming")return;g.stopImmediatePropagation(),g.preventDefault(),P2(U)}return window.addEventListener("keydown",v,!0),()=>window.removeEventListener("keydown",v,!0)},[]),$.length===0)return null;return O("div",{class:"intent-layer",children:[O("svg",{class:"intent-line-layer",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"visible",pointerEvents:"none"},children:[O("defs",{children:O("marker",{id:"intent-arrow",markerWidth:"8",markerHeight:"8",refX:"6",refY:"3",orient:"auto",children:O("path",{d:"M0,0 L6,3 L0,6 Z",class:"intent-arrow-head"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),$.map((v)=>{if(v.kind==="connect"&&v.edge){let g=k6(v.edge.from),_=k6(v.edge.to);if(!g||!_)return null;return O("path",{d:kB(kG(g),kG(_)),class:`intent-edge type-${v.edge.type}`,style:{opacity:Cg(v)}},`line-${v.id}`,!1,void 0,this)}if(v.kind==="move"&&v.position){let g=k6(v.nodeId);if(!g)return null;let _=g,U={x:v.position.x+_.width/2,y:v.position.y+_.height/2};return O("path",{d:kB(kG(g),U),class:"intent-trail",markerEnd:"url(#intent-arrow)",style:{opacity:Cg(v)}},`line-${v.id}`,!1,void 0,this)}return null})]},void 0,!0,void 0,this),$.map(HX)]},void 0,!0,void 0,this)}var FU=8,J4=W$(null),YU=[],qU=[],qB=null;function FB($){let v=$?.data.parentGroup;return typeof v==="string"&&v.length>0?v:null}function YB($){if(!$||!Array.isArray($.data.children))return[];return $.data.children.filter((v)=>typeof v==="string")}function IX($,v){let g=new Map(v.map((b)=>[b.id,b])),_=new Set([$]),U=g.get($);if(!U)return _;let z=FB(U);while(z&&!_.has(z))_.add(z),z=FB(g.get(z));if(U.type!=="group")return _;let J=[...YB(U)];while(J.length>0){let b=J.pop();if(!b||_.has(b))continue;_.add(b);let G=g.get(b);if(G?.type==="group")J.push(...YB(G))}return _}function XB($,v){YU=[],qU=[],qB=$;let g=Array.from(v),_=IX($,g);for(let U of g){if(_.has(U.id)||U.dockPosition!==null)continue;let z=U.position.x,J=U.position.x+U.size.width,b=U.position.x+U.size.width/2,G=U.position.y,K=U.position.y+U.size.height,W=U.position.y+U.size.height/2;YU.push({val:z,minY:G,maxY:K}),YU.push({val:J,minY:G,maxY:K}),YU.push({val:b,minY:G,maxY:K}),qU.push({val:G,minX:z,maxX:J}),qU.push({val:K,minX:z,maxX:J}),qU.push({val:W,minX:z,maxX:J})}}function AB(){YU=[],qU=[],qB=null}function wB($,v,g,_){let U=[$,$+g/2,$+g],z=[v,v+_/2,v+_],J=[0,g/2,g],b=[0,_/2,_],G=null,K=FU+1,W=null;for(let L=0;L<3;L++){let H=U[L];for(let F of YU){let Y=Math.abs(H-F.val);if(Y<K)K=Y,G=F.val-J[L],W={axis:"x",pos:F.val,from:Math.min(F.minY,v),to:Math.max(F.maxY,v+_)}}}let B=null,k=FU+1,P=null;for(let L=0;L<3;L++){let H=z[L];for(let F of qU){let Y=Math.abs(H-F.val);if(Y<k)k=Y,B=F.val-b[L],P={axis:"y",pos:F.val,from:Math.min(F.minX,$),to:Math.max(F.maxX,$+g)}}}let q=[];if(W&&K<=FU)q.push(W);if(P&&k<=FU)q.push(P);return{x:G!==null&&K<=FU?G:$,y:B!==null&&k<=FU?B:v,guides:q}}function ZB({nodeId:$,viewport:v,onMove:g,onDragEnd:_}){let U=y(!1),z=y({x:0,y:0}),J=y({x:0,y:0});return Q((G,K,W)=>{G.stopPropagation(),G.preventDefault(),U.current=!0,document.documentElement.classList.add("is-node-dragging"),window.getSelection()?.removeAllRanges(),z.current={x:G.clientX,y:G.clientY},J.current={x:K,y:W};let B=null,k=null,P=()=>{if(k=null,!U.current||!B)return;let H=B;B=null;let F=v.value.scale,Y=(H.x-z.current.x)/F,A=(H.y-z.current.y)/F;g($,J.current.x+Y,J.current.y+A)},q=(H)=>{if(!U.current)return;if(B={x:H.clientX,y:H.clientY},k!==null)return;k=window.requestAnimationFrame(P)},L=()=>{if(k!==null)window.cancelAnimationFrame(k),P();U.current=!1,document.documentElement.classList.remove("is-node-dragging"),document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",L),document.removeEventListener("pointercancel",L),_()};document.addEventListener("pointermove",q),document.addEventListener("pointerup",L),document.addEventListener("pointercancel",L)},[$,v,g,_])}var LX=200,FX=100;function SB({nodeId:$,viewport:v,onResize:g,onResizeEnd:_}){let U=y(!1),z=y({x:0,y:0}),J=y({w:0,h:0});return Q((G,K,W)=>{G.stopPropagation(),G.preventDefault(),U.current=!0,z.current={x:G.clientX,y:G.clientY},J.current={w:K,h:W},document.documentElement.classList.add("is-node-resizing");let B=null,k=null,P=()=>{if(k=null,!U.current||!B)return;let H=B;B=null;let F=v.value.scale,Y=(H.x-z.current.x)/F,A=(H.y-z.current.y)/F;g($,Math.max(LX,J.current.w+Y),Math.max(FX,J.current.h+A))},q=(H)=>{if(!U.current)return;if(B={x:H.clientX,y:H.clientY},k!==null)return;k=window.requestAnimationFrame(P)},L=()=>{if(k!==null)window.cancelAnimationFrame(k),P();U.current=!1,document.documentElement.classList.remove("is-node-resizing"),document.removeEventListener("pointermove",q),document.removeEventListener("pointerup",L),document.removeEventListener("pointercancel",L),_()};document.addEventListener("pointermove",q),document.addEventListener("pointerup",L),document.addEventListener("pointercancel",L)},[$,v,g,_])}function MB({node:$,children:v,onContextMenu:g}){let _=R$.value===$.id,U=h$.value.has($.id),z=D$.value.has($.id),J=I4.value.has($.id),b=!J&&L4.value.has($.id),G=b_.value.has($.id),K=!_&&C3.value.has($.id),W=A6.value,B=W!==null&&W.has($.id),k=W!==null&&!W.has($.id),[P,q]=x(!1),L=y(null),H=Q((E,e,G$)=>{let J$=wB(e,G$,$.size.width,$.size.height),i$=T.value.get(E);if(i$?.position.x===J$.x&&i$.position.y===J$.y){J4.value=J$.guides.length>0?J$.guides:null;return}Pv(E,{position:{x:J$.x,y:J$.y}}),J4.value=J$.guides.length>0?J$.guides:null},[$.size.width,$.size.height]),F=Q(()=>{AB(),J4.value=null,d$()},[]),Y=ZB({nodeId:$.id,viewport:P$,onMove:H,onDragEnd:F}),A=Q((E,e,G$)=>{let J$=T.value.get(E);if(J$?.size.width===e&&J$.size.height===G$)return;Pv(E,{size:{width:e,height:G$}})},[]),M=Q(()=>{U$($.id,{userResized:!0}),Zv($.id,{data:{userResized:!0}}),d$()},[$.id]),V=SB({nodeId:$.id,viewport:P$,onResize:A,onResizeEnd:M}),f=Q((E)=>{if(P)return;w6($.id),XB($.id,T.value.values()),Y(E,$.position.x,$.position.y)},[$.id,$.position.x,$.position.y,Y,P]),N=Q((E)=>{if(E.stopPropagation(),E.shiftKey){f3($.id);return}w6($.id)},[$.id]),t=Q((E)=>{if(g)g(E,$.id)},[g,$.id]),d=Q((E)=>{E.stopPropagation(),q(!0),requestAnimationFrame(()=>L.current?.focus())},[]),u=$.data.title||e$[$.type],r=Q((E)=>{let e=E.trim();if(e&&e!==u)U$($.id,{title:e}),Zv($.id,{title:e});q(!1)},[$.id,u]),g$=y(null),p=y(!1),m=y(null);c(()=>{if(p.current||!i2($))return;let E=g$.current;if(!E)return;let e=new ResizeObserver(()=>{if(p.current){e.disconnect();return}let G$=E.scrollHeight,J$=v5($,G$);if(J$===null)return;if(Math.abs(J$-$.size.height)>8){if(Z4($.id,{width:$.size.width,height:J$}),m.current!==null)window.clearTimeout(m.current);m.current=window.setTimeout(()=>{d$({recordHistory:!1}),m.current=null},0)}p.current=!0,e.disconnect()});return e.observe(E),()=>{if(e.disconnect(),m.current!==null)window.clearTimeout(m.current),m.current=null}},[$.id,$.type,$.data.mode,$.data.strictSize,$.collapsed,$.dockPosition,$.size.width,$.size.height]);let L$=$.pinned,Y$=$.type==="trace",n$=Y$&&$.data.status==="running",S=$.type==="group",i=$.data.strictSize===!0,$$=Math.max(P$.value.scale,0.01),a=$$<1?Math.min(2.2,1/$$):1,n=S&&$.data.color?$.data.color:void 0,z$={left:`${$.position.x}px`,top:`${$.position.y}px`,width:`${$.size.width}px`,height:$.collapsed?"auto":`${$.size.height}px`,zIndex:$.zIndex,"--node-chrome-scale":a.toFixed(3),...n?{"--group-color":n}:{}},s=["canvas-node",_?"active":"",K?"neighbor":"",B?"search-match":"",k?"search-dimmed":"",U?"selected":"",z?"context-pinned":"",J?"attention-focus-primary":"",b?"attention-focus-secondary":"",G?"attention-pulse":"",L$?"pinned":"",Y$?"trace-node":"",n$?"trace-running":"",S?"group-node":"",i?"strict-size":""].filter(Boolean).join(" ");return O("div",{class:s,style:z$,onPointerDown:N,onContextMenu:t,children:[O("div",{class:"node-titlebar",onPointerDown:f,children:[O("span",{class:"node-type-icon","aria-hidden":"true",children:(()=>{let E=Vg($.type);return O(E,{size:Math.round(14*a)},void 0,!1,void 0,this)})()},void 0,!1,void 0,this),O("span",{class:"node-type-badge",children:e$[$.type]},void 0,!1,void 0,this),P?O("input",{ref:L,class:"node-title-input",value:u,onBlur:(E)=>r(E.target.value),onKeyDown:(E)=>{if(E.key==="Enter")r(E.target.value);if(E.key==="Escape")q(!1)},onClick:(E)=>E.stopPropagation()},void 0,!1,void 0,this):O("span",{class:"node-title",onDblClick:d,title:"Double-click to rename",children:u},void 0,!1,void 0,this),O("div",{class:"node-controls",children:[L$&&O("span",{class:"pin-indicator",title:"Pinned",children:"⊙"},void 0,!1,void 0,this),O("button",{type:"button",class:`ctx-pin-btn${z?" ctx-pin-active":""}`,onClick:(E)=>{E.stopPropagation(),A4($.id)},title:z?"Remove from context":"Add to context",children:"✦"},void 0,!1,void 0,this),V0($)&&O("button",{type:"button",onClick:(E)=>{E.stopPropagation(),C0($)},title:"Open as site",children:"↗"},void 0,!1,void 0,this),B_.has($.type)&&O("button",{type:"button",onClick:(E)=>{E.stopPropagation(),b6($.id)},title:"Expand (focus mode)",children:"⤢"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(E)=>{E.stopPropagation(),Z6($.id)},title:$.collapsed?"Expand":"Collapse",children:$.collapsed?"▸":"▾"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(E)=>{E.stopPropagation(),w4($.id),I_($.id)},title:"Close",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!$.collapsed&&O("div",{ref:g$,class:"node-body",children:v},void 0,!1,void 0,this),!$.collapsed&&O("div",{class:"node-resize-handle",onPointerDown:(E)=>V(E,$.size.width,$.size.height)},void 0,!1,void 0,this),["top","right","bottom","left"].map((E)=>O("div",{class:`node-port node-port-${E}`,onPointerDown:(e)=>{e.stopPropagation(),e.preventDefault();let G$=$.position.x+$.size.width/2,J$=$.position.y+$.size.height/2,i$=$.size.width/2,C$=$.size.height/2,Wv,Ov;switch(E){case"top":Wv=G$,Ov=J$-C$;break;case"bottom":Wv=G$,Ov=J$+C$;break;case"left":Wv=G$-i$,Ov=J$;break;case"right":Wv=G$+i$,Ov=J$;break}Rv.value={fromId:$.id,fromX:Wv,fromY:Ov,cursorX:Wv,cursorY:Ov}}},E,!1,void 0,this))]},void 0,!0,void 0,this)}var YX={relation:"var(--c-muted)","depends-on":"var(--c-warn)",flow:"var(--c-accent)",references:"var(--c-dim)"},qX=new Set(["depends-on","flow"]);function XX($){if($.style==="dashed")return"8 4";if($.style==="dotted")return"3 3";if($.type==="references"&&!$.style)return"8 4";return}function QB($,v){let g=$.position.x+$.size.width/2,_=$.position.y+$.size.height/2,U=v.position.x+v.size.width/2,z=v.position.y+v.size.height/2,J=U-g,b=z-_,G=$.size.width/2,K=$.size.height/2,W=Math.abs(b/(J||0.001)),B=K/(G||0.001);if(W>B){let P=b>0?1:-1;return{x:g+K/W*(J>0?1:-1),y:_+K*P}}let k=J>0?1:-1;return{x:g+G*k,y:_+W*G*(b>0?1:-1)}}function AX($,v,g,_,U,z,J,b){return{x:0.125*$+0.375*g+0.375*U+0.125*J,y:0.125*v+0.375*_+0.375*z+0.125*b}}function wX({edge:$,fromNode:v,toNode:g,focused:_,dimmed:U}){let z=QB(v,g),J=QB(g,v),b=J.x-z.x,G=J.y-z.y,K=Math.sqrt(b*b+G*G),W=Math.min(K*0.25,80),B=b/(K||1),k=G/(K||1),P=z.x+B*W,q=z.y+k*W,L=J.x-B*W,H=J.y-k*W,F=`M ${z.x} ${z.y} C ${P} ${q}, ${L} ${H}, ${J.x} ${J.y}`,Y=YX[$.type],A=qX.has($.type),M=XX($),V=$.label?AX(z.x,z.y,P,q,L,H,J.x,J.y):null,f=`edge-path-${$.id}`;return O("g",{children:[O("path",{d:F,fill:"none",stroke:"transparent","stroke-width":"12",style:{cursor:"pointer"}},void 0,!1,void 0,this),_&&O("path",{d:F,fill:"none",stroke:Y,"stroke-width":"6","stroke-dasharray":M,opacity:"0.15",style:{filter:"blur(3px)"}},void 0,!1,void 0,this),O("path",{id:f,d:F,fill:"none",stroke:Y,"stroke-width":_?2.5:1.5,"stroke-dasharray":M,"marker-end":A?"url(#edge-arrow)":void 0,opacity:U?0.2:_?1:0.75,style:{transition:"opacity 0.2s, stroke-width 0.2s"}},void 0,!1,void 0,this),$.animated&&O("circle",{r:"3",fill:Y,opacity:"0.9",children:O("animateMotion",{dur:"2s",repeatCount:"indefinite",children:O("mpath",{href:`#${f}`},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),V&&$.label&&O("g",{transform:`translate(${V.x}, ${V.y})`,children:[O("rect",{class:"edge-label-bg",x:-($.label.length*3.5+8),y:"-10",width:$.label.length*7+16,height:"20",rx:"4"},void 0,!1,void 0,this),O("text",{class:"edge-label","text-anchor":"middle","dominant-baseline":"central",fill:"var(--c-text)","font-size":"11",children:$.label},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function NB({nodes:$,edges:v}){let g=$.value,_=Array.from(v.value.values()),U=R$.value,z=U!==null,J=A6.value,b=J!==null;if(_.length===0)return null;let G=96,K=Array.from(g.values()),W=Math.min(...K.map((H)=>H.position.x))-G,B=Math.min(...K.map((H)=>H.position.y))-G,k=Math.max(...K.map((H)=>H.position.x+H.size.width))+G,P=Math.max(...K.map((H)=>H.position.y+H.size.height))+G,q=Math.max(1,k-W),L=Math.max(1,P-B);return O("svg",{"aria-label":"Canvas connections",role:"img",viewBox:`${W} ${B} ${q} ${L}`,width:q,height:L,style:{position:"absolute",top:`${B}px`,left:`${W}px`,pointerEvents:"none",overflow:"visible"},children:[O("title",{children:"Canvas connections"},void 0,!1,void 0,this),O("defs",{children:O("marker",{id:"edge-arrow",viewBox:"0 0 10 10",refX:"9",refY:"5",markerWidth:"8",markerHeight:"8",orient:"auto-start-reverse",children:O("path",{d:"M 0 1 L 10 5 L 0 9 z",fill:"currentColor",opacity:"0.75"},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),_.map((H)=>{let F=g.get(H.from),Y=g.get(H.to);if(!F||!Y)return null;let A=z&&(H.from===U||H.to===U),M=b&&!(J.has(H.from)||J.has(H.to));return O(wX,{edge:H,fromNode:F,toNode:Y,focused:A,dimmed:z&&!A||M},H.id,!1,void 0,this)}),Rv.value&&(()=>{let H=Rv.value,F=H.cursorX-H.fromX,Y=H.cursorY-H.fromY,A=Math.sqrt(F*F+Y*Y),M=Math.min(A*0.25,80),V=F/(A||1),f=Y/(A||1),N=`M ${H.fromX} ${H.fromY} C ${H.fromX+V*M} ${H.fromY+f*M}, ${H.cursorX-V*M} ${H.cursorY-f*M}, ${H.cursorX} ${H.cursorY}`;return O("g",{children:[O("path",{d:N,fill:"none",stroke:"var(--c-accent)","stroke-width":"6",opacity:"0.1",style:{filter:"blur(3px)"}},void 0,!1,void 0,this),O("path",{d:N,fill:"none",stroke:"var(--c-accent)","stroke-width":"2","stroke-dasharray":"6 4",opacity:"0.8"},void 0,!1,void 0,this),O("circle",{cx:H.cursorX,cy:H.cursorY,r:"5",fill:"var(--c-accent)",opacity:"0.5"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)})()]},void 0,!0,void 0,this)}function ZX($){let[v,...g]=$;if(!v)return"";return g.reduce((_,U)=>`${_} L ${U.x} ${U.y}`,`M ${v.x} ${v.y}`)}function LG({annotations:$}){if($.length===0)return null;return O("svg",{class:"annotation-layer","aria-hidden":"true",children:$.map((v)=>{let g=v.color==="currentColor"?"var(--c-annotation)":v.color;if(v.type==="text"){let _=v.points[0];if(!_||!v.text)return null;return O("text",{x:_.x,y:_.y,fill:g,"font-size":v.width,"font-family":"var(--font)","font-weight":"700",opacity:"0.95",children:v.text},v.id,!1,void 0,this)}return O("path",{d:ZX(v.points),fill:"none",stroke:g,"stroke-width":v.width,"stroke-linecap":"round","stroke-linejoin":"round",opacity:"0.9"},v.id,!1,void 0,this)})},void 0,!1,void 0,this)}var SX=0.1,MX=4,rB=1;function uB($){return Math.min(MX,Math.max(SX,$))}function yB({viewport:$,onViewportChange:v,onViewportCommit:g,disabled:_=!1}){let U=y(null),z=y(!1),J=y({x:0,y:0}),b=y(0),G=y(null),K=Q((H)=>{if(G.current!==null)window.clearTimeout(G.current);G.current=window.setTimeout(()=>{G.current=null,g(H)},140)},[g]),W=Q((H)=>{if(_)return;H.preventDefault();let F=$.value;if(H.ctrlKey||H.metaKey){let Y=U.current?.getBoundingClientRect();if(!Y)return;let A=H.clientX-Y.left,M=H.clientY-Y.top,V=-H.deltaY*0.002,f=uB(F.scale*(1+V)),N=f/F.scale,t={x:A-N*(A-F.x),y:M-N*(M-F.y),scale:f};v(t),K(t)}else{let Y={x:F.x-H.deltaX*rB,y:F.y-H.deltaY*rB,scale:F.scale};v(Y),K(Y)}},[_,$,v,K]),B=Q((H)=>{if(_)return;let F=U.current;if(!F||H.target!==F)return;z.current=!0,J.current={x:H.clientX,y:H.clientY},F.setPointerCapture(H.pointerId)},[_]),k=Q((H)=>{if(!z.current)return;if(_)return;let F=H.clientX-J.current.x,Y=H.clientY-J.current.y;J.current={x:H.clientX,y:H.clientY};let A=$.value;v({x:A.x+F,y:A.y+Y,scale:A.scale})},[_,$,v]),P=Q(()=>{if(z.current)g($.value);z.current=!1},[g,$]),q=Q((H)=>{if(_)return;if(H.touches.length!==2){b.current=0;return}H.preventDefault();let F=H.touches[0],Y=H.touches[1],A=Math.hypot(Y.clientX-F.clientX,Y.clientY-F.clientY),M=(F.clientX+Y.clientX)/2,V=(F.clientY+Y.clientY)/2;if(b.current>0){let f=$.value,N=U.current?.getBoundingClientRect();if(!N)return;let t=M-N.left,d=V-N.top,u=A/b.current,r=uB(f.scale*u),g$=r/f.scale,p={x:t-g$*(t-f.x),y:d-g$*(d-f.y),scale:r};v(p),K(p)}b.current=A},[_,$,v,K]),L=Q(()=>{if(G.current!==null)window.clearTimeout(G.current),G.current=null;g($.value),b.current=0},[g,$]);return c(()=>{let H=U.current;if(!H)return;return H.addEventListener("wheel",W,{passive:!1}),H.addEventListener("pointerdown",B),H.addEventListener("pointermove",k),H.addEventListener("pointerup",P),H.addEventListener("pointercancel",P),H.addEventListener("touchmove",q,{passive:!1}),H.addEventListener("touchend",L),()=>{if(G.current!==null)window.clearTimeout(G.current);H.removeEventListener("wheel",W),H.removeEventListener("pointerdown",B),H.removeEventListener("pointermove",k),H.removeEventListener("pointerup",P),H.removeEventListener("pointercancel",P),H.removeEventListener("touchmove",q),H.removeEventListener("touchend",L)}},[W,B,k,P,q,L]),U}function QX($){switch($.type){case"markdown":return O(f_,{node:$},void 0,!1,void 0,this);case"mcp-app":return O(m6,{node:$},void 0,!1,void 0,this);case"webpage":return O(j0,{node:$},void 0,!1,void 0,this);case"json-render":return O(m6,{node:$},void 0,!1,void 0,this);case"graph":return O(m6,{node:$},void 0,!1,void 0,this);case"prompt":return O(f0,{node:$},void 0,!1,void 0,this);case"response":return O(E0,{node:$},void 0,!1,void 0,this);case"status":return O(HU,{node:$},void 0,!1,void 0,this);case"context":return O(d6,{node:$},void 0,!1,void 0,this);case"ledger":return O(r4,{node:$},void 0,!1,void 0,this);case"trace":return O(c0,{node:$},void 0,!1,void 0,this);case"file":return O(R_,{node:$},void 0,!1,void 0,this);case"image":return O(T0,{node:$},void 0,!1,void 0,this);case"html":return O(Tg,{node:$},void 0,!1,void 0,this);case"group":return O(TW,{node:$},void 0,!1,void 0,this);default:return O("div",{children:"Unknown node type"},void 0,!1,void 0,this)}}function NX($,v,g){let _=g.x-v.x,U=g.y-v.y,z=_*_+U*U;if(z===0)return Math.hypot($.x-v.x,$.y-v.y);let J=Math.max(0,Math.min(1,(($.x-v.x)*_+($.y-v.y)*U)/z));return Math.hypot($.x-(v.x+J*_),$.y-(v.y+J*U))}function rX($,v,g){for(let _=$.length-1;_>=0;_--){let U=$[_];if(!U)continue;let z=g+U.width;if(v.x<U.bounds.x-z||v.x>U.bounds.x+U.bounds.width+z||v.y<U.bounds.y-z||v.y>U.bounds.y+U.bounds.height+z)continue;if(U.type==="text")return U;for(let J=1;J<U.points.length;J++){let b=U.points[J-1],G=U.points[J];if(b&&G&&NX(v,b,G)<=g+U.width/2)return U}}return null}var FG="currentColor",RB=4,DB=24,uX=14,yX=new Set(["png","jpg","jpeg","gif","svg","webp","bmp","ico","avif"]),RX=new Set(["md","mdx","markdown"]),TB={width:520,height:420};function DX($){let v=$.trim();if(!v||/\s/.test(v))return null;let g=/^[a-z][a-z0-9+.-]*:/i.test(v)?v:`https://${v}`;try{let _=new URL(g);if(_.protocol!=="http:"&&_.protocol!=="https:")return null;return _.toString()}catch{return null}}function YG($){let v=$.trim();if(!v)return[];let g=v.includes(`
226
+ `)?v.split(/\r?\n/):v.split(/\s+/),_=new Set,U=[];for(let z of g){let J=z.trim();if(!J||J.startsWith("#"))continue;let b=DX(J);if(!b||_.has(b))continue;_.add(b),U.push(b)}return U}function TX($){let v=YG($.getData("text/uri-list"));if(v.length>0)return v;return YG($.getData("text/plain"))}function jX($){if(!$)return!1;return $.types.includes("text/uri-list")||$.types.includes("text/plain")}function jB($){if(!($ instanceof HTMLElement))return!1;return Boolean($.closest('input, textarea, select, [contenteditable="true"], [contenteditable=""]'))}function VX($){let v=$.split(".").pop()?.toLowerCase()??"";if(yX.has(v))return"image";if(RX.has(v))return"markdown";return"file"}function CX($,v){let g=[],_=0;for(let U of $){if(U.dockPosition!==null)continue;if(v&&U.id===v)continue;if(U.type==="group")g.splice(_++,0,U);else g.push(U)}return g}function VB({onNodeContextMenu:$,onCanvasContextMenu:v,annotationMode:g=!1,annotationTool:_=null}){let U=P$.value,z=y(!1),J=y(!1),b=y([]),[G,K]=x(null),[W,B]=x(null),[k,P]=x(null),q=y(null),[L,H]=x(!1),F=y(0),Y=y(null),A=yB({viewport:P$,disabled:g,onViewportChange:(S)=>{if(z.current||g)return;M4(),o3(S)},onViewportCommit:(S)=>{if(z.current||g)return;M4(),t3(S)}}),M=Q((S)=>{q.current=S,P(S)},[]),V=Q(async(S,i,$$)=>{if(S.length===0)return;let{width:a,height:n}=TB,z$=24,s=Math.ceil(Math.sqrt(S.length)),E=Math.ceil(S.length/s),e=s*a+Math.max(0,s-1)*z$,G$=E*n+Math.max(0,E-1)*z$;for(let J$=0;J$<S.length;J$++){let i$=J$%s,C$=Math.floor(J$/s),Wv=i-e/2+i$*(a+z$),Ov=$$-G$/2+C$*(n+z$);await hv({type:"webpage",content:S[J$],x:Wv,y:Ov,width:a,height:n})}},[]),f=Q((S)=>{let i=A.current;if(!i)return;if(_==="eraser"){if((S.target instanceof Element?S.target:null)?.closest(".hud-layer, .snapshot-panel, .context-menu, .command-palette"))return;S.preventDefault(),S.stopPropagation();let E=i.getBoundingClientRect(),e=P$.value,G$={x:(S.clientX-E.left-e.x)/e.scale,y:(S.clientY-E.top-e.y)/e.scale},J$=rX(Array.from(q4.value.values()),G$,uX/e.scale);if(J$)x3(J$.id);return}if(_==="text"){if((S.target instanceof Element?S.target:null)?.closest(".hud-layer, .snapshot-panel, .context-menu, .command-palette"))return;S.preventDefault(),S.stopPropagation(),R$.value=null,fv();let E=i.getBoundingClientRect(),e=P$.value;M({x:(S.clientX-E.left-e.x)/e.scale,y:(S.clientY-E.top-e.y)/e.scale,value:""});return}if(_==="pen"){if((S.target instanceof Element?S.target:null)?.closest(".hud-layer, .snapshot-panel, .context-menu, .command-palette"))return;S.preventDefault(),S.stopPropagation(),R$.value=null,fv(),J.current=!0;let E=i.getBoundingClientRect(),e=P$.value,G$={x:(S.clientX-E.left-e.x)/e.scale,y:(S.clientY-E.top-e.y)/e.scale};b.current=[G$],B({id:"draft-annotation",type:"freehand",points:[G$],bounds:{x:0,y:0,width:0,height:0},color:FG,width:RB,createdAt:""}),i.setPointerCapture(S.pointerId);return}if(S.target!==i)return;if(!S.shiftKey){if(!Y.current)R$.value=null,fv();return}S.preventDefault(),S.stopPropagation(),z.current=!0;let $$=i.getBoundingClientRect(),a=S.clientX-$$.left,n=S.clientY-$$.top,z$={startX:a,startY:n,currentX:a,currentY:n};Y.current=z$,K(z$),i.setPointerCapture(S.pointerId)},[_,A]),N=Q((S)=>{if(J.current){let a=A.current;if(!a)return;let n=a.getBoundingClientRect(),z$=P$.value,s={x:(S.clientX-n.left-z$.x)/z$.scale,y:(S.clientY-n.top-z$.y)/z$.scale},E=b.current.at(-1);if(E&&Math.hypot(s.x-E.x,s.y-E.y)<2)return;b.current=[...b.current,s],B((e)=>e?{...e,points:b.current}:null);return}if(!z.current||!Y.current)return;let i=A.current?.getBoundingClientRect();if(!i)return;let $$={...Y.current,currentX:S.clientX-i.left,currentY:S.clientY-i.top};Y.current=$$,K($$)},[A]),t=Q((S)=>{if(J.current){J.current=!1;let s=b.current;if(b.current=[],B(null),s.length>=2)I2({points:s,color:FG,width:RB});let E=A.current;if(E?.hasPointerCapture(S.pointerId))E.releasePointerCapture(S.pointerId);return}let i=Y.current;if(!z.current||!i)return;z.current=!1,Y.current=null;let $$=Math.min(i.startX,i.currentX),a=Math.max(i.startX,i.currentX),n=Math.min(i.startY,i.currentY),z$=Math.max(i.startY,i.currentY);if(a-$$>5||z$-n>5){let s=P$.value,E=($$-s.x)/s.scale,e=(a-s.x)/s.scale,G$=(n-s.y)/s.scale,J$=(z$-s.y)/s.scale,i$=[];for(let C$ of T.value.values()){if(C$.dockPosition!==null)continue;let Wv=C$.position.x,Ov=C$.position.y;if(Wv+C$.size.width>E&&Wv<e&&Ov+C$.size.height>G$&&Ov<J$)i$.push(C$.id)}if(i$.length>0)E3(i$)}K(null)},[]);c(()=>{if(g)return;if(!J.current&&!W&&!k)return;J.current=!1,b.current=[],B(null),M(null)},[g,W,M,k]);let d=Q(()=>{let S=q.current;if(!S)return;let i=S.value.trim();if(M(null),!i)return;let $$={x:S.x,y:S.y};I2({type:"text",points:[$$],color:FG,width:DB,text:i})},[M]);c(()=>{if(_!=="text"&&k)M(null)},[_,M,k]),c(()=>{function S($$){if(!Rv.value)return;let a=A.current;if(!a)return;let n=a.getBoundingClientRect(),z$=P$.value;Rv.value={...Rv.value,cursorX:($$.clientX-n.left-z$.x)/z$.scale,cursorY:($$.clientY-n.top-z$.y)/z$.scale}}function i($$){let a=Rv.value;if(!a)return;Rv.value=null;let n=A.current;if(!n)return;let z$=n.getBoundingClientRect(),s=P$.value,E=($$.clientX-z$.left-s.x)/s.scale,e=($$.clientY-z$.top-s.y)/s.scale;for(let G$ of T.value.values()){if(G$.id===a.fromId||G$.dockPosition!==null)continue;if(E>=G$.position.x&&E<=G$.position.x+G$.size.width&&e>=G$.position.y&&e<=G$.position.y+G$.size.height){F4(a.fromId,G$.id,"relation");return}}}return document.addEventListener("pointermove",S),document.addEventListener("pointerup",i),()=>{document.removeEventListener("pointermove",S),document.removeEventListener("pointerup",i)}},[A]);let u=Q((S)=>{if(g)return;let i=A.current;if(!i||S.target!==i)return;let $$=i.getBoundingClientRect(),a=P$.value,n=(S.clientX-$$.left-a.x)/a.scale,z$=(S.clientY-$$.top-a.y)/a.scale,s=520,E=360;hv({type:"markdown",title:"New note",x:n-s/2,y:z$-E/2,width:s,height:E})},[g,A]),r=Q((S)=>{if(g)return;if(!v)return;let i=A.current;if(!i)return;if((S.target instanceof Element?S.target:null)?.closest(".canvas-node"))return;let a=i.getBoundingClientRect(),n=P$.value,z$=(S.clientX-a.left-n.x)/n.scale,s=(S.clientY-a.top-n.y)/n.scale;v(S,z$,s)},[g,A,v]),g$=Q((S)=>{if(S.preventDefault(),F.current++,S.dataTransfer?.types.includes("Files")||jX(S.dataTransfer))H(!0)},[]),p=Q((S)=>{if(S.preventDefault(),S.dataTransfer)S.dataTransfer.dropEffect="copy"},[]),m=Q((S)=>{if(S.preventDefault(),F.current--,F.current<=0)F.current=0,H(!1)},[]),L$=Q(async(S)=>{S.preventDefault(),H(!1),F.current=0;let i=A.current;if(!i||!S.dataTransfer)return;let $$=i.getBoundingClientRect(),a=P$.value,n=(S.clientX-$$.left-a.x)/a.scale,z$=(S.clientY-$$.top-a.y)/a.scale,s=Array.from(S.dataTransfer.files);if(s.length===0){let i$=TX(S.dataTransfer);await V(i$,n,z$);return}let E=400,e=300,G$=20,J$=Math.ceil(Math.sqrt(s.length));for(let i$=0;i$<s.length;i$++){let C$=s[i$],Wv=i$%J$,Ov=Math.floor(i$/J$),mg=n-J$*(E+G$)/2+Wv*(E+G$),O4=z$-e/2+Ov*(e+G$),wv=VX(C$.name),G4=C$.name;if(wv==="image"){let $6=new FileReader,K$=await new Promise((Z$)=>{$6.onload=()=>Z$($6.result),$6.readAsDataURL(C$)});await hv({type:"image",title:G4,content:K$,x:mg,y:O4,width:E,height:e})}else{let $6=await C$.text(),K$=wv==="markdown"||wv==="file";await hv({type:wv,title:G4,content:$6,x:mg,y:O4,width:K$?720:E,height:K$?500:e})}}},[A,V]);c(()=>{let S=async(i)=>{if(i.defaultPrevented)return;if(jB(i.target instanceof Element?i.target:null))return;if(jB(document.activeElement))return;let $$=i.clipboardData?.getData("text/plain")??"",a=YG($$);if(a.length===0)return;let n=A.current;if(!n)return;i.preventDefault();let z$=n.getBoundingClientRect(),s=P$.value,E=(z$.width/2-s.x)/s.scale,e=(z$.height/2-s.y)/s.scale;await V(a,E,e)};return document.addEventListener("paste",S),()=>{document.removeEventListener("paste",S)}},[A,V]);let Y$=CX(T.value.values(),V$.value),n$=null;if(G){let S=Math.min(G.startX,G.currentX),i=Math.min(G.startY,G.currentY),$$=Math.abs(G.currentX-G.startX),a=Math.abs(G.currentY-G.startY);n$={position:"absolute",left:`${S}px`,top:`${i}px`,width:`${$$}px`,height:`${a}px`,pointerEvents:"none"}}return O("div",{class:"canvas-viewport",ref:A,tabIndex:0,onPointerDown:f,onPointerMove:N,onPointerUp:t,onContextMenu:r,onDblClick:u,onDragEnter:g$,onDragOver:p,onDragLeave:m,onDrop:L$,style:{width:"100%",height:"100%",position:"relative",overflow:"hidden",cursor:_==="eraser"?"cell":_==="text"?"text":g||Rv.value||z.current?"crosshair":"grab"},children:[O("div",{style:{transform:`matrix(${U.scale}, 0, 0, ${U.scale}, ${U.x}, ${U.y})`,transformOrigin:"0 0",willChange:"transform",position:"absolute",top:0,left:0},children:[O(lW,{},void 0,!1,void 0,this),O(LB,{},void 0,!1,void 0,this),O(NB,{nodes:T,edges:m$},void 0,!1,void 0,this),O(LG,{annotations:Array.from(q4.value.values())},void 0,!1,void 0,this),W&&W.points.length>=2&&O(LG,{annotations:[W]},void 0,!1,void 0,this),Y$.map((S)=>O(MB,{node:S,onContextMenu:$,children:QX(S)},S.id,!1,void 0,this)),J4.value&&O("svg",{class:"snap-guides-svg",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",pointerEvents:"none",overflow:"visible"},children:J4.value.map((S,i)=>S.axis==="x"?O("line",{x1:S.pos,y1:S.from-20,x2:S.pos,y2:S.to+20,class:"snap-guide-line"},i,!1,void 0,this):O("line",{x1:S.from-20,y1:S.pos,x2:S.to+20,y2:S.pos,class:"snap-guide-line"},i,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),g&&O("div",{class:`annotation-capture-layer${_==="eraser"?" erasing":""}${_==="text"?" text":""}`,"aria-hidden":"true"},void 0,!1,void 0,this),k&&O("input",{class:"annotation-text-input",value:k.value,autoFocus:!0,style:{left:`${k.x*U.scale+U.x}px`,top:`${k.y*U.scale+U.y}px`,fontSize:`${DB*U.scale}px`},onInput:(S)=>M({...k,value:S.target.value}),onBlur:d,onPointerDown:(S)=>S.stopPropagation(),onKeyDown:(S)=>{if(S.key==="Enter")S.preventDefault(),d();if(S.key==="Escape")S.preventDefault(),M(null)}},void 0,!1,void 0,this),n$&&O("div",{class:"lasso-rect",style:n$},void 0,!1,void 0,this),L&&O("div",{class:"drop-zone-overlay",children:O("div",{class:"drop-zone-indicator",children:[O("div",{class:"drop-zone-icon",children:"+"},void 0,!1,void 0,this),O("div",{class:"drop-zone-label",children:"Drop files or URLs to add to canvas"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function fX($,v){let g=$.toLowerCase(),_=v.toLowerCase(),U=[],z=0,J=0,b=-1;for(let G=0;G<_.length&&z<g.length;G++)if(_[G]===g[z]){if(U.push(G),J+=b===G-1?10:1,G===0||_[G-1]===" "||_[G-1]==="-"||_[G-1]==="_")J+=5;b=G,z++}return{match:z===g.length,score:J,indices:U}}function EX($,v){if(v.length===0)return $;let g=[],_=0;for(let U of v){if(U>_)g.push($.slice(_,U));g.push(O("mark",{children:$[U]},U,!1,void 0,this)),_=U+1}if(_<$.length)g.push($.slice(_));return g}var qG={md:"markdown",app:"mcp-app",web:"webpage",ui:"json-render",chart:"graph",ctx:"context",log:"ledger"};function cX($){let v=$.toLowerCase().trim();if(v.startsWith("type:")){let g=v.slice(5).trim(),U=Object.keys(e$).find((J)=>J.startsWith(g));if(U)return{typeFilter:U,remaining:""};let z=qG[g];if(z)return{typeFilter:z,remaining:""}}if(qG[v])return{typeFilter:qG[v],remaining:""};return{typeFilter:null,remaining:$}}function CB({onClose:$,onToggleMinimap:v}){let[g,_]=x(""),[U,z]=x(0),J=y(null),b=y(null);c(()=>{setTimeout(()=>J.current?.focus(),30)},[]);let G=Q(()=>{let L=[];for(let F of T.value.values()){let Y=F.data.title||e$[F.type],A=F.data.content||F.data.path||"";L.push({id:`node:${F.id}`,kind:"node",label:Y,description:A.length>80?A.slice(0,80)+"...":A||void 0,badge:e$[F.type],nodeType:F.type,action:()=>{Fv(F.id),$()}})}let H=[{label:"New note (markdown node)",badge:"CREATE",action:()=>{hv({type:"markdown",title:"New note",width:520,height:360}),$()}},{label:"Fit all nodes",badge:"VIEW",action:()=>{Z_(window.innerWidth,window.innerHeight),$()}},{label:"Auto-arrange (grid)",badge:"LAYOUT",action:()=>{S_(),$()}},{label:"Auto-arrange (graph-aware)",badge:"LAYOUT",action:()=>{M_(),$()}},{label:"Toggle minimap",badge:"VIEW",action:()=>{v(),$()}},{label:"Toggle theme (dark/light)",badge:"THEME",action:()=>{let F=T$.value==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",F),kU(),T$.value=F,k_(F),$()}}];for(let F of H)L.push({id:`action:${F.label}`,kind:"action",label:F.label,badge:F.badge,badgeClass:"command-palette-badge--action",action:F.action});return L},[$,v]),{typeFilter:K,remaining:W}=cX(g),B=G(),k;if(!g.trim())k=B.map((L)=>({...L,score:0,indices:[]}));else{k=[];for(let L of B){if(K){if(L.kind!=="node"||L.nodeType!==K)continue;if(!W){k.push({...L,score:0,indices:[]});continue}}let H=fX(W||g,L.label);if(H.match)k.push({...L,score:H.score,indices:H.indices})}k.sort((L,H)=>H.score-L.score)}c(()=>{if(!g.trim()){A6.value=null;return}let L=new Set;for(let H of k)if(H.kind==="node")L.add(H.id.slice(5));A6.value=L.size>0?L:null},[g,k]),c(()=>{return()=>{A6.value=null}},[]);let P=Math.min(U,Math.max(0,k.length-1)),q=Q((L)=>{if(L.key==="ArrowDown")L.preventDefault(),z((H)=>Math.min(H+1,k.length-1));else if(L.key==="ArrowUp")L.preventDefault(),z((H)=>Math.max(H-1,0));else if(L.key==="Enter"){if(L.preventDefault(),k[P])k[P].action()}else if(L.key==="Escape")L.preventDefault(),L.stopPropagation(),$()},[k,P,$]);return c(()=>{let L=b.current;if(!L)return;L.children[P]?.scrollIntoView({block:"nearest"})},[P]),c(()=>{z(0)},[g]),O("div",{class:"command-palette-backdrop",onMouseDown:$,children:O("div",{class:"command-palette",onMouseDown:(L)=>L.stopPropagation(),children:[O("input",{ref:J,type:"text",class:"command-palette-input",value:g,onInput:(L)=>_(L.target.value),onKeyDown:q,placeholder:`Search nodes and actions... (${Mv}+K)`},void 0,!1,void 0,this),O("div",{class:"command-palette-hint",children:[O("span",{children:[O("kbd",{children:"↑"},void 0,!1,void 0,this),O("kbd",{children:"↓"},void 0,!1,void 0,this)," navigate"]},void 0,!0,void 0,this),O("span",{children:[O("kbd",{children:"↵"},void 0,!1,void 0,this)," select"]},void 0,!0,void 0,this),O("span",{children:[O("kbd",{children:"esc"},void 0,!1,void 0,this)," close"]},void 0,!0,void 0,this),O("span",{children:[O("kbd",{children:"type:"},void 0,!1,void 0,this)," filter by type"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"command-palette-results",ref:b,children:[k.length===0&&O("div",{class:"command-palette-empty",children:"No matching nodes or actions"},void 0,!1,void 0,this),k.map((L,H)=>O("button",{type:"button",class:`command-palette-item${H===P?" selected":""}`,onMouseEnter:()=>z(H),onClick:()=>L.action(),children:[O("span",{class:`command-palette-badge${L.badgeClass?` ${L.badgeClass}`:""}`,children:L.badge},void 0,!1,void 0,this),O("span",{class:"command-palette-label",children:L.indices.length>0?EX(L.label,L.indices):L.label},void 0,!1,void 0,this),L.description&&O("span",{class:"command-palette-desc",children:L.description},void 0,!1,void 0,this)]},L.id,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function fB(){let[$,v]=x(null),g=Q((z,J)=>{z.preventDefault(),z.stopPropagation(),v({kind:"node",x:z.clientX,y:z.clientY,nodeId:J})},[]),_=Q((z,J,b)=>{z.preventDefault(),z.stopPropagation(),v({kind:"canvas",x:z.clientX,y:z.clientY,canvasX:J,canvasY:b})},[]),U=Q(()=>v(null),[]);return c(()=>{if(!$)return;let z=()=>v(null),J=(b)=>{if(b.key==="Escape")v(null)};return document.addEventListener("click",z),document.addEventListener("keydown",J),()=>{document.removeEventListener("click",z),document.removeEventListener("keydown",J)}},[$]),{menu:$,openNodeMenu:g,openCanvasMenu:_,closeMenu:U}}var mX="#4bbcFF",iX=[{label:"Blue",value:"#3b82f6"},{label:"Green",value:"#22c55e"},{label:"Yellow",value:"#eab308"},{label:"Red",value:"#ef4444"},{label:"Gray",value:"#6b7280"},{label:"Purple",value:"#a855f7"}];function EB({menu:$,onClose:v}){let g;if($.kind==="node"){let b=T.value.get($.nodeId);if(!b)return null;g=nX(b)}else g=oX($.canvasX,$.canvasY);let _=new Map,U=g.some((b)=>b.render)?g.length*32+168:g.length*32+8,z=Math.min($.x,Math.max(12,window.innerWidth-240)),J=Math.min($.y,Math.max(12,window.innerHeight-U));return O("div",{class:"context-menu",style:{position:"fixed",left:`${z}px`,top:`${J}px`,zIndex:1e4},onPointerDown:(b)=>b.stopPropagation(),onClick:(b)=>b.stopPropagation(),children:g.map((b)=>{let G=b.separator?"separator":b.render?"custom":`${b.label??"item"}:${b.shortcut??""}`,K=(_.get(G)??0)+1;_.set(G,K);let W=`${G}:${K}`;if(b.separator)return O("div",{class:"context-menu-separator"},W,!1,void 0,this);if(b.render)return O("div",{class:"context-menu-custom",children:b.render(v)},W,!1,void 0,this);return O("button",{type:"button",class:"context-menu-item",onClick:()=>{b.action?.(),v()},children:[O("span",{class:"context-menu-label",children:b.label},void 0,!1,void 0,this),b.shortcut&&O("span",{class:"context-menu-shortcut",children:b.shortcut},void 0,!1,void 0,this)]},W,!0,void 0,this)})},void 0,!1,void 0,this)}function lX($){return(typeof $.data.path==="string"?$.data.path.trim():"")||null}function m0($){let v=$.trim().toLowerCase(),g=v.match(/^#([0-9a-f]{3})$/);if(g){let[_,U,z]=g[1].split("");return`#${_}${_}${U}${U}${z}${z}`}return v}function cB($){if(typeof $.data.color!=="string"||!$.data.color.trim())return null;return m0($.data.color)}function hX($){let v=cB($);return v&&/^#[0-9a-f]{6}$/.test(v)?v:m0(mX)}function XG($,v){let g=v?m0(v):null;Pv($.id,{data:{...$.data,color:g}}),Zv($.id,{data:{color:g}})}function xX($,v){let g=cB($);return O("div",{class:"context-menu-section",children:[O("div",{class:"context-menu-section-header",children:[O("span",{class:"context-menu-section-label",children:"Group color"},void 0,!1,void 0,this),O("button",{type:"button",class:"context-menu-reset",onClick:()=>{XG($,null),v()},children:"Theme default"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"context-menu-color-grid",children:iX.map((_)=>{let U=m0(_.value);return O("button",{type:"button",class:`context-menu-color-swatch${g===U?" active":""}`,"aria-label":`Set group color to ${_.label}`,title:_.label,style:{"--swatch-color":_.value},onClick:()=>{XG($,_.value),v()},children:[O("span",{class:"context-menu-color-dot",style:{"--swatch-color":_.value}},void 0,!1,void 0,this),O("span",{children:_.label},void 0,!1,void 0,this)]},_.value,!0,void 0,this)})},void 0,!1,void 0,this),O("label",{class:"context-menu-color-custom",children:[O("span",{children:"Custom"},void 0,!1,void 0,this),O("input",{type:"color",class:"context-menu-color-input","aria-label":"Custom group color",value:hX($),onClick:(_)=>_.stopPropagation(),onInput:(_)=>{XG($,_.currentTarget.value),v()}},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function wG($,v,g,_){return{x:$-g/2,y:v-_/2}}function pX($,v){return $.trim().replace(/[?#].*$/,"").split("/").filter(Boolean).at(-1)||v}async function AG($){let v=window.prompt($.promptLabel,$.placeholder??"");if(!v)return;let g=v.trim();if(!g)return;let _=wG($.canvasX,$.canvasY,$.width,$.height);if(!(await hv({type:$.type,...$.type!=="webpage"?{title:pX(g,$.titleFallback)}:{},content:g,x:_.x,y:_.y,width:$.width,height:$.height})).ok)window.alert($.errorMessage)}function oX($,v){return[{label:"New note",action:()=>{let U=wG($,v,520,360);hv({type:"markdown",title:"New note",x:U.x,y:U.y,width:520,height:360})}},{label:"Open webpage...",action:()=>{AG({promptLabel:"Webpage URL:",type:"webpage",canvasX:$,canvasY:v,width:520,height:420,placeholder:"https://example.com",titleFallback:"Webpage",errorMessage:"Could not create webpage node. Enter a valid http(s) URL."})}},{label:"Open file...",action:()=>{AG({promptLabel:"Workspace path or absolute file path:",type:"file",canvasX:$,canvasY:v,width:720,height:500,placeholder:"src/server/server.ts",titleFallback:"File",errorMessage:"Could not create file node. Check the path and try again."})}},{label:"Open image...",action:()=>{AG({promptLabel:"Image path, URL, or data URI:",type:"image",canvasX:$,canvasY:v,width:480,height:360,placeholder:"artifacts/architecture.png",titleFallback:"Image",errorMessage:"Could not create image node. Check the image source and try again."})}},{separator:!0},{label:"New group",action:()=>{let U=wG($,v,600,400);L_({title:"Group",x:U.x,y:U.y,width:600,height:400})}}]}function nX($){let v=[],g=lX($);if(v.push({label:"Focus",action:()=>Fv($.id)}),B_.has($.type))v.push({label:"Expand",shortcut:"⤢",action:()=>b6($.id)});v.push({label:$.collapsed?"Expand":"Collapse",action:()=>Z6($.id)});let _=D$.value.has($.id);v.push({label:_?"Unpin from context":"Pin as context",action:()=>A4($.id)}),v.push({label:$.pinned?"Unlock position":"Lock position (no auto-arrange)",action:()=>{let J=!$.pinned;Pv($.id,{pinned:J}),Zv($.id,{pinned:J}),d$()}});let U=q_.value;if(U&&U.from!==$.id){let J=T.value.get(U.from),b=J?(J.data.title||J.id).slice(0,20):U.from;v.push({label:`Connect from "${b}"`,action:()=>{F4(U.from,$.id,"relation"),q_.value=null}})}v.push({label:U?"Connect from here (replace)":"Connect from here",action:()=>{q_.value={from:$.id}}});let z=Array.from(m$.value.values()).filter((J)=>J.from===$.id||J.to===$.id).length;if(z>0)v.push({label:`${z} edge${z!==1?"s":""} connected`});if(v.push({separator:!0}),($.type==="markdown"||$.type==="file"||$.type==="image")&&g)v.push({label:"Open in browser",action:()=>{window.open(`/artifact?path=${encodeURIComponent(g)}`,"_blank","noopener")}}),v.push({label:"Copy path",action:()=>{navigator.clipboard.writeText(g)}});if($.type==="mcp-app"||$.type==="json-render"||$.type==="graph")if($.data.chartConfig){let J=$.data.chartConfig.title||"chart";v.push({label:"Copy chart data",action:()=>{navigator.clipboard.writeText(JSON.stringify($.data.chartConfig,null,2))}})}else{let J=$.data.url;if(v.push({label:"Open in browser",action:()=>{if(J)window.open(J,"_blank")}}),v.push({label:"Focus in TUI",action:()=>q3("mcp-app-focus",{url:J})}),$.type==="json-render"||$.type==="graph")v.push({label:"Copy spec",action:()=>{navigator.clipboard.writeText(JSON.stringify($.data.spec??$.data.graphConfig??{},null,2))}})}if($.type==="webpage"){let J=typeof $.data.url==="string"?$.data.url:"";v.push({label:"Refresh webpage",action:()=>{H_($.id)}}),v.push({label:"Open in browser",action:()=>{if(J)window.open(J,"_blank","noopener")}}),v.push({label:"Copy URL",action:()=>{if(J)navigator.clipboard.writeText(J)}})}if($.type==="group"){let J=$.data.children??[];if(v.push({separator:!0}),v.push({render:(b)=>xX($,b)}),J.length>0)v.push({label:`Ungroup (${J.length} node${J.length!==1?"s":""})`,action:()=>N3($.id)})}if($.type==="status"||$.type==="ledger")if(v.push({separator:!0}),$.dockPosition!==null)v.push({label:"Undock to canvas",action:()=>S4($.id)});else v.push({label:"Dock left of toolbar",action:()=>L2($.id,"left")}),v.push({label:"Dock right of toolbar",action:()=>L2($.id,"right")});return v.push({separator:!0}),v.push({label:"Close",action:()=>{w4($.id),I_($.id)}}),v}function mB(){let $=D$.value.size;if($===0||F6.value||w_.value)return null;return O("div",{class:"context-pin-bar",children:[O("span",{class:"context-pin-bar-count",children:["✦"," ",$," node",$!==1?"s":""," in context"]},void 0,!0,void 0,this),O("button",{type:"button",class:"context-pin-bar-btn context-pin-bar-clear",onClick:m3,title:"Clear all context pins",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function iB({node:$}){let v=JG($),g=$.data.activeTool,_=$.data.subagent,U=D0[v]??"var(--c-muted)";return O("span",{style:{display:"flex",alignItems:"center",gap:"6px",flex:1,minWidth:0},children:[O("span",{style:{width:"6px",height:"6px",borderRadius:"50%",background:U,animation:v!=="idle"?"pulse 1.5s infinite":"none",flexShrink:0}},void 0,!1,void 0,this),O("span",{style:{color:U,fontSize:"10px",textTransform:"uppercase",fontWeight:600},children:v},void 0,!1,void 0,this),g&&O("span",{style:{color:"var(--c-warn)",fontSize:"10px",fontFamily:"var(--mono)"},children:["⚙ ",g]},void 0,!0,void 0,this),_&&_.state!=="completed"&&O("span",{style:{color:"var(--c-subagent)",fontSize:"10px"},children:["⠉ ",_.name]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function tX($){switch($.type){case"status":return O(HU,{node:$},void 0,!1,void 0,this);case"ledger":return O(r4,{node:$},void 0,!1,void 0,this);case"context":return O(d6,{node:$},void 0,!1,void 0,this);default:return null}}function dX($){let v=Array.isArray($.data.cards)?$.data.cards:[],g=Array.isArray($.data.auxTabs)?$.data.auxTabs:[];return v.length+g.length}function aX({node:$}){let v=l3(),g=v.length>0?v.length:dX($),_=g>0,U=$.collapsed===!0,z=()=>{G_(),Z6($.id)};if(U)return O("div",{class:"docked-node docked-node--collapsed","data-docked-node":"true",children:O("div",{class:"docked-node-header",children:[O("span",{class:"node-type-badge",children:"Context"},void 0,!1,void 0,this),_&&O("span",{class:"docked-node-count","aria-hidden":"true",children:g>99?"99+":g},void 0,!1,void 0,this),O("div",{class:"docked-node-controls",children:[O("button",{type:"button",onClick:(J)=>{J.stopPropagation(),z()},title:_?`${g} item${g===1?"":"s"} in agent context — expand`:"Expand agent context","aria-label":_?`Context — ${g} item${g===1?"":"s"}`:"Expand agent context",children:"▸"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(J)=>{J.stopPropagation(),S4($.id)},title:"Undock to canvas","aria-label":"Undock to canvas",children:"⊙"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this);return O("aside",{class:"context-dock-panel","data-docked-node":"true","aria-label":"Agent context",children:[O("div",{class:"context-dock-header",children:[O("div",{class:"context-dock-header-text",children:[O("span",{class:"context-dock-title",children:"Context"},void 0,!1,void 0,this),O("span",{class:"context-dock-subtitle",children:_?`${g} item${g===1?"":"s"} in agent context`:"Active agent context"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"context-dock-controls",children:[O("button",{type:"button",class:"context-dock-icon-button",onClick:(J)=>{J.stopPropagation(),S4($.id)},"aria-label":"Undock to canvas",title:"Undock to canvas",children:"⊙"},void 0,!1,void 0,this),O("button",{type:"button",class:"context-dock-icon-button",onClick:(J)=>{J.stopPropagation(),Z6($.id)},"aria-label":"Collapse context panel",title:"Collapse",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"context-dock-body",children:O(d6,{node:$,pinnedNodes:v},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function ZG({node:$}){if($.type==="context")return O(aX,{node:$},void 0,!1,void 0,this);return O("div",{class:`docked-node${$.collapsed?" docked-node--collapsed":""}`,"data-docked-node":"true",children:[O("div",{class:"docked-node-header",children:[O("span",{class:"node-type-badge",children:e$[$.type]??$.type},void 0,!1,void 0,this),$.type==="status"&&$.collapsed&&O(iB,{node:$},void 0,!1,void 0,this),O("div",{class:"docked-node-controls",children:[O("button",{type:"button",onClick:(v)=>{v.stopPropagation(),Z6($.id)},title:$.collapsed?"Expand":"Collapse",children:$.collapsed?"▸":"▾"},void 0,!1,void 0,this),O("button",{type:"button",onClick:(v)=>{v.stopPropagation(),S4($.id)},title:"Undock to canvas",children:"⊙"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),!$.collapsed&&O("div",{class:"docked-node-body",children:tX($)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function lB($,v){switch($.type){case"markdown":return O(f_,{node:$,expanded:v},void 0,!1,void 0,this);case"mcp-app":return O(m6,{node:$,expanded:v},void 0,!1,void 0,this);case"webpage":return O(j0,{node:$,expanded:v},void 0,!1,void 0,this);case"json-render":return O(m6,{node:$,expanded:v},void 0,!1,void 0,this);case"graph":return O(m6,{node:$,expanded:v},void 0,!1,void 0,this);case"prompt":return O(f0,{node:$},void 0,!1,void 0,this);case"response":return O(E0,{node:$,expanded:v},void 0,!1,void 0,this);case"status":return O(HU,{node:$},void 0,!1,void 0,this);case"context":return O(d6,{node:$,expanded:v},void 0,!1,void 0,this);case"ledger":return O(r4,{node:$},void 0,!1,void 0,this);case"trace":return O(c0,{node:$},void 0,!1,void 0,this);case"file":return O(R_,{node:$,expanded:v},void 0,!1,void 0,this);case"image":return O(T0,{node:$,expanded:v},void 0,!1,void 0,this);case"html":return O(Tg,{node:$,expanded:v},void 0,!1,void 0,this);default:return O("div",{children:"Unknown node type"},void 0,!1,void 0,this)}}function hB($){switch($.type){case"markdown":return $.data.content||"";case"file":return $.data.fileContent||"";case"webpage":return $.data.content||"";case"html":return $.data.html||$.data.content||"";case"json-render":case"graph":return JSON.stringify($.data.spec??$.data.graphConfig??{},null,2);default:return""}}function sX($){if(!$)return 0;return $.split(/\s+/).filter(Boolean).length}function eX($,v){return $!==null&&typeof $==="object"&&$.source==="pmx-canvas-html-node"&&$.type==="presentation-exit"&&$.token===v}function $A($){return $==="ArrowRight"||$==="PageDown"||$===" "||$==="ArrowLeft"||$==="PageUp"||$==="Home"||$==="End"}function xB($){return $ instanceof HTMLElement&&Boolean($.closest(".html-presentation-exit"))}function pB(){let $=V$.value,v=$?T.value.get($):void 0,[g,_]=x(!1),[U,z]=x(!1),[J,b]=x(""),G=y(null),K=y(null),W=Q(()=>{z(!1),t6()},[]),B=Q(()=>{b(`presentation-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,8)}`),z(!0)},[]),k=Q((u)=>{document.querySelector(".html-presentation-overlay iframe.html-node-frame-presentation")?.contentWindow?.postMessage({source:"pmx-canvas-html-node",token:J,...u},"*")},[J]),P=Q(()=>{z(!1)},[]),q=Q((u)=>{if(u.key==="Escape"){u.preventDefault(),u.stopPropagation(),z(!1);return}if(u.key==="Tab"&&!xB(u.target)){u.preventDefault(),u.stopPropagation(),K.current?.focus();return}if((u.key===" "||u.key==="Enter")&&xB(u.target))return;if(!$A(u.key))return;u.preventDefault(),u.stopPropagation(),k({type:"presentation-key",key:u.key})},[k]),L=Q((u)=>{if(u.target.classList.contains("expanded-overlay-backdrop"))t6()},[]),H=Q(()=>{if(!v)return;let u=hB(v);if(!u)return;navigator.clipboard.writeText(u).then(()=>{_(!0),setTimeout(()=>_(!1),1500)})},[v]),F=Q(()=>{if(!$)return;A4($)},[$]);if(c(()=>{z(!1)},[$]),sg(()=>{if(!U)return;let u=()=>{let p=G.current;if(!p||p.contains(document.activeElement))return;p.focus()},r=[0,50,150].map((p)=>window.setTimeout(u,p)),g$=(p)=>{if(!eX(p.data,J))return;z(!1)};return document.addEventListener("keydown",q,!0),window.addEventListener("message",g$),()=>{r.forEach((p)=>{window.clearTimeout(p)}),document.removeEventListener("keydown",q,!0),window.removeEventListener("message",g$)}},[q,J,U]),!v)return null;let Y=v.data.title||v.data.path?.split("/").pop()||e$[v.type],A=hB(v),M=sX(A),V=$?D$.value.has($):!1,f=A.length>0,N=xv.value===$,t=v.type==="mcp-app"||v.type==="webpage"||v.type==="json-render"||v.type==="graph",d=VW(v);return O("div",{class:"expanded-overlay-backdrop",onPointerDown:L,style:{position:"fixed",inset:0,zIndex:10001,background:"rgba(10,14,30,0.85)",backdropFilter:"blur(8px)",display:"flex",alignItems:"stretch",justifyContent:"center",padding:"32px",pointerEvents:N?"none":"auto"},children:O("div",{class:"expanded-overlay-panel",style:{flex:1,maxWidth:"1200px",display:"flex",flexDirection:"column",background:"var(--c-panel)",border:`1px solid ${V?"var(--c-warn)":"var(--c-accent)"}`,borderRadius:"var(--radius)",boxShadow:`0 0 0 1px ${V?"var(--c-warn)":"var(--c-accent)"}, 0 24px 80px rgba(0,0,0,0.6)`,overflow:"hidden"},children:[O("div",{style:{display:"flex",alignItems:"center",gap:"10px",padding:"10px 16px",background:"var(--c-panel-glass)",borderBottom:"1px solid var(--c-line)",flexShrink:0},children:[O("span",{style:{fontSize:"10px",padding:"1px 6px",borderRadius:"4px",background:"var(--c-accent-12)",color:"var(--c-accent)",textTransform:"uppercase",letterSpacing:"0.04em"},children:e$[v.type]},void 0,!1,void 0,this),O("span",{style:{flex:1,fontSize:"13px",fontWeight:600,color:"var(--c-text)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:Y},void 0,!1,void 0,this),O("div",{class:"expanded-actions",children:[O("button",{type:"button",class:`expanded-action-btn ${V?"expanded-action-active":""}`,onClick:F,title:V?"Remove from context":"Pin as context",children:V?"✦ In context":"✦ Pin as context"},void 0,!1,void 0,this),f&&O("button",{type:"button",class:"expanded-action-btn",onClick:H,title:"Copy content to clipboard",children:g?"Copied!":"Copy"},void 0,!1,void 0,this),V0(v)&&O("button",{type:"button",class:"expanded-action-btn",onClick:()=>void C0(v),title:"Open as a full-page site in the system browser",children:"Open as site"},void 0,!1,void 0,this),d&&O("button",{type:"button",class:"expanded-action-btn expanded-action-primary",onClick:B,title:"Present this HTML node fullscreen",children:"Present"},void 0,!1,void 0,this),M>0&&O("span",{class:"expanded-meta",children:[M.toLocaleString()," word",M!==1?"s":""]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("span",{style:{fontSize:"10px",color:N?"var(--c-warn)":"var(--c-muted)"},children:N?"Saving edits...":"Esc to close"},void 0,!1,void 0,this),O("button",{type:"button",onClick:W,style:{background:"none",border:"none",color:"var(--c-muted)",cursor:"pointer",padding:"2px 6px",fontSize:"16px",lineHeight:1,borderRadius:"4px"},onMouseEnter:(u)=>{u.target.style.color="var(--c-text)"},onMouseLeave:(u)=>{u.target.style.color="var(--c-muted)"},title:"Close (Esc)",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{style:{flex:1,overflow:"auto",padding:"16px",minHeight:0,...t?{display:"flex",flexDirection:"column"}:{}},children:t?O("div",{style:{flex:1,minHeight:0,display:"flex"},children:lB(v,!0)},void 0,!1,void 0,this):lB(v,!0)},void 0,!1,void 0,this),d&&U&&O("div",{ref:G,class:"html-presentation-overlay",role:"dialog","aria-modal":"true","aria-label":`Present ${Y}`,tabIndex:-1,onKeyDownCapture:q,children:[O("button",{ref:K,type:"button",class:"html-presentation-exit",onClick:P,title:"Exit presentation (Esc)","aria-label":"Exit presentation",children:"Exit presentation"},void 0,!1,void 0,this),O("div",{class:"html-presentation-stage",children:O(Tg,{node:v,expanded:!0,presentation:!0,presentationExitToken:J},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}var XU=180,AU=120,i0=20;function vA(){let $=R0();return{markdown:$.accent,"mcp-app":$.ok,webpage:$.warn,"json-render":$.ok,graph:$.purple,prompt:$.accent,response:$.ok,status:$.warn,context:$.muted,ledger:$.dim,trace:$.purple,file:$.accent,image:$.ok,html:$.warn,group:$.dim}}function UA(){let $=R0();return{relation:$.muted,"depends-on":$.warn,flow:$.accent,references:$.dim}}function oB($,v,g,_){let U=Array.from($.values()),z=0,J=0,b=1000,G=800;if(U.length>0){z=Number.POSITIVE_INFINITY,J=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,G=Number.NEGATIVE_INFINITY;for(let H of U)z=Math.min(z,H.position.x),J=Math.min(J,H.position.y),b=Math.max(b,H.position.x+H.size.width),G=Math.max(G,H.position.y+H.size.height)}let K=-v.x/v.scale,W=-v.y/v.scale,B=K+g/v.scale,k=W+_/v.scale,P={minX:Math.min(z,K)-i0,minY:Math.min(J,W)-i0,maxX:Math.max(b,B)+i0,maxY:Math.max(G,k)+i0},q=P.maxX-P.minX||1,L=P.maxY-P.minY||1;return{bounds:P,scale:Math.min(XU/q,AU/L)}}function nB({viewport:$,nodes:v,edges:g,onNavigate:_,containerWidth:U,containerHeight:z}){let J=y(null),b=y(!1),G=y(null),K=y(null),W=Q(()=>{let L=J.current;if(!L)return;let H=L.getContext("2d");if(!H)return;let F=v.value,Y=g.value,A=$.value,M=window.devicePixelRatio||1;L.width=XU*M,L.height=AU*M,H.scale(M,M),H.clearRect(0,0,XU,AU);let V=R0();H.fillStyle=V.panel+"d9",H.fillRect(0,0,XU,AU);let f=oB(F,A,U,z);G.current=f;let{bounds:N,scale:t}=f,d=(S)=>(S-N.minX)*t,u=(S)=>(S-N.minY)*t,r=Array.from(F.values()),g$=vA();for(let S of r)H.fillStyle=g$[S.type]??V.muted,H.globalAlpha=0.6,H.fillRect(d(S.position.x),u(S.position.y),Math.max(4,S.size.width*t),Math.max(3,S.size.height*t));let p=UA();for(let S of Y.values()){let i=F.get(S.from),$$=F.get(S.to);if(!i||!$$)continue;let a=d(i.position.x+i.size.width/2),n=u(i.position.y+i.size.height/2),z$=d($$.position.x+$$.size.width/2),s=u($$.position.y+$$.size.height/2);H.beginPath(),H.moveTo(a,n),H.lineTo(z$,s),H.strokeStyle=p[S.type]??V.muted,H.globalAlpha=0.3,H.lineWidth=0.5,H.stroke()}let m=-A.x/A.scale,L$=-A.y/A.scale,Y$=U/A.scale,n$=z/A.scale;H.globalAlpha=1,H.strokeStyle=V.accent,H.lineWidth=1.5,H.strokeRect(d(m),u(L$),Y$*t,n$*t)},[v,g,$,U,z]),B=y(W);B.current=W;let k=Q(()=>{if(K.current!==null)return;K.current=window.requestAnimationFrame(()=>{K.current=null,B.current()})},[]);P3(()=>{T$.value,v.value,g.value,$.value,k()}),c(()=>{k()},[U,z,k]),c(()=>()=>{if(K.current!==null)window.cancelAnimationFrame(K.current),K.current=null},[]);let P=Q((L)=>{let H=J.current;if(!H)return;let F=H.getBoundingClientRect(),Y=L.clientX-F.left,A=L.clientY-F.top,M=G.current??oB(v.value,$.value,U,z);G.current=M;let{bounds:V,scale:f}=M,N=$.value,t=U/N.scale,d=z/N.scale,u=Y/f+V.minX,r=A/f+V.minY;_(-(u-t/2)*N.scale,-(r-d/2)*N.scale)},[v,$,U,z,_]),q=Q((L)=>{L.stopPropagation(),b.current=!0,P(L);let H=(Y)=>{if(b.current)P(Y)},F=()=>{b.current=!1,document.removeEventListener("pointermove",H),document.removeEventListener("pointerup",F)};document.addEventListener("pointermove",H),document.addEventListener("pointerup",F)},[P]);return O("div",{style:{position:"fixed",bottom:"16px",right:"16px",zIndex:9998,border:"1px solid var(--c-line)",borderRadius:"var(--radius-sm)",overflow:"hidden",boxShadow:"0 4px 16px var(--c-shadow)"},children:O("canvas",{ref:J,width:XU,height:AU,style:{width:`${XU}px`,height:`${AU}px`,display:"block",cursor:"pointer"},onPointerDown:q},void 0,!1,void 0,this)},void 0,!1,void 0,this)}function tB(){let $=h$.value.size,v=Q(()=>{let U=Array.from(h$.value);if(U.length===0)return;c3(U),fv()},[]),g=Q(()=>{let U=Array.from(h$.value);if(U.length===0)return;L_({title:"Group",childIds:U}),fv()},[]),_=Q(()=>{let U=Array.from(h$.value);for(let z=0;z<U.length;z++)for(let J=z+1;J<U.length;J++)F4(U[z],U[J],"relation");fv()},[]);if($===0)return null;return O("div",{class:"selection-bar",children:[O("span",{class:"selection-bar-count",children:["✦"," ",$," node",$!==1?"s":""," selected"]},void 0,!0,void 0,this),O("button",{type:"button",class:"selection-bar-btn selection-bar-pin-ctx",onClick:v,children:"Pin as context"},void 0,!1,void 0,this),$>=2&&O("button",{type:"button",class:"selection-bar-btn",onClick:g,children:"Group"},void 0,!1,void 0,this),$>=2&&O("button",{type:"button",class:"selection-bar-btn",onClick:_,children:"Connect"},void 0,!1,void 0,this),O("button",{type:"button",class:"selection-bar-btn selection-bar-clear",onClick:fv,title:"Clear selection",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var gA=[{title:"Navigation",shortcuts:[{keys:`${Mv}+K`,desc:"Command palette — search nodes & actions"},{keys:"Tab / Shift+Tab",desc:"Cycle through nodes"},{keys:"← ↑ → ↓",desc:"Walk graph along edges (when node focused)"},{keys:`${Mv}+0`,desc:"Reset viewport to origin"},{keys:`${Mv}++ / ${Mv}+−`,desc:"Zoom in / out"}]},{title:"Creation",shortcuts:[{keys:"Double-click",desc:"Create new markdown note on canvas"},{keys:"Drag port → node",desc:"Connect two nodes (hover to reveal ports)"}]},{title:"Selection",shortcuts:[{keys:"Click",desc:"Focus node (highlights neighbors & edges)"},{keys:"Shift+Click",desc:"Toggle node in multi-selection"},{keys:"Shift+Drag",desc:"Lasso select multiple nodes"},{keys:"Esc",desc:"Clear selection / close overlay"}]},{title:"View",shortcuts:[{keys:"?",desc:"Toggle this shortcut overlay"},{keys:"Minimap",desc:"Click/drag to navigate (toggle in toolbar)"},{keys:"Right-click",desc:"Context menu — dock, focus, connect"}]}];function dB({onClose:$}){return O("div",{class:"shortcut-overlay-backdrop",onMouseDown:$,children:O("div",{class:"shortcut-overlay",onMouseDown:(v)=>v.stopPropagation(),children:[O("div",{class:"shortcut-overlay-header",children:[O("span",{class:"shortcut-overlay-title",children:"Keyboard Shortcuts"},void 0,!1,void 0,this),O("span",{class:"shortcut-overlay-hint",children:["Press ",O("kbd",{children:"?"},void 0,!1,void 0,this)," or ",O("kbd",{children:"Esc"},void 0,!1,void 0,this)," to close"]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"shortcut-overlay-body",children:gA.map((v)=>O("div",{class:"shortcut-group",children:[O("div",{class:"shortcut-group-title",children:v.title},void 0,!1,void 0,this),v.shortcuts.map((g)=>O("div",{class:"shortcut-row",children:[O("kbd",{class:"shortcut-keys",children:g.keys},void 0,!1,void 0,this),O("span",{class:"shortcut-desc",children:g.desc},void 0,!1,void 0,this)]},g.keys,!0,void 0,this))]},v.title,!0,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)}function _A($){let v=Date.now()-new Date($).getTime(),g=Math.floor(v/60000);if(g<1)return"just now";if(g<60)return`${g}m ago`;let _=Math.floor(g/60);if(_<24)return`${_}h ago`;return`${Math.floor(_/24)}d ago`}function aB({open:$,onClose:v,anchorRef:g}){let[_,U]=x([]),[z,J]=x(!1),[b,G]=x(!1),[K,W]=x(null),[B,k]=x(""),[P,q]=x(null),L=y(null),H=y(null);c(()=>{if(!$)return;J(!0),r3().then((N)=>{U(N),J(!1)})},[$]),c(()=>{if($)setTimeout(()=>H.current?.focus(),50)},[$]),c(()=>{if(!$)return;let N=(t)=>{let d=L.current,u=g.current;if(d&&!d.contains(t.target)&&u&&!u.contains(t.target))v()};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[$,v]),c(()=>{if(!$)return;let N=(t)=>{if(t.key==="Escape")v()};return document.addEventListener("keydown",N),()=>document.removeEventListener("keydown",N)},[$,v]);let F=Q(async()=>{let N=B.trim();if(!N)return;G(!0);let t=await u3(N);if(G(!1),t.ok&&t.snapshot)U((d)=>[t.snapshot,...d]),k("")},[B]),Y=Q(async(N)=>{q(null),W(N);let t=await y3(N);if(W(null),t.ok)v()},[v]),A=Q(async(N)=>{if((await R3(N)).ok)U((d)=>d.filter((u)=>u.id!==N));q(null)},[]);if(!$)return null;let M=g.current?.getBoundingClientRect(),V=M?Math.max(8,M.left-120):100,f=M?M.bottom+8:48;return O("div",{ref:L,class:"snapshot-panel",style:{left:`${V}px`,top:`${f}px`},children:[O("div",{class:"snapshot-panel-header",children:[O("span",{class:"snapshot-panel-title",children:"Snapshots"},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-panel-close",onClick:v,title:"Close",children:"×"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"snapshot-save-form",children:[O("input",{ref:H,type:"text",class:"snapshot-name-input",value:B,onInput:(N)=>k(N.target.value),onKeyDown:(N)=>{if(N.key==="Enter")F()},placeholder:"Snapshot name...",maxLength:80,disabled:b},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-save-btn",onClick:F,disabled:!B.trim()||b,children:b?"...":"Save"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"snapshot-restore-note",children:"Restoring replaces the current canvas. You can undo it if needed."},void 0,!1,void 0,this),O("div",{class:"snapshot-list",children:[z&&O("div",{class:"snapshot-empty",children:"Loading..."},void 0,!1,void 0,this),!z&&_.length===0&&O("div",{class:"snapshot-empty",children:"No snapshots yet. Save one to capture the current canvas state."},void 0,!1,void 0,this),!z&&_.map((N)=>O("div",{class:"snapshot-item",children:[O("div",{class:"snapshot-item-info",children:[O("span",{class:"snapshot-item-name",children:N.name},void 0,!1,void 0,this),O("span",{class:"snapshot-item-meta",children:[N.nodeCount," node",N.nodeCount!==1?"s":"",N.edgeCount>0?` · ${N.edgeCount} edge${N.edgeCount!==1?"s":""}`:""," · ",_A(N.createdAt)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"snapshot-item-actions",children:P?.id===N.id?O(s$,{children:[O("button",{type:"button",class:`snapshot-action-btn ${P.action==="delete"?"snapshot-action-confirm":"snapshot-action-restore"}`,onClick:()=>P.action==="delete"?A(N.id):Y(N.id),title:P.action==="delete"?"Confirm delete":"Confirm restore",disabled:K!==null,children:P.action==="delete"?"Delete":K===N.id?"Restoring...":"Confirm"},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-action-btn",onClick:()=>q(null),title:"Cancel",disabled:K!==null,children:"Cancel"},void 0,!1,void 0,this)]},void 0,!0,void 0,this):O(s$,{children:[O("button",{type:"button",class:"snapshot-action-btn snapshot-action-restore",onClick:()=>q({id:N.id,action:"restore"}),title:"Restore this snapshot",disabled:K!==null,children:K===N.id?"Restoring...":"Restore"},void 0,!1,void 0,this),O("button",{type:"button",class:"snapshot-action-btn snapshot-action-delete",onClick:()=>q({id:N.id,action:"delete"}),title:"Delete this snapshot",disabled:K!==null,children:"✕"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)},void 0,!1,void 0,this)]},N.id,!0,void 0,this))]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function sB($,v,g,_,U){return $.x<_.position.x+_.size.width+U&&$.x+v+U>_.position.x&&$.y<_.position.y+_.size.height+U&&$.y+g+U>_.position.y}function zA($,v,g,_,U){return _.some((z)=>sB($,v,g,z,U))}function JA($,v,g,_,U){return _.find((z)=>sB($,v,g,z,U))}function l0($,v,g,_=24){if($.length===0)return{x:40,y:80};let U=$[$.length-1],z={x:U.position.x+U.size.width+_,y:U.position.y};if(!zA(z,v,g,$,_))return z;let J=40,b=80,G=3000,K=b;for(let B=0;B<20;B++){let k=J;while(k+v<G){let L=JA({x:k,y:K},v,g,$,_);if(!L)return{x:k,y:K};k=L.position.x+L.size.width+_}K=$.filter((L)=>L.position.y<=K+g+_&&L.position.y+L.size.height+_>K).reduce((L,H)=>Math.max(L,H.position.y+H.size.height),K)+_}let W=$.reduce((B,k)=>Math.max(B,k.position.y+k.size.height),0);return{x:J,y:W+_}}var fg=null,MG=null,SG=0,i6=null,x0=new Map;function Eg($){let v=0;for(let g=0;g<$.length;g++)v=(v<<5)-v+$.charCodeAt(g)|0;return Math.abs(v).toString(36)}function p0($){if(!MG)return $;let v=MG.get($.id);if(!v)return $;return{...$,position:v.position??$.position,size:v.size??$.size,collapsed:v.collapsed??$.collapsed,pinned:v.pinned??$.pinned,dockPosition:v.dockPosition!==void 0?v.dockPosition:$.dockPosition}}var ev={status:{x:40,y:80,w:300,h:120},markdown:{x:380,y:80,w:720,h:600},context:{x:1130,y:80,w:320,h:400},"mcp-app":{x:380,y:720,w:960,h:600},webpage:{x:380,y:80,w:520,h:420},"json-render":{x:380,y:720,w:840,h:620},graph:{x:380,y:720,w:760,h:520},ledger:{x:1130,y:520,w:320,h:280},trace:{x:40,y:900,w:200,h:56},file:{x:380,y:80,w:720,h:600},image:{x:380,y:80,w:720,h:520},html:{x:380,y:80,w:720,h:640},group:{x:220,y:60,w:840,h:560},prompt:{x:380,y:1260,w:520,h:400},response:{x:380,y:1480,w:720,h:400}};function cg($,v,g,_=null){let U=ev[v];return p0({id:$,type:v,position:{x:U.x,y:U.y},size:{width:U.w,height:U.h},zIndex:v==="status"?0:1,collapsed:!1,pinned:!1,dockPosition:_,data:g})}function bA(){return l0([...T.value.values()],ev.markdown.w,ev.markdown.h)}function b4(){if(!T.value.has("status-main"))J6(cg("status-main","status",{phase:"idle",message:"",elapsed:0},"left"))}function OA($,v){let g=`md-${Eg($)}`;if(T.value.get(g))U$(g,{path:$,title:v}),R$.value=g;else{let U=bA(),z=cg(g,"markdown",{path:$,title:v,content:"",rendered:""});if(z.position=U,J6(z),!z.dockPosition)Fv(g)}}function GA($){if(T.value.get("context-main"))U$("context-main",{cards:$});else if($.length>0){let _=cg("context-main","context",{cards:$});J6(_)}}function KA($){let v=$.url,g=`mcp-${Eg(v)}`;if(T.value.get(g))U$(g,$);else J6(cg(g,"mcp-app",$)),Fv(g)}function WA($){let v=$.toolCallId,_=(typeof $.nodeId==="string"&&$.nodeId.length>0?$.nodeId:null)??(v.startsWith("ext-app-")?v:`ext-app-${v}`);if(T.value.get(_)){U$(_,$);return}let{serverName:z,toolName:J}=$;if(z&&J){for(let[H,F]of T.value.entries())if(F.type==="mcp-app"&&F.data.mode==="ext-app"&&F.data.serverName===z&&F.data.toolName===J&&!F.data.toolResult){U$(H,{...$});return}}let{_x:b,_y:G,_width:K,_height:W}=$,B=ev["mcp-app"],k=K??B.w,P=W??B.h,q=b===void 0||G===void 0?l0([...T.value.values()],k,P):null,L=p0({id:_,type:"mcp-app",position:{x:b??q?.x??B.x,y:G??q?.y??B.y},size:{width:k,height:P},zIndex:1,collapsed:!1,pinned:!1,dockPosition:null,data:{mode:"ext-app",...$}});if(J6(L),!L.dockPosition)Fv(_,{recordHistory:!1})}function BA($){let v=$.startsWith("ext-app-")?$:`ext-app-${$}`;if(T.value.has(v))return v;let g=`ext-app-${$}`;if(g!==v&&T.value.has(g))return g;for(let[_,U]of T.value.entries())if(U.type==="mcp-app"&&U.data.mode==="ext-app"&&U.data.toolCallId===$)return _;return null}function $P($){let v=typeof $.nodeId==="string"&&$.nodeId.length>0?$.nodeId:null;if(v&&T.value.has(v))return v;if(typeof $.toolCallId!=="string"||!$.toolCallId)return null;return BA($.toolCallId)}function vP($,v){if(typeof $!=="string"||!$)return null;if(typeof v!=="string"||!v)return null;let g=null;for(let[_,U]of T.value.entries())if(U.type==="mcp-app"&&U.data.mode==="ext-app"&&U.data.serverName===$&&U.data.toolName===v&&!U.data.toolResult){if(g)return null;g=_}return g}function UP($){if(T.value.get("ledger-main"))U$("ledger-main",$);else{let _=cg("ledger-main","ledger",$,"right");_.collapsed=!0,J6(_)}}function gP($){if(!($==="dark"||$==="light"||$==="high-contrast"))return;if(document.documentElement.setAttribute("data-theme",$),kU(),T$.value!==$)T$.value=$}function PA($){return $==="markdown"||$==="mcp-app"||$==="webpage"||$==="json-render"||$==="graph"||$==="prompt"||$==="response"||$==="status"||$==="context"||$==="ledger"||$==="trace"||$==="file"||$==="image"||$==="html"||$==="group"}function kA($){return $==="relation"||$==="depends-on"||$==="flow"||$==="references"}function QG($){if(!$||typeof $!=="object")return null;let v=$;if(typeof v.x!=="number"||typeof v.y!=="number")return null;return{x:v.x,y:v.y}}function _P($){if(!$||typeof $!=="object")return null;let v=$;if(typeof v.width!=="number"||typeof v.height!=="number")return null;return{width:v.width,height:v.height}}function HA($){let v=QG($),g=_P($);return v&&g?{...v,...g}:null}function IA($){if(typeof $.id!=="string"||!$.id)return null;if(!PA($.type))return null;let v=QG($.position),g=_P($.size);if(!v||!g)return null;let _=$.dockPosition==="left"||$.dockPosition==="right"?$.dockPosition:null,U=$.data&&typeof $.data==="object"?Object.fromEntries(Object.entries($.data)):{};return{id:$.id,type:$.type,position:v,size:g,zIndex:typeof $.zIndex==="number"?$.zIndex:1,collapsed:$.collapsed===!0,pinned:$.pinned===!0,dockPosition:_,data:U}}function LA($){if(typeof $.id!=="string"||!$.id)return null;if(typeof $.from!=="string"||!$.from)return null;if(typeof $.to!=="string"||!$.to)return null;if(!kA($.type))return null;return{id:$.id,from:$.from,to:$.to,type:$.type,...typeof $.label==="string"?{label:$.label}:{},...$.style==="solid"||$.style==="dashed"||$.style==="dotted"?{style:$.style}:{},...$.animated===!0?{animated:!0}:{}}}function FA($){if(typeof $.id!=="string"||!$.id)return null;if($.type!=="freehand"&&$.type!=="text")return null;if(!Array.isArray($.points))return null;let v=$.points.map((_)=>QG(_)).filter((_)=>_!==null),g=HA($.bounds);if(v.length<($.type==="text"?1:2)||!g)return null;return{id:$.id,type:$.type,points:v,bounds:g,color:typeof $.color==="string"?$.color:"#f97316",width:typeof $.width==="number"?$.width:4,...typeof $.text==="string"?{text:$.text}:{},...typeof $.label==="string"?{label:$.label}:{},createdAt:typeof $.createdAt==="string"?$.createdAt:""}}function YA($){if(X4.value=$.sessionId||"",o6.value="connected",typeof $.theme==="string")gP($.theme);if($.ledgerSummary)UP($.ledgerSummary)}function qA($){if(typeof $.path!=="string"||!$.path)return;let v=$.path,g=(typeof $.title==="string"?$.title:"")||v.split("/").pop()||"Untitled";if(OA(v,g),$.ledgerSummary)UP($.ledgerSummary)}function XA($){b4(),U$("status-main",{message:typeof $.message==="string"?$.message:String($.message??""),level:$.level??"ok",source:$.source})}function AA($){b4(),U$("status-main",{phase:$.phase,detail:$.detail})}function wA($){let v=$.cards??[];GA(v)}function ZA($){if(typeof $.url==="string"&&$.url)KA({url:$.url,sourceServer:$.sourceServer,sourceTool:$.sourceTool,inferredType:$.inferredType,trustedDomain:$.trustedDomain,hostMode:$.hostMode??"hosted"})}function SA($){let v=$.sessions??[];for(let g of v){let _=g.url;if(!_)continue;let U=`mcp-${Eg(_)}`;if(T.value.has(U))U$(U,{sessionState:g.state,lastSeenAt:g.lastSeenAt})}}function MA($){if(typeof $.url==="string"&&$.url){let v=`mcp-${Eg($.url)}`;if(T.value.has(v))U$(v,{hostMode:"fallback",fallbackReason:$.reasonCode})}}function QA($){let g=T.value.get("context-main");if(!g)return;let _=(g.data.auxTabs??[]).concat($);U$("context-main",{auxTabs:_})}function NA($){if(T.value.has("context-main"))if($.mode==="all")U$("context-main",{auxTabs:[]});else{let _=T.value.get("context-main");if(!_)return;let U=(_.data.auxTabs??[]).filter((z)=>z.id!==$.id);U$("context-main",{auxTabs:U})}}function rA($){b4(),U$("status-main",{phase:"idle",lastCompletion:{tokenCount:$.tokenCount,artifactCount:$.artifactCount}})}function uA($){b4(),U$("status-main",{phase:"tooling",detail:`${$.name}`,activeTool:$.name})}function yA($){b4(),U$("status-main",{activeTool:null})}function RA($){if($.state==="active"&&$.path){let g=`md-${Eg($.path)}`;if(T.value.has(g))U$(g,{reviewActive:!0})}}function DA($){if(typeof $.toolCallId!=="string"||!$.toolCallId)return;WA({toolCallId:$.toolCallId,...typeof $.nodeId==="string"&&$.nodeId.length>0?{nodeId:$.nodeId}:{},title:$.title,html:$.html,toolInput:$.toolInput,serverName:$.serverName,toolName:$.toolName,appSessionId:$.appSessionId,resourceUri:$.resourceUri,toolDefinition:$.toolDefinition,resourceMeta:$.resourceMeta,hostMode:"hosted",trustedDomain:!0,...$.chartConfig?{chartConfig:$.chartConfig}:{},...typeof $.x==="number"&&{_x:$.x},...typeof $.y==="number"&&{_y:$.y},...typeof $.width==="number"&&{_width:$.width},...typeof $.height==="number"&&{_height:$.height}})}function TA($){if(typeof $.toolCallId!=="string"||!$.toolCallId)return;let v=$P($)??vP($.serverName,$.toolName);if(!v)return;if(T.value.has(v))U$(v,{html:$.html})}function jA($){if(typeof $.toolCallId!=="string"||!$.toolCallId)return;let v=$P($)??vP($.serverName,$.toolName);if(!v)return;if(T.value.has(v)){if($.success===!1){w4(v);return}U$(v,{toolResult:gG({result:$.result,success:typeof $.success==="boolean"?$.success:void 0,error:typeof $.error==="string"?$.error:void 0,content:typeof $.content==="string"?$.content:void 0,detailedContent:typeof $.detailedContent==="string"?$.detailedContent:void 0})})}}function VA($){b4(),U$("status-main",{subagent:{state:$.state,name:$.agentDisplayName??$.agentName}})}function CA($){let v=$.nodeId;if(!v)return;let g=$.text||"",_=$.position,U=$.parentNodeId,z=$.contextNodeIds;if($.threadNodeId&&T.value.has($.threadNodeId)){let J=$.threadNodeId,b=T.value.get(J);if(!b)return;let G=Array.isArray(b.data.turns)?[...b.data.turns]:[],K=G[G.length-1];if(!K||K.role!=="user"||K.text!==g)G.push({role:"user",text:g,status:"pending"});U$(J,{turns:G,threadStatus:"pending"});return}if(!T.value.has(v)){let J=_??ev.prompt;J6(p0({id:v,type:"prompt",position:{x:J.x,y:J.y},size:{width:ev.prompt.w,height:400},zIndex:1,collapsed:!1,pinned:!1,dockPosition:null,data:{text:g,turns:g?[{role:"user",text:g,status:"pending"}]:[],threadStatus:g?"pending":"draft",status:g?"pending":"draft",parentNodeId:U,contextNodeIds:z}})),Fv(v)}if(U&&T.value.has(U))A_({id:`edge-${U}-${v}`,from:U,to:v,type:"flow",style:"dashed"})}function fA($){let{nodeId:v,status:g}=$;if(v&&T.value.has(v))U$(v,{status:g})}function EA($){let{responseNodeId:v,promptNodeId:g}=$;if(!v)return;let _=g?T.value.get(g):void 0;if(_&&Array.isArray(_.data.turns)){x0.set(v,g);let z=[..._.data.turns];z.push({role:"assistant",text:"",status:"streaming"}),U$(g,{turns:z,threadStatus:"streaming",_activeResponseId:v}),Fv(g);return}let U=_?{x:_.position.x,y:_.position.y+_.size.height+24}:{x:ev.response.x,y:ev.response.y};if(!T.value.has(v))J6(p0({id:v,type:"response",position:U,size:{width:ev.response.w,height:ev.response.h},zIndex:1,collapsed:!1,pinned:!1,dockPosition:null,data:{content:"",status:"streaming",promptNodeId:g}}));if(g)A_({id:`edge-${g}-${v}`,from:g,to:v,type:"flow",animated:!0});Fv(v)}function cA($){let v=$.responseNodeId;if(!v)return;let g=x0.get(v);if(g){let _=T.value.get(g);if(_&&Array.isArray(_.data.turns)){let U=[..._.data.turns],z=U[U.length-1];if(z&&z.role==="assistant")z.text=$.content,z.status="streaming";U$(g,{turns:U,threadStatus:"streaming"})}return}if(!T.value.has(v))return;U$(v,{content:$.content,status:"streaming"})}function mA($){let v=$.responseNodeId;if(!v)return;let g=x0.get(v);if(g){let z=T.value.get(g);if(z&&Array.isArray(z.data.turns)){let J=[...z.data.turns],b=J[J.length-1];if(b&&b.role==="assistant")b.text=$.content,b.status="complete";U$(g,{turns:J,threadStatus:"answered",_activeResponseId:void 0})}x0.delete(v);return}if(!T.value.has(v))return;U$(v,{content:$.content,status:"complete"});let U=T.value.get(v)?.data.promptNodeId;if(U){let z=`edge-${U}-${v}`,J=m$.value.get(z);if(J)h3(z),A_({...J,animated:!1})}}function iA($){let v=$.layout;if(!v?.nodes)return;let g=!n6.value;n6.value=!0;let _=v.nodes.map(IA).filter((b)=>b!==null),U=Array.isArray(v.edges)?v.edges.map(LA).filter((b)=>b!==null):Array.from(m$.value.values()),z=Array.isArray(v.annotations)?v.annotations.map(FA).filter((b)=>b!==null):void 0,J=v.viewport?{x:typeof v.viewport.x==="number"?v.viewport.x:0,y:typeof v.viewport.y==="number"?v.viewport.y:0,scale:typeof v.viewport.scale==="number"?v.viewport.scale:1}:void 0;M4(),a3({...J?{viewport:J}:{},nodes:_,edges:U,...z?{annotations:z}:{}},{applyViewport:g}),S2({event:"canvas-layout-update",data:$})}function lA($){if($<=1)return 500;if($===2)return 1000;return Math.min(2500,1500+($-3)*500)}function hA($){let v=$.nodeId;if(v&&T.value.has(v)){if($.noPan===!0){w6(v);return}Fv(v)}}function xA($){let v=$.viewport;if(!v)return;let g=typeof v.x==="number"?v.x:0,_=typeof v.y==="number"?v.y:0,U=typeof v.scale==="number"?v.scale:1;M4(),n3({x:g,y:_,scale:U})}function pA($){if(T.value.get("context-main"))U$("context-main",{currentTokens:$.currentTokens,tokenLimit:$.tokenLimit,messagesLength:$.messagesLength,utilization:$.utilization,nearLimit:$.nearLimit})}function oA($){Y_.value=$.enabled===!0}function nA($){if(typeof $.theme==="string")gP($.theme)}function tA($){let v=Array.isArray($.nodeIds)?$.nodeIds.filter((g)=>typeof g==="string"):[];i3(v),S2({event:"context-pins-changed",data:$})}var h0=null;function eB(){if(h0)clearTimeout(h0);h0=setTimeout(()=>{h0=null,S3().then(($)=>{X6.value=$})},150)}function dA($){let v=$.intent;if(!v||typeof v.id!=="string"||typeof v.kind!=="string"||typeof v.expiresAt!=="number")return;hW(v)}function aA($){let v=typeof $.id==="string"?$.id:"";if(!v)return;if($.settled===!0)pW(v,typeof $.nodeId==="string"?$.nodeId:void 0);else PG(v)}var sA={connected:YA,"workbench-open":qA,"canvas-status":XA,"execution-phase":AA,"context-cards":wA,"mcp-app-candidate":ZA,"mcp-app-host-snapshot":SA,"mcp-app-host-fallback":MA,"aux-open":QA,"aux-close":NA,"assistant-complete":rA,"tool-start":uA,"tool-complete":yA,"review-state":RA,"subagent-status":VA,"ext-app-open":DA,"ext-app-update":TA,"ext-app-result":jA,"context-pins-changed":tA,"canvas-layout-update":iA,"canvas-focus-node":hA,"canvas-viewport-update":xA,"context-usage":pA,"trace-state":oA,"theme-changed":nA,"canvas-prompt-created":CA,"canvas-prompt-status":fA,"canvas-response-start":EA,"canvas-response-delta":cA,"canvas-response-complete":mA,"ax-state-changed":eB,"ax-event-created":eB,"ax-intent":dA,"ax-intent-clear":aA};function NG(){if(MG=e3(),b4(),n6.value=!1,kK(),oW(),i6)clearTimeout(i6),i6=null;let $=X4.value,v=$?`/api/workbench/events?session=${$}`:"/api/workbench/events";o6.value="connecting";let g=new EventSource(v);fg=g;for(let[_,U]of Object.entries(sA))g.addEventListener(_,(z)=>{try{U(JSON.parse(z.data))}catch(J){console.warn(`[sse-bridge] Failed to parse "${_}" event:`,J)}});return g.onopen=()=>{if(fg!==g)return;SG=0,o6.value="connected"},g.onerror=()=>{if(fg!==g)return;o6.value="disconnected",g.close(),fg=null,SG+=1,i6=setTimeout(()=>{i6=null,NG()},lA(SG))},()=>{if(i6)clearTimeout(i6),i6=null;g.close(),fg=null}}function eA($,v){console.error(`[app] ${$} failed`,v)}function zP($,v={}){fetch(`/api/workbench/intent?_ts=${Date.now()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:$,payload:v})}).catch((g)=>{eA("sendIntent",g)})}function bv({label:$,detail:v,shortcut:g,align:_="center",children:U}){return O("span",{class:`toolbar-tooltip-anchor toolbar-tooltip-anchor-${_}`,children:[U,O("span",{class:"toolbar-tooltip",role:"tooltip",children:[O("span",{class:"toolbar-tooltip-label",children:$},void 0,!1,void 0,this),(v||g)&&O("span",{class:"toolbar-tooltip-meta",children:[v&&O("span",{children:v},void 0,!1,void 0,this),g&&O("kbd",{class:"toolbar-tooltip-shortcut",children:g},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function $w({minimapVisible:$,onToggleMinimap:v,snapshotOpen:g,onToggleSnapshot:_,snapshotBtnRef:U,onOpenPalette:z,onOpenShortcuts:J,annotationTool:b,onToggleAnnotationMode:G,onToggleAnnotationEraser:K,onToggleTextAnnotation:W}){let B=o6.value,k=n6.value,P=P$.value,q=T.value.size,L=m$.value.size,H=Y_.value,F=Array.from(T.value.values()).filter((V)=>V.type==="trace").length,Y=B==="connected"&&!k?"syncing":B,A=Y.charAt(0).toUpperCase()+Y.slice(1),M=k?[`${q} node${q!==1?"s":""}`,...L>0?[`${L} edge${L!==1?"s":""}`]:[],...F>0?[`${F} trace${F!==1?"s":""}`]:H?["trace armed"]:[]].join(" · "):"Syncing canvas…";return O("div",{class:"toolbar-group",children:[O("div",{class:"canvas-toolbar",children:[O(bv,{label:"PMX Canvas",detail:"Focus Field · spatial workbench for coding agents",align:"start",children:O("span",{class:"canvas-brand","aria-label":"PMX Canvas",children:O(BB,{size:22},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(bv,{label:"Canvas status",detail:k?A:"Syncing canvas from server",align:"start",children:O("span",{class:`connection-dot ${B}`,"aria-label":`Canvas status: ${Y}`},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"hud-collapsible-text",style:{fontSize:"11px",color:"var(--c-muted)"},children:X4.value?X4.value.slice(0,12):"…"},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(bv,{label:"Fit canvas",detail:"Frame every node on screen",children:O("button",{type:"button",onClick:()=>Z_(window.innerWidth,window.innerHeight),"aria-label":"Fit canvas",children:O(dW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:"Reset view",shortcut:`${Mv}+0`,children:O("button",{type:"button",onClick:()=>pv({x:0,y:0,scale:1},250),"aria-label":"Reset view",children:O(aW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:"Zoom in",shortcut:`${Mv}++`,children:O("button",{type:"button",onClick:()=>pv({...P,scale:Math.min(4,P.scale*1.25)},150),"aria-label":"Zoom in",children:O(sW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:"Zoom out",shortcut:`${Mv}+-`,children:O("button",{type:"button",onClick:()=>pv({...P,scale:Math.max(0.1,P.scale/1.25)},150),"aria-label":"Zoom out",children:O(eW,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"hud-collapsible-text",style:{fontSize:"10px",color:"var(--c-dim)",minWidth:"36px",textAlign:"center"},children:[Math.round(P.scale*100),"%"]},void 0,!0,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(bv,{label:"Arrange layout",detail:L>0?"Graph-aware layout for connected nodes":"Grid layout for loose nodes",children:O("button",{type:"button",onClick:()=>L>0?M_():S_(),"aria-label":"Arrange layout",children:O($B,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:$?"Hide minimap":"Show minimap",detail:"Quickly navigate large canvases",children:O("button",{type:"button",onClick:v,"aria-label":$?"Hide minimap":"Show minimap",style:{color:$?"var(--c-accent)":void 0},children:O(vB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:`Switch to ${T$.value==="dark"?"light":"dark"} theme`,detail:`Current theme: ${T$.value}`,children:O("button",{type:"button",onClick:()=>{let V=T$.value==="dark"?"light":"dark";document.documentElement.setAttribute("data-theme",V),kU(),T$.value=V,k_(V)},"aria-label":`Switch to ${T$.value==="dark"?"light":"dark"} theme`,children:T$.value==="dark"?O(UB,{},void 0,!1,void 0,this):O(gB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:"Snapshots",detail:"Capture and restore canvas states",align:"end",children:O("button",{ref:U,type:"button",onClick:_,"aria-label":"Snapshots",style:{color:g?"var(--c-accent)":void 0},children:O(bB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"canvas-toolbar",children:[O(bv,{label:H?"Disable trace":"Enable trace",detail:H?"Stop collecting new trace nodes":"Capture agent execution on the canvas",children:O("button",{type:"button",onClick:()=>zP("trace-toggle",{enabled:!H}),"aria-label":H?"Disable trace":"Enable trace",style:{color:H?"var(--c-purple)":void 0},children:O(OB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),(H||F>0)&&O(bv,{label:"Clear trace",detail:F>0?`Remove ${F} trace node${F===1?"":"s"}`:"Trace is enabled but still empty",children:O("button",{type:"button",onClick:()=>zP("trace-clear"),"aria-label":"Clear trace",children:O(GB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(bv,{label:b==="pen"?"Stop annotating":"Annotate canvas",detail:"Draw directly on the canvas for human-visible markup",children:O("button",{type:"button",onClick:G,"aria-label":b==="pen"?"Stop annotating":"Annotate canvas","aria-pressed":b==="pen",style:{color:b==="pen"?"var(--c-accent)":void 0},children:O(_B,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:b==="eraser"?"Stop erasing":"Erase annotations",detail:"Click a drawn annotation to remove it",children:O("button",{type:"button",onClick:K,"aria-label":b==="eraser"?"Stop erasing":"Erase annotations","aria-pressed":b==="eraser",style:{color:b==="eraser"?"var(--c-accent)":void 0},children:O(zB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:b==="text"?"Stop text annotations":"Text annotations",detail:"Click anywhere to type an intent note",children:O("button",{type:"button",onClick:W,"aria-label":b==="text"?"Stop text annotations":"Text annotations","aria-pressed":b==="text",style:{color:b==="text"?"var(--c-accent)":void 0},children:O(JB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("div",{class:"separator"},void 0,!1,void 0,this),O(bv,{label:"Search nodes and actions",shortcut:`${Mv}+K`,children:O("button",{type:"button",onClick:z,"aria-label":"Search nodes and actions",children:O(KB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O(bv,{label:"Keyboard shortcuts",shortcut:"?",align:"end",children:O("button",{type:"button",onClick:J,"aria-label":"Keyboard shortcuts",children:O(WB,{},void 0,!1,void 0,this)},void 0,!1,void 0,this)},void 0,!1,void 0,this),O("span",{class:"hud-collapsible-text",style:{fontSize:"10px",color:"var(--c-dim)"},children:M},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this)}function vw({onOpenPalette:$}){return O("div",{class:"welcome-card",children:[O("div",{class:"welcome-icon",children:"◇"},void 0,!1,void 0,this),O("div",{class:"welcome-title",children:"Shape What The Agent Sees"},void 0,!1,void 0,this),O("div",{class:"welcome-subtitle",children:"Lay out notes, files, and evidence. Bring related nodes together. Pin what matters. The board will reflect the active focus."},void 0,!1,void 0,this),O("div",{class:"welcome-hints",children:[O("button",{type:"button",class:"welcome-hint",onClick:$,children:[O("kbd",{children:[Mv,"+K"]},void 0,!0,void 0,this),O("span",{children:"Create a note"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-hint",children:[O("kbd",{children:"Drop files"},void 0,!1,void 0,this),O("span",{children:"Add evidence to the board"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-hint",children:[O("kbd",{children:"✦"},void 0,!1,void 0,this),O("span",{children:"Pin important nodes"},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-hint",children:[O("kbd",{children:"Move nearby"},void 0,!1,void 0,this),O("span",{children:"Shape the focus field"},void 0,!1,void 0,this)]},void 0,!0,void 0,this)]},void 0,!0,void 0,this),O("div",{class:"welcome-footer",children:"The canvas is a shared attention surface, not just an editor."},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}function JP(){let[$,v]=x(!0),[g,_]=x(!1),[U,z]=x(!1),[J,b]=x(!1),[G,K]=x(null),W=y(null),{menu:B,openNodeMenu:k,openCanvasMenu:P,closeMenu:q}=fB(),L=n6.value,H=Q(()=>v((u)=>!u),[]),F=Q(()=>_((u)=>!u),[]),Y=Q(()=>_(!1),[]),A=Q(()=>K((u)=>u==="pen"?null:"pen"),[]),M=Q(()=>K((u)=>u==="eraser"?null:"eraser"),[]),V=Q(()=>K((u)=>u==="text"?null:"text"),[]),f=Q((u,r)=>{pv({x:u,y:r,scale:P$.value.scale},200)},[]);c(()=>{return NG()},[]),c(()=>{let u=(r)=>{let g$=r.metaKey||r.ctrlKey;if(g$&&r.key==="k"){r.preventDefault(),z((m)=>!m);return}if(r.key==="Escape"&&G){r.preventDefault(),K(null);return}if(r.key==="Escape"&&V$.value&&!xv.value){r.preventDefault(),t6();return}if(r.key==="Escape"&&U){r.preventDefault(),z(!1);return}if(r.key==="Escape"&&J){r.preventDefault(),b(!1);return}let p=r.target?.tagName;if(p==="INPUT"||p==="TEXTAREA")return;if(r.key==="?"||r.key==="/"&&r.shiftKey){r.preventDefault(),b((m)=>!m);return}if(g$&&r.key==="0")r.preventDefault(),pv({x:0,y:0,scale:1},250);else if(g$&&(r.key==="="||r.key==="+")){r.preventDefault();let m=P$.value;pv({...m,scale:Math.min(4,m.scale*1.25)},150)}else if(g$&&r.key==="-"){r.preventDefault();let m=P$.value;pv({...m,scale:Math.max(0.1,m.scale/1.25)},150)}else if(r.key==="Escape"){if(h$.value.size>0){fv();return}R$.value=null,q()}else if(r.key==="Tab")r.preventDefault(),$K(r.shiftKey?-1:1);else if(R$.value&&["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(r.key)){r.preventDefault();let m=r.key.replace("Arrow","").toLowerCase();vK(m)}};return document.addEventListener("keydown",u),()=>{document.removeEventListener("keydown",u)}},[G,q,U,J]),c(()=>{if(!L)return;let u=window.__pmxCanvasBootstrapReady;if(typeof u==="function")u()},[L]);let N=Array.from(T.value.values()),t=N.filter((u)=>u.dockPosition==="left"),d=N.filter((u)=>u.dockPosition==="right").sort((u,r)=>{let g$={context:0,ledger:1};return(g$[u.type]??2)-(g$[r.type]??2)});return O("div",{style:{width:"100%",height:"100%",position:"relative"},children:[O("div",{class:"hud-layer",children:[O("div",{class:"hud-left",children:t.map((u)=>O(ZG,{node:u},u.id,!1,void 0,this))},void 0,!1,void 0,this),O($w,{minimapVisible:$,onToggleMinimap:H,snapshotOpen:g,onToggleSnapshot:F,snapshotBtnRef:W,onOpenPalette:()=>z(!0),onOpenShortcuts:()=>b((u)=>!u),annotationTool:G,onToggleAnnotationMode:A,onToggleAnnotationEraser:M,onToggleTextAnnotation:V},void 0,!1,void 0,this),O("div",{class:"hud-right",children:d.map((u)=>O(ZG,{node:u},u.id,!1,void 0,this))},void 0,!1,void 0,this)]},void 0,!0,void 0,this),O(gK,{},void 0,!1,void 0,this),O(UK,{},void 0,!1,void 0,this),O(VB,{onNodeContextMenu:k,onCanvasContextMenu:P,annotationMode:G!==null,annotationTool:G},void 0,!1,void 0,this),L&&N.filter((u)=>!u.dockPosition).length===0&&Lv.value.size===0&&O(vw,{onOpenPalette:()=>z(!0)},void 0,!1,void 0,this),h$.value.size>0&&O(tB,{},void 0,!1,void 0,this),D$.value.size>0&&O(mB,{},void 0,!1,void 0,this),V$.value&&O(pB,{},void 0,!1,void 0,this),O(aB,{open:g,onClose:Y,anchorRef:W},void 0,!1,void 0,this),$&&O(nB,{viewport:P$,nodes:T,edges:m$,onNavigate:f,containerWidth:window.innerWidth,containerHeight:window.innerHeight},void 0,!1,void 0,this),B&&O(EB,{menu:B,onClose:q},void 0,!1,void 0,this),U&&O(CB,{onClose:()=>z(!1),onToggleMinimap:H},void 0,!1,void 0,this),J&&O(dB,{onClose:()=>b(!1)},void 0,!1,void 0,this)]},void 0,!0,void 0,this)}var bP=document.getElementById("app");if(bP)pG(O(JP,{},void 0,!1,void 0,this),bP);